index.js 1.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226
  1. "use strict";
  2. var __getOwnPropNames = Object.getOwnPropertyNames;
  3. var __commonJS = (cb, mod) => function __require() {
  4. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  5. };
  6. // node_modules/core-js/internals/global.js
  7. var require_global = __commonJS({
  8. "node_modules/core-js/internals/global.js"(exports2, module2) {
  9. var check = function(it) {
  10. return it && it.Math == Math && it;
  11. };
  12. module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || function() {
  13. return this;
  14. }() || Function("return this")();
  15. }
  16. });
  17. // node_modules/core-js/internals/fails.js
  18. var require_fails = __commonJS({
  19. "node_modules/core-js/internals/fails.js"(exports2, module2) {
  20. module2.exports = function(exec) {
  21. try {
  22. return !!exec();
  23. } catch (error) {
  24. return true;
  25. }
  26. };
  27. }
  28. });
  29. // node_modules/core-js/internals/descriptors.js
  30. var require_descriptors = __commonJS({
  31. "node_modules/core-js/internals/descriptors.js"(exports2, module2) {
  32. var fails = require_fails();
  33. module2.exports = !fails(function() {
  34. return Object.defineProperty({}, 1, { get: function() {
  35. return 7;
  36. } })[1] != 7;
  37. });
  38. }
  39. });
  40. // node_modules/core-js/internals/function-bind-native.js
  41. var require_function_bind_native = __commonJS({
  42. "node_modules/core-js/internals/function-bind-native.js"(exports2, module2) {
  43. var fails = require_fails();
  44. module2.exports = !fails(function() {
  45. var test = function() {
  46. }.bind();
  47. return typeof test != "function" || test.hasOwnProperty("prototype");
  48. });
  49. }
  50. });
  51. // node_modules/core-js/internals/function-call.js
  52. var require_function_call = __commonJS({
  53. "node_modules/core-js/internals/function-call.js"(exports2, module2) {
  54. var NATIVE_BIND = require_function_bind_native();
  55. var call = Function.prototype.call;
  56. module2.exports = NATIVE_BIND ? call.bind(call) : function() {
  57. return call.apply(call, arguments);
  58. };
  59. }
  60. });
  61. // node_modules/core-js/internals/object-property-is-enumerable.js
  62. var require_object_property_is_enumerable = __commonJS({
  63. "node_modules/core-js/internals/object-property-is-enumerable.js"(exports2) {
  64. "use strict";
  65. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  66. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  67. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  68. exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  69. var descriptor = getOwnPropertyDescriptor(this, V);
  70. return !!descriptor && descriptor.enumerable;
  71. } : $propertyIsEnumerable;
  72. }
  73. });
  74. // node_modules/core-js/internals/create-property-descriptor.js
  75. var require_create_property_descriptor = __commonJS({
  76. "node_modules/core-js/internals/create-property-descriptor.js"(exports2, module2) {
  77. module2.exports = function(bitmap, value) {
  78. return {
  79. enumerable: !(bitmap & 1),
  80. configurable: !(bitmap & 2),
  81. writable: !(bitmap & 4),
  82. value
  83. };
  84. };
  85. }
  86. });
  87. // node_modules/core-js/internals/function-uncurry-this.js
  88. var require_function_uncurry_this = __commonJS({
  89. "node_modules/core-js/internals/function-uncurry-this.js"(exports2, module2) {
  90. var NATIVE_BIND = require_function_bind_native();
  91. var FunctionPrototype = Function.prototype;
  92. var bind = FunctionPrototype.bind;
  93. var call = FunctionPrototype.call;
  94. var uncurryThis = NATIVE_BIND && bind.bind(call, call);
  95. module2.exports = NATIVE_BIND ? function(fn) {
  96. return fn && uncurryThis(fn);
  97. } : function(fn) {
  98. return fn && function() {
  99. return call.apply(fn, arguments);
  100. };
  101. };
  102. }
  103. });
  104. // node_modules/core-js/internals/classof-raw.js
  105. var require_classof_raw = __commonJS({
  106. "node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
  107. var uncurryThis = require_function_uncurry_this();
  108. var toString = uncurryThis({}.toString);
  109. var stringSlice = uncurryThis("".slice);
  110. module2.exports = function(it) {
  111. return stringSlice(toString(it), 8, -1);
  112. };
  113. }
  114. });
  115. // node_modules/core-js/internals/indexed-object.js
  116. var require_indexed_object = __commonJS({
  117. "node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
  118. var global2 = require_global();
  119. var uncurryThis = require_function_uncurry_this();
  120. var fails = require_fails();
  121. var classof = require_classof_raw();
  122. var Object2 = global2.Object;
  123. var split = uncurryThis("".split);
  124. module2.exports = fails(function() {
  125. return !Object2("z").propertyIsEnumerable(0);
  126. }) ? function(it) {
  127. return classof(it) == "String" ? split(it, "") : Object2(it);
  128. } : Object2;
  129. }
  130. });
  131. // node_modules/core-js/internals/require-object-coercible.js
  132. var require_require_object_coercible = __commonJS({
  133. "node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
  134. var global2 = require_global();
  135. var TypeError2 = global2.TypeError;
  136. module2.exports = function(it) {
  137. if (it == void 0)
  138. throw TypeError2("Can't call method on " + it);
  139. return it;
  140. };
  141. }
  142. });
  143. // node_modules/core-js/internals/to-indexed-object.js
  144. var require_to_indexed_object = __commonJS({
  145. "node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
  146. var IndexedObject = require_indexed_object();
  147. var requireObjectCoercible = require_require_object_coercible();
  148. module2.exports = function(it) {
  149. return IndexedObject(requireObjectCoercible(it));
  150. };
  151. }
  152. });
  153. // node_modules/core-js/internals/is-callable.js
  154. var require_is_callable = __commonJS({
  155. "node_modules/core-js/internals/is-callable.js"(exports2, module2) {
  156. module2.exports = function(argument) {
  157. return typeof argument == "function";
  158. };
  159. }
  160. });
  161. // node_modules/core-js/internals/is-object.js
  162. var require_is_object = __commonJS({
  163. "node_modules/core-js/internals/is-object.js"(exports2, module2) {
  164. var isCallable = require_is_callable();
  165. module2.exports = function(it) {
  166. return typeof it == "object" ? it !== null : isCallable(it);
  167. };
  168. }
  169. });
  170. // node_modules/core-js/internals/get-built-in.js
  171. var require_get_built_in = __commonJS({
  172. "node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
  173. var global2 = require_global();
  174. var isCallable = require_is_callable();
  175. var aFunction = function(argument) {
  176. return isCallable(argument) ? argument : void 0;
  177. };
  178. module2.exports = function(namespace, method) {
  179. return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
  180. };
  181. }
  182. });
  183. // node_modules/core-js/internals/object-is-prototype-of.js
  184. var require_object_is_prototype_of = __commonJS({
  185. "node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
  186. var uncurryThis = require_function_uncurry_this();
  187. module2.exports = uncurryThis({}.isPrototypeOf);
  188. }
  189. });
  190. // node_modules/core-js/internals/engine-user-agent.js
  191. var require_engine_user_agent = __commonJS({
  192. "node_modules/core-js/internals/engine-user-agent.js"(exports2, module2) {
  193. var getBuiltIn = require_get_built_in();
  194. module2.exports = getBuiltIn("navigator", "userAgent") || "";
  195. }
  196. });
  197. // node_modules/core-js/internals/engine-v8-version.js
  198. var require_engine_v8_version = __commonJS({
  199. "node_modules/core-js/internals/engine-v8-version.js"(exports2, module2) {
  200. var global2 = require_global();
  201. var userAgent = require_engine_user_agent();
  202. var process2 = global2.process;
  203. var Deno = global2.Deno;
  204. var versions = process2 && process2.versions || Deno && Deno.version;
  205. var v8 = versions && versions.v8;
  206. var match;
  207. var version2;
  208. if (v8) {
  209. match = v8.split(".");
  210. version2 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  211. }
  212. if (!version2 && userAgent) {
  213. match = userAgent.match(/Edge\/(\d+)/);
  214. if (!match || match[1] >= 74) {
  215. match = userAgent.match(/Chrome\/(\d+)/);
  216. if (match)
  217. version2 = +match[1];
  218. }
  219. }
  220. module2.exports = version2;
  221. }
  222. });
  223. // node_modules/core-js/internals/native-symbol.js
  224. var require_native_symbol = __commonJS({
  225. "node_modules/core-js/internals/native-symbol.js"(exports2, module2) {
  226. var V8_VERSION = require_engine_v8_version();
  227. var fails = require_fails();
  228. module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
  229. var symbol = Symbol();
  230. return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  231. });
  232. }
  233. });
  234. // node_modules/core-js/internals/use-symbol-as-uid.js
  235. var require_use_symbol_as_uid = __commonJS({
  236. "node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
  237. var NATIVE_SYMBOL = require_native_symbol();
  238. module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
  239. }
  240. });
  241. // node_modules/core-js/internals/is-symbol.js
  242. var require_is_symbol = __commonJS({
  243. "node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
  244. var global2 = require_global();
  245. var getBuiltIn = require_get_built_in();
  246. var isCallable = require_is_callable();
  247. var isPrototypeOf = require_object_is_prototype_of();
  248. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  249. var Object2 = global2.Object;
  250. module2.exports = USE_SYMBOL_AS_UID ? function(it) {
  251. return typeof it == "symbol";
  252. } : function(it) {
  253. var $Symbol = getBuiltIn("Symbol");
  254. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object2(it));
  255. };
  256. }
  257. });
  258. // node_modules/core-js/internals/try-to-string.js
  259. var require_try_to_string = __commonJS({
  260. "node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
  261. var global2 = require_global();
  262. var String2 = global2.String;
  263. module2.exports = function(argument) {
  264. try {
  265. return String2(argument);
  266. } catch (error) {
  267. return "Object";
  268. }
  269. };
  270. }
  271. });
  272. // node_modules/core-js/internals/a-callable.js
  273. var require_a_callable = __commonJS({
  274. "node_modules/core-js/internals/a-callable.js"(exports2, module2) {
  275. var global2 = require_global();
  276. var isCallable = require_is_callable();
  277. var tryToString = require_try_to_string();
  278. var TypeError2 = global2.TypeError;
  279. module2.exports = function(argument) {
  280. if (isCallable(argument))
  281. return argument;
  282. throw TypeError2(tryToString(argument) + " is not a function");
  283. };
  284. }
  285. });
  286. // node_modules/core-js/internals/get-method.js
  287. var require_get_method = __commonJS({
  288. "node_modules/core-js/internals/get-method.js"(exports2, module2) {
  289. var aCallable = require_a_callable();
  290. module2.exports = function(V, P) {
  291. var func = V[P];
  292. return func == null ? void 0 : aCallable(func);
  293. };
  294. }
  295. });
  296. // node_modules/core-js/internals/ordinary-to-primitive.js
  297. var require_ordinary_to_primitive = __commonJS({
  298. "node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
  299. var global2 = require_global();
  300. var call = require_function_call();
  301. var isCallable = require_is_callable();
  302. var isObject = require_is_object();
  303. var TypeError2 = global2.TypeError;
  304. module2.exports = function(input, pref) {
  305. var fn, val;
  306. if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  307. return val;
  308. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
  309. return val;
  310. if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  311. return val;
  312. throw TypeError2("Can't convert object to primitive value");
  313. };
  314. }
  315. });
  316. // node_modules/core-js/internals/is-pure.js
  317. var require_is_pure = __commonJS({
  318. "node_modules/core-js/internals/is-pure.js"(exports2, module2) {
  319. module2.exports = false;
  320. }
  321. });
  322. // node_modules/core-js/internals/set-global.js
  323. var require_set_global = __commonJS({
  324. "node_modules/core-js/internals/set-global.js"(exports2, module2) {
  325. var global2 = require_global();
  326. var defineProperty = Object.defineProperty;
  327. module2.exports = function(key, value) {
  328. try {
  329. defineProperty(global2, key, { value, configurable: true, writable: true });
  330. } catch (error) {
  331. global2[key] = value;
  332. }
  333. return value;
  334. };
  335. }
  336. });
  337. // node_modules/core-js/internals/shared-store.js
  338. var require_shared_store = __commonJS({
  339. "node_modules/core-js/internals/shared-store.js"(exports2, module2) {
  340. var global2 = require_global();
  341. var setGlobal = require_set_global();
  342. var SHARED = "__core-js_shared__";
  343. var store = global2[SHARED] || setGlobal(SHARED, {});
  344. module2.exports = store;
  345. }
  346. });
  347. // node_modules/core-js/internals/shared.js
  348. var require_shared = __commonJS({
  349. "node_modules/core-js/internals/shared.js"(exports2, module2) {
  350. var IS_PURE = require_is_pure();
  351. var store = require_shared_store();
  352. (module2.exports = function(key, value) {
  353. return store[key] || (store[key] = value !== void 0 ? value : {});
  354. })("versions", []).push({
  355. version: "3.21.1",
  356. mode: IS_PURE ? "pure" : "global",
  357. copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
  358. license: "https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",
  359. source: "https://github.com/zloirock/core-js"
  360. });
  361. }
  362. });
  363. // node_modules/core-js/internals/to-object.js
  364. var require_to_object = __commonJS({
  365. "node_modules/core-js/internals/to-object.js"(exports2, module2) {
  366. var global2 = require_global();
  367. var requireObjectCoercible = require_require_object_coercible();
  368. var Object2 = global2.Object;
  369. module2.exports = function(argument) {
  370. return Object2(requireObjectCoercible(argument));
  371. };
  372. }
  373. });
  374. // node_modules/core-js/internals/has-own-property.js
  375. var require_has_own_property = __commonJS({
  376. "node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
  377. var uncurryThis = require_function_uncurry_this();
  378. var toObject = require_to_object();
  379. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  380. module2.exports = Object.hasOwn || function hasOwn(it, key) {
  381. return hasOwnProperty(toObject(it), key);
  382. };
  383. }
  384. });
  385. // node_modules/core-js/internals/uid.js
  386. var require_uid = __commonJS({
  387. "node_modules/core-js/internals/uid.js"(exports2, module2) {
  388. var uncurryThis = require_function_uncurry_this();
  389. var id = 0;
  390. var postfix = Math.random();
  391. var toString = uncurryThis(1 .toString);
  392. module2.exports = function(key) {
  393. return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
  394. };
  395. }
  396. });
  397. // node_modules/core-js/internals/well-known-symbol.js
  398. var require_well_known_symbol = __commonJS({
  399. "node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
  400. var global2 = require_global();
  401. var shared = require_shared();
  402. var hasOwn = require_has_own_property();
  403. var uid = require_uid();
  404. var NATIVE_SYMBOL = require_native_symbol();
  405. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  406. var WellKnownSymbolsStore = shared("wks");
  407. var Symbol2 = global2.Symbol;
  408. var symbolFor = Symbol2 && Symbol2["for"];
  409. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
  410. module2.exports = function(name) {
  411. if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
  412. var description = "Symbol." + name;
  413. if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
  414. WellKnownSymbolsStore[name] = Symbol2[name];
  415. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  416. WellKnownSymbolsStore[name] = symbolFor(description);
  417. } else {
  418. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  419. }
  420. }
  421. return WellKnownSymbolsStore[name];
  422. };
  423. }
  424. });
  425. // node_modules/core-js/internals/to-primitive.js
  426. var require_to_primitive = __commonJS({
  427. "node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
  428. var global2 = require_global();
  429. var call = require_function_call();
  430. var isObject = require_is_object();
  431. var isSymbol = require_is_symbol();
  432. var getMethod = require_get_method();
  433. var ordinaryToPrimitive = require_ordinary_to_primitive();
  434. var wellKnownSymbol = require_well_known_symbol();
  435. var TypeError2 = global2.TypeError;
  436. var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
  437. module2.exports = function(input, pref) {
  438. if (!isObject(input) || isSymbol(input))
  439. return input;
  440. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  441. var result;
  442. if (exoticToPrim) {
  443. if (pref === void 0)
  444. pref = "default";
  445. result = call(exoticToPrim, input, pref);
  446. if (!isObject(result) || isSymbol(result))
  447. return result;
  448. throw TypeError2("Can't convert object to primitive value");
  449. }
  450. if (pref === void 0)
  451. pref = "number";
  452. return ordinaryToPrimitive(input, pref);
  453. };
  454. }
  455. });
  456. // node_modules/core-js/internals/to-property-key.js
  457. var require_to_property_key = __commonJS({
  458. "node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
  459. var toPrimitive = require_to_primitive();
  460. var isSymbol = require_is_symbol();
  461. module2.exports = function(argument) {
  462. var key = toPrimitive(argument, "string");
  463. return isSymbol(key) ? key : key + "";
  464. };
  465. }
  466. });
  467. // node_modules/core-js/internals/document-create-element.js
  468. var require_document_create_element = __commonJS({
  469. "node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
  470. var global2 = require_global();
  471. var isObject = require_is_object();
  472. var document = global2.document;
  473. var EXISTS = isObject(document) && isObject(document.createElement);
  474. module2.exports = function(it) {
  475. return EXISTS ? document.createElement(it) : {};
  476. };
  477. }
  478. });
  479. // node_modules/core-js/internals/ie8-dom-define.js
  480. var require_ie8_dom_define = __commonJS({
  481. "node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
  482. var DESCRIPTORS = require_descriptors();
  483. var fails = require_fails();
  484. var createElement = require_document_create_element();
  485. module2.exports = !DESCRIPTORS && !fails(function() {
  486. return Object.defineProperty(createElement("div"), "a", {
  487. get: function() {
  488. return 7;
  489. }
  490. }).a != 7;
  491. });
  492. }
  493. });
  494. // node_modules/core-js/internals/object-get-own-property-descriptor.js
  495. var require_object_get_own_property_descriptor = __commonJS({
  496. "node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
  497. var DESCRIPTORS = require_descriptors();
  498. var call = require_function_call();
  499. var propertyIsEnumerableModule = require_object_property_is_enumerable();
  500. var createPropertyDescriptor = require_create_property_descriptor();
  501. var toIndexedObject = require_to_indexed_object();
  502. var toPropertyKey = require_to_property_key();
  503. var hasOwn = require_has_own_property();
  504. var IE8_DOM_DEFINE = require_ie8_dom_define();
  505. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  506. exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  507. O = toIndexedObject(O);
  508. P = toPropertyKey(P);
  509. if (IE8_DOM_DEFINE)
  510. try {
  511. return $getOwnPropertyDescriptor(O, P);
  512. } catch (error) {
  513. }
  514. if (hasOwn(O, P))
  515. return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  516. };
  517. }
  518. });
  519. // node_modules/core-js/internals/v8-prototype-define-bug.js
  520. var require_v8_prototype_define_bug = __commonJS({
  521. "node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
  522. var DESCRIPTORS = require_descriptors();
  523. var fails = require_fails();
  524. module2.exports = DESCRIPTORS && fails(function() {
  525. return Object.defineProperty(function() {
  526. }, "prototype", {
  527. value: 42,
  528. writable: false
  529. }).prototype != 42;
  530. });
  531. }
  532. });
  533. // node_modules/core-js/internals/an-object.js
  534. var require_an_object = __commonJS({
  535. "node_modules/core-js/internals/an-object.js"(exports2, module2) {
  536. var global2 = require_global();
  537. var isObject = require_is_object();
  538. var String2 = global2.String;
  539. var TypeError2 = global2.TypeError;
  540. module2.exports = function(argument) {
  541. if (isObject(argument))
  542. return argument;
  543. throw TypeError2(String2(argument) + " is not an object");
  544. };
  545. }
  546. });
  547. // node_modules/core-js/internals/object-define-property.js
  548. var require_object_define_property = __commonJS({
  549. "node_modules/core-js/internals/object-define-property.js"(exports2) {
  550. var global2 = require_global();
  551. var DESCRIPTORS = require_descriptors();
  552. var IE8_DOM_DEFINE = require_ie8_dom_define();
  553. var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
  554. var anObject = require_an_object();
  555. var toPropertyKey = require_to_property_key();
  556. var TypeError2 = global2.TypeError;
  557. var $defineProperty = Object.defineProperty;
  558. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  559. var ENUMERABLE = "enumerable";
  560. var CONFIGURABLE = "configurable";
  561. var WRITABLE = "writable";
  562. exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  563. anObject(O);
  564. P = toPropertyKey(P);
  565. anObject(Attributes);
  566. if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  567. var current = $getOwnPropertyDescriptor(O, P);
  568. if (current && current[WRITABLE]) {
  569. O[P] = Attributes.value;
  570. Attributes = {
  571. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  572. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  573. writable: false
  574. };
  575. }
  576. }
  577. return $defineProperty(O, P, Attributes);
  578. } : $defineProperty : function defineProperty(O, P, Attributes) {
  579. anObject(O);
  580. P = toPropertyKey(P);
  581. anObject(Attributes);
  582. if (IE8_DOM_DEFINE)
  583. try {
  584. return $defineProperty(O, P, Attributes);
  585. } catch (error) {
  586. }
  587. if ("get" in Attributes || "set" in Attributes)
  588. throw TypeError2("Accessors not supported");
  589. if ("value" in Attributes)
  590. O[P] = Attributes.value;
  591. return O;
  592. };
  593. }
  594. });
  595. // node_modules/core-js/internals/create-non-enumerable-property.js
  596. var require_create_non_enumerable_property = __commonJS({
  597. "node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
  598. var DESCRIPTORS = require_descriptors();
  599. var definePropertyModule = require_object_define_property();
  600. var createPropertyDescriptor = require_create_property_descriptor();
  601. module2.exports = DESCRIPTORS ? function(object, key, value) {
  602. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  603. } : function(object, key, value) {
  604. object[key] = value;
  605. return object;
  606. };
  607. }
  608. });
  609. // node_modules/core-js/internals/inspect-source.js
  610. var require_inspect_source = __commonJS({
  611. "node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
  612. var uncurryThis = require_function_uncurry_this();
  613. var isCallable = require_is_callable();
  614. var store = require_shared_store();
  615. var functionToString = uncurryThis(Function.toString);
  616. if (!isCallable(store.inspectSource)) {
  617. store.inspectSource = function(it) {
  618. return functionToString(it);
  619. };
  620. }
  621. module2.exports = store.inspectSource;
  622. }
  623. });
  624. // node_modules/core-js/internals/native-weak-map.js
  625. var require_native_weak_map = __commonJS({
  626. "node_modules/core-js/internals/native-weak-map.js"(exports2, module2) {
  627. var global2 = require_global();
  628. var isCallable = require_is_callable();
  629. var inspectSource = require_inspect_source();
  630. var WeakMap2 = global2.WeakMap;
  631. module2.exports = isCallable(WeakMap2) && /native code/.test(inspectSource(WeakMap2));
  632. }
  633. });
  634. // node_modules/core-js/internals/shared-key.js
  635. var require_shared_key = __commonJS({
  636. "node_modules/core-js/internals/shared-key.js"(exports2, module2) {
  637. var shared = require_shared();
  638. var uid = require_uid();
  639. var keys = shared("keys");
  640. module2.exports = function(key) {
  641. return keys[key] || (keys[key] = uid(key));
  642. };
  643. }
  644. });
  645. // node_modules/core-js/internals/hidden-keys.js
  646. var require_hidden_keys = __commonJS({
  647. "node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
  648. module2.exports = {};
  649. }
  650. });
  651. // node_modules/core-js/internals/internal-state.js
  652. var require_internal_state = __commonJS({
  653. "node_modules/core-js/internals/internal-state.js"(exports2, module2) {
  654. var NATIVE_WEAK_MAP = require_native_weak_map();
  655. var global2 = require_global();
  656. var uncurryThis = require_function_uncurry_this();
  657. var isObject = require_is_object();
  658. var createNonEnumerableProperty = require_create_non_enumerable_property();
  659. var hasOwn = require_has_own_property();
  660. var shared = require_shared_store();
  661. var sharedKey = require_shared_key();
  662. var hiddenKeys = require_hidden_keys();
  663. var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
  664. var TypeError2 = global2.TypeError;
  665. var WeakMap2 = global2.WeakMap;
  666. var set;
  667. var get;
  668. var has;
  669. var enforce = function(it) {
  670. return has(it) ? get(it) : set(it, {});
  671. };
  672. var getterFor = function(TYPE) {
  673. return function(it) {
  674. var state;
  675. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  676. throw TypeError2("Incompatible receiver, " + TYPE + " required");
  677. }
  678. return state;
  679. };
  680. };
  681. if (NATIVE_WEAK_MAP || shared.state) {
  682. store = shared.state || (shared.state = new WeakMap2());
  683. wmget = uncurryThis(store.get);
  684. wmhas = uncurryThis(store.has);
  685. wmset = uncurryThis(store.set);
  686. set = function(it, metadata) {
  687. if (wmhas(store, it))
  688. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  689. metadata.facade = it;
  690. wmset(store, it, metadata);
  691. return metadata;
  692. };
  693. get = function(it) {
  694. return wmget(store, it) || {};
  695. };
  696. has = function(it) {
  697. return wmhas(store, it);
  698. };
  699. } else {
  700. STATE = sharedKey("state");
  701. hiddenKeys[STATE] = true;
  702. set = function(it, metadata) {
  703. if (hasOwn(it, STATE))
  704. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  705. metadata.facade = it;
  706. createNonEnumerableProperty(it, STATE, metadata);
  707. return metadata;
  708. };
  709. get = function(it) {
  710. return hasOwn(it, STATE) ? it[STATE] : {};
  711. };
  712. has = function(it) {
  713. return hasOwn(it, STATE);
  714. };
  715. }
  716. var store;
  717. var wmget;
  718. var wmhas;
  719. var wmset;
  720. var STATE;
  721. module2.exports = {
  722. set,
  723. get,
  724. has,
  725. enforce,
  726. getterFor
  727. };
  728. }
  729. });
  730. // node_modules/core-js/internals/function-name.js
  731. var require_function_name = __commonJS({
  732. "node_modules/core-js/internals/function-name.js"(exports2, module2) {
  733. var DESCRIPTORS = require_descriptors();
  734. var hasOwn = require_has_own_property();
  735. var FunctionPrototype = Function.prototype;
  736. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  737. var EXISTS = hasOwn(FunctionPrototype, "name");
  738. var PROPER = EXISTS && function something() {
  739. }.name === "something";
  740. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
  741. module2.exports = {
  742. EXISTS,
  743. PROPER,
  744. CONFIGURABLE
  745. };
  746. }
  747. });
  748. // node_modules/core-js/internals/redefine.js
  749. var require_redefine = __commonJS({
  750. "node_modules/core-js/internals/redefine.js"(exports2, module2) {
  751. var global2 = require_global();
  752. var isCallable = require_is_callable();
  753. var hasOwn = require_has_own_property();
  754. var createNonEnumerableProperty = require_create_non_enumerable_property();
  755. var setGlobal = require_set_global();
  756. var inspectSource = require_inspect_source();
  757. var InternalStateModule = require_internal_state();
  758. var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
  759. var getInternalState = InternalStateModule.get;
  760. var enforceInternalState = InternalStateModule.enforce;
  761. var TEMPLATE = String(String).split("String");
  762. (module2.exports = function(O, key, value, options) {
  763. var unsafe = options ? !!options.unsafe : false;
  764. var simple = options ? !!options.enumerable : false;
  765. var noTargetGet = options ? !!options.noTargetGet : false;
  766. var name = options && options.name !== void 0 ? options.name : key;
  767. var state;
  768. if (isCallable(value)) {
  769. if (String(name).slice(0, 7) === "Symbol(") {
  770. name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
  771. }
  772. if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  773. createNonEnumerableProperty(value, "name", name);
  774. }
  775. state = enforceInternalState(value);
  776. if (!state.source) {
  777. state.source = TEMPLATE.join(typeof name == "string" ? name : "");
  778. }
  779. }
  780. if (O === global2) {
  781. if (simple)
  782. O[key] = value;
  783. else
  784. setGlobal(key, value);
  785. return;
  786. } else if (!unsafe) {
  787. delete O[key];
  788. } else if (!noTargetGet && O[key]) {
  789. simple = true;
  790. }
  791. if (simple)
  792. O[key] = value;
  793. else
  794. createNonEnumerableProperty(O, key, value);
  795. })(Function.prototype, "toString", function toString() {
  796. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  797. });
  798. }
  799. });
  800. // node_modules/core-js/internals/to-integer-or-infinity.js
  801. var require_to_integer_or_infinity = __commonJS({
  802. "node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
  803. var ceil = Math.ceil;
  804. var floor = Math.floor;
  805. module2.exports = function(argument) {
  806. var number = +argument;
  807. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  808. };
  809. }
  810. });
  811. // node_modules/core-js/internals/to-absolute-index.js
  812. var require_to_absolute_index = __commonJS({
  813. "node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
  814. var toIntegerOrInfinity = require_to_integer_or_infinity();
  815. var max = Math.max;
  816. var min = Math.min;
  817. module2.exports = function(index, length) {
  818. var integer = toIntegerOrInfinity(index);
  819. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  820. };
  821. }
  822. });
  823. // node_modules/core-js/internals/to-length.js
  824. var require_to_length = __commonJS({
  825. "node_modules/core-js/internals/to-length.js"(exports2, module2) {
  826. var toIntegerOrInfinity = require_to_integer_or_infinity();
  827. var min = Math.min;
  828. module2.exports = function(argument) {
  829. return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
  830. };
  831. }
  832. });
  833. // node_modules/core-js/internals/length-of-array-like.js
  834. var require_length_of_array_like = __commonJS({
  835. "node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
  836. var toLength = require_to_length();
  837. module2.exports = function(obj) {
  838. return toLength(obj.length);
  839. };
  840. }
  841. });
  842. // node_modules/core-js/internals/array-includes.js
  843. var require_array_includes = __commonJS({
  844. "node_modules/core-js/internals/array-includes.js"(exports2, module2) {
  845. var toIndexedObject = require_to_indexed_object();
  846. var toAbsoluteIndex = require_to_absolute_index();
  847. var lengthOfArrayLike = require_length_of_array_like();
  848. var createMethod = function(IS_INCLUDES) {
  849. return function($this, el, fromIndex) {
  850. var O = toIndexedObject($this);
  851. var length = lengthOfArrayLike(O);
  852. var index = toAbsoluteIndex(fromIndex, length);
  853. var value;
  854. if (IS_INCLUDES && el != el)
  855. while (length > index) {
  856. value = O[index++];
  857. if (value != value)
  858. return true;
  859. }
  860. else
  861. for (; length > index; index++) {
  862. if ((IS_INCLUDES || index in O) && O[index] === el)
  863. return IS_INCLUDES || index || 0;
  864. }
  865. return !IS_INCLUDES && -1;
  866. };
  867. };
  868. module2.exports = {
  869. includes: createMethod(true),
  870. indexOf: createMethod(false)
  871. };
  872. }
  873. });
  874. // node_modules/core-js/internals/object-keys-internal.js
  875. var require_object_keys_internal = __commonJS({
  876. "node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
  877. var uncurryThis = require_function_uncurry_this();
  878. var hasOwn = require_has_own_property();
  879. var toIndexedObject = require_to_indexed_object();
  880. var indexOf = require_array_includes().indexOf;
  881. var hiddenKeys = require_hidden_keys();
  882. var push = uncurryThis([].push);
  883. module2.exports = function(object, names) {
  884. var O = toIndexedObject(object);
  885. var i = 0;
  886. var result = [];
  887. var key;
  888. for (key in O)
  889. !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  890. while (names.length > i)
  891. if (hasOwn(O, key = names[i++])) {
  892. ~indexOf(result, key) || push(result, key);
  893. }
  894. return result;
  895. };
  896. }
  897. });
  898. // node_modules/core-js/internals/enum-bug-keys.js
  899. var require_enum_bug_keys = __commonJS({
  900. "node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
  901. module2.exports = [
  902. "constructor",
  903. "hasOwnProperty",
  904. "isPrototypeOf",
  905. "propertyIsEnumerable",
  906. "toLocaleString",
  907. "toString",
  908. "valueOf"
  909. ];
  910. }
  911. });
  912. // node_modules/core-js/internals/object-get-own-property-names.js
  913. var require_object_get_own_property_names = __commonJS({
  914. "node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
  915. var internalObjectKeys = require_object_keys_internal();
  916. var enumBugKeys = require_enum_bug_keys();
  917. var hiddenKeys = enumBugKeys.concat("length", "prototype");
  918. exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  919. return internalObjectKeys(O, hiddenKeys);
  920. };
  921. }
  922. });
  923. // node_modules/core-js/internals/object-get-own-property-symbols.js
  924. var require_object_get_own_property_symbols = __commonJS({
  925. "node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
  926. exports2.f = Object.getOwnPropertySymbols;
  927. }
  928. });
  929. // node_modules/core-js/internals/own-keys.js
  930. var require_own_keys = __commonJS({
  931. "node_modules/core-js/internals/own-keys.js"(exports2, module2) {
  932. var getBuiltIn = require_get_built_in();
  933. var uncurryThis = require_function_uncurry_this();
  934. var getOwnPropertyNamesModule = require_object_get_own_property_names();
  935. var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
  936. var anObject = require_an_object();
  937. var concat = uncurryThis([].concat);
  938. module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
  939. var keys = getOwnPropertyNamesModule.f(anObject(it));
  940. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  941. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  942. };
  943. }
  944. });
  945. // node_modules/core-js/internals/copy-constructor-properties.js
  946. var require_copy_constructor_properties = __commonJS({
  947. "node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
  948. var hasOwn = require_has_own_property();
  949. var ownKeys = require_own_keys();
  950. var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
  951. var definePropertyModule = require_object_define_property();
  952. module2.exports = function(target, source, exceptions) {
  953. var keys = ownKeys(source);
  954. var defineProperty = definePropertyModule.f;
  955. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  956. for (var i = 0; i < keys.length; i++) {
  957. var key = keys[i];
  958. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  959. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  960. }
  961. }
  962. };
  963. }
  964. });
  965. // node_modules/core-js/internals/is-forced.js
  966. var require_is_forced = __commonJS({
  967. "node_modules/core-js/internals/is-forced.js"(exports2, module2) {
  968. var fails = require_fails();
  969. var isCallable = require_is_callable();
  970. var replacement = /#|\.prototype\./;
  971. var isForced = function(feature, detection) {
  972. var value = data[normalize(feature)];
  973. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  974. };
  975. var normalize = isForced.normalize = function(string) {
  976. return String(string).replace(replacement, ".").toLowerCase();
  977. };
  978. var data = isForced.data = {};
  979. var NATIVE = isForced.NATIVE = "N";
  980. var POLYFILL = isForced.POLYFILL = "P";
  981. module2.exports = isForced;
  982. }
  983. });
  984. // node_modules/core-js/internals/export.js
  985. var require_export = __commonJS({
  986. "node_modules/core-js/internals/export.js"(exports2, module2) {
  987. var global2 = require_global();
  988. var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
  989. var createNonEnumerableProperty = require_create_non_enumerable_property();
  990. var redefine = require_redefine();
  991. var setGlobal = require_set_global();
  992. var copyConstructorProperties = require_copy_constructor_properties();
  993. var isForced = require_is_forced();
  994. module2.exports = function(options, source) {
  995. var TARGET = options.target;
  996. var GLOBAL = options.global;
  997. var STATIC = options.stat;
  998. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  999. if (GLOBAL) {
  1000. target = global2;
  1001. } else if (STATIC) {
  1002. target = global2[TARGET] || setGlobal(TARGET, {});
  1003. } else {
  1004. target = (global2[TARGET] || {}).prototype;
  1005. }
  1006. if (target)
  1007. for (key in source) {
  1008. sourceProperty = source[key];
  1009. if (options.noTargetGet) {
  1010. descriptor = getOwnPropertyDescriptor(target, key);
  1011. targetProperty = descriptor && descriptor.value;
  1012. } else
  1013. targetProperty = target[key];
  1014. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
  1015. if (!FORCED && targetProperty !== void 0) {
  1016. if (typeof sourceProperty == typeof targetProperty)
  1017. continue;
  1018. copyConstructorProperties(sourceProperty, targetProperty);
  1019. }
  1020. if (options.sham || targetProperty && targetProperty.sham) {
  1021. createNonEnumerableProperty(sourceProperty, "sham", true);
  1022. }
  1023. redefine(target, key, sourceProperty, options);
  1024. }
  1025. };
  1026. }
  1027. });
  1028. // node_modules/core-js/internals/is-array.js
  1029. var require_is_array = __commonJS({
  1030. "node_modules/core-js/internals/is-array.js"(exports2, module2) {
  1031. var classof = require_classof_raw();
  1032. module2.exports = Array.isArray || function isArray(argument) {
  1033. return classof(argument) == "Array";
  1034. };
  1035. }
  1036. });
  1037. // node_modules/core-js/internals/function-bind-context.js
  1038. var require_function_bind_context = __commonJS({
  1039. "node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
  1040. var uncurryThis = require_function_uncurry_this();
  1041. var aCallable = require_a_callable();
  1042. var NATIVE_BIND = require_function_bind_native();
  1043. var bind = uncurryThis(uncurryThis.bind);
  1044. module2.exports = function(fn, that) {
  1045. aCallable(fn);
  1046. return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
  1047. return fn.apply(that, arguments);
  1048. };
  1049. };
  1050. }
  1051. });
  1052. // node_modules/core-js/internals/flatten-into-array.js
  1053. var require_flatten_into_array = __commonJS({
  1054. "node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
  1055. "use strict";
  1056. var global2 = require_global();
  1057. var isArray = require_is_array();
  1058. var lengthOfArrayLike = require_length_of_array_like();
  1059. var bind = require_function_bind_context();
  1060. var TypeError2 = global2.TypeError;
  1061. var flattenIntoArray = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  1062. var targetIndex = start;
  1063. var sourceIndex = 0;
  1064. var mapFn = mapper ? bind(mapper, thisArg) : false;
  1065. var element, elementLen;
  1066. while (sourceIndex < sourceLen) {
  1067. if (sourceIndex in source) {
  1068. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  1069. if (depth > 0 && isArray(element)) {
  1070. elementLen = lengthOfArrayLike(element);
  1071. targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
  1072. } else {
  1073. if (targetIndex >= 9007199254740991)
  1074. throw TypeError2("Exceed the acceptable array length");
  1075. target[targetIndex] = element;
  1076. }
  1077. targetIndex++;
  1078. }
  1079. sourceIndex++;
  1080. }
  1081. return targetIndex;
  1082. };
  1083. module2.exports = flattenIntoArray;
  1084. }
  1085. });
  1086. // node_modules/core-js/internals/to-string-tag-support.js
  1087. var require_to_string_tag_support = __commonJS({
  1088. "node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
  1089. var wellKnownSymbol = require_well_known_symbol();
  1090. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1091. var test = {};
  1092. test[TO_STRING_TAG] = "z";
  1093. module2.exports = String(test) === "[object z]";
  1094. }
  1095. });
  1096. // node_modules/core-js/internals/classof.js
  1097. var require_classof = __commonJS({
  1098. "node_modules/core-js/internals/classof.js"(exports2, module2) {
  1099. var global2 = require_global();
  1100. var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  1101. var isCallable = require_is_callable();
  1102. var classofRaw = require_classof_raw();
  1103. var wellKnownSymbol = require_well_known_symbol();
  1104. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1105. var Object2 = global2.Object;
  1106. var CORRECT_ARGUMENTS = classofRaw(function() {
  1107. return arguments;
  1108. }()) == "Arguments";
  1109. var tryGet = function(it, key) {
  1110. try {
  1111. return it[key];
  1112. } catch (error) {
  1113. }
  1114. };
  1115. module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
  1116. var O, tag, result;
  1117. return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object2(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
  1118. };
  1119. }
  1120. });
  1121. // node_modules/core-js/internals/is-constructor.js
  1122. var require_is_constructor = __commonJS({
  1123. "node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
  1124. var uncurryThis = require_function_uncurry_this();
  1125. var fails = require_fails();
  1126. var isCallable = require_is_callable();
  1127. var classof = require_classof();
  1128. var getBuiltIn = require_get_built_in();
  1129. var inspectSource = require_inspect_source();
  1130. var noop = function() {
  1131. };
  1132. var empty = [];
  1133. var construct = getBuiltIn("Reflect", "construct");
  1134. var constructorRegExp = /^\s*(?:class|function)\b/;
  1135. var exec = uncurryThis(constructorRegExp.exec);
  1136. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  1137. var isConstructorModern = function isConstructor(argument) {
  1138. if (!isCallable(argument))
  1139. return false;
  1140. try {
  1141. construct(noop, empty, argument);
  1142. return true;
  1143. } catch (error) {
  1144. return false;
  1145. }
  1146. };
  1147. var isConstructorLegacy = function isConstructor(argument) {
  1148. if (!isCallable(argument))
  1149. return false;
  1150. switch (classof(argument)) {
  1151. case "AsyncFunction":
  1152. case "GeneratorFunction":
  1153. case "AsyncGeneratorFunction":
  1154. return false;
  1155. }
  1156. try {
  1157. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  1158. } catch (error) {
  1159. return true;
  1160. }
  1161. };
  1162. isConstructorLegacy.sham = true;
  1163. module2.exports = !construct || fails(function() {
  1164. var called;
  1165. return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
  1166. called = true;
  1167. }) || called;
  1168. }) ? isConstructorLegacy : isConstructorModern;
  1169. }
  1170. });
  1171. // node_modules/core-js/internals/array-species-constructor.js
  1172. var require_array_species_constructor = __commonJS({
  1173. "node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
  1174. var global2 = require_global();
  1175. var isArray = require_is_array();
  1176. var isConstructor = require_is_constructor();
  1177. var isObject = require_is_object();
  1178. var wellKnownSymbol = require_well_known_symbol();
  1179. var SPECIES = wellKnownSymbol("species");
  1180. var Array2 = global2.Array;
  1181. module2.exports = function(originalArray) {
  1182. var C;
  1183. if (isArray(originalArray)) {
  1184. C = originalArray.constructor;
  1185. if (isConstructor(C) && (C === Array2 || isArray(C.prototype)))
  1186. C = void 0;
  1187. else if (isObject(C)) {
  1188. C = C[SPECIES];
  1189. if (C === null)
  1190. C = void 0;
  1191. }
  1192. }
  1193. return C === void 0 ? Array2 : C;
  1194. };
  1195. }
  1196. });
  1197. // node_modules/core-js/internals/array-species-create.js
  1198. var require_array_species_create = __commonJS({
  1199. "node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
  1200. var arraySpeciesConstructor = require_array_species_constructor();
  1201. module2.exports = function(originalArray, length) {
  1202. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1203. };
  1204. }
  1205. });
  1206. // node_modules/core-js/modules/es.array.flat-map.js
  1207. var require_es_array_flat_map = __commonJS({
  1208. "node_modules/core-js/modules/es.array.flat-map.js"() {
  1209. "use strict";
  1210. var $ = require_export();
  1211. var flattenIntoArray = require_flatten_into_array();
  1212. var aCallable = require_a_callable();
  1213. var toObject = require_to_object();
  1214. var lengthOfArrayLike = require_length_of_array_like();
  1215. var arraySpeciesCreate = require_array_species_create();
  1216. $({ target: "Array", proto: true }, {
  1217. flatMap: function flatMap(callbackfn) {
  1218. var O = toObject(this);
  1219. var sourceLen = lengthOfArrayLike(O);
  1220. var A;
  1221. aCallable(callbackfn);
  1222. A = arraySpeciesCreate(O, 0);
  1223. A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  1224. return A;
  1225. }
  1226. });
  1227. }
  1228. });
  1229. // node_modules/core-js/internals/iterators.js
  1230. var require_iterators = __commonJS({
  1231. "node_modules/core-js/internals/iterators.js"(exports2, module2) {
  1232. module2.exports = {};
  1233. }
  1234. });
  1235. // node_modules/core-js/internals/is-array-iterator-method.js
  1236. var require_is_array_iterator_method = __commonJS({
  1237. "node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
  1238. var wellKnownSymbol = require_well_known_symbol();
  1239. var Iterators = require_iterators();
  1240. var ITERATOR = wellKnownSymbol("iterator");
  1241. var ArrayPrototype = Array.prototype;
  1242. module2.exports = function(it) {
  1243. return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  1244. };
  1245. }
  1246. });
  1247. // node_modules/core-js/internals/get-iterator-method.js
  1248. var require_get_iterator_method = __commonJS({
  1249. "node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
  1250. var classof = require_classof();
  1251. var getMethod = require_get_method();
  1252. var Iterators = require_iterators();
  1253. var wellKnownSymbol = require_well_known_symbol();
  1254. var ITERATOR = wellKnownSymbol("iterator");
  1255. module2.exports = function(it) {
  1256. if (it != void 0)
  1257. return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
  1258. };
  1259. }
  1260. });
  1261. // node_modules/core-js/internals/get-iterator.js
  1262. var require_get_iterator = __commonJS({
  1263. "node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
  1264. var global2 = require_global();
  1265. var call = require_function_call();
  1266. var aCallable = require_a_callable();
  1267. var anObject = require_an_object();
  1268. var tryToString = require_try_to_string();
  1269. var getIteratorMethod = require_get_iterator_method();
  1270. var TypeError2 = global2.TypeError;
  1271. module2.exports = function(argument, usingIterator) {
  1272. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  1273. if (aCallable(iteratorMethod))
  1274. return anObject(call(iteratorMethod, argument));
  1275. throw TypeError2(tryToString(argument) + " is not iterable");
  1276. };
  1277. }
  1278. });
  1279. // node_modules/core-js/internals/iterator-close.js
  1280. var require_iterator_close = __commonJS({
  1281. "node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
  1282. var call = require_function_call();
  1283. var anObject = require_an_object();
  1284. var getMethod = require_get_method();
  1285. module2.exports = function(iterator, kind, value) {
  1286. var innerResult, innerError;
  1287. anObject(iterator);
  1288. try {
  1289. innerResult = getMethod(iterator, "return");
  1290. if (!innerResult) {
  1291. if (kind === "throw")
  1292. throw value;
  1293. return value;
  1294. }
  1295. innerResult = call(innerResult, iterator);
  1296. } catch (error) {
  1297. innerError = true;
  1298. innerResult = error;
  1299. }
  1300. if (kind === "throw")
  1301. throw value;
  1302. if (innerError)
  1303. throw innerResult;
  1304. anObject(innerResult);
  1305. return value;
  1306. };
  1307. }
  1308. });
  1309. // node_modules/core-js/internals/iterate.js
  1310. var require_iterate = __commonJS({
  1311. "node_modules/core-js/internals/iterate.js"(exports2, module2) {
  1312. var global2 = require_global();
  1313. var bind = require_function_bind_context();
  1314. var call = require_function_call();
  1315. var anObject = require_an_object();
  1316. var tryToString = require_try_to_string();
  1317. var isArrayIteratorMethod = require_is_array_iterator_method();
  1318. var lengthOfArrayLike = require_length_of_array_like();
  1319. var isPrototypeOf = require_object_is_prototype_of();
  1320. var getIterator = require_get_iterator();
  1321. var getIteratorMethod = require_get_iterator_method();
  1322. var iteratorClose = require_iterator_close();
  1323. var TypeError2 = global2.TypeError;
  1324. var Result = function(stopped, result) {
  1325. this.stopped = stopped;
  1326. this.result = result;
  1327. };
  1328. var ResultPrototype = Result.prototype;
  1329. module2.exports = function(iterable, unboundFunction, options) {
  1330. var that = options && options.that;
  1331. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  1332. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  1333. var INTERRUPTED = !!(options && options.INTERRUPTED);
  1334. var fn = bind(unboundFunction, that);
  1335. var iterator, iterFn, index, length, result, next, step;
  1336. var stop = function(condition) {
  1337. if (iterator)
  1338. iteratorClose(iterator, "normal", condition);
  1339. return new Result(true, condition);
  1340. };
  1341. var callFn = function(value) {
  1342. if (AS_ENTRIES) {
  1343. anObject(value);
  1344. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  1345. }
  1346. return INTERRUPTED ? fn(value, stop) : fn(value);
  1347. };
  1348. if (IS_ITERATOR) {
  1349. iterator = iterable;
  1350. } else {
  1351. iterFn = getIteratorMethod(iterable);
  1352. if (!iterFn)
  1353. throw TypeError2(tryToString(iterable) + " is not iterable");
  1354. if (isArrayIteratorMethod(iterFn)) {
  1355. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  1356. result = callFn(iterable[index]);
  1357. if (result && isPrototypeOf(ResultPrototype, result))
  1358. return result;
  1359. }
  1360. return new Result(false);
  1361. }
  1362. iterator = getIterator(iterable, iterFn);
  1363. }
  1364. next = iterator.next;
  1365. while (!(step = call(next, iterator)).done) {
  1366. try {
  1367. result = callFn(step.value);
  1368. } catch (error) {
  1369. iteratorClose(iterator, "throw", error);
  1370. }
  1371. if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
  1372. return result;
  1373. }
  1374. return new Result(false);
  1375. };
  1376. }
  1377. });
  1378. // node_modules/core-js/internals/create-property.js
  1379. var require_create_property = __commonJS({
  1380. "node_modules/core-js/internals/create-property.js"(exports2, module2) {
  1381. "use strict";
  1382. var toPropertyKey = require_to_property_key();
  1383. var definePropertyModule = require_object_define_property();
  1384. var createPropertyDescriptor = require_create_property_descriptor();
  1385. module2.exports = function(object, key, value) {
  1386. var propertyKey = toPropertyKey(key);
  1387. if (propertyKey in object)
  1388. definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  1389. else
  1390. object[propertyKey] = value;
  1391. };
  1392. }
  1393. });
  1394. // node_modules/core-js/modules/es.object.from-entries.js
  1395. var require_es_object_from_entries = __commonJS({
  1396. "node_modules/core-js/modules/es.object.from-entries.js"() {
  1397. var $ = require_export();
  1398. var iterate = require_iterate();
  1399. var createProperty = require_create_property();
  1400. $({ target: "Object", stat: true }, {
  1401. fromEntries: function fromEntries(iterable) {
  1402. var obj = {};
  1403. iterate(iterable, function(k, v) {
  1404. createProperty(obj, k, v);
  1405. }, { AS_ENTRIES: true });
  1406. return obj;
  1407. }
  1408. });
  1409. }
  1410. });
  1411. // node_modules/core-js/modules/es.array.flat.js
  1412. var require_es_array_flat = __commonJS({
  1413. "node_modules/core-js/modules/es.array.flat.js"() {
  1414. "use strict";
  1415. var $ = require_export();
  1416. var flattenIntoArray = require_flatten_into_array();
  1417. var toObject = require_to_object();
  1418. var lengthOfArrayLike = require_length_of_array_like();
  1419. var toIntegerOrInfinity = require_to_integer_or_infinity();
  1420. var arraySpeciesCreate = require_array_species_create();
  1421. $({ target: "Array", proto: true }, {
  1422. flat: function flat() {
  1423. var depthArg = arguments.length ? arguments[0] : void 0;
  1424. var O = toObject(this);
  1425. var sourceLen = lengthOfArrayLike(O);
  1426. var A = arraySpeciesCreate(O, 0);
  1427. A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
  1428. return A;
  1429. }
  1430. });
  1431. }
  1432. });
  1433. // dist/index.js
  1434. var _excluded = ["cliName", "cliCategory", "cliDescription"];
  1435. var _excluded2 = ["_"];
  1436. var _excluded3 = ["overrides"];
  1437. var _excluded4 = ["languageId"];
  1438. function _objectWithoutProperties(source, excluded) {
  1439. if (source == null)
  1440. return {};
  1441. var target = _objectWithoutPropertiesLoose(source, excluded);
  1442. var key, i;
  1443. if (Object.getOwnPropertySymbols) {
  1444. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  1445. for (i = 0; i < sourceSymbolKeys.length; i++) {
  1446. key = sourceSymbolKeys[i];
  1447. if (excluded.indexOf(key) >= 0)
  1448. continue;
  1449. if (!Object.prototype.propertyIsEnumerable.call(source, key))
  1450. continue;
  1451. target[key] = source[key];
  1452. }
  1453. }
  1454. return target;
  1455. }
  1456. function _objectWithoutPropertiesLoose(source, excluded) {
  1457. if (source == null)
  1458. return {};
  1459. var target = {};
  1460. var sourceKeys = Object.keys(source);
  1461. var key, i;
  1462. for (i = 0; i < sourceKeys.length; i++) {
  1463. key = sourceKeys[i];
  1464. if (excluded.indexOf(key) >= 0)
  1465. continue;
  1466. target[key] = source[key];
  1467. }
  1468. return target;
  1469. }
  1470. require_es_array_flat_map();
  1471. require_es_object_from_entries();
  1472. require_es_array_flat();
  1473. var __defProp = Object.defineProperty;
  1474. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1475. var __getOwnPropNames2 = Object.getOwnPropertyNames;
  1476. var __hasOwnProp = Object.prototype.hasOwnProperty;
  1477. var __esm = (fn, res) => function __init() {
  1478. return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
  1479. };
  1480. var __commonJS2 = (cb, mod) => function __require() {
  1481. return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = {
  1482. exports: {}
  1483. }).exports, mod), mod.exports;
  1484. };
  1485. var __export = (target, all) => {
  1486. for (var name in all)
  1487. __defProp(target, name, {
  1488. get: all[name],
  1489. enumerable: true
  1490. });
  1491. };
  1492. var __copyProps = (to, from, except, desc) => {
  1493. if (from && typeof from === "object" || typeof from === "function") {
  1494. for (let key of __getOwnPropNames2(from))
  1495. if (!__hasOwnProp.call(to, key) && key !== except)
  1496. __defProp(to, key, {
  1497. get: () => from[key],
  1498. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  1499. });
  1500. }
  1501. return to;
  1502. };
  1503. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", {
  1504. value: true
  1505. }), mod);
  1506. var require_base = __commonJS2({
  1507. "node_modules/diff/lib/diff/base.js"(exports2) {
  1508. "use strict";
  1509. Object.defineProperty(exports2, "__esModule", {
  1510. value: true
  1511. });
  1512. exports2["default"] = Diff;
  1513. function Diff() {
  1514. }
  1515. Diff.prototype = {
  1516. diff: function diff(oldString, newString) {
  1517. var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  1518. var callback = options.callback;
  1519. if (typeof options === "function") {
  1520. callback = options;
  1521. options = {};
  1522. }
  1523. this.options = options;
  1524. var self2 = this;
  1525. function done(value) {
  1526. if (callback) {
  1527. setTimeout(function() {
  1528. callback(void 0, value);
  1529. }, 0);
  1530. return true;
  1531. } else {
  1532. return value;
  1533. }
  1534. }
  1535. oldString = this.castInput(oldString);
  1536. newString = this.castInput(newString);
  1537. oldString = this.removeEmpty(this.tokenize(oldString));
  1538. newString = this.removeEmpty(this.tokenize(newString));
  1539. var newLen = newString.length, oldLen = oldString.length;
  1540. var editLength = 1;
  1541. var maxEditLength = newLen + oldLen;
  1542. var bestPath = [{
  1543. newPos: -1,
  1544. components: []
  1545. }];
  1546. var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
  1547. if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
  1548. return done([{
  1549. value: this.join(newString),
  1550. count: newString.length
  1551. }]);
  1552. }
  1553. function execEditLength() {
  1554. for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
  1555. var basePath = void 0;
  1556. var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
  1557. if (addPath) {
  1558. bestPath[diagonalPath - 1] = void 0;
  1559. }
  1560. var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
  1561. if (!canAdd && !canRemove) {
  1562. bestPath[diagonalPath] = void 0;
  1563. continue;
  1564. }
  1565. if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
  1566. basePath = clonePath(removePath);
  1567. self2.pushComponent(basePath.components, void 0, true);
  1568. } else {
  1569. basePath = addPath;
  1570. basePath.newPos++;
  1571. self2.pushComponent(basePath.components, true, void 0);
  1572. }
  1573. _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath);
  1574. if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
  1575. return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken));
  1576. } else {
  1577. bestPath[diagonalPath] = basePath;
  1578. }
  1579. }
  1580. editLength++;
  1581. }
  1582. if (callback) {
  1583. (function exec() {
  1584. setTimeout(function() {
  1585. if (editLength > maxEditLength) {
  1586. return callback();
  1587. }
  1588. if (!execEditLength()) {
  1589. exec();
  1590. }
  1591. }, 0);
  1592. })();
  1593. } else {
  1594. while (editLength <= maxEditLength) {
  1595. var ret = execEditLength();
  1596. if (ret) {
  1597. return ret;
  1598. }
  1599. }
  1600. }
  1601. },
  1602. pushComponent: function pushComponent(components, added, removed) {
  1603. var last = components[components.length - 1];
  1604. if (last && last.added === added && last.removed === removed) {
  1605. components[components.length - 1] = {
  1606. count: last.count + 1,
  1607. added,
  1608. removed
  1609. };
  1610. } else {
  1611. components.push({
  1612. count: 1,
  1613. added,
  1614. removed
  1615. });
  1616. }
  1617. },
  1618. extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
  1619. var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
  1620. while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
  1621. newPos++;
  1622. oldPos++;
  1623. commonCount++;
  1624. }
  1625. if (commonCount) {
  1626. basePath.components.push({
  1627. count: commonCount
  1628. });
  1629. }
  1630. basePath.newPos = newPos;
  1631. return oldPos;
  1632. },
  1633. equals: function equals(left, right) {
  1634. if (this.options.comparator) {
  1635. return this.options.comparator(left, right);
  1636. } else {
  1637. return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
  1638. }
  1639. },
  1640. removeEmpty: function removeEmpty(array) {
  1641. var ret = [];
  1642. for (var i = 0; i < array.length; i++) {
  1643. if (array[i]) {
  1644. ret.push(array[i]);
  1645. }
  1646. }
  1647. return ret;
  1648. },
  1649. castInput: function castInput(value) {
  1650. return value;
  1651. },
  1652. tokenize: function tokenize(value) {
  1653. return value.split("");
  1654. },
  1655. join: function join(chars) {
  1656. return chars.join("");
  1657. }
  1658. };
  1659. function buildValues(diff, components, newString, oldString, useLongestToken) {
  1660. var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
  1661. for (; componentPos < componentLen; componentPos++) {
  1662. var component = components[componentPos];
  1663. if (!component.removed) {
  1664. if (!component.added && useLongestToken) {
  1665. var value = newString.slice(newPos, newPos + component.count);
  1666. value = value.map(function(value2, i) {
  1667. var oldValue = oldString[oldPos + i];
  1668. return oldValue.length > value2.length ? oldValue : value2;
  1669. });
  1670. component.value = diff.join(value);
  1671. } else {
  1672. component.value = diff.join(newString.slice(newPos, newPos + component.count));
  1673. }
  1674. newPos += component.count;
  1675. if (!component.added) {
  1676. oldPos += component.count;
  1677. }
  1678. } else {
  1679. component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
  1680. oldPos += component.count;
  1681. if (componentPos && components[componentPos - 1].added) {
  1682. var tmp = components[componentPos - 1];
  1683. components[componentPos - 1] = components[componentPos];
  1684. components[componentPos] = tmp;
  1685. }
  1686. }
  1687. }
  1688. var lastComponent = components[componentLen - 1];
  1689. if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
  1690. components[componentLen - 2].value += lastComponent.value;
  1691. components.pop();
  1692. }
  1693. return components;
  1694. }
  1695. function clonePath(path) {
  1696. return {
  1697. newPos: path.newPos,
  1698. components: path.components.slice(0)
  1699. };
  1700. }
  1701. }
  1702. });
  1703. var require_array = __commonJS2({
  1704. "node_modules/diff/lib/diff/array.js"(exports2) {
  1705. "use strict";
  1706. Object.defineProperty(exports2, "__esModule", {
  1707. value: true
  1708. });
  1709. exports2.diffArrays = diffArrays;
  1710. exports2.arrayDiff = void 0;
  1711. var _base = _interopRequireDefault(require_base());
  1712. function _interopRequireDefault(obj) {
  1713. return obj && obj.__esModule ? obj : {
  1714. "default": obj
  1715. };
  1716. }
  1717. var arrayDiff = new _base["default"]();
  1718. exports2.arrayDiff = arrayDiff;
  1719. arrayDiff.tokenize = function(value) {
  1720. return value.slice();
  1721. };
  1722. arrayDiff.join = arrayDiff.removeEmpty = function(value) {
  1723. return value;
  1724. };
  1725. function diffArrays(oldArr, newArr, callback) {
  1726. return arrayDiff.diff(oldArr, newArr, callback);
  1727. }
  1728. }
  1729. });
  1730. var require_escape_string_regexp = __commonJS2({
  1731. "vendors/escape-string-regexp.js"(exports2, module2) {
  1732. var __defProp2 = Object.defineProperty;
  1733. var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
  1734. var __getOwnPropNames22 = Object.getOwnPropertyNames;
  1735. var __hasOwnProp2 = Object.prototype.hasOwnProperty;
  1736. var __export2 = (target, all) => {
  1737. for (var name in all)
  1738. __defProp2(target, name, {
  1739. get: all[name],
  1740. enumerable: true
  1741. });
  1742. };
  1743. var __copyProps2 = (to, from, except, desc) => {
  1744. if (from && typeof from === "object" || typeof from === "function") {
  1745. for (let key of __getOwnPropNames22(from))
  1746. if (!__hasOwnProp2.call(to, key) && key !== except)
  1747. __defProp2(to, key, {
  1748. get: () => from[key],
  1749. enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
  1750. });
  1751. }
  1752. return to;
  1753. };
  1754. var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", {
  1755. value: true
  1756. }), mod);
  1757. var escape_string_regexp_exports = {};
  1758. __export2(escape_string_regexp_exports, {
  1759. default: () => escapeStringRegexp
  1760. });
  1761. module2.exports = __toCommonJS2(escape_string_regexp_exports);
  1762. function escapeStringRegexp(string) {
  1763. if (typeof string !== "string") {
  1764. throw new TypeError("Expected a string");
  1765. }
  1766. return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  1767. }
  1768. }
  1769. });
  1770. var require_get_last = __commonJS2({
  1771. "src/utils/get-last.js"(exports2, module2) {
  1772. "use strict";
  1773. var getLast = (arr) => arr[arr.length - 1];
  1774. module2.exports = getLast;
  1775. }
  1776. });
  1777. var require_debug = __commonJS2({
  1778. "node_modules/semver/internal/debug.js"(exports2, module2) {
  1779. var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
  1780. };
  1781. module2.exports = debug;
  1782. }
  1783. });
  1784. var require_constants = __commonJS2({
  1785. "node_modules/semver/internal/constants.js"(exports2, module2) {
  1786. var SEMVER_SPEC_VERSION = "2.0.0";
  1787. var MAX_LENGTH = 256;
  1788. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  1789. var MAX_SAFE_COMPONENT_LENGTH = 16;
  1790. module2.exports = {
  1791. SEMVER_SPEC_VERSION,
  1792. MAX_LENGTH,
  1793. MAX_SAFE_INTEGER,
  1794. MAX_SAFE_COMPONENT_LENGTH
  1795. };
  1796. }
  1797. });
  1798. var require_re = __commonJS2({
  1799. "node_modules/semver/internal/re.js"(exports2, module2) {
  1800. var {
  1801. MAX_SAFE_COMPONENT_LENGTH
  1802. } = require_constants();
  1803. var debug = require_debug();
  1804. exports2 = module2.exports = {};
  1805. var re = exports2.re = [];
  1806. var src = exports2.src = [];
  1807. var t = exports2.t = {};
  1808. var R = 0;
  1809. var createToken = (name, value, isGlobal) => {
  1810. const index = R++;
  1811. debug(index, value);
  1812. t[name] = index;
  1813. src[index] = value;
  1814. re[index] = new RegExp(value, isGlobal ? "g" : void 0);
  1815. };
  1816. createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
  1817. createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+");
  1818. createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
  1819. createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
  1820. createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
  1821. createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
  1822. createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
  1823. createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
  1824. createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
  1825. createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
  1826. createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
  1827. createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
  1828. createToken("FULL", `^${src[t.FULLPLAIN]}$`);
  1829. createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
  1830. createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
  1831. createToken("GTLT", "((?:<|>)?=?)");
  1832. createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
  1833. createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
  1834. createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
  1835. createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
  1836. createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
  1837. createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
  1838. createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
  1839. createToken("COERCERTL", src[t.COERCE], true);
  1840. createToken("LONETILDE", "(?:~>?)");
  1841. createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
  1842. exports2.tildeTrimReplace = "$1~";
  1843. createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
  1844. createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
  1845. createToken("LONECARET", "(?:\\^)");
  1846. createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
  1847. exports2.caretTrimReplace = "$1^";
  1848. createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
  1849. createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
  1850. createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
  1851. createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
  1852. createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
  1853. exports2.comparatorTrimReplace = "$1$2$3";
  1854. createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
  1855. createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
  1856. createToken("STAR", "(<|>)?=?\\s*\\*");
  1857. createToken("GTE0", "^\\s*>=\\s*0.0.0\\s*$");
  1858. createToken("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$");
  1859. }
  1860. });
  1861. var require_parse_options = __commonJS2({
  1862. "node_modules/semver/internal/parse-options.js"(exports2, module2) {
  1863. var opts = ["includePrerelease", "loose", "rtl"];
  1864. var parseOptions = (options) => !options ? {} : typeof options !== "object" ? {
  1865. loose: true
  1866. } : opts.filter((k) => options[k]).reduce((options2, k) => {
  1867. options2[k] = true;
  1868. return options2;
  1869. }, {});
  1870. module2.exports = parseOptions;
  1871. }
  1872. });
  1873. var require_identifiers = __commonJS2({
  1874. "node_modules/semver/internal/identifiers.js"(exports2, module2) {
  1875. var numeric = /^[0-9]+$/;
  1876. var compareIdentifiers = (a, b) => {
  1877. const anum = numeric.test(a);
  1878. const bnum = numeric.test(b);
  1879. if (anum && bnum) {
  1880. a = +a;
  1881. b = +b;
  1882. }
  1883. return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
  1884. };
  1885. var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
  1886. module2.exports = {
  1887. compareIdentifiers,
  1888. rcompareIdentifiers
  1889. };
  1890. }
  1891. });
  1892. var require_semver = __commonJS2({
  1893. "node_modules/semver/classes/semver.js"(exports2, module2) {
  1894. var debug = require_debug();
  1895. var {
  1896. MAX_LENGTH,
  1897. MAX_SAFE_INTEGER
  1898. } = require_constants();
  1899. var {
  1900. re,
  1901. t
  1902. } = require_re();
  1903. var parseOptions = require_parse_options();
  1904. var {
  1905. compareIdentifiers
  1906. } = require_identifiers();
  1907. var SemVer = class {
  1908. constructor(version2, options) {
  1909. options = parseOptions(options);
  1910. if (version2 instanceof SemVer) {
  1911. if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
  1912. return version2;
  1913. } else {
  1914. version2 = version2.version;
  1915. }
  1916. } else if (typeof version2 !== "string") {
  1917. throw new TypeError(`Invalid Version: ${version2}`);
  1918. }
  1919. if (version2.length > MAX_LENGTH) {
  1920. throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
  1921. }
  1922. debug("SemVer", version2, options);
  1923. this.options = options;
  1924. this.loose = !!options.loose;
  1925. this.includePrerelease = !!options.includePrerelease;
  1926. const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
  1927. if (!m) {
  1928. throw new TypeError(`Invalid Version: ${version2}`);
  1929. }
  1930. this.raw = version2;
  1931. this.major = +m[1];
  1932. this.minor = +m[2];
  1933. this.patch = +m[3];
  1934. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  1935. throw new TypeError("Invalid major version");
  1936. }
  1937. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  1938. throw new TypeError("Invalid minor version");
  1939. }
  1940. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  1941. throw new TypeError("Invalid patch version");
  1942. }
  1943. if (!m[4]) {
  1944. this.prerelease = [];
  1945. } else {
  1946. this.prerelease = m[4].split(".").map((id) => {
  1947. if (/^[0-9]+$/.test(id)) {
  1948. const num = +id;
  1949. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  1950. return num;
  1951. }
  1952. }
  1953. return id;
  1954. });
  1955. }
  1956. this.build = m[5] ? m[5].split(".") : [];
  1957. this.format();
  1958. }
  1959. format() {
  1960. this.version = `${this.major}.${this.minor}.${this.patch}`;
  1961. if (this.prerelease.length) {
  1962. this.version += `-${this.prerelease.join(".")}`;
  1963. }
  1964. return this.version;
  1965. }
  1966. toString() {
  1967. return this.version;
  1968. }
  1969. compare(other) {
  1970. debug("SemVer.compare", this.version, this.options, other);
  1971. if (!(other instanceof SemVer)) {
  1972. if (typeof other === "string" && other === this.version) {
  1973. return 0;
  1974. }
  1975. other = new SemVer(other, this.options);
  1976. }
  1977. if (other.version === this.version) {
  1978. return 0;
  1979. }
  1980. return this.compareMain(other) || this.comparePre(other);
  1981. }
  1982. compareMain(other) {
  1983. if (!(other instanceof SemVer)) {
  1984. other = new SemVer(other, this.options);
  1985. }
  1986. return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
  1987. }
  1988. comparePre(other) {
  1989. if (!(other instanceof SemVer)) {
  1990. other = new SemVer(other, this.options);
  1991. }
  1992. if (this.prerelease.length && !other.prerelease.length) {
  1993. return -1;
  1994. } else if (!this.prerelease.length && other.prerelease.length) {
  1995. return 1;
  1996. } else if (!this.prerelease.length && !other.prerelease.length) {
  1997. return 0;
  1998. }
  1999. let i = 0;
  2000. do {
  2001. const a = this.prerelease[i];
  2002. const b = other.prerelease[i];
  2003. debug("prerelease compare", i, a, b);
  2004. if (a === void 0 && b === void 0) {
  2005. return 0;
  2006. } else if (b === void 0) {
  2007. return 1;
  2008. } else if (a === void 0) {
  2009. return -1;
  2010. } else if (a === b) {
  2011. continue;
  2012. } else {
  2013. return compareIdentifiers(a, b);
  2014. }
  2015. } while (++i);
  2016. }
  2017. compareBuild(other) {
  2018. if (!(other instanceof SemVer)) {
  2019. other = new SemVer(other, this.options);
  2020. }
  2021. let i = 0;
  2022. do {
  2023. const a = this.build[i];
  2024. const b = other.build[i];
  2025. debug("prerelease compare", i, a, b);
  2026. if (a === void 0 && b === void 0) {
  2027. return 0;
  2028. } else if (b === void 0) {
  2029. return 1;
  2030. } else if (a === void 0) {
  2031. return -1;
  2032. } else if (a === b) {
  2033. continue;
  2034. } else {
  2035. return compareIdentifiers(a, b);
  2036. }
  2037. } while (++i);
  2038. }
  2039. inc(release, identifier) {
  2040. switch (release) {
  2041. case "premajor":
  2042. this.prerelease.length = 0;
  2043. this.patch = 0;
  2044. this.minor = 0;
  2045. this.major++;
  2046. this.inc("pre", identifier);
  2047. break;
  2048. case "preminor":
  2049. this.prerelease.length = 0;
  2050. this.patch = 0;
  2051. this.minor++;
  2052. this.inc("pre", identifier);
  2053. break;
  2054. case "prepatch":
  2055. this.prerelease.length = 0;
  2056. this.inc("patch", identifier);
  2057. this.inc("pre", identifier);
  2058. break;
  2059. case "prerelease":
  2060. if (this.prerelease.length === 0) {
  2061. this.inc("patch", identifier);
  2062. }
  2063. this.inc("pre", identifier);
  2064. break;
  2065. case "major":
  2066. if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
  2067. this.major++;
  2068. }
  2069. this.minor = 0;
  2070. this.patch = 0;
  2071. this.prerelease = [];
  2072. break;
  2073. case "minor":
  2074. if (this.patch !== 0 || this.prerelease.length === 0) {
  2075. this.minor++;
  2076. }
  2077. this.patch = 0;
  2078. this.prerelease = [];
  2079. break;
  2080. case "patch":
  2081. if (this.prerelease.length === 0) {
  2082. this.patch++;
  2083. }
  2084. this.prerelease = [];
  2085. break;
  2086. case "pre":
  2087. if (this.prerelease.length === 0) {
  2088. this.prerelease = [0];
  2089. } else {
  2090. let i = this.prerelease.length;
  2091. while (--i >= 0) {
  2092. if (typeof this.prerelease[i] === "number") {
  2093. this.prerelease[i]++;
  2094. i = -2;
  2095. }
  2096. }
  2097. if (i === -1) {
  2098. this.prerelease.push(0);
  2099. }
  2100. }
  2101. if (identifier) {
  2102. if (this.prerelease[0] === identifier) {
  2103. if (isNaN(this.prerelease[1])) {
  2104. this.prerelease = [identifier, 0];
  2105. }
  2106. } else {
  2107. this.prerelease = [identifier, 0];
  2108. }
  2109. }
  2110. break;
  2111. default:
  2112. throw new Error(`invalid increment argument: ${release}`);
  2113. }
  2114. this.format();
  2115. this.raw = this.version;
  2116. return this;
  2117. }
  2118. };
  2119. module2.exports = SemVer;
  2120. }
  2121. });
  2122. var require_compare = __commonJS2({
  2123. "node_modules/semver/functions/compare.js"(exports2, module2) {
  2124. var SemVer = require_semver();
  2125. var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
  2126. module2.exports = compare;
  2127. }
  2128. });
  2129. var require_lt = __commonJS2({
  2130. "node_modules/semver/functions/lt.js"(exports2, module2) {
  2131. var compare = require_compare();
  2132. var lt = (a, b, loose) => compare(a, b, loose) < 0;
  2133. module2.exports = lt;
  2134. }
  2135. });
  2136. var require_gte = __commonJS2({
  2137. "node_modules/semver/functions/gte.js"(exports2, module2) {
  2138. var compare = require_compare();
  2139. var gte = (a, b, loose) => compare(a, b, loose) >= 0;
  2140. module2.exports = gte;
  2141. }
  2142. });
  2143. var require_arrayify = __commonJS2({
  2144. "src/utils/arrayify.js"(exports2, module2) {
  2145. "use strict";
  2146. module2.exports = (object, keyName) => Object.entries(object).map(([key, value]) => Object.assign({
  2147. [keyName]: key
  2148. }, value));
  2149. }
  2150. });
  2151. var require_lib = __commonJS2({
  2152. "node_modules/outdent/lib/index.js"(exports2, module2) {
  2153. "use strict";
  2154. Object.defineProperty(exports2, "__esModule", {
  2155. value: true
  2156. });
  2157. exports2.outdent = void 0;
  2158. function noop() {
  2159. var args = [];
  2160. for (var _i = 0; _i < arguments.length; _i++) {
  2161. args[_i] = arguments[_i];
  2162. }
  2163. }
  2164. function createWeakMap() {
  2165. if (typeof WeakMap !== "undefined") {
  2166. return /* @__PURE__ */ new WeakMap();
  2167. } else {
  2168. return fakeSetOrMap();
  2169. }
  2170. }
  2171. function fakeSetOrMap() {
  2172. return {
  2173. add: noop,
  2174. delete: noop,
  2175. get: noop,
  2176. set: noop,
  2177. has: function(k) {
  2178. return false;
  2179. }
  2180. };
  2181. }
  2182. var hop = Object.prototype.hasOwnProperty;
  2183. var has = function(obj, prop) {
  2184. return hop.call(obj, prop);
  2185. };
  2186. function extend(target, source) {
  2187. for (var prop in source) {
  2188. if (has(source, prop)) {
  2189. target[prop] = source[prop];
  2190. }
  2191. }
  2192. return target;
  2193. }
  2194. var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
  2195. var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
  2196. var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
  2197. var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
  2198. var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
  2199. function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
  2200. var indentationLevel = 0;
  2201. var match = strings[0].match(reDetectIndentation);
  2202. if (match) {
  2203. indentationLevel = match[1].length;
  2204. }
  2205. var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
  2206. var reMatchIndent = new RegExp(reSource, "g");
  2207. if (firstInterpolatedValueSetsIndentationLevel) {
  2208. strings = strings.slice(1);
  2209. }
  2210. var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
  2211. var normalizeNewlines = typeof newline === "string";
  2212. var l = strings.length;
  2213. var outdentedStrings = strings.map(function(v, i) {
  2214. v = v.replace(reMatchIndent, "$1");
  2215. if (i === 0 && trimLeadingNewline) {
  2216. v = v.replace(reLeadingNewline, "");
  2217. }
  2218. if (i === l - 1 && trimTrailingNewline) {
  2219. v = v.replace(reTrailingNewline, "");
  2220. }
  2221. if (normalizeNewlines) {
  2222. v = v.replace(/\r\n|\n|\r/g, function(_) {
  2223. return newline;
  2224. });
  2225. }
  2226. return v;
  2227. });
  2228. return outdentedStrings;
  2229. }
  2230. function concatStringsAndValues(strings, values) {
  2231. var ret = "";
  2232. for (var i = 0, l = strings.length; i < l; i++) {
  2233. ret += strings[i];
  2234. if (i < l - 1) {
  2235. ret += values[i];
  2236. }
  2237. }
  2238. return ret;
  2239. }
  2240. function isTemplateStringsArray(v) {
  2241. return has(v, "raw") && has(v, "length");
  2242. }
  2243. function createInstance(options) {
  2244. var arrayAutoIndentCache = createWeakMap();
  2245. var arrayFirstInterpSetsIndentCache = createWeakMap();
  2246. function outdent(stringsOrOptions) {
  2247. var values = [];
  2248. for (var _i = 1; _i < arguments.length; _i++) {
  2249. values[_i - 1] = arguments[_i];
  2250. }
  2251. if (isTemplateStringsArray(stringsOrOptions)) {
  2252. var strings = stringsOrOptions;
  2253. var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
  2254. var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
  2255. var renderedArray = cache.get(strings);
  2256. if (!renderedArray) {
  2257. renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
  2258. cache.set(strings, renderedArray);
  2259. }
  2260. if (values.length === 0) {
  2261. return renderedArray[0];
  2262. }
  2263. var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
  2264. return rendered;
  2265. } else {
  2266. return createInstance(extend(extend({}, options), stringsOrOptions || {}));
  2267. }
  2268. }
  2269. var fullOutdent = extend(outdent, {
  2270. string: function(str) {
  2271. return _outdentArray([str], false, options)[0];
  2272. }
  2273. });
  2274. return fullOutdent;
  2275. }
  2276. var defaultOutdent = createInstance({
  2277. trimLeadingNewline: true,
  2278. trimTrailingNewline: true
  2279. });
  2280. exports2.outdent = defaultOutdent;
  2281. exports2.default = defaultOutdent;
  2282. if (typeof module2 !== "undefined") {
  2283. try {
  2284. module2.exports = defaultOutdent;
  2285. Object.defineProperty(defaultOutdent, "__esModule", {
  2286. value: true
  2287. });
  2288. defaultOutdent.default = defaultOutdent;
  2289. defaultOutdent.outdent = defaultOutdent;
  2290. } catch (e) {
  2291. }
  2292. }
  2293. }
  2294. });
  2295. var require_core_options = __commonJS2({
  2296. "src/main/core-options.js"(exports2, module2) {
  2297. "use strict";
  2298. var {
  2299. outdent
  2300. } = require_lib();
  2301. var CATEGORY_CONFIG = "Config";
  2302. var CATEGORY_EDITOR = "Editor";
  2303. var CATEGORY_FORMAT = "Format";
  2304. var CATEGORY_OTHER = "Other";
  2305. var CATEGORY_OUTPUT = "Output";
  2306. var CATEGORY_GLOBAL = "Global";
  2307. var CATEGORY_SPECIAL = "Special";
  2308. var options = {
  2309. cursorOffset: {
  2310. since: "1.4.0",
  2311. category: CATEGORY_SPECIAL,
  2312. type: "int",
  2313. default: -1,
  2314. range: {
  2315. start: -1,
  2316. end: Number.POSITIVE_INFINITY,
  2317. step: 1
  2318. },
  2319. description: outdent`
  2320. Print (to stderr) where a cursor at the given position would move to after formatting.
  2321. This option cannot be used with --range-start and --range-end.
  2322. `,
  2323. cliCategory: CATEGORY_EDITOR
  2324. },
  2325. endOfLine: {
  2326. since: "1.15.0",
  2327. category: CATEGORY_GLOBAL,
  2328. type: "choice",
  2329. default: [{
  2330. since: "1.15.0",
  2331. value: "auto"
  2332. }, {
  2333. since: "2.0.0",
  2334. value: "lf"
  2335. }],
  2336. description: "Which end of line characters to apply.",
  2337. choices: [{
  2338. value: "lf",
  2339. description: "Line Feed only (\\n), common on Linux and macOS as well as inside git repos"
  2340. }, {
  2341. value: "crlf",
  2342. description: "Carriage Return + Line Feed characters (\\r\\n), common on Windows"
  2343. }, {
  2344. value: "cr",
  2345. description: "Carriage Return character only (\\r), used very rarely"
  2346. }, {
  2347. value: "auto",
  2348. description: outdent`
  2349. Maintain existing
  2350. (mixed values within one file are normalised by looking at what's used after the first line)
  2351. `
  2352. }]
  2353. },
  2354. filepath: {
  2355. since: "1.4.0",
  2356. category: CATEGORY_SPECIAL,
  2357. type: "path",
  2358. description: "Specify the input filepath. This will be used to do parser inference.",
  2359. cliName: "stdin-filepath",
  2360. cliCategory: CATEGORY_OTHER,
  2361. cliDescription: "Path to the file to pretend that stdin comes from."
  2362. },
  2363. insertPragma: {
  2364. since: "1.8.0",
  2365. category: CATEGORY_SPECIAL,
  2366. type: "boolean",
  2367. default: false,
  2368. description: "Insert @format pragma into file's first docblock comment.",
  2369. cliCategory: CATEGORY_OTHER
  2370. },
  2371. parser: {
  2372. since: "0.0.10",
  2373. category: CATEGORY_GLOBAL,
  2374. type: "choice",
  2375. default: [{
  2376. since: "0.0.10",
  2377. value: "babylon"
  2378. }, {
  2379. since: "1.13.0",
  2380. value: void 0
  2381. }],
  2382. description: "Which parser to use.",
  2383. exception: (value) => typeof value === "string" || typeof value === "function",
  2384. choices: [{
  2385. value: "flow",
  2386. description: "Flow"
  2387. }, {
  2388. value: "babel",
  2389. since: "1.16.0",
  2390. description: "JavaScript"
  2391. }, {
  2392. value: "babel-flow",
  2393. since: "1.16.0",
  2394. description: "Flow"
  2395. }, {
  2396. value: "babel-ts",
  2397. since: "2.0.0",
  2398. description: "TypeScript"
  2399. }, {
  2400. value: "typescript",
  2401. since: "1.4.0",
  2402. description: "TypeScript"
  2403. }, {
  2404. value: "acorn",
  2405. since: "2.6.0",
  2406. description: "JavaScript"
  2407. }, {
  2408. value: "espree",
  2409. since: "2.2.0",
  2410. description: "JavaScript"
  2411. }, {
  2412. value: "meriyah",
  2413. since: "2.2.0",
  2414. description: "JavaScript"
  2415. }, {
  2416. value: "css",
  2417. since: "1.7.1",
  2418. description: "CSS"
  2419. }, {
  2420. value: "less",
  2421. since: "1.7.1",
  2422. description: "Less"
  2423. }, {
  2424. value: "scss",
  2425. since: "1.7.1",
  2426. description: "SCSS"
  2427. }, {
  2428. value: "json",
  2429. since: "1.5.0",
  2430. description: "JSON"
  2431. }, {
  2432. value: "json5",
  2433. since: "1.13.0",
  2434. description: "JSON5"
  2435. }, {
  2436. value: "json-stringify",
  2437. since: "1.13.0",
  2438. description: "JSON.stringify"
  2439. }, {
  2440. value: "graphql",
  2441. since: "1.5.0",
  2442. description: "GraphQL"
  2443. }, {
  2444. value: "markdown",
  2445. since: "1.8.0",
  2446. description: "Markdown"
  2447. }, {
  2448. value: "mdx",
  2449. since: "1.15.0",
  2450. description: "MDX"
  2451. }, {
  2452. value: "vue",
  2453. since: "1.10.0",
  2454. description: "Vue"
  2455. }, {
  2456. value: "yaml",
  2457. since: "1.14.0",
  2458. description: "YAML"
  2459. }, {
  2460. value: "glimmer",
  2461. since: "2.3.0",
  2462. description: "Ember / Handlebars"
  2463. }, {
  2464. value: "html",
  2465. since: "1.15.0",
  2466. description: "HTML"
  2467. }, {
  2468. value: "angular",
  2469. since: "1.15.0",
  2470. description: "Angular"
  2471. }, {
  2472. value: "lwc",
  2473. since: "1.17.0",
  2474. description: "Lightning Web Components"
  2475. }]
  2476. },
  2477. plugins: {
  2478. since: "1.10.0",
  2479. type: "path",
  2480. array: true,
  2481. default: [{
  2482. value: []
  2483. }],
  2484. category: CATEGORY_GLOBAL,
  2485. description: "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
  2486. exception: (value) => typeof value === "string" || typeof value === "object",
  2487. cliName: "plugin",
  2488. cliCategory: CATEGORY_CONFIG
  2489. },
  2490. pluginSearchDirs: {
  2491. since: "1.13.0",
  2492. type: "path",
  2493. array: true,
  2494. default: [{
  2495. value: []
  2496. }],
  2497. category: CATEGORY_GLOBAL,
  2498. description: outdent`
  2499. Custom directory that contains prettier plugins in node_modules subdirectory.
  2500. Overrides default behavior when plugins are searched relatively to the location of Prettier.
  2501. Multiple values are accepted.
  2502. `,
  2503. exception: (value) => typeof value === "string" || typeof value === "object",
  2504. cliName: "plugin-search-dir",
  2505. cliCategory: CATEGORY_CONFIG
  2506. },
  2507. printWidth: {
  2508. since: "0.0.0",
  2509. category: CATEGORY_GLOBAL,
  2510. type: "int",
  2511. default: 80,
  2512. description: "The line length where Prettier will try wrap.",
  2513. range: {
  2514. start: 0,
  2515. end: Number.POSITIVE_INFINITY,
  2516. step: 1
  2517. }
  2518. },
  2519. rangeEnd: {
  2520. since: "1.4.0",
  2521. category: CATEGORY_SPECIAL,
  2522. type: "int",
  2523. default: Number.POSITIVE_INFINITY,
  2524. range: {
  2525. start: 0,
  2526. end: Number.POSITIVE_INFINITY,
  2527. step: 1
  2528. },
  2529. description: outdent`
  2530. Format code ending at a given character offset (exclusive).
  2531. The range will extend forwards to the end of the selected statement.
  2532. This option cannot be used with --cursor-offset.
  2533. `,
  2534. cliCategory: CATEGORY_EDITOR
  2535. },
  2536. rangeStart: {
  2537. since: "1.4.0",
  2538. category: CATEGORY_SPECIAL,
  2539. type: "int",
  2540. default: 0,
  2541. range: {
  2542. start: 0,
  2543. end: Number.POSITIVE_INFINITY,
  2544. step: 1
  2545. },
  2546. description: outdent`
  2547. Format code starting at a given character offset.
  2548. The range will extend backwards to the start of the first line containing the selected statement.
  2549. This option cannot be used with --cursor-offset.
  2550. `,
  2551. cliCategory: CATEGORY_EDITOR
  2552. },
  2553. requirePragma: {
  2554. since: "1.7.0",
  2555. category: CATEGORY_SPECIAL,
  2556. type: "boolean",
  2557. default: false,
  2558. description: outdent`
  2559. Require either '@prettier' or '@format' to be present in the file's first docblock comment
  2560. in order for it to be formatted.
  2561. `,
  2562. cliCategory: CATEGORY_OTHER
  2563. },
  2564. tabWidth: {
  2565. type: "int",
  2566. category: CATEGORY_GLOBAL,
  2567. default: 2,
  2568. description: "Number of spaces per indentation level.",
  2569. range: {
  2570. start: 0,
  2571. end: Number.POSITIVE_INFINITY,
  2572. step: 1
  2573. }
  2574. },
  2575. useTabs: {
  2576. since: "1.0.0",
  2577. category: CATEGORY_GLOBAL,
  2578. type: "boolean",
  2579. default: false,
  2580. description: "Indent with tabs instead of spaces."
  2581. },
  2582. embeddedLanguageFormatting: {
  2583. since: "2.1.0",
  2584. category: CATEGORY_GLOBAL,
  2585. type: "choice",
  2586. default: [{
  2587. since: "2.1.0",
  2588. value: "auto"
  2589. }],
  2590. description: "Control how Prettier formats quoted code embedded in the file.",
  2591. choices: [{
  2592. value: "auto",
  2593. description: "Format embedded code if Prettier can automatically identify it."
  2594. }, {
  2595. value: "off",
  2596. description: "Never automatically format embedded code."
  2597. }]
  2598. }
  2599. };
  2600. module2.exports = {
  2601. CATEGORY_CONFIG,
  2602. CATEGORY_EDITOR,
  2603. CATEGORY_FORMAT,
  2604. CATEGORY_OTHER,
  2605. CATEGORY_OUTPUT,
  2606. CATEGORY_GLOBAL,
  2607. CATEGORY_SPECIAL,
  2608. options
  2609. };
  2610. }
  2611. });
  2612. var require_support = __commonJS2({
  2613. "src/main/support.js"(exports2, module2) {
  2614. "use strict";
  2615. var semver = {
  2616. compare: require_compare(),
  2617. lt: require_lt(),
  2618. gte: require_gte()
  2619. };
  2620. var arrayify = require_arrayify();
  2621. var currentVersion = require("./package.json").version;
  2622. var coreOptions = require_core_options().options;
  2623. function getSupportInfo2({
  2624. plugins: plugins2 = [],
  2625. showUnreleased = false,
  2626. showDeprecated = false,
  2627. showInternal = false
  2628. } = {}) {
  2629. const version2 = currentVersion.split("-", 1)[0];
  2630. const languages = plugins2.flatMap((plugin) => plugin.languages || []).filter(filterSince);
  2631. const options = arrayify(Object.assign({}, ...plugins2.map(({
  2632. options: options2
  2633. }) => options2), coreOptions), "name").filter((option) => filterSince(option) && filterDeprecated(option)).sort((a, b) => a.name === b.name ? 0 : a.name < b.name ? -1 : 1).map(mapInternal).map((option) => {
  2634. option = Object.assign({}, option);
  2635. if (Array.isArray(option.default)) {
  2636. option.default = option.default.length === 1 ? option.default[0].value : option.default.filter(filterSince).sort((info1, info2) => semver.compare(info2.since, info1.since))[0].value;
  2637. }
  2638. if (Array.isArray(option.choices)) {
  2639. option.choices = option.choices.filter((option2) => filterSince(option2) && filterDeprecated(option2));
  2640. if (option.name === "parser") {
  2641. collectParsersFromLanguages(option, languages, plugins2);
  2642. }
  2643. }
  2644. const pluginDefaults = Object.fromEntries(plugins2.filter((plugin) => plugin.defaultOptions && plugin.defaultOptions[option.name] !== void 0).map((plugin) => [plugin.name, plugin.defaultOptions[option.name]]));
  2645. return Object.assign(Object.assign({}, option), {}, {
  2646. pluginDefaults
  2647. });
  2648. });
  2649. return {
  2650. languages,
  2651. options
  2652. };
  2653. function filterSince(object) {
  2654. return showUnreleased || !("since" in object) || object.since && semver.gte(version2, object.since);
  2655. }
  2656. function filterDeprecated(object) {
  2657. return showDeprecated || !("deprecated" in object) || object.deprecated && semver.lt(version2, object.deprecated);
  2658. }
  2659. function mapInternal(object) {
  2660. if (showInternal) {
  2661. return object;
  2662. }
  2663. const {
  2664. cliName,
  2665. cliCategory,
  2666. cliDescription
  2667. } = object, newObject = _objectWithoutProperties(object, _excluded);
  2668. return newObject;
  2669. }
  2670. }
  2671. function collectParsersFromLanguages(option, languages, plugins2) {
  2672. const existingValues = new Set(option.choices.map((choice) => choice.value));
  2673. for (const language of languages) {
  2674. if (language.parsers) {
  2675. for (const value of language.parsers) {
  2676. if (!existingValues.has(value)) {
  2677. existingValues.add(value);
  2678. const plugin = plugins2.find((plugin2) => plugin2.parsers && plugin2.parsers[value]);
  2679. let description = language.name;
  2680. if (plugin && plugin.name) {
  2681. description += ` (plugin: ${plugin.name})`;
  2682. }
  2683. option.choices.push({
  2684. value,
  2685. description
  2686. });
  2687. }
  2688. }
  2689. }
  2690. }
  2691. }
  2692. module2.exports = {
  2693. getSupportInfo: getSupportInfo2
  2694. };
  2695. }
  2696. });
  2697. var require_is_non_empty_array = __commonJS2({
  2698. "src/utils/is-non-empty-array.js"(exports2, module2) {
  2699. "use strict";
  2700. function isNonEmptyArray(object) {
  2701. return Array.isArray(object) && object.length > 0;
  2702. }
  2703. module2.exports = isNonEmptyArray;
  2704. }
  2705. });
  2706. var require_string_width = __commonJS2({
  2707. "vendors/string-width.js"(exports2, module2) {
  2708. var __create = Object.create;
  2709. var __defProp2 = Object.defineProperty;
  2710. var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
  2711. var __getOwnPropNames22 = Object.getOwnPropertyNames;
  2712. var __getProtoOf = Object.getPrototypeOf;
  2713. var __hasOwnProp2 = Object.prototype.hasOwnProperty;
  2714. var __commonJS22 = (cb, mod) => function __require() {
  2715. return mod || (0, cb[__getOwnPropNames22(cb)[0]])((mod = {
  2716. exports: {}
  2717. }).exports, mod), mod.exports;
  2718. };
  2719. var __export2 = (target, all) => {
  2720. for (var name in all)
  2721. __defProp2(target, name, {
  2722. get: all[name],
  2723. enumerable: true
  2724. });
  2725. };
  2726. var __copyProps2 = (to, from, except, desc) => {
  2727. if (from && typeof from === "object" || typeof from === "function") {
  2728. for (let key of __getOwnPropNames22(from))
  2729. if (!__hasOwnProp2.call(to, key) && key !== except)
  2730. __defProp2(to, key, {
  2731. get: () => from[key],
  2732. enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
  2733. });
  2734. }
  2735. return to;
  2736. };
  2737. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
  2738. value: mod,
  2739. enumerable: true
  2740. }) : target, mod));
  2741. var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", {
  2742. value: true
  2743. }), mod);
  2744. var require_emoji_regex = __commonJS22({
  2745. "node_modules/emoji-regex/index.js"(exports3, module22) {
  2746. "use strict";
  2747. module22.exports = function() {
  2748. return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
  2749. };
  2750. }
  2751. });
  2752. var string_width_exports = {};
  2753. __export2(string_width_exports, {
  2754. default: () => stringWidth
  2755. });
  2756. module2.exports = __toCommonJS2(string_width_exports);
  2757. function ansiRegex({
  2758. onlyFirst = false
  2759. } = {}) {
  2760. const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
  2761. return new RegExp(pattern, onlyFirst ? void 0 : "g");
  2762. }
  2763. function stripAnsi(string) {
  2764. if (typeof string !== "string") {
  2765. throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
  2766. }
  2767. return string.replace(ansiRegex(), "");
  2768. }
  2769. function isFullwidthCodePoint(codePoint) {
  2770. if (!Number.isInteger(codePoint)) {
  2771. return false;
  2772. }
  2773. return codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141);
  2774. }
  2775. var import_emoji_regex = __toESM(require_emoji_regex(), 1);
  2776. function stringWidth(string) {
  2777. if (typeof string !== "string" || string.length === 0) {
  2778. return 0;
  2779. }
  2780. string = stripAnsi(string);
  2781. if (string.length === 0) {
  2782. return 0;
  2783. }
  2784. string = string.replace((0, import_emoji_regex.default)(), " ");
  2785. let width = 0;
  2786. for (let index = 0; index < string.length; index++) {
  2787. const codePoint = string.codePointAt(index);
  2788. if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
  2789. continue;
  2790. }
  2791. if (codePoint >= 768 && codePoint <= 879) {
  2792. continue;
  2793. }
  2794. if (codePoint > 65535) {
  2795. index++;
  2796. }
  2797. width += isFullwidthCodePoint(codePoint) ? 2 : 1;
  2798. }
  2799. return width;
  2800. }
  2801. }
  2802. });
  2803. var require_get_string_width = __commonJS2({
  2804. "src/utils/get-string-width.js"(exports2, module2) {
  2805. "use strict";
  2806. var stringWidth = require_string_width().default;
  2807. var notAsciiRegex = /[^\x20-\x7F]/;
  2808. function getStringWidth(text) {
  2809. if (!text) {
  2810. return 0;
  2811. }
  2812. if (!notAsciiRegex.test(text)) {
  2813. return text.length;
  2814. }
  2815. return stringWidth(text);
  2816. }
  2817. module2.exports = getStringWidth;
  2818. }
  2819. });
  2820. var require_skip = __commonJS2({
  2821. "src/utils/text/skip.js"(exports2, module2) {
  2822. "use strict";
  2823. function skip(chars) {
  2824. return (text, index, opts) => {
  2825. const backwards = opts && opts.backwards;
  2826. if (index === false) {
  2827. return false;
  2828. }
  2829. const {
  2830. length
  2831. } = text;
  2832. let cursor = index;
  2833. while (cursor >= 0 && cursor < length) {
  2834. const c = text.charAt(cursor);
  2835. if (chars instanceof RegExp) {
  2836. if (!chars.test(c)) {
  2837. return cursor;
  2838. }
  2839. } else if (!chars.includes(c)) {
  2840. return cursor;
  2841. }
  2842. backwards ? cursor-- : cursor++;
  2843. }
  2844. if (cursor === -1 || cursor === length) {
  2845. return cursor;
  2846. }
  2847. return false;
  2848. };
  2849. }
  2850. var skipWhitespace = skip(/\s/);
  2851. var skipSpaces = skip(" ");
  2852. var skipToLineEnd = skip(",; ");
  2853. var skipEverythingButNewLine = skip(/[^\n\r]/);
  2854. module2.exports = {
  2855. skipWhitespace,
  2856. skipSpaces,
  2857. skipToLineEnd,
  2858. skipEverythingButNewLine
  2859. };
  2860. }
  2861. });
  2862. var require_skip_inline_comment = __commonJS2({
  2863. "src/utils/text/skip-inline-comment.js"(exports2, module2) {
  2864. "use strict";
  2865. function skipInlineComment(text, index) {
  2866. if (index === false) {
  2867. return false;
  2868. }
  2869. if (text.charAt(index) === "/" && text.charAt(index + 1) === "*") {
  2870. for (let i = index + 2; i < text.length; ++i) {
  2871. if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") {
  2872. return i + 2;
  2873. }
  2874. }
  2875. }
  2876. return index;
  2877. }
  2878. module2.exports = skipInlineComment;
  2879. }
  2880. });
  2881. var require_skip_trailing_comment = __commonJS2({
  2882. "src/utils/text/skip-trailing-comment.js"(exports2, module2) {
  2883. "use strict";
  2884. var {
  2885. skipEverythingButNewLine
  2886. } = require_skip();
  2887. function skipTrailingComment(text, index) {
  2888. if (index === false) {
  2889. return false;
  2890. }
  2891. if (text.charAt(index) === "/" && text.charAt(index + 1) === "/") {
  2892. return skipEverythingButNewLine(text, index);
  2893. }
  2894. return index;
  2895. }
  2896. module2.exports = skipTrailingComment;
  2897. }
  2898. });
  2899. var require_skip_newline = __commonJS2({
  2900. "src/utils/text/skip-newline.js"(exports2, module2) {
  2901. "use strict";
  2902. function skipNewline(text, index, opts) {
  2903. const backwards = opts && opts.backwards;
  2904. if (index === false) {
  2905. return false;
  2906. }
  2907. const atIndex = text.charAt(index);
  2908. if (backwards) {
  2909. if (text.charAt(index - 1) === "\r" && atIndex === "\n") {
  2910. return index - 2;
  2911. }
  2912. if (atIndex === "\n" || atIndex === "\r" || atIndex === "\u2028" || atIndex === "\u2029") {
  2913. return index - 1;
  2914. }
  2915. } else {
  2916. if (atIndex === "\r" && text.charAt(index + 1) === "\n") {
  2917. return index + 2;
  2918. }
  2919. if (atIndex === "\n" || atIndex === "\r" || atIndex === "\u2028" || atIndex === "\u2029") {
  2920. return index + 1;
  2921. }
  2922. }
  2923. return index;
  2924. }
  2925. module2.exports = skipNewline;
  2926. }
  2927. });
  2928. var require_get_next_non_space_non_comment_character_index_with_start_index = __commonJS2({
  2929. "src/utils/text/get-next-non-space-non-comment-character-index-with-start-index.js"(exports2, module2) {
  2930. "use strict";
  2931. var skipInlineComment = require_skip_inline_comment();
  2932. var skipNewline = require_skip_newline();
  2933. var skipTrailingComment = require_skip_trailing_comment();
  2934. var {
  2935. skipSpaces
  2936. } = require_skip();
  2937. function getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, idx) {
  2938. let oldIdx = null;
  2939. let nextIdx = idx;
  2940. while (nextIdx !== oldIdx) {
  2941. oldIdx = nextIdx;
  2942. nextIdx = skipSpaces(text, nextIdx);
  2943. nextIdx = skipInlineComment(text, nextIdx);
  2944. nextIdx = skipTrailingComment(text, nextIdx);
  2945. nextIdx = skipNewline(text, nextIdx);
  2946. }
  2947. return nextIdx;
  2948. }
  2949. module2.exports = getNextNonSpaceNonCommentCharacterIndexWithStartIndex;
  2950. }
  2951. });
  2952. var require_util = __commonJS2({
  2953. "src/common/util.js"(exports2, module2) {
  2954. "use strict";
  2955. var {
  2956. default: escapeStringRegexp
  2957. } = require_escape_string_regexp();
  2958. var getLast = require_get_last();
  2959. var {
  2960. getSupportInfo: getSupportInfo2
  2961. } = require_support();
  2962. var isNonEmptyArray = require_is_non_empty_array();
  2963. var getStringWidth = require_get_string_width();
  2964. var {
  2965. skipWhitespace,
  2966. skipSpaces,
  2967. skipToLineEnd,
  2968. skipEverythingButNewLine
  2969. } = require_skip();
  2970. var skipInlineComment = require_skip_inline_comment();
  2971. var skipTrailingComment = require_skip_trailing_comment();
  2972. var skipNewline = require_skip_newline();
  2973. var getNextNonSpaceNonCommentCharacterIndexWithStartIndex = require_get_next_non_space_non_comment_character_index_with_start_index();
  2974. var getPenultimate = (arr) => arr[arr.length - 2];
  2975. function skip(chars) {
  2976. return (text, index, opts) => {
  2977. const backwards = opts && opts.backwards;
  2978. if (index === false) {
  2979. return false;
  2980. }
  2981. const {
  2982. length
  2983. } = text;
  2984. let cursor = index;
  2985. while (cursor >= 0 && cursor < length) {
  2986. const c = text.charAt(cursor);
  2987. if (chars instanceof RegExp) {
  2988. if (!chars.test(c)) {
  2989. return cursor;
  2990. }
  2991. } else if (!chars.includes(c)) {
  2992. return cursor;
  2993. }
  2994. backwards ? cursor-- : cursor++;
  2995. }
  2996. if (cursor === -1 || cursor === length) {
  2997. return cursor;
  2998. }
  2999. return false;
  3000. };
  3001. }
  3002. function hasNewline(text, index, opts = {}) {
  3003. const idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts);
  3004. const idx2 = skipNewline(text, idx, opts);
  3005. return idx !== idx2;
  3006. }
  3007. function hasNewlineInRange(text, start, end) {
  3008. for (let i = start; i < end; ++i) {
  3009. if (text.charAt(i) === "\n") {
  3010. return true;
  3011. }
  3012. }
  3013. return false;
  3014. }
  3015. function isPreviousLineEmpty(text, node, locStart) {
  3016. let idx = locStart(node) - 1;
  3017. idx = skipSpaces(text, idx, {
  3018. backwards: true
  3019. });
  3020. idx = skipNewline(text, idx, {
  3021. backwards: true
  3022. });
  3023. idx = skipSpaces(text, idx, {
  3024. backwards: true
  3025. });
  3026. const idx2 = skipNewline(text, idx, {
  3027. backwards: true
  3028. });
  3029. return idx !== idx2;
  3030. }
  3031. function isNextLineEmptyAfterIndex(text, index) {
  3032. let oldIdx = null;
  3033. let idx = index;
  3034. while (idx !== oldIdx) {
  3035. oldIdx = idx;
  3036. idx = skipToLineEnd(text, idx);
  3037. idx = skipInlineComment(text, idx);
  3038. idx = skipSpaces(text, idx);
  3039. }
  3040. idx = skipTrailingComment(text, idx);
  3041. idx = skipNewline(text, idx);
  3042. return idx !== false && hasNewline(text, idx);
  3043. }
  3044. function isNextLineEmpty(text, node, locEnd) {
  3045. return isNextLineEmptyAfterIndex(text, locEnd(node));
  3046. }
  3047. function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
  3048. return getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(node));
  3049. }
  3050. function getNextNonSpaceNonCommentCharacter(text, node, locEnd) {
  3051. return text.charAt(getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd));
  3052. }
  3053. function hasSpaces(text, index, opts = {}) {
  3054. const idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts);
  3055. return idx !== index;
  3056. }
  3057. function getAlignmentSize(value, tabWidth, startIndex = 0) {
  3058. let size = 0;
  3059. for (let i = startIndex; i < value.length; ++i) {
  3060. if (value[i] === " ") {
  3061. size = size + tabWidth - size % tabWidth;
  3062. } else {
  3063. size++;
  3064. }
  3065. }
  3066. return size;
  3067. }
  3068. function getIndentSize(value, tabWidth) {
  3069. const lastNewlineIndex = value.lastIndexOf("\n");
  3070. if (lastNewlineIndex === -1) {
  3071. return 0;
  3072. }
  3073. return getAlignmentSize(value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0], tabWidth);
  3074. }
  3075. function getPreferredQuote(rawContent, preferredQuote) {
  3076. const double = {
  3077. quote: '"',
  3078. regex: /"/g,
  3079. escaped: "&quot;"
  3080. };
  3081. const single = {
  3082. quote: "'",
  3083. regex: /'/g,
  3084. escaped: "&apos;"
  3085. };
  3086. const preferred = preferredQuote === "'" ? single : double;
  3087. const alternate = preferred === single ? double : single;
  3088. let result = preferred;
  3089. if (rawContent.includes(preferred.quote) || rawContent.includes(alternate.quote)) {
  3090. const numPreferredQuotes = (rawContent.match(preferred.regex) || []).length;
  3091. const numAlternateQuotes = (rawContent.match(alternate.regex) || []).length;
  3092. result = numPreferredQuotes > numAlternateQuotes ? alternate : preferred;
  3093. }
  3094. return result;
  3095. }
  3096. function printString(raw, options) {
  3097. const rawContent = raw.slice(1, -1);
  3098. const enclosingQuote = options.parser === "json" || options.parser === "json5" && options.quoteProps === "preserve" && !options.singleQuote ? '"' : options.__isInHtmlAttribute ? "'" : getPreferredQuote(rawContent, options.singleQuote ? "'" : '"').quote;
  3099. return makeString(rawContent, enclosingQuote, !(options.parser === "css" || options.parser === "less" || options.parser === "scss" || options.__embeddedInHtml));
  3100. }
  3101. function makeString(rawContent, enclosingQuote, unescapeUnnecessaryEscapes) {
  3102. const otherQuote = enclosingQuote === '"' ? "'" : '"';
  3103. const regex = /\\(.)|(["'])/gs;
  3104. const newContent = rawContent.replace(regex, (match, escaped, quote) => {
  3105. if (escaped === otherQuote) {
  3106. return escaped;
  3107. }
  3108. if (quote === enclosingQuote) {
  3109. return "\\" + quote;
  3110. }
  3111. if (quote) {
  3112. return quote;
  3113. }
  3114. return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(escaped) ? escaped : "\\" + escaped;
  3115. });
  3116. return enclosingQuote + newContent + enclosingQuote;
  3117. }
  3118. function printNumber(rawNumber) {
  3119. return rawNumber.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/, "$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/, "$1").replace(/^([+-])?\./, "$10.").replace(/(\.\d+?)0+(?=e|$)/, "$1").replace(/\.(?=e|$)/, "");
  3120. }
  3121. function getMaxContinuousCount(str, target) {
  3122. const results = str.match(new RegExp(`(${escapeStringRegexp(target)})+`, "g"));
  3123. if (results === null) {
  3124. return 0;
  3125. }
  3126. return results.reduce((maxCount, result) => Math.max(maxCount, result.length / target.length), 0);
  3127. }
  3128. function getMinNotPresentContinuousCount(str, target) {
  3129. const matches = str.match(new RegExp(`(${escapeStringRegexp(target)})+`, "g"));
  3130. if (matches === null) {
  3131. return 0;
  3132. }
  3133. const countPresent = /* @__PURE__ */ new Map();
  3134. let max = 0;
  3135. for (const match of matches) {
  3136. const count = match.length / target.length;
  3137. countPresent.set(count, true);
  3138. if (count > max) {
  3139. max = count;
  3140. }
  3141. }
  3142. for (let i = 1; i < max; i++) {
  3143. if (!countPresent.get(i)) {
  3144. return i;
  3145. }
  3146. }
  3147. return max + 1;
  3148. }
  3149. function addCommentHelper(node, comment) {
  3150. const comments = node.comments || (node.comments = []);
  3151. comments.push(comment);
  3152. comment.printed = false;
  3153. comment.nodeDescription = describeNodeForDebugging(node);
  3154. }
  3155. function addLeadingComment(node, comment) {
  3156. comment.leading = true;
  3157. comment.trailing = false;
  3158. addCommentHelper(node, comment);
  3159. }
  3160. function addDanglingComment(node, comment, marker) {
  3161. comment.leading = false;
  3162. comment.trailing = false;
  3163. if (marker) {
  3164. comment.marker = marker;
  3165. }
  3166. addCommentHelper(node, comment);
  3167. }
  3168. function addTrailingComment(node, comment) {
  3169. comment.leading = false;
  3170. comment.trailing = true;
  3171. addCommentHelper(node, comment);
  3172. }
  3173. function inferParserByLanguage(language, options) {
  3174. const {
  3175. languages
  3176. } = getSupportInfo2({
  3177. plugins: options.plugins
  3178. });
  3179. const matched = languages.find(({
  3180. name
  3181. }) => name.toLowerCase() === language) || languages.find(({
  3182. aliases
  3183. }) => Array.isArray(aliases) && aliases.includes(language)) || languages.find(({
  3184. extensions
  3185. }) => Array.isArray(extensions) && extensions.includes(`.${language}`));
  3186. return matched && matched.parsers[0];
  3187. }
  3188. function isFrontMatterNode(node) {
  3189. return node && node.type === "front-matter";
  3190. }
  3191. function createGroupIdMapper(description) {
  3192. const groupIds = /* @__PURE__ */ new WeakMap();
  3193. return function(node) {
  3194. if (!groupIds.has(node)) {
  3195. groupIds.set(node, Symbol(description));
  3196. }
  3197. return groupIds.get(node);
  3198. };
  3199. }
  3200. function describeNodeForDebugging(node) {
  3201. const nodeType = node.type || node.kind || "(unknown type)";
  3202. let nodeName = String(node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || "");
  3203. if (nodeName.length > 20) {
  3204. nodeName = nodeName.slice(0, 19) + "\u2026";
  3205. }
  3206. return nodeType + (nodeName ? " " + nodeName : "");
  3207. }
  3208. module2.exports = {
  3209. inferParserByLanguage,
  3210. getStringWidth,
  3211. getMaxContinuousCount,
  3212. getMinNotPresentContinuousCount,
  3213. getPenultimate,
  3214. getLast,
  3215. getNextNonSpaceNonCommentCharacterIndexWithStartIndex,
  3216. getNextNonSpaceNonCommentCharacterIndex,
  3217. getNextNonSpaceNonCommentCharacter,
  3218. skip,
  3219. skipWhitespace,
  3220. skipSpaces,
  3221. skipToLineEnd,
  3222. skipEverythingButNewLine,
  3223. skipInlineComment,
  3224. skipTrailingComment,
  3225. skipNewline,
  3226. isNextLineEmptyAfterIndex,
  3227. isNextLineEmpty,
  3228. isPreviousLineEmpty,
  3229. hasNewline,
  3230. hasNewlineInRange,
  3231. hasSpaces,
  3232. getAlignmentSize,
  3233. getIndentSize,
  3234. getPreferredQuote,
  3235. printString,
  3236. printNumber,
  3237. makeString,
  3238. addLeadingComment,
  3239. addDanglingComment,
  3240. addTrailingComment,
  3241. isFrontMatterNode,
  3242. isNonEmptyArray,
  3243. createGroupIdMapper
  3244. };
  3245. }
  3246. });
  3247. var require_end_of_line = __commonJS2({
  3248. "src/common/end-of-line.js"(exports2, module2) {
  3249. "use strict";
  3250. function guessEndOfLine(text) {
  3251. const index = text.indexOf("\r");
  3252. if (index >= 0) {
  3253. return text.charAt(index + 1) === "\n" ? "crlf" : "cr";
  3254. }
  3255. return "lf";
  3256. }
  3257. function convertEndOfLineToChars(value) {
  3258. switch (value) {
  3259. case "cr":
  3260. return "\r";
  3261. case "crlf":
  3262. return "\r\n";
  3263. default:
  3264. return "\n";
  3265. }
  3266. }
  3267. function countEndOfLineChars(text, eol) {
  3268. let regex;
  3269. switch (eol) {
  3270. case "\n":
  3271. regex = /\n/g;
  3272. break;
  3273. case "\r":
  3274. regex = /\r/g;
  3275. break;
  3276. case "\r\n":
  3277. regex = /\r\n/g;
  3278. break;
  3279. default:
  3280. throw new Error(`Unexpected "eol" ${JSON.stringify(eol)}.`);
  3281. }
  3282. const endOfLines = text.match(regex);
  3283. return endOfLines ? endOfLines.length : 0;
  3284. }
  3285. function normalizeEndOfLine(text) {
  3286. return text.replace(/\r\n?/g, "\n");
  3287. }
  3288. module2.exports = {
  3289. guessEndOfLine,
  3290. convertEndOfLineToChars,
  3291. countEndOfLineChars,
  3292. normalizeEndOfLine
  3293. };
  3294. }
  3295. });
  3296. var require_errors = __commonJS2({
  3297. "src/common/errors.js"(exports2, module2) {
  3298. "use strict";
  3299. var ConfigError = class extends Error {
  3300. };
  3301. var DebugError = class extends Error {
  3302. };
  3303. var UndefinedParserError = class extends Error {
  3304. };
  3305. var ArgExpansionBailout = class extends Error {
  3306. };
  3307. module2.exports = {
  3308. ConfigError,
  3309. DebugError,
  3310. UndefinedParserError,
  3311. ArgExpansionBailout
  3312. };
  3313. }
  3314. });
  3315. var tslib_es6_exports = {};
  3316. __export(tslib_es6_exports, {
  3317. __assign: () => __assign,
  3318. __asyncDelegator: () => __asyncDelegator,
  3319. __asyncGenerator: () => __asyncGenerator,
  3320. __asyncValues: () => __asyncValues,
  3321. __await: () => __await,
  3322. __awaiter: () => __awaiter,
  3323. __classPrivateFieldGet: () => __classPrivateFieldGet,
  3324. __classPrivateFieldSet: () => __classPrivateFieldSet,
  3325. __createBinding: () => __createBinding,
  3326. __decorate: () => __decorate,
  3327. __exportStar: () => __exportStar,
  3328. __extends: () => __extends,
  3329. __generator: () => __generator,
  3330. __importDefault: () => __importDefault,
  3331. __importStar: () => __importStar,
  3332. __makeTemplateObject: () => __makeTemplateObject,
  3333. __metadata: () => __metadata,
  3334. __param: () => __param,
  3335. __read: () => __read,
  3336. __rest: () => __rest,
  3337. __spread: () => __spread,
  3338. __spreadArrays: () => __spreadArrays,
  3339. __values: () => __values
  3340. });
  3341. function __extends(d, b) {
  3342. extendStatics(d, b);
  3343. function __() {
  3344. this.constructor = d;
  3345. }
  3346. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3347. }
  3348. function __rest(s, e) {
  3349. var t = {};
  3350. for (var p in s)
  3351. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  3352. t[p] = s[p];
  3353. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  3354. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  3355. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  3356. t[p[i]] = s[p[i]];
  3357. }
  3358. return t;
  3359. }
  3360. function __decorate(decorators, target, key, desc) {
  3361. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  3362. if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
  3363. r = Reflect.decorate(decorators, target, key, desc);
  3364. else
  3365. for (var i = decorators.length - 1; i >= 0; i--)
  3366. if (d = decorators[i])
  3367. r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  3368. return c > 3 && r && Object.defineProperty(target, key, r), r;
  3369. }
  3370. function __param(paramIndex, decorator) {
  3371. return function(target, key) {
  3372. decorator(target, key, paramIndex);
  3373. };
  3374. }
  3375. function __metadata(metadataKey, metadataValue) {
  3376. if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
  3377. return Reflect.metadata(metadataKey, metadataValue);
  3378. }
  3379. function __awaiter(thisArg, _arguments, P, generator) {
  3380. function adopt(value) {
  3381. return value instanceof P ? value : new P(function(resolve) {
  3382. resolve(value);
  3383. });
  3384. }
  3385. return new (P || (P = Promise))(function(resolve, reject) {
  3386. function fulfilled(value) {
  3387. try {
  3388. step(generator.next(value));
  3389. } catch (e) {
  3390. reject(e);
  3391. }
  3392. }
  3393. function rejected(value) {
  3394. try {
  3395. step(generator["throw"](value));
  3396. } catch (e) {
  3397. reject(e);
  3398. }
  3399. }
  3400. function step(result) {
  3401. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  3402. }
  3403. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3404. });
  3405. }
  3406. function __generator(thisArg, body) {
  3407. var _ = {
  3408. label: 0,
  3409. sent: function() {
  3410. if (t[0] & 1)
  3411. throw t[1];
  3412. return t[1];
  3413. },
  3414. trys: [],
  3415. ops: []
  3416. }, f, y, t, g;
  3417. return g = {
  3418. next: verb(0),
  3419. "throw": verb(1),
  3420. "return": verb(2)
  3421. }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
  3422. return this;
  3423. }), g;
  3424. function verb(n) {
  3425. return function(v) {
  3426. return step([n, v]);
  3427. };
  3428. }
  3429. function step(op) {
  3430. if (f)
  3431. throw new TypeError("Generator is already executing.");
  3432. while (_)
  3433. try {
  3434. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
  3435. return t;
  3436. if (y = 0, t)
  3437. op = [op[0] & 2, t.value];
  3438. switch (op[0]) {
  3439. case 0:
  3440. case 1:
  3441. t = op;
  3442. break;
  3443. case 4:
  3444. _.label++;
  3445. return {
  3446. value: op[1],
  3447. done: false
  3448. };
  3449. case 5:
  3450. _.label++;
  3451. y = op[1];
  3452. op = [0];
  3453. continue;
  3454. case 7:
  3455. op = _.ops.pop();
  3456. _.trys.pop();
  3457. continue;
  3458. default:
  3459. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  3460. _ = 0;
  3461. continue;
  3462. }
  3463. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  3464. _.label = op[1];
  3465. break;
  3466. }
  3467. if (op[0] === 6 && _.label < t[1]) {
  3468. _.label = t[1];
  3469. t = op;
  3470. break;
  3471. }
  3472. if (t && _.label < t[2]) {
  3473. _.label = t[2];
  3474. _.ops.push(op);
  3475. break;
  3476. }
  3477. if (t[2])
  3478. _.ops.pop();
  3479. _.trys.pop();
  3480. continue;
  3481. }
  3482. op = body.call(thisArg, _);
  3483. } catch (e) {
  3484. op = [6, e];
  3485. y = 0;
  3486. } finally {
  3487. f = t = 0;
  3488. }
  3489. if (op[0] & 5)
  3490. throw op[1];
  3491. return {
  3492. value: op[0] ? op[1] : void 0,
  3493. done: true
  3494. };
  3495. }
  3496. }
  3497. function __createBinding(o, m, k, k2) {
  3498. if (k2 === void 0)
  3499. k2 = k;
  3500. o[k2] = m[k];
  3501. }
  3502. function __exportStar(m, exports2) {
  3503. for (var p in m)
  3504. if (p !== "default" && !exports2.hasOwnProperty(p))
  3505. exports2[p] = m[p];
  3506. }
  3507. function __values(o) {
  3508. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  3509. if (m)
  3510. return m.call(o);
  3511. if (o && typeof o.length === "number")
  3512. return {
  3513. next: function() {
  3514. if (o && i >= o.length)
  3515. o = void 0;
  3516. return {
  3517. value: o && o[i++],
  3518. done: !o
  3519. };
  3520. }
  3521. };
  3522. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  3523. }
  3524. function __read(o, n) {
  3525. var m = typeof Symbol === "function" && o[Symbol.iterator];
  3526. if (!m)
  3527. return o;
  3528. var i = m.call(o), r, ar = [], e;
  3529. try {
  3530. while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
  3531. ar.push(r.value);
  3532. } catch (error) {
  3533. e = {
  3534. error
  3535. };
  3536. } finally {
  3537. try {
  3538. if (r && !r.done && (m = i["return"]))
  3539. m.call(i);
  3540. } finally {
  3541. if (e)
  3542. throw e.error;
  3543. }
  3544. }
  3545. return ar;
  3546. }
  3547. function __spread() {
  3548. for (var ar = [], i = 0; i < arguments.length; i++)
  3549. ar = ar.concat(__read(arguments[i]));
  3550. return ar;
  3551. }
  3552. function __spreadArrays() {
  3553. for (var s = 0, i = 0, il = arguments.length; i < il; i++)
  3554. s += arguments[i].length;
  3555. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  3556. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  3557. r[k] = a[j];
  3558. return r;
  3559. }
  3560. function __await(v) {
  3561. return this instanceof __await ? (this.v = v, this) : new __await(v);
  3562. }
  3563. function __asyncGenerator(thisArg, _arguments, generator) {
  3564. if (!Symbol.asyncIterator)
  3565. throw new TypeError("Symbol.asyncIterator is not defined.");
  3566. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  3567. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
  3568. return this;
  3569. }, i;
  3570. function verb(n) {
  3571. if (g[n])
  3572. i[n] = function(v) {
  3573. return new Promise(function(a, b) {
  3574. q.push([n, v, a, b]) > 1 || resume(n, v);
  3575. });
  3576. };
  3577. }
  3578. function resume(n, v) {
  3579. try {
  3580. step(g[n](v));
  3581. } catch (e) {
  3582. settle(q[0][3], e);
  3583. }
  3584. }
  3585. function step(r) {
  3586. r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  3587. }
  3588. function fulfill(value) {
  3589. resume("next", value);
  3590. }
  3591. function reject(value) {
  3592. resume("throw", value);
  3593. }
  3594. function settle(f, v) {
  3595. if (f(v), q.shift(), q.length)
  3596. resume(q[0][0], q[0][1]);
  3597. }
  3598. }
  3599. function __asyncDelegator(o) {
  3600. var i, p;
  3601. return i = {}, verb("next"), verb("throw", function(e) {
  3602. throw e;
  3603. }), verb("return"), i[Symbol.iterator] = function() {
  3604. return this;
  3605. }, i;
  3606. function verb(n, f) {
  3607. i[n] = o[n] ? function(v) {
  3608. return (p = !p) ? {
  3609. value: __await(o[n](v)),
  3610. done: n === "return"
  3611. } : f ? f(v) : v;
  3612. } : f;
  3613. }
  3614. }
  3615. function __asyncValues(o) {
  3616. if (!Symbol.asyncIterator)
  3617. throw new TypeError("Symbol.asyncIterator is not defined.");
  3618. var m = o[Symbol.asyncIterator], i;
  3619. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
  3620. return this;
  3621. }, i);
  3622. function verb(n) {
  3623. i[n] = o[n] && function(v) {
  3624. return new Promise(function(resolve, reject) {
  3625. v = o[n](v), settle(resolve, reject, v.done, v.value);
  3626. });
  3627. };
  3628. }
  3629. function settle(resolve, reject, d, v) {
  3630. Promise.resolve(v).then(function(v2) {
  3631. resolve({
  3632. value: v2,
  3633. done: d
  3634. });
  3635. }, reject);
  3636. }
  3637. }
  3638. function __makeTemplateObject(cooked, raw) {
  3639. if (Object.defineProperty) {
  3640. Object.defineProperty(cooked, "raw", {
  3641. value: raw
  3642. });
  3643. } else {
  3644. cooked.raw = raw;
  3645. }
  3646. return cooked;
  3647. }
  3648. function __importStar(mod) {
  3649. if (mod && mod.__esModule)
  3650. return mod;
  3651. var result = {};
  3652. if (mod != null) {
  3653. for (var k in mod)
  3654. if (Object.hasOwnProperty.call(mod, k))
  3655. result[k] = mod[k];
  3656. }
  3657. result.default = mod;
  3658. return result;
  3659. }
  3660. function __importDefault(mod) {
  3661. return mod && mod.__esModule ? mod : {
  3662. default: mod
  3663. };
  3664. }
  3665. function __classPrivateFieldGet(receiver, privateMap) {
  3666. if (!privateMap.has(receiver)) {
  3667. throw new TypeError("attempted to get private field on non-instance");
  3668. }
  3669. return privateMap.get(receiver);
  3670. }
  3671. function __classPrivateFieldSet(receiver, privateMap, value) {
  3672. if (!privateMap.has(receiver)) {
  3673. throw new TypeError("attempted to set private field on non-instance");
  3674. }
  3675. privateMap.set(receiver, value);
  3676. return value;
  3677. }
  3678. var extendStatics;
  3679. var __assign;
  3680. var init_tslib_es6 = __esm({
  3681. "node_modules/tslib/tslib.es6.js"() {
  3682. extendStatics = function(d, b) {
  3683. extendStatics = Object.setPrototypeOf || {
  3684. __proto__: []
  3685. } instanceof Array && function(d2, b2) {
  3686. d2.__proto__ = b2;
  3687. } || function(d2, b2) {
  3688. for (var p in b2)
  3689. if (b2.hasOwnProperty(p))
  3690. d2[p] = b2[p];
  3691. };
  3692. return extendStatics(d, b);
  3693. };
  3694. __assign = function() {
  3695. __assign = Object.assign || function __assign2(t) {
  3696. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3697. s = arguments[i];
  3698. for (var p in s)
  3699. if (Object.prototype.hasOwnProperty.call(s, p))
  3700. t[p] = s[p];
  3701. }
  3702. return t;
  3703. };
  3704. return __assign.apply(this, arguments);
  3705. };
  3706. }
  3707. });
  3708. var require_api = __commonJS2({
  3709. "node_modules/vnopts/lib/descriptors/api.js"(exports2) {
  3710. "use strict";
  3711. Object.defineProperty(exports2, "__esModule", {
  3712. value: true
  3713. });
  3714. exports2.apiDescriptor = {
  3715. key: (key) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(key) ? key : JSON.stringify(key),
  3716. value(value) {
  3717. if (value === null || typeof value !== "object") {
  3718. return JSON.stringify(value);
  3719. }
  3720. if (Array.isArray(value)) {
  3721. return `[${value.map((subValue) => exports2.apiDescriptor.value(subValue)).join(", ")}]`;
  3722. }
  3723. const keys = Object.keys(value);
  3724. return keys.length === 0 ? "{}" : `{ ${keys.map((key) => `${exports2.apiDescriptor.key(key)}: ${exports2.apiDescriptor.value(value[key])}`).join(", ")} }`;
  3725. },
  3726. pair: ({
  3727. key,
  3728. value
  3729. }) => exports2.apiDescriptor.value({
  3730. [key]: value
  3731. })
  3732. };
  3733. }
  3734. });
  3735. var require_descriptors2 = __commonJS2({
  3736. "node_modules/vnopts/lib/descriptors/index.js"(exports2) {
  3737. "use strict";
  3738. Object.defineProperty(exports2, "__esModule", {
  3739. value: true
  3740. });
  3741. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  3742. tslib_1.__exportStar(require_api(), exports2);
  3743. }
  3744. });
  3745. var require_escape_string_regexp2 = __commonJS2({
  3746. "node_modules/vnopts/node_modules/escape-string-regexp/index.js"(exports2, module2) {
  3747. "use strict";
  3748. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  3749. module2.exports = function(str) {
  3750. if (typeof str !== "string") {
  3751. throw new TypeError("Expected a string");
  3752. }
  3753. return str.replace(matchOperatorsRe, "\\$&");
  3754. };
  3755. }
  3756. });
  3757. var require_color_name = __commonJS2({
  3758. "node_modules/color-name/index.js"(exports2, module2) {
  3759. "use strict";
  3760. module2.exports = {
  3761. "aliceblue": [240, 248, 255],
  3762. "antiquewhite": [250, 235, 215],
  3763. "aqua": [0, 255, 255],
  3764. "aquamarine": [127, 255, 212],
  3765. "azure": [240, 255, 255],
  3766. "beige": [245, 245, 220],
  3767. "bisque": [255, 228, 196],
  3768. "black": [0, 0, 0],
  3769. "blanchedalmond": [255, 235, 205],
  3770. "blue": [0, 0, 255],
  3771. "blueviolet": [138, 43, 226],
  3772. "brown": [165, 42, 42],
  3773. "burlywood": [222, 184, 135],
  3774. "cadetblue": [95, 158, 160],
  3775. "chartreuse": [127, 255, 0],
  3776. "chocolate": [210, 105, 30],
  3777. "coral": [255, 127, 80],
  3778. "cornflowerblue": [100, 149, 237],
  3779. "cornsilk": [255, 248, 220],
  3780. "crimson": [220, 20, 60],
  3781. "cyan": [0, 255, 255],
  3782. "darkblue": [0, 0, 139],
  3783. "darkcyan": [0, 139, 139],
  3784. "darkgoldenrod": [184, 134, 11],
  3785. "darkgray": [169, 169, 169],
  3786. "darkgreen": [0, 100, 0],
  3787. "darkgrey": [169, 169, 169],
  3788. "darkkhaki": [189, 183, 107],
  3789. "darkmagenta": [139, 0, 139],
  3790. "darkolivegreen": [85, 107, 47],
  3791. "darkorange": [255, 140, 0],
  3792. "darkorchid": [153, 50, 204],
  3793. "darkred": [139, 0, 0],
  3794. "darksalmon": [233, 150, 122],
  3795. "darkseagreen": [143, 188, 143],
  3796. "darkslateblue": [72, 61, 139],
  3797. "darkslategray": [47, 79, 79],
  3798. "darkslategrey": [47, 79, 79],
  3799. "darkturquoise": [0, 206, 209],
  3800. "darkviolet": [148, 0, 211],
  3801. "deeppink": [255, 20, 147],
  3802. "deepskyblue": [0, 191, 255],
  3803. "dimgray": [105, 105, 105],
  3804. "dimgrey": [105, 105, 105],
  3805. "dodgerblue": [30, 144, 255],
  3806. "firebrick": [178, 34, 34],
  3807. "floralwhite": [255, 250, 240],
  3808. "forestgreen": [34, 139, 34],
  3809. "fuchsia": [255, 0, 255],
  3810. "gainsboro": [220, 220, 220],
  3811. "ghostwhite": [248, 248, 255],
  3812. "gold": [255, 215, 0],
  3813. "goldenrod": [218, 165, 32],
  3814. "gray": [128, 128, 128],
  3815. "green": [0, 128, 0],
  3816. "greenyellow": [173, 255, 47],
  3817. "grey": [128, 128, 128],
  3818. "honeydew": [240, 255, 240],
  3819. "hotpink": [255, 105, 180],
  3820. "indianred": [205, 92, 92],
  3821. "indigo": [75, 0, 130],
  3822. "ivory": [255, 255, 240],
  3823. "khaki": [240, 230, 140],
  3824. "lavender": [230, 230, 250],
  3825. "lavenderblush": [255, 240, 245],
  3826. "lawngreen": [124, 252, 0],
  3827. "lemonchiffon": [255, 250, 205],
  3828. "lightblue": [173, 216, 230],
  3829. "lightcoral": [240, 128, 128],
  3830. "lightcyan": [224, 255, 255],
  3831. "lightgoldenrodyellow": [250, 250, 210],
  3832. "lightgray": [211, 211, 211],
  3833. "lightgreen": [144, 238, 144],
  3834. "lightgrey": [211, 211, 211],
  3835. "lightpink": [255, 182, 193],
  3836. "lightsalmon": [255, 160, 122],
  3837. "lightseagreen": [32, 178, 170],
  3838. "lightskyblue": [135, 206, 250],
  3839. "lightslategray": [119, 136, 153],
  3840. "lightslategrey": [119, 136, 153],
  3841. "lightsteelblue": [176, 196, 222],
  3842. "lightyellow": [255, 255, 224],
  3843. "lime": [0, 255, 0],
  3844. "limegreen": [50, 205, 50],
  3845. "linen": [250, 240, 230],
  3846. "magenta": [255, 0, 255],
  3847. "maroon": [128, 0, 0],
  3848. "mediumaquamarine": [102, 205, 170],
  3849. "mediumblue": [0, 0, 205],
  3850. "mediumorchid": [186, 85, 211],
  3851. "mediumpurple": [147, 112, 219],
  3852. "mediumseagreen": [60, 179, 113],
  3853. "mediumslateblue": [123, 104, 238],
  3854. "mediumspringgreen": [0, 250, 154],
  3855. "mediumturquoise": [72, 209, 204],
  3856. "mediumvioletred": [199, 21, 133],
  3857. "midnightblue": [25, 25, 112],
  3858. "mintcream": [245, 255, 250],
  3859. "mistyrose": [255, 228, 225],
  3860. "moccasin": [255, 228, 181],
  3861. "navajowhite": [255, 222, 173],
  3862. "navy": [0, 0, 128],
  3863. "oldlace": [253, 245, 230],
  3864. "olive": [128, 128, 0],
  3865. "olivedrab": [107, 142, 35],
  3866. "orange": [255, 165, 0],
  3867. "orangered": [255, 69, 0],
  3868. "orchid": [218, 112, 214],
  3869. "palegoldenrod": [238, 232, 170],
  3870. "palegreen": [152, 251, 152],
  3871. "paleturquoise": [175, 238, 238],
  3872. "palevioletred": [219, 112, 147],
  3873. "papayawhip": [255, 239, 213],
  3874. "peachpuff": [255, 218, 185],
  3875. "peru": [205, 133, 63],
  3876. "pink": [255, 192, 203],
  3877. "plum": [221, 160, 221],
  3878. "powderblue": [176, 224, 230],
  3879. "purple": [128, 0, 128],
  3880. "rebeccapurple": [102, 51, 153],
  3881. "red": [255, 0, 0],
  3882. "rosybrown": [188, 143, 143],
  3883. "royalblue": [65, 105, 225],
  3884. "saddlebrown": [139, 69, 19],
  3885. "salmon": [250, 128, 114],
  3886. "sandybrown": [244, 164, 96],
  3887. "seagreen": [46, 139, 87],
  3888. "seashell": [255, 245, 238],
  3889. "sienna": [160, 82, 45],
  3890. "silver": [192, 192, 192],
  3891. "skyblue": [135, 206, 235],
  3892. "slateblue": [106, 90, 205],
  3893. "slategray": [112, 128, 144],
  3894. "slategrey": [112, 128, 144],
  3895. "snow": [255, 250, 250],
  3896. "springgreen": [0, 255, 127],
  3897. "steelblue": [70, 130, 180],
  3898. "tan": [210, 180, 140],
  3899. "teal": [0, 128, 128],
  3900. "thistle": [216, 191, 216],
  3901. "tomato": [255, 99, 71],
  3902. "turquoise": [64, 224, 208],
  3903. "violet": [238, 130, 238],
  3904. "wheat": [245, 222, 179],
  3905. "white": [255, 255, 255],
  3906. "whitesmoke": [245, 245, 245],
  3907. "yellow": [255, 255, 0],
  3908. "yellowgreen": [154, 205, 50]
  3909. };
  3910. }
  3911. });
  3912. var require_conversions = __commonJS2({
  3913. "node_modules/color-convert/conversions.js"(exports2, module2) {
  3914. var cssKeywords = require_color_name();
  3915. var reverseKeywords = {};
  3916. for (key in cssKeywords) {
  3917. if (cssKeywords.hasOwnProperty(key)) {
  3918. reverseKeywords[cssKeywords[key]] = key;
  3919. }
  3920. }
  3921. var key;
  3922. var convert = module2.exports = {
  3923. rgb: {
  3924. channels: 3,
  3925. labels: "rgb"
  3926. },
  3927. hsl: {
  3928. channels: 3,
  3929. labels: "hsl"
  3930. },
  3931. hsv: {
  3932. channels: 3,
  3933. labels: "hsv"
  3934. },
  3935. hwb: {
  3936. channels: 3,
  3937. labels: "hwb"
  3938. },
  3939. cmyk: {
  3940. channels: 4,
  3941. labels: "cmyk"
  3942. },
  3943. xyz: {
  3944. channels: 3,
  3945. labels: "xyz"
  3946. },
  3947. lab: {
  3948. channels: 3,
  3949. labels: "lab"
  3950. },
  3951. lch: {
  3952. channels: 3,
  3953. labels: "lch"
  3954. },
  3955. hex: {
  3956. channels: 1,
  3957. labels: ["hex"]
  3958. },
  3959. keyword: {
  3960. channels: 1,
  3961. labels: ["keyword"]
  3962. },
  3963. ansi16: {
  3964. channels: 1,
  3965. labels: ["ansi16"]
  3966. },
  3967. ansi256: {
  3968. channels: 1,
  3969. labels: ["ansi256"]
  3970. },
  3971. hcg: {
  3972. channels: 3,
  3973. labels: ["h", "c", "g"]
  3974. },
  3975. apple: {
  3976. channels: 3,
  3977. labels: ["r16", "g16", "b16"]
  3978. },
  3979. gray: {
  3980. channels: 1,
  3981. labels: ["gray"]
  3982. }
  3983. };
  3984. for (model in convert) {
  3985. if (convert.hasOwnProperty(model)) {
  3986. if (!("channels" in convert[model])) {
  3987. throw new Error("missing channels property: " + model);
  3988. }
  3989. if (!("labels" in convert[model])) {
  3990. throw new Error("missing channel labels property: " + model);
  3991. }
  3992. if (convert[model].labels.length !== convert[model].channels) {
  3993. throw new Error("channel and label counts mismatch: " + model);
  3994. }
  3995. channels = convert[model].channels;
  3996. labels = convert[model].labels;
  3997. delete convert[model].channels;
  3998. delete convert[model].labels;
  3999. Object.defineProperty(convert[model], "channels", {
  4000. value: channels
  4001. });
  4002. Object.defineProperty(convert[model], "labels", {
  4003. value: labels
  4004. });
  4005. }
  4006. }
  4007. var channels;
  4008. var labels;
  4009. var model;
  4010. convert.rgb.hsl = function(rgb) {
  4011. var r = rgb[0] / 255;
  4012. var g = rgb[1] / 255;
  4013. var b = rgb[2] / 255;
  4014. var min = Math.min(r, g, b);
  4015. var max = Math.max(r, g, b);
  4016. var delta = max - min;
  4017. var h;
  4018. var s;
  4019. var l;
  4020. if (max === min) {
  4021. h = 0;
  4022. } else if (r === max) {
  4023. h = (g - b) / delta;
  4024. } else if (g === max) {
  4025. h = 2 + (b - r) / delta;
  4026. } else if (b === max) {
  4027. h = 4 + (r - g) / delta;
  4028. }
  4029. h = Math.min(h * 60, 360);
  4030. if (h < 0) {
  4031. h += 360;
  4032. }
  4033. l = (min + max) / 2;
  4034. if (max === min) {
  4035. s = 0;
  4036. } else if (l <= 0.5) {
  4037. s = delta / (max + min);
  4038. } else {
  4039. s = delta / (2 - max - min);
  4040. }
  4041. return [h, s * 100, l * 100];
  4042. };
  4043. convert.rgb.hsv = function(rgb) {
  4044. var rdif;
  4045. var gdif;
  4046. var bdif;
  4047. var h;
  4048. var s;
  4049. var r = rgb[0] / 255;
  4050. var g = rgb[1] / 255;
  4051. var b = rgb[2] / 255;
  4052. var v = Math.max(r, g, b);
  4053. var diff = v - Math.min(r, g, b);
  4054. var diffc = function(c) {
  4055. return (v - c) / 6 / diff + 1 / 2;
  4056. };
  4057. if (diff === 0) {
  4058. h = s = 0;
  4059. } else {
  4060. s = diff / v;
  4061. rdif = diffc(r);
  4062. gdif = diffc(g);
  4063. bdif = diffc(b);
  4064. if (r === v) {
  4065. h = bdif - gdif;
  4066. } else if (g === v) {
  4067. h = 1 / 3 + rdif - bdif;
  4068. } else if (b === v) {
  4069. h = 2 / 3 + gdif - rdif;
  4070. }
  4071. if (h < 0) {
  4072. h += 1;
  4073. } else if (h > 1) {
  4074. h -= 1;
  4075. }
  4076. }
  4077. return [h * 360, s * 100, v * 100];
  4078. };
  4079. convert.rgb.hwb = function(rgb) {
  4080. var r = rgb[0];
  4081. var g = rgb[1];
  4082. var b = rgb[2];
  4083. var h = convert.rgb.hsl(rgb)[0];
  4084. var w = 1 / 255 * Math.min(r, Math.min(g, b));
  4085. b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
  4086. return [h, w * 100, b * 100];
  4087. };
  4088. convert.rgb.cmyk = function(rgb) {
  4089. var r = rgb[0] / 255;
  4090. var g = rgb[1] / 255;
  4091. var b = rgb[2] / 255;
  4092. var c;
  4093. var m;
  4094. var y;
  4095. var k;
  4096. k = Math.min(1 - r, 1 - g, 1 - b);
  4097. c = (1 - r - k) / (1 - k) || 0;
  4098. m = (1 - g - k) / (1 - k) || 0;
  4099. y = (1 - b - k) / (1 - k) || 0;
  4100. return [c * 100, m * 100, y * 100, k * 100];
  4101. };
  4102. function comparativeDistance(x, y) {
  4103. return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
  4104. }
  4105. convert.rgb.keyword = function(rgb) {
  4106. var reversed = reverseKeywords[rgb];
  4107. if (reversed) {
  4108. return reversed;
  4109. }
  4110. var currentClosestDistance = Infinity;
  4111. var currentClosestKeyword;
  4112. for (var keyword in cssKeywords) {
  4113. if (cssKeywords.hasOwnProperty(keyword)) {
  4114. var value = cssKeywords[keyword];
  4115. var distance = comparativeDistance(rgb, value);
  4116. if (distance < currentClosestDistance) {
  4117. currentClosestDistance = distance;
  4118. currentClosestKeyword = keyword;
  4119. }
  4120. }
  4121. }
  4122. return currentClosestKeyword;
  4123. };
  4124. convert.keyword.rgb = function(keyword) {
  4125. return cssKeywords[keyword];
  4126. };
  4127. convert.rgb.xyz = function(rgb) {
  4128. var r = rgb[0] / 255;
  4129. var g = rgb[1] / 255;
  4130. var b = rgb[2] / 255;
  4131. r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
  4132. g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
  4133. b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
  4134. var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
  4135. var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
  4136. var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
  4137. return [x * 100, y * 100, z * 100];
  4138. };
  4139. convert.rgb.lab = function(rgb) {
  4140. var xyz = convert.rgb.xyz(rgb);
  4141. var x = xyz[0];
  4142. var y = xyz[1];
  4143. var z = xyz[2];
  4144. var l;
  4145. var a;
  4146. var b;
  4147. x /= 95.047;
  4148. y /= 100;
  4149. z /= 108.883;
  4150. x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
  4151. y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
  4152. z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
  4153. l = 116 * y - 16;
  4154. a = 500 * (x - y);
  4155. b = 200 * (y - z);
  4156. return [l, a, b];
  4157. };
  4158. convert.hsl.rgb = function(hsl) {
  4159. var h = hsl[0] / 360;
  4160. var s = hsl[1] / 100;
  4161. var l = hsl[2] / 100;
  4162. var t1;
  4163. var t2;
  4164. var t3;
  4165. var rgb;
  4166. var val;
  4167. if (s === 0) {
  4168. val = l * 255;
  4169. return [val, val, val];
  4170. }
  4171. if (l < 0.5) {
  4172. t2 = l * (1 + s);
  4173. } else {
  4174. t2 = l + s - l * s;
  4175. }
  4176. t1 = 2 * l - t2;
  4177. rgb = [0, 0, 0];
  4178. for (var i = 0; i < 3; i++) {
  4179. t3 = h + 1 / 3 * -(i - 1);
  4180. if (t3 < 0) {
  4181. t3++;
  4182. }
  4183. if (t3 > 1) {
  4184. t3--;
  4185. }
  4186. if (6 * t3 < 1) {
  4187. val = t1 + (t2 - t1) * 6 * t3;
  4188. } else if (2 * t3 < 1) {
  4189. val = t2;
  4190. } else if (3 * t3 < 2) {
  4191. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  4192. } else {
  4193. val = t1;
  4194. }
  4195. rgb[i] = val * 255;
  4196. }
  4197. return rgb;
  4198. };
  4199. convert.hsl.hsv = function(hsl) {
  4200. var h = hsl[0];
  4201. var s = hsl[1] / 100;
  4202. var l = hsl[2] / 100;
  4203. var smin = s;
  4204. var lmin = Math.max(l, 0.01);
  4205. var sv;
  4206. var v;
  4207. l *= 2;
  4208. s *= l <= 1 ? l : 2 - l;
  4209. smin *= lmin <= 1 ? lmin : 2 - lmin;
  4210. v = (l + s) / 2;
  4211. sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
  4212. return [h, sv * 100, v * 100];
  4213. };
  4214. convert.hsv.rgb = function(hsv) {
  4215. var h = hsv[0] / 60;
  4216. var s = hsv[1] / 100;
  4217. var v = hsv[2] / 100;
  4218. var hi = Math.floor(h) % 6;
  4219. var f = h - Math.floor(h);
  4220. var p = 255 * v * (1 - s);
  4221. var q = 255 * v * (1 - s * f);
  4222. var t = 255 * v * (1 - s * (1 - f));
  4223. v *= 255;
  4224. switch (hi) {
  4225. case 0:
  4226. return [v, t, p];
  4227. case 1:
  4228. return [q, v, p];
  4229. case 2:
  4230. return [p, v, t];
  4231. case 3:
  4232. return [p, q, v];
  4233. case 4:
  4234. return [t, p, v];
  4235. case 5:
  4236. return [v, p, q];
  4237. }
  4238. };
  4239. convert.hsv.hsl = function(hsv) {
  4240. var h = hsv[0];
  4241. var s = hsv[1] / 100;
  4242. var v = hsv[2] / 100;
  4243. var vmin = Math.max(v, 0.01);
  4244. var lmin;
  4245. var sl;
  4246. var l;
  4247. l = (2 - s) * v;
  4248. lmin = (2 - s) * vmin;
  4249. sl = s * vmin;
  4250. sl /= lmin <= 1 ? lmin : 2 - lmin;
  4251. sl = sl || 0;
  4252. l /= 2;
  4253. return [h, sl * 100, l * 100];
  4254. };
  4255. convert.hwb.rgb = function(hwb) {
  4256. var h = hwb[0] / 360;
  4257. var wh = hwb[1] / 100;
  4258. var bl = hwb[2] / 100;
  4259. var ratio = wh + bl;
  4260. var i;
  4261. var v;
  4262. var f;
  4263. var n;
  4264. if (ratio > 1) {
  4265. wh /= ratio;
  4266. bl /= ratio;
  4267. }
  4268. i = Math.floor(6 * h);
  4269. v = 1 - bl;
  4270. f = 6 * h - i;
  4271. if ((i & 1) !== 0) {
  4272. f = 1 - f;
  4273. }
  4274. n = wh + f * (v - wh);
  4275. var r;
  4276. var g;
  4277. var b;
  4278. switch (i) {
  4279. default:
  4280. case 6:
  4281. case 0:
  4282. r = v;
  4283. g = n;
  4284. b = wh;
  4285. break;
  4286. case 1:
  4287. r = n;
  4288. g = v;
  4289. b = wh;
  4290. break;
  4291. case 2:
  4292. r = wh;
  4293. g = v;
  4294. b = n;
  4295. break;
  4296. case 3:
  4297. r = wh;
  4298. g = n;
  4299. b = v;
  4300. break;
  4301. case 4:
  4302. r = n;
  4303. g = wh;
  4304. b = v;
  4305. break;
  4306. case 5:
  4307. r = v;
  4308. g = wh;
  4309. b = n;
  4310. break;
  4311. }
  4312. return [r * 255, g * 255, b * 255];
  4313. };
  4314. convert.cmyk.rgb = function(cmyk) {
  4315. var c = cmyk[0] / 100;
  4316. var m = cmyk[1] / 100;
  4317. var y = cmyk[2] / 100;
  4318. var k = cmyk[3] / 100;
  4319. var r;
  4320. var g;
  4321. var b;
  4322. r = 1 - Math.min(1, c * (1 - k) + k);
  4323. g = 1 - Math.min(1, m * (1 - k) + k);
  4324. b = 1 - Math.min(1, y * (1 - k) + k);
  4325. return [r * 255, g * 255, b * 255];
  4326. };
  4327. convert.xyz.rgb = function(xyz) {
  4328. var x = xyz[0] / 100;
  4329. var y = xyz[1] / 100;
  4330. var z = xyz[2] / 100;
  4331. var r;
  4332. var g;
  4333. var b;
  4334. r = x * 3.2406 + y * -1.5372 + z * -0.4986;
  4335. g = x * -0.9689 + y * 1.8758 + z * 0.0415;
  4336. b = x * 0.0557 + y * -0.204 + z * 1.057;
  4337. r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92;
  4338. g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92;
  4339. b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92;
  4340. r = Math.min(Math.max(0, r), 1);
  4341. g = Math.min(Math.max(0, g), 1);
  4342. b = Math.min(Math.max(0, b), 1);
  4343. return [r * 255, g * 255, b * 255];
  4344. };
  4345. convert.xyz.lab = function(xyz) {
  4346. var x = xyz[0];
  4347. var y = xyz[1];
  4348. var z = xyz[2];
  4349. var l;
  4350. var a;
  4351. var b;
  4352. x /= 95.047;
  4353. y /= 100;
  4354. z /= 108.883;
  4355. x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
  4356. y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
  4357. z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
  4358. l = 116 * y - 16;
  4359. a = 500 * (x - y);
  4360. b = 200 * (y - z);
  4361. return [l, a, b];
  4362. };
  4363. convert.lab.xyz = function(lab) {
  4364. var l = lab[0];
  4365. var a = lab[1];
  4366. var b = lab[2];
  4367. var x;
  4368. var y;
  4369. var z;
  4370. y = (l + 16) / 116;
  4371. x = a / 500 + y;
  4372. z = y - b / 200;
  4373. var y2 = Math.pow(y, 3);
  4374. var x2 = Math.pow(x, 3);
  4375. var z2 = Math.pow(z, 3);
  4376. y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
  4377. x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
  4378. z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
  4379. x *= 95.047;
  4380. y *= 100;
  4381. z *= 108.883;
  4382. return [x, y, z];
  4383. };
  4384. convert.lab.lch = function(lab) {
  4385. var l = lab[0];
  4386. var a = lab[1];
  4387. var b = lab[2];
  4388. var hr;
  4389. var h;
  4390. var c;
  4391. hr = Math.atan2(b, a);
  4392. h = hr * 360 / 2 / Math.PI;
  4393. if (h < 0) {
  4394. h += 360;
  4395. }
  4396. c = Math.sqrt(a * a + b * b);
  4397. return [l, c, h];
  4398. };
  4399. convert.lch.lab = function(lch) {
  4400. var l = lch[0];
  4401. var c = lch[1];
  4402. var h = lch[2];
  4403. var a;
  4404. var b;
  4405. var hr;
  4406. hr = h / 360 * 2 * Math.PI;
  4407. a = c * Math.cos(hr);
  4408. b = c * Math.sin(hr);
  4409. return [l, a, b];
  4410. };
  4411. convert.rgb.ansi16 = function(args) {
  4412. var r = args[0];
  4413. var g = args[1];
  4414. var b = args[2];
  4415. var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
  4416. value = Math.round(value / 50);
  4417. if (value === 0) {
  4418. return 30;
  4419. }
  4420. var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
  4421. if (value === 2) {
  4422. ansi += 60;
  4423. }
  4424. return ansi;
  4425. };
  4426. convert.hsv.ansi16 = function(args) {
  4427. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
  4428. };
  4429. convert.rgb.ansi256 = function(args) {
  4430. var r = args[0];
  4431. var g = args[1];
  4432. var b = args[2];
  4433. if (r === g && g === b) {
  4434. if (r < 8) {
  4435. return 16;
  4436. }
  4437. if (r > 248) {
  4438. return 231;
  4439. }
  4440. return Math.round((r - 8) / 247 * 24) + 232;
  4441. }
  4442. var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
  4443. return ansi;
  4444. };
  4445. convert.ansi16.rgb = function(args) {
  4446. var color = args % 10;
  4447. if (color === 0 || color === 7) {
  4448. if (args > 50) {
  4449. color += 3.5;
  4450. }
  4451. color = color / 10.5 * 255;
  4452. return [color, color, color];
  4453. }
  4454. var mult = (~~(args > 50) + 1) * 0.5;
  4455. var r = (color & 1) * mult * 255;
  4456. var g = (color >> 1 & 1) * mult * 255;
  4457. var b = (color >> 2 & 1) * mult * 255;
  4458. return [r, g, b];
  4459. };
  4460. convert.ansi256.rgb = function(args) {
  4461. if (args >= 232) {
  4462. var c = (args - 232) * 10 + 8;
  4463. return [c, c, c];
  4464. }
  4465. args -= 16;
  4466. var rem;
  4467. var r = Math.floor(args / 36) / 5 * 255;
  4468. var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
  4469. var b = rem % 6 / 5 * 255;
  4470. return [r, g, b];
  4471. };
  4472. convert.rgb.hex = function(args) {
  4473. var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
  4474. var string = integer.toString(16).toUpperCase();
  4475. return "000000".substring(string.length) + string;
  4476. };
  4477. convert.hex.rgb = function(args) {
  4478. var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
  4479. if (!match) {
  4480. return [0, 0, 0];
  4481. }
  4482. var colorString = match[0];
  4483. if (match[0].length === 3) {
  4484. colorString = colorString.split("").map(function(char) {
  4485. return char + char;
  4486. }).join("");
  4487. }
  4488. var integer = parseInt(colorString, 16);
  4489. var r = integer >> 16 & 255;
  4490. var g = integer >> 8 & 255;
  4491. var b = integer & 255;
  4492. return [r, g, b];
  4493. };
  4494. convert.rgb.hcg = function(rgb) {
  4495. var r = rgb[0] / 255;
  4496. var g = rgb[1] / 255;
  4497. var b = rgb[2] / 255;
  4498. var max = Math.max(Math.max(r, g), b);
  4499. var min = Math.min(Math.min(r, g), b);
  4500. var chroma = max - min;
  4501. var grayscale;
  4502. var hue;
  4503. if (chroma < 1) {
  4504. grayscale = min / (1 - chroma);
  4505. } else {
  4506. grayscale = 0;
  4507. }
  4508. if (chroma <= 0) {
  4509. hue = 0;
  4510. } else if (max === r) {
  4511. hue = (g - b) / chroma % 6;
  4512. } else if (max === g) {
  4513. hue = 2 + (b - r) / chroma;
  4514. } else {
  4515. hue = 4 + (r - g) / chroma + 4;
  4516. }
  4517. hue /= 6;
  4518. hue %= 1;
  4519. return [hue * 360, chroma * 100, grayscale * 100];
  4520. };
  4521. convert.hsl.hcg = function(hsl) {
  4522. var s = hsl[1] / 100;
  4523. var l = hsl[2] / 100;
  4524. var c = 1;
  4525. var f = 0;
  4526. if (l < 0.5) {
  4527. c = 2 * s * l;
  4528. } else {
  4529. c = 2 * s * (1 - l);
  4530. }
  4531. if (c < 1) {
  4532. f = (l - 0.5 * c) / (1 - c);
  4533. }
  4534. return [hsl[0], c * 100, f * 100];
  4535. };
  4536. convert.hsv.hcg = function(hsv) {
  4537. var s = hsv[1] / 100;
  4538. var v = hsv[2] / 100;
  4539. var c = s * v;
  4540. var f = 0;
  4541. if (c < 1) {
  4542. f = (v - c) / (1 - c);
  4543. }
  4544. return [hsv[0], c * 100, f * 100];
  4545. };
  4546. convert.hcg.rgb = function(hcg) {
  4547. var h = hcg[0] / 360;
  4548. var c = hcg[1] / 100;
  4549. var g = hcg[2] / 100;
  4550. if (c === 0) {
  4551. return [g * 255, g * 255, g * 255];
  4552. }
  4553. var pure = [0, 0, 0];
  4554. var hi = h % 1 * 6;
  4555. var v = hi % 1;
  4556. var w = 1 - v;
  4557. var mg = 0;
  4558. switch (Math.floor(hi)) {
  4559. case 0:
  4560. pure[0] = 1;
  4561. pure[1] = v;
  4562. pure[2] = 0;
  4563. break;
  4564. case 1:
  4565. pure[0] = w;
  4566. pure[1] = 1;
  4567. pure[2] = 0;
  4568. break;
  4569. case 2:
  4570. pure[0] = 0;
  4571. pure[1] = 1;
  4572. pure[2] = v;
  4573. break;
  4574. case 3:
  4575. pure[0] = 0;
  4576. pure[1] = w;
  4577. pure[2] = 1;
  4578. break;
  4579. case 4:
  4580. pure[0] = v;
  4581. pure[1] = 0;
  4582. pure[2] = 1;
  4583. break;
  4584. default:
  4585. pure[0] = 1;
  4586. pure[1] = 0;
  4587. pure[2] = w;
  4588. }
  4589. mg = (1 - c) * g;
  4590. return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
  4591. };
  4592. convert.hcg.hsv = function(hcg) {
  4593. var c = hcg[1] / 100;
  4594. var g = hcg[2] / 100;
  4595. var v = c + g * (1 - c);
  4596. var f = 0;
  4597. if (v > 0) {
  4598. f = c / v;
  4599. }
  4600. return [hcg[0], f * 100, v * 100];
  4601. };
  4602. convert.hcg.hsl = function(hcg) {
  4603. var c = hcg[1] / 100;
  4604. var g = hcg[2] / 100;
  4605. var l = g * (1 - c) + 0.5 * c;
  4606. var s = 0;
  4607. if (l > 0 && l < 0.5) {
  4608. s = c / (2 * l);
  4609. } else if (l >= 0.5 && l < 1) {
  4610. s = c / (2 * (1 - l));
  4611. }
  4612. return [hcg[0], s * 100, l * 100];
  4613. };
  4614. convert.hcg.hwb = function(hcg) {
  4615. var c = hcg[1] / 100;
  4616. var g = hcg[2] / 100;
  4617. var v = c + g * (1 - c);
  4618. return [hcg[0], (v - c) * 100, (1 - v) * 100];
  4619. };
  4620. convert.hwb.hcg = function(hwb) {
  4621. var w = hwb[1] / 100;
  4622. var b = hwb[2] / 100;
  4623. var v = 1 - b;
  4624. var c = v - w;
  4625. var g = 0;
  4626. if (c < 1) {
  4627. g = (v - c) / (1 - c);
  4628. }
  4629. return [hwb[0], c * 100, g * 100];
  4630. };
  4631. convert.apple.rgb = function(apple) {
  4632. return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
  4633. };
  4634. convert.rgb.apple = function(rgb) {
  4635. return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
  4636. };
  4637. convert.gray.rgb = function(args) {
  4638. return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
  4639. };
  4640. convert.gray.hsl = convert.gray.hsv = function(args) {
  4641. return [0, 0, args[0]];
  4642. };
  4643. convert.gray.hwb = function(gray) {
  4644. return [0, 100, gray[0]];
  4645. };
  4646. convert.gray.cmyk = function(gray) {
  4647. return [0, 0, 0, gray[0]];
  4648. };
  4649. convert.gray.lab = function(gray) {
  4650. return [gray[0], 0, 0];
  4651. };
  4652. convert.gray.hex = function(gray) {
  4653. var val = Math.round(gray[0] / 100 * 255) & 255;
  4654. var integer = (val << 16) + (val << 8) + val;
  4655. var string = integer.toString(16).toUpperCase();
  4656. return "000000".substring(string.length) + string;
  4657. };
  4658. convert.rgb.gray = function(rgb) {
  4659. var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
  4660. return [val / 255 * 100];
  4661. };
  4662. }
  4663. });
  4664. var require_route = __commonJS2({
  4665. "node_modules/color-convert/route.js"(exports2, module2) {
  4666. var conversions = require_conversions();
  4667. function buildGraph() {
  4668. var graph = {};
  4669. var models = Object.keys(conversions);
  4670. for (var len = models.length, i = 0; i < len; i++) {
  4671. graph[models[i]] = {
  4672. distance: -1,
  4673. parent: null
  4674. };
  4675. }
  4676. return graph;
  4677. }
  4678. function deriveBFS(fromModel) {
  4679. var graph = buildGraph();
  4680. var queue = [fromModel];
  4681. graph[fromModel].distance = 0;
  4682. while (queue.length) {
  4683. var current = queue.pop();
  4684. var adjacents = Object.keys(conversions[current]);
  4685. for (var len = adjacents.length, i = 0; i < len; i++) {
  4686. var adjacent = adjacents[i];
  4687. var node = graph[adjacent];
  4688. if (node.distance === -1) {
  4689. node.distance = graph[current].distance + 1;
  4690. node.parent = current;
  4691. queue.unshift(adjacent);
  4692. }
  4693. }
  4694. }
  4695. return graph;
  4696. }
  4697. function link(from, to) {
  4698. return function(args) {
  4699. return to(from(args));
  4700. };
  4701. }
  4702. function wrapConversion(toModel, graph) {
  4703. var path = [graph[toModel].parent, toModel];
  4704. var fn = conversions[graph[toModel].parent][toModel];
  4705. var cur = graph[toModel].parent;
  4706. while (graph[cur].parent) {
  4707. path.unshift(graph[cur].parent);
  4708. fn = link(conversions[graph[cur].parent][cur], fn);
  4709. cur = graph[cur].parent;
  4710. }
  4711. fn.conversion = path;
  4712. return fn;
  4713. }
  4714. module2.exports = function(fromModel) {
  4715. var graph = deriveBFS(fromModel);
  4716. var conversion = {};
  4717. var models = Object.keys(graph);
  4718. for (var len = models.length, i = 0; i < len; i++) {
  4719. var toModel = models[i];
  4720. var node = graph[toModel];
  4721. if (node.parent === null) {
  4722. continue;
  4723. }
  4724. conversion[toModel] = wrapConversion(toModel, graph);
  4725. }
  4726. return conversion;
  4727. };
  4728. }
  4729. });
  4730. var require_color_convert = __commonJS2({
  4731. "node_modules/color-convert/index.js"(exports2, module2) {
  4732. var conversions = require_conversions();
  4733. var route = require_route();
  4734. var convert = {};
  4735. var models = Object.keys(conversions);
  4736. function wrapRaw(fn) {
  4737. var wrappedFn = function(args) {
  4738. if (args === void 0 || args === null) {
  4739. return args;
  4740. }
  4741. if (arguments.length > 1) {
  4742. args = Array.prototype.slice.call(arguments);
  4743. }
  4744. return fn(args);
  4745. };
  4746. if ("conversion" in fn) {
  4747. wrappedFn.conversion = fn.conversion;
  4748. }
  4749. return wrappedFn;
  4750. }
  4751. function wrapRounded(fn) {
  4752. var wrappedFn = function(args) {
  4753. if (args === void 0 || args === null) {
  4754. return args;
  4755. }
  4756. if (arguments.length > 1) {
  4757. args = Array.prototype.slice.call(arguments);
  4758. }
  4759. var result = fn(args);
  4760. if (typeof result === "object") {
  4761. for (var len = result.length, i = 0; i < len; i++) {
  4762. result[i] = Math.round(result[i]);
  4763. }
  4764. }
  4765. return result;
  4766. };
  4767. if ("conversion" in fn) {
  4768. wrappedFn.conversion = fn.conversion;
  4769. }
  4770. return wrappedFn;
  4771. }
  4772. models.forEach(function(fromModel) {
  4773. convert[fromModel] = {};
  4774. Object.defineProperty(convert[fromModel], "channels", {
  4775. value: conversions[fromModel].channels
  4776. });
  4777. Object.defineProperty(convert[fromModel], "labels", {
  4778. value: conversions[fromModel].labels
  4779. });
  4780. var routes = route(fromModel);
  4781. var routeModels = Object.keys(routes);
  4782. routeModels.forEach(function(toModel) {
  4783. var fn = routes[toModel];
  4784. convert[fromModel][toModel] = wrapRounded(fn);
  4785. convert[fromModel][toModel].raw = wrapRaw(fn);
  4786. });
  4787. });
  4788. module2.exports = convert;
  4789. }
  4790. });
  4791. var require_ansi_styles = __commonJS2({
  4792. "node_modules/ansi-styles/index.js"(exports2, module2) {
  4793. "use strict";
  4794. var colorConvert = require_color_convert();
  4795. var wrapAnsi16 = (fn, offset) => function() {
  4796. const code = fn.apply(colorConvert, arguments);
  4797. return `\x1B[${code + offset}m`;
  4798. };
  4799. var wrapAnsi256 = (fn, offset) => function() {
  4800. const code = fn.apply(colorConvert, arguments);
  4801. return `\x1B[${38 + offset};5;${code}m`;
  4802. };
  4803. var wrapAnsi16m = (fn, offset) => function() {
  4804. const rgb = fn.apply(colorConvert, arguments);
  4805. return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
  4806. };
  4807. function assembleStyles() {
  4808. const codes = /* @__PURE__ */ new Map();
  4809. const styles = {
  4810. modifier: {
  4811. reset: [0, 0],
  4812. bold: [1, 22],
  4813. dim: [2, 22],
  4814. italic: [3, 23],
  4815. underline: [4, 24],
  4816. inverse: [7, 27],
  4817. hidden: [8, 28],
  4818. strikethrough: [9, 29]
  4819. },
  4820. color: {
  4821. black: [30, 39],
  4822. red: [31, 39],
  4823. green: [32, 39],
  4824. yellow: [33, 39],
  4825. blue: [34, 39],
  4826. magenta: [35, 39],
  4827. cyan: [36, 39],
  4828. white: [37, 39],
  4829. gray: [90, 39],
  4830. redBright: [91, 39],
  4831. greenBright: [92, 39],
  4832. yellowBright: [93, 39],
  4833. blueBright: [94, 39],
  4834. magentaBright: [95, 39],
  4835. cyanBright: [96, 39],
  4836. whiteBright: [97, 39]
  4837. },
  4838. bgColor: {
  4839. bgBlack: [40, 49],
  4840. bgRed: [41, 49],
  4841. bgGreen: [42, 49],
  4842. bgYellow: [43, 49],
  4843. bgBlue: [44, 49],
  4844. bgMagenta: [45, 49],
  4845. bgCyan: [46, 49],
  4846. bgWhite: [47, 49],
  4847. bgBlackBright: [100, 49],
  4848. bgRedBright: [101, 49],
  4849. bgGreenBright: [102, 49],
  4850. bgYellowBright: [103, 49],
  4851. bgBlueBright: [104, 49],
  4852. bgMagentaBright: [105, 49],
  4853. bgCyanBright: [106, 49],
  4854. bgWhiteBright: [107, 49]
  4855. }
  4856. };
  4857. styles.color.grey = styles.color.gray;
  4858. for (const groupName of Object.keys(styles)) {
  4859. const group = styles[groupName];
  4860. for (const styleName of Object.keys(group)) {
  4861. const style = group[styleName];
  4862. styles[styleName] = {
  4863. open: `\x1B[${style[0]}m`,
  4864. close: `\x1B[${style[1]}m`
  4865. };
  4866. group[styleName] = styles[styleName];
  4867. codes.set(style[0], style[1]);
  4868. }
  4869. Object.defineProperty(styles, groupName, {
  4870. value: group,
  4871. enumerable: false
  4872. });
  4873. Object.defineProperty(styles, "codes", {
  4874. value: codes,
  4875. enumerable: false
  4876. });
  4877. }
  4878. const ansi2ansi = (n) => n;
  4879. const rgb2rgb = (r, g, b) => [r, g, b];
  4880. styles.color.close = "\x1B[39m";
  4881. styles.bgColor.close = "\x1B[49m";
  4882. styles.color.ansi = {
  4883. ansi: wrapAnsi16(ansi2ansi, 0)
  4884. };
  4885. styles.color.ansi256 = {
  4886. ansi256: wrapAnsi256(ansi2ansi, 0)
  4887. };
  4888. styles.color.ansi16m = {
  4889. rgb: wrapAnsi16m(rgb2rgb, 0)
  4890. };
  4891. styles.bgColor.ansi = {
  4892. ansi: wrapAnsi16(ansi2ansi, 10)
  4893. };
  4894. styles.bgColor.ansi256 = {
  4895. ansi256: wrapAnsi256(ansi2ansi, 10)
  4896. };
  4897. styles.bgColor.ansi16m = {
  4898. rgb: wrapAnsi16m(rgb2rgb, 10)
  4899. };
  4900. for (let key of Object.keys(colorConvert)) {
  4901. if (typeof colorConvert[key] !== "object") {
  4902. continue;
  4903. }
  4904. const suite = colorConvert[key];
  4905. if (key === "ansi16") {
  4906. key = "ansi";
  4907. }
  4908. if ("ansi16" in suite) {
  4909. styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
  4910. styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
  4911. }
  4912. if ("ansi256" in suite) {
  4913. styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
  4914. styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
  4915. }
  4916. if ("rgb" in suite) {
  4917. styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
  4918. styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
  4919. }
  4920. }
  4921. return styles;
  4922. }
  4923. Object.defineProperty(module2, "exports", {
  4924. enumerable: true,
  4925. get: assembleStyles
  4926. });
  4927. }
  4928. });
  4929. var require_has_flag = __commonJS2({
  4930. "node_modules/vnopts/node_modules/has-flag/index.js"(exports2, module2) {
  4931. "use strict";
  4932. module2.exports = (flag, argv) => {
  4933. argv = argv || process.argv;
  4934. const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
  4935. const pos = argv.indexOf(prefix + flag);
  4936. const terminatorPos = argv.indexOf("--");
  4937. return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
  4938. };
  4939. }
  4940. });
  4941. var require_supports_color = __commonJS2({
  4942. "node_modules/vnopts/node_modules/supports-color/index.js"(exports2, module2) {
  4943. "use strict";
  4944. var os = require("os");
  4945. var hasFlag = require_has_flag();
  4946. var env = process.env;
  4947. var forceColor;
  4948. if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
  4949. forceColor = false;
  4950. } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
  4951. forceColor = true;
  4952. }
  4953. if ("FORCE_COLOR" in env) {
  4954. forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
  4955. }
  4956. function translateLevel(level) {
  4957. if (level === 0) {
  4958. return false;
  4959. }
  4960. return {
  4961. level,
  4962. hasBasic: true,
  4963. has256: level >= 2,
  4964. has16m: level >= 3
  4965. };
  4966. }
  4967. function supportsColor(stream) {
  4968. if (forceColor === false) {
  4969. return 0;
  4970. }
  4971. if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
  4972. return 3;
  4973. }
  4974. if (hasFlag("color=256")) {
  4975. return 2;
  4976. }
  4977. if (stream && !stream.isTTY && forceColor !== true) {
  4978. return 0;
  4979. }
  4980. const min = forceColor ? 1 : 0;
  4981. if (process.platform === "win32") {
  4982. const osRelease = os.release().split(".");
  4983. if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
  4984. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  4985. }
  4986. return 1;
  4987. }
  4988. if ("CI" in env) {
  4989. if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
  4990. return 1;
  4991. }
  4992. return min;
  4993. }
  4994. if ("TEAMCITY_VERSION" in env) {
  4995. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
  4996. }
  4997. if (env.COLORTERM === "truecolor") {
  4998. return 3;
  4999. }
  5000. if ("TERM_PROGRAM" in env) {
  5001. const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
  5002. switch (env.TERM_PROGRAM) {
  5003. case "iTerm.app":
  5004. return version2 >= 3 ? 3 : 2;
  5005. case "Apple_Terminal":
  5006. return 2;
  5007. }
  5008. }
  5009. if (/-256(color)?$/i.test(env.TERM)) {
  5010. return 2;
  5011. }
  5012. if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  5013. return 1;
  5014. }
  5015. if ("COLORTERM" in env) {
  5016. return 1;
  5017. }
  5018. if (env.TERM === "dumb") {
  5019. return min;
  5020. }
  5021. return min;
  5022. }
  5023. function getSupportLevel(stream) {
  5024. const level = supportsColor(stream);
  5025. return translateLevel(level);
  5026. }
  5027. module2.exports = {
  5028. supportsColor: getSupportLevel,
  5029. stdout: getSupportLevel(process.stdout),
  5030. stderr: getSupportLevel(process.stderr)
  5031. };
  5032. }
  5033. });
  5034. var require_templates = __commonJS2({
  5035. "node_modules/vnopts/node_modules/chalk/templates.js"(exports2, module2) {
  5036. "use strict";
  5037. var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
  5038. var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
  5039. var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
  5040. var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
  5041. var ESCAPES = /* @__PURE__ */ new Map([["n", "\n"], ["r", "\r"], ["t", " "], ["b", "\b"], ["f", "\f"], ["v", "\v"], ["0", "\0"], ["\\", "\\"], ["e", "\x1B"], ["a", "\x07"]]);
  5042. function unescape(c) {
  5043. if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) {
  5044. return String.fromCharCode(parseInt(c.slice(1), 16));
  5045. }
  5046. return ESCAPES.get(c) || c;
  5047. }
  5048. function parseArguments(name, args) {
  5049. const results = [];
  5050. const chunks = args.trim().split(/\s*,\s*/g);
  5051. let matches;
  5052. for (const chunk of chunks) {
  5053. if (!isNaN(chunk)) {
  5054. results.push(Number(chunk));
  5055. } else if (matches = chunk.match(STRING_REGEX)) {
  5056. results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
  5057. } else {
  5058. throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
  5059. }
  5060. }
  5061. return results;
  5062. }
  5063. function parseStyle(style) {
  5064. STYLE_REGEX.lastIndex = 0;
  5065. const results = [];
  5066. let matches;
  5067. while ((matches = STYLE_REGEX.exec(style)) !== null) {
  5068. const name = matches[1];
  5069. if (matches[2]) {
  5070. const args = parseArguments(name, matches[2]);
  5071. results.push([name].concat(args));
  5072. } else {
  5073. results.push([name]);
  5074. }
  5075. }
  5076. return results;
  5077. }
  5078. function buildStyle(chalk, styles) {
  5079. const enabled = {};
  5080. for (const layer of styles) {
  5081. for (const style of layer.styles) {
  5082. enabled[style[0]] = layer.inverse ? null : style.slice(1);
  5083. }
  5084. }
  5085. let current = chalk;
  5086. for (const styleName of Object.keys(enabled)) {
  5087. if (Array.isArray(enabled[styleName])) {
  5088. if (!(styleName in current)) {
  5089. throw new Error(`Unknown Chalk style: ${styleName}`);
  5090. }
  5091. if (enabled[styleName].length > 0) {
  5092. current = current[styleName].apply(current, enabled[styleName]);
  5093. } else {
  5094. current = current[styleName];
  5095. }
  5096. }
  5097. }
  5098. return current;
  5099. }
  5100. module2.exports = (chalk, tmp) => {
  5101. const styles = [];
  5102. const chunks = [];
  5103. let chunk = [];
  5104. tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
  5105. if (escapeChar) {
  5106. chunk.push(unescape(escapeChar));
  5107. } else if (style) {
  5108. const str = chunk.join("");
  5109. chunk = [];
  5110. chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
  5111. styles.push({
  5112. inverse,
  5113. styles: parseStyle(style)
  5114. });
  5115. } else if (close) {
  5116. if (styles.length === 0) {
  5117. throw new Error("Found extraneous } in Chalk template literal");
  5118. }
  5119. chunks.push(buildStyle(chalk, styles)(chunk.join("")));
  5120. chunk = [];
  5121. styles.pop();
  5122. } else {
  5123. chunk.push(chr);
  5124. }
  5125. });
  5126. chunks.push(chunk.join(""));
  5127. if (styles.length > 0) {
  5128. const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
  5129. throw new Error(errMsg);
  5130. }
  5131. return chunks.join("");
  5132. };
  5133. }
  5134. });
  5135. var require_chalk = __commonJS2({
  5136. "node_modules/vnopts/node_modules/chalk/index.js"(exports2, module2) {
  5137. "use strict";
  5138. var escapeStringRegexp = require_escape_string_regexp2();
  5139. var ansiStyles = require_ansi_styles();
  5140. var stdoutColor = require_supports_color().stdout;
  5141. var template = require_templates();
  5142. var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm");
  5143. var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
  5144. var skipModels = /* @__PURE__ */ new Set(["gray"]);
  5145. var styles = /* @__PURE__ */ Object.create(null);
  5146. function applyOptions(obj, options) {
  5147. options = options || {};
  5148. const scLevel = stdoutColor ? stdoutColor.level : 0;
  5149. obj.level = options.level === void 0 ? scLevel : options.level;
  5150. obj.enabled = "enabled" in options ? options.enabled : obj.level > 0;
  5151. }
  5152. function Chalk(options) {
  5153. if (!this || !(this instanceof Chalk) || this.template) {
  5154. const chalk = {};
  5155. applyOptions(chalk, options);
  5156. chalk.template = function() {
  5157. const args = [].slice.call(arguments);
  5158. return chalkTag.apply(null, [chalk.template].concat(args));
  5159. };
  5160. Object.setPrototypeOf(chalk, Chalk.prototype);
  5161. Object.setPrototypeOf(chalk.template, chalk);
  5162. chalk.template.constructor = Chalk;
  5163. return chalk.template;
  5164. }
  5165. applyOptions(this, options);
  5166. }
  5167. if (isSimpleWindowsTerm) {
  5168. ansiStyles.blue.open = "\x1B[94m";
  5169. }
  5170. for (const key of Object.keys(ansiStyles)) {
  5171. ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
  5172. styles[key] = {
  5173. get() {
  5174. const codes = ansiStyles[key];
  5175. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
  5176. }
  5177. };
  5178. }
  5179. styles.visible = {
  5180. get() {
  5181. return build.call(this, this._styles || [], true, "visible");
  5182. }
  5183. };
  5184. ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), "g");
  5185. for (const model of Object.keys(ansiStyles.color.ansi)) {
  5186. if (skipModels.has(model)) {
  5187. continue;
  5188. }
  5189. styles[model] = {
  5190. get() {
  5191. const level = this.level;
  5192. return function() {
  5193. const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
  5194. const codes = {
  5195. open,
  5196. close: ansiStyles.color.close,
  5197. closeRe: ansiStyles.color.closeRe
  5198. };
  5199. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
  5200. };
  5201. }
  5202. };
  5203. }
  5204. ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), "g");
  5205. for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
  5206. if (skipModels.has(model)) {
  5207. continue;
  5208. }
  5209. const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
  5210. styles[bgModel] = {
  5211. get() {
  5212. const level = this.level;
  5213. return function() {
  5214. const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
  5215. const codes = {
  5216. open,
  5217. close: ansiStyles.bgColor.close,
  5218. closeRe: ansiStyles.bgColor.closeRe
  5219. };
  5220. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
  5221. };
  5222. }
  5223. };
  5224. }
  5225. var proto = Object.defineProperties(() => {
  5226. }, styles);
  5227. function build(_styles, _empty, key) {
  5228. const builder = function() {
  5229. return applyStyle.apply(builder, arguments);
  5230. };
  5231. builder._styles = _styles;
  5232. builder._empty = _empty;
  5233. const self2 = this;
  5234. Object.defineProperty(builder, "level", {
  5235. enumerable: true,
  5236. get() {
  5237. return self2.level;
  5238. },
  5239. set(level) {
  5240. self2.level = level;
  5241. }
  5242. });
  5243. Object.defineProperty(builder, "enabled", {
  5244. enumerable: true,
  5245. get() {
  5246. return self2.enabled;
  5247. },
  5248. set(enabled) {
  5249. self2.enabled = enabled;
  5250. }
  5251. });
  5252. builder.hasGrey = this.hasGrey || key === "gray" || key === "grey";
  5253. builder.__proto__ = proto;
  5254. return builder;
  5255. }
  5256. function applyStyle() {
  5257. const args = arguments;
  5258. const argsLen = args.length;
  5259. let str = String(arguments[0]);
  5260. if (argsLen === 0) {
  5261. return "";
  5262. }
  5263. if (argsLen > 1) {
  5264. for (let a = 1; a < argsLen; a++) {
  5265. str += " " + args[a];
  5266. }
  5267. }
  5268. if (!this.enabled || this.level <= 0 || !str) {
  5269. return this._empty ? "" : str;
  5270. }
  5271. const originalDim = ansiStyles.dim.open;
  5272. if (isSimpleWindowsTerm && this.hasGrey) {
  5273. ansiStyles.dim.open = "";
  5274. }
  5275. for (const code of this._styles.slice().reverse()) {
  5276. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  5277. str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
  5278. }
  5279. ansiStyles.dim.open = originalDim;
  5280. return str;
  5281. }
  5282. function chalkTag(chalk, strings) {
  5283. if (!Array.isArray(strings)) {
  5284. return [].slice.call(arguments, 1).join(" ");
  5285. }
  5286. const args = [].slice.call(arguments, 2);
  5287. const parts = [strings.raw[0]];
  5288. for (let i = 1; i < strings.length; i++) {
  5289. parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
  5290. parts.push(String(strings.raw[i]));
  5291. }
  5292. return template(chalk, parts.join(""));
  5293. }
  5294. Object.defineProperties(Chalk.prototype, styles);
  5295. module2.exports = Chalk();
  5296. module2.exports.supportsColor = stdoutColor;
  5297. module2.exports.default = module2.exports;
  5298. }
  5299. });
  5300. var require_common = __commonJS2({
  5301. "node_modules/vnopts/lib/handlers/deprecated/common.js"(exports2) {
  5302. "use strict";
  5303. Object.defineProperty(exports2, "__esModule", {
  5304. value: true
  5305. });
  5306. var chalk_1 = require_chalk();
  5307. exports2.commonDeprecatedHandler = (keyOrPair, redirectTo, {
  5308. descriptor
  5309. }) => {
  5310. const messages = [`${chalk_1.default.yellow(typeof keyOrPair === "string" ? descriptor.key(keyOrPair) : descriptor.pair(keyOrPair))} is deprecated`];
  5311. if (redirectTo) {
  5312. messages.push(`we now treat it as ${chalk_1.default.blue(typeof redirectTo === "string" ? descriptor.key(redirectTo) : descriptor.pair(redirectTo))}`);
  5313. }
  5314. return messages.join("; ") + ".";
  5315. };
  5316. }
  5317. });
  5318. var require_deprecated = __commonJS2({
  5319. "node_modules/vnopts/lib/handlers/deprecated/index.js"(exports2) {
  5320. "use strict";
  5321. Object.defineProperty(exports2, "__esModule", {
  5322. value: true
  5323. });
  5324. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  5325. tslib_1.__exportStar(require_common(), exports2);
  5326. }
  5327. });
  5328. var require_common2 = __commonJS2({
  5329. "node_modules/vnopts/lib/handlers/invalid/common.js"(exports2) {
  5330. "use strict";
  5331. Object.defineProperty(exports2, "__esModule", {
  5332. value: true
  5333. });
  5334. var chalk_1 = require_chalk();
  5335. exports2.commonInvalidHandler = (key, value, utils) => [`Invalid ${chalk_1.default.red(utils.descriptor.key(key))} value.`, `Expected ${chalk_1.default.blue(utils.schemas[key].expected(utils))},`, `but received ${chalk_1.default.red(utils.descriptor.value(value))}.`].join(" ");
  5336. }
  5337. });
  5338. var require_invalid = __commonJS2({
  5339. "node_modules/vnopts/lib/handlers/invalid/index.js"(exports2) {
  5340. "use strict";
  5341. Object.defineProperty(exports2, "__esModule", {
  5342. value: true
  5343. });
  5344. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  5345. tslib_1.__exportStar(require_common2(), exports2);
  5346. }
  5347. });
  5348. var require_leven = __commonJS2({
  5349. "node_modules/vnopts/node_modules/leven/index.js"(exports2, module2) {
  5350. "use strict";
  5351. var arr = [];
  5352. var charCodeCache = [];
  5353. module2.exports = function(a, b) {
  5354. if (a === b) {
  5355. return 0;
  5356. }
  5357. var swap = a;
  5358. if (a.length > b.length) {
  5359. a = b;
  5360. b = swap;
  5361. }
  5362. var aLen = a.length;
  5363. var bLen = b.length;
  5364. if (aLen === 0) {
  5365. return bLen;
  5366. }
  5367. if (bLen === 0) {
  5368. return aLen;
  5369. }
  5370. while (aLen > 0 && a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen)) {
  5371. aLen--;
  5372. bLen--;
  5373. }
  5374. if (aLen === 0) {
  5375. return bLen;
  5376. }
  5377. var start = 0;
  5378. while (start < aLen && a.charCodeAt(start) === b.charCodeAt(start)) {
  5379. start++;
  5380. }
  5381. aLen -= start;
  5382. bLen -= start;
  5383. if (aLen === 0) {
  5384. return bLen;
  5385. }
  5386. var bCharCode;
  5387. var ret;
  5388. var tmp;
  5389. var tmp2;
  5390. var i = 0;
  5391. var j = 0;
  5392. while (i < aLen) {
  5393. charCodeCache[start + i] = a.charCodeAt(start + i);
  5394. arr[i] = ++i;
  5395. }
  5396. while (j < bLen) {
  5397. bCharCode = b.charCodeAt(start + j);
  5398. tmp = j++;
  5399. ret = j;
  5400. for (i = 0; i < aLen; i++) {
  5401. tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
  5402. tmp = arr[i];
  5403. ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
  5404. }
  5405. }
  5406. return ret;
  5407. };
  5408. }
  5409. });
  5410. var require_leven2 = __commonJS2({
  5411. "node_modules/vnopts/lib/handlers/unknown/leven.js"(exports2) {
  5412. "use strict";
  5413. Object.defineProperty(exports2, "__esModule", {
  5414. value: true
  5415. });
  5416. var chalk_1 = require_chalk();
  5417. var leven = require_leven();
  5418. exports2.levenUnknownHandler = (key, value, {
  5419. descriptor,
  5420. logger,
  5421. schemas
  5422. }) => {
  5423. const messages = [`Ignored unknown option ${chalk_1.default.yellow(descriptor.pair({
  5424. key,
  5425. value
  5426. }))}.`];
  5427. const suggestion = Object.keys(schemas).sort().find((knownKey) => leven(key, knownKey) < 3);
  5428. if (suggestion) {
  5429. messages.push(`Did you mean ${chalk_1.default.blue(descriptor.key(suggestion))}?`);
  5430. }
  5431. logger.warn(messages.join(" "));
  5432. };
  5433. }
  5434. });
  5435. var require_unknown = __commonJS2({
  5436. "node_modules/vnopts/lib/handlers/unknown/index.js"(exports2) {
  5437. "use strict";
  5438. Object.defineProperty(exports2, "__esModule", {
  5439. value: true
  5440. });
  5441. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  5442. tslib_1.__exportStar(require_leven2(), exports2);
  5443. }
  5444. });
  5445. var require_handlers = __commonJS2({
  5446. "node_modules/vnopts/lib/handlers/index.js"(exports2) {
  5447. "use strict";
  5448. Object.defineProperty(exports2, "__esModule", {
  5449. value: true
  5450. });
  5451. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  5452. tslib_1.__exportStar(require_deprecated(), exports2);
  5453. tslib_1.__exportStar(require_invalid(), exports2);
  5454. tslib_1.__exportStar(require_unknown(), exports2);
  5455. }
  5456. });
  5457. var require_schema = __commonJS2({
  5458. "node_modules/vnopts/lib/schema.js"(exports2) {
  5459. "use strict";
  5460. Object.defineProperty(exports2, "__esModule", {
  5461. value: true
  5462. });
  5463. var HANDLER_KEYS = ["default", "expected", "validate", "deprecated", "forward", "redirect", "overlap", "preprocess", "postprocess"];
  5464. function createSchema(SchemaConstructor, parameters) {
  5465. const schema = new SchemaConstructor(parameters);
  5466. const subSchema = Object.create(schema);
  5467. for (const handlerKey of HANDLER_KEYS) {
  5468. if (handlerKey in parameters) {
  5469. subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema, Schema.prototype[handlerKey].length);
  5470. }
  5471. }
  5472. return subSchema;
  5473. }
  5474. exports2.createSchema = createSchema;
  5475. var Schema = class {
  5476. constructor(parameters) {
  5477. this.name = parameters.name;
  5478. }
  5479. static create(parameters) {
  5480. return createSchema(this, parameters);
  5481. }
  5482. default(_utils) {
  5483. return void 0;
  5484. }
  5485. expected(_utils) {
  5486. return "nothing";
  5487. }
  5488. validate(_value, _utils) {
  5489. return false;
  5490. }
  5491. deprecated(_value, _utils) {
  5492. return false;
  5493. }
  5494. forward(_value, _utils) {
  5495. return void 0;
  5496. }
  5497. redirect(_value, _utils) {
  5498. return void 0;
  5499. }
  5500. overlap(currentValue, _newValue, _utils) {
  5501. return currentValue;
  5502. }
  5503. preprocess(value, _utils) {
  5504. return value;
  5505. }
  5506. postprocess(value, _utils) {
  5507. return value;
  5508. }
  5509. };
  5510. exports2.Schema = Schema;
  5511. function normalizeHandler(handler, superSchema, handlerArgumentsLength) {
  5512. return typeof handler === "function" ? (...args) => handler(...args.slice(0, handlerArgumentsLength - 1), superSchema, ...args.slice(handlerArgumentsLength - 1)) : () => handler;
  5513. }
  5514. }
  5515. });
  5516. var require_alias = __commonJS2({
  5517. "node_modules/vnopts/lib/schemas/alias.js"(exports2) {
  5518. "use strict";
  5519. Object.defineProperty(exports2, "__esModule", {
  5520. value: true
  5521. });
  5522. var schema_1 = require_schema();
  5523. var AliasSchema = class extends schema_1.Schema {
  5524. constructor(parameters) {
  5525. super(parameters);
  5526. this._sourceName = parameters.sourceName;
  5527. }
  5528. expected(utils) {
  5529. return utils.schemas[this._sourceName].expected(utils);
  5530. }
  5531. validate(value, utils) {
  5532. return utils.schemas[this._sourceName].validate(value, utils);
  5533. }
  5534. redirect(_value, _utils) {
  5535. return this._sourceName;
  5536. }
  5537. };
  5538. exports2.AliasSchema = AliasSchema;
  5539. }
  5540. });
  5541. var require_any = __commonJS2({
  5542. "node_modules/vnopts/lib/schemas/any.js"(exports2) {
  5543. "use strict";
  5544. Object.defineProperty(exports2, "__esModule", {
  5545. value: true
  5546. });
  5547. var schema_1 = require_schema();
  5548. var AnySchema = class extends schema_1.Schema {
  5549. expected() {
  5550. return "anything";
  5551. }
  5552. validate() {
  5553. return true;
  5554. }
  5555. };
  5556. exports2.AnySchema = AnySchema;
  5557. }
  5558. });
  5559. var require_array2 = __commonJS2({
  5560. "node_modules/vnopts/lib/schemas/array.js"(exports2) {
  5561. "use strict";
  5562. Object.defineProperty(exports2, "__esModule", {
  5563. value: true
  5564. });
  5565. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  5566. var schema_1 = require_schema();
  5567. var ArraySchema = class extends schema_1.Schema {
  5568. constructor(_a) {
  5569. var {
  5570. valueSchema,
  5571. name = valueSchema.name
  5572. } = _a, handlers = tslib_1.__rest(_a, ["valueSchema", "name"]);
  5573. super(Object.assign({}, handlers, {
  5574. name
  5575. }));
  5576. this._valueSchema = valueSchema;
  5577. }
  5578. expected(utils) {
  5579. return `an array of ${this._valueSchema.expected(utils)}`;
  5580. }
  5581. validate(value, utils) {
  5582. if (!Array.isArray(value)) {
  5583. return false;
  5584. }
  5585. const invalidValues = [];
  5586. for (const subValue of value) {
  5587. const subValidateResult = utils.normalizeValidateResult(this._valueSchema.validate(subValue, utils), subValue);
  5588. if (subValidateResult !== true) {
  5589. invalidValues.push(subValidateResult.value);
  5590. }
  5591. }
  5592. return invalidValues.length === 0 ? true : {
  5593. value: invalidValues
  5594. };
  5595. }
  5596. deprecated(value, utils) {
  5597. const deprecatedResult = [];
  5598. for (const subValue of value) {
  5599. const subDeprecatedResult = utils.normalizeDeprecatedResult(this._valueSchema.deprecated(subValue, utils), subValue);
  5600. if (subDeprecatedResult !== false) {
  5601. deprecatedResult.push(...subDeprecatedResult.map(({
  5602. value: deprecatedValue
  5603. }) => ({
  5604. value: [deprecatedValue]
  5605. })));
  5606. }
  5607. }
  5608. return deprecatedResult;
  5609. }
  5610. forward(value, utils) {
  5611. const forwardResult = [];
  5612. for (const subValue of value) {
  5613. const subForwardResult = utils.normalizeForwardResult(this._valueSchema.forward(subValue, utils), subValue);
  5614. forwardResult.push(...subForwardResult.map(wrapTransferResult));
  5615. }
  5616. return forwardResult;
  5617. }
  5618. redirect(value, utils) {
  5619. const remain = [];
  5620. const redirect = [];
  5621. for (const subValue of value) {
  5622. const subRedirectResult = utils.normalizeRedirectResult(this._valueSchema.redirect(subValue, utils), subValue);
  5623. if ("remain" in subRedirectResult) {
  5624. remain.push(subRedirectResult.remain);
  5625. }
  5626. redirect.push(...subRedirectResult.redirect.map(wrapTransferResult));
  5627. }
  5628. return remain.length === 0 ? {
  5629. redirect
  5630. } : {
  5631. redirect,
  5632. remain
  5633. };
  5634. }
  5635. overlap(currentValue, newValue) {
  5636. return currentValue.concat(newValue);
  5637. }
  5638. };
  5639. exports2.ArraySchema = ArraySchema;
  5640. function wrapTransferResult({
  5641. from,
  5642. to
  5643. }) {
  5644. return {
  5645. from: [from],
  5646. to
  5647. };
  5648. }
  5649. }
  5650. });
  5651. var require_boolean = __commonJS2({
  5652. "node_modules/vnopts/lib/schemas/boolean.js"(exports2) {
  5653. "use strict";
  5654. Object.defineProperty(exports2, "__esModule", {
  5655. value: true
  5656. });
  5657. var schema_1 = require_schema();
  5658. var BooleanSchema = class extends schema_1.Schema {
  5659. expected() {
  5660. return "true or false";
  5661. }
  5662. validate(value) {
  5663. return typeof value === "boolean";
  5664. }
  5665. };
  5666. exports2.BooleanSchema = BooleanSchema;
  5667. }
  5668. });
  5669. var require_utils = __commonJS2({
  5670. "node_modules/vnopts/lib/utils.js"(exports2) {
  5671. "use strict";
  5672. Object.defineProperty(exports2, "__esModule", {
  5673. value: true
  5674. });
  5675. function recordFromArray(array, mainKey) {
  5676. const record = /* @__PURE__ */ Object.create(null);
  5677. for (const value of array) {
  5678. const key = value[mainKey];
  5679. if (record[key]) {
  5680. throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key)}`);
  5681. }
  5682. record[key] = value;
  5683. }
  5684. return record;
  5685. }
  5686. exports2.recordFromArray = recordFromArray;
  5687. function mapFromArray(array, mainKey) {
  5688. const map = /* @__PURE__ */ new Map();
  5689. for (const value of array) {
  5690. const key = value[mainKey];
  5691. if (map.has(key)) {
  5692. throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key)}`);
  5693. }
  5694. map.set(key, value);
  5695. }
  5696. return map;
  5697. }
  5698. exports2.mapFromArray = mapFromArray;
  5699. function createAutoChecklist() {
  5700. const map = /* @__PURE__ */ Object.create(null);
  5701. return (id) => {
  5702. const idString = JSON.stringify(id);
  5703. if (map[idString]) {
  5704. return true;
  5705. }
  5706. map[idString] = true;
  5707. return false;
  5708. };
  5709. }
  5710. exports2.createAutoChecklist = createAutoChecklist;
  5711. function partition(array, predicate) {
  5712. const trueArray = [];
  5713. const falseArray = [];
  5714. for (const value of array) {
  5715. if (predicate(value)) {
  5716. trueArray.push(value);
  5717. } else {
  5718. falseArray.push(value);
  5719. }
  5720. }
  5721. return [trueArray, falseArray];
  5722. }
  5723. exports2.partition = partition;
  5724. function isInt(value) {
  5725. return value === Math.floor(value);
  5726. }
  5727. exports2.isInt = isInt;
  5728. function comparePrimitive(a, b) {
  5729. if (a === b) {
  5730. return 0;
  5731. }
  5732. const typeofA = typeof a;
  5733. const typeofB = typeof b;
  5734. const orders = ["undefined", "object", "boolean", "number", "string"];
  5735. if (typeofA !== typeofB) {
  5736. return orders.indexOf(typeofA) - orders.indexOf(typeofB);
  5737. }
  5738. if (typeofA !== "string") {
  5739. return Number(a) - Number(b);
  5740. }
  5741. return a.localeCompare(b);
  5742. }
  5743. exports2.comparePrimitive = comparePrimitive;
  5744. function normalizeDefaultResult(result) {
  5745. return result === void 0 ? {} : result;
  5746. }
  5747. exports2.normalizeDefaultResult = normalizeDefaultResult;
  5748. function normalizeValidateResult(result, value) {
  5749. return result === true ? true : result === false ? {
  5750. value
  5751. } : result;
  5752. }
  5753. exports2.normalizeValidateResult = normalizeValidateResult;
  5754. function normalizeDeprecatedResult(result, value, doNotNormalizeTrue = false) {
  5755. return result === false ? false : result === true ? doNotNormalizeTrue ? true : [{
  5756. value
  5757. }] : "value" in result ? [result] : result.length === 0 ? false : result;
  5758. }
  5759. exports2.normalizeDeprecatedResult = normalizeDeprecatedResult;
  5760. function normalizeTransferResult(result, value) {
  5761. return typeof result === "string" || "key" in result ? {
  5762. from: value,
  5763. to: result
  5764. } : "from" in result ? {
  5765. from: result.from,
  5766. to: result.to
  5767. } : {
  5768. from: value,
  5769. to: result.to
  5770. };
  5771. }
  5772. exports2.normalizeTransferResult = normalizeTransferResult;
  5773. function normalizeForwardResult(result, value) {
  5774. return result === void 0 ? [] : Array.isArray(result) ? result.map((transferResult) => normalizeTransferResult(transferResult, value)) : [normalizeTransferResult(result, value)];
  5775. }
  5776. exports2.normalizeForwardResult = normalizeForwardResult;
  5777. function normalizeRedirectResult(result, value) {
  5778. const redirect = normalizeForwardResult(typeof result === "object" && "redirect" in result ? result.redirect : result, value);
  5779. return redirect.length === 0 ? {
  5780. remain: value,
  5781. redirect
  5782. } : typeof result === "object" && "remain" in result ? {
  5783. remain: result.remain,
  5784. redirect
  5785. } : {
  5786. redirect
  5787. };
  5788. }
  5789. exports2.normalizeRedirectResult = normalizeRedirectResult;
  5790. }
  5791. });
  5792. var require_choice = __commonJS2({
  5793. "node_modules/vnopts/lib/schemas/choice.js"(exports2) {
  5794. "use strict";
  5795. Object.defineProperty(exports2, "__esModule", {
  5796. value: true
  5797. });
  5798. var schema_1 = require_schema();
  5799. var utils_1 = require_utils();
  5800. var ChoiceSchema = class extends schema_1.Schema {
  5801. constructor(parameters) {
  5802. super(parameters);
  5803. this._choices = utils_1.mapFromArray(parameters.choices.map((choice) => choice && typeof choice === "object" ? choice : {
  5804. value: choice
  5805. }), "value");
  5806. }
  5807. expected({
  5808. descriptor
  5809. }) {
  5810. const choiceValues = Array.from(this._choices.keys()).map((value) => this._choices.get(value)).filter((choiceInfo) => !choiceInfo.deprecated).map((choiceInfo) => choiceInfo.value).sort(utils_1.comparePrimitive).map(descriptor.value);
  5811. const head = choiceValues.slice(0, -2);
  5812. const tail = choiceValues.slice(-2);
  5813. return head.concat(tail.join(" or ")).join(", ");
  5814. }
  5815. validate(value) {
  5816. return this._choices.has(value);
  5817. }
  5818. deprecated(value) {
  5819. const choiceInfo = this._choices.get(value);
  5820. return choiceInfo && choiceInfo.deprecated ? {
  5821. value
  5822. } : false;
  5823. }
  5824. forward(value) {
  5825. const choiceInfo = this._choices.get(value);
  5826. return choiceInfo ? choiceInfo.forward : void 0;
  5827. }
  5828. redirect(value) {
  5829. const choiceInfo = this._choices.get(value);
  5830. return choiceInfo ? choiceInfo.redirect : void 0;
  5831. }
  5832. };
  5833. exports2.ChoiceSchema = ChoiceSchema;
  5834. }
  5835. });
  5836. var require_number = __commonJS2({
  5837. "node_modules/vnopts/lib/schemas/number.js"(exports2) {
  5838. "use strict";
  5839. Object.defineProperty(exports2, "__esModule", {
  5840. value: true
  5841. });
  5842. var schema_1 = require_schema();
  5843. var NumberSchema = class extends schema_1.Schema {
  5844. expected() {
  5845. return "a number";
  5846. }
  5847. validate(value, _utils) {
  5848. return typeof value === "number";
  5849. }
  5850. };
  5851. exports2.NumberSchema = NumberSchema;
  5852. }
  5853. });
  5854. var require_integer = __commonJS2({
  5855. "node_modules/vnopts/lib/schemas/integer.js"(exports2) {
  5856. "use strict";
  5857. Object.defineProperty(exports2, "__esModule", {
  5858. value: true
  5859. });
  5860. var utils_1 = require_utils();
  5861. var number_1 = require_number();
  5862. var IntegerSchema = class extends number_1.NumberSchema {
  5863. expected() {
  5864. return "an integer";
  5865. }
  5866. validate(value, utils) {
  5867. return utils.normalizeValidateResult(super.validate(value, utils), value) === true && utils_1.isInt(value);
  5868. }
  5869. };
  5870. exports2.IntegerSchema = IntegerSchema;
  5871. }
  5872. });
  5873. var require_string = __commonJS2({
  5874. "node_modules/vnopts/lib/schemas/string.js"(exports2) {
  5875. "use strict";
  5876. Object.defineProperty(exports2, "__esModule", {
  5877. value: true
  5878. });
  5879. var schema_1 = require_schema();
  5880. var StringSchema = class extends schema_1.Schema {
  5881. expected() {
  5882. return "a string";
  5883. }
  5884. validate(value) {
  5885. return typeof value === "string";
  5886. }
  5887. };
  5888. exports2.StringSchema = StringSchema;
  5889. }
  5890. });
  5891. var require_schemas = __commonJS2({
  5892. "node_modules/vnopts/lib/schemas/index.js"(exports2) {
  5893. "use strict";
  5894. Object.defineProperty(exports2, "__esModule", {
  5895. value: true
  5896. });
  5897. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  5898. tslib_1.__exportStar(require_alias(), exports2);
  5899. tslib_1.__exportStar(require_any(), exports2);
  5900. tslib_1.__exportStar(require_array2(), exports2);
  5901. tslib_1.__exportStar(require_boolean(), exports2);
  5902. tslib_1.__exportStar(require_choice(), exports2);
  5903. tslib_1.__exportStar(require_integer(), exports2);
  5904. tslib_1.__exportStar(require_number(), exports2);
  5905. tslib_1.__exportStar(require_string(), exports2);
  5906. }
  5907. });
  5908. var require_defaults = __commonJS2({
  5909. "node_modules/vnopts/lib/defaults.js"(exports2) {
  5910. "use strict";
  5911. Object.defineProperty(exports2, "__esModule", {
  5912. value: true
  5913. });
  5914. var api_1 = require_api();
  5915. var common_1 = require_common();
  5916. var invalid_1 = require_invalid();
  5917. var leven_1 = require_leven2();
  5918. exports2.defaultDescriptor = api_1.apiDescriptor;
  5919. exports2.defaultUnknownHandler = leven_1.levenUnknownHandler;
  5920. exports2.defaultInvalidHandler = invalid_1.commonInvalidHandler;
  5921. exports2.defaultDeprecatedHandler = common_1.commonDeprecatedHandler;
  5922. }
  5923. });
  5924. var require_normalize = __commonJS2({
  5925. "node_modules/vnopts/lib/normalize.js"(exports2) {
  5926. "use strict";
  5927. Object.defineProperty(exports2, "__esModule", {
  5928. value: true
  5929. });
  5930. var defaults_1 = require_defaults();
  5931. var utils_1 = require_utils();
  5932. exports2.normalize = (options, schemas, opts) => new Normalizer(schemas, opts).normalize(options);
  5933. var Normalizer = class {
  5934. constructor(schemas, opts) {
  5935. const {
  5936. logger = console,
  5937. descriptor = defaults_1.defaultDescriptor,
  5938. unknown = defaults_1.defaultUnknownHandler,
  5939. invalid = defaults_1.defaultInvalidHandler,
  5940. deprecated = defaults_1.defaultDeprecatedHandler
  5941. } = opts || {};
  5942. this._utils = {
  5943. descriptor,
  5944. logger: logger || {
  5945. warn: () => {
  5946. }
  5947. },
  5948. schemas: utils_1.recordFromArray(schemas, "name"),
  5949. normalizeDefaultResult: utils_1.normalizeDefaultResult,
  5950. normalizeDeprecatedResult: utils_1.normalizeDeprecatedResult,
  5951. normalizeForwardResult: utils_1.normalizeForwardResult,
  5952. normalizeRedirectResult: utils_1.normalizeRedirectResult,
  5953. normalizeValidateResult: utils_1.normalizeValidateResult
  5954. };
  5955. this._unknownHandler = unknown;
  5956. this._invalidHandler = invalid;
  5957. this._deprecatedHandler = deprecated;
  5958. this.cleanHistory();
  5959. }
  5960. cleanHistory() {
  5961. this._hasDeprecationWarned = utils_1.createAutoChecklist();
  5962. }
  5963. normalize(options) {
  5964. const normalized = {};
  5965. const restOptionsArray = [options];
  5966. const applyNormalization = () => {
  5967. while (restOptionsArray.length !== 0) {
  5968. const currentOptions = restOptionsArray.shift();
  5969. const transferredOptionsArray = this._applyNormalization(currentOptions, normalized);
  5970. restOptionsArray.push(...transferredOptionsArray);
  5971. }
  5972. };
  5973. applyNormalization();
  5974. for (const key of Object.keys(this._utils.schemas)) {
  5975. const schema = this._utils.schemas[key];
  5976. if (!(key in normalized)) {
  5977. const defaultResult = utils_1.normalizeDefaultResult(schema.default(this._utils));
  5978. if ("value" in defaultResult) {
  5979. restOptionsArray.push({
  5980. [key]: defaultResult.value
  5981. });
  5982. }
  5983. }
  5984. }
  5985. applyNormalization();
  5986. for (const key of Object.keys(this._utils.schemas)) {
  5987. const schema = this._utils.schemas[key];
  5988. if (key in normalized) {
  5989. normalized[key] = schema.postprocess(normalized[key], this._utils);
  5990. }
  5991. }
  5992. return normalized;
  5993. }
  5994. _applyNormalization(options, normalized) {
  5995. const transferredOptionsArray = [];
  5996. const [knownOptionNames, unknownOptionNames] = utils_1.partition(Object.keys(options), (key) => key in this._utils.schemas);
  5997. for (const key of knownOptionNames) {
  5998. const schema = this._utils.schemas[key];
  5999. const value = schema.preprocess(options[key], this._utils);
  6000. const validateResult = utils_1.normalizeValidateResult(schema.validate(value, this._utils), value);
  6001. if (validateResult !== true) {
  6002. const {
  6003. value: invalidValue
  6004. } = validateResult;
  6005. const errorMessageOrError = this._invalidHandler(key, invalidValue, this._utils);
  6006. throw typeof errorMessageOrError === "string" ? new Error(errorMessageOrError) : errorMessageOrError;
  6007. }
  6008. const appendTransferredOptions = ({
  6009. from,
  6010. to
  6011. }) => {
  6012. transferredOptionsArray.push(typeof to === "string" ? {
  6013. [to]: from
  6014. } : {
  6015. [to.key]: to.value
  6016. });
  6017. };
  6018. const warnDeprecated = ({
  6019. value: currentValue,
  6020. redirectTo
  6021. }) => {
  6022. const deprecatedResult = utils_1.normalizeDeprecatedResult(schema.deprecated(currentValue, this._utils), value, true);
  6023. if (deprecatedResult === false) {
  6024. return;
  6025. }
  6026. if (deprecatedResult === true) {
  6027. if (!this._hasDeprecationWarned(key)) {
  6028. this._utils.logger.warn(this._deprecatedHandler(key, redirectTo, this._utils));
  6029. }
  6030. } else {
  6031. for (const {
  6032. value: deprecatedValue
  6033. } of deprecatedResult) {
  6034. const pair = {
  6035. key,
  6036. value: deprecatedValue
  6037. };
  6038. if (!this._hasDeprecationWarned(pair)) {
  6039. const redirectToPair = typeof redirectTo === "string" ? {
  6040. key: redirectTo,
  6041. value: deprecatedValue
  6042. } : redirectTo;
  6043. this._utils.logger.warn(this._deprecatedHandler(pair, redirectToPair, this._utils));
  6044. }
  6045. }
  6046. }
  6047. };
  6048. const forwardResult = utils_1.normalizeForwardResult(schema.forward(value, this._utils), value);
  6049. forwardResult.forEach(appendTransferredOptions);
  6050. const redirectResult = utils_1.normalizeRedirectResult(schema.redirect(value, this._utils), value);
  6051. redirectResult.redirect.forEach(appendTransferredOptions);
  6052. if ("remain" in redirectResult) {
  6053. const remainingValue = redirectResult.remain;
  6054. normalized[key] = key in normalized ? schema.overlap(normalized[key], remainingValue, this._utils) : remainingValue;
  6055. warnDeprecated({
  6056. value: remainingValue
  6057. });
  6058. }
  6059. for (const {
  6060. from,
  6061. to
  6062. } of redirectResult.redirect) {
  6063. warnDeprecated({
  6064. value: from,
  6065. redirectTo: to
  6066. });
  6067. }
  6068. }
  6069. for (const key of unknownOptionNames) {
  6070. const value = options[key];
  6071. const unknownResult = this._unknownHandler(key, value, this._utils);
  6072. if (unknownResult) {
  6073. for (const unknownKey of Object.keys(unknownResult)) {
  6074. const unknownOption = {
  6075. [unknownKey]: unknownResult[unknownKey]
  6076. };
  6077. if (unknownKey in this._utils.schemas) {
  6078. transferredOptionsArray.push(unknownOption);
  6079. } else {
  6080. Object.assign(normalized, unknownOption);
  6081. }
  6082. }
  6083. }
  6084. }
  6085. return transferredOptionsArray;
  6086. }
  6087. };
  6088. exports2.Normalizer = Normalizer;
  6089. }
  6090. });
  6091. var require_lib2 = __commonJS2({
  6092. "node_modules/vnopts/lib/index.js"(exports2) {
  6093. "use strict";
  6094. Object.defineProperty(exports2, "__esModule", {
  6095. value: true
  6096. });
  6097. var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
  6098. tslib_1.__exportStar(require_descriptors2(), exports2);
  6099. tslib_1.__exportStar(require_handlers(), exports2);
  6100. tslib_1.__exportStar(require_schemas(), exports2);
  6101. tslib_1.__exportStar(require_normalize(), exports2);
  6102. tslib_1.__exportStar(require_schema(), exports2);
  6103. }
  6104. });
  6105. var require_options_normalizer = __commonJS2({
  6106. "src/main/options-normalizer.js"(exports2, module2) {
  6107. "use strict";
  6108. var vnopts = require_lib2();
  6109. var getLast = require_get_last();
  6110. var cliDescriptor = {
  6111. key: (key) => key.length === 1 ? `-${key}` : `--${key}`,
  6112. value: (value) => vnopts.apiDescriptor.value(value),
  6113. pair: ({
  6114. key,
  6115. value
  6116. }) => value === false ? `--no-${key}` : value === true ? cliDescriptor.key(key) : value === "" ? `${cliDescriptor.key(key)} without an argument` : `${cliDescriptor.key(key)}=${value}`
  6117. };
  6118. var getFlagSchema = ({
  6119. colorsModule,
  6120. levenshteinDistance
  6121. }) => class FlagSchema extends vnopts.ChoiceSchema {
  6122. constructor({
  6123. name,
  6124. flags
  6125. }) {
  6126. super({
  6127. name,
  6128. choices: flags
  6129. });
  6130. this._flags = [...flags].sort();
  6131. }
  6132. preprocess(value, utils) {
  6133. if (typeof value === "string" && value.length > 0 && !this._flags.includes(value)) {
  6134. const suggestion = this._flags.find((flag) => levenshteinDistance(flag, value) < 3);
  6135. if (suggestion) {
  6136. utils.logger.warn([`Unknown flag ${colorsModule.yellow(utils.descriptor.value(value))},`, `did you mean ${colorsModule.blue(utils.descriptor.value(suggestion))}?`].join(" "));
  6137. return suggestion;
  6138. }
  6139. }
  6140. return value;
  6141. }
  6142. expected() {
  6143. return "a flag";
  6144. }
  6145. };
  6146. var hasDeprecationWarned;
  6147. function normalizeOptions(options, optionInfos, {
  6148. logger,
  6149. isCLI = false,
  6150. passThrough = false,
  6151. colorsModule,
  6152. levenshteinDistance
  6153. } = {}) {
  6154. const unknown = !passThrough ? (key, value, options2) => {
  6155. const _options2$schemas = options2.schemas, {
  6156. _
  6157. } = _options2$schemas, schemas2 = _objectWithoutProperties(_options2$schemas, _excluded2);
  6158. return vnopts.levenUnknownHandler(key, value, Object.assign(Object.assign({}, options2), {}, {
  6159. schemas: schemas2
  6160. }));
  6161. } : Array.isArray(passThrough) ? (key, value) => !passThrough.includes(key) ? void 0 : {
  6162. [key]: value
  6163. } : (key, value) => ({
  6164. [key]: value
  6165. });
  6166. const descriptor = isCLI ? cliDescriptor : vnopts.apiDescriptor;
  6167. const schemas = optionInfosToSchemas(optionInfos, {
  6168. isCLI,
  6169. colorsModule,
  6170. levenshteinDistance
  6171. });
  6172. const normalizer = new vnopts.Normalizer(schemas, {
  6173. logger,
  6174. unknown,
  6175. descriptor
  6176. });
  6177. const shouldSuppressDuplicateDeprecationWarnings = logger !== false;
  6178. if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
  6179. normalizer._hasDeprecationWarned = hasDeprecationWarned;
  6180. }
  6181. const normalized = normalizer.normalize(options);
  6182. if (shouldSuppressDuplicateDeprecationWarnings) {
  6183. hasDeprecationWarned = normalizer._hasDeprecationWarned;
  6184. }
  6185. if (isCLI && normalized["plugin-search"] === false) {
  6186. normalized["plugin-search-dir"] = false;
  6187. }
  6188. return normalized;
  6189. }
  6190. function optionInfosToSchemas(optionInfos, {
  6191. isCLI,
  6192. colorsModule,
  6193. levenshteinDistance
  6194. }) {
  6195. const schemas = [];
  6196. if (isCLI) {
  6197. schemas.push(vnopts.AnySchema.create({
  6198. name: "_"
  6199. }));
  6200. }
  6201. for (const optionInfo of optionInfos) {
  6202. schemas.push(optionInfoToSchema(optionInfo, {
  6203. isCLI,
  6204. optionInfos,
  6205. colorsModule,
  6206. levenshteinDistance
  6207. }));
  6208. if (optionInfo.alias && isCLI) {
  6209. schemas.push(vnopts.AliasSchema.create({
  6210. name: optionInfo.alias,
  6211. sourceName: optionInfo.name
  6212. }));
  6213. }
  6214. }
  6215. return schemas;
  6216. }
  6217. function optionInfoToSchema(optionInfo, {
  6218. isCLI,
  6219. optionInfos,
  6220. colorsModule,
  6221. levenshteinDistance
  6222. }) {
  6223. const {
  6224. name
  6225. } = optionInfo;
  6226. if (name === "plugin-search-dir" || name === "pluginSearchDirs") {
  6227. return vnopts.AnySchema.create({
  6228. name,
  6229. preprocess(value) {
  6230. if (value === false) {
  6231. return value;
  6232. }
  6233. value = Array.isArray(value) ? value : [value];
  6234. return value;
  6235. },
  6236. validate(value) {
  6237. if (value === false) {
  6238. return true;
  6239. }
  6240. return value.every((dir) => typeof dir === "string");
  6241. },
  6242. expected() {
  6243. return "false or paths to plugin search dir";
  6244. }
  6245. });
  6246. }
  6247. const parameters = {
  6248. name
  6249. };
  6250. let SchemaConstructor;
  6251. const handlers = {};
  6252. switch (optionInfo.type) {
  6253. case "int":
  6254. SchemaConstructor = vnopts.IntegerSchema;
  6255. if (isCLI) {
  6256. parameters.preprocess = (value) => Number(value);
  6257. }
  6258. break;
  6259. case "string":
  6260. SchemaConstructor = vnopts.StringSchema;
  6261. break;
  6262. case "choice":
  6263. SchemaConstructor = vnopts.ChoiceSchema;
  6264. parameters.choices = optionInfo.choices.map((choiceInfo) => typeof choiceInfo === "object" && choiceInfo.redirect ? Object.assign(Object.assign({}, choiceInfo), {}, {
  6265. redirect: {
  6266. to: {
  6267. key: optionInfo.name,
  6268. value: choiceInfo.redirect
  6269. }
  6270. }
  6271. }) : choiceInfo);
  6272. break;
  6273. case "boolean":
  6274. SchemaConstructor = vnopts.BooleanSchema;
  6275. break;
  6276. case "flag":
  6277. SchemaConstructor = getFlagSchema({
  6278. colorsModule,
  6279. levenshteinDistance
  6280. });
  6281. parameters.flags = optionInfos.flatMap((optionInfo2) => [optionInfo2.alias, optionInfo2.description && optionInfo2.name, optionInfo2.oppositeDescription && `no-${optionInfo2.name}`].filter(Boolean));
  6282. break;
  6283. case "path":
  6284. SchemaConstructor = vnopts.StringSchema;
  6285. break;
  6286. default:
  6287. throw new Error(`Unexpected type ${optionInfo.type}`);
  6288. }
  6289. if (optionInfo.exception) {
  6290. parameters.validate = (value, schema, utils) => optionInfo.exception(value) || schema.validate(value, utils);
  6291. } else {
  6292. parameters.validate = (value, schema, utils) => value === void 0 || schema.validate(value, utils);
  6293. }
  6294. if (optionInfo.redirect) {
  6295. handlers.redirect = (value) => !value ? void 0 : {
  6296. to: {
  6297. key: optionInfo.redirect.option,
  6298. value: optionInfo.redirect.value
  6299. }
  6300. };
  6301. }
  6302. if (optionInfo.deprecated) {
  6303. handlers.deprecated = true;
  6304. }
  6305. if (isCLI && !optionInfo.array) {
  6306. const originalPreprocess = parameters.preprocess || ((x) => x);
  6307. parameters.preprocess = (value, schema, utils) => schema.preprocess(originalPreprocess(Array.isArray(value) ? getLast(value) : value), utils);
  6308. }
  6309. return optionInfo.array ? vnopts.ArraySchema.create(Object.assign(Object.assign(Object.assign({}, isCLI ? {
  6310. preprocess: (v) => Array.isArray(v) ? v : [v]
  6311. } : {}), handlers), {}, {
  6312. valueSchema: SchemaConstructor.create(parameters)
  6313. })) : SchemaConstructor.create(Object.assign(Object.assign({}, parameters), handlers));
  6314. }
  6315. function normalizeApiOptions(options, optionInfos, opts) {
  6316. return normalizeOptions(options, optionInfos, opts);
  6317. }
  6318. function normalizeCliOptions(options, optionInfos, opts) {
  6319. if (false) {
  6320. if (!opts.colorsModule) {
  6321. throw new Error("'colorsModule' option is required.");
  6322. }
  6323. if (!opts.levenshteinDistance) {
  6324. throw new Error("'levenshteinDistance' option is required.");
  6325. }
  6326. }
  6327. return normalizeOptions(options, optionInfos, Object.assign({
  6328. isCLI: true
  6329. }, opts));
  6330. }
  6331. module2.exports = {
  6332. normalizeApiOptions,
  6333. normalizeCliOptions
  6334. };
  6335. }
  6336. });
  6337. var require_loc = __commonJS2({
  6338. "src/language-js/loc.js"(exports2, module2) {
  6339. "use strict";
  6340. var isNonEmptyArray = require_is_non_empty_array();
  6341. function locStart(node, opts) {
  6342. const {
  6343. ignoreDecorators
  6344. } = opts || {};
  6345. if (!ignoreDecorators) {
  6346. const decorators = node.declaration && node.declaration.decorators || node.decorators;
  6347. if (isNonEmptyArray(decorators)) {
  6348. return locStart(decorators[0]);
  6349. }
  6350. }
  6351. return node.range ? node.range[0] : node.start;
  6352. }
  6353. function locEnd(node) {
  6354. return node.range ? node.range[1] : node.end;
  6355. }
  6356. function hasSameLocStart(nodeA, nodeB) {
  6357. const nodeAStart = locStart(nodeA);
  6358. return Number.isInteger(nodeAStart) && nodeAStart === locStart(nodeB);
  6359. }
  6360. function hasSameLocEnd(nodeA, nodeB) {
  6361. const nodeAEnd = locEnd(nodeA);
  6362. return Number.isInteger(nodeAEnd) && nodeAEnd === locEnd(nodeB);
  6363. }
  6364. function hasSameLoc(nodeA, nodeB) {
  6365. return hasSameLocStart(nodeA, nodeB) && hasSameLocEnd(nodeA, nodeB);
  6366. }
  6367. module2.exports = {
  6368. locStart,
  6369. locEnd,
  6370. hasSameLocStart,
  6371. hasSameLoc
  6372. };
  6373. }
  6374. });
  6375. var require_js_tokens = __commonJS2({
  6376. "node_modules/js-tokens/index.js"(exports2) {
  6377. Object.defineProperty(exports2, "__esModule", {
  6378. value: true
  6379. });
  6380. exports2.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
  6381. exports2.matchToToken = function(match) {
  6382. var token = {
  6383. type: "invalid",
  6384. value: match[0],
  6385. closed: void 0
  6386. };
  6387. if (match[1])
  6388. token.type = "string", token.closed = !!(match[3] || match[4]);
  6389. else if (match[5])
  6390. token.type = "comment";
  6391. else if (match[6])
  6392. token.type = "comment", token.closed = !!match[7];
  6393. else if (match[8])
  6394. token.type = "regex";
  6395. else if (match[9])
  6396. token.type = "number";
  6397. else if (match[10])
  6398. token.type = "name";
  6399. else if (match[11])
  6400. token.type = "punctuator";
  6401. else if (match[12])
  6402. token.type = "whitespace";
  6403. return token;
  6404. };
  6405. }
  6406. });
  6407. var require_identifier = __commonJS2({
  6408. "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports2) {
  6409. "use strict";
  6410. Object.defineProperty(exports2, "__esModule", {
  6411. value: true
  6412. });
  6413. exports2.isIdentifierChar = isIdentifierChar;
  6414. exports2.isIdentifierName = isIdentifierName;
  6415. exports2.isIdentifierStart = isIdentifierStart;
  6416. 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";
  6417. 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\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-\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\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";
  6418. var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  6419. var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
  6420. nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
  6421. 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, 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, 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, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 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, 46, 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, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 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, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
  6422. 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, 154, 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, 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, 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, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
  6423. function isInAstralSet(code, set) {
  6424. let pos = 65536;
  6425. for (let i = 0, length = set.length; i < length; i += 2) {
  6426. pos += set[i];
  6427. if (pos > code)
  6428. return false;
  6429. pos += set[i + 1];
  6430. if (pos >= code)
  6431. return true;
  6432. }
  6433. return false;
  6434. }
  6435. function isIdentifierStart(code) {
  6436. if (code < 65)
  6437. return code === 36;
  6438. if (code <= 90)
  6439. return true;
  6440. if (code < 97)
  6441. return code === 95;
  6442. if (code <= 122)
  6443. return true;
  6444. if (code <= 65535) {
  6445. return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
  6446. }
  6447. return isInAstralSet(code, astralIdentifierStartCodes);
  6448. }
  6449. function isIdentifierChar(code) {
  6450. if (code < 48)
  6451. return code === 36;
  6452. if (code < 58)
  6453. return true;
  6454. if (code < 65)
  6455. return false;
  6456. if (code <= 90)
  6457. return true;
  6458. if (code < 97)
  6459. return code === 95;
  6460. if (code <= 122)
  6461. return true;
  6462. if (code <= 65535) {
  6463. return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
  6464. }
  6465. return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
  6466. }
  6467. function isIdentifierName(name) {
  6468. let isFirst = true;
  6469. for (let i = 0; i < name.length; i++) {
  6470. let cp = name.charCodeAt(i);
  6471. if ((cp & 64512) === 55296 && i + 1 < name.length) {
  6472. const trail = name.charCodeAt(++i);
  6473. if ((trail & 64512) === 56320) {
  6474. cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
  6475. }
  6476. }
  6477. if (isFirst) {
  6478. isFirst = false;
  6479. if (!isIdentifierStart(cp)) {
  6480. return false;
  6481. }
  6482. } else if (!isIdentifierChar(cp)) {
  6483. return false;
  6484. }
  6485. }
  6486. return !isFirst;
  6487. }
  6488. }
  6489. });
  6490. var require_keyword = __commonJS2({
  6491. "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports2) {
  6492. "use strict";
  6493. Object.defineProperty(exports2, "__esModule", {
  6494. value: true
  6495. });
  6496. exports2.isKeyword = isKeyword;
  6497. exports2.isReservedWord = isReservedWord;
  6498. exports2.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
  6499. exports2.isStrictBindReservedWord = isStrictBindReservedWord;
  6500. exports2.isStrictReservedWord = isStrictReservedWord;
  6501. var reservedWords = {
  6502. keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
  6503. strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
  6504. strictBind: ["eval", "arguments"]
  6505. };
  6506. var keywords = new Set(reservedWords.keyword);
  6507. var reservedWordsStrictSet = new Set(reservedWords.strict);
  6508. var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
  6509. function isReservedWord(word, inModule) {
  6510. return inModule && word === "await" || word === "enum";
  6511. }
  6512. function isStrictReservedWord(word, inModule) {
  6513. return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
  6514. }
  6515. function isStrictBindOnlyReservedWord(word) {
  6516. return reservedWordsStrictBindSet.has(word);
  6517. }
  6518. function isStrictBindReservedWord(word, inModule) {
  6519. return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
  6520. }
  6521. function isKeyword(word) {
  6522. return keywords.has(word);
  6523. }
  6524. }
  6525. });
  6526. var require_lib3 = __commonJS2({
  6527. "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports2) {
  6528. "use strict";
  6529. Object.defineProperty(exports2, "__esModule", {
  6530. value: true
  6531. });
  6532. Object.defineProperty(exports2, "isIdentifierChar", {
  6533. enumerable: true,
  6534. get: function() {
  6535. return _identifier.isIdentifierChar;
  6536. }
  6537. });
  6538. Object.defineProperty(exports2, "isIdentifierName", {
  6539. enumerable: true,
  6540. get: function() {
  6541. return _identifier.isIdentifierName;
  6542. }
  6543. });
  6544. Object.defineProperty(exports2, "isIdentifierStart", {
  6545. enumerable: true,
  6546. get: function() {
  6547. return _identifier.isIdentifierStart;
  6548. }
  6549. });
  6550. Object.defineProperty(exports2, "isKeyword", {
  6551. enumerable: true,
  6552. get: function() {
  6553. return _keyword.isKeyword;
  6554. }
  6555. });
  6556. Object.defineProperty(exports2, "isReservedWord", {
  6557. enumerable: true,
  6558. get: function() {
  6559. return _keyword.isReservedWord;
  6560. }
  6561. });
  6562. Object.defineProperty(exports2, "isStrictBindOnlyReservedWord", {
  6563. enumerable: true,
  6564. get: function() {
  6565. return _keyword.isStrictBindOnlyReservedWord;
  6566. }
  6567. });
  6568. Object.defineProperty(exports2, "isStrictBindReservedWord", {
  6569. enumerable: true,
  6570. get: function() {
  6571. return _keyword.isStrictBindReservedWord;
  6572. }
  6573. });
  6574. Object.defineProperty(exports2, "isStrictReservedWord", {
  6575. enumerable: true,
  6576. get: function() {
  6577. return _keyword.isStrictReservedWord;
  6578. }
  6579. });
  6580. var _identifier = require_identifier();
  6581. var _keyword = require_keyword();
  6582. }
  6583. });
  6584. var require_escape_string_regexp3 = __commonJS2({
  6585. "node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js"(exports2, module2) {
  6586. "use strict";
  6587. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  6588. module2.exports = function(str) {
  6589. if (typeof str !== "string") {
  6590. throw new TypeError("Expected a string");
  6591. }
  6592. return str.replace(matchOperatorsRe, "\\$&");
  6593. };
  6594. }
  6595. });
  6596. var require_has_flag2 = __commonJS2({
  6597. "node_modules/@babel/highlight/node_modules/has-flag/index.js"(exports2, module2) {
  6598. "use strict";
  6599. module2.exports = (flag, argv) => {
  6600. argv = argv || process.argv;
  6601. const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
  6602. const pos = argv.indexOf(prefix + flag);
  6603. const terminatorPos = argv.indexOf("--");
  6604. return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
  6605. };
  6606. }
  6607. });
  6608. var require_supports_color2 = __commonJS2({
  6609. "node_modules/@babel/highlight/node_modules/supports-color/index.js"(exports2, module2) {
  6610. "use strict";
  6611. var os = require("os");
  6612. var hasFlag = require_has_flag2();
  6613. var env = process.env;
  6614. var forceColor;
  6615. if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
  6616. forceColor = false;
  6617. } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
  6618. forceColor = true;
  6619. }
  6620. if ("FORCE_COLOR" in env) {
  6621. forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
  6622. }
  6623. function translateLevel(level) {
  6624. if (level === 0) {
  6625. return false;
  6626. }
  6627. return {
  6628. level,
  6629. hasBasic: true,
  6630. has256: level >= 2,
  6631. has16m: level >= 3
  6632. };
  6633. }
  6634. function supportsColor(stream) {
  6635. if (forceColor === false) {
  6636. return 0;
  6637. }
  6638. if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
  6639. return 3;
  6640. }
  6641. if (hasFlag("color=256")) {
  6642. return 2;
  6643. }
  6644. if (stream && !stream.isTTY && forceColor !== true) {
  6645. return 0;
  6646. }
  6647. const min = forceColor ? 1 : 0;
  6648. if (process.platform === "win32") {
  6649. const osRelease = os.release().split(".");
  6650. if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
  6651. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  6652. }
  6653. return 1;
  6654. }
  6655. if ("CI" in env) {
  6656. if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
  6657. return 1;
  6658. }
  6659. return min;
  6660. }
  6661. if ("TEAMCITY_VERSION" in env) {
  6662. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
  6663. }
  6664. if (env.COLORTERM === "truecolor") {
  6665. return 3;
  6666. }
  6667. if ("TERM_PROGRAM" in env) {
  6668. const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
  6669. switch (env.TERM_PROGRAM) {
  6670. case "iTerm.app":
  6671. return version2 >= 3 ? 3 : 2;
  6672. case "Apple_Terminal":
  6673. return 2;
  6674. }
  6675. }
  6676. if (/-256(color)?$/i.test(env.TERM)) {
  6677. return 2;
  6678. }
  6679. if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  6680. return 1;
  6681. }
  6682. if ("COLORTERM" in env) {
  6683. return 1;
  6684. }
  6685. if (env.TERM === "dumb") {
  6686. return min;
  6687. }
  6688. return min;
  6689. }
  6690. function getSupportLevel(stream) {
  6691. const level = supportsColor(stream);
  6692. return translateLevel(level);
  6693. }
  6694. module2.exports = {
  6695. supportsColor: getSupportLevel,
  6696. stdout: getSupportLevel(process.stdout),
  6697. stderr: getSupportLevel(process.stderr)
  6698. };
  6699. }
  6700. });
  6701. var require_templates2 = __commonJS2({
  6702. "node_modules/@babel/highlight/node_modules/chalk/templates.js"(exports2, module2) {
  6703. "use strict";
  6704. var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
  6705. var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
  6706. var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
  6707. var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
  6708. var ESCAPES = /* @__PURE__ */ new Map([["n", "\n"], ["r", "\r"], ["t", " "], ["b", "\b"], ["f", "\f"], ["v", "\v"], ["0", "\0"], ["\\", "\\"], ["e", "\x1B"], ["a", "\x07"]]);
  6709. function unescape(c) {
  6710. if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) {
  6711. return String.fromCharCode(parseInt(c.slice(1), 16));
  6712. }
  6713. return ESCAPES.get(c) || c;
  6714. }
  6715. function parseArguments(name, args) {
  6716. const results = [];
  6717. const chunks = args.trim().split(/\s*,\s*/g);
  6718. let matches;
  6719. for (const chunk of chunks) {
  6720. if (!isNaN(chunk)) {
  6721. results.push(Number(chunk));
  6722. } else if (matches = chunk.match(STRING_REGEX)) {
  6723. results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
  6724. } else {
  6725. throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
  6726. }
  6727. }
  6728. return results;
  6729. }
  6730. function parseStyle(style) {
  6731. STYLE_REGEX.lastIndex = 0;
  6732. const results = [];
  6733. let matches;
  6734. while ((matches = STYLE_REGEX.exec(style)) !== null) {
  6735. const name = matches[1];
  6736. if (matches[2]) {
  6737. const args = parseArguments(name, matches[2]);
  6738. results.push([name].concat(args));
  6739. } else {
  6740. results.push([name]);
  6741. }
  6742. }
  6743. return results;
  6744. }
  6745. function buildStyle(chalk, styles) {
  6746. const enabled = {};
  6747. for (const layer of styles) {
  6748. for (const style of layer.styles) {
  6749. enabled[style[0]] = layer.inverse ? null : style.slice(1);
  6750. }
  6751. }
  6752. let current = chalk;
  6753. for (const styleName of Object.keys(enabled)) {
  6754. if (Array.isArray(enabled[styleName])) {
  6755. if (!(styleName in current)) {
  6756. throw new Error(`Unknown Chalk style: ${styleName}`);
  6757. }
  6758. if (enabled[styleName].length > 0) {
  6759. current = current[styleName].apply(current, enabled[styleName]);
  6760. } else {
  6761. current = current[styleName];
  6762. }
  6763. }
  6764. }
  6765. return current;
  6766. }
  6767. module2.exports = (chalk, tmp) => {
  6768. const styles = [];
  6769. const chunks = [];
  6770. let chunk = [];
  6771. tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
  6772. if (escapeChar) {
  6773. chunk.push(unescape(escapeChar));
  6774. } else if (style) {
  6775. const str = chunk.join("");
  6776. chunk = [];
  6777. chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
  6778. styles.push({
  6779. inverse,
  6780. styles: parseStyle(style)
  6781. });
  6782. } else if (close) {
  6783. if (styles.length === 0) {
  6784. throw new Error("Found extraneous } in Chalk template literal");
  6785. }
  6786. chunks.push(buildStyle(chalk, styles)(chunk.join("")));
  6787. chunk = [];
  6788. styles.pop();
  6789. } else {
  6790. chunk.push(chr);
  6791. }
  6792. });
  6793. chunks.push(chunk.join(""));
  6794. if (styles.length > 0) {
  6795. const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
  6796. throw new Error(errMsg);
  6797. }
  6798. return chunks.join("");
  6799. };
  6800. }
  6801. });
  6802. var require_chalk2 = __commonJS2({
  6803. "node_modules/@babel/highlight/node_modules/chalk/index.js"(exports2, module2) {
  6804. "use strict";
  6805. var escapeStringRegexp = require_escape_string_regexp3();
  6806. var ansiStyles = require_ansi_styles();
  6807. var stdoutColor = require_supports_color2().stdout;
  6808. var template = require_templates2();
  6809. var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm");
  6810. var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
  6811. var skipModels = /* @__PURE__ */ new Set(["gray"]);
  6812. var styles = /* @__PURE__ */ Object.create(null);
  6813. function applyOptions(obj, options) {
  6814. options = options || {};
  6815. const scLevel = stdoutColor ? stdoutColor.level : 0;
  6816. obj.level = options.level === void 0 ? scLevel : options.level;
  6817. obj.enabled = "enabled" in options ? options.enabled : obj.level > 0;
  6818. }
  6819. function Chalk(options) {
  6820. if (!this || !(this instanceof Chalk) || this.template) {
  6821. const chalk = {};
  6822. applyOptions(chalk, options);
  6823. chalk.template = function() {
  6824. const args = [].slice.call(arguments);
  6825. return chalkTag.apply(null, [chalk.template].concat(args));
  6826. };
  6827. Object.setPrototypeOf(chalk, Chalk.prototype);
  6828. Object.setPrototypeOf(chalk.template, chalk);
  6829. chalk.template.constructor = Chalk;
  6830. return chalk.template;
  6831. }
  6832. applyOptions(this, options);
  6833. }
  6834. if (isSimpleWindowsTerm) {
  6835. ansiStyles.blue.open = "\x1B[94m";
  6836. }
  6837. for (const key of Object.keys(ansiStyles)) {
  6838. ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
  6839. styles[key] = {
  6840. get() {
  6841. const codes = ansiStyles[key];
  6842. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
  6843. }
  6844. };
  6845. }
  6846. styles.visible = {
  6847. get() {
  6848. return build.call(this, this._styles || [], true, "visible");
  6849. }
  6850. };
  6851. ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), "g");
  6852. for (const model of Object.keys(ansiStyles.color.ansi)) {
  6853. if (skipModels.has(model)) {
  6854. continue;
  6855. }
  6856. styles[model] = {
  6857. get() {
  6858. const level = this.level;
  6859. return function() {
  6860. const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
  6861. const codes = {
  6862. open,
  6863. close: ansiStyles.color.close,
  6864. closeRe: ansiStyles.color.closeRe
  6865. };
  6866. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
  6867. };
  6868. }
  6869. };
  6870. }
  6871. ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), "g");
  6872. for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
  6873. if (skipModels.has(model)) {
  6874. continue;
  6875. }
  6876. const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
  6877. styles[bgModel] = {
  6878. get() {
  6879. const level = this.level;
  6880. return function() {
  6881. const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
  6882. const codes = {
  6883. open,
  6884. close: ansiStyles.bgColor.close,
  6885. closeRe: ansiStyles.bgColor.closeRe
  6886. };
  6887. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
  6888. };
  6889. }
  6890. };
  6891. }
  6892. var proto = Object.defineProperties(() => {
  6893. }, styles);
  6894. function build(_styles, _empty, key) {
  6895. const builder = function() {
  6896. return applyStyle.apply(builder, arguments);
  6897. };
  6898. builder._styles = _styles;
  6899. builder._empty = _empty;
  6900. const self2 = this;
  6901. Object.defineProperty(builder, "level", {
  6902. enumerable: true,
  6903. get() {
  6904. return self2.level;
  6905. },
  6906. set(level) {
  6907. self2.level = level;
  6908. }
  6909. });
  6910. Object.defineProperty(builder, "enabled", {
  6911. enumerable: true,
  6912. get() {
  6913. return self2.enabled;
  6914. },
  6915. set(enabled) {
  6916. self2.enabled = enabled;
  6917. }
  6918. });
  6919. builder.hasGrey = this.hasGrey || key === "gray" || key === "grey";
  6920. builder.__proto__ = proto;
  6921. return builder;
  6922. }
  6923. function applyStyle() {
  6924. const args = arguments;
  6925. const argsLen = args.length;
  6926. let str = String(arguments[0]);
  6927. if (argsLen === 0) {
  6928. return "";
  6929. }
  6930. if (argsLen > 1) {
  6931. for (let a = 1; a < argsLen; a++) {
  6932. str += " " + args[a];
  6933. }
  6934. }
  6935. if (!this.enabled || this.level <= 0 || !str) {
  6936. return this._empty ? "" : str;
  6937. }
  6938. const originalDim = ansiStyles.dim.open;
  6939. if (isSimpleWindowsTerm && this.hasGrey) {
  6940. ansiStyles.dim.open = "";
  6941. }
  6942. for (const code of this._styles.slice().reverse()) {
  6943. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  6944. str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
  6945. }
  6946. ansiStyles.dim.open = originalDim;
  6947. return str;
  6948. }
  6949. function chalkTag(chalk, strings) {
  6950. if (!Array.isArray(strings)) {
  6951. return [].slice.call(arguments, 1).join(" ");
  6952. }
  6953. const args = [].slice.call(arguments, 2);
  6954. const parts = [strings.raw[0]];
  6955. for (let i = 1; i < strings.length; i++) {
  6956. parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
  6957. parts.push(String(strings.raw[i]));
  6958. }
  6959. return template(chalk, parts.join(""));
  6960. }
  6961. Object.defineProperties(Chalk.prototype, styles);
  6962. module2.exports = Chalk();
  6963. module2.exports.supportsColor = stdoutColor;
  6964. module2.exports.default = module2.exports;
  6965. }
  6966. });
  6967. var require_lib4 = __commonJS2({
  6968. "node_modules/@babel/highlight/lib/index.js"(exports2) {
  6969. "use strict";
  6970. Object.defineProperty(exports2, "__esModule", {
  6971. value: true
  6972. });
  6973. exports2.default = highlight;
  6974. exports2.getChalk = getChalk;
  6975. exports2.shouldHighlight = shouldHighlight;
  6976. var _jsTokens = require_js_tokens();
  6977. var _helperValidatorIdentifier = require_lib3();
  6978. var _chalk = require_chalk2();
  6979. var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
  6980. function getDefs(chalk) {
  6981. return {
  6982. keyword: chalk.cyan,
  6983. capitalized: chalk.yellow,
  6984. jsxIdentifier: chalk.yellow,
  6985. punctuator: chalk.yellow,
  6986. number: chalk.magenta,
  6987. string: chalk.green,
  6988. regex: chalk.magenta,
  6989. comment: chalk.grey,
  6990. invalid: chalk.white.bgRed.bold
  6991. };
  6992. }
  6993. var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
  6994. var BRACKET = /^[()[\]{}]$/;
  6995. var tokenize;
  6996. {
  6997. const JSX_TAG = /^[a-z][\w-]*$/i;
  6998. const getTokenType = function(token, offset, text) {
  6999. if (token.type === "name") {
  7000. if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
  7001. return "keyword";
  7002. }
  7003. if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
  7004. return "jsxIdentifier";
  7005. }
  7006. if (token.value[0] !== token.value[0].toLowerCase()) {
  7007. return "capitalized";
  7008. }
  7009. }
  7010. if (token.type === "punctuator" && BRACKET.test(token.value)) {
  7011. return "bracket";
  7012. }
  7013. if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
  7014. return "punctuator";
  7015. }
  7016. return token.type;
  7017. };
  7018. tokenize = function* (text) {
  7019. let match;
  7020. while (match = _jsTokens.default.exec(text)) {
  7021. const token = _jsTokens.matchToToken(match);
  7022. yield {
  7023. type: getTokenType(token, match.index, text),
  7024. value: token.value
  7025. };
  7026. }
  7027. };
  7028. }
  7029. function highlightTokens(defs, text) {
  7030. let highlighted = "";
  7031. for (const {
  7032. type,
  7033. value
  7034. } of tokenize(text)) {
  7035. const colorize = defs[type];
  7036. if (colorize) {
  7037. highlighted += value.split(NEWLINE).map((str) => colorize(str)).join("\n");
  7038. } else {
  7039. highlighted += value;
  7040. }
  7041. }
  7042. return highlighted;
  7043. }
  7044. function shouldHighlight(options) {
  7045. return !!_chalk.supportsColor || options.forceColor;
  7046. }
  7047. function getChalk(options) {
  7048. return options.forceColor ? new _chalk.constructor({
  7049. enabled: true,
  7050. level: 1
  7051. }) : _chalk;
  7052. }
  7053. function highlight(code, options = {}) {
  7054. if (code !== "" && shouldHighlight(options)) {
  7055. const chalk = getChalk(options);
  7056. const defs = getDefs(chalk);
  7057. return highlightTokens(defs, code);
  7058. } else {
  7059. return code;
  7060. }
  7061. }
  7062. }
  7063. });
  7064. var require_lib5 = __commonJS2({
  7065. "node_modules/@babel/code-frame/lib/index.js"(exports2) {
  7066. "use strict";
  7067. Object.defineProperty(exports2, "__esModule", {
  7068. value: true
  7069. });
  7070. exports2.codeFrameColumns = codeFrameColumns;
  7071. exports2.default = _default;
  7072. var _highlight = require_lib4();
  7073. var deprecationWarningShown = false;
  7074. function getDefs(chalk) {
  7075. return {
  7076. gutter: chalk.grey,
  7077. marker: chalk.red.bold,
  7078. message: chalk.red.bold
  7079. };
  7080. }
  7081. var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
  7082. function getMarkerLines(loc, source, opts) {
  7083. const startLoc = Object.assign({
  7084. column: 0,
  7085. line: -1
  7086. }, loc.start);
  7087. const endLoc = Object.assign({}, startLoc, loc.end);
  7088. const {
  7089. linesAbove = 2,
  7090. linesBelow = 3
  7091. } = opts || {};
  7092. const startLine = startLoc.line;
  7093. const startColumn = startLoc.column;
  7094. const endLine = endLoc.line;
  7095. const endColumn = endLoc.column;
  7096. let start = Math.max(startLine - (linesAbove + 1), 0);
  7097. let end = Math.min(source.length, endLine + linesBelow);
  7098. if (startLine === -1) {
  7099. start = 0;
  7100. }
  7101. if (endLine === -1) {
  7102. end = source.length;
  7103. }
  7104. const lineDiff = endLine - startLine;
  7105. const markerLines = {};
  7106. if (lineDiff) {
  7107. for (let i = 0; i <= lineDiff; i++) {
  7108. const lineNumber = i + startLine;
  7109. if (!startColumn) {
  7110. markerLines[lineNumber] = true;
  7111. } else if (i === 0) {
  7112. const sourceLength = source[lineNumber - 1].length;
  7113. markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
  7114. } else if (i === lineDiff) {
  7115. markerLines[lineNumber] = [0, endColumn];
  7116. } else {
  7117. const sourceLength = source[lineNumber - i].length;
  7118. markerLines[lineNumber] = [0, sourceLength];
  7119. }
  7120. }
  7121. } else {
  7122. if (startColumn === endColumn) {
  7123. if (startColumn) {
  7124. markerLines[startLine] = [startColumn, 0];
  7125. } else {
  7126. markerLines[startLine] = true;
  7127. }
  7128. } else {
  7129. markerLines[startLine] = [startColumn, endColumn - startColumn];
  7130. }
  7131. }
  7132. return {
  7133. start,
  7134. end,
  7135. markerLines
  7136. };
  7137. }
  7138. function codeFrameColumns(rawLines, loc, opts = {}) {
  7139. const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
  7140. const chalk = (0, _highlight.getChalk)(opts);
  7141. const defs = getDefs(chalk);
  7142. const maybeHighlight = (chalkFn, string) => {
  7143. return highlighted ? chalkFn(string) : string;
  7144. };
  7145. const lines = rawLines.split(NEWLINE);
  7146. const {
  7147. start,
  7148. end,
  7149. markerLines
  7150. } = getMarkerLines(loc, lines, opts);
  7151. const hasColumns = loc.start && typeof loc.start.column === "number";
  7152. const numberMaxWidth = String(end).length;
  7153. const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
  7154. let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
  7155. const number = start + 1 + index;
  7156. const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
  7157. const gutter = ` ${paddedNumber} |`;
  7158. const hasMarker = markerLines[number];
  7159. const lastMarkerLine = !markerLines[number + 1];
  7160. if (hasMarker) {
  7161. let markerLine = "";
  7162. if (Array.isArray(hasMarker)) {
  7163. const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
  7164. const numberOfMarkers = hasMarker[1] || 1;
  7165. markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
  7166. if (lastMarkerLine && opts.message) {
  7167. markerLine += " " + maybeHighlight(defs.message, opts.message);
  7168. }
  7169. }
  7170. return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
  7171. } else {
  7172. return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
  7173. }
  7174. }).join("\n");
  7175. if (opts.message && !hasColumns) {
  7176. frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
  7177. ${frame}`;
  7178. }
  7179. if (highlighted) {
  7180. return chalk.reset(frame);
  7181. } else {
  7182. return frame;
  7183. }
  7184. }
  7185. function _default(rawLines, lineNumber, colNumber, opts = {}) {
  7186. if (!deprecationWarningShown) {
  7187. deprecationWarningShown = true;
  7188. const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
  7189. if (process.emitWarning) {
  7190. process.emitWarning(message, "DeprecationWarning");
  7191. } else {
  7192. const deprecationError = new Error(message);
  7193. deprecationError.name = "DeprecationWarning";
  7194. console.warn(new Error(message));
  7195. }
  7196. }
  7197. colNumber = Math.max(colNumber, 0);
  7198. const location = {
  7199. start: {
  7200. column: colNumber,
  7201. line: lineNumber
  7202. }
  7203. };
  7204. return codeFrameColumns(rawLines, location, opts);
  7205. }
  7206. }
  7207. });
  7208. var require_parser = __commonJS2({
  7209. "src/main/parser.js"(exports2, module2) {
  7210. "use strict";
  7211. var path = require("path");
  7212. var {
  7213. ConfigError
  7214. } = require_errors();
  7215. var jsLoc = require_loc();
  7216. var {
  7217. locStart,
  7218. locEnd
  7219. } = jsLoc;
  7220. var ownNames = Object.getOwnPropertyNames;
  7221. var ownDescriptor = Object.getOwnPropertyDescriptor;
  7222. function getParsers(options) {
  7223. const parsers = {};
  7224. for (const plugin of options.plugins) {
  7225. if (!plugin.parsers) {
  7226. continue;
  7227. }
  7228. for (const name of ownNames(plugin.parsers)) {
  7229. Object.defineProperty(parsers, name, ownDescriptor(plugin.parsers, name));
  7230. }
  7231. }
  7232. return parsers;
  7233. }
  7234. function resolveParser(opts, parsers = getParsers(opts)) {
  7235. if (typeof opts.parser === "function") {
  7236. return {
  7237. parse: opts.parser,
  7238. astFormat: "estree",
  7239. locStart,
  7240. locEnd
  7241. };
  7242. }
  7243. if (typeof opts.parser === "string") {
  7244. if (Object.prototype.hasOwnProperty.call(parsers, opts.parser)) {
  7245. return parsers[opts.parser];
  7246. }
  7247. if (false) {
  7248. throw new ConfigError(`Couldn't resolve parser "${opts.parser}". Parsers must be explicitly added to the standalone bundle.`);
  7249. }
  7250. return requireParser(opts.parser);
  7251. }
  7252. }
  7253. function requireParser(parser) {
  7254. try {
  7255. return {
  7256. parse: require(path.resolve(process.cwd(), parser)),
  7257. astFormat: "estree",
  7258. locStart,
  7259. locEnd
  7260. };
  7261. } catch {
  7262. throw new ConfigError(`Couldn't resolve parser "${parser}"`);
  7263. }
  7264. }
  7265. function parse(text, opts) {
  7266. const parsers = getParsers(opts);
  7267. const parsersForCustomParserApi = Object.defineProperties({}, Object.fromEntries(Object.keys(parsers).map((parserName) => [parserName, {
  7268. enumerable: true,
  7269. get() {
  7270. return parsers[parserName].parse;
  7271. }
  7272. }])));
  7273. const parser = resolveParser(opts, parsers);
  7274. try {
  7275. if (parser.preprocess) {
  7276. text = parser.preprocess(text, opts);
  7277. }
  7278. return {
  7279. text,
  7280. ast: parser.parse(text, parsersForCustomParserApi, opts)
  7281. };
  7282. } catch (error) {
  7283. const {
  7284. loc
  7285. } = error;
  7286. if (loc) {
  7287. const {
  7288. codeFrameColumns
  7289. } = require_lib5();
  7290. error.codeFrame = codeFrameColumns(text, loc, {
  7291. highlightCode: true
  7292. });
  7293. error.message += "\n" + error.codeFrame;
  7294. throw error;
  7295. }
  7296. throw error.stack;
  7297. }
  7298. }
  7299. module2.exports = {
  7300. parse,
  7301. resolveParser
  7302. };
  7303. }
  7304. });
  7305. var require_readlines = __commonJS2({
  7306. "node_modules/n-readlines/readlines.js"(exports2, module2) {
  7307. "use strict";
  7308. var fs = require("fs");
  7309. var LineByLine = class {
  7310. constructor(file, options) {
  7311. options = options || {};
  7312. if (!options.readChunk)
  7313. options.readChunk = 1024;
  7314. if (!options.newLineCharacter) {
  7315. options.newLineCharacter = 10;
  7316. } else {
  7317. options.newLineCharacter = options.newLineCharacter.charCodeAt(0);
  7318. }
  7319. if (typeof file === "number") {
  7320. this.fd = file;
  7321. } else {
  7322. this.fd = fs.openSync(file, "r");
  7323. }
  7324. this.options = options;
  7325. this.newLineCharacter = options.newLineCharacter;
  7326. this.reset();
  7327. }
  7328. _searchInBuffer(buffer, hexNeedle) {
  7329. let found = -1;
  7330. for (let i = 0; i <= buffer.length; i++) {
  7331. let b_byte = buffer[i];
  7332. if (b_byte === hexNeedle) {
  7333. found = i;
  7334. break;
  7335. }
  7336. }
  7337. return found;
  7338. }
  7339. reset() {
  7340. this.eofReached = false;
  7341. this.linesCache = [];
  7342. this.fdPosition = 0;
  7343. }
  7344. close() {
  7345. fs.closeSync(this.fd);
  7346. this.fd = null;
  7347. }
  7348. _extractLines(buffer) {
  7349. let line;
  7350. const lines = [];
  7351. let bufferPosition = 0;
  7352. let lastNewLineBufferPosition = 0;
  7353. while (true) {
  7354. let bufferPositionValue = buffer[bufferPosition++];
  7355. if (bufferPositionValue === this.newLineCharacter) {
  7356. line = buffer.slice(lastNewLineBufferPosition, bufferPosition);
  7357. lines.push(line);
  7358. lastNewLineBufferPosition = bufferPosition;
  7359. } else if (bufferPositionValue === void 0) {
  7360. break;
  7361. }
  7362. }
  7363. let leftovers = buffer.slice(lastNewLineBufferPosition, bufferPosition);
  7364. if (leftovers.length) {
  7365. lines.push(leftovers);
  7366. }
  7367. return lines;
  7368. }
  7369. _readChunk(lineLeftovers) {
  7370. let totalBytesRead = 0;
  7371. let bytesRead;
  7372. const buffers = [];
  7373. do {
  7374. const readBuffer = new Buffer(this.options.readChunk);
  7375. bytesRead = fs.readSync(this.fd, readBuffer, 0, this.options.readChunk, this.fdPosition);
  7376. totalBytesRead = totalBytesRead + bytesRead;
  7377. this.fdPosition = this.fdPosition + bytesRead;
  7378. buffers.push(readBuffer);
  7379. } while (bytesRead && this._searchInBuffer(buffers[buffers.length - 1], this.options.newLineCharacter) === -1);
  7380. let bufferData = Buffer.concat(buffers);
  7381. if (bytesRead < this.options.readChunk) {
  7382. this.eofReached = true;
  7383. bufferData = bufferData.slice(0, totalBytesRead);
  7384. }
  7385. if (totalBytesRead) {
  7386. this.linesCache = this._extractLines(bufferData);
  7387. if (lineLeftovers) {
  7388. this.linesCache[0] = Buffer.concat([lineLeftovers, this.linesCache[0]]);
  7389. }
  7390. }
  7391. return totalBytesRead;
  7392. }
  7393. next() {
  7394. if (!this.fd)
  7395. return false;
  7396. let line = false;
  7397. if (this.eofReached && this.linesCache.length === 0) {
  7398. return line;
  7399. }
  7400. let bytesRead;
  7401. if (!this.linesCache.length) {
  7402. bytesRead = this._readChunk();
  7403. }
  7404. if (this.linesCache.length) {
  7405. line = this.linesCache.shift();
  7406. const lastLineCharacter = line[line.length - 1];
  7407. if (lastLineCharacter !== this.newLineCharacter) {
  7408. bytesRead = this._readChunk(line);
  7409. if (bytesRead) {
  7410. line = this.linesCache.shift();
  7411. }
  7412. }
  7413. }
  7414. if (this.eofReached && this.linesCache.length === 0) {
  7415. this.close();
  7416. }
  7417. if (line && line[line.length - 1] === this.newLineCharacter) {
  7418. line = line.slice(0, line.length - 1);
  7419. }
  7420. return line;
  7421. }
  7422. };
  7423. module2.exports = LineByLine;
  7424. }
  7425. });
  7426. var require_get_interpreter = __commonJS2({
  7427. "src/utils/get-interpreter.js"(exports2, module2) {
  7428. "use strict";
  7429. var fs = require("fs");
  7430. var readlines = require_readlines();
  7431. function getInterpreter(filepath) {
  7432. if (typeof filepath !== "string") {
  7433. return "";
  7434. }
  7435. let fd;
  7436. try {
  7437. fd = fs.openSync(filepath, "r");
  7438. } catch {
  7439. return "";
  7440. }
  7441. try {
  7442. const liner = new readlines(fd);
  7443. const firstLine = liner.next().toString("utf8");
  7444. const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/);
  7445. if (m1) {
  7446. return m1[1];
  7447. }
  7448. const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/);
  7449. if (m2) {
  7450. return m2[1];
  7451. }
  7452. return "";
  7453. } catch {
  7454. return "";
  7455. } finally {
  7456. try {
  7457. fs.closeSync(fd);
  7458. } catch {
  7459. }
  7460. }
  7461. }
  7462. module2.exports = getInterpreter;
  7463. }
  7464. });
  7465. var require_options = __commonJS2({
  7466. "src/main/options.js"(exports2, module2) {
  7467. "use strict";
  7468. var path = require("path");
  7469. var {
  7470. UndefinedParserError
  7471. } = require_errors();
  7472. var {
  7473. getSupportInfo: getSupportInfo2
  7474. } = require_support();
  7475. var normalizer = require_options_normalizer();
  7476. var {
  7477. resolveParser
  7478. } = require_parser();
  7479. var hiddenDefaults = {
  7480. astFormat: "estree",
  7481. printer: {},
  7482. originalText: void 0,
  7483. locStart: null,
  7484. locEnd: null
  7485. };
  7486. function normalize(options, opts = {}) {
  7487. const rawOptions = Object.assign({}, options);
  7488. const supportOptions = getSupportInfo2({
  7489. plugins: options.plugins,
  7490. showUnreleased: true,
  7491. showDeprecated: true
  7492. }).options;
  7493. const defaults = Object.assign(Object.assign({}, hiddenDefaults), Object.fromEntries(supportOptions.filter((optionInfo) => optionInfo.default !== void 0).map((option) => [option.name, option.default])));
  7494. if (!rawOptions.parser) {
  7495. if (!rawOptions.filepath) {
  7496. const logger = opts.logger || console;
  7497. logger.warn("No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.");
  7498. rawOptions.parser = "babel";
  7499. } else {
  7500. rawOptions.parser = inferParser(rawOptions.filepath, rawOptions.plugins);
  7501. if (!rawOptions.parser) {
  7502. throw new UndefinedParserError(`No parser could be inferred for file: ${rawOptions.filepath}`);
  7503. }
  7504. }
  7505. }
  7506. const parser = resolveParser(normalizer.normalizeApiOptions(rawOptions, [supportOptions.find((x) => x.name === "parser")], {
  7507. passThrough: true,
  7508. logger: false
  7509. }));
  7510. rawOptions.astFormat = parser.astFormat;
  7511. rawOptions.locEnd = parser.locEnd;
  7512. rawOptions.locStart = parser.locStart;
  7513. const plugin = getPlugin(rawOptions);
  7514. rawOptions.printer = plugin.printers[rawOptions.astFormat];
  7515. const pluginDefaults = Object.fromEntries(supportOptions.filter((optionInfo) => optionInfo.pluginDefaults && optionInfo.pluginDefaults[plugin.name] !== void 0).map((optionInfo) => [optionInfo.name, optionInfo.pluginDefaults[plugin.name]]));
  7516. const mixedDefaults = Object.assign(Object.assign({}, defaults), pluginDefaults);
  7517. for (const [k, value] of Object.entries(mixedDefaults)) {
  7518. if (rawOptions[k] === null || rawOptions[k] === void 0) {
  7519. rawOptions[k] = value;
  7520. }
  7521. }
  7522. if (rawOptions.parser === "json") {
  7523. rawOptions.trailingComma = "none";
  7524. }
  7525. return normalizer.normalizeApiOptions(rawOptions, supportOptions, Object.assign({
  7526. passThrough: Object.keys(hiddenDefaults)
  7527. }, opts));
  7528. }
  7529. function getPlugin(options) {
  7530. const {
  7531. astFormat
  7532. } = options;
  7533. if (!astFormat) {
  7534. throw new Error("getPlugin() requires astFormat to be set");
  7535. }
  7536. const printerPlugin = options.plugins.find((plugin) => plugin.printers && plugin.printers[astFormat]);
  7537. if (!printerPlugin) {
  7538. throw new Error(`Couldn't find plugin for AST format "${astFormat}"`);
  7539. }
  7540. return printerPlugin;
  7541. }
  7542. function inferParser(filepath, plugins2) {
  7543. const filename = path.basename(filepath).toLowerCase();
  7544. const languages = getSupportInfo2({
  7545. plugins: plugins2
  7546. }).languages.filter((language2) => language2.since !== null);
  7547. let language = languages.find((language2) => language2.extensions && language2.extensions.some((extension) => filename.endsWith(extension)) || language2.filenames && language2.filenames.some((name) => name.toLowerCase() === filename));
  7548. if (!language && !filename.includes(".")) {
  7549. const getInterpreter = require_get_interpreter();
  7550. const interpreter = getInterpreter(filepath);
  7551. language = languages.find((language2) => language2.interpreters && language2.interpreters.includes(interpreter));
  7552. }
  7553. return language && language.parsers[0];
  7554. }
  7555. module2.exports = {
  7556. normalize,
  7557. hiddenDefaults,
  7558. inferParser
  7559. };
  7560. }
  7561. });
  7562. var require_massage_ast = __commonJS2({
  7563. "src/main/massage-ast.js"(exports2, module2) {
  7564. "use strict";
  7565. function massageAST(ast, options, parent) {
  7566. if (Array.isArray(ast)) {
  7567. return ast.map((e) => massageAST(e, options, parent)).filter(Boolean);
  7568. }
  7569. if (!ast || typeof ast !== "object") {
  7570. return ast;
  7571. }
  7572. const cleanFunction = options.printer.massageAstNode;
  7573. let ignoredProperties;
  7574. if (cleanFunction && cleanFunction.ignoredProperties) {
  7575. ignoredProperties = cleanFunction.ignoredProperties;
  7576. } else {
  7577. ignoredProperties = /* @__PURE__ */ new Set();
  7578. }
  7579. const newObj = {};
  7580. for (const [key, value] of Object.entries(ast)) {
  7581. if (!ignoredProperties.has(key) && typeof value !== "function") {
  7582. newObj[key] = massageAST(value, options, ast);
  7583. }
  7584. }
  7585. if (cleanFunction) {
  7586. const result = cleanFunction(ast, newObj, parent);
  7587. if (result === null) {
  7588. return;
  7589. }
  7590. if (result) {
  7591. return result;
  7592. }
  7593. }
  7594. return newObj;
  7595. }
  7596. module2.exports = massageAST;
  7597. }
  7598. });
  7599. var require_comments = __commonJS2({
  7600. "src/main/comments.js"(exports2, module2) {
  7601. "use strict";
  7602. var assert = require("assert");
  7603. var {
  7604. builders: {
  7605. line,
  7606. hardline,
  7607. breakParent,
  7608. indent,
  7609. lineSuffix,
  7610. join,
  7611. cursor
  7612. }
  7613. } = require("./doc.js");
  7614. var {
  7615. hasNewline,
  7616. skipNewline,
  7617. skipSpaces,
  7618. isPreviousLineEmpty,
  7619. addLeadingComment,
  7620. addDanglingComment,
  7621. addTrailingComment
  7622. } = require_util();
  7623. var childNodesCache = /* @__PURE__ */ new WeakMap();
  7624. function getSortedChildNodes(node, options, resultArray) {
  7625. if (!node) {
  7626. return;
  7627. }
  7628. const {
  7629. printer,
  7630. locStart,
  7631. locEnd
  7632. } = options;
  7633. if (resultArray) {
  7634. if (printer.canAttachComment && printer.canAttachComment(node)) {
  7635. let i;
  7636. for (i = resultArray.length - 1; i >= 0; --i) {
  7637. if (locStart(resultArray[i]) <= locStart(node) && locEnd(resultArray[i]) <= locEnd(node)) {
  7638. break;
  7639. }
  7640. }
  7641. resultArray.splice(i + 1, 0, node);
  7642. return;
  7643. }
  7644. } else if (childNodesCache.has(node)) {
  7645. return childNodesCache.get(node);
  7646. }
  7647. const childNodes = printer.getCommentChildNodes && printer.getCommentChildNodes(node, options) || typeof node === "object" && Object.entries(node).filter(([key]) => key !== "enclosingNode" && key !== "precedingNode" && key !== "followingNode" && key !== "tokens" && key !== "comments" && key !== "parent").map(([, value]) => value);
  7648. if (!childNodes) {
  7649. return;
  7650. }
  7651. if (!resultArray) {
  7652. resultArray = [];
  7653. childNodesCache.set(node, resultArray);
  7654. }
  7655. for (const childNode of childNodes) {
  7656. getSortedChildNodes(childNode, options, resultArray);
  7657. }
  7658. return resultArray;
  7659. }
  7660. function decorateComment(node, comment, options, enclosingNode) {
  7661. const {
  7662. locStart,
  7663. locEnd
  7664. } = options;
  7665. const commentStart = locStart(comment);
  7666. const commentEnd = locEnd(comment);
  7667. const childNodes = getSortedChildNodes(node, options);
  7668. let precedingNode;
  7669. let followingNode;
  7670. let left = 0;
  7671. let right = childNodes.length;
  7672. while (left < right) {
  7673. const middle = left + right >> 1;
  7674. const child = childNodes[middle];
  7675. const start = locStart(child);
  7676. const end = locEnd(child);
  7677. if (start <= commentStart && commentEnd <= end) {
  7678. return decorateComment(child, comment, options, child);
  7679. }
  7680. if (end <= commentStart) {
  7681. precedingNode = child;
  7682. left = middle + 1;
  7683. continue;
  7684. }
  7685. if (commentEnd <= start) {
  7686. followingNode = child;
  7687. right = middle;
  7688. continue;
  7689. }
  7690. throw new Error("Comment location overlaps with node location");
  7691. }
  7692. if (enclosingNode && enclosingNode.type === "TemplateLiteral") {
  7693. const {
  7694. quasis
  7695. } = enclosingNode;
  7696. const commentIndex = findExpressionIndexForComment(quasis, comment, options);
  7697. if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options) !== commentIndex) {
  7698. precedingNode = null;
  7699. }
  7700. if (followingNode && findExpressionIndexForComment(quasis, followingNode, options) !== commentIndex) {
  7701. followingNode = null;
  7702. }
  7703. }
  7704. return {
  7705. enclosingNode,
  7706. precedingNode,
  7707. followingNode
  7708. };
  7709. }
  7710. var returnFalse = () => false;
  7711. function attach(comments, ast, text, options) {
  7712. if (!Array.isArray(comments)) {
  7713. return;
  7714. }
  7715. const tiesToBreak = [];
  7716. const {
  7717. locStart,
  7718. locEnd,
  7719. printer: {
  7720. handleComments = {}
  7721. }
  7722. } = options;
  7723. const {
  7724. avoidAstMutation,
  7725. ownLine: handleOwnLineComment = returnFalse,
  7726. endOfLine: handleEndOfLineComment = returnFalse,
  7727. remaining: handleRemainingComment = returnFalse
  7728. } = handleComments;
  7729. const decoratedComments = comments.map((comment, index) => Object.assign(Object.assign({}, decorateComment(ast, comment, options)), {}, {
  7730. comment,
  7731. text,
  7732. options,
  7733. ast,
  7734. isLastComment: comments.length - 1 === index
  7735. }));
  7736. for (const [index, context] of decoratedComments.entries()) {
  7737. const {
  7738. comment,
  7739. precedingNode,
  7740. enclosingNode,
  7741. followingNode,
  7742. text: text2,
  7743. options: options2,
  7744. ast: ast2,
  7745. isLastComment
  7746. } = context;
  7747. if (options2.parser === "json" || options2.parser === "json5" || options2.parser === "__js_expression" || options2.parser === "__vue_expression") {
  7748. if (locStart(comment) - locStart(ast2) <= 0) {
  7749. addLeadingComment(ast2, comment);
  7750. continue;
  7751. }
  7752. if (locEnd(comment) - locEnd(ast2) >= 0) {
  7753. addTrailingComment(ast2, comment);
  7754. continue;
  7755. }
  7756. }
  7757. let args;
  7758. if (avoidAstMutation) {
  7759. args = [context];
  7760. } else {
  7761. comment.enclosingNode = enclosingNode;
  7762. comment.precedingNode = precedingNode;
  7763. comment.followingNode = followingNode;
  7764. args = [comment, text2, options2, ast2, isLastComment];
  7765. }
  7766. if (isOwnLineComment(text2, options2, decoratedComments, index)) {
  7767. comment.placement = "ownLine";
  7768. if (handleOwnLineComment(...args)) {
  7769. } else if (followingNode) {
  7770. addLeadingComment(followingNode, comment);
  7771. } else if (precedingNode) {
  7772. addTrailingComment(precedingNode, comment);
  7773. } else if (enclosingNode) {
  7774. addDanglingComment(enclosingNode, comment);
  7775. } else {
  7776. addDanglingComment(ast2, comment);
  7777. }
  7778. } else if (isEndOfLineComment(text2, options2, decoratedComments, index)) {
  7779. comment.placement = "endOfLine";
  7780. if (handleEndOfLineComment(...args)) {
  7781. } else if (precedingNode) {
  7782. addTrailingComment(precedingNode, comment);
  7783. } else if (followingNode) {
  7784. addLeadingComment(followingNode, comment);
  7785. } else if (enclosingNode) {
  7786. addDanglingComment(enclosingNode, comment);
  7787. } else {
  7788. addDanglingComment(ast2, comment);
  7789. }
  7790. } else {
  7791. comment.placement = "remaining";
  7792. if (handleRemainingComment(...args)) {
  7793. } else if (precedingNode && followingNode) {
  7794. const tieCount = tiesToBreak.length;
  7795. if (tieCount > 0) {
  7796. const lastTie = tiesToBreak[tieCount - 1];
  7797. if (lastTie.followingNode !== followingNode) {
  7798. breakTies(tiesToBreak, text2, options2);
  7799. }
  7800. }
  7801. tiesToBreak.push(context);
  7802. } else if (precedingNode) {
  7803. addTrailingComment(precedingNode, comment);
  7804. } else if (followingNode) {
  7805. addLeadingComment(followingNode, comment);
  7806. } else if (enclosingNode) {
  7807. addDanglingComment(enclosingNode, comment);
  7808. } else {
  7809. addDanglingComment(ast2, comment);
  7810. }
  7811. }
  7812. }
  7813. breakTies(tiesToBreak, text, options);
  7814. if (!avoidAstMutation) {
  7815. for (const comment of comments) {
  7816. delete comment.precedingNode;
  7817. delete comment.enclosingNode;
  7818. delete comment.followingNode;
  7819. }
  7820. }
  7821. }
  7822. var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/.test(text);
  7823. function isOwnLineComment(text, options, decoratedComments, commentIndex) {
  7824. const {
  7825. comment,
  7826. precedingNode
  7827. } = decoratedComments[commentIndex];
  7828. const {
  7829. locStart,
  7830. locEnd
  7831. } = options;
  7832. let start = locStart(comment);
  7833. if (precedingNode) {
  7834. for (let index = commentIndex - 1; index >= 0; index--) {
  7835. const {
  7836. comment: comment2,
  7837. precedingNode: currentCommentPrecedingNode
  7838. } = decoratedComments[index];
  7839. if (currentCommentPrecedingNode !== precedingNode || !isAllEmptyAndNoLineBreak(text.slice(locEnd(comment2), start))) {
  7840. break;
  7841. }
  7842. start = locStart(comment2);
  7843. }
  7844. }
  7845. return hasNewline(text, start, {
  7846. backwards: true
  7847. });
  7848. }
  7849. function isEndOfLineComment(text, options, decoratedComments, commentIndex) {
  7850. const {
  7851. comment,
  7852. followingNode
  7853. } = decoratedComments[commentIndex];
  7854. const {
  7855. locStart,
  7856. locEnd
  7857. } = options;
  7858. let end = locEnd(comment);
  7859. if (followingNode) {
  7860. for (let index = commentIndex + 1; index < decoratedComments.length; index++) {
  7861. const {
  7862. comment: comment2,
  7863. followingNode: currentCommentFollowingNode
  7864. } = decoratedComments[index];
  7865. if (currentCommentFollowingNode !== followingNode || !isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment2)))) {
  7866. break;
  7867. }
  7868. end = locEnd(comment2);
  7869. }
  7870. }
  7871. return hasNewline(text, end);
  7872. }
  7873. function breakTies(tiesToBreak, text, options) {
  7874. const tieCount = tiesToBreak.length;
  7875. if (tieCount === 0) {
  7876. return;
  7877. }
  7878. const {
  7879. precedingNode,
  7880. followingNode,
  7881. enclosingNode
  7882. } = tiesToBreak[0];
  7883. const gapRegExp = options.printer.getGapRegex && options.printer.getGapRegex(enclosingNode) || /^[\s(]*$/;
  7884. let gapEndPos = options.locStart(followingNode);
  7885. let indexOfFirstLeadingComment;
  7886. for (indexOfFirstLeadingComment = tieCount; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) {
  7887. const {
  7888. comment,
  7889. precedingNode: currentCommentPrecedingNode,
  7890. followingNode: currentCommentFollowingNode
  7891. } = tiesToBreak[indexOfFirstLeadingComment - 1];
  7892. assert.strictEqual(currentCommentPrecedingNode, precedingNode);
  7893. assert.strictEqual(currentCommentFollowingNode, followingNode);
  7894. const gap = text.slice(options.locEnd(comment), gapEndPos);
  7895. if (gapRegExp.test(gap)) {
  7896. gapEndPos = options.locStart(comment);
  7897. } else {
  7898. break;
  7899. }
  7900. }
  7901. for (const [i, {
  7902. comment
  7903. }] of tiesToBreak.entries()) {
  7904. if (i < indexOfFirstLeadingComment) {
  7905. addTrailingComment(precedingNode, comment);
  7906. } else {
  7907. addLeadingComment(followingNode, comment);
  7908. }
  7909. }
  7910. for (const node of [precedingNode, followingNode]) {
  7911. if (node.comments && node.comments.length > 1) {
  7912. node.comments.sort((a, b) => options.locStart(a) - options.locStart(b));
  7913. }
  7914. }
  7915. tiesToBreak.length = 0;
  7916. }
  7917. function printComment(path, options) {
  7918. const comment = path.getValue();
  7919. comment.printed = true;
  7920. return options.printer.printComment(path, options);
  7921. }
  7922. function findExpressionIndexForComment(quasis, comment, options) {
  7923. const startPos = options.locStart(comment) - 1;
  7924. for (let i = 1; i < quasis.length; ++i) {
  7925. if (startPos < options.locStart(quasis[i])) {
  7926. return i - 1;
  7927. }
  7928. }
  7929. return 0;
  7930. }
  7931. function printLeadingComment(path, options) {
  7932. const comment = path.getValue();
  7933. const parts = [printComment(path, options)];
  7934. const {
  7935. printer,
  7936. originalText,
  7937. locStart,
  7938. locEnd
  7939. } = options;
  7940. const isBlock = printer.isBlockComment && printer.isBlockComment(comment);
  7941. if (isBlock) {
  7942. const lineBreak = hasNewline(originalText, locEnd(comment)) ? hasNewline(originalText, locStart(comment), {
  7943. backwards: true
  7944. }) ? hardline : line : " ";
  7945. parts.push(lineBreak);
  7946. } else {
  7947. parts.push(hardline);
  7948. }
  7949. const index = skipNewline(originalText, skipSpaces(originalText, locEnd(comment)));
  7950. if (index !== false && hasNewline(originalText, index)) {
  7951. parts.push(hardline);
  7952. }
  7953. return parts;
  7954. }
  7955. function printTrailingComment(path, options) {
  7956. const comment = path.getValue();
  7957. const printed = printComment(path, options);
  7958. const {
  7959. printer,
  7960. originalText,
  7961. locStart
  7962. } = options;
  7963. const isBlock = printer.isBlockComment && printer.isBlockComment(comment);
  7964. if (hasNewline(originalText, locStart(comment), {
  7965. backwards: true
  7966. })) {
  7967. const isLineBeforeEmpty = isPreviousLineEmpty(originalText, comment, locStart);
  7968. return lineSuffix([hardline, isLineBeforeEmpty ? hardline : "", printed]);
  7969. }
  7970. let parts = [" ", printed];
  7971. if (!isBlock) {
  7972. parts = [lineSuffix(parts), breakParent];
  7973. }
  7974. return parts;
  7975. }
  7976. function printDanglingComments(path, options, sameIndent, filter) {
  7977. const parts = [];
  7978. const node = path.getValue();
  7979. if (!node || !node.comments) {
  7980. return "";
  7981. }
  7982. path.each(() => {
  7983. const comment = path.getValue();
  7984. if (!comment.leading && !comment.trailing && (!filter || filter(comment))) {
  7985. parts.push(printComment(path, options));
  7986. }
  7987. }, "comments");
  7988. if (parts.length === 0) {
  7989. return "";
  7990. }
  7991. if (sameIndent) {
  7992. return join(hardline, parts);
  7993. }
  7994. return indent([hardline, join(hardline, parts)]);
  7995. }
  7996. function printCommentsSeparately(path, options, ignored) {
  7997. const value = path.getValue();
  7998. if (!value) {
  7999. return {};
  8000. }
  8001. let comments = value.comments || [];
  8002. if (ignored) {
  8003. comments = comments.filter((comment) => !ignored.has(comment));
  8004. }
  8005. const isCursorNode = value === options.cursorNode;
  8006. if (comments.length === 0) {
  8007. const maybeCursor = isCursorNode ? cursor : "";
  8008. return {
  8009. leading: maybeCursor,
  8010. trailing: maybeCursor
  8011. };
  8012. }
  8013. const leadingParts = [];
  8014. const trailingParts = [];
  8015. path.each(() => {
  8016. const comment = path.getValue();
  8017. if (ignored && ignored.has(comment)) {
  8018. return;
  8019. }
  8020. const {
  8021. leading,
  8022. trailing
  8023. } = comment;
  8024. if (leading) {
  8025. leadingParts.push(printLeadingComment(path, options));
  8026. } else if (trailing) {
  8027. trailingParts.push(printTrailingComment(path, options));
  8028. }
  8029. }, "comments");
  8030. if (isCursorNode) {
  8031. leadingParts.unshift(cursor);
  8032. trailingParts.push(cursor);
  8033. }
  8034. return {
  8035. leading: leadingParts,
  8036. trailing: trailingParts
  8037. };
  8038. }
  8039. function printComments(path, doc2, options, ignored) {
  8040. const {
  8041. leading,
  8042. trailing
  8043. } = printCommentsSeparately(path, options, ignored);
  8044. if (!leading && !trailing) {
  8045. return doc2;
  8046. }
  8047. return [leading, doc2, trailing];
  8048. }
  8049. function ensureAllCommentsPrinted(astComments) {
  8050. if (!astComments) {
  8051. return;
  8052. }
  8053. for (const comment of astComments) {
  8054. if (!comment.printed) {
  8055. throw new Error('Comment "' + comment.value.trim() + '" was not printed. Please report this error!');
  8056. }
  8057. delete comment.printed;
  8058. }
  8059. }
  8060. module2.exports = {
  8061. attach,
  8062. printComments,
  8063. printCommentsSeparately,
  8064. printDanglingComments,
  8065. getSortedChildNodes,
  8066. ensureAllCommentsPrinted
  8067. };
  8068. }
  8069. });
  8070. var require_ast_path = __commonJS2({
  8071. "src/common/ast-path.js"(exports2, module2) {
  8072. "use strict";
  8073. var getLast = require_get_last();
  8074. function getNodeHelper(path, count) {
  8075. const stackIndex = getNodeStackIndexHelper(path.stack, count);
  8076. return stackIndex === -1 ? null : path.stack[stackIndex];
  8077. }
  8078. function getNodeStackIndexHelper(stack, count) {
  8079. for (let i = stack.length - 1; i >= 0; i -= 2) {
  8080. const value = stack[i];
  8081. if (value && !Array.isArray(value) && --count < 0) {
  8082. return i;
  8083. }
  8084. }
  8085. return -1;
  8086. }
  8087. var AstPath = class {
  8088. constructor(value) {
  8089. this.stack = [value];
  8090. }
  8091. getName() {
  8092. const {
  8093. stack
  8094. } = this;
  8095. const {
  8096. length
  8097. } = stack;
  8098. if (length > 1) {
  8099. return stack[length - 2];
  8100. }
  8101. return null;
  8102. }
  8103. getValue() {
  8104. return getLast(this.stack);
  8105. }
  8106. getNode(count = 0) {
  8107. return getNodeHelper(this, count);
  8108. }
  8109. getParentNode(count = 0) {
  8110. return getNodeHelper(this, count + 1);
  8111. }
  8112. call(callback, ...names) {
  8113. const {
  8114. stack
  8115. } = this;
  8116. const {
  8117. length
  8118. } = stack;
  8119. let value = getLast(stack);
  8120. for (const name of names) {
  8121. value = value[name];
  8122. stack.push(name, value);
  8123. }
  8124. const result = callback(this);
  8125. stack.length = length;
  8126. return result;
  8127. }
  8128. callParent(callback, count = 0) {
  8129. const stackIndex = getNodeStackIndexHelper(this.stack, count + 1);
  8130. const parentValues = this.stack.splice(stackIndex + 1);
  8131. const result = callback(this);
  8132. this.stack.push(...parentValues);
  8133. return result;
  8134. }
  8135. each(callback, ...names) {
  8136. const {
  8137. stack
  8138. } = this;
  8139. const {
  8140. length
  8141. } = stack;
  8142. let value = getLast(stack);
  8143. for (const name of names) {
  8144. value = value[name];
  8145. stack.push(name, value);
  8146. }
  8147. for (let i = 0; i < value.length; ++i) {
  8148. stack.push(i, value[i]);
  8149. callback(this, i, value);
  8150. stack.length -= 2;
  8151. }
  8152. stack.length = length;
  8153. }
  8154. map(callback, ...names) {
  8155. const result = [];
  8156. this.each((path, index, value) => {
  8157. result[index] = callback(path, index, value);
  8158. }, ...names);
  8159. return result;
  8160. }
  8161. try(callback) {
  8162. const {
  8163. stack
  8164. } = this;
  8165. const stackBackup = [...stack];
  8166. try {
  8167. return callback();
  8168. } finally {
  8169. stack.length = 0;
  8170. stack.push(...stackBackup);
  8171. }
  8172. }
  8173. match(...predicates) {
  8174. let stackPointer = this.stack.length - 1;
  8175. let name = null;
  8176. let node = this.stack[stackPointer--];
  8177. for (const predicate of predicates) {
  8178. if (node === void 0) {
  8179. return false;
  8180. }
  8181. let number = null;
  8182. if (typeof name === "number") {
  8183. number = name;
  8184. name = this.stack[stackPointer--];
  8185. node = this.stack[stackPointer--];
  8186. }
  8187. if (predicate && !predicate(node, name, number)) {
  8188. return false;
  8189. }
  8190. name = this.stack[stackPointer--];
  8191. node = this.stack[stackPointer--];
  8192. }
  8193. return true;
  8194. }
  8195. findAncestor(predicate) {
  8196. let stackPointer = this.stack.length - 1;
  8197. let name = null;
  8198. let node = this.stack[stackPointer--];
  8199. while (node) {
  8200. let number = null;
  8201. if (typeof name === "number") {
  8202. number = name;
  8203. name = this.stack[stackPointer--];
  8204. node = this.stack[stackPointer--];
  8205. }
  8206. if (name !== null && predicate(node, name, number)) {
  8207. return node;
  8208. }
  8209. name = this.stack[stackPointer--];
  8210. node = this.stack[stackPointer--];
  8211. }
  8212. }
  8213. };
  8214. module2.exports = AstPath;
  8215. }
  8216. });
  8217. var require_multiparser = __commonJS2({
  8218. "src/main/multiparser.js"(exports2, module2) {
  8219. "use strict";
  8220. var {
  8221. utils: {
  8222. stripTrailingHardline
  8223. }
  8224. } = require("./doc.js");
  8225. var {
  8226. normalize
  8227. } = require_options();
  8228. var comments = require_comments();
  8229. function printSubtree(path, print, options, printAstToDoc) {
  8230. if (options.printer.embed && options.embeddedLanguageFormatting === "auto") {
  8231. return options.printer.embed(path, print, (text, partialNextOptions, textToDocOptions) => textToDoc(text, partialNextOptions, options, printAstToDoc, textToDocOptions), options);
  8232. }
  8233. }
  8234. function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc, {
  8235. stripTrailingHardline: shouldStripTrailingHardline = false
  8236. } = {}) {
  8237. const nextOptions = normalize(Object.assign(Object.assign(Object.assign({}, parentOptions), partialNextOptions), {}, {
  8238. parentParser: parentOptions.parser,
  8239. originalText: text
  8240. }), {
  8241. passThrough: true
  8242. });
  8243. const result = require_parser().parse(text, nextOptions);
  8244. const {
  8245. ast
  8246. } = result;
  8247. text = result.text;
  8248. const astComments = ast.comments;
  8249. delete ast.comments;
  8250. comments.attach(astComments, ast, text, nextOptions);
  8251. nextOptions[Symbol.for("comments")] = astComments || [];
  8252. nextOptions[Symbol.for("tokens")] = ast.tokens || [];
  8253. const doc2 = printAstToDoc(ast, nextOptions);
  8254. comments.ensureAllCommentsPrinted(astComments);
  8255. if (shouldStripTrailingHardline) {
  8256. if (typeof doc2 === "string") {
  8257. return doc2.replace(/(?:\r?\n)*$/, "");
  8258. }
  8259. return stripTrailingHardline(doc2);
  8260. }
  8261. return doc2;
  8262. }
  8263. module2.exports = {
  8264. printSubtree
  8265. };
  8266. }
  8267. });
  8268. var require_ast_to_doc = __commonJS2({
  8269. "src/main/ast-to-doc.js"(exports2, module2) {
  8270. "use strict";
  8271. var AstPath = require_ast_path();
  8272. var {
  8273. builders: {
  8274. hardline,
  8275. addAlignmentToDoc
  8276. },
  8277. utils: {
  8278. propagateBreaks
  8279. }
  8280. } = require("./doc.js");
  8281. var {
  8282. printComments
  8283. } = require_comments();
  8284. var multiparser = require_multiparser();
  8285. function printAstToDoc(ast, options, alignmentSize = 0) {
  8286. const {
  8287. printer
  8288. } = options;
  8289. if (printer.preprocess) {
  8290. ast = printer.preprocess(ast, options);
  8291. }
  8292. const cache = /* @__PURE__ */ new Map();
  8293. const path = new AstPath(ast);
  8294. let doc2 = mainPrint();
  8295. if (alignmentSize > 0) {
  8296. doc2 = addAlignmentToDoc([hardline, doc2], alignmentSize, options.tabWidth);
  8297. }
  8298. propagateBreaks(doc2);
  8299. return doc2;
  8300. function mainPrint(selector, args) {
  8301. if (selector === void 0 || selector === path) {
  8302. return mainPrintInternal(args);
  8303. }
  8304. if (Array.isArray(selector)) {
  8305. return path.call(() => mainPrintInternal(args), ...selector);
  8306. }
  8307. return path.call(() => mainPrintInternal(args), selector);
  8308. }
  8309. function mainPrintInternal(args) {
  8310. const value = path.getValue();
  8311. const shouldCache = value && typeof value === "object" && args === void 0;
  8312. if (shouldCache && cache.has(value)) {
  8313. return cache.get(value);
  8314. }
  8315. const doc3 = callPluginPrintFunction(path, options, mainPrint, args);
  8316. if (shouldCache) {
  8317. cache.set(value, doc3);
  8318. }
  8319. return doc3;
  8320. }
  8321. }
  8322. function printPrettierIgnoredNode(node, options) {
  8323. const {
  8324. originalText,
  8325. [Symbol.for("comments")]: comments,
  8326. locStart,
  8327. locEnd
  8328. } = options;
  8329. const start = locStart(node);
  8330. const end = locEnd(node);
  8331. const printedComments = /* @__PURE__ */ new Set();
  8332. for (const comment of comments) {
  8333. if (locStart(comment) >= start && locEnd(comment) <= end) {
  8334. comment.printed = true;
  8335. printedComments.add(comment);
  8336. }
  8337. }
  8338. return {
  8339. doc: originalText.slice(start, end),
  8340. printedComments
  8341. };
  8342. }
  8343. function callPluginPrintFunction(path, options, printPath, args) {
  8344. const node = path.getValue();
  8345. const {
  8346. printer
  8347. } = options;
  8348. let doc2;
  8349. let printedComments;
  8350. if (printer.hasPrettierIgnore && printer.hasPrettierIgnore(path)) {
  8351. ({
  8352. doc: doc2,
  8353. printedComments
  8354. } = printPrettierIgnoredNode(node, options));
  8355. } else {
  8356. if (node) {
  8357. try {
  8358. doc2 = multiparser.printSubtree(path, printPath, options, printAstToDoc);
  8359. } catch (error) {
  8360. if (process.env.PRETTIER_DEBUG) {
  8361. throw error;
  8362. }
  8363. }
  8364. }
  8365. if (!doc2) {
  8366. doc2 = printer.print(path, options, printPath, args);
  8367. }
  8368. }
  8369. if (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path, options)) {
  8370. doc2 = printComments(path, doc2, options, printedComments);
  8371. }
  8372. return doc2;
  8373. }
  8374. module2.exports = printAstToDoc;
  8375. }
  8376. });
  8377. var require_range_util = __commonJS2({
  8378. "src/main/range-util.js"(exports2, module2) {
  8379. "use strict";
  8380. var assert = require("assert");
  8381. var comments = require_comments();
  8382. var isJsonParser = ({
  8383. parser
  8384. }) => parser === "json" || parser === "json5" || parser === "json-stringify";
  8385. function findCommonAncestor(startNodeAndParents, endNodeAndParents) {
  8386. const startNodeAndAncestors = [startNodeAndParents.node, ...startNodeAndParents.parentNodes];
  8387. const endNodeAndAncestors = /* @__PURE__ */ new Set([endNodeAndParents.node, ...endNodeAndParents.parentNodes]);
  8388. return startNodeAndAncestors.find((node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node));
  8389. }
  8390. function dropRootParents(parents) {
  8391. let lastParentIndex = parents.length - 1;
  8392. for (; ; ) {
  8393. const parent = parents[lastParentIndex];
  8394. if (parent && (parent.type === "Program" || parent.type === "File")) {
  8395. lastParentIndex--;
  8396. } else {
  8397. break;
  8398. }
  8399. }
  8400. return parents.slice(0, lastParentIndex + 1);
  8401. }
  8402. function findSiblingAncestors(startNodeAndParents, endNodeAndParents, {
  8403. locStart,
  8404. locEnd
  8405. }) {
  8406. let resultStartNode = startNodeAndParents.node;
  8407. let resultEndNode = endNodeAndParents.node;
  8408. if (resultStartNode === resultEndNode) {
  8409. return {
  8410. startNode: resultStartNode,
  8411. endNode: resultEndNode
  8412. };
  8413. }
  8414. const startNodeStart = locStart(startNodeAndParents.node);
  8415. for (const endParent of dropRootParents(endNodeAndParents.parentNodes)) {
  8416. if (locStart(endParent) >= startNodeStart) {
  8417. resultEndNode = endParent;
  8418. } else {
  8419. break;
  8420. }
  8421. }
  8422. const endNodeEnd = locEnd(endNodeAndParents.node);
  8423. for (const startParent of dropRootParents(startNodeAndParents.parentNodes)) {
  8424. if (locEnd(startParent) <= endNodeEnd) {
  8425. resultStartNode = startParent;
  8426. } else {
  8427. break;
  8428. }
  8429. }
  8430. return {
  8431. startNode: resultStartNode,
  8432. endNode: resultEndNode
  8433. };
  8434. }
  8435. function findNodeAtOffset(node, offset, options, predicate, parentNodes = [], type) {
  8436. const {
  8437. locStart,
  8438. locEnd
  8439. } = options;
  8440. const start = locStart(node);
  8441. const end = locEnd(node);
  8442. if (offset > end || offset < start || type === "rangeEnd" && offset === start || type === "rangeStart" && offset === end) {
  8443. return;
  8444. }
  8445. for (const childNode of comments.getSortedChildNodes(node, options)) {
  8446. const childResult = findNodeAtOffset(childNode, offset, options, predicate, [node, ...parentNodes], type);
  8447. if (childResult) {
  8448. return childResult;
  8449. }
  8450. }
  8451. if (!predicate || predicate(node, parentNodes[0])) {
  8452. return {
  8453. node,
  8454. parentNodes
  8455. };
  8456. }
  8457. }
  8458. function isJsSourceElement(type, parentType) {
  8459. return parentType !== "DeclareExportDeclaration" && type !== "TypeParameterDeclaration" && (type === "Directive" || type === "TypeAlias" || type === "TSExportAssignment" || type.startsWith("Declare") || type.startsWith("TSDeclare") || type.endsWith("Statement") || type.endsWith("Declaration"));
  8460. }
  8461. var jsonSourceElements = /* @__PURE__ */ new Set(["ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]);
  8462. var graphqlSourceElements = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
  8463. function isSourceElement(opts, node, parentNode) {
  8464. if (!node) {
  8465. return false;
  8466. }
  8467. switch (opts.parser) {
  8468. case "flow":
  8469. case "babel":
  8470. case "babel-flow":
  8471. case "babel-ts":
  8472. case "typescript":
  8473. case "acorn":
  8474. case "espree":
  8475. case "meriyah":
  8476. case "__babel_estree":
  8477. return isJsSourceElement(node.type, parentNode && parentNode.type);
  8478. case "json":
  8479. case "json5":
  8480. case "json-stringify":
  8481. return jsonSourceElements.has(node.type);
  8482. case "graphql":
  8483. return graphqlSourceElements.has(node.kind);
  8484. case "vue":
  8485. return node.tag !== "root";
  8486. }
  8487. return false;
  8488. }
  8489. function calculateRange(text, opts, ast) {
  8490. let {
  8491. rangeStart: start,
  8492. rangeEnd: end,
  8493. locStart,
  8494. locEnd
  8495. } = opts;
  8496. assert.ok(end > start);
  8497. const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/);
  8498. const isAllWhitespace = firstNonWhitespaceCharacterIndex === -1;
  8499. if (!isAllWhitespace) {
  8500. start += firstNonWhitespaceCharacterIndex;
  8501. for (; end > start; --end) {
  8502. if (/\S/.test(text[end - 1])) {
  8503. break;
  8504. }
  8505. }
  8506. }
  8507. const startNodeAndParents = findNodeAtOffset(ast, start, opts, (node, parentNode) => isSourceElement(opts, node, parentNode), [], "rangeStart");
  8508. const endNodeAndParents = isAllWhitespace ? startNodeAndParents : findNodeAtOffset(ast, end, opts, (node) => isSourceElement(opts, node), [], "rangeEnd");
  8509. if (!startNodeAndParents || !endNodeAndParents) {
  8510. return {
  8511. rangeStart: 0,
  8512. rangeEnd: 0
  8513. };
  8514. }
  8515. let startNode;
  8516. let endNode;
  8517. if (isJsonParser(opts)) {
  8518. const commonAncestor = findCommonAncestor(startNodeAndParents, endNodeAndParents);
  8519. startNode = commonAncestor;
  8520. endNode = commonAncestor;
  8521. } else {
  8522. ({
  8523. startNode,
  8524. endNode
  8525. } = findSiblingAncestors(startNodeAndParents, endNodeAndParents, opts));
  8526. }
  8527. return {
  8528. rangeStart: Math.min(locStart(startNode), locStart(endNode)),
  8529. rangeEnd: Math.max(locEnd(startNode), locEnd(endNode))
  8530. };
  8531. }
  8532. module2.exports = {
  8533. calculateRange,
  8534. findNodeAtOffset
  8535. };
  8536. }
  8537. });
  8538. var require_core = __commonJS2({
  8539. "src/main/core.js"(exports2, module2) {
  8540. "use strict";
  8541. var {
  8542. diffArrays
  8543. } = require_array();
  8544. var {
  8545. printer: {
  8546. printDocToString
  8547. },
  8548. debug: {
  8549. printDocToDebug
  8550. }
  8551. } = require("./doc.js");
  8552. var {
  8553. getAlignmentSize
  8554. } = require_util();
  8555. var {
  8556. guessEndOfLine,
  8557. convertEndOfLineToChars,
  8558. countEndOfLineChars,
  8559. normalizeEndOfLine
  8560. } = require_end_of_line();
  8561. var normalizeOptions = require_options().normalize;
  8562. var massageAST = require_massage_ast();
  8563. var comments = require_comments();
  8564. var parser = require_parser();
  8565. var printAstToDoc = require_ast_to_doc();
  8566. var rangeUtil = require_range_util();
  8567. var BOM = "\uFEFF";
  8568. var CURSOR = Symbol("cursor");
  8569. function attachComments(text, ast, opts) {
  8570. const astComments = ast.comments;
  8571. if (astComments) {
  8572. delete ast.comments;
  8573. comments.attach(astComments, ast, text, opts);
  8574. }
  8575. opts[Symbol.for("comments")] = astComments || [];
  8576. opts[Symbol.for("tokens")] = ast.tokens || [];
  8577. opts.originalText = text;
  8578. return astComments;
  8579. }
  8580. function coreFormat(originalText, opts, addAlignmentSize = 0) {
  8581. if (!originalText || originalText.trim().length === 0) {
  8582. return {
  8583. formatted: "",
  8584. cursorOffset: -1,
  8585. comments: []
  8586. };
  8587. }
  8588. const {
  8589. ast,
  8590. text
  8591. } = parser.parse(originalText, opts);
  8592. if (opts.cursorOffset >= 0) {
  8593. const nodeResult = rangeUtil.findNodeAtOffset(ast, opts.cursorOffset, opts);
  8594. if (nodeResult && nodeResult.node) {
  8595. opts.cursorNode = nodeResult.node;
  8596. }
  8597. }
  8598. const astComments = attachComments(text, ast, opts);
  8599. const doc2 = printAstToDoc(ast, opts, addAlignmentSize);
  8600. const result = printDocToString(doc2, opts);
  8601. comments.ensureAllCommentsPrinted(astComments);
  8602. if (addAlignmentSize > 0) {
  8603. const trimmed = result.formatted.trim();
  8604. if (result.cursorNodeStart !== void 0) {
  8605. result.cursorNodeStart -= result.formatted.indexOf(trimmed);
  8606. }
  8607. result.formatted = trimmed + convertEndOfLineToChars(opts.endOfLine);
  8608. }
  8609. if (opts.cursorOffset >= 0) {
  8610. let oldCursorNodeStart;
  8611. let oldCursorNodeText;
  8612. let cursorOffsetRelativeToOldCursorNode;
  8613. let newCursorNodeStart;
  8614. let newCursorNodeText;
  8615. if (opts.cursorNode && result.cursorNodeText) {
  8616. oldCursorNodeStart = opts.locStart(opts.cursorNode);
  8617. oldCursorNodeText = text.slice(oldCursorNodeStart, opts.locEnd(opts.cursorNode));
  8618. cursorOffsetRelativeToOldCursorNode = opts.cursorOffset - oldCursorNodeStart;
  8619. newCursorNodeStart = result.cursorNodeStart;
  8620. newCursorNodeText = result.cursorNodeText;
  8621. } else {
  8622. oldCursorNodeStart = 0;
  8623. oldCursorNodeText = text;
  8624. cursorOffsetRelativeToOldCursorNode = opts.cursorOffset;
  8625. newCursorNodeStart = 0;
  8626. newCursorNodeText = result.formatted;
  8627. }
  8628. if (oldCursorNodeText === newCursorNodeText) {
  8629. return {
  8630. formatted: result.formatted,
  8631. cursorOffset: newCursorNodeStart + cursorOffsetRelativeToOldCursorNode,
  8632. comments: astComments
  8633. };
  8634. }
  8635. const oldCursorNodeCharArray = [...oldCursorNodeText];
  8636. oldCursorNodeCharArray.splice(cursorOffsetRelativeToOldCursorNode, 0, CURSOR);
  8637. const newCursorNodeCharArray = [...newCursorNodeText];
  8638. const cursorNodeDiff = diffArrays(oldCursorNodeCharArray, newCursorNodeCharArray);
  8639. let cursorOffset = newCursorNodeStart;
  8640. for (const entry of cursorNodeDiff) {
  8641. if (entry.removed) {
  8642. if (entry.value.includes(CURSOR)) {
  8643. break;
  8644. }
  8645. } else {
  8646. cursorOffset += entry.count;
  8647. }
  8648. }
  8649. return {
  8650. formatted: result.formatted,
  8651. cursorOffset,
  8652. comments: astComments
  8653. };
  8654. }
  8655. return {
  8656. formatted: result.formatted,
  8657. cursorOffset: -1,
  8658. comments: astComments
  8659. };
  8660. }
  8661. function formatRange(originalText, opts) {
  8662. const {
  8663. ast,
  8664. text
  8665. } = parser.parse(originalText, opts);
  8666. const {
  8667. rangeStart,
  8668. rangeEnd
  8669. } = rangeUtil.calculateRange(text, opts, ast);
  8670. const rangeString = text.slice(rangeStart, rangeEnd);
  8671. const rangeStart2 = Math.min(rangeStart, text.lastIndexOf("\n", rangeStart) + 1);
  8672. const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/)[0];
  8673. const alignmentSize = getAlignmentSize(indentString, opts.tabWidth);
  8674. const rangeResult = coreFormat(rangeString, Object.assign(Object.assign({}, opts), {}, {
  8675. rangeStart: 0,
  8676. rangeEnd: Number.POSITIVE_INFINITY,
  8677. cursorOffset: opts.cursorOffset > rangeStart && opts.cursorOffset <= rangeEnd ? opts.cursorOffset - rangeStart : -1,
  8678. endOfLine: "lf"
  8679. }), alignmentSize);
  8680. const rangeTrimmed = rangeResult.formatted.trimEnd();
  8681. let {
  8682. cursorOffset
  8683. } = opts;
  8684. if (cursorOffset > rangeEnd) {
  8685. cursorOffset += rangeTrimmed.length - rangeString.length;
  8686. } else if (rangeResult.cursorOffset >= 0) {
  8687. cursorOffset = rangeResult.cursorOffset + rangeStart;
  8688. }
  8689. let formatted = text.slice(0, rangeStart) + rangeTrimmed + text.slice(rangeEnd);
  8690. if (opts.endOfLine !== "lf") {
  8691. const eol = convertEndOfLineToChars(opts.endOfLine);
  8692. if (cursorOffset >= 0 && eol === "\r\n") {
  8693. cursorOffset += countEndOfLineChars(formatted.slice(0, cursorOffset), "\n");
  8694. }
  8695. formatted = formatted.replace(/\n/g, eol);
  8696. }
  8697. return {
  8698. formatted,
  8699. cursorOffset,
  8700. comments: rangeResult.comments
  8701. };
  8702. }
  8703. function ensureIndexInText(text, index, defaultValue) {
  8704. if (typeof index !== "number" || Number.isNaN(index) || index < 0 || index > text.length) {
  8705. return defaultValue;
  8706. }
  8707. return index;
  8708. }
  8709. function normalizeIndexes(text, options) {
  8710. let {
  8711. cursorOffset,
  8712. rangeStart,
  8713. rangeEnd
  8714. } = options;
  8715. cursorOffset = ensureIndexInText(text, cursorOffset, -1);
  8716. rangeStart = ensureIndexInText(text, rangeStart, 0);
  8717. rangeEnd = ensureIndexInText(text, rangeEnd, text.length);
  8718. return Object.assign(Object.assign({}, options), {}, {
  8719. cursorOffset,
  8720. rangeStart,
  8721. rangeEnd
  8722. });
  8723. }
  8724. function normalizeInputAndOptions(text, options) {
  8725. let {
  8726. cursorOffset,
  8727. rangeStart,
  8728. rangeEnd,
  8729. endOfLine
  8730. } = normalizeIndexes(text, options);
  8731. const hasBOM = text.charAt(0) === BOM;
  8732. if (hasBOM) {
  8733. text = text.slice(1);
  8734. cursorOffset--;
  8735. rangeStart--;
  8736. rangeEnd--;
  8737. }
  8738. if (endOfLine === "auto") {
  8739. endOfLine = guessEndOfLine(text);
  8740. }
  8741. if (text.includes("\r")) {
  8742. const countCrlfBefore = (index) => countEndOfLineChars(text.slice(0, Math.max(index, 0)), "\r\n");
  8743. cursorOffset -= countCrlfBefore(cursorOffset);
  8744. rangeStart -= countCrlfBefore(rangeStart);
  8745. rangeEnd -= countCrlfBefore(rangeEnd);
  8746. text = normalizeEndOfLine(text);
  8747. }
  8748. return {
  8749. hasBOM,
  8750. text,
  8751. options: normalizeIndexes(text, Object.assign(Object.assign({}, options), {}, {
  8752. cursorOffset,
  8753. rangeStart,
  8754. rangeEnd,
  8755. endOfLine
  8756. }))
  8757. };
  8758. }
  8759. function hasPragma(text, options) {
  8760. const selectedParser = parser.resolveParser(options);
  8761. return !selectedParser.hasPragma || selectedParser.hasPragma(text);
  8762. }
  8763. function formatWithCursor2(originalText, originalOptions) {
  8764. let {
  8765. hasBOM,
  8766. text,
  8767. options
  8768. } = normalizeInputAndOptions(originalText, normalizeOptions(originalOptions));
  8769. if (options.rangeStart >= options.rangeEnd && text !== "" || options.requirePragma && !hasPragma(text, options)) {
  8770. return {
  8771. formatted: originalText,
  8772. cursorOffset: originalOptions.cursorOffset,
  8773. comments: []
  8774. };
  8775. }
  8776. let result;
  8777. if (options.rangeStart > 0 || options.rangeEnd < text.length) {
  8778. result = formatRange(text, options);
  8779. } else {
  8780. if (!options.requirePragma && options.insertPragma && options.printer.insertPragma && !hasPragma(text, options)) {
  8781. text = options.printer.insertPragma(text);
  8782. }
  8783. result = coreFormat(text, options);
  8784. }
  8785. if (hasBOM) {
  8786. result.formatted = BOM + result.formatted;
  8787. if (result.cursorOffset >= 0) {
  8788. result.cursorOffset++;
  8789. }
  8790. }
  8791. return result;
  8792. }
  8793. module2.exports = {
  8794. formatWithCursor: formatWithCursor2,
  8795. parse(originalText, originalOptions, massage) {
  8796. const {
  8797. text,
  8798. options
  8799. } = normalizeInputAndOptions(originalText, normalizeOptions(originalOptions));
  8800. const parsed = parser.parse(text, options);
  8801. if (massage) {
  8802. parsed.ast = massageAST(parsed.ast, options);
  8803. }
  8804. return parsed;
  8805. },
  8806. formatAST(ast, options) {
  8807. options = normalizeOptions(options);
  8808. const doc2 = printAstToDoc(ast, options);
  8809. return printDocToString(doc2, options);
  8810. },
  8811. formatDoc(doc2, options) {
  8812. return formatWithCursor2(printDocToDebug(doc2), Object.assign(Object.assign({}, options), {}, {
  8813. parser: "__js_expression"
  8814. })).formatted;
  8815. },
  8816. printToDoc(originalText, options) {
  8817. options = normalizeOptions(options);
  8818. const {
  8819. ast,
  8820. text
  8821. } = parser.parse(originalText, options);
  8822. attachComments(text, ast, options);
  8823. return printAstToDoc(ast, options);
  8824. },
  8825. printDocToString(doc2, options) {
  8826. return printDocToString(doc2, normalizeOptions(options));
  8827. }
  8828. };
  8829. }
  8830. });
  8831. var require_utils2 = __commonJS2({
  8832. "node_modules/braces/lib/utils.js"(exports2) {
  8833. "use strict";
  8834. exports2.isInteger = (num) => {
  8835. if (typeof num === "number") {
  8836. return Number.isInteger(num);
  8837. }
  8838. if (typeof num === "string" && num.trim() !== "") {
  8839. return Number.isInteger(Number(num));
  8840. }
  8841. return false;
  8842. };
  8843. exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
  8844. exports2.exceedsLimit = (min, max, step = 1, limit) => {
  8845. if (limit === false)
  8846. return false;
  8847. if (!exports2.isInteger(min) || !exports2.isInteger(max))
  8848. return false;
  8849. return (Number(max) - Number(min)) / Number(step) >= limit;
  8850. };
  8851. exports2.escapeNode = (block, n = 0, type) => {
  8852. let node = block.nodes[n];
  8853. if (!node)
  8854. return;
  8855. if (type && node.type === type || node.type === "open" || node.type === "close") {
  8856. if (node.escaped !== true) {
  8857. node.value = "\\" + node.value;
  8858. node.escaped = true;
  8859. }
  8860. }
  8861. };
  8862. exports2.encloseBrace = (node) => {
  8863. if (node.type !== "brace")
  8864. return false;
  8865. if (node.commas >> 0 + node.ranges >> 0 === 0) {
  8866. node.invalid = true;
  8867. return true;
  8868. }
  8869. return false;
  8870. };
  8871. exports2.isInvalidBrace = (block) => {
  8872. if (block.type !== "brace")
  8873. return false;
  8874. if (block.invalid === true || block.dollar)
  8875. return true;
  8876. if (block.commas >> 0 + block.ranges >> 0 === 0) {
  8877. block.invalid = true;
  8878. return true;
  8879. }
  8880. if (block.open !== true || block.close !== true) {
  8881. block.invalid = true;
  8882. return true;
  8883. }
  8884. return false;
  8885. };
  8886. exports2.isOpenOrClose = (node) => {
  8887. if (node.type === "open" || node.type === "close") {
  8888. return true;
  8889. }
  8890. return node.open === true || node.close === true;
  8891. };
  8892. exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
  8893. if (node.type === "text")
  8894. acc.push(node.value);
  8895. if (node.type === "range")
  8896. node.type = "text";
  8897. return acc;
  8898. }, []);
  8899. exports2.flatten = (...args) => {
  8900. const result = [];
  8901. const flat = (arr) => {
  8902. for (let i = 0; i < arr.length; i++) {
  8903. let ele = arr[i];
  8904. Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
  8905. }
  8906. return result;
  8907. };
  8908. flat(args);
  8909. return result;
  8910. };
  8911. }
  8912. });
  8913. var require_stringify = __commonJS2({
  8914. "node_modules/braces/lib/stringify.js"(exports2, module2) {
  8915. "use strict";
  8916. var utils = require_utils2();
  8917. module2.exports = (ast, options = {}) => {
  8918. let stringify = (node, parent = {}) => {
  8919. let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
  8920. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  8921. let output = "";
  8922. if (node.value) {
  8923. if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
  8924. return "\\" + node.value;
  8925. }
  8926. return node.value;
  8927. }
  8928. if (node.value) {
  8929. return node.value;
  8930. }
  8931. if (node.nodes) {
  8932. for (let child of node.nodes) {
  8933. output += stringify(child);
  8934. }
  8935. }
  8936. return output;
  8937. };
  8938. return stringify(ast);
  8939. };
  8940. }
  8941. });
  8942. var require_is_number = __commonJS2({
  8943. "node_modules/is-number/index.js"(exports2, module2) {
  8944. "use strict";
  8945. module2.exports = function(num) {
  8946. if (typeof num === "number") {
  8947. return num - num === 0;
  8948. }
  8949. if (typeof num === "string" && num.trim() !== "") {
  8950. return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  8951. }
  8952. return false;
  8953. };
  8954. }
  8955. });
  8956. var require_to_regex_range = __commonJS2({
  8957. "node_modules/to-regex-range/index.js"(exports2, module2) {
  8958. "use strict";
  8959. var isNumber = require_is_number();
  8960. var toRegexRange = (min, max, options) => {
  8961. if (isNumber(min) === false) {
  8962. throw new TypeError("toRegexRange: expected the first argument to be a number");
  8963. }
  8964. if (max === void 0 || min === max) {
  8965. return String(min);
  8966. }
  8967. if (isNumber(max) === false) {
  8968. throw new TypeError("toRegexRange: expected the second argument to be a number.");
  8969. }
  8970. let opts = Object.assign({
  8971. relaxZeros: true
  8972. }, options);
  8973. if (typeof opts.strictZeros === "boolean") {
  8974. opts.relaxZeros = opts.strictZeros === false;
  8975. }
  8976. let relax = String(opts.relaxZeros);
  8977. let shorthand = String(opts.shorthand);
  8978. let capture = String(opts.capture);
  8979. let wrap = String(opts.wrap);
  8980. let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
  8981. if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
  8982. return toRegexRange.cache[cacheKey].result;
  8983. }
  8984. let a = Math.min(min, max);
  8985. let b = Math.max(min, max);
  8986. if (Math.abs(a - b) === 1) {
  8987. let result = min + "|" + max;
  8988. if (opts.capture) {
  8989. return `(${result})`;
  8990. }
  8991. if (opts.wrap === false) {
  8992. return result;
  8993. }
  8994. return `(?:${result})`;
  8995. }
  8996. let isPadded = hasPadding(min) || hasPadding(max);
  8997. let state = {
  8998. min,
  8999. max,
  9000. a,
  9001. b
  9002. };
  9003. let positives = [];
  9004. let negatives = [];
  9005. if (isPadded) {
  9006. state.isPadded = isPadded;
  9007. state.maxLen = String(state.max).length;
  9008. }
  9009. if (a < 0) {
  9010. let newMin = b < 0 ? Math.abs(b) : 1;
  9011. negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
  9012. a = state.a = 0;
  9013. }
  9014. if (b >= 0) {
  9015. positives = splitToPatterns(a, b, state, opts);
  9016. }
  9017. state.negatives = negatives;
  9018. state.positives = positives;
  9019. state.result = collatePatterns(negatives, positives, opts);
  9020. if (opts.capture === true) {
  9021. state.result = `(${state.result})`;
  9022. } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
  9023. state.result = `(?:${state.result})`;
  9024. }
  9025. toRegexRange.cache[cacheKey] = state;
  9026. return state.result;
  9027. };
  9028. function collatePatterns(neg, pos, options) {
  9029. let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
  9030. let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
  9031. let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
  9032. let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
  9033. return subpatterns.join("|");
  9034. }
  9035. function splitToRanges(min, max) {
  9036. let nines = 1;
  9037. let zeros = 1;
  9038. let stop = countNines(min, nines);
  9039. let stops = /* @__PURE__ */ new Set([max]);
  9040. while (min <= stop && stop <= max) {
  9041. stops.add(stop);
  9042. nines += 1;
  9043. stop = countNines(min, nines);
  9044. }
  9045. stop = countZeros(max + 1, zeros) - 1;
  9046. while (min < stop && stop <= max) {
  9047. stops.add(stop);
  9048. zeros += 1;
  9049. stop = countZeros(max + 1, zeros) - 1;
  9050. }
  9051. stops = [...stops];
  9052. stops.sort(compare);
  9053. return stops;
  9054. }
  9055. function rangeToPattern(start, stop, options) {
  9056. if (start === stop) {
  9057. return {
  9058. pattern: start,
  9059. count: [],
  9060. digits: 0
  9061. };
  9062. }
  9063. let zipped = zip(start, stop);
  9064. let digits = zipped.length;
  9065. let pattern = "";
  9066. let count = 0;
  9067. for (let i = 0; i < digits; i++) {
  9068. let [startDigit, stopDigit] = zipped[i];
  9069. if (startDigit === stopDigit) {
  9070. pattern += startDigit;
  9071. } else if (startDigit !== "0" || stopDigit !== "9") {
  9072. pattern += toCharacterClass(startDigit, stopDigit, options);
  9073. } else {
  9074. count++;
  9075. }
  9076. }
  9077. if (count) {
  9078. pattern += options.shorthand === true ? "\\d" : "[0-9]";
  9079. }
  9080. return {
  9081. pattern,
  9082. count: [count],
  9083. digits
  9084. };
  9085. }
  9086. function splitToPatterns(min, max, tok, options) {
  9087. let ranges = splitToRanges(min, max);
  9088. let tokens = [];
  9089. let start = min;
  9090. let prev;
  9091. for (let i = 0; i < ranges.length; i++) {
  9092. let max2 = ranges[i];
  9093. let obj = rangeToPattern(String(start), String(max2), options);
  9094. let zeros = "";
  9095. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  9096. if (prev.count.length > 1) {
  9097. prev.count.pop();
  9098. }
  9099. prev.count.push(obj.count[0]);
  9100. prev.string = prev.pattern + toQuantifier(prev.count);
  9101. start = max2 + 1;
  9102. continue;
  9103. }
  9104. if (tok.isPadded) {
  9105. zeros = padZeros(max2, tok, options);
  9106. }
  9107. obj.string = zeros + obj.pattern + toQuantifier(obj.count);
  9108. tokens.push(obj);
  9109. start = max2 + 1;
  9110. prev = obj;
  9111. }
  9112. return tokens;
  9113. }
  9114. function filterPatterns(arr, comparison, prefix, intersection, options) {
  9115. let result = [];
  9116. for (let ele of arr) {
  9117. let {
  9118. string
  9119. } = ele;
  9120. if (!intersection && !contains(comparison, "string", string)) {
  9121. result.push(prefix + string);
  9122. }
  9123. if (intersection && contains(comparison, "string", string)) {
  9124. result.push(prefix + string);
  9125. }
  9126. }
  9127. return result;
  9128. }
  9129. function zip(a, b) {
  9130. let arr = [];
  9131. for (let i = 0; i < a.length; i++)
  9132. arr.push([a[i], b[i]]);
  9133. return arr;
  9134. }
  9135. function compare(a, b) {
  9136. return a > b ? 1 : b > a ? -1 : 0;
  9137. }
  9138. function contains(arr, key, val) {
  9139. return arr.some((ele) => ele[key] === val);
  9140. }
  9141. function countNines(min, len) {
  9142. return Number(String(min).slice(0, -len) + "9".repeat(len));
  9143. }
  9144. function countZeros(integer, zeros) {
  9145. return integer - integer % Math.pow(10, zeros);
  9146. }
  9147. function toQuantifier(digits) {
  9148. let [start = 0, stop = ""] = digits;
  9149. if (stop || start > 1) {
  9150. return `{${start + (stop ? "," + stop : "")}}`;
  9151. }
  9152. return "";
  9153. }
  9154. function toCharacterClass(a, b, options) {
  9155. return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
  9156. }
  9157. function hasPadding(str) {
  9158. return /^-?(0+)\d/.test(str);
  9159. }
  9160. function padZeros(value, tok, options) {
  9161. if (!tok.isPadded) {
  9162. return value;
  9163. }
  9164. let diff = Math.abs(tok.maxLen - String(value).length);
  9165. let relax = options.relaxZeros !== false;
  9166. switch (diff) {
  9167. case 0:
  9168. return "";
  9169. case 1:
  9170. return relax ? "0?" : "0";
  9171. case 2:
  9172. return relax ? "0{0,2}" : "00";
  9173. default: {
  9174. return relax ? `0{0,${diff}}` : `0{${diff}}`;
  9175. }
  9176. }
  9177. }
  9178. toRegexRange.cache = {};
  9179. toRegexRange.clearCache = () => toRegexRange.cache = {};
  9180. module2.exports = toRegexRange;
  9181. }
  9182. });
  9183. var require_fill_range = __commonJS2({
  9184. "node_modules/fill-range/index.js"(exports2, module2) {
  9185. "use strict";
  9186. var util = require("util");
  9187. var toRegexRange = require_to_regex_range();
  9188. var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  9189. var transform = (toNumber) => {
  9190. return (value) => toNumber === true ? Number(value) : String(value);
  9191. };
  9192. var isValidValue = (value) => {
  9193. return typeof value === "number" || typeof value === "string" && value !== "";
  9194. };
  9195. var isNumber = (num) => Number.isInteger(+num);
  9196. var zeros = (input) => {
  9197. let value = `${input}`;
  9198. let index = -1;
  9199. if (value[0] === "-")
  9200. value = value.slice(1);
  9201. if (value === "0")
  9202. return false;
  9203. while (value[++index] === "0")
  9204. ;
  9205. return index > 0;
  9206. };
  9207. var stringify = (start, end, options) => {
  9208. if (typeof start === "string" || typeof end === "string") {
  9209. return true;
  9210. }
  9211. return options.stringify === true;
  9212. };
  9213. var pad = (input, maxLength, toNumber) => {
  9214. if (maxLength > 0) {
  9215. let dash = input[0] === "-" ? "-" : "";
  9216. if (dash)
  9217. input = input.slice(1);
  9218. input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
  9219. }
  9220. if (toNumber === false) {
  9221. return String(input);
  9222. }
  9223. return input;
  9224. };
  9225. var toMaxLen = (input, maxLength) => {
  9226. let negative = input[0] === "-" ? "-" : "";
  9227. if (negative) {
  9228. input = input.slice(1);
  9229. maxLength--;
  9230. }
  9231. while (input.length < maxLength)
  9232. input = "0" + input;
  9233. return negative ? "-" + input : input;
  9234. };
  9235. var toSequence = (parts, options) => {
  9236. parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  9237. parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  9238. let prefix = options.capture ? "" : "?:";
  9239. let positives = "";
  9240. let negatives = "";
  9241. let result;
  9242. if (parts.positives.length) {
  9243. positives = parts.positives.join("|");
  9244. }
  9245. if (parts.negatives.length) {
  9246. negatives = `-(${prefix}${parts.negatives.join("|")})`;
  9247. }
  9248. if (positives && negatives) {
  9249. result = `${positives}|${negatives}`;
  9250. } else {
  9251. result = positives || negatives;
  9252. }
  9253. if (options.wrap) {
  9254. return `(${prefix}${result})`;
  9255. }
  9256. return result;
  9257. };
  9258. var toRange = (a, b, isNumbers, options) => {
  9259. if (isNumbers) {
  9260. return toRegexRange(a, b, Object.assign({
  9261. wrap: false
  9262. }, options));
  9263. }
  9264. let start = String.fromCharCode(a);
  9265. if (a === b)
  9266. return start;
  9267. let stop = String.fromCharCode(b);
  9268. return `[${start}-${stop}]`;
  9269. };
  9270. var toRegex = (start, end, options) => {
  9271. if (Array.isArray(start)) {
  9272. let wrap = options.wrap === true;
  9273. let prefix = options.capture ? "" : "?:";
  9274. return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
  9275. }
  9276. return toRegexRange(start, end, options);
  9277. };
  9278. var rangeError = (...args) => {
  9279. return new RangeError("Invalid range arguments: " + util.inspect(...args));
  9280. };
  9281. var invalidRange = (start, end, options) => {
  9282. if (options.strictRanges === true)
  9283. throw rangeError([start, end]);
  9284. return [];
  9285. };
  9286. var invalidStep = (step, options) => {
  9287. if (options.strictRanges === true) {
  9288. throw new TypeError(`Expected step "${step}" to be a number`);
  9289. }
  9290. return [];
  9291. };
  9292. var fillNumbers = (start, end, step = 1, options = {}) => {
  9293. let a = Number(start);
  9294. let b = Number(end);
  9295. if (!Number.isInteger(a) || !Number.isInteger(b)) {
  9296. if (options.strictRanges === true)
  9297. throw rangeError([start, end]);
  9298. return [];
  9299. }
  9300. if (a === 0)
  9301. a = 0;
  9302. if (b === 0)
  9303. b = 0;
  9304. let descending = a > b;
  9305. let startString = String(start);
  9306. let endString = String(end);
  9307. let stepString = String(step);
  9308. step = Math.max(Math.abs(step), 1);
  9309. let padded = zeros(startString) || zeros(endString) || zeros(stepString);
  9310. let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
  9311. let toNumber = padded === false && stringify(start, end, options) === false;
  9312. let format = options.transform || transform(toNumber);
  9313. if (options.toRegex && step === 1) {
  9314. return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
  9315. }
  9316. let parts = {
  9317. negatives: [],
  9318. positives: []
  9319. };
  9320. let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
  9321. let range = [];
  9322. let index = 0;
  9323. while (descending ? a >= b : a <= b) {
  9324. if (options.toRegex === true && step > 1) {
  9325. push(a);
  9326. } else {
  9327. range.push(pad(format(a, index), maxLen, toNumber));
  9328. }
  9329. a = descending ? a - step : a + step;
  9330. index++;
  9331. }
  9332. if (options.toRegex === true) {
  9333. return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
  9334. wrap: false
  9335. }, options));
  9336. }
  9337. return range;
  9338. };
  9339. var fillLetters = (start, end, step = 1, options = {}) => {
  9340. if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
  9341. return invalidRange(start, end, options);
  9342. }
  9343. let format = options.transform || ((val) => String.fromCharCode(val));
  9344. let a = `${start}`.charCodeAt(0);
  9345. let b = `${end}`.charCodeAt(0);
  9346. let descending = a > b;
  9347. let min = Math.min(a, b);
  9348. let max = Math.max(a, b);
  9349. if (options.toRegex && step === 1) {
  9350. return toRange(min, max, false, options);
  9351. }
  9352. let range = [];
  9353. let index = 0;
  9354. while (descending ? a >= b : a <= b) {
  9355. range.push(format(a, index));
  9356. a = descending ? a - step : a + step;
  9357. index++;
  9358. }
  9359. if (options.toRegex === true) {
  9360. return toRegex(range, null, {
  9361. wrap: false,
  9362. options
  9363. });
  9364. }
  9365. return range;
  9366. };
  9367. var fill = (start, end, step, options = {}) => {
  9368. if (end == null && isValidValue(start)) {
  9369. return [start];
  9370. }
  9371. if (!isValidValue(start) || !isValidValue(end)) {
  9372. return invalidRange(start, end, options);
  9373. }
  9374. if (typeof step === "function") {
  9375. return fill(start, end, 1, {
  9376. transform: step
  9377. });
  9378. }
  9379. if (isObject(step)) {
  9380. return fill(start, end, 0, step);
  9381. }
  9382. let opts = Object.assign({}, options);
  9383. if (opts.capture === true)
  9384. opts.wrap = true;
  9385. step = step || opts.step || 1;
  9386. if (!isNumber(step)) {
  9387. if (step != null && !isObject(step))
  9388. return invalidStep(step, opts);
  9389. return fill(start, end, 1, step);
  9390. }
  9391. if (isNumber(start) && isNumber(end)) {
  9392. return fillNumbers(start, end, step, opts);
  9393. }
  9394. return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
  9395. };
  9396. module2.exports = fill;
  9397. }
  9398. });
  9399. var require_compile = __commonJS2({
  9400. "node_modules/braces/lib/compile.js"(exports2, module2) {
  9401. "use strict";
  9402. var fill = require_fill_range();
  9403. var utils = require_utils2();
  9404. var compile = (ast, options = {}) => {
  9405. let walk = (node, parent = {}) => {
  9406. let invalidBlock = utils.isInvalidBrace(parent);
  9407. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  9408. let invalid = invalidBlock === true || invalidNode === true;
  9409. let prefix = options.escapeInvalid === true ? "\\" : "";
  9410. let output = "";
  9411. if (node.isOpen === true) {
  9412. return prefix + node.value;
  9413. }
  9414. if (node.isClose === true) {
  9415. return prefix + node.value;
  9416. }
  9417. if (node.type === "open") {
  9418. return invalid ? prefix + node.value : "(";
  9419. }
  9420. if (node.type === "close") {
  9421. return invalid ? prefix + node.value : ")";
  9422. }
  9423. if (node.type === "comma") {
  9424. return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
  9425. }
  9426. if (node.value) {
  9427. return node.value;
  9428. }
  9429. if (node.nodes && node.ranges > 0) {
  9430. let args = utils.reduce(node.nodes);
  9431. let range = fill(...args, Object.assign(Object.assign({}, options), {}, {
  9432. wrap: false,
  9433. toRegex: true
  9434. }));
  9435. if (range.length !== 0) {
  9436. return args.length > 1 && range.length > 1 ? `(${range})` : range;
  9437. }
  9438. }
  9439. if (node.nodes) {
  9440. for (let child of node.nodes) {
  9441. output += walk(child, node);
  9442. }
  9443. }
  9444. return output;
  9445. };
  9446. return walk(ast);
  9447. };
  9448. module2.exports = compile;
  9449. }
  9450. });
  9451. var require_expand = __commonJS2({
  9452. "node_modules/braces/lib/expand.js"(exports2, module2) {
  9453. "use strict";
  9454. var fill = require_fill_range();
  9455. var stringify = require_stringify();
  9456. var utils = require_utils2();
  9457. var append = (queue = "", stash = "", enclose = false) => {
  9458. let result = [];
  9459. queue = [].concat(queue);
  9460. stash = [].concat(stash);
  9461. if (!stash.length)
  9462. return queue;
  9463. if (!queue.length) {
  9464. return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
  9465. }
  9466. for (let item of queue) {
  9467. if (Array.isArray(item)) {
  9468. for (let value of item) {
  9469. result.push(append(value, stash, enclose));
  9470. }
  9471. } else {
  9472. for (let ele of stash) {
  9473. if (enclose === true && typeof ele === "string")
  9474. ele = `{${ele}}`;
  9475. result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
  9476. }
  9477. }
  9478. }
  9479. return utils.flatten(result);
  9480. };
  9481. var expand = (ast, options = {}) => {
  9482. let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
  9483. let walk = (node, parent = {}) => {
  9484. node.queue = [];
  9485. let p = parent;
  9486. let q = parent.queue;
  9487. while (p.type !== "brace" && p.type !== "root" && p.parent) {
  9488. p = p.parent;
  9489. q = p.queue;
  9490. }
  9491. if (node.invalid || node.dollar) {
  9492. q.push(append(q.pop(), stringify(node, options)));
  9493. return;
  9494. }
  9495. if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
  9496. q.push(append(q.pop(), ["{}"]));
  9497. return;
  9498. }
  9499. if (node.nodes && node.ranges > 0) {
  9500. let args = utils.reduce(node.nodes);
  9501. if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
  9502. throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
  9503. }
  9504. let range = fill(...args, options);
  9505. if (range.length === 0) {
  9506. range = stringify(node, options);
  9507. }
  9508. q.push(append(q.pop(), range));
  9509. node.nodes = [];
  9510. return;
  9511. }
  9512. let enclose = utils.encloseBrace(node);
  9513. let queue = node.queue;
  9514. let block = node;
  9515. while (block.type !== "brace" && block.type !== "root" && block.parent) {
  9516. block = block.parent;
  9517. queue = block.queue;
  9518. }
  9519. for (let i = 0; i < node.nodes.length; i++) {
  9520. let child = node.nodes[i];
  9521. if (child.type === "comma" && node.type === "brace") {
  9522. if (i === 1)
  9523. queue.push("");
  9524. queue.push("");
  9525. continue;
  9526. }
  9527. if (child.type === "close") {
  9528. q.push(append(q.pop(), queue, enclose));
  9529. continue;
  9530. }
  9531. if (child.value && child.type !== "open") {
  9532. queue.push(append(queue.pop(), child.value));
  9533. continue;
  9534. }
  9535. if (child.nodes) {
  9536. walk(child, node);
  9537. }
  9538. }
  9539. return queue;
  9540. };
  9541. return utils.flatten(walk(ast));
  9542. };
  9543. module2.exports = expand;
  9544. }
  9545. });
  9546. var require_constants2 = __commonJS2({
  9547. "node_modules/braces/lib/constants.js"(exports2, module2) {
  9548. "use strict";
  9549. module2.exports = {
  9550. MAX_LENGTH: 1024 * 64,
  9551. CHAR_0: "0",
  9552. CHAR_9: "9",
  9553. CHAR_UPPERCASE_A: "A",
  9554. CHAR_LOWERCASE_A: "a",
  9555. CHAR_UPPERCASE_Z: "Z",
  9556. CHAR_LOWERCASE_Z: "z",
  9557. CHAR_LEFT_PARENTHESES: "(",
  9558. CHAR_RIGHT_PARENTHESES: ")",
  9559. CHAR_ASTERISK: "*",
  9560. CHAR_AMPERSAND: "&",
  9561. CHAR_AT: "@",
  9562. CHAR_BACKSLASH: "\\",
  9563. CHAR_BACKTICK: "`",
  9564. CHAR_CARRIAGE_RETURN: "\r",
  9565. CHAR_CIRCUMFLEX_ACCENT: "^",
  9566. CHAR_COLON: ":",
  9567. CHAR_COMMA: ",",
  9568. CHAR_DOLLAR: "$",
  9569. CHAR_DOT: ".",
  9570. CHAR_DOUBLE_QUOTE: '"',
  9571. CHAR_EQUAL: "=",
  9572. CHAR_EXCLAMATION_MARK: "!",
  9573. CHAR_FORM_FEED: "\f",
  9574. CHAR_FORWARD_SLASH: "/",
  9575. CHAR_HASH: "#",
  9576. CHAR_HYPHEN_MINUS: "-",
  9577. CHAR_LEFT_ANGLE_BRACKET: "<",
  9578. CHAR_LEFT_CURLY_BRACE: "{",
  9579. CHAR_LEFT_SQUARE_BRACKET: "[",
  9580. CHAR_LINE_FEED: "\n",
  9581. CHAR_NO_BREAK_SPACE: "\xA0",
  9582. CHAR_PERCENT: "%",
  9583. CHAR_PLUS: "+",
  9584. CHAR_QUESTION_MARK: "?",
  9585. CHAR_RIGHT_ANGLE_BRACKET: ">",
  9586. CHAR_RIGHT_CURLY_BRACE: "}",
  9587. CHAR_RIGHT_SQUARE_BRACKET: "]",
  9588. CHAR_SEMICOLON: ";",
  9589. CHAR_SINGLE_QUOTE: "'",
  9590. CHAR_SPACE: " ",
  9591. CHAR_TAB: " ",
  9592. CHAR_UNDERSCORE: "_",
  9593. CHAR_VERTICAL_LINE: "|",
  9594. CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
  9595. };
  9596. }
  9597. });
  9598. var require_parse = __commonJS2({
  9599. "node_modules/braces/lib/parse.js"(exports2, module2) {
  9600. "use strict";
  9601. var stringify = require_stringify();
  9602. var {
  9603. MAX_LENGTH,
  9604. CHAR_BACKSLASH,
  9605. CHAR_BACKTICK,
  9606. CHAR_COMMA,
  9607. CHAR_DOT,
  9608. CHAR_LEFT_PARENTHESES,
  9609. CHAR_RIGHT_PARENTHESES,
  9610. CHAR_LEFT_CURLY_BRACE,
  9611. CHAR_RIGHT_CURLY_BRACE,
  9612. CHAR_LEFT_SQUARE_BRACKET,
  9613. CHAR_RIGHT_SQUARE_BRACKET,
  9614. CHAR_DOUBLE_QUOTE,
  9615. CHAR_SINGLE_QUOTE,
  9616. CHAR_NO_BREAK_SPACE,
  9617. CHAR_ZERO_WIDTH_NOBREAK_SPACE
  9618. } = require_constants2();
  9619. var parse = (input, options = {}) => {
  9620. if (typeof input !== "string") {
  9621. throw new TypeError("Expected a string");
  9622. }
  9623. let opts = options || {};
  9624. let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  9625. if (input.length > max) {
  9626. throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
  9627. }
  9628. let ast = {
  9629. type: "root",
  9630. input,
  9631. nodes: []
  9632. };
  9633. let stack = [ast];
  9634. let block = ast;
  9635. let prev = ast;
  9636. let brackets = 0;
  9637. let length = input.length;
  9638. let index = 0;
  9639. let depth = 0;
  9640. let value;
  9641. let memo = {};
  9642. const advance = () => input[index++];
  9643. const push = (node) => {
  9644. if (node.type === "text" && prev.type === "dot") {
  9645. prev.type = "text";
  9646. }
  9647. if (prev && prev.type === "text" && node.type === "text") {
  9648. prev.value += node.value;
  9649. return;
  9650. }
  9651. block.nodes.push(node);
  9652. node.parent = block;
  9653. node.prev = prev;
  9654. prev = node;
  9655. return node;
  9656. };
  9657. push({
  9658. type: "bos"
  9659. });
  9660. while (index < length) {
  9661. block = stack[stack.length - 1];
  9662. value = advance();
  9663. if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
  9664. continue;
  9665. }
  9666. if (value === CHAR_BACKSLASH) {
  9667. push({
  9668. type: "text",
  9669. value: (options.keepEscaping ? value : "") + advance()
  9670. });
  9671. continue;
  9672. }
  9673. if (value === CHAR_RIGHT_SQUARE_BRACKET) {
  9674. push({
  9675. type: "text",
  9676. value: "\\" + value
  9677. });
  9678. continue;
  9679. }
  9680. if (value === CHAR_LEFT_SQUARE_BRACKET) {
  9681. brackets++;
  9682. let closed = true;
  9683. let next;
  9684. while (index < length && (next = advance())) {
  9685. value += next;
  9686. if (next === CHAR_LEFT_SQUARE_BRACKET) {
  9687. brackets++;
  9688. continue;
  9689. }
  9690. if (next === CHAR_BACKSLASH) {
  9691. value += advance();
  9692. continue;
  9693. }
  9694. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  9695. brackets--;
  9696. if (brackets === 0) {
  9697. break;
  9698. }
  9699. }
  9700. }
  9701. push({
  9702. type: "text",
  9703. value
  9704. });
  9705. continue;
  9706. }
  9707. if (value === CHAR_LEFT_PARENTHESES) {
  9708. block = push({
  9709. type: "paren",
  9710. nodes: []
  9711. });
  9712. stack.push(block);
  9713. push({
  9714. type: "text",
  9715. value
  9716. });
  9717. continue;
  9718. }
  9719. if (value === CHAR_RIGHT_PARENTHESES) {
  9720. if (block.type !== "paren") {
  9721. push({
  9722. type: "text",
  9723. value
  9724. });
  9725. continue;
  9726. }
  9727. block = stack.pop();
  9728. push({
  9729. type: "text",
  9730. value
  9731. });
  9732. block = stack[stack.length - 1];
  9733. continue;
  9734. }
  9735. if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
  9736. let open = value;
  9737. let next;
  9738. if (options.keepQuotes !== true) {
  9739. value = "";
  9740. }
  9741. while (index < length && (next = advance())) {
  9742. if (next === CHAR_BACKSLASH) {
  9743. value += next + advance();
  9744. continue;
  9745. }
  9746. if (next === open) {
  9747. if (options.keepQuotes === true)
  9748. value += next;
  9749. break;
  9750. }
  9751. value += next;
  9752. }
  9753. push({
  9754. type: "text",
  9755. value
  9756. });
  9757. continue;
  9758. }
  9759. if (value === CHAR_LEFT_CURLY_BRACE) {
  9760. depth++;
  9761. let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
  9762. let brace = {
  9763. type: "brace",
  9764. open: true,
  9765. close: false,
  9766. dollar,
  9767. depth,
  9768. commas: 0,
  9769. ranges: 0,
  9770. nodes: []
  9771. };
  9772. block = push(brace);
  9773. stack.push(block);
  9774. push({
  9775. type: "open",
  9776. value
  9777. });
  9778. continue;
  9779. }
  9780. if (value === CHAR_RIGHT_CURLY_BRACE) {
  9781. if (block.type !== "brace") {
  9782. push({
  9783. type: "text",
  9784. value
  9785. });
  9786. continue;
  9787. }
  9788. let type = "close";
  9789. block = stack.pop();
  9790. block.close = true;
  9791. push({
  9792. type,
  9793. value
  9794. });
  9795. depth--;
  9796. block = stack[stack.length - 1];
  9797. continue;
  9798. }
  9799. if (value === CHAR_COMMA && depth > 0) {
  9800. if (block.ranges > 0) {
  9801. block.ranges = 0;
  9802. let open = block.nodes.shift();
  9803. block.nodes = [open, {
  9804. type: "text",
  9805. value: stringify(block)
  9806. }];
  9807. }
  9808. push({
  9809. type: "comma",
  9810. value
  9811. });
  9812. block.commas++;
  9813. continue;
  9814. }
  9815. if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
  9816. let siblings = block.nodes;
  9817. if (depth === 0 || siblings.length === 0) {
  9818. push({
  9819. type: "text",
  9820. value
  9821. });
  9822. continue;
  9823. }
  9824. if (prev.type === "dot") {
  9825. block.range = [];
  9826. prev.value += value;
  9827. prev.type = "range";
  9828. if (block.nodes.length !== 3 && block.nodes.length !== 5) {
  9829. block.invalid = true;
  9830. block.ranges = 0;
  9831. prev.type = "text";
  9832. continue;
  9833. }
  9834. block.ranges++;
  9835. block.args = [];
  9836. continue;
  9837. }
  9838. if (prev.type === "range") {
  9839. siblings.pop();
  9840. let before = siblings[siblings.length - 1];
  9841. before.value += prev.value + value;
  9842. prev = before;
  9843. block.ranges--;
  9844. continue;
  9845. }
  9846. push({
  9847. type: "dot",
  9848. value
  9849. });
  9850. continue;
  9851. }
  9852. push({
  9853. type: "text",
  9854. value
  9855. });
  9856. }
  9857. do {
  9858. block = stack.pop();
  9859. if (block.type !== "root") {
  9860. block.nodes.forEach((node) => {
  9861. if (!node.nodes) {
  9862. if (node.type === "open")
  9863. node.isOpen = true;
  9864. if (node.type === "close")
  9865. node.isClose = true;
  9866. if (!node.nodes)
  9867. node.type = "text";
  9868. node.invalid = true;
  9869. }
  9870. });
  9871. let parent = stack[stack.length - 1];
  9872. let index2 = parent.nodes.indexOf(block);
  9873. parent.nodes.splice(index2, 1, ...block.nodes);
  9874. }
  9875. } while (stack.length > 0);
  9876. push({
  9877. type: "eos"
  9878. });
  9879. return ast;
  9880. };
  9881. module2.exports = parse;
  9882. }
  9883. });
  9884. var require_braces = __commonJS2({
  9885. "node_modules/braces/index.js"(exports2, module2) {
  9886. "use strict";
  9887. var stringify = require_stringify();
  9888. var compile = require_compile();
  9889. var expand = require_expand();
  9890. var parse = require_parse();
  9891. var braces = (input, options = {}) => {
  9892. let output = [];
  9893. if (Array.isArray(input)) {
  9894. for (let pattern of input) {
  9895. let result = braces.create(pattern, options);
  9896. if (Array.isArray(result)) {
  9897. output.push(...result);
  9898. } else {
  9899. output.push(result);
  9900. }
  9901. }
  9902. } else {
  9903. output = [].concat(braces.create(input, options));
  9904. }
  9905. if (options && options.expand === true && options.nodupes === true) {
  9906. output = [...new Set(output)];
  9907. }
  9908. return output;
  9909. };
  9910. braces.parse = (input, options = {}) => parse(input, options);
  9911. braces.stringify = (input, options = {}) => {
  9912. if (typeof input === "string") {
  9913. return stringify(braces.parse(input, options), options);
  9914. }
  9915. return stringify(input, options);
  9916. };
  9917. braces.compile = (input, options = {}) => {
  9918. if (typeof input === "string") {
  9919. input = braces.parse(input, options);
  9920. }
  9921. return compile(input, options);
  9922. };
  9923. braces.expand = (input, options = {}) => {
  9924. if (typeof input === "string") {
  9925. input = braces.parse(input, options);
  9926. }
  9927. let result = expand(input, options);
  9928. if (options.noempty === true) {
  9929. result = result.filter(Boolean);
  9930. }
  9931. if (options.nodupes === true) {
  9932. result = [...new Set(result)];
  9933. }
  9934. return result;
  9935. };
  9936. braces.create = (input, options = {}) => {
  9937. if (input === "" || input.length < 3) {
  9938. return [input];
  9939. }
  9940. return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
  9941. };
  9942. module2.exports = braces;
  9943. }
  9944. });
  9945. var require_constants3 = __commonJS2({
  9946. "node_modules/picomatch/lib/constants.js"(exports2, module2) {
  9947. "use strict";
  9948. var path = require("path");
  9949. var WIN_SLASH = "\\\\/";
  9950. var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  9951. var DOT_LITERAL = "\\.";
  9952. var PLUS_LITERAL = "\\+";
  9953. var QMARK_LITERAL = "\\?";
  9954. var SLASH_LITERAL = "\\/";
  9955. var ONE_CHAR = "(?=.)";
  9956. var QMARK = "[^/]";
  9957. var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  9958. var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  9959. var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  9960. var NO_DOT = `(?!${DOT_LITERAL})`;
  9961. var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
  9962. var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
  9963. var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
  9964. var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
  9965. var STAR = `${QMARK}*?`;
  9966. var POSIX_CHARS = {
  9967. DOT_LITERAL,
  9968. PLUS_LITERAL,
  9969. QMARK_LITERAL,
  9970. SLASH_LITERAL,
  9971. ONE_CHAR,
  9972. QMARK,
  9973. END_ANCHOR,
  9974. DOTS_SLASH,
  9975. NO_DOT,
  9976. NO_DOTS,
  9977. NO_DOT_SLASH,
  9978. NO_DOTS_SLASH,
  9979. QMARK_NO_DOT,
  9980. STAR,
  9981. START_ANCHOR
  9982. };
  9983. var WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
  9984. SLASH_LITERAL: `[${WIN_SLASH}]`,
  9985. QMARK: WIN_NO_SLASH,
  9986. STAR: `${WIN_NO_SLASH}*?`,
  9987. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  9988. NO_DOT: `(?!${DOT_LITERAL})`,
  9989. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  9990. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  9991. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  9992. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  9993. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  9994. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  9995. });
  9996. var POSIX_REGEX_SOURCE = {
  9997. alnum: "a-zA-Z0-9",
  9998. alpha: "a-zA-Z",
  9999. ascii: "\\x00-\\x7F",
  10000. blank: " \\t",
  10001. cntrl: "\\x00-\\x1F\\x7F",
  10002. digit: "0-9",
  10003. graph: "\\x21-\\x7E",
  10004. lower: "a-z",
  10005. print: "\\x20-\\x7E ",
  10006. punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
  10007. space: " \\t\\r\\n\\v\\f",
  10008. upper: "A-Z",
  10009. word: "A-Za-z0-9_",
  10010. xdigit: "A-Fa-f0-9"
  10011. };
  10012. module2.exports = {
  10013. MAX_LENGTH: 1024 * 64,
  10014. POSIX_REGEX_SOURCE,
  10015. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  10016. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  10017. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  10018. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  10019. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  10020. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  10021. REPLACEMENTS: {
  10022. "***": "*",
  10023. "**/**": "**",
  10024. "**/**/**": "**"
  10025. },
  10026. CHAR_0: 48,
  10027. CHAR_9: 57,
  10028. CHAR_UPPERCASE_A: 65,
  10029. CHAR_LOWERCASE_A: 97,
  10030. CHAR_UPPERCASE_Z: 90,
  10031. CHAR_LOWERCASE_Z: 122,
  10032. CHAR_LEFT_PARENTHESES: 40,
  10033. CHAR_RIGHT_PARENTHESES: 41,
  10034. CHAR_ASTERISK: 42,
  10035. CHAR_AMPERSAND: 38,
  10036. CHAR_AT: 64,
  10037. CHAR_BACKWARD_SLASH: 92,
  10038. CHAR_CARRIAGE_RETURN: 13,
  10039. CHAR_CIRCUMFLEX_ACCENT: 94,
  10040. CHAR_COLON: 58,
  10041. CHAR_COMMA: 44,
  10042. CHAR_DOT: 46,
  10043. CHAR_DOUBLE_QUOTE: 34,
  10044. CHAR_EQUAL: 61,
  10045. CHAR_EXCLAMATION_MARK: 33,
  10046. CHAR_FORM_FEED: 12,
  10047. CHAR_FORWARD_SLASH: 47,
  10048. CHAR_GRAVE_ACCENT: 96,
  10049. CHAR_HASH: 35,
  10050. CHAR_HYPHEN_MINUS: 45,
  10051. CHAR_LEFT_ANGLE_BRACKET: 60,
  10052. CHAR_LEFT_CURLY_BRACE: 123,
  10053. CHAR_LEFT_SQUARE_BRACKET: 91,
  10054. CHAR_LINE_FEED: 10,
  10055. CHAR_NO_BREAK_SPACE: 160,
  10056. CHAR_PERCENT: 37,
  10057. CHAR_PLUS: 43,
  10058. CHAR_QUESTION_MARK: 63,
  10059. CHAR_RIGHT_ANGLE_BRACKET: 62,
  10060. CHAR_RIGHT_CURLY_BRACE: 125,
  10061. CHAR_RIGHT_SQUARE_BRACKET: 93,
  10062. CHAR_SEMICOLON: 59,
  10063. CHAR_SINGLE_QUOTE: 39,
  10064. CHAR_SPACE: 32,
  10065. CHAR_TAB: 9,
  10066. CHAR_UNDERSCORE: 95,
  10067. CHAR_VERTICAL_LINE: 124,
  10068. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
  10069. SEP: path.sep,
  10070. extglobChars(chars) {
  10071. return {
  10072. "!": {
  10073. type: "negate",
  10074. open: "(?:(?!(?:",
  10075. close: `))${chars.STAR})`
  10076. },
  10077. "?": {
  10078. type: "qmark",
  10079. open: "(?:",
  10080. close: ")?"
  10081. },
  10082. "+": {
  10083. type: "plus",
  10084. open: "(?:",
  10085. close: ")+"
  10086. },
  10087. "*": {
  10088. type: "star",
  10089. open: "(?:",
  10090. close: ")*"
  10091. },
  10092. "@": {
  10093. type: "at",
  10094. open: "(?:",
  10095. close: ")"
  10096. }
  10097. };
  10098. },
  10099. globChars(win32) {
  10100. return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
  10101. }
  10102. };
  10103. }
  10104. });
  10105. var require_utils3 = __commonJS2({
  10106. "node_modules/picomatch/lib/utils.js"(exports2) {
  10107. "use strict";
  10108. var path = require("path");
  10109. var win32 = process.platform === "win32";
  10110. var {
  10111. REGEX_BACKSLASH,
  10112. REGEX_REMOVE_BACKSLASH,
  10113. REGEX_SPECIAL_CHARS,
  10114. REGEX_SPECIAL_CHARS_GLOBAL
  10115. } = require_constants3();
  10116. exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  10117. exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
  10118. exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
  10119. exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
  10120. exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
  10121. exports2.removeBackslashes = (str) => {
  10122. return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
  10123. return match === "\\" ? "" : match;
  10124. });
  10125. };
  10126. exports2.supportsLookbehinds = () => {
  10127. const segs = process.version.slice(1).split(".").map(Number);
  10128. if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
  10129. return true;
  10130. }
  10131. return false;
  10132. };
  10133. exports2.isWindows = (options) => {
  10134. if (options && typeof options.windows === "boolean") {
  10135. return options.windows;
  10136. }
  10137. return win32 === true || path.sep === "\\";
  10138. };
  10139. exports2.escapeLast = (input, char, lastIdx) => {
  10140. const idx = input.lastIndexOf(char, lastIdx);
  10141. if (idx === -1)
  10142. return input;
  10143. if (input[idx - 1] === "\\")
  10144. return exports2.escapeLast(input, char, idx - 1);
  10145. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  10146. };
  10147. exports2.removePrefix = (input, state = {}) => {
  10148. let output = input;
  10149. if (output.startsWith("./")) {
  10150. output = output.slice(2);
  10151. state.prefix = "./";
  10152. }
  10153. return output;
  10154. };
  10155. exports2.wrapOutput = (input, state = {}, options = {}) => {
  10156. const prepend = options.contains ? "" : "^";
  10157. const append = options.contains ? "" : "$";
  10158. let output = `${prepend}(?:${input})${append}`;
  10159. if (state.negated === true) {
  10160. output = `(?:^(?!${output}).*$)`;
  10161. }
  10162. return output;
  10163. };
  10164. }
  10165. });
  10166. var require_scan = __commonJS2({
  10167. "node_modules/picomatch/lib/scan.js"(exports2, module2) {
  10168. "use strict";
  10169. var utils = require_utils3();
  10170. var {
  10171. CHAR_ASTERISK,
  10172. CHAR_AT,
  10173. CHAR_BACKWARD_SLASH,
  10174. CHAR_COMMA,
  10175. CHAR_DOT,
  10176. CHAR_EXCLAMATION_MARK,
  10177. CHAR_FORWARD_SLASH,
  10178. CHAR_LEFT_CURLY_BRACE,
  10179. CHAR_LEFT_PARENTHESES,
  10180. CHAR_LEFT_SQUARE_BRACKET,
  10181. CHAR_PLUS,
  10182. CHAR_QUESTION_MARK,
  10183. CHAR_RIGHT_CURLY_BRACE,
  10184. CHAR_RIGHT_PARENTHESES,
  10185. CHAR_RIGHT_SQUARE_BRACKET
  10186. } = require_constants3();
  10187. var isPathSeparator = (code) => {
  10188. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  10189. };
  10190. var depth = (token) => {
  10191. if (token.isPrefix !== true) {
  10192. token.depth = token.isGlobstar ? Infinity : 1;
  10193. }
  10194. };
  10195. var scan = (input, options) => {
  10196. const opts = options || {};
  10197. const length = input.length - 1;
  10198. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  10199. const slashes = [];
  10200. const tokens = [];
  10201. const parts = [];
  10202. let str = input;
  10203. let index = -1;
  10204. let start = 0;
  10205. let lastIndex = 0;
  10206. let isBrace = false;
  10207. let isBracket = false;
  10208. let isGlob = false;
  10209. let isExtglob = false;
  10210. let isGlobstar = false;
  10211. let braceEscaped = false;
  10212. let backslashes = false;
  10213. let negated = false;
  10214. let negatedExtglob = false;
  10215. let finished = false;
  10216. let braces = 0;
  10217. let prev;
  10218. let code;
  10219. let token = {
  10220. value: "",
  10221. depth: 0,
  10222. isGlob: false
  10223. };
  10224. const eos = () => index >= length;
  10225. const peek = () => str.charCodeAt(index + 1);
  10226. const advance = () => {
  10227. prev = code;
  10228. return str.charCodeAt(++index);
  10229. };
  10230. while (index < length) {
  10231. code = advance();
  10232. let next;
  10233. if (code === CHAR_BACKWARD_SLASH) {
  10234. backslashes = token.backslashes = true;
  10235. code = advance();
  10236. if (code === CHAR_LEFT_CURLY_BRACE) {
  10237. braceEscaped = true;
  10238. }
  10239. continue;
  10240. }
  10241. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  10242. braces++;
  10243. while (eos() !== true && (code = advance())) {
  10244. if (code === CHAR_BACKWARD_SLASH) {
  10245. backslashes = token.backslashes = true;
  10246. advance();
  10247. continue;
  10248. }
  10249. if (code === CHAR_LEFT_CURLY_BRACE) {
  10250. braces++;
  10251. continue;
  10252. }
  10253. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  10254. isBrace = token.isBrace = true;
  10255. isGlob = token.isGlob = true;
  10256. finished = true;
  10257. if (scanToEnd === true) {
  10258. continue;
  10259. }
  10260. break;
  10261. }
  10262. if (braceEscaped !== true && code === CHAR_COMMA) {
  10263. isBrace = token.isBrace = true;
  10264. isGlob = token.isGlob = true;
  10265. finished = true;
  10266. if (scanToEnd === true) {
  10267. continue;
  10268. }
  10269. break;
  10270. }
  10271. if (code === CHAR_RIGHT_CURLY_BRACE) {
  10272. braces--;
  10273. if (braces === 0) {
  10274. braceEscaped = false;
  10275. isBrace = token.isBrace = true;
  10276. finished = true;
  10277. break;
  10278. }
  10279. }
  10280. }
  10281. if (scanToEnd === true) {
  10282. continue;
  10283. }
  10284. break;
  10285. }
  10286. if (code === CHAR_FORWARD_SLASH) {
  10287. slashes.push(index);
  10288. tokens.push(token);
  10289. token = {
  10290. value: "",
  10291. depth: 0,
  10292. isGlob: false
  10293. };
  10294. if (finished === true)
  10295. continue;
  10296. if (prev === CHAR_DOT && index === start + 1) {
  10297. start += 2;
  10298. continue;
  10299. }
  10300. lastIndex = index + 1;
  10301. continue;
  10302. }
  10303. if (opts.noext !== true) {
  10304. const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
  10305. if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
  10306. isGlob = token.isGlob = true;
  10307. isExtglob = token.isExtglob = true;
  10308. finished = true;
  10309. if (code === CHAR_EXCLAMATION_MARK && index === start) {
  10310. negatedExtglob = true;
  10311. }
  10312. if (scanToEnd === true) {
  10313. while (eos() !== true && (code = advance())) {
  10314. if (code === CHAR_BACKWARD_SLASH) {
  10315. backslashes = token.backslashes = true;
  10316. code = advance();
  10317. continue;
  10318. }
  10319. if (code === CHAR_RIGHT_PARENTHESES) {
  10320. isGlob = token.isGlob = true;
  10321. finished = true;
  10322. break;
  10323. }
  10324. }
  10325. continue;
  10326. }
  10327. break;
  10328. }
  10329. }
  10330. if (code === CHAR_ASTERISK) {
  10331. if (prev === CHAR_ASTERISK)
  10332. isGlobstar = token.isGlobstar = true;
  10333. isGlob = token.isGlob = true;
  10334. finished = true;
  10335. if (scanToEnd === true) {
  10336. continue;
  10337. }
  10338. break;
  10339. }
  10340. if (code === CHAR_QUESTION_MARK) {
  10341. isGlob = token.isGlob = true;
  10342. finished = true;
  10343. if (scanToEnd === true) {
  10344. continue;
  10345. }
  10346. break;
  10347. }
  10348. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  10349. while (eos() !== true && (next = advance())) {
  10350. if (next === CHAR_BACKWARD_SLASH) {
  10351. backslashes = token.backslashes = true;
  10352. advance();
  10353. continue;
  10354. }
  10355. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  10356. isBracket = token.isBracket = true;
  10357. isGlob = token.isGlob = true;
  10358. finished = true;
  10359. break;
  10360. }
  10361. }
  10362. if (scanToEnd === true) {
  10363. continue;
  10364. }
  10365. break;
  10366. }
  10367. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  10368. negated = token.negated = true;
  10369. start++;
  10370. continue;
  10371. }
  10372. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  10373. isGlob = token.isGlob = true;
  10374. if (scanToEnd === true) {
  10375. while (eos() !== true && (code = advance())) {
  10376. if (code === CHAR_LEFT_PARENTHESES) {
  10377. backslashes = token.backslashes = true;
  10378. code = advance();
  10379. continue;
  10380. }
  10381. if (code === CHAR_RIGHT_PARENTHESES) {
  10382. finished = true;
  10383. break;
  10384. }
  10385. }
  10386. continue;
  10387. }
  10388. break;
  10389. }
  10390. if (isGlob === true) {
  10391. finished = true;
  10392. if (scanToEnd === true) {
  10393. continue;
  10394. }
  10395. break;
  10396. }
  10397. }
  10398. if (opts.noext === true) {
  10399. isExtglob = false;
  10400. isGlob = false;
  10401. }
  10402. let base = str;
  10403. let prefix = "";
  10404. let glob = "";
  10405. if (start > 0) {
  10406. prefix = str.slice(0, start);
  10407. str = str.slice(start);
  10408. lastIndex -= start;
  10409. }
  10410. if (base && isGlob === true && lastIndex > 0) {
  10411. base = str.slice(0, lastIndex);
  10412. glob = str.slice(lastIndex);
  10413. } else if (isGlob === true) {
  10414. base = "";
  10415. glob = str;
  10416. } else {
  10417. base = str;
  10418. }
  10419. if (base && base !== "" && base !== "/" && base !== str) {
  10420. if (isPathSeparator(base.charCodeAt(base.length - 1))) {
  10421. base = base.slice(0, -1);
  10422. }
  10423. }
  10424. if (opts.unescape === true) {
  10425. if (glob)
  10426. glob = utils.removeBackslashes(glob);
  10427. if (base && backslashes === true) {
  10428. base = utils.removeBackslashes(base);
  10429. }
  10430. }
  10431. const state = {
  10432. prefix,
  10433. input,
  10434. start,
  10435. base,
  10436. glob,
  10437. isBrace,
  10438. isBracket,
  10439. isGlob,
  10440. isExtglob,
  10441. isGlobstar,
  10442. negated,
  10443. negatedExtglob
  10444. };
  10445. if (opts.tokens === true) {
  10446. state.maxDepth = 0;
  10447. if (!isPathSeparator(code)) {
  10448. tokens.push(token);
  10449. }
  10450. state.tokens = tokens;
  10451. }
  10452. if (opts.parts === true || opts.tokens === true) {
  10453. let prevIndex;
  10454. for (let idx = 0; idx < slashes.length; idx++) {
  10455. const n = prevIndex ? prevIndex + 1 : start;
  10456. const i = slashes[idx];
  10457. const value = input.slice(n, i);
  10458. if (opts.tokens) {
  10459. if (idx === 0 && start !== 0) {
  10460. tokens[idx].isPrefix = true;
  10461. tokens[idx].value = prefix;
  10462. } else {
  10463. tokens[idx].value = value;
  10464. }
  10465. depth(tokens[idx]);
  10466. state.maxDepth += tokens[idx].depth;
  10467. }
  10468. if (idx !== 0 || value !== "") {
  10469. parts.push(value);
  10470. }
  10471. prevIndex = i;
  10472. }
  10473. if (prevIndex && prevIndex + 1 < input.length) {
  10474. const value = input.slice(prevIndex + 1);
  10475. parts.push(value);
  10476. if (opts.tokens) {
  10477. tokens[tokens.length - 1].value = value;
  10478. depth(tokens[tokens.length - 1]);
  10479. state.maxDepth += tokens[tokens.length - 1].depth;
  10480. }
  10481. }
  10482. state.slashes = slashes;
  10483. state.parts = parts;
  10484. }
  10485. return state;
  10486. };
  10487. module2.exports = scan;
  10488. }
  10489. });
  10490. var require_parse2 = __commonJS2({
  10491. "node_modules/picomatch/lib/parse.js"(exports2, module2) {
  10492. "use strict";
  10493. var constants = require_constants3();
  10494. var utils = require_utils3();
  10495. var {
  10496. MAX_LENGTH,
  10497. POSIX_REGEX_SOURCE,
  10498. REGEX_NON_SPECIAL_CHARS,
  10499. REGEX_SPECIAL_CHARS_BACKREF,
  10500. REPLACEMENTS
  10501. } = constants;
  10502. var expandRange = (args, options) => {
  10503. if (typeof options.expandRange === "function") {
  10504. return options.expandRange(...args, options);
  10505. }
  10506. args.sort();
  10507. const value = `[${args.join("-")}]`;
  10508. try {
  10509. new RegExp(value);
  10510. } catch (ex) {
  10511. return args.map((v) => utils.escapeRegex(v)).join("..");
  10512. }
  10513. return value;
  10514. };
  10515. var syntaxError = (type, char) => {
  10516. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  10517. };
  10518. var parse = (input, options) => {
  10519. if (typeof input !== "string") {
  10520. throw new TypeError("Expected a string");
  10521. }
  10522. input = REPLACEMENTS[input] || input;
  10523. const opts = Object.assign({}, options);
  10524. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  10525. let len = input.length;
  10526. if (len > max) {
  10527. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  10528. }
  10529. const bos = {
  10530. type: "bos",
  10531. value: "",
  10532. output: opts.prepend || ""
  10533. };
  10534. const tokens = [bos];
  10535. const capture = opts.capture ? "" : "?:";
  10536. const win32 = utils.isWindows(options);
  10537. const PLATFORM_CHARS = constants.globChars(win32);
  10538. const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
  10539. const {
  10540. DOT_LITERAL,
  10541. PLUS_LITERAL,
  10542. SLASH_LITERAL,
  10543. ONE_CHAR,
  10544. DOTS_SLASH,
  10545. NO_DOT,
  10546. NO_DOT_SLASH,
  10547. NO_DOTS_SLASH,
  10548. QMARK,
  10549. QMARK_NO_DOT,
  10550. STAR,
  10551. START_ANCHOR
  10552. } = PLATFORM_CHARS;
  10553. const globstar = (opts2) => {
  10554. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  10555. };
  10556. const nodot = opts.dot ? "" : NO_DOT;
  10557. const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
  10558. let star = opts.bash === true ? globstar(opts) : STAR;
  10559. if (opts.capture) {
  10560. star = `(${star})`;
  10561. }
  10562. if (typeof opts.noext === "boolean") {
  10563. opts.noextglob = opts.noext;
  10564. }
  10565. const state = {
  10566. input,
  10567. index: -1,
  10568. start: 0,
  10569. dot: opts.dot === true,
  10570. consumed: "",
  10571. output: "",
  10572. prefix: "",
  10573. backtrack: false,
  10574. negated: false,
  10575. brackets: 0,
  10576. braces: 0,
  10577. parens: 0,
  10578. quotes: 0,
  10579. globstar: false,
  10580. tokens
  10581. };
  10582. input = utils.removePrefix(input, state);
  10583. len = input.length;
  10584. const extglobs = [];
  10585. const braces = [];
  10586. const stack = [];
  10587. let prev = bos;
  10588. let value;
  10589. const eos = () => state.index === len - 1;
  10590. const peek = state.peek = (n = 1) => input[state.index + n];
  10591. const advance = state.advance = () => input[++state.index] || "";
  10592. const remaining = () => input.slice(state.index + 1);
  10593. const consume = (value2 = "", num = 0) => {
  10594. state.consumed += value2;
  10595. state.index += num;
  10596. };
  10597. const append = (token) => {
  10598. state.output += token.output != null ? token.output : token.value;
  10599. consume(token.value);
  10600. };
  10601. const negate = () => {
  10602. let count = 1;
  10603. while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
  10604. advance();
  10605. state.start++;
  10606. count++;
  10607. }
  10608. if (count % 2 === 0) {
  10609. return false;
  10610. }
  10611. state.negated = true;
  10612. state.start++;
  10613. return true;
  10614. };
  10615. const increment = (type) => {
  10616. state[type]++;
  10617. stack.push(type);
  10618. };
  10619. const decrement = (type) => {
  10620. state[type]--;
  10621. stack.pop();
  10622. };
  10623. const push = (tok) => {
  10624. if (prev.type === "globstar") {
  10625. const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
  10626. const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
  10627. if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
  10628. state.output = state.output.slice(0, -prev.output.length);
  10629. prev.type = "star";
  10630. prev.value = "*";
  10631. prev.output = star;
  10632. state.output += prev.output;
  10633. }
  10634. }
  10635. if (extglobs.length && tok.type !== "paren") {
  10636. extglobs[extglobs.length - 1].inner += tok.value;
  10637. }
  10638. if (tok.value || tok.output)
  10639. append(tok);
  10640. if (prev && prev.type === "text" && tok.type === "text") {
  10641. prev.value += tok.value;
  10642. prev.output = (prev.output || "") + tok.value;
  10643. return;
  10644. }
  10645. tok.prev = prev;
  10646. tokens.push(tok);
  10647. prev = tok;
  10648. };
  10649. const extglobOpen = (type, value2) => {
  10650. const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value2]), {}, {
  10651. conditions: 1,
  10652. inner: ""
  10653. });
  10654. token.prev = prev;
  10655. token.parens = state.parens;
  10656. token.output = state.output;
  10657. const output = (opts.capture ? "(" : "") + token.open;
  10658. increment("parens");
  10659. push({
  10660. type,
  10661. value: value2,
  10662. output: state.output ? "" : ONE_CHAR
  10663. });
  10664. push({
  10665. type: "paren",
  10666. extglob: true,
  10667. value: advance(),
  10668. output
  10669. });
  10670. extglobs.push(token);
  10671. };
  10672. const extglobClose = (token) => {
  10673. let output = token.close + (opts.capture ? ")" : "");
  10674. let rest;
  10675. if (token.type === "negate") {
  10676. let extglobStar = star;
  10677. if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
  10678. extglobStar = globstar(opts);
  10679. }
  10680. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
  10681. output = token.close = `)$))${extglobStar}`;
  10682. }
  10683. if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
  10684. const expression = parse(rest, Object.assign(Object.assign({}, options), {}, {
  10685. fastpaths: false
  10686. })).output;
  10687. output = token.close = `)${expression})${extglobStar})`;
  10688. }
  10689. if (token.prev.type === "bos") {
  10690. state.negatedExtglob = true;
  10691. }
  10692. }
  10693. push({
  10694. type: "paren",
  10695. extglob: true,
  10696. value,
  10697. output
  10698. });
  10699. decrement("parens");
  10700. };
  10701. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  10702. let backslashes = false;
  10703. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
  10704. if (first === "\\") {
  10705. backslashes = true;
  10706. return m;
  10707. }
  10708. if (first === "?") {
  10709. if (esc) {
  10710. return esc + first + (rest ? QMARK.repeat(rest.length) : "");
  10711. }
  10712. if (index === 0) {
  10713. return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
  10714. }
  10715. return QMARK.repeat(chars.length);
  10716. }
  10717. if (first === ".") {
  10718. return DOT_LITERAL.repeat(chars.length);
  10719. }
  10720. if (first === "*") {
  10721. if (esc) {
  10722. return esc + first + (rest ? star : "");
  10723. }
  10724. return star;
  10725. }
  10726. return esc ? m : `\\${m}`;
  10727. });
  10728. if (backslashes === true) {
  10729. if (opts.unescape === true) {
  10730. output = output.replace(/\\/g, "");
  10731. } else {
  10732. output = output.replace(/\\+/g, (m) => {
  10733. return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
  10734. });
  10735. }
  10736. }
  10737. if (output === input && opts.contains === true) {
  10738. state.output = input;
  10739. return state;
  10740. }
  10741. state.output = utils.wrapOutput(output, state, options);
  10742. return state;
  10743. }
  10744. while (!eos()) {
  10745. value = advance();
  10746. if (value === "\0") {
  10747. continue;
  10748. }
  10749. if (value === "\\") {
  10750. const next = peek();
  10751. if (next === "/" && opts.bash !== true) {
  10752. continue;
  10753. }
  10754. if (next === "." || next === ";") {
  10755. continue;
  10756. }
  10757. if (!next) {
  10758. value += "\\";
  10759. push({
  10760. type: "text",
  10761. value
  10762. });
  10763. continue;
  10764. }
  10765. const match = /^\\+/.exec(remaining());
  10766. let slashes = 0;
  10767. if (match && match[0].length > 2) {
  10768. slashes = match[0].length;
  10769. state.index += slashes;
  10770. if (slashes % 2 !== 0) {
  10771. value += "\\";
  10772. }
  10773. }
  10774. if (opts.unescape === true) {
  10775. value = advance();
  10776. } else {
  10777. value += advance();
  10778. }
  10779. if (state.brackets === 0) {
  10780. push({
  10781. type: "text",
  10782. value
  10783. });
  10784. continue;
  10785. }
  10786. }
  10787. if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
  10788. if (opts.posix !== false && value === ":") {
  10789. const inner = prev.value.slice(1);
  10790. if (inner.includes("[")) {
  10791. prev.posix = true;
  10792. if (inner.includes(":")) {
  10793. const idx = prev.value.lastIndexOf("[");
  10794. const pre = prev.value.slice(0, idx);
  10795. const rest2 = prev.value.slice(idx + 2);
  10796. const posix = POSIX_REGEX_SOURCE[rest2];
  10797. if (posix) {
  10798. prev.value = pre + posix;
  10799. state.backtrack = true;
  10800. advance();
  10801. if (!bos.output && tokens.indexOf(prev) === 1) {
  10802. bos.output = ONE_CHAR;
  10803. }
  10804. continue;
  10805. }
  10806. }
  10807. }
  10808. }
  10809. if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
  10810. value = `\\${value}`;
  10811. }
  10812. if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
  10813. value = `\\${value}`;
  10814. }
  10815. if (opts.posix === true && value === "!" && prev.value === "[") {
  10816. value = "^";
  10817. }
  10818. prev.value += value;
  10819. append({
  10820. value
  10821. });
  10822. continue;
  10823. }
  10824. if (state.quotes === 1 && value !== '"') {
  10825. value = utils.escapeRegex(value);
  10826. prev.value += value;
  10827. append({
  10828. value
  10829. });
  10830. continue;
  10831. }
  10832. if (value === '"') {
  10833. state.quotes = state.quotes === 1 ? 0 : 1;
  10834. if (opts.keepQuotes === true) {
  10835. push({
  10836. type: "text",
  10837. value
  10838. });
  10839. }
  10840. continue;
  10841. }
  10842. if (value === "(") {
  10843. increment("parens");
  10844. push({
  10845. type: "paren",
  10846. value
  10847. });
  10848. continue;
  10849. }
  10850. if (value === ")") {
  10851. if (state.parens === 0 && opts.strictBrackets === true) {
  10852. throw new SyntaxError(syntaxError("opening", "("));
  10853. }
  10854. const extglob = extglobs[extglobs.length - 1];
  10855. if (extglob && state.parens === extglob.parens + 1) {
  10856. extglobClose(extglobs.pop());
  10857. continue;
  10858. }
  10859. push({
  10860. type: "paren",
  10861. value,
  10862. output: state.parens ? ")" : "\\)"
  10863. });
  10864. decrement("parens");
  10865. continue;
  10866. }
  10867. if (value === "[") {
  10868. if (opts.nobracket === true || !remaining().includes("]")) {
  10869. if (opts.nobracket !== true && opts.strictBrackets === true) {
  10870. throw new SyntaxError(syntaxError("closing", "]"));
  10871. }
  10872. value = `\\${value}`;
  10873. } else {
  10874. increment("brackets");
  10875. }
  10876. push({
  10877. type: "bracket",
  10878. value
  10879. });
  10880. continue;
  10881. }
  10882. if (value === "]") {
  10883. if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
  10884. push({
  10885. type: "text",
  10886. value,
  10887. output: `\\${value}`
  10888. });
  10889. continue;
  10890. }
  10891. if (state.brackets === 0) {
  10892. if (opts.strictBrackets === true) {
  10893. throw new SyntaxError(syntaxError("opening", "["));
  10894. }
  10895. push({
  10896. type: "text",
  10897. value,
  10898. output: `\\${value}`
  10899. });
  10900. continue;
  10901. }
  10902. decrement("brackets");
  10903. const prevValue = prev.value.slice(1);
  10904. if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
  10905. value = `/${value}`;
  10906. }
  10907. prev.value += value;
  10908. append({
  10909. value
  10910. });
  10911. if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
  10912. continue;
  10913. }
  10914. const escaped = utils.escapeRegex(prev.value);
  10915. state.output = state.output.slice(0, -prev.value.length);
  10916. if (opts.literalBrackets === true) {
  10917. state.output += escaped;
  10918. prev.value = escaped;
  10919. continue;
  10920. }
  10921. prev.value = `(${capture}${escaped}|${prev.value})`;
  10922. state.output += prev.value;
  10923. continue;
  10924. }
  10925. if (value === "{" && opts.nobrace !== true) {
  10926. increment("braces");
  10927. const open = {
  10928. type: "brace",
  10929. value,
  10930. output: "(",
  10931. outputIndex: state.output.length,
  10932. tokensIndex: state.tokens.length
  10933. };
  10934. braces.push(open);
  10935. push(open);
  10936. continue;
  10937. }
  10938. if (value === "}") {
  10939. const brace = braces[braces.length - 1];
  10940. if (opts.nobrace === true || !brace) {
  10941. push({
  10942. type: "text",
  10943. value,
  10944. output: value
  10945. });
  10946. continue;
  10947. }
  10948. let output = ")";
  10949. if (brace.dots === true) {
  10950. const arr = tokens.slice();
  10951. const range = [];
  10952. for (let i = arr.length - 1; i >= 0; i--) {
  10953. tokens.pop();
  10954. if (arr[i].type === "brace") {
  10955. break;
  10956. }
  10957. if (arr[i].type !== "dots") {
  10958. range.unshift(arr[i].value);
  10959. }
  10960. }
  10961. output = expandRange(range, opts);
  10962. state.backtrack = true;
  10963. }
  10964. if (brace.comma !== true && brace.dots !== true) {
  10965. const out = state.output.slice(0, brace.outputIndex);
  10966. const toks = state.tokens.slice(brace.tokensIndex);
  10967. brace.value = brace.output = "\\{";
  10968. value = output = "\\}";
  10969. state.output = out;
  10970. for (const t of toks) {
  10971. state.output += t.output || t.value;
  10972. }
  10973. }
  10974. push({
  10975. type: "brace",
  10976. value,
  10977. output
  10978. });
  10979. decrement("braces");
  10980. braces.pop();
  10981. continue;
  10982. }
  10983. if (value === "|") {
  10984. if (extglobs.length > 0) {
  10985. extglobs[extglobs.length - 1].conditions++;
  10986. }
  10987. push({
  10988. type: "text",
  10989. value
  10990. });
  10991. continue;
  10992. }
  10993. if (value === ",") {
  10994. let output = value;
  10995. const brace = braces[braces.length - 1];
  10996. if (brace && stack[stack.length - 1] === "braces") {
  10997. brace.comma = true;
  10998. output = "|";
  10999. }
  11000. push({
  11001. type: "comma",
  11002. value,
  11003. output
  11004. });
  11005. continue;
  11006. }
  11007. if (value === "/") {
  11008. if (prev.type === "dot" && state.index === state.start + 1) {
  11009. state.start = state.index + 1;
  11010. state.consumed = "";
  11011. state.output = "";
  11012. tokens.pop();
  11013. prev = bos;
  11014. continue;
  11015. }
  11016. push({
  11017. type: "slash",
  11018. value,
  11019. output: SLASH_LITERAL
  11020. });
  11021. continue;
  11022. }
  11023. if (value === ".") {
  11024. if (state.braces > 0 && prev.type === "dot") {
  11025. if (prev.value === ".")
  11026. prev.output = DOT_LITERAL;
  11027. const brace = braces[braces.length - 1];
  11028. prev.type = "dots";
  11029. prev.output += value;
  11030. prev.value += value;
  11031. brace.dots = true;
  11032. continue;
  11033. }
  11034. if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
  11035. push({
  11036. type: "text",
  11037. value,
  11038. output: DOT_LITERAL
  11039. });
  11040. continue;
  11041. }
  11042. push({
  11043. type: "dot",
  11044. value,
  11045. output: DOT_LITERAL
  11046. });
  11047. continue;
  11048. }
  11049. if (value === "?") {
  11050. const isGroup = prev && prev.value === "(";
  11051. if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  11052. extglobOpen("qmark", value);
  11053. continue;
  11054. }
  11055. if (prev && prev.type === "paren") {
  11056. const next = peek();
  11057. let output = value;
  11058. if (next === "<" && !utils.supportsLookbehinds()) {
  11059. throw new Error("Node.js v10 or higher is required for regex lookbehinds");
  11060. }
  11061. if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
  11062. output = `\\${value}`;
  11063. }
  11064. push({
  11065. type: "text",
  11066. value,
  11067. output
  11068. });
  11069. continue;
  11070. }
  11071. if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
  11072. push({
  11073. type: "qmark",
  11074. value,
  11075. output: QMARK_NO_DOT
  11076. });
  11077. continue;
  11078. }
  11079. push({
  11080. type: "qmark",
  11081. value,
  11082. output: QMARK
  11083. });
  11084. continue;
  11085. }
  11086. if (value === "!") {
  11087. if (opts.noextglob !== true && peek() === "(") {
  11088. if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
  11089. extglobOpen("negate", value);
  11090. continue;
  11091. }
  11092. }
  11093. if (opts.nonegate !== true && state.index === 0) {
  11094. negate();
  11095. continue;
  11096. }
  11097. }
  11098. if (value === "+") {
  11099. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  11100. extglobOpen("plus", value);
  11101. continue;
  11102. }
  11103. if (prev && prev.value === "(" || opts.regex === false) {
  11104. push({
  11105. type: "plus",
  11106. value,
  11107. output: PLUS_LITERAL
  11108. });
  11109. continue;
  11110. }
  11111. if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
  11112. push({
  11113. type: "plus",
  11114. value
  11115. });
  11116. continue;
  11117. }
  11118. push({
  11119. type: "plus",
  11120. value: PLUS_LITERAL
  11121. });
  11122. continue;
  11123. }
  11124. if (value === "@") {
  11125. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  11126. push({
  11127. type: "at",
  11128. extglob: true,
  11129. value,
  11130. output: ""
  11131. });
  11132. continue;
  11133. }
  11134. push({
  11135. type: "text",
  11136. value
  11137. });
  11138. continue;
  11139. }
  11140. if (value !== "*") {
  11141. if (value === "$" || value === "^") {
  11142. value = `\\${value}`;
  11143. }
  11144. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  11145. if (match) {
  11146. value += match[0];
  11147. state.index += match[0].length;
  11148. }
  11149. push({
  11150. type: "text",
  11151. value
  11152. });
  11153. continue;
  11154. }
  11155. if (prev && (prev.type === "globstar" || prev.star === true)) {
  11156. prev.type = "star";
  11157. prev.star = true;
  11158. prev.value += value;
  11159. prev.output = star;
  11160. state.backtrack = true;
  11161. state.globstar = true;
  11162. consume(value);
  11163. continue;
  11164. }
  11165. let rest = remaining();
  11166. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  11167. extglobOpen("star", value);
  11168. continue;
  11169. }
  11170. if (prev.type === "star") {
  11171. if (opts.noglobstar === true) {
  11172. consume(value);
  11173. continue;
  11174. }
  11175. const prior = prev.prev;
  11176. const before = prior.prev;
  11177. const isStart = prior.type === "slash" || prior.type === "bos";
  11178. const afterStar = before && (before.type === "star" || before.type === "globstar");
  11179. if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
  11180. push({
  11181. type: "star",
  11182. value,
  11183. output: ""
  11184. });
  11185. continue;
  11186. }
  11187. const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
  11188. const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
  11189. if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
  11190. push({
  11191. type: "star",
  11192. value,
  11193. output: ""
  11194. });
  11195. continue;
  11196. }
  11197. while (rest.slice(0, 3) === "/**") {
  11198. const after = input[state.index + 4];
  11199. if (after && after !== "/") {
  11200. break;
  11201. }
  11202. rest = rest.slice(3);
  11203. consume("/**", 3);
  11204. }
  11205. if (prior.type === "bos" && eos()) {
  11206. prev.type = "globstar";
  11207. prev.value += value;
  11208. prev.output = globstar(opts);
  11209. state.output = prev.output;
  11210. state.globstar = true;
  11211. consume(value);
  11212. continue;
  11213. }
  11214. if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
  11215. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  11216. prior.output = `(?:${prior.output}`;
  11217. prev.type = "globstar";
  11218. prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
  11219. prev.value += value;
  11220. state.globstar = true;
  11221. state.output += prior.output + prev.output;
  11222. consume(value);
  11223. continue;
  11224. }
  11225. if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
  11226. const end = rest[1] !== void 0 ? "|$" : "";
  11227. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  11228. prior.output = `(?:${prior.output}`;
  11229. prev.type = "globstar";
  11230. prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
  11231. prev.value += value;
  11232. state.output += prior.output + prev.output;
  11233. state.globstar = true;
  11234. consume(value + advance());
  11235. push({
  11236. type: "slash",
  11237. value: "/",
  11238. output: ""
  11239. });
  11240. continue;
  11241. }
  11242. if (prior.type === "bos" && rest[0] === "/") {
  11243. prev.type = "globstar";
  11244. prev.value += value;
  11245. prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
  11246. state.output = prev.output;
  11247. state.globstar = true;
  11248. consume(value + advance());
  11249. push({
  11250. type: "slash",
  11251. value: "/",
  11252. output: ""
  11253. });
  11254. continue;
  11255. }
  11256. state.output = state.output.slice(0, -prev.output.length);
  11257. prev.type = "globstar";
  11258. prev.output = globstar(opts);
  11259. prev.value += value;
  11260. state.output += prev.output;
  11261. state.globstar = true;
  11262. consume(value);
  11263. continue;
  11264. }
  11265. const token = {
  11266. type: "star",
  11267. value,
  11268. output: star
  11269. };
  11270. if (opts.bash === true) {
  11271. token.output = ".*?";
  11272. if (prev.type === "bos" || prev.type === "slash") {
  11273. token.output = nodot + token.output;
  11274. }
  11275. push(token);
  11276. continue;
  11277. }
  11278. if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
  11279. token.output = value;
  11280. push(token);
  11281. continue;
  11282. }
  11283. if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
  11284. if (prev.type === "dot") {
  11285. state.output += NO_DOT_SLASH;
  11286. prev.output += NO_DOT_SLASH;
  11287. } else if (opts.dot === true) {
  11288. state.output += NO_DOTS_SLASH;
  11289. prev.output += NO_DOTS_SLASH;
  11290. } else {
  11291. state.output += nodot;
  11292. prev.output += nodot;
  11293. }
  11294. if (peek() !== "*") {
  11295. state.output += ONE_CHAR;
  11296. prev.output += ONE_CHAR;
  11297. }
  11298. }
  11299. push(token);
  11300. }
  11301. while (state.brackets > 0) {
  11302. if (opts.strictBrackets === true)
  11303. throw new SyntaxError(syntaxError("closing", "]"));
  11304. state.output = utils.escapeLast(state.output, "[");
  11305. decrement("brackets");
  11306. }
  11307. while (state.parens > 0) {
  11308. if (opts.strictBrackets === true)
  11309. throw new SyntaxError(syntaxError("closing", ")"));
  11310. state.output = utils.escapeLast(state.output, "(");
  11311. decrement("parens");
  11312. }
  11313. while (state.braces > 0) {
  11314. if (opts.strictBrackets === true)
  11315. throw new SyntaxError(syntaxError("closing", "}"));
  11316. state.output = utils.escapeLast(state.output, "{");
  11317. decrement("braces");
  11318. }
  11319. if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
  11320. push({
  11321. type: "maybe_slash",
  11322. value: "",
  11323. output: `${SLASH_LITERAL}?`
  11324. });
  11325. }
  11326. if (state.backtrack === true) {
  11327. state.output = "";
  11328. for (const token of state.tokens) {
  11329. state.output += token.output != null ? token.output : token.value;
  11330. if (token.suffix) {
  11331. state.output += token.suffix;
  11332. }
  11333. }
  11334. }
  11335. return state;
  11336. };
  11337. parse.fastpaths = (input, options) => {
  11338. const opts = Object.assign({}, options);
  11339. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  11340. const len = input.length;
  11341. if (len > max) {
  11342. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  11343. }
  11344. input = REPLACEMENTS[input] || input;
  11345. const win32 = utils.isWindows(options);
  11346. const {
  11347. DOT_LITERAL,
  11348. SLASH_LITERAL,
  11349. ONE_CHAR,
  11350. DOTS_SLASH,
  11351. NO_DOT,
  11352. NO_DOTS,
  11353. NO_DOTS_SLASH,
  11354. STAR,
  11355. START_ANCHOR
  11356. } = constants.globChars(win32);
  11357. const nodot = opts.dot ? NO_DOTS : NO_DOT;
  11358. const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  11359. const capture = opts.capture ? "" : "?:";
  11360. const state = {
  11361. negated: false,
  11362. prefix: ""
  11363. };
  11364. let star = opts.bash === true ? ".*?" : STAR;
  11365. if (opts.capture) {
  11366. star = `(${star})`;
  11367. }
  11368. const globstar = (opts2) => {
  11369. if (opts2.noglobstar === true)
  11370. return star;
  11371. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  11372. };
  11373. const create = (str) => {
  11374. switch (str) {
  11375. case "*":
  11376. return `${nodot}${ONE_CHAR}${star}`;
  11377. case ".*":
  11378. return `${DOT_LITERAL}${ONE_CHAR}${star}`;
  11379. case "*.*":
  11380. return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  11381. case "*/*":
  11382. return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
  11383. case "**":
  11384. return nodot + globstar(opts);
  11385. case "**/*":
  11386. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
  11387. case "**/*.*":
  11388. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  11389. case "**/.*":
  11390. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
  11391. default: {
  11392. const match = /^(.*?)\.(\w+)$/.exec(str);
  11393. if (!match)
  11394. return;
  11395. const source2 = create(match[1]);
  11396. if (!source2)
  11397. return;
  11398. return source2 + DOT_LITERAL + match[2];
  11399. }
  11400. }
  11401. };
  11402. const output = utils.removePrefix(input, state);
  11403. let source = create(output);
  11404. if (source && opts.strictSlashes !== true) {
  11405. source += `${SLASH_LITERAL}?`;
  11406. }
  11407. return source;
  11408. };
  11409. module2.exports = parse;
  11410. }
  11411. });
  11412. var require_picomatch = __commonJS2({
  11413. "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
  11414. "use strict";
  11415. var path = require("path");
  11416. var scan = require_scan();
  11417. var parse = require_parse2();
  11418. var utils = require_utils3();
  11419. var constants = require_constants3();
  11420. var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
  11421. var picomatch = (glob, options, returnState = false) => {
  11422. if (Array.isArray(glob)) {
  11423. const fns = glob.map((input) => picomatch(input, options, returnState));
  11424. const arrayMatcher = (str) => {
  11425. for (const isMatch of fns) {
  11426. const state2 = isMatch(str);
  11427. if (state2)
  11428. return state2;
  11429. }
  11430. return false;
  11431. };
  11432. return arrayMatcher;
  11433. }
  11434. const isState = isObject(glob) && glob.tokens && glob.input;
  11435. if (glob === "" || typeof glob !== "string" && !isState) {
  11436. throw new TypeError("Expected pattern to be a non-empty string");
  11437. }
  11438. const opts = options || {};
  11439. const posix = utils.isWindows(options);
  11440. const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
  11441. const state = regex.state;
  11442. delete regex.state;
  11443. let isIgnored = () => false;
  11444. if (opts.ignore) {
  11445. const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
  11446. ignore: null,
  11447. onMatch: null,
  11448. onResult: null
  11449. });
  11450. isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
  11451. }
  11452. const matcher = (input, returnObject = false) => {
  11453. const {
  11454. isMatch,
  11455. match,
  11456. output
  11457. } = picomatch.test(input, regex, options, {
  11458. glob,
  11459. posix
  11460. });
  11461. const result = {
  11462. glob,
  11463. state,
  11464. regex,
  11465. posix,
  11466. input,
  11467. output,
  11468. match,
  11469. isMatch
  11470. };
  11471. if (typeof opts.onResult === "function") {
  11472. opts.onResult(result);
  11473. }
  11474. if (isMatch === false) {
  11475. result.isMatch = false;
  11476. return returnObject ? result : false;
  11477. }
  11478. if (isIgnored(input)) {
  11479. if (typeof opts.onIgnore === "function") {
  11480. opts.onIgnore(result);
  11481. }
  11482. result.isMatch = false;
  11483. return returnObject ? result : false;
  11484. }
  11485. if (typeof opts.onMatch === "function") {
  11486. opts.onMatch(result);
  11487. }
  11488. return returnObject ? result : true;
  11489. };
  11490. if (returnState) {
  11491. matcher.state = state;
  11492. }
  11493. return matcher;
  11494. };
  11495. picomatch.test = (input, regex, options, {
  11496. glob,
  11497. posix
  11498. } = {}) => {
  11499. if (typeof input !== "string") {
  11500. throw new TypeError("Expected input to be a string");
  11501. }
  11502. if (input === "") {
  11503. return {
  11504. isMatch: false,
  11505. output: ""
  11506. };
  11507. }
  11508. const opts = options || {};
  11509. const format = opts.format || (posix ? utils.toPosixSlashes : null);
  11510. let match = input === glob;
  11511. let output = match && format ? format(input) : input;
  11512. if (match === false) {
  11513. output = format ? format(input) : input;
  11514. match = output === glob;
  11515. }
  11516. if (match === false || opts.capture === true) {
  11517. if (opts.matchBase === true || opts.basename === true) {
  11518. match = picomatch.matchBase(input, regex, options, posix);
  11519. } else {
  11520. match = regex.exec(output);
  11521. }
  11522. }
  11523. return {
  11524. isMatch: Boolean(match),
  11525. match,
  11526. output
  11527. };
  11528. };
  11529. picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
  11530. const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
  11531. return regex.test(path.basename(input));
  11532. };
  11533. picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  11534. picomatch.parse = (pattern, options) => {
  11535. if (Array.isArray(pattern))
  11536. return pattern.map((p) => picomatch.parse(p, options));
  11537. return parse(pattern, Object.assign(Object.assign({}, options), {}, {
  11538. fastpaths: false
  11539. }));
  11540. };
  11541. picomatch.scan = (input, options) => scan(input, options);
  11542. picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
  11543. if (returnOutput === true) {
  11544. return state.output;
  11545. }
  11546. const opts = options || {};
  11547. const prepend = opts.contains ? "" : "^";
  11548. const append = opts.contains ? "" : "$";
  11549. let source = `${prepend}(?:${state.output})${append}`;
  11550. if (state && state.negated === true) {
  11551. source = `^(?!${source}).*$`;
  11552. }
  11553. const regex = picomatch.toRegex(source, options);
  11554. if (returnState === true) {
  11555. regex.state = state;
  11556. }
  11557. return regex;
  11558. };
  11559. picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
  11560. if (!input || typeof input !== "string") {
  11561. throw new TypeError("Expected a non-empty string");
  11562. }
  11563. let parsed = {
  11564. negated: false,
  11565. fastpaths: true
  11566. };
  11567. if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
  11568. parsed.output = parse.fastpaths(input, options);
  11569. }
  11570. if (!parsed.output) {
  11571. parsed = parse(input, options);
  11572. }
  11573. return picomatch.compileRe(parsed, options, returnOutput, returnState);
  11574. };
  11575. picomatch.toRegex = (source, options) => {
  11576. try {
  11577. const opts = options || {};
  11578. return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
  11579. } catch (err) {
  11580. if (options && options.debug === true)
  11581. throw err;
  11582. return /$^/;
  11583. }
  11584. };
  11585. picomatch.constants = constants;
  11586. module2.exports = picomatch;
  11587. }
  11588. });
  11589. var require_picomatch2 = __commonJS2({
  11590. "node_modules/picomatch/index.js"(exports2, module2) {
  11591. "use strict";
  11592. module2.exports = require_picomatch();
  11593. }
  11594. });
  11595. var require_micromatch = __commonJS2({
  11596. "node_modules/micromatch/index.js"(exports2, module2) {
  11597. "use strict";
  11598. var util = require("util");
  11599. var braces = require_braces();
  11600. var picomatch = require_picomatch2();
  11601. var utils = require_utils3();
  11602. var isEmptyString = (val) => val === "" || val === "./";
  11603. var micromatch = (list, patterns, options) => {
  11604. patterns = [].concat(patterns);
  11605. list = [].concat(list);
  11606. let omit = /* @__PURE__ */ new Set();
  11607. let keep = /* @__PURE__ */ new Set();
  11608. let items = /* @__PURE__ */ new Set();
  11609. let negatives = 0;
  11610. let onResult = (state) => {
  11611. items.add(state.output);
  11612. if (options && options.onResult) {
  11613. options.onResult(state);
  11614. }
  11615. };
  11616. for (let i = 0; i < patterns.length; i++) {
  11617. let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
  11618. onResult
  11619. }), true);
  11620. let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
  11621. if (negated)
  11622. negatives++;
  11623. for (let item of list) {
  11624. let matched = isMatch(item, true);
  11625. let match = negated ? !matched.isMatch : matched.isMatch;
  11626. if (!match)
  11627. continue;
  11628. if (negated) {
  11629. omit.add(matched.output);
  11630. } else {
  11631. omit.delete(matched.output);
  11632. keep.add(matched.output);
  11633. }
  11634. }
  11635. }
  11636. let result = negatives === patterns.length ? [...items] : [...keep];
  11637. let matches = result.filter((item) => !omit.has(item));
  11638. if (options && matches.length === 0) {
  11639. if (options.failglob === true) {
  11640. throw new Error(`No matches found for "${patterns.join(", ")}"`);
  11641. }
  11642. if (options.nonull === true || options.nullglob === true) {
  11643. return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
  11644. }
  11645. }
  11646. return matches;
  11647. };
  11648. micromatch.match = micromatch;
  11649. micromatch.matcher = (pattern, options) => picomatch(pattern, options);
  11650. micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  11651. micromatch.any = micromatch.isMatch;
  11652. micromatch.not = (list, patterns, options = {}) => {
  11653. patterns = [].concat(patterns).map(String);
  11654. let result = /* @__PURE__ */ new Set();
  11655. let items = [];
  11656. let onResult = (state) => {
  11657. if (options.onResult)
  11658. options.onResult(state);
  11659. items.push(state.output);
  11660. };
  11661. let matches = new Set(micromatch(list, patterns, Object.assign(Object.assign({}, options), {}, {
  11662. onResult
  11663. })));
  11664. for (let item of items) {
  11665. if (!matches.has(item)) {
  11666. result.add(item);
  11667. }
  11668. }
  11669. return [...result];
  11670. };
  11671. micromatch.contains = (str, pattern, options) => {
  11672. if (typeof str !== "string") {
  11673. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  11674. }
  11675. if (Array.isArray(pattern)) {
  11676. return pattern.some((p) => micromatch.contains(str, p, options));
  11677. }
  11678. if (typeof pattern === "string") {
  11679. if (isEmptyString(str) || isEmptyString(pattern)) {
  11680. return false;
  11681. }
  11682. if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
  11683. return true;
  11684. }
  11685. }
  11686. return micromatch.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
  11687. contains: true
  11688. }));
  11689. };
  11690. micromatch.matchKeys = (obj, patterns, options) => {
  11691. if (!utils.isObject(obj)) {
  11692. throw new TypeError("Expected the first argument to be an object");
  11693. }
  11694. let keys = micromatch(Object.keys(obj), patterns, options);
  11695. let res = {};
  11696. for (let key of keys)
  11697. res[key] = obj[key];
  11698. return res;
  11699. };
  11700. micromatch.some = (list, patterns, options) => {
  11701. let items = [].concat(list);
  11702. for (let pattern of [].concat(patterns)) {
  11703. let isMatch = picomatch(String(pattern), options);
  11704. if (items.some((item) => isMatch(item))) {
  11705. return true;
  11706. }
  11707. }
  11708. return false;
  11709. };
  11710. micromatch.every = (list, patterns, options) => {
  11711. let items = [].concat(list);
  11712. for (let pattern of [].concat(patterns)) {
  11713. let isMatch = picomatch(String(pattern), options);
  11714. if (!items.every((item) => isMatch(item))) {
  11715. return false;
  11716. }
  11717. }
  11718. return true;
  11719. };
  11720. micromatch.all = (str, patterns, options) => {
  11721. if (typeof str !== "string") {
  11722. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  11723. }
  11724. return [].concat(patterns).every((p) => picomatch(p, options)(str));
  11725. };
  11726. micromatch.capture = (glob, input, options) => {
  11727. let posix = utils.isWindows(options);
  11728. let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
  11729. capture: true
  11730. }));
  11731. let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
  11732. if (match) {
  11733. return match.slice(1).map((v) => v === void 0 ? "" : v);
  11734. }
  11735. };
  11736. micromatch.makeRe = (...args) => picomatch.makeRe(...args);
  11737. micromatch.scan = (...args) => picomatch.scan(...args);
  11738. micromatch.parse = (patterns, options) => {
  11739. let res = [];
  11740. for (let pattern of [].concat(patterns || [])) {
  11741. for (let str of braces(String(pattern), options)) {
  11742. res.push(picomatch.parse(str, options));
  11743. }
  11744. }
  11745. return res;
  11746. };
  11747. micromatch.braces = (pattern, options) => {
  11748. if (typeof pattern !== "string")
  11749. throw new TypeError("Expected a string");
  11750. if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
  11751. return [pattern];
  11752. }
  11753. return braces(pattern, options);
  11754. };
  11755. micromatch.braceExpand = (pattern, options) => {
  11756. if (typeof pattern !== "string")
  11757. throw new TypeError("Expected a string");
  11758. return micromatch.braces(pattern, Object.assign(Object.assign({}, options), {}, {
  11759. expand: true
  11760. }));
  11761. };
  11762. module2.exports = micromatch;
  11763. }
  11764. });
  11765. var require_parser2 = __commonJS2({
  11766. "node_modules/@iarna/toml/lib/parser.js"(exports2, module2) {
  11767. "use strict";
  11768. var ParserEND = 1114112;
  11769. var ParserError = class extends Error {
  11770. constructor(msg, filename, linenumber) {
  11771. super("[ParserError] " + msg, filename, linenumber);
  11772. this.name = "ParserError";
  11773. this.code = "ParserError";
  11774. if (Error.captureStackTrace)
  11775. Error.captureStackTrace(this, ParserError);
  11776. }
  11777. };
  11778. var State = class {
  11779. constructor(parser) {
  11780. this.parser = parser;
  11781. this.buf = "";
  11782. this.returned = null;
  11783. this.result = null;
  11784. this.resultTable = null;
  11785. this.resultArr = null;
  11786. }
  11787. };
  11788. var Parser = class {
  11789. constructor() {
  11790. this.pos = 0;
  11791. this.col = 0;
  11792. this.line = 0;
  11793. this.obj = {};
  11794. this.ctx = this.obj;
  11795. this.stack = [];
  11796. this._buf = "";
  11797. this.char = null;
  11798. this.ii = 0;
  11799. this.state = new State(this.parseStart);
  11800. }
  11801. parse(str) {
  11802. if (str.length === 0 || str.length == null)
  11803. return;
  11804. this._buf = String(str);
  11805. this.ii = -1;
  11806. this.char = -1;
  11807. let getNext;
  11808. while (getNext === false || this.nextChar()) {
  11809. getNext = this.runOne();
  11810. }
  11811. this._buf = null;
  11812. }
  11813. nextChar() {
  11814. if (this.char === 10) {
  11815. ++this.line;
  11816. this.col = -1;
  11817. }
  11818. ++this.ii;
  11819. this.char = this._buf.codePointAt(this.ii);
  11820. ++this.pos;
  11821. ++this.col;
  11822. return this.haveBuffer();
  11823. }
  11824. haveBuffer() {
  11825. return this.ii < this._buf.length;
  11826. }
  11827. runOne() {
  11828. return this.state.parser.call(this, this.state.returned);
  11829. }
  11830. finish() {
  11831. this.char = ParserEND;
  11832. let last;
  11833. do {
  11834. last = this.state.parser;
  11835. this.runOne();
  11836. } while (this.state.parser !== last);
  11837. this.ctx = null;
  11838. this.state = null;
  11839. this._buf = null;
  11840. return this.obj;
  11841. }
  11842. next(fn) {
  11843. if (typeof fn !== "function")
  11844. throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn));
  11845. this.state.parser = fn;
  11846. }
  11847. goto(fn) {
  11848. this.next(fn);
  11849. return this.runOne();
  11850. }
  11851. call(fn, returnWith) {
  11852. if (returnWith)
  11853. this.next(returnWith);
  11854. this.stack.push(this.state);
  11855. this.state = new State(fn);
  11856. }
  11857. callNow(fn, returnWith) {
  11858. this.call(fn, returnWith);
  11859. return this.runOne();
  11860. }
  11861. return(value) {
  11862. if (this.stack.length === 0)
  11863. throw this.error(new ParserError("Stack underflow"));
  11864. if (value === void 0)
  11865. value = this.state.buf;
  11866. this.state = this.stack.pop();
  11867. this.state.returned = value;
  11868. }
  11869. returnNow(value) {
  11870. this.return(value);
  11871. return this.runOne();
  11872. }
  11873. consume() {
  11874. if (this.char === ParserEND)
  11875. throw this.error(new ParserError("Unexpected end-of-buffer"));
  11876. this.state.buf += this._buf[this.ii];
  11877. }
  11878. error(err) {
  11879. err.line = this.line;
  11880. err.col = this.col;
  11881. err.pos = this.pos;
  11882. return err;
  11883. }
  11884. parseStart() {
  11885. throw new ParserError("Must declare a parseStart method");
  11886. }
  11887. };
  11888. Parser.END = ParserEND;
  11889. Parser.Error = ParserError;
  11890. module2.exports = Parser;
  11891. }
  11892. });
  11893. var require_create_datetime = __commonJS2({
  11894. "node_modules/@iarna/toml/lib/create-datetime.js"(exports2, module2) {
  11895. "use strict";
  11896. module2.exports = (value) => {
  11897. const date = new Date(value);
  11898. if (isNaN(date)) {
  11899. throw new TypeError("Invalid Datetime");
  11900. } else {
  11901. return date;
  11902. }
  11903. };
  11904. }
  11905. });
  11906. var require_format_num = __commonJS2({
  11907. "node_modules/@iarna/toml/lib/format-num.js"(exports2, module2) {
  11908. "use strict";
  11909. module2.exports = (d, num) => {
  11910. num = String(num);
  11911. while (num.length < d)
  11912. num = "0" + num;
  11913. return num;
  11914. };
  11915. }
  11916. });
  11917. var require_create_datetime_float = __commonJS2({
  11918. "node_modules/@iarna/toml/lib/create-datetime-float.js"(exports2, module2) {
  11919. "use strict";
  11920. var f = require_format_num();
  11921. var FloatingDateTime = class extends Date {
  11922. constructor(value) {
  11923. super(value + "Z");
  11924. this.isFloating = true;
  11925. }
  11926. toISOString() {
  11927. const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
  11928. const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
  11929. return `${date}T${time}`;
  11930. }
  11931. };
  11932. module2.exports = (value) => {
  11933. const date = new FloatingDateTime(value);
  11934. if (isNaN(date)) {
  11935. throw new TypeError("Invalid Datetime");
  11936. } else {
  11937. return date;
  11938. }
  11939. };
  11940. }
  11941. });
  11942. var require_create_date = __commonJS2({
  11943. "node_modules/@iarna/toml/lib/create-date.js"(exports2, module2) {
  11944. "use strict";
  11945. var f = require_format_num();
  11946. var DateTime = global.Date;
  11947. var Date2 = class extends DateTime {
  11948. constructor(value) {
  11949. super(value);
  11950. this.isDate = true;
  11951. }
  11952. toISOString() {
  11953. return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
  11954. }
  11955. };
  11956. module2.exports = (value) => {
  11957. const date = new Date2(value);
  11958. if (isNaN(date)) {
  11959. throw new TypeError("Invalid Datetime");
  11960. } else {
  11961. return date;
  11962. }
  11963. };
  11964. }
  11965. });
  11966. var require_create_time = __commonJS2({
  11967. "node_modules/@iarna/toml/lib/create-time.js"(exports2, module2) {
  11968. "use strict";
  11969. var f = require_format_num();
  11970. var Time = class extends Date {
  11971. constructor(value) {
  11972. super(`0000-01-01T${value}Z`);
  11973. this.isTime = true;
  11974. }
  11975. toISOString() {
  11976. return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
  11977. }
  11978. };
  11979. module2.exports = (value) => {
  11980. const date = new Time(value);
  11981. if (isNaN(date)) {
  11982. throw new TypeError("Invalid Datetime");
  11983. } else {
  11984. return date;
  11985. }
  11986. };
  11987. }
  11988. });
  11989. var require_toml_parser = __commonJS2({
  11990. "node_modules/@iarna/toml/lib/toml-parser.js"(exports2, module2) {
  11991. "use strict";
  11992. module2.exports = makeParserClass(require_parser2());
  11993. module2.exports.makeParserClass = makeParserClass;
  11994. var TomlError = class extends Error {
  11995. constructor(msg) {
  11996. super(msg);
  11997. this.name = "TomlError";
  11998. if (Error.captureStackTrace)
  11999. Error.captureStackTrace(this, TomlError);
  12000. this.fromTOML = true;
  12001. this.wrapped = null;
  12002. }
  12003. };
  12004. TomlError.wrap = (err) => {
  12005. const terr = new TomlError(err.message);
  12006. terr.code = err.code;
  12007. terr.wrapped = err;
  12008. return terr;
  12009. };
  12010. module2.exports.TomlError = TomlError;
  12011. var createDateTime = require_create_datetime();
  12012. var createDateTimeFloat = require_create_datetime_float();
  12013. var createDate = require_create_date();
  12014. var createTime = require_create_time();
  12015. var CTRL_I = 9;
  12016. var CTRL_J = 10;
  12017. var CTRL_M = 13;
  12018. var CTRL_CHAR_BOUNDARY = 31;
  12019. var CHAR_SP = 32;
  12020. var CHAR_QUOT = 34;
  12021. var CHAR_NUM = 35;
  12022. var CHAR_APOS = 39;
  12023. var CHAR_PLUS = 43;
  12024. var CHAR_COMMA = 44;
  12025. var CHAR_HYPHEN = 45;
  12026. var CHAR_PERIOD = 46;
  12027. var CHAR_0 = 48;
  12028. var CHAR_1 = 49;
  12029. var CHAR_7 = 55;
  12030. var CHAR_9 = 57;
  12031. var CHAR_COLON = 58;
  12032. var CHAR_EQUALS = 61;
  12033. var CHAR_A = 65;
  12034. var CHAR_E = 69;
  12035. var CHAR_F = 70;
  12036. var CHAR_T = 84;
  12037. var CHAR_U = 85;
  12038. var CHAR_Z = 90;
  12039. var CHAR_LOWBAR = 95;
  12040. var CHAR_a = 97;
  12041. var CHAR_b = 98;
  12042. var CHAR_e = 101;
  12043. var CHAR_f = 102;
  12044. var CHAR_i = 105;
  12045. var CHAR_l = 108;
  12046. var CHAR_n = 110;
  12047. var CHAR_o = 111;
  12048. var CHAR_r = 114;
  12049. var CHAR_s = 115;
  12050. var CHAR_t = 116;
  12051. var CHAR_u = 117;
  12052. var CHAR_x = 120;
  12053. var CHAR_z = 122;
  12054. var CHAR_LCUB = 123;
  12055. var CHAR_RCUB = 125;
  12056. var CHAR_LSQB = 91;
  12057. var CHAR_BSOL = 92;
  12058. var CHAR_RSQB = 93;
  12059. var CHAR_DEL = 127;
  12060. var SURROGATE_FIRST = 55296;
  12061. var SURROGATE_LAST = 57343;
  12062. var escapes = {
  12063. [CHAR_b]: "\b",
  12064. [CHAR_t]: " ",
  12065. [CHAR_n]: "\n",
  12066. [CHAR_f]: "\f",
  12067. [CHAR_r]: "\r",
  12068. [CHAR_QUOT]: '"',
  12069. [CHAR_BSOL]: "\\"
  12070. };
  12071. function isDigit(cp) {
  12072. return cp >= CHAR_0 && cp <= CHAR_9;
  12073. }
  12074. function isHexit(cp) {
  12075. return cp >= CHAR_A && cp <= CHAR_F || cp >= CHAR_a && cp <= CHAR_f || cp >= CHAR_0 && cp <= CHAR_9;
  12076. }
  12077. function isBit(cp) {
  12078. return cp === CHAR_1 || cp === CHAR_0;
  12079. }
  12080. function isOctit(cp) {
  12081. return cp >= CHAR_0 && cp <= CHAR_7;
  12082. }
  12083. function isAlphaNumQuoteHyphen(cp) {
  12084. return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_APOS || cp === CHAR_QUOT || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
  12085. }
  12086. function isAlphaNumHyphen(cp) {
  12087. return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
  12088. }
  12089. var _type = Symbol("type");
  12090. var _declared = Symbol("declared");
  12091. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12092. var defineProperty = Object.defineProperty;
  12093. var descriptor = {
  12094. configurable: true,
  12095. enumerable: true,
  12096. writable: true,
  12097. value: void 0
  12098. };
  12099. function hasKey(obj, key) {
  12100. if (hasOwnProperty.call(obj, key))
  12101. return true;
  12102. if (key === "__proto__")
  12103. defineProperty(obj, "__proto__", descriptor);
  12104. return false;
  12105. }
  12106. var INLINE_TABLE = Symbol("inline-table");
  12107. function InlineTable() {
  12108. return Object.defineProperties({}, {
  12109. [_type]: {
  12110. value: INLINE_TABLE
  12111. }
  12112. });
  12113. }
  12114. function isInlineTable(obj) {
  12115. if (obj === null || typeof obj !== "object")
  12116. return false;
  12117. return obj[_type] === INLINE_TABLE;
  12118. }
  12119. var TABLE = Symbol("table");
  12120. function Table() {
  12121. return Object.defineProperties({}, {
  12122. [_type]: {
  12123. value: TABLE
  12124. },
  12125. [_declared]: {
  12126. value: false,
  12127. writable: true
  12128. }
  12129. });
  12130. }
  12131. function isTable(obj) {
  12132. if (obj === null || typeof obj !== "object")
  12133. return false;
  12134. return obj[_type] === TABLE;
  12135. }
  12136. var _contentType = Symbol("content-type");
  12137. var INLINE_LIST = Symbol("inline-list");
  12138. function InlineList(type) {
  12139. return Object.defineProperties([], {
  12140. [_type]: {
  12141. value: INLINE_LIST
  12142. },
  12143. [_contentType]: {
  12144. value: type
  12145. }
  12146. });
  12147. }
  12148. function isInlineList(obj) {
  12149. if (obj === null || typeof obj !== "object")
  12150. return false;
  12151. return obj[_type] === INLINE_LIST;
  12152. }
  12153. var LIST = Symbol("list");
  12154. function List() {
  12155. return Object.defineProperties([], {
  12156. [_type]: {
  12157. value: LIST
  12158. }
  12159. });
  12160. }
  12161. function isList(obj) {
  12162. if (obj === null || typeof obj !== "object")
  12163. return false;
  12164. return obj[_type] === LIST;
  12165. }
  12166. var _custom;
  12167. try {
  12168. const utilInspect = require("util").inspect;
  12169. _custom = utilInspect.custom;
  12170. } catch (_) {
  12171. }
  12172. var _inspect = _custom || "inspect";
  12173. var BoxedBigInt = class {
  12174. constructor(value) {
  12175. try {
  12176. this.value = global.BigInt.asIntN(64, value);
  12177. } catch (_) {
  12178. this.value = null;
  12179. }
  12180. Object.defineProperty(this, _type, {
  12181. value: INTEGER
  12182. });
  12183. }
  12184. isNaN() {
  12185. return this.value === null;
  12186. }
  12187. toString() {
  12188. return String(this.value);
  12189. }
  12190. [_inspect]() {
  12191. return `[BigInt: ${this.toString()}]}`;
  12192. }
  12193. valueOf() {
  12194. return this.value;
  12195. }
  12196. };
  12197. var INTEGER = Symbol("integer");
  12198. function Integer(value) {
  12199. let num = Number(value);
  12200. if (Object.is(num, -0))
  12201. num = 0;
  12202. if (global.BigInt && !Number.isSafeInteger(num)) {
  12203. return new BoxedBigInt(value);
  12204. } else {
  12205. return Object.defineProperties(new Number(num), {
  12206. isNaN: {
  12207. value: function() {
  12208. return isNaN(this);
  12209. }
  12210. },
  12211. [_type]: {
  12212. value: INTEGER
  12213. },
  12214. [_inspect]: {
  12215. value: () => `[Integer: ${value}]`
  12216. }
  12217. });
  12218. }
  12219. }
  12220. function isInteger(obj) {
  12221. if (obj === null || typeof obj !== "object")
  12222. return false;
  12223. return obj[_type] === INTEGER;
  12224. }
  12225. var FLOAT = Symbol("float");
  12226. function Float(value) {
  12227. return Object.defineProperties(new Number(value), {
  12228. [_type]: {
  12229. value: FLOAT
  12230. },
  12231. [_inspect]: {
  12232. value: () => `[Float: ${value}]`
  12233. }
  12234. });
  12235. }
  12236. function isFloat(obj) {
  12237. if (obj === null || typeof obj !== "object")
  12238. return false;
  12239. return obj[_type] === FLOAT;
  12240. }
  12241. function tomlType(value) {
  12242. const type = typeof value;
  12243. if (type === "object") {
  12244. if (value === null)
  12245. return "null";
  12246. if (value instanceof Date)
  12247. return "datetime";
  12248. if (_type in value) {
  12249. switch (value[_type]) {
  12250. case INLINE_TABLE:
  12251. return "inline-table";
  12252. case INLINE_LIST:
  12253. return "inline-list";
  12254. case TABLE:
  12255. return "table";
  12256. case LIST:
  12257. return "list";
  12258. case FLOAT:
  12259. return "float";
  12260. case INTEGER:
  12261. return "integer";
  12262. }
  12263. }
  12264. }
  12265. return type;
  12266. }
  12267. function makeParserClass(Parser) {
  12268. class TOMLParser extends Parser {
  12269. constructor() {
  12270. super();
  12271. this.ctx = this.obj = Table();
  12272. }
  12273. atEndOfWord() {
  12274. return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine();
  12275. }
  12276. atEndOfLine() {
  12277. return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M;
  12278. }
  12279. parseStart() {
  12280. if (this.char === Parser.END) {
  12281. return null;
  12282. } else if (this.char === CHAR_LSQB) {
  12283. return this.call(this.parseTableOrList);
  12284. } else if (this.char === CHAR_NUM) {
  12285. return this.call(this.parseComment);
  12286. } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
  12287. return null;
  12288. } else if (isAlphaNumQuoteHyphen(this.char)) {
  12289. return this.callNow(this.parseAssignStatement);
  12290. } else {
  12291. throw this.error(new TomlError(`Unknown character "${this.char}"`));
  12292. }
  12293. }
  12294. parseWhitespaceToEOL() {
  12295. if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
  12296. return null;
  12297. } else if (this.char === CHAR_NUM) {
  12298. return this.goto(this.parseComment);
  12299. } else if (this.char === Parser.END || this.char === CTRL_J) {
  12300. return this.return();
  12301. } else {
  12302. throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"));
  12303. }
  12304. }
  12305. parseAssignStatement() {
  12306. return this.callNow(this.parseAssign, this.recordAssignStatement);
  12307. }
  12308. recordAssignStatement(kv) {
  12309. let target = this.ctx;
  12310. let finalKey = kv.key.pop();
  12311. for (let kw of kv.key) {
  12312. if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
  12313. throw this.error(new TomlError("Can't redefine existing key"));
  12314. }
  12315. target = target[kw] = target[kw] || Table();
  12316. }
  12317. if (hasKey(target, finalKey)) {
  12318. throw this.error(new TomlError("Can't redefine existing key"));
  12319. }
  12320. if (isInteger(kv.value) || isFloat(kv.value)) {
  12321. target[finalKey] = kv.value.valueOf();
  12322. } else {
  12323. target[finalKey] = kv.value;
  12324. }
  12325. return this.goto(this.parseWhitespaceToEOL);
  12326. }
  12327. parseAssign() {
  12328. return this.callNow(this.parseKeyword, this.recordAssignKeyword);
  12329. }
  12330. recordAssignKeyword(key) {
  12331. if (this.state.resultTable) {
  12332. this.state.resultTable.push(key);
  12333. } else {
  12334. this.state.resultTable = [key];
  12335. }
  12336. return this.goto(this.parseAssignKeywordPreDot);
  12337. }
  12338. parseAssignKeywordPreDot() {
  12339. if (this.char === CHAR_PERIOD) {
  12340. return this.next(this.parseAssignKeywordPostDot);
  12341. } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {
  12342. return this.goto(this.parseAssignEqual);
  12343. }
  12344. }
  12345. parseAssignKeywordPostDot() {
  12346. if (this.char !== CHAR_SP && this.char !== CTRL_I) {
  12347. return this.callNow(this.parseKeyword, this.recordAssignKeyword);
  12348. }
  12349. }
  12350. parseAssignEqual() {
  12351. if (this.char === CHAR_EQUALS) {
  12352. return this.next(this.parseAssignPreValue);
  12353. } else {
  12354. throw this.error(new TomlError('Invalid character, expected "="'));
  12355. }
  12356. }
  12357. parseAssignPreValue() {
  12358. if (this.char === CHAR_SP || this.char === CTRL_I) {
  12359. return null;
  12360. } else {
  12361. return this.callNow(this.parseValue, this.recordAssignValue);
  12362. }
  12363. }
  12364. recordAssignValue(value) {
  12365. return this.returnNow({
  12366. key: this.state.resultTable,
  12367. value
  12368. });
  12369. }
  12370. parseComment() {
  12371. do {
  12372. if (this.char === Parser.END || this.char === CTRL_J) {
  12373. return this.return();
  12374. }
  12375. } while (this.nextChar());
  12376. }
  12377. parseTableOrList() {
  12378. if (this.char === CHAR_LSQB) {
  12379. this.next(this.parseList);
  12380. } else {
  12381. return this.goto(this.parseTable);
  12382. }
  12383. }
  12384. parseTable() {
  12385. this.ctx = this.obj;
  12386. return this.goto(this.parseTableNext);
  12387. }
  12388. parseTableNext() {
  12389. if (this.char === CHAR_SP || this.char === CTRL_I) {
  12390. return null;
  12391. } else {
  12392. return this.callNow(this.parseKeyword, this.parseTableMore);
  12393. }
  12394. }
  12395. parseTableMore(keyword) {
  12396. if (this.char === CHAR_SP || this.char === CTRL_I) {
  12397. return null;
  12398. } else if (this.char === CHAR_RSQB) {
  12399. if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {
  12400. throw this.error(new TomlError("Can't redefine existing key"));
  12401. } else {
  12402. this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table();
  12403. this.ctx[_declared] = true;
  12404. }
  12405. return this.next(this.parseWhitespaceToEOL);
  12406. } else if (this.char === CHAR_PERIOD) {
  12407. if (!hasKey(this.ctx, keyword)) {
  12408. this.ctx = this.ctx[keyword] = Table();
  12409. } else if (isTable(this.ctx[keyword])) {
  12410. this.ctx = this.ctx[keyword];
  12411. } else if (isList(this.ctx[keyword])) {
  12412. this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
  12413. } else {
  12414. throw this.error(new TomlError("Can't redefine existing key"));
  12415. }
  12416. return this.next(this.parseTableNext);
  12417. } else {
  12418. throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
  12419. }
  12420. }
  12421. parseList() {
  12422. this.ctx = this.obj;
  12423. return this.goto(this.parseListNext);
  12424. }
  12425. parseListNext() {
  12426. if (this.char === CHAR_SP || this.char === CTRL_I) {
  12427. return null;
  12428. } else {
  12429. return this.callNow(this.parseKeyword, this.parseListMore);
  12430. }
  12431. }
  12432. parseListMore(keyword) {
  12433. if (this.char === CHAR_SP || this.char === CTRL_I) {
  12434. return null;
  12435. } else if (this.char === CHAR_RSQB) {
  12436. if (!hasKey(this.ctx, keyword)) {
  12437. this.ctx[keyword] = List();
  12438. }
  12439. if (isInlineList(this.ctx[keyword])) {
  12440. throw this.error(new TomlError("Can't extend an inline array"));
  12441. } else if (isList(this.ctx[keyword])) {
  12442. const next = Table();
  12443. this.ctx[keyword].push(next);
  12444. this.ctx = next;
  12445. } else {
  12446. throw this.error(new TomlError("Can't redefine an existing key"));
  12447. }
  12448. return this.next(this.parseListEnd);
  12449. } else if (this.char === CHAR_PERIOD) {
  12450. if (!hasKey(this.ctx, keyword)) {
  12451. this.ctx = this.ctx[keyword] = Table();
  12452. } else if (isInlineList(this.ctx[keyword])) {
  12453. throw this.error(new TomlError("Can't extend an inline array"));
  12454. } else if (isInlineTable(this.ctx[keyword])) {
  12455. throw this.error(new TomlError("Can't extend an inline table"));
  12456. } else if (isList(this.ctx[keyword])) {
  12457. this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
  12458. } else if (isTable(this.ctx[keyword])) {
  12459. this.ctx = this.ctx[keyword];
  12460. } else {
  12461. throw this.error(new TomlError("Can't redefine an existing key"));
  12462. }
  12463. return this.next(this.parseListNext);
  12464. } else {
  12465. throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
  12466. }
  12467. }
  12468. parseListEnd(keyword) {
  12469. if (this.char === CHAR_RSQB) {
  12470. return this.next(this.parseWhitespaceToEOL);
  12471. } else {
  12472. throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
  12473. }
  12474. }
  12475. parseValue() {
  12476. if (this.char === Parser.END) {
  12477. throw this.error(new TomlError("Key without value"));
  12478. } else if (this.char === CHAR_QUOT) {
  12479. return this.next(this.parseDoubleString);
  12480. }
  12481. if (this.char === CHAR_APOS) {
  12482. return this.next(this.parseSingleString);
  12483. } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
  12484. return this.goto(this.parseNumberSign);
  12485. } else if (this.char === CHAR_i) {
  12486. return this.next(this.parseInf);
  12487. } else if (this.char === CHAR_n) {
  12488. return this.next(this.parseNan);
  12489. } else if (isDigit(this.char)) {
  12490. return this.goto(this.parseNumberOrDateTime);
  12491. } else if (this.char === CHAR_t || this.char === CHAR_f) {
  12492. return this.goto(this.parseBoolean);
  12493. } else if (this.char === CHAR_LSQB) {
  12494. return this.call(this.parseInlineList, this.recordValue);
  12495. } else if (this.char === CHAR_LCUB) {
  12496. return this.call(this.parseInlineTable, this.recordValue);
  12497. } else {
  12498. throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"));
  12499. }
  12500. }
  12501. recordValue(value) {
  12502. return this.returnNow(value);
  12503. }
  12504. parseInf() {
  12505. if (this.char === CHAR_n) {
  12506. return this.next(this.parseInf2);
  12507. } else {
  12508. throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
  12509. }
  12510. }
  12511. parseInf2() {
  12512. if (this.char === CHAR_f) {
  12513. if (this.state.buf === "-") {
  12514. return this.return(-Infinity);
  12515. } else {
  12516. return this.return(Infinity);
  12517. }
  12518. } else {
  12519. throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
  12520. }
  12521. }
  12522. parseNan() {
  12523. if (this.char === CHAR_a) {
  12524. return this.next(this.parseNan2);
  12525. } else {
  12526. throw this.error(new TomlError('Unexpected character, expected "nan"'));
  12527. }
  12528. }
  12529. parseNan2() {
  12530. if (this.char === CHAR_n) {
  12531. return this.return(NaN);
  12532. } else {
  12533. throw this.error(new TomlError('Unexpected character, expected "nan"'));
  12534. }
  12535. }
  12536. parseKeyword() {
  12537. if (this.char === CHAR_QUOT) {
  12538. return this.next(this.parseBasicString);
  12539. } else if (this.char === CHAR_APOS) {
  12540. return this.next(this.parseLiteralString);
  12541. } else {
  12542. return this.goto(this.parseBareKey);
  12543. }
  12544. }
  12545. parseBareKey() {
  12546. do {
  12547. if (this.char === Parser.END) {
  12548. throw this.error(new TomlError("Key ended without value"));
  12549. } else if (isAlphaNumHyphen(this.char)) {
  12550. this.consume();
  12551. } else if (this.state.buf.length === 0) {
  12552. throw this.error(new TomlError("Empty bare keys are not allowed"));
  12553. } else {
  12554. return this.returnNow();
  12555. }
  12556. } while (this.nextChar());
  12557. }
  12558. parseSingleString() {
  12559. if (this.char === CHAR_APOS) {
  12560. return this.next(this.parseLiteralMultiStringMaybe);
  12561. } else {
  12562. return this.goto(this.parseLiteralString);
  12563. }
  12564. }
  12565. parseLiteralString() {
  12566. do {
  12567. if (this.char === CHAR_APOS) {
  12568. return this.return();
  12569. } else if (this.atEndOfLine()) {
  12570. throw this.error(new TomlError("Unterminated string"));
  12571. } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
  12572. throw this.errorControlCharInString();
  12573. } else {
  12574. this.consume();
  12575. }
  12576. } while (this.nextChar());
  12577. }
  12578. parseLiteralMultiStringMaybe() {
  12579. if (this.char === CHAR_APOS) {
  12580. return this.next(this.parseLiteralMultiString);
  12581. } else {
  12582. return this.returnNow();
  12583. }
  12584. }
  12585. parseLiteralMultiString() {
  12586. if (this.char === CTRL_M) {
  12587. return null;
  12588. } else if (this.char === CTRL_J) {
  12589. return this.next(this.parseLiteralMultiStringContent);
  12590. } else {
  12591. return this.goto(this.parseLiteralMultiStringContent);
  12592. }
  12593. }
  12594. parseLiteralMultiStringContent() {
  12595. do {
  12596. if (this.char === CHAR_APOS) {
  12597. return this.next(this.parseLiteralMultiEnd);
  12598. } else if (this.char === Parser.END) {
  12599. throw this.error(new TomlError("Unterminated multi-line string"));
  12600. } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
  12601. throw this.errorControlCharInString();
  12602. } else {
  12603. this.consume();
  12604. }
  12605. } while (this.nextChar());
  12606. }
  12607. parseLiteralMultiEnd() {
  12608. if (this.char === CHAR_APOS) {
  12609. return this.next(this.parseLiteralMultiEnd2);
  12610. } else {
  12611. this.state.buf += "'";
  12612. return this.goto(this.parseLiteralMultiStringContent);
  12613. }
  12614. }
  12615. parseLiteralMultiEnd2() {
  12616. if (this.char === CHAR_APOS) {
  12617. return this.return();
  12618. } else {
  12619. this.state.buf += "''";
  12620. return this.goto(this.parseLiteralMultiStringContent);
  12621. }
  12622. }
  12623. parseDoubleString() {
  12624. if (this.char === CHAR_QUOT) {
  12625. return this.next(this.parseMultiStringMaybe);
  12626. } else {
  12627. return this.goto(this.parseBasicString);
  12628. }
  12629. }
  12630. parseBasicString() {
  12631. do {
  12632. if (this.char === CHAR_BSOL) {
  12633. return this.call(this.parseEscape, this.recordEscapeReplacement);
  12634. } else if (this.char === CHAR_QUOT) {
  12635. return this.return();
  12636. } else if (this.atEndOfLine()) {
  12637. throw this.error(new TomlError("Unterminated string"));
  12638. } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
  12639. throw this.errorControlCharInString();
  12640. } else {
  12641. this.consume();
  12642. }
  12643. } while (this.nextChar());
  12644. }
  12645. recordEscapeReplacement(replacement) {
  12646. this.state.buf += replacement;
  12647. return this.goto(this.parseBasicString);
  12648. }
  12649. parseMultiStringMaybe() {
  12650. if (this.char === CHAR_QUOT) {
  12651. return this.next(this.parseMultiString);
  12652. } else {
  12653. return this.returnNow();
  12654. }
  12655. }
  12656. parseMultiString() {
  12657. if (this.char === CTRL_M) {
  12658. return null;
  12659. } else if (this.char === CTRL_J) {
  12660. return this.next(this.parseMultiStringContent);
  12661. } else {
  12662. return this.goto(this.parseMultiStringContent);
  12663. }
  12664. }
  12665. parseMultiStringContent() {
  12666. do {
  12667. if (this.char === CHAR_BSOL) {
  12668. return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement);
  12669. } else if (this.char === CHAR_QUOT) {
  12670. return this.next(this.parseMultiEnd);
  12671. } else if (this.char === Parser.END) {
  12672. throw this.error(new TomlError("Unterminated multi-line string"));
  12673. } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
  12674. throw this.errorControlCharInString();
  12675. } else {
  12676. this.consume();
  12677. }
  12678. } while (this.nextChar());
  12679. }
  12680. errorControlCharInString() {
  12681. let displayCode = "\\u00";
  12682. if (this.char < 16) {
  12683. displayCode += "0";
  12684. }
  12685. displayCode += this.char.toString(16);
  12686. return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${displayCode} instead`));
  12687. }
  12688. recordMultiEscapeReplacement(replacement) {
  12689. this.state.buf += replacement;
  12690. return this.goto(this.parseMultiStringContent);
  12691. }
  12692. parseMultiEnd() {
  12693. if (this.char === CHAR_QUOT) {
  12694. return this.next(this.parseMultiEnd2);
  12695. } else {
  12696. this.state.buf += '"';
  12697. return this.goto(this.parseMultiStringContent);
  12698. }
  12699. }
  12700. parseMultiEnd2() {
  12701. if (this.char === CHAR_QUOT) {
  12702. return this.return();
  12703. } else {
  12704. this.state.buf += '""';
  12705. return this.goto(this.parseMultiStringContent);
  12706. }
  12707. }
  12708. parseMultiEscape() {
  12709. if (this.char === CTRL_M || this.char === CTRL_J) {
  12710. return this.next(this.parseMultiTrim);
  12711. } else if (this.char === CHAR_SP || this.char === CTRL_I) {
  12712. return this.next(this.parsePreMultiTrim);
  12713. } else {
  12714. return this.goto(this.parseEscape);
  12715. }
  12716. }
  12717. parsePreMultiTrim() {
  12718. if (this.char === CHAR_SP || this.char === CTRL_I) {
  12719. return null;
  12720. } else if (this.char === CTRL_M || this.char === CTRL_J) {
  12721. return this.next(this.parseMultiTrim);
  12722. } else {
  12723. throw this.error(new TomlError("Can't escape whitespace"));
  12724. }
  12725. }
  12726. parseMultiTrim() {
  12727. if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
  12728. return null;
  12729. } else {
  12730. return this.returnNow();
  12731. }
  12732. }
  12733. parseEscape() {
  12734. if (this.char in escapes) {
  12735. return this.return(escapes[this.char]);
  12736. } else if (this.char === CHAR_u) {
  12737. return this.call(this.parseSmallUnicode, this.parseUnicodeReturn);
  12738. } else if (this.char === CHAR_U) {
  12739. return this.call(this.parseLargeUnicode, this.parseUnicodeReturn);
  12740. } else {
  12741. throw this.error(new TomlError("Unknown escape character: " + this.char));
  12742. }
  12743. }
  12744. parseUnicodeReturn(char) {
  12745. try {
  12746. const codePoint = parseInt(char, 16);
  12747. if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {
  12748. throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));
  12749. }
  12750. return this.returnNow(String.fromCodePoint(codePoint));
  12751. } catch (err) {
  12752. throw this.error(TomlError.wrap(err));
  12753. }
  12754. }
  12755. parseSmallUnicode() {
  12756. if (!isHexit(this.char)) {
  12757. throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
  12758. } else {
  12759. this.consume();
  12760. if (this.state.buf.length >= 4)
  12761. return this.return();
  12762. }
  12763. }
  12764. parseLargeUnicode() {
  12765. if (!isHexit(this.char)) {
  12766. throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
  12767. } else {
  12768. this.consume();
  12769. if (this.state.buf.length >= 8)
  12770. return this.return();
  12771. }
  12772. }
  12773. parseNumberSign() {
  12774. this.consume();
  12775. return this.next(this.parseMaybeSignedInfOrNan);
  12776. }
  12777. parseMaybeSignedInfOrNan() {
  12778. if (this.char === CHAR_i) {
  12779. return this.next(this.parseInf);
  12780. } else if (this.char === CHAR_n) {
  12781. return this.next(this.parseNan);
  12782. } else {
  12783. return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart);
  12784. }
  12785. }
  12786. parseNumberIntegerStart() {
  12787. if (this.char === CHAR_0) {
  12788. this.consume();
  12789. return this.next(this.parseNumberIntegerExponentOrDecimal);
  12790. } else {
  12791. return this.goto(this.parseNumberInteger);
  12792. }
  12793. }
  12794. parseNumberIntegerExponentOrDecimal() {
  12795. if (this.char === CHAR_PERIOD) {
  12796. this.consume();
  12797. return this.call(this.parseNoUnder, this.parseNumberFloat);
  12798. } else if (this.char === CHAR_E || this.char === CHAR_e) {
  12799. this.consume();
  12800. return this.next(this.parseNumberExponentSign);
  12801. } else {
  12802. return this.returnNow(Integer(this.state.buf));
  12803. }
  12804. }
  12805. parseNumberInteger() {
  12806. if (isDigit(this.char)) {
  12807. this.consume();
  12808. } else if (this.char === CHAR_LOWBAR) {
  12809. return this.call(this.parseNoUnder);
  12810. } else if (this.char === CHAR_E || this.char === CHAR_e) {
  12811. this.consume();
  12812. return this.next(this.parseNumberExponentSign);
  12813. } else if (this.char === CHAR_PERIOD) {
  12814. this.consume();
  12815. return this.call(this.parseNoUnder, this.parseNumberFloat);
  12816. } else {
  12817. const result = Integer(this.state.buf);
  12818. if (result.isNaN()) {
  12819. throw this.error(new TomlError("Invalid number"));
  12820. } else {
  12821. return this.returnNow(result);
  12822. }
  12823. }
  12824. }
  12825. parseNoUnder() {
  12826. if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {
  12827. throw this.error(new TomlError("Unexpected character, expected digit"));
  12828. } else if (this.atEndOfWord()) {
  12829. throw this.error(new TomlError("Incomplete number"));
  12830. }
  12831. return this.returnNow();
  12832. }
  12833. parseNoUnderHexOctBinLiteral() {
  12834. if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {
  12835. throw this.error(new TomlError("Unexpected character, expected digit"));
  12836. } else if (this.atEndOfWord()) {
  12837. throw this.error(new TomlError("Incomplete number"));
  12838. }
  12839. return this.returnNow();
  12840. }
  12841. parseNumberFloat() {
  12842. if (this.char === CHAR_LOWBAR) {
  12843. return this.call(this.parseNoUnder, this.parseNumberFloat);
  12844. } else if (isDigit(this.char)) {
  12845. this.consume();
  12846. } else if (this.char === CHAR_E || this.char === CHAR_e) {
  12847. this.consume();
  12848. return this.next(this.parseNumberExponentSign);
  12849. } else {
  12850. return this.returnNow(Float(this.state.buf));
  12851. }
  12852. }
  12853. parseNumberExponentSign() {
  12854. if (isDigit(this.char)) {
  12855. return this.goto(this.parseNumberExponent);
  12856. } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
  12857. this.consume();
  12858. this.call(this.parseNoUnder, this.parseNumberExponent);
  12859. } else {
  12860. throw this.error(new TomlError("Unexpected character, expected -, + or digit"));
  12861. }
  12862. }
  12863. parseNumberExponent() {
  12864. if (isDigit(this.char)) {
  12865. this.consume();
  12866. } else if (this.char === CHAR_LOWBAR) {
  12867. return this.call(this.parseNoUnder);
  12868. } else {
  12869. return this.returnNow(Float(this.state.buf));
  12870. }
  12871. }
  12872. parseNumberOrDateTime() {
  12873. if (this.char === CHAR_0) {
  12874. this.consume();
  12875. return this.next(this.parseNumberBaseOrDateTime);
  12876. } else {
  12877. return this.goto(this.parseNumberOrDateTimeOnly);
  12878. }
  12879. }
  12880. parseNumberOrDateTimeOnly() {
  12881. if (this.char === CHAR_LOWBAR) {
  12882. return this.call(this.parseNoUnder, this.parseNumberInteger);
  12883. } else if (isDigit(this.char)) {
  12884. this.consume();
  12885. if (this.state.buf.length > 4)
  12886. this.next(this.parseNumberInteger);
  12887. } else if (this.char === CHAR_E || this.char === CHAR_e) {
  12888. this.consume();
  12889. return this.next(this.parseNumberExponentSign);
  12890. } else if (this.char === CHAR_PERIOD) {
  12891. this.consume();
  12892. return this.call(this.parseNoUnder, this.parseNumberFloat);
  12893. } else if (this.char === CHAR_HYPHEN) {
  12894. return this.goto(this.parseDateTime);
  12895. } else if (this.char === CHAR_COLON) {
  12896. return this.goto(this.parseOnlyTimeHour);
  12897. } else {
  12898. return this.returnNow(Integer(this.state.buf));
  12899. }
  12900. }
  12901. parseDateTimeOnly() {
  12902. if (this.state.buf.length < 4) {
  12903. if (isDigit(this.char)) {
  12904. return this.consume();
  12905. } else if (this.char === CHAR_COLON) {
  12906. return this.goto(this.parseOnlyTimeHour);
  12907. } else {
  12908. throw this.error(new TomlError("Expected digit while parsing year part of a date"));
  12909. }
  12910. } else {
  12911. if (this.char === CHAR_HYPHEN) {
  12912. return this.goto(this.parseDateTime);
  12913. } else {
  12914. throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"));
  12915. }
  12916. }
  12917. }
  12918. parseNumberBaseOrDateTime() {
  12919. if (this.char === CHAR_b) {
  12920. this.consume();
  12921. return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin);
  12922. } else if (this.char === CHAR_o) {
  12923. this.consume();
  12924. return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct);
  12925. } else if (this.char === CHAR_x) {
  12926. this.consume();
  12927. return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex);
  12928. } else if (this.char === CHAR_PERIOD) {
  12929. return this.goto(this.parseNumberInteger);
  12930. } else if (isDigit(this.char)) {
  12931. return this.goto(this.parseDateTimeOnly);
  12932. } else {
  12933. return this.returnNow(Integer(this.state.buf));
  12934. }
  12935. }
  12936. parseIntegerHex() {
  12937. if (isHexit(this.char)) {
  12938. this.consume();
  12939. } else if (this.char === CHAR_LOWBAR) {
  12940. return this.call(this.parseNoUnderHexOctBinLiteral);
  12941. } else {
  12942. const result = Integer(this.state.buf);
  12943. if (result.isNaN()) {
  12944. throw this.error(new TomlError("Invalid number"));
  12945. } else {
  12946. return this.returnNow(result);
  12947. }
  12948. }
  12949. }
  12950. parseIntegerOct() {
  12951. if (isOctit(this.char)) {
  12952. this.consume();
  12953. } else if (this.char === CHAR_LOWBAR) {
  12954. return this.call(this.parseNoUnderHexOctBinLiteral);
  12955. } else {
  12956. const result = Integer(this.state.buf);
  12957. if (result.isNaN()) {
  12958. throw this.error(new TomlError("Invalid number"));
  12959. } else {
  12960. return this.returnNow(result);
  12961. }
  12962. }
  12963. }
  12964. parseIntegerBin() {
  12965. if (isBit(this.char)) {
  12966. this.consume();
  12967. } else if (this.char === CHAR_LOWBAR) {
  12968. return this.call(this.parseNoUnderHexOctBinLiteral);
  12969. } else {
  12970. const result = Integer(this.state.buf);
  12971. if (result.isNaN()) {
  12972. throw this.error(new TomlError("Invalid number"));
  12973. } else {
  12974. return this.returnNow(result);
  12975. }
  12976. }
  12977. }
  12978. parseDateTime() {
  12979. if (this.state.buf.length < 4) {
  12980. throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));
  12981. }
  12982. this.state.result = this.state.buf;
  12983. this.state.buf = "";
  12984. return this.next(this.parseDateMonth);
  12985. }
  12986. parseDateMonth() {
  12987. if (this.char === CHAR_HYPHEN) {
  12988. if (this.state.buf.length < 2) {
  12989. throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));
  12990. }
  12991. this.state.result += "-" + this.state.buf;
  12992. this.state.buf = "";
  12993. return this.next(this.parseDateDay);
  12994. } else if (isDigit(this.char)) {
  12995. this.consume();
  12996. } else {
  12997. throw this.error(new TomlError("Incomplete datetime"));
  12998. }
  12999. }
  13000. parseDateDay() {
  13001. if (this.char === CHAR_T || this.char === CHAR_SP) {
  13002. if (this.state.buf.length < 2) {
  13003. throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));
  13004. }
  13005. this.state.result += "-" + this.state.buf;
  13006. this.state.buf = "";
  13007. return this.next(this.parseStartTimeHour);
  13008. } else if (this.atEndOfWord()) {
  13009. return this.returnNow(createDate(this.state.result + "-" + this.state.buf));
  13010. } else if (isDigit(this.char)) {
  13011. this.consume();
  13012. } else {
  13013. throw this.error(new TomlError("Incomplete datetime"));
  13014. }
  13015. }
  13016. parseStartTimeHour() {
  13017. if (this.atEndOfWord()) {
  13018. return this.returnNow(createDate(this.state.result));
  13019. } else {
  13020. return this.goto(this.parseTimeHour);
  13021. }
  13022. }
  13023. parseTimeHour() {
  13024. if (this.char === CHAR_COLON) {
  13025. if (this.state.buf.length < 2) {
  13026. throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
  13027. }
  13028. this.state.result += "T" + this.state.buf;
  13029. this.state.buf = "";
  13030. return this.next(this.parseTimeMin);
  13031. } else if (isDigit(this.char)) {
  13032. this.consume();
  13033. } else {
  13034. throw this.error(new TomlError("Incomplete datetime"));
  13035. }
  13036. }
  13037. parseTimeMin() {
  13038. if (this.state.buf.length < 2 && isDigit(this.char)) {
  13039. this.consume();
  13040. } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
  13041. this.state.result += ":" + this.state.buf;
  13042. this.state.buf = "";
  13043. return this.next(this.parseTimeSec);
  13044. } else {
  13045. throw this.error(new TomlError("Incomplete datetime"));
  13046. }
  13047. }
  13048. parseTimeSec() {
  13049. if (isDigit(this.char)) {
  13050. this.consume();
  13051. if (this.state.buf.length === 2) {
  13052. this.state.result += ":" + this.state.buf;
  13053. this.state.buf = "";
  13054. return this.next(this.parseTimeZoneOrFraction);
  13055. }
  13056. } else {
  13057. throw this.error(new TomlError("Incomplete datetime"));
  13058. }
  13059. }
  13060. parseOnlyTimeHour() {
  13061. if (this.char === CHAR_COLON) {
  13062. if (this.state.buf.length < 2) {
  13063. throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
  13064. }
  13065. this.state.result = this.state.buf;
  13066. this.state.buf = "";
  13067. return this.next(this.parseOnlyTimeMin);
  13068. } else {
  13069. throw this.error(new TomlError("Incomplete time"));
  13070. }
  13071. }
  13072. parseOnlyTimeMin() {
  13073. if (this.state.buf.length < 2 && isDigit(this.char)) {
  13074. this.consume();
  13075. } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
  13076. this.state.result += ":" + this.state.buf;
  13077. this.state.buf = "";
  13078. return this.next(this.parseOnlyTimeSec);
  13079. } else {
  13080. throw this.error(new TomlError("Incomplete time"));
  13081. }
  13082. }
  13083. parseOnlyTimeSec() {
  13084. if (isDigit(this.char)) {
  13085. this.consume();
  13086. if (this.state.buf.length === 2) {
  13087. return this.next(this.parseOnlyTimeFractionMaybe);
  13088. }
  13089. } else {
  13090. throw this.error(new TomlError("Incomplete time"));
  13091. }
  13092. }
  13093. parseOnlyTimeFractionMaybe() {
  13094. this.state.result += ":" + this.state.buf;
  13095. if (this.char === CHAR_PERIOD) {
  13096. this.state.buf = "";
  13097. this.next(this.parseOnlyTimeFraction);
  13098. } else {
  13099. return this.return(createTime(this.state.result));
  13100. }
  13101. }
  13102. parseOnlyTimeFraction() {
  13103. if (isDigit(this.char)) {
  13104. this.consume();
  13105. } else if (this.atEndOfWord()) {
  13106. if (this.state.buf.length === 0)
  13107. throw this.error(new TomlError("Expected digit in milliseconds"));
  13108. return this.returnNow(createTime(this.state.result + "." + this.state.buf));
  13109. } else {
  13110. throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
  13111. }
  13112. }
  13113. parseTimeZoneOrFraction() {
  13114. if (this.char === CHAR_PERIOD) {
  13115. this.consume();
  13116. this.next(this.parseDateTimeFraction);
  13117. } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
  13118. this.consume();
  13119. this.next(this.parseTimeZoneHour);
  13120. } else if (this.char === CHAR_Z) {
  13121. this.consume();
  13122. return this.return(createDateTime(this.state.result + this.state.buf));
  13123. } else if (this.atEndOfWord()) {
  13124. return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
  13125. } else {
  13126. throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
  13127. }
  13128. }
  13129. parseDateTimeFraction() {
  13130. if (isDigit(this.char)) {
  13131. this.consume();
  13132. } else if (this.state.buf.length === 1) {
  13133. throw this.error(new TomlError("Expected digit in milliseconds"));
  13134. } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
  13135. this.consume();
  13136. this.next(this.parseTimeZoneHour);
  13137. } else if (this.char === CHAR_Z) {
  13138. this.consume();
  13139. return this.return(createDateTime(this.state.result + this.state.buf));
  13140. } else if (this.atEndOfWord()) {
  13141. return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
  13142. } else {
  13143. throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
  13144. }
  13145. }
  13146. parseTimeZoneHour() {
  13147. if (isDigit(this.char)) {
  13148. this.consume();
  13149. if (/\d\d$/.test(this.state.buf))
  13150. return this.next(this.parseTimeZoneSep);
  13151. } else {
  13152. throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
  13153. }
  13154. }
  13155. parseTimeZoneSep() {
  13156. if (this.char === CHAR_COLON) {
  13157. this.consume();
  13158. this.next(this.parseTimeZoneMin);
  13159. } else {
  13160. throw this.error(new TomlError("Unexpected character in datetime, expected colon"));
  13161. }
  13162. }
  13163. parseTimeZoneMin() {
  13164. if (isDigit(this.char)) {
  13165. this.consume();
  13166. if (/\d\d$/.test(this.state.buf))
  13167. return this.return(createDateTime(this.state.result + this.state.buf));
  13168. } else {
  13169. throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
  13170. }
  13171. }
  13172. parseBoolean() {
  13173. if (this.char === CHAR_t) {
  13174. this.consume();
  13175. return this.next(this.parseTrue_r);
  13176. } else if (this.char === CHAR_f) {
  13177. this.consume();
  13178. return this.next(this.parseFalse_a);
  13179. }
  13180. }
  13181. parseTrue_r() {
  13182. if (this.char === CHAR_r) {
  13183. this.consume();
  13184. return this.next(this.parseTrue_u);
  13185. } else {
  13186. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13187. }
  13188. }
  13189. parseTrue_u() {
  13190. if (this.char === CHAR_u) {
  13191. this.consume();
  13192. return this.next(this.parseTrue_e);
  13193. } else {
  13194. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13195. }
  13196. }
  13197. parseTrue_e() {
  13198. if (this.char === CHAR_e) {
  13199. return this.return(true);
  13200. } else {
  13201. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13202. }
  13203. }
  13204. parseFalse_a() {
  13205. if (this.char === CHAR_a) {
  13206. this.consume();
  13207. return this.next(this.parseFalse_l);
  13208. } else {
  13209. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13210. }
  13211. }
  13212. parseFalse_l() {
  13213. if (this.char === CHAR_l) {
  13214. this.consume();
  13215. return this.next(this.parseFalse_s);
  13216. } else {
  13217. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13218. }
  13219. }
  13220. parseFalse_s() {
  13221. if (this.char === CHAR_s) {
  13222. this.consume();
  13223. return this.next(this.parseFalse_e);
  13224. } else {
  13225. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13226. }
  13227. }
  13228. parseFalse_e() {
  13229. if (this.char === CHAR_e) {
  13230. return this.return(false);
  13231. } else {
  13232. throw this.error(new TomlError("Invalid boolean, expected true or false"));
  13233. }
  13234. }
  13235. parseInlineList() {
  13236. if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
  13237. return null;
  13238. } else if (this.char === Parser.END) {
  13239. throw this.error(new TomlError("Unterminated inline array"));
  13240. } else if (this.char === CHAR_NUM) {
  13241. return this.call(this.parseComment);
  13242. } else if (this.char === CHAR_RSQB) {
  13243. return this.return(this.state.resultArr || InlineList());
  13244. } else {
  13245. return this.callNow(this.parseValue, this.recordInlineListValue);
  13246. }
  13247. }
  13248. recordInlineListValue(value) {
  13249. if (this.state.resultArr) {
  13250. const listType = this.state.resultArr[_contentType];
  13251. const valueType = tomlType(value);
  13252. if (listType !== valueType) {
  13253. throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${listType} and ${valueType}`));
  13254. }
  13255. } else {
  13256. this.state.resultArr = InlineList(tomlType(value));
  13257. }
  13258. if (isFloat(value) || isInteger(value)) {
  13259. this.state.resultArr.push(value.valueOf());
  13260. } else {
  13261. this.state.resultArr.push(value);
  13262. }
  13263. return this.goto(this.parseInlineListNext);
  13264. }
  13265. parseInlineListNext() {
  13266. if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
  13267. return null;
  13268. } else if (this.char === CHAR_NUM) {
  13269. return this.call(this.parseComment);
  13270. } else if (this.char === CHAR_COMMA) {
  13271. return this.next(this.parseInlineList);
  13272. } else if (this.char === CHAR_RSQB) {
  13273. return this.goto(this.parseInlineList);
  13274. } else {
  13275. throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
  13276. }
  13277. }
  13278. parseInlineTable() {
  13279. if (this.char === CHAR_SP || this.char === CTRL_I) {
  13280. return null;
  13281. } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
  13282. throw this.error(new TomlError("Unterminated inline array"));
  13283. } else if (this.char === CHAR_RCUB) {
  13284. return this.return(this.state.resultTable || InlineTable());
  13285. } else {
  13286. if (!this.state.resultTable)
  13287. this.state.resultTable = InlineTable();
  13288. return this.callNow(this.parseAssign, this.recordInlineTableValue);
  13289. }
  13290. }
  13291. recordInlineTableValue(kv) {
  13292. let target = this.state.resultTable;
  13293. let finalKey = kv.key.pop();
  13294. for (let kw of kv.key) {
  13295. if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
  13296. throw this.error(new TomlError("Can't redefine existing key"));
  13297. }
  13298. target = target[kw] = target[kw] || Table();
  13299. }
  13300. if (hasKey(target, finalKey)) {
  13301. throw this.error(new TomlError("Can't redefine existing key"));
  13302. }
  13303. if (isInteger(kv.value) || isFloat(kv.value)) {
  13304. target[finalKey] = kv.value.valueOf();
  13305. } else {
  13306. target[finalKey] = kv.value;
  13307. }
  13308. return this.goto(this.parseInlineTableNext);
  13309. }
  13310. parseInlineTableNext() {
  13311. if (this.char === CHAR_SP || this.char === CTRL_I) {
  13312. return null;
  13313. } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
  13314. throw this.error(new TomlError("Unterminated inline array"));
  13315. } else if (this.char === CHAR_COMMA) {
  13316. return this.next(this.parseInlineTable);
  13317. } else if (this.char === CHAR_RCUB) {
  13318. return this.goto(this.parseInlineTable);
  13319. } else {
  13320. throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
  13321. }
  13322. }
  13323. }
  13324. return TOMLParser;
  13325. }
  13326. }
  13327. });
  13328. var require_parse_pretty_error = __commonJS2({
  13329. "node_modules/@iarna/toml/parse-pretty-error.js"(exports2, module2) {
  13330. "use strict";
  13331. module2.exports = prettyError;
  13332. function prettyError(err, buf) {
  13333. if (err.pos == null || err.line == null)
  13334. return err;
  13335. let msg = err.message;
  13336. msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:
  13337. `;
  13338. if (buf && buf.split) {
  13339. const lines = buf.split(/\n/);
  13340. const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length;
  13341. let linePadding = " ";
  13342. while (linePadding.length < lineNumWidth)
  13343. linePadding += " ";
  13344. for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
  13345. let lineNum = String(ii + 1);
  13346. if (lineNum.length < lineNumWidth)
  13347. lineNum = " " + lineNum;
  13348. if (err.line === ii) {
  13349. msg += lineNum + "> " + lines[ii] + "\n";
  13350. msg += linePadding + " ";
  13351. for (let hh = 0; hh < err.col; ++hh) {
  13352. msg += " ";
  13353. }
  13354. msg += "^\n";
  13355. } else {
  13356. msg += lineNum + ": " + lines[ii] + "\n";
  13357. }
  13358. }
  13359. }
  13360. err.message = msg + "\n";
  13361. return err;
  13362. }
  13363. }
  13364. });
  13365. var require_parse_string = __commonJS2({
  13366. "node_modules/@iarna/toml/parse-string.js"(exports2, module2) {
  13367. "use strict";
  13368. module2.exports = parseString;
  13369. var TOMLParser = require_toml_parser();
  13370. var prettyError = require_parse_pretty_error();
  13371. function parseString(str) {
  13372. if (global.Buffer && global.Buffer.isBuffer(str)) {
  13373. str = str.toString("utf8");
  13374. }
  13375. const parser = new TOMLParser();
  13376. try {
  13377. parser.parse(str);
  13378. return parser.finish();
  13379. } catch (err) {
  13380. throw prettyError(err, str);
  13381. }
  13382. }
  13383. }
  13384. });
  13385. var require_load_toml = __commonJS2({
  13386. "src/utils/load-toml.js"(exports2, module2) {
  13387. "use strict";
  13388. var parse = require_parse_string();
  13389. module2.exports = function(filePath, content) {
  13390. try {
  13391. return parse(content);
  13392. } catch (error) {
  13393. error.message = `TOML Error in ${filePath}:
  13394. ${error.message}`;
  13395. throw error;
  13396. }
  13397. };
  13398. }
  13399. });
  13400. var require_unicode = __commonJS2({
  13401. "node_modules/json5/lib/unicode.js"(exports2, module2) {
  13402. module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
  13403. module2.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
  13404. module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
  13405. }
  13406. });
  13407. var require_util2 = __commonJS2({
  13408. "node_modules/json5/lib/util.js"(exports2, module2) {
  13409. var unicode = require_unicode();
  13410. module2.exports = {
  13411. isSpaceSeparator(c) {
  13412. return typeof c === "string" && unicode.Space_Separator.test(c);
  13413. },
  13414. isIdStartChar(c) {
  13415. return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
  13416. },
  13417. isIdContinueChar(c) {
  13418. return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
  13419. },
  13420. isDigit(c) {
  13421. return typeof c === "string" && /[0-9]/.test(c);
  13422. },
  13423. isHexDigit(c) {
  13424. return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
  13425. }
  13426. };
  13427. }
  13428. });
  13429. var require_parse3 = __commonJS2({
  13430. "node_modules/json5/lib/parse.js"(exports2, module2) {
  13431. var util = require_util2();
  13432. var source;
  13433. var parseState;
  13434. var stack;
  13435. var pos;
  13436. var line;
  13437. var column;
  13438. var token;
  13439. var key;
  13440. var root;
  13441. module2.exports = function parse(text, reviver) {
  13442. source = String(text);
  13443. parseState = "start";
  13444. stack = [];
  13445. pos = 0;
  13446. line = 1;
  13447. column = 0;
  13448. token = void 0;
  13449. key = void 0;
  13450. root = void 0;
  13451. do {
  13452. token = lex();
  13453. parseStates[parseState]();
  13454. } while (token.type !== "eof");
  13455. if (typeof reviver === "function") {
  13456. return internalize({
  13457. "": root
  13458. }, "", reviver);
  13459. }
  13460. return root;
  13461. };
  13462. function internalize(holder, name, reviver) {
  13463. const value = holder[name];
  13464. if (value != null && typeof value === "object") {
  13465. for (const key2 in value) {
  13466. const replacement = internalize(value, key2, reviver);
  13467. if (replacement === void 0) {
  13468. delete value[key2];
  13469. } else {
  13470. value[key2] = replacement;
  13471. }
  13472. }
  13473. }
  13474. return reviver.call(holder, name, value);
  13475. }
  13476. var lexState;
  13477. var buffer;
  13478. var doubleQuote;
  13479. var sign;
  13480. var c;
  13481. function lex() {
  13482. lexState = "default";
  13483. buffer = "";
  13484. doubleQuote = false;
  13485. sign = 1;
  13486. for (; ; ) {
  13487. c = peek();
  13488. const token2 = lexStates[lexState]();
  13489. if (token2) {
  13490. return token2;
  13491. }
  13492. }
  13493. }
  13494. function peek() {
  13495. if (source[pos]) {
  13496. return String.fromCodePoint(source.codePointAt(pos));
  13497. }
  13498. }
  13499. function read() {
  13500. const c2 = peek();
  13501. if (c2 === "\n") {
  13502. line++;
  13503. column = 0;
  13504. } else if (c2) {
  13505. column += c2.length;
  13506. } else {
  13507. column++;
  13508. }
  13509. if (c2) {
  13510. pos += c2.length;
  13511. }
  13512. return c2;
  13513. }
  13514. var lexStates = {
  13515. default() {
  13516. switch (c) {
  13517. case " ":
  13518. case "\v":
  13519. case "\f":
  13520. case " ":
  13521. case "\xA0":
  13522. case "\uFEFF":
  13523. case "\n":
  13524. case "\r":
  13525. case "\u2028":
  13526. case "\u2029":
  13527. read();
  13528. return;
  13529. case "/":
  13530. read();
  13531. lexState = "comment";
  13532. return;
  13533. case void 0:
  13534. read();
  13535. return newToken("eof");
  13536. }
  13537. if (util.isSpaceSeparator(c)) {
  13538. read();
  13539. return;
  13540. }
  13541. return lexStates[parseState]();
  13542. },
  13543. comment() {
  13544. switch (c) {
  13545. case "*":
  13546. read();
  13547. lexState = "multiLineComment";
  13548. return;
  13549. case "/":
  13550. read();
  13551. lexState = "singleLineComment";
  13552. return;
  13553. }
  13554. throw invalidChar(read());
  13555. },
  13556. multiLineComment() {
  13557. switch (c) {
  13558. case "*":
  13559. read();
  13560. lexState = "multiLineCommentAsterisk";
  13561. return;
  13562. case void 0:
  13563. throw invalidChar(read());
  13564. }
  13565. read();
  13566. },
  13567. multiLineCommentAsterisk() {
  13568. switch (c) {
  13569. case "*":
  13570. read();
  13571. return;
  13572. case "/":
  13573. read();
  13574. lexState = "default";
  13575. return;
  13576. case void 0:
  13577. throw invalidChar(read());
  13578. }
  13579. read();
  13580. lexState = "multiLineComment";
  13581. },
  13582. singleLineComment() {
  13583. switch (c) {
  13584. case "\n":
  13585. case "\r":
  13586. case "\u2028":
  13587. case "\u2029":
  13588. read();
  13589. lexState = "default";
  13590. return;
  13591. case void 0:
  13592. read();
  13593. return newToken("eof");
  13594. }
  13595. read();
  13596. },
  13597. value() {
  13598. switch (c) {
  13599. case "{":
  13600. case "[":
  13601. return newToken("punctuator", read());
  13602. case "n":
  13603. read();
  13604. literal("ull");
  13605. return newToken("null", null);
  13606. case "t":
  13607. read();
  13608. literal("rue");
  13609. return newToken("boolean", true);
  13610. case "f":
  13611. read();
  13612. literal("alse");
  13613. return newToken("boolean", false);
  13614. case "-":
  13615. case "+":
  13616. if (read() === "-") {
  13617. sign = -1;
  13618. }
  13619. lexState = "sign";
  13620. return;
  13621. case ".":
  13622. buffer = read();
  13623. lexState = "decimalPointLeading";
  13624. return;
  13625. case "0":
  13626. buffer = read();
  13627. lexState = "zero";
  13628. return;
  13629. case "1":
  13630. case "2":
  13631. case "3":
  13632. case "4":
  13633. case "5":
  13634. case "6":
  13635. case "7":
  13636. case "8":
  13637. case "9":
  13638. buffer = read();
  13639. lexState = "decimalInteger";
  13640. return;
  13641. case "I":
  13642. read();
  13643. literal("nfinity");
  13644. return newToken("numeric", Infinity);
  13645. case "N":
  13646. read();
  13647. literal("aN");
  13648. return newToken("numeric", NaN);
  13649. case '"':
  13650. case "'":
  13651. doubleQuote = read() === '"';
  13652. buffer = "";
  13653. lexState = "string";
  13654. return;
  13655. }
  13656. throw invalidChar(read());
  13657. },
  13658. identifierNameStartEscape() {
  13659. if (c !== "u") {
  13660. throw invalidChar(read());
  13661. }
  13662. read();
  13663. const u = unicodeEscape();
  13664. switch (u) {
  13665. case "$":
  13666. case "_":
  13667. break;
  13668. default:
  13669. if (!util.isIdStartChar(u)) {
  13670. throw invalidIdentifier();
  13671. }
  13672. break;
  13673. }
  13674. buffer += u;
  13675. lexState = "identifierName";
  13676. },
  13677. identifierName() {
  13678. switch (c) {
  13679. case "$":
  13680. case "_":
  13681. case "\u200C":
  13682. case "\u200D":
  13683. buffer += read();
  13684. return;
  13685. case "\\":
  13686. read();
  13687. lexState = "identifierNameEscape";
  13688. return;
  13689. }
  13690. if (util.isIdContinueChar(c)) {
  13691. buffer += read();
  13692. return;
  13693. }
  13694. return newToken("identifier", buffer);
  13695. },
  13696. identifierNameEscape() {
  13697. if (c !== "u") {
  13698. throw invalidChar(read());
  13699. }
  13700. read();
  13701. const u = unicodeEscape();
  13702. switch (u) {
  13703. case "$":
  13704. case "_":
  13705. case "\u200C":
  13706. case "\u200D":
  13707. break;
  13708. default:
  13709. if (!util.isIdContinueChar(u)) {
  13710. throw invalidIdentifier();
  13711. }
  13712. break;
  13713. }
  13714. buffer += u;
  13715. lexState = "identifierName";
  13716. },
  13717. sign() {
  13718. switch (c) {
  13719. case ".":
  13720. buffer = read();
  13721. lexState = "decimalPointLeading";
  13722. return;
  13723. case "0":
  13724. buffer = read();
  13725. lexState = "zero";
  13726. return;
  13727. case "1":
  13728. case "2":
  13729. case "3":
  13730. case "4":
  13731. case "5":
  13732. case "6":
  13733. case "7":
  13734. case "8":
  13735. case "9":
  13736. buffer = read();
  13737. lexState = "decimalInteger";
  13738. return;
  13739. case "I":
  13740. read();
  13741. literal("nfinity");
  13742. return newToken("numeric", sign * Infinity);
  13743. case "N":
  13744. read();
  13745. literal("aN");
  13746. return newToken("numeric", NaN);
  13747. }
  13748. throw invalidChar(read());
  13749. },
  13750. zero() {
  13751. switch (c) {
  13752. case ".":
  13753. buffer += read();
  13754. lexState = "decimalPoint";
  13755. return;
  13756. case "e":
  13757. case "E":
  13758. buffer += read();
  13759. lexState = "decimalExponent";
  13760. return;
  13761. case "x":
  13762. case "X":
  13763. buffer += read();
  13764. lexState = "hexadecimal";
  13765. return;
  13766. }
  13767. return newToken("numeric", sign * 0);
  13768. },
  13769. decimalInteger() {
  13770. switch (c) {
  13771. case ".":
  13772. buffer += read();
  13773. lexState = "decimalPoint";
  13774. return;
  13775. case "e":
  13776. case "E":
  13777. buffer += read();
  13778. lexState = "decimalExponent";
  13779. return;
  13780. }
  13781. if (util.isDigit(c)) {
  13782. buffer += read();
  13783. return;
  13784. }
  13785. return newToken("numeric", sign * Number(buffer));
  13786. },
  13787. decimalPointLeading() {
  13788. if (util.isDigit(c)) {
  13789. buffer += read();
  13790. lexState = "decimalFraction";
  13791. return;
  13792. }
  13793. throw invalidChar(read());
  13794. },
  13795. decimalPoint() {
  13796. switch (c) {
  13797. case "e":
  13798. case "E":
  13799. buffer += read();
  13800. lexState = "decimalExponent";
  13801. return;
  13802. }
  13803. if (util.isDigit(c)) {
  13804. buffer += read();
  13805. lexState = "decimalFraction";
  13806. return;
  13807. }
  13808. return newToken("numeric", sign * Number(buffer));
  13809. },
  13810. decimalFraction() {
  13811. switch (c) {
  13812. case "e":
  13813. case "E":
  13814. buffer += read();
  13815. lexState = "decimalExponent";
  13816. return;
  13817. }
  13818. if (util.isDigit(c)) {
  13819. buffer += read();
  13820. return;
  13821. }
  13822. return newToken("numeric", sign * Number(buffer));
  13823. },
  13824. decimalExponent() {
  13825. switch (c) {
  13826. case "+":
  13827. case "-":
  13828. buffer += read();
  13829. lexState = "decimalExponentSign";
  13830. return;
  13831. }
  13832. if (util.isDigit(c)) {
  13833. buffer += read();
  13834. lexState = "decimalExponentInteger";
  13835. return;
  13836. }
  13837. throw invalidChar(read());
  13838. },
  13839. decimalExponentSign() {
  13840. if (util.isDigit(c)) {
  13841. buffer += read();
  13842. lexState = "decimalExponentInteger";
  13843. return;
  13844. }
  13845. throw invalidChar(read());
  13846. },
  13847. decimalExponentInteger() {
  13848. if (util.isDigit(c)) {
  13849. buffer += read();
  13850. return;
  13851. }
  13852. return newToken("numeric", sign * Number(buffer));
  13853. },
  13854. hexadecimal() {
  13855. if (util.isHexDigit(c)) {
  13856. buffer += read();
  13857. lexState = "hexadecimalInteger";
  13858. return;
  13859. }
  13860. throw invalidChar(read());
  13861. },
  13862. hexadecimalInteger() {
  13863. if (util.isHexDigit(c)) {
  13864. buffer += read();
  13865. return;
  13866. }
  13867. return newToken("numeric", sign * Number(buffer));
  13868. },
  13869. string() {
  13870. switch (c) {
  13871. case "\\":
  13872. read();
  13873. buffer += escape();
  13874. return;
  13875. case '"':
  13876. if (doubleQuote) {
  13877. read();
  13878. return newToken("string", buffer);
  13879. }
  13880. buffer += read();
  13881. return;
  13882. case "'":
  13883. if (!doubleQuote) {
  13884. read();
  13885. return newToken("string", buffer);
  13886. }
  13887. buffer += read();
  13888. return;
  13889. case "\n":
  13890. case "\r":
  13891. throw invalidChar(read());
  13892. case "\u2028":
  13893. case "\u2029":
  13894. separatorChar(c);
  13895. break;
  13896. case void 0:
  13897. throw invalidChar(read());
  13898. }
  13899. buffer += read();
  13900. },
  13901. start() {
  13902. switch (c) {
  13903. case "{":
  13904. case "[":
  13905. return newToken("punctuator", read());
  13906. }
  13907. lexState = "value";
  13908. },
  13909. beforePropertyName() {
  13910. switch (c) {
  13911. case "$":
  13912. case "_":
  13913. buffer = read();
  13914. lexState = "identifierName";
  13915. return;
  13916. case "\\":
  13917. read();
  13918. lexState = "identifierNameStartEscape";
  13919. return;
  13920. case "}":
  13921. return newToken("punctuator", read());
  13922. case '"':
  13923. case "'":
  13924. doubleQuote = read() === '"';
  13925. lexState = "string";
  13926. return;
  13927. }
  13928. if (util.isIdStartChar(c)) {
  13929. buffer += read();
  13930. lexState = "identifierName";
  13931. return;
  13932. }
  13933. throw invalidChar(read());
  13934. },
  13935. afterPropertyName() {
  13936. if (c === ":") {
  13937. return newToken("punctuator", read());
  13938. }
  13939. throw invalidChar(read());
  13940. },
  13941. beforePropertyValue() {
  13942. lexState = "value";
  13943. },
  13944. afterPropertyValue() {
  13945. switch (c) {
  13946. case ",":
  13947. case "}":
  13948. return newToken("punctuator", read());
  13949. }
  13950. throw invalidChar(read());
  13951. },
  13952. beforeArrayValue() {
  13953. if (c === "]") {
  13954. return newToken("punctuator", read());
  13955. }
  13956. lexState = "value";
  13957. },
  13958. afterArrayValue() {
  13959. switch (c) {
  13960. case ",":
  13961. case "]":
  13962. return newToken("punctuator", read());
  13963. }
  13964. throw invalidChar(read());
  13965. },
  13966. end() {
  13967. throw invalidChar(read());
  13968. }
  13969. };
  13970. function newToken(type, value) {
  13971. return {
  13972. type,
  13973. value,
  13974. line,
  13975. column
  13976. };
  13977. }
  13978. function literal(s) {
  13979. for (const c2 of s) {
  13980. const p = peek();
  13981. if (p !== c2) {
  13982. throw invalidChar(read());
  13983. }
  13984. read();
  13985. }
  13986. }
  13987. function escape() {
  13988. const c2 = peek();
  13989. switch (c2) {
  13990. case "b":
  13991. read();
  13992. return "\b";
  13993. case "f":
  13994. read();
  13995. return "\f";
  13996. case "n":
  13997. read();
  13998. return "\n";
  13999. case "r":
  14000. read();
  14001. return "\r";
  14002. case "t":
  14003. read();
  14004. return " ";
  14005. case "v":
  14006. read();
  14007. return "\v";
  14008. case "0":
  14009. read();
  14010. if (util.isDigit(peek())) {
  14011. throw invalidChar(read());
  14012. }
  14013. return "\0";
  14014. case "x":
  14015. read();
  14016. return hexEscape();
  14017. case "u":
  14018. read();
  14019. return unicodeEscape();
  14020. case "\n":
  14021. case "\u2028":
  14022. case "\u2029":
  14023. read();
  14024. return "";
  14025. case "\r":
  14026. read();
  14027. if (peek() === "\n") {
  14028. read();
  14029. }
  14030. return "";
  14031. case "1":
  14032. case "2":
  14033. case "3":
  14034. case "4":
  14035. case "5":
  14036. case "6":
  14037. case "7":
  14038. case "8":
  14039. case "9":
  14040. throw invalidChar(read());
  14041. case void 0:
  14042. throw invalidChar(read());
  14043. }
  14044. return read();
  14045. }
  14046. function hexEscape() {
  14047. let buffer2 = "";
  14048. let c2 = peek();
  14049. if (!util.isHexDigit(c2)) {
  14050. throw invalidChar(read());
  14051. }
  14052. buffer2 += read();
  14053. c2 = peek();
  14054. if (!util.isHexDigit(c2)) {
  14055. throw invalidChar(read());
  14056. }
  14057. buffer2 += read();
  14058. return String.fromCodePoint(parseInt(buffer2, 16));
  14059. }
  14060. function unicodeEscape() {
  14061. let buffer2 = "";
  14062. let count = 4;
  14063. while (count-- > 0) {
  14064. const c2 = peek();
  14065. if (!util.isHexDigit(c2)) {
  14066. throw invalidChar(read());
  14067. }
  14068. buffer2 += read();
  14069. }
  14070. return String.fromCodePoint(parseInt(buffer2, 16));
  14071. }
  14072. var parseStates = {
  14073. start() {
  14074. if (token.type === "eof") {
  14075. throw invalidEOF();
  14076. }
  14077. push();
  14078. },
  14079. beforePropertyName() {
  14080. switch (token.type) {
  14081. case "identifier":
  14082. case "string":
  14083. key = token.value;
  14084. parseState = "afterPropertyName";
  14085. return;
  14086. case "punctuator":
  14087. pop();
  14088. return;
  14089. case "eof":
  14090. throw invalidEOF();
  14091. }
  14092. },
  14093. afterPropertyName() {
  14094. if (token.type === "eof") {
  14095. throw invalidEOF();
  14096. }
  14097. parseState = "beforePropertyValue";
  14098. },
  14099. beforePropertyValue() {
  14100. if (token.type === "eof") {
  14101. throw invalidEOF();
  14102. }
  14103. push();
  14104. },
  14105. beforeArrayValue() {
  14106. if (token.type === "eof") {
  14107. throw invalidEOF();
  14108. }
  14109. if (token.type === "punctuator" && token.value === "]") {
  14110. pop();
  14111. return;
  14112. }
  14113. push();
  14114. },
  14115. afterPropertyValue() {
  14116. if (token.type === "eof") {
  14117. throw invalidEOF();
  14118. }
  14119. switch (token.value) {
  14120. case ",":
  14121. parseState = "beforePropertyName";
  14122. return;
  14123. case "}":
  14124. pop();
  14125. }
  14126. },
  14127. afterArrayValue() {
  14128. if (token.type === "eof") {
  14129. throw invalidEOF();
  14130. }
  14131. switch (token.value) {
  14132. case ",":
  14133. parseState = "beforeArrayValue";
  14134. return;
  14135. case "]":
  14136. pop();
  14137. }
  14138. },
  14139. end() {
  14140. }
  14141. };
  14142. function push() {
  14143. let value;
  14144. switch (token.type) {
  14145. case "punctuator":
  14146. switch (token.value) {
  14147. case "{":
  14148. value = {};
  14149. break;
  14150. case "[":
  14151. value = [];
  14152. break;
  14153. }
  14154. break;
  14155. case "null":
  14156. case "boolean":
  14157. case "numeric":
  14158. case "string":
  14159. value = token.value;
  14160. break;
  14161. }
  14162. if (root === void 0) {
  14163. root = value;
  14164. } else {
  14165. const parent = stack[stack.length - 1];
  14166. if (Array.isArray(parent)) {
  14167. parent.push(value);
  14168. } else {
  14169. parent[key] = value;
  14170. }
  14171. }
  14172. if (value !== null && typeof value === "object") {
  14173. stack.push(value);
  14174. if (Array.isArray(value)) {
  14175. parseState = "beforeArrayValue";
  14176. } else {
  14177. parseState = "beforePropertyName";
  14178. }
  14179. } else {
  14180. const current = stack[stack.length - 1];
  14181. if (current == null) {
  14182. parseState = "end";
  14183. } else if (Array.isArray(current)) {
  14184. parseState = "afterArrayValue";
  14185. } else {
  14186. parseState = "afterPropertyValue";
  14187. }
  14188. }
  14189. }
  14190. function pop() {
  14191. stack.pop();
  14192. const current = stack[stack.length - 1];
  14193. if (current == null) {
  14194. parseState = "end";
  14195. } else if (Array.isArray(current)) {
  14196. parseState = "afterArrayValue";
  14197. } else {
  14198. parseState = "afterPropertyValue";
  14199. }
  14200. }
  14201. function invalidChar(c2) {
  14202. if (c2 === void 0) {
  14203. return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
  14204. }
  14205. return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
  14206. }
  14207. function invalidEOF() {
  14208. return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
  14209. }
  14210. function invalidIdentifier() {
  14211. column -= 5;
  14212. return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
  14213. }
  14214. function separatorChar(c2) {
  14215. console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
  14216. }
  14217. function formatChar(c2) {
  14218. const replacements = {
  14219. "'": "\\'",
  14220. '"': '\\"',
  14221. "\\": "\\\\",
  14222. "\b": "\\b",
  14223. "\f": "\\f",
  14224. "\n": "\\n",
  14225. "\r": "\\r",
  14226. " ": "\\t",
  14227. "\v": "\\v",
  14228. "\0": "\\0",
  14229. "\u2028": "\\u2028",
  14230. "\u2029": "\\u2029"
  14231. };
  14232. if (replacements[c2]) {
  14233. return replacements[c2];
  14234. }
  14235. if (c2 < " ") {
  14236. const hexString = c2.charCodeAt(0).toString(16);
  14237. return "\\x" + ("00" + hexString).substring(hexString.length);
  14238. }
  14239. return c2;
  14240. }
  14241. function syntaxError(message) {
  14242. const err = new SyntaxError(message);
  14243. err.lineNumber = line;
  14244. err.columnNumber = column;
  14245. return err;
  14246. }
  14247. }
  14248. });
  14249. var require_stringify2 = __commonJS2({
  14250. "node_modules/json5/lib/stringify.js"(exports2, module2) {
  14251. var util = require_util2();
  14252. module2.exports = function stringify(value, replacer, space) {
  14253. const stack = [];
  14254. let indent = "";
  14255. let propertyList;
  14256. let replacerFunc;
  14257. let gap = "";
  14258. let quote;
  14259. if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
  14260. space = replacer.space;
  14261. quote = replacer.quote;
  14262. replacer = replacer.replacer;
  14263. }
  14264. if (typeof replacer === "function") {
  14265. replacerFunc = replacer;
  14266. } else if (Array.isArray(replacer)) {
  14267. propertyList = [];
  14268. for (const v of replacer) {
  14269. let item;
  14270. if (typeof v === "string") {
  14271. item = v;
  14272. } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
  14273. item = String(v);
  14274. }
  14275. if (item !== void 0 && propertyList.indexOf(item) < 0) {
  14276. propertyList.push(item);
  14277. }
  14278. }
  14279. }
  14280. if (space instanceof Number) {
  14281. space = Number(space);
  14282. } else if (space instanceof String) {
  14283. space = String(space);
  14284. }
  14285. if (typeof space === "number") {
  14286. if (space > 0) {
  14287. space = Math.min(10, Math.floor(space));
  14288. gap = " ".substr(0, space);
  14289. }
  14290. } else if (typeof space === "string") {
  14291. gap = space.substr(0, 10);
  14292. }
  14293. return serializeProperty("", {
  14294. "": value
  14295. });
  14296. function serializeProperty(key, holder) {
  14297. let value2 = holder[key];
  14298. if (value2 != null) {
  14299. if (typeof value2.toJSON5 === "function") {
  14300. value2 = value2.toJSON5(key);
  14301. } else if (typeof value2.toJSON === "function") {
  14302. value2 = value2.toJSON(key);
  14303. }
  14304. }
  14305. if (replacerFunc) {
  14306. value2 = replacerFunc.call(holder, key, value2);
  14307. }
  14308. if (value2 instanceof Number) {
  14309. value2 = Number(value2);
  14310. } else if (value2 instanceof String) {
  14311. value2 = String(value2);
  14312. } else if (value2 instanceof Boolean) {
  14313. value2 = value2.valueOf();
  14314. }
  14315. switch (value2) {
  14316. case null:
  14317. return "null";
  14318. case true:
  14319. return "true";
  14320. case false:
  14321. return "false";
  14322. }
  14323. if (typeof value2 === "string") {
  14324. return quoteString(value2, false);
  14325. }
  14326. if (typeof value2 === "number") {
  14327. return String(value2);
  14328. }
  14329. if (typeof value2 === "object") {
  14330. return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
  14331. }
  14332. return void 0;
  14333. }
  14334. function quoteString(value2) {
  14335. const quotes = {
  14336. "'": 0.1,
  14337. '"': 0.2
  14338. };
  14339. const replacements = {
  14340. "'": "\\'",
  14341. '"': '\\"',
  14342. "\\": "\\\\",
  14343. "\b": "\\b",
  14344. "\f": "\\f",
  14345. "\n": "\\n",
  14346. "\r": "\\r",
  14347. " ": "\\t",
  14348. "\v": "\\v",
  14349. "\0": "\\0",
  14350. "\u2028": "\\u2028",
  14351. "\u2029": "\\u2029"
  14352. };
  14353. let product = "";
  14354. for (let i = 0; i < value2.length; i++) {
  14355. const c = value2[i];
  14356. switch (c) {
  14357. case "'":
  14358. case '"':
  14359. quotes[c]++;
  14360. product += c;
  14361. continue;
  14362. case "\0":
  14363. if (util.isDigit(value2[i + 1])) {
  14364. product += "\\x00";
  14365. continue;
  14366. }
  14367. }
  14368. if (replacements[c]) {
  14369. product += replacements[c];
  14370. continue;
  14371. }
  14372. if (c < " ") {
  14373. let hexString = c.charCodeAt(0).toString(16);
  14374. product += "\\x" + ("00" + hexString).substring(hexString.length);
  14375. continue;
  14376. }
  14377. product += c;
  14378. }
  14379. const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
  14380. product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
  14381. return quoteChar + product + quoteChar;
  14382. }
  14383. function serializeObject(value2) {
  14384. if (stack.indexOf(value2) >= 0) {
  14385. throw TypeError("Converting circular structure to JSON5");
  14386. }
  14387. stack.push(value2);
  14388. let stepback = indent;
  14389. indent = indent + gap;
  14390. let keys = propertyList || Object.keys(value2);
  14391. let partial = [];
  14392. for (const key of keys) {
  14393. const propertyString = serializeProperty(key, value2);
  14394. if (propertyString !== void 0) {
  14395. let member = serializeKey(key) + ":";
  14396. if (gap !== "") {
  14397. member += " ";
  14398. }
  14399. member += propertyString;
  14400. partial.push(member);
  14401. }
  14402. }
  14403. let final;
  14404. if (partial.length === 0) {
  14405. final = "{}";
  14406. } else {
  14407. let properties;
  14408. if (gap === "") {
  14409. properties = partial.join(",");
  14410. final = "{" + properties + "}";
  14411. } else {
  14412. let separator = ",\n" + indent;
  14413. properties = partial.join(separator);
  14414. final = "{\n" + indent + properties + ",\n" + stepback + "}";
  14415. }
  14416. }
  14417. stack.pop();
  14418. indent = stepback;
  14419. return final;
  14420. }
  14421. function serializeKey(key) {
  14422. if (key.length === 0) {
  14423. return quoteString(key, true);
  14424. }
  14425. const firstChar = String.fromCodePoint(key.codePointAt(0));
  14426. if (!util.isIdStartChar(firstChar)) {
  14427. return quoteString(key, true);
  14428. }
  14429. for (let i = firstChar.length; i < key.length; i++) {
  14430. if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
  14431. return quoteString(key, true);
  14432. }
  14433. }
  14434. return key;
  14435. }
  14436. function serializeArray(value2) {
  14437. if (stack.indexOf(value2) >= 0) {
  14438. throw TypeError("Converting circular structure to JSON5");
  14439. }
  14440. stack.push(value2);
  14441. let stepback = indent;
  14442. indent = indent + gap;
  14443. let partial = [];
  14444. for (let i = 0; i < value2.length; i++) {
  14445. const propertyString = serializeProperty(String(i), value2);
  14446. partial.push(propertyString !== void 0 ? propertyString : "null");
  14447. }
  14448. let final;
  14449. if (partial.length === 0) {
  14450. final = "[]";
  14451. } else {
  14452. if (gap === "") {
  14453. let properties = partial.join(",");
  14454. final = "[" + properties + "]";
  14455. } else {
  14456. let separator = ",\n" + indent;
  14457. let properties = partial.join(separator);
  14458. final = "[\n" + indent + properties + ",\n" + stepback + "]";
  14459. }
  14460. }
  14461. stack.pop();
  14462. indent = stepback;
  14463. return final;
  14464. }
  14465. };
  14466. }
  14467. });
  14468. var require_lib6 = __commonJS2({
  14469. "node_modules/json5/lib/index.js"(exports2, module2) {
  14470. var parse = require_parse3();
  14471. var stringify = require_stringify2();
  14472. var JSON5 = {
  14473. parse,
  14474. stringify
  14475. };
  14476. module2.exports = JSON5;
  14477. }
  14478. });
  14479. var require_load_json5 = __commonJS2({
  14480. "src/utils/load-json5.js"(exports2, module2) {
  14481. "use strict";
  14482. var {
  14483. parse
  14484. } = require_lib6();
  14485. module2.exports = function(filePath, content) {
  14486. try {
  14487. return parse(content);
  14488. } catch (error) {
  14489. error.message = `JSON5 Error in ${filePath}:
  14490. ${error.message}`;
  14491. throw error;
  14492. }
  14493. };
  14494. }
  14495. });
  14496. var require_homedir = __commonJS2({
  14497. "node_modules/resolve/lib/homedir.js"(exports2, module2) {
  14498. "use strict";
  14499. var os = require("os");
  14500. module2.exports = os.homedir || function homedir() {
  14501. var home = process.env.HOME;
  14502. var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
  14503. if (process.platform === "win32") {
  14504. return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
  14505. }
  14506. if (process.platform === "darwin") {
  14507. return home || (user ? "/Users/" + user : null);
  14508. }
  14509. if (process.platform === "linux") {
  14510. return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null);
  14511. }
  14512. return home || null;
  14513. };
  14514. }
  14515. });
  14516. var require_caller = __commonJS2({
  14517. "node_modules/resolve/lib/caller.js"(exports2, module2) {
  14518. module2.exports = function() {
  14519. var origPrepareStackTrace = Error.prepareStackTrace;
  14520. Error.prepareStackTrace = function(_, stack2) {
  14521. return stack2;
  14522. };
  14523. var stack = new Error().stack;
  14524. Error.prepareStackTrace = origPrepareStackTrace;
  14525. return stack[2].getFileName();
  14526. };
  14527. }
  14528. });
  14529. var require_path_parse = __commonJS2({
  14530. "node_modules/path-parse/index.js"(exports2, module2) {
  14531. "use strict";
  14532. var isWindows = process.platform === "win32";
  14533. var splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
  14534. var win32 = {};
  14535. function win32SplitPath(filename) {
  14536. return splitWindowsRe.exec(filename).slice(1);
  14537. }
  14538. win32.parse = function(pathString) {
  14539. if (typeof pathString !== "string") {
  14540. throw new TypeError("Parameter 'pathString' must be a string, not " + typeof pathString);
  14541. }
  14542. var allParts = win32SplitPath(pathString);
  14543. if (!allParts || allParts.length !== 5) {
  14544. throw new TypeError("Invalid path '" + pathString + "'");
  14545. }
  14546. return {
  14547. root: allParts[1],
  14548. dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
  14549. base: allParts[2],
  14550. ext: allParts[4],
  14551. name: allParts[3]
  14552. };
  14553. };
  14554. var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
  14555. var posix = {};
  14556. function posixSplitPath(filename) {
  14557. return splitPathRe.exec(filename).slice(1);
  14558. }
  14559. posix.parse = function(pathString) {
  14560. if (typeof pathString !== "string") {
  14561. throw new TypeError("Parameter 'pathString' must be a string, not " + typeof pathString);
  14562. }
  14563. var allParts = posixSplitPath(pathString);
  14564. if (!allParts || allParts.length !== 5) {
  14565. throw new TypeError("Invalid path '" + pathString + "'");
  14566. }
  14567. return {
  14568. root: allParts[1],
  14569. dir: allParts[0].slice(0, -1),
  14570. base: allParts[2],
  14571. ext: allParts[4],
  14572. name: allParts[3]
  14573. };
  14574. };
  14575. if (isWindows)
  14576. module2.exports = win32.parse;
  14577. else
  14578. module2.exports = posix.parse;
  14579. module2.exports.posix = posix.parse;
  14580. module2.exports.win32 = win32.parse;
  14581. }
  14582. });
  14583. var require_node_modules_paths = __commonJS2({
  14584. "node_modules/resolve/lib/node-modules-paths.js"(exports2, module2) {
  14585. var path = require("path");
  14586. var parse = path.parse || require_path_parse();
  14587. var getNodeModulesDirs = function getNodeModulesDirs2(absoluteStart, modules) {
  14588. var prefix = "/";
  14589. if (/^([A-Za-z]:)/.test(absoluteStart)) {
  14590. prefix = "";
  14591. } else if (/^\\\\/.test(absoluteStart)) {
  14592. prefix = "\\\\";
  14593. }
  14594. var paths = [absoluteStart];
  14595. var parsed = parse(absoluteStart);
  14596. while (parsed.dir !== paths[paths.length - 1]) {
  14597. paths.push(parsed.dir);
  14598. parsed = parse(parsed.dir);
  14599. }
  14600. return paths.reduce(function(dirs, aPath) {
  14601. return dirs.concat(modules.map(function(moduleDir) {
  14602. return path.resolve(prefix, aPath, moduleDir);
  14603. }));
  14604. }, []);
  14605. };
  14606. module2.exports = function nodeModulesPaths(start, opts, request) {
  14607. var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
  14608. if (opts && typeof opts.paths === "function") {
  14609. return opts.paths(request, start, function() {
  14610. return getNodeModulesDirs(start, modules);
  14611. }, opts);
  14612. }
  14613. var dirs = getNodeModulesDirs(start, modules);
  14614. return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
  14615. };
  14616. }
  14617. });
  14618. var require_normalize_options = __commonJS2({
  14619. "node_modules/resolve/lib/normalize-options.js"(exports2, module2) {
  14620. module2.exports = function(x, opts) {
  14621. return opts || {};
  14622. };
  14623. }
  14624. });
  14625. var require_implementation = __commonJS2({
  14626. "node_modules/function-bind/implementation.js"(exports2, module2) {
  14627. "use strict";
  14628. var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
  14629. var slice = Array.prototype.slice;
  14630. var toStr = Object.prototype.toString;
  14631. var funcType = "[object Function]";
  14632. module2.exports = function bind(that) {
  14633. var target = this;
  14634. if (typeof target !== "function" || toStr.call(target) !== funcType) {
  14635. throw new TypeError(ERROR_MESSAGE + target);
  14636. }
  14637. var args = slice.call(arguments, 1);
  14638. var bound;
  14639. var binder = function() {
  14640. if (this instanceof bound) {
  14641. var result = target.apply(this, args.concat(slice.call(arguments)));
  14642. if (Object(result) === result) {
  14643. return result;
  14644. }
  14645. return this;
  14646. } else {
  14647. return target.apply(that, args.concat(slice.call(arguments)));
  14648. }
  14649. };
  14650. var boundLength = Math.max(0, target.length - args.length);
  14651. var boundArgs = [];
  14652. for (var i = 0; i < boundLength; i++) {
  14653. boundArgs.push("$" + i);
  14654. }
  14655. bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder);
  14656. if (target.prototype) {
  14657. var Empty = function Empty2() {
  14658. };
  14659. Empty.prototype = target.prototype;
  14660. bound.prototype = new Empty();
  14661. Empty.prototype = null;
  14662. }
  14663. return bound;
  14664. };
  14665. }
  14666. });
  14667. var require_function_bind = __commonJS2({
  14668. "node_modules/function-bind/index.js"(exports2, module2) {
  14669. "use strict";
  14670. var implementation = require_implementation();
  14671. module2.exports = Function.prototype.bind || implementation;
  14672. }
  14673. });
  14674. var require_src = __commonJS2({
  14675. "node_modules/has/src/index.js"(exports2, module2) {
  14676. "use strict";
  14677. var bind = require_function_bind();
  14678. module2.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  14679. }
  14680. });
  14681. var require_core2 = __commonJS2({
  14682. "node_modules/is-core-module/core.json"(exports2, module2) {
  14683. module2.exports = {
  14684. assert: true,
  14685. "node:assert": [">= 14.18 && < 15", ">= 16"],
  14686. "assert/strict": ">= 15",
  14687. "node:assert/strict": ">= 16",
  14688. async_hooks: ">= 8",
  14689. "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
  14690. buffer_ieee754: ">= 0.5 && < 0.9.7",
  14691. buffer: true,
  14692. "node:buffer": [">= 14.18 && < 15", ">= 16"],
  14693. child_process: true,
  14694. "node:child_process": [">= 14.18 && < 15", ">= 16"],
  14695. cluster: ">= 0.5",
  14696. "node:cluster": [">= 14.18 && < 15", ">= 16"],
  14697. console: true,
  14698. "node:console": [">= 14.18 && < 15", ">= 16"],
  14699. constants: true,
  14700. "node:constants": [">= 14.18 && < 15", ">= 16"],
  14701. crypto: true,
  14702. "node:crypto": [">= 14.18 && < 15", ">= 16"],
  14703. _debug_agent: ">= 1 && < 8",
  14704. _debugger: "< 8",
  14705. dgram: true,
  14706. "node:dgram": [">= 14.18 && < 15", ">= 16"],
  14707. diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
  14708. "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
  14709. dns: true,
  14710. "node:dns": [">= 14.18 && < 15", ">= 16"],
  14711. "dns/promises": ">= 15",
  14712. "node:dns/promises": ">= 16",
  14713. domain: ">= 0.7.12",
  14714. "node:domain": [">= 14.18 && < 15", ">= 16"],
  14715. events: true,
  14716. "node:events": [">= 14.18 && < 15", ">= 16"],
  14717. freelist: "< 6",
  14718. fs: true,
  14719. "node:fs": [">= 14.18 && < 15", ">= 16"],
  14720. "fs/promises": [">= 10 && < 10.1", ">= 14"],
  14721. "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
  14722. _http_agent: ">= 0.11.1",
  14723. "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
  14724. _http_client: ">= 0.11.1",
  14725. "node:_http_client": [">= 14.18 && < 15", ">= 16"],
  14726. _http_common: ">= 0.11.1",
  14727. "node:_http_common": [">= 14.18 && < 15", ">= 16"],
  14728. _http_incoming: ">= 0.11.1",
  14729. "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
  14730. _http_outgoing: ">= 0.11.1",
  14731. "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
  14732. _http_server: ">= 0.11.1",
  14733. "node:_http_server": [">= 14.18 && < 15", ">= 16"],
  14734. http: true,
  14735. "node:http": [">= 14.18 && < 15", ">= 16"],
  14736. http2: ">= 8.8",
  14737. "node:http2": [">= 14.18 && < 15", ">= 16"],
  14738. https: true,
  14739. "node:https": [">= 14.18 && < 15", ">= 16"],
  14740. inspector: ">= 8",
  14741. "node:inspector": [">= 14.18 && < 15", ">= 16"],
  14742. _linklist: "< 8",
  14743. module: true,
  14744. "node:module": [">= 14.18 && < 15", ">= 16"],
  14745. net: true,
  14746. "node:net": [">= 14.18 && < 15", ">= 16"],
  14747. "node-inspect/lib/_inspect": ">= 7.6 && < 12",
  14748. "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
  14749. "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
  14750. os: true,
  14751. "node:os": [">= 14.18 && < 15", ">= 16"],
  14752. path: true,
  14753. "node:path": [">= 14.18 && < 15", ">= 16"],
  14754. "path/posix": ">= 15.3",
  14755. "node:path/posix": ">= 16",
  14756. "path/win32": ">= 15.3",
  14757. "node:path/win32": ">= 16",
  14758. perf_hooks: ">= 8.5",
  14759. "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
  14760. process: ">= 1",
  14761. "node:process": [">= 14.18 && < 15", ">= 16"],
  14762. punycode: ">= 0.5",
  14763. "node:punycode": [">= 14.18 && < 15", ">= 16"],
  14764. querystring: true,
  14765. "node:querystring": [">= 14.18 && < 15", ">= 16"],
  14766. readline: true,
  14767. "node:readline": [">= 14.18 && < 15", ">= 16"],
  14768. "readline/promises": ">= 17",
  14769. "node:readline/promises": ">= 17",
  14770. repl: true,
  14771. "node:repl": [">= 14.18 && < 15", ">= 16"],
  14772. smalloc: ">= 0.11.5 && < 3",
  14773. _stream_duplex: ">= 0.9.4",
  14774. "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
  14775. _stream_transform: ">= 0.9.4",
  14776. "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
  14777. _stream_wrap: ">= 1.4.1",
  14778. "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
  14779. _stream_passthrough: ">= 0.9.4",
  14780. "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
  14781. _stream_readable: ">= 0.9.4",
  14782. "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
  14783. _stream_writable: ">= 0.9.4",
  14784. "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
  14785. stream: true,
  14786. "node:stream": [">= 14.18 && < 15", ">= 16"],
  14787. "stream/consumers": ">= 16.7",
  14788. "node:stream/consumers": ">= 16.7",
  14789. "stream/promises": ">= 15",
  14790. "node:stream/promises": ">= 16",
  14791. "stream/web": ">= 16.5",
  14792. "node:stream/web": ">= 16.5",
  14793. string_decoder: true,
  14794. "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
  14795. sys: [">= 0.4 && < 0.7", ">= 0.8"],
  14796. "node:sys": [">= 14.18 && < 15", ">= 16"],
  14797. timers: true,
  14798. "node:timers": [">= 14.18 && < 15", ">= 16"],
  14799. "timers/promises": ">= 15",
  14800. "node:timers/promises": ">= 16",
  14801. _tls_common: ">= 0.11.13",
  14802. "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
  14803. _tls_legacy: ">= 0.11.3 && < 10",
  14804. _tls_wrap: ">= 0.11.3",
  14805. "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
  14806. tls: true,
  14807. "node:tls": [">= 14.18 && < 15", ">= 16"],
  14808. trace_events: ">= 10",
  14809. "node:trace_events": [">= 14.18 && < 15", ">= 16"],
  14810. tty: true,
  14811. "node:tty": [">= 14.18 && < 15", ">= 16"],
  14812. url: true,
  14813. "node:url": [">= 14.18 && < 15", ">= 16"],
  14814. util: true,
  14815. "node:util": [">= 14.18 && < 15", ">= 16"],
  14816. "util/types": ">= 15.3",
  14817. "node:util/types": ">= 16",
  14818. "v8/tools/arguments": ">= 10 && < 12",
  14819. "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  14820. "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  14821. "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  14822. "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  14823. "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  14824. "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  14825. v8: ">= 1",
  14826. "node:v8": [">= 14.18 && < 15", ">= 16"],
  14827. vm: true,
  14828. "node:vm": [">= 14.18 && < 15", ">= 16"],
  14829. wasi: ">= 13.4 && < 13.5",
  14830. worker_threads: ">= 11.7",
  14831. "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
  14832. zlib: ">= 0.5",
  14833. "node:zlib": [">= 14.18 && < 15", ">= 16"]
  14834. };
  14835. }
  14836. });
  14837. var require_is_core_module = __commonJS2({
  14838. "node_modules/is-core-module/index.js"(exports2, module2) {
  14839. "use strict";
  14840. var has = require_src();
  14841. function specifierIncluded(current, specifier) {
  14842. var nodeParts = current.split(".");
  14843. var parts = specifier.split(" ");
  14844. var op = parts.length > 1 ? parts[0] : "=";
  14845. var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split(".");
  14846. for (var i = 0; i < 3; ++i) {
  14847. var cur = parseInt(nodeParts[i] || 0, 10);
  14848. var ver = parseInt(versionParts[i] || 0, 10);
  14849. if (cur === ver) {
  14850. continue;
  14851. }
  14852. if (op === "<") {
  14853. return cur < ver;
  14854. }
  14855. if (op === ">=") {
  14856. return cur >= ver;
  14857. }
  14858. return false;
  14859. }
  14860. return op === ">=";
  14861. }
  14862. function matchesRange(current, range) {
  14863. var specifiers = range.split(/ ?&& ?/);
  14864. if (specifiers.length === 0) {
  14865. return false;
  14866. }
  14867. for (var i = 0; i < specifiers.length; ++i) {
  14868. if (!specifierIncluded(current, specifiers[i])) {
  14869. return false;
  14870. }
  14871. }
  14872. return true;
  14873. }
  14874. function versionIncluded(nodeVersion, specifierValue) {
  14875. if (typeof specifierValue === "boolean") {
  14876. return specifierValue;
  14877. }
  14878. var current = typeof nodeVersion === "undefined" ? process.versions && process.versions.node : nodeVersion;
  14879. if (typeof current !== "string") {
  14880. throw new TypeError(typeof nodeVersion === "undefined" ? "Unable to determine current node version" : "If provided, a valid node version is required");
  14881. }
  14882. if (specifierValue && typeof specifierValue === "object") {
  14883. for (var i = 0; i < specifierValue.length; ++i) {
  14884. if (matchesRange(current, specifierValue[i])) {
  14885. return true;
  14886. }
  14887. }
  14888. return false;
  14889. }
  14890. return matchesRange(current, specifierValue);
  14891. }
  14892. var data = require_core2();
  14893. module2.exports = function isCore(x, nodeVersion) {
  14894. return has(data, x) && versionIncluded(nodeVersion, data[x]);
  14895. };
  14896. }
  14897. });
  14898. var require_async = __commonJS2({
  14899. "node_modules/resolve/lib/async.js"(exports2, module2) {
  14900. var fs = require("fs");
  14901. var getHomedir = require_homedir();
  14902. var path = require("path");
  14903. var caller = require_caller();
  14904. var nodeModulesPaths = require_node_modules_paths();
  14905. var normalizeOptions = require_normalize_options();
  14906. var isCore = require_is_core_module();
  14907. var realpathFS = fs.realpath && typeof fs.realpath.native === "function" ? fs.realpath.native : fs.realpath;
  14908. var homedir = getHomedir();
  14909. var defaultPaths = function() {
  14910. return [path.join(homedir, ".node_modules"), path.join(homedir, ".node_libraries")];
  14911. };
  14912. var defaultIsFile = function isFile(file, cb) {
  14913. fs.stat(file, function(err, stat) {
  14914. if (!err) {
  14915. return cb(null, stat.isFile() || stat.isFIFO());
  14916. }
  14917. if (err.code === "ENOENT" || err.code === "ENOTDIR")
  14918. return cb(null, false);
  14919. return cb(err);
  14920. });
  14921. };
  14922. var defaultIsDir = function isDirectory(dir, cb) {
  14923. fs.stat(dir, function(err, stat) {
  14924. if (!err) {
  14925. return cb(null, stat.isDirectory());
  14926. }
  14927. if (err.code === "ENOENT" || err.code === "ENOTDIR")
  14928. return cb(null, false);
  14929. return cb(err);
  14930. });
  14931. };
  14932. var defaultRealpath = function realpath(x, cb) {
  14933. realpathFS(x, function(realpathErr, realPath) {
  14934. if (realpathErr && realpathErr.code !== "ENOENT")
  14935. cb(realpathErr);
  14936. else
  14937. cb(null, realpathErr ? x : realPath);
  14938. });
  14939. };
  14940. var maybeRealpath = function maybeRealpath2(realpath, x, opts, cb) {
  14941. if (opts && opts.preserveSymlinks === false) {
  14942. realpath(x, cb);
  14943. } else {
  14944. cb(null, x);
  14945. }
  14946. };
  14947. var defaultReadPackage = function defaultReadPackage2(readFile, pkgfile, cb) {
  14948. readFile(pkgfile, function(readFileErr, body) {
  14949. if (readFileErr)
  14950. cb(readFileErr);
  14951. else {
  14952. try {
  14953. var pkg = JSON.parse(body);
  14954. cb(null, pkg);
  14955. } catch (jsonErr) {
  14956. cb(null);
  14957. }
  14958. }
  14959. });
  14960. };
  14961. var getPackageCandidates = function getPackageCandidates2(x, start, opts) {
  14962. var dirs = nodeModulesPaths(start, opts, x);
  14963. for (var i = 0; i < dirs.length; i++) {
  14964. dirs[i] = path.join(dirs[i], x);
  14965. }
  14966. return dirs;
  14967. };
  14968. module2.exports = function resolve(x, options, callback) {
  14969. var cb = callback;
  14970. var opts = options;
  14971. if (typeof options === "function") {
  14972. cb = opts;
  14973. opts = {};
  14974. }
  14975. if (typeof x !== "string") {
  14976. var err = new TypeError("Path must be a string.");
  14977. return process.nextTick(function() {
  14978. cb(err);
  14979. });
  14980. }
  14981. opts = normalizeOptions(x, opts);
  14982. var isFile = opts.isFile || defaultIsFile;
  14983. var isDirectory = opts.isDirectory || defaultIsDir;
  14984. var readFile = opts.readFile || fs.readFile;
  14985. var realpath = opts.realpath || defaultRealpath;
  14986. var readPackage = opts.readPackage || defaultReadPackage;
  14987. if (opts.readFile && opts.readPackage) {
  14988. var conflictErr = new TypeError("`readFile` and `readPackage` are mutually exclusive.");
  14989. return process.nextTick(function() {
  14990. cb(conflictErr);
  14991. });
  14992. }
  14993. var packageIterator = opts.packageIterator;
  14994. var extensions = opts.extensions || [".js"];
  14995. var includeCoreModules = opts.includeCoreModules !== false;
  14996. var basedir = opts.basedir || path.dirname(caller());
  14997. var parent = opts.filename || basedir;
  14998. opts.paths = opts.paths || defaultPaths();
  14999. var absoluteStart = path.resolve(basedir);
  15000. maybeRealpath(realpath, absoluteStart, opts, function(err2, realStart) {
  15001. if (err2)
  15002. cb(err2);
  15003. else
  15004. init(realStart);
  15005. });
  15006. var res;
  15007. function init(basedir2) {
  15008. if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
  15009. res = path.resolve(basedir2, x);
  15010. if (x === "." || x === ".." || x.slice(-1) === "/")
  15011. res += "/";
  15012. if (/\/$/.test(x) && res === basedir2) {
  15013. loadAsDirectory(res, opts.package, onfile);
  15014. } else
  15015. loadAsFile(res, opts.package, onfile);
  15016. } else if (includeCoreModules && isCore(x)) {
  15017. return cb(null, x);
  15018. } else
  15019. loadNodeModules(x, basedir2, function(err2, n, pkg) {
  15020. if (err2)
  15021. cb(err2);
  15022. else if (n) {
  15023. return maybeRealpath(realpath, n, opts, function(err3, realN) {
  15024. if (err3) {
  15025. cb(err3);
  15026. } else {
  15027. cb(null, realN, pkg);
  15028. }
  15029. });
  15030. } else {
  15031. var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  15032. moduleError.code = "MODULE_NOT_FOUND";
  15033. cb(moduleError);
  15034. }
  15035. });
  15036. }
  15037. function onfile(err2, m, pkg) {
  15038. if (err2)
  15039. cb(err2);
  15040. else if (m)
  15041. cb(null, m, pkg);
  15042. else
  15043. loadAsDirectory(res, function(err3, d, pkg2) {
  15044. if (err3)
  15045. cb(err3);
  15046. else if (d) {
  15047. maybeRealpath(realpath, d, opts, function(err4, realD) {
  15048. if (err4) {
  15049. cb(err4);
  15050. } else {
  15051. cb(null, realD, pkg2);
  15052. }
  15053. });
  15054. } else {
  15055. var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  15056. moduleError.code = "MODULE_NOT_FOUND";
  15057. cb(moduleError);
  15058. }
  15059. });
  15060. }
  15061. function loadAsFile(x2, thePackage, callback2) {
  15062. var loadAsFilePackage = thePackage;
  15063. var cb2 = callback2;
  15064. if (typeof loadAsFilePackage === "function") {
  15065. cb2 = loadAsFilePackage;
  15066. loadAsFilePackage = void 0;
  15067. }
  15068. var exts = [""].concat(extensions);
  15069. load(exts, x2, loadAsFilePackage);
  15070. function load(exts2, x3, loadPackage) {
  15071. if (exts2.length === 0)
  15072. return cb2(null, void 0, loadPackage);
  15073. var file = x3 + exts2[0];
  15074. var pkg = loadPackage;
  15075. if (pkg)
  15076. onpkg(null, pkg);
  15077. else
  15078. loadpkg(path.dirname(file), onpkg);
  15079. function onpkg(err2, pkg_, dir) {
  15080. pkg = pkg_;
  15081. if (err2)
  15082. return cb2(err2);
  15083. if (dir && pkg && opts.pathFilter) {
  15084. var rfile = path.relative(dir, file);
  15085. var rel = rfile.slice(0, rfile.length - exts2[0].length);
  15086. var r = opts.pathFilter(pkg, x3, rel);
  15087. if (r)
  15088. return load([""].concat(extensions.slice()), path.resolve(dir, r), pkg);
  15089. }
  15090. isFile(file, onex);
  15091. }
  15092. function onex(err2, ex) {
  15093. if (err2)
  15094. return cb2(err2);
  15095. if (ex)
  15096. return cb2(null, file, pkg);
  15097. load(exts2.slice(1), x3, pkg);
  15098. }
  15099. }
  15100. }
  15101. function loadpkg(dir, cb2) {
  15102. if (dir === "" || dir === "/")
  15103. return cb2(null);
  15104. if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir)) {
  15105. return cb2(null);
  15106. }
  15107. if (/[/\\]node_modules[/\\]*$/.test(dir))
  15108. return cb2(null);
  15109. maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
  15110. if (unwrapErr)
  15111. return loadpkg(path.dirname(dir), cb2);
  15112. var pkgfile = path.join(pkgdir, "package.json");
  15113. isFile(pkgfile, function(err2, ex) {
  15114. if (!ex)
  15115. return loadpkg(path.dirname(dir), cb2);
  15116. readPackage(readFile, pkgfile, function(err3, pkgParam) {
  15117. if (err3)
  15118. cb2(err3);
  15119. var pkg = pkgParam;
  15120. if (pkg && opts.packageFilter) {
  15121. pkg = opts.packageFilter(pkg, pkgfile);
  15122. }
  15123. cb2(null, pkg, dir);
  15124. });
  15125. });
  15126. });
  15127. }
  15128. function loadAsDirectory(x2, loadAsDirectoryPackage, callback2) {
  15129. var cb2 = callback2;
  15130. var fpkg = loadAsDirectoryPackage;
  15131. if (typeof fpkg === "function") {
  15132. cb2 = fpkg;
  15133. fpkg = opts.package;
  15134. }
  15135. maybeRealpath(realpath, x2, opts, function(unwrapErr, pkgdir) {
  15136. if (unwrapErr)
  15137. return cb2(unwrapErr);
  15138. var pkgfile = path.join(pkgdir, "package.json");
  15139. isFile(pkgfile, function(err2, ex) {
  15140. if (err2)
  15141. return cb2(err2);
  15142. if (!ex)
  15143. return loadAsFile(path.join(x2, "index"), fpkg, cb2);
  15144. readPackage(readFile, pkgfile, function(err3, pkgParam) {
  15145. if (err3)
  15146. return cb2(err3);
  15147. var pkg = pkgParam;
  15148. if (pkg && opts.packageFilter) {
  15149. pkg = opts.packageFilter(pkg, pkgfile);
  15150. }
  15151. if (pkg && pkg.main) {
  15152. if (typeof pkg.main !== "string") {
  15153. var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
  15154. mainError.code = "INVALID_PACKAGE_MAIN";
  15155. return cb2(mainError);
  15156. }
  15157. if (pkg.main === "." || pkg.main === "./") {
  15158. pkg.main = "index";
  15159. }
  15160. loadAsFile(path.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
  15161. if (err4)
  15162. return cb2(err4);
  15163. if (m)
  15164. return cb2(null, m, pkg2);
  15165. if (!pkg2)
  15166. return loadAsFile(path.join(x2, "index"), pkg2, cb2);
  15167. var dir = path.resolve(x2, pkg2.main);
  15168. loadAsDirectory(dir, pkg2, function(err5, n, pkg3) {
  15169. if (err5)
  15170. return cb2(err5);
  15171. if (n)
  15172. return cb2(null, n, pkg3);
  15173. loadAsFile(path.join(x2, "index"), pkg3, cb2);
  15174. });
  15175. });
  15176. return;
  15177. }
  15178. loadAsFile(path.join(x2, "/index"), pkg, cb2);
  15179. });
  15180. });
  15181. });
  15182. }
  15183. function processDirs(cb2, dirs) {
  15184. if (dirs.length === 0)
  15185. return cb2(null, void 0);
  15186. var dir = dirs[0];
  15187. isDirectory(path.dirname(dir), isdir);
  15188. function isdir(err2, isdir2) {
  15189. if (err2)
  15190. return cb2(err2);
  15191. if (!isdir2)
  15192. return processDirs(cb2, dirs.slice(1));
  15193. loadAsFile(dir, opts.package, onfile2);
  15194. }
  15195. function onfile2(err2, m, pkg) {
  15196. if (err2)
  15197. return cb2(err2);
  15198. if (m)
  15199. return cb2(null, m, pkg);
  15200. loadAsDirectory(dir, opts.package, ondir);
  15201. }
  15202. function ondir(err2, n, pkg) {
  15203. if (err2)
  15204. return cb2(err2);
  15205. if (n)
  15206. return cb2(null, n, pkg);
  15207. processDirs(cb2, dirs.slice(1));
  15208. }
  15209. }
  15210. function loadNodeModules(x2, start, cb2) {
  15211. var thunk = function() {
  15212. return getPackageCandidates(x2, start, opts);
  15213. };
  15214. processDirs(cb2, packageIterator ? packageIterator(x2, start, thunk, opts) : thunk());
  15215. }
  15216. };
  15217. }
  15218. });
  15219. var require_core3 = __commonJS2({
  15220. "node_modules/resolve/lib/core.json"(exports2, module2) {
  15221. module2.exports = {
  15222. assert: true,
  15223. "node:assert": [">= 14.18 && < 15", ">= 16"],
  15224. "assert/strict": ">= 15",
  15225. "node:assert/strict": ">= 16",
  15226. async_hooks: ">= 8",
  15227. "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
  15228. buffer_ieee754: ">= 0.5 && < 0.9.7",
  15229. buffer: true,
  15230. "node:buffer": [">= 14.18 && < 15", ">= 16"],
  15231. child_process: true,
  15232. "node:child_process": [">= 14.18 && < 15", ">= 16"],
  15233. cluster: ">= 0.5",
  15234. "node:cluster": [">= 14.18 && < 15", ">= 16"],
  15235. console: true,
  15236. "node:console": [">= 14.18 && < 15", ">= 16"],
  15237. constants: true,
  15238. "node:constants": [">= 14.18 && < 15", ">= 16"],
  15239. crypto: true,
  15240. "node:crypto": [">= 14.18 && < 15", ">= 16"],
  15241. _debug_agent: ">= 1 && < 8",
  15242. _debugger: "< 8",
  15243. dgram: true,
  15244. "node:dgram": [">= 14.18 && < 15", ">= 16"],
  15245. diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
  15246. "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
  15247. dns: true,
  15248. "node:dns": [">= 14.18 && < 15", ">= 16"],
  15249. "dns/promises": ">= 15",
  15250. "node:dns/promises": ">= 16",
  15251. domain: ">= 0.7.12",
  15252. "node:domain": [">= 14.18 && < 15", ">= 16"],
  15253. events: true,
  15254. "node:events": [">= 14.18 && < 15", ">= 16"],
  15255. freelist: "< 6",
  15256. fs: true,
  15257. "node:fs": [">= 14.18 && < 15", ">= 16"],
  15258. "fs/promises": [">= 10 && < 10.1", ">= 14"],
  15259. "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
  15260. _http_agent: ">= 0.11.1",
  15261. "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
  15262. _http_client: ">= 0.11.1",
  15263. "node:_http_client": [">= 14.18 && < 15", ">= 16"],
  15264. _http_common: ">= 0.11.1",
  15265. "node:_http_common": [">= 14.18 && < 15", ">= 16"],
  15266. _http_incoming: ">= 0.11.1",
  15267. "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
  15268. _http_outgoing: ">= 0.11.1",
  15269. "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
  15270. _http_server: ">= 0.11.1",
  15271. "node:_http_server": [">= 14.18 && < 15", ">= 16"],
  15272. http: true,
  15273. "node:http": [">= 14.18 && < 15", ">= 16"],
  15274. http2: ">= 8.8",
  15275. "node:http2": [">= 14.18 && < 15", ">= 16"],
  15276. https: true,
  15277. "node:https": [">= 14.18 && < 15", ">= 16"],
  15278. inspector: ">= 8",
  15279. "node:inspector": [">= 14.18 && < 15", ">= 16"],
  15280. _linklist: "< 8",
  15281. module: true,
  15282. "node:module": [">= 14.18 && < 15", ">= 16"],
  15283. net: true,
  15284. "node:net": [">= 14.18 && < 15", ">= 16"],
  15285. "node-inspect/lib/_inspect": ">= 7.6 && < 12",
  15286. "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
  15287. "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
  15288. os: true,
  15289. "node:os": [">= 14.18 && < 15", ">= 16"],
  15290. path: true,
  15291. "node:path": [">= 14.18 && < 15", ">= 16"],
  15292. "path/posix": ">= 15.3",
  15293. "node:path/posix": ">= 16",
  15294. "path/win32": ">= 15.3",
  15295. "node:path/win32": ">= 16",
  15296. perf_hooks: ">= 8.5",
  15297. "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
  15298. process: ">= 1",
  15299. "node:process": [">= 14.18 && < 15", ">= 16"],
  15300. punycode: ">= 0.5",
  15301. "node:punycode": [">= 14.18 && < 15", ">= 16"],
  15302. querystring: true,
  15303. "node:querystring": [">= 14.18 && < 15", ">= 16"],
  15304. readline: true,
  15305. "node:readline": [">= 14.18 && < 15", ">= 16"],
  15306. "readline/promises": ">= 17",
  15307. "node:readline/promises": ">= 17",
  15308. repl: true,
  15309. "node:repl": [">= 14.18 && < 15", ">= 16"],
  15310. smalloc: ">= 0.11.5 && < 3",
  15311. _stream_duplex: ">= 0.9.4",
  15312. "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
  15313. _stream_transform: ">= 0.9.4",
  15314. "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
  15315. _stream_wrap: ">= 1.4.1",
  15316. "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
  15317. _stream_passthrough: ">= 0.9.4",
  15318. "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
  15319. _stream_readable: ">= 0.9.4",
  15320. "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
  15321. _stream_writable: ">= 0.9.4",
  15322. "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
  15323. stream: true,
  15324. "node:stream": [">= 14.18 && < 15", ">= 16"],
  15325. "stream/consumers": ">= 16.7",
  15326. "node:stream/consumers": ">= 16.7",
  15327. "stream/promises": ">= 15",
  15328. "node:stream/promises": ">= 16",
  15329. "stream/web": ">= 16.5",
  15330. "node:stream/web": ">= 16.5",
  15331. string_decoder: true,
  15332. "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
  15333. sys: [">= 0.4 && < 0.7", ">= 0.8"],
  15334. "node:sys": [">= 14.18 && < 15", ">= 16"],
  15335. timers: true,
  15336. "node:timers": [">= 14.18 && < 15", ">= 16"],
  15337. "timers/promises": ">= 15",
  15338. "node:timers/promises": ">= 16",
  15339. _tls_common: ">= 0.11.13",
  15340. "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
  15341. _tls_legacy: ">= 0.11.3 && < 10",
  15342. _tls_wrap: ">= 0.11.3",
  15343. "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
  15344. tls: true,
  15345. "node:tls": [">= 14.18 && < 15", ">= 16"],
  15346. trace_events: ">= 10",
  15347. "node:trace_events": [">= 14.18 && < 15", ">= 16"],
  15348. tty: true,
  15349. "node:tty": [">= 14.18 && < 15", ">= 16"],
  15350. url: true,
  15351. "node:url": [">= 14.18 && < 15", ">= 16"],
  15352. util: true,
  15353. "node:util": [">= 14.18 && < 15", ">= 16"],
  15354. "util/types": ">= 15.3",
  15355. "node:util/types": ">= 16",
  15356. "v8/tools/arguments": ">= 10 && < 12",
  15357. "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  15358. "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  15359. "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  15360. "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  15361. "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  15362. "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
  15363. v8: ">= 1",
  15364. "node:v8": [">= 14.18 && < 15", ">= 16"],
  15365. vm: true,
  15366. "node:vm": [">= 14.18 && < 15", ">= 16"],
  15367. wasi: ">= 13.4 && < 13.5",
  15368. worker_threads: ">= 11.7",
  15369. "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
  15370. zlib: ">= 0.5",
  15371. "node:zlib": [">= 14.18 && < 15", ">= 16"]
  15372. };
  15373. }
  15374. });
  15375. var require_core4 = __commonJS2({
  15376. "node_modules/resolve/lib/core.js"(exports2, module2) {
  15377. var current = process.versions && process.versions.node && process.versions.node.split(".") || [];
  15378. function specifierIncluded(specifier) {
  15379. var parts = specifier.split(" ");
  15380. var op = parts.length > 1 ? parts[0] : "=";
  15381. var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split(".");
  15382. for (var i = 0; i < 3; ++i) {
  15383. var cur = parseInt(current[i] || 0, 10);
  15384. var ver = parseInt(versionParts[i] || 0, 10);
  15385. if (cur === ver) {
  15386. continue;
  15387. }
  15388. if (op === "<") {
  15389. return cur < ver;
  15390. } else if (op === ">=") {
  15391. return cur >= ver;
  15392. }
  15393. return false;
  15394. }
  15395. return op === ">=";
  15396. }
  15397. function matchesRange(range) {
  15398. var specifiers = range.split(/ ?&& ?/);
  15399. if (specifiers.length === 0) {
  15400. return false;
  15401. }
  15402. for (var i = 0; i < specifiers.length; ++i) {
  15403. if (!specifierIncluded(specifiers[i])) {
  15404. return false;
  15405. }
  15406. }
  15407. return true;
  15408. }
  15409. function versionIncluded(specifierValue) {
  15410. if (typeof specifierValue === "boolean") {
  15411. return specifierValue;
  15412. }
  15413. if (specifierValue && typeof specifierValue === "object") {
  15414. for (var i = 0; i < specifierValue.length; ++i) {
  15415. if (matchesRange(specifierValue[i])) {
  15416. return true;
  15417. }
  15418. }
  15419. return false;
  15420. }
  15421. return matchesRange(specifierValue);
  15422. }
  15423. var data = require_core3();
  15424. var core2 = {};
  15425. for (mod in data) {
  15426. if (Object.prototype.hasOwnProperty.call(data, mod)) {
  15427. core2[mod] = versionIncluded(data[mod]);
  15428. }
  15429. }
  15430. var mod;
  15431. module2.exports = core2;
  15432. }
  15433. });
  15434. var require_is_core = __commonJS2({
  15435. "node_modules/resolve/lib/is-core.js"(exports2, module2) {
  15436. var isCoreModule = require_is_core_module();
  15437. module2.exports = function isCore(x) {
  15438. return isCoreModule(x);
  15439. };
  15440. }
  15441. });
  15442. var require_sync = __commonJS2({
  15443. "node_modules/resolve/lib/sync.js"(exports2, module2) {
  15444. var isCore = require_is_core_module();
  15445. var fs = require("fs");
  15446. var path = require("path");
  15447. var getHomedir = require_homedir();
  15448. var caller = require_caller();
  15449. var nodeModulesPaths = require_node_modules_paths();
  15450. var normalizeOptions = require_normalize_options();
  15451. var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === "function" ? fs.realpathSync.native : fs.realpathSync;
  15452. var homedir = getHomedir();
  15453. var defaultPaths = function() {
  15454. return [path.join(homedir, ".node_modules"), path.join(homedir, ".node_libraries")];
  15455. };
  15456. var defaultIsFile = function isFile(file) {
  15457. try {
  15458. var stat = fs.statSync(file, {
  15459. throwIfNoEntry: false
  15460. });
  15461. } catch (e) {
  15462. if (e && (e.code === "ENOENT" || e.code === "ENOTDIR"))
  15463. return false;
  15464. throw e;
  15465. }
  15466. return !!stat && (stat.isFile() || stat.isFIFO());
  15467. };
  15468. var defaultIsDir = function isDirectory(dir) {
  15469. try {
  15470. var stat = fs.statSync(dir, {
  15471. throwIfNoEntry: false
  15472. });
  15473. } catch (e) {
  15474. if (e && (e.code === "ENOENT" || e.code === "ENOTDIR"))
  15475. return false;
  15476. throw e;
  15477. }
  15478. return !!stat && stat.isDirectory();
  15479. };
  15480. var defaultRealpathSync = function realpathSync(x) {
  15481. try {
  15482. return realpathFS(x);
  15483. } catch (realpathErr) {
  15484. if (realpathErr.code !== "ENOENT") {
  15485. throw realpathErr;
  15486. }
  15487. }
  15488. return x;
  15489. };
  15490. var maybeRealpathSync = function maybeRealpathSync2(realpathSync, x, opts) {
  15491. if (opts && opts.preserveSymlinks === false) {
  15492. return realpathSync(x);
  15493. }
  15494. return x;
  15495. };
  15496. var defaultReadPackageSync = function defaultReadPackageSync2(readFileSync, pkgfile) {
  15497. var body = readFileSync(pkgfile);
  15498. try {
  15499. var pkg = JSON.parse(body);
  15500. return pkg;
  15501. } catch (jsonErr) {
  15502. }
  15503. };
  15504. var getPackageCandidates = function getPackageCandidates2(x, start, opts) {
  15505. var dirs = nodeModulesPaths(start, opts, x);
  15506. for (var i = 0; i < dirs.length; i++) {
  15507. dirs[i] = path.join(dirs[i], x);
  15508. }
  15509. return dirs;
  15510. };
  15511. module2.exports = function resolveSync(x, options) {
  15512. if (typeof x !== "string") {
  15513. throw new TypeError("Path must be a string.");
  15514. }
  15515. var opts = normalizeOptions(x, options);
  15516. var isFile = opts.isFile || defaultIsFile;
  15517. var readFileSync = opts.readFileSync || fs.readFileSync;
  15518. var isDirectory = opts.isDirectory || defaultIsDir;
  15519. var realpathSync = opts.realpathSync || defaultRealpathSync;
  15520. var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
  15521. if (opts.readFileSync && opts.readPackageSync) {
  15522. throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
  15523. }
  15524. var packageIterator = opts.packageIterator;
  15525. var extensions = opts.extensions || [".js"];
  15526. var includeCoreModules = opts.includeCoreModules !== false;
  15527. var basedir = opts.basedir || path.dirname(caller());
  15528. var parent = opts.filename || basedir;
  15529. opts.paths = opts.paths || defaultPaths();
  15530. var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
  15531. if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
  15532. var res = path.resolve(absoluteStart, x);
  15533. if (x === "." || x === ".." || x.slice(-1) === "/")
  15534. res += "/";
  15535. var m = loadAsFileSync(res) || loadAsDirectorySync(res);
  15536. if (m)
  15537. return maybeRealpathSync(realpathSync, m, opts);
  15538. } else if (includeCoreModules && isCore(x)) {
  15539. return x;
  15540. } else {
  15541. var n = loadNodeModulesSync(x, absoluteStart);
  15542. if (n)
  15543. return maybeRealpathSync(realpathSync, n, opts);
  15544. }
  15545. var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  15546. err.code = "MODULE_NOT_FOUND";
  15547. throw err;
  15548. function loadAsFileSync(x2) {
  15549. var pkg = loadpkg(path.dirname(x2));
  15550. if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
  15551. var rfile = path.relative(pkg.dir, x2);
  15552. var r = opts.pathFilter(pkg.pkg, x2, rfile);
  15553. if (r) {
  15554. x2 = path.resolve(pkg.dir, r);
  15555. }
  15556. }
  15557. if (isFile(x2)) {
  15558. return x2;
  15559. }
  15560. for (var i = 0; i < extensions.length; i++) {
  15561. var file = x2 + extensions[i];
  15562. if (isFile(file)) {
  15563. return file;
  15564. }
  15565. }
  15566. }
  15567. function loadpkg(dir) {
  15568. if (dir === "" || dir === "/")
  15569. return;
  15570. if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir)) {
  15571. return;
  15572. }
  15573. if (/[/\\]node_modules[/\\]*$/.test(dir))
  15574. return;
  15575. var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
  15576. if (!isFile(pkgfile)) {
  15577. return loadpkg(path.dirname(dir));
  15578. }
  15579. var pkg = readPackageSync(readFileSync, pkgfile);
  15580. if (pkg && opts.packageFilter) {
  15581. pkg = opts.packageFilter(pkg, dir);
  15582. }
  15583. return {
  15584. pkg,
  15585. dir
  15586. };
  15587. }
  15588. function loadAsDirectorySync(x2) {
  15589. var pkgfile = path.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
  15590. if (isFile(pkgfile)) {
  15591. try {
  15592. var pkg = readPackageSync(readFileSync, pkgfile);
  15593. } catch (e) {
  15594. }
  15595. if (pkg && opts.packageFilter) {
  15596. pkg = opts.packageFilter(pkg, x2);
  15597. }
  15598. if (pkg && pkg.main) {
  15599. if (typeof pkg.main !== "string") {
  15600. var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
  15601. mainError.code = "INVALID_PACKAGE_MAIN";
  15602. throw mainError;
  15603. }
  15604. if (pkg.main === "." || pkg.main === "./") {
  15605. pkg.main = "index";
  15606. }
  15607. try {
  15608. var m2 = loadAsFileSync(path.resolve(x2, pkg.main));
  15609. if (m2)
  15610. return m2;
  15611. var n2 = loadAsDirectorySync(path.resolve(x2, pkg.main));
  15612. if (n2)
  15613. return n2;
  15614. } catch (e) {
  15615. }
  15616. }
  15617. }
  15618. return loadAsFileSync(path.join(x2, "/index"));
  15619. }
  15620. function loadNodeModulesSync(x2, start) {
  15621. var thunk = function() {
  15622. return getPackageCandidates(x2, start, opts);
  15623. };
  15624. var dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk();
  15625. for (var i = 0; i < dirs.length; i++) {
  15626. var dir = dirs[i];
  15627. if (isDirectory(path.dirname(dir))) {
  15628. var m2 = loadAsFileSync(dir);
  15629. if (m2)
  15630. return m2;
  15631. var n2 = loadAsDirectorySync(dir);
  15632. if (n2)
  15633. return n2;
  15634. }
  15635. }
  15636. }
  15637. };
  15638. }
  15639. });
  15640. var require_resolve = __commonJS2({
  15641. "node_modules/resolve/index.js"(exports2, module2) {
  15642. var async = require_async();
  15643. async.core = require_core4();
  15644. async.isCore = require_is_core();
  15645. async.sync = require_sync();
  15646. module2.exports = async;
  15647. }
  15648. });
  15649. var require_resolve2 = __commonJS2({
  15650. "src/common/resolve.js"(exports2, module2) {
  15651. "use strict";
  15652. var {
  15653. resolve
  15654. } = require;
  15655. if (resolve.length === 1 || process.env.PRETTIER_FALLBACK_RESOLVE) {
  15656. resolve = (id, options) => {
  15657. let basedir;
  15658. if (options && options.paths && options.paths.length === 1) {
  15659. basedir = options.paths[0];
  15660. }
  15661. return require_resolve().sync(id, {
  15662. basedir
  15663. });
  15664. };
  15665. }
  15666. module2.exports = resolve;
  15667. }
  15668. });
  15669. var require_mem = __commonJS2({
  15670. "vendors/mem.js"(exports2, module2) {
  15671. var __create = Object.create;
  15672. var __defProp2 = Object.defineProperty;
  15673. var __defProps = Object.defineProperties;
  15674. var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
  15675. var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
  15676. var __getOwnPropNames22 = Object.getOwnPropertyNames;
  15677. var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  15678. var __getProtoOf = Object.getPrototypeOf;
  15679. var __hasOwnProp2 = Object.prototype.hasOwnProperty;
  15680. var __propIsEnum = Object.prototype.propertyIsEnumerable;
  15681. var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, {
  15682. enumerable: true,
  15683. configurable: true,
  15684. writable: true,
  15685. value
  15686. }) : obj[key] = value;
  15687. var __spreadValues = (a, b) => {
  15688. for (var prop in b || (b = {}))
  15689. if (__hasOwnProp2.call(b, prop))
  15690. __defNormalProp(a, prop, b[prop]);
  15691. if (__getOwnPropSymbols)
  15692. for (var prop of __getOwnPropSymbols(b)) {
  15693. if (__propIsEnum.call(b, prop))
  15694. __defNormalProp(a, prop, b[prop]);
  15695. }
  15696. return a;
  15697. };
  15698. var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
  15699. var __commonJS22 = (cb, mod) => function __require() {
  15700. return mod || (0, cb[__getOwnPropNames22(cb)[0]])((mod = {
  15701. exports: {}
  15702. }).exports, mod), mod.exports;
  15703. };
  15704. var __export2 = (target, all) => {
  15705. for (var name in all)
  15706. __defProp2(target, name, {
  15707. get: all[name],
  15708. enumerable: true
  15709. });
  15710. };
  15711. var __copyProps2 = (to, from, except, desc) => {
  15712. if (from && typeof from === "object" || typeof from === "function") {
  15713. for (let key of __getOwnPropNames22(from))
  15714. if (!__hasOwnProp2.call(to, key) && key !== except)
  15715. __defProp2(to, key, {
  15716. get: () => from[key],
  15717. enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
  15718. });
  15719. }
  15720. return to;
  15721. };
  15722. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
  15723. value: mod,
  15724. enumerable: true
  15725. }) : target, mod));
  15726. var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", {
  15727. value: true
  15728. }), mod);
  15729. var require_p_defer = __commonJS22({
  15730. "node_modules/p-defer/index.js"(exports3, module22) {
  15731. "use strict";
  15732. module22.exports = () => {
  15733. const ret = {};
  15734. ret.promise = new Promise((resolve, reject) => {
  15735. ret.resolve = resolve;
  15736. ret.reject = reject;
  15737. });
  15738. return ret;
  15739. };
  15740. }
  15741. });
  15742. var require_dist = __commonJS22({
  15743. "node_modules/map-age-cleaner/dist/index.js"(exports3, module22) {
  15744. "use strict";
  15745. var __awaiter2 = exports3 && exports3.__awaiter || function(thisArg, _arguments, P, generator) {
  15746. return new (P || (P = Promise))(function(resolve, reject) {
  15747. function fulfilled(value) {
  15748. try {
  15749. step(generator.next(value));
  15750. } catch (e) {
  15751. reject(e);
  15752. }
  15753. }
  15754. function rejected(value) {
  15755. try {
  15756. step(generator["throw"](value));
  15757. } catch (e) {
  15758. reject(e);
  15759. }
  15760. }
  15761. function step(result) {
  15762. result.done ? resolve(result.value) : new P(function(resolve2) {
  15763. resolve2(result.value);
  15764. }).then(fulfilled, rejected);
  15765. }
  15766. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15767. });
  15768. };
  15769. var __importDefault2 = exports3 && exports3.__importDefault || function(mod) {
  15770. return mod && mod.__esModule ? mod : {
  15771. "default": mod
  15772. };
  15773. };
  15774. Object.defineProperty(exports3, "__esModule", {
  15775. value: true
  15776. });
  15777. var p_defer_1 = __importDefault2(require_p_defer());
  15778. function mapAgeCleaner2(map, property = "maxAge") {
  15779. let processingKey;
  15780. let processingTimer;
  15781. let processingDeferred;
  15782. const cleanup = () => __awaiter2(this, void 0, void 0, function* () {
  15783. if (processingKey !== void 0) {
  15784. return;
  15785. }
  15786. const setupTimer = (item) => __awaiter2(this, void 0, void 0, function* () {
  15787. processingDeferred = p_defer_1.default();
  15788. const delay = item[1][property] - Date.now();
  15789. if (delay <= 0) {
  15790. map.delete(item[0]);
  15791. processingDeferred.resolve();
  15792. return;
  15793. }
  15794. processingKey = item[0];
  15795. processingTimer = setTimeout(() => {
  15796. map.delete(item[0]);
  15797. if (processingDeferred) {
  15798. processingDeferred.resolve();
  15799. }
  15800. }, delay);
  15801. if (typeof processingTimer.unref === "function") {
  15802. processingTimer.unref();
  15803. }
  15804. return processingDeferred.promise;
  15805. });
  15806. try {
  15807. for (const entry of map) {
  15808. yield setupTimer(entry);
  15809. }
  15810. } catch (_a) {
  15811. }
  15812. processingKey = void 0;
  15813. });
  15814. const reset = () => {
  15815. processingKey = void 0;
  15816. if (processingTimer !== void 0) {
  15817. clearTimeout(processingTimer);
  15818. processingTimer = void 0;
  15819. }
  15820. if (processingDeferred !== void 0) {
  15821. processingDeferred.reject(void 0);
  15822. processingDeferred = void 0;
  15823. }
  15824. };
  15825. const originalSet = map.set.bind(map);
  15826. map.set = (key, value) => {
  15827. if (map.has(key)) {
  15828. map.delete(key);
  15829. }
  15830. const result = originalSet(key, value);
  15831. if (processingKey && processingKey === key) {
  15832. reset();
  15833. }
  15834. cleanup();
  15835. return result;
  15836. };
  15837. cleanup();
  15838. return map;
  15839. }
  15840. exports3.default = mapAgeCleaner2;
  15841. module22.exports = mapAgeCleaner2;
  15842. module22.exports.default = mapAgeCleaner2;
  15843. }
  15844. });
  15845. var dist_exports = {};
  15846. __export2(dist_exports, {
  15847. default: () => mem,
  15848. memClear: () => memClear,
  15849. memDecorator: () => memDecorator
  15850. });
  15851. module2.exports = __toCommonJS2(dist_exports);
  15852. var copyProperty = (to, from, property, ignoreNonConfigurable) => {
  15853. if (property === "length" || property === "prototype") {
  15854. return;
  15855. }
  15856. if (property === "arguments" || property === "caller") {
  15857. return;
  15858. }
  15859. const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
  15860. const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
  15861. if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
  15862. return;
  15863. }
  15864. Object.defineProperty(to, property, fromDescriptor);
  15865. };
  15866. var canCopyProperty = function(toDescriptor, fromDescriptor) {
  15867. return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
  15868. };
  15869. var changePrototype = (to, from) => {
  15870. const fromPrototype = Object.getPrototypeOf(from);
  15871. if (fromPrototype === Object.getPrototypeOf(to)) {
  15872. return;
  15873. }
  15874. Object.setPrototypeOf(to, fromPrototype);
  15875. };
  15876. var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
  15877. ${fromBody}`;
  15878. var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
  15879. var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
  15880. var changeToString = (to, from, name) => {
  15881. const withName = name === "" ? "" : `with ${name.trim()}() `;
  15882. const newToString = wrappedToString.bind(null, withName, from.toString());
  15883. Object.defineProperty(newToString, "name", toStringName);
  15884. Object.defineProperty(to, "toString", __spreadProps(__spreadValues({}, toStringDescriptor), {
  15885. value: newToString
  15886. }));
  15887. };
  15888. function mimicFunction(to, from, {
  15889. ignoreNonConfigurable = false
  15890. } = {}) {
  15891. const {
  15892. name
  15893. } = to;
  15894. for (const property of Reflect.ownKeys(from)) {
  15895. copyProperty(to, from, property, ignoreNonConfigurable);
  15896. }
  15897. changePrototype(to, from);
  15898. changeToString(to, from, name);
  15899. return to;
  15900. }
  15901. var import_map_age_cleaner = __toESM(require_dist(), 1);
  15902. var cacheStore = /* @__PURE__ */ new WeakMap();
  15903. function mem(fn, {
  15904. cacheKey,
  15905. cache = /* @__PURE__ */ new Map(),
  15906. maxAge
  15907. } = {}) {
  15908. if (typeof maxAge === "number") {
  15909. (0, import_map_age_cleaner.default)(cache);
  15910. }
  15911. const memoized = function(...arguments_) {
  15912. const key = cacheKey ? cacheKey(arguments_) : arguments_[0];
  15913. const cacheItem = cache.get(key);
  15914. if (cacheItem) {
  15915. return cacheItem.data;
  15916. }
  15917. const result = fn.apply(this, arguments_);
  15918. cache.set(key, {
  15919. data: result,
  15920. maxAge: maxAge ? Date.now() + maxAge : Number.POSITIVE_INFINITY
  15921. });
  15922. return result;
  15923. };
  15924. mimicFunction(memoized, fn, {
  15925. ignoreNonConfigurable: true
  15926. });
  15927. cacheStore.set(memoized, cache);
  15928. return memoized;
  15929. }
  15930. function memDecorator(options = {}) {
  15931. const instanceMap = /* @__PURE__ */ new WeakMap();
  15932. return (target, propertyKey, descriptor) => {
  15933. const input = target[propertyKey];
  15934. if (typeof input !== "function") {
  15935. throw new TypeError("The decorated value must be a function");
  15936. }
  15937. delete descriptor.value;
  15938. delete descriptor.writable;
  15939. descriptor.get = function() {
  15940. if (!instanceMap.has(this)) {
  15941. const value = mem(input, options);
  15942. instanceMap.set(this, value);
  15943. return value;
  15944. }
  15945. return instanceMap.get(this);
  15946. };
  15947. };
  15948. }
  15949. function memClear(fn) {
  15950. const cache = cacheStore.get(fn);
  15951. if (!cache) {
  15952. throw new TypeError("Can't clear a function that was not memoized!");
  15953. }
  15954. if (typeof cache.clear !== "function") {
  15955. throw new TypeError("The cache Map can't be cleared!");
  15956. }
  15957. cache.clear();
  15958. }
  15959. }
  15960. });
  15961. var require_pseudomap = __commonJS2({
  15962. "node_modules/pseudomap/pseudomap.js"(exports2, module2) {
  15963. var hasOwnProperty = Object.prototype.hasOwnProperty;
  15964. module2.exports = PseudoMap;
  15965. function PseudoMap(set2) {
  15966. if (!(this instanceof PseudoMap))
  15967. throw new TypeError("Constructor PseudoMap requires 'new'");
  15968. this.clear();
  15969. if (set2) {
  15970. if (set2 instanceof PseudoMap || typeof Map === "function" && set2 instanceof Map)
  15971. set2.forEach(function(value, key) {
  15972. this.set(key, value);
  15973. }, this);
  15974. else if (Array.isArray(set2))
  15975. set2.forEach(function(kv) {
  15976. this.set(kv[0], kv[1]);
  15977. }, this);
  15978. else
  15979. throw new TypeError("invalid argument");
  15980. }
  15981. }
  15982. PseudoMap.prototype.forEach = function(fn, thisp) {
  15983. thisp = thisp || this;
  15984. Object.keys(this._data).forEach(function(k) {
  15985. if (k !== "size")
  15986. fn.call(thisp, this._data[k].value, this._data[k].key);
  15987. }, this);
  15988. };
  15989. PseudoMap.prototype.has = function(k) {
  15990. return !!find(this._data, k);
  15991. };
  15992. PseudoMap.prototype.get = function(k) {
  15993. var res = find(this._data, k);
  15994. return res && res.value;
  15995. };
  15996. PseudoMap.prototype.set = function(k, v) {
  15997. set(this._data, k, v);
  15998. };
  15999. PseudoMap.prototype.delete = function(k) {
  16000. var res = find(this._data, k);
  16001. if (res) {
  16002. delete this._data[res._index];
  16003. this._data.size--;
  16004. }
  16005. };
  16006. PseudoMap.prototype.clear = function() {
  16007. var data = /* @__PURE__ */ Object.create(null);
  16008. data.size = 0;
  16009. Object.defineProperty(this, "_data", {
  16010. value: data,
  16011. enumerable: false,
  16012. configurable: true,
  16013. writable: false
  16014. });
  16015. };
  16016. Object.defineProperty(PseudoMap.prototype, "size", {
  16017. get: function() {
  16018. return this._data.size;
  16019. },
  16020. set: function(n) {
  16021. },
  16022. enumerable: true,
  16023. configurable: true
  16024. });
  16025. PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
  16026. throw new Error("iterators are not implemented in this version");
  16027. };
  16028. function same(a, b) {
  16029. return a === b || a !== a && b !== b;
  16030. }
  16031. function Entry(k, v, i) {
  16032. this.key = k;
  16033. this.value = v;
  16034. this._index = i;
  16035. }
  16036. function find(data, k) {
  16037. for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
  16038. if (same(data[key].key, k))
  16039. return data[key];
  16040. }
  16041. }
  16042. function set(data, k, v) {
  16043. for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
  16044. if (same(data[key].key, k)) {
  16045. data[key].value = v;
  16046. return;
  16047. }
  16048. }
  16049. data.size++;
  16050. data[key] = new Entry(k, v, key);
  16051. }
  16052. }
  16053. });
  16054. var require_map = __commonJS2({
  16055. "node_modules/pseudomap/map.js"(exports2, module2) {
  16056. if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test")
  16057. process.env.TEST_PSEUDOMAP = "true";
  16058. if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) {
  16059. module2.exports = Map;
  16060. } else {
  16061. module2.exports = require_pseudomap();
  16062. }
  16063. }
  16064. });
  16065. var require_yallist = __commonJS2({
  16066. "node_modules/yallist/yallist.js"(exports2, module2) {
  16067. module2.exports = Yallist;
  16068. Yallist.Node = Node;
  16069. Yallist.create = Yallist;
  16070. function Yallist(list) {
  16071. var self2 = this;
  16072. if (!(self2 instanceof Yallist)) {
  16073. self2 = new Yallist();
  16074. }
  16075. self2.tail = null;
  16076. self2.head = null;
  16077. self2.length = 0;
  16078. if (list && typeof list.forEach === "function") {
  16079. list.forEach(function(item) {
  16080. self2.push(item);
  16081. });
  16082. } else if (arguments.length > 0) {
  16083. for (var i = 0, l = arguments.length; i < l; i++) {
  16084. self2.push(arguments[i]);
  16085. }
  16086. }
  16087. return self2;
  16088. }
  16089. Yallist.prototype.removeNode = function(node) {
  16090. if (node.list !== this) {
  16091. throw new Error("removing node which does not belong to this list");
  16092. }
  16093. var next = node.next;
  16094. var prev = node.prev;
  16095. if (next) {
  16096. next.prev = prev;
  16097. }
  16098. if (prev) {
  16099. prev.next = next;
  16100. }
  16101. if (node === this.head) {
  16102. this.head = next;
  16103. }
  16104. if (node === this.tail) {
  16105. this.tail = prev;
  16106. }
  16107. node.list.length--;
  16108. node.next = null;
  16109. node.prev = null;
  16110. node.list = null;
  16111. };
  16112. Yallist.prototype.unshiftNode = function(node) {
  16113. if (node === this.head) {
  16114. return;
  16115. }
  16116. if (node.list) {
  16117. node.list.removeNode(node);
  16118. }
  16119. var head = this.head;
  16120. node.list = this;
  16121. node.next = head;
  16122. if (head) {
  16123. head.prev = node;
  16124. }
  16125. this.head = node;
  16126. if (!this.tail) {
  16127. this.tail = node;
  16128. }
  16129. this.length++;
  16130. };
  16131. Yallist.prototype.pushNode = function(node) {
  16132. if (node === this.tail) {
  16133. return;
  16134. }
  16135. if (node.list) {
  16136. node.list.removeNode(node);
  16137. }
  16138. var tail = this.tail;
  16139. node.list = this;
  16140. node.prev = tail;
  16141. if (tail) {
  16142. tail.next = node;
  16143. }
  16144. this.tail = node;
  16145. if (!this.head) {
  16146. this.head = node;
  16147. }
  16148. this.length++;
  16149. };
  16150. Yallist.prototype.push = function() {
  16151. for (var i = 0, l = arguments.length; i < l; i++) {
  16152. push(this, arguments[i]);
  16153. }
  16154. return this.length;
  16155. };
  16156. Yallist.prototype.unshift = function() {
  16157. for (var i = 0, l = arguments.length; i < l; i++) {
  16158. unshift(this, arguments[i]);
  16159. }
  16160. return this.length;
  16161. };
  16162. Yallist.prototype.pop = function() {
  16163. if (!this.tail) {
  16164. return void 0;
  16165. }
  16166. var res = this.tail.value;
  16167. this.tail = this.tail.prev;
  16168. if (this.tail) {
  16169. this.tail.next = null;
  16170. } else {
  16171. this.head = null;
  16172. }
  16173. this.length--;
  16174. return res;
  16175. };
  16176. Yallist.prototype.shift = function() {
  16177. if (!this.head) {
  16178. return void 0;
  16179. }
  16180. var res = this.head.value;
  16181. this.head = this.head.next;
  16182. if (this.head) {
  16183. this.head.prev = null;
  16184. } else {
  16185. this.tail = null;
  16186. }
  16187. this.length--;
  16188. return res;
  16189. };
  16190. Yallist.prototype.forEach = function(fn, thisp) {
  16191. thisp = thisp || this;
  16192. for (var walker = this.head, i = 0; walker !== null; i++) {
  16193. fn.call(thisp, walker.value, i, this);
  16194. walker = walker.next;
  16195. }
  16196. };
  16197. Yallist.prototype.forEachReverse = function(fn, thisp) {
  16198. thisp = thisp || this;
  16199. for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
  16200. fn.call(thisp, walker.value, i, this);
  16201. walker = walker.prev;
  16202. }
  16203. };
  16204. Yallist.prototype.get = function(n) {
  16205. for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
  16206. walker = walker.next;
  16207. }
  16208. if (i === n && walker !== null) {
  16209. return walker.value;
  16210. }
  16211. };
  16212. Yallist.prototype.getReverse = function(n) {
  16213. for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
  16214. walker = walker.prev;
  16215. }
  16216. if (i === n && walker !== null) {
  16217. return walker.value;
  16218. }
  16219. };
  16220. Yallist.prototype.map = function(fn, thisp) {
  16221. thisp = thisp || this;
  16222. var res = new Yallist();
  16223. for (var walker = this.head; walker !== null; ) {
  16224. res.push(fn.call(thisp, walker.value, this));
  16225. walker = walker.next;
  16226. }
  16227. return res;
  16228. };
  16229. Yallist.prototype.mapReverse = function(fn, thisp) {
  16230. thisp = thisp || this;
  16231. var res = new Yallist();
  16232. for (var walker = this.tail; walker !== null; ) {
  16233. res.push(fn.call(thisp, walker.value, this));
  16234. walker = walker.prev;
  16235. }
  16236. return res;
  16237. };
  16238. Yallist.prototype.reduce = function(fn, initial) {
  16239. var acc;
  16240. var walker = this.head;
  16241. if (arguments.length > 1) {
  16242. acc = initial;
  16243. } else if (this.head) {
  16244. walker = this.head.next;
  16245. acc = this.head.value;
  16246. } else {
  16247. throw new TypeError("Reduce of empty list with no initial value");
  16248. }
  16249. for (var i = 0; walker !== null; i++) {
  16250. acc = fn(acc, walker.value, i);
  16251. walker = walker.next;
  16252. }
  16253. return acc;
  16254. };
  16255. Yallist.prototype.reduceReverse = function(fn, initial) {
  16256. var acc;
  16257. var walker = this.tail;
  16258. if (arguments.length > 1) {
  16259. acc = initial;
  16260. } else if (this.tail) {
  16261. walker = this.tail.prev;
  16262. acc = this.tail.value;
  16263. } else {
  16264. throw new TypeError("Reduce of empty list with no initial value");
  16265. }
  16266. for (var i = this.length - 1; walker !== null; i--) {
  16267. acc = fn(acc, walker.value, i);
  16268. walker = walker.prev;
  16269. }
  16270. return acc;
  16271. };
  16272. Yallist.prototype.toArray = function() {
  16273. var arr = new Array(this.length);
  16274. for (var i = 0, walker = this.head; walker !== null; i++) {
  16275. arr[i] = walker.value;
  16276. walker = walker.next;
  16277. }
  16278. return arr;
  16279. };
  16280. Yallist.prototype.toArrayReverse = function() {
  16281. var arr = new Array(this.length);
  16282. for (var i = 0, walker = this.tail; walker !== null; i++) {
  16283. arr[i] = walker.value;
  16284. walker = walker.prev;
  16285. }
  16286. return arr;
  16287. };
  16288. Yallist.prototype.slice = function(from, to) {
  16289. to = to || this.length;
  16290. if (to < 0) {
  16291. to += this.length;
  16292. }
  16293. from = from || 0;
  16294. if (from < 0) {
  16295. from += this.length;
  16296. }
  16297. var ret = new Yallist();
  16298. if (to < from || to < 0) {
  16299. return ret;
  16300. }
  16301. if (from < 0) {
  16302. from = 0;
  16303. }
  16304. if (to > this.length) {
  16305. to = this.length;
  16306. }
  16307. for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
  16308. walker = walker.next;
  16309. }
  16310. for (; walker !== null && i < to; i++, walker = walker.next) {
  16311. ret.push(walker.value);
  16312. }
  16313. return ret;
  16314. };
  16315. Yallist.prototype.sliceReverse = function(from, to) {
  16316. to = to || this.length;
  16317. if (to < 0) {
  16318. to += this.length;
  16319. }
  16320. from = from || 0;
  16321. if (from < 0) {
  16322. from += this.length;
  16323. }
  16324. var ret = new Yallist();
  16325. if (to < from || to < 0) {
  16326. return ret;
  16327. }
  16328. if (from < 0) {
  16329. from = 0;
  16330. }
  16331. if (to > this.length) {
  16332. to = this.length;
  16333. }
  16334. for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
  16335. walker = walker.prev;
  16336. }
  16337. for (; walker !== null && i > from; i--, walker = walker.prev) {
  16338. ret.push(walker.value);
  16339. }
  16340. return ret;
  16341. };
  16342. Yallist.prototype.reverse = function() {
  16343. var head = this.head;
  16344. var tail = this.tail;
  16345. for (var walker = head; walker !== null; walker = walker.prev) {
  16346. var p = walker.prev;
  16347. walker.prev = walker.next;
  16348. walker.next = p;
  16349. }
  16350. this.head = tail;
  16351. this.tail = head;
  16352. return this;
  16353. };
  16354. function push(self2, item) {
  16355. self2.tail = new Node(item, self2.tail, null, self2);
  16356. if (!self2.head) {
  16357. self2.head = self2.tail;
  16358. }
  16359. self2.length++;
  16360. }
  16361. function unshift(self2, item) {
  16362. self2.head = new Node(item, null, self2.head, self2);
  16363. if (!self2.tail) {
  16364. self2.tail = self2.head;
  16365. }
  16366. self2.length++;
  16367. }
  16368. function Node(value, prev, next, list) {
  16369. if (!(this instanceof Node)) {
  16370. return new Node(value, prev, next, list);
  16371. }
  16372. this.list = list;
  16373. this.value = value;
  16374. if (prev) {
  16375. prev.next = this;
  16376. this.prev = prev;
  16377. } else {
  16378. this.prev = null;
  16379. }
  16380. if (next) {
  16381. next.prev = this;
  16382. this.next = next;
  16383. } else {
  16384. this.next = null;
  16385. }
  16386. }
  16387. }
  16388. });
  16389. var require_lru_cache = __commonJS2({
  16390. "node_modules/lru-cache/index.js"(exports2, module2) {
  16391. "use strict";
  16392. module2.exports = LRUCache;
  16393. var Map2 = require_map();
  16394. var util = require("util");
  16395. var Yallist = require_yallist();
  16396. var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1";
  16397. var makeSymbol;
  16398. if (hasSymbol) {
  16399. makeSymbol = function(key) {
  16400. return Symbol(key);
  16401. };
  16402. } else {
  16403. makeSymbol = function(key) {
  16404. return "_" + key;
  16405. };
  16406. }
  16407. var MAX = makeSymbol("max");
  16408. var LENGTH = makeSymbol("length");
  16409. var LENGTH_CALCULATOR = makeSymbol("lengthCalculator");
  16410. var ALLOW_STALE = makeSymbol("allowStale");
  16411. var MAX_AGE = makeSymbol("maxAge");
  16412. var DISPOSE = makeSymbol("dispose");
  16413. var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet");
  16414. var LRU_LIST = makeSymbol("lruList");
  16415. var CACHE = makeSymbol("cache");
  16416. function naiveLength() {
  16417. return 1;
  16418. }
  16419. function LRUCache(options) {
  16420. if (!(this instanceof LRUCache)) {
  16421. return new LRUCache(options);
  16422. }
  16423. if (typeof options === "number") {
  16424. options = {
  16425. max: options
  16426. };
  16427. }
  16428. if (!options) {
  16429. options = {};
  16430. }
  16431. var max = this[MAX] = options.max;
  16432. if (!max || !(typeof max === "number") || max <= 0) {
  16433. this[MAX] = Infinity;
  16434. }
  16435. var lc = options.length || naiveLength;
  16436. if (typeof lc !== "function") {
  16437. lc = naiveLength;
  16438. }
  16439. this[LENGTH_CALCULATOR] = lc;
  16440. this[ALLOW_STALE] = options.stale || false;
  16441. this[MAX_AGE] = options.maxAge || 0;
  16442. this[DISPOSE] = options.dispose;
  16443. this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
  16444. this.reset();
  16445. }
  16446. Object.defineProperty(LRUCache.prototype, "max", {
  16447. set: function(mL) {
  16448. if (!mL || !(typeof mL === "number") || mL <= 0) {
  16449. mL = Infinity;
  16450. }
  16451. this[MAX] = mL;
  16452. trim(this);
  16453. },
  16454. get: function() {
  16455. return this[MAX];
  16456. },
  16457. enumerable: true
  16458. });
  16459. Object.defineProperty(LRUCache.prototype, "allowStale", {
  16460. set: function(allowStale) {
  16461. this[ALLOW_STALE] = !!allowStale;
  16462. },
  16463. get: function() {
  16464. return this[ALLOW_STALE];
  16465. },
  16466. enumerable: true
  16467. });
  16468. Object.defineProperty(LRUCache.prototype, "maxAge", {
  16469. set: function(mA) {
  16470. if (!mA || !(typeof mA === "number") || mA < 0) {
  16471. mA = 0;
  16472. }
  16473. this[MAX_AGE] = mA;
  16474. trim(this);
  16475. },
  16476. get: function() {
  16477. return this[MAX_AGE];
  16478. },
  16479. enumerable: true
  16480. });
  16481. Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
  16482. set: function(lC) {
  16483. if (typeof lC !== "function") {
  16484. lC = naiveLength;
  16485. }
  16486. if (lC !== this[LENGTH_CALCULATOR]) {
  16487. this[LENGTH_CALCULATOR] = lC;
  16488. this[LENGTH] = 0;
  16489. this[LRU_LIST].forEach(function(hit) {
  16490. hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
  16491. this[LENGTH] += hit.length;
  16492. }, this);
  16493. }
  16494. trim(this);
  16495. },
  16496. get: function() {
  16497. return this[LENGTH_CALCULATOR];
  16498. },
  16499. enumerable: true
  16500. });
  16501. Object.defineProperty(LRUCache.prototype, "length", {
  16502. get: function() {
  16503. return this[LENGTH];
  16504. },
  16505. enumerable: true
  16506. });
  16507. Object.defineProperty(LRUCache.prototype, "itemCount", {
  16508. get: function() {
  16509. return this[LRU_LIST].length;
  16510. },
  16511. enumerable: true
  16512. });
  16513. LRUCache.prototype.rforEach = function(fn, thisp) {
  16514. thisp = thisp || this;
  16515. for (var walker = this[LRU_LIST].tail; walker !== null; ) {
  16516. var prev = walker.prev;
  16517. forEachStep(this, fn, walker, thisp);
  16518. walker = prev;
  16519. }
  16520. };
  16521. function forEachStep(self2, fn, node, thisp) {
  16522. var hit = node.value;
  16523. if (isStale(self2, hit)) {
  16524. del(self2, node);
  16525. if (!self2[ALLOW_STALE]) {
  16526. hit = void 0;
  16527. }
  16528. }
  16529. if (hit) {
  16530. fn.call(thisp, hit.value, hit.key, self2);
  16531. }
  16532. }
  16533. LRUCache.prototype.forEach = function(fn, thisp) {
  16534. thisp = thisp || this;
  16535. for (var walker = this[LRU_LIST].head; walker !== null; ) {
  16536. var next = walker.next;
  16537. forEachStep(this, fn, walker, thisp);
  16538. walker = next;
  16539. }
  16540. };
  16541. LRUCache.prototype.keys = function() {
  16542. return this[LRU_LIST].toArray().map(function(k) {
  16543. return k.key;
  16544. }, this);
  16545. };
  16546. LRUCache.prototype.values = function() {
  16547. return this[LRU_LIST].toArray().map(function(k) {
  16548. return k.value;
  16549. }, this);
  16550. };
  16551. LRUCache.prototype.reset = function() {
  16552. if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
  16553. this[LRU_LIST].forEach(function(hit) {
  16554. this[DISPOSE](hit.key, hit.value);
  16555. }, this);
  16556. }
  16557. this[CACHE] = new Map2();
  16558. this[LRU_LIST] = new Yallist();
  16559. this[LENGTH] = 0;
  16560. };
  16561. LRUCache.prototype.dump = function() {
  16562. return this[LRU_LIST].map(function(hit) {
  16563. if (!isStale(this, hit)) {
  16564. return {
  16565. k: hit.key,
  16566. v: hit.value,
  16567. e: hit.now + (hit.maxAge || 0)
  16568. };
  16569. }
  16570. }, this).toArray().filter(function(h) {
  16571. return h;
  16572. });
  16573. };
  16574. LRUCache.prototype.dumpLru = function() {
  16575. return this[LRU_LIST];
  16576. };
  16577. LRUCache.prototype.inspect = function(n, opts) {
  16578. var str = "LRUCache {";
  16579. var extras = false;
  16580. var as = this[ALLOW_STALE];
  16581. if (as) {
  16582. str += "\n allowStale: true";
  16583. extras = true;
  16584. }
  16585. var max = this[MAX];
  16586. if (max && max !== Infinity) {
  16587. if (extras) {
  16588. str += ",";
  16589. }
  16590. str += "\n max: " + util.inspect(max, opts);
  16591. extras = true;
  16592. }
  16593. var maxAge = this[MAX_AGE];
  16594. if (maxAge) {
  16595. if (extras) {
  16596. str += ",";
  16597. }
  16598. str += "\n maxAge: " + util.inspect(maxAge, opts);
  16599. extras = true;
  16600. }
  16601. var lc = this[LENGTH_CALCULATOR];
  16602. if (lc && lc !== naiveLength) {
  16603. if (extras) {
  16604. str += ",";
  16605. }
  16606. str += "\n length: " + util.inspect(this[LENGTH], opts);
  16607. extras = true;
  16608. }
  16609. var didFirst = false;
  16610. this[LRU_LIST].forEach(function(item) {
  16611. if (didFirst) {
  16612. str += ",\n ";
  16613. } else {
  16614. if (extras) {
  16615. str += ",\n";
  16616. }
  16617. didFirst = true;
  16618. str += "\n ";
  16619. }
  16620. var key = util.inspect(item.key).split("\n").join("\n ");
  16621. var val = {
  16622. value: item.value
  16623. };
  16624. if (item.maxAge !== maxAge) {
  16625. val.maxAge = item.maxAge;
  16626. }
  16627. if (lc !== naiveLength) {
  16628. val.length = item.length;
  16629. }
  16630. if (isStale(this, item)) {
  16631. val.stale = true;
  16632. }
  16633. val = util.inspect(val, opts).split("\n").join("\n ");
  16634. str += key + " => " + val;
  16635. });
  16636. if (didFirst || extras) {
  16637. str += "\n";
  16638. }
  16639. str += "}";
  16640. return str;
  16641. };
  16642. LRUCache.prototype.set = function(key, value, maxAge) {
  16643. maxAge = maxAge || this[MAX_AGE];
  16644. var now = maxAge ? Date.now() : 0;
  16645. var len = this[LENGTH_CALCULATOR](value, key);
  16646. if (this[CACHE].has(key)) {
  16647. if (len > this[MAX]) {
  16648. del(this, this[CACHE].get(key));
  16649. return false;
  16650. }
  16651. var node = this[CACHE].get(key);
  16652. var item = node.value;
  16653. if (this[DISPOSE]) {
  16654. if (!this[NO_DISPOSE_ON_SET]) {
  16655. this[DISPOSE](key, item.value);
  16656. }
  16657. }
  16658. item.now = now;
  16659. item.maxAge = maxAge;
  16660. item.value = value;
  16661. this[LENGTH] += len - item.length;
  16662. item.length = len;
  16663. this.get(key);
  16664. trim(this);
  16665. return true;
  16666. }
  16667. var hit = new Entry(key, value, len, now, maxAge);
  16668. if (hit.length > this[MAX]) {
  16669. if (this[DISPOSE]) {
  16670. this[DISPOSE](key, value);
  16671. }
  16672. return false;
  16673. }
  16674. this[LENGTH] += hit.length;
  16675. this[LRU_LIST].unshift(hit);
  16676. this[CACHE].set(key, this[LRU_LIST].head);
  16677. trim(this);
  16678. return true;
  16679. };
  16680. LRUCache.prototype.has = function(key) {
  16681. if (!this[CACHE].has(key))
  16682. return false;
  16683. var hit = this[CACHE].get(key).value;
  16684. if (isStale(this, hit)) {
  16685. return false;
  16686. }
  16687. return true;
  16688. };
  16689. LRUCache.prototype.get = function(key) {
  16690. return get(this, key, true);
  16691. };
  16692. LRUCache.prototype.peek = function(key) {
  16693. return get(this, key, false);
  16694. };
  16695. LRUCache.prototype.pop = function() {
  16696. var node = this[LRU_LIST].tail;
  16697. if (!node)
  16698. return null;
  16699. del(this, node);
  16700. return node.value;
  16701. };
  16702. LRUCache.prototype.del = function(key) {
  16703. del(this, this[CACHE].get(key));
  16704. };
  16705. LRUCache.prototype.load = function(arr) {
  16706. this.reset();
  16707. var now = Date.now();
  16708. for (var l = arr.length - 1; l >= 0; l--) {
  16709. var hit = arr[l];
  16710. var expiresAt = hit.e || 0;
  16711. if (expiresAt === 0) {
  16712. this.set(hit.k, hit.v);
  16713. } else {
  16714. var maxAge = expiresAt - now;
  16715. if (maxAge > 0) {
  16716. this.set(hit.k, hit.v, maxAge);
  16717. }
  16718. }
  16719. }
  16720. };
  16721. LRUCache.prototype.prune = function() {
  16722. var self2 = this;
  16723. this[CACHE].forEach(function(value, key) {
  16724. get(self2, key, false);
  16725. });
  16726. };
  16727. function get(self2, key, doUse) {
  16728. var node = self2[CACHE].get(key);
  16729. if (node) {
  16730. var hit = node.value;
  16731. if (isStale(self2, hit)) {
  16732. del(self2, node);
  16733. if (!self2[ALLOW_STALE])
  16734. hit = void 0;
  16735. } else {
  16736. if (doUse) {
  16737. self2[LRU_LIST].unshiftNode(node);
  16738. }
  16739. }
  16740. if (hit)
  16741. hit = hit.value;
  16742. }
  16743. return hit;
  16744. }
  16745. function isStale(self2, hit) {
  16746. if (!hit || !hit.maxAge && !self2[MAX_AGE]) {
  16747. return false;
  16748. }
  16749. var stale = false;
  16750. var diff = Date.now() - hit.now;
  16751. if (hit.maxAge) {
  16752. stale = diff > hit.maxAge;
  16753. } else {
  16754. stale = self2[MAX_AGE] && diff > self2[MAX_AGE];
  16755. }
  16756. return stale;
  16757. }
  16758. function trim(self2) {
  16759. if (self2[LENGTH] > self2[MAX]) {
  16760. for (var walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
  16761. var prev = walker.prev;
  16762. del(self2, walker);
  16763. walker = prev;
  16764. }
  16765. }
  16766. }
  16767. function del(self2, node) {
  16768. if (node) {
  16769. var hit = node.value;
  16770. if (self2[DISPOSE]) {
  16771. self2[DISPOSE](hit.key, hit.value);
  16772. }
  16773. self2[LENGTH] -= hit.length;
  16774. self2[CACHE].delete(hit.key);
  16775. self2[LRU_LIST].removeNode(node);
  16776. }
  16777. }
  16778. function Entry(key, value, length, now, maxAge) {
  16779. this.key = key;
  16780. this.value = value;
  16781. this.length = length;
  16782. this.now = now;
  16783. this.maxAge = maxAge || 0;
  16784. }
  16785. }
  16786. });
  16787. var require_sigmund = __commonJS2({
  16788. "node_modules/sigmund/sigmund.js"(exports2, module2) {
  16789. module2.exports = sigmund;
  16790. function sigmund(subject, maxSessions) {
  16791. maxSessions = maxSessions || 10;
  16792. var notes = [];
  16793. var analysis = "";
  16794. var RE = RegExp;
  16795. function psychoAnalyze(subject2, session) {
  16796. if (session > maxSessions)
  16797. return;
  16798. if (typeof subject2 === "function" || typeof subject2 === "undefined") {
  16799. return;
  16800. }
  16801. if (typeof subject2 !== "object" || !subject2 || subject2 instanceof RE) {
  16802. analysis += subject2;
  16803. return;
  16804. }
  16805. if (notes.indexOf(subject2) !== -1 || session === maxSessions)
  16806. return;
  16807. notes.push(subject2);
  16808. analysis += "{";
  16809. Object.keys(subject2).forEach(function(issue, _, __) {
  16810. if (issue.charAt(0) === "_")
  16811. return;
  16812. var to = typeof subject2[issue];
  16813. if (to === "function" || to === "undefined")
  16814. return;
  16815. analysis += issue;
  16816. psychoAnalyze(subject2[issue], session + 1);
  16817. });
  16818. }
  16819. psychoAnalyze(subject, 0);
  16820. return analysis;
  16821. }
  16822. }
  16823. });
  16824. var require_fnmatch = __commonJS2({
  16825. "node_modules/editorconfig/src/lib/fnmatch.js"(exports2, module2) {
  16826. var platform = typeof process === "object" ? process.platform : "win32";
  16827. if (module2)
  16828. module2.exports = minimatch;
  16829. else
  16830. exports2.minimatch = minimatch;
  16831. minimatch.Minimatch = Minimatch;
  16832. var LRU = require_lru_cache();
  16833. var cache = minimatch.cache = new LRU({
  16834. max: 100
  16835. });
  16836. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
  16837. var sigmund = require_sigmund();
  16838. var path = require("path");
  16839. var qmark = "[^/]";
  16840. var star = qmark + "*?";
  16841. var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
  16842. var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
  16843. var reSpecials = charSet("().*{}+?[]^$\\!");
  16844. function charSet(s) {
  16845. return s.split("").reduce(function(set, c) {
  16846. set[c] = true;
  16847. return set;
  16848. }, {});
  16849. }
  16850. var slashSplit = /\/+/;
  16851. minimatch.monkeyPatch = monkeyPatch;
  16852. function monkeyPatch() {
  16853. var desc = Object.getOwnPropertyDescriptor(String.prototype, "match");
  16854. var orig = desc.value;
  16855. desc.value = function(p) {
  16856. if (p instanceof Minimatch)
  16857. return p.match(this);
  16858. return orig.call(this, p);
  16859. };
  16860. Object.defineProperty(String.prototype, desc);
  16861. }
  16862. minimatch.filter = filter;
  16863. function filter(pattern, options) {
  16864. options = options || {};
  16865. return function(p, i, list) {
  16866. return minimatch(p, pattern, options);
  16867. };
  16868. }
  16869. function ext(a, b) {
  16870. a = a || {};
  16871. b = b || {};
  16872. var t = {};
  16873. Object.keys(b).forEach(function(k) {
  16874. t[k] = b[k];
  16875. });
  16876. Object.keys(a).forEach(function(k) {
  16877. t[k] = a[k];
  16878. });
  16879. return t;
  16880. }
  16881. minimatch.defaults = function(def) {
  16882. if (!def || !Object.keys(def).length)
  16883. return minimatch;
  16884. var orig = minimatch;
  16885. var m = function minimatch2(p, pattern, options) {
  16886. return orig.minimatch(p, pattern, ext(def, options));
  16887. };
  16888. m.Minimatch = function Minimatch2(pattern, options) {
  16889. return new orig.Minimatch(pattern, ext(def, options));
  16890. };
  16891. return m;
  16892. };
  16893. Minimatch.defaults = function(def) {
  16894. if (!def || !Object.keys(def).length)
  16895. return Minimatch;
  16896. return minimatch.defaults(def).Minimatch;
  16897. };
  16898. function minimatch(p, pattern, options) {
  16899. if (typeof pattern !== "string") {
  16900. throw new TypeError("glob pattern string required");
  16901. }
  16902. if (!options)
  16903. options = {};
  16904. if (!options.nocomment && pattern.charAt(0) === "#") {
  16905. return false;
  16906. }
  16907. if (pattern.trim() === "")
  16908. return p === "";
  16909. return new Minimatch(pattern, options).match(p);
  16910. }
  16911. function Minimatch(pattern, options) {
  16912. if (!(this instanceof Minimatch)) {
  16913. return new Minimatch(pattern, options, cache);
  16914. }
  16915. if (typeof pattern !== "string") {
  16916. throw new TypeError("glob pattern string required");
  16917. }
  16918. if (!options)
  16919. options = {};
  16920. if (platform === "win32") {
  16921. pattern = pattern.split("\\").join("/");
  16922. }
  16923. var cacheKey = pattern + "\n" + sigmund(options);
  16924. var cached = minimatch.cache.get(cacheKey);
  16925. if (cached)
  16926. return cached;
  16927. minimatch.cache.set(cacheKey, this);
  16928. this.options = options;
  16929. this.set = [];
  16930. this.pattern = pattern;
  16931. this.regexp = null;
  16932. this.negate = false;
  16933. this.comment = false;
  16934. this.empty = false;
  16935. this.make();
  16936. }
  16937. Minimatch.prototype.make = make;
  16938. function make() {
  16939. if (this._made)
  16940. return;
  16941. var pattern = this.pattern;
  16942. var options = this.options;
  16943. if (!options.nocomment && pattern.charAt(0) === "#") {
  16944. this.comment = true;
  16945. return;
  16946. }
  16947. if (!pattern) {
  16948. this.empty = true;
  16949. return;
  16950. }
  16951. this.parseNegate();
  16952. var set = this.globSet = this.braceExpand();
  16953. if (options.debug)
  16954. console.error(this.pattern, set);
  16955. set = this.globParts = set.map(function(s) {
  16956. return s.split(slashSplit);
  16957. });
  16958. if (options.debug)
  16959. console.error(this.pattern, set);
  16960. set = set.map(function(s, si, set2) {
  16961. return s.map(this.parse, this);
  16962. }, this);
  16963. if (options.debug)
  16964. console.error(this.pattern, set);
  16965. set = set.filter(function(s) {
  16966. return s.indexOf(false) === -1;
  16967. });
  16968. if (options.debug)
  16969. console.error(this.pattern, set);
  16970. this.set = set;
  16971. }
  16972. Minimatch.prototype.parseNegate = parseNegate;
  16973. function parseNegate() {
  16974. var pattern = this.pattern, negate = false, options = this.options, negateOffset = 0;
  16975. if (options.nonegate)
  16976. return;
  16977. for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
  16978. negate = !negate;
  16979. negateOffset++;
  16980. }
  16981. if (negateOffset)
  16982. this.pattern = pattern.substr(negateOffset);
  16983. this.negate = negate;
  16984. }
  16985. minimatch.braceExpand = function(pattern, options) {
  16986. return new Minimatch(pattern, options).braceExpand();
  16987. };
  16988. Minimatch.prototype.braceExpand = braceExpand;
  16989. function braceExpand(pattern, options) {
  16990. options = options || this.options;
  16991. pattern = typeof pattern === "undefined" ? this.pattern : pattern;
  16992. if (typeof pattern === "undefined") {
  16993. throw new Error("undefined pattern");
  16994. }
  16995. if (options.nobrace || !pattern.match(/\{.*\}/)) {
  16996. return [pattern];
  16997. }
  16998. var escaping = false;
  16999. if (pattern.charAt(0) !== "{") {
  17000. var prefix = null;
  17001. for (var i = 0, l = pattern.length; i < l; i++) {
  17002. var c = pattern.charAt(i);
  17003. if (c === "\\") {
  17004. escaping = !escaping;
  17005. } else if (c === "{" && !escaping) {
  17006. prefix = pattern.substr(0, i);
  17007. break;
  17008. }
  17009. }
  17010. if (prefix === null) {
  17011. return [pattern];
  17012. }
  17013. var tail = braceExpand(pattern.substr(i), options);
  17014. return tail.map(function(t) {
  17015. return prefix + t;
  17016. });
  17017. }
  17018. var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);
  17019. if (numset) {
  17020. var suf = braceExpand(pattern.substr(numset[0].length), options), start = +numset[1], end = +numset[2], inc = start > end ? -1 : 1, set = [];
  17021. for (var i = start; i != end + inc; i += inc) {
  17022. for (var ii = 0, ll = suf.length; ii < ll; ii++) {
  17023. set.push(i + suf[ii]);
  17024. }
  17025. }
  17026. return set;
  17027. }
  17028. var i = 1, depth = 1, set = [], member = "", sawEnd = false, escaping = false;
  17029. function addMember() {
  17030. set.push(member);
  17031. member = "";
  17032. }
  17033. FOR:
  17034. for (i = 1, l = pattern.length; i < l; i++) {
  17035. var c = pattern.charAt(i);
  17036. if (escaping) {
  17037. escaping = false;
  17038. member += "\\" + c;
  17039. } else {
  17040. switch (c) {
  17041. case "\\":
  17042. escaping = true;
  17043. continue;
  17044. case "{":
  17045. depth++;
  17046. member += "{";
  17047. continue;
  17048. case "}":
  17049. depth--;
  17050. if (depth === 0) {
  17051. addMember();
  17052. i++;
  17053. break FOR;
  17054. } else {
  17055. member += c;
  17056. continue;
  17057. }
  17058. case ",":
  17059. if (depth === 1) {
  17060. addMember();
  17061. } else {
  17062. member += c;
  17063. }
  17064. continue;
  17065. default:
  17066. member += c;
  17067. continue;
  17068. }
  17069. }
  17070. }
  17071. if (depth !== 0) {
  17072. return braceExpand("\\" + pattern, options);
  17073. }
  17074. var suf = braceExpand(pattern.substr(i), options);
  17075. var addBraces = set.length === 1;
  17076. set = set.map(function(p) {
  17077. return braceExpand(p, options);
  17078. });
  17079. set = set.reduce(function(l2, r) {
  17080. return l2.concat(r);
  17081. });
  17082. if (addBraces) {
  17083. set = set.map(function(s) {
  17084. return "{" + s + "}";
  17085. });
  17086. }
  17087. var ret = [];
  17088. for (var i = 0, l = set.length; i < l; i++) {
  17089. for (var ii = 0, ll = suf.length; ii < ll; ii++) {
  17090. ret.push(set[i] + suf[ii]);
  17091. }
  17092. }
  17093. return ret;
  17094. }
  17095. Minimatch.prototype.parse = parse;
  17096. var SUBPARSE = {};
  17097. function parse(pattern, isSub) {
  17098. var options = this.options;
  17099. if (!options.noglobstar && pattern === "**")
  17100. return GLOBSTAR;
  17101. if (pattern === "")
  17102. return "";
  17103. var re = "", hasMagic = !!options.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
  17104. function clearStateChar() {
  17105. if (stateChar) {
  17106. switch (stateChar) {
  17107. case "*":
  17108. re += star;
  17109. hasMagic = true;
  17110. break;
  17111. case "?":
  17112. re += qmark;
  17113. hasMagic = true;
  17114. break;
  17115. default:
  17116. re += "\\" + stateChar;
  17117. break;
  17118. }
  17119. stateChar = false;
  17120. }
  17121. }
  17122. for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
  17123. if (options.debug) {
  17124. console.error("%s %s %s %j", pattern, i, re, c);
  17125. }
  17126. if (escaping && reSpecials[c]) {
  17127. re += "\\" + c;
  17128. escaping = false;
  17129. continue;
  17130. }
  17131. SWITCH:
  17132. switch (c) {
  17133. case "/":
  17134. return false;
  17135. case "\\":
  17136. clearStateChar();
  17137. escaping = true;
  17138. continue;
  17139. case "?":
  17140. case "*":
  17141. case "+":
  17142. case "@":
  17143. case "!":
  17144. if (options.debug) {
  17145. console.error("%s %s %s %j <-- stateChar", pattern, i, re, c);
  17146. }
  17147. if (inClass) {
  17148. if (c === "!" && i === classStart + 1)
  17149. c = "^";
  17150. re += c;
  17151. continue;
  17152. }
  17153. clearStateChar();
  17154. stateChar = c;
  17155. if (options.noext)
  17156. clearStateChar();
  17157. continue;
  17158. case "(":
  17159. if (inClass) {
  17160. re += "(";
  17161. continue;
  17162. }
  17163. if (!stateChar) {
  17164. re += "\\(";
  17165. continue;
  17166. }
  17167. plType = stateChar;
  17168. patternListStack.push({
  17169. type: plType,
  17170. start: i - 1,
  17171. reStart: re.length
  17172. });
  17173. re += stateChar === "!" ? "(?:(?!" : "(?:";
  17174. stateChar = false;
  17175. continue;
  17176. case ")":
  17177. if (inClass || !patternListStack.length) {
  17178. re += "\\)";
  17179. continue;
  17180. }
  17181. hasMagic = true;
  17182. re += ")";
  17183. plType = patternListStack.pop().type;
  17184. switch (plType) {
  17185. case "!":
  17186. re += "[^/]*?)";
  17187. break;
  17188. case "?":
  17189. case "+":
  17190. case "*":
  17191. re += plType;
  17192. case "@":
  17193. break;
  17194. }
  17195. continue;
  17196. case "|":
  17197. if (inClass || !patternListStack.length || escaping) {
  17198. re += "\\|";
  17199. escaping = false;
  17200. continue;
  17201. }
  17202. re += "|";
  17203. continue;
  17204. case "[":
  17205. clearStateChar();
  17206. if (inClass) {
  17207. re += "\\" + c;
  17208. continue;
  17209. }
  17210. inClass = true;
  17211. classStart = i;
  17212. reClassStart = re.length;
  17213. re += c;
  17214. continue;
  17215. case "]":
  17216. if (i === classStart + 1 || !inClass) {
  17217. re += "\\" + c;
  17218. escaping = false;
  17219. continue;
  17220. }
  17221. hasMagic = true;
  17222. inClass = false;
  17223. re += c;
  17224. continue;
  17225. default:
  17226. clearStateChar();
  17227. if (escaping) {
  17228. escaping = false;
  17229. } else if (reSpecials[c] && !(c === "^" && inClass)) {
  17230. re += "\\";
  17231. }
  17232. re += c;
  17233. }
  17234. }
  17235. if (inClass) {
  17236. var cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE);
  17237. re = re.substr(0, reClassStart) + "\\[" + sp[0];
  17238. hasMagic = hasMagic || sp[1];
  17239. }
  17240. var pl;
  17241. while (pl = patternListStack.pop()) {
  17242. var tail = re.slice(pl.reStart + 3);
  17243. tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function(_, $1, $2) {
  17244. if (!$2) {
  17245. $2 = "\\";
  17246. }
  17247. return $1 + $1 + $2 + "|";
  17248. });
  17249. var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
  17250. hasMagic = true;
  17251. re = re.slice(0, pl.reStart) + t + "\\(" + tail;
  17252. }
  17253. clearStateChar();
  17254. if (escaping) {
  17255. re += "\\\\";
  17256. }
  17257. var addPatternStart = false;
  17258. switch (re.charAt(0)) {
  17259. case ".":
  17260. case "[":
  17261. case "(":
  17262. addPatternStart = true;
  17263. }
  17264. if (re !== "" && hasMagic)
  17265. re = "(?=.)" + re;
  17266. if (addPatternStart)
  17267. re = patternStart + re;
  17268. if (isSub === SUBPARSE) {
  17269. return [re, hasMagic];
  17270. }
  17271. if (!hasMagic) {
  17272. return globUnescape(pattern);
  17273. }
  17274. var flags = options.nocase ? "i" : "", regExp = new RegExp("^" + re + "$", flags);
  17275. regExp._glob = pattern;
  17276. regExp._src = re;
  17277. return regExp;
  17278. }
  17279. minimatch.makeRe = function(pattern, options) {
  17280. return new Minimatch(pattern, options || {}).makeRe();
  17281. };
  17282. Minimatch.prototype.makeRe = makeRe;
  17283. function makeRe() {
  17284. if (this.regexp || this.regexp === false)
  17285. return this.regexp;
  17286. var set = this.set;
  17287. if (!set.length)
  17288. return this.regexp = false;
  17289. var options = this.options;
  17290. var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot, flags = options.nocase ? "i" : "";
  17291. var re = set.map(function(pattern) {
  17292. return pattern.map(function(p) {
  17293. return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
  17294. }).join("\\/");
  17295. }).join("|");
  17296. re = "^(?:" + re + ")$";
  17297. if (this.negate)
  17298. re = "^(?!" + re + ").*$";
  17299. try {
  17300. return this.regexp = new RegExp(re, flags);
  17301. } catch (ex) {
  17302. return this.regexp = false;
  17303. }
  17304. }
  17305. minimatch.match = function(list, pattern, options) {
  17306. var mm = new Minimatch(pattern, options);
  17307. list = list.filter(function(f) {
  17308. return mm.match(f);
  17309. });
  17310. if (options.nonull && !list.length) {
  17311. list.push(pattern);
  17312. }
  17313. return list;
  17314. };
  17315. Minimatch.prototype.match = match;
  17316. function match(f, partial) {
  17317. if (this.comment)
  17318. return false;
  17319. if (this.empty)
  17320. return f === "";
  17321. if (f === "/" && partial)
  17322. return true;
  17323. var options = this.options;
  17324. if (platform === "win32") {
  17325. f = f.split("\\").join("/");
  17326. }
  17327. f = f.split(slashSplit);
  17328. if (options.debug) {
  17329. console.error(this.pattern, "split", f);
  17330. }
  17331. var set = this.set;
  17332. for (var i = 0, l = set.length; i < l; i++) {
  17333. var pattern = set[i];
  17334. var hit = this.matchOne(f, pattern, partial);
  17335. if (hit) {
  17336. if (options.flipNegate)
  17337. return true;
  17338. return !this.negate;
  17339. }
  17340. }
  17341. if (options.flipNegate)
  17342. return false;
  17343. return this.negate;
  17344. }
  17345. Minimatch.prototype.matchOne = function(file, pattern, partial) {
  17346. var options = this.options;
  17347. if (options.debug) {
  17348. console.error("matchOne", {
  17349. "this": this,
  17350. file,
  17351. pattern
  17352. });
  17353. }
  17354. if (options.matchBase && pattern.length === 1) {
  17355. file = path.basename(file.join("/")).split("/");
  17356. }
  17357. if (options.debug) {
  17358. console.error("matchOne", file.length, pattern.length);
  17359. }
  17360. for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
  17361. if (options.debug) {
  17362. console.error("matchOne loop");
  17363. }
  17364. var p = pattern[pi], f = file[fi];
  17365. if (options.debug) {
  17366. console.error(pattern, p, f);
  17367. }
  17368. if (p === false)
  17369. return false;
  17370. if (p === GLOBSTAR) {
  17371. if (options.debug)
  17372. console.error("GLOBSTAR", [pattern, p, f]);
  17373. var fr = fi, pr = pi + 1;
  17374. if (pr === pl) {
  17375. if (options.debug)
  17376. console.error("** at the end");
  17377. for (; fi < fl; fi++) {
  17378. if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
  17379. return false;
  17380. }
  17381. return true;
  17382. }
  17383. WHILE:
  17384. while (fr < fl) {
  17385. var swallowee = file[fr];
  17386. if (options.debug) {
  17387. console.error("\nglobstar while", file, fr, pattern, pr, swallowee);
  17388. }
  17389. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  17390. if (options.debug)
  17391. console.error("globstar found match!", fr, fl, swallowee);
  17392. return true;
  17393. } else {
  17394. if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
  17395. if (options.debug)
  17396. console.error("dot detected!", file, fr, pattern, pr);
  17397. break WHILE;
  17398. }
  17399. if (options.debug)
  17400. console.error("globstar swallow a segment, and continue");
  17401. fr++;
  17402. }
  17403. }
  17404. if (partial) {
  17405. if (fr === fl)
  17406. return true;
  17407. }
  17408. return false;
  17409. }
  17410. var hit;
  17411. if (typeof p === "string") {
  17412. if (options.nocase) {
  17413. hit = f.toLowerCase() === p.toLowerCase();
  17414. } else {
  17415. hit = f === p;
  17416. }
  17417. if (options.debug) {
  17418. console.error("string match", p, f, hit);
  17419. }
  17420. } else {
  17421. hit = f.match(p);
  17422. if (options.debug) {
  17423. console.error("pattern match", p, f, hit);
  17424. }
  17425. }
  17426. if (!hit)
  17427. return false;
  17428. }
  17429. if (fi === fl && pi === pl) {
  17430. return true;
  17431. } else if (fi === fl) {
  17432. return partial;
  17433. } else if (pi === pl) {
  17434. var emptyFileEnd = fi === fl - 1 && file[fi] === "";
  17435. return emptyFileEnd;
  17436. }
  17437. throw new Error("wtf?");
  17438. };
  17439. function globUnescape(s) {
  17440. return s.replace(/\\(.)/g, "$1");
  17441. }
  17442. function regExpEscape(s) {
  17443. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  17444. }
  17445. }
  17446. });
  17447. var require_ini = __commonJS2({
  17448. "node_modules/editorconfig/src/lib/ini.js"(exports2) {
  17449. "use strict";
  17450. var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
  17451. return new (P || (P = Promise))(function(resolve, reject) {
  17452. function fulfilled(value) {
  17453. try {
  17454. step(generator.next(value));
  17455. } catch (e) {
  17456. reject(e);
  17457. }
  17458. }
  17459. function rejected(value) {
  17460. try {
  17461. step(generator["throw"](value));
  17462. } catch (e) {
  17463. reject(e);
  17464. }
  17465. }
  17466. function step(result) {
  17467. result.done ? resolve(result.value) : new P(function(resolve2) {
  17468. resolve2(result.value);
  17469. }).then(fulfilled, rejected);
  17470. }
  17471. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17472. });
  17473. };
  17474. var __generator2 = exports2 && exports2.__generator || function(thisArg, body) {
  17475. var _ = {
  17476. label: 0,
  17477. sent: function() {
  17478. if (t[0] & 1)
  17479. throw t[1];
  17480. return t[1];
  17481. },
  17482. trys: [],
  17483. ops: []
  17484. }, f, y, t, g;
  17485. return g = {
  17486. next: verb(0),
  17487. "throw": verb(1),
  17488. "return": verb(2)
  17489. }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
  17490. return this;
  17491. }), g;
  17492. function verb(n) {
  17493. return function(v) {
  17494. return step([n, v]);
  17495. };
  17496. }
  17497. function step(op) {
  17498. if (f)
  17499. throw new TypeError("Generator is already executing.");
  17500. while (_)
  17501. try {
  17502. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
  17503. return t;
  17504. if (y = 0, t)
  17505. op = [op[0] & 2, t.value];
  17506. switch (op[0]) {
  17507. case 0:
  17508. case 1:
  17509. t = op;
  17510. break;
  17511. case 4:
  17512. _.label++;
  17513. return {
  17514. value: op[1],
  17515. done: false
  17516. };
  17517. case 5:
  17518. _.label++;
  17519. y = op[1];
  17520. op = [0];
  17521. continue;
  17522. case 7:
  17523. op = _.ops.pop();
  17524. _.trys.pop();
  17525. continue;
  17526. default:
  17527. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17528. _ = 0;
  17529. continue;
  17530. }
  17531. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17532. _.label = op[1];
  17533. break;
  17534. }
  17535. if (op[0] === 6 && _.label < t[1]) {
  17536. _.label = t[1];
  17537. t = op;
  17538. break;
  17539. }
  17540. if (t && _.label < t[2]) {
  17541. _.label = t[2];
  17542. _.ops.push(op);
  17543. break;
  17544. }
  17545. if (t[2])
  17546. _.ops.pop();
  17547. _.trys.pop();
  17548. continue;
  17549. }
  17550. op = body.call(thisArg, _);
  17551. } catch (e) {
  17552. op = [6, e];
  17553. y = 0;
  17554. } finally {
  17555. f = t = 0;
  17556. }
  17557. if (op[0] & 5)
  17558. throw op[1];
  17559. return {
  17560. value: op[0] ? op[1] : void 0,
  17561. done: true
  17562. };
  17563. }
  17564. };
  17565. var __importStar2 = exports2 && exports2.__importStar || function(mod) {
  17566. if (mod && mod.__esModule)
  17567. return mod;
  17568. var result = {};
  17569. if (mod != null) {
  17570. for (var k in mod)
  17571. if (Object.hasOwnProperty.call(mod, k))
  17572. result[k] = mod[k];
  17573. }
  17574. result["default"] = mod;
  17575. return result;
  17576. };
  17577. Object.defineProperty(exports2, "__esModule", {
  17578. value: true
  17579. });
  17580. var fs = __importStar2(require("fs"));
  17581. var regex = {
  17582. section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
  17583. param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
  17584. comment: /^\s*[#;].*$/
  17585. };
  17586. function parse(file) {
  17587. return __awaiter2(this, void 0, void 0, function() {
  17588. return __generator2(this, function(_a) {
  17589. return [2, new Promise(function(resolve, reject) {
  17590. fs.readFile(file, "utf8", function(err, data) {
  17591. if (err) {
  17592. reject(err);
  17593. return;
  17594. }
  17595. resolve(parseString(data));
  17596. });
  17597. })];
  17598. });
  17599. });
  17600. }
  17601. exports2.parse = parse;
  17602. function parseSync(file) {
  17603. return parseString(fs.readFileSync(file, "utf8"));
  17604. }
  17605. exports2.parseSync = parseSync;
  17606. function parseString(data) {
  17607. var sectionBody = {};
  17608. var sectionName = null;
  17609. var value = [[sectionName, sectionBody]];
  17610. var lines = data.split(/\r\n|\r|\n/);
  17611. lines.forEach(function(line) {
  17612. var match;
  17613. if (regex.comment.test(line)) {
  17614. return;
  17615. }
  17616. if (regex.param.test(line)) {
  17617. match = line.match(regex.param);
  17618. sectionBody[match[1]] = match[2];
  17619. } else if (regex.section.test(line)) {
  17620. match = line.match(regex.section);
  17621. sectionName = match[1];
  17622. sectionBody = {};
  17623. value.push([sectionName, sectionBody]);
  17624. }
  17625. });
  17626. return value;
  17627. }
  17628. exports2.parseString = parseString;
  17629. }
  17630. });
  17631. var require_package = __commonJS2({
  17632. "node_modules/editorconfig/package.json"(exports2, module2) {
  17633. module2.exports = {
  17634. name: "editorconfig",
  17635. version: "0.15.3",
  17636. description: "EditorConfig File Locator and Interpreter for Node.js",
  17637. keywords: ["editorconfig", "core"],
  17638. main: "src/index.js",
  17639. contributors: ["Hong Xu (topbug.net)", "Jed Mao (https://github.com/jedmao/)", "Trey Hunner (http://treyhunner.com)"],
  17640. directories: {
  17641. bin: "./bin",
  17642. lib: "./lib"
  17643. },
  17644. scripts: {
  17645. clean: "rimraf dist",
  17646. prebuild: "npm run clean",
  17647. build: "tsc",
  17648. pretest: "npm run lint && npm run build && npm run copy && cmake .",
  17649. test: "ctest .",
  17650. "pretest:ci": "npm run pretest",
  17651. "test:ci": "ctest -VV --output-on-failure .",
  17652. lint: "npm run eclint && npm run tslint",
  17653. eclint: 'eclint check --indent_size ignore "src/**"',
  17654. tslint: "tslint --project tsconfig.json --exclude package.json",
  17655. copy: "cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib",
  17656. prepub: "npm run lint && npm run build && npm run copy",
  17657. pub: "npm publish ./dist"
  17658. },
  17659. repository: {
  17660. type: "git",
  17661. url: "git://github.com/editorconfig/editorconfig-core-js.git"
  17662. },
  17663. bugs: "https://github.com/editorconfig/editorconfig-core-js/issues",
  17664. author: "EditorConfig Team",
  17665. license: "MIT",
  17666. dependencies: {
  17667. commander: "^2.19.0",
  17668. "lru-cache": "^4.1.5",
  17669. semver: "^5.6.0",
  17670. sigmund: "^1.0.1"
  17671. },
  17672. devDependencies: {
  17673. "@types/mocha": "^5.2.6",
  17674. "@types/node": "^10.12.29",
  17675. "@types/semver": "^5.5.0",
  17676. "cpy-cli": "^2.0.0",
  17677. eclint: "^2.8.1",
  17678. mocha: "^5.2.0",
  17679. rimraf: "^2.6.3",
  17680. should: "^13.2.3",
  17681. tslint: "^5.13.1",
  17682. typescript: "^3.3.3333"
  17683. }
  17684. };
  17685. }
  17686. });
  17687. var require_src2 = __commonJS2({
  17688. "node_modules/editorconfig/src/index.js"(exports2) {
  17689. "use strict";
  17690. var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
  17691. return new (P || (P = Promise))(function(resolve, reject) {
  17692. function fulfilled(value) {
  17693. try {
  17694. step(generator.next(value));
  17695. } catch (e) {
  17696. reject(e);
  17697. }
  17698. }
  17699. function rejected(value) {
  17700. try {
  17701. step(generator["throw"](value));
  17702. } catch (e) {
  17703. reject(e);
  17704. }
  17705. }
  17706. function step(result) {
  17707. result.done ? resolve(result.value) : new P(function(resolve2) {
  17708. resolve2(result.value);
  17709. }).then(fulfilled, rejected);
  17710. }
  17711. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17712. });
  17713. };
  17714. var __generator2 = exports2 && exports2.__generator || function(thisArg, body) {
  17715. var _ = {
  17716. label: 0,
  17717. sent: function() {
  17718. if (t[0] & 1)
  17719. throw t[1];
  17720. return t[1];
  17721. },
  17722. trys: [],
  17723. ops: []
  17724. }, f, y, t, g;
  17725. return g = {
  17726. next: verb(0),
  17727. "throw": verb(1),
  17728. "return": verb(2)
  17729. }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
  17730. return this;
  17731. }), g;
  17732. function verb(n) {
  17733. return function(v) {
  17734. return step([n, v]);
  17735. };
  17736. }
  17737. function step(op) {
  17738. if (f)
  17739. throw new TypeError("Generator is already executing.");
  17740. while (_)
  17741. try {
  17742. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
  17743. return t;
  17744. if (y = 0, t)
  17745. op = [op[0] & 2, t.value];
  17746. switch (op[0]) {
  17747. case 0:
  17748. case 1:
  17749. t = op;
  17750. break;
  17751. case 4:
  17752. _.label++;
  17753. return {
  17754. value: op[1],
  17755. done: false
  17756. };
  17757. case 5:
  17758. _.label++;
  17759. y = op[1];
  17760. op = [0];
  17761. continue;
  17762. case 7:
  17763. op = _.ops.pop();
  17764. _.trys.pop();
  17765. continue;
  17766. default:
  17767. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  17768. _ = 0;
  17769. continue;
  17770. }
  17771. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  17772. _.label = op[1];
  17773. break;
  17774. }
  17775. if (op[0] === 6 && _.label < t[1]) {
  17776. _.label = t[1];
  17777. t = op;
  17778. break;
  17779. }
  17780. if (t && _.label < t[2]) {
  17781. _.label = t[2];
  17782. _.ops.push(op);
  17783. break;
  17784. }
  17785. if (t[2])
  17786. _.ops.pop();
  17787. _.trys.pop();
  17788. continue;
  17789. }
  17790. op = body.call(thisArg, _);
  17791. } catch (e) {
  17792. op = [6, e];
  17793. y = 0;
  17794. } finally {
  17795. f = t = 0;
  17796. }
  17797. if (op[0] & 5)
  17798. throw op[1];
  17799. return {
  17800. value: op[0] ? op[1] : void 0,
  17801. done: true
  17802. };
  17803. }
  17804. };
  17805. var __importStar2 = exports2 && exports2.__importStar || function(mod) {
  17806. if (mod && mod.__esModule)
  17807. return mod;
  17808. var result = {};
  17809. if (mod != null) {
  17810. for (var k in mod)
  17811. if (Object.hasOwnProperty.call(mod, k))
  17812. result[k] = mod[k];
  17813. }
  17814. result["default"] = mod;
  17815. return result;
  17816. };
  17817. var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
  17818. return mod && mod.__esModule ? mod : {
  17819. "default": mod
  17820. };
  17821. };
  17822. Object.defineProperty(exports2, "__esModule", {
  17823. value: true
  17824. });
  17825. var fs = __importStar2(require("fs"));
  17826. var path = __importStar2(require("path"));
  17827. var semver = {
  17828. gte: require_gte()
  17829. };
  17830. var fnmatch_1 = __importDefault2(require_fnmatch());
  17831. var ini_1 = require_ini();
  17832. exports2.parseString = ini_1.parseString;
  17833. var package_json_1 = __importDefault2(require_package());
  17834. var knownProps = {
  17835. end_of_line: true,
  17836. indent_style: true,
  17837. indent_size: true,
  17838. insert_final_newline: true,
  17839. trim_trailing_whitespace: true,
  17840. charset: true
  17841. };
  17842. function fnmatch(filepath, glob) {
  17843. var matchOptions = {
  17844. matchBase: true,
  17845. dot: true,
  17846. noext: true
  17847. };
  17848. glob = glob.replace(/\*\*/g, "{*,**/**/**}");
  17849. return fnmatch_1.default(filepath, glob, matchOptions);
  17850. }
  17851. function getConfigFileNames(filepath, options) {
  17852. var paths = [];
  17853. do {
  17854. filepath = path.dirname(filepath);
  17855. paths.push(path.join(filepath, options.config));
  17856. } while (filepath !== options.root);
  17857. return paths;
  17858. }
  17859. function processMatches(matches, version2) {
  17860. if ("indent_style" in matches && matches.indent_style === "tab" && !("indent_size" in matches) && semver.gte(version2, "0.10.0")) {
  17861. matches.indent_size = "tab";
  17862. }
  17863. if ("indent_size" in matches && !("tab_width" in matches) && matches.indent_size !== "tab") {
  17864. matches.tab_width = matches.indent_size;
  17865. }
  17866. if ("indent_size" in matches && "tab_width" in matches && matches.indent_size === "tab") {
  17867. matches.indent_size = matches.tab_width;
  17868. }
  17869. return matches;
  17870. }
  17871. function processOptions(options, filepath) {
  17872. if (options === void 0) {
  17873. options = {};
  17874. }
  17875. return {
  17876. config: options.config || ".editorconfig",
  17877. version: options.version || package_json_1.default.version,
  17878. root: path.resolve(options.root || path.parse(filepath).root)
  17879. };
  17880. }
  17881. function buildFullGlob(pathPrefix, glob) {
  17882. switch (glob.indexOf("/")) {
  17883. case -1:
  17884. glob = "**/" + glob;
  17885. break;
  17886. case 0:
  17887. glob = glob.substring(1);
  17888. break;
  17889. default:
  17890. break;
  17891. }
  17892. return path.join(pathPrefix, glob);
  17893. }
  17894. function extendProps(props, options) {
  17895. if (props === void 0) {
  17896. props = {};
  17897. }
  17898. if (options === void 0) {
  17899. options = {};
  17900. }
  17901. for (var key in options) {
  17902. if (options.hasOwnProperty(key)) {
  17903. var value = options[key];
  17904. var key2 = key.toLowerCase();
  17905. var value2 = value;
  17906. if (knownProps[key2]) {
  17907. value2 = value.toLowerCase();
  17908. }
  17909. try {
  17910. value2 = JSON.parse(value);
  17911. } catch (e) {
  17912. }
  17913. if (typeof value === "undefined" || value === null) {
  17914. value2 = String(value);
  17915. }
  17916. props[key2] = value2;
  17917. }
  17918. }
  17919. return props;
  17920. }
  17921. function parseFromConfigs(configs, filepath, options) {
  17922. return processMatches(configs.reverse().reduce(function(matches, file) {
  17923. var pathPrefix = path.dirname(file.name);
  17924. file.contents.forEach(function(section) {
  17925. var glob = section[0];
  17926. var options2 = section[1];
  17927. if (!glob) {
  17928. return;
  17929. }
  17930. var fullGlob = buildFullGlob(pathPrefix, glob);
  17931. if (!fnmatch(filepath, fullGlob)) {
  17932. return;
  17933. }
  17934. matches = extendProps(matches, options2);
  17935. });
  17936. return matches;
  17937. }, {}), options.version);
  17938. }
  17939. function getConfigsForFiles(files) {
  17940. var configs = [];
  17941. for (var i in files) {
  17942. if (files.hasOwnProperty(i)) {
  17943. var file = files[i];
  17944. var contents = ini_1.parseString(file.contents);
  17945. configs.push({
  17946. name: file.name,
  17947. contents
  17948. });
  17949. if ((contents[0][1].root || "").toLowerCase() === "true") {
  17950. break;
  17951. }
  17952. }
  17953. }
  17954. return configs;
  17955. }
  17956. function readConfigFiles(filepaths) {
  17957. return __awaiter2(this, void 0, void 0, function() {
  17958. return __generator2(this, function(_a) {
  17959. return [2, Promise.all(filepaths.map(function(name) {
  17960. return new Promise(function(resolve) {
  17961. fs.readFile(name, "utf8", function(err, data) {
  17962. resolve({
  17963. name,
  17964. contents: err ? "" : data
  17965. });
  17966. });
  17967. });
  17968. }))];
  17969. });
  17970. });
  17971. }
  17972. function readConfigFilesSync(filepaths) {
  17973. var files = [];
  17974. var file;
  17975. filepaths.forEach(function(filepath) {
  17976. try {
  17977. file = fs.readFileSync(filepath, "utf8");
  17978. } catch (e) {
  17979. file = "";
  17980. }
  17981. files.push({
  17982. name: filepath,
  17983. contents: file
  17984. });
  17985. });
  17986. return files;
  17987. }
  17988. function opts(filepath, options) {
  17989. if (options === void 0) {
  17990. options = {};
  17991. }
  17992. var resolvedFilePath = path.resolve(filepath);
  17993. return [resolvedFilePath, processOptions(options, resolvedFilePath)];
  17994. }
  17995. function parseFromFiles(filepath, files, options) {
  17996. if (options === void 0) {
  17997. options = {};
  17998. }
  17999. return __awaiter2(this, void 0, void 0, function() {
  18000. var _a, resolvedFilePath, processedOptions;
  18001. return __generator2(this, function(_b) {
  18002. _a = opts(filepath, options), resolvedFilePath = _a[0], processedOptions = _a[1];
  18003. return [2, files.then(getConfigsForFiles).then(function(configs) {
  18004. return parseFromConfigs(configs, resolvedFilePath, processedOptions);
  18005. })];
  18006. });
  18007. });
  18008. }
  18009. exports2.parseFromFiles = parseFromFiles;
  18010. function parseFromFilesSync(filepath, files, options) {
  18011. if (options === void 0) {
  18012. options = {};
  18013. }
  18014. var _a = opts(filepath, options), resolvedFilePath = _a[0], processedOptions = _a[1];
  18015. return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
  18016. }
  18017. exports2.parseFromFilesSync = parseFromFilesSync;
  18018. function parse(_filepath, _options) {
  18019. if (_options === void 0) {
  18020. _options = {};
  18021. }
  18022. return __awaiter2(this, void 0, void 0, function() {
  18023. var _a, resolvedFilePath, processedOptions, filepaths;
  18024. return __generator2(this, function(_b) {
  18025. _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
  18026. filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
  18027. return [2, readConfigFiles(filepaths).then(getConfigsForFiles).then(function(configs) {
  18028. return parseFromConfigs(configs, resolvedFilePath, processedOptions);
  18029. })];
  18030. });
  18031. });
  18032. }
  18033. exports2.parse = parse;
  18034. function parseSync(_filepath, _options) {
  18035. if (_options === void 0) {
  18036. _options = {};
  18037. }
  18038. var _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
  18039. var filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
  18040. var files = readConfigFilesSync(filepaths);
  18041. return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
  18042. }
  18043. exports2.parseSync = parseSync;
  18044. }
  18045. });
  18046. var require_editorconfig_to_prettier = __commonJS2({
  18047. "node_modules/editorconfig-to-prettier/index.js"(exports2, module2) {
  18048. module2.exports = editorConfigToPrettier;
  18049. function removeUnset(editorConfig) {
  18050. const result = {};
  18051. const keys = Object.keys(editorConfig);
  18052. for (let i = 0; i < keys.length; i++) {
  18053. const key = keys[i];
  18054. if (editorConfig[key] === "unset") {
  18055. continue;
  18056. }
  18057. result[key] = editorConfig[key];
  18058. }
  18059. return result;
  18060. }
  18061. function editorConfigToPrettier(editorConfig) {
  18062. if (!editorConfig) {
  18063. return null;
  18064. }
  18065. editorConfig = removeUnset(editorConfig);
  18066. if (Object.keys(editorConfig).length === 0) {
  18067. return null;
  18068. }
  18069. const result = {};
  18070. if (editorConfig.indent_style) {
  18071. result.useTabs = editorConfig.indent_style === "tab";
  18072. }
  18073. if (editorConfig.indent_size === "tab") {
  18074. result.useTabs = true;
  18075. }
  18076. if (result.useTabs && editorConfig.tab_width) {
  18077. result.tabWidth = editorConfig.tab_width;
  18078. } else if (editorConfig.indent_style === "space" && editorConfig.indent_size && editorConfig.indent_size !== "tab") {
  18079. result.tabWidth = editorConfig.indent_size;
  18080. } else if (editorConfig.tab_width !== void 0) {
  18081. result.tabWidth = editorConfig.tab_width;
  18082. }
  18083. if (editorConfig.max_line_length && editorConfig.max_line_length !== "off") {
  18084. result.printWidth = editorConfig.max_line_length;
  18085. }
  18086. if (editorConfig.quote_type === "single") {
  18087. result.singleQuote = true;
  18088. } else if (editorConfig.quote_type === "double") {
  18089. result.singleQuote = false;
  18090. }
  18091. if (["cr", "crlf", "lf"].indexOf(editorConfig.end_of_line) !== -1) {
  18092. result.endOfLine = editorConfig.end_of_line;
  18093. }
  18094. if (editorConfig.insert_final_newline === false || editorConfig.insert_final_newline === true) {
  18095. result.insertFinalNewline = editorConfig.insert_final_newline;
  18096. }
  18097. return result;
  18098. }
  18099. }
  18100. });
  18101. var require_find_project_root = __commonJS2({
  18102. "src/config/find-project-root.js"(exports2, module2) {
  18103. "use strict";
  18104. var fs = require("fs");
  18105. var path = require("path");
  18106. var MARKERS = [".git", ".hg"];
  18107. var markerExists = (directory) => MARKERS.some((mark) => fs.existsSync(path.join(directory, mark)));
  18108. function findProjectRoot(directory) {
  18109. while (!markerExists(directory)) {
  18110. const parentDirectory = path.resolve(directory, "..");
  18111. if (parentDirectory === directory) {
  18112. break;
  18113. }
  18114. directory = parentDirectory;
  18115. }
  18116. return directory;
  18117. }
  18118. module2.exports = findProjectRoot;
  18119. }
  18120. });
  18121. var require_resolve_config_editorconfig = __commonJS2({
  18122. "src/config/resolve-config-editorconfig.js"(exports2, module2) {
  18123. "use strict";
  18124. var path = require("path");
  18125. var editorconfig = require_src2();
  18126. var editorConfigToPrettier = require_editorconfig_to_prettier();
  18127. var {
  18128. default: mem,
  18129. memClear
  18130. } = require_mem();
  18131. var findProjectRoot = require_find_project_root();
  18132. var jsonStringifyMem = (fn) => mem(fn, {
  18133. cacheKey: JSON.stringify
  18134. });
  18135. var maybeParse = (filePath, parse) => filePath && parse(filePath, {
  18136. root: findProjectRoot(path.dirname(path.resolve(filePath)))
  18137. });
  18138. var editorconfigAsyncNoCache = async (filePath) => editorConfigToPrettier(await maybeParse(filePath, editorconfig.parse));
  18139. var editorconfigAsyncWithCache = jsonStringifyMem(editorconfigAsyncNoCache);
  18140. var editorconfigSyncNoCache = (filePath) => editorConfigToPrettier(maybeParse(filePath, editorconfig.parseSync));
  18141. var editorconfigSyncWithCache = jsonStringifyMem(editorconfigSyncNoCache);
  18142. function getLoadFunction(opts) {
  18143. if (!opts.editorconfig) {
  18144. return () => null;
  18145. }
  18146. if (opts.sync) {
  18147. return opts.cache ? editorconfigSyncWithCache : editorconfigSyncNoCache;
  18148. }
  18149. return opts.cache ? editorconfigAsyncWithCache : editorconfigAsyncNoCache;
  18150. }
  18151. function clearCache() {
  18152. memClear(editorconfigSyncWithCache);
  18153. memClear(editorconfigAsyncWithCache);
  18154. }
  18155. module2.exports = {
  18156. getLoadFunction,
  18157. clearCache
  18158. };
  18159. }
  18160. });
  18161. var require_resolve_config = __commonJS2({
  18162. "src/config/resolve-config.js"(exports2, module2) {
  18163. "use strict";
  18164. var path = require("path");
  18165. var micromatch = require_micromatch();
  18166. var thirdParty = require("./third-party.js");
  18167. var loadToml = require_load_toml();
  18168. var loadJson5 = require_load_json5();
  18169. var resolve = require_resolve2();
  18170. var {
  18171. default: mem,
  18172. memClear
  18173. } = require_mem();
  18174. var resolveEditorConfig = require_resolve_config_editorconfig();
  18175. var getExplorerMemoized = mem((opts) => {
  18176. const cosmiconfig = thirdParty["cosmiconfig" + (opts.sync ? "Sync" : "")];
  18177. const explorer = cosmiconfig("prettier", {
  18178. cache: opts.cache,
  18179. transform: (result) => {
  18180. if (result && result.config) {
  18181. if (typeof result.config === "string") {
  18182. const dir = path.dirname(result.filepath);
  18183. const modulePath = resolve(result.config, {
  18184. paths: [dir]
  18185. });
  18186. result.config = require(modulePath);
  18187. }
  18188. if (typeof result.config !== "object") {
  18189. throw new TypeError(`Config is only allowed to be an object, but received ${typeof result.config} in "${result.filepath}"`);
  18190. }
  18191. delete result.config.$schema;
  18192. }
  18193. return result;
  18194. },
  18195. searchPlaces: ["package.json", ".prettierrc", ".prettierrc.json", ".prettierrc.yaml", ".prettierrc.yml", ".prettierrc.json5", ".prettierrc.js", ".prettierrc.cjs", "prettier.config.js", "prettier.config.cjs", ".prettierrc.toml"],
  18196. loaders: {
  18197. ".toml": loadToml,
  18198. ".json5": loadJson5
  18199. }
  18200. });
  18201. return explorer;
  18202. }, {
  18203. cacheKey: JSON.stringify
  18204. });
  18205. function getExplorer(opts) {
  18206. opts = Object.assign({
  18207. sync: false,
  18208. cache: false
  18209. }, opts);
  18210. return getExplorerMemoized(opts);
  18211. }
  18212. function _resolveConfig(filePath, opts, sync) {
  18213. opts = Object.assign({
  18214. useCache: true
  18215. }, opts);
  18216. const loadOpts = {
  18217. cache: Boolean(opts.useCache),
  18218. sync: Boolean(sync),
  18219. editorconfig: Boolean(opts.editorconfig)
  18220. };
  18221. const {
  18222. load,
  18223. search
  18224. } = getExplorer(loadOpts);
  18225. const loadEditorConfig = resolveEditorConfig.getLoadFunction(loadOpts);
  18226. const arr = [opts.config ? load(opts.config) : search(filePath), loadEditorConfig(filePath)];
  18227. const unwrapAndMerge = ([result, editorConfigured]) => {
  18228. const merged = Object.assign(Object.assign({}, editorConfigured), mergeOverrides(result, filePath));
  18229. for (const optionName of ["plugins", "pluginSearchDirs"]) {
  18230. if (Array.isArray(merged[optionName])) {
  18231. merged[optionName] = merged[optionName].map((value) => typeof value === "string" && value.startsWith(".") ? path.resolve(path.dirname(result.filepath), value) : value);
  18232. }
  18233. }
  18234. if (!result && !editorConfigured) {
  18235. return null;
  18236. }
  18237. delete merged.insertFinalNewline;
  18238. return merged;
  18239. };
  18240. if (loadOpts.sync) {
  18241. return unwrapAndMerge(arr);
  18242. }
  18243. return Promise.all(arr).then(unwrapAndMerge);
  18244. }
  18245. var resolveConfig = (filePath, opts) => _resolveConfig(filePath, opts, false);
  18246. resolveConfig.sync = (filePath, opts) => _resolveConfig(filePath, opts, true);
  18247. function clearCache() {
  18248. memClear(getExplorerMemoized);
  18249. resolveEditorConfig.clearCache();
  18250. }
  18251. async function resolveConfigFile(filePath) {
  18252. const {
  18253. search
  18254. } = getExplorer({
  18255. sync: false
  18256. });
  18257. const result = await search(filePath);
  18258. return result ? result.filepath : null;
  18259. }
  18260. resolveConfigFile.sync = (filePath) => {
  18261. const {
  18262. search
  18263. } = getExplorer({
  18264. sync: true
  18265. });
  18266. const result = search(filePath);
  18267. return result ? result.filepath : null;
  18268. };
  18269. function mergeOverrides(configResult, filePath) {
  18270. const {
  18271. config: config2,
  18272. filepath: configPath
  18273. } = configResult || {};
  18274. const _ref = config2 || {}, {
  18275. overrides
  18276. } = _ref, options = _objectWithoutProperties(_ref, _excluded3);
  18277. if (filePath && overrides) {
  18278. const relativeFilePath = path.relative(path.dirname(configPath), filePath);
  18279. for (const override of overrides) {
  18280. if (pathMatchesGlobs(relativeFilePath, override.files, override.excludeFiles)) {
  18281. Object.assign(options, override.options);
  18282. }
  18283. }
  18284. }
  18285. return options;
  18286. }
  18287. function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
  18288. const patternList = Array.isArray(patterns) ? patterns : [patterns];
  18289. const withSlashes = [];
  18290. const withoutSlashes = [];
  18291. for (const pattern of patternList) {
  18292. if (pattern.includes("/")) {
  18293. withSlashes.push(pattern);
  18294. } else {
  18295. withoutSlashes.push(pattern);
  18296. }
  18297. }
  18298. return micromatch.isMatch(filePath, withoutSlashes, {
  18299. ignore: excludedPatterns,
  18300. basename: true,
  18301. dot: true
  18302. }) || micromatch.isMatch(filePath, withSlashes, {
  18303. ignore: excludedPatterns,
  18304. basename: false,
  18305. dot: true
  18306. });
  18307. }
  18308. module2.exports = {
  18309. resolveConfig,
  18310. resolveConfigFile,
  18311. clearCache
  18312. };
  18313. }
  18314. });
  18315. var require_ignore = __commonJS2({
  18316. "node_modules/ignore/index.js"(exports2, module2) {
  18317. function makeArray(subject) {
  18318. return Array.isArray(subject) ? subject : [subject];
  18319. }
  18320. var EMPTY = "";
  18321. var SPACE = " ";
  18322. var ESCAPE = "\\";
  18323. var REGEX_TEST_BLANK_LINE = /^\s+$/;
  18324. var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
  18325. var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
  18326. var REGEX_SPLITALL_CRLF = /\r?\n/g;
  18327. var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
  18328. var SLASH = "/";
  18329. var KEY_IGNORE = typeof Symbol !== "undefined" ? Symbol.for("node-ignore") : "node-ignore";
  18330. var define2 = (object, key, value) => Object.defineProperty(object, key, {
  18331. value
  18332. });
  18333. var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
  18334. var RETURN_FALSE = () => false;
  18335. var sanitizeRange = (range) => range.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY);
  18336. var cleanRangeBackSlash = (slashes) => {
  18337. const {
  18338. length
  18339. } = slashes;
  18340. return slashes.slice(0, length - length % 2);
  18341. };
  18342. var REPLACERS = [[/\\?\s+$/, (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY], [/\\\s/g, () => SPACE], [/[\\$.|*+(){^]/g, (match) => `\\${match}`], [/(?!\\)\?/g, () => "[^/]"], [/^\//, () => "^"], [/\//g, () => "\\/"], [/^\^*\\\*\\\*\\\//, () => "^(?:.*\\/)?"], [/^(?=[^^])/, function startingReplacer() {
  18343. return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
  18344. }], [/\\\/\\\*\\\*(?=\\\/|$)/g, (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"], [/(^|[^\\]+)\\\*(?=.+)/g, (_, p1) => `${p1}[^\\/]*`], [/\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE], [/\\\\/g, () => ESCAPE], [/(\\)?\[([^\]/]*?)(\\*)($|\])/g, (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"], [/(?:[^*])$/, (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`], [/(\^|\\\/)?\\\*$/, (_, p1) => {
  18345. const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
  18346. return `${prefix}(?=$|\\/$)`;
  18347. }]];
  18348. var regexCache = /* @__PURE__ */ Object.create(null);
  18349. var makeRegex = (pattern, ignoreCase) => {
  18350. let source = regexCache[pattern];
  18351. if (!source) {
  18352. source = REPLACERS.reduce((prev, current) => prev.replace(current[0], current[1].bind(pattern)), pattern);
  18353. regexCache[pattern] = source;
  18354. }
  18355. return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
  18356. };
  18357. var isString = (subject) => typeof subject === "string";
  18358. var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && pattern.indexOf("#") !== 0;
  18359. var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
  18360. var IgnoreRule = class {
  18361. constructor(origin, pattern, negative, regex) {
  18362. this.origin = origin;
  18363. this.pattern = pattern;
  18364. this.negative = negative;
  18365. this.regex = regex;
  18366. }
  18367. };
  18368. var createRule = (pattern, ignoreCase) => {
  18369. const origin = pattern;
  18370. let negative = false;
  18371. if (pattern.indexOf("!") === 0) {
  18372. negative = true;
  18373. pattern = pattern.substr(1);
  18374. }
  18375. pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
  18376. const regex = makeRegex(pattern, ignoreCase);
  18377. return new IgnoreRule(origin, pattern, negative, regex);
  18378. };
  18379. var throwError = (message, Ctor) => {
  18380. throw new Ctor(message);
  18381. };
  18382. var checkPath = (path, originalPath, doThrow) => {
  18383. if (!isString(path)) {
  18384. return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
  18385. }
  18386. if (!path) {
  18387. return doThrow(`path must not be empty`, TypeError);
  18388. }
  18389. if (checkPath.isNotRelative(path)) {
  18390. const r = "`path.relative()`d";
  18391. return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError);
  18392. }
  18393. return true;
  18394. };
  18395. var isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
  18396. checkPath.isNotRelative = isNotRelative;
  18397. checkPath.convert = (p) => p;
  18398. var Ignore = class {
  18399. constructor({
  18400. ignorecase = true,
  18401. ignoreCase = ignorecase,
  18402. allowRelativePaths = false
  18403. } = {}) {
  18404. define2(this, KEY_IGNORE, true);
  18405. this._rules = [];
  18406. this._ignoreCase = ignoreCase;
  18407. this._allowRelativePaths = allowRelativePaths;
  18408. this._initCache();
  18409. }
  18410. _initCache() {
  18411. this._ignoreCache = /* @__PURE__ */ Object.create(null);
  18412. this._testCache = /* @__PURE__ */ Object.create(null);
  18413. }
  18414. _addPattern(pattern) {
  18415. if (pattern && pattern[KEY_IGNORE]) {
  18416. this._rules = this._rules.concat(pattern._rules);
  18417. this._added = true;
  18418. return;
  18419. }
  18420. if (checkPattern(pattern)) {
  18421. const rule = createRule(pattern, this._ignoreCase);
  18422. this._added = true;
  18423. this._rules.push(rule);
  18424. }
  18425. }
  18426. add(pattern) {
  18427. this._added = false;
  18428. makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this);
  18429. if (this._added) {
  18430. this._initCache();
  18431. }
  18432. return this;
  18433. }
  18434. addPattern(pattern) {
  18435. return this.add(pattern);
  18436. }
  18437. _testOne(path, checkUnignored) {
  18438. let ignored = false;
  18439. let unignored = false;
  18440. this._rules.forEach((rule) => {
  18441. const {
  18442. negative
  18443. } = rule;
  18444. if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
  18445. return;
  18446. }
  18447. const matched = rule.regex.test(path);
  18448. if (matched) {
  18449. ignored = !negative;
  18450. unignored = negative;
  18451. }
  18452. });
  18453. return {
  18454. ignored,
  18455. unignored
  18456. };
  18457. }
  18458. _test(originalPath, cache, checkUnignored, slices) {
  18459. const path = originalPath && checkPath.convert(originalPath);
  18460. checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
  18461. return this._t(path, cache, checkUnignored, slices);
  18462. }
  18463. _t(path, cache, checkUnignored, slices) {
  18464. if (path in cache) {
  18465. return cache[path];
  18466. }
  18467. if (!slices) {
  18468. slices = path.split(SLASH);
  18469. }
  18470. slices.pop();
  18471. if (!slices.length) {
  18472. return cache[path] = this._testOne(path, checkUnignored);
  18473. }
  18474. const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
  18475. return cache[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
  18476. }
  18477. ignores(path) {
  18478. return this._test(path, this._ignoreCache, false).ignored;
  18479. }
  18480. createFilter() {
  18481. return (path) => !this.ignores(path);
  18482. }
  18483. filter(paths) {
  18484. return makeArray(paths).filter(this.createFilter());
  18485. }
  18486. test(path) {
  18487. return this._test(path, this._testCache, true);
  18488. }
  18489. };
  18490. var factory = (options) => new Ignore(options);
  18491. var isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
  18492. factory.isPathValid = isPathValid;
  18493. factory.default = factory;
  18494. module2.exports = factory;
  18495. if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) {
  18496. const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
  18497. checkPath.convert = makePosix;
  18498. const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
  18499. checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
  18500. }
  18501. }
  18502. });
  18503. var require_get_file_content_or_null = __commonJS2({
  18504. "src/utils/get-file-content-or-null.js"(exports2, module2) {
  18505. "use strict";
  18506. var fs = require("fs");
  18507. var fsAsync = fs.promises;
  18508. async function getFileContentOrNull(filename) {
  18509. try {
  18510. return await fsAsync.readFile(filename, "utf8");
  18511. } catch (error) {
  18512. return handleError(filename, error);
  18513. }
  18514. }
  18515. getFileContentOrNull.sync = function(filename) {
  18516. try {
  18517. return fs.readFileSync(filename, "utf8");
  18518. } catch (error) {
  18519. return handleError(filename, error);
  18520. }
  18521. };
  18522. function handleError(filename, error) {
  18523. if (error && error.code === "ENOENT") {
  18524. return null;
  18525. }
  18526. throw new Error(`Unable to read ${filename}: ${error.message}`);
  18527. }
  18528. module2.exports = getFileContentOrNull;
  18529. }
  18530. });
  18531. var require_create_ignorer = __commonJS2({
  18532. "src/common/create-ignorer.js"(exports2, module2) {
  18533. "use strict";
  18534. var path = require("path");
  18535. var ignore = require_ignore();
  18536. var getFileContentOrNull = require_get_file_content_or_null();
  18537. async function createIgnorer(ignorePath, withNodeModules) {
  18538. const ignoreContent = ignorePath ? await getFileContentOrNull(path.resolve(ignorePath)) : null;
  18539. return _createIgnorer(ignoreContent, withNodeModules);
  18540. }
  18541. createIgnorer.sync = function(ignorePath, withNodeModules) {
  18542. const ignoreContent = !ignorePath ? null : getFileContentOrNull.sync(path.resolve(ignorePath));
  18543. return _createIgnorer(ignoreContent, withNodeModules);
  18544. };
  18545. function _createIgnorer(ignoreContent, withNodeModules) {
  18546. const ignorer = ignore({
  18547. allowRelativePaths: true
  18548. }).add(ignoreContent || "");
  18549. if (!withNodeModules) {
  18550. ignorer.add("node_modules");
  18551. }
  18552. return ignorer;
  18553. }
  18554. module2.exports = createIgnorer;
  18555. }
  18556. });
  18557. var require_get_file_info = __commonJS2({
  18558. "src/common/get-file-info.js"(exports2, module2) {
  18559. "use strict";
  18560. var path = require("path");
  18561. var options = require_options();
  18562. var config2 = require_resolve_config();
  18563. var createIgnorer = require_create_ignorer();
  18564. async function getFileInfo2(filePath, opts) {
  18565. if (typeof filePath !== "string") {
  18566. throw new TypeError(`expect \`filePath\` to be a string, got \`${typeof filePath}\``);
  18567. }
  18568. const ignorer = await createIgnorer(opts.ignorePath, opts.withNodeModules);
  18569. return _getFileInfo({
  18570. ignorer,
  18571. filePath,
  18572. plugins: opts.plugins,
  18573. resolveConfig: opts.resolveConfig,
  18574. ignorePath: opts.ignorePath,
  18575. sync: false
  18576. });
  18577. }
  18578. getFileInfo2.sync = function(filePath, opts) {
  18579. if (typeof filePath !== "string") {
  18580. throw new TypeError(`expect \`filePath\` to be a string, got \`${typeof filePath}\``);
  18581. }
  18582. const ignorer = createIgnorer.sync(opts.ignorePath, opts.withNodeModules);
  18583. return _getFileInfo({
  18584. ignorer,
  18585. filePath,
  18586. plugins: opts.plugins,
  18587. resolveConfig: opts.resolveConfig,
  18588. ignorePath: opts.ignorePath,
  18589. sync: true
  18590. });
  18591. };
  18592. function getFileParser(resolvedConfig, filePath, plugins2) {
  18593. if (resolvedConfig && resolvedConfig.parser) {
  18594. return resolvedConfig.parser;
  18595. }
  18596. const inferredParser = options.inferParser(filePath, plugins2);
  18597. if (inferredParser) {
  18598. return inferredParser;
  18599. }
  18600. return null;
  18601. }
  18602. function _getFileInfo({
  18603. ignorer,
  18604. filePath,
  18605. plugins: plugins2,
  18606. resolveConfig = false,
  18607. ignorePath,
  18608. sync = false
  18609. }) {
  18610. const normalizedFilePath = normalizeFilePath(filePath, ignorePath);
  18611. const fileInfo = {
  18612. ignored: ignorer.ignores(normalizedFilePath),
  18613. inferredParser: null
  18614. };
  18615. if (fileInfo.ignored) {
  18616. return fileInfo;
  18617. }
  18618. let resolvedConfig;
  18619. if (resolveConfig) {
  18620. if (sync) {
  18621. resolvedConfig = config2.resolveConfig.sync(filePath);
  18622. } else {
  18623. return config2.resolveConfig(filePath).then((resolvedConfig2) => {
  18624. fileInfo.inferredParser = getFileParser(resolvedConfig2, filePath, plugins2);
  18625. return fileInfo;
  18626. });
  18627. }
  18628. }
  18629. fileInfo.inferredParser = getFileParser(resolvedConfig, filePath, plugins2);
  18630. return fileInfo;
  18631. }
  18632. function normalizeFilePath(filePath, ignorePath) {
  18633. return ignorePath ? path.relative(path.dirname(ignorePath), filePath) : filePath;
  18634. }
  18635. module2.exports = getFileInfo2;
  18636. }
  18637. });
  18638. var require_util_shared = __commonJS2({
  18639. "src/common/util-shared.js"(exports2, module2) {
  18640. "use strict";
  18641. var {
  18642. getMaxContinuousCount,
  18643. getStringWidth,
  18644. getAlignmentSize,
  18645. getIndentSize,
  18646. skip,
  18647. skipWhitespace,
  18648. skipSpaces,
  18649. skipNewline,
  18650. skipToLineEnd,
  18651. skipEverythingButNewLine,
  18652. skipInlineComment,
  18653. skipTrailingComment,
  18654. hasNewline,
  18655. hasNewlineInRange,
  18656. hasSpaces,
  18657. isNextLineEmpty,
  18658. isNextLineEmptyAfterIndex,
  18659. isPreviousLineEmpty,
  18660. getNextNonSpaceNonCommentCharacterIndex,
  18661. makeString,
  18662. addLeadingComment,
  18663. addDanglingComment,
  18664. addTrailingComment
  18665. } = require_util();
  18666. module2.exports = {
  18667. getMaxContinuousCount,
  18668. getStringWidth,
  18669. getAlignmentSize,
  18670. getIndentSize,
  18671. skip,
  18672. skipWhitespace,
  18673. skipSpaces,
  18674. skipNewline,
  18675. skipToLineEnd,
  18676. skipEverythingButNewLine,
  18677. skipInlineComment,
  18678. skipTrailingComment,
  18679. hasNewline,
  18680. hasNewlineInRange,
  18681. hasSpaces,
  18682. isNextLineEmpty,
  18683. isNextLineEmptyAfterIndex,
  18684. isPreviousLineEmpty,
  18685. getNextNonSpaceNonCommentCharacterIndex,
  18686. makeString,
  18687. addLeadingComment,
  18688. addDanglingComment,
  18689. addTrailingComment
  18690. };
  18691. }
  18692. });
  18693. var require_listCacheClear = __commonJS2({
  18694. "node_modules/lodash/_listCacheClear.js"(exports2, module2) {
  18695. function listCacheClear() {
  18696. this.__data__ = [];
  18697. this.size = 0;
  18698. }
  18699. module2.exports = listCacheClear;
  18700. }
  18701. });
  18702. var require_eq = __commonJS2({
  18703. "node_modules/lodash/eq.js"(exports2, module2) {
  18704. function eq(value, other) {
  18705. return value === other || value !== value && other !== other;
  18706. }
  18707. module2.exports = eq;
  18708. }
  18709. });
  18710. var require_assocIndexOf = __commonJS2({
  18711. "node_modules/lodash/_assocIndexOf.js"(exports2, module2) {
  18712. var eq = require_eq();
  18713. function assocIndexOf(array, key) {
  18714. var length = array.length;
  18715. while (length--) {
  18716. if (eq(array[length][0], key)) {
  18717. return length;
  18718. }
  18719. }
  18720. return -1;
  18721. }
  18722. module2.exports = assocIndexOf;
  18723. }
  18724. });
  18725. var require_listCacheDelete = __commonJS2({
  18726. "node_modules/lodash/_listCacheDelete.js"(exports2, module2) {
  18727. var assocIndexOf = require_assocIndexOf();
  18728. var arrayProto = Array.prototype;
  18729. var splice = arrayProto.splice;
  18730. function listCacheDelete(key) {
  18731. var data = this.__data__, index = assocIndexOf(data, key);
  18732. if (index < 0) {
  18733. return false;
  18734. }
  18735. var lastIndex = data.length - 1;
  18736. if (index == lastIndex) {
  18737. data.pop();
  18738. } else {
  18739. splice.call(data, index, 1);
  18740. }
  18741. --this.size;
  18742. return true;
  18743. }
  18744. module2.exports = listCacheDelete;
  18745. }
  18746. });
  18747. var require_listCacheGet = __commonJS2({
  18748. "node_modules/lodash/_listCacheGet.js"(exports2, module2) {
  18749. var assocIndexOf = require_assocIndexOf();
  18750. function listCacheGet(key) {
  18751. var data = this.__data__, index = assocIndexOf(data, key);
  18752. return index < 0 ? void 0 : data[index][1];
  18753. }
  18754. module2.exports = listCacheGet;
  18755. }
  18756. });
  18757. var require_listCacheHas = __commonJS2({
  18758. "node_modules/lodash/_listCacheHas.js"(exports2, module2) {
  18759. var assocIndexOf = require_assocIndexOf();
  18760. function listCacheHas(key) {
  18761. return assocIndexOf(this.__data__, key) > -1;
  18762. }
  18763. module2.exports = listCacheHas;
  18764. }
  18765. });
  18766. var require_listCacheSet = __commonJS2({
  18767. "node_modules/lodash/_listCacheSet.js"(exports2, module2) {
  18768. var assocIndexOf = require_assocIndexOf();
  18769. function listCacheSet(key, value) {
  18770. var data = this.__data__, index = assocIndexOf(data, key);
  18771. if (index < 0) {
  18772. ++this.size;
  18773. data.push([key, value]);
  18774. } else {
  18775. data[index][1] = value;
  18776. }
  18777. return this;
  18778. }
  18779. module2.exports = listCacheSet;
  18780. }
  18781. });
  18782. var require_ListCache = __commonJS2({
  18783. "node_modules/lodash/_ListCache.js"(exports2, module2) {
  18784. var listCacheClear = require_listCacheClear();
  18785. var listCacheDelete = require_listCacheDelete();
  18786. var listCacheGet = require_listCacheGet();
  18787. var listCacheHas = require_listCacheHas();
  18788. var listCacheSet = require_listCacheSet();
  18789. function ListCache(entries) {
  18790. var index = -1, length = entries == null ? 0 : entries.length;
  18791. this.clear();
  18792. while (++index < length) {
  18793. var entry = entries[index];
  18794. this.set(entry[0], entry[1]);
  18795. }
  18796. }
  18797. ListCache.prototype.clear = listCacheClear;
  18798. ListCache.prototype["delete"] = listCacheDelete;
  18799. ListCache.prototype.get = listCacheGet;
  18800. ListCache.prototype.has = listCacheHas;
  18801. ListCache.prototype.set = listCacheSet;
  18802. module2.exports = ListCache;
  18803. }
  18804. });
  18805. var require_stackClear = __commonJS2({
  18806. "node_modules/lodash/_stackClear.js"(exports2, module2) {
  18807. var ListCache = require_ListCache();
  18808. function stackClear() {
  18809. this.__data__ = new ListCache();
  18810. this.size = 0;
  18811. }
  18812. module2.exports = stackClear;
  18813. }
  18814. });
  18815. var require_stackDelete = __commonJS2({
  18816. "node_modules/lodash/_stackDelete.js"(exports2, module2) {
  18817. function stackDelete(key) {
  18818. var data = this.__data__, result = data["delete"](key);
  18819. this.size = data.size;
  18820. return result;
  18821. }
  18822. module2.exports = stackDelete;
  18823. }
  18824. });
  18825. var require_stackGet = __commonJS2({
  18826. "node_modules/lodash/_stackGet.js"(exports2, module2) {
  18827. function stackGet(key) {
  18828. return this.__data__.get(key);
  18829. }
  18830. module2.exports = stackGet;
  18831. }
  18832. });
  18833. var require_stackHas = __commonJS2({
  18834. "node_modules/lodash/_stackHas.js"(exports2, module2) {
  18835. function stackHas(key) {
  18836. return this.__data__.has(key);
  18837. }
  18838. module2.exports = stackHas;
  18839. }
  18840. });
  18841. var require_freeGlobal = __commonJS2({
  18842. "node_modules/lodash/_freeGlobal.js"(exports2, module2) {
  18843. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  18844. module2.exports = freeGlobal;
  18845. }
  18846. });
  18847. var require_root = __commonJS2({
  18848. "node_modules/lodash/_root.js"(exports2, module2) {
  18849. var freeGlobal = require_freeGlobal();
  18850. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  18851. var root = freeGlobal || freeSelf || Function("return this")();
  18852. module2.exports = root;
  18853. }
  18854. });
  18855. var require_Symbol = __commonJS2({
  18856. "node_modules/lodash/_Symbol.js"(exports2, module2) {
  18857. var root = require_root();
  18858. var Symbol2 = root.Symbol;
  18859. module2.exports = Symbol2;
  18860. }
  18861. });
  18862. var require_getRawTag = __commonJS2({
  18863. "node_modules/lodash/_getRawTag.js"(exports2, module2) {
  18864. var Symbol2 = require_Symbol();
  18865. var objectProto = Object.prototype;
  18866. var hasOwnProperty = objectProto.hasOwnProperty;
  18867. var nativeObjectToString = objectProto.toString;
  18868. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  18869. function getRawTag(value) {
  18870. var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
  18871. try {
  18872. value[symToStringTag] = void 0;
  18873. var unmasked = true;
  18874. } catch (e) {
  18875. }
  18876. var result = nativeObjectToString.call(value);
  18877. if (unmasked) {
  18878. if (isOwn) {
  18879. value[symToStringTag] = tag;
  18880. } else {
  18881. delete value[symToStringTag];
  18882. }
  18883. }
  18884. return result;
  18885. }
  18886. module2.exports = getRawTag;
  18887. }
  18888. });
  18889. var require_objectToString = __commonJS2({
  18890. "node_modules/lodash/_objectToString.js"(exports2, module2) {
  18891. var objectProto = Object.prototype;
  18892. var nativeObjectToString = objectProto.toString;
  18893. function objectToString(value) {
  18894. return nativeObjectToString.call(value);
  18895. }
  18896. module2.exports = objectToString;
  18897. }
  18898. });
  18899. var require_baseGetTag = __commonJS2({
  18900. "node_modules/lodash/_baseGetTag.js"(exports2, module2) {
  18901. var Symbol2 = require_Symbol();
  18902. var getRawTag = require_getRawTag();
  18903. var objectToString = require_objectToString();
  18904. var nullTag = "[object Null]";
  18905. var undefinedTag = "[object Undefined]";
  18906. var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  18907. function baseGetTag(value) {
  18908. if (value == null) {
  18909. return value === void 0 ? undefinedTag : nullTag;
  18910. }
  18911. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  18912. }
  18913. module2.exports = baseGetTag;
  18914. }
  18915. });
  18916. var require_isObject = __commonJS2({
  18917. "node_modules/lodash/isObject.js"(exports2, module2) {
  18918. function isObject(value) {
  18919. var type = typeof value;
  18920. return value != null && (type == "object" || type == "function");
  18921. }
  18922. module2.exports = isObject;
  18923. }
  18924. });
  18925. var require_isFunction = __commonJS2({
  18926. "node_modules/lodash/isFunction.js"(exports2, module2) {
  18927. var baseGetTag = require_baseGetTag();
  18928. var isObject = require_isObject();
  18929. var asyncTag = "[object AsyncFunction]";
  18930. var funcTag = "[object Function]";
  18931. var genTag = "[object GeneratorFunction]";
  18932. var proxyTag = "[object Proxy]";
  18933. function isFunction(value) {
  18934. if (!isObject(value)) {
  18935. return false;
  18936. }
  18937. var tag = baseGetTag(value);
  18938. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  18939. }
  18940. module2.exports = isFunction;
  18941. }
  18942. });
  18943. var require_coreJsData = __commonJS2({
  18944. "node_modules/lodash/_coreJsData.js"(exports2, module2) {
  18945. var root = require_root();
  18946. var coreJsData = root["__core-js_shared__"];
  18947. module2.exports = coreJsData;
  18948. }
  18949. });
  18950. var require_isMasked = __commonJS2({
  18951. "node_modules/lodash/_isMasked.js"(exports2, module2) {
  18952. var coreJsData = require_coreJsData();
  18953. var maskSrcKey = function() {
  18954. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  18955. return uid ? "Symbol(src)_1." + uid : "";
  18956. }();
  18957. function isMasked(func) {
  18958. return !!maskSrcKey && maskSrcKey in func;
  18959. }
  18960. module2.exports = isMasked;
  18961. }
  18962. });
  18963. var require_toSource = __commonJS2({
  18964. "node_modules/lodash/_toSource.js"(exports2, module2) {
  18965. var funcProto = Function.prototype;
  18966. var funcToString = funcProto.toString;
  18967. function toSource(func) {
  18968. if (func != null) {
  18969. try {
  18970. return funcToString.call(func);
  18971. } catch (e) {
  18972. }
  18973. try {
  18974. return func + "";
  18975. } catch (e) {
  18976. }
  18977. }
  18978. return "";
  18979. }
  18980. module2.exports = toSource;
  18981. }
  18982. });
  18983. var require_baseIsNative = __commonJS2({
  18984. "node_modules/lodash/_baseIsNative.js"(exports2, module2) {
  18985. var isFunction = require_isFunction();
  18986. var isMasked = require_isMasked();
  18987. var isObject = require_isObject();
  18988. var toSource = require_toSource();
  18989. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  18990. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  18991. var funcProto = Function.prototype;
  18992. var objectProto = Object.prototype;
  18993. var funcToString = funcProto.toString;
  18994. var hasOwnProperty = objectProto.hasOwnProperty;
  18995. var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
  18996. function baseIsNative(value) {
  18997. if (!isObject(value) || isMasked(value)) {
  18998. return false;
  18999. }
  19000. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  19001. return pattern.test(toSource(value));
  19002. }
  19003. module2.exports = baseIsNative;
  19004. }
  19005. });
  19006. var require_getValue = __commonJS2({
  19007. "node_modules/lodash/_getValue.js"(exports2, module2) {
  19008. function getValue(object, key) {
  19009. return object == null ? void 0 : object[key];
  19010. }
  19011. module2.exports = getValue;
  19012. }
  19013. });
  19014. var require_getNative = __commonJS2({
  19015. "node_modules/lodash/_getNative.js"(exports2, module2) {
  19016. var baseIsNative = require_baseIsNative();
  19017. var getValue = require_getValue();
  19018. function getNative(object, key) {
  19019. var value = getValue(object, key);
  19020. return baseIsNative(value) ? value : void 0;
  19021. }
  19022. module2.exports = getNative;
  19023. }
  19024. });
  19025. var require_Map = __commonJS2({
  19026. "node_modules/lodash/_Map.js"(exports2, module2) {
  19027. var getNative = require_getNative();
  19028. var root = require_root();
  19029. var Map2 = getNative(root, "Map");
  19030. module2.exports = Map2;
  19031. }
  19032. });
  19033. var require_nativeCreate = __commonJS2({
  19034. "node_modules/lodash/_nativeCreate.js"(exports2, module2) {
  19035. var getNative = require_getNative();
  19036. var nativeCreate = getNative(Object, "create");
  19037. module2.exports = nativeCreate;
  19038. }
  19039. });
  19040. var require_hashClear = __commonJS2({
  19041. "node_modules/lodash/_hashClear.js"(exports2, module2) {
  19042. var nativeCreate = require_nativeCreate();
  19043. function hashClear() {
  19044. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  19045. this.size = 0;
  19046. }
  19047. module2.exports = hashClear;
  19048. }
  19049. });
  19050. var require_hashDelete = __commonJS2({
  19051. "node_modules/lodash/_hashDelete.js"(exports2, module2) {
  19052. function hashDelete(key) {
  19053. var result = this.has(key) && delete this.__data__[key];
  19054. this.size -= result ? 1 : 0;
  19055. return result;
  19056. }
  19057. module2.exports = hashDelete;
  19058. }
  19059. });
  19060. var require_hashGet = __commonJS2({
  19061. "node_modules/lodash/_hashGet.js"(exports2, module2) {
  19062. var nativeCreate = require_nativeCreate();
  19063. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  19064. var objectProto = Object.prototype;
  19065. var hasOwnProperty = objectProto.hasOwnProperty;
  19066. function hashGet(key) {
  19067. var data = this.__data__;
  19068. if (nativeCreate) {
  19069. var result = data[key];
  19070. return result === HASH_UNDEFINED ? void 0 : result;
  19071. }
  19072. return hasOwnProperty.call(data, key) ? data[key] : void 0;
  19073. }
  19074. module2.exports = hashGet;
  19075. }
  19076. });
  19077. var require_hashHas = __commonJS2({
  19078. "node_modules/lodash/_hashHas.js"(exports2, module2) {
  19079. var nativeCreate = require_nativeCreate();
  19080. var objectProto = Object.prototype;
  19081. var hasOwnProperty = objectProto.hasOwnProperty;
  19082. function hashHas(key) {
  19083. var data = this.__data__;
  19084. return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
  19085. }
  19086. module2.exports = hashHas;
  19087. }
  19088. });
  19089. var require_hashSet = __commonJS2({
  19090. "node_modules/lodash/_hashSet.js"(exports2, module2) {
  19091. var nativeCreate = require_nativeCreate();
  19092. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  19093. function hashSet(key, value) {
  19094. var data = this.__data__;
  19095. this.size += this.has(key) ? 0 : 1;
  19096. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
  19097. return this;
  19098. }
  19099. module2.exports = hashSet;
  19100. }
  19101. });
  19102. var require_Hash = __commonJS2({
  19103. "node_modules/lodash/_Hash.js"(exports2, module2) {
  19104. var hashClear = require_hashClear();
  19105. var hashDelete = require_hashDelete();
  19106. var hashGet = require_hashGet();
  19107. var hashHas = require_hashHas();
  19108. var hashSet = require_hashSet();
  19109. function Hash(entries) {
  19110. var index = -1, length = entries == null ? 0 : entries.length;
  19111. this.clear();
  19112. while (++index < length) {
  19113. var entry = entries[index];
  19114. this.set(entry[0], entry[1]);
  19115. }
  19116. }
  19117. Hash.prototype.clear = hashClear;
  19118. Hash.prototype["delete"] = hashDelete;
  19119. Hash.prototype.get = hashGet;
  19120. Hash.prototype.has = hashHas;
  19121. Hash.prototype.set = hashSet;
  19122. module2.exports = Hash;
  19123. }
  19124. });
  19125. var require_mapCacheClear = __commonJS2({
  19126. "node_modules/lodash/_mapCacheClear.js"(exports2, module2) {
  19127. var Hash = require_Hash();
  19128. var ListCache = require_ListCache();
  19129. var Map2 = require_Map();
  19130. function mapCacheClear() {
  19131. this.size = 0;
  19132. this.__data__ = {
  19133. "hash": new Hash(),
  19134. "map": new (Map2 || ListCache)(),
  19135. "string": new Hash()
  19136. };
  19137. }
  19138. module2.exports = mapCacheClear;
  19139. }
  19140. });
  19141. var require_isKeyable = __commonJS2({
  19142. "node_modules/lodash/_isKeyable.js"(exports2, module2) {
  19143. function isKeyable(value) {
  19144. var type = typeof value;
  19145. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  19146. }
  19147. module2.exports = isKeyable;
  19148. }
  19149. });
  19150. var require_getMapData = __commonJS2({
  19151. "node_modules/lodash/_getMapData.js"(exports2, module2) {
  19152. var isKeyable = require_isKeyable();
  19153. function getMapData(map, key) {
  19154. var data = map.__data__;
  19155. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  19156. }
  19157. module2.exports = getMapData;
  19158. }
  19159. });
  19160. var require_mapCacheDelete = __commonJS2({
  19161. "node_modules/lodash/_mapCacheDelete.js"(exports2, module2) {
  19162. var getMapData = require_getMapData();
  19163. function mapCacheDelete(key) {
  19164. var result = getMapData(this, key)["delete"](key);
  19165. this.size -= result ? 1 : 0;
  19166. return result;
  19167. }
  19168. module2.exports = mapCacheDelete;
  19169. }
  19170. });
  19171. var require_mapCacheGet = __commonJS2({
  19172. "node_modules/lodash/_mapCacheGet.js"(exports2, module2) {
  19173. var getMapData = require_getMapData();
  19174. function mapCacheGet(key) {
  19175. return getMapData(this, key).get(key);
  19176. }
  19177. module2.exports = mapCacheGet;
  19178. }
  19179. });
  19180. var require_mapCacheHas = __commonJS2({
  19181. "node_modules/lodash/_mapCacheHas.js"(exports2, module2) {
  19182. var getMapData = require_getMapData();
  19183. function mapCacheHas(key) {
  19184. return getMapData(this, key).has(key);
  19185. }
  19186. module2.exports = mapCacheHas;
  19187. }
  19188. });
  19189. var require_mapCacheSet = __commonJS2({
  19190. "node_modules/lodash/_mapCacheSet.js"(exports2, module2) {
  19191. var getMapData = require_getMapData();
  19192. function mapCacheSet(key, value) {
  19193. var data = getMapData(this, key), size = data.size;
  19194. data.set(key, value);
  19195. this.size += data.size == size ? 0 : 1;
  19196. return this;
  19197. }
  19198. module2.exports = mapCacheSet;
  19199. }
  19200. });
  19201. var require_MapCache = __commonJS2({
  19202. "node_modules/lodash/_MapCache.js"(exports2, module2) {
  19203. var mapCacheClear = require_mapCacheClear();
  19204. var mapCacheDelete = require_mapCacheDelete();
  19205. var mapCacheGet = require_mapCacheGet();
  19206. var mapCacheHas = require_mapCacheHas();
  19207. var mapCacheSet = require_mapCacheSet();
  19208. function MapCache(entries) {
  19209. var index = -1, length = entries == null ? 0 : entries.length;
  19210. this.clear();
  19211. while (++index < length) {
  19212. var entry = entries[index];
  19213. this.set(entry[0], entry[1]);
  19214. }
  19215. }
  19216. MapCache.prototype.clear = mapCacheClear;
  19217. MapCache.prototype["delete"] = mapCacheDelete;
  19218. MapCache.prototype.get = mapCacheGet;
  19219. MapCache.prototype.has = mapCacheHas;
  19220. MapCache.prototype.set = mapCacheSet;
  19221. module2.exports = MapCache;
  19222. }
  19223. });
  19224. var require_stackSet = __commonJS2({
  19225. "node_modules/lodash/_stackSet.js"(exports2, module2) {
  19226. var ListCache = require_ListCache();
  19227. var Map2 = require_Map();
  19228. var MapCache = require_MapCache();
  19229. var LARGE_ARRAY_SIZE = 200;
  19230. function stackSet(key, value) {
  19231. var data = this.__data__;
  19232. if (data instanceof ListCache) {
  19233. var pairs = data.__data__;
  19234. if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  19235. pairs.push([key, value]);
  19236. this.size = ++data.size;
  19237. return this;
  19238. }
  19239. data = this.__data__ = new MapCache(pairs);
  19240. }
  19241. data.set(key, value);
  19242. this.size = data.size;
  19243. return this;
  19244. }
  19245. module2.exports = stackSet;
  19246. }
  19247. });
  19248. var require_Stack = __commonJS2({
  19249. "node_modules/lodash/_Stack.js"(exports2, module2) {
  19250. var ListCache = require_ListCache();
  19251. var stackClear = require_stackClear();
  19252. var stackDelete = require_stackDelete();
  19253. var stackGet = require_stackGet();
  19254. var stackHas = require_stackHas();
  19255. var stackSet = require_stackSet();
  19256. function Stack(entries) {
  19257. var data = this.__data__ = new ListCache(entries);
  19258. this.size = data.size;
  19259. }
  19260. Stack.prototype.clear = stackClear;
  19261. Stack.prototype["delete"] = stackDelete;
  19262. Stack.prototype.get = stackGet;
  19263. Stack.prototype.has = stackHas;
  19264. Stack.prototype.set = stackSet;
  19265. module2.exports = Stack;
  19266. }
  19267. });
  19268. var require_setCacheAdd = __commonJS2({
  19269. "node_modules/lodash/_setCacheAdd.js"(exports2, module2) {
  19270. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  19271. function setCacheAdd(value) {
  19272. this.__data__.set(value, HASH_UNDEFINED);
  19273. return this;
  19274. }
  19275. module2.exports = setCacheAdd;
  19276. }
  19277. });
  19278. var require_setCacheHas = __commonJS2({
  19279. "node_modules/lodash/_setCacheHas.js"(exports2, module2) {
  19280. function setCacheHas(value) {
  19281. return this.__data__.has(value);
  19282. }
  19283. module2.exports = setCacheHas;
  19284. }
  19285. });
  19286. var require_SetCache = __commonJS2({
  19287. "node_modules/lodash/_SetCache.js"(exports2, module2) {
  19288. var MapCache = require_MapCache();
  19289. var setCacheAdd = require_setCacheAdd();
  19290. var setCacheHas = require_setCacheHas();
  19291. function SetCache(values) {
  19292. var index = -1, length = values == null ? 0 : values.length;
  19293. this.__data__ = new MapCache();
  19294. while (++index < length) {
  19295. this.add(values[index]);
  19296. }
  19297. }
  19298. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  19299. SetCache.prototype.has = setCacheHas;
  19300. module2.exports = SetCache;
  19301. }
  19302. });
  19303. var require_arraySome = __commonJS2({
  19304. "node_modules/lodash/_arraySome.js"(exports2, module2) {
  19305. function arraySome(array, predicate) {
  19306. var index = -1, length = array == null ? 0 : array.length;
  19307. while (++index < length) {
  19308. if (predicate(array[index], index, array)) {
  19309. return true;
  19310. }
  19311. }
  19312. return false;
  19313. }
  19314. module2.exports = arraySome;
  19315. }
  19316. });
  19317. var require_cacheHas = __commonJS2({
  19318. "node_modules/lodash/_cacheHas.js"(exports2, module2) {
  19319. function cacheHas(cache, key) {
  19320. return cache.has(key);
  19321. }
  19322. module2.exports = cacheHas;
  19323. }
  19324. });
  19325. var require_equalArrays = __commonJS2({
  19326. "node_modules/lodash/_equalArrays.js"(exports2, module2) {
  19327. var SetCache = require_SetCache();
  19328. var arraySome = require_arraySome();
  19329. var cacheHas = require_cacheHas();
  19330. var COMPARE_PARTIAL_FLAG = 1;
  19331. var COMPARE_UNORDERED_FLAG = 2;
  19332. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  19333. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
  19334. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  19335. return false;
  19336. }
  19337. var arrStacked = stack.get(array);
  19338. var othStacked = stack.get(other);
  19339. if (arrStacked && othStacked) {
  19340. return arrStacked == other && othStacked == array;
  19341. }
  19342. var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
  19343. stack.set(array, other);
  19344. stack.set(other, array);
  19345. while (++index < arrLength) {
  19346. var arrValue = array[index], othValue = other[index];
  19347. if (customizer) {
  19348. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  19349. }
  19350. if (compared !== void 0) {
  19351. if (compared) {
  19352. continue;
  19353. }
  19354. result = false;
  19355. break;
  19356. }
  19357. if (seen) {
  19358. if (!arraySome(other, function(othValue2, othIndex) {
  19359. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  19360. return seen.push(othIndex);
  19361. }
  19362. })) {
  19363. result = false;
  19364. break;
  19365. }
  19366. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  19367. result = false;
  19368. break;
  19369. }
  19370. }
  19371. stack["delete"](array);
  19372. stack["delete"](other);
  19373. return result;
  19374. }
  19375. module2.exports = equalArrays;
  19376. }
  19377. });
  19378. var require_Uint8Array = __commonJS2({
  19379. "node_modules/lodash/_Uint8Array.js"(exports2, module2) {
  19380. var root = require_root();
  19381. var Uint8Array2 = root.Uint8Array;
  19382. module2.exports = Uint8Array2;
  19383. }
  19384. });
  19385. var require_mapToArray = __commonJS2({
  19386. "node_modules/lodash/_mapToArray.js"(exports2, module2) {
  19387. function mapToArray(map) {
  19388. var index = -1, result = Array(map.size);
  19389. map.forEach(function(value, key) {
  19390. result[++index] = [key, value];
  19391. });
  19392. return result;
  19393. }
  19394. module2.exports = mapToArray;
  19395. }
  19396. });
  19397. var require_setToArray = __commonJS2({
  19398. "node_modules/lodash/_setToArray.js"(exports2, module2) {
  19399. function setToArray(set) {
  19400. var index = -1, result = Array(set.size);
  19401. set.forEach(function(value) {
  19402. result[++index] = value;
  19403. });
  19404. return result;
  19405. }
  19406. module2.exports = setToArray;
  19407. }
  19408. });
  19409. var require_equalByTag = __commonJS2({
  19410. "node_modules/lodash/_equalByTag.js"(exports2, module2) {
  19411. var Symbol2 = require_Symbol();
  19412. var Uint8Array2 = require_Uint8Array();
  19413. var eq = require_eq();
  19414. var equalArrays = require_equalArrays();
  19415. var mapToArray = require_mapToArray();
  19416. var setToArray = require_setToArray();
  19417. var COMPARE_PARTIAL_FLAG = 1;
  19418. var COMPARE_UNORDERED_FLAG = 2;
  19419. var boolTag = "[object Boolean]";
  19420. var dateTag = "[object Date]";
  19421. var errorTag = "[object Error]";
  19422. var mapTag = "[object Map]";
  19423. var numberTag = "[object Number]";
  19424. var regexpTag = "[object RegExp]";
  19425. var setTag = "[object Set]";
  19426. var stringTag = "[object String]";
  19427. var symbolTag = "[object Symbol]";
  19428. var arrayBufferTag = "[object ArrayBuffer]";
  19429. var dataViewTag = "[object DataView]";
  19430. var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
  19431. var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  19432. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  19433. switch (tag) {
  19434. case dataViewTag:
  19435. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  19436. return false;
  19437. }
  19438. object = object.buffer;
  19439. other = other.buffer;
  19440. case arrayBufferTag:
  19441. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
  19442. return false;
  19443. }
  19444. return true;
  19445. case boolTag:
  19446. case dateTag:
  19447. case numberTag:
  19448. return eq(+object, +other);
  19449. case errorTag:
  19450. return object.name == other.name && object.message == other.message;
  19451. case regexpTag:
  19452. case stringTag:
  19453. return object == other + "";
  19454. case mapTag:
  19455. var convert = mapToArray;
  19456. case setTag:
  19457. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  19458. convert || (convert = setToArray);
  19459. if (object.size != other.size && !isPartial) {
  19460. return false;
  19461. }
  19462. var stacked = stack.get(object);
  19463. if (stacked) {
  19464. return stacked == other;
  19465. }
  19466. bitmask |= COMPARE_UNORDERED_FLAG;
  19467. stack.set(object, other);
  19468. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  19469. stack["delete"](object);
  19470. return result;
  19471. case symbolTag:
  19472. if (symbolValueOf) {
  19473. return symbolValueOf.call(object) == symbolValueOf.call(other);
  19474. }
  19475. }
  19476. return false;
  19477. }
  19478. module2.exports = equalByTag;
  19479. }
  19480. });
  19481. var require_arrayPush = __commonJS2({
  19482. "node_modules/lodash/_arrayPush.js"(exports2, module2) {
  19483. function arrayPush(array, values) {
  19484. var index = -1, length = values.length, offset = array.length;
  19485. while (++index < length) {
  19486. array[offset + index] = values[index];
  19487. }
  19488. return array;
  19489. }
  19490. module2.exports = arrayPush;
  19491. }
  19492. });
  19493. var require_isArray = __commonJS2({
  19494. "node_modules/lodash/isArray.js"(exports2, module2) {
  19495. var isArray = Array.isArray;
  19496. module2.exports = isArray;
  19497. }
  19498. });
  19499. var require_baseGetAllKeys = __commonJS2({
  19500. "node_modules/lodash/_baseGetAllKeys.js"(exports2, module2) {
  19501. var arrayPush = require_arrayPush();
  19502. var isArray = require_isArray();
  19503. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  19504. var result = keysFunc(object);
  19505. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  19506. }
  19507. module2.exports = baseGetAllKeys;
  19508. }
  19509. });
  19510. var require_arrayFilter = __commonJS2({
  19511. "node_modules/lodash/_arrayFilter.js"(exports2, module2) {
  19512. function arrayFilter(array, predicate) {
  19513. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  19514. while (++index < length) {
  19515. var value = array[index];
  19516. if (predicate(value, index, array)) {
  19517. result[resIndex++] = value;
  19518. }
  19519. }
  19520. return result;
  19521. }
  19522. module2.exports = arrayFilter;
  19523. }
  19524. });
  19525. var require_stubArray = __commonJS2({
  19526. "node_modules/lodash/stubArray.js"(exports2, module2) {
  19527. function stubArray() {
  19528. return [];
  19529. }
  19530. module2.exports = stubArray;
  19531. }
  19532. });
  19533. var require_getSymbols = __commonJS2({
  19534. "node_modules/lodash/_getSymbols.js"(exports2, module2) {
  19535. var arrayFilter = require_arrayFilter();
  19536. var stubArray = require_stubArray();
  19537. var objectProto = Object.prototype;
  19538. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  19539. var nativeGetSymbols = Object.getOwnPropertySymbols;
  19540. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  19541. if (object == null) {
  19542. return [];
  19543. }
  19544. object = Object(object);
  19545. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  19546. return propertyIsEnumerable.call(object, symbol);
  19547. });
  19548. };
  19549. module2.exports = getSymbols;
  19550. }
  19551. });
  19552. var require_baseTimes = __commonJS2({
  19553. "node_modules/lodash/_baseTimes.js"(exports2, module2) {
  19554. function baseTimes(n, iteratee) {
  19555. var index = -1, result = Array(n);
  19556. while (++index < n) {
  19557. result[index] = iteratee(index);
  19558. }
  19559. return result;
  19560. }
  19561. module2.exports = baseTimes;
  19562. }
  19563. });
  19564. var require_isObjectLike = __commonJS2({
  19565. "node_modules/lodash/isObjectLike.js"(exports2, module2) {
  19566. function isObjectLike(value) {
  19567. return value != null && typeof value == "object";
  19568. }
  19569. module2.exports = isObjectLike;
  19570. }
  19571. });
  19572. var require_baseIsArguments = __commonJS2({
  19573. "node_modules/lodash/_baseIsArguments.js"(exports2, module2) {
  19574. var baseGetTag = require_baseGetTag();
  19575. var isObjectLike = require_isObjectLike();
  19576. var argsTag = "[object Arguments]";
  19577. function baseIsArguments(value) {
  19578. return isObjectLike(value) && baseGetTag(value) == argsTag;
  19579. }
  19580. module2.exports = baseIsArguments;
  19581. }
  19582. });
  19583. var require_isArguments = __commonJS2({
  19584. "node_modules/lodash/isArguments.js"(exports2, module2) {
  19585. var baseIsArguments = require_baseIsArguments();
  19586. var isObjectLike = require_isObjectLike();
  19587. var objectProto = Object.prototype;
  19588. var hasOwnProperty = objectProto.hasOwnProperty;
  19589. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  19590. var isArguments = baseIsArguments(function() {
  19591. return arguments;
  19592. }()) ? baseIsArguments : function(value) {
  19593. return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  19594. };
  19595. module2.exports = isArguments;
  19596. }
  19597. });
  19598. var require_stubFalse = __commonJS2({
  19599. "node_modules/lodash/stubFalse.js"(exports2, module2) {
  19600. function stubFalse() {
  19601. return false;
  19602. }
  19603. module2.exports = stubFalse;
  19604. }
  19605. });
  19606. var require_isBuffer = __commonJS2({
  19607. "node_modules/lodash/isBuffer.js"(exports2, module2) {
  19608. var root = require_root();
  19609. var stubFalse = require_stubFalse();
  19610. var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
  19611. var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
  19612. var moduleExports = freeModule && freeModule.exports === freeExports;
  19613. var Buffer2 = moduleExports ? root.Buffer : void 0;
  19614. var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
  19615. var isBuffer = nativeIsBuffer || stubFalse;
  19616. module2.exports = isBuffer;
  19617. }
  19618. });
  19619. var require_isIndex = __commonJS2({
  19620. "node_modules/lodash/_isIndex.js"(exports2, module2) {
  19621. var MAX_SAFE_INTEGER = 9007199254740991;
  19622. var reIsUint = /^(?:0|[1-9]\d*)$/;
  19623. function isIndex(value, length) {
  19624. var type = typeof value;
  19625. length = length == null ? MAX_SAFE_INTEGER : length;
  19626. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  19627. }
  19628. module2.exports = isIndex;
  19629. }
  19630. });
  19631. var require_isLength = __commonJS2({
  19632. "node_modules/lodash/isLength.js"(exports2, module2) {
  19633. var MAX_SAFE_INTEGER = 9007199254740991;
  19634. function isLength(value) {
  19635. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  19636. }
  19637. module2.exports = isLength;
  19638. }
  19639. });
  19640. var require_baseIsTypedArray = __commonJS2({
  19641. "node_modules/lodash/_baseIsTypedArray.js"(exports2, module2) {
  19642. var baseGetTag = require_baseGetTag();
  19643. var isLength = require_isLength();
  19644. var isObjectLike = require_isObjectLike();
  19645. var argsTag = "[object Arguments]";
  19646. var arrayTag = "[object Array]";
  19647. var boolTag = "[object Boolean]";
  19648. var dateTag = "[object Date]";
  19649. var errorTag = "[object Error]";
  19650. var funcTag = "[object Function]";
  19651. var mapTag = "[object Map]";
  19652. var numberTag = "[object Number]";
  19653. var objectTag = "[object Object]";
  19654. var regexpTag = "[object RegExp]";
  19655. var setTag = "[object Set]";
  19656. var stringTag = "[object String]";
  19657. var weakMapTag = "[object WeakMap]";
  19658. var arrayBufferTag = "[object ArrayBuffer]";
  19659. var dataViewTag = "[object DataView]";
  19660. var float32Tag = "[object Float32Array]";
  19661. var float64Tag = "[object Float64Array]";
  19662. var int8Tag = "[object Int8Array]";
  19663. var int16Tag = "[object Int16Array]";
  19664. var int32Tag = "[object Int32Array]";
  19665. var uint8Tag = "[object Uint8Array]";
  19666. var uint8ClampedTag = "[object Uint8ClampedArray]";
  19667. var uint16Tag = "[object Uint16Array]";
  19668. var uint32Tag = "[object Uint32Array]";
  19669. var typedArrayTags = {};
  19670. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  19671. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  19672. function baseIsTypedArray(value) {
  19673. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  19674. }
  19675. module2.exports = baseIsTypedArray;
  19676. }
  19677. });
  19678. var require_baseUnary = __commonJS2({
  19679. "node_modules/lodash/_baseUnary.js"(exports2, module2) {
  19680. function baseUnary(func) {
  19681. return function(value) {
  19682. return func(value);
  19683. };
  19684. }
  19685. module2.exports = baseUnary;
  19686. }
  19687. });
  19688. var require_nodeUtil = __commonJS2({
  19689. "node_modules/lodash/_nodeUtil.js"(exports2, module2) {
  19690. var freeGlobal = require_freeGlobal();
  19691. var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
  19692. var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
  19693. var moduleExports = freeModule && freeModule.exports === freeExports;
  19694. var freeProcess = moduleExports && freeGlobal.process;
  19695. var nodeUtil = function() {
  19696. try {
  19697. var types = freeModule && freeModule.require && freeModule.require("util").types;
  19698. if (types) {
  19699. return types;
  19700. }
  19701. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  19702. } catch (e) {
  19703. }
  19704. }();
  19705. module2.exports = nodeUtil;
  19706. }
  19707. });
  19708. var require_isTypedArray = __commonJS2({
  19709. "node_modules/lodash/isTypedArray.js"(exports2, module2) {
  19710. var baseIsTypedArray = require_baseIsTypedArray();
  19711. var baseUnary = require_baseUnary();
  19712. var nodeUtil = require_nodeUtil();
  19713. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  19714. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  19715. module2.exports = isTypedArray;
  19716. }
  19717. });
  19718. var require_arrayLikeKeys = __commonJS2({
  19719. "node_modules/lodash/_arrayLikeKeys.js"(exports2, module2) {
  19720. var baseTimes = require_baseTimes();
  19721. var isArguments = require_isArguments();
  19722. var isArray = require_isArray();
  19723. var isBuffer = require_isBuffer();
  19724. var isIndex = require_isIndex();
  19725. var isTypedArray = require_isTypedArray();
  19726. var objectProto = Object.prototype;
  19727. var hasOwnProperty = objectProto.hasOwnProperty;
  19728. function arrayLikeKeys(value, inherited) {
  19729. var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  19730. for (var key in value) {
  19731. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
  19732. result.push(key);
  19733. }
  19734. }
  19735. return result;
  19736. }
  19737. module2.exports = arrayLikeKeys;
  19738. }
  19739. });
  19740. var require_isPrototype = __commonJS2({
  19741. "node_modules/lodash/_isPrototype.js"(exports2, module2) {
  19742. var objectProto = Object.prototype;
  19743. function isPrototype(value) {
  19744. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
  19745. return value === proto;
  19746. }
  19747. module2.exports = isPrototype;
  19748. }
  19749. });
  19750. var require_overArg = __commonJS2({
  19751. "node_modules/lodash/_overArg.js"(exports2, module2) {
  19752. function overArg(func, transform) {
  19753. return function(arg) {
  19754. return func(transform(arg));
  19755. };
  19756. }
  19757. module2.exports = overArg;
  19758. }
  19759. });
  19760. var require_nativeKeys = __commonJS2({
  19761. "node_modules/lodash/_nativeKeys.js"(exports2, module2) {
  19762. var overArg = require_overArg();
  19763. var nativeKeys = overArg(Object.keys, Object);
  19764. module2.exports = nativeKeys;
  19765. }
  19766. });
  19767. var require_baseKeys = __commonJS2({
  19768. "node_modules/lodash/_baseKeys.js"(exports2, module2) {
  19769. var isPrototype = require_isPrototype();
  19770. var nativeKeys = require_nativeKeys();
  19771. var objectProto = Object.prototype;
  19772. var hasOwnProperty = objectProto.hasOwnProperty;
  19773. function baseKeys(object) {
  19774. if (!isPrototype(object)) {
  19775. return nativeKeys(object);
  19776. }
  19777. var result = [];
  19778. for (var key in Object(object)) {
  19779. if (hasOwnProperty.call(object, key) && key != "constructor") {
  19780. result.push(key);
  19781. }
  19782. }
  19783. return result;
  19784. }
  19785. module2.exports = baseKeys;
  19786. }
  19787. });
  19788. var require_isArrayLike = __commonJS2({
  19789. "node_modules/lodash/isArrayLike.js"(exports2, module2) {
  19790. var isFunction = require_isFunction();
  19791. var isLength = require_isLength();
  19792. function isArrayLike(value) {
  19793. return value != null && isLength(value.length) && !isFunction(value);
  19794. }
  19795. module2.exports = isArrayLike;
  19796. }
  19797. });
  19798. var require_keys = __commonJS2({
  19799. "node_modules/lodash/keys.js"(exports2, module2) {
  19800. var arrayLikeKeys = require_arrayLikeKeys();
  19801. var baseKeys = require_baseKeys();
  19802. var isArrayLike = require_isArrayLike();
  19803. function keys(object) {
  19804. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  19805. }
  19806. module2.exports = keys;
  19807. }
  19808. });
  19809. var require_getAllKeys = __commonJS2({
  19810. "node_modules/lodash/_getAllKeys.js"(exports2, module2) {
  19811. var baseGetAllKeys = require_baseGetAllKeys();
  19812. var getSymbols = require_getSymbols();
  19813. var keys = require_keys();
  19814. function getAllKeys(object) {
  19815. return baseGetAllKeys(object, keys, getSymbols);
  19816. }
  19817. module2.exports = getAllKeys;
  19818. }
  19819. });
  19820. var require_equalObjects = __commonJS2({
  19821. "node_modules/lodash/_equalObjects.js"(exports2, module2) {
  19822. var getAllKeys = require_getAllKeys();
  19823. var COMPARE_PARTIAL_FLAG = 1;
  19824. var objectProto = Object.prototype;
  19825. var hasOwnProperty = objectProto.hasOwnProperty;
  19826. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  19827. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  19828. if (objLength != othLength && !isPartial) {
  19829. return false;
  19830. }
  19831. var index = objLength;
  19832. while (index--) {
  19833. var key = objProps[index];
  19834. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  19835. return false;
  19836. }
  19837. }
  19838. var objStacked = stack.get(object);
  19839. var othStacked = stack.get(other);
  19840. if (objStacked && othStacked) {
  19841. return objStacked == other && othStacked == object;
  19842. }
  19843. var result = true;
  19844. stack.set(object, other);
  19845. stack.set(other, object);
  19846. var skipCtor = isPartial;
  19847. while (++index < objLength) {
  19848. key = objProps[index];
  19849. var objValue = object[key], othValue = other[key];
  19850. if (customizer) {
  19851. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  19852. }
  19853. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  19854. result = false;
  19855. break;
  19856. }
  19857. skipCtor || (skipCtor = key == "constructor");
  19858. }
  19859. if (result && !skipCtor) {
  19860. var objCtor = object.constructor, othCtor = other.constructor;
  19861. if (objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  19862. result = false;
  19863. }
  19864. }
  19865. stack["delete"](object);
  19866. stack["delete"](other);
  19867. return result;
  19868. }
  19869. module2.exports = equalObjects;
  19870. }
  19871. });
  19872. var require_DataView = __commonJS2({
  19873. "node_modules/lodash/_DataView.js"(exports2, module2) {
  19874. var getNative = require_getNative();
  19875. var root = require_root();
  19876. var DataView = getNative(root, "DataView");
  19877. module2.exports = DataView;
  19878. }
  19879. });
  19880. var require_Promise = __commonJS2({
  19881. "node_modules/lodash/_Promise.js"(exports2, module2) {
  19882. var getNative = require_getNative();
  19883. var root = require_root();
  19884. var Promise2 = getNative(root, "Promise");
  19885. module2.exports = Promise2;
  19886. }
  19887. });
  19888. var require_Set = __commonJS2({
  19889. "node_modules/lodash/_Set.js"(exports2, module2) {
  19890. var getNative = require_getNative();
  19891. var root = require_root();
  19892. var Set2 = getNative(root, "Set");
  19893. module2.exports = Set2;
  19894. }
  19895. });
  19896. var require_WeakMap = __commonJS2({
  19897. "node_modules/lodash/_WeakMap.js"(exports2, module2) {
  19898. var getNative = require_getNative();
  19899. var root = require_root();
  19900. var WeakMap2 = getNative(root, "WeakMap");
  19901. module2.exports = WeakMap2;
  19902. }
  19903. });
  19904. var require_getTag = __commonJS2({
  19905. "node_modules/lodash/_getTag.js"(exports2, module2) {
  19906. var DataView = require_DataView();
  19907. var Map2 = require_Map();
  19908. var Promise2 = require_Promise();
  19909. var Set2 = require_Set();
  19910. var WeakMap2 = require_WeakMap();
  19911. var baseGetTag = require_baseGetTag();
  19912. var toSource = require_toSource();
  19913. var mapTag = "[object Map]";
  19914. var objectTag = "[object Object]";
  19915. var promiseTag = "[object Promise]";
  19916. var setTag = "[object Set]";
  19917. var weakMapTag = "[object WeakMap]";
  19918. var dataViewTag = "[object DataView]";
  19919. var dataViewCtorString = toSource(DataView);
  19920. var mapCtorString = toSource(Map2);
  19921. var promiseCtorString = toSource(Promise2);
  19922. var setCtorString = toSource(Set2);
  19923. var weakMapCtorString = toSource(WeakMap2);
  19924. var getTag = baseGetTag;
  19925. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
  19926. getTag = function(value) {
  19927. var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  19928. if (ctorString) {
  19929. switch (ctorString) {
  19930. case dataViewCtorString:
  19931. return dataViewTag;
  19932. case mapCtorString:
  19933. return mapTag;
  19934. case promiseCtorString:
  19935. return promiseTag;
  19936. case setCtorString:
  19937. return setTag;
  19938. case weakMapCtorString:
  19939. return weakMapTag;
  19940. }
  19941. }
  19942. return result;
  19943. };
  19944. }
  19945. module2.exports = getTag;
  19946. }
  19947. });
  19948. var require_baseIsEqualDeep = __commonJS2({
  19949. "node_modules/lodash/_baseIsEqualDeep.js"(exports2, module2) {
  19950. var Stack = require_Stack();
  19951. var equalArrays = require_equalArrays();
  19952. var equalByTag = require_equalByTag();
  19953. var equalObjects = require_equalObjects();
  19954. var getTag = require_getTag();
  19955. var isArray = require_isArray();
  19956. var isBuffer = require_isBuffer();
  19957. var isTypedArray = require_isTypedArray();
  19958. var COMPARE_PARTIAL_FLAG = 1;
  19959. var argsTag = "[object Arguments]";
  19960. var arrayTag = "[object Array]";
  19961. var objectTag = "[object Object]";
  19962. var objectProto = Object.prototype;
  19963. var hasOwnProperty = objectProto.hasOwnProperty;
  19964. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  19965. var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
  19966. objTag = objTag == argsTag ? objectTag : objTag;
  19967. othTag = othTag == argsTag ? objectTag : othTag;
  19968. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  19969. if (isSameTag && isBuffer(object)) {
  19970. if (!isBuffer(other)) {
  19971. return false;
  19972. }
  19973. objIsArr = true;
  19974. objIsObj = false;
  19975. }
  19976. if (isSameTag && !objIsObj) {
  19977. stack || (stack = new Stack());
  19978. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  19979. }
  19980. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  19981. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  19982. if (objIsWrapped || othIsWrapped) {
  19983. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  19984. stack || (stack = new Stack());
  19985. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  19986. }
  19987. }
  19988. if (!isSameTag) {
  19989. return false;
  19990. }
  19991. stack || (stack = new Stack());
  19992. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  19993. }
  19994. module2.exports = baseIsEqualDeep;
  19995. }
  19996. });
  19997. var require_baseIsEqual = __commonJS2({
  19998. "node_modules/lodash/_baseIsEqual.js"(exports2, module2) {
  19999. var baseIsEqualDeep = require_baseIsEqualDeep();
  20000. var isObjectLike = require_isObjectLike();
  20001. function baseIsEqual(value, other, bitmask, customizer, stack) {
  20002. if (value === other) {
  20003. return true;
  20004. }
  20005. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  20006. return value !== value && other !== other;
  20007. }
  20008. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  20009. }
  20010. module2.exports = baseIsEqual;
  20011. }
  20012. });
  20013. var require_baseIsMatch = __commonJS2({
  20014. "node_modules/lodash/_baseIsMatch.js"(exports2, module2) {
  20015. var Stack = require_Stack();
  20016. var baseIsEqual = require_baseIsEqual();
  20017. var COMPARE_PARTIAL_FLAG = 1;
  20018. var COMPARE_UNORDERED_FLAG = 2;
  20019. function baseIsMatch(object, source, matchData, customizer) {
  20020. var index = matchData.length, length = index, noCustomizer = !customizer;
  20021. if (object == null) {
  20022. return !length;
  20023. }
  20024. object = Object(object);
  20025. while (index--) {
  20026. var data = matchData[index];
  20027. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  20028. return false;
  20029. }
  20030. }
  20031. while (++index < length) {
  20032. data = matchData[index];
  20033. var key = data[0], objValue = object[key], srcValue = data[1];
  20034. if (noCustomizer && data[2]) {
  20035. if (objValue === void 0 && !(key in object)) {
  20036. return false;
  20037. }
  20038. } else {
  20039. var stack = new Stack();
  20040. if (customizer) {
  20041. var result = customizer(objValue, srcValue, key, object, source, stack);
  20042. }
  20043. if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
  20044. return false;
  20045. }
  20046. }
  20047. }
  20048. return true;
  20049. }
  20050. module2.exports = baseIsMatch;
  20051. }
  20052. });
  20053. var require_isStrictComparable = __commonJS2({
  20054. "node_modules/lodash/_isStrictComparable.js"(exports2, module2) {
  20055. var isObject = require_isObject();
  20056. function isStrictComparable(value) {
  20057. return value === value && !isObject(value);
  20058. }
  20059. module2.exports = isStrictComparable;
  20060. }
  20061. });
  20062. var require_getMatchData = __commonJS2({
  20063. "node_modules/lodash/_getMatchData.js"(exports2, module2) {
  20064. var isStrictComparable = require_isStrictComparable();
  20065. var keys = require_keys();
  20066. function getMatchData(object) {
  20067. var result = keys(object), length = result.length;
  20068. while (length--) {
  20069. var key = result[length], value = object[key];
  20070. result[length] = [key, value, isStrictComparable(value)];
  20071. }
  20072. return result;
  20073. }
  20074. module2.exports = getMatchData;
  20075. }
  20076. });
  20077. var require_matchesStrictComparable = __commonJS2({
  20078. "node_modules/lodash/_matchesStrictComparable.js"(exports2, module2) {
  20079. function matchesStrictComparable(key, srcValue) {
  20080. return function(object) {
  20081. if (object == null) {
  20082. return false;
  20083. }
  20084. return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
  20085. };
  20086. }
  20087. module2.exports = matchesStrictComparable;
  20088. }
  20089. });
  20090. var require_baseMatches = __commonJS2({
  20091. "node_modules/lodash/_baseMatches.js"(exports2, module2) {
  20092. var baseIsMatch = require_baseIsMatch();
  20093. var getMatchData = require_getMatchData();
  20094. var matchesStrictComparable = require_matchesStrictComparable();
  20095. function baseMatches(source) {
  20096. var matchData = getMatchData(source);
  20097. if (matchData.length == 1 && matchData[0][2]) {
  20098. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  20099. }
  20100. return function(object) {
  20101. return object === source || baseIsMatch(object, source, matchData);
  20102. };
  20103. }
  20104. module2.exports = baseMatches;
  20105. }
  20106. });
  20107. var require_isSymbol = __commonJS2({
  20108. "node_modules/lodash/isSymbol.js"(exports2, module2) {
  20109. var baseGetTag = require_baseGetTag();
  20110. var isObjectLike = require_isObjectLike();
  20111. var symbolTag = "[object Symbol]";
  20112. function isSymbol(value) {
  20113. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
  20114. }
  20115. module2.exports = isSymbol;
  20116. }
  20117. });
  20118. var require_isKey = __commonJS2({
  20119. "node_modules/lodash/_isKey.js"(exports2, module2) {
  20120. var isArray = require_isArray();
  20121. var isSymbol = require_isSymbol();
  20122. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
  20123. var reIsPlainProp = /^\w*$/;
  20124. function isKey(value, object) {
  20125. if (isArray(value)) {
  20126. return false;
  20127. }
  20128. var type = typeof value;
  20129. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
  20130. return true;
  20131. }
  20132. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  20133. }
  20134. module2.exports = isKey;
  20135. }
  20136. });
  20137. var require_memoize = __commonJS2({
  20138. "node_modules/lodash/memoize.js"(exports2, module2) {
  20139. var MapCache = require_MapCache();
  20140. var FUNC_ERROR_TEXT = "Expected a function";
  20141. function memoize(func, resolver) {
  20142. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  20143. throw new TypeError(FUNC_ERROR_TEXT);
  20144. }
  20145. var memoized = function() {
  20146. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  20147. if (cache.has(key)) {
  20148. return cache.get(key);
  20149. }
  20150. var result = func.apply(this, args);
  20151. memoized.cache = cache.set(key, result) || cache;
  20152. return result;
  20153. };
  20154. memoized.cache = new (memoize.Cache || MapCache)();
  20155. return memoized;
  20156. }
  20157. memoize.Cache = MapCache;
  20158. module2.exports = memoize;
  20159. }
  20160. });
  20161. var require_memoizeCapped = __commonJS2({
  20162. "node_modules/lodash/_memoizeCapped.js"(exports2, module2) {
  20163. var memoize = require_memoize();
  20164. var MAX_MEMOIZE_SIZE = 500;
  20165. function memoizeCapped(func) {
  20166. var result = memoize(func, function(key) {
  20167. if (cache.size === MAX_MEMOIZE_SIZE) {
  20168. cache.clear();
  20169. }
  20170. return key;
  20171. });
  20172. var cache = result.cache;
  20173. return result;
  20174. }
  20175. module2.exports = memoizeCapped;
  20176. }
  20177. });
  20178. var require_stringToPath = __commonJS2({
  20179. "node_modules/lodash/_stringToPath.js"(exports2, module2) {
  20180. var memoizeCapped = require_memoizeCapped();
  20181. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  20182. var reEscapeChar = /\\(\\)?/g;
  20183. var stringToPath = memoizeCapped(function(string) {
  20184. var result = [];
  20185. if (string.charCodeAt(0) === 46) {
  20186. result.push("");
  20187. }
  20188. string.replace(rePropName, function(match, number, quote, subString) {
  20189. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  20190. });
  20191. return result;
  20192. });
  20193. module2.exports = stringToPath;
  20194. }
  20195. });
  20196. var require_arrayMap = __commonJS2({
  20197. "node_modules/lodash/_arrayMap.js"(exports2, module2) {
  20198. function arrayMap(array, iteratee) {
  20199. var index = -1, length = array == null ? 0 : array.length, result = Array(length);
  20200. while (++index < length) {
  20201. result[index] = iteratee(array[index], index, array);
  20202. }
  20203. return result;
  20204. }
  20205. module2.exports = arrayMap;
  20206. }
  20207. });
  20208. var require_baseToString = __commonJS2({
  20209. "node_modules/lodash/_baseToString.js"(exports2, module2) {
  20210. var Symbol2 = require_Symbol();
  20211. var arrayMap = require_arrayMap();
  20212. var isArray = require_isArray();
  20213. var isSymbol = require_isSymbol();
  20214. var INFINITY = 1 / 0;
  20215. var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
  20216. var symbolToString = symbolProto ? symbolProto.toString : void 0;
  20217. function baseToString(value) {
  20218. if (typeof value == "string") {
  20219. return value;
  20220. }
  20221. if (isArray(value)) {
  20222. return arrayMap(value, baseToString) + "";
  20223. }
  20224. if (isSymbol(value)) {
  20225. return symbolToString ? symbolToString.call(value) : "";
  20226. }
  20227. var result = value + "";
  20228. return result == "0" && 1 / value == -INFINITY ? "-0" : result;
  20229. }
  20230. module2.exports = baseToString;
  20231. }
  20232. });
  20233. var require_toString = __commonJS2({
  20234. "node_modules/lodash/toString.js"(exports2, module2) {
  20235. var baseToString = require_baseToString();
  20236. function toString(value) {
  20237. return value == null ? "" : baseToString(value);
  20238. }
  20239. module2.exports = toString;
  20240. }
  20241. });
  20242. var require_castPath = __commonJS2({
  20243. "node_modules/lodash/_castPath.js"(exports2, module2) {
  20244. var isArray = require_isArray();
  20245. var isKey = require_isKey();
  20246. var stringToPath = require_stringToPath();
  20247. var toString = require_toString();
  20248. function castPath(value, object) {
  20249. if (isArray(value)) {
  20250. return value;
  20251. }
  20252. return isKey(value, object) ? [value] : stringToPath(toString(value));
  20253. }
  20254. module2.exports = castPath;
  20255. }
  20256. });
  20257. var require_toKey = __commonJS2({
  20258. "node_modules/lodash/_toKey.js"(exports2, module2) {
  20259. var isSymbol = require_isSymbol();
  20260. var INFINITY = 1 / 0;
  20261. function toKey(value) {
  20262. if (typeof value == "string" || isSymbol(value)) {
  20263. return value;
  20264. }
  20265. var result = value + "";
  20266. return result == "0" && 1 / value == -INFINITY ? "-0" : result;
  20267. }
  20268. module2.exports = toKey;
  20269. }
  20270. });
  20271. var require_baseGet = __commonJS2({
  20272. "node_modules/lodash/_baseGet.js"(exports2, module2) {
  20273. var castPath = require_castPath();
  20274. var toKey = require_toKey();
  20275. function baseGet(object, path) {
  20276. path = castPath(path, object);
  20277. var index = 0, length = path.length;
  20278. while (object != null && index < length) {
  20279. object = object[toKey(path[index++])];
  20280. }
  20281. return index && index == length ? object : void 0;
  20282. }
  20283. module2.exports = baseGet;
  20284. }
  20285. });
  20286. var require_get = __commonJS2({
  20287. "node_modules/lodash/get.js"(exports2, module2) {
  20288. var baseGet = require_baseGet();
  20289. function get(object, path, defaultValue) {
  20290. var result = object == null ? void 0 : baseGet(object, path);
  20291. return result === void 0 ? defaultValue : result;
  20292. }
  20293. module2.exports = get;
  20294. }
  20295. });
  20296. var require_baseHasIn = __commonJS2({
  20297. "node_modules/lodash/_baseHasIn.js"(exports2, module2) {
  20298. function baseHasIn(object, key) {
  20299. return object != null && key in Object(object);
  20300. }
  20301. module2.exports = baseHasIn;
  20302. }
  20303. });
  20304. var require_hasPath = __commonJS2({
  20305. "node_modules/lodash/_hasPath.js"(exports2, module2) {
  20306. var castPath = require_castPath();
  20307. var isArguments = require_isArguments();
  20308. var isArray = require_isArray();
  20309. var isIndex = require_isIndex();
  20310. var isLength = require_isLength();
  20311. var toKey = require_toKey();
  20312. function hasPath(object, path, hasFunc) {
  20313. path = castPath(path, object);
  20314. var index = -1, length = path.length, result = false;
  20315. while (++index < length) {
  20316. var key = toKey(path[index]);
  20317. if (!(result = object != null && hasFunc(object, key))) {
  20318. break;
  20319. }
  20320. object = object[key];
  20321. }
  20322. if (result || ++index != length) {
  20323. return result;
  20324. }
  20325. length = object == null ? 0 : object.length;
  20326. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  20327. }
  20328. module2.exports = hasPath;
  20329. }
  20330. });
  20331. var require_hasIn = __commonJS2({
  20332. "node_modules/lodash/hasIn.js"(exports2, module2) {
  20333. var baseHasIn = require_baseHasIn();
  20334. var hasPath = require_hasPath();
  20335. function hasIn(object, path) {
  20336. return object != null && hasPath(object, path, baseHasIn);
  20337. }
  20338. module2.exports = hasIn;
  20339. }
  20340. });
  20341. var require_baseMatchesProperty = __commonJS2({
  20342. "node_modules/lodash/_baseMatchesProperty.js"(exports2, module2) {
  20343. var baseIsEqual = require_baseIsEqual();
  20344. var get = require_get();
  20345. var hasIn = require_hasIn();
  20346. var isKey = require_isKey();
  20347. var isStrictComparable = require_isStrictComparable();
  20348. var matchesStrictComparable = require_matchesStrictComparable();
  20349. var toKey = require_toKey();
  20350. var COMPARE_PARTIAL_FLAG = 1;
  20351. var COMPARE_UNORDERED_FLAG = 2;
  20352. function baseMatchesProperty(path, srcValue) {
  20353. if (isKey(path) && isStrictComparable(srcValue)) {
  20354. return matchesStrictComparable(toKey(path), srcValue);
  20355. }
  20356. return function(object) {
  20357. var objValue = get(object, path);
  20358. return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  20359. };
  20360. }
  20361. module2.exports = baseMatchesProperty;
  20362. }
  20363. });
  20364. var require_identity = __commonJS2({
  20365. "node_modules/lodash/identity.js"(exports2, module2) {
  20366. function identity(value) {
  20367. return value;
  20368. }
  20369. module2.exports = identity;
  20370. }
  20371. });
  20372. var require_baseProperty = __commonJS2({
  20373. "node_modules/lodash/_baseProperty.js"(exports2, module2) {
  20374. function baseProperty(key) {
  20375. return function(object) {
  20376. return object == null ? void 0 : object[key];
  20377. };
  20378. }
  20379. module2.exports = baseProperty;
  20380. }
  20381. });
  20382. var require_basePropertyDeep = __commonJS2({
  20383. "node_modules/lodash/_basePropertyDeep.js"(exports2, module2) {
  20384. var baseGet = require_baseGet();
  20385. function basePropertyDeep(path) {
  20386. return function(object) {
  20387. return baseGet(object, path);
  20388. };
  20389. }
  20390. module2.exports = basePropertyDeep;
  20391. }
  20392. });
  20393. var require_property = __commonJS2({
  20394. "node_modules/lodash/property.js"(exports2, module2) {
  20395. var baseProperty = require_baseProperty();
  20396. var basePropertyDeep = require_basePropertyDeep();
  20397. var isKey = require_isKey();
  20398. var toKey = require_toKey();
  20399. function property(path) {
  20400. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  20401. }
  20402. module2.exports = property;
  20403. }
  20404. });
  20405. var require_baseIteratee = __commonJS2({
  20406. "node_modules/lodash/_baseIteratee.js"(exports2, module2) {
  20407. var baseMatches = require_baseMatches();
  20408. var baseMatchesProperty = require_baseMatchesProperty();
  20409. var identity = require_identity();
  20410. var isArray = require_isArray();
  20411. var property = require_property();
  20412. function baseIteratee(value) {
  20413. if (typeof value == "function") {
  20414. return value;
  20415. }
  20416. if (value == null) {
  20417. return identity;
  20418. }
  20419. if (typeof value == "object") {
  20420. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  20421. }
  20422. return property(value);
  20423. }
  20424. module2.exports = baseIteratee;
  20425. }
  20426. });
  20427. var require_baseFindIndex = __commonJS2({
  20428. "node_modules/lodash/_baseFindIndex.js"(exports2, module2) {
  20429. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  20430. var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
  20431. while (fromRight ? index-- : ++index < length) {
  20432. if (predicate(array[index], index, array)) {
  20433. return index;
  20434. }
  20435. }
  20436. return -1;
  20437. }
  20438. module2.exports = baseFindIndex;
  20439. }
  20440. });
  20441. var require_baseIsNaN = __commonJS2({
  20442. "node_modules/lodash/_baseIsNaN.js"(exports2, module2) {
  20443. function baseIsNaN(value) {
  20444. return value !== value;
  20445. }
  20446. module2.exports = baseIsNaN;
  20447. }
  20448. });
  20449. var require_strictIndexOf = __commonJS2({
  20450. "node_modules/lodash/_strictIndexOf.js"(exports2, module2) {
  20451. function strictIndexOf(array, value, fromIndex) {
  20452. var index = fromIndex - 1, length = array.length;
  20453. while (++index < length) {
  20454. if (array[index] === value) {
  20455. return index;
  20456. }
  20457. }
  20458. return -1;
  20459. }
  20460. module2.exports = strictIndexOf;
  20461. }
  20462. });
  20463. var require_baseIndexOf = __commonJS2({
  20464. "node_modules/lodash/_baseIndexOf.js"(exports2, module2) {
  20465. var baseFindIndex = require_baseFindIndex();
  20466. var baseIsNaN = require_baseIsNaN();
  20467. var strictIndexOf = require_strictIndexOf();
  20468. function baseIndexOf(array, value, fromIndex) {
  20469. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  20470. }
  20471. module2.exports = baseIndexOf;
  20472. }
  20473. });
  20474. var require_arrayIncludes = __commonJS2({
  20475. "node_modules/lodash/_arrayIncludes.js"(exports2, module2) {
  20476. var baseIndexOf = require_baseIndexOf();
  20477. function arrayIncludes(array, value) {
  20478. var length = array == null ? 0 : array.length;
  20479. return !!length && baseIndexOf(array, value, 0) > -1;
  20480. }
  20481. module2.exports = arrayIncludes;
  20482. }
  20483. });
  20484. var require_arrayIncludesWith = __commonJS2({
  20485. "node_modules/lodash/_arrayIncludesWith.js"(exports2, module2) {
  20486. function arrayIncludesWith(array, value, comparator) {
  20487. var index = -1, length = array == null ? 0 : array.length;
  20488. while (++index < length) {
  20489. if (comparator(value, array[index])) {
  20490. return true;
  20491. }
  20492. }
  20493. return false;
  20494. }
  20495. module2.exports = arrayIncludesWith;
  20496. }
  20497. });
  20498. var require_noop = __commonJS2({
  20499. "node_modules/lodash/noop.js"(exports2, module2) {
  20500. function noop() {
  20501. }
  20502. module2.exports = noop;
  20503. }
  20504. });
  20505. var require_createSet = __commonJS2({
  20506. "node_modules/lodash/_createSet.js"(exports2, module2) {
  20507. var Set2 = require_Set();
  20508. var noop = require_noop();
  20509. var setToArray = require_setToArray();
  20510. var INFINITY = 1 / 0;
  20511. var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
  20512. return new Set2(values);
  20513. };
  20514. module2.exports = createSet;
  20515. }
  20516. });
  20517. var require_baseUniq = __commonJS2({
  20518. "node_modules/lodash/_baseUniq.js"(exports2, module2) {
  20519. var SetCache = require_SetCache();
  20520. var arrayIncludes = require_arrayIncludes();
  20521. var arrayIncludesWith = require_arrayIncludesWith();
  20522. var cacheHas = require_cacheHas();
  20523. var createSet = require_createSet();
  20524. var setToArray = require_setToArray();
  20525. var LARGE_ARRAY_SIZE = 200;
  20526. function baseUniq(array, iteratee, comparator) {
  20527. var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
  20528. if (comparator) {
  20529. isCommon = false;
  20530. includes = arrayIncludesWith;
  20531. } else if (length >= LARGE_ARRAY_SIZE) {
  20532. var set = iteratee ? null : createSet(array);
  20533. if (set) {
  20534. return setToArray(set);
  20535. }
  20536. isCommon = false;
  20537. includes = cacheHas;
  20538. seen = new SetCache();
  20539. } else {
  20540. seen = iteratee ? [] : result;
  20541. }
  20542. outer:
  20543. while (++index < length) {
  20544. var value = array[index], computed = iteratee ? iteratee(value) : value;
  20545. value = comparator || value !== 0 ? value : 0;
  20546. if (isCommon && computed === computed) {
  20547. var seenIndex = seen.length;
  20548. while (seenIndex--) {
  20549. if (seen[seenIndex] === computed) {
  20550. continue outer;
  20551. }
  20552. }
  20553. if (iteratee) {
  20554. seen.push(computed);
  20555. }
  20556. result.push(value);
  20557. } else if (!includes(seen, computed, comparator)) {
  20558. if (seen !== result) {
  20559. seen.push(computed);
  20560. }
  20561. result.push(value);
  20562. }
  20563. }
  20564. return result;
  20565. }
  20566. module2.exports = baseUniq;
  20567. }
  20568. });
  20569. var require_uniqBy = __commonJS2({
  20570. "node_modules/lodash/uniqBy.js"(exports2, module2) {
  20571. var baseIteratee = require_baseIteratee();
  20572. var baseUniq = require_baseUniq();
  20573. function uniqBy(array, iteratee) {
  20574. return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
  20575. }
  20576. module2.exports = uniqBy;
  20577. }
  20578. });
  20579. var require_arrayAggregator = __commonJS2({
  20580. "node_modules/lodash/_arrayAggregator.js"(exports2, module2) {
  20581. function arrayAggregator(array, setter, iteratee, accumulator) {
  20582. var index = -1, length = array == null ? 0 : array.length;
  20583. while (++index < length) {
  20584. var value = array[index];
  20585. setter(accumulator, value, iteratee(value), array);
  20586. }
  20587. return accumulator;
  20588. }
  20589. module2.exports = arrayAggregator;
  20590. }
  20591. });
  20592. var require_createBaseFor = __commonJS2({
  20593. "node_modules/lodash/_createBaseFor.js"(exports2, module2) {
  20594. function createBaseFor(fromRight) {
  20595. return function(object, iteratee, keysFunc) {
  20596. var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
  20597. while (length--) {
  20598. var key = props[fromRight ? length : ++index];
  20599. if (iteratee(iterable[key], key, iterable) === false) {
  20600. break;
  20601. }
  20602. }
  20603. return object;
  20604. };
  20605. }
  20606. module2.exports = createBaseFor;
  20607. }
  20608. });
  20609. var require_baseFor = __commonJS2({
  20610. "node_modules/lodash/_baseFor.js"(exports2, module2) {
  20611. var createBaseFor = require_createBaseFor();
  20612. var baseFor = createBaseFor();
  20613. module2.exports = baseFor;
  20614. }
  20615. });
  20616. var require_baseForOwn = __commonJS2({
  20617. "node_modules/lodash/_baseForOwn.js"(exports2, module2) {
  20618. var baseFor = require_baseFor();
  20619. var keys = require_keys();
  20620. function baseForOwn(object, iteratee) {
  20621. return object && baseFor(object, iteratee, keys);
  20622. }
  20623. module2.exports = baseForOwn;
  20624. }
  20625. });
  20626. var require_createBaseEach = __commonJS2({
  20627. "node_modules/lodash/_createBaseEach.js"(exports2, module2) {
  20628. var isArrayLike = require_isArrayLike();
  20629. function createBaseEach(eachFunc, fromRight) {
  20630. return function(collection, iteratee) {
  20631. if (collection == null) {
  20632. return collection;
  20633. }
  20634. if (!isArrayLike(collection)) {
  20635. return eachFunc(collection, iteratee);
  20636. }
  20637. var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
  20638. while (fromRight ? index-- : ++index < length) {
  20639. if (iteratee(iterable[index], index, iterable) === false) {
  20640. break;
  20641. }
  20642. }
  20643. return collection;
  20644. };
  20645. }
  20646. module2.exports = createBaseEach;
  20647. }
  20648. });
  20649. var require_baseEach = __commonJS2({
  20650. "node_modules/lodash/_baseEach.js"(exports2, module2) {
  20651. var baseForOwn = require_baseForOwn();
  20652. var createBaseEach = require_createBaseEach();
  20653. var baseEach = createBaseEach(baseForOwn);
  20654. module2.exports = baseEach;
  20655. }
  20656. });
  20657. var require_baseAggregator = __commonJS2({
  20658. "node_modules/lodash/_baseAggregator.js"(exports2, module2) {
  20659. var baseEach = require_baseEach();
  20660. function baseAggregator(collection, setter, iteratee, accumulator) {
  20661. baseEach(collection, function(value, key, collection2) {
  20662. setter(accumulator, value, iteratee(value), collection2);
  20663. });
  20664. return accumulator;
  20665. }
  20666. module2.exports = baseAggregator;
  20667. }
  20668. });
  20669. var require_createAggregator = __commonJS2({
  20670. "node_modules/lodash/_createAggregator.js"(exports2, module2) {
  20671. var arrayAggregator = require_arrayAggregator();
  20672. var baseAggregator = require_baseAggregator();
  20673. var baseIteratee = require_baseIteratee();
  20674. var isArray = require_isArray();
  20675. function createAggregator(setter, initializer) {
  20676. return function(collection, iteratee) {
  20677. var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
  20678. return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
  20679. };
  20680. }
  20681. module2.exports = createAggregator;
  20682. }
  20683. });
  20684. var require_partition = __commonJS2({
  20685. "node_modules/lodash/partition.js"(exports2, module2) {
  20686. var createAggregator = require_createAggregator();
  20687. var partition = createAggregator(function(result, value, key) {
  20688. result[key ? 0 : 1].push(value);
  20689. }, function() {
  20690. return [[], []];
  20691. });
  20692. module2.exports = partition;
  20693. }
  20694. });
  20695. var require_array3 = __commonJS2({
  20696. "node_modules/fast-glob/out/utils/array.js"(exports2) {
  20697. "use strict";
  20698. Object.defineProperty(exports2, "__esModule", {
  20699. value: true
  20700. });
  20701. exports2.splitWhen = exports2.flatten = void 0;
  20702. function flatten(items) {
  20703. return items.reduce((collection, item) => [].concat(collection, item), []);
  20704. }
  20705. exports2.flatten = flatten;
  20706. function splitWhen(items, predicate) {
  20707. const result = [[]];
  20708. let groupIndex = 0;
  20709. for (const item of items) {
  20710. if (predicate(item)) {
  20711. groupIndex++;
  20712. result[groupIndex] = [];
  20713. } else {
  20714. result[groupIndex].push(item);
  20715. }
  20716. }
  20717. return result;
  20718. }
  20719. exports2.splitWhen = splitWhen;
  20720. }
  20721. });
  20722. var require_errno = __commonJS2({
  20723. "node_modules/fast-glob/out/utils/errno.js"(exports2) {
  20724. "use strict";
  20725. Object.defineProperty(exports2, "__esModule", {
  20726. value: true
  20727. });
  20728. exports2.isEnoentCodeError = void 0;
  20729. function isEnoentCodeError(error) {
  20730. return error.code === "ENOENT";
  20731. }
  20732. exports2.isEnoentCodeError = isEnoentCodeError;
  20733. }
  20734. });
  20735. var require_fs = __commonJS2({
  20736. "node_modules/fast-glob/out/utils/fs.js"(exports2) {
  20737. "use strict";
  20738. Object.defineProperty(exports2, "__esModule", {
  20739. value: true
  20740. });
  20741. exports2.createDirentFromStats = void 0;
  20742. var DirentFromStats = class {
  20743. constructor(name, stats) {
  20744. this.name = name;
  20745. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  20746. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  20747. this.isDirectory = stats.isDirectory.bind(stats);
  20748. this.isFIFO = stats.isFIFO.bind(stats);
  20749. this.isFile = stats.isFile.bind(stats);
  20750. this.isSocket = stats.isSocket.bind(stats);
  20751. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  20752. }
  20753. };
  20754. function createDirentFromStats(name, stats) {
  20755. return new DirentFromStats(name, stats);
  20756. }
  20757. exports2.createDirentFromStats = createDirentFromStats;
  20758. }
  20759. });
  20760. var require_path = __commonJS2({
  20761. "node_modules/fast-glob/out/utils/path.js"(exports2) {
  20762. "use strict";
  20763. Object.defineProperty(exports2, "__esModule", {
  20764. value: true
  20765. });
  20766. exports2.removeLeadingDotSegment = exports2.escape = exports2.makeAbsolute = exports2.unixify = void 0;
  20767. var path = require("path");
  20768. var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
  20769. var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
  20770. function unixify(filepath) {
  20771. return filepath.replace(/\\/g, "/");
  20772. }
  20773. exports2.unixify = unixify;
  20774. function makeAbsolute(cwd, filepath) {
  20775. return path.resolve(cwd, filepath);
  20776. }
  20777. exports2.makeAbsolute = makeAbsolute;
  20778. function escape(pattern) {
  20779. return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  20780. }
  20781. exports2.escape = escape;
  20782. function removeLeadingDotSegment(entry) {
  20783. if (entry.charAt(0) === ".") {
  20784. const secondCharactery = entry.charAt(1);
  20785. if (secondCharactery === "/" || secondCharactery === "\\") {
  20786. return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
  20787. }
  20788. }
  20789. return entry;
  20790. }
  20791. exports2.removeLeadingDotSegment = removeLeadingDotSegment;
  20792. }
  20793. });
  20794. var require_is_extglob = __commonJS2({
  20795. "node_modules/is-extglob/index.js"(exports2, module2) {
  20796. module2.exports = function isExtglob(str) {
  20797. if (typeof str !== "string" || str === "") {
  20798. return false;
  20799. }
  20800. var match;
  20801. while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
  20802. if (match[2])
  20803. return true;
  20804. str = str.slice(match.index + match[0].length);
  20805. }
  20806. return false;
  20807. };
  20808. }
  20809. });
  20810. var require_is_glob = __commonJS2({
  20811. "node_modules/is-glob/index.js"(exports2, module2) {
  20812. var isExtglob = require_is_extglob();
  20813. var chars = {
  20814. "{": "}",
  20815. "(": ")",
  20816. "[": "]"
  20817. };
  20818. var strictCheck = function(str) {
  20819. if (str[0] === "!") {
  20820. return true;
  20821. }
  20822. var index = 0;
  20823. var pipeIndex = -2;
  20824. var closeSquareIndex = -2;
  20825. var closeCurlyIndex = -2;
  20826. var closeParenIndex = -2;
  20827. var backSlashIndex = -2;
  20828. while (index < str.length) {
  20829. if (str[index] === "*") {
  20830. return true;
  20831. }
  20832. if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
  20833. return true;
  20834. }
  20835. if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
  20836. if (closeSquareIndex < index) {
  20837. closeSquareIndex = str.indexOf("]", index);
  20838. }
  20839. if (closeSquareIndex > index) {
  20840. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  20841. return true;
  20842. }
  20843. backSlashIndex = str.indexOf("\\", index);
  20844. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  20845. return true;
  20846. }
  20847. }
  20848. }
  20849. if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
  20850. closeCurlyIndex = str.indexOf("}", index);
  20851. if (closeCurlyIndex > index) {
  20852. backSlashIndex = str.indexOf("\\", index);
  20853. if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
  20854. return true;
  20855. }
  20856. }
  20857. }
  20858. if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
  20859. closeParenIndex = str.indexOf(")", index);
  20860. if (closeParenIndex > index) {
  20861. backSlashIndex = str.indexOf("\\", index);
  20862. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  20863. return true;
  20864. }
  20865. }
  20866. }
  20867. if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
  20868. if (pipeIndex < index) {
  20869. pipeIndex = str.indexOf("|", index);
  20870. }
  20871. if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
  20872. closeParenIndex = str.indexOf(")", pipeIndex);
  20873. if (closeParenIndex > pipeIndex) {
  20874. backSlashIndex = str.indexOf("\\", pipeIndex);
  20875. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  20876. return true;
  20877. }
  20878. }
  20879. }
  20880. }
  20881. if (str[index] === "\\") {
  20882. var open = str[index + 1];
  20883. index += 2;
  20884. var close = chars[open];
  20885. if (close) {
  20886. var n = str.indexOf(close, index);
  20887. if (n !== -1) {
  20888. index = n + 1;
  20889. }
  20890. }
  20891. if (str[index] === "!") {
  20892. return true;
  20893. }
  20894. } else {
  20895. index++;
  20896. }
  20897. }
  20898. return false;
  20899. };
  20900. var relaxedCheck = function(str) {
  20901. if (str[0] === "!") {
  20902. return true;
  20903. }
  20904. var index = 0;
  20905. while (index < str.length) {
  20906. if (/[*?{}()[\]]/.test(str[index])) {
  20907. return true;
  20908. }
  20909. if (str[index] === "\\") {
  20910. var open = str[index + 1];
  20911. index += 2;
  20912. var close = chars[open];
  20913. if (close) {
  20914. var n = str.indexOf(close, index);
  20915. if (n !== -1) {
  20916. index = n + 1;
  20917. }
  20918. }
  20919. if (str[index] === "!") {
  20920. return true;
  20921. }
  20922. } else {
  20923. index++;
  20924. }
  20925. }
  20926. return false;
  20927. };
  20928. module2.exports = function isGlob(str, options) {
  20929. if (typeof str !== "string" || str === "") {
  20930. return false;
  20931. }
  20932. if (isExtglob(str)) {
  20933. return true;
  20934. }
  20935. var check = strictCheck;
  20936. if (options && options.strict === false) {
  20937. check = relaxedCheck;
  20938. }
  20939. return check(str);
  20940. };
  20941. }
  20942. });
  20943. var require_glob_parent = __commonJS2({
  20944. "node_modules/glob-parent/index.js"(exports2, module2) {
  20945. "use strict";
  20946. var isGlob = require_is_glob();
  20947. var pathPosixDirname = require("path").posix.dirname;
  20948. var isWin32 = require("os").platform() === "win32";
  20949. var slash = "/";
  20950. var backslash = /\\/g;
  20951. var enclosure = /[\{\[].*[\}\]]$/;
  20952. var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
  20953. var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
  20954. module2.exports = function globParent(str, opts) {
  20955. var options = Object.assign({
  20956. flipBackslashes: true
  20957. }, opts);
  20958. if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
  20959. str = str.replace(backslash, slash);
  20960. }
  20961. if (enclosure.test(str)) {
  20962. str += slash;
  20963. }
  20964. str += "a";
  20965. do {
  20966. str = pathPosixDirname(str);
  20967. } while (isGlob(str) || globby.test(str));
  20968. return str.replace(escaped, "$1");
  20969. };
  20970. }
  20971. });
  20972. var require_pattern = __commonJS2({
  20973. "node_modules/fast-glob/out/utils/pattern.js"(exports2) {
  20974. "use strict";
  20975. Object.defineProperty(exports2, "__esModule", {
  20976. value: true
  20977. });
  20978. exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
  20979. var path = require("path");
  20980. var globParent = require_glob_parent();
  20981. var micromatch = require_micromatch();
  20982. var GLOBSTAR = "**";
  20983. var ESCAPE_SYMBOL = "\\";
  20984. var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
  20985. var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
  20986. var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
  20987. var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
  20988. var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
  20989. function isStaticPattern(pattern, options = {}) {
  20990. return !isDynamicPattern(pattern, options);
  20991. }
  20992. exports2.isStaticPattern = isStaticPattern;
  20993. function isDynamicPattern(pattern, options = {}) {
  20994. if (pattern === "") {
  20995. return false;
  20996. }
  20997. if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
  20998. return true;
  20999. }
  21000. if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
  21001. return true;
  21002. }
  21003. if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
  21004. return true;
  21005. }
  21006. if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
  21007. return true;
  21008. }
  21009. return false;
  21010. }
  21011. exports2.isDynamicPattern = isDynamicPattern;
  21012. function hasBraceExpansion(pattern) {
  21013. const openingBraceIndex = pattern.indexOf("{");
  21014. if (openingBraceIndex === -1) {
  21015. return false;
  21016. }
  21017. const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
  21018. if (closingBraceIndex === -1) {
  21019. return false;
  21020. }
  21021. const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
  21022. return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
  21023. }
  21024. function convertToPositivePattern(pattern) {
  21025. return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
  21026. }
  21027. exports2.convertToPositivePattern = convertToPositivePattern;
  21028. function convertToNegativePattern(pattern) {
  21029. return "!" + pattern;
  21030. }
  21031. exports2.convertToNegativePattern = convertToNegativePattern;
  21032. function isNegativePattern(pattern) {
  21033. return pattern.startsWith("!") && pattern[1] !== "(";
  21034. }
  21035. exports2.isNegativePattern = isNegativePattern;
  21036. function isPositivePattern(pattern) {
  21037. return !isNegativePattern(pattern);
  21038. }
  21039. exports2.isPositivePattern = isPositivePattern;
  21040. function getNegativePatterns(patterns) {
  21041. return patterns.filter(isNegativePattern);
  21042. }
  21043. exports2.getNegativePatterns = getNegativePatterns;
  21044. function getPositivePatterns(patterns) {
  21045. return patterns.filter(isPositivePattern);
  21046. }
  21047. exports2.getPositivePatterns = getPositivePatterns;
  21048. function getPatternsInsideCurrentDirectory(patterns) {
  21049. return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
  21050. }
  21051. exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
  21052. function getPatternsOutsideCurrentDirectory(patterns) {
  21053. return patterns.filter(isPatternRelatedToParentDirectory);
  21054. }
  21055. exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
  21056. function isPatternRelatedToParentDirectory(pattern) {
  21057. return pattern.startsWith("..") || pattern.startsWith("./..");
  21058. }
  21059. exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
  21060. function getBaseDirectory(pattern) {
  21061. return globParent(pattern, {
  21062. flipBackslashes: false
  21063. });
  21064. }
  21065. exports2.getBaseDirectory = getBaseDirectory;
  21066. function hasGlobStar(pattern) {
  21067. return pattern.includes(GLOBSTAR);
  21068. }
  21069. exports2.hasGlobStar = hasGlobStar;
  21070. function endsWithSlashGlobStar(pattern) {
  21071. return pattern.endsWith("/" + GLOBSTAR);
  21072. }
  21073. exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
  21074. function isAffectDepthOfReadingPattern(pattern) {
  21075. const basename = path.basename(pattern);
  21076. return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
  21077. }
  21078. exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
  21079. function expandPatternsWithBraceExpansion(patterns) {
  21080. return patterns.reduce((collection, pattern) => {
  21081. return collection.concat(expandBraceExpansion(pattern));
  21082. }, []);
  21083. }
  21084. exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
  21085. function expandBraceExpansion(pattern) {
  21086. return micromatch.braces(pattern, {
  21087. expand: true,
  21088. nodupes: true
  21089. });
  21090. }
  21091. exports2.expandBraceExpansion = expandBraceExpansion;
  21092. function getPatternParts(pattern, options) {
  21093. let {
  21094. parts
  21095. } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
  21096. parts: true
  21097. }));
  21098. if (parts.length === 0) {
  21099. parts = [pattern];
  21100. }
  21101. if (parts[0].startsWith("/")) {
  21102. parts[0] = parts[0].slice(1);
  21103. parts.unshift("");
  21104. }
  21105. return parts;
  21106. }
  21107. exports2.getPatternParts = getPatternParts;
  21108. function makeRe(pattern, options) {
  21109. return micromatch.makeRe(pattern, options);
  21110. }
  21111. exports2.makeRe = makeRe;
  21112. function convertPatternsToRe(patterns, options) {
  21113. return patterns.map((pattern) => makeRe(pattern, options));
  21114. }
  21115. exports2.convertPatternsToRe = convertPatternsToRe;
  21116. function matchAny(entry, patternsRe) {
  21117. return patternsRe.some((patternRe) => patternRe.test(entry));
  21118. }
  21119. exports2.matchAny = matchAny;
  21120. }
  21121. });
  21122. var require_merge2 = __commonJS2({
  21123. "node_modules/merge2/index.js"(exports2, module2) {
  21124. "use strict";
  21125. var Stream = require("stream");
  21126. var PassThrough = Stream.PassThrough;
  21127. var slice = Array.prototype.slice;
  21128. module2.exports = merge2;
  21129. function merge2() {
  21130. const streamsQueue = [];
  21131. const args = slice.call(arguments);
  21132. let merging = false;
  21133. let options = args[args.length - 1];
  21134. if (options && !Array.isArray(options) && options.pipe == null) {
  21135. args.pop();
  21136. } else {
  21137. options = {};
  21138. }
  21139. const doEnd = options.end !== false;
  21140. const doPipeError = options.pipeError === true;
  21141. if (options.objectMode == null) {
  21142. options.objectMode = true;
  21143. }
  21144. if (options.highWaterMark == null) {
  21145. options.highWaterMark = 64 * 1024;
  21146. }
  21147. const mergedStream = PassThrough(options);
  21148. function addStream() {
  21149. for (let i = 0, len = arguments.length; i < len; i++) {
  21150. streamsQueue.push(pauseStreams(arguments[i], options));
  21151. }
  21152. mergeStream();
  21153. return this;
  21154. }
  21155. function mergeStream() {
  21156. if (merging) {
  21157. return;
  21158. }
  21159. merging = true;
  21160. let streams = streamsQueue.shift();
  21161. if (!streams) {
  21162. process.nextTick(endStream);
  21163. return;
  21164. }
  21165. if (!Array.isArray(streams)) {
  21166. streams = [streams];
  21167. }
  21168. let pipesCount = streams.length + 1;
  21169. function next() {
  21170. if (--pipesCount > 0) {
  21171. return;
  21172. }
  21173. merging = false;
  21174. mergeStream();
  21175. }
  21176. function pipe(stream) {
  21177. function onend() {
  21178. stream.removeListener("merge2UnpipeEnd", onend);
  21179. stream.removeListener("end", onend);
  21180. if (doPipeError) {
  21181. stream.removeListener("error", onerror);
  21182. }
  21183. next();
  21184. }
  21185. function onerror(err) {
  21186. mergedStream.emit("error", err);
  21187. }
  21188. if (stream._readableState.endEmitted) {
  21189. return next();
  21190. }
  21191. stream.on("merge2UnpipeEnd", onend);
  21192. stream.on("end", onend);
  21193. if (doPipeError) {
  21194. stream.on("error", onerror);
  21195. }
  21196. stream.pipe(mergedStream, {
  21197. end: false
  21198. });
  21199. stream.resume();
  21200. }
  21201. for (let i = 0; i < streams.length; i++) {
  21202. pipe(streams[i]);
  21203. }
  21204. next();
  21205. }
  21206. function endStream() {
  21207. merging = false;
  21208. mergedStream.emit("queueDrain");
  21209. if (doEnd) {
  21210. mergedStream.end();
  21211. }
  21212. }
  21213. mergedStream.setMaxListeners(0);
  21214. mergedStream.add = addStream;
  21215. mergedStream.on("unpipe", function(stream) {
  21216. stream.emit("merge2UnpipeEnd");
  21217. });
  21218. if (args.length) {
  21219. addStream.apply(null, args);
  21220. }
  21221. return mergedStream;
  21222. }
  21223. function pauseStreams(streams, options) {
  21224. if (!Array.isArray(streams)) {
  21225. if (!streams._readableState && streams.pipe) {
  21226. streams = streams.pipe(PassThrough(options));
  21227. }
  21228. if (!streams._readableState || !streams.pause || !streams.pipe) {
  21229. throw new Error("Only readable stream can be merged.");
  21230. }
  21231. streams.pause();
  21232. } else {
  21233. for (let i = 0, len = streams.length; i < len; i++) {
  21234. streams[i] = pauseStreams(streams[i], options);
  21235. }
  21236. }
  21237. return streams;
  21238. }
  21239. }
  21240. });
  21241. var require_stream = __commonJS2({
  21242. "node_modules/fast-glob/out/utils/stream.js"(exports2) {
  21243. "use strict";
  21244. Object.defineProperty(exports2, "__esModule", {
  21245. value: true
  21246. });
  21247. exports2.merge = void 0;
  21248. var merge2 = require_merge2();
  21249. function merge(streams) {
  21250. const mergedStream = merge2(streams);
  21251. streams.forEach((stream) => {
  21252. stream.once("error", (error) => mergedStream.emit("error", error));
  21253. });
  21254. mergedStream.once("close", () => propagateCloseEventToSources(streams));
  21255. mergedStream.once("end", () => propagateCloseEventToSources(streams));
  21256. return mergedStream;
  21257. }
  21258. exports2.merge = merge;
  21259. function propagateCloseEventToSources(streams) {
  21260. streams.forEach((stream) => stream.emit("close"));
  21261. }
  21262. }
  21263. });
  21264. var require_string2 = __commonJS2({
  21265. "node_modules/fast-glob/out/utils/string.js"(exports2) {
  21266. "use strict";
  21267. Object.defineProperty(exports2, "__esModule", {
  21268. value: true
  21269. });
  21270. exports2.isEmpty = exports2.isString = void 0;
  21271. function isString(input) {
  21272. return typeof input === "string";
  21273. }
  21274. exports2.isString = isString;
  21275. function isEmpty(input) {
  21276. return input === "";
  21277. }
  21278. exports2.isEmpty = isEmpty;
  21279. }
  21280. });
  21281. var require_utils4 = __commonJS2({
  21282. "node_modules/fast-glob/out/utils/index.js"(exports2) {
  21283. "use strict";
  21284. Object.defineProperty(exports2, "__esModule", {
  21285. value: true
  21286. });
  21287. exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
  21288. var array = require_array3();
  21289. exports2.array = array;
  21290. var errno = require_errno();
  21291. exports2.errno = errno;
  21292. var fs = require_fs();
  21293. exports2.fs = fs;
  21294. var path = require_path();
  21295. exports2.path = path;
  21296. var pattern = require_pattern();
  21297. exports2.pattern = pattern;
  21298. var stream = require_stream();
  21299. exports2.stream = stream;
  21300. var string = require_string2();
  21301. exports2.string = string;
  21302. }
  21303. });
  21304. var require_tasks = __commonJS2({
  21305. "node_modules/fast-glob/out/managers/tasks.js"(exports2) {
  21306. "use strict";
  21307. Object.defineProperty(exports2, "__esModule", {
  21308. value: true
  21309. });
  21310. exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
  21311. var utils = require_utils4();
  21312. function generate(patterns, settings) {
  21313. const positivePatterns = getPositivePatterns(patterns);
  21314. const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
  21315. const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
  21316. const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
  21317. const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
  21318. const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
  21319. return staticTasks.concat(dynamicTasks);
  21320. }
  21321. exports2.generate = generate;
  21322. function convertPatternsToTasks(positive, negative, dynamic) {
  21323. const tasks = [];
  21324. const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
  21325. const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
  21326. const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
  21327. const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
  21328. tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
  21329. if ("." in insideCurrentDirectoryGroup) {
  21330. tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
  21331. } else {
  21332. tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
  21333. }
  21334. return tasks;
  21335. }
  21336. exports2.convertPatternsToTasks = convertPatternsToTasks;
  21337. function getPositivePatterns(patterns) {
  21338. return utils.pattern.getPositivePatterns(patterns);
  21339. }
  21340. exports2.getPositivePatterns = getPositivePatterns;
  21341. function getNegativePatternsAsPositive(patterns, ignore) {
  21342. const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
  21343. const positive = negative.map(utils.pattern.convertToPositivePattern);
  21344. return positive;
  21345. }
  21346. exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
  21347. function groupPatternsByBaseDirectory(patterns) {
  21348. const group = {};
  21349. return patterns.reduce((collection, pattern) => {
  21350. const base = utils.pattern.getBaseDirectory(pattern);
  21351. if (base in collection) {
  21352. collection[base].push(pattern);
  21353. } else {
  21354. collection[base] = [pattern];
  21355. }
  21356. return collection;
  21357. }, group);
  21358. }
  21359. exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
  21360. function convertPatternGroupsToTasks(positive, negative, dynamic) {
  21361. return Object.keys(positive).map((base) => {
  21362. return convertPatternGroupToTask(base, positive[base], negative, dynamic);
  21363. });
  21364. }
  21365. exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
  21366. function convertPatternGroupToTask(base, positive, negative, dynamic) {
  21367. return {
  21368. dynamic,
  21369. positive,
  21370. negative,
  21371. base,
  21372. patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
  21373. };
  21374. }
  21375. exports2.convertPatternGroupToTask = convertPatternGroupToTask;
  21376. }
  21377. });
  21378. var require_patterns = __commonJS2({
  21379. "node_modules/fast-glob/out/managers/patterns.js"(exports2) {
  21380. "use strict";
  21381. Object.defineProperty(exports2, "__esModule", {
  21382. value: true
  21383. });
  21384. exports2.removeDuplicateSlashes = exports2.transform = void 0;
  21385. var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
  21386. function transform(patterns) {
  21387. return patterns.map((pattern) => removeDuplicateSlashes(pattern));
  21388. }
  21389. exports2.transform = transform;
  21390. function removeDuplicateSlashes(pattern) {
  21391. return pattern.replace(DOUBLE_SLASH_RE, "/");
  21392. }
  21393. exports2.removeDuplicateSlashes = removeDuplicateSlashes;
  21394. }
  21395. });
  21396. var require_async2 = __commonJS2({
  21397. "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
  21398. "use strict";
  21399. Object.defineProperty(exports2, "__esModule", {
  21400. value: true
  21401. });
  21402. exports2.read = void 0;
  21403. function read(path, settings, callback) {
  21404. settings.fs.lstat(path, (lstatError, lstat) => {
  21405. if (lstatError !== null) {
  21406. callFailureCallback(callback, lstatError);
  21407. return;
  21408. }
  21409. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  21410. callSuccessCallback(callback, lstat);
  21411. return;
  21412. }
  21413. settings.fs.stat(path, (statError, stat) => {
  21414. if (statError !== null) {
  21415. if (settings.throwErrorOnBrokenSymbolicLink) {
  21416. callFailureCallback(callback, statError);
  21417. return;
  21418. }
  21419. callSuccessCallback(callback, lstat);
  21420. return;
  21421. }
  21422. if (settings.markSymbolicLink) {
  21423. stat.isSymbolicLink = () => true;
  21424. }
  21425. callSuccessCallback(callback, stat);
  21426. });
  21427. });
  21428. }
  21429. exports2.read = read;
  21430. function callFailureCallback(callback, error) {
  21431. callback(error);
  21432. }
  21433. function callSuccessCallback(callback, result) {
  21434. callback(null, result);
  21435. }
  21436. }
  21437. });
  21438. var require_sync2 = __commonJS2({
  21439. "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
  21440. "use strict";
  21441. Object.defineProperty(exports2, "__esModule", {
  21442. value: true
  21443. });
  21444. exports2.read = void 0;
  21445. function read(path, settings) {
  21446. const lstat = settings.fs.lstatSync(path);
  21447. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  21448. return lstat;
  21449. }
  21450. try {
  21451. const stat = settings.fs.statSync(path);
  21452. if (settings.markSymbolicLink) {
  21453. stat.isSymbolicLink = () => true;
  21454. }
  21455. return stat;
  21456. } catch (error) {
  21457. if (!settings.throwErrorOnBrokenSymbolicLink) {
  21458. return lstat;
  21459. }
  21460. throw error;
  21461. }
  21462. }
  21463. exports2.read = read;
  21464. }
  21465. });
  21466. var require_fs2 = __commonJS2({
  21467. "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
  21468. "use strict";
  21469. Object.defineProperty(exports2, "__esModule", {
  21470. value: true
  21471. });
  21472. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  21473. var fs = require("fs");
  21474. exports2.FILE_SYSTEM_ADAPTER = {
  21475. lstat: fs.lstat,
  21476. stat: fs.stat,
  21477. lstatSync: fs.lstatSync,
  21478. statSync: fs.statSync
  21479. };
  21480. function createFileSystemAdapter(fsMethods) {
  21481. if (fsMethods === void 0) {
  21482. return exports2.FILE_SYSTEM_ADAPTER;
  21483. }
  21484. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  21485. }
  21486. exports2.createFileSystemAdapter = createFileSystemAdapter;
  21487. }
  21488. });
  21489. var require_settings = __commonJS2({
  21490. "node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
  21491. "use strict";
  21492. Object.defineProperty(exports2, "__esModule", {
  21493. value: true
  21494. });
  21495. var fs = require_fs2();
  21496. var Settings = class {
  21497. constructor(_options = {}) {
  21498. this._options = _options;
  21499. this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
  21500. this.fs = fs.createFileSystemAdapter(this._options.fs);
  21501. this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
  21502. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  21503. }
  21504. _getValue(option, value) {
  21505. return option !== null && option !== void 0 ? option : value;
  21506. }
  21507. };
  21508. exports2.default = Settings;
  21509. }
  21510. });
  21511. var require_out = __commonJS2({
  21512. "node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
  21513. "use strict";
  21514. Object.defineProperty(exports2, "__esModule", {
  21515. value: true
  21516. });
  21517. exports2.statSync = exports2.stat = exports2.Settings = void 0;
  21518. var async = require_async2();
  21519. var sync = require_sync2();
  21520. var settings_1 = require_settings();
  21521. exports2.Settings = settings_1.default;
  21522. function stat(path, optionsOrSettingsOrCallback, callback) {
  21523. if (typeof optionsOrSettingsOrCallback === "function") {
  21524. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  21525. return;
  21526. }
  21527. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  21528. }
  21529. exports2.stat = stat;
  21530. function statSync(path, optionsOrSettings) {
  21531. const settings = getSettings(optionsOrSettings);
  21532. return sync.read(path, settings);
  21533. }
  21534. exports2.statSync = statSync;
  21535. function getSettings(settingsOrOptions = {}) {
  21536. if (settingsOrOptions instanceof settings_1.default) {
  21537. return settingsOrOptions;
  21538. }
  21539. return new settings_1.default(settingsOrOptions);
  21540. }
  21541. }
  21542. });
  21543. var require_queue_microtask = __commonJS2({
  21544. "node_modules/queue-microtask/index.js"(exports2, module2) {
  21545. var promise;
  21546. module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
  21547. throw err;
  21548. }, 0));
  21549. }
  21550. });
  21551. var require_run_parallel = __commonJS2({
  21552. "node_modules/run-parallel/index.js"(exports2, module2) {
  21553. module2.exports = runParallel;
  21554. var queueMicrotask2 = require_queue_microtask();
  21555. function runParallel(tasks, cb) {
  21556. let results, pending, keys;
  21557. let isSync = true;
  21558. if (Array.isArray(tasks)) {
  21559. results = [];
  21560. pending = tasks.length;
  21561. } else {
  21562. keys = Object.keys(tasks);
  21563. results = {};
  21564. pending = keys.length;
  21565. }
  21566. function done(err) {
  21567. function end() {
  21568. if (cb)
  21569. cb(err, results);
  21570. cb = null;
  21571. }
  21572. if (isSync)
  21573. queueMicrotask2(end);
  21574. else
  21575. end();
  21576. }
  21577. function each(i, err, result) {
  21578. results[i] = result;
  21579. if (--pending === 0 || err) {
  21580. done(err);
  21581. }
  21582. }
  21583. if (!pending) {
  21584. done(null);
  21585. } else if (keys) {
  21586. keys.forEach(function(key) {
  21587. tasks[key](function(err, result) {
  21588. each(key, err, result);
  21589. });
  21590. });
  21591. } else {
  21592. tasks.forEach(function(task, i) {
  21593. task(function(err, result) {
  21594. each(i, err, result);
  21595. });
  21596. });
  21597. }
  21598. isSync = false;
  21599. }
  21600. }
  21601. });
  21602. var require_constants4 = __commonJS2({
  21603. "node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
  21604. "use strict";
  21605. Object.defineProperty(exports2, "__esModule", {
  21606. value: true
  21607. });
  21608. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
  21609. var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
  21610. if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
  21611. throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
  21612. }
  21613. var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
  21614. var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
  21615. var SUPPORTED_MAJOR_VERSION = 10;
  21616. var SUPPORTED_MINOR_VERSION = 10;
  21617. var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
  21618. var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
  21619. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
  21620. }
  21621. });
  21622. var require_fs3 = __commonJS2({
  21623. "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
  21624. "use strict";
  21625. Object.defineProperty(exports2, "__esModule", {
  21626. value: true
  21627. });
  21628. exports2.createDirentFromStats = void 0;
  21629. var DirentFromStats = class {
  21630. constructor(name, stats) {
  21631. this.name = name;
  21632. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  21633. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  21634. this.isDirectory = stats.isDirectory.bind(stats);
  21635. this.isFIFO = stats.isFIFO.bind(stats);
  21636. this.isFile = stats.isFile.bind(stats);
  21637. this.isSocket = stats.isSocket.bind(stats);
  21638. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  21639. }
  21640. };
  21641. function createDirentFromStats(name, stats) {
  21642. return new DirentFromStats(name, stats);
  21643. }
  21644. exports2.createDirentFromStats = createDirentFromStats;
  21645. }
  21646. });
  21647. var require_utils5 = __commonJS2({
  21648. "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
  21649. "use strict";
  21650. Object.defineProperty(exports2, "__esModule", {
  21651. value: true
  21652. });
  21653. exports2.fs = void 0;
  21654. var fs = require_fs3();
  21655. exports2.fs = fs;
  21656. }
  21657. });
  21658. var require_common3 = __commonJS2({
  21659. "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
  21660. "use strict";
  21661. Object.defineProperty(exports2, "__esModule", {
  21662. value: true
  21663. });
  21664. exports2.joinPathSegments = void 0;
  21665. function joinPathSegments(a, b, separator) {
  21666. if (a.endsWith(separator)) {
  21667. return a + b;
  21668. }
  21669. return a + separator + b;
  21670. }
  21671. exports2.joinPathSegments = joinPathSegments;
  21672. }
  21673. });
  21674. var require_async3 = __commonJS2({
  21675. "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
  21676. "use strict";
  21677. Object.defineProperty(exports2, "__esModule", {
  21678. value: true
  21679. });
  21680. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  21681. var fsStat = require_out();
  21682. var rpl = require_run_parallel();
  21683. var constants_1 = require_constants4();
  21684. var utils = require_utils5();
  21685. var common = require_common3();
  21686. function read(directory, settings, callback) {
  21687. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  21688. readdirWithFileTypes(directory, settings, callback);
  21689. return;
  21690. }
  21691. readdir(directory, settings, callback);
  21692. }
  21693. exports2.read = read;
  21694. function readdirWithFileTypes(directory, settings, callback) {
  21695. settings.fs.readdir(directory, {
  21696. withFileTypes: true
  21697. }, (readdirError, dirents) => {
  21698. if (readdirError !== null) {
  21699. callFailureCallback(callback, readdirError);
  21700. return;
  21701. }
  21702. const entries = dirents.map((dirent) => ({
  21703. dirent,
  21704. name: dirent.name,
  21705. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  21706. }));
  21707. if (!settings.followSymbolicLinks) {
  21708. callSuccessCallback(callback, entries);
  21709. return;
  21710. }
  21711. const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
  21712. rpl(tasks, (rplError, rplEntries) => {
  21713. if (rplError !== null) {
  21714. callFailureCallback(callback, rplError);
  21715. return;
  21716. }
  21717. callSuccessCallback(callback, rplEntries);
  21718. });
  21719. });
  21720. }
  21721. exports2.readdirWithFileTypes = readdirWithFileTypes;
  21722. function makeRplTaskEntry(entry, settings) {
  21723. return (done) => {
  21724. if (!entry.dirent.isSymbolicLink()) {
  21725. done(null, entry);
  21726. return;
  21727. }
  21728. settings.fs.stat(entry.path, (statError, stats) => {
  21729. if (statError !== null) {
  21730. if (settings.throwErrorOnBrokenSymbolicLink) {
  21731. done(statError);
  21732. return;
  21733. }
  21734. done(null, entry);
  21735. return;
  21736. }
  21737. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  21738. done(null, entry);
  21739. });
  21740. };
  21741. }
  21742. function readdir(directory, settings, callback) {
  21743. settings.fs.readdir(directory, (readdirError, names) => {
  21744. if (readdirError !== null) {
  21745. callFailureCallback(callback, readdirError);
  21746. return;
  21747. }
  21748. const tasks = names.map((name) => {
  21749. const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  21750. return (done) => {
  21751. fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
  21752. if (error !== null) {
  21753. done(error);
  21754. return;
  21755. }
  21756. const entry = {
  21757. name,
  21758. path,
  21759. dirent: utils.fs.createDirentFromStats(name, stats)
  21760. };
  21761. if (settings.stats) {
  21762. entry.stats = stats;
  21763. }
  21764. done(null, entry);
  21765. });
  21766. };
  21767. });
  21768. rpl(tasks, (rplError, entries) => {
  21769. if (rplError !== null) {
  21770. callFailureCallback(callback, rplError);
  21771. return;
  21772. }
  21773. callSuccessCallback(callback, entries);
  21774. });
  21775. });
  21776. }
  21777. exports2.readdir = readdir;
  21778. function callFailureCallback(callback, error) {
  21779. callback(error);
  21780. }
  21781. function callSuccessCallback(callback, result) {
  21782. callback(null, result);
  21783. }
  21784. }
  21785. });
  21786. var require_sync3 = __commonJS2({
  21787. "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
  21788. "use strict";
  21789. Object.defineProperty(exports2, "__esModule", {
  21790. value: true
  21791. });
  21792. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  21793. var fsStat = require_out();
  21794. var constants_1 = require_constants4();
  21795. var utils = require_utils5();
  21796. var common = require_common3();
  21797. function read(directory, settings) {
  21798. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  21799. return readdirWithFileTypes(directory, settings);
  21800. }
  21801. return readdir(directory, settings);
  21802. }
  21803. exports2.read = read;
  21804. function readdirWithFileTypes(directory, settings) {
  21805. const dirents = settings.fs.readdirSync(directory, {
  21806. withFileTypes: true
  21807. });
  21808. return dirents.map((dirent) => {
  21809. const entry = {
  21810. dirent,
  21811. name: dirent.name,
  21812. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  21813. };
  21814. if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
  21815. try {
  21816. const stats = settings.fs.statSync(entry.path);
  21817. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  21818. } catch (error) {
  21819. if (settings.throwErrorOnBrokenSymbolicLink) {
  21820. throw error;
  21821. }
  21822. }
  21823. }
  21824. return entry;
  21825. });
  21826. }
  21827. exports2.readdirWithFileTypes = readdirWithFileTypes;
  21828. function readdir(directory, settings) {
  21829. const names = settings.fs.readdirSync(directory);
  21830. return names.map((name) => {
  21831. const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  21832. const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
  21833. const entry = {
  21834. name,
  21835. path: entryPath,
  21836. dirent: utils.fs.createDirentFromStats(name, stats)
  21837. };
  21838. if (settings.stats) {
  21839. entry.stats = stats;
  21840. }
  21841. return entry;
  21842. });
  21843. }
  21844. exports2.readdir = readdir;
  21845. }
  21846. });
  21847. var require_fs4 = __commonJS2({
  21848. "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
  21849. "use strict";
  21850. Object.defineProperty(exports2, "__esModule", {
  21851. value: true
  21852. });
  21853. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  21854. var fs = require("fs");
  21855. exports2.FILE_SYSTEM_ADAPTER = {
  21856. lstat: fs.lstat,
  21857. stat: fs.stat,
  21858. lstatSync: fs.lstatSync,
  21859. statSync: fs.statSync,
  21860. readdir: fs.readdir,
  21861. readdirSync: fs.readdirSync
  21862. };
  21863. function createFileSystemAdapter(fsMethods) {
  21864. if (fsMethods === void 0) {
  21865. return exports2.FILE_SYSTEM_ADAPTER;
  21866. }
  21867. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  21868. }
  21869. exports2.createFileSystemAdapter = createFileSystemAdapter;
  21870. }
  21871. });
  21872. var require_settings2 = __commonJS2({
  21873. "node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
  21874. "use strict";
  21875. Object.defineProperty(exports2, "__esModule", {
  21876. value: true
  21877. });
  21878. var path = require("path");
  21879. var fsStat = require_out();
  21880. var fs = require_fs4();
  21881. var Settings = class {
  21882. constructor(_options = {}) {
  21883. this._options = _options;
  21884. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
  21885. this.fs = fs.createFileSystemAdapter(this._options.fs);
  21886. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  21887. this.stats = this._getValue(this._options.stats, false);
  21888. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  21889. this.fsStatSettings = new fsStat.Settings({
  21890. followSymbolicLink: this.followSymbolicLinks,
  21891. fs: this.fs,
  21892. throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
  21893. });
  21894. }
  21895. _getValue(option, value) {
  21896. return option !== null && option !== void 0 ? option : value;
  21897. }
  21898. };
  21899. exports2.default = Settings;
  21900. }
  21901. });
  21902. var require_out2 = __commonJS2({
  21903. "node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
  21904. "use strict";
  21905. Object.defineProperty(exports2, "__esModule", {
  21906. value: true
  21907. });
  21908. exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
  21909. var async = require_async3();
  21910. var sync = require_sync3();
  21911. var settings_1 = require_settings2();
  21912. exports2.Settings = settings_1.default;
  21913. function scandir(path, optionsOrSettingsOrCallback, callback) {
  21914. if (typeof optionsOrSettingsOrCallback === "function") {
  21915. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  21916. return;
  21917. }
  21918. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  21919. }
  21920. exports2.scandir = scandir;
  21921. function scandirSync(path, optionsOrSettings) {
  21922. const settings = getSettings(optionsOrSettings);
  21923. return sync.read(path, settings);
  21924. }
  21925. exports2.scandirSync = scandirSync;
  21926. function getSettings(settingsOrOptions = {}) {
  21927. if (settingsOrOptions instanceof settings_1.default) {
  21928. return settingsOrOptions;
  21929. }
  21930. return new settings_1.default(settingsOrOptions);
  21931. }
  21932. }
  21933. });
  21934. var require_reusify = __commonJS2({
  21935. "node_modules/reusify/reusify.js"(exports2, module2) {
  21936. "use strict";
  21937. function reusify(Constructor) {
  21938. var head = new Constructor();
  21939. var tail = head;
  21940. function get() {
  21941. var current = head;
  21942. if (current.next) {
  21943. head = current.next;
  21944. } else {
  21945. head = new Constructor();
  21946. tail = head;
  21947. }
  21948. current.next = null;
  21949. return current;
  21950. }
  21951. function release(obj) {
  21952. tail.next = obj;
  21953. tail = obj;
  21954. }
  21955. return {
  21956. get,
  21957. release
  21958. };
  21959. }
  21960. module2.exports = reusify;
  21961. }
  21962. });
  21963. var require_queue = __commonJS2({
  21964. "node_modules/fastq/queue.js"(exports2, module2) {
  21965. "use strict";
  21966. var reusify = require_reusify();
  21967. function fastqueue(context, worker, concurrency) {
  21968. if (typeof context === "function") {
  21969. concurrency = worker;
  21970. worker = context;
  21971. context = null;
  21972. }
  21973. if (concurrency < 1) {
  21974. throw new Error("fastqueue concurrency must be greater than 1");
  21975. }
  21976. var cache = reusify(Task);
  21977. var queueHead = null;
  21978. var queueTail = null;
  21979. var _running = 0;
  21980. var errorHandler = null;
  21981. var self2 = {
  21982. push,
  21983. drain: noop,
  21984. saturated: noop,
  21985. pause,
  21986. paused: false,
  21987. concurrency,
  21988. running,
  21989. resume,
  21990. idle,
  21991. length,
  21992. getQueue,
  21993. unshift,
  21994. empty: noop,
  21995. kill,
  21996. killAndDrain,
  21997. error
  21998. };
  21999. return self2;
  22000. function running() {
  22001. return _running;
  22002. }
  22003. function pause() {
  22004. self2.paused = true;
  22005. }
  22006. function length() {
  22007. var current = queueHead;
  22008. var counter = 0;
  22009. while (current) {
  22010. current = current.next;
  22011. counter++;
  22012. }
  22013. return counter;
  22014. }
  22015. function getQueue() {
  22016. var current = queueHead;
  22017. var tasks = [];
  22018. while (current) {
  22019. tasks.push(current.value);
  22020. current = current.next;
  22021. }
  22022. return tasks;
  22023. }
  22024. function resume() {
  22025. if (!self2.paused)
  22026. return;
  22027. self2.paused = false;
  22028. for (var i = 0; i < self2.concurrency; i++) {
  22029. _running++;
  22030. release();
  22031. }
  22032. }
  22033. function idle() {
  22034. return _running === 0 && self2.length() === 0;
  22035. }
  22036. function push(value, done) {
  22037. var current = cache.get();
  22038. current.context = context;
  22039. current.release = release;
  22040. current.value = value;
  22041. current.callback = done || noop;
  22042. current.errorHandler = errorHandler;
  22043. if (_running === self2.concurrency || self2.paused) {
  22044. if (queueTail) {
  22045. queueTail.next = current;
  22046. queueTail = current;
  22047. } else {
  22048. queueHead = current;
  22049. queueTail = current;
  22050. self2.saturated();
  22051. }
  22052. } else {
  22053. _running++;
  22054. worker.call(context, current.value, current.worked);
  22055. }
  22056. }
  22057. function unshift(value, done) {
  22058. var current = cache.get();
  22059. current.context = context;
  22060. current.release = release;
  22061. current.value = value;
  22062. current.callback = done || noop;
  22063. if (_running === self2.concurrency || self2.paused) {
  22064. if (queueHead) {
  22065. current.next = queueHead;
  22066. queueHead = current;
  22067. } else {
  22068. queueHead = current;
  22069. queueTail = current;
  22070. self2.saturated();
  22071. }
  22072. } else {
  22073. _running++;
  22074. worker.call(context, current.value, current.worked);
  22075. }
  22076. }
  22077. function release(holder) {
  22078. if (holder) {
  22079. cache.release(holder);
  22080. }
  22081. var next = queueHead;
  22082. if (next) {
  22083. if (!self2.paused) {
  22084. if (queueTail === queueHead) {
  22085. queueTail = null;
  22086. }
  22087. queueHead = next.next;
  22088. next.next = null;
  22089. worker.call(context, next.value, next.worked);
  22090. if (queueTail === null) {
  22091. self2.empty();
  22092. }
  22093. } else {
  22094. _running--;
  22095. }
  22096. } else if (--_running === 0) {
  22097. self2.drain();
  22098. }
  22099. }
  22100. function kill() {
  22101. queueHead = null;
  22102. queueTail = null;
  22103. self2.drain = noop;
  22104. }
  22105. function killAndDrain() {
  22106. queueHead = null;
  22107. queueTail = null;
  22108. self2.drain();
  22109. self2.drain = noop;
  22110. }
  22111. function error(handler) {
  22112. errorHandler = handler;
  22113. }
  22114. }
  22115. function noop() {
  22116. }
  22117. function Task() {
  22118. this.value = null;
  22119. this.callback = noop;
  22120. this.next = null;
  22121. this.release = noop;
  22122. this.context = null;
  22123. this.errorHandler = null;
  22124. var self2 = this;
  22125. this.worked = function worked(err, result) {
  22126. var callback = self2.callback;
  22127. var errorHandler = self2.errorHandler;
  22128. var val = self2.value;
  22129. self2.value = null;
  22130. self2.callback = noop;
  22131. if (self2.errorHandler) {
  22132. errorHandler(err, val);
  22133. }
  22134. callback.call(self2.context, err, result);
  22135. self2.release(self2);
  22136. };
  22137. }
  22138. function queueAsPromised(context, worker, concurrency) {
  22139. if (typeof context === "function") {
  22140. concurrency = worker;
  22141. worker = context;
  22142. context = null;
  22143. }
  22144. function asyncWrapper(arg, cb) {
  22145. worker.call(this, arg).then(function(res) {
  22146. cb(null, res);
  22147. }, cb);
  22148. }
  22149. var queue = fastqueue(context, asyncWrapper, concurrency);
  22150. var pushCb = queue.push;
  22151. var unshiftCb = queue.unshift;
  22152. queue.push = push;
  22153. queue.unshift = unshift;
  22154. queue.drained = drained;
  22155. return queue;
  22156. function push(value) {
  22157. var p = new Promise(function(resolve, reject) {
  22158. pushCb(value, function(err, result) {
  22159. if (err) {
  22160. reject(err);
  22161. return;
  22162. }
  22163. resolve(result);
  22164. });
  22165. });
  22166. p.catch(noop);
  22167. return p;
  22168. }
  22169. function unshift(value) {
  22170. var p = new Promise(function(resolve, reject) {
  22171. unshiftCb(value, function(err, result) {
  22172. if (err) {
  22173. reject(err);
  22174. return;
  22175. }
  22176. resolve(result);
  22177. });
  22178. });
  22179. p.catch(noop);
  22180. return p;
  22181. }
  22182. function drained() {
  22183. var previousDrain = queue.drain;
  22184. var p = new Promise(function(resolve) {
  22185. queue.drain = function() {
  22186. previousDrain();
  22187. resolve();
  22188. };
  22189. });
  22190. return p;
  22191. }
  22192. }
  22193. module2.exports = fastqueue;
  22194. module2.exports.promise = queueAsPromised;
  22195. }
  22196. });
  22197. var require_common4 = __commonJS2({
  22198. "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
  22199. "use strict";
  22200. Object.defineProperty(exports2, "__esModule", {
  22201. value: true
  22202. });
  22203. exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
  22204. function isFatalError(settings, error) {
  22205. if (settings.errorFilter === null) {
  22206. return true;
  22207. }
  22208. return !settings.errorFilter(error);
  22209. }
  22210. exports2.isFatalError = isFatalError;
  22211. function isAppliedFilter(filter, value) {
  22212. return filter === null || filter(value);
  22213. }
  22214. exports2.isAppliedFilter = isAppliedFilter;
  22215. function replacePathSegmentSeparator(filepath, separator) {
  22216. return filepath.split(/[/\\]/).join(separator);
  22217. }
  22218. exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;
  22219. function joinPathSegments(a, b, separator) {
  22220. if (a === "") {
  22221. return b;
  22222. }
  22223. if (a.endsWith(separator)) {
  22224. return a + b;
  22225. }
  22226. return a + separator + b;
  22227. }
  22228. exports2.joinPathSegments = joinPathSegments;
  22229. }
  22230. });
  22231. var require_reader = __commonJS2({
  22232. "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
  22233. "use strict";
  22234. Object.defineProperty(exports2, "__esModule", {
  22235. value: true
  22236. });
  22237. var common = require_common4();
  22238. var Reader = class {
  22239. constructor(_root, _settings) {
  22240. this._root = _root;
  22241. this._settings = _settings;
  22242. this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
  22243. }
  22244. };
  22245. exports2.default = Reader;
  22246. }
  22247. });
  22248. var require_async4 = __commonJS2({
  22249. "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
  22250. "use strict";
  22251. Object.defineProperty(exports2, "__esModule", {
  22252. value: true
  22253. });
  22254. var events_1 = require("events");
  22255. var fsScandir = require_out2();
  22256. var fastq = require_queue();
  22257. var common = require_common4();
  22258. var reader_1 = require_reader();
  22259. var AsyncReader = class extends reader_1.default {
  22260. constructor(_root, _settings) {
  22261. super(_root, _settings);
  22262. this._settings = _settings;
  22263. this._scandir = fsScandir.scandir;
  22264. this._emitter = new events_1.EventEmitter();
  22265. this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
  22266. this._isFatalError = false;
  22267. this._isDestroyed = false;
  22268. this._queue.drain = () => {
  22269. if (!this._isFatalError) {
  22270. this._emitter.emit("end");
  22271. }
  22272. };
  22273. }
  22274. read() {
  22275. this._isFatalError = false;
  22276. this._isDestroyed = false;
  22277. setImmediate(() => {
  22278. this._pushToQueue(this._root, this._settings.basePath);
  22279. });
  22280. return this._emitter;
  22281. }
  22282. get isDestroyed() {
  22283. return this._isDestroyed;
  22284. }
  22285. destroy() {
  22286. if (this._isDestroyed) {
  22287. throw new Error("The reader is already destroyed");
  22288. }
  22289. this._isDestroyed = true;
  22290. this._queue.killAndDrain();
  22291. }
  22292. onEntry(callback) {
  22293. this._emitter.on("entry", callback);
  22294. }
  22295. onError(callback) {
  22296. this._emitter.once("error", callback);
  22297. }
  22298. onEnd(callback) {
  22299. this._emitter.once("end", callback);
  22300. }
  22301. _pushToQueue(directory, base) {
  22302. const queueItem = {
  22303. directory,
  22304. base
  22305. };
  22306. this._queue.push(queueItem, (error) => {
  22307. if (error !== null) {
  22308. this._handleError(error);
  22309. }
  22310. });
  22311. }
  22312. _worker(item, done) {
  22313. this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
  22314. if (error !== null) {
  22315. done(error, void 0);
  22316. return;
  22317. }
  22318. for (const entry of entries) {
  22319. this._handleEntry(entry, item.base);
  22320. }
  22321. done(null, void 0);
  22322. });
  22323. }
  22324. _handleError(error) {
  22325. if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
  22326. return;
  22327. }
  22328. this._isFatalError = true;
  22329. this._isDestroyed = true;
  22330. this._emitter.emit("error", error);
  22331. }
  22332. _handleEntry(entry, base) {
  22333. if (this._isDestroyed || this._isFatalError) {
  22334. return;
  22335. }
  22336. const fullpath = entry.path;
  22337. if (base !== void 0) {
  22338. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  22339. }
  22340. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  22341. this._emitEntry(entry);
  22342. }
  22343. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  22344. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  22345. }
  22346. }
  22347. _emitEntry(entry) {
  22348. this._emitter.emit("entry", entry);
  22349. }
  22350. };
  22351. exports2.default = AsyncReader;
  22352. }
  22353. });
  22354. var require_async5 = __commonJS2({
  22355. "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
  22356. "use strict";
  22357. Object.defineProperty(exports2, "__esModule", {
  22358. value: true
  22359. });
  22360. var async_1 = require_async4();
  22361. var AsyncProvider = class {
  22362. constructor(_root, _settings) {
  22363. this._root = _root;
  22364. this._settings = _settings;
  22365. this._reader = new async_1.default(this._root, this._settings);
  22366. this._storage = [];
  22367. }
  22368. read(callback) {
  22369. this._reader.onError((error) => {
  22370. callFailureCallback(callback, error);
  22371. });
  22372. this._reader.onEntry((entry) => {
  22373. this._storage.push(entry);
  22374. });
  22375. this._reader.onEnd(() => {
  22376. callSuccessCallback(callback, this._storage);
  22377. });
  22378. this._reader.read();
  22379. }
  22380. };
  22381. exports2.default = AsyncProvider;
  22382. function callFailureCallback(callback, error) {
  22383. callback(error);
  22384. }
  22385. function callSuccessCallback(callback, entries) {
  22386. callback(null, entries);
  22387. }
  22388. }
  22389. });
  22390. var require_stream2 = __commonJS2({
  22391. "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
  22392. "use strict";
  22393. Object.defineProperty(exports2, "__esModule", {
  22394. value: true
  22395. });
  22396. var stream_1 = require("stream");
  22397. var async_1 = require_async4();
  22398. var StreamProvider = class {
  22399. constructor(_root, _settings) {
  22400. this._root = _root;
  22401. this._settings = _settings;
  22402. this._reader = new async_1.default(this._root, this._settings);
  22403. this._stream = new stream_1.Readable({
  22404. objectMode: true,
  22405. read: () => {
  22406. },
  22407. destroy: () => {
  22408. if (!this._reader.isDestroyed) {
  22409. this._reader.destroy();
  22410. }
  22411. }
  22412. });
  22413. }
  22414. read() {
  22415. this._reader.onError((error) => {
  22416. this._stream.emit("error", error);
  22417. });
  22418. this._reader.onEntry((entry) => {
  22419. this._stream.push(entry);
  22420. });
  22421. this._reader.onEnd(() => {
  22422. this._stream.push(null);
  22423. });
  22424. this._reader.read();
  22425. return this._stream;
  22426. }
  22427. };
  22428. exports2.default = StreamProvider;
  22429. }
  22430. });
  22431. var require_sync4 = __commonJS2({
  22432. "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
  22433. "use strict";
  22434. Object.defineProperty(exports2, "__esModule", {
  22435. value: true
  22436. });
  22437. var fsScandir = require_out2();
  22438. var common = require_common4();
  22439. var reader_1 = require_reader();
  22440. var SyncReader = class extends reader_1.default {
  22441. constructor() {
  22442. super(...arguments);
  22443. this._scandir = fsScandir.scandirSync;
  22444. this._storage = [];
  22445. this._queue = /* @__PURE__ */ new Set();
  22446. }
  22447. read() {
  22448. this._pushToQueue(this._root, this._settings.basePath);
  22449. this._handleQueue();
  22450. return this._storage;
  22451. }
  22452. _pushToQueue(directory, base) {
  22453. this._queue.add({
  22454. directory,
  22455. base
  22456. });
  22457. }
  22458. _handleQueue() {
  22459. for (const item of this._queue.values()) {
  22460. this._handleDirectory(item.directory, item.base);
  22461. }
  22462. }
  22463. _handleDirectory(directory, base) {
  22464. try {
  22465. const entries = this._scandir(directory, this._settings.fsScandirSettings);
  22466. for (const entry of entries) {
  22467. this._handleEntry(entry, base);
  22468. }
  22469. } catch (error) {
  22470. this._handleError(error);
  22471. }
  22472. }
  22473. _handleError(error) {
  22474. if (!common.isFatalError(this._settings, error)) {
  22475. return;
  22476. }
  22477. throw error;
  22478. }
  22479. _handleEntry(entry, base) {
  22480. const fullpath = entry.path;
  22481. if (base !== void 0) {
  22482. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  22483. }
  22484. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  22485. this._pushToStorage(entry);
  22486. }
  22487. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  22488. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  22489. }
  22490. }
  22491. _pushToStorage(entry) {
  22492. this._storage.push(entry);
  22493. }
  22494. };
  22495. exports2.default = SyncReader;
  22496. }
  22497. });
  22498. var require_sync5 = __commonJS2({
  22499. "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
  22500. "use strict";
  22501. Object.defineProperty(exports2, "__esModule", {
  22502. value: true
  22503. });
  22504. var sync_1 = require_sync4();
  22505. var SyncProvider = class {
  22506. constructor(_root, _settings) {
  22507. this._root = _root;
  22508. this._settings = _settings;
  22509. this._reader = new sync_1.default(this._root, this._settings);
  22510. }
  22511. read() {
  22512. return this._reader.read();
  22513. }
  22514. };
  22515. exports2.default = SyncProvider;
  22516. }
  22517. });
  22518. var require_settings3 = __commonJS2({
  22519. "node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
  22520. "use strict";
  22521. Object.defineProperty(exports2, "__esModule", {
  22522. value: true
  22523. });
  22524. var path = require("path");
  22525. var fsScandir = require_out2();
  22526. var Settings = class {
  22527. constructor(_options = {}) {
  22528. this._options = _options;
  22529. this.basePath = this._getValue(this._options.basePath, void 0);
  22530. this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
  22531. this.deepFilter = this._getValue(this._options.deepFilter, null);
  22532. this.entryFilter = this._getValue(this._options.entryFilter, null);
  22533. this.errorFilter = this._getValue(this._options.errorFilter, null);
  22534. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  22535. this.fsScandirSettings = new fsScandir.Settings({
  22536. followSymbolicLinks: this._options.followSymbolicLinks,
  22537. fs: this._options.fs,
  22538. pathSegmentSeparator: this._options.pathSegmentSeparator,
  22539. stats: this._options.stats,
  22540. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  22541. });
  22542. }
  22543. _getValue(option, value) {
  22544. return option !== null && option !== void 0 ? option : value;
  22545. }
  22546. };
  22547. exports2.default = Settings;
  22548. }
  22549. });
  22550. var require_out3 = __commonJS2({
  22551. "node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
  22552. "use strict";
  22553. Object.defineProperty(exports2, "__esModule", {
  22554. value: true
  22555. });
  22556. exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
  22557. var async_1 = require_async5();
  22558. var stream_1 = require_stream2();
  22559. var sync_1 = require_sync5();
  22560. var settings_1 = require_settings3();
  22561. exports2.Settings = settings_1.default;
  22562. function walk(directory, optionsOrSettingsOrCallback, callback) {
  22563. if (typeof optionsOrSettingsOrCallback === "function") {
  22564. new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
  22565. return;
  22566. }
  22567. new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
  22568. }
  22569. exports2.walk = walk;
  22570. function walkSync(directory, optionsOrSettings) {
  22571. const settings = getSettings(optionsOrSettings);
  22572. const provider = new sync_1.default(directory, settings);
  22573. return provider.read();
  22574. }
  22575. exports2.walkSync = walkSync;
  22576. function walkStream(directory, optionsOrSettings) {
  22577. const settings = getSettings(optionsOrSettings);
  22578. const provider = new stream_1.default(directory, settings);
  22579. return provider.read();
  22580. }
  22581. exports2.walkStream = walkStream;
  22582. function getSettings(settingsOrOptions = {}) {
  22583. if (settingsOrOptions instanceof settings_1.default) {
  22584. return settingsOrOptions;
  22585. }
  22586. return new settings_1.default(settingsOrOptions);
  22587. }
  22588. }
  22589. });
  22590. var require_reader2 = __commonJS2({
  22591. "node_modules/fast-glob/out/readers/reader.js"(exports2) {
  22592. "use strict";
  22593. Object.defineProperty(exports2, "__esModule", {
  22594. value: true
  22595. });
  22596. var path = require("path");
  22597. var fsStat = require_out();
  22598. var utils = require_utils4();
  22599. var Reader = class {
  22600. constructor(_settings) {
  22601. this._settings = _settings;
  22602. this._fsStatSettings = new fsStat.Settings({
  22603. followSymbolicLink: this._settings.followSymbolicLinks,
  22604. fs: this._settings.fs,
  22605. throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
  22606. });
  22607. }
  22608. _getFullEntryPath(filepath) {
  22609. return path.resolve(this._settings.cwd, filepath);
  22610. }
  22611. _makeEntry(stats, pattern) {
  22612. const entry = {
  22613. name: pattern,
  22614. path: pattern,
  22615. dirent: utils.fs.createDirentFromStats(pattern, stats)
  22616. };
  22617. if (this._settings.stats) {
  22618. entry.stats = stats;
  22619. }
  22620. return entry;
  22621. }
  22622. _isFatalError(error) {
  22623. return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
  22624. }
  22625. };
  22626. exports2.default = Reader;
  22627. }
  22628. });
  22629. var require_stream3 = __commonJS2({
  22630. "node_modules/fast-glob/out/readers/stream.js"(exports2) {
  22631. "use strict";
  22632. Object.defineProperty(exports2, "__esModule", {
  22633. value: true
  22634. });
  22635. var stream_1 = require("stream");
  22636. var fsStat = require_out();
  22637. var fsWalk = require_out3();
  22638. var reader_1 = require_reader2();
  22639. var ReaderStream = class extends reader_1.default {
  22640. constructor() {
  22641. super(...arguments);
  22642. this._walkStream = fsWalk.walkStream;
  22643. this._stat = fsStat.stat;
  22644. }
  22645. dynamic(root, options) {
  22646. return this._walkStream(root, options);
  22647. }
  22648. static(patterns, options) {
  22649. const filepaths = patterns.map(this._getFullEntryPath, this);
  22650. const stream = new stream_1.PassThrough({
  22651. objectMode: true
  22652. });
  22653. stream._write = (index, _enc, done) => {
  22654. return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
  22655. if (entry !== null && options.entryFilter(entry)) {
  22656. stream.push(entry);
  22657. }
  22658. if (index === filepaths.length - 1) {
  22659. stream.end();
  22660. }
  22661. done();
  22662. }).catch(done);
  22663. };
  22664. for (let i = 0; i < filepaths.length; i++) {
  22665. stream.write(i);
  22666. }
  22667. return stream;
  22668. }
  22669. _getEntry(filepath, pattern, options) {
  22670. return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
  22671. if (options.errorFilter(error)) {
  22672. return null;
  22673. }
  22674. throw error;
  22675. });
  22676. }
  22677. _getStat(filepath) {
  22678. return new Promise((resolve, reject) => {
  22679. this._stat(filepath, this._fsStatSettings, (error, stats) => {
  22680. return error === null ? resolve(stats) : reject(error);
  22681. });
  22682. });
  22683. }
  22684. };
  22685. exports2.default = ReaderStream;
  22686. }
  22687. });
  22688. var require_matcher = __commonJS2({
  22689. "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
  22690. "use strict";
  22691. Object.defineProperty(exports2, "__esModule", {
  22692. value: true
  22693. });
  22694. var utils = require_utils4();
  22695. var Matcher = class {
  22696. constructor(_patterns, _settings, _micromatchOptions) {
  22697. this._patterns = _patterns;
  22698. this._settings = _settings;
  22699. this._micromatchOptions = _micromatchOptions;
  22700. this._storage = [];
  22701. this._fillStorage();
  22702. }
  22703. _fillStorage() {
  22704. const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
  22705. for (const pattern of patterns) {
  22706. const segments = this._getPatternSegments(pattern);
  22707. const sections = this._splitSegmentsIntoSections(segments);
  22708. this._storage.push({
  22709. complete: sections.length <= 1,
  22710. pattern,
  22711. segments,
  22712. sections
  22713. });
  22714. }
  22715. }
  22716. _getPatternSegments(pattern) {
  22717. const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
  22718. return parts.map((part) => {
  22719. const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
  22720. if (!dynamic) {
  22721. return {
  22722. dynamic: false,
  22723. pattern: part
  22724. };
  22725. }
  22726. return {
  22727. dynamic: true,
  22728. pattern: part,
  22729. patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
  22730. };
  22731. });
  22732. }
  22733. _splitSegmentsIntoSections(segments) {
  22734. return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
  22735. }
  22736. };
  22737. exports2.default = Matcher;
  22738. }
  22739. });
  22740. var require_partial = __commonJS2({
  22741. "node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
  22742. "use strict";
  22743. Object.defineProperty(exports2, "__esModule", {
  22744. value: true
  22745. });
  22746. var matcher_1 = require_matcher();
  22747. var PartialMatcher = class extends matcher_1.default {
  22748. match(filepath) {
  22749. const parts = filepath.split("/");
  22750. const levels = parts.length;
  22751. const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
  22752. for (const pattern of patterns) {
  22753. const section = pattern.sections[0];
  22754. if (!pattern.complete && levels > section.length) {
  22755. return true;
  22756. }
  22757. const match = parts.every((part, index) => {
  22758. const segment = pattern.segments[index];
  22759. if (segment.dynamic && segment.patternRe.test(part)) {
  22760. return true;
  22761. }
  22762. if (!segment.dynamic && segment.pattern === part) {
  22763. return true;
  22764. }
  22765. return false;
  22766. });
  22767. if (match) {
  22768. return true;
  22769. }
  22770. }
  22771. return false;
  22772. }
  22773. };
  22774. exports2.default = PartialMatcher;
  22775. }
  22776. });
  22777. var require_deep = __commonJS2({
  22778. "node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
  22779. "use strict";
  22780. Object.defineProperty(exports2, "__esModule", {
  22781. value: true
  22782. });
  22783. var utils = require_utils4();
  22784. var partial_1 = require_partial();
  22785. var DeepFilter = class {
  22786. constructor(_settings, _micromatchOptions) {
  22787. this._settings = _settings;
  22788. this._micromatchOptions = _micromatchOptions;
  22789. }
  22790. getFilter(basePath, positive, negative) {
  22791. const matcher = this._getMatcher(positive);
  22792. const negativeRe = this._getNegativePatternsRe(negative);
  22793. return (entry) => this._filter(basePath, entry, matcher, negativeRe);
  22794. }
  22795. _getMatcher(patterns) {
  22796. return new partial_1.default(patterns, this._settings, this._micromatchOptions);
  22797. }
  22798. _getNegativePatternsRe(patterns) {
  22799. const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
  22800. return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
  22801. }
  22802. _filter(basePath, entry, matcher, negativeRe) {
  22803. if (this._isSkippedByDeep(basePath, entry.path)) {
  22804. return false;
  22805. }
  22806. if (this._isSkippedSymbolicLink(entry)) {
  22807. return false;
  22808. }
  22809. const filepath = utils.path.removeLeadingDotSegment(entry.path);
  22810. if (this._isSkippedByPositivePatterns(filepath, matcher)) {
  22811. return false;
  22812. }
  22813. return this._isSkippedByNegativePatterns(filepath, negativeRe);
  22814. }
  22815. _isSkippedByDeep(basePath, entryPath) {
  22816. if (this._settings.deep === Infinity) {
  22817. return false;
  22818. }
  22819. return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
  22820. }
  22821. _getEntryLevel(basePath, entryPath) {
  22822. const entryPathDepth = entryPath.split("/").length;
  22823. if (basePath === "") {
  22824. return entryPathDepth;
  22825. }
  22826. const basePathDepth = basePath.split("/").length;
  22827. return entryPathDepth - basePathDepth;
  22828. }
  22829. _isSkippedSymbolicLink(entry) {
  22830. return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
  22831. }
  22832. _isSkippedByPositivePatterns(entryPath, matcher) {
  22833. return !this._settings.baseNameMatch && !matcher.match(entryPath);
  22834. }
  22835. _isSkippedByNegativePatterns(entryPath, patternsRe) {
  22836. return !utils.pattern.matchAny(entryPath, patternsRe);
  22837. }
  22838. };
  22839. exports2.default = DeepFilter;
  22840. }
  22841. });
  22842. var require_entry = __commonJS2({
  22843. "node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
  22844. "use strict";
  22845. Object.defineProperty(exports2, "__esModule", {
  22846. value: true
  22847. });
  22848. var utils = require_utils4();
  22849. var EntryFilter = class {
  22850. constructor(_settings, _micromatchOptions) {
  22851. this._settings = _settings;
  22852. this._micromatchOptions = _micromatchOptions;
  22853. this.index = /* @__PURE__ */ new Map();
  22854. }
  22855. getFilter(positive, negative) {
  22856. const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
  22857. const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
  22858. return (entry) => this._filter(entry, positiveRe, negativeRe);
  22859. }
  22860. _filter(entry, positiveRe, negativeRe) {
  22861. if (this._settings.unique && this._isDuplicateEntry(entry)) {
  22862. return false;
  22863. }
  22864. if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
  22865. return false;
  22866. }
  22867. if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
  22868. return false;
  22869. }
  22870. const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
  22871. const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
  22872. if (this._settings.unique && isMatched) {
  22873. this._createIndexRecord(entry);
  22874. }
  22875. return isMatched;
  22876. }
  22877. _isDuplicateEntry(entry) {
  22878. return this.index.has(entry.path);
  22879. }
  22880. _createIndexRecord(entry) {
  22881. this.index.set(entry.path, void 0);
  22882. }
  22883. _onlyFileFilter(entry) {
  22884. return this._settings.onlyFiles && !entry.dirent.isFile();
  22885. }
  22886. _onlyDirectoryFilter(entry) {
  22887. return this._settings.onlyDirectories && !entry.dirent.isDirectory();
  22888. }
  22889. _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
  22890. if (!this._settings.absolute) {
  22891. return false;
  22892. }
  22893. const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
  22894. return utils.pattern.matchAny(fullpath, patternsRe);
  22895. }
  22896. _isMatchToPatterns(entryPath, patternsRe) {
  22897. const filepath = utils.path.removeLeadingDotSegment(entryPath);
  22898. return utils.pattern.matchAny(filepath, patternsRe) || utils.pattern.matchAny(filepath + "/", patternsRe);
  22899. }
  22900. };
  22901. exports2.default = EntryFilter;
  22902. }
  22903. });
  22904. var require_error = __commonJS2({
  22905. "node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
  22906. "use strict";
  22907. Object.defineProperty(exports2, "__esModule", {
  22908. value: true
  22909. });
  22910. var utils = require_utils4();
  22911. var ErrorFilter = class {
  22912. constructor(_settings) {
  22913. this._settings = _settings;
  22914. }
  22915. getFilter() {
  22916. return (error) => this._isNonFatalError(error);
  22917. }
  22918. _isNonFatalError(error) {
  22919. return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
  22920. }
  22921. };
  22922. exports2.default = ErrorFilter;
  22923. }
  22924. });
  22925. var require_entry2 = __commonJS2({
  22926. "node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
  22927. "use strict";
  22928. Object.defineProperty(exports2, "__esModule", {
  22929. value: true
  22930. });
  22931. var utils = require_utils4();
  22932. var EntryTransformer = class {
  22933. constructor(_settings) {
  22934. this._settings = _settings;
  22935. }
  22936. getTransformer() {
  22937. return (entry) => this._transform(entry);
  22938. }
  22939. _transform(entry) {
  22940. let filepath = entry.path;
  22941. if (this._settings.absolute) {
  22942. filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
  22943. filepath = utils.path.unixify(filepath);
  22944. }
  22945. if (this._settings.markDirectories && entry.dirent.isDirectory()) {
  22946. filepath += "/";
  22947. }
  22948. if (!this._settings.objectMode) {
  22949. return filepath;
  22950. }
  22951. return Object.assign(Object.assign({}, entry), {
  22952. path: filepath
  22953. });
  22954. }
  22955. };
  22956. exports2.default = EntryTransformer;
  22957. }
  22958. });
  22959. var require_provider = __commonJS2({
  22960. "node_modules/fast-glob/out/providers/provider.js"(exports2) {
  22961. "use strict";
  22962. Object.defineProperty(exports2, "__esModule", {
  22963. value: true
  22964. });
  22965. var path = require("path");
  22966. var deep_1 = require_deep();
  22967. var entry_1 = require_entry();
  22968. var error_1 = require_error();
  22969. var entry_2 = require_entry2();
  22970. var Provider = class {
  22971. constructor(_settings) {
  22972. this._settings = _settings;
  22973. this.errorFilter = new error_1.default(this._settings);
  22974. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  22975. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  22976. this.entryTransformer = new entry_2.default(this._settings);
  22977. }
  22978. _getRootDirectory(task) {
  22979. return path.resolve(this._settings.cwd, task.base);
  22980. }
  22981. _getReaderOptions(task) {
  22982. const basePath = task.base === "." ? "" : task.base;
  22983. return {
  22984. basePath,
  22985. pathSegmentSeparator: "/",
  22986. concurrency: this._settings.concurrency,
  22987. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  22988. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  22989. errorFilter: this.errorFilter.getFilter(),
  22990. followSymbolicLinks: this._settings.followSymbolicLinks,
  22991. fs: this._settings.fs,
  22992. stats: this._settings.stats,
  22993. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  22994. transform: this.entryTransformer.getTransformer()
  22995. };
  22996. }
  22997. _getMicromatchOptions() {
  22998. return {
  22999. dot: this._settings.dot,
  23000. matchBase: this._settings.baseNameMatch,
  23001. nobrace: !this._settings.braceExpansion,
  23002. nocase: !this._settings.caseSensitiveMatch,
  23003. noext: !this._settings.extglob,
  23004. noglobstar: !this._settings.globstar,
  23005. posix: true,
  23006. strictSlashes: false
  23007. };
  23008. }
  23009. };
  23010. exports2.default = Provider;
  23011. }
  23012. });
  23013. var require_async6 = __commonJS2({
  23014. "node_modules/fast-glob/out/providers/async.js"(exports2) {
  23015. "use strict";
  23016. Object.defineProperty(exports2, "__esModule", {
  23017. value: true
  23018. });
  23019. var stream_1 = require_stream3();
  23020. var provider_1 = require_provider();
  23021. var ProviderAsync = class extends provider_1.default {
  23022. constructor() {
  23023. super(...arguments);
  23024. this._reader = new stream_1.default(this._settings);
  23025. }
  23026. read(task) {
  23027. const root = this._getRootDirectory(task);
  23028. const options = this._getReaderOptions(task);
  23029. const entries = [];
  23030. return new Promise((resolve, reject) => {
  23031. const stream = this.api(root, task, options);
  23032. stream.once("error", reject);
  23033. stream.on("data", (entry) => entries.push(options.transform(entry)));
  23034. stream.once("end", () => resolve(entries));
  23035. });
  23036. }
  23037. api(root, task, options) {
  23038. if (task.dynamic) {
  23039. return this._reader.dynamic(root, options);
  23040. }
  23041. return this._reader.static(task.patterns, options);
  23042. }
  23043. };
  23044. exports2.default = ProviderAsync;
  23045. }
  23046. });
  23047. var require_stream4 = __commonJS2({
  23048. "node_modules/fast-glob/out/providers/stream.js"(exports2) {
  23049. "use strict";
  23050. Object.defineProperty(exports2, "__esModule", {
  23051. value: true
  23052. });
  23053. var stream_1 = require("stream");
  23054. var stream_2 = require_stream3();
  23055. var provider_1 = require_provider();
  23056. var ProviderStream = class extends provider_1.default {
  23057. constructor() {
  23058. super(...arguments);
  23059. this._reader = new stream_2.default(this._settings);
  23060. }
  23061. read(task) {
  23062. const root = this._getRootDirectory(task);
  23063. const options = this._getReaderOptions(task);
  23064. const source = this.api(root, task, options);
  23065. const destination = new stream_1.Readable({
  23066. objectMode: true,
  23067. read: () => {
  23068. }
  23069. });
  23070. source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
  23071. destination.once("close", () => source.destroy());
  23072. return destination;
  23073. }
  23074. api(root, task, options) {
  23075. if (task.dynamic) {
  23076. return this._reader.dynamic(root, options);
  23077. }
  23078. return this._reader.static(task.patterns, options);
  23079. }
  23080. };
  23081. exports2.default = ProviderStream;
  23082. }
  23083. });
  23084. var require_sync6 = __commonJS2({
  23085. "node_modules/fast-glob/out/readers/sync.js"(exports2) {
  23086. "use strict";
  23087. Object.defineProperty(exports2, "__esModule", {
  23088. value: true
  23089. });
  23090. var fsStat = require_out();
  23091. var fsWalk = require_out3();
  23092. var reader_1 = require_reader2();
  23093. var ReaderSync = class extends reader_1.default {
  23094. constructor() {
  23095. super(...arguments);
  23096. this._walkSync = fsWalk.walkSync;
  23097. this._statSync = fsStat.statSync;
  23098. }
  23099. dynamic(root, options) {
  23100. return this._walkSync(root, options);
  23101. }
  23102. static(patterns, options) {
  23103. const entries = [];
  23104. for (const pattern of patterns) {
  23105. const filepath = this._getFullEntryPath(pattern);
  23106. const entry = this._getEntry(filepath, pattern, options);
  23107. if (entry === null || !options.entryFilter(entry)) {
  23108. continue;
  23109. }
  23110. entries.push(entry);
  23111. }
  23112. return entries;
  23113. }
  23114. _getEntry(filepath, pattern, options) {
  23115. try {
  23116. const stats = this._getStat(filepath);
  23117. return this._makeEntry(stats, pattern);
  23118. } catch (error) {
  23119. if (options.errorFilter(error)) {
  23120. return null;
  23121. }
  23122. throw error;
  23123. }
  23124. }
  23125. _getStat(filepath) {
  23126. return this._statSync(filepath, this._fsStatSettings);
  23127. }
  23128. };
  23129. exports2.default = ReaderSync;
  23130. }
  23131. });
  23132. var require_sync7 = __commonJS2({
  23133. "node_modules/fast-glob/out/providers/sync.js"(exports2) {
  23134. "use strict";
  23135. Object.defineProperty(exports2, "__esModule", {
  23136. value: true
  23137. });
  23138. var sync_1 = require_sync6();
  23139. var provider_1 = require_provider();
  23140. var ProviderSync = class extends provider_1.default {
  23141. constructor() {
  23142. super(...arguments);
  23143. this._reader = new sync_1.default(this._settings);
  23144. }
  23145. read(task) {
  23146. const root = this._getRootDirectory(task);
  23147. const options = this._getReaderOptions(task);
  23148. const entries = this.api(root, task, options);
  23149. return entries.map(options.transform);
  23150. }
  23151. api(root, task, options) {
  23152. if (task.dynamic) {
  23153. return this._reader.dynamic(root, options);
  23154. }
  23155. return this._reader.static(task.patterns, options);
  23156. }
  23157. };
  23158. exports2.default = ProviderSync;
  23159. }
  23160. });
  23161. var require_settings4 = __commonJS2({
  23162. "node_modules/fast-glob/out/settings.js"(exports2) {
  23163. "use strict";
  23164. Object.defineProperty(exports2, "__esModule", {
  23165. value: true
  23166. });
  23167. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
  23168. var fs = require("fs");
  23169. var os = require("os");
  23170. var CPU_COUNT = Math.max(os.cpus().length, 1);
  23171. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
  23172. lstat: fs.lstat,
  23173. lstatSync: fs.lstatSync,
  23174. stat: fs.stat,
  23175. statSync: fs.statSync,
  23176. readdir: fs.readdir,
  23177. readdirSync: fs.readdirSync
  23178. };
  23179. var Settings = class {
  23180. constructor(_options = {}) {
  23181. this._options = _options;
  23182. this.absolute = this._getValue(this._options.absolute, false);
  23183. this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
  23184. this.braceExpansion = this._getValue(this._options.braceExpansion, true);
  23185. this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
  23186. this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
  23187. this.cwd = this._getValue(this._options.cwd, process.cwd());
  23188. this.deep = this._getValue(this._options.deep, Infinity);
  23189. this.dot = this._getValue(this._options.dot, false);
  23190. this.extglob = this._getValue(this._options.extglob, true);
  23191. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
  23192. this.fs = this._getFileSystemMethods(this._options.fs);
  23193. this.globstar = this._getValue(this._options.globstar, true);
  23194. this.ignore = this._getValue(this._options.ignore, []);
  23195. this.markDirectories = this._getValue(this._options.markDirectories, false);
  23196. this.objectMode = this._getValue(this._options.objectMode, false);
  23197. this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
  23198. this.onlyFiles = this._getValue(this._options.onlyFiles, true);
  23199. this.stats = this._getValue(this._options.stats, false);
  23200. this.suppressErrors = this._getValue(this._options.suppressErrors, false);
  23201. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
  23202. this.unique = this._getValue(this._options.unique, true);
  23203. if (this.onlyDirectories) {
  23204. this.onlyFiles = false;
  23205. }
  23206. if (this.stats) {
  23207. this.objectMode = true;
  23208. }
  23209. }
  23210. _getValue(option, value) {
  23211. return option === void 0 ? value : option;
  23212. }
  23213. _getFileSystemMethods(methods = {}) {
  23214. return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
  23215. }
  23216. };
  23217. exports2.default = Settings;
  23218. }
  23219. });
  23220. var require_out4 = __commonJS2({
  23221. "node_modules/fast-glob/out/index.js"(exports2, module2) {
  23222. "use strict";
  23223. var taskManager = require_tasks();
  23224. var patternManager = require_patterns();
  23225. var async_1 = require_async6();
  23226. var stream_1 = require_stream4();
  23227. var sync_1 = require_sync7();
  23228. var settings_1 = require_settings4();
  23229. var utils = require_utils4();
  23230. async function FastGlob(source, options) {
  23231. assertPatternsInput(source);
  23232. const works = getWorks(source, async_1.default, options);
  23233. const result = await Promise.all(works);
  23234. return utils.array.flatten(result);
  23235. }
  23236. (function(FastGlob2) {
  23237. function sync(source, options) {
  23238. assertPatternsInput(source);
  23239. const works = getWorks(source, sync_1.default, options);
  23240. return utils.array.flatten(works);
  23241. }
  23242. FastGlob2.sync = sync;
  23243. function stream(source, options) {
  23244. assertPatternsInput(source);
  23245. const works = getWorks(source, stream_1.default, options);
  23246. return utils.stream.merge(works);
  23247. }
  23248. FastGlob2.stream = stream;
  23249. function generateTasks(source, options) {
  23250. assertPatternsInput(source);
  23251. const patterns = patternManager.transform([].concat(source));
  23252. const settings = new settings_1.default(options);
  23253. return taskManager.generate(patterns, settings);
  23254. }
  23255. FastGlob2.generateTasks = generateTasks;
  23256. function isDynamicPattern(source, options) {
  23257. assertPatternsInput(source);
  23258. const settings = new settings_1.default(options);
  23259. return utils.pattern.isDynamicPattern(source, settings);
  23260. }
  23261. FastGlob2.isDynamicPattern = isDynamicPattern;
  23262. function escapePath(source) {
  23263. assertPatternsInput(source);
  23264. return utils.path.escape(source);
  23265. }
  23266. FastGlob2.escapePath = escapePath;
  23267. })(FastGlob || (FastGlob = {}));
  23268. function getWorks(source, _Provider, options) {
  23269. const patterns = patternManager.transform([].concat(source));
  23270. const settings = new settings_1.default(options);
  23271. const tasks = taskManager.generate(patterns, settings);
  23272. const provider = new _Provider(settings);
  23273. return tasks.map(provider.read, provider);
  23274. }
  23275. function assertPatternsInput(input) {
  23276. const source = [].concat(input);
  23277. const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
  23278. if (!isValidSource) {
  23279. throw new TypeError("Patterns must be a string (non empty) or an array of strings");
  23280. }
  23281. }
  23282. module2.exports = FastGlob;
  23283. }
  23284. });
  23285. var require_create_language = __commonJS2({
  23286. "src/utils/create-language.js"(exports2, module2) {
  23287. "use strict";
  23288. module2.exports = function(linguistData, override) {
  23289. const {
  23290. languageId
  23291. } = linguistData, rest = _objectWithoutProperties(linguistData, _excluded4);
  23292. return Object.assign(Object.assign({
  23293. linguistLanguageId: languageId
  23294. }, rest), override(linguistData));
  23295. };
  23296. }
  23297. });
  23298. var require_ast = __commonJS2({
  23299. "node_modules/esutils/lib/ast.js"(exports2, module2) {
  23300. (function() {
  23301. "use strict";
  23302. function isExpression(node) {
  23303. if (node == null) {
  23304. return false;
  23305. }
  23306. switch (node.type) {
  23307. case "ArrayExpression":
  23308. case "AssignmentExpression":
  23309. case "BinaryExpression":
  23310. case "CallExpression":
  23311. case "ConditionalExpression":
  23312. case "FunctionExpression":
  23313. case "Identifier":
  23314. case "Literal":
  23315. case "LogicalExpression":
  23316. case "MemberExpression":
  23317. case "NewExpression":
  23318. case "ObjectExpression":
  23319. case "SequenceExpression":
  23320. case "ThisExpression":
  23321. case "UnaryExpression":
  23322. case "UpdateExpression":
  23323. return true;
  23324. }
  23325. return false;
  23326. }
  23327. function isIterationStatement(node) {
  23328. if (node == null) {
  23329. return false;
  23330. }
  23331. switch (node.type) {
  23332. case "DoWhileStatement":
  23333. case "ForInStatement":
  23334. case "ForStatement":
  23335. case "WhileStatement":
  23336. return true;
  23337. }
  23338. return false;
  23339. }
  23340. function isStatement(node) {
  23341. if (node == null) {
  23342. return false;
  23343. }
  23344. switch (node.type) {
  23345. case "BlockStatement":
  23346. case "BreakStatement":
  23347. case "ContinueStatement":
  23348. case "DebuggerStatement":
  23349. case "DoWhileStatement":
  23350. case "EmptyStatement":
  23351. case "ExpressionStatement":
  23352. case "ForInStatement":
  23353. case "ForStatement":
  23354. case "IfStatement":
  23355. case "LabeledStatement":
  23356. case "ReturnStatement":
  23357. case "SwitchStatement":
  23358. case "ThrowStatement":
  23359. case "TryStatement":
  23360. case "VariableDeclaration":
  23361. case "WhileStatement":
  23362. case "WithStatement":
  23363. return true;
  23364. }
  23365. return false;
  23366. }
  23367. function isSourceElement(node) {
  23368. return isStatement(node) || node != null && node.type === "FunctionDeclaration";
  23369. }
  23370. function trailingStatement(node) {
  23371. switch (node.type) {
  23372. case "IfStatement":
  23373. if (node.alternate != null) {
  23374. return node.alternate;
  23375. }
  23376. return node.consequent;
  23377. case "LabeledStatement":
  23378. case "ForStatement":
  23379. case "ForInStatement":
  23380. case "WhileStatement":
  23381. case "WithStatement":
  23382. return node.body;
  23383. }
  23384. return null;
  23385. }
  23386. function isProblematicIfStatement(node) {
  23387. var current;
  23388. if (node.type !== "IfStatement") {
  23389. return false;
  23390. }
  23391. if (node.alternate == null) {
  23392. return false;
  23393. }
  23394. current = node.consequent;
  23395. do {
  23396. if (current.type === "IfStatement") {
  23397. if (current.alternate == null) {
  23398. return true;
  23399. }
  23400. }
  23401. current = trailingStatement(current);
  23402. } while (current);
  23403. return false;
  23404. }
  23405. module2.exports = {
  23406. isExpression,
  23407. isStatement,
  23408. isIterationStatement,
  23409. isSourceElement,
  23410. isProblematicIfStatement,
  23411. trailingStatement
  23412. };
  23413. })();
  23414. }
  23415. });
  23416. var require_code = __commonJS2({
  23417. "node_modules/esutils/lib/code.js"(exports2, module2) {
  23418. (function() {
  23419. "use strict";
  23420. var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
  23421. ES5Regex = {
  23422. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
  23423. NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
  23424. };
  23425. ES6Regex = {
  23426. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
  23427. NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
  23428. };
  23429. function isDecimalDigit(ch2) {
  23430. return 48 <= ch2 && ch2 <= 57;
  23431. }
  23432. function isHexDigit(ch2) {
  23433. return 48 <= ch2 && ch2 <= 57 || 97 <= ch2 && ch2 <= 102 || 65 <= ch2 && ch2 <= 70;
  23434. }
  23435. function isOctalDigit(ch2) {
  23436. return ch2 >= 48 && ch2 <= 55;
  23437. }
  23438. NON_ASCII_WHITESPACES = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279];
  23439. function isWhiteSpace(ch2) {
  23440. return ch2 === 32 || ch2 === 9 || ch2 === 11 || ch2 === 12 || ch2 === 160 || ch2 >= 5760 && NON_ASCII_WHITESPACES.indexOf(ch2) >= 0;
  23441. }
  23442. function isLineTerminator(ch2) {
  23443. return ch2 === 10 || ch2 === 13 || ch2 === 8232 || ch2 === 8233;
  23444. }
  23445. function fromCodePoint(cp) {
  23446. if (cp <= 65535) {
  23447. return String.fromCharCode(cp);
  23448. }
  23449. var cu1 = String.fromCharCode(Math.floor((cp - 65536) / 1024) + 55296);
  23450. var cu2 = String.fromCharCode((cp - 65536) % 1024 + 56320);
  23451. return cu1 + cu2;
  23452. }
  23453. IDENTIFIER_START = new Array(128);
  23454. for (ch = 0; ch < 128; ++ch) {
  23455. IDENTIFIER_START[ch] = ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90 || ch === 36 || ch === 95;
  23456. }
  23457. IDENTIFIER_PART = new Array(128);
  23458. for (ch = 0; ch < 128; ++ch) {
  23459. IDENTIFIER_PART[ch] = ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95;
  23460. }
  23461. function isIdentifierStartES5(ch2) {
  23462. return ch2 < 128 ? IDENTIFIER_START[ch2] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch2));
  23463. }
  23464. function isIdentifierPartES5(ch2) {
  23465. return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch2));
  23466. }
  23467. function isIdentifierStartES6(ch2) {
  23468. return ch2 < 128 ? IDENTIFIER_START[ch2] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch2));
  23469. }
  23470. function isIdentifierPartES6(ch2) {
  23471. return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch2));
  23472. }
  23473. module2.exports = {
  23474. isDecimalDigit,
  23475. isHexDigit,
  23476. isOctalDigit,
  23477. isWhiteSpace,
  23478. isLineTerminator,
  23479. isIdentifierStartES5,
  23480. isIdentifierPartES5,
  23481. isIdentifierStartES6,
  23482. isIdentifierPartES6
  23483. };
  23484. })();
  23485. }
  23486. });
  23487. var require_keyword2 = __commonJS2({
  23488. "node_modules/esutils/lib/keyword.js"(exports2, module2) {
  23489. (function() {
  23490. "use strict";
  23491. var code = require_code();
  23492. function isStrictModeReservedWordES6(id) {
  23493. switch (id) {
  23494. case "implements":
  23495. case "interface":
  23496. case "package":
  23497. case "private":
  23498. case "protected":
  23499. case "public":
  23500. case "static":
  23501. case "let":
  23502. return true;
  23503. default:
  23504. return false;
  23505. }
  23506. }
  23507. function isKeywordES5(id, strict) {
  23508. if (!strict && id === "yield") {
  23509. return false;
  23510. }
  23511. return isKeywordES6(id, strict);
  23512. }
  23513. function isKeywordES6(id, strict) {
  23514. if (strict && isStrictModeReservedWordES6(id)) {
  23515. return true;
  23516. }
  23517. switch (id.length) {
  23518. case 2:
  23519. return id === "if" || id === "in" || id === "do";
  23520. case 3:
  23521. return id === "var" || id === "for" || id === "new" || id === "try";
  23522. case 4:
  23523. return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum";
  23524. case 5:
  23525. return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super";
  23526. case 6:
  23527. return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import";
  23528. case 7:
  23529. return id === "default" || id === "finally" || id === "extends";
  23530. case 8:
  23531. return id === "function" || id === "continue" || id === "debugger";
  23532. case 10:
  23533. return id === "instanceof";
  23534. default:
  23535. return false;
  23536. }
  23537. }
  23538. function isReservedWordES5(id, strict) {
  23539. return id === "null" || id === "true" || id === "false" || isKeywordES5(id, strict);
  23540. }
  23541. function isReservedWordES6(id, strict) {
  23542. return id === "null" || id === "true" || id === "false" || isKeywordES6(id, strict);
  23543. }
  23544. function isRestrictedWord(id) {
  23545. return id === "eval" || id === "arguments";
  23546. }
  23547. function isIdentifierNameES5(id) {
  23548. var i, iz, ch;
  23549. if (id.length === 0) {
  23550. return false;
  23551. }
  23552. ch = id.charCodeAt(0);
  23553. if (!code.isIdentifierStartES5(ch)) {
  23554. return false;
  23555. }
  23556. for (i = 1, iz = id.length; i < iz; ++i) {
  23557. ch = id.charCodeAt(i);
  23558. if (!code.isIdentifierPartES5(ch)) {
  23559. return false;
  23560. }
  23561. }
  23562. return true;
  23563. }
  23564. function decodeUtf16(lead, trail) {
  23565. return (lead - 55296) * 1024 + (trail - 56320) + 65536;
  23566. }
  23567. function isIdentifierNameES6(id) {
  23568. var i, iz, ch, lowCh, check;
  23569. if (id.length === 0) {
  23570. return false;
  23571. }
  23572. check = code.isIdentifierStartES6;
  23573. for (i = 0, iz = id.length; i < iz; ++i) {
  23574. ch = id.charCodeAt(i);
  23575. if (55296 <= ch && ch <= 56319) {
  23576. ++i;
  23577. if (i >= iz) {
  23578. return false;
  23579. }
  23580. lowCh = id.charCodeAt(i);
  23581. if (!(56320 <= lowCh && lowCh <= 57343)) {
  23582. return false;
  23583. }
  23584. ch = decodeUtf16(ch, lowCh);
  23585. }
  23586. if (!check(ch)) {
  23587. return false;
  23588. }
  23589. check = code.isIdentifierPartES6;
  23590. }
  23591. return true;
  23592. }
  23593. function isIdentifierES5(id, strict) {
  23594. return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
  23595. }
  23596. function isIdentifierES6(id, strict) {
  23597. return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
  23598. }
  23599. module2.exports = {
  23600. isKeywordES5,
  23601. isKeywordES6,
  23602. isReservedWordES5,
  23603. isReservedWordES6,
  23604. isRestrictedWord,
  23605. isIdentifierNameES5,
  23606. isIdentifierNameES6,
  23607. isIdentifierES5,
  23608. isIdentifierES6
  23609. };
  23610. })();
  23611. }
  23612. });
  23613. var require_utils6 = __commonJS2({
  23614. "node_modules/esutils/lib/utils.js"(exports2) {
  23615. (function() {
  23616. "use strict";
  23617. exports2.ast = require_ast();
  23618. exports2.code = require_code();
  23619. exports2.keyword = require_keyword2();
  23620. })();
  23621. }
  23622. });
  23623. var require_is_block_comment = __commonJS2({
  23624. "src/language-js/utils/is-block-comment.js"(exports2, module2) {
  23625. "use strict";
  23626. function isBlockComment(comment) {
  23627. return comment.type === "Block" || comment.type === "CommentBlock" || comment.type === "MultiLine";
  23628. }
  23629. module2.exports = isBlockComment;
  23630. }
  23631. });
  23632. var require_utils7 = __commonJS2({
  23633. "src/language-js/utils/index.js"(exports2, module2) {
  23634. "use strict";
  23635. var isIdentifierName = require_utils6().keyword.isIdentifierNameES5;
  23636. var {
  23637. getLast,
  23638. hasNewline,
  23639. skipWhitespace,
  23640. isNonEmptyArray,
  23641. isNextLineEmptyAfterIndex,
  23642. getStringWidth
  23643. } = require_util();
  23644. var {
  23645. locStart,
  23646. locEnd,
  23647. hasSameLocStart
  23648. } = require_loc();
  23649. var isBlockComment = require_is_block_comment();
  23650. var NON_LINE_TERMINATING_WHITE_SPACE = "(?:(?=.)\\s)";
  23651. var FLOW_SHORTHAND_ANNOTATION = new RegExp(`^${NON_LINE_TERMINATING_WHITE_SPACE}*:`);
  23652. var FLOW_ANNOTATION = new RegExp(`^${NON_LINE_TERMINATING_WHITE_SPACE}*::`);
  23653. function hasFlowShorthandAnnotationComment(node) {
  23654. return node.extra && node.extra.parenthesized && isNonEmptyArray(node.trailingComments) && isBlockComment(node.trailingComments[0]) && FLOW_SHORTHAND_ANNOTATION.test(node.trailingComments[0].value);
  23655. }
  23656. function hasFlowAnnotationComment(comments) {
  23657. return isNonEmptyArray(comments) && isBlockComment(comments[0]) && FLOW_ANNOTATION.test(comments[0].value);
  23658. }
  23659. function hasNode(node, fn) {
  23660. if (!node || typeof node !== "object") {
  23661. return false;
  23662. }
  23663. if (Array.isArray(node)) {
  23664. return node.some((value) => hasNode(value, fn));
  23665. }
  23666. const result = fn(node);
  23667. return typeof result === "boolean" ? result : Object.values(node).some((value) => hasNode(value, fn));
  23668. }
  23669. function hasNakedLeftSide(node) {
  23670. return node.type === "AssignmentExpression" || node.type === "BinaryExpression" || node.type === "LogicalExpression" || node.type === "NGPipeExpression" || node.type === "ConditionalExpression" || isCallExpression(node) || isMemberExpression(node) || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "BindExpression" || node.type === "UpdateExpression" && !node.prefix || node.type === "TSAsExpression" || node.type === "TSNonNullExpression";
  23671. }
  23672. function getLeftSide(node) {
  23673. if (node.expressions) {
  23674. return node.expressions[0];
  23675. }
  23676. return node.left || node.test || node.callee || node.object || node.tag || node.argument || node.expression;
  23677. }
  23678. function getLeftSidePathName(path, node) {
  23679. if (node.expressions) {
  23680. return ["expressions", 0];
  23681. }
  23682. if (node.left) {
  23683. return ["left"];
  23684. }
  23685. if (node.test) {
  23686. return ["test"];
  23687. }
  23688. if (node.object) {
  23689. return ["object"];
  23690. }
  23691. if (node.callee) {
  23692. return ["callee"];
  23693. }
  23694. if (node.tag) {
  23695. return ["tag"];
  23696. }
  23697. if (node.argument) {
  23698. return ["argument"];
  23699. }
  23700. if (node.expression) {
  23701. return ["expression"];
  23702. }
  23703. throw new Error("Unexpected node has no left side.");
  23704. }
  23705. function isLineComment(comment) {
  23706. return comment.type === "Line" || comment.type === "CommentLine" || comment.type === "SingleLine" || comment.type === "HashbangComment" || comment.type === "HTMLOpen" || comment.type === "HTMLClose";
  23707. }
  23708. var exportDeclarationTypes = /* @__PURE__ */ new Set(["ExportDefaultDeclaration", "ExportDefaultSpecifier", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration"]);
  23709. function isExportDeclaration(node) {
  23710. return node && exportDeclarationTypes.has(node.type);
  23711. }
  23712. function getParentExportDeclaration(path) {
  23713. const parentNode = path.getParentNode();
  23714. if (path.getName() === "declaration" && isExportDeclaration(parentNode)) {
  23715. return parentNode;
  23716. }
  23717. return null;
  23718. }
  23719. function isLiteral(node) {
  23720. return node.type === "BooleanLiteral" || node.type === "DirectiveLiteral" || node.type === "Literal" || node.type === "NullLiteral" || node.type === "NumericLiteral" || node.type === "BigIntLiteral" || node.type === "DecimalLiteral" || node.type === "RegExpLiteral" || node.type === "StringLiteral" || node.type === "TemplateLiteral" || node.type === "TSTypeLiteral" || node.type === "JSXText";
  23721. }
  23722. function isNumericLiteral(node) {
  23723. return node.type === "NumericLiteral" || node.type === "Literal" && typeof node.value === "number";
  23724. }
  23725. function isSignedNumericLiteral(node) {
  23726. return node.type === "UnaryExpression" && (node.operator === "+" || node.operator === "-") && isNumericLiteral(node.argument);
  23727. }
  23728. function isStringLiteral(node) {
  23729. return node.type === "StringLiteral" || node.type === "Literal" && typeof node.value === "string";
  23730. }
  23731. function isObjectType(node) {
  23732. return node.type === "ObjectTypeAnnotation" || node.type === "TSTypeLiteral" || node.type === "TSMappedType";
  23733. }
  23734. function isFunctionOrArrowExpression(node) {
  23735. return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
  23736. }
  23737. function isFunctionOrArrowExpressionWithBody(node) {
  23738. return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement";
  23739. }
  23740. function isTemplateLiteral(node) {
  23741. return node.type === "TemplateLiteral";
  23742. }
  23743. function isAngularTestWrapper(node) {
  23744. return isCallExpression(node) && node.callee.type === "Identifier" && ["async", "inject", "fakeAsync", "waitForAsync"].includes(node.callee.name);
  23745. }
  23746. function isJsxNode(node) {
  23747. return node.type === "JSXElement" || node.type === "JSXFragment";
  23748. }
  23749. function isTheOnlyJsxElementInMarkdown(options, path) {
  23750. if (options.parentParser !== "markdown" && options.parentParser !== "mdx") {
  23751. return false;
  23752. }
  23753. const node = path.getNode();
  23754. if (!node.expression || !isJsxNode(node.expression)) {
  23755. return false;
  23756. }
  23757. const parent = path.getParentNode();
  23758. return parent.type === "Program" && parent.body.length === 1;
  23759. }
  23760. function isGetterOrSetter(node) {
  23761. return node.kind === "get" || node.kind === "set";
  23762. }
  23763. function isFunctionNotation(node) {
  23764. return isGetterOrSetter(node) || hasSameLocStart(node, node.value);
  23765. }
  23766. function isObjectTypePropertyAFunction(node) {
  23767. return (node.type === "ObjectTypeProperty" || node.type === "ObjectTypeInternalSlot") && node.value.type === "FunctionTypeAnnotation" && !node.static && !isFunctionNotation(node);
  23768. }
  23769. function isTypeAnnotationAFunction(node) {
  23770. return (node.type === "TypeAnnotation" || node.type === "TSTypeAnnotation") && node.typeAnnotation.type === "FunctionTypeAnnotation" && !node.static && !hasSameLocStart(node, node.typeAnnotation);
  23771. }
  23772. var binaryishNodeTypes = /* @__PURE__ */ new Set(["BinaryExpression", "LogicalExpression", "NGPipeExpression"]);
  23773. function isBinaryish(node) {
  23774. return binaryishNodeTypes.has(node.type);
  23775. }
  23776. function isMemberish(node) {
  23777. return isMemberExpression(node) || node.type === "BindExpression" && Boolean(node.object);
  23778. }
  23779. var simpleTypeAnnotations = /* @__PURE__ */ new Set(["AnyTypeAnnotation", "TSAnyKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword", "ThisTypeAnnotation", "TSThisType", "NumberTypeAnnotation", "TSNumberKeyword", "VoidTypeAnnotation", "TSVoidKeyword", "BooleanTypeAnnotation", "TSBooleanKeyword", "BigIntTypeAnnotation", "TSBigIntKeyword", "SymbolTypeAnnotation", "TSSymbolKeyword", "StringTypeAnnotation", "TSStringKeyword", "BooleanLiteralTypeAnnotation", "StringLiteralTypeAnnotation", "BigIntLiteralTypeAnnotation", "NumberLiteralTypeAnnotation", "TSLiteralType", "TSTemplateLiteralType", "EmptyTypeAnnotation", "MixedTypeAnnotation", "TSNeverKeyword", "TSObjectKeyword", "TSUndefinedKeyword", "TSUnknownKeyword"]);
  23780. function isSimpleType(node) {
  23781. if (!node) {
  23782. return false;
  23783. }
  23784. if ((node.type === "GenericTypeAnnotation" || node.type === "TSTypeReference") && !node.typeParameters) {
  23785. return true;
  23786. }
  23787. if (simpleTypeAnnotations.has(node.type)) {
  23788. return true;
  23789. }
  23790. return false;
  23791. }
  23792. var unitTestRe = /^(?:skip|[fx]?(?:it|describe|test))$/;
  23793. function isSkipOrOnlyBlock(node) {
  23794. return isMemberExpression(node.callee) && node.callee.object.type === "Identifier" && node.callee.property.type === "Identifier" && unitTestRe.test(node.callee.object.name) && (node.callee.property.name === "only" || node.callee.property.name === "skip");
  23795. }
  23796. function isUnitTestSetUp(node) {
  23797. const unitTestSetUpRe = /^(?:before|after)(?:Each|All)$/;
  23798. return node.callee.type === "Identifier" && unitTestSetUpRe.test(node.callee.name) && node.arguments.length === 1;
  23799. }
  23800. function isTestCall(node, parent) {
  23801. if (node.type !== "CallExpression") {
  23802. return false;
  23803. }
  23804. if (node.arguments.length === 1) {
  23805. if (isAngularTestWrapper(node) && parent && isTestCall(parent)) {
  23806. return isFunctionOrArrowExpression(node.arguments[0]);
  23807. }
  23808. if (isUnitTestSetUp(node)) {
  23809. return isAngularTestWrapper(node.arguments[0]);
  23810. }
  23811. } else if (node.arguments.length === 2 || node.arguments.length === 3) {
  23812. if ((node.callee.type === "Identifier" && unitTestRe.test(node.callee.name) || isSkipOrOnlyBlock(node)) && (isTemplateLiteral(node.arguments[0]) || isStringLiteral(node.arguments[0]))) {
  23813. if (node.arguments[2] && !isNumericLiteral(node.arguments[2])) {
  23814. return false;
  23815. }
  23816. return (node.arguments.length === 2 ? isFunctionOrArrowExpression(node.arguments[1]) : isFunctionOrArrowExpressionWithBody(node.arguments[1]) && getFunctionParameters(node.arguments[1]).length <= 1) || isAngularTestWrapper(node.arguments[1]);
  23817. }
  23818. }
  23819. return false;
  23820. }
  23821. function isCallExpression(node) {
  23822. return node && (node.type === "CallExpression" || node.type === "OptionalCallExpression");
  23823. }
  23824. function isMemberExpression(node) {
  23825. return node && (node.type === "MemberExpression" || node.type === "OptionalMemberExpression");
  23826. }
  23827. function isSimpleTemplateLiteral(node) {
  23828. let expressionsKey = "expressions";
  23829. if (node.type === "TSTemplateLiteralType") {
  23830. expressionsKey = "types";
  23831. }
  23832. const expressions = node[expressionsKey];
  23833. if (expressions.length === 0) {
  23834. return false;
  23835. }
  23836. return expressions.every((expr) => {
  23837. if (hasComment(expr)) {
  23838. return false;
  23839. }
  23840. if (expr.type === "Identifier" || expr.type === "ThisExpression") {
  23841. return true;
  23842. }
  23843. if (isMemberExpression(expr)) {
  23844. let head = expr;
  23845. while (isMemberExpression(head)) {
  23846. if (head.property.type !== "Identifier" && head.property.type !== "Literal" && head.property.type !== "StringLiteral" && head.property.type !== "NumericLiteral") {
  23847. return false;
  23848. }
  23849. head = head.object;
  23850. if (hasComment(head)) {
  23851. return false;
  23852. }
  23853. }
  23854. if (head.type === "Identifier" || head.type === "ThisExpression") {
  23855. return true;
  23856. }
  23857. return false;
  23858. }
  23859. return false;
  23860. });
  23861. }
  23862. function getTypeScriptMappedTypeModifier(tokenNode, keyword) {
  23863. if (tokenNode === "+") {
  23864. return "+" + keyword;
  23865. }
  23866. if (tokenNode === "-") {
  23867. return "-" + keyword;
  23868. }
  23869. return keyword;
  23870. }
  23871. function isFlowAnnotationComment(text, typeAnnotation) {
  23872. const start = locStart(typeAnnotation);
  23873. const end = skipWhitespace(text, locEnd(typeAnnotation));
  23874. return end !== false && text.slice(start, start + 2) === "/*" && text.slice(end, end + 2) === "*/";
  23875. }
  23876. function hasLeadingOwnLineComment(text, node) {
  23877. if (isJsxNode(node)) {
  23878. return hasNodeIgnoreComment(node);
  23879. }
  23880. return hasComment(node, CommentCheckFlags.Leading, (comment) => hasNewline(text, locEnd(comment)));
  23881. }
  23882. function isStringPropSafeToUnquote(node, options) {
  23883. return options.parser !== "json" && isStringLiteral(node.key) && rawText(node.key).slice(1, -1) === node.key.value && (isIdentifierName(node.key.value) && !(options.parser === "babel-ts" && node.type === "ClassProperty" || options.parser === "typescript" && node.type === "PropertyDefinition") || isSimpleNumber(node.key.value) && String(Number(node.key.value)) === node.key.value && (options.parser === "babel" || options.parser === "acorn" || options.parser === "espree" || options.parser === "meriyah" || options.parser === "__babel_estree"));
  23884. }
  23885. function isSimpleNumber(numberString) {
  23886. return /^(?:\d+|\d+\.\d+)$/.test(numberString);
  23887. }
  23888. function isJestEachTemplateLiteral(node, parentNode) {
  23889. const jestEachTriggerRegex = /^[fx]?(?:describe|it|test)$/;
  23890. return parentNode.type === "TaggedTemplateExpression" && parentNode.quasi === node && parentNode.tag.type === "MemberExpression" && parentNode.tag.property.type === "Identifier" && parentNode.tag.property.name === "each" && (parentNode.tag.object.type === "Identifier" && jestEachTriggerRegex.test(parentNode.tag.object.name) || parentNode.tag.object.type === "MemberExpression" && parentNode.tag.object.property.type === "Identifier" && (parentNode.tag.object.property.name === "only" || parentNode.tag.object.property.name === "skip") && parentNode.tag.object.object.type === "Identifier" && jestEachTriggerRegex.test(parentNode.tag.object.object.name));
  23891. }
  23892. function templateLiteralHasNewLines(template) {
  23893. return template.quasis.some((quasi) => quasi.value.raw.includes("\n"));
  23894. }
  23895. function isTemplateOnItsOwnLine(node, text) {
  23896. return (node.type === "TemplateLiteral" && templateLiteralHasNewLines(node) || node.type === "TaggedTemplateExpression" && templateLiteralHasNewLines(node.quasi)) && !hasNewline(text, locStart(node), {
  23897. backwards: true
  23898. });
  23899. }
  23900. function needsHardlineAfterDanglingComment(node) {
  23901. if (!hasComment(node)) {
  23902. return false;
  23903. }
  23904. const lastDanglingComment = getLast(getComments(node, CommentCheckFlags.Dangling));
  23905. return lastDanglingComment && !isBlockComment(lastDanglingComment);
  23906. }
  23907. function isFunctionCompositionArgs(args) {
  23908. if (args.length <= 1) {
  23909. return false;
  23910. }
  23911. let count = 0;
  23912. for (const arg of args) {
  23913. if (isFunctionOrArrowExpression(arg)) {
  23914. count += 1;
  23915. if (count > 1) {
  23916. return true;
  23917. }
  23918. } else if (isCallExpression(arg)) {
  23919. for (const childArg of arg.arguments) {
  23920. if (isFunctionOrArrowExpression(childArg)) {
  23921. return true;
  23922. }
  23923. }
  23924. }
  23925. }
  23926. return false;
  23927. }
  23928. function isLongCurriedCallExpression(path) {
  23929. const node = path.getValue();
  23930. const parent = path.getParentNode();
  23931. return isCallExpression(node) && isCallExpression(parent) && parent.callee === node && node.arguments.length > parent.arguments.length && parent.arguments.length > 0;
  23932. }
  23933. function isSimpleCallArgument(node, depth) {
  23934. if (depth >= 2) {
  23935. return false;
  23936. }
  23937. const isChildSimple = (child) => isSimpleCallArgument(child, depth + 1);
  23938. const regexpPattern = node.type === "Literal" && "regex" in node && node.regex.pattern || node.type === "RegExpLiteral" && node.pattern;
  23939. if (regexpPattern && getStringWidth(regexpPattern) > 5) {
  23940. return false;
  23941. }
  23942. if (node.type === "Literal" || node.type === "BigIntLiteral" || node.type === "DecimalLiteral" || node.type === "BooleanLiteral" || node.type === "NullLiteral" || node.type === "NumericLiteral" || node.type === "RegExpLiteral" || node.type === "StringLiteral" || node.type === "Identifier" || node.type === "ThisExpression" || node.type === "Super" || node.type === "PrivateName" || node.type === "PrivateIdentifier" || node.type === "ArgumentPlaceholder" || node.type === "Import") {
  23943. return true;
  23944. }
  23945. if (node.type === "TemplateLiteral") {
  23946. return node.quasis.every((element) => !element.value.raw.includes("\n")) && node.expressions.every(isChildSimple);
  23947. }
  23948. if (node.type === "ObjectExpression") {
  23949. return node.properties.every((p) => !p.computed && (p.shorthand || p.value && isChildSimple(p.value)));
  23950. }
  23951. if (node.type === "ArrayExpression") {
  23952. return node.elements.every((x) => x === null || isChildSimple(x));
  23953. }
  23954. if (isCallLikeExpression(node)) {
  23955. return (node.type === "ImportExpression" || isSimpleCallArgument(node.callee, depth)) && getCallArguments(node).every(isChildSimple);
  23956. }
  23957. if (isMemberExpression(node)) {
  23958. return isSimpleCallArgument(node.object, depth) && isSimpleCallArgument(node.property, depth);
  23959. }
  23960. if (node.type === "UnaryExpression" && (node.operator === "!" || node.operator === "-")) {
  23961. return isSimpleCallArgument(node.argument, depth);
  23962. }
  23963. if (node.type === "TSNonNullExpression") {
  23964. return isSimpleCallArgument(node.expression, depth);
  23965. }
  23966. return false;
  23967. }
  23968. function rawText(node) {
  23969. return node.extra ? node.extra.raw : node.raw;
  23970. }
  23971. function identity(x) {
  23972. return x;
  23973. }
  23974. function isTSXFile(options) {
  23975. return options.filepath && /\.tsx$/i.test(options.filepath);
  23976. }
  23977. function shouldPrintComma(options, level = "es5") {
  23978. return options.trailingComma === "es5" && level === "es5" || options.trailingComma === "all" && (level === "all" || level === "es5");
  23979. }
  23980. function startsWithNoLookaheadToken(node, forbidFunctionClassAndDoExpr) {
  23981. node = getLeftMost(node);
  23982. switch (node.type) {
  23983. case "FunctionExpression":
  23984. case "ClassExpression":
  23985. case "DoExpression":
  23986. return forbidFunctionClassAndDoExpr;
  23987. case "ObjectExpression":
  23988. return true;
  23989. case "MemberExpression":
  23990. case "OptionalMemberExpression":
  23991. return startsWithNoLookaheadToken(node.object, forbidFunctionClassAndDoExpr);
  23992. case "TaggedTemplateExpression":
  23993. if (node.tag.type === "FunctionExpression") {
  23994. return false;
  23995. }
  23996. return startsWithNoLookaheadToken(node.tag, forbidFunctionClassAndDoExpr);
  23997. case "CallExpression":
  23998. case "OptionalCallExpression":
  23999. if (node.callee.type === "FunctionExpression") {
  24000. return false;
  24001. }
  24002. return startsWithNoLookaheadToken(node.callee, forbidFunctionClassAndDoExpr);
  24003. case "ConditionalExpression":
  24004. return startsWithNoLookaheadToken(node.test, forbidFunctionClassAndDoExpr);
  24005. case "UpdateExpression":
  24006. return !node.prefix && startsWithNoLookaheadToken(node.argument, forbidFunctionClassAndDoExpr);
  24007. case "BindExpression":
  24008. return node.object && startsWithNoLookaheadToken(node.object, forbidFunctionClassAndDoExpr);
  24009. case "SequenceExpression":
  24010. return startsWithNoLookaheadToken(node.expressions[0], forbidFunctionClassAndDoExpr);
  24011. case "TSAsExpression":
  24012. case "TSNonNullExpression":
  24013. return startsWithNoLookaheadToken(node.expression, forbidFunctionClassAndDoExpr);
  24014. default:
  24015. return false;
  24016. }
  24017. }
  24018. var equalityOperators = {
  24019. "==": true,
  24020. "!=": true,
  24021. "===": true,
  24022. "!==": true
  24023. };
  24024. var multiplicativeOperators = {
  24025. "*": true,
  24026. "/": true,
  24027. "%": true
  24028. };
  24029. var bitshiftOperators = {
  24030. ">>": true,
  24031. ">>>": true,
  24032. "<<": true
  24033. };
  24034. function shouldFlatten(parentOp, nodeOp) {
  24035. if (getPrecedence(nodeOp) !== getPrecedence(parentOp)) {
  24036. return false;
  24037. }
  24038. if (parentOp === "**") {
  24039. return false;
  24040. }
  24041. if (equalityOperators[parentOp] && equalityOperators[nodeOp]) {
  24042. return false;
  24043. }
  24044. if (nodeOp === "%" && multiplicativeOperators[parentOp] || parentOp === "%" && multiplicativeOperators[nodeOp]) {
  24045. return false;
  24046. }
  24047. if (nodeOp !== parentOp && multiplicativeOperators[nodeOp] && multiplicativeOperators[parentOp]) {
  24048. return false;
  24049. }
  24050. if (bitshiftOperators[parentOp] && bitshiftOperators[nodeOp]) {
  24051. return false;
  24052. }
  24053. return true;
  24054. }
  24055. var PRECEDENCE = {};
  24056. for (const [i, tier] of [["|>"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"]].entries()) {
  24057. for (const op of tier) {
  24058. PRECEDENCE[op] = i;
  24059. }
  24060. }
  24061. function getPrecedence(op) {
  24062. return PRECEDENCE[op];
  24063. }
  24064. function getLeftMost(node) {
  24065. while (node.left) {
  24066. node = node.left;
  24067. }
  24068. return node;
  24069. }
  24070. function isBitwiseOperator(operator) {
  24071. return Boolean(bitshiftOperators[operator]) || operator === "|" || operator === "^" || operator === "&";
  24072. }
  24073. function hasRestParameter(node) {
  24074. if (node.rest) {
  24075. return true;
  24076. }
  24077. const parameters = getFunctionParameters(node);
  24078. return parameters.length > 0 && getLast(parameters).type === "RestElement";
  24079. }
  24080. var functionParametersCache = /* @__PURE__ */ new WeakMap();
  24081. function getFunctionParameters(node) {
  24082. if (functionParametersCache.has(node)) {
  24083. return functionParametersCache.get(node);
  24084. }
  24085. const parameters = [];
  24086. if (node.this) {
  24087. parameters.push(node.this);
  24088. }
  24089. if (Array.isArray(node.parameters)) {
  24090. parameters.push(...node.parameters);
  24091. } else if (Array.isArray(node.params)) {
  24092. parameters.push(...node.params);
  24093. }
  24094. if (node.rest) {
  24095. parameters.push(node.rest);
  24096. }
  24097. functionParametersCache.set(node, parameters);
  24098. return parameters;
  24099. }
  24100. function iterateFunctionParametersPath(path, iteratee) {
  24101. const node = path.getValue();
  24102. let index = 0;
  24103. const callback = (childPath) => iteratee(childPath, index++);
  24104. if (node.this) {
  24105. path.call(callback, "this");
  24106. }
  24107. if (Array.isArray(node.parameters)) {
  24108. path.each(callback, "parameters");
  24109. } else if (Array.isArray(node.params)) {
  24110. path.each(callback, "params");
  24111. }
  24112. if (node.rest) {
  24113. path.call(callback, "rest");
  24114. }
  24115. }
  24116. var callArgumentsCache = /* @__PURE__ */ new WeakMap();
  24117. function getCallArguments(node) {
  24118. if (callArgumentsCache.has(node)) {
  24119. return callArgumentsCache.get(node);
  24120. }
  24121. let args = node.arguments;
  24122. if (node.type === "ImportExpression") {
  24123. args = [node.source];
  24124. if (node.attributes) {
  24125. args.push(node.attributes);
  24126. }
  24127. }
  24128. callArgumentsCache.set(node, args);
  24129. return args;
  24130. }
  24131. function iterateCallArgumentsPath(path, iteratee) {
  24132. const node = path.getValue();
  24133. if (node.type === "ImportExpression") {
  24134. path.call((sourcePath) => iteratee(sourcePath, 0), "source");
  24135. if (node.attributes) {
  24136. path.call((sourcePath) => iteratee(sourcePath, 1), "attributes");
  24137. }
  24138. } else {
  24139. path.each(iteratee, "arguments");
  24140. }
  24141. }
  24142. function isPrettierIgnoreComment(comment) {
  24143. return comment.value.trim() === "prettier-ignore" && !comment.unignore;
  24144. }
  24145. function hasNodeIgnoreComment(node) {
  24146. return node && (node.prettierIgnore || hasComment(node, CommentCheckFlags.PrettierIgnore));
  24147. }
  24148. function hasIgnoreComment(path) {
  24149. const node = path.getValue();
  24150. return hasNodeIgnoreComment(node);
  24151. }
  24152. var CommentCheckFlags = {
  24153. Leading: 1 << 1,
  24154. Trailing: 1 << 2,
  24155. Dangling: 1 << 3,
  24156. Block: 1 << 4,
  24157. Line: 1 << 5,
  24158. PrettierIgnore: 1 << 6,
  24159. First: 1 << 7,
  24160. Last: 1 << 8
  24161. };
  24162. var getCommentTestFunction = (flags, fn) => {
  24163. if (typeof flags === "function") {
  24164. fn = flags;
  24165. flags = 0;
  24166. }
  24167. if (flags || fn) {
  24168. return (comment, index, comments) => !(flags & CommentCheckFlags.Leading && !comment.leading || flags & CommentCheckFlags.Trailing && !comment.trailing || flags & CommentCheckFlags.Dangling && (comment.leading || comment.trailing) || flags & CommentCheckFlags.Block && !isBlockComment(comment) || flags & CommentCheckFlags.Line && !isLineComment(comment) || flags & CommentCheckFlags.First && index !== 0 || flags & CommentCheckFlags.Last && index !== comments.length - 1 || flags & CommentCheckFlags.PrettierIgnore && !isPrettierIgnoreComment(comment) || fn && !fn(comment));
  24169. }
  24170. };
  24171. function hasComment(node, flags, fn) {
  24172. if (!node || !isNonEmptyArray(node.comments)) {
  24173. return false;
  24174. }
  24175. const test = getCommentTestFunction(flags, fn);
  24176. return test ? node.comments.some(test) : true;
  24177. }
  24178. function getComments(node, flags, fn) {
  24179. if (!node || !Array.isArray(node.comments)) {
  24180. return [];
  24181. }
  24182. const test = getCommentTestFunction(flags, fn);
  24183. return test ? node.comments.filter(test) : node.comments;
  24184. }
  24185. var isNextLineEmpty = (node, {
  24186. originalText
  24187. }) => isNextLineEmptyAfterIndex(originalText, locEnd(node));
  24188. function isCallLikeExpression(node) {
  24189. return isCallExpression(node) || node.type === "NewExpression" || node.type === "ImportExpression";
  24190. }
  24191. function isObjectProperty(node) {
  24192. return node && (node.type === "ObjectProperty" || node.type === "Property" && !node.method && node.kind === "init");
  24193. }
  24194. function isEnabledHackPipeline(options) {
  24195. return Boolean(options.__isUsingHackPipeline);
  24196. }
  24197. var markerForIfWithoutBlockAndSameLineComment = Symbol("ifWithoutBlockAndSameLineComment");
  24198. module2.exports = {
  24199. getFunctionParameters,
  24200. iterateFunctionParametersPath,
  24201. getCallArguments,
  24202. iterateCallArgumentsPath,
  24203. hasRestParameter,
  24204. getLeftSide,
  24205. getLeftSidePathName,
  24206. getParentExportDeclaration,
  24207. getTypeScriptMappedTypeModifier,
  24208. hasFlowAnnotationComment,
  24209. hasFlowShorthandAnnotationComment,
  24210. hasLeadingOwnLineComment,
  24211. hasNakedLeftSide,
  24212. hasNode,
  24213. hasIgnoreComment,
  24214. hasNodeIgnoreComment,
  24215. identity,
  24216. isBinaryish,
  24217. isCallLikeExpression,
  24218. isEnabledHackPipeline,
  24219. isLineComment,
  24220. isPrettierIgnoreComment,
  24221. isCallExpression,
  24222. isMemberExpression,
  24223. isExportDeclaration,
  24224. isFlowAnnotationComment,
  24225. isFunctionCompositionArgs,
  24226. isFunctionNotation,
  24227. isFunctionOrArrowExpression,
  24228. isGetterOrSetter,
  24229. isJestEachTemplateLiteral,
  24230. isJsxNode,
  24231. isLiteral,
  24232. isLongCurriedCallExpression,
  24233. isSimpleCallArgument,
  24234. isMemberish,
  24235. isNumericLiteral,
  24236. isSignedNumericLiteral,
  24237. isObjectProperty,
  24238. isObjectType,
  24239. isObjectTypePropertyAFunction,
  24240. isSimpleType,
  24241. isSimpleNumber,
  24242. isSimpleTemplateLiteral,
  24243. isStringLiteral,
  24244. isStringPropSafeToUnquote,
  24245. isTemplateOnItsOwnLine,
  24246. isTestCall,
  24247. isTheOnlyJsxElementInMarkdown,
  24248. isTSXFile,
  24249. isTypeAnnotationAFunction,
  24250. isNextLineEmpty,
  24251. needsHardlineAfterDanglingComment,
  24252. rawText,
  24253. shouldPrintComma,
  24254. isBitwiseOperator,
  24255. shouldFlatten,
  24256. startsWithNoLookaheadToken,
  24257. getPrecedence,
  24258. hasComment,
  24259. getComments,
  24260. CommentCheckFlags,
  24261. markerForIfWithoutBlockAndSameLineComment
  24262. };
  24263. }
  24264. });
  24265. var require_template_literal = __commonJS2({
  24266. "src/language-js/print/template-literal.js"(exports2, module2) {
  24267. "use strict";
  24268. var getLast = require_get_last();
  24269. var {
  24270. getStringWidth,
  24271. getIndentSize
  24272. } = require_util();
  24273. var {
  24274. builders: {
  24275. join,
  24276. hardline,
  24277. softline,
  24278. group,
  24279. indent,
  24280. align,
  24281. lineSuffixBoundary,
  24282. addAlignmentToDoc
  24283. },
  24284. printer: {
  24285. printDocToString
  24286. },
  24287. utils: {
  24288. mapDoc
  24289. }
  24290. } = require("./doc.js");
  24291. var {
  24292. isBinaryish,
  24293. isJestEachTemplateLiteral,
  24294. isSimpleTemplateLiteral,
  24295. hasComment,
  24296. isMemberExpression
  24297. } = require_utils7();
  24298. function printTemplateLiteral(path, print, options) {
  24299. const node = path.getValue();
  24300. const isTemplateLiteral = node.type === "TemplateLiteral";
  24301. if (isTemplateLiteral && isJestEachTemplateLiteral(node, path.getParentNode())) {
  24302. const printed = printJestEachTemplateLiteral(path, options, print);
  24303. if (printed) {
  24304. return printed;
  24305. }
  24306. }
  24307. let expressionsKey = "expressions";
  24308. if (node.type === "TSTemplateLiteralType") {
  24309. expressionsKey = "types";
  24310. }
  24311. const parts = [];
  24312. let expressions = path.map(print, expressionsKey);
  24313. const isSimple = isSimpleTemplateLiteral(node);
  24314. if (isSimple) {
  24315. expressions = expressions.map((doc2) => printDocToString(doc2, Object.assign(Object.assign({}, options), {}, {
  24316. printWidth: Number.POSITIVE_INFINITY
  24317. })).formatted);
  24318. }
  24319. parts.push(lineSuffixBoundary, "`");
  24320. path.each((childPath) => {
  24321. const i = childPath.getName();
  24322. parts.push(print());
  24323. if (i < expressions.length) {
  24324. const {
  24325. tabWidth
  24326. } = options;
  24327. const quasi = childPath.getValue();
  24328. const indentSize = getIndentSize(quasi.value.raw, tabWidth);
  24329. let printed = expressions[i];
  24330. if (!isSimple) {
  24331. const expression = node[expressionsKey][i];
  24332. if (hasComment(expression) || isMemberExpression(expression) || expression.type === "ConditionalExpression" || expression.type === "SequenceExpression" || expression.type === "TSAsExpression" || isBinaryish(expression)) {
  24333. printed = [indent([softline, printed]), softline];
  24334. }
  24335. }
  24336. const aligned = indentSize === 0 && quasi.value.raw.endsWith("\n") ? align(Number.NEGATIVE_INFINITY, printed) : addAlignmentToDoc(printed, indentSize, tabWidth);
  24337. parts.push(group(["${", aligned, lineSuffixBoundary, "}"]));
  24338. }
  24339. }, "quasis");
  24340. parts.push("`");
  24341. return parts;
  24342. }
  24343. function printJestEachTemplateLiteral(path, options, print) {
  24344. const node = path.getNode();
  24345. const headerNames = node.quasis[0].value.raw.trim().split(/\s*\|\s*/);
  24346. if (headerNames.length > 1 || headerNames.some((headerName) => headerName.length > 0)) {
  24347. options.__inJestEach = true;
  24348. const expressions = path.map(print, "expressions");
  24349. options.__inJestEach = false;
  24350. const parts = [];
  24351. const stringifiedExpressions = expressions.map((doc2) => "${" + printDocToString(doc2, Object.assign(Object.assign({}, options), {}, {
  24352. printWidth: Number.POSITIVE_INFINITY,
  24353. endOfLine: "lf"
  24354. })).formatted + "}");
  24355. const tableBody = [{
  24356. hasLineBreak: false,
  24357. cells: []
  24358. }];
  24359. for (let i = 1; i < node.quasis.length; i++) {
  24360. const row = getLast(tableBody);
  24361. const correspondingExpression = stringifiedExpressions[i - 1];
  24362. row.cells.push(correspondingExpression);
  24363. if (correspondingExpression.includes("\n")) {
  24364. row.hasLineBreak = true;
  24365. }
  24366. if (node.quasis[i].value.raw.includes("\n")) {
  24367. tableBody.push({
  24368. hasLineBreak: false,
  24369. cells: []
  24370. });
  24371. }
  24372. }
  24373. const maxColumnCount = Math.max(headerNames.length, ...tableBody.map((row) => row.cells.length));
  24374. const maxColumnWidths = Array.from({
  24375. length: maxColumnCount
  24376. }).fill(0);
  24377. const table = [{
  24378. cells: headerNames
  24379. }, ...tableBody.filter((row) => row.cells.length > 0)];
  24380. for (const {
  24381. cells
  24382. } of table.filter((row) => !row.hasLineBreak)) {
  24383. for (const [index, cell] of cells.entries()) {
  24384. maxColumnWidths[index] = Math.max(maxColumnWidths[index], getStringWidth(cell));
  24385. }
  24386. }
  24387. parts.push(lineSuffixBoundary, "`", indent([hardline, join(hardline, table.map((row) => join(" | ", row.cells.map((cell, index) => row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index] - getStringWidth(cell))))))]), hardline, "`");
  24388. return parts;
  24389. }
  24390. }
  24391. function printTemplateExpression(path, print) {
  24392. const node = path.getValue();
  24393. let printed = print();
  24394. if (hasComment(node)) {
  24395. printed = group([indent([softline, printed]), softline]);
  24396. }
  24397. return ["${", printed, lineSuffixBoundary, "}"];
  24398. }
  24399. function printTemplateExpressions(path, print) {
  24400. return path.map((path2) => printTemplateExpression(path2, print), "expressions");
  24401. }
  24402. function escapeTemplateCharacters(doc2, raw) {
  24403. return mapDoc(doc2, (currentDoc) => {
  24404. if (typeof currentDoc === "string") {
  24405. return raw ? currentDoc.replace(/(\\*)`/g, "$1$1\\`") : uncookTemplateElementValue(currentDoc);
  24406. }
  24407. return currentDoc;
  24408. });
  24409. }
  24410. function uncookTemplateElementValue(cookedValue) {
  24411. return cookedValue.replace(/([\\`]|\${)/g, "\\$1");
  24412. }
  24413. module2.exports = {
  24414. printTemplateLiteral,
  24415. printTemplateExpressions,
  24416. escapeTemplateCharacters,
  24417. uncookTemplateElementValue
  24418. };
  24419. }
  24420. });
  24421. var require_markdown = __commonJS2({
  24422. "src/language-js/embed/markdown.js"(exports2, module2) {
  24423. "use strict";
  24424. var {
  24425. builders: {
  24426. indent,
  24427. softline,
  24428. literalline,
  24429. dedentToRoot
  24430. }
  24431. } = require("./doc.js");
  24432. var {
  24433. escapeTemplateCharacters
  24434. } = require_template_literal();
  24435. function format(path, print, textToDoc) {
  24436. const node = path.getValue();
  24437. let text = node.quasis[0].value.raw.replace(/((?:\\\\)*)\\`/g, (_, backslashes) => "\\".repeat(backslashes.length / 2) + "`");
  24438. const indentation = getIndentation(text);
  24439. const hasIndent = indentation !== "";
  24440. if (hasIndent) {
  24441. text = text.replace(new RegExp(`^${indentation}`, "gm"), "");
  24442. }
  24443. const doc2 = escapeTemplateCharacters(textToDoc(text, {
  24444. parser: "markdown",
  24445. __inJsTemplate: true
  24446. }, {
  24447. stripTrailingHardline: true
  24448. }), true);
  24449. return ["`", hasIndent ? indent([softline, doc2]) : [literalline, dedentToRoot(doc2)], softline, "`"];
  24450. }
  24451. function getIndentation(str) {
  24452. const firstMatchedIndent = str.match(/^([^\S\n]*)\S/m);
  24453. return firstMatchedIndent === null ? "" : firstMatchedIndent[1];
  24454. }
  24455. module2.exports = format;
  24456. }
  24457. });
  24458. var require_css = __commonJS2({
  24459. "src/language-js/embed/css.js"(exports2, module2) {
  24460. "use strict";
  24461. var {
  24462. isNonEmptyArray
  24463. } = require_util();
  24464. var {
  24465. builders: {
  24466. indent,
  24467. hardline,
  24468. softline
  24469. },
  24470. utils: {
  24471. mapDoc,
  24472. replaceEndOfLine,
  24473. cleanDoc
  24474. }
  24475. } = require("./doc.js");
  24476. var {
  24477. printTemplateExpressions
  24478. } = require_template_literal();
  24479. function format(path, print, textToDoc) {
  24480. const node = path.getValue();
  24481. const rawQuasis = node.quasis.map((q) => q.value.raw);
  24482. let placeholderID = 0;
  24483. const text = rawQuasis.reduce((prevVal, currVal, idx) => idx === 0 ? currVal : prevVal + "@prettier-placeholder-" + placeholderID++ + "-id" + currVal, "");
  24484. const doc2 = textToDoc(text, {
  24485. parser: "scss"
  24486. }, {
  24487. stripTrailingHardline: true
  24488. });
  24489. const expressionDocs = printTemplateExpressions(path, print);
  24490. return transformCssDoc(doc2, node, expressionDocs);
  24491. }
  24492. function transformCssDoc(quasisDoc, parentNode, expressionDocs) {
  24493. const isEmpty = parentNode.quasis.length === 1 && !parentNode.quasis[0].value.raw.trim();
  24494. if (isEmpty) {
  24495. return "``";
  24496. }
  24497. const newDoc = replacePlaceholders(quasisDoc, expressionDocs);
  24498. if (!newDoc) {
  24499. throw new Error("Couldn't insert all the expressions");
  24500. }
  24501. return ["`", indent([hardline, newDoc]), softline, "`"];
  24502. }
  24503. function replacePlaceholders(quasisDoc, expressionDocs) {
  24504. if (!isNonEmptyArray(expressionDocs)) {
  24505. return quasisDoc;
  24506. }
  24507. let replaceCounter = 0;
  24508. const newDoc = mapDoc(cleanDoc(quasisDoc), (doc2) => {
  24509. if (typeof doc2 !== "string" || !doc2.includes("@prettier-placeholder")) {
  24510. return doc2;
  24511. }
  24512. return doc2.split(/@prettier-placeholder-(\d+)-id/).map((component, idx) => {
  24513. if (idx % 2 === 0) {
  24514. return replaceEndOfLine(component);
  24515. }
  24516. replaceCounter++;
  24517. return expressionDocs[component];
  24518. });
  24519. });
  24520. return expressionDocs.length === replaceCounter ? newDoc : null;
  24521. }
  24522. module2.exports = format;
  24523. }
  24524. });
  24525. var require_graphql = __commonJS2({
  24526. "src/language-js/embed/graphql.js"(exports2, module2) {
  24527. "use strict";
  24528. var {
  24529. builders: {
  24530. indent,
  24531. join,
  24532. hardline
  24533. }
  24534. } = require("./doc.js");
  24535. var {
  24536. escapeTemplateCharacters,
  24537. printTemplateExpressions
  24538. } = require_template_literal();
  24539. function format(path, print, textToDoc) {
  24540. const node = path.getValue();
  24541. const numQuasis = node.quasis.length;
  24542. if (numQuasis === 1 && node.quasis[0].value.raw.trim() === "") {
  24543. return "``";
  24544. }
  24545. const expressionDocs = printTemplateExpressions(path, print);
  24546. const parts = [];
  24547. for (let i = 0; i < numQuasis; i++) {
  24548. const templateElement = node.quasis[i];
  24549. const isFirst = i === 0;
  24550. const isLast = i === numQuasis - 1;
  24551. const text = templateElement.value.cooked;
  24552. const lines = text.split("\n");
  24553. const numLines = lines.length;
  24554. const expressionDoc = expressionDocs[i];
  24555. const startsWithBlankLine = numLines > 2 && lines[0].trim() === "" && lines[1].trim() === "";
  24556. const endsWithBlankLine = numLines > 2 && lines[numLines - 1].trim() === "" && lines[numLines - 2].trim() === "";
  24557. const commentsAndWhitespaceOnly = lines.every((line) => /^\s*(?:#[^\n\r]*)?$/.test(line));
  24558. if (!isLast && /#[^\n\r]*$/.test(lines[numLines - 1])) {
  24559. return null;
  24560. }
  24561. let doc2 = null;
  24562. if (commentsAndWhitespaceOnly) {
  24563. doc2 = printGraphqlComments(lines);
  24564. } else {
  24565. doc2 = textToDoc(text, {
  24566. parser: "graphql"
  24567. }, {
  24568. stripTrailingHardline: true
  24569. });
  24570. }
  24571. if (doc2) {
  24572. doc2 = escapeTemplateCharacters(doc2, false);
  24573. if (!isFirst && startsWithBlankLine) {
  24574. parts.push("");
  24575. }
  24576. parts.push(doc2);
  24577. if (!isLast && endsWithBlankLine) {
  24578. parts.push("");
  24579. }
  24580. } else if (!isFirst && !isLast && startsWithBlankLine) {
  24581. parts.push("");
  24582. }
  24583. if (expressionDoc) {
  24584. parts.push(expressionDoc);
  24585. }
  24586. }
  24587. return ["`", indent([hardline, join(hardline, parts)]), hardline, "`"];
  24588. }
  24589. function printGraphqlComments(lines) {
  24590. const parts = [];
  24591. let seenComment = false;
  24592. const array = lines.map((textLine) => textLine.trim());
  24593. for (const [i, textLine] of array.entries()) {
  24594. if (textLine === "") {
  24595. continue;
  24596. }
  24597. if (array[i - 1] === "" && seenComment) {
  24598. parts.push([hardline, textLine]);
  24599. } else {
  24600. parts.push(textLine);
  24601. }
  24602. seenComment = true;
  24603. }
  24604. return parts.length === 0 ? null : join(hardline, parts);
  24605. }
  24606. module2.exports = format;
  24607. }
  24608. });
  24609. var require_html = __commonJS2({
  24610. "src/language-js/embed/html.js"(exports2, module2) {
  24611. "use strict";
  24612. var {
  24613. builders: {
  24614. indent,
  24615. line,
  24616. hardline,
  24617. group
  24618. },
  24619. utils: {
  24620. mapDoc
  24621. }
  24622. } = require("./doc.js");
  24623. var {
  24624. printTemplateExpressions,
  24625. uncookTemplateElementValue
  24626. } = require_template_literal();
  24627. var htmlTemplateLiteralCounter = 0;
  24628. function format(path, print, textToDoc, options, {
  24629. parser
  24630. }) {
  24631. const node = path.getValue();
  24632. const counter = htmlTemplateLiteralCounter;
  24633. htmlTemplateLiteralCounter = htmlTemplateLiteralCounter + 1 >>> 0;
  24634. const composePlaceholder = (index) => `PRETTIER_HTML_PLACEHOLDER_${index}_${counter}_IN_JS`;
  24635. const text = node.quasis.map((quasi, index, quasis) => index === quasis.length - 1 ? quasi.value.cooked : quasi.value.cooked + composePlaceholder(index)).join("");
  24636. const expressionDocs = printTemplateExpressions(path, print);
  24637. if (expressionDocs.length === 0 && text.trim().length === 0) {
  24638. return "``";
  24639. }
  24640. const placeholderRegex = new RegExp(composePlaceholder("(\\d+)"), "g");
  24641. let topLevelCount = 0;
  24642. const doc2 = textToDoc(text, {
  24643. parser,
  24644. __onHtmlRoot(root) {
  24645. topLevelCount = root.children.length;
  24646. }
  24647. }, {
  24648. stripTrailingHardline: true
  24649. });
  24650. const contentDoc = mapDoc(doc2, (doc3) => {
  24651. if (typeof doc3 !== "string") {
  24652. return doc3;
  24653. }
  24654. const parts = [];
  24655. const components = doc3.split(placeholderRegex);
  24656. for (let i = 0; i < components.length; i++) {
  24657. let component = components[i];
  24658. if (i % 2 === 0) {
  24659. if (component) {
  24660. component = uncookTemplateElementValue(component);
  24661. if (options.__embeddedInHtml) {
  24662. component = component.replace(/<\/(script)\b/gi, "<\\/$1");
  24663. }
  24664. parts.push(component);
  24665. }
  24666. continue;
  24667. }
  24668. const placeholderIndex = Number(component);
  24669. parts.push(expressionDocs[placeholderIndex]);
  24670. }
  24671. return parts;
  24672. });
  24673. const leadingWhitespace = /^\s/.test(text) ? " " : "";
  24674. const trailingWhitespace = /\s$/.test(text) ? " " : "";
  24675. const linebreak = options.htmlWhitespaceSensitivity === "ignore" ? hardline : leadingWhitespace && trailingWhitespace ? line : null;
  24676. if (linebreak) {
  24677. return group(["`", indent([linebreak, group(contentDoc)]), linebreak, "`"]);
  24678. }
  24679. return group(["`", leadingWhitespace, topLevelCount > 1 ? indent(group(contentDoc)) : group(contentDoc), trailingWhitespace, "`"]);
  24680. }
  24681. module2.exports = format;
  24682. }
  24683. });
  24684. var require_embed = __commonJS2({
  24685. "src/language-js/embed.js"(exports2, module2) {
  24686. "use strict";
  24687. var {
  24688. hasComment,
  24689. CommentCheckFlags,
  24690. isObjectProperty
  24691. } = require_utils7();
  24692. var formatMarkdown = require_markdown();
  24693. var formatCss = require_css();
  24694. var formatGraphql = require_graphql();
  24695. var formatHtml = require_html();
  24696. function getLanguage(path) {
  24697. if (isStyledJsx(path) || isStyledComponents(path) || isCssProp(path) || isAngularComponentStyles(path)) {
  24698. return "css";
  24699. }
  24700. if (isGraphQL(path)) {
  24701. return "graphql";
  24702. }
  24703. if (isHtml(path)) {
  24704. return "html";
  24705. }
  24706. if (isAngularComponentTemplate(path)) {
  24707. return "angular";
  24708. }
  24709. if (isMarkdown(path)) {
  24710. return "markdown";
  24711. }
  24712. }
  24713. function embed(path, print, textToDoc, options) {
  24714. const node = path.getValue();
  24715. if (node.type !== "TemplateLiteral" || hasInvalidCookedValue(node)) {
  24716. return;
  24717. }
  24718. const language = getLanguage(path);
  24719. if (!language) {
  24720. return;
  24721. }
  24722. if (language === "markdown") {
  24723. return formatMarkdown(path, print, textToDoc);
  24724. }
  24725. if (language === "css") {
  24726. return formatCss(path, print, textToDoc);
  24727. }
  24728. if (language === "graphql") {
  24729. return formatGraphql(path, print, textToDoc);
  24730. }
  24731. if (language === "html" || language === "angular") {
  24732. return formatHtml(path, print, textToDoc, options, {
  24733. parser: language
  24734. });
  24735. }
  24736. }
  24737. function isMarkdown(path) {
  24738. const node = path.getValue();
  24739. const parent = path.getParentNode();
  24740. return parent && parent.type === "TaggedTemplateExpression" && node.quasis.length === 1 && parent.tag.type === "Identifier" && (parent.tag.name === "md" || parent.tag.name === "markdown");
  24741. }
  24742. function isStyledJsx(path) {
  24743. const node = path.getValue();
  24744. const parent = path.getParentNode();
  24745. const parentParent = path.getParentNode(1);
  24746. return parentParent && node.quasis && parent.type === "JSXExpressionContainer" && parentParent.type === "JSXElement" && parentParent.openingElement.name.name === "style" && parentParent.openingElement.attributes.some((attribute) => attribute.name.name === "jsx") || parent && parent.type === "TaggedTemplateExpression" && parent.tag.type === "Identifier" && parent.tag.name === "css" || parent && parent.type === "TaggedTemplateExpression" && parent.tag.type === "MemberExpression" && parent.tag.object.name === "css" && (parent.tag.property.name === "global" || parent.tag.property.name === "resolve");
  24747. }
  24748. function isAngularComponentStyles(path) {
  24749. return path.match((node) => node.type === "TemplateLiteral", (node, name) => node.type === "ArrayExpression" && name === "elements", (node, name) => isObjectProperty(node) && node.key.type === "Identifier" && node.key.name === "styles" && name === "value", ...angularComponentObjectExpressionPredicates);
  24750. }
  24751. function isAngularComponentTemplate(path) {
  24752. return path.match((node) => node.type === "TemplateLiteral", (node, name) => isObjectProperty(node) && node.key.type === "Identifier" && node.key.name === "template" && name === "value", ...angularComponentObjectExpressionPredicates);
  24753. }
  24754. var angularComponentObjectExpressionPredicates = [(node, name) => node.type === "ObjectExpression" && name === "properties", (node, name) => node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "Component" && name === "arguments", (node, name) => node.type === "Decorator" && name === "expression"];
  24755. function isStyledComponents(path) {
  24756. const parent = path.getParentNode();
  24757. if (!parent || parent.type !== "TaggedTemplateExpression") {
  24758. return false;
  24759. }
  24760. const tag = parent.tag.type === "ParenthesizedExpression" ? parent.tag.expression : parent.tag;
  24761. switch (tag.type) {
  24762. case "MemberExpression":
  24763. return isStyledIdentifier(tag.object) || isStyledExtend(tag);
  24764. case "CallExpression":
  24765. return isStyledIdentifier(tag.callee) || tag.callee.type === "MemberExpression" && (tag.callee.object.type === "MemberExpression" && (isStyledIdentifier(tag.callee.object.object) || isStyledExtend(tag.callee.object)) || tag.callee.object.type === "CallExpression" && isStyledIdentifier(tag.callee.object.callee));
  24766. case "Identifier":
  24767. return tag.name === "css";
  24768. default:
  24769. return false;
  24770. }
  24771. }
  24772. function isCssProp(path) {
  24773. const parent = path.getParentNode();
  24774. const parentParent = path.getParentNode(1);
  24775. return parentParent && parent.type === "JSXExpressionContainer" && parentParent.type === "JSXAttribute" && parentParent.name.type === "JSXIdentifier" && parentParent.name.name === "css";
  24776. }
  24777. function isStyledIdentifier(node) {
  24778. return node.type === "Identifier" && node.name === "styled";
  24779. }
  24780. function isStyledExtend(node) {
  24781. return /^[A-Z]/.test(node.object.name) && node.property.name === "extend";
  24782. }
  24783. function isGraphQL(path) {
  24784. const node = path.getValue();
  24785. const parent = path.getParentNode();
  24786. return hasLanguageComment(node, "GraphQL") || parent && (parent.type === "TaggedTemplateExpression" && (parent.tag.type === "MemberExpression" && parent.tag.object.name === "graphql" && parent.tag.property.name === "experimental" || parent.tag.type === "Identifier" && (parent.tag.name === "gql" || parent.tag.name === "graphql")) || parent.type === "CallExpression" && parent.callee.type === "Identifier" && parent.callee.name === "graphql");
  24787. }
  24788. function hasLanguageComment(node, languageName) {
  24789. return hasComment(node, CommentCheckFlags.Block | CommentCheckFlags.Leading, ({
  24790. value
  24791. }) => value === ` ${languageName} `);
  24792. }
  24793. function isHtml(path) {
  24794. return hasLanguageComment(path.getValue(), "HTML") || path.match((node) => node.type === "TemplateLiteral", (node, name) => node.type === "TaggedTemplateExpression" && node.tag.type === "Identifier" && node.tag.name === "html" && name === "quasi");
  24795. }
  24796. function hasInvalidCookedValue({
  24797. quasis
  24798. }) {
  24799. return quasis.some(({
  24800. value: {
  24801. cooked
  24802. }
  24803. }) => cooked === null);
  24804. }
  24805. module2.exports = embed;
  24806. }
  24807. });
  24808. var require_clean = __commonJS2({
  24809. "src/language-js/clean.js"(exports2, module2) {
  24810. "use strict";
  24811. var isBlockComment = require_is_block_comment();
  24812. var ignoredProperties = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]);
  24813. var removeTemplateElementsValue = (node) => {
  24814. for (const templateElement of node.quasis) {
  24815. delete templateElement.value;
  24816. }
  24817. };
  24818. function clean(ast, newObj, parent) {
  24819. if (ast.type === "Program") {
  24820. delete newObj.sourceType;
  24821. }
  24822. if (ast.type === "BigIntLiteral" || ast.type === "BigIntLiteralTypeAnnotation") {
  24823. if (newObj.value) {
  24824. newObj.value = newObj.value.toLowerCase();
  24825. }
  24826. }
  24827. if (ast.type === "BigIntLiteral" || ast.type === "Literal") {
  24828. if (newObj.bigint) {
  24829. newObj.bigint = newObj.bigint.toLowerCase();
  24830. }
  24831. }
  24832. if (ast.type === "DecimalLiteral") {
  24833. newObj.value = Number(newObj.value);
  24834. }
  24835. if (ast.type === "Literal" && newObj.decimal) {
  24836. newObj.decimal = Number(newObj.decimal);
  24837. }
  24838. if (ast.type === "EmptyStatement") {
  24839. return null;
  24840. }
  24841. if (ast.type === "JSXText") {
  24842. return null;
  24843. }
  24844. if (ast.type === "JSXExpressionContainer" && (ast.expression.type === "Literal" || ast.expression.type === "StringLiteral") && ast.expression.value === " ") {
  24845. return null;
  24846. }
  24847. if ((ast.type === "Property" || ast.type === "ObjectProperty" || ast.type === "MethodDefinition" || ast.type === "ClassProperty" || ast.type === "ClassMethod" || ast.type === "PropertyDefinition" || ast.type === "TSDeclareMethod" || ast.type === "TSPropertySignature" || ast.type === "ObjectTypeProperty") && typeof ast.key === "object" && ast.key && (ast.key.type === "Literal" || ast.key.type === "NumericLiteral" || ast.key.type === "StringLiteral" || ast.key.type === "Identifier")) {
  24848. delete newObj.key;
  24849. }
  24850. if (ast.type === "JSXElement" && ast.openingElement.name.name === "style" && ast.openingElement.attributes.some((attr) => attr.name.name === "jsx")) {
  24851. for (const {
  24852. type,
  24853. expression: expression2
  24854. } of newObj.children) {
  24855. if (type === "JSXExpressionContainer" && expression2.type === "TemplateLiteral") {
  24856. removeTemplateElementsValue(expression2);
  24857. }
  24858. }
  24859. }
  24860. if (ast.type === "JSXAttribute" && ast.name.name === "css" && ast.value.type === "JSXExpressionContainer" && ast.value.expression.type === "TemplateLiteral") {
  24861. removeTemplateElementsValue(newObj.value.expression);
  24862. }
  24863. if (ast.type === "JSXAttribute" && ast.value && ast.value.type === "Literal" && /["']|&quot;|&apos;/.test(ast.value.value)) {
  24864. newObj.value.value = newObj.value.value.replace(/["']|&quot;|&apos;/g, '"');
  24865. }
  24866. const expression = ast.expression || ast.callee;
  24867. if (ast.type === "Decorator" && expression.type === "CallExpression" && expression.callee.name === "Component" && expression.arguments.length === 1) {
  24868. const astProps = ast.expression.arguments[0].properties;
  24869. for (const [index, prop] of newObj.expression.arguments[0].properties.entries()) {
  24870. switch (astProps[index].key.name) {
  24871. case "styles":
  24872. if (prop.value.type === "ArrayExpression") {
  24873. removeTemplateElementsValue(prop.value.elements[0]);
  24874. }
  24875. break;
  24876. case "template":
  24877. if (prop.value.type === "TemplateLiteral") {
  24878. removeTemplateElementsValue(prop.value);
  24879. }
  24880. break;
  24881. }
  24882. }
  24883. }
  24884. if (ast.type === "TaggedTemplateExpression" && (ast.tag.type === "MemberExpression" || ast.tag.type === "Identifier" && (ast.tag.name === "gql" || ast.tag.name === "graphql" || ast.tag.name === "css" || ast.tag.name === "md" || ast.tag.name === "markdown" || ast.tag.name === "html") || ast.tag.type === "CallExpression")) {
  24885. removeTemplateElementsValue(newObj.quasi);
  24886. }
  24887. if (ast.type === "TemplateLiteral") {
  24888. const hasLanguageComment = ast.leadingComments && ast.leadingComments.some((comment) => isBlockComment(comment) && ["GraphQL", "HTML"].some((languageName) => comment.value === ` ${languageName} `));
  24889. if (hasLanguageComment || parent.type === "CallExpression" && parent.callee.name === "graphql" || !ast.leadingComments) {
  24890. removeTemplateElementsValue(newObj);
  24891. }
  24892. }
  24893. if (ast.type === "InterpreterDirective") {
  24894. newObj.value = newObj.value.trimEnd();
  24895. }
  24896. if ((ast.type === "TSIntersectionType" || ast.type === "TSUnionType") && ast.types.length === 1) {
  24897. return newObj.types[0];
  24898. }
  24899. }
  24900. clean.ignoredProperties = ignoredProperties;
  24901. module2.exports = clean;
  24902. }
  24903. });
  24904. var require_detect_newline = __commonJS2({
  24905. "node_modules/detect-newline/index.js"(exports2, module2) {
  24906. "use strict";
  24907. var detectNewline = (string) => {
  24908. if (typeof string !== "string") {
  24909. throw new TypeError("Expected a string");
  24910. }
  24911. const newlines = string.match(/(?:\r?\n)/g) || [];
  24912. if (newlines.length === 0) {
  24913. return;
  24914. }
  24915. const crlf = newlines.filter((newline) => newline === "\r\n").length;
  24916. const lf = newlines.length - crlf;
  24917. return crlf > lf ? "\r\n" : "\n";
  24918. };
  24919. module2.exports = detectNewline;
  24920. module2.exports.graceful = (string) => typeof string === "string" && detectNewline(string) || "\n";
  24921. }
  24922. });
  24923. var require_build = __commonJS2({
  24924. "node_modules/jest-docblock/build/index.js"(exports2) {
  24925. "use strict";
  24926. Object.defineProperty(exports2, "__esModule", {
  24927. value: true
  24928. });
  24929. exports2.extract = extract;
  24930. exports2.parse = parse;
  24931. exports2.parseWithComments = parseWithComments;
  24932. exports2.print = print;
  24933. exports2.strip = strip;
  24934. function _os() {
  24935. const data = require("os");
  24936. _os = function() {
  24937. return data;
  24938. };
  24939. return data;
  24940. }
  24941. function _detectNewline() {
  24942. const data = _interopRequireDefault(require_detect_newline());
  24943. _detectNewline = function() {
  24944. return data;
  24945. };
  24946. return data;
  24947. }
  24948. function _interopRequireDefault(obj) {
  24949. return obj && obj.__esModule ? obj : {
  24950. default: obj
  24951. };
  24952. }
  24953. var commentEndRe = /\*\/$/;
  24954. var commentStartRe = /^\/\*\*/;
  24955. var docblockRe = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/;
  24956. var lineCommentRe = /(^|\s+)\/\/([^\r\n]*)/g;
  24957. var ltrimNewlineRe = /^(\r?\n)+/;
  24958. var multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g;
  24959. var propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g;
  24960. var stringStartRe = /(\r?\n|^) *\* ?/g;
  24961. var STRING_ARRAY = [];
  24962. function extract(contents) {
  24963. const match = contents.match(docblockRe);
  24964. return match ? match[0].trimLeft() : "";
  24965. }
  24966. function strip(contents) {
  24967. const match = contents.match(docblockRe);
  24968. return match && match[0] ? contents.substring(match[0].length) : contents;
  24969. }
  24970. function parse(docblock) {
  24971. return parseWithComments(docblock).pragmas;
  24972. }
  24973. function parseWithComments(docblock) {
  24974. const line = (0, _detectNewline().default)(docblock) || _os().EOL;
  24975. docblock = docblock.replace(commentStartRe, "").replace(commentEndRe, "").replace(stringStartRe, "$1");
  24976. let prev = "";
  24977. while (prev !== docblock) {
  24978. prev = docblock;
  24979. docblock = docblock.replace(multilineRe, `${line}$1 $2${line}`);
  24980. }
  24981. docblock = docblock.replace(ltrimNewlineRe, "").trimRight();
  24982. const result = /* @__PURE__ */ Object.create(null);
  24983. const comments = docblock.replace(propertyRe, "").replace(ltrimNewlineRe, "").trimRight();
  24984. let match;
  24985. while (match = propertyRe.exec(docblock)) {
  24986. const nextPragma = match[2].replace(lineCommentRe, "");
  24987. if (typeof result[match[1]] === "string" || Array.isArray(result[match[1]])) {
  24988. result[match[1]] = STRING_ARRAY.concat(result[match[1]], nextPragma);
  24989. } else {
  24990. result[match[1]] = nextPragma;
  24991. }
  24992. }
  24993. return {
  24994. comments,
  24995. pragmas: result
  24996. };
  24997. }
  24998. function print({
  24999. comments = "",
  25000. pragmas = {}
  25001. }) {
  25002. const line = (0, _detectNewline().default)(comments) || _os().EOL;
  25003. const head = "/**";
  25004. const start = " *";
  25005. const tail = " */";
  25006. const keys = Object.keys(pragmas);
  25007. const printedObject = keys.map((key) => printKeyValues(key, pragmas[key])).reduce((arr, next) => arr.concat(next), []).map((keyValue) => start + " " + keyValue + line).join("");
  25008. if (!comments) {
  25009. if (keys.length === 0) {
  25010. return "";
  25011. }
  25012. if (keys.length === 1 && !Array.isArray(pragmas[keys[0]])) {
  25013. const value = pragmas[keys[0]];
  25014. return `${head} ${printKeyValues(keys[0], value)[0]}${tail}`;
  25015. }
  25016. }
  25017. const printedComments = comments.split(line).map((textLine) => `${start} ${textLine}`).join(line) + line;
  25018. return head + line + (comments ? printedComments : "") + (comments && keys.length ? start + line : "") + printedObject + tail;
  25019. }
  25020. function printKeyValues(key, valueOrArray) {
  25021. return STRING_ARRAY.concat(valueOrArray).map((value) => `@${key} ${value}`.trim());
  25022. }
  25023. }
  25024. });
  25025. var require_get_shebang = __commonJS2({
  25026. "src/language-js/utils/get-shebang.js"(exports2, module2) {
  25027. "use strict";
  25028. function getShebang(text) {
  25029. if (!text.startsWith("#!")) {
  25030. return "";
  25031. }
  25032. const index = text.indexOf("\n");
  25033. if (index === -1) {
  25034. return text;
  25035. }
  25036. return text.slice(0, index);
  25037. }
  25038. module2.exports = getShebang;
  25039. }
  25040. });
  25041. var require_pragma = __commonJS2({
  25042. "src/language-js/pragma.js"(exports2, module2) {
  25043. "use strict";
  25044. var {
  25045. parseWithComments,
  25046. strip,
  25047. extract,
  25048. print
  25049. } = require_build();
  25050. var {
  25051. normalizeEndOfLine
  25052. } = require_end_of_line();
  25053. var getShebang = require_get_shebang();
  25054. function parseDocBlock(text) {
  25055. const shebang = getShebang(text);
  25056. if (shebang) {
  25057. text = text.slice(shebang.length + 1);
  25058. }
  25059. const docBlock = extract(text);
  25060. const {
  25061. pragmas,
  25062. comments
  25063. } = parseWithComments(docBlock);
  25064. return {
  25065. shebang,
  25066. text,
  25067. pragmas,
  25068. comments
  25069. };
  25070. }
  25071. function hasPragma(text) {
  25072. const pragmas = Object.keys(parseDocBlock(text).pragmas);
  25073. return pragmas.includes("prettier") || pragmas.includes("format");
  25074. }
  25075. function insertPragma(originalText) {
  25076. const {
  25077. shebang,
  25078. text,
  25079. pragmas,
  25080. comments
  25081. } = parseDocBlock(originalText);
  25082. const strippedText = strip(text);
  25083. const docBlock = print({
  25084. pragmas: Object.assign({
  25085. format: ""
  25086. }, pragmas),
  25087. comments: comments.trimStart()
  25088. });
  25089. return (shebang ? `${shebang}
  25090. ` : "") + normalizeEndOfLine(docBlock) + (strippedText.startsWith("\n") ? "\n" : "\n\n") + strippedText;
  25091. }
  25092. module2.exports = {
  25093. hasPragma,
  25094. insertPragma
  25095. };
  25096. }
  25097. });
  25098. var require_comments2 = __commonJS2({
  25099. "src/language-js/comments.js"(exports2, module2) {
  25100. "use strict";
  25101. var {
  25102. getLast,
  25103. hasNewline,
  25104. getNextNonSpaceNonCommentCharacterIndexWithStartIndex,
  25105. getNextNonSpaceNonCommentCharacter,
  25106. hasNewlineInRange,
  25107. addLeadingComment,
  25108. addTrailingComment,
  25109. addDanglingComment,
  25110. getNextNonSpaceNonCommentCharacterIndex,
  25111. isNonEmptyArray
  25112. } = require_util();
  25113. var {
  25114. getFunctionParameters,
  25115. isPrettierIgnoreComment,
  25116. isJsxNode,
  25117. hasFlowShorthandAnnotationComment,
  25118. hasFlowAnnotationComment,
  25119. hasIgnoreComment,
  25120. isCallLikeExpression,
  25121. getCallArguments,
  25122. isCallExpression,
  25123. isMemberExpression,
  25124. isObjectProperty,
  25125. isLineComment,
  25126. getComments,
  25127. CommentCheckFlags,
  25128. markerForIfWithoutBlockAndSameLineComment
  25129. } = require_utils7();
  25130. var {
  25131. locStart,
  25132. locEnd
  25133. } = require_loc();
  25134. var isBlockComment = require_is_block_comment();
  25135. function handleOwnLineComment(context) {
  25136. return [handleIgnoreComments, handleLastFunctionArgComments, handleMemberExpressionComments, handleIfStatementComments, handleWhileComments, handleTryStatementComments, handleClassComments, handleImportSpecifierComments, handleForComments, handleUnionTypeComments, handleOnlyComments, handleImportDeclarationComments, handleAssignmentPatternComments, handleMethodNameComments, handleLabeledStatementComments, handleBreakAndContinueStatementComments].some((fn) => fn(context));
  25137. }
  25138. function handleEndOfLineComment(context) {
  25139. return [handleClosureTypeCastComments, handleLastFunctionArgComments, handleConditionalExpressionComments, handleImportSpecifierComments, handleIfStatementComments, handleWhileComments, handleTryStatementComments, handleClassComments, handleLabeledStatementComments, handleCallExpressionComments, handlePropertyComments, handleOnlyComments, handleVariableDeclaratorComments, handleBreakAndContinueStatementComments, handleSwitchDefaultCaseComments].some((fn) => fn(context));
  25140. }
  25141. function handleRemainingComment(context) {
  25142. return [handleIgnoreComments, handleIfStatementComments, handleWhileComments, handleObjectPropertyAssignment, handleCommentInEmptyParens, handleMethodNameComments, handleOnlyComments, handleCommentAfterArrowParams, handleFunctionNameComments, handleTSMappedTypeComments, handleBreakAndContinueStatementComments, handleTSFunctionTrailingComments].some((fn) => fn(context));
  25143. }
  25144. function addBlockStatementFirstComment(node, comment) {
  25145. const firstNonEmptyNode = (node.body || node.properties).find(({
  25146. type
  25147. }) => type !== "EmptyStatement");
  25148. if (firstNonEmptyNode) {
  25149. addLeadingComment(firstNonEmptyNode, comment);
  25150. } else {
  25151. addDanglingComment(node, comment);
  25152. }
  25153. }
  25154. function addBlockOrNotComment(node, comment) {
  25155. if (node.type === "BlockStatement") {
  25156. addBlockStatementFirstComment(node, comment);
  25157. } else {
  25158. addLeadingComment(node, comment);
  25159. }
  25160. }
  25161. function handleClosureTypeCastComments({
  25162. comment,
  25163. followingNode
  25164. }) {
  25165. if (followingNode && isTypeCastComment(comment)) {
  25166. addLeadingComment(followingNode, comment);
  25167. return true;
  25168. }
  25169. return false;
  25170. }
  25171. function handleIfStatementComments({
  25172. comment,
  25173. precedingNode,
  25174. enclosingNode,
  25175. followingNode,
  25176. text
  25177. }) {
  25178. if (!enclosingNode || enclosingNode.type !== "IfStatement" || !followingNode) {
  25179. return false;
  25180. }
  25181. const nextCharacter = getNextNonSpaceNonCommentCharacter(text, comment, locEnd);
  25182. if (nextCharacter === ")") {
  25183. addTrailingComment(precedingNode, comment);
  25184. return true;
  25185. }
  25186. if (precedingNode === enclosingNode.consequent && followingNode === enclosingNode.alternate) {
  25187. if (precedingNode.type === "BlockStatement") {
  25188. addTrailingComment(precedingNode, comment);
  25189. } else {
  25190. const isSingleLineComment = comment.type === "SingleLine" || comment.loc.start.line === comment.loc.end.line;
  25191. const isSameLineComment = comment.loc.start.line === precedingNode.loc.start.line;
  25192. if (isSingleLineComment && isSameLineComment) {
  25193. addDanglingComment(precedingNode, comment, markerForIfWithoutBlockAndSameLineComment);
  25194. } else {
  25195. addDanglingComment(enclosingNode, comment);
  25196. }
  25197. }
  25198. return true;
  25199. }
  25200. if (followingNode.type === "BlockStatement") {
  25201. addBlockStatementFirstComment(followingNode, comment);
  25202. return true;
  25203. }
  25204. if (followingNode.type === "IfStatement") {
  25205. addBlockOrNotComment(followingNode.consequent, comment);
  25206. return true;
  25207. }
  25208. if (enclosingNode.consequent === followingNode) {
  25209. addLeadingComment(followingNode, comment);
  25210. return true;
  25211. }
  25212. return false;
  25213. }
  25214. function handleWhileComments({
  25215. comment,
  25216. precedingNode,
  25217. enclosingNode,
  25218. followingNode,
  25219. text
  25220. }) {
  25221. if (!enclosingNode || enclosingNode.type !== "WhileStatement" || !followingNode) {
  25222. return false;
  25223. }
  25224. const nextCharacter = getNextNonSpaceNonCommentCharacter(text, comment, locEnd);
  25225. if (nextCharacter === ")") {
  25226. addTrailingComment(precedingNode, comment);
  25227. return true;
  25228. }
  25229. if (followingNode.type === "BlockStatement") {
  25230. addBlockStatementFirstComment(followingNode, comment);
  25231. return true;
  25232. }
  25233. if (enclosingNode.body === followingNode) {
  25234. addLeadingComment(followingNode, comment);
  25235. return true;
  25236. }
  25237. return false;
  25238. }
  25239. function handleTryStatementComments({
  25240. comment,
  25241. precedingNode,
  25242. enclosingNode,
  25243. followingNode
  25244. }) {
  25245. if (!enclosingNode || enclosingNode.type !== "TryStatement" && enclosingNode.type !== "CatchClause" || !followingNode) {
  25246. return false;
  25247. }
  25248. if (enclosingNode.type === "CatchClause" && precedingNode) {
  25249. addTrailingComment(precedingNode, comment);
  25250. return true;
  25251. }
  25252. if (followingNode.type === "BlockStatement") {
  25253. addBlockStatementFirstComment(followingNode, comment);
  25254. return true;
  25255. }
  25256. if (followingNode.type === "TryStatement") {
  25257. addBlockOrNotComment(followingNode.finalizer, comment);
  25258. return true;
  25259. }
  25260. if (followingNode.type === "CatchClause") {
  25261. addBlockOrNotComment(followingNode.body, comment);
  25262. return true;
  25263. }
  25264. return false;
  25265. }
  25266. function handleMemberExpressionComments({
  25267. comment,
  25268. enclosingNode,
  25269. followingNode
  25270. }) {
  25271. if (isMemberExpression(enclosingNode) && followingNode && followingNode.type === "Identifier") {
  25272. addLeadingComment(enclosingNode, comment);
  25273. return true;
  25274. }
  25275. return false;
  25276. }
  25277. function handleConditionalExpressionComments({
  25278. comment,
  25279. precedingNode,
  25280. enclosingNode,
  25281. followingNode,
  25282. text
  25283. }) {
  25284. const isSameLineAsPrecedingNode = precedingNode && !hasNewlineInRange(text, locEnd(precedingNode), locStart(comment));
  25285. if ((!precedingNode || !isSameLineAsPrecedingNode) && enclosingNode && (enclosingNode.type === "ConditionalExpression" || enclosingNode.type === "TSConditionalType") && followingNode) {
  25286. addLeadingComment(followingNode, comment);
  25287. return true;
  25288. }
  25289. return false;
  25290. }
  25291. function handleObjectPropertyAssignment({
  25292. comment,
  25293. precedingNode,
  25294. enclosingNode
  25295. }) {
  25296. if (isObjectProperty(enclosingNode) && enclosingNode.shorthand && enclosingNode.key === precedingNode && enclosingNode.value.type === "AssignmentPattern") {
  25297. addTrailingComment(enclosingNode.value.left, comment);
  25298. return true;
  25299. }
  25300. return false;
  25301. }
  25302. function handleClassComments({
  25303. comment,
  25304. precedingNode,
  25305. enclosingNode,
  25306. followingNode
  25307. }) {
  25308. if (enclosingNode && (enclosingNode.type === "ClassDeclaration" || enclosingNode.type === "ClassExpression" || enclosingNode.type === "DeclareClass" || enclosingNode.type === "DeclareInterface" || enclosingNode.type === "InterfaceDeclaration" || enclosingNode.type === "TSInterfaceDeclaration")) {
  25309. if (isNonEmptyArray(enclosingNode.decorators) && !(followingNode && followingNode.type === "Decorator")) {
  25310. addTrailingComment(getLast(enclosingNode.decorators), comment);
  25311. return true;
  25312. }
  25313. if (enclosingNode.body && followingNode === enclosingNode.body) {
  25314. addBlockStatementFirstComment(enclosingNode.body, comment);
  25315. return true;
  25316. }
  25317. if (followingNode) {
  25318. if (enclosingNode.superClass && followingNode === enclosingNode.superClass && precedingNode && (precedingNode === enclosingNode.id || precedingNode === enclosingNode.typeParameters)) {
  25319. addTrailingComment(precedingNode, comment);
  25320. return true;
  25321. }
  25322. for (const prop of ["implements", "extends", "mixins"]) {
  25323. if (enclosingNode[prop] && followingNode === enclosingNode[prop][0]) {
  25324. if (precedingNode && (precedingNode === enclosingNode.id || precedingNode === enclosingNode.typeParameters || precedingNode === enclosingNode.superClass)) {
  25325. addTrailingComment(precedingNode, comment);
  25326. } else {
  25327. addDanglingComment(enclosingNode, comment, prop);
  25328. }
  25329. return true;
  25330. }
  25331. }
  25332. }
  25333. }
  25334. return false;
  25335. }
  25336. function handleMethodNameComments({
  25337. comment,
  25338. precedingNode,
  25339. enclosingNode,
  25340. text
  25341. }) {
  25342. if (enclosingNode && precedingNode && getNextNonSpaceNonCommentCharacter(text, comment, locEnd) === "(" && (enclosingNode.type === "Property" || enclosingNode.type === "TSDeclareMethod" || enclosingNode.type === "TSAbstractMethodDefinition") && precedingNode.type === "Identifier" && enclosingNode.key === precedingNode && getNextNonSpaceNonCommentCharacter(text, precedingNode, locEnd) !== ":") {
  25343. addTrailingComment(precedingNode, comment);
  25344. return true;
  25345. }
  25346. if (precedingNode && enclosingNode && precedingNode.type === "Decorator" && (enclosingNode.type === "ClassMethod" || enclosingNode.type === "ClassProperty" || enclosingNode.type === "PropertyDefinition" || enclosingNode.type === "TSAbstractPropertyDefinition" || enclosingNode.type === "TSAbstractMethodDefinition" || enclosingNode.type === "TSDeclareMethod" || enclosingNode.type === "MethodDefinition")) {
  25347. addTrailingComment(precedingNode, comment);
  25348. return true;
  25349. }
  25350. return false;
  25351. }
  25352. function handleFunctionNameComments({
  25353. comment,
  25354. precedingNode,
  25355. enclosingNode,
  25356. text
  25357. }) {
  25358. if (getNextNonSpaceNonCommentCharacter(text, comment, locEnd) !== "(") {
  25359. return false;
  25360. }
  25361. if (precedingNode && enclosingNode && (enclosingNode.type === "FunctionDeclaration" || enclosingNode.type === "FunctionExpression" || enclosingNode.type === "ClassMethod" || enclosingNode.type === "MethodDefinition" || enclosingNode.type === "ObjectMethod")) {
  25362. addTrailingComment(precedingNode, comment);
  25363. return true;
  25364. }
  25365. return false;
  25366. }
  25367. function handleCommentAfterArrowParams({
  25368. comment,
  25369. enclosingNode,
  25370. text
  25371. }) {
  25372. if (!(enclosingNode && enclosingNode.type === "ArrowFunctionExpression")) {
  25373. return false;
  25374. }
  25375. const index = getNextNonSpaceNonCommentCharacterIndex(text, comment, locEnd);
  25376. if (index !== false && text.slice(index, index + 2) === "=>") {
  25377. addDanglingComment(enclosingNode, comment);
  25378. return true;
  25379. }
  25380. return false;
  25381. }
  25382. function handleCommentInEmptyParens({
  25383. comment,
  25384. enclosingNode,
  25385. text
  25386. }) {
  25387. if (getNextNonSpaceNonCommentCharacter(text, comment, locEnd) !== ")") {
  25388. return false;
  25389. }
  25390. if (enclosingNode && (isRealFunctionLikeNode(enclosingNode) && getFunctionParameters(enclosingNode).length === 0 || isCallLikeExpression(enclosingNode) && getCallArguments(enclosingNode).length === 0)) {
  25391. addDanglingComment(enclosingNode, comment);
  25392. return true;
  25393. }
  25394. if (enclosingNode && (enclosingNode.type === "MethodDefinition" || enclosingNode.type === "TSAbstractMethodDefinition") && getFunctionParameters(enclosingNode.value).length === 0) {
  25395. addDanglingComment(enclosingNode.value, comment);
  25396. return true;
  25397. }
  25398. return false;
  25399. }
  25400. function handleLastFunctionArgComments({
  25401. comment,
  25402. precedingNode,
  25403. enclosingNode,
  25404. followingNode,
  25405. text
  25406. }) {
  25407. if (precedingNode && precedingNode.type === "FunctionTypeParam" && enclosingNode && enclosingNode.type === "FunctionTypeAnnotation" && followingNode && followingNode.type !== "FunctionTypeParam") {
  25408. addTrailingComment(precedingNode, comment);
  25409. return true;
  25410. }
  25411. if (precedingNode && (precedingNode.type === "Identifier" || precedingNode.type === "AssignmentPattern") && enclosingNode && isRealFunctionLikeNode(enclosingNode) && getNextNonSpaceNonCommentCharacter(text, comment, locEnd) === ")") {
  25412. addTrailingComment(precedingNode, comment);
  25413. return true;
  25414. }
  25415. if (enclosingNode && enclosingNode.type === "FunctionDeclaration" && followingNode && followingNode.type === "BlockStatement") {
  25416. const functionParamRightParenIndex = (() => {
  25417. const parameters = getFunctionParameters(enclosingNode);
  25418. if (parameters.length > 0) {
  25419. return getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(getLast(parameters)));
  25420. }
  25421. const functionParamLeftParenIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(enclosingNode.id));
  25422. return functionParamLeftParenIndex !== false && getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, functionParamLeftParenIndex + 1);
  25423. })();
  25424. if (locStart(comment) > functionParamRightParenIndex) {
  25425. addBlockStatementFirstComment(followingNode, comment);
  25426. return true;
  25427. }
  25428. }
  25429. return false;
  25430. }
  25431. function handleImportSpecifierComments({
  25432. comment,
  25433. enclosingNode
  25434. }) {
  25435. if (enclosingNode && enclosingNode.type === "ImportSpecifier") {
  25436. addLeadingComment(enclosingNode, comment);
  25437. return true;
  25438. }
  25439. return false;
  25440. }
  25441. function handleLabeledStatementComments({
  25442. comment,
  25443. enclosingNode
  25444. }) {
  25445. if (enclosingNode && enclosingNode.type === "LabeledStatement") {
  25446. addLeadingComment(enclosingNode, comment);
  25447. return true;
  25448. }
  25449. return false;
  25450. }
  25451. function handleBreakAndContinueStatementComments({
  25452. comment,
  25453. enclosingNode
  25454. }) {
  25455. if (enclosingNode && (enclosingNode.type === "ContinueStatement" || enclosingNode.type === "BreakStatement") && !enclosingNode.label) {
  25456. addTrailingComment(enclosingNode, comment);
  25457. return true;
  25458. }
  25459. return false;
  25460. }
  25461. function handleCallExpressionComments({
  25462. comment,
  25463. precedingNode,
  25464. enclosingNode
  25465. }) {
  25466. if (isCallExpression(enclosingNode) && precedingNode && enclosingNode.callee === precedingNode && enclosingNode.arguments.length > 0) {
  25467. addLeadingComment(enclosingNode.arguments[0], comment);
  25468. return true;
  25469. }
  25470. return false;
  25471. }
  25472. function handleUnionTypeComments({
  25473. comment,
  25474. precedingNode,
  25475. enclosingNode,
  25476. followingNode
  25477. }) {
  25478. if (enclosingNode && (enclosingNode.type === "UnionTypeAnnotation" || enclosingNode.type === "TSUnionType")) {
  25479. if (isPrettierIgnoreComment(comment)) {
  25480. followingNode.prettierIgnore = true;
  25481. comment.unignore = true;
  25482. }
  25483. if (precedingNode) {
  25484. addTrailingComment(precedingNode, comment);
  25485. return true;
  25486. }
  25487. return false;
  25488. }
  25489. if (followingNode && (followingNode.type === "UnionTypeAnnotation" || followingNode.type === "TSUnionType") && isPrettierIgnoreComment(comment)) {
  25490. followingNode.types[0].prettierIgnore = true;
  25491. comment.unignore = true;
  25492. }
  25493. return false;
  25494. }
  25495. function handlePropertyComments({
  25496. comment,
  25497. enclosingNode
  25498. }) {
  25499. if (isObjectProperty(enclosingNode)) {
  25500. addLeadingComment(enclosingNode, comment);
  25501. return true;
  25502. }
  25503. return false;
  25504. }
  25505. function handleOnlyComments({
  25506. comment,
  25507. enclosingNode,
  25508. followingNode,
  25509. ast,
  25510. isLastComment
  25511. }) {
  25512. if (ast && ast.body && ast.body.length === 0) {
  25513. if (isLastComment) {
  25514. addDanglingComment(ast, comment);
  25515. } else {
  25516. addLeadingComment(ast, comment);
  25517. }
  25518. return true;
  25519. }
  25520. if (enclosingNode && enclosingNode.type === "Program" && enclosingNode.body.length === 0 && !isNonEmptyArray(enclosingNode.directives)) {
  25521. if (isLastComment) {
  25522. addDanglingComment(enclosingNode, comment);
  25523. } else {
  25524. addLeadingComment(enclosingNode, comment);
  25525. }
  25526. return true;
  25527. }
  25528. if (followingNode && followingNode.type === "Program" && followingNode.body.length === 0 && enclosingNode && enclosingNode.type === "ModuleExpression") {
  25529. addDanglingComment(followingNode, comment);
  25530. return true;
  25531. }
  25532. return false;
  25533. }
  25534. function handleForComments({
  25535. comment,
  25536. enclosingNode
  25537. }) {
  25538. if (enclosingNode && (enclosingNode.type === "ForInStatement" || enclosingNode.type === "ForOfStatement")) {
  25539. addLeadingComment(enclosingNode, comment);
  25540. return true;
  25541. }
  25542. return false;
  25543. }
  25544. function handleImportDeclarationComments({
  25545. comment,
  25546. precedingNode,
  25547. enclosingNode,
  25548. text
  25549. }) {
  25550. if (precedingNode && precedingNode.type === "ImportSpecifier" && enclosingNode && enclosingNode.type === "ImportDeclaration" && hasNewline(text, locEnd(comment))) {
  25551. addTrailingComment(precedingNode, comment);
  25552. return true;
  25553. }
  25554. return false;
  25555. }
  25556. function handleAssignmentPatternComments({
  25557. comment,
  25558. enclosingNode
  25559. }) {
  25560. if (enclosingNode && enclosingNode.type === "AssignmentPattern") {
  25561. addLeadingComment(enclosingNode, comment);
  25562. return true;
  25563. }
  25564. return false;
  25565. }
  25566. function handleVariableDeclaratorComments({
  25567. comment,
  25568. enclosingNode,
  25569. followingNode
  25570. }) {
  25571. if (enclosingNode && (enclosingNode.type === "VariableDeclarator" || enclosingNode.type === "AssignmentExpression" || enclosingNode.type === "TypeAlias" || enclosingNode.type === "TSTypeAliasDeclaration") && followingNode && (followingNode.type === "ObjectExpression" || followingNode.type === "ArrayExpression" || followingNode.type === "TemplateLiteral" || followingNode.type === "TaggedTemplateExpression" || followingNode.type === "ObjectTypeAnnotation" || followingNode.type === "TSTypeLiteral" || isBlockComment(comment))) {
  25572. addLeadingComment(followingNode, comment);
  25573. return true;
  25574. }
  25575. return false;
  25576. }
  25577. function handleTSFunctionTrailingComments({
  25578. comment,
  25579. enclosingNode,
  25580. followingNode,
  25581. text
  25582. }) {
  25583. if (!followingNode && enclosingNode && (enclosingNode.type === "TSMethodSignature" || enclosingNode.type === "TSDeclareFunction" || enclosingNode.type === "TSAbstractMethodDefinition") && getNextNonSpaceNonCommentCharacter(text, comment, locEnd) === ";") {
  25584. addTrailingComment(enclosingNode, comment);
  25585. return true;
  25586. }
  25587. return false;
  25588. }
  25589. function handleIgnoreComments({
  25590. comment,
  25591. enclosingNode,
  25592. followingNode
  25593. }) {
  25594. if (isPrettierIgnoreComment(comment) && enclosingNode && enclosingNode.type === "TSMappedType" && followingNode && followingNode.type === "TSTypeParameter" && followingNode.constraint) {
  25595. enclosingNode.prettierIgnore = true;
  25596. comment.unignore = true;
  25597. return true;
  25598. }
  25599. }
  25600. function handleTSMappedTypeComments({
  25601. comment,
  25602. precedingNode,
  25603. enclosingNode,
  25604. followingNode
  25605. }) {
  25606. if (!enclosingNode || enclosingNode.type !== "TSMappedType") {
  25607. return false;
  25608. }
  25609. if (followingNode && followingNode.type === "TSTypeParameter" && followingNode.name) {
  25610. addLeadingComment(followingNode.name, comment);
  25611. return true;
  25612. }
  25613. if (precedingNode && precedingNode.type === "TSTypeParameter" && precedingNode.constraint) {
  25614. addTrailingComment(precedingNode.constraint, comment);
  25615. return true;
  25616. }
  25617. return false;
  25618. }
  25619. function handleSwitchDefaultCaseComments({
  25620. comment,
  25621. enclosingNode,
  25622. followingNode
  25623. }) {
  25624. if (!enclosingNode || enclosingNode.type !== "SwitchCase" || enclosingNode.test) {
  25625. return false;
  25626. }
  25627. if (followingNode.type === "BlockStatement" && isLineComment(comment)) {
  25628. addBlockStatementFirstComment(followingNode, comment);
  25629. } else {
  25630. addDanglingComment(enclosingNode, comment);
  25631. }
  25632. return true;
  25633. }
  25634. function isRealFunctionLikeNode(node) {
  25635. return node.type === "ArrowFunctionExpression" || node.type === "FunctionExpression" || node.type === "FunctionDeclaration" || node.type === "ObjectMethod" || node.type === "ClassMethod" || node.type === "TSDeclareFunction" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSMethodSignature" || node.type === "TSConstructorType" || node.type === "TSFunctionType" || node.type === "TSDeclareMethod";
  25636. }
  25637. function getCommentChildNodes(node, options) {
  25638. if ((options.parser === "typescript" || options.parser === "flow" || options.parser === "acorn" || options.parser === "espree" || options.parser === "meriyah" || options.parser === "__babel_estree") && node.type === "MethodDefinition" && node.value && node.value.type === "FunctionExpression" && getFunctionParameters(node.value).length === 0 && !node.value.returnType && !isNonEmptyArray(node.value.typeParameters) && node.value.body) {
  25639. return [...node.decorators || [], node.key, node.value.body];
  25640. }
  25641. }
  25642. function isTypeCastComment(comment) {
  25643. return isBlockComment(comment) && comment.value[0] === "*" && /@type\b/.test(comment.value);
  25644. }
  25645. function willPrintOwnComments(path) {
  25646. const node = path.getValue();
  25647. const parent = path.getParentNode();
  25648. const hasFlowAnnotations = (node2) => hasFlowAnnotationComment(getComments(node2, CommentCheckFlags.Leading)) || hasFlowAnnotationComment(getComments(node2, CommentCheckFlags.Trailing));
  25649. return (node && (isJsxNode(node) || hasFlowShorthandAnnotationComment(node) || isCallExpression(parent) && hasFlowAnnotations(node)) || parent && (parent.type === "JSXSpreadAttribute" || parent.type === "JSXSpreadChild" || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType" || (parent.type === "ClassDeclaration" || parent.type === "ClassExpression") && parent.superClass === node)) && (!hasIgnoreComment(path) || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType");
  25650. }
  25651. module2.exports = {
  25652. handleOwnLineComment,
  25653. handleEndOfLineComment,
  25654. handleRemainingComment,
  25655. isTypeCastComment,
  25656. getCommentChildNodes,
  25657. willPrintOwnComments
  25658. };
  25659. }
  25660. });
  25661. var require_needs_parens = __commonJS2({
  25662. "src/language-js/needs-parens.js"(exports2, module2) {
  25663. "use strict";
  25664. var getLast = require_get_last();
  25665. var isNonEmptyArray = require_is_non_empty_array();
  25666. var {
  25667. getFunctionParameters,
  25668. getLeftSidePathName,
  25669. hasFlowShorthandAnnotationComment,
  25670. hasNakedLeftSide,
  25671. hasNode,
  25672. isBitwiseOperator,
  25673. startsWithNoLookaheadToken,
  25674. shouldFlatten,
  25675. getPrecedence,
  25676. isCallExpression,
  25677. isMemberExpression,
  25678. isObjectProperty
  25679. } = require_utils7();
  25680. function needsParens(path, options) {
  25681. const parent = path.getParentNode();
  25682. if (!parent) {
  25683. return false;
  25684. }
  25685. const name = path.getName();
  25686. const node = path.getNode();
  25687. if (options.__isInHtmlInterpolation && !options.bracketSpacing && endsWithRightBracket(node) && isFollowedByRightBracket(path)) {
  25688. return true;
  25689. }
  25690. if (isStatement(node)) {
  25691. return false;
  25692. }
  25693. if (options.parser !== "flow" && hasFlowShorthandAnnotationComment(path.getValue())) {
  25694. return true;
  25695. }
  25696. if (node.type === "Identifier") {
  25697. if (node.extra && node.extra.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(node.name)) {
  25698. return true;
  25699. }
  25700. if (name === "left" && node.name === "async" && parent.type === "ForOfStatement" && !parent.await) {
  25701. return true;
  25702. }
  25703. return false;
  25704. }
  25705. switch (parent.type) {
  25706. case "ParenthesizedExpression":
  25707. return false;
  25708. case "ClassDeclaration":
  25709. case "ClassExpression": {
  25710. if (name === "superClass" && (node.type === "ArrowFunctionExpression" || node.type === "AssignmentExpression" || node.type === "AwaitExpression" || node.type === "BinaryExpression" || node.type === "ConditionalExpression" || node.type === "LogicalExpression" || node.type === "NewExpression" || node.type === "ObjectExpression" || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "UnaryExpression" || node.type === "UpdateExpression" || node.type === "YieldExpression" || node.type === "TSNonNullExpression")) {
  25711. return true;
  25712. }
  25713. break;
  25714. }
  25715. case "ExportDefaultDeclaration": {
  25716. return shouldWrapFunctionForExportDefault(path, options) || node.type === "SequenceExpression";
  25717. }
  25718. case "Decorator": {
  25719. if (name === "expression") {
  25720. let hasCallExpression = false;
  25721. let hasMemberExpression = false;
  25722. let current = node;
  25723. while (current) {
  25724. switch (current.type) {
  25725. case "MemberExpression":
  25726. hasMemberExpression = true;
  25727. current = current.object;
  25728. break;
  25729. case "CallExpression":
  25730. if (hasMemberExpression || hasCallExpression) {
  25731. return options.parser !== "typescript";
  25732. }
  25733. hasCallExpression = true;
  25734. current = current.callee;
  25735. break;
  25736. case "Identifier":
  25737. return false;
  25738. case "TaggedTemplateExpression":
  25739. return options.parser !== "typescript";
  25740. default:
  25741. return true;
  25742. }
  25743. }
  25744. return true;
  25745. }
  25746. break;
  25747. }
  25748. case "ExpressionStatement": {
  25749. if (startsWithNoLookaheadToken(node, true)) {
  25750. return true;
  25751. }
  25752. break;
  25753. }
  25754. case "ArrowFunctionExpression": {
  25755. if (name === "body" && node.type !== "SequenceExpression" && startsWithNoLookaheadToken(node, false)) {
  25756. return true;
  25757. }
  25758. break;
  25759. }
  25760. }
  25761. switch (node.type) {
  25762. case "UpdateExpression":
  25763. if (parent.type === "UnaryExpression") {
  25764. return node.prefix && (node.operator === "++" && parent.operator === "+" || node.operator === "--" && parent.operator === "-");
  25765. }
  25766. case "UnaryExpression":
  25767. switch (parent.type) {
  25768. case "UnaryExpression":
  25769. return node.operator === parent.operator && (node.operator === "+" || node.operator === "-");
  25770. case "BindExpression":
  25771. return true;
  25772. case "MemberExpression":
  25773. case "OptionalMemberExpression":
  25774. return name === "object";
  25775. case "TaggedTemplateExpression":
  25776. return true;
  25777. case "NewExpression":
  25778. case "CallExpression":
  25779. case "OptionalCallExpression":
  25780. return name === "callee";
  25781. case "BinaryExpression":
  25782. return name === "left" && parent.operator === "**";
  25783. case "TSNonNullExpression":
  25784. return true;
  25785. default:
  25786. return false;
  25787. }
  25788. case "BinaryExpression": {
  25789. if (parent.type === "UpdateExpression") {
  25790. return true;
  25791. }
  25792. if (node.operator === "in" && isPathInForStatementInitializer(path)) {
  25793. return true;
  25794. }
  25795. if (node.operator === "|>" && node.extra && node.extra.parenthesized) {
  25796. const grandParent = path.getParentNode(1);
  25797. if (grandParent.type === "BinaryExpression" && grandParent.operator === "|>") {
  25798. return true;
  25799. }
  25800. }
  25801. }
  25802. case "TSTypeAssertion":
  25803. case "TSAsExpression":
  25804. case "LogicalExpression":
  25805. switch (parent.type) {
  25806. case "TSAsExpression":
  25807. return node.type !== "TSAsExpression";
  25808. case "ConditionalExpression":
  25809. return node.type === "TSAsExpression";
  25810. case "CallExpression":
  25811. case "NewExpression":
  25812. case "OptionalCallExpression":
  25813. return name === "callee";
  25814. case "ClassExpression":
  25815. case "ClassDeclaration":
  25816. return name === "superClass";
  25817. case "TSTypeAssertion":
  25818. case "TaggedTemplateExpression":
  25819. case "UnaryExpression":
  25820. case "JSXSpreadAttribute":
  25821. case "SpreadElement":
  25822. case "SpreadProperty":
  25823. case "BindExpression":
  25824. case "AwaitExpression":
  25825. case "TSNonNullExpression":
  25826. case "UpdateExpression":
  25827. return true;
  25828. case "MemberExpression":
  25829. case "OptionalMemberExpression":
  25830. return name === "object";
  25831. case "AssignmentExpression":
  25832. case "AssignmentPattern":
  25833. return name === "left" && (node.type === "TSTypeAssertion" || node.type === "TSAsExpression");
  25834. case "LogicalExpression":
  25835. if (node.type === "LogicalExpression") {
  25836. return parent.operator !== node.operator;
  25837. }
  25838. case "BinaryExpression": {
  25839. const {
  25840. operator,
  25841. type
  25842. } = node;
  25843. if (!operator && type !== "TSTypeAssertion") {
  25844. return true;
  25845. }
  25846. const precedence = getPrecedence(operator);
  25847. const parentOperator = parent.operator;
  25848. const parentPrecedence = getPrecedence(parentOperator);
  25849. if (parentPrecedence > precedence) {
  25850. return true;
  25851. }
  25852. if (name === "right" && parentPrecedence === precedence) {
  25853. return true;
  25854. }
  25855. if (parentPrecedence === precedence && !shouldFlatten(parentOperator, operator)) {
  25856. return true;
  25857. }
  25858. if (parentPrecedence < precedence && operator === "%") {
  25859. return parentOperator === "+" || parentOperator === "-";
  25860. }
  25861. if (isBitwiseOperator(parentOperator)) {
  25862. return true;
  25863. }
  25864. return false;
  25865. }
  25866. default:
  25867. return false;
  25868. }
  25869. case "SequenceExpression":
  25870. switch (parent.type) {
  25871. case "ReturnStatement":
  25872. return false;
  25873. case "ForStatement":
  25874. return false;
  25875. case "ExpressionStatement":
  25876. return name !== "expression";
  25877. case "ArrowFunctionExpression":
  25878. return name !== "body";
  25879. default:
  25880. return true;
  25881. }
  25882. case "YieldExpression":
  25883. if (parent.type === "UnaryExpression" || parent.type === "AwaitExpression" || parent.type === "TSAsExpression" || parent.type === "TSNonNullExpression") {
  25884. return true;
  25885. }
  25886. case "AwaitExpression":
  25887. switch (parent.type) {
  25888. case "TaggedTemplateExpression":
  25889. case "UnaryExpression":
  25890. case "LogicalExpression":
  25891. case "SpreadElement":
  25892. case "SpreadProperty":
  25893. case "TSAsExpression":
  25894. case "TSNonNullExpression":
  25895. case "BindExpression":
  25896. return true;
  25897. case "MemberExpression":
  25898. case "OptionalMemberExpression":
  25899. return name === "object";
  25900. case "NewExpression":
  25901. case "CallExpression":
  25902. case "OptionalCallExpression":
  25903. return name === "callee";
  25904. case "ConditionalExpression":
  25905. return name === "test";
  25906. case "BinaryExpression": {
  25907. if (!node.argument && parent.operator === "|>") {
  25908. return false;
  25909. }
  25910. return true;
  25911. }
  25912. default:
  25913. return false;
  25914. }
  25915. case "TSConditionalType":
  25916. if (name === "extendsType" && parent.type === "TSConditionalType") {
  25917. return true;
  25918. }
  25919. case "TSFunctionType":
  25920. case "TSConstructorType":
  25921. if (name === "checkType" && parent.type === "TSConditionalType") {
  25922. return true;
  25923. }
  25924. case "TSUnionType":
  25925. case "TSIntersectionType":
  25926. if ((parent.type === "TSUnionType" || parent.type === "TSIntersectionType") && parent.types.length > 1 && (!node.types || node.types.length > 1)) {
  25927. return true;
  25928. }
  25929. case "TSInferType":
  25930. if (node.type === "TSInferType" && parent.type === "TSRestType") {
  25931. return false;
  25932. }
  25933. case "TSTypeOperator":
  25934. return parent.type === "TSArrayType" || parent.type === "TSOptionalType" || parent.type === "TSRestType" || name === "objectType" && parent.type === "TSIndexedAccessType" || parent.type === "TSTypeOperator" || parent.type === "TSTypeAnnotation" && path.getParentNode(1).type.startsWith("TSJSDoc");
  25935. case "ArrayTypeAnnotation":
  25936. return parent.type === "NullableTypeAnnotation";
  25937. case "IntersectionTypeAnnotation":
  25938. case "UnionTypeAnnotation":
  25939. return parent.type === "ArrayTypeAnnotation" || parent.type === "NullableTypeAnnotation" || parent.type === "IntersectionTypeAnnotation" || parent.type === "UnionTypeAnnotation" || name === "objectType" && (parent.type === "IndexedAccessType" || parent.type === "OptionalIndexedAccessType");
  25940. case "NullableTypeAnnotation":
  25941. return parent.type === "ArrayTypeAnnotation" || name === "objectType" && (parent.type === "IndexedAccessType" || parent.type === "OptionalIndexedAccessType");
  25942. case "FunctionTypeAnnotation": {
  25943. const ancestor = parent.type === "NullableTypeAnnotation" ? path.getParentNode(1) : parent;
  25944. return ancestor.type === "UnionTypeAnnotation" || ancestor.type === "IntersectionTypeAnnotation" || ancestor.type === "ArrayTypeAnnotation" || name === "objectType" && (ancestor.type === "IndexedAccessType" || ancestor.type === "OptionalIndexedAccessType") || ancestor.type === "NullableTypeAnnotation" || parent.type === "FunctionTypeParam" && parent.name === null && getFunctionParameters(node).some((param) => param.typeAnnotation && param.typeAnnotation.type === "NullableTypeAnnotation");
  25945. }
  25946. case "OptionalIndexedAccessType":
  25947. return name === "objectType" && parent.type === "IndexedAccessType";
  25948. case "TypeofTypeAnnotation":
  25949. return name === "objectType" && (parent.type === "IndexedAccessType" || parent.type === "OptionalIndexedAccessType");
  25950. case "StringLiteral":
  25951. case "NumericLiteral":
  25952. case "Literal":
  25953. if (typeof node.value === "string" && parent.type === "ExpressionStatement" && !parent.directive) {
  25954. const grandParent = path.getParentNode(1);
  25955. return grandParent.type === "Program" || grandParent.type === "BlockStatement";
  25956. }
  25957. return name === "object" && parent.type === "MemberExpression" && typeof node.value === "number";
  25958. case "AssignmentExpression": {
  25959. const grandParent = path.getParentNode(1);
  25960. if (name === "body" && parent.type === "ArrowFunctionExpression") {
  25961. return true;
  25962. }
  25963. if (name === "key" && (parent.type === "ClassProperty" || parent.type === "PropertyDefinition") && parent.computed) {
  25964. return false;
  25965. }
  25966. if ((name === "init" || name === "update") && parent.type === "ForStatement") {
  25967. return false;
  25968. }
  25969. if (parent.type === "ExpressionStatement") {
  25970. return node.left.type === "ObjectPattern";
  25971. }
  25972. if (name === "key" && parent.type === "TSPropertySignature") {
  25973. return false;
  25974. }
  25975. if (parent.type === "AssignmentExpression") {
  25976. return false;
  25977. }
  25978. if (parent.type === "SequenceExpression" && grandParent && grandParent.type === "ForStatement" && (grandParent.init === parent || grandParent.update === parent)) {
  25979. return false;
  25980. }
  25981. if (name === "value" && parent.type === "Property" && grandParent && grandParent.type === "ObjectPattern" && grandParent.properties.includes(parent)) {
  25982. return false;
  25983. }
  25984. if (parent.type === "NGChainedExpression") {
  25985. return false;
  25986. }
  25987. return true;
  25988. }
  25989. case "ConditionalExpression":
  25990. switch (parent.type) {
  25991. case "TaggedTemplateExpression":
  25992. case "UnaryExpression":
  25993. case "SpreadElement":
  25994. case "SpreadProperty":
  25995. case "BinaryExpression":
  25996. case "LogicalExpression":
  25997. case "NGPipeExpression":
  25998. case "ExportDefaultDeclaration":
  25999. case "AwaitExpression":
  26000. case "JSXSpreadAttribute":
  26001. case "TSTypeAssertion":
  26002. case "TypeCastExpression":
  26003. case "TSAsExpression":
  26004. case "TSNonNullExpression":
  26005. return true;
  26006. case "NewExpression":
  26007. case "CallExpression":
  26008. case "OptionalCallExpression":
  26009. return name === "callee";
  26010. case "ConditionalExpression":
  26011. return name === "test";
  26012. case "MemberExpression":
  26013. case "OptionalMemberExpression":
  26014. return name === "object";
  26015. default:
  26016. return false;
  26017. }
  26018. case "FunctionExpression":
  26019. switch (parent.type) {
  26020. case "NewExpression":
  26021. case "CallExpression":
  26022. case "OptionalCallExpression":
  26023. return name === "callee";
  26024. case "TaggedTemplateExpression":
  26025. return true;
  26026. default:
  26027. return false;
  26028. }
  26029. case "ArrowFunctionExpression":
  26030. switch (parent.type) {
  26031. case "BinaryExpression":
  26032. return parent.operator !== "|>" || node.extra && node.extra.parenthesized;
  26033. case "NewExpression":
  26034. case "CallExpression":
  26035. case "OptionalCallExpression":
  26036. return name === "callee";
  26037. case "MemberExpression":
  26038. case "OptionalMemberExpression":
  26039. return name === "object";
  26040. case "TSAsExpression":
  26041. case "TSNonNullExpression":
  26042. case "BindExpression":
  26043. case "TaggedTemplateExpression":
  26044. case "UnaryExpression":
  26045. case "LogicalExpression":
  26046. case "AwaitExpression":
  26047. case "TSTypeAssertion":
  26048. return true;
  26049. case "ConditionalExpression":
  26050. return name === "test";
  26051. default:
  26052. return false;
  26053. }
  26054. case "ClassExpression":
  26055. if (isNonEmptyArray(node.decorators)) {
  26056. return true;
  26057. }
  26058. switch (parent.type) {
  26059. case "NewExpression":
  26060. return name === "callee";
  26061. default:
  26062. return false;
  26063. }
  26064. case "OptionalMemberExpression":
  26065. case "OptionalCallExpression": {
  26066. const parentParent = path.getParentNode(1);
  26067. if (name === "object" && parent.type === "MemberExpression" || name === "callee" && (parent.type === "CallExpression" || parent.type === "NewExpression") || parent.type === "TSNonNullExpression" && parentParent.type === "MemberExpression" && parentParent.object === parent) {
  26068. return true;
  26069. }
  26070. }
  26071. case "CallExpression":
  26072. case "MemberExpression":
  26073. case "TaggedTemplateExpression":
  26074. case "TSNonNullExpression":
  26075. if (name === "callee" && (parent.type === "BindExpression" || parent.type === "NewExpression")) {
  26076. let object = node;
  26077. while (object) {
  26078. switch (object.type) {
  26079. case "CallExpression":
  26080. case "OptionalCallExpression":
  26081. return true;
  26082. case "MemberExpression":
  26083. case "OptionalMemberExpression":
  26084. case "BindExpression":
  26085. object = object.object;
  26086. break;
  26087. case "TaggedTemplateExpression":
  26088. object = object.tag;
  26089. break;
  26090. case "TSNonNullExpression":
  26091. object = object.expression;
  26092. break;
  26093. default:
  26094. return false;
  26095. }
  26096. }
  26097. }
  26098. return false;
  26099. case "BindExpression":
  26100. return name === "callee" && (parent.type === "BindExpression" || parent.type === "NewExpression") || name === "object" && isMemberExpression(parent);
  26101. case "NGPipeExpression":
  26102. if (parent.type === "NGRoot" || parent.type === "NGMicrosyntaxExpression" || parent.type === "ObjectProperty" && !(node.extra && node.extra.parenthesized) || parent.type === "ArrayExpression" || isCallExpression(parent) && parent.arguments[name] === node || name === "right" && parent.type === "NGPipeExpression" || name === "property" && parent.type === "MemberExpression" || parent.type === "AssignmentExpression") {
  26103. return false;
  26104. }
  26105. return true;
  26106. case "JSXFragment":
  26107. case "JSXElement":
  26108. return name === "callee" || name === "left" && parent.type === "BinaryExpression" && parent.operator === "<" || parent.type !== "ArrayExpression" && parent.type !== "ArrowFunctionExpression" && parent.type !== "AssignmentExpression" && parent.type !== "AssignmentPattern" && parent.type !== "BinaryExpression" && parent.type !== "NewExpression" && parent.type !== "ConditionalExpression" && parent.type !== "ExpressionStatement" && parent.type !== "JsExpressionRoot" && parent.type !== "JSXAttribute" && parent.type !== "JSXElement" && parent.type !== "JSXExpressionContainer" && parent.type !== "JSXFragment" && parent.type !== "LogicalExpression" && !isCallExpression(parent) && !isObjectProperty(parent) && parent.type !== "ReturnStatement" && parent.type !== "ThrowStatement" && parent.type !== "TypeCastExpression" && parent.type !== "VariableDeclarator" && parent.type !== "YieldExpression";
  26109. case "TypeAnnotation":
  26110. return name === "returnType" && parent.type === "ArrowFunctionExpression" && includesFunctionTypeInObjectType(node);
  26111. }
  26112. return false;
  26113. }
  26114. function isStatement(node) {
  26115. return node.type === "BlockStatement" || node.type === "BreakStatement" || node.type === "ClassBody" || node.type === "ClassDeclaration" || node.type === "ClassMethod" || node.type === "ClassProperty" || node.type === "PropertyDefinition" || node.type === "ClassPrivateProperty" || node.type === "ContinueStatement" || node.type === "DebuggerStatement" || node.type === "DeclareClass" || node.type === "DeclareExportAllDeclaration" || node.type === "DeclareExportDeclaration" || node.type === "DeclareFunction" || node.type === "DeclareInterface" || node.type === "DeclareModule" || node.type === "DeclareModuleExports" || node.type === "DeclareVariable" || node.type === "DoWhileStatement" || node.type === "EnumDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportDefaultDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExpressionStatement" || node.type === "ForInStatement" || node.type === "ForOfStatement" || node.type === "ForStatement" || node.type === "FunctionDeclaration" || node.type === "IfStatement" || node.type === "ImportDeclaration" || node.type === "InterfaceDeclaration" || node.type === "LabeledStatement" || node.type === "MethodDefinition" || node.type === "ReturnStatement" || node.type === "SwitchStatement" || node.type === "ThrowStatement" || node.type === "TryStatement" || node.type === "TSDeclareFunction" || node.type === "TSEnumDeclaration" || node.type === "TSImportEqualsDeclaration" || node.type === "TSInterfaceDeclaration" || node.type === "TSModuleDeclaration" || node.type === "TSNamespaceExportDeclaration" || node.type === "TypeAlias" || node.type === "VariableDeclaration" || node.type === "WhileStatement" || node.type === "WithStatement";
  26116. }
  26117. function isPathInForStatementInitializer(path) {
  26118. let i = 0;
  26119. let node = path.getValue();
  26120. while (node) {
  26121. const parent = path.getParentNode(i++);
  26122. if (parent && parent.type === "ForStatement" && parent.init === node) {
  26123. return true;
  26124. }
  26125. node = parent;
  26126. }
  26127. return false;
  26128. }
  26129. function includesFunctionTypeInObjectType(node) {
  26130. return hasNode(node, (n1) => n1.type === "ObjectTypeAnnotation" && hasNode(n1, (n2) => n2.type === "FunctionTypeAnnotation" || void 0) || void 0);
  26131. }
  26132. function endsWithRightBracket(node) {
  26133. switch (node.type) {
  26134. case "ObjectExpression":
  26135. return true;
  26136. default:
  26137. return false;
  26138. }
  26139. }
  26140. function isFollowedByRightBracket(path) {
  26141. const node = path.getValue();
  26142. const parent = path.getParentNode();
  26143. const name = path.getName();
  26144. switch (parent.type) {
  26145. case "NGPipeExpression":
  26146. if (typeof name === "number" && parent.arguments[name] === node && parent.arguments.length - 1 === name) {
  26147. return path.callParent(isFollowedByRightBracket);
  26148. }
  26149. break;
  26150. case "ObjectProperty":
  26151. if (name === "value") {
  26152. const parentParent = path.getParentNode(1);
  26153. return getLast(parentParent.properties) === parent;
  26154. }
  26155. break;
  26156. case "BinaryExpression":
  26157. case "LogicalExpression":
  26158. if (name === "right") {
  26159. return path.callParent(isFollowedByRightBracket);
  26160. }
  26161. break;
  26162. case "ConditionalExpression":
  26163. if (name === "alternate") {
  26164. return path.callParent(isFollowedByRightBracket);
  26165. }
  26166. break;
  26167. case "UnaryExpression":
  26168. if (parent.prefix) {
  26169. return path.callParent(isFollowedByRightBracket);
  26170. }
  26171. break;
  26172. }
  26173. return false;
  26174. }
  26175. function shouldWrapFunctionForExportDefault(path, options) {
  26176. const node = path.getValue();
  26177. const parent = path.getParentNode();
  26178. if (node.type === "FunctionExpression" || node.type === "ClassExpression") {
  26179. return parent.type === "ExportDefaultDeclaration" || !needsParens(path, options);
  26180. }
  26181. if (!hasNakedLeftSide(node) || parent.type !== "ExportDefaultDeclaration" && needsParens(path, options)) {
  26182. return false;
  26183. }
  26184. return path.call((childPath) => shouldWrapFunctionForExportDefault(childPath, options), ...getLeftSidePathName(path, node));
  26185. }
  26186. module2.exports = needsParens;
  26187. }
  26188. });
  26189. var require_print_preprocess = __commonJS2({
  26190. "src/language-js/print-preprocess.js"(exports2, module2) {
  26191. "use strict";
  26192. function preprocess(ast, options) {
  26193. switch (options.parser) {
  26194. case "json":
  26195. case "json5":
  26196. case "json-stringify":
  26197. case "__js_expression":
  26198. case "__vue_expression":
  26199. return Object.assign(Object.assign({}, ast), {}, {
  26200. type: options.parser.startsWith("__") ? "JsExpressionRoot" : "JsonRoot",
  26201. node: ast,
  26202. comments: [],
  26203. rootMarker: options.rootMarker
  26204. });
  26205. default:
  26206. return ast;
  26207. }
  26208. }
  26209. module2.exports = preprocess;
  26210. }
  26211. });
  26212. var require_html_binding = __commonJS2({
  26213. "src/language-js/print/html-binding.js"(exports2, module2) {
  26214. "use strict";
  26215. var {
  26216. builders: {
  26217. join,
  26218. line,
  26219. group,
  26220. softline,
  26221. indent
  26222. }
  26223. } = require("./doc.js");
  26224. function printHtmlBinding(path, options, print) {
  26225. const node = path.getValue();
  26226. if (options.__onHtmlBindingRoot && path.getName() === null) {
  26227. options.__onHtmlBindingRoot(node, options);
  26228. }
  26229. if (node.type !== "File") {
  26230. return;
  26231. }
  26232. if (options.__isVueForBindingLeft) {
  26233. return path.call((functionDeclarationPath) => {
  26234. const printed = join([",", line], functionDeclarationPath.map(print, "params"));
  26235. const {
  26236. params
  26237. } = functionDeclarationPath.getValue();
  26238. if (params.length === 1) {
  26239. return printed;
  26240. }
  26241. return ["(", indent([softline, group(printed)]), softline, ")"];
  26242. }, "program", "body", 0);
  26243. }
  26244. if (options.__isVueBindings) {
  26245. return path.call((functionDeclarationPath) => join([",", line], functionDeclarationPath.map(print, "params")), "program", "body", 0);
  26246. }
  26247. }
  26248. function isVueEventBindingExpression(node) {
  26249. switch (node.type) {
  26250. case "MemberExpression":
  26251. switch (node.property.type) {
  26252. case "Identifier":
  26253. case "NumericLiteral":
  26254. case "StringLiteral":
  26255. return isVueEventBindingExpression(node.object);
  26256. }
  26257. return false;
  26258. case "Identifier":
  26259. return true;
  26260. default:
  26261. return false;
  26262. }
  26263. }
  26264. module2.exports = {
  26265. isVueEventBindingExpression,
  26266. printHtmlBinding
  26267. };
  26268. }
  26269. });
  26270. var require_binaryish = __commonJS2({
  26271. "src/language-js/print/binaryish.js"(exports2, module2) {
  26272. "use strict";
  26273. var {
  26274. printComments
  26275. } = require_comments();
  26276. var {
  26277. getLast
  26278. } = require_util();
  26279. var {
  26280. builders: {
  26281. join,
  26282. line,
  26283. softline,
  26284. group,
  26285. indent,
  26286. align,
  26287. ifBreak,
  26288. indentIfBreak
  26289. },
  26290. utils: {
  26291. cleanDoc,
  26292. getDocParts,
  26293. isConcat
  26294. }
  26295. } = require("./doc.js");
  26296. var {
  26297. hasLeadingOwnLineComment,
  26298. isBinaryish,
  26299. isJsxNode,
  26300. shouldFlatten,
  26301. hasComment,
  26302. CommentCheckFlags,
  26303. isCallExpression,
  26304. isMemberExpression,
  26305. isObjectProperty,
  26306. isEnabledHackPipeline
  26307. } = require_utils7();
  26308. var uid = 0;
  26309. function printBinaryishExpression(path, options, print) {
  26310. const node = path.getValue();
  26311. const parent = path.getParentNode();
  26312. const parentParent = path.getParentNode(1);
  26313. const isInsideParenthesis = node !== parent.body && (parent.type === "IfStatement" || parent.type === "WhileStatement" || parent.type === "SwitchStatement" || parent.type === "DoWhileStatement");
  26314. const isHackPipeline = isEnabledHackPipeline(options) && node.operator === "|>";
  26315. const parts = printBinaryishExpressions(path, print, options, false, isInsideParenthesis);
  26316. if (isInsideParenthesis) {
  26317. return parts;
  26318. }
  26319. if (isHackPipeline) {
  26320. return group(parts);
  26321. }
  26322. if (isCallExpression(parent) && parent.callee === node || parent.type === "UnaryExpression" || isMemberExpression(parent) && !parent.computed) {
  26323. return group([indent([softline, ...parts]), softline]);
  26324. }
  26325. const shouldNotIndent = parent.type === "ReturnStatement" || parent.type === "ThrowStatement" || parent.type === "JSXExpressionContainer" && parentParent.type === "JSXAttribute" || node.operator !== "|" && parent.type === "JsExpressionRoot" || node.type !== "NGPipeExpression" && (parent.type === "NGRoot" && options.parser === "__ng_binding" || parent.type === "NGMicrosyntaxExpression" && parentParent.type === "NGMicrosyntax" && parentParent.body.length === 1) || node === parent.body && parent.type === "ArrowFunctionExpression" || node !== parent.body && parent.type === "ForStatement" || parent.type === "ConditionalExpression" && parentParent.type !== "ReturnStatement" && parentParent.type !== "ThrowStatement" && !isCallExpression(parentParent) || parent.type === "TemplateLiteral";
  26326. const shouldIndentIfInlining = parent.type === "AssignmentExpression" || parent.type === "VariableDeclarator" || parent.type === "ClassProperty" || parent.type === "PropertyDefinition" || parent.type === "TSAbstractPropertyDefinition" || parent.type === "ClassPrivateProperty" || isObjectProperty(parent);
  26327. const samePrecedenceSubExpression = isBinaryish(node.left) && shouldFlatten(node.operator, node.left.operator);
  26328. if (shouldNotIndent || shouldInlineLogicalExpression(node) && !samePrecedenceSubExpression || !shouldInlineLogicalExpression(node) && shouldIndentIfInlining) {
  26329. return group(parts);
  26330. }
  26331. if (parts.length === 0) {
  26332. return "";
  26333. }
  26334. const hasJsx = isJsxNode(node.right);
  26335. const firstGroupIndex = parts.findIndex((part) => typeof part !== "string" && !Array.isArray(part) && part.type === "group");
  26336. const headParts = parts.slice(0, firstGroupIndex === -1 ? 1 : firstGroupIndex + 1);
  26337. const rest = parts.slice(headParts.length, hasJsx ? -1 : void 0);
  26338. const groupId = Symbol("logicalChain-" + ++uid);
  26339. const chain = group([...headParts, indent(rest)], {
  26340. id: groupId
  26341. });
  26342. if (!hasJsx) {
  26343. return chain;
  26344. }
  26345. const jsxPart = getLast(parts);
  26346. return group([chain, indentIfBreak(jsxPart, {
  26347. groupId
  26348. })]);
  26349. }
  26350. function printBinaryishExpressions(path, print, options, isNested, isInsideParenthesis) {
  26351. const node = path.getValue();
  26352. if (!isBinaryish(node)) {
  26353. return [group(print())];
  26354. }
  26355. let parts = [];
  26356. if (shouldFlatten(node.operator, node.left.operator)) {
  26357. parts = path.call((left) => printBinaryishExpressions(left, print, options, true, isInsideParenthesis), "left");
  26358. } else {
  26359. parts.push(group(print("left")));
  26360. }
  26361. const shouldInline = shouldInlineLogicalExpression(node);
  26362. const lineBeforeOperator = (node.operator === "|>" || node.type === "NGPipeExpression" || node.operator === "|" && options.parser === "__vue_expression") && !hasLeadingOwnLineComment(options.originalText, node.right);
  26363. const operator = node.type === "NGPipeExpression" ? "|" : node.operator;
  26364. const rightSuffix = node.type === "NGPipeExpression" && node.arguments.length > 0 ? group(indent([softline, ": ", join([softline, ":", ifBreak(" ")], path.map(print, "arguments").map((arg) => align(2, group(arg))))])) : "";
  26365. let right;
  26366. if (shouldInline) {
  26367. right = [operator, " ", print("right"), rightSuffix];
  26368. } else {
  26369. const isHackPipeline = isEnabledHackPipeline(options) && operator === "|>";
  26370. const rightContent = isHackPipeline ? path.call((left) => printBinaryishExpressions(left, print, options, true, isInsideParenthesis), "right") : print("right");
  26371. right = [lineBeforeOperator ? line : "", operator, lineBeforeOperator ? " " : line, rightContent, rightSuffix];
  26372. }
  26373. const parent = path.getParentNode();
  26374. const shouldBreak = hasComment(node.left, CommentCheckFlags.Trailing | CommentCheckFlags.Line);
  26375. const shouldGroup = shouldBreak || !(isInsideParenthesis && node.type === "LogicalExpression") && parent.type !== node.type && node.left.type !== node.type && node.right.type !== node.type;
  26376. parts.push(lineBeforeOperator ? "" : " ", shouldGroup ? group(right, {
  26377. shouldBreak
  26378. }) : right);
  26379. if (isNested && hasComment(node)) {
  26380. const printed = cleanDoc(printComments(path, parts, options));
  26381. if (isConcat(printed) || printed.type === "fill") {
  26382. return getDocParts(printed);
  26383. }
  26384. return [printed];
  26385. }
  26386. return parts;
  26387. }
  26388. function shouldInlineLogicalExpression(node) {
  26389. if (node.type !== "LogicalExpression") {
  26390. return false;
  26391. }
  26392. if (node.right.type === "ObjectExpression" && node.right.properties.length > 0) {
  26393. return true;
  26394. }
  26395. if (node.right.type === "ArrayExpression" && node.right.elements.length > 0) {
  26396. return true;
  26397. }
  26398. if (isJsxNode(node.right)) {
  26399. return true;
  26400. }
  26401. return false;
  26402. }
  26403. module2.exports = {
  26404. printBinaryishExpression,
  26405. shouldInlineLogicalExpression
  26406. };
  26407. }
  26408. });
  26409. var require_angular = __commonJS2({
  26410. "src/language-js/print/angular.js"(exports2, module2) {
  26411. "use strict";
  26412. var {
  26413. builders: {
  26414. join,
  26415. line,
  26416. group
  26417. }
  26418. } = require("./doc.js");
  26419. var {
  26420. hasNode,
  26421. hasComment,
  26422. getComments
  26423. } = require_utils7();
  26424. var {
  26425. printBinaryishExpression
  26426. } = require_binaryish();
  26427. function printAngular(path, options, print) {
  26428. const node = path.getValue();
  26429. if (!node.type.startsWith("NG")) {
  26430. return;
  26431. }
  26432. switch (node.type) {
  26433. case "NGRoot":
  26434. return [print("node"), !hasComment(node.node) ? "" : " //" + getComments(node.node)[0].value.trimEnd()];
  26435. case "NGPipeExpression":
  26436. return printBinaryishExpression(path, options, print);
  26437. case "NGChainedExpression":
  26438. return group(join([";", line], path.map((childPath) => hasNgSideEffect(childPath) ? print() : ["(", print(), ")"], "expressions")));
  26439. case "NGEmptyExpression":
  26440. return "";
  26441. case "NGQuotedExpression":
  26442. return [node.prefix, ": ", node.value.trim()];
  26443. case "NGMicrosyntax":
  26444. return path.map((childPath, index) => [index === 0 ? "" : isNgForOf(childPath.getValue(), index, node) ? " " : [";", line], print()], "body");
  26445. case "NGMicrosyntaxKey":
  26446. return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/i.test(node.name) ? node.name : JSON.stringify(node.name);
  26447. case "NGMicrosyntaxExpression":
  26448. return [print("expression"), node.alias === null ? "" : [" as ", print("alias")]];
  26449. case "NGMicrosyntaxKeyedExpression": {
  26450. const index = path.getName();
  26451. const parentNode = path.getParentNode();
  26452. const shouldNotPrintColon = isNgForOf(node, index, parentNode) || (index === 1 && (node.key.name === "then" || node.key.name === "else") || index === 2 && node.key.name === "else" && parentNode.body[index - 1].type === "NGMicrosyntaxKeyedExpression" && parentNode.body[index - 1].key.name === "then") && parentNode.body[0].type === "NGMicrosyntaxExpression";
  26453. return [print("key"), shouldNotPrintColon ? " " : ": ", print("expression")];
  26454. }
  26455. case "NGMicrosyntaxLet":
  26456. return ["let ", print("key"), node.value === null ? "" : [" = ", print("value")]];
  26457. case "NGMicrosyntaxAs":
  26458. return [print("key"), " as ", print("alias")];
  26459. default:
  26460. throw new Error(`Unknown Angular node type: ${JSON.stringify(node.type)}.`);
  26461. }
  26462. }
  26463. function isNgForOf(node, index, parentNode) {
  26464. return node.type === "NGMicrosyntaxKeyedExpression" && node.key.name === "of" && index === 1 && parentNode.body[0].type === "NGMicrosyntaxLet" && parentNode.body[0].value === null;
  26465. }
  26466. function hasNgSideEffect(path) {
  26467. return hasNode(path.getValue(), (node) => {
  26468. switch (node.type) {
  26469. case void 0:
  26470. return false;
  26471. case "CallExpression":
  26472. case "OptionalCallExpression":
  26473. case "AssignmentExpression":
  26474. return true;
  26475. }
  26476. });
  26477. }
  26478. module2.exports = {
  26479. printAngular
  26480. };
  26481. }
  26482. });
  26483. var require_jsx = __commonJS2({
  26484. "src/language-js/print/jsx.js"(exports2, module2) {
  26485. "use strict";
  26486. var {
  26487. printComments,
  26488. printDanglingComments
  26489. } = require_comments();
  26490. var {
  26491. builders: {
  26492. line,
  26493. hardline,
  26494. softline,
  26495. group,
  26496. indent,
  26497. conditionalGroup,
  26498. fill,
  26499. ifBreak,
  26500. lineSuffixBoundary,
  26501. join
  26502. },
  26503. utils: {
  26504. willBreak
  26505. }
  26506. } = require("./doc.js");
  26507. var {
  26508. getLast,
  26509. getPreferredQuote
  26510. } = require_util();
  26511. var {
  26512. isJsxNode,
  26513. rawText,
  26514. isLiteral,
  26515. isCallExpression,
  26516. isStringLiteral,
  26517. isBinaryish,
  26518. hasComment,
  26519. CommentCheckFlags,
  26520. hasNodeIgnoreComment
  26521. } = require_utils7();
  26522. var pathNeedsParens = require_needs_parens();
  26523. var {
  26524. willPrintOwnComments
  26525. } = require_comments2();
  26526. var isEmptyStringOrAnyLine = (doc2) => doc2 === "" || doc2 === line || doc2 === hardline || doc2 === softline;
  26527. function printJsxElementInternal(path, options, print) {
  26528. const node = path.getValue();
  26529. if (node.type === "JSXElement" && isEmptyJsxElement(node)) {
  26530. return [print("openingElement"), print("closingElement")];
  26531. }
  26532. const openingLines = node.type === "JSXElement" ? print("openingElement") : print("openingFragment");
  26533. const closingLines = node.type === "JSXElement" ? print("closingElement") : print("closingFragment");
  26534. if (node.children.length === 1 && node.children[0].type === "JSXExpressionContainer" && (node.children[0].expression.type === "TemplateLiteral" || node.children[0].expression.type === "TaggedTemplateExpression")) {
  26535. return [openingLines, ...path.map(print, "children"), closingLines];
  26536. }
  26537. node.children = node.children.map((child) => {
  26538. if (isJsxWhitespaceExpression(child)) {
  26539. return {
  26540. type: "JSXText",
  26541. value: " ",
  26542. raw: " "
  26543. };
  26544. }
  26545. return child;
  26546. });
  26547. const containsTag = node.children.some(isJsxNode);
  26548. const containsMultipleExpressions = node.children.filter((child) => child.type === "JSXExpressionContainer").length > 1;
  26549. const containsMultipleAttributes = node.type === "JSXElement" && node.openingElement.attributes.length > 1;
  26550. let forcedBreak = willBreak(openingLines) || containsTag || containsMultipleAttributes || containsMultipleExpressions;
  26551. const isMdxBlock = path.getParentNode().rootMarker === "mdx";
  26552. const rawJsxWhitespace = options.singleQuote ? "{' '}" : '{" "}';
  26553. const jsxWhitespace = isMdxBlock ? " " : ifBreak([rawJsxWhitespace, softline], " ");
  26554. const isFacebookTranslationTag = node.openingElement && node.openingElement.name && node.openingElement.name.name === "fbt";
  26555. const children = printJsxChildren(path, options, print, jsxWhitespace, isFacebookTranslationTag);
  26556. const containsText = node.children.some((child) => isMeaningfulJsxText(child));
  26557. for (let i = children.length - 2; i >= 0; i--) {
  26558. const isPairOfEmptyStrings = children[i] === "" && children[i + 1] === "";
  26559. const isPairOfHardlines = children[i] === hardline && children[i + 1] === "" && children[i + 2] === hardline;
  26560. const isLineFollowedByJsxWhitespace = (children[i] === softline || children[i] === hardline) && children[i + 1] === "" && children[i + 2] === jsxWhitespace;
  26561. const isJsxWhitespaceFollowedByLine = children[i] === jsxWhitespace && children[i + 1] === "" && (children[i + 2] === softline || children[i + 2] === hardline);
  26562. const isDoubleJsxWhitespace = children[i] === jsxWhitespace && children[i + 1] === "" && children[i + 2] === jsxWhitespace;
  26563. const isPairOfHardOrSoftLines = children[i] === softline && children[i + 1] === "" && children[i + 2] === hardline || children[i] === hardline && children[i + 1] === "" && children[i + 2] === softline;
  26564. if (isPairOfHardlines && containsText || isPairOfEmptyStrings || isLineFollowedByJsxWhitespace || isDoubleJsxWhitespace || isPairOfHardOrSoftLines) {
  26565. children.splice(i, 2);
  26566. } else if (isJsxWhitespaceFollowedByLine) {
  26567. children.splice(i + 1, 2);
  26568. }
  26569. }
  26570. while (children.length > 0 && isEmptyStringOrAnyLine(getLast(children))) {
  26571. children.pop();
  26572. }
  26573. while (children.length > 1 && isEmptyStringOrAnyLine(children[0]) && isEmptyStringOrAnyLine(children[1])) {
  26574. children.shift();
  26575. children.shift();
  26576. }
  26577. const multilineChildren = [];
  26578. for (const [i, child] of children.entries()) {
  26579. if (child === jsxWhitespace) {
  26580. if (i === 1 && children[i - 1] === "") {
  26581. if (children.length === 2) {
  26582. multilineChildren.push(rawJsxWhitespace);
  26583. continue;
  26584. }
  26585. multilineChildren.push([rawJsxWhitespace, hardline]);
  26586. continue;
  26587. } else if (i === children.length - 1) {
  26588. multilineChildren.push(rawJsxWhitespace);
  26589. continue;
  26590. } else if (children[i - 1] === "" && children[i - 2] === hardline) {
  26591. multilineChildren.push(rawJsxWhitespace);
  26592. continue;
  26593. }
  26594. }
  26595. multilineChildren.push(child);
  26596. if (willBreak(child)) {
  26597. forcedBreak = true;
  26598. }
  26599. }
  26600. const content = containsText ? fill(multilineChildren) : group(multilineChildren, {
  26601. shouldBreak: true
  26602. });
  26603. if (isMdxBlock) {
  26604. return content;
  26605. }
  26606. const multiLineElem = group([openingLines, indent([hardline, content]), hardline, closingLines]);
  26607. if (forcedBreak) {
  26608. return multiLineElem;
  26609. }
  26610. return conditionalGroup([group([openingLines, ...children, closingLines]), multiLineElem]);
  26611. }
  26612. function printJsxChildren(path, options, print, jsxWhitespace, isFacebookTranslationTag) {
  26613. const parts = [];
  26614. path.each((childPath, i, children) => {
  26615. const child = childPath.getValue();
  26616. if (isLiteral(child)) {
  26617. const text = rawText(child);
  26618. if (isMeaningfulJsxText(child)) {
  26619. const words = text.split(matchJsxWhitespaceRegex);
  26620. if (words[0] === "") {
  26621. parts.push("");
  26622. words.shift();
  26623. if (/\n/.test(words[0])) {
  26624. const next = children[i + 1];
  26625. parts.push(separatorWithWhitespace(isFacebookTranslationTag, words[1], child, next));
  26626. } else {
  26627. parts.push(jsxWhitespace);
  26628. }
  26629. words.shift();
  26630. }
  26631. let endWhitespace;
  26632. if (getLast(words) === "") {
  26633. words.pop();
  26634. endWhitespace = words.pop();
  26635. }
  26636. if (words.length === 0) {
  26637. return;
  26638. }
  26639. for (const [i2, word] of words.entries()) {
  26640. if (i2 % 2 === 1) {
  26641. parts.push(line);
  26642. } else {
  26643. parts.push(word);
  26644. }
  26645. }
  26646. if (endWhitespace !== void 0) {
  26647. if (/\n/.test(endWhitespace)) {
  26648. const next = children[i + 1];
  26649. parts.push(separatorWithWhitespace(isFacebookTranslationTag, getLast(parts), child, next));
  26650. } else {
  26651. parts.push(jsxWhitespace);
  26652. }
  26653. } else {
  26654. const next = children[i + 1];
  26655. parts.push(separatorNoWhitespace(isFacebookTranslationTag, getLast(parts), child, next));
  26656. }
  26657. } else if (/\n/.test(text)) {
  26658. if (text.match(/\n/g).length > 1) {
  26659. parts.push("", hardline);
  26660. }
  26661. } else {
  26662. parts.push("", jsxWhitespace);
  26663. }
  26664. } else {
  26665. const printedChild = print();
  26666. parts.push(printedChild);
  26667. const next = children[i + 1];
  26668. const directlyFollowedByMeaningfulText = next && isMeaningfulJsxText(next);
  26669. if (directlyFollowedByMeaningfulText) {
  26670. const firstWord = trimJsxWhitespace(rawText(next)).split(matchJsxWhitespaceRegex)[0];
  26671. parts.push(separatorNoWhitespace(isFacebookTranslationTag, firstWord, child, next));
  26672. } else {
  26673. parts.push(hardline);
  26674. }
  26675. }
  26676. }, "children");
  26677. return parts;
  26678. }
  26679. function separatorNoWhitespace(isFacebookTranslationTag, child, childNode, nextNode) {
  26680. if (isFacebookTranslationTag) {
  26681. return "";
  26682. }
  26683. if (childNode.type === "JSXElement" && !childNode.closingElement || nextNode && nextNode.type === "JSXElement" && !nextNode.closingElement) {
  26684. return child.length === 1 ? softline : hardline;
  26685. }
  26686. return softline;
  26687. }
  26688. function separatorWithWhitespace(isFacebookTranslationTag, child, childNode, nextNode) {
  26689. if (isFacebookTranslationTag) {
  26690. return hardline;
  26691. }
  26692. if (child.length === 1) {
  26693. return childNode.type === "JSXElement" && !childNode.closingElement || nextNode && nextNode.type === "JSXElement" && !nextNode.closingElement ? hardline : softline;
  26694. }
  26695. return hardline;
  26696. }
  26697. function maybeWrapJsxElementInParens(path, elem, options) {
  26698. const parent = path.getParentNode();
  26699. if (!parent) {
  26700. return elem;
  26701. }
  26702. const NO_WRAP_PARENTS = {
  26703. ArrayExpression: true,
  26704. JSXAttribute: true,
  26705. JSXElement: true,
  26706. JSXExpressionContainer: true,
  26707. JSXFragment: true,
  26708. ExpressionStatement: true,
  26709. CallExpression: true,
  26710. OptionalCallExpression: true,
  26711. ConditionalExpression: true,
  26712. JsExpressionRoot: true
  26713. };
  26714. if (NO_WRAP_PARENTS[parent.type]) {
  26715. return elem;
  26716. }
  26717. const shouldBreak = path.match(void 0, (node) => node.type === "ArrowFunctionExpression", isCallExpression, (node) => node.type === "JSXExpressionContainer");
  26718. const needsParens = pathNeedsParens(path, options);
  26719. return group([needsParens ? "" : ifBreak("("), indent([softline, elem]), softline, needsParens ? "" : ifBreak(")")], {
  26720. shouldBreak
  26721. });
  26722. }
  26723. function printJsxAttribute(path, options, print) {
  26724. const node = path.getValue();
  26725. const parts = [];
  26726. parts.push(print("name"));
  26727. if (node.value) {
  26728. let res;
  26729. if (isStringLiteral(node.value)) {
  26730. const raw = rawText(node.value);
  26731. let final = raw.slice(1, -1).replace(/&apos;/g, "'").replace(/&quot;/g, '"');
  26732. const {
  26733. escaped,
  26734. quote,
  26735. regex
  26736. } = getPreferredQuote(final, options.jsxSingleQuote ? "'" : '"');
  26737. final = final.replace(regex, escaped);
  26738. res = [quote, final, quote];
  26739. } else {
  26740. res = print("value");
  26741. }
  26742. parts.push("=", res);
  26743. }
  26744. return parts;
  26745. }
  26746. function printJsxExpressionContainer(path, options, print) {
  26747. const node = path.getValue();
  26748. const shouldInline = (node2, parent) => node2.type === "JSXEmptyExpression" || !hasComment(node2) && (node2.type === "ArrayExpression" || node2.type === "ObjectExpression" || node2.type === "ArrowFunctionExpression" || node2.type === "AwaitExpression" && (shouldInline(node2.argument, node2) || node2.argument.type === "JSXElement") || isCallExpression(node2) || node2.type === "FunctionExpression" || node2.type === "TemplateLiteral" || node2.type === "TaggedTemplateExpression" || node2.type === "DoExpression" || isJsxNode(parent) && (node2.type === "ConditionalExpression" || isBinaryish(node2)));
  26749. if (shouldInline(node.expression, path.getParentNode(0))) {
  26750. return group(["{", print("expression"), lineSuffixBoundary, "}"]);
  26751. }
  26752. return group(["{", indent([softline, print("expression")]), softline, lineSuffixBoundary, "}"]);
  26753. }
  26754. function printJsxOpeningElement(path, options, print) {
  26755. const node = path.getValue();
  26756. const nameHasComments = node.name && hasComment(node.name) || node.typeParameters && hasComment(node.typeParameters);
  26757. if (node.selfClosing && node.attributes.length === 0 && !nameHasComments) {
  26758. return ["<", print("name"), print("typeParameters"), " />"];
  26759. }
  26760. if (node.attributes && node.attributes.length === 1 && node.attributes[0].value && isStringLiteral(node.attributes[0].value) && !node.attributes[0].value.value.includes("\n") && !nameHasComments && !hasComment(node.attributes[0])) {
  26761. return group(["<", print("name"), print("typeParameters"), " ", ...path.map(print, "attributes"), node.selfClosing ? " />" : ">"]);
  26762. }
  26763. const lastAttrHasTrailingComments = node.attributes.length > 0 && hasComment(getLast(node.attributes), CommentCheckFlags.Trailing);
  26764. const bracketSameLine = node.attributes.length === 0 && !nameHasComments || (options.bracketSameLine || options.jsxBracketSameLine) && (!nameHasComments || node.attributes.length > 0) && !lastAttrHasTrailingComments;
  26765. const shouldBreak = node.attributes && node.attributes.some((attr) => attr.value && isStringLiteral(attr.value) && attr.value.value.includes("\n"));
  26766. const attributeLine = options.singleAttributePerLine && node.attributes.length > 1 ? hardline : line;
  26767. return group(["<", print("name"), print("typeParameters"), indent(path.map(() => [attributeLine, print()], "attributes")), node.selfClosing ? line : bracketSameLine ? ">" : softline, node.selfClosing ? "/>" : bracketSameLine ? "" : ">"], {
  26768. shouldBreak
  26769. });
  26770. }
  26771. function printJsxClosingElement(path, options, print) {
  26772. const node = path.getValue();
  26773. const parts = [];
  26774. parts.push("</");
  26775. const printed = print("name");
  26776. if (hasComment(node.name, CommentCheckFlags.Leading | CommentCheckFlags.Line)) {
  26777. parts.push(indent([hardline, printed]), hardline);
  26778. } else if (hasComment(node.name, CommentCheckFlags.Leading | CommentCheckFlags.Block)) {
  26779. parts.push(" ", printed);
  26780. } else {
  26781. parts.push(printed);
  26782. }
  26783. parts.push(">");
  26784. return parts;
  26785. }
  26786. function printJsxOpeningClosingFragment(path, options) {
  26787. const node = path.getValue();
  26788. const nodeHasComment = hasComment(node);
  26789. const hasOwnLineComment = hasComment(node, CommentCheckFlags.Line);
  26790. const isOpeningFragment = node.type === "JSXOpeningFragment";
  26791. return [isOpeningFragment ? "<" : "</", indent([hasOwnLineComment ? hardline : nodeHasComment && !isOpeningFragment ? " " : "", printDanglingComments(path, options, true)]), hasOwnLineComment ? hardline : "", ">"];
  26792. }
  26793. function printJsxElement(path, options, print) {
  26794. const elem = printComments(path, printJsxElementInternal(path, options, print), options);
  26795. return maybeWrapJsxElementInParens(path, elem, options);
  26796. }
  26797. function printJsxEmptyExpression(path, options) {
  26798. const node = path.getValue();
  26799. const requiresHardline = hasComment(node, CommentCheckFlags.Line);
  26800. return [printDanglingComments(path, options, !requiresHardline), requiresHardline ? hardline : ""];
  26801. }
  26802. function printJsxSpreadAttribute(path, options, print) {
  26803. const node = path.getValue();
  26804. return ["{", path.call((p) => {
  26805. const printed = ["...", print()];
  26806. const node2 = p.getValue();
  26807. if (!hasComment(node2) || !willPrintOwnComments(p)) {
  26808. return printed;
  26809. }
  26810. return [indent([softline, printComments(p, printed, options)]), softline];
  26811. }, node.type === "JSXSpreadAttribute" ? "argument" : "expression"), "}"];
  26812. }
  26813. function printJsx(path, options, print) {
  26814. const node = path.getValue();
  26815. if (!node.type.startsWith("JSX")) {
  26816. return;
  26817. }
  26818. switch (node.type) {
  26819. case "JSXAttribute":
  26820. return printJsxAttribute(path, options, print);
  26821. case "JSXIdentifier":
  26822. return String(node.name);
  26823. case "JSXNamespacedName":
  26824. return join(":", [print("namespace"), print("name")]);
  26825. case "JSXMemberExpression":
  26826. return join(".", [print("object"), print("property")]);
  26827. case "JSXSpreadAttribute":
  26828. return printJsxSpreadAttribute(path, options, print);
  26829. case "JSXSpreadChild": {
  26830. const printJsxSpreadChild = printJsxSpreadAttribute;
  26831. return printJsxSpreadChild(path, options, print);
  26832. }
  26833. case "JSXExpressionContainer":
  26834. return printJsxExpressionContainer(path, options, print);
  26835. case "JSXFragment":
  26836. case "JSXElement":
  26837. return printJsxElement(path, options, print);
  26838. case "JSXOpeningElement":
  26839. return printJsxOpeningElement(path, options, print);
  26840. case "JSXClosingElement":
  26841. return printJsxClosingElement(path, options, print);
  26842. case "JSXOpeningFragment":
  26843. case "JSXClosingFragment":
  26844. return printJsxOpeningClosingFragment(path, options);
  26845. case "JSXEmptyExpression":
  26846. return printJsxEmptyExpression(path, options);
  26847. case "JSXText":
  26848. throw new Error("JSXTest should be handled by JSXElement");
  26849. default:
  26850. throw new Error(`Unknown JSX node type: ${JSON.stringify(node.type)}.`);
  26851. }
  26852. }
  26853. var jsxWhitespaceChars = " \n\r ";
  26854. var matchJsxWhitespaceRegex = new RegExp("([" + jsxWhitespaceChars + "]+)");
  26855. var containsNonJsxWhitespaceRegex = new RegExp("[^" + jsxWhitespaceChars + "]");
  26856. var trimJsxWhitespace = (text) => text.replace(new RegExp("(?:^" + matchJsxWhitespaceRegex.source + "|" + matchJsxWhitespaceRegex.source + "$)"), "");
  26857. function isEmptyJsxElement(node) {
  26858. if (node.children.length === 0) {
  26859. return true;
  26860. }
  26861. if (node.children.length > 1) {
  26862. return false;
  26863. }
  26864. const child = node.children[0];
  26865. return isLiteral(child) && !isMeaningfulJsxText(child);
  26866. }
  26867. function isMeaningfulJsxText(node) {
  26868. return isLiteral(node) && (containsNonJsxWhitespaceRegex.test(rawText(node)) || !/\n/.test(rawText(node)));
  26869. }
  26870. function isJsxWhitespaceExpression(node) {
  26871. return node.type === "JSXExpressionContainer" && isLiteral(node.expression) && node.expression.value === " " && !hasComment(node.expression);
  26872. }
  26873. function hasJsxIgnoreComment(path) {
  26874. const node = path.getValue();
  26875. const parent = path.getParentNode();
  26876. if (!parent || !node || !isJsxNode(node) || !isJsxNode(parent)) {
  26877. return false;
  26878. }
  26879. const index = parent.children.indexOf(node);
  26880. let prevSibling = null;
  26881. for (let i = index; i > 0; i--) {
  26882. const candidate = parent.children[i - 1];
  26883. if (candidate.type === "JSXText" && !isMeaningfulJsxText(candidate)) {
  26884. continue;
  26885. }
  26886. prevSibling = candidate;
  26887. break;
  26888. }
  26889. return prevSibling && prevSibling.type === "JSXExpressionContainer" && prevSibling.expression.type === "JSXEmptyExpression" && hasNodeIgnoreComment(prevSibling.expression);
  26890. }
  26891. module2.exports = {
  26892. hasJsxIgnoreComment,
  26893. printJsx
  26894. };
  26895. }
  26896. });
  26897. var require_misc = __commonJS2({
  26898. "src/language-js/print/misc.js"(exports2, module2) {
  26899. "use strict";
  26900. var {
  26901. isNonEmptyArray
  26902. } = require_util();
  26903. var {
  26904. builders: {
  26905. indent,
  26906. join,
  26907. line
  26908. }
  26909. } = require("./doc.js");
  26910. var {
  26911. isFlowAnnotationComment
  26912. } = require_utils7();
  26913. function printOptionalToken(path) {
  26914. const node = path.getValue();
  26915. if (!node.optional || node.type === "Identifier" && node === path.getParentNode().key) {
  26916. return "";
  26917. }
  26918. if (node.type === "OptionalCallExpression" || node.type === "OptionalMemberExpression" && node.computed) {
  26919. return "?.";
  26920. }
  26921. return "?";
  26922. }
  26923. function printDefiniteToken(path) {
  26924. return path.getValue().definite || path.match(void 0, (node, name) => name === "id" && node.type === "VariableDeclarator" && node.definite) ? "!" : "";
  26925. }
  26926. function printFunctionTypeParameters(path, options, print) {
  26927. const fun = path.getValue();
  26928. if (fun.typeArguments) {
  26929. return print("typeArguments");
  26930. }
  26931. if (fun.typeParameters) {
  26932. return print("typeParameters");
  26933. }
  26934. return "";
  26935. }
  26936. function printTypeAnnotation(path, options, print) {
  26937. const node = path.getValue();
  26938. if (!node.typeAnnotation) {
  26939. return "";
  26940. }
  26941. const parentNode = path.getParentNode();
  26942. const isFunctionDeclarationIdentifier = parentNode.type === "DeclareFunction" && parentNode.id === node;
  26943. if (isFlowAnnotationComment(options.originalText, node.typeAnnotation)) {
  26944. return [" /*: ", print("typeAnnotation"), " */"];
  26945. }
  26946. return [isFunctionDeclarationIdentifier ? "" : ": ", print("typeAnnotation")];
  26947. }
  26948. function printBindExpressionCallee(path, options, print) {
  26949. return ["::", print("callee")];
  26950. }
  26951. function printTypeScriptModifiers(path, options, print) {
  26952. const node = path.getValue();
  26953. if (!isNonEmptyArray(node.modifiers)) {
  26954. return "";
  26955. }
  26956. return [join(" ", path.map(print, "modifiers")), " "];
  26957. }
  26958. function adjustClause(node, clause, forceSpace) {
  26959. if (node.type === "EmptyStatement") {
  26960. return ";";
  26961. }
  26962. if (node.type === "BlockStatement" || forceSpace) {
  26963. return [" ", clause];
  26964. }
  26965. return indent([line, clause]);
  26966. }
  26967. function printRestSpread(path, options, print) {
  26968. return ["...", print("argument"), printTypeAnnotation(path, options, print)];
  26969. }
  26970. module2.exports = {
  26971. printOptionalToken,
  26972. printDefiniteToken,
  26973. printFunctionTypeParameters,
  26974. printBindExpressionCallee,
  26975. printTypeScriptModifiers,
  26976. printTypeAnnotation,
  26977. printRestSpread,
  26978. adjustClause
  26979. };
  26980. }
  26981. });
  26982. var require_array4 = __commonJS2({
  26983. "src/language-js/print/array.js"(exports2, module2) {
  26984. "use strict";
  26985. var {
  26986. printDanglingComments
  26987. } = require_comments();
  26988. var {
  26989. builders: {
  26990. line,
  26991. softline,
  26992. hardline,
  26993. group,
  26994. indent,
  26995. ifBreak,
  26996. fill
  26997. }
  26998. } = require("./doc.js");
  26999. var {
  27000. getLast,
  27001. hasNewline
  27002. } = require_util();
  27003. var {
  27004. shouldPrintComma,
  27005. hasComment,
  27006. CommentCheckFlags,
  27007. isNextLineEmpty,
  27008. isNumericLiteral,
  27009. isSignedNumericLiteral
  27010. } = require_utils7();
  27011. var {
  27012. locStart
  27013. } = require_loc();
  27014. var {
  27015. printOptionalToken,
  27016. printTypeAnnotation
  27017. } = require_misc();
  27018. function printArray(path, options, print) {
  27019. const node = path.getValue();
  27020. const parts = [];
  27021. const openBracket = node.type === "TupleExpression" ? "#[" : "[";
  27022. const closeBracket = "]";
  27023. if (node.elements.length === 0) {
  27024. if (!hasComment(node, CommentCheckFlags.Dangling)) {
  27025. parts.push(openBracket, closeBracket);
  27026. } else {
  27027. parts.push(group([openBracket, printDanglingComments(path, options), softline, closeBracket]));
  27028. }
  27029. } else {
  27030. const lastElem = getLast(node.elements);
  27031. const canHaveTrailingComma = !(lastElem && lastElem.type === "RestElement");
  27032. const needsForcedTrailingComma = lastElem === null;
  27033. const groupId = Symbol("array");
  27034. const shouldBreak = !options.__inJestEach && node.elements.length > 1 && node.elements.every((element, i, elements) => {
  27035. const elementType = element && element.type;
  27036. if (elementType !== "ArrayExpression" && elementType !== "ObjectExpression") {
  27037. return false;
  27038. }
  27039. const nextElement = elements[i + 1];
  27040. if (nextElement && elementType !== nextElement.type) {
  27041. return false;
  27042. }
  27043. const itemsKey = elementType === "ArrayExpression" ? "elements" : "properties";
  27044. return element[itemsKey] && element[itemsKey].length > 1;
  27045. });
  27046. const shouldUseConciseFormatting = isConciselyPrintedArray(node, options);
  27047. const trailingComma = !canHaveTrailingComma ? "" : needsForcedTrailingComma ? "," : !shouldPrintComma(options) ? "" : shouldUseConciseFormatting ? ifBreak(",", "", {
  27048. groupId
  27049. }) : ifBreak(",");
  27050. parts.push(group([openBracket, indent([softline, shouldUseConciseFormatting ? printArrayItemsConcisely(path, options, print, trailingComma) : [printArrayItems(path, options, "elements", print), trailingComma], printDanglingComments(path, options, true)]), softline, closeBracket], {
  27051. shouldBreak,
  27052. id: groupId
  27053. }));
  27054. }
  27055. parts.push(printOptionalToken(path), printTypeAnnotation(path, options, print));
  27056. return parts;
  27057. }
  27058. function isConciselyPrintedArray(node, options) {
  27059. return node.elements.length > 1 && node.elements.every((element) => element && (isNumericLiteral(element) || isSignedNumericLiteral(element) && !hasComment(element.argument)) && !hasComment(element, CommentCheckFlags.Trailing | CommentCheckFlags.Line, (comment) => !hasNewline(options.originalText, locStart(comment), {
  27060. backwards: true
  27061. })));
  27062. }
  27063. function printArrayItems(path, options, printPath, print) {
  27064. const printedElements = [];
  27065. let separatorParts = [];
  27066. path.each((childPath) => {
  27067. printedElements.push(separatorParts, group(print()));
  27068. separatorParts = [",", line];
  27069. if (childPath.getValue() && isNextLineEmpty(childPath.getValue(), options)) {
  27070. separatorParts.push(softline);
  27071. }
  27072. }, printPath);
  27073. return printedElements;
  27074. }
  27075. function printArrayItemsConcisely(path, options, print, trailingComma) {
  27076. const parts = [];
  27077. path.each((childPath, i, elements) => {
  27078. const isLast = i === elements.length - 1;
  27079. parts.push([print(), isLast ? trailingComma : ","]);
  27080. if (!isLast) {
  27081. parts.push(isNextLineEmpty(childPath.getValue(), options) ? [hardline, hardline] : hasComment(elements[i + 1], CommentCheckFlags.Leading | CommentCheckFlags.Line) ? hardline : line);
  27082. }
  27083. }, "elements");
  27084. return fill(parts);
  27085. }
  27086. module2.exports = {
  27087. printArray,
  27088. printArrayItems,
  27089. isConciselyPrintedArray
  27090. };
  27091. }
  27092. });
  27093. var require_call_arguments = __commonJS2({
  27094. "src/language-js/print/call-arguments.js"(exports2, module2) {
  27095. "use strict";
  27096. var {
  27097. printDanglingComments
  27098. } = require_comments();
  27099. var {
  27100. getLast,
  27101. getPenultimate
  27102. } = require_util();
  27103. var {
  27104. getFunctionParameters,
  27105. hasComment,
  27106. CommentCheckFlags,
  27107. isFunctionCompositionArgs,
  27108. isJsxNode,
  27109. isLongCurriedCallExpression,
  27110. shouldPrintComma,
  27111. getCallArguments,
  27112. iterateCallArgumentsPath,
  27113. isNextLineEmpty,
  27114. isCallExpression,
  27115. isStringLiteral,
  27116. isObjectProperty
  27117. } = require_utils7();
  27118. var {
  27119. builders: {
  27120. line,
  27121. hardline,
  27122. softline,
  27123. group,
  27124. indent,
  27125. conditionalGroup,
  27126. ifBreak,
  27127. breakParent
  27128. },
  27129. utils: {
  27130. willBreak
  27131. }
  27132. } = require("./doc.js");
  27133. var {
  27134. ArgExpansionBailout
  27135. } = require_errors();
  27136. var {
  27137. isConciselyPrintedArray
  27138. } = require_array4();
  27139. function printCallArguments(path, options, print) {
  27140. const node = path.getValue();
  27141. const isDynamicImport = node.type === "ImportExpression";
  27142. const args = getCallArguments(node);
  27143. if (args.length === 0) {
  27144. return ["(", printDanglingComments(path, options, true), ")"];
  27145. }
  27146. if (isReactHookCallWithDepsArray(args)) {
  27147. return ["(", print(["arguments", 0]), ", ", print(["arguments", 1]), ")"];
  27148. }
  27149. let anyArgEmptyLine = false;
  27150. let hasEmptyLineFollowingFirstArg = false;
  27151. const lastArgIndex = args.length - 1;
  27152. const printedArguments = [];
  27153. iterateCallArgumentsPath(path, (argPath, index) => {
  27154. const arg = argPath.getNode();
  27155. const parts = [print()];
  27156. if (index === lastArgIndex) {
  27157. } else if (isNextLineEmpty(arg, options)) {
  27158. if (index === 0) {
  27159. hasEmptyLineFollowingFirstArg = true;
  27160. }
  27161. anyArgEmptyLine = true;
  27162. parts.push(",", hardline, hardline);
  27163. } else {
  27164. parts.push(",", line);
  27165. }
  27166. printedArguments.push(parts);
  27167. });
  27168. const maybeTrailingComma = !(isDynamicImport || node.callee && node.callee.type === "Import") && shouldPrintComma(options, "all") ? "," : "";
  27169. function allArgsBrokenOut() {
  27170. return group(["(", indent([line, ...printedArguments]), maybeTrailingComma, line, ")"], {
  27171. shouldBreak: true
  27172. });
  27173. }
  27174. if (anyArgEmptyLine || path.getParentNode().type !== "Decorator" && isFunctionCompositionArgs(args)) {
  27175. return allArgsBrokenOut();
  27176. }
  27177. const shouldGroupFirst = shouldGroupFirstArg(args);
  27178. const shouldGroupLast = shouldGroupLastArg(args, options);
  27179. if (shouldGroupFirst || shouldGroupLast) {
  27180. if (shouldGroupFirst ? printedArguments.slice(1).some(willBreak) : printedArguments.slice(0, -1).some(willBreak)) {
  27181. return allArgsBrokenOut();
  27182. }
  27183. let printedExpanded = [];
  27184. try {
  27185. path.try(() => {
  27186. iterateCallArgumentsPath(path, (argPath, i) => {
  27187. if (shouldGroupFirst && i === 0) {
  27188. printedExpanded = [[print([], {
  27189. expandFirstArg: true
  27190. }), printedArguments.length > 1 ? "," : "", hasEmptyLineFollowingFirstArg ? hardline : line, hasEmptyLineFollowingFirstArg ? hardline : ""], ...printedArguments.slice(1)];
  27191. }
  27192. if (shouldGroupLast && i === lastArgIndex) {
  27193. printedExpanded = [...printedArguments.slice(0, -1), print([], {
  27194. expandLastArg: true
  27195. })];
  27196. }
  27197. });
  27198. });
  27199. } catch (caught) {
  27200. if (caught instanceof ArgExpansionBailout) {
  27201. return allArgsBrokenOut();
  27202. }
  27203. throw caught;
  27204. }
  27205. return [printedArguments.some(willBreak) ? breakParent : "", conditionalGroup([["(", ...printedExpanded, ")"], shouldGroupFirst ? ["(", group(printedExpanded[0], {
  27206. shouldBreak: true
  27207. }), ...printedExpanded.slice(1), ")"] : ["(", ...printedArguments.slice(0, -1), group(getLast(printedExpanded), {
  27208. shouldBreak: true
  27209. }), ")"], allArgsBrokenOut()])];
  27210. }
  27211. const contents = ["(", indent([softline, ...printedArguments]), ifBreak(maybeTrailingComma), softline, ")"];
  27212. if (isLongCurriedCallExpression(path)) {
  27213. return contents;
  27214. }
  27215. return group(contents, {
  27216. shouldBreak: printedArguments.some(willBreak) || anyArgEmptyLine
  27217. });
  27218. }
  27219. function couldGroupArg(arg, arrowChainRecursion = false) {
  27220. return arg.type === "ObjectExpression" && (arg.properties.length > 0 || hasComment(arg)) || arg.type === "ArrayExpression" && (arg.elements.length > 0 || hasComment(arg)) || arg.type === "TSTypeAssertion" && couldGroupArg(arg.expression) || arg.type === "TSAsExpression" && couldGroupArg(arg.expression) || arg.type === "FunctionExpression" || arg.type === "ArrowFunctionExpression" && (!arg.returnType || !arg.returnType.typeAnnotation || arg.returnType.typeAnnotation.type !== "TSTypeReference" || isNonEmptyBlockStatement(arg.body)) && (arg.body.type === "BlockStatement" || arg.body.type === "ArrowFunctionExpression" && couldGroupArg(arg.body, true) || arg.body.type === "ObjectExpression" || arg.body.type === "ArrayExpression" || !arrowChainRecursion && (isCallExpression(arg.body) || arg.body.type === "ConditionalExpression") || isJsxNode(arg.body)) || arg.type === "DoExpression" || arg.type === "ModuleExpression";
  27221. }
  27222. function shouldGroupLastArg(args, options) {
  27223. const lastArg = getLast(args);
  27224. const penultimateArg = getPenultimate(args);
  27225. return !hasComment(lastArg, CommentCheckFlags.Leading) && !hasComment(lastArg, CommentCheckFlags.Trailing) && couldGroupArg(lastArg) && (!penultimateArg || penultimateArg.type !== lastArg.type) && (args.length !== 2 || penultimateArg.type !== "ArrowFunctionExpression" || lastArg.type !== "ArrayExpression") && !(args.length > 1 && lastArg.type === "ArrayExpression" && isConciselyPrintedArray(lastArg, options));
  27226. }
  27227. function shouldGroupFirstArg(args) {
  27228. if (args.length !== 2) {
  27229. return false;
  27230. }
  27231. const [firstArg, secondArg] = args;
  27232. if (firstArg.type === "ModuleExpression" && isTypeModuleObjectExpression(secondArg)) {
  27233. return true;
  27234. }
  27235. return !hasComment(firstArg) && (firstArg.type === "FunctionExpression" || firstArg.type === "ArrowFunctionExpression" && firstArg.body.type === "BlockStatement") && secondArg.type !== "FunctionExpression" && secondArg.type !== "ArrowFunctionExpression" && secondArg.type !== "ConditionalExpression" && !couldGroupArg(secondArg);
  27236. }
  27237. function isReactHookCallWithDepsArray(args) {
  27238. return args.length === 2 && args[0].type === "ArrowFunctionExpression" && getFunctionParameters(args[0]).length === 0 && args[0].body.type === "BlockStatement" && args[1].type === "ArrayExpression" && !args.some((arg) => hasComment(arg));
  27239. }
  27240. function isNonEmptyBlockStatement(node) {
  27241. return node.type === "BlockStatement" && (node.body.some((node2) => node2.type !== "EmptyStatement") || hasComment(node, CommentCheckFlags.Dangling));
  27242. }
  27243. function isTypeModuleObjectExpression(node) {
  27244. return node.type === "ObjectExpression" && node.properties.length === 1 && isObjectProperty(node.properties[0]) && node.properties[0].key.type === "Identifier" && node.properties[0].key.name === "type" && isStringLiteral(node.properties[0].value) && node.properties[0].value.value === "module";
  27245. }
  27246. module2.exports = printCallArguments;
  27247. }
  27248. });
  27249. var require_member = __commonJS2({
  27250. "src/language-js/print/member.js"(exports2, module2) {
  27251. "use strict";
  27252. var {
  27253. builders: {
  27254. softline,
  27255. group,
  27256. indent,
  27257. label
  27258. }
  27259. } = require("./doc.js");
  27260. var {
  27261. isNumericLiteral,
  27262. isMemberExpression,
  27263. isCallExpression
  27264. } = require_utils7();
  27265. var {
  27266. printOptionalToken
  27267. } = require_misc();
  27268. function printMemberExpression(path, options, print) {
  27269. const node = path.getValue();
  27270. const parent = path.getParentNode();
  27271. let firstNonMemberParent;
  27272. let i = 0;
  27273. do {
  27274. firstNonMemberParent = path.getParentNode(i);
  27275. i++;
  27276. } while (firstNonMemberParent && (isMemberExpression(firstNonMemberParent) || firstNonMemberParent.type === "TSNonNullExpression"));
  27277. const objectDoc = print("object");
  27278. const lookupDoc = printMemberLookup(path, options, print);
  27279. const shouldInline = firstNonMemberParent && (firstNonMemberParent.type === "NewExpression" || firstNonMemberParent.type === "BindExpression" || firstNonMemberParent.type === "AssignmentExpression" && firstNonMemberParent.left.type !== "Identifier") || node.computed || node.object.type === "Identifier" && node.property.type === "Identifier" && !isMemberExpression(parent) || (parent.type === "AssignmentExpression" || parent.type === "VariableDeclarator") && (isCallExpression(node.object) && node.object.arguments.length > 0 || node.object.type === "TSNonNullExpression" && isCallExpression(node.object.expression) && node.object.expression.arguments.length > 0 || objectDoc.label === "member-chain");
  27280. return label(objectDoc.label === "member-chain" ? "member-chain" : "member", [objectDoc, shouldInline ? lookupDoc : group(indent([softline, lookupDoc]))]);
  27281. }
  27282. function printMemberLookup(path, options, print) {
  27283. const property = print("property");
  27284. const node = path.getValue();
  27285. const optional = printOptionalToken(path);
  27286. if (!node.computed) {
  27287. return [optional, ".", property];
  27288. }
  27289. if (!node.property || isNumericLiteral(node.property)) {
  27290. return [optional, "[", property, "]"];
  27291. }
  27292. return group([optional, "[", indent([softline, property]), softline, "]"]);
  27293. }
  27294. module2.exports = {
  27295. printMemberExpression,
  27296. printMemberLookup
  27297. };
  27298. }
  27299. });
  27300. var require_member_chain = __commonJS2({
  27301. "src/language-js/print/member-chain.js"(exports2, module2) {
  27302. "use strict";
  27303. var {
  27304. printComments
  27305. } = require_comments();
  27306. var {
  27307. getLast,
  27308. isNextLineEmptyAfterIndex,
  27309. getNextNonSpaceNonCommentCharacterIndex
  27310. } = require_util();
  27311. var pathNeedsParens = require_needs_parens();
  27312. var {
  27313. isCallExpression,
  27314. isMemberExpression,
  27315. isFunctionOrArrowExpression,
  27316. isLongCurriedCallExpression,
  27317. isMemberish,
  27318. isNumericLiteral,
  27319. isSimpleCallArgument,
  27320. hasComment,
  27321. CommentCheckFlags,
  27322. isNextLineEmpty
  27323. } = require_utils7();
  27324. var {
  27325. locEnd
  27326. } = require_loc();
  27327. var {
  27328. builders: {
  27329. join,
  27330. hardline,
  27331. group,
  27332. indent,
  27333. conditionalGroup,
  27334. breakParent,
  27335. label
  27336. },
  27337. utils: {
  27338. willBreak
  27339. }
  27340. } = require("./doc.js");
  27341. var printCallArguments = require_call_arguments();
  27342. var {
  27343. printMemberLookup
  27344. } = require_member();
  27345. var {
  27346. printOptionalToken,
  27347. printFunctionTypeParameters,
  27348. printBindExpressionCallee
  27349. } = require_misc();
  27350. function printMemberChain(path, options, print) {
  27351. const parent = path.getParentNode();
  27352. const isExpressionStatement = !parent || parent.type === "ExpressionStatement";
  27353. const printedNodes = [];
  27354. function shouldInsertEmptyLineAfter(node2) {
  27355. const {
  27356. originalText
  27357. } = options;
  27358. const nextCharIndex = getNextNonSpaceNonCommentCharacterIndex(originalText, node2, locEnd);
  27359. const nextChar = originalText.charAt(nextCharIndex);
  27360. if (nextChar === ")") {
  27361. return nextCharIndex !== false && isNextLineEmptyAfterIndex(originalText, nextCharIndex + 1);
  27362. }
  27363. return isNextLineEmpty(node2, options);
  27364. }
  27365. function rec(path2) {
  27366. const node2 = path2.getValue();
  27367. if (isCallExpression(node2) && (isMemberish(node2.callee) || isCallExpression(node2.callee))) {
  27368. printedNodes.unshift({
  27369. node: node2,
  27370. printed: [printComments(path2, [printOptionalToken(path2), printFunctionTypeParameters(path2, options, print), printCallArguments(path2, options, print)], options), shouldInsertEmptyLineAfter(node2) ? hardline : ""]
  27371. });
  27372. path2.call((callee) => rec(callee), "callee");
  27373. } else if (isMemberish(node2)) {
  27374. printedNodes.unshift({
  27375. node: node2,
  27376. needsParens: pathNeedsParens(path2, options),
  27377. printed: printComments(path2, isMemberExpression(node2) ? printMemberLookup(path2, options, print) : printBindExpressionCallee(path2, options, print), options)
  27378. });
  27379. path2.call((object) => rec(object), "object");
  27380. } else if (node2.type === "TSNonNullExpression") {
  27381. printedNodes.unshift({
  27382. node: node2,
  27383. printed: printComments(path2, "!", options)
  27384. });
  27385. path2.call((expression) => rec(expression), "expression");
  27386. } else {
  27387. printedNodes.unshift({
  27388. node: node2,
  27389. printed: print()
  27390. });
  27391. }
  27392. }
  27393. const node = path.getValue();
  27394. printedNodes.unshift({
  27395. node,
  27396. printed: [printOptionalToken(path), printFunctionTypeParameters(path, options, print), printCallArguments(path, options, print)]
  27397. });
  27398. if (node.callee) {
  27399. path.call((callee) => rec(callee), "callee");
  27400. }
  27401. const groups = [];
  27402. let currentGroup = [printedNodes[0]];
  27403. let i = 1;
  27404. for (; i < printedNodes.length; ++i) {
  27405. if (printedNodes[i].node.type === "TSNonNullExpression" || isCallExpression(printedNodes[i].node) || isMemberExpression(printedNodes[i].node) && printedNodes[i].node.computed && isNumericLiteral(printedNodes[i].node.property)) {
  27406. currentGroup.push(printedNodes[i]);
  27407. } else {
  27408. break;
  27409. }
  27410. }
  27411. if (!isCallExpression(printedNodes[0].node)) {
  27412. for (; i + 1 < printedNodes.length; ++i) {
  27413. if (isMemberish(printedNodes[i].node) && isMemberish(printedNodes[i + 1].node)) {
  27414. currentGroup.push(printedNodes[i]);
  27415. } else {
  27416. break;
  27417. }
  27418. }
  27419. }
  27420. groups.push(currentGroup);
  27421. currentGroup = [];
  27422. let hasSeenCallExpression = false;
  27423. for (; i < printedNodes.length; ++i) {
  27424. if (hasSeenCallExpression && isMemberish(printedNodes[i].node)) {
  27425. if (printedNodes[i].node.computed && isNumericLiteral(printedNodes[i].node.property)) {
  27426. currentGroup.push(printedNodes[i]);
  27427. continue;
  27428. }
  27429. groups.push(currentGroup);
  27430. currentGroup = [];
  27431. hasSeenCallExpression = false;
  27432. }
  27433. if (isCallExpression(printedNodes[i].node) || printedNodes[i].node.type === "ImportExpression") {
  27434. hasSeenCallExpression = true;
  27435. }
  27436. currentGroup.push(printedNodes[i]);
  27437. if (hasComment(printedNodes[i].node, CommentCheckFlags.Trailing)) {
  27438. groups.push(currentGroup);
  27439. currentGroup = [];
  27440. hasSeenCallExpression = false;
  27441. }
  27442. }
  27443. if (currentGroup.length > 0) {
  27444. groups.push(currentGroup);
  27445. }
  27446. function isFactory(name) {
  27447. return /^[A-Z]|^[$_]+$/.test(name);
  27448. }
  27449. function isShort(name) {
  27450. return name.length <= options.tabWidth;
  27451. }
  27452. function shouldNotWrap(groups2) {
  27453. const hasComputed = groups2[1].length > 0 && groups2[1][0].node.computed;
  27454. if (groups2[0].length === 1) {
  27455. const firstNode = groups2[0][0].node;
  27456. return firstNode.type === "ThisExpression" || firstNode.type === "Identifier" && (isFactory(firstNode.name) || isExpressionStatement && isShort(firstNode.name) || hasComputed);
  27457. }
  27458. const lastNode = getLast(groups2[0]).node;
  27459. return isMemberExpression(lastNode) && lastNode.property.type === "Identifier" && (isFactory(lastNode.property.name) || hasComputed);
  27460. }
  27461. const shouldMerge = groups.length >= 2 && !hasComment(groups[1][0].node) && shouldNotWrap(groups);
  27462. function printGroup(printedGroup) {
  27463. const printed = printedGroup.map((tuple) => tuple.printed);
  27464. if (printedGroup.length > 0 && getLast(printedGroup).needsParens) {
  27465. return ["(", ...printed, ")"];
  27466. }
  27467. return printed;
  27468. }
  27469. function printIndentedGroup(groups2) {
  27470. if (groups2.length === 0) {
  27471. return "";
  27472. }
  27473. return indent(group([hardline, join(hardline, groups2.map(printGroup))]));
  27474. }
  27475. const printedGroups = groups.map(printGroup);
  27476. const oneLine = printedGroups;
  27477. const cutoff = shouldMerge ? 3 : 2;
  27478. const flatGroups = groups.flat();
  27479. const nodeHasComment = flatGroups.slice(1, -1).some((node2) => hasComment(node2.node, CommentCheckFlags.Leading)) || flatGroups.slice(0, -1).some((node2) => hasComment(node2.node, CommentCheckFlags.Trailing)) || groups[cutoff] && hasComment(groups[cutoff][0].node, CommentCheckFlags.Leading);
  27480. if (groups.length <= cutoff && !nodeHasComment) {
  27481. if (isLongCurriedCallExpression(path)) {
  27482. return oneLine;
  27483. }
  27484. return group(oneLine);
  27485. }
  27486. const lastNodeBeforeIndent = getLast(groups[shouldMerge ? 1 : 0]).node;
  27487. const shouldHaveEmptyLineBeforeIndent = !isCallExpression(lastNodeBeforeIndent) && shouldInsertEmptyLineAfter(lastNodeBeforeIndent);
  27488. const expanded = [printGroup(groups[0]), shouldMerge ? groups.slice(1, 2).map(printGroup) : "", shouldHaveEmptyLineBeforeIndent ? hardline : "", printIndentedGroup(groups.slice(shouldMerge ? 2 : 1))];
  27489. const callExpressions = printedNodes.map(({
  27490. node: node2
  27491. }) => node2).filter(isCallExpression);
  27492. function lastGroupWillBreakAndOtherCallsHaveFunctionArguments() {
  27493. const lastGroupNode = getLast(getLast(groups)).node;
  27494. const lastGroupDoc = getLast(printedGroups);
  27495. return isCallExpression(lastGroupNode) && willBreak(lastGroupDoc) && callExpressions.slice(0, -1).some((node2) => node2.arguments.some(isFunctionOrArrowExpression));
  27496. }
  27497. let result;
  27498. if (nodeHasComment || callExpressions.length > 2 && callExpressions.some((expr) => !expr.arguments.every((arg) => isSimpleCallArgument(arg, 0))) || printedGroups.slice(0, -1).some(willBreak) || lastGroupWillBreakAndOtherCallsHaveFunctionArguments()) {
  27499. result = group(expanded);
  27500. } else {
  27501. result = [willBreak(oneLine) || shouldHaveEmptyLineBeforeIndent ? breakParent : "", conditionalGroup([oneLine, expanded])];
  27502. }
  27503. return label("member-chain", result);
  27504. }
  27505. module2.exports = printMemberChain;
  27506. }
  27507. });
  27508. var require_call_expression = __commonJS2({
  27509. "src/language-js/print/call-expression.js"(exports2, module2) {
  27510. "use strict";
  27511. var {
  27512. builders: {
  27513. join,
  27514. group
  27515. }
  27516. } = require("./doc.js");
  27517. var pathNeedsParens = require_needs_parens();
  27518. var {
  27519. getCallArguments,
  27520. hasFlowAnnotationComment,
  27521. isCallExpression,
  27522. isMemberish,
  27523. isStringLiteral,
  27524. isTemplateOnItsOwnLine,
  27525. isTestCall,
  27526. iterateCallArgumentsPath
  27527. } = require_utils7();
  27528. var printMemberChain = require_member_chain();
  27529. var printCallArguments = require_call_arguments();
  27530. var {
  27531. printOptionalToken,
  27532. printFunctionTypeParameters
  27533. } = require_misc();
  27534. function printCallExpression(path, options, print) {
  27535. const node = path.getValue();
  27536. const parentNode = path.getParentNode();
  27537. const isNew = node.type === "NewExpression";
  27538. const isDynamicImport = node.type === "ImportExpression";
  27539. const optional = printOptionalToken(path);
  27540. const args = getCallArguments(node);
  27541. if (args.length > 0 && (!isDynamicImport && !isNew && isCommonsJsOrAmdCall(node, parentNode) || args.length === 1 && isTemplateOnItsOwnLine(args[0], options.originalText) || !isNew && isTestCall(node, parentNode))) {
  27542. const printed = [];
  27543. iterateCallArgumentsPath(path, () => {
  27544. printed.push(print());
  27545. });
  27546. return [isNew ? "new " : "", print("callee"), optional, printFunctionTypeParameters(path, options, print), "(", join(", ", printed), ")"];
  27547. }
  27548. const isIdentifierWithFlowAnnotation = (options.parser === "babel" || options.parser === "babel-flow") && node.callee && node.callee.type === "Identifier" && hasFlowAnnotationComment(node.callee.trailingComments);
  27549. if (isIdentifierWithFlowAnnotation) {
  27550. node.callee.trailingComments[0].printed = true;
  27551. }
  27552. if (!isDynamicImport && !isNew && isMemberish(node.callee) && !path.call((path2) => pathNeedsParens(path2, options), "callee")) {
  27553. return printMemberChain(path, options, print);
  27554. }
  27555. const contents = [isNew ? "new " : "", isDynamicImport ? "import" : print("callee"), optional, isIdentifierWithFlowAnnotation ? `/*:: ${node.callee.trailingComments[0].value.slice(2).trim()} */` : "", printFunctionTypeParameters(path, options, print), printCallArguments(path, options, print)];
  27556. if (isDynamicImport || isCallExpression(node.callee)) {
  27557. return group(contents);
  27558. }
  27559. return contents;
  27560. }
  27561. function isCommonsJsOrAmdCall(node, parentNode) {
  27562. if (node.callee.type !== "Identifier") {
  27563. return false;
  27564. }
  27565. if (node.callee.name === "require") {
  27566. return true;
  27567. }
  27568. if (node.callee.name === "define") {
  27569. const args = getCallArguments(node);
  27570. return parentNode.type === "ExpressionStatement" && (args.length === 1 || args.length === 2 && args[0].type === "ArrayExpression" || args.length === 3 && isStringLiteral(args[0]) && args[1].type === "ArrayExpression");
  27571. }
  27572. return false;
  27573. }
  27574. module2.exports = {
  27575. printCallExpression
  27576. };
  27577. }
  27578. });
  27579. var require_assignment = __commonJS2({
  27580. "src/language-js/print/assignment.js"(exports2, module2) {
  27581. "use strict";
  27582. var {
  27583. isNonEmptyArray,
  27584. getStringWidth
  27585. } = require_util();
  27586. var {
  27587. builders: {
  27588. line,
  27589. group,
  27590. indent,
  27591. indentIfBreak,
  27592. lineSuffixBoundary
  27593. },
  27594. utils: {
  27595. cleanDoc,
  27596. willBreak,
  27597. canBreak
  27598. }
  27599. } = require("./doc.js");
  27600. var {
  27601. hasLeadingOwnLineComment,
  27602. isBinaryish,
  27603. isStringLiteral,
  27604. isLiteral,
  27605. isNumericLiteral,
  27606. isCallExpression,
  27607. isMemberExpression,
  27608. getCallArguments,
  27609. rawText,
  27610. hasComment,
  27611. isSignedNumericLiteral,
  27612. isObjectProperty
  27613. } = require_utils7();
  27614. var {
  27615. shouldInlineLogicalExpression
  27616. } = require_binaryish();
  27617. var {
  27618. printCallExpression
  27619. } = require_call_expression();
  27620. function printAssignment(path, options, print, leftDoc, operator, rightPropertyName) {
  27621. const layout = chooseLayout(path, options, print, leftDoc, rightPropertyName);
  27622. const rightDoc = print(rightPropertyName, {
  27623. assignmentLayout: layout
  27624. });
  27625. switch (layout) {
  27626. case "break-after-operator":
  27627. return group([group(leftDoc), operator, group(indent([line, rightDoc]))]);
  27628. case "never-break-after-operator":
  27629. return group([group(leftDoc), operator, " ", rightDoc]);
  27630. case "fluid": {
  27631. const groupId = Symbol("assignment");
  27632. return group([group(leftDoc), operator, group(indent(line), {
  27633. id: groupId
  27634. }), lineSuffixBoundary, indentIfBreak(rightDoc, {
  27635. groupId
  27636. })]);
  27637. }
  27638. case "break-lhs":
  27639. return group([leftDoc, operator, " ", group(rightDoc)]);
  27640. case "chain":
  27641. return [group(leftDoc), operator, line, rightDoc];
  27642. case "chain-tail":
  27643. return [group(leftDoc), operator, indent([line, rightDoc])];
  27644. case "chain-tail-arrow-chain":
  27645. return [group(leftDoc), operator, rightDoc];
  27646. case "only-left":
  27647. return leftDoc;
  27648. }
  27649. }
  27650. function printAssignmentExpression(path, options, print) {
  27651. const node = path.getValue();
  27652. return printAssignment(path, options, print, print("left"), [" ", node.operator], "right");
  27653. }
  27654. function printVariableDeclarator(path, options, print) {
  27655. return printAssignment(path, options, print, print("id"), " =", "init");
  27656. }
  27657. function chooseLayout(path, options, print, leftDoc, rightPropertyName) {
  27658. const node = path.getValue();
  27659. const rightNode = node[rightPropertyName];
  27660. if (!rightNode) {
  27661. return "only-left";
  27662. }
  27663. const isTail = !isAssignment(rightNode);
  27664. const shouldUseChainFormatting = path.match(isAssignment, isAssignmentOrVariableDeclarator, (node2) => !isTail || node2.type !== "ExpressionStatement" && node2.type !== "VariableDeclaration");
  27665. if (shouldUseChainFormatting) {
  27666. return !isTail ? "chain" : rightNode.type === "ArrowFunctionExpression" && rightNode.body.type === "ArrowFunctionExpression" ? "chain-tail-arrow-chain" : "chain-tail";
  27667. }
  27668. const isHeadOfLongChain = !isTail && isAssignment(rightNode.right);
  27669. if (isHeadOfLongChain || hasLeadingOwnLineComment(options.originalText, rightNode)) {
  27670. return "break-after-operator";
  27671. }
  27672. if (rightNode.type === "CallExpression" && rightNode.callee.name === "require" || options.parser === "json5" || options.parser === "json") {
  27673. return "never-break-after-operator";
  27674. }
  27675. if (isComplexDestructuring(node) || isComplexTypeAliasParams(node) || hasComplexTypeAnnotation(node) || isArrowFunctionVariableDeclarator(node) && canBreak(leftDoc)) {
  27676. return "break-lhs";
  27677. }
  27678. const hasShortKey = isObjectPropertyWithShortKey(node, leftDoc, options);
  27679. if (path.call(() => shouldBreakAfterOperator(path, options, print, hasShortKey), rightPropertyName)) {
  27680. return "break-after-operator";
  27681. }
  27682. if (hasShortKey || rightNode.type === "TemplateLiteral" || rightNode.type === "TaggedTemplateExpression" || rightNode.type === "BooleanLiteral" || isNumericLiteral(rightNode) || rightNode.type === "ClassExpression") {
  27683. return "never-break-after-operator";
  27684. }
  27685. return "fluid";
  27686. }
  27687. function shouldBreakAfterOperator(path, options, print, hasShortKey) {
  27688. const rightNode = path.getValue();
  27689. if (isBinaryish(rightNode) && !shouldInlineLogicalExpression(rightNode)) {
  27690. return true;
  27691. }
  27692. switch (rightNode.type) {
  27693. case "StringLiteralTypeAnnotation":
  27694. case "SequenceExpression":
  27695. return true;
  27696. case "ConditionalExpression": {
  27697. const {
  27698. test
  27699. } = rightNode;
  27700. return isBinaryish(test) && !shouldInlineLogicalExpression(test);
  27701. }
  27702. case "ClassExpression":
  27703. return isNonEmptyArray(rightNode.decorators);
  27704. }
  27705. if (hasShortKey) {
  27706. return false;
  27707. }
  27708. let node = rightNode;
  27709. const propertiesForPath = [];
  27710. for (; ; ) {
  27711. if (node.type === "UnaryExpression") {
  27712. node = node.argument;
  27713. propertiesForPath.push("argument");
  27714. } else if (node.type === "TSNonNullExpression") {
  27715. node = node.expression;
  27716. propertiesForPath.push("expression");
  27717. } else {
  27718. break;
  27719. }
  27720. }
  27721. if (isStringLiteral(node) || path.call(() => isPoorlyBreakableMemberOrCallChain(path, options, print), ...propertiesForPath)) {
  27722. return true;
  27723. }
  27724. return false;
  27725. }
  27726. function isComplexDestructuring(node) {
  27727. if (isAssignmentOrVariableDeclarator(node)) {
  27728. const leftNode = node.left || node.id;
  27729. return leftNode.type === "ObjectPattern" && leftNode.properties.length > 2 && leftNode.properties.some((property) => isObjectProperty(property) && (!property.shorthand || property.value && property.value.type === "AssignmentPattern"));
  27730. }
  27731. return false;
  27732. }
  27733. function isAssignment(node) {
  27734. return node.type === "AssignmentExpression";
  27735. }
  27736. function isAssignmentOrVariableDeclarator(node) {
  27737. return isAssignment(node) || node.type === "VariableDeclarator";
  27738. }
  27739. function isComplexTypeAliasParams(node) {
  27740. const typeParams = getTypeParametersFromTypeAlias(node);
  27741. if (isNonEmptyArray(typeParams)) {
  27742. const constraintPropertyName = node.type === "TSTypeAliasDeclaration" ? "constraint" : "bound";
  27743. if (typeParams.length > 1 && typeParams.some((param) => param[constraintPropertyName] || param.default)) {
  27744. return true;
  27745. }
  27746. }
  27747. return false;
  27748. }
  27749. function getTypeParametersFromTypeAlias(node) {
  27750. if (isTypeAlias(node) && node.typeParameters && node.typeParameters.params) {
  27751. return node.typeParameters.params;
  27752. }
  27753. return null;
  27754. }
  27755. function isTypeAlias(node) {
  27756. return node.type === "TSTypeAliasDeclaration" || node.type === "TypeAlias";
  27757. }
  27758. function hasComplexTypeAnnotation(node) {
  27759. if (node.type !== "VariableDeclarator") {
  27760. return false;
  27761. }
  27762. const {
  27763. typeAnnotation
  27764. } = node.id;
  27765. if (!typeAnnotation || !typeAnnotation.typeAnnotation) {
  27766. return false;
  27767. }
  27768. const typeParams = getTypeParametersFromTypeReference(typeAnnotation.typeAnnotation);
  27769. return isNonEmptyArray(typeParams) && typeParams.length > 1 && typeParams.some((param) => isNonEmptyArray(getTypeParametersFromTypeReference(param)) || param.type === "TSConditionalType");
  27770. }
  27771. function isArrowFunctionVariableDeclarator(node) {
  27772. return node.type === "VariableDeclarator" && node.init && node.init.type === "ArrowFunctionExpression";
  27773. }
  27774. function getTypeParametersFromTypeReference(node) {
  27775. if (isTypeReference(node) && node.typeParameters && node.typeParameters.params) {
  27776. return node.typeParameters.params;
  27777. }
  27778. return null;
  27779. }
  27780. function isTypeReference(node) {
  27781. return node.type === "TSTypeReference" || node.type === "GenericTypeAnnotation";
  27782. }
  27783. function isPoorlyBreakableMemberOrCallChain(path, options, print, deep = false) {
  27784. const node = path.getValue();
  27785. const goDeeper = () => isPoorlyBreakableMemberOrCallChain(path, options, print, true);
  27786. if (node.type === "TSNonNullExpression") {
  27787. return path.call(goDeeper, "expression");
  27788. }
  27789. if (isCallExpression(node)) {
  27790. const doc2 = printCallExpression(path, options, print);
  27791. if (doc2.label === "member-chain") {
  27792. return false;
  27793. }
  27794. const args = getCallArguments(node);
  27795. const isPoorlyBreakableCall = args.length === 0 || args.length === 1 && isLoneShortArgument(args[0], options);
  27796. if (!isPoorlyBreakableCall) {
  27797. return false;
  27798. }
  27799. if (isCallExpressionWithComplexTypeArguments(node, print)) {
  27800. return false;
  27801. }
  27802. return path.call(goDeeper, "callee");
  27803. }
  27804. if (isMemberExpression(node)) {
  27805. return path.call(goDeeper, "object");
  27806. }
  27807. return deep && (node.type === "Identifier" || node.type === "ThisExpression");
  27808. }
  27809. var LONE_SHORT_ARGUMENT_THRESHOLD_RATE = 0.25;
  27810. function isLoneShortArgument(node, {
  27811. printWidth
  27812. }) {
  27813. if (hasComment(node)) {
  27814. return false;
  27815. }
  27816. const threshold = printWidth * LONE_SHORT_ARGUMENT_THRESHOLD_RATE;
  27817. if (node.type === "ThisExpression" || node.type === "Identifier" && node.name.length <= threshold || isSignedNumericLiteral(node) && !hasComment(node.argument)) {
  27818. return true;
  27819. }
  27820. const regexpPattern = node.type === "Literal" && "regex" in node && node.regex.pattern || node.type === "RegExpLiteral" && node.pattern;
  27821. if (regexpPattern) {
  27822. return regexpPattern.length <= threshold;
  27823. }
  27824. if (isStringLiteral(node)) {
  27825. return rawText(node).length <= threshold;
  27826. }
  27827. if (node.type === "TemplateLiteral") {
  27828. return node.expressions.length === 0 && node.quasis[0].value.raw.length <= threshold && !node.quasis[0].value.raw.includes("\n");
  27829. }
  27830. return isLiteral(node);
  27831. }
  27832. function isObjectPropertyWithShortKey(node, keyDoc, options) {
  27833. if (!isObjectProperty(node)) {
  27834. return false;
  27835. }
  27836. keyDoc = cleanDoc(keyDoc);
  27837. const MIN_OVERLAP_FOR_BREAK = 3;
  27838. return typeof keyDoc === "string" && getStringWidth(keyDoc) < options.tabWidth + MIN_OVERLAP_FOR_BREAK;
  27839. }
  27840. function isCallExpressionWithComplexTypeArguments(node, print) {
  27841. const typeArgs = getTypeArgumentsFromCallExpression(node);
  27842. if (isNonEmptyArray(typeArgs)) {
  27843. if (typeArgs.length > 1) {
  27844. return true;
  27845. }
  27846. if (typeArgs.length === 1) {
  27847. const firstArg = typeArgs[0];
  27848. if (firstArg.type === "TSUnionType" || firstArg.type === "UnionTypeAnnotation" || firstArg.type === "TSIntersectionType" || firstArg.type === "IntersectionTypeAnnotation" || firstArg.type === "TSTypeLiteral" || firstArg.type === "ObjectTypeAnnotation") {
  27849. return true;
  27850. }
  27851. }
  27852. const typeArgsKeyName = node.typeParameters ? "typeParameters" : "typeArguments";
  27853. if (willBreak(print(typeArgsKeyName))) {
  27854. return true;
  27855. }
  27856. }
  27857. return false;
  27858. }
  27859. function getTypeArgumentsFromCallExpression(node) {
  27860. return node.typeParameters && node.typeParameters.params || node.typeArguments && node.typeArguments.params;
  27861. }
  27862. module2.exports = {
  27863. printVariableDeclarator,
  27864. printAssignmentExpression,
  27865. printAssignment,
  27866. isArrowFunctionVariableDeclarator
  27867. };
  27868. }
  27869. });
  27870. var require_function_parameters = __commonJS2({
  27871. "src/language-js/print/function-parameters.js"(exports2, module2) {
  27872. "use strict";
  27873. var {
  27874. getNextNonSpaceNonCommentCharacter
  27875. } = require_util();
  27876. var {
  27877. printDanglingComments
  27878. } = require_comments();
  27879. var {
  27880. builders: {
  27881. line,
  27882. hardline,
  27883. softline,
  27884. group,
  27885. indent,
  27886. ifBreak
  27887. },
  27888. utils: {
  27889. removeLines,
  27890. willBreak
  27891. }
  27892. } = require("./doc.js");
  27893. var {
  27894. getFunctionParameters,
  27895. iterateFunctionParametersPath,
  27896. isSimpleType,
  27897. isTestCall,
  27898. isTypeAnnotationAFunction,
  27899. isObjectType,
  27900. isObjectTypePropertyAFunction,
  27901. hasRestParameter,
  27902. shouldPrintComma,
  27903. hasComment,
  27904. isNextLineEmpty
  27905. } = require_utils7();
  27906. var {
  27907. locEnd
  27908. } = require_loc();
  27909. var {
  27910. ArgExpansionBailout
  27911. } = require_errors();
  27912. var {
  27913. printFunctionTypeParameters
  27914. } = require_misc();
  27915. function printFunctionParameters(path, print, options, expandArg, printTypeParams) {
  27916. const functionNode = path.getValue();
  27917. const parameters = getFunctionParameters(functionNode);
  27918. const typeParams = printTypeParams ? printFunctionTypeParameters(path, options, print) : "";
  27919. if (parameters.length === 0) {
  27920. return [typeParams, "(", printDanglingComments(path, options, true, (comment) => getNextNonSpaceNonCommentCharacter(options.originalText, comment, locEnd) === ")"), ")"];
  27921. }
  27922. const parent = path.getParentNode();
  27923. const isParametersInTestCall = isTestCall(parent);
  27924. const shouldHugParameters = shouldHugFunctionParameters(functionNode);
  27925. const printed = [];
  27926. iterateFunctionParametersPath(path, (parameterPath, index) => {
  27927. const isLastParameter = index === parameters.length - 1;
  27928. if (isLastParameter && functionNode.rest) {
  27929. printed.push("...");
  27930. }
  27931. printed.push(print());
  27932. if (isLastParameter) {
  27933. return;
  27934. }
  27935. printed.push(",");
  27936. if (isParametersInTestCall || shouldHugParameters) {
  27937. printed.push(" ");
  27938. } else if (isNextLineEmpty(parameters[index], options)) {
  27939. printed.push(hardline, hardline);
  27940. } else {
  27941. printed.push(line);
  27942. }
  27943. });
  27944. if (expandArg) {
  27945. if (willBreak(typeParams) || willBreak(printed)) {
  27946. throw new ArgExpansionBailout();
  27947. }
  27948. return group([removeLines(typeParams), "(", removeLines(printed), ")"]);
  27949. }
  27950. const hasNotParameterDecorator = parameters.every((node) => !node.decorators);
  27951. if (shouldHugParameters && hasNotParameterDecorator) {
  27952. return [typeParams, "(", ...printed, ")"];
  27953. }
  27954. if (isParametersInTestCall) {
  27955. return [typeParams, "(", ...printed, ")"];
  27956. }
  27957. const isFlowShorthandWithOneArg = (isObjectTypePropertyAFunction(parent) || isTypeAnnotationAFunction(parent) || parent.type === "TypeAlias" || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType" || parent.type === "IntersectionTypeAnnotation" || parent.type === "FunctionTypeAnnotation" && parent.returnType === functionNode) && parameters.length === 1 && parameters[0].name === null && functionNode.this !== parameters[0] && parameters[0].typeAnnotation && functionNode.typeParameters === null && isSimpleType(parameters[0].typeAnnotation) && !functionNode.rest;
  27958. if (isFlowShorthandWithOneArg) {
  27959. if (options.arrowParens === "always") {
  27960. return ["(", ...printed, ")"];
  27961. }
  27962. return printed;
  27963. }
  27964. return [typeParams, "(", indent([softline, ...printed]), ifBreak(!hasRestParameter(functionNode) && shouldPrintComma(options, "all") ? "," : ""), softline, ")"];
  27965. }
  27966. function shouldHugFunctionParameters(node) {
  27967. if (!node) {
  27968. return false;
  27969. }
  27970. const parameters = getFunctionParameters(node);
  27971. if (parameters.length !== 1) {
  27972. return false;
  27973. }
  27974. const [parameter] = parameters;
  27975. return !hasComment(parameter) && (parameter.type === "ObjectPattern" || parameter.type === "ArrayPattern" || parameter.type === "Identifier" && parameter.typeAnnotation && (parameter.typeAnnotation.type === "TypeAnnotation" || parameter.typeAnnotation.type === "TSTypeAnnotation") && isObjectType(parameter.typeAnnotation.typeAnnotation) || parameter.type === "FunctionTypeParam" && isObjectType(parameter.typeAnnotation) || parameter.type === "AssignmentPattern" && (parameter.left.type === "ObjectPattern" || parameter.left.type === "ArrayPattern") && (parameter.right.type === "Identifier" || parameter.right.type === "ObjectExpression" && parameter.right.properties.length === 0 || parameter.right.type === "ArrayExpression" && parameter.right.elements.length === 0));
  27976. }
  27977. function getReturnTypeNode(functionNode) {
  27978. let returnTypeNode;
  27979. if (functionNode.returnType) {
  27980. returnTypeNode = functionNode.returnType;
  27981. if (returnTypeNode.typeAnnotation) {
  27982. returnTypeNode = returnTypeNode.typeAnnotation;
  27983. }
  27984. } else if (functionNode.typeAnnotation) {
  27985. returnTypeNode = functionNode.typeAnnotation;
  27986. }
  27987. return returnTypeNode;
  27988. }
  27989. function shouldGroupFunctionParameters(functionNode, returnTypeDoc) {
  27990. const returnTypeNode = getReturnTypeNode(functionNode);
  27991. if (!returnTypeNode) {
  27992. return false;
  27993. }
  27994. const typeParameters = functionNode.typeParameters && functionNode.typeParameters.params;
  27995. if (typeParameters) {
  27996. if (typeParameters.length > 1) {
  27997. return false;
  27998. }
  27999. if (typeParameters.length === 1) {
  28000. const typeParameter = typeParameters[0];
  28001. if (typeParameter.constraint || typeParameter.default) {
  28002. return false;
  28003. }
  28004. }
  28005. }
  28006. return getFunctionParameters(functionNode).length === 1 && (isObjectType(returnTypeNode) || willBreak(returnTypeDoc));
  28007. }
  28008. module2.exports = {
  28009. printFunctionParameters,
  28010. shouldHugFunctionParameters,
  28011. shouldGroupFunctionParameters
  28012. };
  28013. }
  28014. });
  28015. var require_type_annotation = __commonJS2({
  28016. "src/language-js/print/type-annotation.js"(exports2, module2) {
  28017. "use strict";
  28018. var {
  28019. printComments,
  28020. printDanglingComments
  28021. } = require_comments();
  28022. var {
  28023. isNonEmptyArray
  28024. } = require_util();
  28025. var {
  28026. builders: {
  28027. group,
  28028. join,
  28029. line,
  28030. softline,
  28031. indent,
  28032. align,
  28033. ifBreak
  28034. }
  28035. } = require("./doc.js");
  28036. var pathNeedsParens = require_needs_parens();
  28037. var {
  28038. locStart
  28039. } = require_loc();
  28040. var {
  28041. isSimpleType,
  28042. isObjectType,
  28043. hasLeadingOwnLineComment,
  28044. isObjectTypePropertyAFunction,
  28045. shouldPrintComma
  28046. } = require_utils7();
  28047. var {
  28048. printAssignment
  28049. } = require_assignment();
  28050. var {
  28051. printFunctionParameters,
  28052. shouldGroupFunctionParameters
  28053. } = require_function_parameters();
  28054. var {
  28055. printArrayItems
  28056. } = require_array4();
  28057. function shouldHugType(node) {
  28058. if (isSimpleType(node) || isObjectType(node)) {
  28059. return true;
  28060. }
  28061. if (node.type === "UnionTypeAnnotation" || node.type === "TSUnionType") {
  28062. const voidCount = node.types.filter((node2) => node2.type === "VoidTypeAnnotation" || node2.type === "TSVoidKeyword" || node2.type === "NullLiteralTypeAnnotation" || node2.type === "TSNullKeyword").length;
  28063. const hasObject = node.types.some((node2) => node2.type === "ObjectTypeAnnotation" || node2.type === "TSTypeLiteral" || node2.type === "GenericTypeAnnotation" || node2.type === "TSTypeReference");
  28064. if (node.types.length - 1 === voidCount && hasObject) {
  28065. return true;
  28066. }
  28067. }
  28068. return false;
  28069. }
  28070. function printOpaqueType(path, options, print) {
  28071. const semi = options.semi ? ";" : "";
  28072. const node = path.getValue();
  28073. const parts = [];
  28074. parts.push("opaque type ", print("id"), print("typeParameters"));
  28075. if (node.supertype) {
  28076. parts.push(": ", print("supertype"));
  28077. }
  28078. if (node.impltype) {
  28079. parts.push(" = ", print("impltype"));
  28080. }
  28081. parts.push(semi);
  28082. return parts;
  28083. }
  28084. function printTypeAlias(path, options, print) {
  28085. const semi = options.semi ? ";" : "";
  28086. const node = path.getValue();
  28087. const parts = [];
  28088. if (node.declare) {
  28089. parts.push("declare ");
  28090. }
  28091. parts.push("type ", print("id"), print("typeParameters"));
  28092. const rightPropertyName = node.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right";
  28093. return [printAssignment(path, options, print, parts, " =", rightPropertyName), semi];
  28094. }
  28095. function printIntersectionType(path, options, print) {
  28096. const node = path.getValue();
  28097. const types = path.map(print, "types");
  28098. const result = [];
  28099. let wasIndented = false;
  28100. for (let i = 0; i < types.length; ++i) {
  28101. if (i === 0) {
  28102. result.push(types[i]);
  28103. } else if (isObjectType(node.types[i - 1]) && isObjectType(node.types[i])) {
  28104. result.push([" & ", wasIndented ? indent(types[i]) : types[i]]);
  28105. } else if (!isObjectType(node.types[i - 1]) && !isObjectType(node.types[i])) {
  28106. result.push(indent([" &", line, types[i]]));
  28107. } else {
  28108. if (i > 1) {
  28109. wasIndented = true;
  28110. }
  28111. result.push(" & ", i > 1 ? indent(types[i]) : types[i]);
  28112. }
  28113. }
  28114. return group(result);
  28115. }
  28116. function printUnionType(path, options, print) {
  28117. const node = path.getValue();
  28118. const parent = path.getParentNode();
  28119. const shouldIndent = parent.type !== "TypeParameterInstantiation" && parent.type !== "TSTypeParameterInstantiation" && parent.type !== "GenericTypeAnnotation" && parent.type !== "TSTypeReference" && parent.type !== "TSTypeAssertion" && parent.type !== "TupleTypeAnnotation" && parent.type !== "TSTupleType" && !(parent.type === "FunctionTypeParam" && !parent.name && path.getParentNode(1).this !== parent) && !((parent.type === "TypeAlias" || parent.type === "VariableDeclarator" || parent.type === "TSTypeAliasDeclaration") && hasLeadingOwnLineComment(options.originalText, node));
  28120. const shouldHug = shouldHugType(node);
  28121. const printed = path.map((typePath) => {
  28122. let printedType = print();
  28123. if (!shouldHug) {
  28124. printedType = align(2, printedType);
  28125. }
  28126. return printComments(typePath, printedType, options);
  28127. }, "types");
  28128. if (shouldHug) {
  28129. return join(" | ", printed);
  28130. }
  28131. const shouldAddStartLine = shouldIndent && !hasLeadingOwnLineComment(options.originalText, node);
  28132. const code = [ifBreak([shouldAddStartLine ? line : "", "| "]), join([line, "| "], printed)];
  28133. if (pathNeedsParens(path, options)) {
  28134. return group([indent(code), softline]);
  28135. }
  28136. if (parent.type === "TupleTypeAnnotation" && parent.types.length > 1 || parent.type === "TSTupleType" && parent.elementTypes.length > 1) {
  28137. return group([indent([ifBreak(["(", softline]), code]), softline, ifBreak(")")]);
  28138. }
  28139. return group(shouldIndent ? indent(code) : code);
  28140. }
  28141. function printFunctionType(path, options, print) {
  28142. const node = path.getValue();
  28143. const parts = [];
  28144. const parent = path.getParentNode(0);
  28145. const parentParent = path.getParentNode(1);
  28146. const parentParentParent = path.getParentNode(2);
  28147. let isArrowFunctionTypeAnnotation = node.type === "TSFunctionType" || !((parent.type === "ObjectTypeProperty" || parent.type === "ObjectTypeInternalSlot") && !parent.variance && !parent.optional && locStart(parent) === locStart(node) || parent.type === "ObjectTypeCallProperty" || parentParentParent && parentParentParent.type === "DeclareFunction");
  28148. let needsColon = isArrowFunctionTypeAnnotation && (parent.type === "TypeAnnotation" || parent.type === "TSTypeAnnotation");
  28149. const needsParens = needsColon && isArrowFunctionTypeAnnotation && (parent.type === "TypeAnnotation" || parent.type === "TSTypeAnnotation") && parentParent.type === "ArrowFunctionExpression";
  28150. if (isObjectTypePropertyAFunction(parent)) {
  28151. isArrowFunctionTypeAnnotation = true;
  28152. needsColon = true;
  28153. }
  28154. if (needsParens) {
  28155. parts.push("(");
  28156. }
  28157. const parametersDoc = printFunctionParameters(path, print, options, false, true);
  28158. const returnTypeDoc = node.returnType || node.predicate || node.typeAnnotation ? [isArrowFunctionTypeAnnotation ? " => " : ": ", print("returnType"), print("predicate"), print("typeAnnotation")] : "";
  28159. const shouldGroupParameters = shouldGroupFunctionParameters(node, returnTypeDoc);
  28160. parts.push(shouldGroupParameters ? group(parametersDoc) : parametersDoc);
  28161. if (returnTypeDoc) {
  28162. parts.push(returnTypeDoc);
  28163. }
  28164. if (needsParens) {
  28165. parts.push(")");
  28166. }
  28167. return group(parts);
  28168. }
  28169. function printTupleType(path, options, print) {
  28170. const node = path.getValue();
  28171. const typesField = node.type === "TSTupleType" ? "elementTypes" : "types";
  28172. const types = node[typesField];
  28173. const isNonEmptyTuple = isNonEmptyArray(types);
  28174. const bracketsDelimiterLine = isNonEmptyTuple ? softline : "";
  28175. return group(["[", indent([bracketsDelimiterLine, printArrayItems(path, options, typesField, print)]), ifBreak(isNonEmptyTuple && shouldPrintComma(options, "all") ? "," : ""), printDanglingComments(path, options, true), bracketsDelimiterLine, "]"]);
  28176. }
  28177. function printIndexedAccessType(path, options, print) {
  28178. const node = path.getValue();
  28179. const leftDelimiter = node.type === "OptionalIndexedAccessType" && node.optional ? "?.[" : "[";
  28180. return [print("objectType"), leftDelimiter, print("indexType"), "]"];
  28181. }
  28182. module2.exports = {
  28183. printOpaqueType,
  28184. printTypeAlias,
  28185. printIntersectionType,
  28186. printUnionType,
  28187. printFunctionType,
  28188. printTupleType,
  28189. printIndexedAccessType,
  28190. shouldHugType
  28191. };
  28192. }
  28193. });
  28194. var require_type_parameters = __commonJS2({
  28195. "src/language-js/print/type-parameters.js"(exports2, module2) {
  28196. "use strict";
  28197. var {
  28198. printDanglingComments
  28199. } = require_comments();
  28200. var {
  28201. builders: {
  28202. join,
  28203. line,
  28204. hardline,
  28205. softline,
  28206. group,
  28207. indent,
  28208. ifBreak
  28209. }
  28210. } = require("./doc.js");
  28211. var {
  28212. isTestCall,
  28213. hasComment,
  28214. CommentCheckFlags,
  28215. isTSXFile,
  28216. shouldPrintComma,
  28217. getFunctionParameters,
  28218. isObjectType
  28219. } = require_utils7();
  28220. var {
  28221. createGroupIdMapper
  28222. } = require_util();
  28223. var {
  28224. shouldHugType
  28225. } = require_type_annotation();
  28226. var {
  28227. isArrowFunctionVariableDeclarator
  28228. } = require_assignment();
  28229. var getTypeParametersGroupId = createGroupIdMapper("typeParameters");
  28230. function printTypeParameters(path, options, print, paramsKey) {
  28231. const node = path.getValue();
  28232. if (!node[paramsKey]) {
  28233. return "";
  28234. }
  28235. if (!Array.isArray(node[paramsKey])) {
  28236. return print(paramsKey);
  28237. }
  28238. const grandparent = path.getNode(2);
  28239. const isParameterInTestCall = grandparent && isTestCall(grandparent);
  28240. const isArrowFunctionVariable = path.match((node2) => !(node2[paramsKey].length === 1 && isObjectType(node2[paramsKey][0])), void 0, (node2, name) => name === "typeAnnotation", (node2) => node2.type === "Identifier", isArrowFunctionVariableDeclarator);
  28241. const shouldInline = !isArrowFunctionVariable && (isParameterInTestCall || node[paramsKey].length === 0 || node[paramsKey].length === 1 && (node[paramsKey][0].type === "NullableTypeAnnotation" || shouldHugType(node[paramsKey][0])));
  28242. if (shouldInline) {
  28243. return ["<", join(", ", path.map(print, paramsKey)), printDanglingCommentsForInline(path, options), ">"];
  28244. }
  28245. const trailingComma = node.type === "TSTypeParameterInstantiation" ? "" : getFunctionParameters(node).length === 1 && isTSXFile(options) && !node[paramsKey][0].constraint && path.getParentNode().type === "ArrowFunctionExpression" ? "," : shouldPrintComma(options, "all") ? ifBreak(",") : "";
  28246. return group(["<", indent([softline, join([",", line], path.map(print, paramsKey))]), trailingComma, softline, ">"], {
  28247. id: getTypeParametersGroupId(node)
  28248. });
  28249. }
  28250. function printDanglingCommentsForInline(path, options) {
  28251. const node = path.getValue();
  28252. if (!hasComment(node, CommentCheckFlags.Dangling)) {
  28253. return "";
  28254. }
  28255. const hasOnlyBlockComments = !hasComment(node, CommentCheckFlags.Line);
  28256. const printed = printDanglingComments(path, options, hasOnlyBlockComments);
  28257. if (hasOnlyBlockComments) {
  28258. return printed;
  28259. }
  28260. return [printed, hardline];
  28261. }
  28262. function printTypeParameter(path, options, print) {
  28263. const node = path.getValue();
  28264. const parts = [];
  28265. const parent = path.getParentNode();
  28266. if (parent.type === "TSMappedType") {
  28267. parts.push("[", print("name"));
  28268. if (node.constraint) {
  28269. parts.push(" in ", print("constraint"));
  28270. }
  28271. if (parent.nameType) {
  28272. parts.push(" as ", path.callParent(() => print("nameType")));
  28273. }
  28274. parts.push("]");
  28275. return parts;
  28276. }
  28277. if (node.variance) {
  28278. parts.push(print("variance"));
  28279. }
  28280. parts.push(print("name"));
  28281. if (node.bound) {
  28282. parts.push(": ", print("bound"));
  28283. }
  28284. if (node.constraint) {
  28285. parts.push(" extends ", print("constraint"));
  28286. }
  28287. if (node.default) {
  28288. parts.push(" = ", print("default"));
  28289. }
  28290. return parts;
  28291. }
  28292. module2.exports = {
  28293. printTypeParameter,
  28294. printTypeParameters,
  28295. getTypeParametersGroupId
  28296. };
  28297. }
  28298. });
  28299. var require_property2 = __commonJS2({
  28300. "src/language-js/print/property.js"(exports2, module2) {
  28301. "use strict";
  28302. var {
  28303. printComments
  28304. } = require_comments();
  28305. var {
  28306. printString,
  28307. printNumber
  28308. } = require_util();
  28309. var {
  28310. isNumericLiteral,
  28311. isSimpleNumber,
  28312. isStringLiteral,
  28313. isStringPropSafeToUnquote,
  28314. rawText
  28315. } = require_utils7();
  28316. var {
  28317. printAssignment
  28318. } = require_assignment();
  28319. var needsQuoteProps = /* @__PURE__ */ new WeakMap();
  28320. function printPropertyKey(path, options, print) {
  28321. const node = path.getNode();
  28322. if (node.computed) {
  28323. return ["[", print("key"), "]"];
  28324. }
  28325. const parent = path.getParentNode();
  28326. const {
  28327. key
  28328. } = node;
  28329. if (node.type === "ClassPrivateProperty" && key.type === "Identifier") {
  28330. return ["#", print("key")];
  28331. }
  28332. if (options.quoteProps === "consistent" && !needsQuoteProps.has(parent)) {
  28333. const objectHasStringProp = (parent.properties || parent.body || parent.members).some((prop) => !prop.computed && prop.key && isStringLiteral(prop.key) && !isStringPropSafeToUnquote(prop, options));
  28334. needsQuoteProps.set(parent, objectHasStringProp);
  28335. }
  28336. if ((key.type === "Identifier" || isNumericLiteral(key) && isSimpleNumber(printNumber(rawText(key))) && String(key.value) === printNumber(rawText(key)) && !(options.parser === "typescript" || options.parser === "babel-ts")) && (options.parser === "json" || options.quoteProps === "consistent" && needsQuoteProps.get(parent))) {
  28337. const prop = printString(JSON.stringify(key.type === "Identifier" ? key.name : key.value.toString()), options);
  28338. return path.call((keyPath) => printComments(keyPath, prop, options), "key");
  28339. }
  28340. if (isStringPropSafeToUnquote(node, options) && (options.quoteProps === "as-needed" || options.quoteProps === "consistent" && !needsQuoteProps.get(parent))) {
  28341. return path.call((keyPath) => printComments(keyPath, /^\d/.test(key.value) ? printNumber(key.value) : key.value, options), "key");
  28342. }
  28343. return print("key");
  28344. }
  28345. function printProperty(path, options, print) {
  28346. const node = path.getValue();
  28347. if (node.shorthand) {
  28348. return print("value");
  28349. }
  28350. return printAssignment(path, options, print, printPropertyKey(path, options, print), ":", "value");
  28351. }
  28352. module2.exports = {
  28353. printProperty,
  28354. printPropertyKey
  28355. };
  28356. }
  28357. });
  28358. var require_function = __commonJS2({
  28359. "src/language-js/print/function.js"(exports2, module2) {
  28360. "use strict";
  28361. var assert = require("assert");
  28362. var {
  28363. printDanglingComments,
  28364. printCommentsSeparately
  28365. } = require_comments();
  28366. var getLast = require_get_last();
  28367. var {
  28368. getNextNonSpaceNonCommentCharacterIndex
  28369. } = require_util();
  28370. var {
  28371. builders: {
  28372. line,
  28373. softline,
  28374. group,
  28375. indent,
  28376. ifBreak,
  28377. hardline,
  28378. join,
  28379. indentIfBreak
  28380. },
  28381. utils: {
  28382. removeLines,
  28383. willBreak
  28384. }
  28385. } = require("./doc.js");
  28386. var {
  28387. ArgExpansionBailout
  28388. } = require_errors();
  28389. var {
  28390. getFunctionParameters,
  28391. hasLeadingOwnLineComment,
  28392. isFlowAnnotationComment,
  28393. isJsxNode,
  28394. isTemplateOnItsOwnLine,
  28395. shouldPrintComma,
  28396. startsWithNoLookaheadToken,
  28397. isBinaryish,
  28398. isLineComment,
  28399. hasComment,
  28400. getComments,
  28401. CommentCheckFlags,
  28402. isCallLikeExpression,
  28403. isCallExpression,
  28404. getCallArguments,
  28405. hasNakedLeftSide,
  28406. getLeftSide
  28407. } = require_utils7();
  28408. var {
  28409. locEnd
  28410. } = require_loc();
  28411. var {
  28412. printFunctionParameters,
  28413. shouldGroupFunctionParameters
  28414. } = require_function_parameters();
  28415. var {
  28416. printPropertyKey
  28417. } = require_property2();
  28418. var {
  28419. printFunctionTypeParameters
  28420. } = require_misc();
  28421. function printFunction(path, print, options, args) {
  28422. const node = path.getValue();
  28423. let expandArg = false;
  28424. if ((node.type === "FunctionDeclaration" || node.type === "FunctionExpression") && args && args.expandLastArg) {
  28425. const parent = path.getParentNode();
  28426. if (isCallExpression(parent) && getCallArguments(parent).length > 1) {
  28427. expandArg = true;
  28428. }
  28429. }
  28430. const parts = [];
  28431. if (node.type === "TSDeclareFunction" && node.declare) {
  28432. parts.push("declare ");
  28433. }
  28434. if (node.async) {
  28435. parts.push("async ");
  28436. }
  28437. if (node.generator) {
  28438. parts.push("function* ");
  28439. } else {
  28440. parts.push("function ");
  28441. }
  28442. if (node.id) {
  28443. parts.push(print("id"));
  28444. }
  28445. const parametersDoc = printFunctionParameters(path, print, options, expandArg);
  28446. const returnTypeDoc = printReturnType(path, print, options);
  28447. const shouldGroupParameters = shouldGroupFunctionParameters(node, returnTypeDoc);
  28448. parts.push(printFunctionTypeParameters(path, options, print), group([shouldGroupParameters ? group(parametersDoc) : parametersDoc, returnTypeDoc]), node.body ? " " : "", print("body"));
  28449. if (options.semi && (node.declare || !node.body)) {
  28450. parts.push(";");
  28451. }
  28452. return parts;
  28453. }
  28454. function printMethod(path, options, print) {
  28455. const node = path.getNode();
  28456. const {
  28457. kind
  28458. } = node;
  28459. const value = node.value || node;
  28460. const parts = [];
  28461. if (!kind || kind === "init" || kind === "method" || kind === "constructor") {
  28462. if (value.async) {
  28463. parts.push("async ");
  28464. }
  28465. } else {
  28466. assert.ok(kind === "get" || kind === "set");
  28467. parts.push(kind, " ");
  28468. }
  28469. if (value.generator) {
  28470. parts.push("*");
  28471. }
  28472. parts.push(printPropertyKey(path, options, print), node.optional || node.key.optional ? "?" : "");
  28473. if (node === value) {
  28474. parts.push(printMethodInternal(path, options, print));
  28475. } else if (value.type === "FunctionExpression") {
  28476. parts.push(path.call((path2) => printMethodInternal(path2, options, print), "value"));
  28477. } else {
  28478. parts.push(print("value"));
  28479. }
  28480. return parts;
  28481. }
  28482. function printMethodInternal(path, options, print) {
  28483. const node = path.getNode();
  28484. const parametersDoc = printFunctionParameters(path, print, options);
  28485. const returnTypeDoc = printReturnType(path, print, options);
  28486. const shouldGroupParameters = shouldGroupFunctionParameters(node, returnTypeDoc);
  28487. const parts = [printFunctionTypeParameters(path, options, print), group([shouldGroupParameters ? group(parametersDoc) : parametersDoc, returnTypeDoc])];
  28488. if (node.body) {
  28489. parts.push(" ", print("body"));
  28490. } else {
  28491. parts.push(options.semi ? ";" : "");
  28492. }
  28493. return parts;
  28494. }
  28495. function printArrowFunctionSignature(path, options, print, args) {
  28496. const node = path.getValue();
  28497. const parts = [];
  28498. if (node.async) {
  28499. parts.push("async ");
  28500. }
  28501. if (shouldPrintParamsWithoutParens(path, options)) {
  28502. parts.push(print(["params", 0]));
  28503. } else {
  28504. const expandArg = args && (args.expandLastArg || args.expandFirstArg);
  28505. let returnTypeDoc = printReturnType(path, print, options);
  28506. if (expandArg) {
  28507. if (willBreak(returnTypeDoc)) {
  28508. throw new ArgExpansionBailout();
  28509. }
  28510. returnTypeDoc = group(removeLines(returnTypeDoc));
  28511. }
  28512. parts.push(group([printFunctionParameters(path, print, options, expandArg, true), returnTypeDoc]));
  28513. }
  28514. const dangling = printDanglingComments(path, options, true, (comment) => {
  28515. const nextCharacter = getNextNonSpaceNonCommentCharacterIndex(options.originalText, comment, locEnd);
  28516. return nextCharacter !== false && options.originalText.slice(nextCharacter, nextCharacter + 2) === "=>";
  28517. });
  28518. if (dangling) {
  28519. parts.push(" ", dangling);
  28520. }
  28521. return parts;
  28522. }
  28523. function printArrowChain(path, args, signatures, shouldBreak, bodyDoc, tailNode) {
  28524. const name = path.getName();
  28525. const parent = path.getParentNode();
  28526. const isCallee = isCallLikeExpression(parent) && name === "callee";
  28527. const isAssignmentRhs = Boolean(args && args.assignmentLayout);
  28528. const shouldPutBodyOnSeparateLine = tailNode.body.type !== "BlockStatement" && tailNode.body.type !== "ObjectExpression" && tailNode.body.type !== "SequenceExpression";
  28529. const shouldBreakBeforeChain = isCallee && shouldPutBodyOnSeparateLine || args && args.assignmentLayout === "chain-tail-arrow-chain";
  28530. const groupId = Symbol("arrow-chain");
  28531. if (tailNode.body.type === "SequenceExpression") {
  28532. bodyDoc = group(["(", indent([softline, bodyDoc]), softline, ")"]);
  28533. }
  28534. return group([group(indent([isCallee || isAssignmentRhs ? softline : "", group(join([" =>", line], signatures), {
  28535. shouldBreak
  28536. })]), {
  28537. id: groupId,
  28538. shouldBreak: shouldBreakBeforeChain
  28539. }), " =>", indentIfBreak(shouldPutBodyOnSeparateLine ? indent([line, bodyDoc]) : [" ", bodyDoc], {
  28540. groupId
  28541. }), isCallee ? ifBreak(softline, "", {
  28542. groupId
  28543. }) : ""]);
  28544. }
  28545. function printArrowFunction(path, options, print, args) {
  28546. let node = path.getValue();
  28547. const signatures = [];
  28548. const body = [];
  28549. let chainShouldBreak = false;
  28550. (function rec() {
  28551. const doc2 = printArrowFunctionSignature(path, options, print, args);
  28552. if (signatures.length === 0) {
  28553. signatures.push(doc2);
  28554. } else {
  28555. const {
  28556. leading,
  28557. trailing
  28558. } = printCommentsSeparately(path, options);
  28559. signatures.push([leading, doc2]);
  28560. body.unshift(trailing);
  28561. }
  28562. chainShouldBreak = chainShouldBreak || node.returnType && getFunctionParameters(node).length > 0 || node.typeParameters || getFunctionParameters(node).some((param) => param.type !== "Identifier");
  28563. if (node.body.type !== "ArrowFunctionExpression" || args && args.expandLastArg) {
  28564. body.unshift(print("body", args));
  28565. } else {
  28566. node = node.body;
  28567. path.call(rec, "body");
  28568. }
  28569. })();
  28570. if (signatures.length > 1) {
  28571. return printArrowChain(path, args, signatures, chainShouldBreak, body, node);
  28572. }
  28573. const parts = signatures;
  28574. parts.push(" =>");
  28575. if (!hasLeadingOwnLineComment(options.originalText, node.body) && (node.body.type === "ArrayExpression" || node.body.type === "ObjectExpression" || node.body.type === "BlockStatement" || isJsxNode(node.body) || isTemplateOnItsOwnLine(node.body, options.originalText) || node.body.type === "ArrowFunctionExpression" || node.body.type === "DoExpression")) {
  28576. return group([...parts, " ", body]);
  28577. }
  28578. if (node.body.type === "SequenceExpression") {
  28579. return group([...parts, group([" (", indent([softline, body]), softline, ")"])]);
  28580. }
  28581. const shouldAddSoftLine = (args && args.expandLastArg || path.getParentNode().type === "JSXExpressionContainer") && !hasComment(node);
  28582. const printTrailingComma = args && args.expandLastArg && shouldPrintComma(options, "all");
  28583. const shouldAddParens = node.body.type === "ConditionalExpression" && !startsWithNoLookaheadToken(node.body, false);
  28584. return group([...parts, group([indent([line, shouldAddParens ? ifBreak("", "(") : "", body, shouldAddParens ? ifBreak("", ")") : ""]), shouldAddSoftLine ? [ifBreak(printTrailingComma ? "," : ""), softline] : ""])]);
  28585. }
  28586. function canPrintParamsWithoutParens(node) {
  28587. const parameters = getFunctionParameters(node);
  28588. return parameters.length === 1 && !node.typeParameters && !hasComment(node, CommentCheckFlags.Dangling) && parameters[0].type === "Identifier" && !parameters[0].typeAnnotation && !hasComment(parameters[0]) && !parameters[0].optional && !node.predicate && !node.returnType;
  28589. }
  28590. function shouldPrintParamsWithoutParens(path, options) {
  28591. if (options.arrowParens === "always") {
  28592. return false;
  28593. }
  28594. if (options.arrowParens === "avoid") {
  28595. const node = path.getValue();
  28596. return canPrintParamsWithoutParens(node);
  28597. }
  28598. return false;
  28599. }
  28600. function printReturnType(path, print, options) {
  28601. const node = path.getValue();
  28602. const returnType = print("returnType");
  28603. if (node.returnType && isFlowAnnotationComment(options.originalText, node.returnType)) {
  28604. return [" /*: ", returnType, " */"];
  28605. }
  28606. const parts = [returnType];
  28607. if (node.returnType && node.returnType.typeAnnotation) {
  28608. parts.unshift(": ");
  28609. }
  28610. if (node.predicate) {
  28611. parts.push(node.returnType ? " " : ": ", print("predicate"));
  28612. }
  28613. return parts;
  28614. }
  28615. function printReturnOrThrowArgument(path, options, print) {
  28616. const node = path.getValue();
  28617. const semi = options.semi ? ";" : "";
  28618. const parts = [];
  28619. if (node.argument) {
  28620. if (returnArgumentHasLeadingComment(options, node.argument)) {
  28621. parts.push([" (", indent([hardline, print("argument")]), hardline, ")"]);
  28622. } else if (isBinaryish(node.argument) || node.argument.type === "SequenceExpression") {
  28623. parts.push(group([ifBreak(" (", " "), indent([softline, print("argument")]), softline, ifBreak(")")]));
  28624. } else {
  28625. parts.push(" ", print("argument"));
  28626. }
  28627. }
  28628. const comments = getComments(node);
  28629. const lastComment = getLast(comments);
  28630. const isLastCommentLine = lastComment && isLineComment(lastComment);
  28631. if (isLastCommentLine) {
  28632. parts.push(semi);
  28633. }
  28634. if (hasComment(node, CommentCheckFlags.Dangling)) {
  28635. parts.push(" ", printDanglingComments(path, options, true));
  28636. }
  28637. if (!isLastCommentLine) {
  28638. parts.push(semi);
  28639. }
  28640. return parts;
  28641. }
  28642. function printReturnStatement(path, options, print) {
  28643. return ["return", printReturnOrThrowArgument(path, options, print)];
  28644. }
  28645. function printThrowStatement(path, options, print) {
  28646. return ["throw", printReturnOrThrowArgument(path, options, print)];
  28647. }
  28648. function returnArgumentHasLeadingComment(options, argument) {
  28649. if (hasLeadingOwnLineComment(options.originalText, argument)) {
  28650. return true;
  28651. }
  28652. if (hasNakedLeftSide(argument)) {
  28653. let leftMost = argument;
  28654. let newLeftMost;
  28655. while (newLeftMost = getLeftSide(leftMost)) {
  28656. leftMost = newLeftMost;
  28657. if (hasLeadingOwnLineComment(options.originalText, leftMost)) {
  28658. return true;
  28659. }
  28660. }
  28661. }
  28662. return false;
  28663. }
  28664. module2.exports = {
  28665. printFunction,
  28666. printArrowFunction,
  28667. printMethod,
  28668. printReturnStatement,
  28669. printThrowStatement,
  28670. printMethodInternal,
  28671. shouldPrintParamsWithoutParens
  28672. };
  28673. }
  28674. });
  28675. var require_decorators = __commonJS2({
  28676. "src/language-js/print/decorators.js"(exports2, module2) {
  28677. "use strict";
  28678. var {
  28679. isNonEmptyArray,
  28680. hasNewline
  28681. } = require_util();
  28682. var {
  28683. builders: {
  28684. line,
  28685. hardline,
  28686. join,
  28687. breakParent,
  28688. group
  28689. }
  28690. } = require("./doc.js");
  28691. var {
  28692. locStart,
  28693. locEnd
  28694. } = require_loc();
  28695. var {
  28696. getParentExportDeclaration
  28697. } = require_utils7();
  28698. function printClassMemberDecorators(path, options, print) {
  28699. const node = path.getValue();
  28700. return group([join(line, path.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node, options) ? hardline : line]);
  28701. }
  28702. function printDecoratorsBeforeExport(path, options, print) {
  28703. return [join(hardline, path.map(print, "declaration", "decorators")), hardline];
  28704. }
  28705. function printDecorators(path, options, print) {
  28706. const node = path.getValue();
  28707. const {
  28708. decorators
  28709. } = node;
  28710. if (!isNonEmptyArray(decorators) || hasDecoratorsBeforeExport(path.getParentNode())) {
  28711. return;
  28712. }
  28713. const shouldBreak = node.type === "ClassExpression" || node.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators(node, options);
  28714. return [getParentExportDeclaration(path) ? hardline : shouldBreak ? breakParent : "", join(line, path.map(print, "decorators")), line];
  28715. }
  28716. function hasNewlineBetweenOrAfterDecorators(node, options) {
  28717. return node.decorators.some((decorator) => hasNewline(options.originalText, locEnd(decorator)));
  28718. }
  28719. function hasDecoratorsBeforeExport(node) {
  28720. if (node.type !== "ExportDefaultDeclaration" && node.type !== "ExportNamedDeclaration" && node.type !== "DeclareExportDeclaration") {
  28721. return false;
  28722. }
  28723. const decorators = node.declaration && node.declaration.decorators;
  28724. return isNonEmptyArray(decorators) && locStart(node, {
  28725. ignoreDecorators: true
  28726. }) > locStart(decorators[0]);
  28727. }
  28728. module2.exports = {
  28729. printDecorators,
  28730. printClassMemberDecorators,
  28731. printDecoratorsBeforeExport,
  28732. hasDecoratorsBeforeExport
  28733. };
  28734. }
  28735. });
  28736. var require_class = __commonJS2({
  28737. "src/language-js/print/class.js"(exports2, module2) {
  28738. "use strict";
  28739. var {
  28740. isNonEmptyArray,
  28741. createGroupIdMapper
  28742. } = require_util();
  28743. var {
  28744. printComments,
  28745. printDanglingComments
  28746. } = require_comments();
  28747. var {
  28748. builders: {
  28749. join,
  28750. line,
  28751. hardline,
  28752. softline,
  28753. group,
  28754. indent,
  28755. ifBreak
  28756. }
  28757. } = require("./doc.js");
  28758. var {
  28759. hasComment,
  28760. CommentCheckFlags
  28761. } = require_utils7();
  28762. var {
  28763. getTypeParametersGroupId
  28764. } = require_type_parameters();
  28765. var {
  28766. printMethod
  28767. } = require_function();
  28768. var {
  28769. printOptionalToken,
  28770. printTypeAnnotation,
  28771. printDefiniteToken
  28772. } = require_misc();
  28773. var {
  28774. printPropertyKey
  28775. } = require_property2();
  28776. var {
  28777. printAssignment
  28778. } = require_assignment();
  28779. var {
  28780. printClassMemberDecorators
  28781. } = require_decorators();
  28782. function printClass(path, options, print) {
  28783. const node = path.getValue();
  28784. const parts = [];
  28785. if (node.declare) {
  28786. parts.push("declare ");
  28787. }
  28788. if (node.abstract) {
  28789. parts.push("abstract ");
  28790. }
  28791. parts.push("class");
  28792. const groupMode = node.id && hasComment(node.id, CommentCheckFlags.Trailing) || node.typeParameters && hasComment(node.typeParameters, CommentCheckFlags.Trailing) || node.superClass && hasComment(node.superClass) || isNonEmptyArray(node.extends) || isNonEmptyArray(node.mixins) || isNonEmptyArray(node.implements);
  28793. const partsGroup = [];
  28794. const extendsParts = [];
  28795. if (node.id) {
  28796. partsGroup.push(" ", print("id"));
  28797. }
  28798. partsGroup.push(print("typeParameters"));
  28799. if (node.superClass) {
  28800. const printed = [printSuperClass(path, options, print), print("superTypeParameters")];
  28801. const printedWithComments = path.call((superClass) => ["extends ", printComments(superClass, printed, options)], "superClass");
  28802. if (groupMode) {
  28803. extendsParts.push(line, group(printedWithComments));
  28804. } else {
  28805. extendsParts.push(" ", printedWithComments);
  28806. }
  28807. } else {
  28808. extendsParts.push(printList(path, options, print, "extends"));
  28809. }
  28810. extendsParts.push(printList(path, options, print, "mixins"), printList(path, options, print, "implements"));
  28811. if (groupMode) {
  28812. let printedPartsGroup;
  28813. if (shouldIndentOnlyHeritageClauses(node)) {
  28814. printedPartsGroup = [...partsGroup, indent(extendsParts)];
  28815. } else {
  28816. printedPartsGroup = indent([...partsGroup, extendsParts]);
  28817. }
  28818. parts.push(group(printedPartsGroup, {
  28819. id: getHeritageGroupId(node)
  28820. }));
  28821. } else {
  28822. parts.push(...partsGroup, ...extendsParts);
  28823. }
  28824. parts.push(" ", print("body"));
  28825. return parts;
  28826. }
  28827. var getHeritageGroupId = createGroupIdMapper("heritageGroup");
  28828. function printHardlineAfterHeritage(node) {
  28829. return ifBreak(hardline, "", {
  28830. groupId: getHeritageGroupId(node)
  28831. });
  28832. }
  28833. function hasMultipleHeritage(node) {
  28834. return ["superClass", "extends", "mixins", "implements"].filter((key) => Boolean(node[key])).length > 1;
  28835. }
  28836. function shouldIndentOnlyHeritageClauses(node) {
  28837. return node.typeParameters && !hasComment(node.typeParameters, CommentCheckFlags.Trailing | CommentCheckFlags.Line) && !hasMultipleHeritage(node);
  28838. }
  28839. function printList(path, options, print, listName) {
  28840. const node = path.getValue();
  28841. if (!isNonEmptyArray(node[listName])) {
  28842. return "";
  28843. }
  28844. const printedLeadingComments = printDanglingComments(path, options, true, ({
  28845. marker
  28846. }) => marker === listName);
  28847. return [shouldIndentOnlyHeritageClauses(node) ? ifBreak(" ", line, {
  28848. groupId: getTypeParametersGroupId(node.typeParameters)
  28849. }) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group(indent([line, join([",", line], path.map(print, listName))]))];
  28850. }
  28851. function printSuperClass(path, options, print) {
  28852. const printed = print("superClass");
  28853. const parent = path.getParentNode();
  28854. if (parent.type === "AssignmentExpression") {
  28855. return group(ifBreak(["(", indent([softline, printed]), softline, ")"], printed));
  28856. }
  28857. return printed;
  28858. }
  28859. function printClassMethod(path, options, print) {
  28860. const node = path.getValue();
  28861. const parts = [];
  28862. if (isNonEmptyArray(node.decorators)) {
  28863. parts.push(printClassMemberDecorators(path, options, print));
  28864. }
  28865. if (node.accessibility) {
  28866. parts.push(node.accessibility + " ");
  28867. }
  28868. if (node.readonly) {
  28869. parts.push("readonly ");
  28870. }
  28871. if (node.declare) {
  28872. parts.push("declare ");
  28873. }
  28874. if (node.static) {
  28875. parts.push("static ");
  28876. }
  28877. if (node.type === "TSAbstractMethodDefinition" || node.abstract) {
  28878. parts.push("abstract ");
  28879. }
  28880. if (node.override) {
  28881. parts.push("override ");
  28882. }
  28883. parts.push(printMethod(path, options, print));
  28884. return parts;
  28885. }
  28886. function printClassProperty(path, options, print) {
  28887. const node = path.getValue();
  28888. const parts = [];
  28889. const semi = options.semi ? ";" : "";
  28890. if (isNonEmptyArray(node.decorators)) {
  28891. parts.push(printClassMemberDecorators(path, options, print));
  28892. }
  28893. if (node.accessibility) {
  28894. parts.push(node.accessibility + " ");
  28895. }
  28896. if (node.declare) {
  28897. parts.push("declare ");
  28898. }
  28899. if (node.static) {
  28900. parts.push("static ");
  28901. }
  28902. if (node.type === "TSAbstractPropertyDefinition" || node.abstract) {
  28903. parts.push("abstract ");
  28904. }
  28905. if (node.override) {
  28906. parts.push("override ");
  28907. }
  28908. if (node.readonly) {
  28909. parts.push("readonly ");
  28910. }
  28911. if (node.variance) {
  28912. parts.push(print("variance"));
  28913. }
  28914. if (node.type === "ClassAccessorProperty") {
  28915. parts.push("accessor ");
  28916. }
  28917. parts.push(printPropertyKey(path, options, print), printOptionalToken(path), printDefiniteToken(path), printTypeAnnotation(path, options, print));
  28918. return [printAssignment(path, options, print, parts, " =", "value"), semi];
  28919. }
  28920. module2.exports = {
  28921. printClass,
  28922. printClassMethod,
  28923. printClassProperty,
  28924. printHardlineAfterHeritage
  28925. };
  28926. }
  28927. });
  28928. var require_interface = __commonJS2({
  28929. "src/language-js/print/interface.js"(exports2, module2) {
  28930. "use strict";
  28931. var {
  28932. isNonEmptyArray
  28933. } = require_util();
  28934. var {
  28935. builders: {
  28936. join,
  28937. line,
  28938. group,
  28939. indent,
  28940. ifBreak
  28941. }
  28942. } = require("./doc.js");
  28943. var {
  28944. hasComment,
  28945. identity,
  28946. CommentCheckFlags
  28947. } = require_utils7();
  28948. var {
  28949. getTypeParametersGroupId
  28950. } = require_type_parameters();
  28951. var {
  28952. printTypeScriptModifiers
  28953. } = require_misc();
  28954. function printInterface(path, options, print) {
  28955. const node = path.getValue();
  28956. const parts = [];
  28957. if (node.declare) {
  28958. parts.push("declare ");
  28959. }
  28960. if (node.type === "TSInterfaceDeclaration") {
  28961. parts.push(node.abstract ? "abstract " : "", printTypeScriptModifiers(path, options, print));
  28962. }
  28963. parts.push("interface");
  28964. const partsGroup = [];
  28965. const extendsParts = [];
  28966. if (node.type !== "InterfaceTypeAnnotation") {
  28967. partsGroup.push(" ", print("id"), print("typeParameters"));
  28968. }
  28969. const shouldIndentOnlyHeritageClauses = node.typeParameters && !hasComment(node.typeParameters, CommentCheckFlags.Trailing | CommentCheckFlags.Line);
  28970. if (isNonEmptyArray(node.extends)) {
  28971. extendsParts.push(shouldIndentOnlyHeritageClauses ? ifBreak(" ", line, {
  28972. groupId: getTypeParametersGroupId(node.typeParameters)
  28973. }) : line, "extends ", (node.extends.length === 1 ? identity : indent)(join([",", line], path.map(print, "extends"))));
  28974. }
  28975. if (node.id && hasComment(node.id, CommentCheckFlags.Trailing) || isNonEmptyArray(node.extends)) {
  28976. if (shouldIndentOnlyHeritageClauses) {
  28977. parts.push(group([...partsGroup, indent(extendsParts)]));
  28978. } else {
  28979. parts.push(group(indent([...partsGroup, ...extendsParts])));
  28980. }
  28981. } else {
  28982. parts.push(...partsGroup, ...extendsParts);
  28983. }
  28984. parts.push(" ", print("body"));
  28985. return group(parts);
  28986. }
  28987. module2.exports = {
  28988. printInterface
  28989. };
  28990. }
  28991. });
  28992. var require_module = __commonJS2({
  28993. "src/language-js/print/module.js"(exports2, module2) {
  28994. "use strict";
  28995. var {
  28996. isNonEmptyArray
  28997. } = require_util();
  28998. var {
  28999. builders: {
  29000. softline,
  29001. group,
  29002. indent,
  29003. join,
  29004. line,
  29005. ifBreak,
  29006. hardline
  29007. }
  29008. } = require("./doc.js");
  29009. var {
  29010. printDanglingComments
  29011. } = require_comments();
  29012. var {
  29013. hasComment,
  29014. CommentCheckFlags,
  29015. shouldPrintComma,
  29016. needsHardlineAfterDanglingComment,
  29017. isStringLiteral,
  29018. rawText
  29019. } = require_utils7();
  29020. var {
  29021. locStart,
  29022. hasSameLoc
  29023. } = require_loc();
  29024. var {
  29025. hasDecoratorsBeforeExport,
  29026. printDecoratorsBeforeExport
  29027. } = require_decorators();
  29028. function printImportDeclaration(path, options, print) {
  29029. const node = path.getValue();
  29030. const semi = options.semi ? ";" : "";
  29031. const parts = [];
  29032. const {
  29033. importKind
  29034. } = node;
  29035. parts.push("import");
  29036. if (importKind && importKind !== "value") {
  29037. parts.push(" ", importKind);
  29038. }
  29039. parts.push(printModuleSpecifiers(path, options, print), printModuleSource(path, options, print), printImportAssertions(path, options, print), semi);
  29040. return parts;
  29041. }
  29042. function printExportDeclaration(path, options, print) {
  29043. const node = path.getValue();
  29044. const parts = [];
  29045. if (hasDecoratorsBeforeExport(node)) {
  29046. parts.push(printDecoratorsBeforeExport(path, options, print));
  29047. }
  29048. const {
  29049. type,
  29050. exportKind,
  29051. declaration
  29052. } = node;
  29053. parts.push("export");
  29054. const isDefaultExport = node.default || type === "ExportDefaultDeclaration";
  29055. if (isDefaultExport) {
  29056. parts.push(" default");
  29057. }
  29058. if (hasComment(node, CommentCheckFlags.Dangling)) {
  29059. parts.push(" ", printDanglingComments(path, options, true));
  29060. if (needsHardlineAfterDanglingComment(node)) {
  29061. parts.push(hardline);
  29062. }
  29063. }
  29064. if (declaration) {
  29065. parts.push(" ", print("declaration"));
  29066. } else {
  29067. parts.push(exportKind === "type" ? " type" : "", printModuleSpecifiers(path, options, print), printModuleSource(path, options, print), printImportAssertions(path, options, print));
  29068. }
  29069. if (shouldExportDeclarationPrintSemi(node, options)) {
  29070. parts.push(";");
  29071. }
  29072. return parts;
  29073. }
  29074. function printExportAllDeclaration(path, options, print) {
  29075. const node = path.getValue();
  29076. const semi = options.semi ? ";" : "";
  29077. const parts = [];
  29078. const {
  29079. exportKind,
  29080. exported
  29081. } = node;
  29082. parts.push("export");
  29083. if (exportKind === "type") {
  29084. parts.push(" type");
  29085. }
  29086. parts.push(" *");
  29087. if (exported) {
  29088. parts.push(" as ", print("exported"));
  29089. }
  29090. parts.push(printModuleSource(path, options, print), printImportAssertions(path, options, print), semi);
  29091. return parts;
  29092. }
  29093. function shouldExportDeclarationPrintSemi(node, options) {
  29094. if (!options.semi) {
  29095. return false;
  29096. }
  29097. const {
  29098. type,
  29099. declaration
  29100. } = node;
  29101. const isDefaultExport = node.default || type === "ExportDefaultDeclaration";
  29102. if (!declaration) {
  29103. return true;
  29104. }
  29105. const {
  29106. type: declarationType
  29107. } = declaration;
  29108. if (isDefaultExport && declarationType !== "ClassDeclaration" && declarationType !== "FunctionDeclaration" && declarationType !== "TSInterfaceDeclaration" && declarationType !== "DeclareClass" && declarationType !== "DeclareFunction" && declarationType !== "TSDeclareFunction" && declarationType !== "EnumDeclaration") {
  29109. return true;
  29110. }
  29111. return false;
  29112. }
  29113. function printModuleSource(path, options, print) {
  29114. const node = path.getValue();
  29115. if (!node.source) {
  29116. return "";
  29117. }
  29118. const parts = [];
  29119. if (!shouldNotPrintSpecifiers(node, options)) {
  29120. parts.push(" from");
  29121. }
  29122. parts.push(" ", print("source"));
  29123. return parts;
  29124. }
  29125. function printModuleSpecifiers(path, options, print) {
  29126. const node = path.getValue();
  29127. if (shouldNotPrintSpecifiers(node, options)) {
  29128. return "";
  29129. }
  29130. const parts = [" "];
  29131. if (isNonEmptyArray(node.specifiers)) {
  29132. const standaloneSpecifiers = [];
  29133. const groupedSpecifiers = [];
  29134. path.each(() => {
  29135. const specifierType = path.getValue().type;
  29136. if (specifierType === "ExportNamespaceSpecifier" || specifierType === "ExportDefaultSpecifier" || specifierType === "ImportNamespaceSpecifier" || specifierType === "ImportDefaultSpecifier") {
  29137. standaloneSpecifiers.push(print());
  29138. } else if (specifierType === "ExportSpecifier" || specifierType === "ImportSpecifier") {
  29139. groupedSpecifiers.push(print());
  29140. } else {
  29141. throw new Error(`Unknown specifier type ${JSON.stringify(specifierType)}`);
  29142. }
  29143. }, "specifiers");
  29144. parts.push(join(", ", standaloneSpecifiers));
  29145. if (groupedSpecifiers.length > 0) {
  29146. if (standaloneSpecifiers.length > 0) {
  29147. parts.push(", ");
  29148. }
  29149. const canBreak = groupedSpecifiers.length > 1 || standaloneSpecifiers.length > 0 || node.specifiers.some((node2) => hasComment(node2));
  29150. if (canBreak) {
  29151. parts.push(group(["{", indent([options.bracketSpacing ? line : softline, join([",", line], groupedSpecifiers)]), ifBreak(shouldPrintComma(options) ? "," : ""), options.bracketSpacing ? line : softline, "}"]));
  29152. } else {
  29153. parts.push(["{", options.bracketSpacing ? " " : "", ...groupedSpecifiers, options.bracketSpacing ? " " : "", "}"]);
  29154. }
  29155. }
  29156. } else {
  29157. parts.push("{}");
  29158. }
  29159. return parts;
  29160. }
  29161. function shouldNotPrintSpecifiers(node, options) {
  29162. const {
  29163. type,
  29164. importKind,
  29165. source,
  29166. specifiers
  29167. } = node;
  29168. if (type !== "ImportDeclaration" || isNonEmptyArray(specifiers) || importKind === "type") {
  29169. return false;
  29170. }
  29171. return !/{\s*}/.test(options.originalText.slice(locStart(node), locStart(source)));
  29172. }
  29173. function printImportAssertions(path, options, print) {
  29174. const node = path.getNode();
  29175. if (isNonEmptyArray(node.assertions)) {
  29176. return [" assert {", options.bracketSpacing ? " " : "", join(", ", path.map(print, "assertions")), options.bracketSpacing ? " " : "", "}"];
  29177. }
  29178. return "";
  29179. }
  29180. function printModuleSpecifier(path, options, print) {
  29181. const node = path.getNode();
  29182. const {
  29183. type
  29184. } = node;
  29185. const parts = [];
  29186. const kind = type === "ImportSpecifier" ? node.importKind : node.exportKind;
  29187. if (kind && kind !== "value") {
  29188. parts.push(kind, " ");
  29189. }
  29190. const isImport = type.startsWith("Import");
  29191. const leftSideProperty = isImport ? "imported" : "local";
  29192. const rightSideProperty = isImport ? "local" : "exported";
  29193. const leftSideNode = node[leftSideProperty];
  29194. const rightSideNode = node[rightSideProperty];
  29195. let left = "";
  29196. let right = "";
  29197. if (type === "ExportNamespaceSpecifier" || type === "ImportNamespaceSpecifier") {
  29198. left = "*";
  29199. } else if (leftSideNode) {
  29200. left = print(leftSideProperty);
  29201. }
  29202. if (rightSideNode && !isShorthandSpecifier(node)) {
  29203. right = print(rightSideProperty);
  29204. }
  29205. parts.push(left, left && right ? " as " : "", right);
  29206. return parts;
  29207. }
  29208. function isShorthandSpecifier(specifier) {
  29209. if (specifier.type !== "ImportSpecifier" && specifier.type !== "ExportSpecifier") {
  29210. return false;
  29211. }
  29212. const {
  29213. local,
  29214. [specifier.type === "ImportSpecifier" ? "imported" : "exported"]: importedOrExported
  29215. } = specifier;
  29216. if (local.type !== importedOrExported.type || !hasSameLoc(local, importedOrExported)) {
  29217. return false;
  29218. }
  29219. if (isStringLiteral(local)) {
  29220. return local.value === importedOrExported.value && rawText(local) === rawText(importedOrExported);
  29221. }
  29222. switch (local.type) {
  29223. case "Identifier":
  29224. return local.name === importedOrExported.name;
  29225. default:
  29226. return false;
  29227. }
  29228. }
  29229. module2.exports = {
  29230. printImportDeclaration,
  29231. printExportDeclaration,
  29232. printExportAllDeclaration,
  29233. printModuleSpecifier
  29234. };
  29235. }
  29236. });
  29237. var require_object = __commonJS2({
  29238. "src/language-js/print/object.js"(exports2, module2) {
  29239. "use strict";
  29240. var {
  29241. printDanglingComments
  29242. } = require_comments();
  29243. var {
  29244. builders: {
  29245. line,
  29246. softline,
  29247. group,
  29248. indent,
  29249. ifBreak,
  29250. hardline
  29251. }
  29252. } = require("./doc.js");
  29253. var {
  29254. getLast,
  29255. hasNewlineInRange,
  29256. hasNewline,
  29257. isNonEmptyArray
  29258. } = require_util();
  29259. var {
  29260. shouldPrintComma,
  29261. hasComment,
  29262. getComments,
  29263. CommentCheckFlags,
  29264. isNextLineEmpty
  29265. } = require_utils7();
  29266. var {
  29267. locStart,
  29268. locEnd
  29269. } = require_loc();
  29270. var {
  29271. printOptionalToken,
  29272. printTypeAnnotation
  29273. } = require_misc();
  29274. var {
  29275. shouldHugFunctionParameters
  29276. } = require_function_parameters();
  29277. var {
  29278. shouldHugType
  29279. } = require_type_annotation();
  29280. var {
  29281. printHardlineAfterHeritage
  29282. } = require_class();
  29283. function printObject(path, options, print) {
  29284. const semi = options.semi ? ";" : "";
  29285. const node = path.getValue();
  29286. let propertiesField;
  29287. if (node.type === "TSTypeLiteral") {
  29288. propertiesField = "members";
  29289. } else if (node.type === "TSInterfaceBody") {
  29290. propertiesField = "body";
  29291. } else {
  29292. propertiesField = "properties";
  29293. }
  29294. const isTypeAnnotation = node.type === "ObjectTypeAnnotation";
  29295. const fields = [propertiesField];
  29296. if (isTypeAnnotation) {
  29297. fields.push("indexers", "callProperties", "internalSlots");
  29298. }
  29299. const firstProperty = fields.map((field) => node[field][0]).sort((a, b) => locStart(a) - locStart(b))[0];
  29300. const parent = path.getParentNode(0);
  29301. const isFlowInterfaceLikeBody = isTypeAnnotation && parent && (parent.type === "InterfaceDeclaration" || parent.type === "DeclareInterface" || parent.type === "DeclareClass") && path.getName() === "body";
  29302. const shouldBreak = node.type === "TSInterfaceBody" || isFlowInterfaceLikeBody || node.type === "ObjectPattern" && parent.type !== "FunctionDeclaration" && parent.type !== "FunctionExpression" && parent.type !== "ArrowFunctionExpression" && parent.type !== "ObjectMethod" && parent.type !== "ClassMethod" && parent.type !== "ClassPrivateMethod" && parent.type !== "AssignmentPattern" && parent.type !== "CatchClause" && node.properties.some((property) => property.value && (property.value.type === "ObjectPattern" || property.value.type === "ArrayPattern")) || node.type !== "ObjectPattern" && firstProperty && hasNewlineInRange(options.originalText, locStart(node), locStart(firstProperty));
  29303. const separator = isFlowInterfaceLikeBody ? ";" : node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral" ? ifBreak(semi, ";") : ",";
  29304. const leftBrace = node.type === "RecordExpression" ? "#{" : node.exact ? "{|" : "{";
  29305. const rightBrace = node.exact ? "|}" : "}";
  29306. const propsAndLoc = [];
  29307. for (const field of fields) {
  29308. path.each((childPath) => {
  29309. const node2 = childPath.getValue();
  29310. propsAndLoc.push({
  29311. node: node2,
  29312. printed: print(),
  29313. loc: locStart(node2)
  29314. });
  29315. }, field);
  29316. }
  29317. if (fields.length > 1) {
  29318. propsAndLoc.sort((a, b) => a.loc - b.loc);
  29319. }
  29320. let separatorParts = [];
  29321. const props = propsAndLoc.map((prop) => {
  29322. const result = [...separatorParts, group(prop.printed)];
  29323. separatorParts = [separator, line];
  29324. if ((prop.node.type === "TSPropertySignature" || prop.node.type === "TSMethodSignature" || prop.node.type === "TSConstructSignatureDeclaration") && hasComment(prop.node, CommentCheckFlags.PrettierIgnore)) {
  29325. separatorParts.shift();
  29326. }
  29327. if (isNextLineEmpty(prop.node, options)) {
  29328. separatorParts.push(hardline);
  29329. }
  29330. return result;
  29331. });
  29332. if (node.inexact) {
  29333. let printed;
  29334. if (hasComment(node, CommentCheckFlags.Dangling)) {
  29335. const hasLineComments = hasComment(node, CommentCheckFlags.Line);
  29336. const printedDanglingComments = printDanglingComments(path, options, true);
  29337. printed = [printedDanglingComments, hasLineComments || hasNewline(options.originalText, locEnd(getLast(getComments(node)))) ? hardline : line, "..."];
  29338. } else {
  29339. printed = ["..."];
  29340. }
  29341. props.push([...separatorParts, ...printed]);
  29342. }
  29343. const lastElem = getLast(node[propertiesField]);
  29344. const canHaveTrailingSeparator = !(node.inexact || lastElem && lastElem.type === "RestElement" || lastElem && (lastElem.type === "TSPropertySignature" || lastElem.type === "TSCallSignatureDeclaration" || lastElem.type === "TSMethodSignature" || lastElem.type === "TSConstructSignatureDeclaration") && hasComment(lastElem, CommentCheckFlags.PrettierIgnore));
  29345. let content;
  29346. if (props.length === 0) {
  29347. if (!hasComment(node, CommentCheckFlags.Dangling)) {
  29348. return [leftBrace, rightBrace, printTypeAnnotation(path, options, print)];
  29349. }
  29350. content = group([leftBrace, printDanglingComments(path, options), softline, rightBrace, printOptionalToken(path), printTypeAnnotation(path, options, print)]);
  29351. } else {
  29352. content = [isFlowInterfaceLikeBody && isNonEmptyArray(node.properties) ? printHardlineAfterHeritage(parent) : "", leftBrace, indent([options.bracketSpacing ? line : softline, ...props]), ifBreak(canHaveTrailingSeparator && (separator !== "," || shouldPrintComma(options)) ? separator : ""), options.bracketSpacing ? line : softline, rightBrace, printOptionalToken(path), printTypeAnnotation(path, options, print)];
  29353. }
  29354. if (path.match((node2) => node2.type === "ObjectPattern" && !node2.decorators, (node2, name, number) => shouldHugFunctionParameters(node2) && (name === "params" || name === "parameters" || name === "this" || name === "rest") && number === 0) || path.match(shouldHugType, (node2, name) => name === "typeAnnotation", (node2, name) => name === "typeAnnotation", (node2, name, number) => shouldHugFunctionParameters(node2) && (name === "params" || name === "parameters" || name === "this" || name === "rest") && number === 0) || !shouldBreak && path.match((node2) => node2.type === "ObjectPattern", (node2) => node2.type === "AssignmentExpression" || node2.type === "VariableDeclarator")) {
  29355. return content;
  29356. }
  29357. return group(content, {
  29358. shouldBreak
  29359. });
  29360. }
  29361. module2.exports = {
  29362. printObject
  29363. };
  29364. }
  29365. });
  29366. var require_flow = __commonJS2({
  29367. "src/language-js/print/flow.js"(exports2, module2) {
  29368. "use strict";
  29369. var assert = require("assert");
  29370. var {
  29371. printDanglingComments
  29372. } = require_comments();
  29373. var {
  29374. printString,
  29375. printNumber
  29376. } = require_util();
  29377. var {
  29378. builders: {
  29379. hardline,
  29380. softline,
  29381. group,
  29382. indent
  29383. }
  29384. } = require("./doc.js");
  29385. var {
  29386. getParentExportDeclaration,
  29387. isFunctionNotation,
  29388. isGetterOrSetter,
  29389. rawText,
  29390. shouldPrintComma
  29391. } = require_utils7();
  29392. var {
  29393. locStart,
  29394. locEnd
  29395. } = require_loc();
  29396. var {
  29397. printClass
  29398. } = require_class();
  29399. var {
  29400. printOpaqueType,
  29401. printTypeAlias,
  29402. printIntersectionType,
  29403. printUnionType,
  29404. printFunctionType,
  29405. printTupleType,
  29406. printIndexedAccessType
  29407. } = require_type_annotation();
  29408. var {
  29409. printInterface
  29410. } = require_interface();
  29411. var {
  29412. printTypeParameter,
  29413. printTypeParameters
  29414. } = require_type_parameters();
  29415. var {
  29416. printExportDeclaration,
  29417. printExportAllDeclaration
  29418. } = require_module();
  29419. var {
  29420. printArrayItems
  29421. } = require_array4();
  29422. var {
  29423. printObject
  29424. } = require_object();
  29425. var {
  29426. printPropertyKey
  29427. } = require_property2();
  29428. var {
  29429. printOptionalToken,
  29430. printTypeAnnotation,
  29431. printRestSpread
  29432. } = require_misc();
  29433. function printFlow(path, options, print) {
  29434. const node = path.getValue();
  29435. const semi = options.semi ? ";" : "";
  29436. const parts = [];
  29437. switch (node.type) {
  29438. case "DeclareClass":
  29439. return printFlowDeclaration(path, printClass(path, options, print));
  29440. case "DeclareFunction":
  29441. return printFlowDeclaration(path, ["function ", print("id"), node.predicate ? " " : "", print("predicate"), semi]);
  29442. case "DeclareModule":
  29443. return printFlowDeclaration(path, ["module ", print("id"), " ", print("body")]);
  29444. case "DeclareModuleExports":
  29445. return printFlowDeclaration(path, ["module.exports", ": ", print("typeAnnotation"), semi]);
  29446. case "DeclareVariable":
  29447. return printFlowDeclaration(path, ["var ", print("id"), semi]);
  29448. case "DeclareOpaqueType":
  29449. return printFlowDeclaration(path, printOpaqueType(path, options, print));
  29450. case "DeclareInterface":
  29451. return printFlowDeclaration(path, printInterface(path, options, print));
  29452. case "DeclareTypeAlias":
  29453. return printFlowDeclaration(path, printTypeAlias(path, options, print));
  29454. case "DeclareExportDeclaration":
  29455. return printFlowDeclaration(path, printExportDeclaration(path, options, print));
  29456. case "DeclareExportAllDeclaration":
  29457. return printFlowDeclaration(path, printExportAllDeclaration(path, options, print));
  29458. case "OpaqueType":
  29459. return printOpaqueType(path, options, print);
  29460. case "TypeAlias":
  29461. return printTypeAlias(path, options, print);
  29462. case "IntersectionTypeAnnotation":
  29463. return printIntersectionType(path, options, print);
  29464. case "UnionTypeAnnotation":
  29465. return printUnionType(path, options, print);
  29466. case "FunctionTypeAnnotation":
  29467. return printFunctionType(path, options, print);
  29468. case "TupleTypeAnnotation":
  29469. return printTupleType(path, options, print);
  29470. case "GenericTypeAnnotation":
  29471. return [print("id"), printTypeParameters(path, options, print, "typeParameters")];
  29472. case "IndexedAccessType":
  29473. case "OptionalIndexedAccessType":
  29474. return printIndexedAccessType(path, options, print);
  29475. case "TypeAnnotation":
  29476. return print("typeAnnotation");
  29477. case "TypeParameter":
  29478. return printTypeParameter(path, options, print);
  29479. case "TypeofTypeAnnotation":
  29480. return ["typeof ", print("argument")];
  29481. case "ExistsTypeAnnotation":
  29482. return "*";
  29483. case "EmptyTypeAnnotation":
  29484. return "empty";
  29485. case "MixedTypeAnnotation":
  29486. return "mixed";
  29487. case "ArrayTypeAnnotation":
  29488. return [print("elementType"), "[]"];
  29489. case "BooleanLiteralTypeAnnotation":
  29490. return String(node.value);
  29491. case "EnumDeclaration":
  29492. return ["enum ", print("id"), " ", print("body")];
  29493. case "EnumBooleanBody":
  29494. case "EnumNumberBody":
  29495. case "EnumStringBody":
  29496. case "EnumSymbolBody": {
  29497. if (node.type === "EnumSymbolBody" || node.explicitType) {
  29498. let type = null;
  29499. switch (node.type) {
  29500. case "EnumBooleanBody":
  29501. type = "boolean";
  29502. break;
  29503. case "EnumNumberBody":
  29504. type = "number";
  29505. break;
  29506. case "EnumStringBody":
  29507. type = "string";
  29508. break;
  29509. case "EnumSymbolBody":
  29510. type = "symbol";
  29511. break;
  29512. }
  29513. parts.push("of ", type, " ");
  29514. }
  29515. if (node.members.length === 0 && !node.hasUnknownMembers) {
  29516. parts.push(group(["{", printDanglingComments(path, options), softline, "}"]));
  29517. } else {
  29518. const members = node.members.length > 0 ? [hardline, printArrayItems(path, options, "members", print), node.hasUnknownMembers || shouldPrintComma(options) ? "," : ""] : [];
  29519. parts.push(group(["{", indent([...members, ...node.hasUnknownMembers ? [hardline, "..."] : []]), printDanglingComments(path, options, true), hardline, "}"]));
  29520. }
  29521. return parts;
  29522. }
  29523. case "EnumBooleanMember":
  29524. case "EnumNumberMember":
  29525. case "EnumStringMember":
  29526. return [print("id"), " = ", typeof node.init === "object" ? print("init") : String(node.init)];
  29527. case "EnumDefaultedMember":
  29528. return print("id");
  29529. case "FunctionTypeParam": {
  29530. const name = node.name ? print("name") : path.getParentNode().this === node ? "this" : "";
  29531. return [name, printOptionalToken(path), name ? ": " : "", print("typeAnnotation")];
  29532. }
  29533. case "InterfaceDeclaration":
  29534. case "InterfaceTypeAnnotation":
  29535. return printInterface(path, options, print);
  29536. case "ClassImplements":
  29537. case "InterfaceExtends":
  29538. return [print("id"), print("typeParameters")];
  29539. case "NullableTypeAnnotation":
  29540. return ["?", print("typeAnnotation")];
  29541. case "Variance": {
  29542. const {
  29543. kind
  29544. } = node;
  29545. assert.ok(kind === "plus" || kind === "minus");
  29546. return kind === "plus" ? "+" : "-";
  29547. }
  29548. case "ObjectTypeCallProperty":
  29549. if (node.static) {
  29550. parts.push("static ");
  29551. }
  29552. parts.push(print("value"));
  29553. return parts;
  29554. case "ObjectTypeIndexer": {
  29555. return [node.static ? "static " : "", node.variance ? print("variance") : "", "[", print("id"), node.id ? ": " : "", print("key"), "]: ", print("value")];
  29556. }
  29557. case "ObjectTypeProperty": {
  29558. let modifier = "";
  29559. if (node.proto) {
  29560. modifier = "proto ";
  29561. } else if (node.static) {
  29562. modifier = "static ";
  29563. }
  29564. return [modifier, isGetterOrSetter(node) ? node.kind + " " : "", node.variance ? print("variance") : "", printPropertyKey(path, options, print), printOptionalToken(path), isFunctionNotation(node) ? "" : ": ", print("value")];
  29565. }
  29566. case "ObjectTypeAnnotation":
  29567. return printObject(path, options, print);
  29568. case "ObjectTypeInternalSlot":
  29569. return [node.static ? "static " : "", "[[", print("id"), "]]", printOptionalToken(path), node.method ? "" : ": ", print("value")];
  29570. case "ObjectTypeSpreadProperty":
  29571. return printRestSpread(path, options, print);
  29572. case "QualifiedTypeofIdentifier":
  29573. case "QualifiedTypeIdentifier":
  29574. return [print("qualification"), ".", print("id")];
  29575. case "StringLiteralTypeAnnotation":
  29576. return printString(rawText(node), options);
  29577. case "NumberLiteralTypeAnnotation":
  29578. assert.strictEqual(typeof node.value, "number");
  29579. case "BigIntLiteralTypeAnnotation":
  29580. if (node.extra) {
  29581. return printNumber(node.extra.raw);
  29582. }
  29583. return printNumber(node.raw);
  29584. case "TypeCastExpression": {
  29585. return ["(", print("expression"), printTypeAnnotation(path, options, print), ")"];
  29586. }
  29587. case "TypeParameterDeclaration":
  29588. case "TypeParameterInstantiation": {
  29589. const printed = printTypeParameters(path, options, print, "params");
  29590. if (options.parser === "flow") {
  29591. const start = locStart(node);
  29592. const end = locEnd(node);
  29593. const commentStartIndex = options.originalText.lastIndexOf("/*", start);
  29594. const commentEndIndex = options.originalText.indexOf("*/", end);
  29595. if (commentStartIndex !== -1 && commentEndIndex !== -1) {
  29596. const comment = options.originalText.slice(commentStartIndex + 2, commentEndIndex).trim();
  29597. if (comment.startsWith("::") && !comment.includes("/*") && !comment.includes("*/")) {
  29598. return ["/*:: ", printed, " */"];
  29599. }
  29600. }
  29601. }
  29602. return printed;
  29603. }
  29604. case "InferredPredicate":
  29605. return "%checks";
  29606. case "DeclaredPredicate":
  29607. return ["%checks(", print("value"), ")"];
  29608. case "AnyTypeAnnotation":
  29609. return "any";
  29610. case "BooleanTypeAnnotation":
  29611. return "boolean";
  29612. case "BigIntTypeAnnotation":
  29613. return "bigint";
  29614. case "NullLiteralTypeAnnotation":
  29615. return "null";
  29616. case "NumberTypeAnnotation":
  29617. return "number";
  29618. case "SymbolTypeAnnotation":
  29619. return "symbol";
  29620. case "StringTypeAnnotation":
  29621. return "string";
  29622. case "VoidTypeAnnotation":
  29623. return "void";
  29624. case "ThisTypeAnnotation":
  29625. return "this";
  29626. case "Node":
  29627. case "Printable":
  29628. case "SourceLocation":
  29629. case "Position":
  29630. case "Statement":
  29631. case "Function":
  29632. case "Pattern":
  29633. case "Expression":
  29634. case "Declaration":
  29635. case "Specifier":
  29636. case "NamedSpecifier":
  29637. case "Comment":
  29638. case "MemberTypeAnnotation":
  29639. case "Type":
  29640. throw new Error("unprintable type: " + JSON.stringify(node.type));
  29641. }
  29642. }
  29643. function printFlowDeclaration(path, printed) {
  29644. const parentExportDecl = getParentExportDeclaration(path);
  29645. if (parentExportDecl) {
  29646. assert.strictEqual(parentExportDecl.type, "DeclareExportDeclaration");
  29647. return printed;
  29648. }
  29649. return ["declare ", printed];
  29650. }
  29651. module2.exports = {
  29652. printFlow
  29653. };
  29654. }
  29655. });
  29656. var require_is_ts_keyword_type = __commonJS2({
  29657. "src/language-js/utils/is-ts-keyword-type.js"(exports2, module2) {
  29658. "use strict";
  29659. function isTsKeywordType({
  29660. type
  29661. }) {
  29662. return type.startsWith("TS") && type.endsWith("Keyword");
  29663. }
  29664. module2.exports = isTsKeywordType;
  29665. }
  29666. });
  29667. var require_ternary = __commonJS2({
  29668. "src/language-js/print/ternary.js"(exports2, module2) {
  29669. "use strict";
  29670. var {
  29671. hasNewlineInRange
  29672. } = require_util();
  29673. var {
  29674. isJsxNode,
  29675. getComments,
  29676. isCallExpression,
  29677. isMemberExpression
  29678. } = require_utils7();
  29679. var {
  29680. locStart,
  29681. locEnd
  29682. } = require_loc();
  29683. var isBlockComment = require_is_block_comment();
  29684. var {
  29685. builders: {
  29686. line,
  29687. softline,
  29688. group,
  29689. indent,
  29690. align,
  29691. ifBreak,
  29692. dedent,
  29693. breakParent
  29694. }
  29695. } = require("./doc.js");
  29696. function conditionalExpressionChainContainsJsx(node) {
  29697. const conditionalExpressions = [node];
  29698. for (let index = 0; index < conditionalExpressions.length; index++) {
  29699. const conditionalExpression = conditionalExpressions[index];
  29700. for (const property of ["test", "consequent", "alternate"]) {
  29701. const node2 = conditionalExpression[property];
  29702. if (isJsxNode(node2)) {
  29703. return true;
  29704. }
  29705. if (node2.type === "ConditionalExpression") {
  29706. conditionalExpressions.push(node2);
  29707. }
  29708. }
  29709. }
  29710. return false;
  29711. }
  29712. function printTernaryTest(path, options, print) {
  29713. const node = path.getValue();
  29714. const isConditionalExpression = node.type === "ConditionalExpression";
  29715. const alternateNodePropertyName = isConditionalExpression ? "alternate" : "falseType";
  29716. const parent = path.getParentNode();
  29717. const printed = isConditionalExpression ? print("test") : [print("checkType"), " ", "extends", " ", print("extendsType")];
  29718. if (parent.type === node.type && parent[alternateNodePropertyName] === node) {
  29719. return align(2, printed);
  29720. }
  29721. return printed;
  29722. }
  29723. var ancestorNameMap = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"]]);
  29724. function shouldExtraIndentForConditionalExpression(path) {
  29725. const node = path.getValue();
  29726. if (node.type !== "ConditionalExpression") {
  29727. return false;
  29728. }
  29729. let parent;
  29730. let child = node;
  29731. for (let ancestorCount = 0; !parent; ancestorCount++) {
  29732. const node2 = path.getParentNode(ancestorCount);
  29733. if (isCallExpression(node2) && node2.callee === child || isMemberExpression(node2) && node2.object === child || node2.type === "TSNonNullExpression" && node2.expression === child) {
  29734. child = node2;
  29735. continue;
  29736. }
  29737. if (node2.type === "NewExpression" && node2.callee === child || node2.type === "TSAsExpression" && node2.expression === child) {
  29738. parent = path.getParentNode(ancestorCount + 1);
  29739. child = node2;
  29740. } else {
  29741. parent = node2;
  29742. }
  29743. }
  29744. if (child === node) {
  29745. return false;
  29746. }
  29747. return parent[ancestorNameMap.get(parent.type)] === child;
  29748. }
  29749. function printTernary(path, options, print) {
  29750. const node = path.getValue();
  29751. const isConditionalExpression = node.type === "ConditionalExpression";
  29752. const consequentNodePropertyName = isConditionalExpression ? "consequent" : "trueType";
  29753. const alternateNodePropertyName = isConditionalExpression ? "alternate" : "falseType";
  29754. const testNodePropertyNames = isConditionalExpression ? ["test"] : ["checkType", "extendsType"];
  29755. const consequentNode = node[consequentNodePropertyName];
  29756. const alternateNode = node[alternateNodePropertyName];
  29757. const parts = [];
  29758. let jsxMode = false;
  29759. const parent = path.getParentNode();
  29760. const isParentTest = parent.type === node.type && testNodePropertyNames.some((prop) => parent[prop] === node);
  29761. let forceNoIndent = parent.type === node.type && !isParentTest;
  29762. let currentParent;
  29763. let previousParent;
  29764. let i = 0;
  29765. do {
  29766. previousParent = currentParent || node;
  29767. currentParent = path.getParentNode(i);
  29768. i++;
  29769. } while (currentParent && currentParent.type === node.type && testNodePropertyNames.every((prop) => currentParent[prop] !== previousParent));
  29770. const firstNonConditionalParent = currentParent || parent;
  29771. const lastConditionalParent = previousParent;
  29772. if (isConditionalExpression && (isJsxNode(node[testNodePropertyNames[0]]) || isJsxNode(consequentNode) || isJsxNode(alternateNode) || conditionalExpressionChainContainsJsx(lastConditionalParent))) {
  29773. jsxMode = true;
  29774. forceNoIndent = true;
  29775. const wrap = (doc2) => [ifBreak("("), indent([softline, doc2]), softline, ifBreak(")")];
  29776. const isNil = (node2) => node2.type === "NullLiteral" || node2.type === "Literal" && node2.value === null || node2.type === "Identifier" && node2.name === "undefined";
  29777. parts.push(" ? ", isNil(consequentNode) ? print(consequentNodePropertyName) : wrap(print(consequentNodePropertyName)), " : ", alternateNode.type === node.type || isNil(alternateNode) ? print(alternateNodePropertyName) : wrap(print(alternateNodePropertyName)));
  29778. } else {
  29779. const part = [line, "? ", consequentNode.type === node.type ? ifBreak("", "(") : "", align(2, print(consequentNodePropertyName)), consequentNode.type === node.type ? ifBreak("", ")") : "", line, ": ", alternateNode.type === node.type ? print(alternateNodePropertyName) : align(2, print(alternateNodePropertyName))];
  29780. parts.push(parent.type !== node.type || parent[alternateNodePropertyName] === node || isParentTest ? part : options.useTabs ? dedent(indent(part)) : align(Math.max(0, options.tabWidth - 2), part));
  29781. }
  29782. const comments = [...testNodePropertyNames.map((propertyName) => getComments(node[propertyName])), getComments(consequentNode), getComments(alternateNode)].flat();
  29783. const shouldBreak = comments.some((comment) => isBlockComment(comment) && hasNewlineInRange(options.originalText, locStart(comment), locEnd(comment)));
  29784. const maybeGroup = (doc2) => parent === firstNonConditionalParent ? group(doc2, {
  29785. shouldBreak
  29786. }) : shouldBreak ? [doc2, breakParent] : doc2;
  29787. const breakClosingParen = !jsxMode && (isMemberExpression(parent) || parent.type === "NGPipeExpression" && parent.left === node) && !parent.computed;
  29788. const shouldExtraIndent = shouldExtraIndentForConditionalExpression(path);
  29789. const result = maybeGroup([printTernaryTest(path, options, print), forceNoIndent ? parts : indent(parts), isConditionalExpression && breakClosingParen && !shouldExtraIndent ? softline : ""]);
  29790. return isParentTest || shouldExtraIndent ? group([indent([softline, result]), softline]) : result;
  29791. }
  29792. module2.exports = {
  29793. printTernary
  29794. };
  29795. }
  29796. });
  29797. var require_statement = __commonJS2({
  29798. "src/language-js/print/statement.js"(exports2, module2) {
  29799. "use strict";
  29800. var {
  29801. builders: {
  29802. hardline
  29803. }
  29804. } = require("./doc.js");
  29805. var pathNeedsParens = require_needs_parens();
  29806. var {
  29807. getLeftSidePathName,
  29808. hasNakedLeftSide,
  29809. isJsxNode,
  29810. isTheOnlyJsxElementInMarkdown,
  29811. hasComment,
  29812. CommentCheckFlags,
  29813. isNextLineEmpty
  29814. } = require_utils7();
  29815. var {
  29816. shouldPrintParamsWithoutParens
  29817. } = require_function();
  29818. function printStatementSequence(path, options, print, property) {
  29819. const node = path.getValue();
  29820. const parts = [];
  29821. const isClassBody = node.type === "ClassBody";
  29822. const lastStatement = getLastStatement(node[property]);
  29823. path.each((path2, index, statements) => {
  29824. const node2 = path2.getValue();
  29825. if (node2.type === "EmptyStatement") {
  29826. return;
  29827. }
  29828. const printed = print();
  29829. if (!options.semi && !isClassBody && !isTheOnlyJsxElementInMarkdown(options, path2) && statementNeedsASIProtection(path2, options)) {
  29830. if (hasComment(node2, CommentCheckFlags.Leading)) {
  29831. parts.push(print([], {
  29832. needsSemi: true
  29833. }));
  29834. } else {
  29835. parts.push(";", printed);
  29836. }
  29837. } else {
  29838. parts.push(printed);
  29839. }
  29840. if (!options.semi && isClassBody && isClassProperty(node2) && shouldPrintSemicolonAfterClassProperty(node2, statements[index + 1])) {
  29841. parts.push(";");
  29842. }
  29843. if (node2 !== lastStatement) {
  29844. parts.push(hardline);
  29845. if (isNextLineEmpty(node2, options)) {
  29846. parts.push(hardline);
  29847. }
  29848. }
  29849. }, property);
  29850. return parts;
  29851. }
  29852. function getLastStatement(statements) {
  29853. for (let i = statements.length - 1; i >= 0; i--) {
  29854. const statement = statements[i];
  29855. if (statement.type !== "EmptyStatement") {
  29856. return statement;
  29857. }
  29858. }
  29859. }
  29860. function statementNeedsASIProtection(path, options) {
  29861. const node = path.getNode();
  29862. if (node.type !== "ExpressionStatement") {
  29863. return false;
  29864. }
  29865. return path.call((childPath) => expressionNeedsASIProtection(childPath, options), "expression");
  29866. }
  29867. function expressionNeedsASIProtection(path, options) {
  29868. const node = path.getValue();
  29869. switch (node.type) {
  29870. case "ParenthesizedExpression":
  29871. case "TypeCastExpression":
  29872. case "ArrayExpression":
  29873. case "ArrayPattern":
  29874. case "TemplateLiteral":
  29875. case "TemplateElement":
  29876. case "RegExpLiteral":
  29877. return true;
  29878. case "ArrowFunctionExpression": {
  29879. if (!shouldPrintParamsWithoutParens(path, options)) {
  29880. return true;
  29881. }
  29882. break;
  29883. }
  29884. case "UnaryExpression": {
  29885. const {
  29886. prefix,
  29887. operator
  29888. } = node;
  29889. if (prefix && (operator === "+" || operator === "-")) {
  29890. return true;
  29891. }
  29892. break;
  29893. }
  29894. case "BindExpression": {
  29895. if (!node.object) {
  29896. return true;
  29897. }
  29898. break;
  29899. }
  29900. case "Literal": {
  29901. if (node.regex) {
  29902. return true;
  29903. }
  29904. break;
  29905. }
  29906. default: {
  29907. if (isJsxNode(node)) {
  29908. return true;
  29909. }
  29910. }
  29911. }
  29912. if (pathNeedsParens(path, options)) {
  29913. return true;
  29914. }
  29915. if (!hasNakedLeftSide(node)) {
  29916. return false;
  29917. }
  29918. return path.call((childPath) => expressionNeedsASIProtection(childPath, options), ...getLeftSidePathName(path, node));
  29919. }
  29920. function printBody(path, options, print) {
  29921. return printStatementSequence(path, options, print, "body");
  29922. }
  29923. function printSwitchCaseConsequent(path, options, print) {
  29924. return printStatementSequence(path, options, print, "consequent");
  29925. }
  29926. var isClassProperty = ({
  29927. type
  29928. }) => type === "ClassProperty" || type === "PropertyDefinition" || type === "ClassPrivateProperty" || type === "ClassAccessorProperty";
  29929. function shouldPrintSemicolonAfterClassProperty(node, nextNode) {
  29930. const name = node.key && node.key.name;
  29931. if ((name === "static" || name === "get" || name === "set") && !node.value && !node.typeAnnotation) {
  29932. return true;
  29933. }
  29934. if (!nextNode) {
  29935. return false;
  29936. }
  29937. if (nextNode.static || nextNode.accessibility) {
  29938. return false;
  29939. }
  29940. if (!nextNode.computed) {
  29941. const name2 = nextNode.key && nextNode.key.name;
  29942. if (name2 === "in" || name2 === "instanceof") {
  29943. return true;
  29944. }
  29945. }
  29946. if (isClassProperty(nextNode) && nextNode.variance && !nextNode.static && !nextNode.declare) {
  29947. return true;
  29948. }
  29949. switch (nextNode.type) {
  29950. case "ClassProperty":
  29951. case "PropertyDefinition":
  29952. case "TSAbstractPropertyDefinition":
  29953. return nextNode.computed;
  29954. case "MethodDefinition":
  29955. case "TSAbstractMethodDefinition":
  29956. case "ClassMethod":
  29957. case "ClassPrivateMethod": {
  29958. const isAsync = nextNode.value ? nextNode.value.async : nextNode.async;
  29959. if (isAsync || nextNode.kind === "get" || nextNode.kind === "set") {
  29960. return false;
  29961. }
  29962. const isGenerator = nextNode.value ? nextNode.value.generator : nextNode.generator;
  29963. if (nextNode.computed || isGenerator) {
  29964. return true;
  29965. }
  29966. return false;
  29967. }
  29968. case "TSIndexSignature":
  29969. return true;
  29970. }
  29971. return false;
  29972. }
  29973. module2.exports = {
  29974. printBody,
  29975. printSwitchCaseConsequent
  29976. };
  29977. }
  29978. });
  29979. var require_block = __commonJS2({
  29980. "src/language-js/print/block.js"(exports2, module2) {
  29981. "use strict";
  29982. var {
  29983. printDanglingComments
  29984. } = require_comments();
  29985. var {
  29986. isNonEmptyArray
  29987. } = require_util();
  29988. var {
  29989. builders: {
  29990. hardline,
  29991. indent
  29992. }
  29993. } = require("./doc.js");
  29994. var {
  29995. hasComment,
  29996. CommentCheckFlags,
  29997. isNextLineEmpty
  29998. } = require_utils7();
  29999. var {
  30000. printHardlineAfterHeritage
  30001. } = require_class();
  30002. var {
  30003. printBody
  30004. } = require_statement();
  30005. function printBlock(path, options, print) {
  30006. const node = path.getValue();
  30007. const parts = [];
  30008. if (node.type === "StaticBlock") {
  30009. parts.push("static ");
  30010. }
  30011. if (node.type === "ClassBody" && isNonEmptyArray(node.body)) {
  30012. const parent = path.getParentNode();
  30013. parts.push(printHardlineAfterHeritage(parent));
  30014. }
  30015. parts.push("{");
  30016. const printed = printBlockBody(path, options, print);
  30017. if (printed) {
  30018. parts.push(indent([hardline, printed]), hardline);
  30019. } else {
  30020. const parent = path.getParentNode();
  30021. const parentParent = path.getParentNode(1);
  30022. if (!(parent.type === "ArrowFunctionExpression" || parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration" || parent.type === "ObjectMethod" || parent.type === "ClassMethod" || parent.type === "ClassPrivateMethod" || parent.type === "ForStatement" || parent.type === "WhileStatement" || parent.type === "DoWhileStatement" || parent.type === "DoExpression" || parent.type === "CatchClause" && !parentParent.finalizer || parent.type === "TSModuleDeclaration" || parent.type === "TSDeclareFunction" || node.type === "StaticBlock" || node.type === "ClassBody")) {
  30023. parts.push(hardline);
  30024. }
  30025. }
  30026. parts.push("}");
  30027. return parts;
  30028. }
  30029. function printBlockBody(path, options, print) {
  30030. const node = path.getValue();
  30031. const nodeHasDirectives = isNonEmptyArray(node.directives);
  30032. const nodeHasBody = node.body.some((node2) => node2.type !== "EmptyStatement");
  30033. const nodeHasComment = hasComment(node, CommentCheckFlags.Dangling);
  30034. if (!nodeHasDirectives && !nodeHasBody && !nodeHasComment) {
  30035. return "";
  30036. }
  30037. const parts = [];
  30038. if (nodeHasDirectives) {
  30039. path.each((childPath, index, directives) => {
  30040. parts.push(print());
  30041. if (index < directives.length - 1 || nodeHasBody || nodeHasComment) {
  30042. parts.push(hardline);
  30043. if (isNextLineEmpty(childPath.getValue(), options)) {
  30044. parts.push(hardline);
  30045. }
  30046. }
  30047. }, "directives");
  30048. }
  30049. if (nodeHasBody) {
  30050. parts.push(printBody(path, options, print));
  30051. }
  30052. if (nodeHasComment) {
  30053. parts.push(printDanglingComments(path, options, true));
  30054. }
  30055. if (node.type === "Program") {
  30056. const parent = path.getParentNode();
  30057. if (!parent || parent.type !== "ModuleExpression") {
  30058. parts.push(hardline);
  30059. }
  30060. }
  30061. return parts;
  30062. }
  30063. module2.exports = {
  30064. printBlock,
  30065. printBlockBody
  30066. };
  30067. }
  30068. });
  30069. var require_typescript = __commonJS2({
  30070. "src/language-js/print/typescript.js"(exports2, module2) {
  30071. "use strict";
  30072. var {
  30073. printDanglingComments
  30074. } = require_comments();
  30075. var {
  30076. hasNewlineInRange
  30077. } = require_util();
  30078. var {
  30079. builders: {
  30080. join,
  30081. line,
  30082. hardline,
  30083. softline,
  30084. group,
  30085. indent,
  30086. conditionalGroup,
  30087. ifBreak
  30088. }
  30089. } = require("./doc.js");
  30090. var {
  30091. isLiteral,
  30092. getTypeScriptMappedTypeModifier,
  30093. shouldPrintComma,
  30094. isCallExpression,
  30095. isMemberExpression
  30096. } = require_utils7();
  30097. var isTsKeywordType = require_is_ts_keyword_type();
  30098. var {
  30099. locStart,
  30100. locEnd
  30101. } = require_loc();
  30102. var {
  30103. printOptionalToken,
  30104. printTypeScriptModifiers
  30105. } = require_misc();
  30106. var {
  30107. printTernary
  30108. } = require_ternary();
  30109. var {
  30110. printFunctionParameters,
  30111. shouldGroupFunctionParameters
  30112. } = require_function_parameters();
  30113. var {
  30114. printTemplateLiteral
  30115. } = require_template_literal();
  30116. var {
  30117. printArrayItems
  30118. } = require_array4();
  30119. var {
  30120. printObject
  30121. } = require_object();
  30122. var {
  30123. printClassProperty,
  30124. printClassMethod
  30125. } = require_class();
  30126. var {
  30127. printTypeParameter,
  30128. printTypeParameters
  30129. } = require_type_parameters();
  30130. var {
  30131. printPropertyKey
  30132. } = require_property2();
  30133. var {
  30134. printFunction,
  30135. printMethodInternal
  30136. } = require_function();
  30137. var {
  30138. printInterface
  30139. } = require_interface();
  30140. var {
  30141. printBlock
  30142. } = require_block();
  30143. var {
  30144. printTypeAlias,
  30145. printIntersectionType,
  30146. printUnionType,
  30147. printFunctionType,
  30148. printTupleType,
  30149. printIndexedAccessType
  30150. } = require_type_annotation();
  30151. function printTypescript(path, options, print) {
  30152. const node = path.getValue();
  30153. if (!node.type.startsWith("TS")) {
  30154. return;
  30155. }
  30156. if (isTsKeywordType(node)) {
  30157. return node.type.slice(2, -7).toLowerCase();
  30158. }
  30159. const semi = options.semi ? ";" : "";
  30160. const parts = [];
  30161. switch (node.type) {
  30162. case "TSThisType":
  30163. return "this";
  30164. case "TSTypeAssertion": {
  30165. const shouldBreakAfterCast = !(node.expression.type === "ArrayExpression" || node.expression.type === "ObjectExpression");
  30166. const castGroup = group(["<", indent([softline, print("typeAnnotation")]), softline, ">"]);
  30167. const exprContents = [ifBreak("("), indent([softline, print("expression")]), softline, ifBreak(")")];
  30168. if (shouldBreakAfterCast) {
  30169. return conditionalGroup([[castGroup, print("expression")], [castGroup, group(exprContents, {
  30170. shouldBreak: true
  30171. })], [castGroup, print("expression")]]);
  30172. }
  30173. return group([castGroup, print("expression")]);
  30174. }
  30175. case "TSDeclareFunction":
  30176. return printFunction(path, print, options);
  30177. case "TSExportAssignment":
  30178. return ["export = ", print("expression"), semi];
  30179. case "TSModuleBlock":
  30180. return printBlock(path, options, print);
  30181. case "TSInterfaceBody":
  30182. case "TSTypeLiteral":
  30183. return printObject(path, options, print);
  30184. case "TSTypeAliasDeclaration":
  30185. return printTypeAlias(path, options, print);
  30186. case "TSQualifiedName":
  30187. return join(".", [print("left"), print("right")]);
  30188. case "TSAbstractMethodDefinition":
  30189. case "TSDeclareMethod":
  30190. return printClassMethod(path, options, print);
  30191. case "TSAbstractPropertyDefinition":
  30192. return printClassProperty(path, options, print);
  30193. case "TSInterfaceHeritage":
  30194. case "TSExpressionWithTypeArguments":
  30195. parts.push(print("expression"));
  30196. if (node.typeParameters) {
  30197. parts.push(print("typeParameters"));
  30198. }
  30199. return parts;
  30200. case "TSTemplateLiteralType":
  30201. return printTemplateLiteral(path, print, options);
  30202. case "TSNamedTupleMember":
  30203. return [print("label"), node.optional ? "?" : "", ": ", print("elementType")];
  30204. case "TSRestType":
  30205. return ["...", print("typeAnnotation")];
  30206. case "TSOptionalType":
  30207. return [print("typeAnnotation"), "?"];
  30208. case "TSInterfaceDeclaration":
  30209. return printInterface(path, options, print);
  30210. case "TSClassImplements":
  30211. return [print("expression"), print("typeParameters")];
  30212. case "TSTypeParameterDeclaration":
  30213. case "TSTypeParameterInstantiation":
  30214. return printTypeParameters(path, options, print, "params");
  30215. case "TSTypeParameter":
  30216. return printTypeParameter(path, options, print);
  30217. case "TSAsExpression": {
  30218. parts.push(print("expression"), " as ", print("typeAnnotation"));
  30219. const parent = path.getParentNode();
  30220. if (isCallExpression(parent) && parent.callee === node || isMemberExpression(parent) && parent.object === node) {
  30221. return group([indent([softline, ...parts]), softline]);
  30222. }
  30223. return parts;
  30224. }
  30225. case "TSArrayType":
  30226. return [print("elementType"), "[]"];
  30227. case "TSPropertySignature": {
  30228. if (node.readonly) {
  30229. parts.push("readonly ");
  30230. }
  30231. parts.push(printPropertyKey(path, options, print), printOptionalToken(path));
  30232. if (node.typeAnnotation) {
  30233. parts.push(": ", print("typeAnnotation"));
  30234. }
  30235. if (node.initializer) {
  30236. parts.push(" = ", print("initializer"));
  30237. }
  30238. return parts;
  30239. }
  30240. case "TSParameterProperty":
  30241. if (node.accessibility) {
  30242. parts.push(node.accessibility + " ");
  30243. }
  30244. if (node.export) {
  30245. parts.push("export ");
  30246. }
  30247. if (node.static) {
  30248. parts.push("static ");
  30249. }
  30250. if (node.override) {
  30251. parts.push("override ");
  30252. }
  30253. if (node.readonly) {
  30254. parts.push("readonly ");
  30255. }
  30256. parts.push(print("parameter"));
  30257. return parts;
  30258. case "TSTypeQuery":
  30259. return ["typeof ", print("exprName")];
  30260. case "TSIndexSignature": {
  30261. const parent = path.getParentNode();
  30262. const trailingComma = node.parameters.length > 1 ? ifBreak(shouldPrintComma(options) ? "," : "") : "";
  30263. const parametersGroup = group([indent([softline, join([", ", softline], path.map(print, "parameters"))]), trailingComma, softline]);
  30264. return [node.export ? "export " : "", node.accessibility ? [node.accessibility, " "] : "", node.static ? "static " : "", node.readonly ? "readonly " : "", node.declare ? "declare " : "", "[", node.parameters ? parametersGroup : "", node.typeAnnotation ? "]: " : "]", node.typeAnnotation ? print("typeAnnotation") : "", parent.type === "ClassBody" ? semi : ""];
  30265. }
  30266. case "TSTypePredicate":
  30267. return [node.asserts ? "asserts " : "", print("parameterName"), node.typeAnnotation ? [" is ", print("typeAnnotation")] : ""];
  30268. case "TSNonNullExpression":
  30269. return [print("expression"), "!"];
  30270. case "TSImportType":
  30271. return [!node.isTypeOf ? "" : "typeof ", "import(", print(node.parameter ? "parameter" : "argument"), ")", !node.qualifier ? "" : [".", print("qualifier")], printTypeParameters(path, options, print, "typeParameters")];
  30272. case "TSLiteralType":
  30273. return print("literal");
  30274. case "TSIndexedAccessType":
  30275. return printIndexedAccessType(path, options, print);
  30276. case "TSConstructSignatureDeclaration":
  30277. case "TSCallSignatureDeclaration":
  30278. case "TSConstructorType": {
  30279. if (node.type === "TSConstructorType" && node.abstract) {
  30280. parts.push("abstract ");
  30281. }
  30282. if (node.type !== "TSCallSignatureDeclaration") {
  30283. parts.push("new ");
  30284. }
  30285. parts.push(group(printFunctionParameters(path, print, options, false, true)));
  30286. if (node.returnType || node.typeAnnotation) {
  30287. const isType = node.type === "TSConstructorType";
  30288. parts.push(isType ? " => " : ": ", print("returnType"), print("typeAnnotation"));
  30289. }
  30290. return parts;
  30291. }
  30292. case "TSTypeOperator":
  30293. return [node.operator, " ", print("typeAnnotation")];
  30294. case "TSMappedType": {
  30295. const shouldBreak = hasNewlineInRange(options.originalText, locStart(node), locEnd(node));
  30296. return group(["{", indent([options.bracketSpacing ? line : softline, node.readonly ? [getTypeScriptMappedTypeModifier(node.readonly, "readonly"), " "] : "", printTypeScriptModifiers(path, options, print), print("typeParameter"), node.optional ? getTypeScriptMappedTypeModifier(node.optional, "?") : "", node.typeAnnotation ? ": " : "", print("typeAnnotation"), ifBreak(semi)]), printDanglingComments(path, options, true), options.bracketSpacing ? line : softline, "}"], {
  30297. shouldBreak
  30298. });
  30299. }
  30300. case "TSMethodSignature": {
  30301. const kind = node.kind && node.kind !== "method" ? `${node.kind} ` : "";
  30302. parts.push(node.accessibility ? [node.accessibility, " "] : "", kind, node.export ? "export " : "", node.static ? "static " : "", node.readonly ? "readonly " : "", node.abstract ? "abstract " : "", node.declare ? "declare " : "", node.computed ? "[" : "", print("key"), node.computed ? "]" : "", printOptionalToken(path));
  30303. const parametersDoc = printFunctionParameters(path, print, options, false, true);
  30304. const returnTypePropertyName = node.returnType ? "returnType" : "typeAnnotation";
  30305. const returnTypeNode = node[returnTypePropertyName];
  30306. const returnTypeDoc = returnTypeNode ? print(returnTypePropertyName) : "";
  30307. const shouldGroupParameters = shouldGroupFunctionParameters(node, returnTypeDoc);
  30308. parts.push(shouldGroupParameters ? group(parametersDoc) : parametersDoc);
  30309. if (returnTypeNode) {
  30310. parts.push(": ", group(returnTypeDoc));
  30311. }
  30312. return group(parts);
  30313. }
  30314. case "TSNamespaceExportDeclaration":
  30315. parts.push("export as namespace ", print("id"));
  30316. if (options.semi) {
  30317. parts.push(";");
  30318. }
  30319. return group(parts);
  30320. case "TSEnumDeclaration":
  30321. if (node.declare) {
  30322. parts.push("declare ");
  30323. }
  30324. if (node.modifiers) {
  30325. parts.push(printTypeScriptModifiers(path, options, print));
  30326. }
  30327. if (node.const) {
  30328. parts.push("const ");
  30329. }
  30330. parts.push("enum ", print("id"), " ");
  30331. if (node.members.length === 0) {
  30332. parts.push(group(["{", printDanglingComments(path, options), softline, "}"]));
  30333. } else {
  30334. parts.push(group(["{", indent([hardline, printArrayItems(path, options, "members", print), shouldPrintComma(options, "es5") ? "," : ""]), printDanglingComments(path, options, true), hardline, "}"]));
  30335. }
  30336. return parts;
  30337. case "TSEnumMember":
  30338. parts.push(print("id"));
  30339. if (node.initializer) {
  30340. parts.push(" = ", print("initializer"));
  30341. }
  30342. return parts;
  30343. case "TSImportEqualsDeclaration":
  30344. if (node.isExport) {
  30345. parts.push("export ");
  30346. }
  30347. parts.push("import ");
  30348. if (node.importKind && node.importKind !== "value") {
  30349. parts.push(node.importKind, " ");
  30350. }
  30351. parts.push(print("id"), " = ", print("moduleReference"));
  30352. if (options.semi) {
  30353. parts.push(";");
  30354. }
  30355. return group(parts);
  30356. case "TSExternalModuleReference":
  30357. return ["require(", print("expression"), ")"];
  30358. case "TSModuleDeclaration": {
  30359. const parent = path.getParentNode();
  30360. const isExternalModule = isLiteral(node.id);
  30361. const parentIsDeclaration = parent.type === "TSModuleDeclaration";
  30362. const bodyIsDeclaration = node.body && node.body.type === "TSModuleDeclaration";
  30363. if (parentIsDeclaration) {
  30364. parts.push(".");
  30365. } else {
  30366. if (node.declare) {
  30367. parts.push("declare ");
  30368. }
  30369. parts.push(printTypeScriptModifiers(path, options, print));
  30370. const textBetweenNodeAndItsId = options.originalText.slice(locStart(node), locStart(node.id));
  30371. const isGlobalDeclaration = node.id.type === "Identifier" && node.id.name === "global" && !/namespace|module/.test(textBetweenNodeAndItsId);
  30372. if (!isGlobalDeclaration) {
  30373. parts.push(isExternalModule || /(?:^|\s)module(?:\s|$)/.test(textBetweenNodeAndItsId) ? "module " : "namespace ");
  30374. }
  30375. }
  30376. parts.push(print("id"));
  30377. if (bodyIsDeclaration) {
  30378. parts.push(print("body"));
  30379. } else if (node.body) {
  30380. parts.push(" ", group(print("body")));
  30381. } else {
  30382. parts.push(semi);
  30383. }
  30384. return parts;
  30385. }
  30386. case "TSConditionalType":
  30387. return printTernary(path, options, print);
  30388. case "TSInferType":
  30389. return ["infer", " ", print("typeParameter")];
  30390. case "TSIntersectionType":
  30391. return printIntersectionType(path, options, print);
  30392. case "TSUnionType":
  30393. return printUnionType(path, options, print);
  30394. case "TSFunctionType":
  30395. return printFunctionType(path, options, print);
  30396. case "TSTupleType":
  30397. return printTupleType(path, options, print);
  30398. case "TSTypeReference":
  30399. return [print("typeName"), printTypeParameters(path, options, print, "typeParameters")];
  30400. case "TSTypeAnnotation":
  30401. return print("typeAnnotation");
  30402. case "TSEmptyBodyFunctionExpression":
  30403. return printMethodInternal(path, options, print);
  30404. case "TSJSDocAllType":
  30405. return "*";
  30406. case "TSJSDocUnknownType":
  30407. return "?";
  30408. case "TSJSDocNullableType":
  30409. return ["?", print("typeAnnotation")];
  30410. case "TSJSDocNonNullableType":
  30411. return ["!", print("typeAnnotation")];
  30412. default:
  30413. throw new Error(`Unknown TypeScript node type: ${JSON.stringify(node.type)}.`);
  30414. }
  30415. }
  30416. module2.exports = {
  30417. printTypescript
  30418. };
  30419. }
  30420. });
  30421. var require_comment = __commonJS2({
  30422. "src/language-js/print/comment.js"(exports2, module2) {
  30423. "use strict";
  30424. var {
  30425. hasNewline
  30426. } = require_util();
  30427. var {
  30428. builders: {
  30429. join,
  30430. hardline
  30431. },
  30432. utils: {
  30433. replaceTextEndOfLine
  30434. }
  30435. } = require("./doc.js");
  30436. var {
  30437. isLineComment
  30438. } = require_utils7();
  30439. var {
  30440. locStart,
  30441. locEnd
  30442. } = require_loc();
  30443. var isBlockComment = require_is_block_comment();
  30444. function printComment(commentPath, options) {
  30445. const comment = commentPath.getValue();
  30446. if (isLineComment(comment)) {
  30447. return options.originalText.slice(locStart(comment), locEnd(comment)).trimEnd();
  30448. }
  30449. if (isBlockComment(comment)) {
  30450. if (isIndentableBlockComment(comment)) {
  30451. const printed = printIndentableBlockComment(comment);
  30452. if (comment.trailing && !hasNewline(options.originalText, locStart(comment), {
  30453. backwards: true
  30454. })) {
  30455. return [hardline, printed];
  30456. }
  30457. return printed;
  30458. }
  30459. const commentEnd = locEnd(comment);
  30460. const isInsideFlowComment = options.originalText.slice(commentEnd - 3, commentEnd) === "*-/";
  30461. return ["/*", replaceTextEndOfLine(comment.value), isInsideFlowComment ? "*-/" : "*/"];
  30462. }
  30463. throw new Error("Not a comment: " + JSON.stringify(comment));
  30464. }
  30465. function isIndentableBlockComment(comment) {
  30466. const lines = `*${comment.value}*`.split("\n");
  30467. return lines.length > 1 && lines.every((line) => line.trim()[0] === "*");
  30468. }
  30469. function printIndentableBlockComment(comment) {
  30470. const lines = comment.value.split("\n");
  30471. return ["/*", join(hardline, lines.map((line, index) => index === 0 ? line.trimEnd() : " " + (index < lines.length - 1 ? line.trim() : line.trimStart()))), "*/"];
  30472. }
  30473. module2.exports = {
  30474. printComment
  30475. };
  30476. }
  30477. });
  30478. var require_literal = __commonJS2({
  30479. "src/language-js/print/literal.js"(exports2, module2) {
  30480. "use strict";
  30481. var {
  30482. printString,
  30483. printNumber
  30484. } = require_util();
  30485. function printLiteral(path, options) {
  30486. const node = path.getNode();
  30487. switch (node.type) {
  30488. case "RegExpLiteral":
  30489. return printRegex(node);
  30490. case "BigIntLiteral":
  30491. return printBigInt(node.bigint || node.extra.raw);
  30492. case "NumericLiteral":
  30493. return printNumber(node.extra.raw);
  30494. case "StringLiteral":
  30495. return printString(node.extra.raw, options);
  30496. case "NullLiteral":
  30497. return "null";
  30498. case "BooleanLiteral":
  30499. return String(node.value);
  30500. case "DecimalLiteral":
  30501. return printNumber(node.value) + "m";
  30502. case "Literal": {
  30503. if (node.regex) {
  30504. return printRegex(node.regex);
  30505. }
  30506. if (node.bigint) {
  30507. return printBigInt(node.raw);
  30508. }
  30509. if (node.decimal) {
  30510. return printNumber(node.decimal) + "m";
  30511. }
  30512. const {
  30513. value
  30514. } = node;
  30515. if (typeof value === "number") {
  30516. return printNumber(node.raw);
  30517. }
  30518. if (typeof value === "string") {
  30519. return printString(node.raw, options);
  30520. }
  30521. return String(value);
  30522. }
  30523. }
  30524. }
  30525. function printBigInt(raw) {
  30526. return raw.toLowerCase();
  30527. }
  30528. function printRegex({
  30529. pattern,
  30530. flags
  30531. }) {
  30532. flags = [...flags].sort().join("");
  30533. return `/${pattern}/${flags}`;
  30534. }
  30535. module2.exports = {
  30536. printLiteral
  30537. };
  30538. }
  30539. });
  30540. var require_printer_estree = __commonJS2({
  30541. "src/language-js/printer-estree.js"(exports2, module2) {
  30542. "use strict";
  30543. var {
  30544. printDanglingComments
  30545. } = require_comments();
  30546. var {
  30547. hasNewline
  30548. } = require_util();
  30549. var {
  30550. builders: {
  30551. join,
  30552. line,
  30553. hardline,
  30554. softline,
  30555. group,
  30556. indent
  30557. },
  30558. utils: {
  30559. replaceTextEndOfLine
  30560. }
  30561. } = require("./doc.js");
  30562. var embed = require_embed();
  30563. var clean = require_clean();
  30564. var {
  30565. insertPragma
  30566. } = require_pragma();
  30567. var handleComments = require_comments2();
  30568. var pathNeedsParens = require_needs_parens();
  30569. var preprocess = require_print_preprocess();
  30570. var {
  30571. hasFlowShorthandAnnotationComment,
  30572. hasComment,
  30573. CommentCheckFlags,
  30574. isTheOnlyJsxElementInMarkdown,
  30575. isLineComment,
  30576. isNextLineEmpty,
  30577. needsHardlineAfterDanglingComment,
  30578. rawText,
  30579. hasIgnoreComment,
  30580. isCallExpression,
  30581. isMemberExpression,
  30582. markerForIfWithoutBlockAndSameLineComment
  30583. } = require_utils7();
  30584. var {
  30585. locStart,
  30586. locEnd
  30587. } = require_loc();
  30588. var isBlockComment = require_is_block_comment();
  30589. var {
  30590. printHtmlBinding,
  30591. isVueEventBindingExpression
  30592. } = require_html_binding();
  30593. var {
  30594. printAngular
  30595. } = require_angular();
  30596. var {
  30597. printJsx,
  30598. hasJsxIgnoreComment
  30599. } = require_jsx();
  30600. var {
  30601. printFlow
  30602. } = require_flow();
  30603. var {
  30604. printTypescript
  30605. } = require_typescript();
  30606. var {
  30607. printOptionalToken,
  30608. printBindExpressionCallee,
  30609. printTypeAnnotation,
  30610. adjustClause,
  30611. printRestSpread,
  30612. printDefiniteToken
  30613. } = require_misc();
  30614. var {
  30615. printImportDeclaration,
  30616. printExportDeclaration,
  30617. printExportAllDeclaration,
  30618. printModuleSpecifier
  30619. } = require_module();
  30620. var {
  30621. printTernary
  30622. } = require_ternary();
  30623. var {
  30624. printTemplateLiteral
  30625. } = require_template_literal();
  30626. var {
  30627. printArray
  30628. } = require_array4();
  30629. var {
  30630. printObject
  30631. } = require_object();
  30632. var {
  30633. printClass,
  30634. printClassMethod,
  30635. printClassProperty
  30636. } = require_class();
  30637. var {
  30638. printProperty
  30639. } = require_property2();
  30640. var {
  30641. printFunction,
  30642. printArrowFunction,
  30643. printMethod,
  30644. printReturnStatement,
  30645. printThrowStatement
  30646. } = require_function();
  30647. var {
  30648. printCallExpression
  30649. } = require_call_expression();
  30650. var {
  30651. printVariableDeclarator,
  30652. printAssignmentExpression
  30653. } = require_assignment();
  30654. var {
  30655. printBinaryishExpression
  30656. } = require_binaryish();
  30657. var {
  30658. printSwitchCaseConsequent
  30659. } = require_statement();
  30660. var {
  30661. printMemberExpression
  30662. } = require_member();
  30663. var {
  30664. printBlock,
  30665. printBlockBody
  30666. } = require_block();
  30667. var {
  30668. printComment
  30669. } = require_comment();
  30670. var {
  30671. printLiteral
  30672. } = require_literal();
  30673. var {
  30674. printDecorators
  30675. } = require_decorators();
  30676. function genericPrint(path, options, print, args) {
  30677. const printed = printPathNoParens(path, options, print, args);
  30678. if (!printed) {
  30679. return "";
  30680. }
  30681. const node = path.getValue();
  30682. const {
  30683. type
  30684. } = node;
  30685. if (type === "ClassMethod" || type === "ClassPrivateMethod" || type === "ClassProperty" || type === "ClassAccessorProperty" || type === "PropertyDefinition" || type === "TSAbstractPropertyDefinition" || type === "ClassPrivateProperty" || type === "MethodDefinition" || type === "TSAbstractMethodDefinition" || type === "TSDeclareMethod") {
  30686. return printed;
  30687. }
  30688. let parts = [printed];
  30689. const printedDecorators = printDecorators(path, options, print);
  30690. const isClassExpressionWithDecorators = node.type === "ClassExpression" && printedDecorators;
  30691. if (printedDecorators) {
  30692. parts = [...printedDecorators, printed];
  30693. if (!isClassExpressionWithDecorators) {
  30694. return group(parts);
  30695. }
  30696. }
  30697. const needsParens = pathNeedsParens(path, options);
  30698. if (!needsParens) {
  30699. if (args && args.needsSemi) {
  30700. parts.unshift(";");
  30701. }
  30702. if (parts.length === 1 && parts[0] === printed) {
  30703. return printed;
  30704. }
  30705. return parts;
  30706. }
  30707. if (isClassExpressionWithDecorators) {
  30708. parts = [indent([line, ...parts])];
  30709. }
  30710. parts.unshift("(");
  30711. if (args && args.needsSemi) {
  30712. parts.unshift(";");
  30713. }
  30714. if (hasFlowShorthandAnnotationComment(node)) {
  30715. const [comment] = node.trailingComments;
  30716. parts.push(" /*", comment.value.trimStart(), "*/");
  30717. comment.printed = true;
  30718. }
  30719. if (isClassExpressionWithDecorators) {
  30720. parts.push(line);
  30721. }
  30722. parts.push(")");
  30723. return parts;
  30724. }
  30725. function printPathNoParens(path, options, print, args) {
  30726. const node = path.getValue();
  30727. const semi = options.semi ? ";" : "";
  30728. if (!node) {
  30729. return "";
  30730. }
  30731. if (typeof node === "string") {
  30732. return node;
  30733. }
  30734. for (const printer of [printLiteral, printHtmlBinding, printAngular, printJsx, printFlow, printTypescript]) {
  30735. const printed = printer(path, options, print);
  30736. if (typeof printed !== "undefined") {
  30737. return printed;
  30738. }
  30739. }
  30740. let parts = [];
  30741. switch (node.type) {
  30742. case "JsExpressionRoot":
  30743. return print("node");
  30744. case "JsonRoot":
  30745. return [print("node"), hardline];
  30746. case "File":
  30747. if (node.program && node.program.interpreter) {
  30748. parts.push(print(["program", "interpreter"]));
  30749. }
  30750. parts.push(print("program"));
  30751. return parts;
  30752. case "Program":
  30753. return printBlockBody(path, options, print);
  30754. case "EmptyStatement":
  30755. return "";
  30756. case "ExpressionStatement": {
  30757. if (node.directive) {
  30758. return [printDirective(node.expression, options), semi];
  30759. }
  30760. if (options.parser === "__vue_event_binding") {
  30761. const parent = path.getParentNode();
  30762. if (parent.type === "Program" && parent.body.length === 1 && parent.body[0] === node) {
  30763. return [print("expression"), isVueEventBindingExpression(node.expression) ? ";" : ""];
  30764. }
  30765. }
  30766. const danglingComment = printDanglingComments(path, options, true, ({
  30767. marker
  30768. }) => marker === markerForIfWithoutBlockAndSameLineComment);
  30769. return [print("expression"), isTheOnlyJsxElementInMarkdown(options, path) ? "" : semi, danglingComment ? [" ", danglingComment] : ""];
  30770. }
  30771. case "ParenthesizedExpression": {
  30772. const shouldHug = !hasComment(node.expression) && (node.expression.type === "ObjectExpression" || node.expression.type === "ArrayExpression");
  30773. if (shouldHug) {
  30774. return ["(", print("expression"), ")"];
  30775. }
  30776. return group(["(", indent([softline, print("expression")]), softline, ")"]);
  30777. }
  30778. case "AssignmentExpression":
  30779. return printAssignmentExpression(path, options, print);
  30780. case "VariableDeclarator":
  30781. return printVariableDeclarator(path, options, print);
  30782. case "BinaryExpression":
  30783. case "LogicalExpression":
  30784. return printBinaryishExpression(path, options, print);
  30785. case "AssignmentPattern":
  30786. return [print("left"), " = ", print("right")];
  30787. case "OptionalMemberExpression":
  30788. case "MemberExpression": {
  30789. return printMemberExpression(path, options, print);
  30790. }
  30791. case "MetaProperty":
  30792. return [print("meta"), ".", print("property")];
  30793. case "BindExpression":
  30794. if (node.object) {
  30795. parts.push(print("object"));
  30796. }
  30797. parts.push(group(indent([softline, printBindExpressionCallee(path, options, print)])));
  30798. return parts;
  30799. case "Identifier": {
  30800. return [node.name, printOptionalToken(path), printDefiniteToken(path), printTypeAnnotation(path, options, print)];
  30801. }
  30802. case "V8IntrinsicIdentifier":
  30803. return ["%", node.name];
  30804. case "SpreadElement":
  30805. case "SpreadElementPattern":
  30806. case "SpreadProperty":
  30807. case "SpreadPropertyPattern":
  30808. case "RestElement":
  30809. return printRestSpread(path, options, print);
  30810. case "FunctionDeclaration":
  30811. case "FunctionExpression":
  30812. return printFunction(path, print, options, args);
  30813. case "ArrowFunctionExpression":
  30814. return printArrowFunction(path, options, print, args);
  30815. case "YieldExpression":
  30816. parts.push("yield");
  30817. if (node.delegate) {
  30818. parts.push("*");
  30819. }
  30820. if (node.argument) {
  30821. parts.push(" ", print("argument"));
  30822. }
  30823. return parts;
  30824. case "AwaitExpression": {
  30825. parts.push("await");
  30826. if (node.argument) {
  30827. parts.push(" ", print("argument"));
  30828. const parent = path.getParentNode();
  30829. if (isCallExpression(parent) && parent.callee === node || isMemberExpression(parent) && parent.object === node) {
  30830. parts = [indent([softline, ...parts]), softline];
  30831. const parentAwaitOrBlock = path.findAncestor((node2) => node2.type === "AwaitExpression" || node2.type === "BlockStatement");
  30832. if (!parentAwaitOrBlock || parentAwaitOrBlock.type !== "AwaitExpression") {
  30833. return group(parts);
  30834. }
  30835. }
  30836. }
  30837. return parts;
  30838. }
  30839. case "ExportDefaultDeclaration":
  30840. case "ExportNamedDeclaration":
  30841. return printExportDeclaration(path, options, print);
  30842. case "ExportAllDeclaration":
  30843. return printExportAllDeclaration(path, options, print);
  30844. case "ImportDeclaration":
  30845. return printImportDeclaration(path, options, print);
  30846. case "ImportSpecifier":
  30847. case "ExportSpecifier":
  30848. case "ImportNamespaceSpecifier":
  30849. case "ExportNamespaceSpecifier":
  30850. case "ImportDefaultSpecifier":
  30851. case "ExportDefaultSpecifier":
  30852. return printModuleSpecifier(path, options, print);
  30853. case "ImportAttribute":
  30854. return [print("key"), ": ", print("value")];
  30855. case "Import":
  30856. return "import";
  30857. case "BlockStatement":
  30858. case "StaticBlock":
  30859. case "ClassBody":
  30860. return printBlock(path, options, print);
  30861. case "ThrowStatement":
  30862. return printThrowStatement(path, options, print);
  30863. case "ReturnStatement":
  30864. return printReturnStatement(path, options, print);
  30865. case "NewExpression":
  30866. case "ImportExpression":
  30867. case "OptionalCallExpression":
  30868. case "CallExpression":
  30869. return printCallExpression(path, options, print);
  30870. case "ObjectExpression":
  30871. case "ObjectPattern":
  30872. case "RecordExpression":
  30873. return printObject(path, options, print);
  30874. case "ObjectProperty":
  30875. case "Property":
  30876. if (node.method || node.kind === "get" || node.kind === "set") {
  30877. return printMethod(path, options, print);
  30878. }
  30879. return printProperty(path, options, print);
  30880. case "ObjectMethod":
  30881. return printMethod(path, options, print);
  30882. case "Decorator":
  30883. return ["@", print("expression")];
  30884. case "ArrayExpression":
  30885. case "ArrayPattern":
  30886. case "TupleExpression":
  30887. return printArray(path, options, print);
  30888. case "SequenceExpression": {
  30889. const parent = path.getParentNode(0);
  30890. if (parent.type === "ExpressionStatement" || parent.type === "ForStatement") {
  30891. const parts2 = [];
  30892. path.each((expressionPath, index) => {
  30893. if (index === 0) {
  30894. parts2.push(print());
  30895. } else {
  30896. parts2.push(",", indent([line, print()]));
  30897. }
  30898. }, "expressions");
  30899. return group(parts2);
  30900. }
  30901. return group(join([",", line], path.map(print, "expressions")));
  30902. }
  30903. case "ThisExpression":
  30904. return "this";
  30905. case "Super":
  30906. return "super";
  30907. case "Directive":
  30908. return [print("value"), semi];
  30909. case "DirectiveLiteral":
  30910. return printDirective(node, options);
  30911. case "UnaryExpression":
  30912. parts.push(node.operator);
  30913. if (/[a-z]$/.test(node.operator)) {
  30914. parts.push(" ");
  30915. }
  30916. if (hasComment(node.argument)) {
  30917. parts.push(group(["(", indent([softline, print("argument")]), softline, ")"]));
  30918. } else {
  30919. parts.push(print("argument"));
  30920. }
  30921. return parts;
  30922. case "UpdateExpression":
  30923. parts.push(print("argument"), node.operator);
  30924. if (node.prefix) {
  30925. parts.reverse();
  30926. }
  30927. return parts;
  30928. case "ConditionalExpression":
  30929. return printTernary(path, options, print);
  30930. case "VariableDeclaration": {
  30931. const printed = path.map(print, "declarations");
  30932. const parentNode = path.getParentNode();
  30933. const isParentForLoop = parentNode.type === "ForStatement" || parentNode.type === "ForInStatement" || parentNode.type === "ForOfStatement";
  30934. const hasValue = node.declarations.some((decl) => decl.init);
  30935. let firstVariable;
  30936. if (printed.length === 1 && !hasComment(node.declarations[0])) {
  30937. firstVariable = printed[0];
  30938. } else if (printed.length > 0) {
  30939. firstVariable = indent(printed[0]);
  30940. }
  30941. parts = [node.declare ? "declare " : "", node.kind, firstVariable ? [" ", firstVariable] : "", indent(printed.slice(1).map((p) => [",", hasValue && !isParentForLoop ? hardline : line, p]))];
  30942. if (!(isParentForLoop && parentNode.body !== node)) {
  30943. parts.push(semi);
  30944. }
  30945. return group(parts);
  30946. }
  30947. case "WithStatement":
  30948. return group(["with (", print("object"), ")", adjustClause(node.body, print("body"))]);
  30949. case "IfStatement": {
  30950. const con = adjustClause(node.consequent, print("consequent"));
  30951. const opening = group(["if (", group([indent([softline, print("test")]), softline]), ")", con]);
  30952. parts.push(opening);
  30953. if (node.alternate) {
  30954. const commentOnOwnLine = hasComment(node.consequent, CommentCheckFlags.Trailing | CommentCheckFlags.Line) || needsHardlineAfterDanglingComment(node);
  30955. const elseOnSameLine = node.consequent.type === "BlockStatement" && !commentOnOwnLine;
  30956. parts.push(elseOnSameLine ? " " : hardline);
  30957. if (hasComment(node, CommentCheckFlags.Dangling)) {
  30958. parts.push(printDanglingComments(path, options, true), commentOnOwnLine ? hardline : " ");
  30959. }
  30960. parts.push("else", group(adjustClause(node.alternate, print("alternate"), node.alternate.type === "IfStatement")));
  30961. }
  30962. return parts;
  30963. }
  30964. case "ForStatement": {
  30965. const body = adjustClause(node.body, print("body"));
  30966. const dangling = printDanglingComments(path, options, true);
  30967. const printedComments = dangling ? [dangling, softline] : "";
  30968. if (!node.init && !node.test && !node.update) {
  30969. return [printedComments, group(["for (;;)", body])];
  30970. }
  30971. return [printedComments, group(["for (", group([indent([softline, print("init"), ";", line, print("test"), ";", line, print("update")]), softline]), ")", body])];
  30972. }
  30973. case "WhileStatement":
  30974. return group(["while (", group([indent([softline, print("test")]), softline]), ")", adjustClause(node.body, print("body"))]);
  30975. case "ForInStatement":
  30976. return group(["for (", print("left"), " in ", print("right"), ")", adjustClause(node.body, print("body"))]);
  30977. case "ForOfStatement":
  30978. return group(["for", node.await ? " await" : "", " (", print("left"), " of ", print("right"), ")", adjustClause(node.body, print("body"))]);
  30979. case "DoWhileStatement": {
  30980. const clause = adjustClause(node.body, print("body"));
  30981. const doBody = group(["do", clause]);
  30982. parts = [doBody];
  30983. if (node.body.type === "BlockStatement") {
  30984. parts.push(" ");
  30985. } else {
  30986. parts.push(hardline);
  30987. }
  30988. parts.push("while (", group([indent([softline, print("test")]), softline]), ")", semi);
  30989. return parts;
  30990. }
  30991. case "DoExpression":
  30992. return [node.async ? "async " : "", "do ", print("body")];
  30993. case "BreakStatement":
  30994. parts.push("break");
  30995. if (node.label) {
  30996. parts.push(" ", print("label"));
  30997. }
  30998. parts.push(semi);
  30999. return parts;
  31000. case "ContinueStatement":
  31001. parts.push("continue");
  31002. if (node.label) {
  31003. parts.push(" ", print("label"));
  31004. }
  31005. parts.push(semi);
  31006. return parts;
  31007. case "LabeledStatement":
  31008. if (node.body.type === "EmptyStatement") {
  31009. return [print("label"), ":;"];
  31010. }
  31011. return [print("label"), ": ", print("body")];
  31012. case "TryStatement":
  31013. return ["try ", print("block"), node.handler ? [" ", print("handler")] : "", node.finalizer ? [" finally ", print("finalizer")] : ""];
  31014. case "CatchClause":
  31015. if (node.param) {
  31016. const parameterHasComments = hasComment(node.param, (comment) => !isBlockComment(comment) || comment.leading && hasNewline(options.originalText, locEnd(comment)) || comment.trailing && hasNewline(options.originalText, locStart(comment), {
  31017. backwards: true
  31018. }));
  31019. const param = print("param");
  31020. return ["catch ", parameterHasComments ? ["(", indent([softline, param]), softline, ") "] : ["(", param, ") "], print("body")];
  31021. }
  31022. return ["catch ", print("body")];
  31023. case "SwitchStatement":
  31024. return [group(["switch (", indent([softline, print("discriminant")]), softline, ")"]), " {", node.cases.length > 0 ? indent([hardline, join(hardline, path.map((casePath, index, cases) => {
  31025. const caseNode = casePath.getValue();
  31026. return [print(), index !== cases.length - 1 && isNextLineEmpty(caseNode, options) ? hardline : ""];
  31027. }, "cases"))]) : "", hardline, "}"];
  31028. case "SwitchCase": {
  31029. if (node.test) {
  31030. parts.push("case ", print("test"), ":");
  31031. } else {
  31032. parts.push("default:");
  31033. }
  31034. if (hasComment(node, CommentCheckFlags.Dangling)) {
  31035. parts.push(" ", printDanglingComments(path, options, true));
  31036. }
  31037. const consequent = node.consequent.filter((node2) => node2.type !== "EmptyStatement");
  31038. if (consequent.length > 0) {
  31039. const cons = printSwitchCaseConsequent(path, options, print);
  31040. parts.push(consequent.length === 1 && consequent[0].type === "BlockStatement" ? [" ", cons] : indent([hardline, cons]));
  31041. }
  31042. return parts;
  31043. }
  31044. case "DebuggerStatement":
  31045. return ["debugger", semi];
  31046. case "ClassDeclaration":
  31047. case "ClassExpression":
  31048. return printClass(path, options, print);
  31049. case "ClassMethod":
  31050. case "ClassPrivateMethod":
  31051. case "MethodDefinition":
  31052. return printClassMethod(path, options, print);
  31053. case "ClassProperty":
  31054. case "PropertyDefinition":
  31055. case "ClassPrivateProperty":
  31056. case "ClassAccessorProperty":
  31057. return printClassProperty(path, options, print);
  31058. case "TemplateElement":
  31059. return replaceTextEndOfLine(node.value.raw);
  31060. case "TemplateLiteral":
  31061. return printTemplateLiteral(path, print, options);
  31062. case "TaggedTemplateExpression":
  31063. return [print("tag"), print("typeParameters"), print("quasi")];
  31064. case "PrivateIdentifier":
  31065. return ["#", print("name")];
  31066. case "PrivateName":
  31067. return ["#", print("id")];
  31068. case "InterpreterDirective":
  31069. parts.push("#!", node.value, hardline);
  31070. if (isNextLineEmpty(node, options)) {
  31071. parts.push(hardline);
  31072. }
  31073. return parts;
  31074. case "TopicReference":
  31075. return "%";
  31076. case "ArgumentPlaceholder":
  31077. return "?";
  31078. case "ModuleExpression": {
  31079. parts.push("module {");
  31080. const printed = print("body");
  31081. if (printed) {
  31082. parts.push(indent([hardline, printed]), hardline);
  31083. }
  31084. parts.push("}");
  31085. return parts;
  31086. }
  31087. default:
  31088. throw new Error("unknown type: " + JSON.stringify(node.type));
  31089. }
  31090. }
  31091. function printDirective(node, options) {
  31092. const raw = rawText(node);
  31093. const rawContent = raw.slice(1, -1);
  31094. if (rawContent.includes('"') || rawContent.includes("'")) {
  31095. return raw;
  31096. }
  31097. const enclosingQuote = options.singleQuote ? "'" : '"';
  31098. return enclosingQuote + rawContent + enclosingQuote;
  31099. }
  31100. function canAttachComment(node) {
  31101. return node.type && !isBlockComment(node) && !isLineComment(node) && node.type !== "EmptyStatement" && node.type !== "TemplateElement" && node.type !== "Import" && node.type !== "TSEmptyBodyFunctionExpression";
  31102. }
  31103. module2.exports = {
  31104. preprocess,
  31105. print: genericPrint,
  31106. embed,
  31107. insertPragma,
  31108. massageAstNode: clean,
  31109. hasPrettierIgnore(path) {
  31110. return hasIgnoreComment(path) || hasJsxIgnoreComment(path);
  31111. },
  31112. willPrintOwnComments: handleComments.willPrintOwnComments,
  31113. canAttachComment,
  31114. printComment,
  31115. isBlockComment,
  31116. handleComments: {
  31117. avoidAstMutation: true,
  31118. ownLine: handleComments.handleOwnLineComment,
  31119. endOfLine: handleComments.handleEndOfLineComment,
  31120. remaining: handleComments.handleRemainingComment
  31121. },
  31122. getCommentChildNodes: handleComments.getCommentChildNodes
  31123. };
  31124. }
  31125. });
  31126. var require_printer_estree_json = __commonJS2({
  31127. "src/language-js/printer-estree-json.js"(exports2, module2) {
  31128. "use strict";
  31129. var {
  31130. builders: {
  31131. hardline,
  31132. indent,
  31133. join
  31134. }
  31135. } = require("./doc.js");
  31136. var preprocess = require_print_preprocess();
  31137. function genericPrint(path, options, print) {
  31138. const node = path.getValue();
  31139. switch (node.type) {
  31140. case "JsonRoot":
  31141. return [print("node"), hardline];
  31142. case "ArrayExpression": {
  31143. if (node.elements.length === 0) {
  31144. return "[]";
  31145. }
  31146. const printed = path.map(() => path.getValue() === null ? "null" : print(), "elements");
  31147. return ["[", indent([hardline, join([",", hardline], printed)]), hardline, "]"];
  31148. }
  31149. case "ObjectExpression":
  31150. return node.properties.length === 0 ? "{}" : ["{", indent([hardline, join([",", hardline], path.map(print, "properties"))]), hardline, "}"];
  31151. case "ObjectProperty":
  31152. return [print("key"), ": ", print("value")];
  31153. case "UnaryExpression":
  31154. return [node.operator === "+" ? "" : node.operator, print("argument")];
  31155. case "NullLiteral":
  31156. return "null";
  31157. case "BooleanLiteral":
  31158. return node.value ? "true" : "false";
  31159. case "StringLiteral":
  31160. case "NumericLiteral":
  31161. return JSON.stringify(node.value);
  31162. case "Identifier": {
  31163. const parent = path.getParentNode();
  31164. if (parent && parent.type === "ObjectProperty" && parent.key === node) {
  31165. return JSON.stringify(node.name);
  31166. }
  31167. return node.name;
  31168. }
  31169. case "TemplateLiteral":
  31170. return print(["quasis", 0]);
  31171. case "TemplateElement":
  31172. return JSON.stringify(node.value.cooked);
  31173. default:
  31174. throw new Error("unknown type: " + JSON.stringify(node.type));
  31175. }
  31176. }
  31177. var ignoredProperties = /* @__PURE__ */ new Set(["start", "end", "extra", "loc", "comments", "leadingComments", "trailingComments", "innerComments", "errors", "range", "tokens"]);
  31178. function clean(node, newNode) {
  31179. const {
  31180. type
  31181. } = node;
  31182. if (type === "ObjectProperty" && node.key.type === "Identifier") {
  31183. newNode.key = {
  31184. type: "StringLiteral",
  31185. value: node.key.name
  31186. };
  31187. return;
  31188. }
  31189. if (type === "UnaryExpression" && node.operator === "+") {
  31190. return newNode.argument;
  31191. }
  31192. if (type === "ArrayExpression") {
  31193. for (const [index, element] of node.elements.entries()) {
  31194. if (element === null) {
  31195. newNode.elements.splice(index, 0, {
  31196. type: "NullLiteral"
  31197. });
  31198. }
  31199. }
  31200. return;
  31201. }
  31202. if (type === "TemplateLiteral") {
  31203. return {
  31204. type: "StringLiteral",
  31205. value: node.quasis[0].value.cooked
  31206. };
  31207. }
  31208. }
  31209. clean.ignoredProperties = ignoredProperties;
  31210. module2.exports = {
  31211. preprocess,
  31212. print: genericPrint,
  31213. massageAstNode: clean
  31214. };
  31215. }
  31216. });
  31217. var require_common_options = __commonJS2({
  31218. "src/common/common-options.js"(exports2, module2) {
  31219. "use strict";
  31220. var CATEGORY_COMMON = "Common";
  31221. module2.exports = {
  31222. bracketSpacing: {
  31223. since: "0.0.0",
  31224. category: CATEGORY_COMMON,
  31225. type: "boolean",
  31226. default: true,
  31227. description: "Print spaces between brackets.",
  31228. oppositeDescription: "Do not print spaces between brackets."
  31229. },
  31230. singleQuote: {
  31231. since: "0.0.0",
  31232. category: CATEGORY_COMMON,
  31233. type: "boolean",
  31234. default: false,
  31235. description: "Use single quotes instead of double quotes."
  31236. },
  31237. proseWrap: {
  31238. since: "1.8.2",
  31239. category: CATEGORY_COMMON,
  31240. type: "choice",
  31241. default: [{
  31242. since: "1.8.2",
  31243. value: true
  31244. }, {
  31245. since: "1.9.0",
  31246. value: "preserve"
  31247. }],
  31248. description: "How to wrap prose.",
  31249. choices: [{
  31250. since: "1.9.0",
  31251. value: "always",
  31252. description: "Wrap prose if it exceeds the print width."
  31253. }, {
  31254. since: "1.9.0",
  31255. value: "never",
  31256. description: "Do not wrap prose."
  31257. }, {
  31258. since: "1.9.0",
  31259. value: "preserve",
  31260. description: "Wrap prose as-is."
  31261. }]
  31262. },
  31263. bracketSameLine: {
  31264. since: "2.4.0",
  31265. category: CATEGORY_COMMON,
  31266. type: "boolean",
  31267. default: false,
  31268. description: "Put > of opening tags on the last line instead of on a new line."
  31269. },
  31270. singleAttributePerLine: {
  31271. since: "2.6.0",
  31272. category: CATEGORY_COMMON,
  31273. type: "boolean",
  31274. default: false,
  31275. description: "Enforce single attribute per line in HTML, Vue and JSX."
  31276. }
  31277. };
  31278. }
  31279. });
  31280. var require_options2 = __commonJS2({
  31281. "src/language-js/options.js"(exports2, module2) {
  31282. "use strict";
  31283. var commonOptions = require_common_options();
  31284. var CATEGORY_JAVASCRIPT = "JavaScript";
  31285. module2.exports = {
  31286. arrowParens: {
  31287. since: "1.9.0",
  31288. category: CATEGORY_JAVASCRIPT,
  31289. type: "choice",
  31290. default: [{
  31291. since: "1.9.0",
  31292. value: "avoid"
  31293. }, {
  31294. since: "2.0.0",
  31295. value: "always"
  31296. }],
  31297. description: "Include parentheses around a sole arrow function parameter.",
  31298. choices: [{
  31299. value: "always",
  31300. description: "Always include parens. Example: `(x) => x`"
  31301. }, {
  31302. value: "avoid",
  31303. description: "Omit parens when possible. Example: `x => x`"
  31304. }]
  31305. },
  31306. bracketSameLine: commonOptions.bracketSameLine,
  31307. bracketSpacing: commonOptions.bracketSpacing,
  31308. jsxBracketSameLine: {
  31309. since: "0.17.0",
  31310. category: CATEGORY_JAVASCRIPT,
  31311. type: "boolean",
  31312. description: "Put > on the last line instead of at a new line.",
  31313. deprecated: "2.4.0"
  31314. },
  31315. semi: {
  31316. since: "1.0.0",
  31317. category: CATEGORY_JAVASCRIPT,
  31318. type: "boolean",
  31319. default: true,
  31320. description: "Print semicolons.",
  31321. oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them."
  31322. },
  31323. singleQuote: commonOptions.singleQuote,
  31324. jsxSingleQuote: {
  31325. since: "1.15.0",
  31326. category: CATEGORY_JAVASCRIPT,
  31327. type: "boolean",
  31328. default: false,
  31329. description: "Use single quotes in JSX."
  31330. },
  31331. quoteProps: {
  31332. since: "1.17.0",
  31333. category: CATEGORY_JAVASCRIPT,
  31334. type: "choice",
  31335. default: "as-needed",
  31336. description: "Change when properties in objects are quoted.",
  31337. choices: [{
  31338. value: "as-needed",
  31339. description: "Only add quotes around object properties where required."
  31340. }, {
  31341. value: "consistent",
  31342. description: "If at least one property in an object requires quotes, quote all properties."
  31343. }, {
  31344. value: "preserve",
  31345. description: "Respect the input use of quotes in object properties."
  31346. }]
  31347. },
  31348. trailingComma: {
  31349. since: "0.0.0",
  31350. category: CATEGORY_JAVASCRIPT,
  31351. type: "choice",
  31352. default: [{
  31353. since: "0.0.0",
  31354. value: false
  31355. }, {
  31356. since: "0.19.0",
  31357. value: "none"
  31358. }, {
  31359. since: "2.0.0",
  31360. value: "es5"
  31361. }],
  31362. description: "Print trailing commas wherever possible when multi-line.",
  31363. choices: [{
  31364. value: "es5",
  31365. description: "Trailing commas where valid in ES5 (objects, arrays, etc.)"
  31366. }, {
  31367. value: "none",
  31368. description: "No trailing commas."
  31369. }, {
  31370. value: "all",
  31371. description: "Trailing commas wherever possible (including function arguments)."
  31372. }]
  31373. },
  31374. singleAttributePerLine: commonOptions.singleAttributePerLine
  31375. };
  31376. }
  31377. });
  31378. var require_parsers = __commonJS2({
  31379. "src/language-js/parse/parsers.js"(exports2, module2) {
  31380. "use strict";
  31381. module2.exports = {
  31382. get babel() {
  31383. return require("./parser-babel.js").parsers.babel;
  31384. },
  31385. get "babel-flow"() {
  31386. return require("./parser-babel.js").parsers["babel-flow"];
  31387. },
  31388. get "babel-ts"() {
  31389. return require("./parser-babel.js").parsers["babel-ts"];
  31390. },
  31391. get json() {
  31392. return require("./parser-babel.js").parsers.json;
  31393. },
  31394. get json5() {
  31395. return require("./parser-babel.js").parsers.json5;
  31396. },
  31397. get "json-stringify"() {
  31398. return require("./parser-babel.js").parsers["json-stringify"];
  31399. },
  31400. get __js_expression() {
  31401. return require("./parser-babel.js").parsers.__js_expression;
  31402. },
  31403. get __vue_expression() {
  31404. return require("./parser-babel.js").parsers.__vue_expression;
  31405. },
  31406. get __vue_event_binding() {
  31407. return require("./parser-babel.js").parsers.__vue_event_binding;
  31408. },
  31409. get flow() {
  31410. return require("./parser-flow.js").parsers.flow;
  31411. },
  31412. get typescript() {
  31413. return require("./parser-typescript.js").parsers.typescript;
  31414. },
  31415. get __ng_action() {
  31416. return require("./parser-angular.js").parsers.__ng_action;
  31417. },
  31418. get __ng_binding() {
  31419. return require("./parser-angular.js").parsers.__ng_binding;
  31420. },
  31421. get __ng_interpolation() {
  31422. return require("./parser-angular.js").parsers.__ng_interpolation;
  31423. },
  31424. get __ng_directive() {
  31425. return require("./parser-angular.js").parsers.__ng_directive;
  31426. },
  31427. get acorn() {
  31428. return require("./parser-espree.js").parsers.acorn;
  31429. },
  31430. get espree() {
  31431. return require("./parser-espree.js").parsers.espree;
  31432. },
  31433. get meriyah() {
  31434. return require("./parser-meriyah.js").parsers.meriyah;
  31435. },
  31436. get __babel_estree() {
  31437. return require("./parser-babel.js").parsers.__babel_estree;
  31438. }
  31439. };
  31440. }
  31441. });
  31442. var require_JavaScript = __commonJS2({
  31443. "node_modules/linguist-languages/data/JavaScript.json"(exports2, module2) {
  31444. module2.exports = {
  31445. name: "JavaScript",
  31446. type: "programming",
  31447. tmScope: "source.js",
  31448. aceMode: "javascript",
  31449. codemirrorMode: "javascript",
  31450. codemirrorMimeType: "text/javascript",
  31451. color: "#f1e05a",
  31452. aliases: ["js", "node"],
  31453. extensions: [".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".jsb", ".jscad", ".jsfl", ".jsm", ".jss", ".jsx", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib"],
  31454. filenames: ["Jakefile"],
  31455. interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"],
  31456. languageId: 183
  31457. };
  31458. }
  31459. });
  31460. var require_TypeScript = __commonJS2({
  31461. "node_modules/linguist-languages/data/TypeScript.json"(exports2, module2) {
  31462. module2.exports = {
  31463. name: "TypeScript",
  31464. type: "programming",
  31465. color: "#2b7489",
  31466. aliases: ["ts"],
  31467. interpreters: ["deno", "ts-node"],
  31468. extensions: [".ts"],
  31469. tmScope: "source.ts",
  31470. aceMode: "typescript",
  31471. codemirrorMode: "javascript",
  31472. codemirrorMimeType: "application/typescript",
  31473. languageId: 378
  31474. };
  31475. }
  31476. });
  31477. var require_TSX = __commonJS2({
  31478. "node_modules/linguist-languages/data/TSX.json"(exports2, module2) {
  31479. module2.exports = {
  31480. name: "TSX",
  31481. type: "programming",
  31482. group: "TypeScript",
  31483. extensions: [".tsx"],
  31484. tmScope: "source.tsx",
  31485. aceMode: "javascript",
  31486. codemirrorMode: "jsx",
  31487. codemirrorMimeType: "text/jsx",
  31488. languageId: 94901924
  31489. };
  31490. }
  31491. });
  31492. var require_JSON = __commonJS2({
  31493. "node_modules/linguist-languages/data/JSON.json"(exports2, module2) {
  31494. module2.exports = {
  31495. name: "JSON",
  31496. type: "data",
  31497. tmScope: "source.json",
  31498. aceMode: "json",
  31499. codemirrorMode: "javascript",
  31500. codemirrorMimeType: "application/json",
  31501. extensions: [".json", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".JSON-tmLanguage", ".jsonl", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"],
  31502. filenames: [".arcconfig", ".htmlhintrc", ".imgbotconfig", ".tern-config", ".tern-project", ".watchmanconfig", "Pipfile.lock", "composer.lock", "mcmod.info"],
  31503. languageId: 174
  31504. };
  31505. }
  31506. });
  31507. var require_JSON_with_Comments = __commonJS2({
  31508. "node_modules/linguist-languages/data/JSON with Comments.json"(exports2, module2) {
  31509. module2.exports = {
  31510. name: "JSON with Comments",
  31511. type: "data",
  31512. group: "JSON",
  31513. tmScope: "source.js",
  31514. aceMode: "javascript",
  31515. codemirrorMode: "javascript",
  31516. codemirrorMimeType: "text/javascript",
  31517. aliases: ["jsonc"],
  31518. extensions: [".jsonc", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"],
  31519. filenames: [".babelrc", ".eslintrc.json", ".jscsrc", ".jshintrc", ".jslintrc", "api-extractor.json", "devcontainer.json", "jsconfig.json", "language-configuration.json", "tsconfig.json", "tslint.json"],
  31520. languageId: 423
  31521. };
  31522. }
  31523. });
  31524. var require_JSON5 = __commonJS2({
  31525. "node_modules/linguist-languages/data/JSON5.json"(exports2, module2) {
  31526. module2.exports = {
  31527. name: "JSON5",
  31528. type: "data",
  31529. extensions: [".json5"],
  31530. tmScope: "source.js",
  31531. aceMode: "javascript",
  31532. codemirrorMode: "javascript",
  31533. codemirrorMimeType: "application/json",
  31534. languageId: 175
  31535. };
  31536. }
  31537. });
  31538. var require_language_js = __commonJS2({
  31539. "src/language-js/index.js"(exports2, module2) {
  31540. "use strict";
  31541. var createLanguage = require_create_language();
  31542. var estreePrinter = require_printer_estree();
  31543. var estreeJsonPrinter = require_printer_estree_json();
  31544. var options = require_options2();
  31545. var parsers = require_parsers();
  31546. var languages = [createLanguage(require_JavaScript(), (data) => ({
  31547. since: "0.0.0",
  31548. parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"],
  31549. vscodeLanguageIds: ["javascript", "mongo"],
  31550. interpreters: [...data.interpreters, "zx"],
  31551. extensions: [...data.extensions.filter((extension) => extension !== ".jsx"), ".wxs"]
  31552. })), createLanguage(require_JavaScript(), () => ({
  31553. name: "Flow",
  31554. since: "0.0.0",
  31555. parsers: ["flow", "babel-flow"],
  31556. vscodeLanguageIds: ["javascript"],
  31557. aliases: [],
  31558. filenames: [],
  31559. extensions: [".js.flow"]
  31560. })), createLanguage(require_JavaScript(), () => ({
  31561. name: "JSX",
  31562. since: "0.0.0",
  31563. parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"],
  31564. vscodeLanguageIds: ["javascriptreact"],
  31565. aliases: void 0,
  31566. filenames: void 0,
  31567. extensions: [".jsx"],
  31568. group: "JavaScript",
  31569. interpreters: void 0,
  31570. tmScope: "source.js.jsx",
  31571. aceMode: "javascript",
  31572. codemirrorMode: "jsx",
  31573. codemirrorMimeType: "text/jsx",
  31574. color: void 0
  31575. })), createLanguage(require_TypeScript(), (data) => ({
  31576. since: "1.4.0",
  31577. parsers: ["typescript", "babel-ts"],
  31578. vscodeLanguageIds: ["typescript"],
  31579. extensions: [...data.extensions, ".mts", ".cts"]
  31580. })), createLanguage(require_TSX(), () => ({
  31581. since: "1.4.0",
  31582. parsers: ["typescript", "babel-ts"],
  31583. vscodeLanguageIds: ["typescriptreact"]
  31584. })), createLanguage(require_JSON(), () => ({
  31585. name: "JSON.stringify",
  31586. since: "1.13.0",
  31587. parsers: ["json-stringify"],
  31588. vscodeLanguageIds: ["json"],
  31589. extensions: [],
  31590. filenames: ["package.json", "package-lock.json", "composer.json"]
  31591. })), createLanguage(require_JSON(), (data) => ({
  31592. since: "1.5.0",
  31593. parsers: ["json"],
  31594. vscodeLanguageIds: ["json"],
  31595. extensions: data.extensions.filter((extension) => extension !== ".jsonl")
  31596. })), createLanguage(require_JSON_with_Comments(), (data) => ({
  31597. since: "1.5.0",
  31598. parsers: ["json"],
  31599. vscodeLanguageIds: ["jsonc"],
  31600. filenames: [...data.filenames, ".eslintrc", ".swcrc"]
  31601. })), createLanguage(require_JSON5(), () => ({
  31602. since: "1.13.0",
  31603. parsers: ["json5"],
  31604. vscodeLanguageIds: ["json5"]
  31605. }))];
  31606. var printers = {
  31607. estree: estreePrinter,
  31608. "estree-json": estreeJsonPrinter
  31609. };
  31610. module2.exports = {
  31611. languages,
  31612. options,
  31613. printers,
  31614. parsers
  31615. };
  31616. }
  31617. });
  31618. var require_clean2 = __commonJS2({
  31619. "src/language-css/clean.js"(exports2, module2) {
  31620. "use strict";
  31621. var {
  31622. isFrontMatterNode
  31623. } = require_util();
  31624. var getLast = require_get_last();
  31625. var ignoredProperties = /* @__PURE__ */ new Set(["raw", "raws", "sourceIndex", "source", "before", "after", "trailingComma"]);
  31626. function clean(ast, newObj, parent) {
  31627. if (isFrontMatterNode(ast) && ast.lang === "yaml") {
  31628. delete newObj.value;
  31629. }
  31630. if (ast.type === "css-comment" && parent.type === "css-root" && parent.nodes.length > 0) {
  31631. if (parent.nodes[0] === ast || isFrontMatterNode(parent.nodes[0]) && parent.nodes[1] === ast) {
  31632. delete newObj.text;
  31633. if (/^\*\s*@(?:format|prettier)\s*$/.test(ast.text)) {
  31634. return null;
  31635. }
  31636. }
  31637. if (parent.type === "css-root" && getLast(parent.nodes) === ast) {
  31638. return null;
  31639. }
  31640. }
  31641. if (ast.type === "value-root") {
  31642. delete newObj.text;
  31643. }
  31644. if (ast.type === "media-query" || ast.type === "media-query-list" || ast.type === "media-feature-expression") {
  31645. delete newObj.value;
  31646. }
  31647. if (ast.type === "css-rule") {
  31648. delete newObj.params;
  31649. }
  31650. if (ast.type === "selector-combinator") {
  31651. newObj.value = newObj.value.replace(/\s+/g, " ");
  31652. }
  31653. if (ast.type === "media-feature") {
  31654. newObj.value = newObj.value.replace(/ /g, "");
  31655. }
  31656. if (ast.type === "value-word" && (ast.isColor && ast.isHex || ["initial", "inherit", "unset", "revert"].includes(newObj.value.replace().toLowerCase())) || ast.type === "media-feature" || ast.type === "selector-root-invalid" || ast.type === "selector-pseudo") {
  31657. newObj.value = newObj.value.toLowerCase();
  31658. }
  31659. if (ast.type === "css-decl") {
  31660. newObj.prop = newObj.prop.toLowerCase();
  31661. }
  31662. if (ast.type === "css-atrule" || ast.type === "css-import") {
  31663. newObj.name = newObj.name.toLowerCase();
  31664. }
  31665. if (ast.type === "value-number") {
  31666. newObj.unit = newObj.unit.toLowerCase();
  31667. }
  31668. if ((ast.type === "media-feature" || ast.type === "media-keyword" || ast.type === "media-type" || ast.type === "media-unknown" || ast.type === "media-url" || ast.type === "media-value" || ast.type === "selector-attribute" || ast.type === "selector-string" || ast.type === "selector-class" || ast.type === "selector-combinator" || ast.type === "value-string") && newObj.value) {
  31669. newObj.value = cleanCSSStrings(newObj.value);
  31670. }
  31671. if (ast.type === "selector-attribute") {
  31672. newObj.attribute = newObj.attribute.trim();
  31673. if (newObj.namespace) {
  31674. if (typeof newObj.namespace === "string") {
  31675. newObj.namespace = newObj.namespace.trim();
  31676. if (newObj.namespace.length === 0) {
  31677. newObj.namespace = true;
  31678. }
  31679. }
  31680. }
  31681. if (newObj.value) {
  31682. newObj.value = newObj.value.trim().replace(/^["']|["']$/g, "");
  31683. delete newObj.quoted;
  31684. }
  31685. }
  31686. if ((ast.type === "media-value" || ast.type === "media-type" || ast.type === "value-number" || ast.type === "selector-root-invalid" || ast.type === "selector-class" || ast.type === "selector-combinator" || ast.type === "selector-tag") && newObj.value) {
  31687. newObj.value = newObj.value.replace(/([\d+.Ee-]+)([A-Za-z]*)/g, (match, numStr, unit) => {
  31688. const num = Number(numStr);
  31689. return Number.isNaN(num) ? match : num + unit.toLowerCase();
  31690. });
  31691. }
  31692. if (ast.type === "selector-tag") {
  31693. const lowercasedValue = ast.value.toLowerCase();
  31694. if (["from", "to"].includes(lowercasedValue)) {
  31695. newObj.value = lowercasedValue;
  31696. }
  31697. }
  31698. if (ast.type === "css-atrule" && ast.name.toLowerCase() === "supports") {
  31699. delete newObj.value;
  31700. }
  31701. if (ast.type === "selector-unknown") {
  31702. delete newObj.value;
  31703. }
  31704. if (ast.type === "value-comma_group") {
  31705. const index = ast.groups.findIndex((node) => node.type === "value-number" && node.unit === "...");
  31706. if (index !== -1) {
  31707. newObj.groups[index].unit = "";
  31708. newObj.groups.splice(index + 1, 0, {
  31709. type: "value-word",
  31710. value: "...",
  31711. isColor: false,
  31712. isHex: false
  31713. });
  31714. }
  31715. }
  31716. }
  31717. clean.ignoredProperties = ignoredProperties;
  31718. function cleanCSSStrings(value) {
  31719. return value.replace(/'/g, '"').replace(/\\([^\dA-Fa-f])/g, "$1");
  31720. }
  31721. module2.exports = clean;
  31722. }
  31723. });
  31724. var require_print = __commonJS2({
  31725. "src/utils/front-matter/print.js"(exports2, module2) {
  31726. "use strict";
  31727. var {
  31728. builders: {
  31729. hardline,
  31730. markAsRoot
  31731. }
  31732. } = require("./doc.js");
  31733. function print(node, textToDoc) {
  31734. if (node.lang === "yaml") {
  31735. const value = node.value.trim();
  31736. const doc2 = value ? textToDoc(value, {
  31737. parser: "yaml"
  31738. }, {
  31739. stripTrailingHardline: true
  31740. }) : "";
  31741. return markAsRoot([node.startDelimiter, hardline, doc2, doc2 ? hardline : "", node.endDelimiter]);
  31742. }
  31743. }
  31744. module2.exports = print;
  31745. }
  31746. });
  31747. var require_embed2 = __commonJS2({
  31748. "src/language-css/embed.js"(exports2, module2) {
  31749. "use strict";
  31750. var {
  31751. builders: {
  31752. hardline
  31753. }
  31754. } = require("./doc.js");
  31755. var printFrontMatter = require_print();
  31756. function embed(path, print, textToDoc) {
  31757. const node = path.getValue();
  31758. if (node.type === "front-matter") {
  31759. const doc2 = printFrontMatter(node, textToDoc);
  31760. return doc2 ? [doc2, hardline] : "";
  31761. }
  31762. }
  31763. module2.exports = embed;
  31764. }
  31765. });
  31766. var require_parse4 = __commonJS2({
  31767. "src/utils/front-matter/parse.js"(exports2, module2) {
  31768. "use strict";
  31769. var frontMatterRegex = new RegExp("^(?<startDelimiter>-{3}|\\+{3})(?<language>[^\\n]*)\\n(?:|(?<value>.*?)\\n)(?<endDelimiter>\\k<startDelimiter>|\\.{3})[^\\S\\n]*(?:\\n|$)", "s");
  31770. function parse(text) {
  31771. const match = text.match(frontMatterRegex);
  31772. if (!match) {
  31773. return {
  31774. content: text
  31775. };
  31776. }
  31777. const {
  31778. startDelimiter,
  31779. language,
  31780. value = "",
  31781. endDelimiter
  31782. } = match.groups;
  31783. let lang = language.trim() || "yaml";
  31784. if (startDelimiter === "+++") {
  31785. lang = "toml";
  31786. }
  31787. if (lang !== "yaml" && startDelimiter !== endDelimiter) {
  31788. return {
  31789. content: text
  31790. };
  31791. }
  31792. const [raw] = match;
  31793. const frontMatter = {
  31794. type: "front-matter",
  31795. lang,
  31796. value,
  31797. startDelimiter,
  31798. endDelimiter,
  31799. raw: raw.replace(/\n$/, "")
  31800. };
  31801. return {
  31802. frontMatter,
  31803. content: raw.replace(/[^\n]/g, " ") + text.slice(raw.length)
  31804. };
  31805. }
  31806. module2.exports = parse;
  31807. }
  31808. });
  31809. var require_pragma2 = __commonJS2({
  31810. "src/language-css/pragma.js"(exports2, module2) {
  31811. "use strict";
  31812. var jsPragma = require_pragma();
  31813. var parseFrontMatter = require_parse4();
  31814. function hasPragma(text) {
  31815. return jsPragma.hasPragma(parseFrontMatter(text).content);
  31816. }
  31817. function insertPragma(text) {
  31818. const {
  31819. frontMatter,
  31820. content
  31821. } = parseFrontMatter(text);
  31822. return (frontMatter ? frontMatter.raw + "\n\n" : "") + jsPragma.insertPragma(content);
  31823. }
  31824. module2.exports = {
  31825. hasPragma,
  31826. insertPragma
  31827. };
  31828. }
  31829. });
  31830. var require_utils8 = __commonJS2({
  31831. "src/language-css/utils/index.js"(exports2, module2) {
  31832. "use strict";
  31833. var colorAdjusterFunctions = /* @__PURE__ */ new Set(["red", "green", "blue", "alpha", "a", "rgb", "hue", "h", "saturation", "s", "lightness", "l", "whiteness", "w", "blackness", "b", "tint", "shade", "blend", "blenda", "contrast", "hsl", "hsla", "hwb", "hwba"]);
  31834. function getAncestorCounter(path, typeOrTypes) {
  31835. const types = Array.isArray(typeOrTypes) ? typeOrTypes : [typeOrTypes];
  31836. let counter = -1;
  31837. let ancestorNode;
  31838. while (ancestorNode = path.getParentNode(++counter)) {
  31839. if (types.includes(ancestorNode.type)) {
  31840. return counter;
  31841. }
  31842. }
  31843. return -1;
  31844. }
  31845. function getAncestorNode(path, typeOrTypes) {
  31846. const counter = getAncestorCounter(path, typeOrTypes);
  31847. return counter === -1 ? null : path.getParentNode(counter);
  31848. }
  31849. function getPropOfDeclNode(path) {
  31850. const declAncestorNode = getAncestorNode(path, "css-decl");
  31851. return declAncestorNode && declAncestorNode.prop && declAncestorNode.prop.toLowerCase();
  31852. }
  31853. function isWideKeywords(value) {
  31854. return ["initial", "inherit", "unset", "revert"].includes(value.toLowerCase());
  31855. }
  31856. function isKeyframeAtRuleKeywords(path, value) {
  31857. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  31858. return atRuleAncestorNode && atRuleAncestorNode.name && atRuleAncestorNode.name.toLowerCase().endsWith("keyframes") && ["from", "to"].includes(value.toLowerCase());
  31859. }
  31860. function maybeToLowerCase(value) {
  31861. return value.includes("$") || value.includes("@") || value.includes("#") || value.startsWith("%") || value.startsWith("--") || value.startsWith(":--") || value.includes("(") && value.includes(")") ? value : value.toLowerCase();
  31862. }
  31863. function insideValueFunctionNode(path, functionName) {
  31864. const funcAncestorNode = getAncestorNode(path, "value-func");
  31865. return funcAncestorNode && funcAncestorNode.value && funcAncestorNode.value.toLowerCase() === functionName;
  31866. }
  31867. function insideICSSRuleNode(path) {
  31868. const ruleAncestorNode = getAncestorNode(path, "css-rule");
  31869. return ruleAncestorNode && ruleAncestorNode.raws && ruleAncestorNode.raws.selector && (ruleAncestorNode.raws.selector.startsWith(":import") || ruleAncestorNode.raws.selector.startsWith(":export"));
  31870. }
  31871. function insideAtRuleNode(path, atRuleNameOrAtRuleNames) {
  31872. const atRuleNames = Array.isArray(atRuleNameOrAtRuleNames) ? atRuleNameOrAtRuleNames : [atRuleNameOrAtRuleNames];
  31873. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  31874. return atRuleAncestorNode && atRuleNames.includes(atRuleAncestorNode.name.toLowerCase());
  31875. }
  31876. function insideURLFunctionInImportAtRuleNode(path) {
  31877. const node = path.getValue();
  31878. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  31879. return atRuleAncestorNode && atRuleAncestorNode.name === "import" && node.groups[0].value === "url" && node.groups.length === 2;
  31880. }
  31881. function isURLFunctionNode(node) {
  31882. return node.type === "value-func" && node.value.toLowerCase() === "url";
  31883. }
  31884. function isLastNode(path, node) {
  31885. const parentNode = path.getParentNode();
  31886. if (!parentNode) {
  31887. return false;
  31888. }
  31889. const {
  31890. nodes
  31891. } = parentNode;
  31892. return nodes && nodes.indexOf(node) === nodes.length - 1;
  31893. }
  31894. function isDetachedRulesetDeclarationNode(node) {
  31895. if (!node.selector) {
  31896. return false;
  31897. }
  31898. return typeof node.selector === "string" && /^@.+:.*$/.test(node.selector) || node.selector.value && /^@.+:.*$/.test(node.selector.value);
  31899. }
  31900. function isForKeywordNode(node) {
  31901. return node.type === "value-word" && ["from", "through", "end"].includes(node.value);
  31902. }
  31903. function isIfElseKeywordNode(node) {
  31904. return node.type === "value-word" && ["and", "or", "not"].includes(node.value);
  31905. }
  31906. function isEachKeywordNode(node) {
  31907. return node.type === "value-word" && node.value === "in";
  31908. }
  31909. function isMultiplicationNode(node) {
  31910. return node.type === "value-operator" && node.value === "*";
  31911. }
  31912. function isDivisionNode(node) {
  31913. return node.type === "value-operator" && node.value === "/";
  31914. }
  31915. function isAdditionNode(node) {
  31916. return node.type === "value-operator" && node.value === "+";
  31917. }
  31918. function isSubtractionNode(node) {
  31919. return node.type === "value-operator" && node.value === "-";
  31920. }
  31921. function isModuloNode(node) {
  31922. return node.type === "value-operator" && node.value === "%";
  31923. }
  31924. function isMathOperatorNode(node) {
  31925. return isMultiplicationNode(node) || isDivisionNode(node) || isAdditionNode(node) || isSubtractionNode(node) || isModuloNode(node);
  31926. }
  31927. function isEqualityOperatorNode(node) {
  31928. return node.type === "value-word" && ["==", "!="].includes(node.value);
  31929. }
  31930. function isRelationalOperatorNode(node) {
  31931. return node.type === "value-word" && ["<", ">", "<=", ">="].includes(node.value);
  31932. }
  31933. function isSCSSControlDirectiveNode(node) {
  31934. return node.type === "css-atrule" && ["if", "else", "for", "each", "while"].includes(node.name);
  31935. }
  31936. function isDetachedRulesetCallNode(node) {
  31937. return node.raws && node.raws.params && /^\(\s*\)$/.test(node.raws.params);
  31938. }
  31939. function isTemplatePlaceholderNode(node) {
  31940. return node.name.startsWith("prettier-placeholder");
  31941. }
  31942. function isTemplatePropNode(node) {
  31943. return node.prop.startsWith("@prettier-placeholder");
  31944. }
  31945. function isPostcssSimpleVarNode(currentNode, nextNode) {
  31946. return currentNode.value === "$$" && currentNode.type === "value-func" && nextNode && nextNode.type === "value-word" && !nextNode.raws.before;
  31947. }
  31948. function hasComposesNode(node) {
  31949. return node.value && node.value.type === "value-root" && node.value.group && node.value.group.type === "value-value" && node.prop.toLowerCase() === "composes";
  31950. }
  31951. function hasParensAroundNode(node) {
  31952. return node.value && node.value.group && node.value.group.group && node.value.group.group.type === "value-paren_group" && node.value.group.group.open !== null && node.value.group.group.close !== null;
  31953. }
  31954. function hasEmptyRawBefore(node) {
  31955. return node.raws && node.raws.before === "";
  31956. }
  31957. function isKeyValuePairNode(node) {
  31958. return node.type === "value-comma_group" && node.groups && node.groups[1] && node.groups[1].type === "value-colon";
  31959. }
  31960. function isKeyValuePairInParenGroupNode(node) {
  31961. return node.type === "value-paren_group" && node.groups && node.groups[0] && isKeyValuePairNode(node.groups[0]);
  31962. }
  31963. function isSCSSMapItemNode(path) {
  31964. const node = path.getValue();
  31965. if (node.groups.length === 0) {
  31966. return false;
  31967. }
  31968. const parentParentNode = path.getParentNode(1);
  31969. if (!isKeyValuePairInParenGroupNode(node) && !(parentParentNode && isKeyValuePairInParenGroupNode(parentParentNode))) {
  31970. return false;
  31971. }
  31972. const declNode = getAncestorNode(path, "css-decl");
  31973. if (declNode && declNode.prop && declNode.prop.startsWith("$")) {
  31974. return true;
  31975. }
  31976. if (isKeyValuePairInParenGroupNode(parentParentNode)) {
  31977. return true;
  31978. }
  31979. if (parentParentNode.type === "value-func") {
  31980. return true;
  31981. }
  31982. return false;
  31983. }
  31984. function isInlineValueCommentNode(node) {
  31985. return node.type === "value-comment" && node.inline;
  31986. }
  31987. function isHashNode(node) {
  31988. return node.type === "value-word" && node.value === "#";
  31989. }
  31990. function isLeftCurlyBraceNode(node) {
  31991. return node.type === "value-word" && node.value === "{";
  31992. }
  31993. function isRightCurlyBraceNode(node) {
  31994. return node.type === "value-word" && node.value === "}";
  31995. }
  31996. function isWordNode(node) {
  31997. return ["value-word", "value-atword"].includes(node.type);
  31998. }
  31999. function isColonNode(node) {
  32000. return node && node.type === "value-colon";
  32001. }
  32002. function isKeyInValuePairNode(node, parentNode) {
  32003. if (!isKeyValuePairNode(parentNode)) {
  32004. return false;
  32005. }
  32006. const {
  32007. groups
  32008. } = parentNode;
  32009. const index = groups.indexOf(node);
  32010. if (index === -1) {
  32011. return false;
  32012. }
  32013. return isColonNode(groups[index + 1]);
  32014. }
  32015. function isMediaAndSupportsKeywords(node) {
  32016. return node.value && ["not", "and", "or"].includes(node.value.toLowerCase());
  32017. }
  32018. function isColorAdjusterFuncNode(node) {
  32019. if (node.type !== "value-func") {
  32020. return false;
  32021. }
  32022. return colorAdjusterFunctions.has(node.value.toLowerCase());
  32023. }
  32024. function lastLineHasInlineComment(text) {
  32025. return /\/\//.test(text.split(/[\n\r]/).pop());
  32026. }
  32027. function isAtWordPlaceholderNode(node) {
  32028. return node && node.type === "value-atword" && node.value.startsWith("prettier-placeholder-");
  32029. }
  32030. function isConfigurationNode(node, parentNode) {
  32031. if (!node.open || node.open.value !== "(" || !node.close || node.close.value !== ")" || node.groups.some((group) => group.type !== "value-comma_group")) {
  32032. return false;
  32033. }
  32034. if (parentNode.type === "value-comma_group") {
  32035. const prevIdx = parentNode.groups.indexOf(node) - 1;
  32036. const maybeWithNode = parentNode.groups[prevIdx];
  32037. if (maybeWithNode && maybeWithNode.type === "value-word" && maybeWithNode.value === "with") {
  32038. return true;
  32039. }
  32040. }
  32041. return false;
  32042. }
  32043. function isParenGroupNode(node) {
  32044. return node.type === "value-paren_group" && node.open && node.open.value === "(" && node.close && node.close.value === ")";
  32045. }
  32046. module2.exports = {
  32047. getAncestorCounter,
  32048. getAncestorNode,
  32049. getPropOfDeclNode,
  32050. maybeToLowerCase,
  32051. insideValueFunctionNode,
  32052. insideICSSRuleNode,
  32053. insideAtRuleNode,
  32054. insideURLFunctionInImportAtRuleNode,
  32055. isKeyframeAtRuleKeywords,
  32056. isWideKeywords,
  32057. isLastNode,
  32058. isSCSSControlDirectiveNode,
  32059. isDetachedRulesetDeclarationNode,
  32060. isRelationalOperatorNode,
  32061. isEqualityOperatorNode,
  32062. isMultiplicationNode,
  32063. isDivisionNode,
  32064. isAdditionNode,
  32065. isSubtractionNode,
  32066. isModuloNode,
  32067. isMathOperatorNode,
  32068. isEachKeywordNode,
  32069. isForKeywordNode,
  32070. isURLFunctionNode,
  32071. isIfElseKeywordNode,
  32072. hasComposesNode,
  32073. hasParensAroundNode,
  32074. hasEmptyRawBefore,
  32075. isDetachedRulesetCallNode,
  32076. isTemplatePlaceholderNode,
  32077. isTemplatePropNode,
  32078. isPostcssSimpleVarNode,
  32079. isKeyValuePairNode,
  32080. isKeyValuePairInParenGroupNode,
  32081. isKeyInValuePairNode,
  32082. isSCSSMapItemNode,
  32083. isInlineValueCommentNode,
  32084. isHashNode,
  32085. isLeftCurlyBraceNode,
  32086. isRightCurlyBraceNode,
  32087. isWordNode,
  32088. isColonNode,
  32089. isMediaAndSupportsKeywords,
  32090. isColorAdjusterFuncNode,
  32091. lastLineHasInlineComment,
  32092. isAtWordPlaceholderNode,
  32093. isConfigurationNode,
  32094. isParenGroupNode
  32095. };
  32096. }
  32097. });
  32098. var require_line_column_to_index = __commonJS2({
  32099. "src/utils/line-column-to-index.js"(exports2, module2) {
  32100. "use strict";
  32101. module2.exports = function(lineColumn, text) {
  32102. let index = 0;
  32103. for (let i = 0; i < lineColumn.line - 1; ++i) {
  32104. index = text.indexOf("\n", index) + 1;
  32105. }
  32106. return index + lineColumn.column;
  32107. };
  32108. }
  32109. });
  32110. var require_loc2 = __commonJS2({
  32111. "src/language-css/loc.js"(exports2, module2) {
  32112. "use strict";
  32113. var {
  32114. skipEverythingButNewLine
  32115. } = require_skip();
  32116. var getLast = require_get_last();
  32117. var lineColumnToIndex = require_line_column_to_index();
  32118. function calculateLocStart(node, text) {
  32119. if (typeof node.sourceIndex === "number") {
  32120. return node.sourceIndex;
  32121. }
  32122. return node.source ? lineColumnToIndex(node.source.start, text) - 1 : null;
  32123. }
  32124. function calculateLocEnd(node, text) {
  32125. if (node.type === "css-comment" && node.inline) {
  32126. return skipEverythingButNewLine(text, node.source.startOffset);
  32127. }
  32128. const endNode = node.nodes && getLast(node.nodes);
  32129. if (endNode && node.source && !node.source.end) {
  32130. node = endNode;
  32131. }
  32132. if (node.source && node.source.end) {
  32133. return lineColumnToIndex(node.source.end, text);
  32134. }
  32135. return null;
  32136. }
  32137. function calculateLoc(node, text) {
  32138. if (node.source) {
  32139. node.source.startOffset = calculateLocStart(node, text);
  32140. node.source.endOffset = calculateLocEnd(node, text);
  32141. }
  32142. for (const key in node) {
  32143. const child = node[key];
  32144. if (key === "source" || !child || typeof child !== "object") {
  32145. continue;
  32146. }
  32147. if (child.type === "value-root" || child.type === "value-unknown") {
  32148. calculateValueNodeLoc(child, getValueRootOffset(node), child.text || child.value);
  32149. } else {
  32150. calculateLoc(child, text);
  32151. }
  32152. }
  32153. }
  32154. function calculateValueNodeLoc(node, rootOffset, text) {
  32155. if (node.source) {
  32156. node.source.startOffset = calculateLocStart(node, text) + rootOffset;
  32157. node.source.endOffset = calculateLocEnd(node, text) + rootOffset;
  32158. }
  32159. for (const key in node) {
  32160. const child = node[key];
  32161. if (key === "source" || !child || typeof child !== "object") {
  32162. continue;
  32163. }
  32164. calculateValueNodeLoc(child, rootOffset, text);
  32165. }
  32166. }
  32167. function getValueRootOffset(node) {
  32168. let result = node.source.startOffset;
  32169. if (typeof node.prop === "string") {
  32170. result += node.prop.length;
  32171. }
  32172. if (node.type === "css-atrule" && typeof node.name === "string") {
  32173. result += 1 + node.name.length + node.raws.afterName.match(/^\s*:?\s*/)[0].length;
  32174. }
  32175. if (node.type !== "css-atrule" && node.raws && typeof node.raws.between === "string") {
  32176. result += node.raws.between.length;
  32177. }
  32178. return result;
  32179. }
  32180. function replaceQuotesInInlineComments(text) {
  32181. let state = "initial";
  32182. let stateToReturnFromQuotes = "initial";
  32183. let inlineCommentStartIndex;
  32184. let inlineCommentContainsQuotes = false;
  32185. const inlineCommentsToReplace = [];
  32186. for (let i = 0; i < text.length; i++) {
  32187. const c = text[i];
  32188. switch (state) {
  32189. case "initial":
  32190. if (c === "'") {
  32191. state = "single-quotes";
  32192. continue;
  32193. }
  32194. if (c === '"') {
  32195. state = "double-quotes";
  32196. continue;
  32197. }
  32198. if ((c === "u" || c === "U") && text.slice(i, i + 4).toLowerCase() === "url(") {
  32199. state = "url";
  32200. i += 3;
  32201. continue;
  32202. }
  32203. if (c === "*" && text[i - 1] === "/") {
  32204. state = "comment-block";
  32205. continue;
  32206. }
  32207. if (c === "/" && text[i - 1] === "/") {
  32208. state = "comment-inline";
  32209. inlineCommentStartIndex = i - 1;
  32210. continue;
  32211. }
  32212. continue;
  32213. case "single-quotes":
  32214. if (c === "'" && text[i - 1] !== "\\") {
  32215. state = stateToReturnFromQuotes;
  32216. stateToReturnFromQuotes = "initial";
  32217. }
  32218. if (c === "\n" || c === "\r") {
  32219. return text;
  32220. }
  32221. continue;
  32222. case "double-quotes":
  32223. if (c === '"' && text[i - 1] !== "\\") {
  32224. state = stateToReturnFromQuotes;
  32225. stateToReturnFromQuotes = "initial";
  32226. }
  32227. if (c === "\n" || c === "\r") {
  32228. return text;
  32229. }
  32230. continue;
  32231. case "url":
  32232. if (c === ")") {
  32233. state = "initial";
  32234. }
  32235. if (c === "\n" || c === "\r") {
  32236. return text;
  32237. }
  32238. if (c === "'") {
  32239. state = "single-quotes";
  32240. stateToReturnFromQuotes = "url";
  32241. continue;
  32242. }
  32243. if (c === '"') {
  32244. state = "double-quotes";
  32245. stateToReturnFromQuotes = "url";
  32246. continue;
  32247. }
  32248. continue;
  32249. case "comment-block":
  32250. if (c === "/" && text[i - 1] === "*") {
  32251. state = "initial";
  32252. }
  32253. continue;
  32254. case "comment-inline":
  32255. if (c === '"' || c === "'" || c === "*") {
  32256. inlineCommentContainsQuotes = true;
  32257. }
  32258. if (c === "\n" || c === "\r") {
  32259. if (inlineCommentContainsQuotes) {
  32260. inlineCommentsToReplace.push([inlineCommentStartIndex, i]);
  32261. }
  32262. state = "initial";
  32263. inlineCommentContainsQuotes = false;
  32264. }
  32265. continue;
  32266. }
  32267. }
  32268. for (const [start, end] of inlineCommentsToReplace) {
  32269. text = text.slice(0, start) + text.slice(start, end).replace(/["'*]/g, " ") + text.slice(end);
  32270. }
  32271. return text;
  32272. }
  32273. function locStart(node) {
  32274. return node.source.startOffset;
  32275. }
  32276. function locEnd(node) {
  32277. return node.source.endOffset;
  32278. }
  32279. module2.exports = {
  32280. locStart,
  32281. locEnd,
  32282. calculateLoc,
  32283. replaceQuotesInInlineComments
  32284. };
  32285. }
  32286. });
  32287. var require_is_less_parser = __commonJS2({
  32288. "src/language-css/utils/is-less-parser.js"(exports2, module2) {
  32289. "use strict";
  32290. function isLessParser(options) {
  32291. return options.parser === "css" || options.parser === "less";
  32292. }
  32293. module2.exports = isLessParser;
  32294. }
  32295. });
  32296. var require_is_scss = __commonJS2({
  32297. "src/language-css/utils/is-scss.js"(exports2, module2) {
  32298. "use strict";
  32299. function isSCSS(parser, text) {
  32300. const hasExplicitParserChoice = parser === "less" || parser === "scss";
  32301. const IS_POSSIBLY_SCSS = /(?:\w\s*:\s*[^:}]+|#){|@import[^\n]+(?:url|,)/;
  32302. return hasExplicitParserChoice ? parser === "scss" : IS_POSSIBLY_SCSS.test(text);
  32303. }
  32304. module2.exports = isSCSS;
  32305. }
  32306. });
  32307. var require_css_units_evaluate = __commonJS2({
  32308. "src/language-css/utils/css-units.evaluate.js"(exports2, module2) {
  32309. module2.exports = {
  32310. em: "em",
  32311. rem: "rem",
  32312. ex: "ex",
  32313. rex: "rex",
  32314. cap: "cap",
  32315. rcap: "rcap",
  32316. ch: "ch",
  32317. rch: "rch",
  32318. ic: "ic",
  32319. ric: "ric",
  32320. lh: "lh",
  32321. rlh: "rlh",
  32322. vw: "vw",
  32323. vh: "vh",
  32324. vi: "vi",
  32325. vb: "vb",
  32326. vmin: "vmin",
  32327. vmax: "vmax",
  32328. cm: "cm",
  32329. mm: "mm",
  32330. q: "Q",
  32331. in: "in",
  32332. pt: "pt",
  32333. pc: "pc",
  32334. px: "px",
  32335. deg: "deg",
  32336. grad: "grad",
  32337. rad: "rad",
  32338. turn: "turn",
  32339. s: "s",
  32340. ms: "ms",
  32341. hz: "Hz",
  32342. khz: "kHz",
  32343. dpi: "dpi",
  32344. dpcm: "dpcm",
  32345. dppx: "dppx",
  32346. x: "x"
  32347. };
  32348. }
  32349. });
  32350. var require_print_unit = __commonJS2({
  32351. "src/language-css/utils/print-unit.js"(exports2, module2) {
  32352. "use strict";
  32353. var CSS_UNITS = require_css_units_evaluate();
  32354. function printUnit(unit) {
  32355. const lowercased = unit.toLowerCase();
  32356. return Object.prototype.hasOwnProperty.call(CSS_UNITS, lowercased) ? CSS_UNITS[lowercased] : unit;
  32357. }
  32358. module2.exports = printUnit;
  32359. }
  32360. });
  32361. var require_printer_postcss = __commonJS2({
  32362. "src/language-css/printer-postcss.js"(exports2, module2) {
  32363. "use strict";
  32364. var getLast = require_get_last();
  32365. var {
  32366. printNumber,
  32367. printString,
  32368. hasNewline,
  32369. isFrontMatterNode,
  32370. isNextLineEmpty,
  32371. isNonEmptyArray
  32372. } = require_util();
  32373. var {
  32374. builders: {
  32375. join,
  32376. line,
  32377. hardline,
  32378. softline,
  32379. group,
  32380. fill,
  32381. indent,
  32382. dedent,
  32383. ifBreak,
  32384. breakParent
  32385. },
  32386. utils: {
  32387. removeLines,
  32388. getDocParts
  32389. }
  32390. } = require("./doc.js");
  32391. var clean = require_clean2();
  32392. var embed = require_embed2();
  32393. var {
  32394. insertPragma
  32395. } = require_pragma2();
  32396. var {
  32397. getAncestorNode,
  32398. getPropOfDeclNode,
  32399. maybeToLowerCase,
  32400. insideValueFunctionNode,
  32401. insideICSSRuleNode,
  32402. insideAtRuleNode,
  32403. insideURLFunctionInImportAtRuleNode,
  32404. isKeyframeAtRuleKeywords,
  32405. isWideKeywords,
  32406. isLastNode,
  32407. isSCSSControlDirectiveNode,
  32408. isDetachedRulesetDeclarationNode,
  32409. isRelationalOperatorNode,
  32410. isEqualityOperatorNode,
  32411. isMultiplicationNode,
  32412. isDivisionNode,
  32413. isAdditionNode,
  32414. isSubtractionNode,
  32415. isMathOperatorNode,
  32416. isEachKeywordNode,
  32417. isForKeywordNode,
  32418. isURLFunctionNode,
  32419. isIfElseKeywordNode,
  32420. hasComposesNode,
  32421. hasParensAroundNode,
  32422. hasEmptyRawBefore,
  32423. isKeyValuePairNode,
  32424. isKeyInValuePairNode,
  32425. isDetachedRulesetCallNode,
  32426. isTemplatePlaceholderNode,
  32427. isTemplatePropNode,
  32428. isPostcssSimpleVarNode,
  32429. isSCSSMapItemNode,
  32430. isInlineValueCommentNode,
  32431. isHashNode,
  32432. isLeftCurlyBraceNode,
  32433. isRightCurlyBraceNode,
  32434. isWordNode,
  32435. isColonNode,
  32436. isMediaAndSupportsKeywords,
  32437. isColorAdjusterFuncNode,
  32438. lastLineHasInlineComment,
  32439. isAtWordPlaceholderNode,
  32440. isConfigurationNode,
  32441. isParenGroupNode
  32442. } = require_utils8();
  32443. var {
  32444. locStart,
  32445. locEnd
  32446. } = require_loc2();
  32447. var isLessParser = require_is_less_parser();
  32448. var isSCSS = require_is_scss();
  32449. var printUnit = require_print_unit();
  32450. function shouldPrintComma(options) {
  32451. return options.trailingComma === "es5" || options.trailingComma === "all";
  32452. }
  32453. function genericPrint(path, options, print) {
  32454. const node = path.getValue();
  32455. if (!node) {
  32456. return "";
  32457. }
  32458. if (typeof node === "string") {
  32459. return node;
  32460. }
  32461. switch (node.type) {
  32462. case "front-matter":
  32463. return [node.raw, hardline];
  32464. case "css-root": {
  32465. const nodes = printNodeSequence(path, options, print);
  32466. const after = node.raws.after.trim();
  32467. return [nodes, after ? ` ${after}` : "", getDocParts(nodes).length > 0 ? hardline : ""];
  32468. }
  32469. case "css-comment": {
  32470. const isInlineComment = node.inline || node.raws.inline;
  32471. const text = options.originalText.slice(locStart(node), locEnd(node));
  32472. return isInlineComment ? text.trimEnd() : text;
  32473. }
  32474. case "css-rule": {
  32475. return [print("selector"), node.important ? " !important" : "", node.nodes ? [node.selector && node.selector.type === "selector-unknown" && lastLineHasInlineComment(node.selector.value) ? line : " ", "{", node.nodes.length > 0 ? indent([hardline, printNodeSequence(path, options, print)]) : "", hardline, "}", isDetachedRulesetDeclarationNode(node) ? ";" : ""] : ";"];
  32476. }
  32477. case "css-decl": {
  32478. const parentNode = path.getParentNode();
  32479. const {
  32480. between: rawBetween
  32481. } = node.raws;
  32482. const trimmedBetween = rawBetween.trim();
  32483. const isColon = trimmedBetween === ":";
  32484. let value = hasComposesNode(node) ? removeLines(print("value")) : print("value");
  32485. if (!isColon && lastLineHasInlineComment(trimmedBetween)) {
  32486. value = indent([hardline, dedent(value)]);
  32487. }
  32488. return [node.raws.before.replace(/[\s;]/g, ""), insideICSSRuleNode(path) ? node.prop : maybeToLowerCase(node.prop), trimmedBetween.startsWith("//") ? " " : "", trimmedBetween, node.extend ? "" : " ", isLessParser(options) && node.extend && node.selector ? ["extend(", print("selector"), ")"] : "", value, node.raws.important ? node.raws.important.replace(/\s*!\s*important/i, " !important") : node.important ? " !important" : "", node.raws.scssDefault ? node.raws.scssDefault.replace(/\s*!default/i, " !default") : node.scssDefault ? " !default" : "", node.raws.scssGlobal ? node.raws.scssGlobal.replace(/\s*!global/i, " !global") : node.scssGlobal ? " !global" : "", node.nodes ? [" {", indent([softline, printNodeSequence(path, options, print)]), softline, "}"] : isTemplatePropNode(node) && !parentNode.raws.semicolon && options.originalText[locEnd(node) - 1] !== ";" ? "" : options.__isHTMLStyleAttribute && isLastNode(path, node) ? ifBreak(";") : ";"];
  32489. }
  32490. case "css-atrule": {
  32491. const parentNode = path.getParentNode();
  32492. const isTemplatePlaceholderNodeWithoutSemiColon = isTemplatePlaceholderNode(node) && !parentNode.raws.semicolon && options.originalText[locEnd(node) - 1] !== ";";
  32493. if (isLessParser(options)) {
  32494. if (node.mixin) {
  32495. return [print("selector"), node.important ? " !important" : "", isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"];
  32496. }
  32497. if (node.function) {
  32498. return [node.name, print("params"), isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"];
  32499. }
  32500. if (node.variable) {
  32501. return ["@", node.name, ": ", node.value ? print("value") : "", node.raws.between.trim() ? node.raws.between.trim() + " " : "", node.nodes ? ["{", indent([node.nodes.length > 0 ? softline : "", printNodeSequence(path, options, print)]), softline, "}"] : "", isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"];
  32502. }
  32503. }
  32504. return ["@", isDetachedRulesetCallNode(node) || node.name.endsWith(":") ? node.name : maybeToLowerCase(node.name), node.params ? [isDetachedRulesetCallNode(node) ? "" : isTemplatePlaceholderNode(node) ? node.raws.afterName === "" ? "" : node.name.endsWith(":") ? " " : /^\s*\n\s*\n/.test(node.raws.afterName) ? [hardline, hardline] : /^\s*\n/.test(node.raws.afterName) ? hardline : " " : " ", print("params")] : "", node.selector ? indent([" ", print("selector")]) : "", node.value ? group([" ", print("value"), isSCSSControlDirectiveNode(node) ? hasParensAroundNode(node) ? " " : line : ""]) : node.name === "else" ? " " : "", node.nodes ? [isSCSSControlDirectiveNode(node) ? "" : node.selector && !node.selector.nodes && typeof node.selector.value === "string" && lastLineHasInlineComment(node.selector.value) || !node.selector && typeof node.params === "string" && lastLineHasInlineComment(node.params) ? line : " ", "{", indent([node.nodes.length > 0 ? softline : "", printNodeSequence(path, options, print)]), softline, "}"] : isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"];
  32505. }
  32506. case "media-query-list": {
  32507. const parts = [];
  32508. path.each((childPath) => {
  32509. const node2 = childPath.getValue();
  32510. if (node2.type === "media-query" && node2.value === "") {
  32511. return;
  32512. }
  32513. parts.push(print());
  32514. }, "nodes");
  32515. return group(indent(join(line, parts)));
  32516. }
  32517. case "media-query": {
  32518. return [join(" ", path.map(print, "nodes")), isLastNode(path, node) ? "" : ","];
  32519. }
  32520. case "media-type": {
  32521. return adjustNumbers(adjustStrings(node.value, options));
  32522. }
  32523. case "media-feature-expression": {
  32524. if (!node.nodes) {
  32525. return node.value;
  32526. }
  32527. return ["(", ...path.map(print, "nodes"), ")"];
  32528. }
  32529. case "media-feature": {
  32530. return maybeToLowerCase(adjustStrings(node.value.replace(/ +/g, " "), options));
  32531. }
  32532. case "media-colon": {
  32533. return [node.value, " "];
  32534. }
  32535. case "media-value": {
  32536. return adjustNumbers(adjustStrings(node.value, options));
  32537. }
  32538. case "media-keyword": {
  32539. return adjustStrings(node.value, options);
  32540. }
  32541. case "media-url": {
  32542. return adjustStrings(node.value.replace(/^url\(\s+/gi, "url(").replace(/\s+\)$/g, ")"), options);
  32543. }
  32544. case "media-unknown": {
  32545. return node.value;
  32546. }
  32547. case "selector-root": {
  32548. return group([insideAtRuleNode(path, "custom-selector") ? [getAncestorNode(path, "css-atrule").customSelector, line] : "", join([",", insideAtRuleNode(path, ["extend", "custom-selector", "nest"]) ? line : hardline], path.map(print, "nodes"))]);
  32549. }
  32550. case "selector-selector": {
  32551. return group(indent(path.map(print, "nodes")));
  32552. }
  32553. case "selector-comment": {
  32554. return node.value;
  32555. }
  32556. case "selector-string": {
  32557. return adjustStrings(node.value, options);
  32558. }
  32559. case "selector-tag": {
  32560. const parentNode = path.getParentNode();
  32561. const index = parentNode && parentNode.nodes.indexOf(node);
  32562. const prevNode = index && parentNode.nodes[index - 1];
  32563. return [node.namespace ? [node.namespace === true ? "" : node.namespace.trim(), "|"] : "", prevNode.type === "selector-nesting" ? node.value : adjustNumbers(isKeyframeAtRuleKeywords(path, node.value) ? node.value.toLowerCase() : node.value)];
  32564. }
  32565. case "selector-id": {
  32566. return ["#", node.value];
  32567. }
  32568. case "selector-class": {
  32569. return [".", adjustNumbers(adjustStrings(node.value, options))];
  32570. }
  32571. case "selector-attribute": {
  32572. return ["[", node.namespace ? [node.namespace === true ? "" : node.namespace.trim(), "|"] : "", node.attribute.trim(), node.operator ? node.operator : "", node.value ? quoteAttributeValue(adjustStrings(node.value.trim(), options), options) : "", node.insensitive ? " i" : "", "]"];
  32573. }
  32574. case "selector-combinator": {
  32575. if (node.value === "+" || node.value === ">" || node.value === "~" || node.value === ">>>") {
  32576. const parentNode = path.getParentNode();
  32577. const leading2 = parentNode.type === "selector-selector" && parentNode.nodes[0] === node ? "" : line;
  32578. return [leading2, node.value, isLastNode(path, node) ? "" : " "];
  32579. }
  32580. const leading = node.value.trim().startsWith("(") ? line : "";
  32581. const value = adjustNumbers(adjustStrings(node.value.trim(), options)) || line;
  32582. return [leading, value];
  32583. }
  32584. case "selector-universal": {
  32585. return [node.namespace ? [node.namespace === true ? "" : node.namespace.trim(), "|"] : "", node.value];
  32586. }
  32587. case "selector-pseudo": {
  32588. return [maybeToLowerCase(node.value), isNonEmptyArray(node.nodes) ? ["(", join(", ", path.map(print, "nodes")), ")"] : ""];
  32589. }
  32590. case "selector-nesting": {
  32591. return node.value;
  32592. }
  32593. case "selector-unknown": {
  32594. const ruleAncestorNode = getAncestorNode(path, "css-rule");
  32595. if (ruleAncestorNode && ruleAncestorNode.isSCSSNesterProperty) {
  32596. return adjustNumbers(adjustStrings(maybeToLowerCase(node.value), options));
  32597. }
  32598. const parentNode = path.getParentNode();
  32599. if (parentNode.raws && parentNode.raws.selector) {
  32600. const start = locStart(parentNode);
  32601. const end = start + parentNode.raws.selector.length;
  32602. return options.originalText.slice(start, end).trim();
  32603. }
  32604. const grandParent = path.getParentNode(1);
  32605. if (parentNode.type === "value-paren_group" && grandParent && grandParent.type === "value-func" && grandParent.value === "selector") {
  32606. const start = locEnd(parentNode.open) + 1;
  32607. const end = locStart(parentNode.close);
  32608. const selector = options.originalText.slice(start, end).trim();
  32609. return lastLineHasInlineComment(selector) ? [breakParent, selector] : selector;
  32610. }
  32611. return node.value;
  32612. }
  32613. case "value-value":
  32614. case "value-root": {
  32615. return print("group");
  32616. }
  32617. case "value-comment": {
  32618. return options.originalText.slice(locStart(node), locEnd(node));
  32619. }
  32620. case "value-comma_group": {
  32621. const parentNode = path.getParentNode();
  32622. const parentParentNode = path.getParentNode(1);
  32623. const declAncestorProp = getPropOfDeclNode(path);
  32624. const isGridValue = declAncestorProp && parentNode.type === "value-value" && (declAncestorProp === "grid" || declAncestorProp.startsWith("grid-template"));
  32625. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  32626. const isControlDirective = atRuleAncestorNode && isSCSSControlDirectiveNode(atRuleAncestorNode);
  32627. const hasInlineComment = node.groups.some((node2) => isInlineValueCommentNode(node2));
  32628. const printed = path.map(print, "groups");
  32629. const parts = [];
  32630. const insideURLFunction = insideValueFunctionNode(path, "url");
  32631. let insideSCSSInterpolationInString = false;
  32632. let didBreak = false;
  32633. for (let i = 0; i < node.groups.length; ++i) {
  32634. parts.push(printed[i]);
  32635. const iPrevNode = node.groups[i - 1];
  32636. const iNode = node.groups[i];
  32637. const iNextNode = node.groups[i + 1];
  32638. const iNextNextNode = node.groups[i + 2];
  32639. if (insideURLFunction) {
  32640. if (iNextNode && isAdditionNode(iNextNode) || isAdditionNode(iNode)) {
  32641. parts.push(" ");
  32642. }
  32643. continue;
  32644. }
  32645. if (insideAtRuleNode(path, "forward") && iNode.type === "value-word" && iNode.value && iPrevNode !== void 0 && iPrevNode.type === "value-word" && iPrevNode.value === "as" && iNextNode.type === "value-operator" && iNextNode.value === "*") {
  32646. continue;
  32647. }
  32648. if (!iNextNode) {
  32649. continue;
  32650. }
  32651. if (iNode.type === "value-word" && iNode.value.endsWith("-") && isAtWordPlaceholderNode(iNextNode)) {
  32652. continue;
  32653. }
  32654. const isStartSCSSInterpolationInString = iNode.type === "value-string" && iNode.value.startsWith("#{");
  32655. const isEndingSCSSInterpolationInString = insideSCSSInterpolationInString && iNextNode.type === "value-string" && iNextNode.value.endsWith("}");
  32656. if (isStartSCSSInterpolationInString || isEndingSCSSInterpolationInString) {
  32657. insideSCSSInterpolationInString = !insideSCSSInterpolationInString;
  32658. continue;
  32659. }
  32660. if (insideSCSSInterpolationInString) {
  32661. continue;
  32662. }
  32663. if (isColonNode(iNode) || isColonNode(iNextNode)) {
  32664. continue;
  32665. }
  32666. if (iNode.type === "value-atword" && iNode.value === "") {
  32667. continue;
  32668. }
  32669. if (iNode.value === "~") {
  32670. continue;
  32671. }
  32672. if (iNode.value && iNode.value.includes("\\") && iNextNode && iNextNode.type !== "value-comment") {
  32673. continue;
  32674. }
  32675. if (iPrevNode && iPrevNode.value && iPrevNode.value.indexOf("\\") === iPrevNode.value.length - 1 && iNode.type === "value-operator" && iNode.value === "/") {
  32676. continue;
  32677. }
  32678. if (iNode.value === "\\") {
  32679. continue;
  32680. }
  32681. if (isPostcssSimpleVarNode(iNode, iNextNode)) {
  32682. continue;
  32683. }
  32684. if (isHashNode(iNode) || isLeftCurlyBraceNode(iNode) || isRightCurlyBraceNode(iNextNode) || isLeftCurlyBraceNode(iNextNode) && hasEmptyRawBefore(iNextNode) || isRightCurlyBraceNode(iNode) && hasEmptyRawBefore(iNextNode)) {
  32685. continue;
  32686. }
  32687. if (iNode.value === "--" && isHashNode(iNextNode)) {
  32688. continue;
  32689. }
  32690. const isMathOperator = isMathOperatorNode(iNode);
  32691. const isNextMathOperator = isMathOperatorNode(iNextNode);
  32692. if ((isMathOperator && isHashNode(iNextNode) || isNextMathOperator && isRightCurlyBraceNode(iNode)) && hasEmptyRawBefore(iNextNode)) {
  32693. continue;
  32694. }
  32695. if (!iPrevNode && isDivisionNode(iNode)) {
  32696. continue;
  32697. }
  32698. if (insideValueFunctionNode(path, "calc") && (isAdditionNode(iNode) || isAdditionNode(iNextNode) || isSubtractionNode(iNode) || isSubtractionNode(iNextNode)) && hasEmptyRawBefore(iNextNode)) {
  32699. continue;
  32700. }
  32701. const isColorAdjusterNode = (isAdditionNode(iNode) || isSubtractionNode(iNode)) && i === 0 && (iNextNode.type === "value-number" || iNextNode.isHex) && parentParentNode && isColorAdjusterFuncNode(parentParentNode) && !hasEmptyRawBefore(iNextNode);
  32702. const requireSpaceBeforeOperator = iNextNextNode && iNextNextNode.type === "value-func" || iNextNextNode && isWordNode(iNextNextNode) || iNode.type === "value-func" || isWordNode(iNode);
  32703. const requireSpaceAfterOperator = iNextNode.type === "value-func" || isWordNode(iNextNode) || iPrevNode && iPrevNode.type === "value-func" || iPrevNode && isWordNode(iPrevNode);
  32704. if (!(isMultiplicationNode(iNextNode) || isMultiplicationNode(iNode)) && !insideValueFunctionNode(path, "calc") && !isColorAdjusterNode && (isDivisionNode(iNextNode) && !requireSpaceBeforeOperator || isDivisionNode(iNode) && !requireSpaceAfterOperator || isAdditionNode(iNextNode) && !requireSpaceBeforeOperator || isAdditionNode(iNode) && !requireSpaceAfterOperator || isSubtractionNode(iNextNode) || isSubtractionNode(iNode)) && (hasEmptyRawBefore(iNextNode) || isMathOperator && (!iPrevNode || iPrevNode && isMathOperatorNode(iPrevNode)))) {
  32705. continue;
  32706. }
  32707. if (isInlineValueCommentNode(iNode)) {
  32708. if (parentNode.type === "value-paren_group") {
  32709. parts.push(dedent(hardline));
  32710. continue;
  32711. }
  32712. parts.push(hardline);
  32713. continue;
  32714. }
  32715. if (isControlDirective && (isEqualityOperatorNode(iNextNode) || isRelationalOperatorNode(iNextNode) || isIfElseKeywordNode(iNextNode) || isEachKeywordNode(iNode) || isForKeywordNode(iNode))) {
  32716. parts.push(" ");
  32717. continue;
  32718. }
  32719. if (atRuleAncestorNode && atRuleAncestorNode.name.toLowerCase() === "namespace") {
  32720. parts.push(" ");
  32721. continue;
  32722. }
  32723. if (isGridValue) {
  32724. if (iNode.source && iNextNode.source && iNode.source.start.line !== iNextNode.source.start.line) {
  32725. parts.push(hardline);
  32726. didBreak = true;
  32727. } else {
  32728. parts.push(" ");
  32729. }
  32730. continue;
  32731. }
  32732. if (isNextMathOperator) {
  32733. parts.push(" ");
  32734. continue;
  32735. }
  32736. if (iNextNode && iNextNode.value === "...") {
  32737. continue;
  32738. }
  32739. if (isAtWordPlaceholderNode(iNode) && isAtWordPlaceholderNode(iNextNode) && locEnd(iNode) === locStart(iNextNode)) {
  32740. continue;
  32741. }
  32742. if (isAtWordPlaceholderNode(iNode) && isParenGroupNode(iNextNode) && locEnd(iNode) === locStart(iNextNode.open)) {
  32743. parts.push(softline);
  32744. continue;
  32745. }
  32746. if (iNode.value === "with" && isParenGroupNode(iNextNode)) {
  32747. parts.push(" ");
  32748. continue;
  32749. }
  32750. parts.push(line);
  32751. }
  32752. if (hasInlineComment) {
  32753. parts.push(breakParent);
  32754. }
  32755. if (didBreak) {
  32756. parts.unshift(hardline);
  32757. }
  32758. if (isControlDirective) {
  32759. return group(indent(parts));
  32760. }
  32761. if (insideURLFunctionInImportAtRuleNode(path)) {
  32762. return group(fill(parts));
  32763. }
  32764. return group(indent(fill(parts)));
  32765. }
  32766. case "value-paren_group": {
  32767. const parentNode = path.getParentNode();
  32768. if (parentNode && isURLFunctionNode(parentNode) && (node.groups.length === 1 || node.groups.length > 0 && node.groups[0].type === "value-comma_group" && node.groups[0].groups.length > 0 && node.groups[0].groups[0].type === "value-word" && node.groups[0].groups[0].value.startsWith("data:"))) {
  32769. return [node.open ? print("open") : "", join(",", path.map(print, "groups")), node.close ? print("close") : ""];
  32770. }
  32771. if (!node.open) {
  32772. const printed2 = path.map(print, "groups");
  32773. const res = [];
  32774. for (let i = 0; i < printed2.length; i++) {
  32775. if (i !== 0) {
  32776. res.push([",", line]);
  32777. }
  32778. res.push(printed2[i]);
  32779. }
  32780. return group(indent(fill(res)));
  32781. }
  32782. const isSCSSMapItem = isSCSSMapItemNode(path);
  32783. const lastItem = getLast(node.groups);
  32784. const isLastItemComment = lastItem && lastItem.type === "value-comment";
  32785. const isKey = isKeyInValuePairNode(node, parentNode);
  32786. const isConfiguration = isConfigurationNode(node, parentNode);
  32787. const shouldBreak = isConfiguration || isSCSSMapItem && !isKey;
  32788. const shouldDedent = isConfiguration || isKey;
  32789. const printed = group([node.open ? print("open") : "", indent([softline, join([line], path.map((childPath, index) => {
  32790. const child = childPath.getValue();
  32791. const isLast = index === node.groups.length - 1;
  32792. const printed2 = [print(), isLast ? "" : ","];
  32793. if (isKeyValuePairNode(child) && child.type === "value-comma_group" && child.groups && child.groups[0].type !== "value-paren_group" && child.groups[2] && child.groups[2].type === "value-paren_group") {
  32794. const parts = getDocParts(printed2[0].contents.contents);
  32795. parts[1] = group(parts[1]);
  32796. return group(dedent(printed2));
  32797. }
  32798. if (!isLast && child.type === "value-comma_group" && isNonEmptyArray(child.groups)) {
  32799. const last = getLast(child.groups);
  32800. if (last.source && isNextLineEmpty(options.originalText, last, locEnd)) {
  32801. printed2.push(hardline);
  32802. }
  32803. }
  32804. return printed2;
  32805. }, "groups"))]), ifBreak(!isLastItemComment && isSCSS(options.parser, options.originalText) && isSCSSMapItem && shouldPrintComma(options) ? "," : ""), softline, node.close ? print("close") : ""], {
  32806. shouldBreak
  32807. });
  32808. return shouldDedent ? dedent(printed) : printed;
  32809. }
  32810. case "value-func": {
  32811. return [node.value, insideAtRuleNode(path, "supports") && isMediaAndSupportsKeywords(node) ? " " : "", print("group")];
  32812. }
  32813. case "value-paren": {
  32814. return node.value;
  32815. }
  32816. case "value-number": {
  32817. return [printCssNumber(node.value), printUnit(node.unit)];
  32818. }
  32819. case "value-operator": {
  32820. return node.value;
  32821. }
  32822. case "value-word": {
  32823. if (node.isColor && node.isHex || isWideKeywords(node.value)) {
  32824. return node.value.toLowerCase();
  32825. }
  32826. return node.value;
  32827. }
  32828. case "value-colon": {
  32829. const parentNode = path.getParentNode();
  32830. const index = parentNode && parentNode.groups.indexOf(node);
  32831. const prevNode = index && parentNode.groups[index - 1];
  32832. return [node.value, prevNode && typeof prevNode.value === "string" && getLast(prevNode.value) === "\\" || insideValueFunctionNode(path, "url") ? "" : line];
  32833. }
  32834. case "value-comma": {
  32835. return [node.value, " "];
  32836. }
  32837. case "value-string": {
  32838. return printString(node.raws.quote + node.value + node.raws.quote, options);
  32839. }
  32840. case "value-atword": {
  32841. return ["@", node.value];
  32842. }
  32843. case "value-unicode-range": {
  32844. return node.value;
  32845. }
  32846. case "value-unknown": {
  32847. return node.value;
  32848. }
  32849. default:
  32850. throw new Error(`Unknown postcss type ${JSON.stringify(node.type)}`);
  32851. }
  32852. }
  32853. function printNodeSequence(path, options, print) {
  32854. const parts = [];
  32855. path.each((pathChild, i, nodes) => {
  32856. const prevNode = nodes[i - 1];
  32857. if (prevNode && prevNode.type === "css-comment" && prevNode.text.trim() === "prettier-ignore") {
  32858. const childNode = pathChild.getValue();
  32859. parts.push(options.originalText.slice(locStart(childNode), locEnd(childNode)));
  32860. } else {
  32861. parts.push(print());
  32862. }
  32863. if (i !== nodes.length - 1) {
  32864. if (nodes[i + 1].type === "css-comment" && !hasNewline(options.originalText, locStart(nodes[i + 1]), {
  32865. backwards: true
  32866. }) && !isFrontMatterNode(nodes[i]) || nodes[i + 1].type === "css-atrule" && nodes[i + 1].name === "else" && nodes[i].type !== "css-comment") {
  32867. parts.push(" ");
  32868. } else {
  32869. parts.push(options.__isHTMLStyleAttribute ? line : hardline);
  32870. if (isNextLineEmpty(options.originalText, pathChild.getValue(), locEnd) && !isFrontMatterNode(nodes[i])) {
  32871. parts.push(hardline);
  32872. }
  32873. }
  32874. }
  32875. }, "nodes");
  32876. return parts;
  32877. }
  32878. var STRING_REGEX = /(["'])(?:(?!\1)[^\\]|\\.)*\1/gs;
  32879. var NUMBER_REGEX = /(?:\d*\.\d+|\d+\.?)(?:[Ee][+-]?\d+)?/g;
  32880. var STANDARD_UNIT_REGEX = /[A-Za-z]+/g;
  32881. var WORD_PART_REGEX = /[$@]?[A-Z_a-z\u0080-\uFFFF][\w\u0080-\uFFFF-]*/g;
  32882. var ADJUST_NUMBERS_REGEX = new RegExp(STRING_REGEX.source + `|(${WORD_PART_REGEX.source})?(${NUMBER_REGEX.source})(${STANDARD_UNIT_REGEX.source})?`, "g");
  32883. function adjustStrings(value, options) {
  32884. return value.replace(STRING_REGEX, (match) => printString(match, options));
  32885. }
  32886. function quoteAttributeValue(value, options) {
  32887. const quote = options.singleQuote ? "'" : '"';
  32888. return value.includes('"') || value.includes("'") ? value : quote + value + quote;
  32889. }
  32890. function adjustNumbers(value) {
  32891. return value.replace(ADJUST_NUMBERS_REGEX, (match, quote, wordPart, number, unit) => !wordPart && number ? printCssNumber(number) + maybeToLowerCase(unit || "") : match);
  32892. }
  32893. function printCssNumber(rawNumber) {
  32894. return printNumber(rawNumber).replace(/\.0(?=$|e)/, "");
  32895. }
  32896. module2.exports = {
  32897. print: genericPrint,
  32898. embed,
  32899. insertPragma,
  32900. massageAstNode: clean
  32901. };
  32902. }
  32903. });
  32904. var require_options3 = __commonJS2({
  32905. "src/language-css/options.js"(exports2, module2) {
  32906. "use strict";
  32907. var commonOptions = require_common_options();
  32908. module2.exports = {
  32909. singleQuote: commonOptions.singleQuote
  32910. };
  32911. }
  32912. });
  32913. var require_parsers2 = __commonJS2({
  32914. "src/language-css/parsers.js"(exports2, module2) {
  32915. "use strict";
  32916. module2.exports = {
  32917. get css() {
  32918. return require("./parser-postcss.js").parsers.css;
  32919. },
  32920. get less() {
  32921. return require("./parser-postcss.js").parsers.less;
  32922. },
  32923. get scss() {
  32924. return require("./parser-postcss.js").parsers.scss;
  32925. }
  32926. };
  32927. }
  32928. });
  32929. var require_CSS = __commonJS2({
  32930. "node_modules/linguist-languages/data/CSS.json"(exports2, module2) {
  32931. module2.exports = {
  32932. name: "CSS",
  32933. type: "markup",
  32934. tmScope: "source.css",
  32935. aceMode: "css",
  32936. codemirrorMode: "css",
  32937. codemirrorMimeType: "text/css",
  32938. color: "#563d7c",
  32939. extensions: [".css"],
  32940. languageId: 50
  32941. };
  32942. }
  32943. });
  32944. var require_PostCSS = __commonJS2({
  32945. "node_modules/linguist-languages/data/PostCSS.json"(exports2, module2) {
  32946. module2.exports = {
  32947. name: "PostCSS",
  32948. type: "markup",
  32949. tmScope: "source.postcss",
  32950. group: "CSS",
  32951. extensions: [".pcss", ".postcss"],
  32952. aceMode: "text",
  32953. languageId: 262764437
  32954. };
  32955. }
  32956. });
  32957. var require_Less = __commonJS2({
  32958. "node_modules/linguist-languages/data/Less.json"(exports2, module2) {
  32959. module2.exports = {
  32960. name: "Less",
  32961. type: "markup",
  32962. color: "#1d365d",
  32963. extensions: [".less"],
  32964. tmScope: "source.css.less",
  32965. aceMode: "less",
  32966. codemirrorMode: "css",
  32967. codemirrorMimeType: "text/css",
  32968. languageId: 198
  32969. };
  32970. }
  32971. });
  32972. var require_SCSS = __commonJS2({
  32973. "node_modules/linguist-languages/data/SCSS.json"(exports2, module2) {
  32974. module2.exports = {
  32975. name: "SCSS",
  32976. type: "markup",
  32977. color: "#c6538c",
  32978. tmScope: "source.css.scss",
  32979. aceMode: "scss",
  32980. codemirrorMode: "css",
  32981. codemirrorMimeType: "text/x-scss",
  32982. extensions: [".scss"],
  32983. languageId: 329
  32984. };
  32985. }
  32986. });
  32987. var require_language_css = __commonJS2({
  32988. "src/language-css/index.js"(exports2, module2) {
  32989. "use strict";
  32990. var createLanguage = require_create_language();
  32991. var printer = require_printer_postcss();
  32992. var options = require_options3();
  32993. var parsers = require_parsers2();
  32994. var languages = [createLanguage(require_CSS(), (data) => ({
  32995. since: "1.4.0",
  32996. parsers: ["css"],
  32997. vscodeLanguageIds: ["css"],
  32998. extensions: [...data.extensions, ".wxss"]
  32999. })), createLanguage(require_PostCSS(), () => ({
  33000. since: "1.4.0",
  33001. parsers: ["css"],
  33002. vscodeLanguageIds: ["postcss"]
  33003. })), createLanguage(require_Less(), () => ({
  33004. since: "1.4.0",
  33005. parsers: ["less"],
  33006. vscodeLanguageIds: ["less"]
  33007. })), createLanguage(require_SCSS(), () => ({
  33008. since: "1.4.0",
  33009. parsers: ["scss"],
  33010. vscodeLanguageIds: ["scss"]
  33011. }))];
  33012. var printers = {
  33013. postcss: printer
  33014. };
  33015. module2.exports = {
  33016. languages,
  33017. options,
  33018. printers,
  33019. parsers
  33020. };
  33021. }
  33022. });
  33023. var require_loc3 = __commonJS2({
  33024. "src/language-handlebars/loc.js"(exports2, module2) {
  33025. "use strict";
  33026. function locStart(node) {
  33027. return node.loc.start.offset;
  33028. }
  33029. function locEnd(node) {
  33030. return node.loc.end.offset;
  33031. }
  33032. module2.exports = {
  33033. locStart,
  33034. locEnd
  33035. };
  33036. }
  33037. });
  33038. var require_clean3 = __commonJS2({
  33039. "src/language-handlebars/clean.js"(exports2, module2) {
  33040. "use strict";
  33041. function clean(ast, newNode) {
  33042. if (ast.type === "TextNode") {
  33043. const trimmed = ast.chars.trim();
  33044. if (!trimmed) {
  33045. return null;
  33046. }
  33047. newNode.chars = trimmed.replace(/[\t\n\f\r ]+/g, " ");
  33048. }
  33049. if (ast.type === "AttrNode" && ast.name.toLowerCase() === "class") {
  33050. delete newNode.value;
  33051. }
  33052. }
  33053. clean.ignoredProperties = /* @__PURE__ */ new Set(["loc", "selfClosing"]);
  33054. module2.exports = clean;
  33055. }
  33056. });
  33057. var require_html_void_elements = __commonJS2({
  33058. "vendors/html-void-elements.json"(exports2, module2) {
  33059. module2.exports = {
  33060. htmlVoidElements: ["area", "base", "basefont", "bgsound", "br", "col", "command", "embed", "frame", "hr", "image", "img", "input", "isindex", "keygen", "link", "menuitem", "meta", "nextid", "param", "source", "track", "wbr"]
  33061. };
  33062. }
  33063. });
  33064. var require_utils9 = __commonJS2({
  33065. "src/language-handlebars/utils.js"(exports2, module2) {
  33066. "use strict";
  33067. var {
  33068. htmlVoidElements
  33069. } = require_html_void_elements();
  33070. var getLast = require_get_last();
  33071. function isLastNodeOfSiblings(path) {
  33072. const node = path.getValue();
  33073. const parentNode = path.getParentNode(0);
  33074. if (isParentOfSomeType(path, ["ElementNode"]) && getLast(parentNode.children) === node) {
  33075. return true;
  33076. }
  33077. if (isParentOfSomeType(path, ["Block"]) && getLast(parentNode.body) === node) {
  33078. return true;
  33079. }
  33080. return false;
  33081. }
  33082. function isUppercase(string) {
  33083. return string.toUpperCase() === string;
  33084. }
  33085. function isGlimmerComponent(node) {
  33086. return isNodeOfSomeType(node, ["ElementNode"]) && typeof node.tag === "string" && node.tag[0] !== ":" && (isUppercase(node.tag[0]) || node.tag.includes("."));
  33087. }
  33088. var voidTags = new Set(htmlVoidElements);
  33089. function isVoid(node) {
  33090. return isGlimmerComponent(node) && node.children.every((node2) => isWhitespaceNode(node2)) || voidTags.has(node.tag);
  33091. }
  33092. function isWhitespaceNode(node) {
  33093. return isNodeOfSomeType(node, ["TextNode"]) && !/\S/.test(node.chars);
  33094. }
  33095. function isNodeOfSomeType(node, types) {
  33096. return node && types.includes(node.type);
  33097. }
  33098. function isParentOfSomeType(path, types) {
  33099. const parentNode = path.getParentNode(0);
  33100. return isNodeOfSomeType(parentNode, types);
  33101. }
  33102. function isPreviousNodeOfSomeType(path, types) {
  33103. const previousNode = getPreviousNode(path);
  33104. return isNodeOfSomeType(previousNode, types);
  33105. }
  33106. function isNextNodeOfSomeType(path, types) {
  33107. const nextNode = getNextNode(path);
  33108. return isNodeOfSomeType(nextNode, types);
  33109. }
  33110. function getSiblingNode(path, offset) {
  33111. const node = path.getValue();
  33112. const parentNode = path.getParentNode(0) || {};
  33113. const children = parentNode.children || parentNode.body || parentNode.parts || [];
  33114. const index = children.indexOf(node);
  33115. return index !== -1 && children[index + offset];
  33116. }
  33117. function getPreviousNode(path, lookBack = 1) {
  33118. return getSiblingNode(path, -lookBack);
  33119. }
  33120. function getNextNode(path) {
  33121. return getSiblingNode(path, 1);
  33122. }
  33123. function isPrettierIgnoreNode(node) {
  33124. return isNodeOfSomeType(node, ["MustacheCommentStatement"]) && typeof node.value === "string" && node.value.trim() === "prettier-ignore";
  33125. }
  33126. function hasPrettierIgnore(path) {
  33127. const node = path.getValue();
  33128. const previousPreviousNode = getPreviousNode(path, 2);
  33129. return isPrettierIgnoreNode(node) || isPrettierIgnoreNode(previousPreviousNode);
  33130. }
  33131. module2.exports = {
  33132. getNextNode,
  33133. getPreviousNode,
  33134. hasPrettierIgnore,
  33135. isLastNodeOfSiblings,
  33136. isNextNodeOfSomeType,
  33137. isNodeOfSomeType,
  33138. isParentOfSomeType,
  33139. isPreviousNodeOfSomeType,
  33140. isVoid,
  33141. isWhitespaceNode
  33142. };
  33143. }
  33144. });
  33145. var require_printer_glimmer = __commonJS2({
  33146. "src/language-handlebars/printer-glimmer.js"(exports2, module2) {
  33147. "use strict";
  33148. var {
  33149. builders: {
  33150. dedent,
  33151. fill,
  33152. group,
  33153. hardline,
  33154. ifBreak,
  33155. indent,
  33156. join,
  33157. line,
  33158. softline
  33159. },
  33160. utils: {
  33161. getDocParts,
  33162. replaceTextEndOfLine
  33163. }
  33164. } = require("./doc.js");
  33165. var {
  33166. getPreferredQuote,
  33167. isNonEmptyArray
  33168. } = require_util();
  33169. var {
  33170. locStart,
  33171. locEnd
  33172. } = require_loc3();
  33173. var clean = require_clean3();
  33174. var {
  33175. getNextNode,
  33176. getPreviousNode,
  33177. hasPrettierIgnore,
  33178. isLastNodeOfSiblings,
  33179. isNextNodeOfSomeType,
  33180. isNodeOfSomeType,
  33181. isParentOfSomeType,
  33182. isPreviousNodeOfSomeType,
  33183. isVoid,
  33184. isWhitespaceNode
  33185. } = require_utils9();
  33186. var NEWLINES_TO_PRESERVE_MAX = 2;
  33187. function print(path, options, print2) {
  33188. const node = path.getValue();
  33189. if (!node) {
  33190. return "";
  33191. }
  33192. if (hasPrettierIgnore(path)) {
  33193. return options.originalText.slice(locStart(node), locEnd(node));
  33194. }
  33195. const favoriteQuote = options.singleQuote ? "'" : '"';
  33196. switch (node.type) {
  33197. case "Block":
  33198. case "Program":
  33199. case "Template": {
  33200. return group(path.map(print2, "body"));
  33201. }
  33202. case "ElementNode": {
  33203. const startingTag = group(printStartingTag(path, print2));
  33204. const escapeNextElementNode = options.htmlWhitespaceSensitivity === "ignore" && isNextNodeOfSomeType(path, ["ElementNode"]) ? softline : "";
  33205. if (isVoid(node)) {
  33206. return [startingTag, escapeNextElementNode];
  33207. }
  33208. const endingTag = ["</", node.tag, ">"];
  33209. if (node.children.length === 0) {
  33210. return [startingTag, indent(endingTag), escapeNextElementNode];
  33211. }
  33212. if (options.htmlWhitespaceSensitivity === "ignore") {
  33213. return [startingTag, indent(printChildren(path, options, print2)), hardline, indent(endingTag), escapeNextElementNode];
  33214. }
  33215. return [startingTag, indent(group(printChildren(path, options, print2))), indent(endingTag), escapeNextElementNode];
  33216. }
  33217. case "BlockStatement": {
  33218. const pp = path.getParentNode(1);
  33219. const isElseIf = pp && pp.inverse && pp.inverse.body.length === 1 && pp.inverse.body[0] === node && pp.inverse.body[0].path.parts[0] === "if";
  33220. if (isElseIf) {
  33221. return [printElseIfBlock(path, print2), printProgram(path, print2, options), printInverse(path, print2, options)];
  33222. }
  33223. return [printOpenBlock(path, print2), group([printProgram(path, print2, options), printInverse(path, print2, options), printCloseBlock(path, print2, options)])];
  33224. }
  33225. case "ElementModifierStatement": {
  33226. return group(["{{", printPathAndParams(path, print2), "}}"]);
  33227. }
  33228. case "MustacheStatement": {
  33229. return group([printOpeningMustache(node), printPathAndParams(path, print2), printClosingMustache(node)]);
  33230. }
  33231. case "SubExpression": {
  33232. return group(["(", printSubExpressionPathAndParams(path, print2), softline, ")"]);
  33233. }
  33234. case "AttrNode": {
  33235. const isText = node.value.type === "TextNode";
  33236. const isEmptyText = isText && node.value.chars === "";
  33237. if (isEmptyText && locStart(node.value) === locEnd(node.value)) {
  33238. return node.name;
  33239. }
  33240. const quote = isText ? getPreferredQuote(node.value.chars, favoriteQuote).quote : node.value.type === "ConcatStatement" ? getPreferredQuote(node.value.parts.filter((part) => part.type === "TextNode").map((part) => part.chars).join(""), favoriteQuote).quote : "";
  33241. const valueDoc = print2("value");
  33242. return [node.name, "=", quote, node.name === "class" && quote ? group(indent(valueDoc)) : valueDoc, quote];
  33243. }
  33244. case "ConcatStatement": {
  33245. return path.map(print2, "parts");
  33246. }
  33247. case "Hash": {
  33248. return join(line, path.map(print2, "pairs"));
  33249. }
  33250. case "HashPair": {
  33251. return [node.key, "=", print2("value")];
  33252. }
  33253. case "TextNode": {
  33254. let text = node.chars.replace(/{{/g, "\\{{");
  33255. const attrName = getCurrentAttributeName(path);
  33256. if (attrName) {
  33257. if (attrName === "class") {
  33258. const formattedClasses = text.trim().split(/\s+/).join(" ");
  33259. let leadingSpace2 = false;
  33260. let trailingSpace2 = false;
  33261. if (isParentOfSomeType(path, ["ConcatStatement"])) {
  33262. if (isPreviousNodeOfSomeType(path, ["MustacheStatement"]) && /^\s/.test(text)) {
  33263. leadingSpace2 = true;
  33264. }
  33265. if (isNextNodeOfSomeType(path, ["MustacheStatement"]) && /\s$/.test(text) && formattedClasses !== "") {
  33266. trailingSpace2 = true;
  33267. }
  33268. }
  33269. return [leadingSpace2 ? line : "", formattedClasses, trailingSpace2 ? line : ""];
  33270. }
  33271. return replaceTextEndOfLine(text);
  33272. }
  33273. const whitespacesOnlyRE = /^[\t\n\f\r ]*$/;
  33274. const isWhitespaceOnly = whitespacesOnlyRE.test(text);
  33275. const isFirstElement = !getPreviousNode(path);
  33276. const isLastElement = !getNextNode(path);
  33277. if (options.htmlWhitespaceSensitivity !== "ignore") {
  33278. const leadingWhitespacesRE = /^[\t\n\f\r ]*/;
  33279. const trailingWhitespacesRE = /[\t\n\f\r ]*$/;
  33280. const shouldTrimTrailingNewlines = isLastElement && isParentOfSomeType(path, ["Template"]);
  33281. const shouldTrimLeadingNewlines = isFirstElement && isParentOfSomeType(path, ["Template"]);
  33282. if (isWhitespaceOnly) {
  33283. if (shouldTrimLeadingNewlines || shouldTrimTrailingNewlines) {
  33284. return "";
  33285. }
  33286. let breaks = [line];
  33287. const newlines = countNewLines(text);
  33288. if (newlines) {
  33289. breaks = generateHardlines(newlines);
  33290. }
  33291. if (isLastNodeOfSiblings(path)) {
  33292. breaks = breaks.map((newline) => dedent(newline));
  33293. }
  33294. return breaks;
  33295. }
  33296. const [lead] = text.match(leadingWhitespacesRE);
  33297. const [tail] = text.match(trailingWhitespacesRE);
  33298. let leadBreaks = [];
  33299. if (lead) {
  33300. leadBreaks = [line];
  33301. const leadingNewlines = countNewLines(lead);
  33302. if (leadingNewlines) {
  33303. leadBreaks = generateHardlines(leadingNewlines);
  33304. }
  33305. text = text.replace(leadingWhitespacesRE, "");
  33306. }
  33307. let trailBreaks = [];
  33308. if (tail) {
  33309. if (!shouldTrimTrailingNewlines) {
  33310. trailBreaks = [line];
  33311. const trailingNewlines = countNewLines(tail);
  33312. if (trailingNewlines) {
  33313. trailBreaks = generateHardlines(trailingNewlines);
  33314. }
  33315. if (isLastNodeOfSiblings(path)) {
  33316. trailBreaks = trailBreaks.map((hardline2) => dedent(hardline2));
  33317. }
  33318. }
  33319. text = text.replace(trailingWhitespacesRE, "");
  33320. }
  33321. return [...leadBreaks, fill(getTextValueParts(text)), ...trailBreaks];
  33322. }
  33323. const lineBreaksCount = countNewLines(text);
  33324. let leadingLineBreaksCount = countLeadingNewLines(text);
  33325. let trailingLineBreaksCount = countTrailingNewLines(text);
  33326. if ((isFirstElement || isLastElement) && isWhitespaceOnly && isParentOfSomeType(path, ["Block", "ElementNode", "Template"])) {
  33327. return "";
  33328. }
  33329. if (isWhitespaceOnly && lineBreaksCount) {
  33330. leadingLineBreaksCount = Math.min(lineBreaksCount, NEWLINES_TO_PRESERVE_MAX);
  33331. trailingLineBreaksCount = 0;
  33332. } else {
  33333. if (isNextNodeOfSomeType(path, ["BlockStatement", "ElementNode"])) {
  33334. trailingLineBreaksCount = Math.max(trailingLineBreaksCount, 1);
  33335. }
  33336. if (isPreviousNodeOfSomeType(path, ["BlockStatement", "ElementNode"])) {
  33337. leadingLineBreaksCount = Math.max(leadingLineBreaksCount, 1);
  33338. }
  33339. }
  33340. let leadingSpace = "";
  33341. let trailingSpace = "";
  33342. if (trailingLineBreaksCount === 0 && isNextNodeOfSomeType(path, ["MustacheStatement"])) {
  33343. trailingSpace = " ";
  33344. }
  33345. if (leadingLineBreaksCount === 0 && isPreviousNodeOfSomeType(path, ["MustacheStatement"])) {
  33346. leadingSpace = " ";
  33347. }
  33348. if (isFirstElement) {
  33349. leadingLineBreaksCount = 0;
  33350. leadingSpace = "";
  33351. }
  33352. if (isLastElement) {
  33353. trailingLineBreaksCount = 0;
  33354. trailingSpace = "";
  33355. }
  33356. text = text.replace(/^[\t\n\f\r ]+/g, leadingSpace).replace(/[\t\n\f\r ]+$/, trailingSpace);
  33357. return [...generateHardlines(leadingLineBreaksCount), fill(getTextValueParts(text)), ...generateHardlines(trailingLineBreaksCount)];
  33358. }
  33359. case "MustacheCommentStatement": {
  33360. const start = locStart(node);
  33361. const end = locEnd(node);
  33362. const isLeftWhiteSpaceSensitive = options.originalText.charAt(start + 2) === "~";
  33363. const isRightWhitespaceSensitive = options.originalText.charAt(end - 3) === "~";
  33364. const dashes = node.value.includes("}}") ? "--" : "";
  33365. return ["{{", isLeftWhiteSpaceSensitive ? "~" : "", "!", dashes, node.value, dashes, isRightWhitespaceSensitive ? "~" : "", "}}"];
  33366. }
  33367. case "PathExpression": {
  33368. return node.original;
  33369. }
  33370. case "BooleanLiteral": {
  33371. return String(node.value);
  33372. }
  33373. case "CommentStatement": {
  33374. return ["<!--", node.value, "-->"];
  33375. }
  33376. case "StringLiteral": {
  33377. if (needsOppositeQuote(path)) {
  33378. const printFavoriteQuote = !options.singleQuote ? "'" : '"';
  33379. return printStringLiteral(node.value, printFavoriteQuote);
  33380. }
  33381. return printStringLiteral(node.value, favoriteQuote);
  33382. }
  33383. case "NumberLiteral": {
  33384. return String(node.value);
  33385. }
  33386. case "UndefinedLiteral": {
  33387. return "undefined";
  33388. }
  33389. case "NullLiteral": {
  33390. return "null";
  33391. }
  33392. default:
  33393. throw new Error("unknown glimmer type: " + JSON.stringify(node.type));
  33394. }
  33395. }
  33396. function sortByLoc(a, b) {
  33397. return locStart(a) - locStart(b);
  33398. }
  33399. function printStartingTag(path, print2) {
  33400. const node = path.getValue();
  33401. const types = ["attributes", "modifiers", "comments"].filter((property) => isNonEmptyArray(node[property]));
  33402. const attributes = types.flatMap((type) => node[type]).sort(sortByLoc);
  33403. for (const attributeType of types) {
  33404. path.each((attributePath) => {
  33405. const index = attributes.indexOf(attributePath.getValue());
  33406. attributes.splice(index, 1, [line, print2()]);
  33407. }, attributeType);
  33408. }
  33409. if (isNonEmptyArray(node.blockParams)) {
  33410. attributes.push(line, printBlockParams(node));
  33411. }
  33412. return ["<", node.tag, indent(attributes), printStartingTagEndMarker(node)];
  33413. }
  33414. function printChildren(path, options, print2) {
  33415. const node = path.getValue();
  33416. const isEmpty = node.children.every((node2) => isWhitespaceNode(node2));
  33417. if (options.htmlWhitespaceSensitivity === "ignore" && isEmpty) {
  33418. return "";
  33419. }
  33420. return path.map((childPath, childIndex) => {
  33421. const printedChild = print2();
  33422. if (childIndex === 0 && options.htmlWhitespaceSensitivity === "ignore") {
  33423. return [softline, printedChild];
  33424. }
  33425. return printedChild;
  33426. }, "children");
  33427. }
  33428. function printStartingTagEndMarker(node) {
  33429. if (isVoid(node)) {
  33430. return ifBreak([softline, "/>"], [" />", softline]);
  33431. }
  33432. return ifBreak([softline, ">"], ">");
  33433. }
  33434. function printOpeningMustache(node) {
  33435. const mustache = node.escaped === false ? "{{{" : "{{";
  33436. const strip = node.strip && node.strip.open ? "~" : "";
  33437. return [mustache, strip];
  33438. }
  33439. function printClosingMustache(node) {
  33440. const mustache = node.escaped === false ? "}}}" : "}}";
  33441. const strip = node.strip && node.strip.close ? "~" : "";
  33442. return [strip, mustache];
  33443. }
  33444. function printOpeningBlockOpeningMustache(node) {
  33445. const opening = printOpeningMustache(node);
  33446. const strip = node.openStrip.open ? "~" : "";
  33447. return [opening, strip, "#"];
  33448. }
  33449. function printOpeningBlockClosingMustache(node) {
  33450. const closing = printClosingMustache(node);
  33451. const strip = node.openStrip.close ? "~" : "";
  33452. return [strip, closing];
  33453. }
  33454. function printClosingBlockOpeningMustache(node) {
  33455. const opening = printOpeningMustache(node);
  33456. const strip = node.closeStrip.open ? "~" : "";
  33457. return [opening, strip, "/"];
  33458. }
  33459. function printClosingBlockClosingMustache(node) {
  33460. const closing = printClosingMustache(node);
  33461. const strip = node.closeStrip.close ? "~" : "";
  33462. return [strip, closing];
  33463. }
  33464. function printInverseBlockOpeningMustache(node) {
  33465. const opening = printOpeningMustache(node);
  33466. const strip = node.inverseStrip.open ? "~" : "";
  33467. return [opening, strip];
  33468. }
  33469. function printInverseBlockClosingMustache(node) {
  33470. const closing = printClosingMustache(node);
  33471. const strip = node.inverseStrip.close ? "~" : "";
  33472. return [strip, closing];
  33473. }
  33474. function printOpenBlock(path, print2) {
  33475. const node = path.getValue();
  33476. const openingMustache = printOpeningBlockOpeningMustache(node);
  33477. const closingMustache = printOpeningBlockClosingMustache(node);
  33478. const attributes = [printPath(path, print2)];
  33479. const params = printParams(path, print2);
  33480. if (params) {
  33481. attributes.push(line, params);
  33482. }
  33483. if (isNonEmptyArray(node.program.blockParams)) {
  33484. const block = printBlockParams(node.program);
  33485. attributes.push(line, block);
  33486. }
  33487. return group([openingMustache, indent(attributes), softline, closingMustache]);
  33488. }
  33489. function printElseBlock(node, options) {
  33490. return [options.htmlWhitespaceSensitivity === "ignore" ? hardline : "", printInverseBlockOpeningMustache(node), "else", printInverseBlockClosingMustache(node)];
  33491. }
  33492. function printElseIfBlock(path, print2) {
  33493. const parentNode = path.getParentNode(1);
  33494. return [printInverseBlockOpeningMustache(parentNode), "else if ", printParams(path, print2), printInverseBlockClosingMustache(parentNode)];
  33495. }
  33496. function printCloseBlock(path, print2, options) {
  33497. const node = path.getValue();
  33498. if (options.htmlWhitespaceSensitivity === "ignore") {
  33499. const escape = blockStatementHasOnlyWhitespaceInProgram(node) ? softline : hardline;
  33500. return [escape, printClosingBlockOpeningMustache(node), print2("path"), printClosingBlockClosingMustache(node)];
  33501. }
  33502. return [printClosingBlockOpeningMustache(node), print2("path"), printClosingBlockClosingMustache(node)];
  33503. }
  33504. function blockStatementHasOnlyWhitespaceInProgram(node) {
  33505. return isNodeOfSomeType(node, ["BlockStatement"]) && node.program.body.every((node2) => isWhitespaceNode(node2));
  33506. }
  33507. function blockStatementHasElseIf(node) {
  33508. return blockStatementHasElse(node) && node.inverse.body.length === 1 && isNodeOfSomeType(node.inverse.body[0], ["BlockStatement"]) && node.inverse.body[0].path.parts[0] === "if";
  33509. }
  33510. function blockStatementHasElse(node) {
  33511. return isNodeOfSomeType(node, ["BlockStatement"]) && node.inverse;
  33512. }
  33513. function printProgram(path, print2, options) {
  33514. const node = path.getValue();
  33515. if (blockStatementHasOnlyWhitespaceInProgram(node)) {
  33516. return "";
  33517. }
  33518. const program = print2("program");
  33519. if (options.htmlWhitespaceSensitivity === "ignore") {
  33520. return indent([hardline, program]);
  33521. }
  33522. return indent(program);
  33523. }
  33524. function printInverse(path, print2, options) {
  33525. const node = path.getValue();
  33526. const inverse = print2("inverse");
  33527. const printed = options.htmlWhitespaceSensitivity === "ignore" ? [hardline, inverse] : inverse;
  33528. if (blockStatementHasElseIf(node)) {
  33529. return printed;
  33530. }
  33531. if (blockStatementHasElse(node)) {
  33532. return [printElseBlock(node, options), indent(printed)];
  33533. }
  33534. return "";
  33535. }
  33536. function getTextValueParts(value) {
  33537. return getDocParts(join(line, splitByHtmlWhitespace(value)));
  33538. }
  33539. function splitByHtmlWhitespace(string) {
  33540. return string.split(/[\t\n\f\r ]+/);
  33541. }
  33542. function getCurrentAttributeName(path) {
  33543. for (let depth = 0; depth < 2; depth++) {
  33544. const parentNode = path.getParentNode(depth);
  33545. if (parentNode && parentNode.type === "AttrNode") {
  33546. return parentNode.name.toLowerCase();
  33547. }
  33548. }
  33549. }
  33550. function countNewLines(string) {
  33551. string = typeof string === "string" ? string : "";
  33552. return string.split("\n").length - 1;
  33553. }
  33554. function countLeadingNewLines(string) {
  33555. string = typeof string === "string" ? string : "";
  33556. const newLines = (string.match(/^([^\S\n\r]*[\n\r])+/g) || [])[0] || "";
  33557. return countNewLines(newLines);
  33558. }
  33559. function countTrailingNewLines(string) {
  33560. string = typeof string === "string" ? string : "";
  33561. const newLines = (string.match(/([\n\r][^\S\n\r]*)+$/g) || [])[0] || "";
  33562. return countNewLines(newLines);
  33563. }
  33564. function generateHardlines(number = 0) {
  33565. return Array.from({
  33566. length: Math.min(number, NEWLINES_TO_PRESERVE_MAX)
  33567. }).fill(hardline);
  33568. }
  33569. function printStringLiteral(stringLiteral, favoriteQuote) {
  33570. const {
  33571. quote,
  33572. regex
  33573. } = getPreferredQuote(stringLiteral, favoriteQuote);
  33574. return [quote, stringLiteral.replace(regex, `\\${quote}`), quote];
  33575. }
  33576. function needsOppositeQuote(path) {
  33577. let index = 0;
  33578. let parentNode = path.getParentNode(index);
  33579. while (parentNode && isNodeOfSomeType(parentNode, ["SubExpression"])) {
  33580. index++;
  33581. parentNode = path.getParentNode(index);
  33582. }
  33583. if (parentNode && isNodeOfSomeType(path.getParentNode(index + 1), ["ConcatStatement"]) && isNodeOfSomeType(path.getParentNode(index + 2), ["AttrNode"])) {
  33584. return true;
  33585. }
  33586. return false;
  33587. }
  33588. function printSubExpressionPathAndParams(path, print2) {
  33589. const p = printPath(path, print2);
  33590. const params = printParams(path, print2);
  33591. if (!params) {
  33592. return p;
  33593. }
  33594. return indent([p, line, group(params)]);
  33595. }
  33596. function printPathAndParams(path, print2) {
  33597. const p = printPath(path, print2);
  33598. const params = printParams(path, print2);
  33599. if (!params) {
  33600. return p;
  33601. }
  33602. return [indent([p, line, params]), softline];
  33603. }
  33604. function printPath(path, print2) {
  33605. return print2("path");
  33606. }
  33607. function printParams(path, print2) {
  33608. const node = path.getValue();
  33609. const parts = [];
  33610. if (node.params.length > 0) {
  33611. const params = path.map(print2, "params");
  33612. parts.push(...params);
  33613. }
  33614. if (node.hash && node.hash.pairs.length > 0) {
  33615. const hash = print2("hash");
  33616. parts.push(hash);
  33617. }
  33618. if (parts.length === 0) {
  33619. return "";
  33620. }
  33621. return join(line, parts);
  33622. }
  33623. function printBlockParams(node) {
  33624. return ["as |", node.blockParams.join(" "), "|"];
  33625. }
  33626. module2.exports = {
  33627. print,
  33628. massageAstNode: clean
  33629. };
  33630. }
  33631. });
  33632. var require_parsers3 = __commonJS2({
  33633. "src/language-handlebars/parsers.js"(exports2, module2) {
  33634. "use strict";
  33635. module2.exports = {
  33636. get glimmer() {
  33637. return require("./parser-glimmer.js").parsers.glimmer;
  33638. }
  33639. };
  33640. }
  33641. });
  33642. var require_Handlebars = __commonJS2({
  33643. "node_modules/linguist-languages/data/Handlebars.json"(exports2, module2) {
  33644. module2.exports = {
  33645. name: "Handlebars",
  33646. type: "markup",
  33647. color: "#f7931e",
  33648. aliases: ["hbs", "htmlbars"],
  33649. extensions: [".handlebars", ".hbs"],
  33650. tmScope: "text.html.handlebars",
  33651. aceMode: "handlebars",
  33652. languageId: 155
  33653. };
  33654. }
  33655. });
  33656. var require_language_handlebars = __commonJS2({
  33657. "src/language-handlebars/index.js"(exports2, module2) {
  33658. "use strict";
  33659. var createLanguage = require_create_language();
  33660. var printer = require_printer_glimmer();
  33661. var parsers = require_parsers3();
  33662. var languages = [createLanguage(require_Handlebars(), () => ({
  33663. since: "2.3.0",
  33664. parsers: ["glimmer"],
  33665. vscodeLanguageIds: ["handlebars"]
  33666. }))];
  33667. var printers = {
  33668. glimmer: printer
  33669. };
  33670. module2.exports = {
  33671. languages,
  33672. printers,
  33673. parsers
  33674. };
  33675. }
  33676. });
  33677. var require_pragma3 = __commonJS2({
  33678. "src/language-graphql/pragma.js"(exports2, module2) {
  33679. "use strict";
  33680. function hasPragma(text) {
  33681. return /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(text);
  33682. }
  33683. function insertPragma(text) {
  33684. return "# @format\n\n" + text;
  33685. }
  33686. module2.exports = {
  33687. hasPragma,
  33688. insertPragma
  33689. };
  33690. }
  33691. });
  33692. var require_loc4 = __commonJS2({
  33693. "src/language-graphql/loc.js"(exports2, module2) {
  33694. "use strict";
  33695. function locStart(node) {
  33696. if (typeof node.start === "number") {
  33697. return node.start;
  33698. }
  33699. return node.loc && node.loc.start;
  33700. }
  33701. function locEnd(node) {
  33702. if (typeof node.end === "number") {
  33703. return node.end;
  33704. }
  33705. return node.loc && node.loc.end;
  33706. }
  33707. module2.exports = {
  33708. locStart,
  33709. locEnd
  33710. };
  33711. }
  33712. });
  33713. var require_printer_graphql = __commonJS2({
  33714. "src/language-graphql/printer-graphql.js"(exports2, module2) {
  33715. "use strict";
  33716. var {
  33717. builders: {
  33718. join,
  33719. hardline,
  33720. line,
  33721. softline,
  33722. group,
  33723. indent,
  33724. ifBreak
  33725. }
  33726. } = require("./doc.js");
  33727. var {
  33728. isNextLineEmpty,
  33729. isNonEmptyArray
  33730. } = require_util();
  33731. var {
  33732. insertPragma
  33733. } = require_pragma3();
  33734. var {
  33735. locStart,
  33736. locEnd
  33737. } = require_loc4();
  33738. function genericPrint(path, options, print) {
  33739. const node = path.getValue();
  33740. if (!node) {
  33741. return "";
  33742. }
  33743. if (typeof node === "string") {
  33744. return node;
  33745. }
  33746. switch (node.kind) {
  33747. case "Document": {
  33748. const parts = [];
  33749. path.each((pathChild, index, definitions) => {
  33750. parts.push(print());
  33751. if (index !== definitions.length - 1) {
  33752. parts.push(hardline);
  33753. if (isNextLineEmpty(options.originalText, pathChild.getValue(), locEnd)) {
  33754. parts.push(hardline);
  33755. }
  33756. }
  33757. }, "definitions");
  33758. return [...parts, hardline];
  33759. }
  33760. case "OperationDefinition": {
  33761. const hasOperation = options.originalText[locStart(node)] !== "{";
  33762. const hasName = Boolean(node.name);
  33763. return [hasOperation ? node.operation : "", hasOperation && hasName ? [" ", print("name")] : "", hasOperation && !hasName && isNonEmptyArray(node.variableDefinitions) ? " " : "", isNonEmptyArray(node.variableDefinitions) ? group(["(", indent([softline, join([ifBreak("", ", "), softline], path.map(print, "variableDefinitions"))]), softline, ")"]) : "", printDirectives(path, print, node), node.selectionSet ? !hasOperation && !hasName ? "" : " " : "", print("selectionSet")];
  33764. }
  33765. case "FragmentDefinition": {
  33766. return ["fragment ", print("name"), isNonEmptyArray(node.variableDefinitions) ? group(["(", indent([softline, join([ifBreak("", ", "), softline], path.map(print, "variableDefinitions"))]), softline, ")"]) : "", " on ", print("typeCondition"), printDirectives(path, print, node), " ", print("selectionSet")];
  33767. }
  33768. case "SelectionSet": {
  33769. return ["{", indent([hardline, join(hardline, printSequence(path, options, print, "selections"))]), hardline, "}"];
  33770. }
  33771. case "Field": {
  33772. return group([node.alias ? [print("alias"), ": "] : "", print("name"), node.arguments.length > 0 ? group(["(", indent([softline, join([ifBreak("", ", "), softline], printSequence(path, options, print, "arguments"))]), softline, ")"]) : "", printDirectives(path, print, node), node.selectionSet ? " " : "", print("selectionSet")]);
  33773. }
  33774. case "Name": {
  33775. return node.value;
  33776. }
  33777. case "StringValue": {
  33778. if (node.block) {
  33779. return ['"""', hardline, join(hardline, node.value.replace(/"""/g, "\\$&").split("\n")), hardline, '"""'];
  33780. }
  33781. return ['"', node.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), '"'];
  33782. }
  33783. case "IntValue":
  33784. case "FloatValue":
  33785. case "EnumValue": {
  33786. return node.value;
  33787. }
  33788. case "BooleanValue": {
  33789. return node.value ? "true" : "false";
  33790. }
  33791. case "NullValue": {
  33792. return "null";
  33793. }
  33794. case "Variable": {
  33795. return ["$", print("name")];
  33796. }
  33797. case "ListValue": {
  33798. return group(["[", indent([softline, join([ifBreak("", ", "), softline], path.map(print, "values"))]), softline, "]"]);
  33799. }
  33800. case "ObjectValue": {
  33801. return group(["{", options.bracketSpacing && node.fields.length > 0 ? " " : "", indent([softline, join([ifBreak("", ", "), softline], path.map(print, "fields"))]), softline, ifBreak("", options.bracketSpacing && node.fields.length > 0 ? " " : ""), "}"]);
  33802. }
  33803. case "ObjectField":
  33804. case "Argument": {
  33805. return [print("name"), ": ", print("value")];
  33806. }
  33807. case "Directive": {
  33808. return ["@", print("name"), node.arguments.length > 0 ? group(["(", indent([softline, join([ifBreak("", ", "), softline], printSequence(path, options, print, "arguments"))]), softline, ")"]) : ""];
  33809. }
  33810. case "NamedType": {
  33811. return print("name");
  33812. }
  33813. case "VariableDefinition": {
  33814. return [print("variable"), ": ", print("type"), node.defaultValue ? [" = ", print("defaultValue")] : "", printDirectives(path, print, node)];
  33815. }
  33816. case "ObjectTypeExtension":
  33817. case "ObjectTypeDefinition": {
  33818. return [print("description"), node.description ? hardline : "", node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path, options, print)] : "", printDirectives(path, print, node), node.fields.length > 0 ? [" {", indent([hardline, join(hardline, printSequence(path, options, print, "fields"))]), hardline, "}"] : ""];
  33819. }
  33820. case "FieldDefinition": {
  33821. return [print("description"), node.description ? hardline : "", print("name"), node.arguments.length > 0 ? group(["(", indent([softline, join([ifBreak("", ", "), softline], printSequence(path, options, print, "arguments"))]), softline, ")"]) : "", ": ", print("type"), printDirectives(path, print, node)];
  33822. }
  33823. case "DirectiveDefinition": {
  33824. return [print("description"), node.description ? hardline : "", "directive ", "@", print("name"), node.arguments.length > 0 ? group(["(", indent([softline, join([ifBreak("", ", "), softline], printSequence(path, options, print, "arguments"))]), softline, ")"]) : "", node.repeatable ? " repeatable" : "", " on ", join(" | ", path.map(print, "locations"))];
  33825. }
  33826. case "EnumTypeExtension":
  33827. case "EnumTypeDefinition": {
  33828. return [print("description"), node.description ? hardline : "", node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path, print, node), node.values.length > 0 ? [" {", indent([hardline, join(hardline, printSequence(path, options, print, "values"))]), hardline, "}"] : ""];
  33829. }
  33830. case "EnumValueDefinition": {
  33831. return [print("description"), node.description ? hardline : "", print("name"), printDirectives(path, print, node)];
  33832. }
  33833. case "InputValueDefinition": {
  33834. return [print("description"), node.description ? node.description.block ? hardline : line : "", print("name"), ": ", print("type"), node.defaultValue ? [" = ", print("defaultValue")] : "", printDirectives(path, print, node)];
  33835. }
  33836. case "InputObjectTypeExtension":
  33837. case "InputObjectTypeDefinition": {
  33838. return [print("description"), node.description ? hardline : "", node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path, print, node), node.fields.length > 0 ? [" {", indent([hardline, join(hardline, printSequence(path, options, print, "fields"))]), hardline, "}"] : ""];
  33839. }
  33840. case "SchemaDefinition": {
  33841. return [print("description"), node.description ? hardline : "", "schema", printDirectives(path, print, node), " {", node.operationTypes.length > 0 ? indent([hardline, join(hardline, printSequence(path, options, print, "operationTypes"))]) : "", hardline, "}"];
  33842. }
  33843. case "OperationTypeDefinition": {
  33844. return [print("operation"), ": ", print("type")];
  33845. }
  33846. case "InterfaceTypeExtension":
  33847. case "InterfaceTypeDefinition": {
  33848. return [print("description"), node.description ? hardline : "", node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path, options, print)] : "", printDirectives(path, print, node), node.fields.length > 0 ? [" {", indent([hardline, join(hardline, printSequence(path, options, print, "fields"))]), hardline, "}"] : ""];
  33849. }
  33850. case "FragmentSpread": {
  33851. return ["...", print("name"), printDirectives(path, print, node)];
  33852. }
  33853. case "InlineFragment": {
  33854. return ["...", node.typeCondition ? [" on ", print("typeCondition")] : "", printDirectives(path, print, node), " ", print("selectionSet")];
  33855. }
  33856. case "UnionTypeExtension":
  33857. case "UnionTypeDefinition": {
  33858. return group([print("description"), node.description ? hardline : "", group([node.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path, print, node), node.types.length > 0 ? [" =", ifBreak("", " "), indent([ifBreak([line, " "]), join([line, "| "], path.map(print, "types"))])] : ""])]);
  33859. }
  33860. case "ScalarTypeExtension":
  33861. case "ScalarTypeDefinition": {
  33862. return [print("description"), node.description ? hardline : "", node.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", print("name"), printDirectives(path, print, node)];
  33863. }
  33864. case "NonNullType": {
  33865. return [print("type"), "!"];
  33866. }
  33867. case "ListType": {
  33868. return ["[", print("type"), "]"];
  33869. }
  33870. default:
  33871. throw new Error("unknown graphql type: " + JSON.stringify(node.kind));
  33872. }
  33873. }
  33874. function printDirectives(path, print, node) {
  33875. if (node.directives.length === 0) {
  33876. return "";
  33877. }
  33878. const printed = join(line, path.map(print, "directives"));
  33879. if (node.kind === "FragmentDefinition" || node.kind === "OperationDefinition") {
  33880. return group([line, printed]);
  33881. }
  33882. return [" ", group(indent([softline, printed]))];
  33883. }
  33884. function printSequence(path, options, print, property) {
  33885. return path.map((path2, index, sequence) => {
  33886. const printed = print();
  33887. if (index < sequence.length - 1 && isNextLineEmpty(options.originalText, path2.getValue(), locEnd)) {
  33888. return [printed, hardline];
  33889. }
  33890. return printed;
  33891. }, property);
  33892. }
  33893. function canAttachComment(node) {
  33894. return node.kind && node.kind !== "Comment";
  33895. }
  33896. function printComment(commentPath) {
  33897. const comment = commentPath.getValue();
  33898. if (comment.kind === "Comment") {
  33899. return "#" + comment.value.trimEnd();
  33900. }
  33901. throw new Error("Not a comment: " + JSON.stringify(comment));
  33902. }
  33903. function printInterfaces(path, options, print) {
  33904. const node = path.getNode();
  33905. const parts = [];
  33906. const {
  33907. interfaces
  33908. } = node;
  33909. const printed = path.map((node2) => print(node2), "interfaces");
  33910. for (let index = 0; index < interfaces.length; index++) {
  33911. const interfaceNode = interfaces[index];
  33912. parts.push(printed[index]);
  33913. const nextInterfaceNode = interfaces[index + 1];
  33914. if (nextInterfaceNode) {
  33915. const textBetween = options.originalText.slice(interfaceNode.loc.end, nextInterfaceNode.loc.start);
  33916. const hasComment = textBetween.includes("#");
  33917. const separator = textBetween.replace(/#.*/g, "").trim();
  33918. parts.push(separator === "," ? "," : " &", hasComment ? line : " ");
  33919. }
  33920. }
  33921. return parts;
  33922. }
  33923. function clean() {
  33924. }
  33925. clean.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
  33926. function hasPrettierIgnore(path) {
  33927. const node = path.getValue();
  33928. return node && Array.isArray(node.comments) && node.comments.some((comment) => comment.value.trim() === "prettier-ignore");
  33929. }
  33930. module2.exports = {
  33931. print: genericPrint,
  33932. massageAstNode: clean,
  33933. hasPrettierIgnore,
  33934. insertPragma,
  33935. printComment,
  33936. canAttachComment
  33937. };
  33938. }
  33939. });
  33940. var require_options4 = __commonJS2({
  33941. "src/language-graphql/options.js"(exports2, module2) {
  33942. "use strict";
  33943. var commonOptions = require_common_options();
  33944. module2.exports = {
  33945. bracketSpacing: commonOptions.bracketSpacing
  33946. };
  33947. }
  33948. });
  33949. var require_parsers4 = __commonJS2({
  33950. "src/language-graphql/parsers.js"(exports2, module2) {
  33951. "use strict";
  33952. module2.exports = {
  33953. get graphql() {
  33954. return require("./parser-graphql.js").parsers.graphql;
  33955. }
  33956. };
  33957. }
  33958. });
  33959. var require_GraphQL = __commonJS2({
  33960. "node_modules/linguist-languages/data/GraphQL.json"(exports2, module2) {
  33961. module2.exports = {
  33962. name: "GraphQL",
  33963. type: "data",
  33964. color: "#e10098",
  33965. extensions: [".graphql", ".gql", ".graphqls"],
  33966. tmScope: "source.graphql",
  33967. aceMode: "text",
  33968. languageId: 139
  33969. };
  33970. }
  33971. });
  33972. var require_language_graphql = __commonJS2({
  33973. "src/language-graphql/index.js"(exports2, module2) {
  33974. "use strict";
  33975. var createLanguage = require_create_language();
  33976. var printer = require_printer_graphql();
  33977. var options = require_options4();
  33978. var parsers = require_parsers4();
  33979. var languages = [createLanguage(require_GraphQL(), () => ({
  33980. since: "1.5.0",
  33981. parsers: ["graphql"],
  33982. vscodeLanguageIds: ["graphql"]
  33983. }))];
  33984. var printers = {
  33985. graphql: printer
  33986. };
  33987. module2.exports = {
  33988. languages,
  33989. options,
  33990. printers,
  33991. parsers
  33992. };
  33993. }
  33994. });
  33995. var require_loc5 = __commonJS2({
  33996. "src/language-markdown/loc.js"(exports2, module2) {
  33997. "use strict";
  33998. function locStart(node) {
  33999. return node.position.start.offset;
  34000. }
  34001. function locEnd(node) {
  34002. return node.position.end.offset;
  34003. }
  34004. module2.exports = {
  34005. locStart,
  34006. locEnd
  34007. };
  34008. }
  34009. });
  34010. var require_constants_evaluate = __commonJS2({
  34011. "src/language-markdown/constants.evaluate.js"(exports2, module2) {
  34012. module2.exports = {
  34013. cjkPattern: "(?:[\\u02ea-\\u02eb\\u1100-\\u11ff\\u2e80-\\u2e99\\u2e9b-\\u2ef3\\u2f00-\\u2fd5\\u2ff0-\\u303f\\u3041-\\u3096\\u3099-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u3190-\\u3191\\u3196-\\u31ba\\u31c0-\\u31e3\\u31f0-\\u321e\\u322a-\\u3247\\u3260-\\u327e\\u328a-\\u32b0\\u32c0-\\u32cb\\u32d0-\\u3370\\u337b-\\u337f\\u33e0-\\u33fe\\u3400-\\u4db5\\u4e00-\\u9fef\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufe10-\\ufe1f\\ufe30-\\ufe6f\\uff00-\\uffef]|[\\ud840-\\ud868\\ud86a-\\ud86c\\ud86f-\\ud872\\ud874-\\ud879][\\udc00-\\udfff]|\\ud82c[\\udc00-\\udd1e\\udd50-\\udd52\\udd64-\\udd67]|\\ud83c[\\ude00\\ude50-\\ude51]|\\ud869[\\udc00-\\uded6\\udf00-\\udfff]|\\ud86d[\\udc00-\\udf34\\udf40-\\udfff]|\\ud86e[\\udc00-\\udc1d\\udc20-\\udfff]|\\ud873[\\udc00-\\udea1\\udeb0-\\udfff]|\\ud87a[\\udc00-\\udfe0]|\\ud87e[\\udc00-\\ude1d])(?:[\\ufe00-\\ufe0f]|\\udb40[\\udd00-\\uddef])?",
  34014. kPattern: "[\\u1100-\\u11ff\\u3001-\\u3003\\u3008-\\u3011\\u3013-\\u301f\\u302e-\\u3030\\u3037\\u30fb\\u3131-\\u318e\\u3200-\\u321e\\u3260-\\u327e\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\ufe45-\\ufe46\\uff61-\\uff65\\uffa0-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc]",
  34015. punctuationPattern: "[\\u0021-\\u002f\\u003a-\\u0040\\u005b-\\u0060\\u007b-\\u007e\\u00a1\\u00a7\\u00ab\\u00b6-\\u00b7\\u00bb\\u00bf\\u037e\\u0387\\u055a-\\u055f\\u0589-\\u058a\\u05be\\u05c0\\u05c3\\u05c6\\u05f3-\\u05f4\\u0609-\\u060a\\u060c-\\u060d\\u061b\\u061e-\\u061f\\u066a-\\u066d\\u06d4\\u0700-\\u070d\\u07f7-\\u07f9\\u0830-\\u083e\\u085e\\u0964-\\u0965\\u0970\\u09fd\\u0a76\\u0af0\\u0c77\\u0c84\\u0df4\\u0e4f\\u0e5a-\\u0e5b\\u0f04-\\u0f12\\u0f14\\u0f3a-\\u0f3d\\u0f85\\u0fd0-\\u0fd4\\u0fd9-\\u0fda\\u104a-\\u104f\\u10fb\\u1360-\\u1368\\u1400\\u166e\\u169b-\\u169c\\u16eb-\\u16ed\\u1735-\\u1736\\u17d4-\\u17d6\\u17d8-\\u17da\\u1800-\\u180a\\u1944-\\u1945\\u1a1e-\\u1a1f\\u1aa0-\\u1aa6\\u1aa8-\\u1aad\\u1b5a-\\u1b60\\u1bfc-\\u1bff\\u1c3b-\\u1c3f\\u1c7e-\\u1c7f\\u1cc0-\\u1cc7\\u1cd3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205e\\u207d-\\u207e\\u208d-\\u208e\\u2308-\\u230b\\u2329-\\u232a\\u2768-\\u2775\\u27c5-\\u27c6\\u27e6-\\u27ef\\u2983-\\u2998\\u29d8-\\u29db\\u29fc-\\u29fd\\u2cf9-\\u2cfc\\u2cfe-\\u2cff\\u2d70\\u2e00-\\u2e2e\\u2e30-\\u2e4f\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301f\\u3030\\u303d\\u30a0\\u30fb\\ua4fe-\\ua4ff\\ua60d-\\ua60f\\ua673\\ua67e\\ua6f2-\\ua6f7\\ua874-\\ua877\\ua8ce-\\ua8cf\\ua8f8-\\ua8fa\\ua8fc\\ua92e-\\ua92f\\ua95f\\ua9c1-\\ua9cd\\ua9de-\\ua9df\\uaa5c-\\uaa5f\\uaade-\\uaadf\\uaaf0-\\uaaf1\\uabeb\\ufd3e-\\ufd3f\\ufe10-\\ufe19\\ufe30-\\ufe52\\ufe54-\\ufe61\\ufe63\\ufe68\\ufe6a-\\ufe6b\\uff01-\\uff03\\uff05-\\uff0a\\uff0c-\\uff0f\\uff1a-\\uff1b\\uff1f-\\uff20\\uff3b-\\uff3d\\uff3f\\uff5b\\uff5d\\uff5f-\\uff65]|\\ud800[\\udd00-\\udd02\\udf9f\\udfd0]|\\ud801[\\udd6f]|\\ud802[\\udc57\\udd1f\\udd3f\\ude50-\\ude58\\ude7f\\udef0-\\udef6\\udf39-\\udf3f\\udf99-\\udf9c]|\\ud803[\\udf55-\\udf59]|\\ud804[\\udc47-\\udc4d\\udcbb-\\udcbc\\udcbe-\\udcc1\\udd40-\\udd43\\udd74-\\udd75\\uddc5-\\uddc8\\uddcd\\udddb\\udddd-\\udddf\\ude38-\\ude3d\\udea9]|\\ud805[\\udc4b-\\udc4f\\udc5b\\udc5d\\udcc6\\uddc1-\\uddd7\\ude41-\\ude43\\ude60-\\ude6c\\udf3c-\\udf3e]|\\ud806[\\udc3b\\udde2\\ude3f-\\ude46\\ude9a-\\ude9c\\ude9e-\\udea2]|\\ud807[\\udc41-\\udc45\\udc70-\\udc71\\udef7-\\udef8\\udfff]|\\ud809[\\udc70-\\udc74]|\\ud81a[\\ude6e-\\ude6f\\udef5\\udf37-\\udf3b\\udf44]|\\ud81b[\\ude97-\\ude9a\\udfe2]|\\ud82f[\\udc9f]|\\ud836[\\ude87-\\ude8b]|\\ud83a[\\udd5e-\\udd5f]"
  34016. };
  34017. }
  34018. });
  34019. var require_utils10 = __commonJS2({
  34020. "src/language-markdown/utils.js"(exports2, module2) {
  34021. "use strict";
  34022. var {
  34023. getLast
  34024. } = require_util();
  34025. var {
  34026. locStart,
  34027. locEnd
  34028. } = require_loc5();
  34029. var {
  34030. cjkPattern,
  34031. kPattern,
  34032. punctuationPattern
  34033. } = require_constants_evaluate();
  34034. var INLINE_NODE_TYPES = ["liquidNode", "inlineCode", "emphasis", "esComment", "strong", "delete", "wikiLink", "link", "linkReference", "image", "imageReference", "footnote", "footnoteReference", "sentence", "whitespace", "word", "break", "inlineMath"];
  34035. var INLINE_NODE_WRAPPER_TYPES = [...INLINE_NODE_TYPES, "tableCell", "paragraph", "heading"];
  34036. var kRegex = new RegExp(kPattern);
  34037. var punctuationRegex = new RegExp(punctuationPattern);
  34038. function splitText(text, options) {
  34039. const KIND_NON_CJK = "non-cjk";
  34040. const KIND_CJ_LETTER = "cj-letter";
  34041. const KIND_K_LETTER = "k-letter";
  34042. const KIND_CJK_PUNCTUATION = "cjk-punctuation";
  34043. const nodes = [];
  34044. const tokens = (options.proseWrap === "preserve" ? text : text.replace(new RegExp(`(${cjkPattern})
  34045. (${cjkPattern})`, "g"), "$1$2")).split(/([\t\n ]+)/);
  34046. for (const [index, token] of tokens.entries()) {
  34047. if (index % 2 === 1) {
  34048. nodes.push({
  34049. type: "whitespace",
  34050. value: /\n/.test(token) ? "\n" : " "
  34051. });
  34052. continue;
  34053. }
  34054. if ((index === 0 || index === tokens.length - 1) && token === "") {
  34055. continue;
  34056. }
  34057. const innerTokens = token.split(new RegExp(`(${cjkPattern})`));
  34058. for (const [innerIndex, innerToken] of innerTokens.entries()) {
  34059. if ((innerIndex === 0 || innerIndex === innerTokens.length - 1) && innerToken === "") {
  34060. continue;
  34061. }
  34062. if (innerIndex % 2 === 0) {
  34063. if (innerToken !== "") {
  34064. appendNode({
  34065. type: "word",
  34066. value: innerToken,
  34067. kind: KIND_NON_CJK,
  34068. hasLeadingPunctuation: punctuationRegex.test(innerToken[0]),
  34069. hasTrailingPunctuation: punctuationRegex.test(getLast(innerToken))
  34070. });
  34071. }
  34072. continue;
  34073. }
  34074. appendNode(punctuationRegex.test(innerToken) ? {
  34075. type: "word",
  34076. value: innerToken,
  34077. kind: KIND_CJK_PUNCTUATION,
  34078. hasLeadingPunctuation: true,
  34079. hasTrailingPunctuation: true
  34080. } : {
  34081. type: "word",
  34082. value: innerToken,
  34083. kind: kRegex.test(innerToken) ? KIND_K_LETTER : KIND_CJ_LETTER,
  34084. hasLeadingPunctuation: false,
  34085. hasTrailingPunctuation: false
  34086. });
  34087. }
  34088. }
  34089. return nodes;
  34090. function appendNode(node) {
  34091. const lastNode = getLast(nodes);
  34092. if (lastNode && lastNode.type === "word") {
  34093. if (lastNode.kind === KIND_NON_CJK && node.kind === KIND_CJ_LETTER && !lastNode.hasTrailingPunctuation || lastNode.kind === KIND_CJ_LETTER && node.kind === KIND_NON_CJK && !node.hasLeadingPunctuation) {
  34094. nodes.push({
  34095. type: "whitespace",
  34096. value: " "
  34097. });
  34098. } else if (!isBetween(KIND_NON_CJK, KIND_CJK_PUNCTUATION) && ![lastNode.value, node.value].some((value) => /\u3000/.test(value))) {
  34099. nodes.push({
  34100. type: "whitespace",
  34101. value: ""
  34102. });
  34103. }
  34104. }
  34105. nodes.push(node);
  34106. function isBetween(kind1, kind2) {
  34107. return lastNode.kind === kind1 && node.kind === kind2 || lastNode.kind === kind2 && node.kind === kind1;
  34108. }
  34109. }
  34110. }
  34111. function getOrderedListItemInfo(orderListItem, originalText) {
  34112. const [, numberText, marker, leadingSpaces] = originalText.slice(orderListItem.position.start.offset, orderListItem.position.end.offset).match(/^\s*(\d+)(\.|\))(\s*)/);
  34113. return {
  34114. numberText,
  34115. marker,
  34116. leadingSpaces
  34117. };
  34118. }
  34119. function hasGitDiffFriendlyOrderedList(node, options) {
  34120. if (!node.ordered) {
  34121. return false;
  34122. }
  34123. if (node.children.length < 2) {
  34124. return false;
  34125. }
  34126. const firstNumber = Number(getOrderedListItemInfo(node.children[0], options.originalText).numberText);
  34127. const secondNumber = Number(getOrderedListItemInfo(node.children[1], options.originalText).numberText);
  34128. if (firstNumber === 0 && node.children.length > 2) {
  34129. const thirdNumber = Number(getOrderedListItemInfo(node.children[2], options.originalText).numberText);
  34130. return secondNumber === 1 && thirdNumber === 1;
  34131. }
  34132. return secondNumber === 1;
  34133. }
  34134. function getFencedCodeBlockValue(node, originalText) {
  34135. const {
  34136. value
  34137. } = node;
  34138. if (node.position.end.offset === originalText.length && value.endsWith("\n") && originalText.endsWith("\n")) {
  34139. return value.slice(0, -1);
  34140. }
  34141. return value;
  34142. }
  34143. function mapAst(ast, handler) {
  34144. return function preorder(node, index, parentStack) {
  34145. const newNode = Object.assign({}, handler(node, index, parentStack));
  34146. if (newNode.children) {
  34147. newNode.children = newNode.children.map((child, index2) => preorder(child, index2, [newNode, ...parentStack]));
  34148. }
  34149. return newNode;
  34150. }(ast, null, []);
  34151. }
  34152. function isAutolink(node) {
  34153. if (!node || node.type !== "link" || node.children.length !== 1) {
  34154. return false;
  34155. }
  34156. const child = node.children[0];
  34157. return child && locStart(node) === locStart(child) && locEnd(node) === locEnd(child);
  34158. }
  34159. module2.exports = {
  34160. mapAst,
  34161. splitText,
  34162. punctuationPattern,
  34163. getFencedCodeBlockValue,
  34164. getOrderedListItemInfo,
  34165. hasGitDiffFriendlyOrderedList,
  34166. INLINE_NODE_TYPES,
  34167. INLINE_NODE_WRAPPER_TYPES,
  34168. isAutolink
  34169. };
  34170. }
  34171. });
  34172. var require_embed3 = __commonJS2({
  34173. "src/language-markdown/embed.js"(exports2, module2) {
  34174. "use strict";
  34175. var {
  34176. inferParserByLanguage,
  34177. getMaxContinuousCount
  34178. } = require_util();
  34179. var {
  34180. builders: {
  34181. hardline,
  34182. markAsRoot
  34183. },
  34184. utils: {
  34185. replaceEndOfLine
  34186. }
  34187. } = require("./doc.js");
  34188. var printFrontMatter = require_print();
  34189. var {
  34190. getFencedCodeBlockValue
  34191. } = require_utils10();
  34192. function embed(path, print, textToDoc, options) {
  34193. const node = path.getValue();
  34194. if (node.type === "code" && node.lang !== null) {
  34195. const parser = inferParserByLanguage(node.lang, options);
  34196. if (parser) {
  34197. const styleUnit = options.__inJsTemplate ? "~" : "`";
  34198. const style = styleUnit.repeat(Math.max(3, getMaxContinuousCount(node.value, styleUnit) + 1));
  34199. const newOptions = {
  34200. parser
  34201. };
  34202. if (node.lang === "tsx") {
  34203. newOptions.filepath = "dummy.tsx";
  34204. }
  34205. const doc2 = textToDoc(getFencedCodeBlockValue(node, options.originalText), newOptions, {
  34206. stripTrailingHardline: true
  34207. });
  34208. return markAsRoot([style, node.lang, node.meta ? " " + node.meta : "", hardline, replaceEndOfLine(doc2), hardline, style]);
  34209. }
  34210. }
  34211. switch (node.type) {
  34212. case "front-matter":
  34213. return printFrontMatter(node, textToDoc);
  34214. case "importExport":
  34215. return [textToDoc(node.value, {
  34216. parser: "babel"
  34217. }, {
  34218. stripTrailingHardline: true
  34219. }), hardline];
  34220. case "jsx":
  34221. return textToDoc(`<$>${node.value}</$>`, {
  34222. parser: "__js_expression",
  34223. rootMarker: "mdx"
  34224. }, {
  34225. stripTrailingHardline: true
  34226. });
  34227. }
  34228. return null;
  34229. }
  34230. module2.exports = embed;
  34231. }
  34232. });
  34233. var require_pragma4 = __commonJS2({
  34234. "src/language-markdown/pragma.js"(exports2, module2) {
  34235. "use strict";
  34236. var parseFrontMatter = require_parse4();
  34237. var pragmas = ["format", "prettier"];
  34238. function startWithPragma(text) {
  34239. const pragma = `@(${pragmas.join("|")})`;
  34240. const regex = new RegExp([`<!--\\s*${pragma}\\s*-->`, `{\\s*\\/\\*\\s*${pragma}\\s*\\*\\/\\s*}`, `<!--.*\r?
  34241. [\\s\\S]*(^|
  34242. )[^\\S
  34243. ]*${pragma}[^\\S
  34244. ]*($|
  34245. )[\\s\\S]*
  34246. .*-->`].join("|"), "m");
  34247. const matched = text.match(regex);
  34248. return matched && matched.index === 0;
  34249. }
  34250. module2.exports = {
  34251. startWithPragma,
  34252. hasPragma: (text) => startWithPragma(parseFrontMatter(text).content.trimStart()),
  34253. insertPragma: (text) => {
  34254. const extracted = parseFrontMatter(text);
  34255. const pragma = `<!-- @${pragmas[0]} -->`;
  34256. return extracted.frontMatter ? `${extracted.frontMatter.raw}
  34257. ${pragma}
  34258. ${extracted.content}` : `${pragma}
  34259. ${extracted.content}`;
  34260. }
  34261. };
  34262. }
  34263. });
  34264. var require_print_preprocess2 = __commonJS2({
  34265. "src/language-markdown/print-preprocess.js"(exports2, module2) {
  34266. "use strict";
  34267. var getLast = require_get_last();
  34268. var {
  34269. getOrderedListItemInfo,
  34270. mapAst,
  34271. splitText
  34272. } = require_utils10();
  34273. var isSingleCharRegex = /^.$/su;
  34274. function preprocess(ast, options) {
  34275. ast = restoreUnescapedCharacter(ast, options);
  34276. ast = mergeContinuousTexts(ast);
  34277. ast = transformInlineCode(ast);
  34278. ast = transformIndentedCodeblockAndMarkItsParentList(ast, options);
  34279. ast = markAlignedList(ast, options);
  34280. ast = splitTextIntoSentences(ast, options);
  34281. ast = transformImportExport(ast);
  34282. ast = mergeContinuousImportExport(ast);
  34283. return ast;
  34284. }
  34285. function transformImportExport(ast) {
  34286. return mapAst(ast, (node) => {
  34287. if (node.type !== "import" && node.type !== "export") {
  34288. return node;
  34289. }
  34290. return Object.assign(Object.assign({}, node), {}, {
  34291. type: "importExport"
  34292. });
  34293. });
  34294. }
  34295. function transformInlineCode(ast) {
  34296. return mapAst(ast, (node) => {
  34297. if (node.type !== "inlineCode") {
  34298. return node;
  34299. }
  34300. return Object.assign(Object.assign({}, node), {}, {
  34301. value: node.value.replace(/\s+/g, " ")
  34302. });
  34303. });
  34304. }
  34305. function restoreUnescapedCharacter(ast, options) {
  34306. return mapAst(ast, (node) => node.type !== "text" || node.value === "*" || node.value === "_" || !isSingleCharRegex.test(node.value) || node.position.end.offset - node.position.start.offset === node.value.length ? node : Object.assign(Object.assign({}, node), {}, {
  34307. value: options.originalText.slice(node.position.start.offset, node.position.end.offset)
  34308. }));
  34309. }
  34310. function mergeContinuousImportExport(ast) {
  34311. return mergeChildren(ast, (prevNode, node) => prevNode.type === "importExport" && node.type === "importExport", (prevNode, node) => ({
  34312. type: "importExport",
  34313. value: prevNode.value + "\n\n" + node.value,
  34314. position: {
  34315. start: prevNode.position.start,
  34316. end: node.position.end
  34317. }
  34318. }));
  34319. }
  34320. function mergeChildren(ast, shouldMerge, mergeNode) {
  34321. return mapAst(ast, (node) => {
  34322. if (!node.children) {
  34323. return node;
  34324. }
  34325. const children = node.children.reduce((current, child) => {
  34326. const lastChild = getLast(current);
  34327. if (lastChild && shouldMerge(lastChild, child)) {
  34328. current.splice(-1, 1, mergeNode(lastChild, child));
  34329. } else {
  34330. current.push(child);
  34331. }
  34332. return current;
  34333. }, []);
  34334. return Object.assign(Object.assign({}, node), {}, {
  34335. children
  34336. });
  34337. });
  34338. }
  34339. function mergeContinuousTexts(ast) {
  34340. return mergeChildren(ast, (prevNode, node) => prevNode.type === "text" && node.type === "text", (prevNode, node) => ({
  34341. type: "text",
  34342. value: prevNode.value + node.value,
  34343. position: {
  34344. start: prevNode.position.start,
  34345. end: node.position.end
  34346. }
  34347. }));
  34348. }
  34349. function splitTextIntoSentences(ast, options) {
  34350. return mapAst(ast, (node, index, [parentNode]) => {
  34351. if (node.type !== "text") {
  34352. return node;
  34353. }
  34354. let {
  34355. value
  34356. } = node;
  34357. if (parentNode.type === "paragraph") {
  34358. if (index === 0) {
  34359. value = value.trimStart();
  34360. }
  34361. if (index === parentNode.children.length - 1) {
  34362. value = value.trimEnd();
  34363. }
  34364. }
  34365. return {
  34366. type: "sentence",
  34367. position: node.position,
  34368. children: splitText(value, options)
  34369. };
  34370. });
  34371. }
  34372. function transformIndentedCodeblockAndMarkItsParentList(ast, options) {
  34373. return mapAst(ast, (node, index, parentStack) => {
  34374. if (node.type === "code") {
  34375. const isIndented = /^\n?(?: {4,}|\t)/.test(options.originalText.slice(node.position.start.offset, node.position.end.offset));
  34376. node.isIndented = isIndented;
  34377. if (isIndented) {
  34378. for (let i = 0; i < parentStack.length; i++) {
  34379. const parent = parentStack[i];
  34380. if (parent.hasIndentedCodeblock) {
  34381. break;
  34382. }
  34383. if (parent.type === "list") {
  34384. parent.hasIndentedCodeblock = true;
  34385. }
  34386. }
  34387. }
  34388. }
  34389. return node;
  34390. });
  34391. }
  34392. function markAlignedList(ast, options) {
  34393. return mapAst(ast, (node, index, parentStack) => {
  34394. if (node.type === "list" && node.children.length > 0) {
  34395. for (let i = 0; i < parentStack.length; i++) {
  34396. const parent = parentStack[i];
  34397. if (parent.type === "list" && !parent.isAligned) {
  34398. node.isAligned = false;
  34399. return node;
  34400. }
  34401. }
  34402. node.isAligned = isAligned(node);
  34403. }
  34404. return node;
  34405. });
  34406. function getListItemStart(listItem) {
  34407. return listItem.children.length === 0 ? -1 : listItem.children[0].position.start.column - 1;
  34408. }
  34409. function isAligned(list) {
  34410. if (!list.ordered) {
  34411. return true;
  34412. }
  34413. const [firstItem, secondItem] = list.children;
  34414. const firstInfo = getOrderedListItemInfo(firstItem, options.originalText);
  34415. if (firstInfo.leadingSpaces.length > 1) {
  34416. return true;
  34417. }
  34418. const firstStart = getListItemStart(firstItem);
  34419. if (firstStart === -1) {
  34420. return false;
  34421. }
  34422. if (list.children.length === 1) {
  34423. return firstStart % options.tabWidth === 0;
  34424. }
  34425. const secondStart = getListItemStart(secondItem);
  34426. if (firstStart !== secondStart) {
  34427. return false;
  34428. }
  34429. if (firstStart % options.tabWidth === 0) {
  34430. return true;
  34431. }
  34432. const secondInfo = getOrderedListItemInfo(secondItem, options.originalText);
  34433. return secondInfo.leadingSpaces.length > 1;
  34434. }
  34435. }
  34436. module2.exports = preprocess;
  34437. }
  34438. });
  34439. var require_clean4 = __commonJS2({
  34440. "src/language-markdown/clean.js"(exports2, module2) {
  34441. "use strict";
  34442. var {
  34443. isFrontMatterNode
  34444. } = require_util();
  34445. var {
  34446. startWithPragma
  34447. } = require_pragma4();
  34448. var ignoredProperties = /* @__PURE__ */ new Set(["position", "raw"]);
  34449. function clean(ast, newObj, parent) {
  34450. if (ast.type === "front-matter" || ast.type === "code" || ast.type === "yaml" || ast.type === "import" || ast.type === "export" || ast.type === "jsx") {
  34451. delete newObj.value;
  34452. }
  34453. if (ast.type === "list") {
  34454. delete newObj.isAligned;
  34455. }
  34456. if (ast.type === "list" || ast.type === "listItem") {
  34457. delete newObj.spread;
  34458. delete newObj.loose;
  34459. }
  34460. if (ast.type === "text") {
  34461. return null;
  34462. }
  34463. if (ast.type === "inlineCode") {
  34464. newObj.value = ast.value.replace(/[\t\n ]+/g, " ");
  34465. }
  34466. if (ast.type === "wikiLink") {
  34467. newObj.value = ast.value.trim().replace(/[\t\n]+/g, " ");
  34468. }
  34469. if (ast.type === "definition" || ast.type === "linkReference") {
  34470. newObj.label = ast.label.trim().replace(/[\t\n ]+/g, " ").toLowerCase();
  34471. }
  34472. if ((ast.type === "definition" || ast.type === "link" || ast.type === "image") && ast.title) {
  34473. newObj.title = ast.title.replace(/\\(["')])/g, "$1");
  34474. }
  34475. if (parent && parent.type === "root" && parent.children.length > 0 && (parent.children[0] === ast || isFrontMatterNode(parent.children[0]) && parent.children[1] === ast) && ast.type === "html" && startWithPragma(ast.value)) {
  34476. return null;
  34477. }
  34478. }
  34479. clean.ignoredProperties = ignoredProperties;
  34480. module2.exports = clean;
  34481. }
  34482. });
  34483. var require_printer_markdown = __commonJS2({
  34484. "src/language-markdown/printer-markdown.js"(exports2, module2) {
  34485. "use strict";
  34486. var {
  34487. getLast,
  34488. getMinNotPresentContinuousCount,
  34489. getMaxContinuousCount,
  34490. getStringWidth,
  34491. isNonEmptyArray
  34492. } = require_util();
  34493. var {
  34494. builders: {
  34495. breakParent,
  34496. join,
  34497. line,
  34498. literalline,
  34499. markAsRoot,
  34500. hardline,
  34501. softline,
  34502. ifBreak,
  34503. fill,
  34504. align,
  34505. indent,
  34506. group,
  34507. hardlineWithoutBreakParent
  34508. },
  34509. utils: {
  34510. normalizeDoc,
  34511. replaceTextEndOfLine
  34512. },
  34513. printer: {
  34514. printDocToString
  34515. }
  34516. } = require("./doc.js");
  34517. var embed = require_embed3();
  34518. var {
  34519. insertPragma
  34520. } = require_pragma4();
  34521. var {
  34522. locStart,
  34523. locEnd
  34524. } = require_loc5();
  34525. var preprocess = require_print_preprocess2();
  34526. var clean = require_clean4();
  34527. var {
  34528. getFencedCodeBlockValue,
  34529. hasGitDiffFriendlyOrderedList,
  34530. splitText,
  34531. punctuationPattern,
  34532. INLINE_NODE_TYPES,
  34533. INLINE_NODE_WRAPPER_TYPES,
  34534. isAutolink
  34535. } = require_utils10();
  34536. var TRAILING_HARDLINE_NODES = /* @__PURE__ */ new Set(["importExport"]);
  34537. var SINGLE_LINE_NODE_TYPES = ["heading", "tableCell", "link", "wikiLink"];
  34538. var SIBLING_NODE_TYPES = /* @__PURE__ */ new Set(["listItem", "definition", "footnoteDefinition"]);
  34539. function genericPrint(path, options, print) {
  34540. const node = path.getValue();
  34541. if (shouldRemainTheSameContent(path)) {
  34542. return splitText(options.originalText.slice(node.position.start.offset, node.position.end.offset), options).map((node2) => node2.type === "word" ? node2.value : node2.value === "" ? "" : printLine(path, node2.value, options));
  34543. }
  34544. switch (node.type) {
  34545. case "front-matter":
  34546. return options.originalText.slice(node.position.start.offset, node.position.end.offset);
  34547. case "root":
  34548. if (node.children.length === 0) {
  34549. return "";
  34550. }
  34551. return [normalizeDoc(printRoot(path, options, print)), !TRAILING_HARDLINE_NODES.has(getLastDescendantNode(node).type) ? hardline : ""];
  34552. case "paragraph":
  34553. return printChildren(path, options, print, {
  34554. postprocessor: fill
  34555. });
  34556. case "sentence":
  34557. return printChildren(path, options, print);
  34558. case "word": {
  34559. let escapedValue = node.value.replace(/\*/g, "\\$&").replace(new RegExp([`(^|${punctuationPattern})(_+)`, `(_+)(${punctuationPattern}|$)`].join("|"), "g"), (_, text1, underscore1, underscore2, text2) => (underscore1 ? `${text1}${underscore1}` : `${underscore2}${text2}`).replace(/_/g, "\\_"));
  34560. const isFirstSentence = (node2, name, index) => node2.type === "sentence" && index === 0;
  34561. const isLastChildAutolink = (node2, name, index) => isAutolink(node2.children[index - 1]);
  34562. if (escapedValue !== node.value && (path.match(void 0, isFirstSentence, isLastChildAutolink) || path.match(void 0, isFirstSentence, (node2, name, index) => node2.type === "emphasis" && index === 0, isLastChildAutolink))) {
  34563. escapedValue = escapedValue.replace(/^(\\?[*_])+/, (prefix) => prefix.replace(/\\/g, ""));
  34564. }
  34565. return escapedValue;
  34566. }
  34567. case "whitespace": {
  34568. const parentNode = path.getParentNode();
  34569. const index = parentNode.children.indexOf(node);
  34570. const nextNode = parentNode.children[index + 1];
  34571. const proseWrap = nextNode && /^>|^(?:[*+-]|#{1,6}|\d+[).])$/.test(nextNode.value) ? "never" : options.proseWrap;
  34572. return printLine(path, node.value, {
  34573. proseWrap
  34574. });
  34575. }
  34576. case "emphasis": {
  34577. let style;
  34578. if (isAutolink(node.children[0])) {
  34579. style = options.originalText[node.position.start.offset];
  34580. } else {
  34581. const parentNode = path.getParentNode();
  34582. const index = parentNode.children.indexOf(node);
  34583. const prevNode = parentNode.children[index - 1];
  34584. const nextNode = parentNode.children[index + 1];
  34585. const hasPrevOrNextWord = prevNode && prevNode.type === "sentence" && prevNode.children.length > 0 && getLast(prevNode.children).type === "word" && !getLast(prevNode.children).hasTrailingPunctuation || nextNode && nextNode.type === "sentence" && nextNode.children.length > 0 && nextNode.children[0].type === "word" && !nextNode.children[0].hasLeadingPunctuation;
  34586. style = hasPrevOrNextWord || getAncestorNode(path, "emphasis") ? "*" : "_";
  34587. }
  34588. return [style, printChildren(path, options, print), style];
  34589. }
  34590. case "strong":
  34591. return ["**", printChildren(path, options, print), "**"];
  34592. case "delete":
  34593. return ["~~", printChildren(path, options, print), "~~"];
  34594. case "inlineCode": {
  34595. const backtickCount = getMinNotPresentContinuousCount(node.value, "`");
  34596. const style = "`".repeat(backtickCount || 1);
  34597. const gap = backtickCount && !/^\s/.test(node.value) ? " " : "";
  34598. return [style, gap, node.value, gap, style];
  34599. }
  34600. case "wikiLink": {
  34601. let contents = "";
  34602. if (options.proseWrap === "preserve") {
  34603. contents = node.value;
  34604. } else {
  34605. contents = node.value.replace(/[\t\n]+/g, " ");
  34606. }
  34607. return ["[[", contents, "]]"];
  34608. }
  34609. case "link":
  34610. switch (options.originalText[node.position.start.offset]) {
  34611. case "<": {
  34612. const mailto = "mailto:";
  34613. const url = node.url.startsWith(mailto) && options.originalText.slice(node.position.start.offset + 1, node.position.start.offset + 1 + mailto.length) !== mailto ? node.url.slice(mailto.length) : node.url;
  34614. return ["<", url, ">"];
  34615. }
  34616. case "[":
  34617. return ["[", printChildren(path, options, print), "](", printUrl(node.url, ")"), printTitle(node.title, options), ")"];
  34618. default:
  34619. return options.originalText.slice(node.position.start.offset, node.position.end.offset);
  34620. }
  34621. case "image":
  34622. return ["![", node.alt || "", "](", printUrl(node.url, ")"), printTitle(node.title, options), ")"];
  34623. case "blockquote":
  34624. return ["> ", align("> ", printChildren(path, options, print))];
  34625. case "heading":
  34626. return ["#".repeat(node.depth) + " ", printChildren(path, options, print)];
  34627. case "code": {
  34628. if (node.isIndented) {
  34629. const alignment = " ".repeat(4);
  34630. return align(alignment, [alignment, ...replaceTextEndOfLine(node.value, hardline)]);
  34631. }
  34632. const styleUnit = options.__inJsTemplate ? "~" : "`";
  34633. const style = styleUnit.repeat(Math.max(3, getMaxContinuousCount(node.value, styleUnit) + 1));
  34634. return [style, node.lang || "", node.meta ? " " + node.meta : "", hardline, ...replaceTextEndOfLine(getFencedCodeBlockValue(node, options.originalText), hardline), hardline, style];
  34635. }
  34636. case "html": {
  34637. const parentNode = path.getParentNode();
  34638. const value = parentNode.type === "root" && getLast(parentNode.children) === node ? node.value.trimEnd() : node.value;
  34639. const isHtmlComment = /^<!--.*-->$/s.test(value);
  34640. return replaceTextEndOfLine(value, isHtmlComment ? hardline : markAsRoot(literalline));
  34641. }
  34642. case "list": {
  34643. const nthSiblingIndex = getNthListSiblingIndex(node, path.getParentNode());
  34644. const isGitDiffFriendlyOrderedList = hasGitDiffFriendlyOrderedList(node, options);
  34645. return printChildren(path, options, print, {
  34646. processor: (childPath, index) => {
  34647. const prefix = getPrefix();
  34648. const childNode = childPath.getValue();
  34649. if (childNode.children.length === 2 && childNode.children[1].type === "html" && childNode.children[0].position.start.column !== childNode.children[1].position.start.column) {
  34650. return [prefix, printListItem(childPath, options, print, prefix)];
  34651. }
  34652. return [prefix, align(" ".repeat(prefix.length), printListItem(childPath, options, print, prefix))];
  34653. function getPrefix() {
  34654. const rawPrefix = node.ordered ? (index === 0 ? node.start : isGitDiffFriendlyOrderedList ? 1 : node.start + index) + (nthSiblingIndex % 2 === 0 ? ". " : ") ") : nthSiblingIndex % 2 === 0 ? "- " : "* ";
  34655. return node.isAligned || node.hasIndentedCodeblock ? alignListPrefix(rawPrefix, options) : rawPrefix;
  34656. }
  34657. }
  34658. });
  34659. }
  34660. case "thematicBreak": {
  34661. const counter = getAncestorCounter(path, "list");
  34662. if (counter === -1) {
  34663. return "---";
  34664. }
  34665. const nthSiblingIndex = getNthListSiblingIndex(path.getParentNode(counter), path.getParentNode(counter + 1));
  34666. return nthSiblingIndex % 2 === 0 ? "***" : "---";
  34667. }
  34668. case "linkReference":
  34669. return ["[", printChildren(path, options, print), "]", node.referenceType === "full" ? ["[", node.identifier, "]"] : node.referenceType === "collapsed" ? "[]" : ""];
  34670. case "imageReference":
  34671. switch (node.referenceType) {
  34672. case "full":
  34673. return ["![", node.alt || "", "][", node.identifier, "]"];
  34674. default:
  34675. return ["![", node.alt, "]", node.referenceType === "collapsed" ? "[]" : ""];
  34676. }
  34677. case "definition": {
  34678. const lineOrSpace = options.proseWrap === "always" ? line : " ";
  34679. return group(["[", node.identifier, "]:", indent([lineOrSpace, printUrl(node.url), node.title === null ? "" : [lineOrSpace, printTitle(node.title, options, false)]])]);
  34680. }
  34681. case "footnote":
  34682. return ["[^", printChildren(path, options, print), "]"];
  34683. case "footnoteReference":
  34684. return ["[^", node.identifier, "]"];
  34685. case "footnoteDefinition": {
  34686. const nextNode = path.getParentNode().children[path.getName() + 1];
  34687. const shouldInlineFootnote = node.children.length === 1 && node.children[0].type === "paragraph" && (options.proseWrap === "never" || options.proseWrap === "preserve" && node.children[0].position.start.line === node.children[0].position.end.line);
  34688. return ["[^", node.identifier, "]: ", shouldInlineFootnote ? printChildren(path, options, print) : group([align(" ".repeat(4), printChildren(path, options, print, {
  34689. processor: (childPath, index) => index === 0 ? group([softline, print()]) : print()
  34690. })), nextNode && nextNode.type === "footnoteDefinition" ? softline : ""])];
  34691. }
  34692. case "table":
  34693. return printTable(path, options, print);
  34694. case "tableCell":
  34695. return printChildren(path, options, print);
  34696. case "break":
  34697. return /\s/.test(options.originalText[node.position.start.offset]) ? [" ", markAsRoot(literalline)] : ["\\", hardline];
  34698. case "liquidNode":
  34699. return replaceTextEndOfLine(node.value, hardline);
  34700. case "importExport":
  34701. return [node.value, hardline];
  34702. case "esComment":
  34703. return ["{/* ", node.value, " */}"];
  34704. case "jsx":
  34705. return node.value;
  34706. case "math":
  34707. return ["$$", hardline, node.value ? [...replaceTextEndOfLine(node.value, hardline), hardline] : "", "$$"];
  34708. case "inlineMath": {
  34709. return options.originalText.slice(locStart(node), locEnd(node));
  34710. }
  34711. case "tableRow":
  34712. case "listItem":
  34713. default:
  34714. throw new Error(`Unknown markdown type ${JSON.stringify(node.type)}`);
  34715. }
  34716. }
  34717. function printListItem(path, options, print, listPrefix) {
  34718. const node = path.getValue();
  34719. const prefix = node.checked === null ? "" : node.checked ? "[x] " : "[ ] ";
  34720. return [prefix, printChildren(path, options, print, {
  34721. processor: (childPath, index) => {
  34722. if (index === 0 && childPath.getValue().type !== "list") {
  34723. return align(" ".repeat(prefix.length), print());
  34724. }
  34725. const alignment = " ".repeat(clamp(options.tabWidth - listPrefix.length, 0, 3));
  34726. return [alignment, align(alignment, print())];
  34727. }
  34728. })];
  34729. }
  34730. function alignListPrefix(prefix, options) {
  34731. const additionalSpaces = getAdditionalSpaces();
  34732. return prefix + " ".repeat(additionalSpaces >= 4 ? 0 : additionalSpaces);
  34733. function getAdditionalSpaces() {
  34734. const restSpaces = prefix.length % options.tabWidth;
  34735. return restSpaces === 0 ? 0 : options.tabWidth - restSpaces;
  34736. }
  34737. }
  34738. function getNthListSiblingIndex(node, parentNode) {
  34739. return getNthSiblingIndex(node, parentNode, (siblingNode) => siblingNode.ordered === node.ordered);
  34740. }
  34741. function getNthSiblingIndex(node, parentNode, condition) {
  34742. let index = -1;
  34743. for (const childNode of parentNode.children) {
  34744. if (childNode.type === node.type && condition(childNode)) {
  34745. index++;
  34746. } else {
  34747. index = -1;
  34748. }
  34749. if (childNode === node) {
  34750. return index;
  34751. }
  34752. }
  34753. }
  34754. function getAncestorCounter(path, typeOrTypes) {
  34755. const types = Array.isArray(typeOrTypes) ? typeOrTypes : [typeOrTypes];
  34756. let counter = -1;
  34757. let ancestorNode;
  34758. while (ancestorNode = path.getParentNode(++counter)) {
  34759. if (types.includes(ancestorNode.type)) {
  34760. return counter;
  34761. }
  34762. }
  34763. return -1;
  34764. }
  34765. function getAncestorNode(path, typeOrTypes) {
  34766. const counter = getAncestorCounter(path, typeOrTypes);
  34767. return counter === -1 ? null : path.getParentNode(counter);
  34768. }
  34769. function printLine(path, value, options) {
  34770. if (options.proseWrap === "preserve" && value === "\n") {
  34771. return hardline;
  34772. }
  34773. const isBreakable = options.proseWrap === "always" && !getAncestorNode(path, SINGLE_LINE_NODE_TYPES);
  34774. return value !== "" ? isBreakable ? line : " " : isBreakable ? softline : "";
  34775. }
  34776. function printTable(path, options, print) {
  34777. const node = path.getValue();
  34778. const columnMaxWidths = [];
  34779. const contents = path.map((rowPath) => rowPath.map((cellPath, columnIndex) => {
  34780. const text = printDocToString(print(), options).formatted;
  34781. const width = getStringWidth(text);
  34782. columnMaxWidths[columnIndex] = Math.max(columnMaxWidths[columnIndex] || 3, width);
  34783. return {
  34784. text,
  34785. width
  34786. };
  34787. }, "children"), "children");
  34788. const alignedTable = printTableContents(false);
  34789. if (options.proseWrap !== "never") {
  34790. return [breakParent, alignedTable];
  34791. }
  34792. const compactTable = printTableContents(true);
  34793. return [breakParent, group(ifBreak(compactTable, alignedTable))];
  34794. function printTableContents(isCompact) {
  34795. const parts = [printRow(contents[0], isCompact), printAlign(isCompact)];
  34796. if (contents.length > 1) {
  34797. parts.push(join(hardlineWithoutBreakParent, contents.slice(1).map((rowContents) => printRow(rowContents, isCompact))));
  34798. }
  34799. return join(hardlineWithoutBreakParent, parts);
  34800. }
  34801. function printAlign(isCompact) {
  34802. const align2 = columnMaxWidths.map((width, index) => {
  34803. const align3 = node.align[index];
  34804. const first = align3 === "center" || align3 === "left" ? ":" : "-";
  34805. const last = align3 === "center" || align3 === "right" ? ":" : "-";
  34806. const middle = isCompact ? "-" : "-".repeat(width - 2);
  34807. return `${first}${middle}${last}`;
  34808. });
  34809. return `| ${align2.join(" | ")} |`;
  34810. }
  34811. function printRow(rowContents, isCompact) {
  34812. const columns = rowContents.map(({
  34813. text,
  34814. width
  34815. }, columnIndex) => {
  34816. if (isCompact) {
  34817. return text;
  34818. }
  34819. const spaces = columnMaxWidths[columnIndex] - width;
  34820. const align2 = node.align[columnIndex];
  34821. let before = 0;
  34822. if (align2 === "right") {
  34823. before = spaces;
  34824. } else if (align2 === "center") {
  34825. before = Math.floor(spaces / 2);
  34826. }
  34827. const after = spaces - before;
  34828. return `${" ".repeat(before)}${text}${" ".repeat(after)}`;
  34829. });
  34830. return `| ${columns.join(" | ")} |`;
  34831. }
  34832. }
  34833. function printRoot(path, options, print) {
  34834. const ignoreRanges = [];
  34835. let ignoreStart = null;
  34836. const {
  34837. children
  34838. } = path.getValue();
  34839. for (const [index, childNode] of children.entries()) {
  34840. switch (isPrettierIgnore(childNode)) {
  34841. case "start":
  34842. if (ignoreStart === null) {
  34843. ignoreStart = {
  34844. index,
  34845. offset: childNode.position.end.offset
  34846. };
  34847. }
  34848. break;
  34849. case "end":
  34850. if (ignoreStart !== null) {
  34851. ignoreRanges.push({
  34852. start: ignoreStart,
  34853. end: {
  34854. index,
  34855. offset: childNode.position.start.offset
  34856. }
  34857. });
  34858. ignoreStart = null;
  34859. }
  34860. break;
  34861. default:
  34862. break;
  34863. }
  34864. }
  34865. return printChildren(path, options, print, {
  34866. processor: (childPath, index) => {
  34867. if (ignoreRanges.length > 0) {
  34868. const ignoreRange = ignoreRanges[0];
  34869. if (index === ignoreRange.start.index) {
  34870. return [children[ignoreRange.start.index].value, options.originalText.slice(ignoreRange.start.offset, ignoreRange.end.offset), children[ignoreRange.end.index].value];
  34871. }
  34872. if (ignoreRange.start.index < index && index < ignoreRange.end.index) {
  34873. return false;
  34874. }
  34875. if (index === ignoreRange.end.index) {
  34876. ignoreRanges.shift();
  34877. return false;
  34878. }
  34879. }
  34880. return print();
  34881. }
  34882. });
  34883. }
  34884. function printChildren(path, options, print, events = {}) {
  34885. const {
  34886. postprocessor
  34887. } = events;
  34888. const processor = events.processor || (() => print());
  34889. const node = path.getValue();
  34890. const parts = [];
  34891. let lastChildNode;
  34892. path.each((childPath, index) => {
  34893. const childNode = childPath.getValue();
  34894. const result = processor(childPath, index);
  34895. if (result !== false) {
  34896. const data = {
  34897. parts,
  34898. prevNode: lastChildNode,
  34899. parentNode: node,
  34900. options
  34901. };
  34902. if (shouldPrePrintHardline(childNode, data)) {
  34903. parts.push(hardline);
  34904. if (lastChildNode && TRAILING_HARDLINE_NODES.has(lastChildNode.type)) {
  34905. if (shouldPrePrintTripleHardline(childNode, data)) {
  34906. parts.push(hardline);
  34907. }
  34908. } else {
  34909. if (shouldPrePrintDoubleHardline(childNode, data) || shouldPrePrintTripleHardline(childNode, data)) {
  34910. parts.push(hardline);
  34911. }
  34912. if (shouldPrePrintTripleHardline(childNode, data)) {
  34913. parts.push(hardline);
  34914. }
  34915. }
  34916. }
  34917. parts.push(result);
  34918. lastChildNode = childNode;
  34919. }
  34920. }, "children");
  34921. return postprocessor ? postprocessor(parts) : parts;
  34922. }
  34923. function getLastDescendantNode(node) {
  34924. let current = node;
  34925. while (isNonEmptyArray(current.children)) {
  34926. current = getLast(current.children);
  34927. }
  34928. return current;
  34929. }
  34930. function isPrettierIgnore(node) {
  34931. let match;
  34932. if (node.type === "html") {
  34933. match = node.value.match(/^<!--\s*prettier-ignore(?:-(start|end))?\s*-->$/);
  34934. } else {
  34935. let comment;
  34936. if (node.type === "esComment") {
  34937. comment = node;
  34938. } else if (node.type === "paragraph" && node.children.length === 1 && node.children[0].type === "esComment") {
  34939. comment = node.children[0];
  34940. }
  34941. if (comment) {
  34942. match = comment.value.match(/^prettier-ignore(?:-(start|end))?$/);
  34943. }
  34944. }
  34945. return match ? match[1] ? match[1] : "next" : false;
  34946. }
  34947. function shouldPrePrintHardline(node, data) {
  34948. const isFirstNode = data.parts.length === 0;
  34949. const isInlineNode = INLINE_NODE_TYPES.includes(node.type);
  34950. const isInlineHTML = node.type === "html" && INLINE_NODE_WRAPPER_TYPES.includes(data.parentNode.type);
  34951. return !isFirstNode && !isInlineNode && !isInlineHTML;
  34952. }
  34953. function shouldPrePrintDoubleHardline(node, data) {
  34954. const isSequence = (data.prevNode && data.prevNode.type) === node.type;
  34955. const isSiblingNode = isSequence && SIBLING_NODE_TYPES.has(node.type);
  34956. const isInTightListItem = data.parentNode.type === "listItem" && !data.parentNode.loose;
  34957. const isPrevNodeLooseListItem = data.prevNode && data.prevNode.type === "listItem" && data.prevNode.loose;
  34958. const isPrevNodePrettierIgnore = isPrettierIgnore(data.prevNode) === "next";
  34959. const isBlockHtmlWithoutBlankLineBetweenPrevHtml = node.type === "html" && data.prevNode && data.prevNode.type === "html" && data.prevNode.position.end.line + 1 === node.position.start.line;
  34960. const isHtmlDirectAfterListItem = node.type === "html" && data.parentNode.type === "listItem" && data.prevNode && data.prevNode.type === "paragraph" && data.prevNode.position.end.line + 1 === node.position.start.line;
  34961. return isPrevNodeLooseListItem || !(isSiblingNode || isInTightListItem || isPrevNodePrettierIgnore || isBlockHtmlWithoutBlankLineBetweenPrevHtml || isHtmlDirectAfterListItem);
  34962. }
  34963. function shouldPrePrintTripleHardline(node, data) {
  34964. const isPrevNodeList = data.prevNode && data.prevNode.type === "list";
  34965. const isIndentedCode = node.type === "code" && node.isIndented;
  34966. return isPrevNodeList && isIndentedCode;
  34967. }
  34968. function shouldRemainTheSameContent(path) {
  34969. const ancestorNode = getAncestorNode(path, ["linkReference", "imageReference"]);
  34970. return ancestorNode && (ancestorNode.type !== "linkReference" || ancestorNode.referenceType !== "full");
  34971. }
  34972. function printUrl(url, dangerousCharOrChars = []) {
  34973. const dangerousChars = [" ", ...Array.isArray(dangerousCharOrChars) ? dangerousCharOrChars : [dangerousCharOrChars]];
  34974. return new RegExp(dangerousChars.map((x) => `\\${x}`).join("|")).test(url) ? `<${url}>` : url;
  34975. }
  34976. function printTitle(title, options, printSpace = true) {
  34977. if (!title) {
  34978. return "";
  34979. }
  34980. if (printSpace) {
  34981. return " " + printTitle(title, options, false);
  34982. }
  34983. title = title.replace(/\\(["')])/g, "$1");
  34984. if (title.includes('"') && title.includes("'") && !title.includes(")")) {
  34985. return `(${title})`;
  34986. }
  34987. const singleCount = title.split("'").length - 1;
  34988. const doubleCount = title.split('"').length - 1;
  34989. const quote = singleCount > doubleCount ? '"' : doubleCount > singleCount ? "'" : options.singleQuote ? "'" : '"';
  34990. title = title.replace(/\\/, "\\\\");
  34991. title = title.replace(new RegExp(`(${quote})`, "g"), "\\$1");
  34992. return `${quote}${title}${quote}`;
  34993. }
  34994. function clamp(value, min, max) {
  34995. return value < min ? min : value > max ? max : value;
  34996. }
  34997. function hasPrettierIgnore(path) {
  34998. const index = Number(path.getName());
  34999. if (index === 0) {
  35000. return false;
  35001. }
  35002. const prevNode = path.getParentNode().children[index - 1];
  35003. return isPrettierIgnore(prevNode) === "next";
  35004. }
  35005. module2.exports = {
  35006. preprocess,
  35007. print: genericPrint,
  35008. embed,
  35009. massageAstNode: clean,
  35010. hasPrettierIgnore,
  35011. insertPragma
  35012. };
  35013. }
  35014. });
  35015. var require_options5 = __commonJS2({
  35016. "src/language-markdown/options.js"(exports2, module2) {
  35017. "use strict";
  35018. var commonOptions = require_common_options();
  35019. module2.exports = {
  35020. proseWrap: commonOptions.proseWrap,
  35021. singleQuote: commonOptions.singleQuote
  35022. };
  35023. }
  35024. });
  35025. var require_parsers5 = __commonJS2({
  35026. "src/language-markdown/parsers.js"(exports2, module2) {
  35027. "use strict";
  35028. module2.exports = {
  35029. get remark() {
  35030. return require("./parser-markdown.js").parsers.remark;
  35031. },
  35032. get markdown() {
  35033. return require("./parser-markdown.js").parsers.remark;
  35034. },
  35035. get mdx() {
  35036. return require("./parser-markdown.js").parsers.mdx;
  35037. }
  35038. };
  35039. }
  35040. });
  35041. var require_Markdown = __commonJS2({
  35042. "node_modules/linguist-languages/data/Markdown.json"(exports2, module2) {
  35043. module2.exports = {
  35044. name: "Markdown",
  35045. type: "prose",
  35046. color: "#083fa1",
  35047. aliases: ["pandoc"],
  35048. aceMode: "markdown",
  35049. codemirrorMode: "gfm",
  35050. codemirrorMimeType: "text/x-gfm",
  35051. wrap: true,
  35052. extensions: [".md", ".markdown", ".mdown", ".mdwn", ".mdx", ".mkd", ".mkdn", ".mkdown", ".ronn", ".scd", ".workbook"],
  35053. filenames: ["contents.lr"],
  35054. tmScope: "source.gfm",
  35055. languageId: 222
  35056. };
  35057. }
  35058. });
  35059. var require_language_markdown = __commonJS2({
  35060. "src/language-markdown/index.js"(exports2, module2) {
  35061. "use strict";
  35062. var createLanguage = require_create_language();
  35063. var printer = require_printer_markdown();
  35064. var options = require_options5();
  35065. var parsers = require_parsers5();
  35066. var languages = [createLanguage(require_Markdown(), (data) => ({
  35067. since: "1.8.0",
  35068. parsers: ["markdown"],
  35069. vscodeLanguageIds: ["markdown"],
  35070. filenames: [...data.filenames, "README"],
  35071. extensions: data.extensions.filter((extension) => extension !== ".mdx")
  35072. })), createLanguage(require_Markdown(), () => ({
  35073. name: "MDX",
  35074. since: "1.15.0",
  35075. parsers: ["mdx"],
  35076. vscodeLanguageIds: ["mdx"],
  35077. filenames: [],
  35078. extensions: [".mdx"]
  35079. }))];
  35080. var printers = {
  35081. mdast: printer
  35082. };
  35083. module2.exports = {
  35084. languages,
  35085. options,
  35086. printers,
  35087. parsers
  35088. };
  35089. }
  35090. });
  35091. var require_clean5 = __commonJS2({
  35092. "src/language-html/clean.js"(exports2, module2) {
  35093. "use strict";
  35094. var {
  35095. isFrontMatterNode
  35096. } = require_util();
  35097. var ignoredProperties = /* @__PURE__ */ new Set(["sourceSpan", "startSourceSpan", "endSourceSpan", "nameSpan", "valueSpan", "parent"]);
  35098. function clean(ast, newNode) {
  35099. if (ast.type === "text" || ast.type === "comment") {
  35100. return null;
  35101. }
  35102. if (isFrontMatterNode(ast) || ast.type === "yaml" || ast.type === "toml") {
  35103. return null;
  35104. }
  35105. if (ast.type === "attribute") {
  35106. delete newNode.value;
  35107. }
  35108. if (ast.type === "docType") {
  35109. delete newNode.value;
  35110. }
  35111. }
  35112. clean.ignoredProperties = ignoredProperties;
  35113. module2.exports = clean;
  35114. }
  35115. });
  35116. var require_constants_evaluate2 = __commonJS2({
  35117. "src/language-html/constants.evaluate.js"(exports2, module2) {
  35118. module2.exports = {
  35119. CSS_DISPLAY_TAGS: {
  35120. area: "none",
  35121. base: "none",
  35122. basefont: "none",
  35123. datalist: "none",
  35124. head: "none",
  35125. link: "none",
  35126. meta: "none",
  35127. noembed: "none",
  35128. noframes: "none",
  35129. param: "block",
  35130. rp: "none",
  35131. script: "block",
  35132. source: "block",
  35133. style: "none",
  35134. template: "inline",
  35135. track: "block",
  35136. title: "none",
  35137. html: "block",
  35138. body: "block",
  35139. address: "block",
  35140. blockquote: "block",
  35141. center: "block",
  35142. div: "block",
  35143. figure: "block",
  35144. figcaption: "block",
  35145. footer: "block",
  35146. form: "block",
  35147. header: "block",
  35148. hr: "block",
  35149. legend: "block",
  35150. listing: "block",
  35151. main: "block",
  35152. p: "block",
  35153. plaintext: "block",
  35154. pre: "block",
  35155. xmp: "block",
  35156. slot: "contents",
  35157. ruby: "ruby",
  35158. rt: "ruby-text",
  35159. article: "block",
  35160. aside: "block",
  35161. h1: "block",
  35162. h2: "block",
  35163. h3: "block",
  35164. h4: "block",
  35165. h5: "block",
  35166. h6: "block",
  35167. hgroup: "block",
  35168. nav: "block",
  35169. section: "block",
  35170. dir: "block",
  35171. dd: "block",
  35172. dl: "block",
  35173. dt: "block",
  35174. ol: "block",
  35175. ul: "block",
  35176. li: "list-item",
  35177. table: "table",
  35178. caption: "table-caption",
  35179. colgroup: "table-column-group",
  35180. col: "table-column",
  35181. thead: "table-header-group",
  35182. tbody: "table-row-group",
  35183. tfoot: "table-footer-group",
  35184. tr: "table-row",
  35185. td: "table-cell",
  35186. th: "table-cell",
  35187. fieldset: "block",
  35188. button: "inline-block",
  35189. details: "block",
  35190. summary: "block",
  35191. dialog: "block",
  35192. meter: "inline-block",
  35193. progress: "inline-block",
  35194. object: "inline-block",
  35195. video: "inline-block",
  35196. audio: "inline-block",
  35197. select: "inline-block",
  35198. option: "block",
  35199. optgroup: "block"
  35200. },
  35201. CSS_DISPLAY_DEFAULT: "inline",
  35202. CSS_WHITE_SPACE_TAGS: {
  35203. listing: "pre",
  35204. plaintext: "pre",
  35205. pre: "pre",
  35206. xmp: "pre",
  35207. nobr: "nowrap",
  35208. table: "initial",
  35209. textarea: "pre-wrap"
  35210. },
  35211. CSS_WHITE_SPACE_DEFAULT: "normal"
  35212. };
  35213. }
  35214. });
  35215. var require_is_unknown_namespace = __commonJS2({
  35216. "src/language-html/utils/is-unknown-namespace.js"(exports2, module2) {
  35217. "use strict";
  35218. function isUnknownNamespace(node) {
  35219. return node.type === "element" && !node.hasExplicitNamespace && !["html", "svg"].includes(node.namespace);
  35220. }
  35221. module2.exports = isUnknownNamespace;
  35222. }
  35223. });
  35224. var require_utils11 = __commonJS2({
  35225. "src/language-html/utils/index.js"(exports2, module2) {
  35226. "use strict";
  35227. var {
  35228. inferParserByLanguage,
  35229. isFrontMatterNode
  35230. } = require_util();
  35231. var {
  35232. builders: {
  35233. line,
  35234. hardline,
  35235. join
  35236. },
  35237. utils: {
  35238. getDocParts,
  35239. replaceTextEndOfLine
  35240. }
  35241. } = require("./doc.js");
  35242. var {
  35243. CSS_DISPLAY_TAGS,
  35244. CSS_DISPLAY_DEFAULT,
  35245. CSS_WHITE_SPACE_TAGS,
  35246. CSS_WHITE_SPACE_DEFAULT
  35247. } = require_constants_evaluate2();
  35248. var isUnknownNamespace = require_is_unknown_namespace();
  35249. var HTML_WHITESPACE = /* @__PURE__ */ new Set([" ", "\n", "\f", "\r", " "]);
  35250. var htmlTrimStart = (string) => string.replace(/^[\t\n\f\r ]+/, "");
  35251. var htmlTrimEnd = (string) => string.replace(/[\t\n\f\r ]+$/, "");
  35252. var htmlTrim = (string) => htmlTrimStart(htmlTrimEnd(string));
  35253. var htmlTrimLeadingBlankLines = (string) => string.replace(/^[\t\f\r ]*\n/g, "");
  35254. var htmlTrimPreserveIndentation = (string) => htmlTrimLeadingBlankLines(htmlTrimEnd(string));
  35255. var splitByHtmlWhitespace = (string) => string.split(/[\t\n\f\r ]+/);
  35256. var getLeadingHtmlWhitespace = (string) => string.match(/^[\t\n\f\r ]*/)[0];
  35257. var getLeadingAndTrailingHtmlWhitespace = (string) => {
  35258. const [, leadingWhitespace, text, trailingWhitespace] = string.match(/^([\t\n\f\r ]*)(.*?)([\t\n\f\r ]*)$/s);
  35259. return {
  35260. leadingWhitespace,
  35261. trailingWhitespace,
  35262. text
  35263. };
  35264. };
  35265. var hasHtmlWhitespace = (string) => /[\t\n\f\r ]/.test(string);
  35266. function shouldPreserveContent(node, options) {
  35267. if (node.type === "ieConditionalComment" && node.lastChild && !node.lastChild.isSelfClosing && !node.lastChild.endSourceSpan) {
  35268. return true;
  35269. }
  35270. if (node.type === "ieConditionalComment" && !node.complete) {
  35271. return true;
  35272. }
  35273. if (isPreLikeNode(node) && node.children.some((child) => child.type !== "text" && child.type !== "interpolation")) {
  35274. return true;
  35275. }
  35276. if (isVueNonHtmlBlock(node, options) && !isScriptLikeTag(node) && node.type !== "interpolation") {
  35277. return true;
  35278. }
  35279. return false;
  35280. }
  35281. function hasPrettierIgnore(node) {
  35282. if (node.type === "attribute") {
  35283. return false;
  35284. }
  35285. if (!node.parent) {
  35286. return false;
  35287. }
  35288. if (!node.prev) {
  35289. return false;
  35290. }
  35291. return isPrettierIgnore(node.prev);
  35292. }
  35293. function isPrettierIgnore(node) {
  35294. return node.type === "comment" && node.value.trim() === "prettier-ignore";
  35295. }
  35296. function isTextLikeNode(node) {
  35297. return node.type === "text" || node.type === "comment";
  35298. }
  35299. function isScriptLikeTag(node) {
  35300. return node.type === "element" && (node.fullName === "script" || node.fullName === "style" || node.fullName === "svg:style" || isUnknownNamespace(node) && (node.name === "script" || node.name === "style"));
  35301. }
  35302. function canHaveInterpolation(node) {
  35303. return node.children && !isScriptLikeTag(node);
  35304. }
  35305. function isWhitespaceSensitiveNode(node) {
  35306. return isScriptLikeTag(node) || node.type === "interpolation" || isIndentationSensitiveNode(node);
  35307. }
  35308. function isIndentationSensitiveNode(node) {
  35309. return getNodeCssStyleWhiteSpace(node).startsWith("pre");
  35310. }
  35311. function isLeadingSpaceSensitiveNode(node, options) {
  35312. const isLeadingSpaceSensitive = _isLeadingSpaceSensitiveNode();
  35313. if (isLeadingSpaceSensitive && !node.prev && node.parent && node.parent.tagDefinition && node.parent.tagDefinition.ignoreFirstLf) {
  35314. return node.type === "interpolation";
  35315. }
  35316. return isLeadingSpaceSensitive;
  35317. function _isLeadingSpaceSensitiveNode() {
  35318. if (isFrontMatterNode(node)) {
  35319. return false;
  35320. }
  35321. if ((node.type === "text" || node.type === "interpolation") && node.prev && (node.prev.type === "text" || node.prev.type === "interpolation")) {
  35322. return true;
  35323. }
  35324. if (!node.parent || node.parent.cssDisplay === "none") {
  35325. return false;
  35326. }
  35327. if (isPreLikeNode(node.parent)) {
  35328. return true;
  35329. }
  35330. if (!node.prev && (node.parent.type === "root" || isPreLikeNode(node) && node.parent || isScriptLikeTag(node.parent) || isVueCustomBlock(node.parent, options) || !isFirstChildLeadingSpaceSensitiveCssDisplay(node.parent.cssDisplay))) {
  35331. return false;
  35332. }
  35333. if (node.prev && !isNextLeadingSpaceSensitiveCssDisplay(node.prev.cssDisplay)) {
  35334. return false;
  35335. }
  35336. return true;
  35337. }
  35338. }
  35339. function isTrailingSpaceSensitiveNode(node, options) {
  35340. if (isFrontMatterNode(node)) {
  35341. return false;
  35342. }
  35343. if ((node.type === "text" || node.type === "interpolation") && node.next && (node.next.type === "text" || node.next.type === "interpolation")) {
  35344. return true;
  35345. }
  35346. if (!node.parent || node.parent.cssDisplay === "none") {
  35347. return false;
  35348. }
  35349. if (isPreLikeNode(node.parent)) {
  35350. return true;
  35351. }
  35352. if (!node.next && (node.parent.type === "root" || isPreLikeNode(node) && node.parent || isScriptLikeTag(node.parent) || isVueCustomBlock(node.parent, options) || !isLastChildTrailingSpaceSensitiveCssDisplay(node.parent.cssDisplay))) {
  35353. return false;
  35354. }
  35355. if (node.next && !isPrevTrailingSpaceSensitiveCssDisplay(node.next.cssDisplay)) {
  35356. return false;
  35357. }
  35358. return true;
  35359. }
  35360. function isDanglingSpaceSensitiveNode(node) {
  35361. return isDanglingSpaceSensitiveCssDisplay(node.cssDisplay) && !isScriptLikeTag(node);
  35362. }
  35363. function forceNextEmptyLine(node) {
  35364. return isFrontMatterNode(node) || node.next && node.sourceSpan.end && node.sourceSpan.end.line + 1 < node.next.sourceSpan.start.line;
  35365. }
  35366. function forceBreakContent(node) {
  35367. return forceBreakChildren(node) || node.type === "element" && node.children.length > 0 && (["body", "script", "style"].includes(node.name) || node.children.some((child) => hasNonTextChild(child))) || node.firstChild && node.firstChild === node.lastChild && node.firstChild.type !== "text" && hasLeadingLineBreak(node.firstChild) && (!node.lastChild.isTrailingSpaceSensitive || hasTrailingLineBreak(node.lastChild));
  35368. }
  35369. function forceBreakChildren(node) {
  35370. return node.type === "element" && node.children.length > 0 && (["html", "head", "ul", "ol", "select"].includes(node.name) || node.cssDisplay.startsWith("table") && node.cssDisplay !== "table-cell");
  35371. }
  35372. function preferHardlineAsLeadingSpaces(node) {
  35373. return preferHardlineAsSurroundingSpaces(node) || node.prev && preferHardlineAsTrailingSpaces(node.prev) || hasSurroundingLineBreak(node);
  35374. }
  35375. function preferHardlineAsTrailingSpaces(node) {
  35376. return preferHardlineAsSurroundingSpaces(node) || node.type === "element" && node.fullName === "br" || hasSurroundingLineBreak(node);
  35377. }
  35378. function hasSurroundingLineBreak(node) {
  35379. return hasLeadingLineBreak(node) && hasTrailingLineBreak(node);
  35380. }
  35381. function hasLeadingLineBreak(node) {
  35382. return node.hasLeadingSpaces && (node.prev ? node.prev.sourceSpan.end.line < node.sourceSpan.start.line : node.parent.type === "root" || node.parent.startSourceSpan.end.line < node.sourceSpan.start.line);
  35383. }
  35384. function hasTrailingLineBreak(node) {
  35385. return node.hasTrailingSpaces && (node.next ? node.next.sourceSpan.start.line > node.sourceSpan.end.line : node.parent.type === "root" || node.parent.endSourceSpan && node.parent.endSourceSpan.start.line > node.sourceSpan.end.line);
  35386. }
  35387. function preferHardlineAsSurroundingSpaces(node) {
  35388. switch (node.type) {
  35389. case "ieConditionalComment":
  35390. case "comment":
  35391. case "directive":
  35392. return true;
  35393. case "element":
  35394. return ["script", "select"].includes(node.name);
  35395. }
  35396. return false;
  35397. }
  35398. function getLastDescendant(node) {
  35399. return node.lastChild ? getLastDescendant(node.lastChild) : node;
  35400. }
  35401. function hasNonTextChild(node) {
  35402. return node.children && node.children.some((child) => child.type !== "text");
  35403. }
  35404. function _inferScriptParser(node) {
  35405. const {
  35406. type,
  35407. lang
  35408. } = node.attrMap;
  35409. if (type === "module" || type === "text/javascript" || type === "text/babel" || type === "application/javascript" || lang === "jsx") {
  35410. return "babel";
  35411. }
  35412. if (type === "application/x-typescript" || lang === "ts" || lang === "tsx") {
  35413. return "typescript";
  35414. }
  35415. if (type === "text/markdown") {
  35416. return "markdown";
  35417. }
  35418. if (type === "text/html") {
  35419. return "html";
  35420. }
  35421. if (type && (type.endsWith("json") || type.endsWith("importmap"))) {
  35422. return "json";
  35423. }
  35424. if (type === "text/x-handlebars-template") {
  35425. return "glimmer";
  35426. }
  35427. }
  35428. function inferStyleParser(node) {
  35429. const {
  35430. lang
  35431. } = node.attrMap;
  35432. if (!lang || lang === "postcss" || lang === "css") {
  35433. return "css";
  35434. }
  35435. if (lang === "scss") {
  35436. return "scss";
  35437. }
  35438. if (lang === "less") {
  35439. return "less";
  35440. }
  35441. }
  35442. function inferScriptParser(node, options) {
  35443. if (node.name === "script" && !node.attrMap.src) {
  35444. if (!node.attrMap.lang && !node.attrMap.type) {
  35445. return "babel";
  35446. }
  35447. return _inferScriptParser(node);
  35448. }
  35449. if (node.name === "style") {
  35450. return inferStyleParser(node);
  35451. }
  35452. if (options && isVueNonHtmlBlock(node, options)) {
  35453. return _inferScriptParser(node) || !("src" in node.attrMap) && inferParserByLanguage(node.attrMap.lang, options);
  35454. }
  35455. }
  35456. function isBlockLikeCssDisplay(cssDisplay) {
  35457. return cssDisplay === "block" || cssDisplay === "list-item" || cssDisplay.startsWith("table");
  35458. }
  35459. function isFirstChildLeadingSpaceSensitiveCssDisplay(cssDisplay) {
  35460. return !isBlockLikeCssDisplay(cssDisplay) && cssDisplay !== "inline-block";
  35461. }
  35462. function isLastChildTrailingSpaceSensitiveCssDisplay(cssDisplay) {
  35463. return !isBlockLikeCssDisplay(cssDisplay) && cssDisplay !== "inline-block";
  35464. }
  35465. function isPrevTrailingSpaceSensitiveCssDisplay(cssDisplay) {
  35466. return !isBlockLikeCssDisplay(cssDisplay);
  35467. }
  35468. function isNextLeadingSpaceSensitiveCssDisplay(cssDisplay) {
  35469. return !isBlockLikeCssDisplay(cssDisplay);
  35470. }
  35471. function isDanglingSpaceSensitiveCssDisplay(cssDisplay) {
  35472. return !isBlockLikeCssDisplay(cssDisplay) && cssDisplay !== "inline-block";
  35473. }
  35474. function isPreLikeNode(node) {
  35475. return getNodeCssStyleWhiteSpace(node).startsWith("pre");
  35476. }
  35477. function countParents(path, predicate) {
  35478. let counter = 0;
  35479. for (let i = path.stack.length - 1; i >= 0; i--) {
  35480. const value = path.stack[i];
  35481. if (value && typeof value === "object" && !Array.isArray(value) && predicate(value)) {
  35482. counter++;
  35483. }
  35484. }
  35485. return counter;
  35486. }
  35487. function hasParent(node, fn) {
  35488. let current = node;
  35489. while (current) {
  35490. if (fn(current)) {
  35491. return true;
  35492. }
  35493. current = current.parent;
  35494. }
  35495. return false;
  35496. }
  35497. function getNodeCssStyleDisplay(node, options) {
  35498. if (node.prev && node.prev.type === "comment") {
  35499. const match = node.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/);
  35500. if (match) {
  35501. return match[1];
  35502. }
  35503. }
  35504. let isInSvgForeignObject = false;
  35505. if (node.type === "element" && node.namespace === "svg") {
  35506. if (hasParent(node, (parent) => parent.fullName === "svg:foreignObject")) {
  35507. isInSvgForeignObject = true;
  35508. } else {
  35509. return node.name === "svg" ? "inline-block" : "block";
  35510. }
  35511. }
  35512. switch (options.htmlWhitespaceSensitivity) {
  35513. case "strict":
  35514. return "inline";
  35515. case "ignore":
  35516. return "block";
  35517. default: {
  35518. if (options.parser === "vue" && node.parent && node.parent.type === "root") {
  35519. return "block";
  35520. }
  35521. return node.type === "element" && (!node.namespace || isInSvgForeignObject || isUnknownNamespace(node)) && CSS_DISPLAY_TAGS[node.name] || CSS_DISPLAY_DEFAULT;
  35522. }
  35523. }
  35524. }
  35525. function getNodeCssStyleWhiteSpace(node) {
  35526. return node.type === "element" && (!node.namespace || isUnknownNamespace(node)) && CSS_WHITE_SPACE_TAGS[node.name] || CSS_WHITE_SPACE_DEFAULT;
  35527. }
  35528. function getMinIndentation(text) {
  35529. let minIndentation = Number.POSITIVE_INFINITY;
  35530. for (const lineText of text.split("\n")) {
  35531. if (lineText.length === 0) {
  35532. continue;
  35533. }
  35534. if (!HTML_WHITESPACE.has(lineText[0])) {
  35535. return 0;
  35536. }
  35537. const indentation = getLeadingHtmlWhitespace(lineText).length;
  35538. if (lineText.length === indentation) {
  35539. continue;
  35540. }
  35541. if (indentation < minIndentation) {
  35542. minIndentation = indentation;
  35543. }
  35544. }
  35545. return minIndentation === Number.POSITIVE_INFINITY ? 0 : minIndentation;
  35546. }
  35547. function dedentString(text, minIndent = getMinIndentation(text)) {
  35548. return minIndent === 0 ? text : text.split("\n").map((lineText) => lineText.slice(minIndent)).join("\n");
  35549. }
  35550. function countChars(text, char) {
  35551. let counter = 0;
  35552. for (let i = 0; i < text.length; i++) {
  35553. if (text[i] === char) {
  35554. counter++;
  35555. }
  35556. }
  35557. return counter;
  35558. }
  35559. function unescapeQuoteEntities(text) {
  35560. return text.replace(/&apos;/g, "'").replace(/&quot;/g, '"');
  35561. }
  35562. var vueRootElementsSet = /* @__PURE__ */ new Set(["template", "style", "script"]);
  35563. function isVueCustomBlock(node, options) {
  35564. return isVueSfcBlock(node, options) && !vueRootElementsSet.has(node.fullName);
  35565. }
  35566. function isVueSfcBlock(node, options) {
  35567. return options.parser === "vue" && node.type === "element" && node.parent.type === "root" && node.fullName.toLowerCase() !== "html";
  35568. }
  35569. function isVueNonHtmlBlock(node, options) {
  35570. return isVueSfcBlock(node, options) && (isVueCustomBlock(node, options) || node.attrMap.lang && node.attrMap.lang !== "html");
  35571. }
  35572. function isVueSlotAttribute(attribute) {
  35573. const attributeName = attribute.fullName;
  35574. return attributeName.charAt(0) === "#" || attributeName === "slot-scope" || attributeName === "v-slot" || attributeName.startsWith("v-slot:");
  35575. }
  35576. function isVueSfcBindingsAttribute(attribute, options) {
  35577. const element = attribute.parent;
  35578. if (!isVueSfcBlock(element, options)) {
  35579. return false;
  35580. }
  35581. const tagName = element.fullName;
  35582. const attributeName = attribute.fullName;
  35583. return tagName === "script" && attributeName === "setup" || tagName === "style" && attributeName === "vars";
  35584. }
  35585. function getTextValueParts(node, value = node.value) {
  35586. return node.parent.isWhitespaceSensitive ? node.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(join(line, splitByHtmlWhitespace(value)));
  35587. }
  35588. module2.exports = {
  35589. htmlTrim,
  35590. htmlTrimPreserveIndentation,
  35591. hasHtmlWhitespace,
  35592. getLeadingAndTrailingHtmlWhitespace,
  35593. canHaveInterpolation,
  35594. countChars,
  35595. countParents,
  35596. dedentString,
  35597. forceBreakChildren,
  35598. forceBreakContent,
  35599. forceNextEmptyLine,
  35600. getLastDescendant,
  35601. getNodeCssStyleDisplay,
  35602. getNodeCssStyleWhiteSpace,
  35603. hasPrettierIgnore,
  35604. inferScriptParser,
  35605. isVueCustomBlock,
  35606. isVueNonHtmlBlock,
  35607. isVueSlotAttribute,
  35608. isVueSfcBindingsAttribute,
  35609. isDanglingSpaceSensitiveNode,
  35610. isIndentationSensitiveNode,
  35611. isLeadingSpaceSensitiveNode,
  35612. isPreLikeNode,
  35613. isScriptLikeTag,
  35614. isTextLikeNode,
  35615. isTrailingSpaceSensitiveNode,
  35616. isWhitespaceSensitiveNode,
  35617. isUnknownNamespace,
  35618. preferHardlineAsLeadingSpaces,
  35619. preferHardlineAsTrailingSpaces,
  35620. shouldPreserveContent,
  35621. unescapeQuoteEntities,
  35622. getTextValueParts
  35623. };
  35624. }
  35625. });
  35626. var require_chars = __commonJS2({
  35627. "node_modules/angular-html-parser/lib/compiler/src/chars.js"(exports2) {
  35628. "use strict";
  35629. Object.defineProperty(exports2, "__esModule", {
  35630. value: true
  35631. });
  35632. exports2.$EOF = 0;
  35633. exports2.$BSPACE = 8;
  35634. exports2.$TAB = 9;
  35635. exports2.$LF = 10;
  35636. exports2.$VTAB = 11;
  35637. exports2.$FF = 12;
  35638. exports2.$CR = 13;
  35639. exports2.$SPACE = 32;
  35640. exports2.$BANG = 33;
  35641. exports2.$DQ = 34;
  35642. exports2.$HASH = 35;
  35643. exports2.$$ = 36;
  35644. exports2.$PERCENT = 37;
  35645. exports2.$AMPERSAND = 38;
  35646. exports2.$SQ = 39;
  35647. exports2.$LPAREN = 40;
  35648. exports2.$RPAREN = 41;
  35649. exports2.$STAR = 42;
  35650. exports2.$PLUS = 43;
  35651. exports2.$COMMA = 44;
  35652. exports2.$MINUS = 45;
  35653. exports2.$PERIOD = 46;
  35654. exports2.$SLASH = 47;
  35655. exports2.$COLON = 58;
  35656. exports2.$SEMICOLON = 59;
  35657. exports2.$LT = 60;
  35658. exports2.$EQ = 61;
  35659. exports2.$GT = 62;
  35660. exports2.$QUESTION = 63;
  35661. exports2.$0 = 48;
  35662. exports2.$7 = 55;
  35663. exports2.$9 = 57;
  35664. exports2.$A = 65;
  35665. exports2.$E = 69;
  35666. exports2.$F = 70;
  35667. exports2.$X = 88;
  35668. exports2.$Z = 90;
  35669. exports2.$LBRACKET = 91;
  35670. exports2.$BACKSLASH = 92;
  35671. exports2.$RBRACKET = 93;
  35672. exports2.$CARET = 94;
  35673. exports2.$_ = 95;
  35674. exports2.$a = 97;
  35675. exports2.$b = 98;
  35676. exports2.$e = 101;
  35677. exports2.$f = 102;
  35678. exports2.$n = 110;
  35679. exports2.$r = 114;
  35680. exports2.$t = 116;
  35681. exports2.$u = 117;
  35682. exports2.$v = 118;
  35683. exports2.$x = 120;
  35684. exports2.$z = 122;
  35685. exports2.$LBRACE = 123;
  35686. exports2.$BAR = 124;
  35687. exports2.$RBRACE = 125;
  35688. exports2.$NBSP = 160;
  35689. exports2.$PIPE = 124;
  35690. exports2.$TILDA = 126;
  35691. exports2.$AT = 64;
  35692. exports2.$BT = 96;
  35693. function isWhitespace(code) {
  35694. return code >= exports2.$TAB && code <= exports2.$SPACE || code == exports2.$NBSP;
  35695. }
  35696. exports2.isWhitespace = isWhitespace;
  35697. function isDigit(code) {
  35698. return exports2.$0 <= code && code <= exports2.$9;
  35699. }
  35700. exports2.isDigit = isDigit;
  35701. function isAsciiLetter(code) {
  35702. return code >= exports2.$a && code <= exports2.$z || code >= exports2.$A && code <= exports2.$Z;
  35703. }
  35704. exports2.isAsciiLetter = isAsciiLetter;
  35705. function isAsciiHexDigit(code) {
  35706. return code >= exports2.$a && code <= exports2.$f || code >= exports2.$A && code <= exports2.$F || isDigit(code);
  35707. }
  35708. exports2.isAsciiHexDigit = isAsciiHexDigit;
  35709. function isNewLine(code) {
  35710. return code === exports2.$LF || code === exports2.$CR;
  35711. }
  35712. exports2.isNewLine = isNewLine;
  35713. function isOctalDigit(code) {
  35714. return exports2.$0 <= code && code <= exports2.$7;
  35715. }
  35716. exports2.isOctalDigit = isOctalDigit;
  35717. }
  35718. });
  35719. var require_static_symbol = __commonJS2({
  35720. "node_modules/angular-html-parser/lib/compiler/src/aot/static_symbol.js"(exports2) {
  35721. "use strict";
  35722. Object.defineProperty(exports2, "__esModule", {
  35723. value: true
  35724. });
  35725. var StaticSymbol = class {
  35726. constructor(filePath, name, members) {
  35727. this.filePath = filePath;
  35728. this.name = name;
  35729. this.members = members;
  35730. }
  35731. assertNoMembers() {
  35732. if (this.members.length) {
  35733. throw new Error(`Illegal state: symbol without members expected, but got ${JSON.stringify(this)}.`);
  35734. }
  35735. }
  35736. };
  35737. exports2.StaticSymbol = StaticSymbol;
  35738. var StaticSymbolCache = class {
  35739. constructor() {
  35740. this.cache = /* @__PURE__ */ new Map();
  35741. }
  35742. get(declarationFile, name, members) {
  35743. members = members || [];
  35744. const memberSuffix = members.length ? `.${members.join(".")}` : "";
  35745. const key = `"${declarationFile}".${name}${memberSuffix}`;
  35746. let result = this.cache.get(key);
  35747. if (!result) {
  35748. result = new StaticSymbol(declarationFile, name, members);
  35749. this.cache.set(key, result);
  35750. }
  35751. return result;
  35752. }
  35753. };
  35754. exports2.StaticSymbolCache = StaticSymbolCache;
  35755. }
  35756. });
  35757. var require_util3 = __commonJS2({
  35758. "node_modules/angular-html-parser/lib/compiler/src/util.js"(exports2) {
  35759. "use strict";
  35760. Object.defineProperty(exports2, "__esModule", {
  35761. value: true
  35762. });
  35763. var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
  35764. function dashCaseToCamelCase(input) {
  35765. return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
  35766. }
  35767. exports2.dashCaseToCamelCase = dashCaseToCamelCase;
  35768. function splitAtColon(input, defaultValues) {
  35769. return _splitAt(input, ":", defaultValues);
  35770. }
  35771. exports2.splitAtColon = splitAtColon;
  35772. function splitAtPeriod(input, defaultValues) {
  35773. return _splitAt(input, ".", defaultValues);
  35774. }
  35775. exports2.splitAtPeriod = splitAtPeriod;
  35776. function _splitAt(input, character, defaultValues) {
  35777. const characterIndex = input.indexOf(character);
  35778. if (characterIndex == -1)
  35779. return defaultValues;
  35780. return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
  35781. }
  35782. function visitValue(value, visitor, context) {
  35783. if (Array.isArray(value)) {
  35784. return visitor.visitArray(value, context);
  35785. }
  35786. if (isStrictStringMap(value)) {
  35787. return visitor.visitStringMap(value, context);
  35788. }
  35789. if (value == null || typeof value == "string" || typeof value == "number" || typeof value == "boolean") {
  35790. return visitor.visitPrimitive(value, context);
  35791. }
  35792. return visitor.visitOther(value, context);
  35793. }
  35794. exports2.visitValue = visitValue;
  35795. function isDefined(val) {
  35796. return val !== null && val !== void 0;
  35797. }
  35798. exports2.isDefined = isDefined;
  35799. function noUndefined(val) {
  35800. return val === void 0 ? null : val;
  35801. }
  35802. exports2.noUndefined = noUndefined;
  35803. var ValueTransformer = class {
  35804. visitArray(arr, context) {
  35805. return arr.map((value) => visitValue(value, this, context));
  35806. }
  35807. visitStringMap(map, context) {
  35808. const result = {};
  35809. Object.keys(map).forEach((key) => {
  35810. result[key] = visitValue(map[key], this, context);
  35811. });
  35812. return result;
  35813. }
  35814. visitPrimitive(value, context) {
  35815. return value;
  35816. }
  35817. visitOther(value, context) {
  35818. return value;
  35819. }
  35820. };
  35821. exports2.ValueTransformer = ValueTransformer;
  35822. exports2.SyncAsync = {
  35823. assertSync: (value) => {
  35824. if (isPromise(value)) {
  35825. throw new Error(`Illegal state: value cannot be a promise`);
  35826. }
  35827. return value;
  35828. },
  35829. then: (value, cb) => {
  35830. return isPromise(value) ? value.then(cb) : cb(value);
  35831. },
  35832. all: (syncAsyncValues) => {
  35833. return syncAsyncValues.some(isPromise) ? Promise.all(syncAsyncValues) : syncAsyncValues;
  35834. }
  35835. };
  35836. function error(msg) {
  35837. throw new Error(`Internal Error: ${msg}`);
  35838. }
  35839. exports2.error = error;
  35840. function syntaxError(msg, parseErrors) {
  35841. const error2 = Error(msg);
  35842. error2[ERROR_SYNTAX_ERROR] = true;
  35843. if (parseErrors)
  35844. error2[ERROR_PARSE_ERRORS] = parseErrors;
  35845. return error2;
  35846. }
  35847. exports2.syntaxError = syntaxError;
  35848. var ERROR_SYNTAX_ERROR = "ngSyntaxError";
  35849. var ERROR_PARSE_ERRORS = "ngParseErrors";
  35850. function isSyntaxError(error2) {
  35851. return error2[ERROR_SYNTAX_ERROR];
  35852. }
  35853. exports2.isSyntaxError = isSyntaxError;
  35854. function getParseErrors(error2) {
  35855. return error2[ERROR_PARSE_ERRORS] || [];
  35856. }
  35857. exports2.getParseErrors = getParseErrors;
  35858. function escapeRegExp(s) {
  35859. return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
  35860. }
  35861. exports2.escapeRegExp = escapeRegExp;
  35862. var STRING_MAP_PROTO = Object.getPrototypeOf({});
  35863. function isStrictStringMap(obj) {
  35864. return typeof obj === "object" && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;
  35865. }
  35866. function utf8Encode(str) {
  35867. let encoded = "";
  35868. for (let index = 0; index < str.length; index++) {
  35869. let codePoint = str.charCodeAt(index);
  35870. if (codePoint >= 55296 && codePoint <= 56319 && str.length > index + 1) {
  35871. const low = str.charCodeAt(index + 1);
  35872. if (low >= 56320 && low <= 57343) {
  35873. index++;
  35874. codePoint = (codePoint - 55296 << 10) + low - 56320 + 65536;
  35875. }
  35876. }
  35877. if (codePoint <= 127) {
  35878. encoded += String.fromCharCode(codePoint);
  35879. } else if (codePoint <= 2047) {
  35880. encoded += String.fromCharCode(codePoint >> 6 & 31 | 192, codePoint & 63 | 128);
  35881. } else if (codePoint <= 65535) {
  35882. encoded += String.fromCharCode(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
  35883. } else if (codePoint <= 2097151) {
  35884. encoded += String.fromCharCode(codePoint >> 18 & 7 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
  35885. }
  35886. }
  35887. return encoded;
  35888. }
  35889. exports2.utf8Encode = utf8Encode;
  35890. function stringify(token) {
  35891. if (typeof token === "string") {
  35892. return token;
  35893. }
  35894. if (token instanceof Array) {
  35895. return "[" + token.map(stringify).join(", ") + "]";
  35896. }
  35897. if (token == null) {
  35898. return "" + token;
  35899. }
  35900. if (token.overriddenName) {
  35901. return `${token.overriddenName}`;
  35902. }
  35903. if (token.name) {
  35904. return `${token.name}`;
  35905. }
  35906. if (!token.toString) {
  35907. return "object";
  35908. }
  35909. const res = token.toString();
  35910. if (res == null) {
  35911. return "" + res;
  35912. }
  35913. const newLineIndex = res.indexOf("\n");
  35914. return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
  35915. }
  35916. exports2.stringify = stringify;
  35917. function resolveForwardRef(type) {
  35918. if (typeof type === "function" && type.hasOwnProperty("__forward_ref__")) {
  35919. return type();
  35920. } else {
  35921. return type;
  35922. }
  35923. }
  35924. exports2.resolveForwardRef = resolveForwardRef;
  35925. function isPromise(obj) {
  35926. return !!obj && typeof obj.then === "function";
  35927. }
  35928. exports2.isPromise = isPromise;
  35929. var Version = class {
  35930. constructor(full) {
  35931. this.full = full;
  35932. const splits = full.split(".");
  35933. this.major = splits[0];
  35934. this.minor = splits[1];
  35935. this.patch = splits.slice(2).join(".");
  35936. }
  35937. };
  35938. exports2.Version = Version;
  35939. var __window = typeof window !== "undefined" && window;
  35940. var __self = typeof self !== "undefined" && typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && self;
  35941. var __global = typeof global !== "undefined" && global;
  35942. var _global = __global || __window || __self;
  35943. exports2.global = _global;
  35944. }
  35945. });
  35946. var require_compile_metadata = __commonJS2({
  35947. "node_modules/angular-html-parser/lib/compiler/src/compile_metadata.js"(exports2) {
  35948. "use strict";
  35949. Object.defineProperty(exports2, "__esModule", {
  35950. value: true
  35951. });
  35952. var static_symbol_1 = require_static_symbol();
  35953. var util_1 = require_util3();
  35954. var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/;
  35955. function sanitizeIdentifier(name) {
  35956. return name.replace(/\W/g, "_");
  35957. }
  35958. exports2.sanitizeIdentifier = sanitizeIdentifier;
  35959. var _anonymousTypeIndex = 0;
  35960. function identifierName(compileIdentifier) {
  35961. if (!compileIdentifier || !compileIdentifier.reference) {
  35962. return null;
  35963. }
  35964. const ref = compileIdentifier.reference;
  35965. if (ref instanceof static_symbol_1.StaticSymbol) {
  35966. return ref.name;
  35967. }
  35968. if (ref["__anonymousType"]) {
  35969. return ref["__anonymousType"];
  35970. }
  35971. let identifier = util_1.stringify(ref);
  35972. if (identifier.indexOf("(") >= 0) {
  35973. identifier = `anonymous_${_anonymousTypeIndex++}`;
  35974. ref["__anonymousType"] = identifier;
  35975. } else {
  35976. identifier = sanitizeIdentifier(identifier);
  35977. }
  35978. return identifier;
  35979. }
  35980. exports2.identifierName = identifierName;
  35981. function identifierModuleUrl(compileIdentifier) {
  35982. const ref = compileIdentifier.reference;
  35983. if (ref instanceof static_symbol_1.StaticSymbol) {
  35984. return ref.filePath;
  35985. }
  35986. return `./${util_1.stringify(ref)}`;
  35987. }
  35988. exports2.identifierModuleUrl = identifierModuleUrl;
  35989. function viewClassName(compType, embeddedTemplateIndex) {
  35990. return `View_${identifierName({
  35991. reference: compType
  35992. })}_${embeddedTemplateIndex}`;
  35993. }
  35994. exports2.viewClassName = viewClassName;
  35995. function rendererTypeName(compType) {
  35996. return `RenderType_${identifierName({
  35997. reference: compType
  35998. })}`;
  35999. }
  36000. exports2.rendererTypeName = rendererTypeName;
  36001. function hostViewClassName(compType) {
  36002. return `HostView_${identifierName({
  36003. reference: compType
  36004. })}`;
  36005. }
  36006. exports2.hostViewClassName = hostViewClassName;
  36007. function componentFactoryName(compType) {
  36008. return `${identifierName({
  36009. reference: compType
  36010. })}NgFactory`;
  36011. }
  36012. exports2.componentFactoryName = componentFactoryName;
  36013. var CompileSummaryKind;
  36014. (function(CompileSummaryKind2) {
  36015. CompileSummaryKind2[CompileSummaryKind2["Pipe"] = 0] = "Pipe";
  36016. CompileSummaryKind2[CompileSummaryKind2["Directive"] = 1] = "Directive";
  36017. CompileSummaryKind2[CompileSummaryKind2["NgModule"] = 2] = "NgModule";
  36018. CompileSummaryKind2[CompileSummaryKind2["Injectable"] = 3] = "Injectable";
  36019. })(CompileSummaryKind = exports2.CompileSummaryKind || (exports2.CompileSummaryKind = {}));
  36020. function tokenName(token) {
  36021. return token.value != null ? sanitizeIdentifier(token.value) : identifierName(token.identifier);
  36022. }
  36023. exports2.tokenName = tokenName;
  36024. function tokenReference(token) {
  36025. if (token.identifier != null) {
  36026. return token.identifier.reference;
  36027. } else {
  36028. return token.value;
  36029. }
  36030. }
  36031. exports2.tokenReference = tokenReference;
  36032. var CompileStylesheetMetadata = class {
  36033. constructor({
  36034. moduleUrl,
  36035. styles,
  36036. styleUrls
  36037. } = {}) {
  36038. this.moduleUrl = moduleUrl || null;
  36039. this.styles = _normalizeArray(styles);
  36040. this.styleUrls = _normalizeArray(styleUrls);
  36041. }
  36042. };
  36043. exports2.CompileStylesheetMetadata = CompileStylesheetMetadata;
  36044. var CompileTemplateMetadata = class {
  36045. constructor({
  36046. encapsulation,
  36047. template,
  36048. templateUrl,
  36049. htmlAst,
  36050. styles,
  36051. styleUrls,
  36052. externalStylesheets,
  36053. animations,
  36054. ngContentSelectors,
  36055. interpolation,
  36056. isInline,
  36057. preserveWhitespaces
  36058. }) {
  36059. this.encapsulation = encapsulation;
  36060. this.template = template;
  36061. this.templateUrl = templateUrl;
  36062. this.htmlAst = htmlAst;
  36063. this.styles = _normalizeArray(styles);
  36064. this.styleUrls = _normalizeArray(styleUrls);
  36065. this.externalStylesheets = _normalizeArray(externalStylesheets);
  36066. this.animations = animations ? flatten(animations) : [];
  36067. this.ngContentSelectors = ngContentSelectors || [];
  36068. if (interpolation && interpolation.length != 2) {
  36069. throw new Error(`'interpolation' should have a start and an end symbol.`);
  36070. }
  36071. this.interpolation = interpolation;
  36072. this.isInline = isInline;
  36073. this.preserveWhitespaces = preserveWhitespaces;
  36074. }
  36075. toSummary() {
  36076. return {
  36077. ngContentSelectors: this.ngContentSelectors,
  36078. encapsulation: this.encapsulation,
  36079. styles: this.styles,
  36080. animations: this.animations
  36081. };
  36082. }
  36083. };
  36084. exports2.CompileTemplateMetadata = CompileTemplateMetadata;
  36085. var CompileDirectiveMetadata = class {
  36086. static create({
  36087. isHost,
  36088. type,
  36089. isComponent,
  36090. selector,
  36091. exportAs,
  36092. changeDetection,
  36093. inputs,
  36094. outputs,
  36095. host,
  36096. providers,
  36097. viewProviders,
  36098. queries,
  36099. guards,
  36100. viewQueries,
  36101. entryComponents,
  36102. template,
  36103. componentViewType,
  36104. rendererType,
  36105. componentFactory
  36106. }) {
  36107. const hostListeners = {};
  36108. const hostProperties = {};
  36109. const hostAttributes = {};
  36110. if (host != null) {
  36111. Object.keys(host).forEach((key) => {
  36112. const value = host[key];
  36113. const matches = key.match(HOST_REG_EXP);
  36114. if (matches === null) {
  36115. hostAttributes[key] = value;
  36116. } else if (matches[1] != null) {
  36117. hostProperties[matches[1]] = value;
  36118. } else if (matches[2] != null) {
  36119. hostListeners[matches[2]] = value;
  36120. }
  36121. });
  36122. }
  36123. const inputsMap = {};
  36124. if (inputs != null) {
  36125. inputs.forEach((bindConfig) => {
  36126. const parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]);
  36127. inputsMap[parts[0]] = parts[1];
  36128. });
  36129. }
  36130. const outputsMap = {};
  36131. if (outputs != null) {
  36132. outputs.forEach((bindConfig) => {
  36133. const parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]);
  36134. outputsMap[parts[0]] = parts[1];
  36135. });
  36136. }
  36137. return new CompileDirectiveMetadata({
  36138. isHost,
  36139. type,
  36140. isComponent: !!isComponent,
  36141. selector,
  36142. exportAs,
  36143. changeDetection,
  36144. inputs: inputsMap,
  36145. outputs: outputsMap,
  36146. hostListeners,
  36147. hostProperties,
  36148. hostAttributes,
  36149. providers,
  36150. viewProviders,
  36151. queries,
  36152. guards,
  36153. viewQueries,
  36154. entryComponents,
  36155. template,
  36156. componentViewType,
  36157. rendererType,
  36158. componentFactory
  36159. });
  36160. }
  36161. constructor({
  36162. isHost,
  36163. type,
  36164. isComponent,
  36165. selector,
  36166. exportAs,
  36167. changeDetection,
  36168. inputs,
  36169. outputs,
  36170. hostListeners,
  36171. hostProperties,
  36172. hostAttributes,
  36173. providers,
  36174. viewProviders,
  36175. queries,
  36176. guards,
  36177. viewQueries,
  36178. entryComponents,
  36179. template,
  36180. componentViewType,
  36181. rendererType,
  36182. componentFactory
  36183. }) {
  36184. this.isHost = !!isHost;
  36185. this.type = type;
  36186. this.isComponent = isComponent;
  36187. this.selector = selector;
  36188. this.exportAs = exportAs;
  36189. this.changeDetection = changeDetection;
  36190. this.inputs = inputs;
  36191. this.outputs = outputs;
  36192. this.hostListeners = hostListeners;
  36193. this.hostProperties = hostProperties;
  36194. this.hostAttributes = hostAttributes;
  36195. this.providers = _normalizeArray(providers);
  36196. this.viewProviders = _normalizeArray(viewProviders);
  36197. this.queries = _normalizeArray(queries);
  36198. this.guards = guards;
  36199. this.viewQueries = _normalizeArray(viewQueries);
  36200. this.entryComponents = _normalizeArray(entryComponents);
  36201. this.template = template;
  36202. this.componentViewType = componentViewType;
  36203. this.rendererType = rendererType;
  36204. this.componentFactory = componentFactory;
  36205. }
  36206. toSummary() {
  36207. return {
  36208. summaryKind: CompileSummaryKind.Directive,
  36209. type: this.type,
  36210. isComponent: this.isComponent,
  36211. selector: this.selector,
  36212. exportAs: this.exportAs,
  36213. inputs: this.inputs,
  36214. outputs: this.outputs,
  36215. hostListeners: this.hostListeners,
  36216. hostProperties: this.hostProperties,
  36217. hostAttributes: this.hostAttributes,
  36218. providers: this.providers,
  36219. viewProviders: this.viewProviders,
  36220. queries: this.queries,
  36221. guards: this.guards,
  36222. viewQueries: this.viewQueries,
  36223. entryComponents: this.entryComponents,
  36224. changeDetection: this.changeDetection,
  36225. template: this.template && this.template.toSummary(),
  36226. componentViewType: this.componentViewType,
  36227. rendererType: this.rendererType,
  36228. componentFactory: this.componentFactory
  36229. };
  36230. }
  36231. };
  36232. exports2.CompileDirectiveMetadata = CompileDirectiveMetadata;
  36233. var CompilePipeMetadata = class {
  36234. constructor({
  36235. type,
  36236. name,
  36237. pure
  36238. }) {
  36239. this.type = type;
  36240. this.name = name;
  36241. this.pure = !!pure;
  36242. }
  36243. toSummary() {
  36244. return {
  36245. summaryKind: CompileSummaryKind.Pipe,
  36246. type: this.type,
  36247. name: this.name,
  36248. pure: this.pure
  36249. };
  36250. }
  36251. };
  36252. exports2.CompilePipeMetadata = CompilePipeMetadata;
  36253. var CompileShallowModuleMetadata = class {
  36254. };
  36255. exports2.CompileShallowModuleMetadata = CompileShallowModuleMetadata;
  36256. var CompileNgModuleMetadata = class {
  36257. constructor({
  36258. type,
  36259. providers,
  36260. declaredDirectives,
  36261. exportedDirectives,
  36262. declaredPipes,
  36263. exportedPipes,
  36264. entryComponents,
  36265. bootstrapComponents,
  36266. importedModules,
  36267. exportedModules,
  36268. schemas,
  36269. transitiveModule,
  36270. id
  36271. }) {
  36272. this.type = type || null;
  36273. this.declaredDirectives = _normalizeArray(declaredDirectives);
  36274. this.exportedDirectives = _normalizeArray(exportedDirectives);
  36275. this.declaredPipes = _normalizeArray(declaredPipes);
  36276. this.exportedPipes = _normalizeArray(exportedPipes);
  36277. this.providers = _normalizeArray(providers);
  36278. this.entryComponents = _normalizeArray(entryComponents);
  36279. this.bootstrapComponents = _normalizeArray(bootstrapComponents);
  36280. this.importedModules = _normalizeArray(importedModules);
  36281. this.exportedModules = _normalizeArray(exportedModules);
  36282. this.schemas = _normalizeArray(schemas);
  36283. this.id = id || null;
  36284. this.transitiveModule = transitiveModule || null;
  36285. }
  36286. toSummary() {
  36287. const module3 = this.transitiveModule;
  36288. return {
  36289. summaryKind: CompileSummaryKind.NgModule,
  36290. type: this.type,
  36291. entryComponents: module3.entryComponents,
  36292. providers: module3.providers,
  36293. modules: module3.modules,
  36294. exportedDirectives: module3.exportedDirectives,
  36295. exportedPipes: module3.exportedPipes
  36296. };
  36297. }
  36298. };
  36299. exports2.CompileNgModuleMetadata = CompileNgModuleMetadata;
  36300. var TransitiveCompileNgModuleMetadata = class {
  36301. constructor() {
  36302. this.directivesSet = /* @__PURE__ */ new Set();
  36303. this.directives = [];
  36304. this.exportedDirectivesSet = /* @__PURE__ */ new Set();
  36305. this.exportedDirectives = [];
  36306. this.pipesSet = /* @__PURE__ */ new Set();
  36307. this.pipes = [];
  36308. this.exportedPipesSet = /* @__PURE__ */ new Set();
  36309. this.exportedPipes = [];
  36310. this.modulesSet = /* @__PURE__ */ new Set();
  36311. this.modules = [];
  36312. this.entryComponentsSet = /* @__PURE__ */ new Set();
  36313. this.entryComponents = [];
  36314. this.providers = [];
  36315. }
  36316. addProvider(provider, module3) {
  36317. this.providers.push({
  36318. provider,
  36319. module: module3
  36320. });
  36321. }
  36322. addDirective(id) {
  36323. if (!this.directivesSet.has(id.reference)) {
  36324. this.directivesSet.add(id.reference);
  36325. this.directives.push(id);
  36326. }
  36327. }
  36328. addExportedDirective(id) {
  36329. if (!this.exportedDirectivesSet.has(id.reference)) {
  36330. this.exportedDirectivesSet.add(id.reference);
  36331. this.exportedDirectives.push(id);
  36332. }
  36333. }
  36334. addPipe(id) {
  36335. if (!this.pipesSet.has(id.reference)) {
  36336. this.pipesSet.add(id.reference);
  36337. this.pipes.push(id);
  36338. }
  36339. }
  36340. addExportedPipe(id) {
  36341. if (!this.exportedPipesSet.has(id.reference)) {
  36342. this.exportedPipesSet.add(id.reference);
  36343. this.exportedPipes.push(id);
  36344. }
  36345. }
  36346. addModule(id) {
  36347. if (!this.modulesSet.has(id.reference)) {
  36348. this.modulesSet.add(id.reference);
  36349. this.modules.push(id);
  36350. }
  36351. }
  36352. addEntryComponent(ec) {
  36353. if (!this.entryComponentsSet.has(ec.componentType)) {
  36354. this.entryComponentsSet.add(ec.componentType);
  36355. this.entryComponents.push(ec);
  36356. }
  36357. }
  36358. };
  36359. exports2.TransitiveCompileNgModuleMetadata = TransitiveCompileNgModuleMetadata;
  36360. function _normalizeArray(obj) {
  36361. return obj || [];
  36362. }
  36363. var ProviderMeta = class {
  36364. constructor(token, {
  36365. useClass,
  36366. useValue,
  36367. useExisting,
  36368. useFactory,
  36369. deps,
  36370. multi
  36371. }) {
  36372. this.token = token;
  36373. this.useClass = useClass || null;
  36374. this.useValue = useValue;
  36375. this.useExisting = useExisting;
  36376. this.useFactory = useFactory || null;
  36377. this.dependencies = deps || null;
  36378. this.multi = !!multi;
  36379. }
  36380. };
  36381. exports2.ProviderMeta = ProviderMeta;
  36382. function flatten(list) {
  36383. return list.reduce((flat, item) => {
  36384. const flatItem = Array.isArray(item) ? flatten(item) : item;
  36385. return flat.concat(flatItem);
  36386. }, []);
  36387. }
  36388. exports2.flatten = flatten;
  36389. function jitSourceUrl(url) {
  36390. return url.replace(/(\w+:\/\/[\w:-]+)?(\/+)?/, "ng:///");
  36391. }
  36392. function templateSourceUrl(ngModuleType, compMeta, templateMeta) {
  36393. let url;
  36394. if (templateMeta.isInline) {
  36395. if (compMeta.type.reference instanceof static_symbol_1.StaticSymbol) {
  36396. url = `${compMeta.type.reference.filePath}.${compMeta.type.reference.name}.html`;
  36397. } else {
  36398. url = `${identifierName(ngModuleType)}/${identifierName(compMeta.type)}.html`;
  36399. }
  36400. } else {
  36401. url = templateMeta.templateUrl;
  36402. }
  36403. return compMeta.type.reference instanceof static_symbol_1.StaticSymbol ? url : jitSourceUrl(url);
  36404. }
  36405. exports2.templateSourceUrl = templateSourceUrl;
  36406. function sharedStylesheetJitUrl(meta, id) {
  36407. const pathParts = meta.moduleUrl.split(/\/\\/g);
  36408. const baseName = pathParts[pathParts.length - 1];
  36409. return jitSourceUrl(`css/${id}${baseName}.ngstyle.js`);
  36410. }
  36411. exports2.sharedStylesheetJitUrl = sharedStylesheetJitUrl;
  36412. function ngModuleJitUrl(moduleMeta) {
  36413. return jitSourceUrl(`${identifierName(moduleMeta.type)}/module.ngfactory.js`);
  36414. }
  36415. exports2.ngModuleJitUrl = ngModuleJitUrl;
  36416. function templateJitUrl(ngModuleType, compMeta) {
  36417. return jitSourceUrl(`${identifierName(ngModuleType)}/${identifierName(compMeta.type)}.ngfactory.js`);
  36418. }
  36419. exports2.templateJitUrl = templateJitUrl;
  36420. }
  36421. });
  36422. var require_parse_util = __commonJS2({
  36423. "node_modules/angular-html-parser/lib/compiler/src/parse_util.js"(exports2) {
  36424. "use strict";
  36425. Object.defineProperty(exports2, "__esModule", {
  36426. value: true
  36427. });
  36428. var chars = require_chars();
  36429. var compile_metadata_1 = require_compile_metadata();
  36430. var ParseLocation = class {
  36431. constructor(file, offset, line, col) {
  36432. this.file = file;
  36433. this.offset = offset;
  36434. this.line = line;
  36435. this.col = col;
  36436. }
  36437. toString() {
  36438. return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;
  36439. }
  36440. moveBy(delta) {
  36441. const source = this.file.content;
  36442. const len = source.length;
  36443. let offset = this.offset;
  36444. let line = this.line;
  36445. let col = this.col;
  36446. while (offset > 0 && delta < 0) {
  36447. offset--;
  36448. delta++;
  36449. const ch = source.charCodeAt(offset);
  36450. if (ch == chars.$LF) {
  36451. line--;
  36452. const priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode(chars.$LF));
  36453. col = priorLine > 0 ? offset - priorLine : offset;
  36454. } else {
  36455. col--;
  36456. }
  36457. }
  36458. while (offset < len && delta > 0) {
  36459. const ch = source.charCodeAt(offset);
  36460. offset++;
  36461. delta--;
  36462. if (ch == chars.$LF) {
  36463. line++;
  36464. col = 0;
  36465. } else {
  36466. col++;
  36467. }
  36468. }
  36469. return new ParseLocation(this.file, offset, line, col);
  36470. }
  36471. getContext(maxChars, maxLines) {
  36472. const content = this.file.content;
  36473. let startOffset = this.offset;
  36474. if (startOffset != null) {
  36475. if (startOffset > content.length - 1) {
  36476. startOffset = content.length - 1;
  36477. }
  36478. let endOffset = startOffset;
  36479. let ctxChars = 0;
  36480. let ctxLines = 0;
  36481. while (ctxChars < maxChars && startOffset > 0) {
  36482. startOffset--;
  36483. ctxChars++;
  36484. if (content[startOffset] == "\n") {
  36485. if (++ctxLines == maxLines) {
  36486. break;
  36487. }
  36488. }
  36489. }
  36490. ctxChars = 0;
  36491. ctxLines = 0;
  36492. while (ctxChars < maxChars && endOffset < content.length - 1) {
  36493. endOffset++;
  36494. ctxChars++;
  36495. if (content[endOffset] == "\n") {
  36496. if (++ctxLines == maxLines) {
  36497. break;
  36498. }
  36499. }
  36500. }
  36501. return {
  36502. before: content.substring(startOffset, this.offset),
  36503. after: content.substring(this.offset, endOffset + 1)
  36504. };
  36505. }
  36506. return null;
  36507. }
  36508. };
  36509. exports2.ParseLocation = ParseLocation;
  36510. var ParseSourceFile = class {
  36511. constructor(content, url) {
  36512. this.content = content;
  36513. this.url = url;
  36514. }
  36515. };
  36516. exports2.ParseSourceFile = ParseSourceFile;
  36517. var ParseSourceSpan = class {
  36518. constructor(start, end, details = null) {
  36519. this.start = start;
  36520. this.end = end;
  36521. this.details = details;
  36522. }
  36523. toString() {
  36524. return this.start.file.content.substring(this.start.offset, this.end.offset);
  36525. }
  36526. };
  36527. exports2.ParseSourceSpan = ParseSourceSpan;
  36528. exports2.EMPTY_PARSE_LOCATION = new ParseLocation(new ParseSourceFile("", ""), 0, 0, 0);
  36529. exports2.EMPTY_SOURCE_SPAN = new ParseSourceSpan(exports2.EMPTY_PARSE_LOCATION, exports2.EMPTY_PARSE_LOCATION);
  36530. var ParseErrorLevel;
  36531. (function(ParseErrorLevel2) {
  36532. ParseErrorLevel2[ParseErrorLevel2["WARNING"] = 0] = "WARNING";
  36533. ParseErrorLevel2[ParseErrorLevel2["ERROR"] = 1] = "ERROR";
  36534. })(ParseErrorLevel = exports2.ParseErrorLevel || (exports2.ParseErrorLevel = {}));
  36535. var ParseError = class {
  36536. constructor(span, msg, level = ParseErrorLevel.ERROR) {
  36537. this.span = span;
  36538. this.msg = msg;
  36539. this.level = level;
  36540. }
  36541. contextualMessage() {
  36542. const ctx = this.span.start.getContext(100, 3);
  36543. return ctx ? `${this.msg} ("${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}")` : this.msg;
  36544. }
  36545. toString() {
  36546. const details = this.span.details ? `, ${this.span.details}` : "";
  36547. return `${this.contextualMessage()}: ${this.span.start}${details}`;
  36548. }
  36549. };
  36550. exports2.ParseError = ParseError;
  36551. function typeSourceSpan(kind, type) {
  36552. const moduleUrl = compile_metadata_1.identifierModuleUrl(type);
  36553. const sourceFileName = moduleUrl != null ? `in ${kind} ${compile_metadata_1.identifierName(type)} in ${moduleUrl}` : `in ${kind} ${compile_metadata_1.identifierName(type)}`;
  36554. const sourceFile = new ParseSourceFile("", sourceFileName);
  36555. return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));
  36556. }
  36557. exports2.typeSourceSpan = typeSourceSpan;
  36558. function r3JitTypeSourceSpan(kind, typeName, sourceUrl) {
  36559. const sourceFileName = `in ${kind} ${typeName} in ${sourceUrl}`;
  36560. const sourceFile = new ParseSourceFile("", sourceFileName);
  36561. return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));
  36562. }
  36563. exports2.r3JitTypeSourceSpan = r3JitTypeSourceSpan;
  36564. }
  36565. });
  36566. var require_print_preprocess3 = __commonJS2({
  36567. "src/language-html/print-preprocess.js"(exports2, module2) {
  36568. "use strict";
  36569. var {
  36570. ParseSourceSpan
  36571. } = require_parse_util();
  36572. var {
  36573. htmlTrim,
  36574. getLeadingAndTrailingHtmlWhitespace,
  36575. hasHtmlWhitespace,
  36576. canHaveInterpolation,
  36577. getNodeCssStyleDisplay,
  36578. isDanglingSpaceSensitiveNode,
  36579. isIndentationSensitiveNode,
  36580. isLeadingSpaceSensitiveNode,
  36581. isTrailingSpaceSensitiveNode,
  36582. isWhitespaceSensitiveNode
  36583. } = require_utils11();
  36584. var PREPROCESS_PIPELINE = [removeIgnorableFirstLf, mergeIfConditionalStartEndCommentIntoElementOpeningTag, mergeCdataIntoText, extractInterpolation, extractWhitespaces, addCssDisplay, addIsSelfClosing, addHasHtmComponentClosingTag, addIsSpaceSensitive, mergeSimpleElementIntoText];
  36585. function preprocess(ast, options) {
  36586. for (const fn of PREPROCESS_PIPELINE) {
  36587. fn(ast, options);
  36588. }
  36589. return ast;
  36590. }
  36591. function removeIgnorableFirstLf(ast) {
  36592. ast.walk((node) => {
  36593. if (node.type === "element" && node.tagDefinition.ignoreFirstLf && node.children.length > 0 && node.children[0].type === "text" && node.children[0].value[0] === "\n") {
  36594. const text = node.children[0];
  36595. if (text.value.length === 1) {
  36596. node.removeChild(text);
  36597. } else {
  36598. text.value = text.value.slice(1);
  36599. }
  36600. }
  36601. });
  36602. }
  36603. function mergeIfConditionalStartEndCommentIntoElementOpeningTag(ast) {
  36604. const isTarget = (node) => node.type === "element" && node.prev && node.prev.type === "ieConditionalStartComment" && node.prev.sourceSpan.end.offset === node.startSourceSpan.start.offset && node.firstChild && node.firstChild.type === "ieConditionalEndComment" && node.firstChild.sourceSpan.start.offset === node.startSourceSpan.end.offset;
  36605. ast.walk((node) => {
  36606. if (node.children) {
  36607. for (let i = 0; i < node.children.length; i++) {
  36608. const child = node.children[i];
  36609. if (!isTarget(child)) {
  36610. continue;
  36611. }
  36612. const ieConditionalStartComment = child.prev;
  36613. const ieConditionalEndComment = child.firstChild;
  36614. node.removeChild(ieConditionalStartComment);
  36615. i--;
  36616. const startSourceSpan = new ParseSourceSpan(ieConditionalStartComment.sourceSpan.start, ieConditionalEndComment.sourceSpan.end);
  36617. const sourceSpan = new ParseSourceSpan(startSourceSpan.start, child.sourceSpan.end);
  36618. child.condition = ieConditionalStartComment.condition;
  36619. child.sourceSpan = sourceSpan;
  36620. child.startSourceSpan = startSourceSpan;
  36621. child.removeChild(ieConditionalEndComment);
  36622. }
  36623. }
  36624. });
  36625. }
  36626. function mergeNodeIntoText(ast, shouldMerge, getValue) {
  36627. ast.walk((node) => {
  36628. if (node.children) {
  36629. for (let i = 0; i < node.children.length; i++) {
  36630. const child = node.children[i];
  36631. if (child.type !== "text" && !shouldMerge(child)) {
  36632. continue;
  36633. }
  36634. if (child.type !== "text") {
  36635. child.type = "text";
  36636. child.value = getValue(child);
  36637. }
  36638. const prevChild = child.prev;
  36639. if (!prevChild || prevChild.type !== "text") {
  36640. continue;
  36641. }
  36642. prevChild.value += child.value;
  36643. prevChild.sourceSpan = new ParseSourceSpan(prevChild.sourceSpan.start, child.sourceSpan.end);
  36644. node.removeChild(child);
  36645. i--;
  36646. }
  36647. }
  36648. });
  36649. }
  36650. function mergeCdataIntoText(ast) {
  36651. return mergeNodeIntoText(ast, (node) => node.type === "cdata", (node) => `<![CDATA[${node.value}]]>`);
  36652. }
  36653. function mergeSimpleElementIntoText(ast) {
  36654. const isSimpleElement = (node) => node.type === "element" && node.attrs.length === 0 && node.children.length === 1 && node.firstChild.type === "text" && !hasHtmlWhitespace(node.children[0].value) && !node.firstChild.hasLeadingSpaces && !node.firstChild.hasTrailingSpaces && node.isLeadingSpaceSensitive && !node.hasLeadingSpaces && node.isTrailingSpaceSensitive && !node.hasTrailingSpaces && node.prev && node.prev.type === "text" && node.next && node.next.type === "text";
  36655. ast.walk((node) => {
  36656. if (node.children) {
  36657. for (let i = 0; i < node.children.length; i++) {
  36658. const child = node.children[i];
  36659. if (!isSimpleElement(child)) {
  36660. continue;
  36661. }
  36662. const prevChild = child.prev;
  36663. const nextChild = child.next;
  36664. prevChild.value += `<${child.rawName}>` + child.firstChild.value + `</${child.rawName}>` + nextChild.value;
  36665. prevChild.sourceSpan = new ParseSourceSpan(prevChild.sourceSpan.start, nextChild.sourceSpan.end);
  36666. prevChild.isTrailingSpaceSensitive = nextChild.isTrailingSpaceSensitive;
  36667. prevChild.hasTrailingSpaces = nextChild.hasTrailingSpaces;
  36668. node.removeChild(child);
  36669. i--;
  36670. node.removeChild(nextChild);
  36671. }
  36672. }
  36673. });
  36674. }
  36675. function extractInterpolation(ast, options) {
  36676. if (options.parser === "html") {
  36677. return;
  36678. }
  36679. const interpolationRegex = /{{(.+?)}}/s;
  36680. ast.walk((node) => {
  36681. if (!canHaveInterpolation(node)) {
  36682. return;
  36683. }
  36684. for (const child of node.children) {
  36685. if (child.type !== "text") {
  36686. continue;
  36687. }
  36688. let startSourceSpan = child.sourceSpan.start;
  36689. let endSourceSpan = null;
  36690. const components = child.value.split(interpolationRegex);
  36691. for (let i = 0; i < components.length; i++, startSourceSpan = endSourceSpan) {
  36692. const value = components[i];
  36693. if (i % 2 === 0) {
  36694. endSourceSpan = startSourceSpan.moveBy(value.length);
  36695. if (value.length > 0) {
  36696. node.insertChildBefore(child, {
  36697. type: "text",
  36698. value,
  36699. sourceSpan: new ParseSourceSpan(startSourceSpan, endSourceSpan)
  36700. });
  36701. }
  36702. continue;
  36703. }
  36704. endSourceSpan = startSourceSpan.moveBy(value.length + 4);
  36705. node.insertChildBefore(child, {
  36706. type: "interpolation",
  36707. sourceSpan: new ParseSourceSpan(startSourceSpan, endSourceSpan),
  36708. children: value.length === 0 ? [] : [{
  36709. type: "text",
  36710. value,
  36711. sourceSpan: new ParseSourceSpan(startSourceSpan.moveBy(2), endSourceSpan.moveBy(-2))
  36712. }]
  36713. });
  36714. }
  36715. node.removeChild(child);
  36716. }
  36717. });
  36718. }
  36719. function extractWhitespaces(ast) {
  36720. ast.walk((node) => {
  36721. if (!node.children) {
  36722. return;
  36723. }
  36724. if (node.children.length === 0 || node.children.length === 1 && node.children[0].type === "text" && htmlTrim(node.children[0].value).length === 0) {
  36725. node.hasDanglingSpaces = node.children.length > 0;
  36726. node.children = [];
  36727. return;
  36728. }
  36729. const isWhitespaceSensitive = isWhitespaceSensitiveNode(node);
  36730. const isIndentationSensitive = isIndentationSensitiveNode(node);
  36731. if (!isWhitespaceSensitive) {
  36732. for (let i = 0; i < node.children.length; i++) {
  36733. const child = node.children[i];
  36734. if (child.type !== "text") {
  36735. continue;
  36736. }
  36737. const {
  36738. leadingWhitespace,
  36739. text,
  36740. trailingWhitespace
  36741. } = getLeadingAndTrailingHtmlWhitespace(child.value);
  36742. const prevChild = child.prev;
  36743. const nextChild = child.next;
  36744. if (!text) {
  36745. node.removeChild(child);
  36746. i--;
  36747. if (leadingWhitespace || trailingWhitespace) {
  36748. if (prevChild) {
  36749. prevChild.hasTrailingSpaces = true;
  36750. }
  36751. if (nextChild) {
  36752. nextChild.hasLeadingSpaces = true;
  36753. }
  36754. }
  36755. } else {
  36756. child.value = text;
  36757. child.sourceSpan = new ParseSourceSpan(child.sourceSpan.start.moveBy(leadingWhitespace.length), child.sourceSpan.end.moveBy(-trailingWhitespace.length));
  36758. if (leadingWhitespace) {
  36759. if (prevChild) {
  36760. prevChild.hasTrailingSpaces = true;
  36761. }
  36762. child.hasLeadingSpaces = true;
  36763. }
  36764. if (trailingWhitespace) {
  36765. child.hasTrailingSpaces = true;
  36766. if (nextChild) {
  36767. nextChild.hasLeadingSpaces = true;
  36768. }
  36769. }
  36770. }
  36771. }
  36772. }
  36773. node.isWhitespaceSensitive = isWhitespaceSensitive;
  36774. node.isIndentationSensitive = isIndentationSensitive;
  36775. });
  36776. }
  36777. function addIsSelfClosing(ast) {
  36778. ast.walk((node) => {
  36779. node.isSelfClosing = !node.children || node.type === "element" && (node.tagDefinition.isVoid || node.startSourceSpan === node.endSourceSpan);
  36780. });
  36781. }
  36782. function addHasHtmComponentClosingTag(ast, options) {
  36783. ast.walk((node) => {
  36784. if (node.type !== "element") {
  36785. return;
  36786. }
  36787. node.hasHtmComponentClosingTag = node.endSourceSpan && /^<\s*\/\s*\/\s*>$/.test(options.originalText.slice(node.endSourceSpan.start.offset, node.endSourceSpan.end.offset));
  36788. });
  36789. }
  36790. function addCssDisplay(ast, options) {
  36791. ast.walk((node) => {
  36792. node.cssDisplay = getNodeCssStyleDisplay(node, options);
  36793. });
  36794. }
  36795. function addIsSpaceSensitive(ast, options) {
  36796. ast.walk((node) => {
  36797. const {
  36798. children
  36799. } = node;
  36800. if (!children) {
  36801. return;
  36802. }
  36803. if (children.length === 0) {
  36804. node.isDanglingSpaceSensitive = isDanglingSpaceSensitiveNode(node);
  36805. return;
  36806. }
  36807. for (const child of children) {
  36808. child.isLeadingSpaceSensitive = isLeadingSpaceSensitiveNode(child, options);
  36809. child.isTrailingSpaceSensitive = isTrailingSpaceSensitiveNode(child, options);
  36810. }
  36811. for (let index = 0; index < children.length; index++) {
  36812. const child = children[index];
  36813. child.isLeadingSpaceSensitive = index === 0 ? child.isLeadingSpaceSensitive : child.prev.isTrailingSpaceSensitive && child.isLeadingSpaceSensitive;
  36814. child.isTrailingSpaceSensitive = index === children.length - 1 ? child.isTrailingSpaceSensitive : child.next.isLeadingSpaceSensitive && child.isTrailingSpaceSensitive;
  36815. }
  36816. });
  36817. }
  36818. module2.exports = preprocess;
  36819. }
  36820. });
  36821. var require_pragma5 = __commonJS2({
  36822. "src/language-html/pragma.js"(exports2, module2) {
  36823. "use strict";
  36824. function hasPragma(text) {
  36825. return /^\s*<!--\s*@(?:format|prettier)\s*-->/.test(text);
  36826. }
  36827. function insertPragma(text) {
  36828. return "<!-- @format -->\n\n" + text.replace(/^\s*\n/, "");
  36829. }
  36830. module2.exports = {
  36831. hasPragma,
  36832. insertPragma
  36833. };
  36834. }
  36835. });
  36836. var require_loc6 = __commonJS2({
  36837. "src/language-html/loc.js"(exports2, module2) {
  36838. "use strict";
  36839. function locStart(node) {
  36840. return node.sourceSpan.start.offset;
  36841. }
  36842. function locEnd(node) {
  36843. return node.sourceSpan.end.offset;
  36844. }
  36845. module2.exports = {
  36846. locStart,
  36847. locEnd
  36848. };
  36849. }
  36850. });
  36851. var require_tag = __commonJS2({
  36852. "src/language-html/print/tag.js"(exports2, module2) {
  36853. "use strict";
  36854. var assert = require("assert");
  36855. var {
  36856. isNonEmptyArray
  36857. } = require_util();
  36858. var {
  36859. builders: {
  36860. indent,
  36861. join,
  36862. line,
  36863. softline,
  36864. hardline
  36865. },
  36866. utils: {
  36867. replaceTextEndOfLine
  36868. }
  36869. } = require("./doc.js");
  36870. var {
  36871. locStart,
  36872. locEnd
  36873. } = require_loc6();
  36874. var {
  36875. isTextLikeNode,
  36876. getLastDescendant,
  36877. isPreLikeNode,
  36878. hasPrettierIgnore,
  36879. shouldPreserveContent
  36880. } = require_utils11();
  36881. function printClosingTag(node, options) {
  36882. return [node.isSelfClosing ? "" : printClosingTagStart(node, options), printClosingTagEnd(node, options)];
  36883. }
  36884. function printClosingTagStart(node, options) {
  36885. return node.lastChild && needsToBorrowParentClosingTagStartMarker(node.lastChild) ? "" : [printClosingTagPrefix(node, options), printClosingTagStartMarker(node, options)];
  36886. }
  36887. function printClosingTagEnd(node, options) {
  36888. return (node.next ? needsToBorrowPrevClosingTagEndMarker(node.next) : needsToBorrowLastChildClosingTagEndMarker(node.parent)) ? "" : [printClosingTagEndMarker(node, options), printClosingTagSuffix(node, options)];
  36889. }
  36890. function printClosingTagPrefix(node, options) {
  36891. return needsToBorrowLastChildClosingTagEndMarker(node) ? printClosingTagEndMarker(node.lastChild, options) : "";
  36892. }
  36893. function printClosingTagSuffix(node, options) {
  36894. return needsToBorrowParentClosingTagStartMarker(node) ? printClosingTagStartMarker(node.parent, options) : needsToBorrowNextOpeningTagStartMarker(node) ? printOpeningTagStartMarker(node.next) : "";
  36895. }
  36896. function printClosingTagStartMarker(node, options) {
  36897. assert(!node.isSelfClosing);
  36898. if (shouldNotPrintClosingTag(node, options)) {
  36899. return "";
  36900. }
  36901. switch (node.type) {
  36902. case "ieConditionalComment":
  36903. return "<!";
  36904. case "element":
  36905. if (node.hasHtmComponentClosingTag) {
  36906. return "<//";
  36907. }
  36908. default:
  36909. return `</${node.rawName}`;
  36910. }
  36911. }
  36912. function printClosingTagEndMarker(node, options) {
  36913. if (shouldNotPrintClosingTag(node, options)) {
  36914. return "";
  36915. }
  36916. switch (node.type) {
  36917. case "ieConditionalComment":
  36918. case "ieConditionalEndComment":
  36919. return "[endif]-->";
  36920. case "ieConditionalStartComment":
  36921. return "]><!-->";
  36922. case "interpolation":
  36923. return "}}";
  36924. case "element":
  36925. if (node.isSelfClosing) {
  36926. return "/>";
  36927. }
  36928. default:
  36929. return ">";
  36930. }
  36931. }
  36932. function shouldNotPrintClosingTag(node, options) {
  36933. return !node.isSelfClosing && !node.endSourceSpan && (hasPrettierIgnore(node) || shouldPreserveContent(node.parent, options));
  36934. }
  36935. function needsToBorrowPrevClosingTagEndMarker(node) {
  36936. return node.prev && node.prev.type !== "docType" && !isTextLikeNode(node.prev) && node.isLeadingSpaceSensitive && !node.hasLeadingSpaces;
  36937. }
  36938. function needsToBorrowLastChildClosingTagEndMarker(node) {
  36939. return node.lastChild && node.lastChild.isTrailingSpaceSensitive && !node.lastChild.hasTrailingSpaces && !isTextLikeNode(getLastDescendant(node.lastChild)) && !isPreLikeNode(node);
  36940. }
  36941. function needsToBorrowParentClosingTagStartMarker(node) {
  36942. return !node.next && !node.hasTrailingSpaces && node.isTrailingSpaceSensitive && isTextLikeNode(getLastDescendant(node));
  36943. }
  36944. function needsToBorrowNextOpeningTagStartMarker(node) {
  36945. return node.next && !isTextLikeNode(node.next) && isTextLikeNode(node) && node.isTrailingSpaceSensitive && !node.hasTrailingSpaces;
  36946. }
  36947. function getPrettierIgnoreAttributeCommentData(value) {
  36948. const match = value.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/s);
  36949. if (!match) {
  36950. return false;
  36951. }
  36952. if (!match[1]) {
  36953. return true;
  36954. }
  36955. return match[1].split(/\s+/);
  36956. }
  36957. function needsToBorrowParentOpeningTagEndMarker(node) {
  36958. return !node.prev && node.isLeadingSpaceSensitive && !node.hasLeadingSpaces;
  36959. }
  36960. function printAttributes(path, options, print) {
  36961. const node = path.getValue();
  36962. if (!isNonEmptyArray(node.attrs)) {
  36963. return node.isSelfClosing ? " " : "";
  36964. }
  36965. const ignoreAttributeData = node.prev && node.prev.type === "comment" && getPrettierIgnoreAttributeCommentData(node.prev.value);
  36966. const hasPrettierIgnoreAttribute = typeof ignoreAttributeData === "boolean" ? () => ignoreAttributeData : Array.isArray(ignoreAttributeData) ? (attribute) => ignoreAttributeData.includes(attribute.rawName) : () => false;
  36967. const printedAttributes = path.map((attributePath) => {
  36968. const attribute = attributePath.getValue();
  36969. return hasPrettierIgnoreAttribute(attribute) ? replaceTextEndOfLine(options.originalText.slice(locStart(attribute), locEnd(attribute))) : print();
  36970. }, "attrs");
  36971. const forceNotToBreakAttrContent = node.type === "element" && node.fullName === "script" && node.attrs.length === 1 && node.attrs[0].fullName === "src" && node.children.length === 0;
  36972. const attributeLine = options.singleAttributePerLine && node.attrs.length > 1 ? hardline : line;
  36973. const parts = [indent([forceNotToBreakAttrContent ? " " : line, join(attributeLine, printedAttributes)])];
  36974. if (node.firstChild && needsToBorrowParentOpeningTagEndMarker(node.firstChild) || node.isSelfClosing && needsToBorrowLastChildClosingTagEndMarker(node.parent) || forceNotToBreakAttrContent) {
  36975. parts.push(node.isSelfClosing ? " " : "");
  36976. } else {
  36977. parts.push(options.bracketSameLine ? node.isSelfClosing ? " " : "" : node.isSelfClosing ? line : softline);
  36978. }
  36979. return parts;
  36980. }
  36981. function printOpeningTagEnd(node) {
  36982. return node.firstChild && needsToBorrowParentOpeningTagEndMarker(node.firstChild) ? "" : printOpeningTagEndMarker(node);
  36983. }
  36984. function printOpeningTag(path, options, print) {
  36985. const node = path.getValue();
  36986. return [printOpeningTagStart(node, options), printAttributes(path, options, print), node.isSelfClosing ? "" : printOpeningTagEnd(node)];
  36987. }
  36988. function printOpeningTagStart(node, options) {
  36989. return node.prev && needsToBorrowNextOpeningTagStartMarker(node.prev) ? "" : [printOpeningTagPrefix(node, options), printOpeningTagStartMarker(node)];
  36990. }
  36991. function printOpeningTagPrefix(node, options) {
  36992. return needsToBorrowParentOpeningTagEndMarker(node) ? printOpeningTagEndMarker(node.parent) : needsToBorrowPrevClosingTagEndMarker(node) ? printClosingTagEndMarker(node.prev, options) : "";
  36993. }
  36994. function printOpeningTagStartMarker(node) {
  36995. switch (node.type) {
  36996. case "ieConditionalComment":
  36997. case "ieConditionalStartComment":
  36998. return `<!--[if ${node.condition}`;
  36999. case "ieConditionalEndComment":
  37000. return "<!--<!";
  37001. case "interpolation":
  37002. return "{{";
  37003. case "docType":
  37004. return "<!DOCTYPE";
  37005. case "element":
  37006. if (node.condition) {
  37007. return `<!--[if ${node.condition}]><!--><${node.rawName}`;
  37008. }
  37009. default:
  37010. return `<${node.rawName}`;
  37011. }
  37012. }
  37013. function printOpeningTagEndMarker(node) {
  37014. assert(!node.isSelfClosing);
  37015. switch (node.type) {
  37016. case "ieConditionalComment":
  37017. return "]>";
  37018. case "element":
  37019. if (node.condition) {
  37020. return "><!--<![endif]-->";
  37021. }
  37022. default:
  37023. return ">";
  37024. }
  37025. }
  37026. module2.exports = {
  37027. printClosingTag,
  37028. printClosingTagStart,
  37029. printClosingTagStartMarker,
  37030. printClosingTagEndMarker,
  37031. printClosingTagSuffix,
  37032. printClosingTagEnd,
  37033. needsToBorrowLastChildClosingTagEndMarker,
  37034. needsToBorrowParentClosingTagStartMarker,
  37035. needsToBorrowPrevClosingTagEndMarker,
  37036. printOpeningTag,
  37037. printOpeningTagStart,
  37038. printOpeningTagPrefix,
  37039. printOpeningTagStartMarker,
  37040. printOpeningTagEndMarker,
  37041. needsToBorrowNextOpeningTagStartMarker,
  37042. needsToBorrowParentOpeningTagEndMarker
  37043. };
  37044. }
  37045. });
  37046. var require_parse_srcset = __commonJS2({
  37047. "node_modules/parse-srcset/src/parse-srcset.js"(exports2, module2) {
  37048. (function(root, factory) {
  37049. if (typeof define === "function" && define.amd) {
  37050. define([], factory);
  37051. } else if (typeof module2 === "object" && module2.exports) {
  37052. module2.exports = factory();
  37053. } else {
  37054. root.parseSrcset = factory();
  37055. }
  37056. })(exports2, function() {
  37057. return function(input, options) {
  37058. var logger = options && options.logger || console;
  37059. function isSpace(c2) {
  37060. return c2 === " " || c2 === " " || c2 === "\n" || c2 === "\f" || c2 === "\r";
  37061. }
  37062. function collectCharacters(regEx) {
  37063. var chars, match = regEx.exec(input.substring(pos));
  37064. if (match) {
  37065. chars = match[0];
  37066. pos += chars.length;
  37067. return chars;
  37068. }
  37069. }
  37070. var inputLength = input.length, regexLeadingSpaces = /^[ \t\n\r\u000c]+/, regexLeadingCommasOrSpaces = /^[, \t\n\r\u000c]+/, regexLeadingNotSpaces = /^[^ \t\n\r\u000c]+/, regexTrailingCommas = /[,]+$/, regexNonNegativeInteger = /^\d+$/, regexFloatingPoint = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/, url, descriptors, currentDescriptor, state, c, pos = 0, candidates = [];
  37071. while (true) {
  37072. collectCharacters(regexLeadingCommasOrSpaces);
  37073. if (pos >= inputLength) {
  37074. return candidates;
  37075. }
  37076. url = collectCharacters(regexLeadingNotSpaces);
  37077. descriptors = [];
  37078. if (url.slice(-1) === ",") {
  37079. url = url.replace(regexTrailingCommas, "");
  37080. parseDescriptors();
  37081. } else {
  37082. tokenize();
  37083. }
  37084. }
  37085. function tokenize() {
  37086. collectCharacters(regexLeadingSpaces);
  37087. currentDescriptor = "";
  37088. state = "in descriptor";
  37089. while (true) {
  37090. c = input.charAt(pos);
  37091. if (state === "in descriptor") {
  37092. if (isSpace(c)) {
  37093. if (currentDescriptor) {
  37094. descriptors.push(currentDescriptor);
  37095. currentDescriptor = "";
  37096. state = "after descriptor";
  37097. }
  37098. } else if (c === ",") {
  37099. pos += 1;
  37100. if (currentDescriptor) {
  37101. descriptors.push(currentDescriptor);
  37102. }
  37103. parseDescriptors();
  37104. return;
  37105. } else if (c === "(") {
  37106. currentDescriptor = currentDescriptor + c;
  37107. state = "in parens";
  37108. } else if (c === "") {
  37109. if (currentDescriptor) {
  37110. descriptors.push(currentDescriptor);
  37111. }
  37112. parseDescriptors();
  37113. return;
  37114. } else {
  37115. currentDescriptor = currentDescriptor + c;
  37116. }
  37117. } else if (state === "in parens") {
  37118. if (c === ")") {
  37119. currentDescriptor = currentDescriptor + c;
  37120. state = "in descriptor";
  37121. } else if (c === "") {
  37122. descriptors.push(currentDescriptor);
  37123. parseDescriptors();
  37124. return;
  37125. } else {
  37126. currentDescriptor = currentDescriptor + c;
  37127. }
  37128. } else if (state === "after descriptor") {
  37129. if (isSpace(c)) {
  37130. } else if (c === "") {
  37131. parseDescriptors();
  37132. return;
  37133. } else {
  37134. state = "in descriptor";
  37135. pos -= 1;
  37136. }
  37137. }
  37138. pos += 1;
  37139. }
  37140. }
  37141. function parseDescriptors() {
  37142. var pError = false, w, d, h, i, candidate = {}, desc, lastChar, value, intVal, floatVal;
  37143. for (i = 0; i < descriptors.length; i++) {
  37144. desc = descriptors[i];
  37145. lastChar = desc[desc.length - 1];
  37146. value = desc.substring(0, desc.length - 1);
  37147. intVal = parseInt(value, 10);
  37148. floatVal = parseFloat(value);
  37149. if (regexNonNegativeInteger.test(value) && lastChar === "w") {
  37150. if (w || d) {
  37151. pError = true;
  37152. }
  37153. if (intVal === 0) {
  37154. pError = true;
  37155. } else {
  37156. w = intVal;
  37157. }
  37158. } else if (regexFloatingPoint.test(value) && lastChar === "x") {
  37159. if (w || d || h) {
  37160. pError = true;
  37161. }
  37162. if (floatVal < 0) {
  37163. pError = true;
  37164. } else {
  37165. d = floatVal;
  37166. }
  37167. } else if (regexNonNegativeInteger.test(value) && lastChar === "h") {
  37168. if (h || d) {
  37169. pError = true;
  37170. }
  37171. if (intVal === 0) {
  37172. pError = true;
  37173. } else {
  37174. h = intVal;
  37175. }
  37176. } else {
  37177. pError = true;
  37178. }
  37179. }
  37180. if (!pError) {
  37181. candidate.url = url;
  37182. if (w) {
  37183. candidate.w = w;
  37184. }
  37185. if (d) {
  37186. candidate.d = d;
  37187. }
  37188. if (h) {
  37189. candidate.h = h;
  37190. }
  37191. candidates.push(candidate);
  37192. } else if (logger && logger.error) {
  37193. logger.error("Invalid srcset descriptor found in '" + input + "' at '" + desc + "'.");
  37194. }
  37195. }
  37196. };
  37197. });
  37198. }
  37199. });
  37200. var require_syntax_attribute = __commonJS2({
  37201. "src/language-html/syntax-attribute.js"(exports2, module2) {
  37202. "use strict";
  37203. var parseSrcset = require_parse_srcset();
  37204. var {
  37205. builders: {
  37206. ifBreak,
  37207. join,
  37208. line
  37209. }
  37210. } = require("./doc.js");
  37211. function printImgSrcset(value) {
  37212. const srcset = parseSrcset(value, {
  37213. logger: {
  37214. error(message) {
  37215. throw new Error(message);
  37216. }
  37217. }
  37218. });
  37219. const hasW = srcset.some(({
  37220. w
  37221. }) => w);
  37222. const hasH = srcset.some(({
  37223. h
  37224. }) => h);
  37225. const hasX = srcset.some(({
  37226. d
  37227. }) => d);
  37228. if (hasW + hasH + hasX > 1) {
  37229. throw new Error("Mixed descriptor in srcset is not supported");
  37230. }
  37231. const key = hasW ? "w" : hasH ? "h" : "d";
  37232. const unit = hasW ? "w" : hasH ? "h" : "x";
  37233. const getMax = (values) => Math.max(...values);
  37234. const urls = srcset.map((src) => src.url);
  37235. const maxUrlLength = getMax(urls.map((url) => url.length));
  37236. const descriptors = srcset.map((src) => src[key]).map((descriptor) => descriptor ? descriptor.toString() : "");
  37237. const descriptorLeftLengths = descriptors.map((descriptor) => {
  37238. const index = descriptor.indexOf(".");
  37239. return index === -1 ? descriptor.length : index;
  37240. });
  37241. const maxDescriptorLeftLength = getMax(descriptorLeftLengths);
  37242. return join([",", line], urls.map((url, index) => {
  37243. const parts = [url];
  37244. const descriptor = descriptors[index];
  37245. if (descriptor) {
  37246. const urlPadding = maxUrlLength - url.length + 1;
  37247. const descriptorPadding = maxDescriptorLeftLength - descriptorLeftLengths[index];
  37248. const alignment = " ".repeat(urlPadding + descriptorPadding);
  37249. parts.push(ifBreak(alignment, " "), descriptor + unit);
  37250. }
  37251. return parts;
  37252. }));
  37253. }
  37254. function printClassNames(value) {
  37255. return value.trim().split(/\s+/).join(" ");
  37256. }
  37257. module2.exports = {
  37258. printImgSrcset,
  37259. printClassNames
  37260. };
  37261. }
  37262. });
  37263. var require_syntax_vue = __commonJS2({
  37264. "src/language-html/syntax-vue.js"(exports2, module2) {
  37265. "use strict";
  37266. var {
  37267. builders: {
  37268. group
  37269. }
  37270. } = require("./doc.js");
  37271. function printVueFor(value, textToDoc) {
  37272. const {
  37273. left,
  37274. operator,
  37275. right
  37276. } = parseVueFor(value);
  37277. return [group(textToDoc(`function _(${left}) {}`, {
  37278. parser: "babel",
  37279. __isVueForBindingLeft: true
  37280. })), " ", operator, " ", textToDoc(right, {
  37281. parser: "__js_expression"
  37282. }, {
  37283. stripTrailingHardline: true
  37284. })];
  37285. }
  37286. function parseVueFor(value) {
  37287. const forAliasRE = /(.*?)\s+(in|of)\s+(.*)/s;
  37288. const forIteratorRE = /,([^,\]}]*)(?:,([^,\]}]*))?$/;
  37289. const stripParensRE = /^\(|\)$/g;
  37290. const inMatch = value.match(forAliasRE);
  37291. if (!inMatch) {
  37292. return;
  37293. }
  37294. const res = {};
  37295. res.for = inMatch[3].trim();
  37296. if (!res.for) {
  37297. return;
  37298. }
  37299. const alias = inMatch[1].trim().replace(stripParensRE, "");
  37300. const iteratorMatch = alias.match(forIteratorRE);
  37301. if (iteratorMatch) {
  37302. res.alias = alias.replace(forIteratorRE, "");
  37303. res.iterator1 = iteratorMatch[1].trim();
  37304. if (iteratorMatch[2]) {
  37305. res.iterator2 = iteratorMatch[2].trim();
  37306. }
  37307. } else {
  37308. res.alias = alias;
  37309. }
  37310. const left = [res.alias, res.iterator1, res.iterator2];
  37311. if (left.some((part, index) => !part && (index === 0 || left.slice(index + 1).some(Boolean)))) {
  37312. return;
  37313. }
  37314. return {
  37315. left: left.filter(Boolean).join(","),
  37316. operator: inMatch[2],
  37317. right: res.for
  37318. };
  37319. }
  37320. function printVueBindings(value, textToDoc) {
  37321. return textToDoc(`function _(${value}) {}`, {
  37322. parser: "babel",
  37323. __isVueBindings: true
  37324. });
  37325. }
  37326. function isVueEventBindingExpression(eventBindingValue) {
  37327. const fnExpRE = /^(?:[\w$]+|\([^)]*\))\s*=>|^function\s*\(/;
  37328. const simplePathRE = /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*']|\["[^"]*"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
  37329. const value = eventBindingValue.trim();
  37330. return fnExpRE.test(value) || simplePathRE.test(value);
  37331. }
  37332. module2.exports = {
  37333. isVueEventBindingExpression,
  37334. printVueFor,
  37335. printVueBindings
  37336. };
  37337. }
  37338. });
  37339. var require_get_node_content = __commonJS2({
  37340. "src/language-html/get-node-content.js"(exports2, module2) {
  37341. "use strict";
  37342. var {
  37343. needsToBorrowParentClosingTagStartMarker,
  37344. printClosingTagStartMarker,
  37345. needsToBorrowLastChildClosingTagEndMarker,
  37346. printClosingTagEndMarker,
  37347. needsToBorrowParentOpeningTagEndMarker,
  37348. printOpeningTagEndMarker
  37349. } = require_tag();
  37350. function getNodeContent(node, options) {
  37351. let start = node.startSourceSpan.end.offset;
  37352. if (node.firstChild && needsToBorrowParentOpeningTagEndMarker(node.firstChild)) {
  37353. start -= printOpeningTagEndMarker(node).length;
  37354. }
  37355. let end = node.endSourceSpan.start.offset;
  37356. if (node.lastChild && needsToBorrowParentClosingTagStartMarker(node.lastChild)) {
  37357. end += printClosingTagStartMarker(node, options).length;
  37358. } else if (needsToBorrowLastChildClosingTagEndMarker(node)) {
  37359. end -= printClosingTagEndMarker(node.lastChild, options).length;
  37360. }
  37361. return options.originalText.slice(start, end);
  37362. }
  37363. module2.exports = getNodeContent;
  37364. }
  37365. });
  37366. var require_embed4 = __commonJS2({
  37367. "src/language-html/embed.js"(exports2, module2) {
  37368. "use strict";
  37369. var {
  37370. builders: {
  37371. breakParent,
  37372. group,
  37373. hardline,
  37374. indent,
  37375. line,
  37376. fill,
  37377. softline
  37378. },
  37379. utils: {
  37380. mapDoc,
  37381. replaceTextEndOfLine
  37382. }
  37383. } = require("./doc.js");
  37384. var printFrontMatter = require_print();
  37385. var {
  37386. printClosingTag,
  37387. printClosingTagSuffix,
  37388. needsToBorrowPrevClosingTagEndMarker,
  37389. printOpeningTagPrefix,
  37390. printOpeningTag
  37391. } = require_tag();
  37392. var {
  37393. printImgSrcset,
  37394. printClassNames
  37395. } = require_syntax_attribute();
  37396. var {
  37397. printVueFor,
  37398. printVueBindings,
  37399. isVueEventBindingExpression
  37400. } = require_syntax_vue();
  37401. var {
  37402. isScriptLikeTag,
  37403. isVueNonHtmlBlock,
  37404. inferScriptParser,
  37405. htmlTrimPreserveIndentation,
  37406. dedentString,
  37407. unescapeQuoteEntities,
  37408. isVueSlotAttribute,
  37409. isVueSfcBindingsAttribute,
  37410. getTextValueParts
  37411. } = require_utils11();
  37412. var getNodeContent = require_get_node_content();
  37413. function printEmbeddedAttributeValue(node, htmlTextToDoc, options) {
  37414. const isKeyMatched = (patterns) => new RegExp(patterns.join("|")).test(node.fullName);
  37415. const getValue = () => unescapeQuoteEntities(node.value);
  37416. let shouldHug = false;
  37417. const __onHtmlBindingRoot = (root, options2) => {
  37418. const rootNode = root.type === "NGRoot" ? root.node.type === "NGMicrosyntax" && root.node.body.length === 1 && root.node.body[0].type === "NGMicrosyntaxExpression" ? root.node.body[0].expression : root.node : root.type === "JsExpressionRoot" ? root.node : root;
  37419. if (rootNode && (rootNode.type === "ObjectExpression" || rootNode.type === "ArrayExpression" || options2.parser === "__vue_expression" && (rootNode.type === "TemplateLiteral" || rootNode.type === "StringLiteral"))) {
  37420. shouldHug = true;
  37421. }
  37422. };
  37423. const printHug = (doc2) => group(doc2);
  37424. const printExpand = (doc2, canHaveTrailingWhitespace = true) => group([indent([softline, doc2]), canHaveTrailingWhitespace ? softline : ""]);
  37425. const printMaybeHug = (doc2) => shouldHug ? printHug(doc2) : printExpand(doc2);
  37426. const attributeTextToDoc = (code, opts) => htmlTextToDoc(code, Object.assign({
  37427. __onHtmlBindingRoot,
  37428. __embeddedInHtml: true
  37429. }, opts));
  37430. if (node.fullName === "srcset" && (node.parent.fullName === "img" || node.parent.fullName === "source")) {
  37431. return printExpand(printImgSrcset(getValue()));
  37432. }
  37433. if (node.fullName === "class" && !options.parentParser) {
  37434. const value = getValue();
  37435. if (!value.includes("{{")) {
  37436. return printClassNames(value);
  37437. }
  37438. }
  37439. if (node.fullName === "style" && !options.parentParser) {
  37440. const value = getValue();
  37441. if (!value.includes("{{")) {
  37442. return printExpand(attributeTextToDoc(value, {
  37443. parser: "css",
  37444. __isHTMLStyleAttribute: true
  37445. }));
  37446. }
  37447. }
  37448. if (options.parser === "vue") {
  37449. if (node.fullName === "v-for") {
  37450. return printVueFor(getValue(), attributeTextToDoc);
  37451. }
  37452. if (isVueSlotAttribute(node) || isVueSfcBindingsAttribute(node, options)) {
  37453. return printVueBindings(getValue(), attributeTextToDoc);
  37454. }
  37455. const vueEventBindingPatterns = ["^@", "^v-on:"];
  37456. const vueExpressionBindingPatterns = ["^:", "^v-bind:"];
  37457. const jsExpressionBindingPatterns = ["^v-"];
  37458. if (isKeyMatched(vueEventBindingPatterns)) {
  37459. const value = getValue();
  37460. return printMaybeHug(attributeTextToDoc(value, {
  37461. parser: isVueEventBindingExpression(value) ? "__js_expression" : "__vue_event_binding"
  37462. }));
  37463. }
  37464. if (isKeyMatched(vueExpressionBindingPatterns)) {
  37465. return printMaybeHug(attributeTextToDoc(getValue(), {
  37466. parser: "__vue_expression"
  37467. }));
  37468. }
  37469. if (isKeyMatched(jsExpressionBindingPatterns)) {
  37470. return printMaybeHug(attributeTextToDoc(getValue(), {
  37471. parser: "__js_expression"
  37472. }));
  37473. }
  37474. }
  37475. if (options.parser === "angular") {
  37476. const ngTextToDoc = (code, opts) => attributeTextToDoc(code, Object.assign(Object.assign({}, opts), {}, {
  37477. trailingComma: "none"
  37478. }));
  37479. const ngDirectiveBindingPatterns = ["^\\*"];
  37480. const ngStatementBindingPatterns = ["^\\(.+\\)$", "^on-"];
  37481. const ngExpressionBindingPatterns = ["^\\[.+\\]$", "^bind(on)?-", "^ng-(if|show|hide|class|style)$"];
  37482. const ngI18nPatterns = ["^i18n(-.+)?$"];
  37483. if (isKeyMatched(ngStatementBindingPatterns)) {
  37484. return printMaybeHug(ngTextToDoc(getValue(), {
  37485. parser: "__ng_action"
  37486. }));
  37487. }
  37488. if (isKeyMatched(ngExpressionBindingPatterns)) {
  37489. return printMaybeHug(ngTextToDoc(getValue(), {
  37490. parser: "__ng_binding"
  37491. }));
  37492. }
  37493. if (isKeyMatched(ngI18nPatterns)) {
  37494. const value2 = getValue().trim();
  37495. return printExpand(fill(getTextValueParts(node, value2)), !value2.includes("@@"));
  37496. }
  37497. if (isKeyMatched(ngDirectiveBindingPatterns)) {
  37498. return printMaybeHug(ngTextToDoc(getValue(), {
  37499. parser: "__ng_directive"
  37500. }));
  37501. }
  37502. const interpolationRegex = /{{(.+?)}}/s;
  37503. const value = getValue();
  37504. if (interpolationRegex.test(value)) {
  37505. const parts = [];
  37506. for (const [index, part] of value.split(interpolationRegex).entries()) {
  37507. if (index % 2 === 0) {
  37508. parts.push(replaceTextEndOfLine(part));
  37509. } else {
  37510. try {
  37511. parts.push(group(["{{", indent([line, ngTextToDoc(part, {
  37512. parser: "__ng_interpolation",
  37513. __isInHtmlInterpolation: true
  37514. })]), line, "}}"]));
  37515. } catch {
  37516. parts.push("{{", replaceTextEndOfLine(part), "}}");
  37517. }
  37518. }
  37519. }
  37520. return group(parts);
  37521. }
  37522. }
  37523. return null;
  37524. }
  37525. function embed(path, print, textToDoc, options) {
  37526. const node = path.getValue();
  37527. switch (node.type) {
  37528. case "element": {
  37529. if (isScriptLikeTag(node) || node.type === "interpolation") {
  37530. return;
  37531. }
  37532. if (!node.isSelfClosing && isVueNonHtmlBlock(node, options)) {
  37533. const parser = inferScriptParser(node, options);
  37534. if (!parser) {
  37535. return;
  37536. }
  37537. const content = getNodeContent(node, options);
  37538. let isEmpty = /^\s*$/.test(content);
  37539. let doc2 = "";
  37540. if (!isEmpty) {
  37541. doc2 = textToDoc(htmlTrimPreserveIndentation(content), {
  37542. parser,
  37543. __embeddedInHtml: true
  37544. }, {
  37545. stripTrailingHardline: true
  37546. });
  37547. isEmpty = doc2 === "";
  37548. }
  37549. return [printOpeningTagPrefix(node, options), group(printOpeningTag(path, options, print)), isEmpty ? "" : hardline, doc2, isEmpty ? "" : hardline, printClosingTag(node, options), printClosingTagSuffix(node, options)];
  37550. }
  37551. break;
  37552. }
  37553. case "text": {
  37554. if (isScriptLikeTag(node.parent)) {
  37555. const parser = inferScriptParser(node.parent);
  37556. if (parser) {
  37557. const value = parser === "markdown" ? dedentString(node.value.replace(/^[^\S\n]*\n/, "")) : node.value;
  37558. const textToDocOptions = {
  37559. parser,
  37560. __embeddedInHtml: true
  37561. };
  37562. if (options.parser === "html" && parser === "babel") {
  37563. let sourceType = "script";
  37564. const {
  37565. attrMap
  37566. } = node.parent;
  37567. if (attrMap && (attrMap.type === "module" || attrMap.type === "text/babel" && attrMap["data-type"] === "module")) {
  37568. sourceType = "module";
  37569. }
  37570. textToDocOptions.__babelSourceType = sourceType;
  37571. }
  37572. return [breakParent, printOpeningTagPrefix(node, options), textToDoc(value, textToDocOptions, {
  37573. stripTrailingHardline: true
  37574. }), printClosingTagSuffix(node, options)];
  37575. }
  37576. } else if (node.parent.type === "interpolation") {
  37577. const textToDocOptions = {
  37578. __isInHtmlInterpolation: true,
  37579. __embeddedInHtml: true
  37580. };
  37581. if (options.parser === "angular") {
  37582. textToDocOptions.parser = "__ng_interpolation";
  37583. textToDocOptions.trailingComma = "none";
  37584. } else if (options.parser === "vue") {
  37585. textToDocOptions.parser = "__vue_expression";
  37586. } else {
  37587. textToDocOptions.parser = "__js_expression";
  37588. }
  37589. return [indent([line, textToDoc(node.value, textToDocOptions, {
  37590. stripTrailingHardline: true
  37591. })]), node.parent.next && needsToBorrowPrevClosingTagEndMarker(node.parent.next) ? " " : line];
  37592. }
  37593. break;
  37594. }
  37595. case "attribute": {
  37596. if (!node.value) {
  37597. break;
  37598. }
  37599. if (/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(options.originalText.slice(node.valueSpan.start.offset, node.valueSpan.end.offset))) {
  37600. return [node.rawName, "=", node.value];
  37601. }
  37602. if (options.parser === "lwc") {
  37603. const interpolationRegex = /^{.*}$/s;
  37604. if (interpolationRegex.test(options.originalText.slice(node.valueSpan.start.offset, node.valueSpan.end.offset))) {
  37605. return [node.rawName, "=", node.value];
  37606. }
  37607. }
  37608. const embeddedAttributeValueDoc = printEmbeddedAttributeValue(node, (code, opts) => textToDoc(code, Object.assign({
  37609. __isInHtmlAttribute: true,
  37610. __embeddedInHtml: true
  37611. }, opts), {
  37612. stripTrailingHardline: true
  37613. }), options);
  37614. if (embeddedAttributeValueDoc) {
  37615. return [node.rawName, '="', group(mapDoc(embeddedAttributeValueDoc, (doc2) => typeof doc2 === "string" ? doc2.replace(/"/g, "&quot;") : doc2)), '"'];
  37616. }
  37617. break;
  37618. }
  37619. case "front-matter":
  37620. return printFrontMatter(node, textToDoc);
  37621. }
  37622. }
  37623. module2.exports = embed;
  37624. }
  37625. });
  37626. var require_children = __commonJS2({
  37627. "src/language-html/print/children.js"(exports2, module2) {
  37628. "use strict";
  37629. var {
  37630. builders: {
  37631. breakParent,
  37632. group,
  37633. ifBreak,
  37634. line,
  37635. softline,
  37636. hardline
  37637. },
  37638. utils: {
  37639. replaceTextEndOfLine
  37640. }
  37641. } = require("./doc.js");
  37642. var {
  37643. locStart,
  37644. locEnd
  37645. } = require_loc6();
  37646. var {
  37647. forceBreakChildren,
  37648. forceNextEmptyLine,
  37649. isTextLikeNode,
  37650. hasPrettierIgnore,
  37651. preferHardlineAsLeadingSpaces
  37652. } = require_utils11();
  37653. var {
  37654. printOpeningTagPrefix,
  37655. needsToBorrowNextOpeningTagStartMarker,
  37656. printOpeningTagStartMarker,
  37657. needsToBorrowPrevClosingTagEndMarker,
  37658. printClosingTagEndMarker,
  37659. printClosingTagSuffix,
  37660. needsToBorrowParentClosingTagStartMarker
  37661. } = require_tag();
  37662. function printChild(childPath, options, print) {
  37663. const child = childPath.getValue();
  37664. if (hasPrettierIgnore(child)) {
  37665. return [printOpeningTagPrefix(child, options), ...replaceTextEndOfLine(options.originalText.slice(locStart(child) + (child.prev && needsToBorrowNextOpeningTagStartMarker(child.prev) ? printOpeningTagStartMarker(child).length : 0), locEnd(child) - (child.next && needsToBorrowPrevClosingTagEndMarker(child.next) ? printClosingTagEndMarker(child, options).length : 0))), printClosingTagSuffix(child, options)];
  37666. }
  37667. return print();
  37668. }
  37669. function printBetweenLine(prevNode, nextNode) {
  37670. return isTextLikeNode(prevNode) && isTextLikeNode(nextNode) ? prevNode.isTrailingSpaceSensitive ? prevNode.hasTrailingSpaces ? preferHardlineAsLeadingSpaces(nextNode) ? hardline : line : "" : preferHardlineAsLeadingSpaces(nextNode) ? hardline : softline : needsToBorrowNextOpeningTagStartMarker(prevNode) && (hasPrettierIgnore(nextNode) || nextNode.firstChild || nextNode.isSelfClosing || nextNode.type === "element" && nextNode.attrs.length > 0) || prevNode.type === "element" && prevNode.isSelfClosing && needsToBorrowPrevClosingTagEndMarker(nextNode) ? "" : !nextNode.isLeadingSpaceSensitive || preferHardlineAsLeadingSpaces(nextNode) || needsToBorrowPrevClosingTagEndMarker(nextNode) && prevNode.lastChild && needsToBorrowParentClosingTagStartMarker(prevNode.lastChild) && prevNode.lastChild.lastChild && needsToBorrowParentClosingTagStartMarker(prevNode.lastChild.lastChild) ? hardline : nextNode.hasLeadingSpaces ? line : softline;
  37671. }
  37672. function printChildren(path, options, print) {
  37673. const node = path.getValue();
  37674. if (forceBreakChildren(node)) {
  37675. return [breakParent, ...path.map((childPath) => {
  37676. const childNode = childPath.getValue();
  37677. const prevBetweenLine = !childNode.prev ? "" : printBetweenLine(childNode.prev, childNode);
  37678. return [!prevBetweenLine ? "" : [prevBetweenLine, forceNextEmptyLine(childNode.prev) ? hardline : ""], printChild(childPath, options, print)];
  37679. }, "children")];
  37680. }
  37681. const groupIds = node.children.map(() => Symbol(""));
  37682. return path.map((childPath, childIndex) => {
  37683. const childNode = childPath.getValue();
  37684. if (isTextLikeNode(childNode)) {
  37685. if (childNode.prev && isTextLikeNode(childNode.prev)) {
  37686. const prevBetweenLine2 = printBetweenLine(childNode.prev, childNode);
  37687. if (prevBetweenLine2) {
  37688. if (forceNextEmptyLine(childNode.prev)) {
  37689. return [hardline, hardline, printChild(childPath, options, print)];
  37690. }
  37691. return [prevBetweenLine2, printChild(childPath, options, print)];
  37692. }
  37693. }
  37694. return printChild(childPath, options, print);
  37695. }
  37696. const prevParts = [];
  37697. const leadingParts = [];
  37698. const trailingParts = [];
  37699. const nextParts = [];
  37700. const prevBetweenLine = childNode.prev ? printBetweenLine(childNode.prev, childNode) : "";
  37701. const nextBetweenLine = childNode.next ? printBetweenLine(childNode, childNode.next) : "";
  37702. if (prevBetweenLine) {
  37703. if (forceNextEmptyLine(childNode.prev)) {
  37704. prevParts.push(hardline, hardline);
  37705. } else if (prevBetweenLine === hardline) {
  37706. prevParts.push(hardline);
  37707. } else {
  37708. if (isTextLikeNode(childNode.prev)) {
  37709. leadingParts.push(prevBetweenLine);
  37710. } else {
  37711. leadingParts.push(ifBreak("", softline, {
  37712. groupId: groupIds[childIndex - 1]
  37713. }));
  37714. }
  37715. }
  37716. }
  37717. if (nextBetweenLine) {
  37718. if (forceNextEmptyLine(childNode)) {
  37719. if (isTextLikeNode(childNode.next)) {
  37720. nextParts.push(hardline, hardline);
  37721. }
  37722. } else if (nextBetweenLine === hardline) {
  37723. if (isTextLikeNode(childNode.next)) {
  37724. nextParts.push(hardline);
  37725. }
  37726. } else {
  37727. trailingParts.push(nextBetweenLine);
  37728. }
  37729. }
  37730. return [...prevParts, group([...leadingParts, group([printChild(childPath, options, print), ...trailingParts], {
  37731. id: groupIds[childIndex]
  37732. })]), ...nextParts];
  37733. }, "children");
  37734. }
  37735. module2.exports = {
  37736. printChildren
  37737. };
  37738. }
  37739. });
  37740. var require_element = __commonJS2({
  37741. "src/language-html/print/element.js"(exports2, module2) {
  37742. "use strict";
  37743. var {
  37744. builders: {
  37745. breakParent,
  37746. dedentToRoot,
  37747. group,
  37748. ifBreak,
  37749. indentIfBreak,
  37750. indent,
  37751. line,
  37752. softline
  37753. },
  37754. utils: {
  37755. replaceTextEndOfLine
  37756. }
  37757. } = require("./doc.js");
  37758. var getNodeContent = require_get_node_content();
  37759. var {
  37760. shouldPreserveContent,
  37761. isScriptLikeTag,
  37762. isVueCustomBlock,
  37763. countParents,
  37764. forceBreakContent
  37765. } = require_utils11();
  37766. var {
  37767. printOpeningTagPrefix,
  37768. printOpeningTag,
  37769. printClosingTagSuffix,
  37770. printClosingTag,
  37771. needsToBorrowPrevClosingTagEndMarker,
  37772. needsToBorrowLastChildClosingTagEndMarker
  37773. } = require_tag();
  37774. var {
  37775. printChildren
  37776. } = require_children();
  37777. function printElement(path, options, print) {
  37778. const node = path.getValue();
  37779. if (shouldPreserveContent(node, options)) {
  37780. return [printOpeningTagPrefix(node, options), group(printOpeningTag(path, options, print)), ...replaceTextEndOfLine(getNodeContent(node, options)), ...printClosingTag(node, options), printClosingTagSuffix(node, options)];
  37781. }
  37782. const shouldHugContent = node.children.length === 1 && node.firstChild.type === "interpolation" && node.firstChild.isLeadingSpaceSensitive && !node.firstChild.hasLeadingSpaces && node.lastChild.isTrailingSpaceSensitive && !node.lastChild.hasTrailingSpaces;
  37783. const attrGroupId = Symbol("element-attr-group-id");
  37784. const printTag = (doc2) => group([group(printOpeningTag(path, options, print), {
  37785. id: attrGroupId
  37786. }), doc2, printClosingTag(node, options)]);
  37787. const printChildrenDoc = (childrenDoc) => {
  37788. if (shouldHugContent) {
  37789. return indentIfBreak(childrenDoc, {
  37790. groupId: attrGroupId
  37791. });
  37792. }
  37793. if ((isScriptLikeTag(node) || isVueCustomBlock(node, options)) && node.parent.type === "root" && options.parser === "vue" && !options.vueIndentScriptAndStyle) {
  37794. return childrenDoc;
  37795. }
  37796. return indent(childrenDoc);
  37797. };
  37798. const printLineBeforeChildren = () => {
  37799. if (shouldHugContent) {
  37800. return ifBreak(softline, "", {
  37801. groupId: attrGroupId
  37802. });
  37803. }
  37804. if (node.firstChild.hasLeadingSpaces && node.firstChild.isLeadingSpaceSensitive) {
  37805. return line;
  37806. }
  37807. if (node.firstChild.type === "text" && node.isWhitespaceSensitive && node.isIndentationSensitive) {
  37808. return dedentToRoot(softline);
  37809. }
  37810. return softline;
  37811. };
  37812. const printLineAfterChildren = () => {
  37813. const needsToBorrow = node.next ? needsToBorrowPrevClosingTagEndMarker(node.next) : needsToBorrowLastChildClosingTagEndMarker(node.parent);
  37814. if (needsToBorrow) {
  37815. if (node.lastChild.hasTrailingSpaces && node.lastChild.isTrailingSpaceSensitive) {
  37816. return " ";
  37817. }
  37818. return "";
  37819. }
  37820. if (shouldHugContent) {
  37821. return ifBreak(softline, "", {
  37822. groupId: attrGroupId
  37823. });
  37824. }
  37825. if (node.lastChild.hasTrailingSpaces && node.lastChild.isTrailingSpaceSensitive) {
  37826. return line;
  37827. }
  37828. if ((node.lastChild.type === "comment" || node.lastChild.type === "text" && node.isWhitespaceSensitive && node.isIndentationSensitive) && new RegExp(`\\n[\\t ]{${options.tabWidth * countParents(path, (node2) => node2.parent && node2.parent.type !== "root")}}$`).test(node.lastChild.value)) {
  37829. return "";
  37830. }
  37831. return softline;
  37832. };
  37833. if (node.children.length === 0) {
  37834. return printTag(node.hasDanglingSpaces && node.isDanglingSpaceSensitive ? line : "");
  37835. }
  37836. return printTag([forceBreakContent(node) ? breakParent : "", printChildrenDoc([printLineBeforeChildren(), printChildren(path, options, print)]), printLineAfterChildren()]);
  37837. }
  37838. module2.exports = {
  37839. printElement
  37840. };
  37841. }
  37842. });
  37843. var require_printer_html = __commonJS2({
  37844. "src/language-html/printer-html.js"(exports2, module2) {
  37845. "use strict";
  37846. var {
  37847. builders: {
  37848. fill,
  37849. group,
  37850. hardline,
  37851. literalline
  37852. },
  37853. utils: {
  37854. cleanDoc,
  37855. getDocParts,
  37856. isConcat,
  37857. replaceTextEndOfLine
  37858. }
  37859. } = require("./doc.js");
  37860. var clean = require_clean5();
  37861. var {
  37862. countChars,
  37863. unescapeQuoteEntities,
  37864. getTextValueParts
  37865. } = require_utils11();
  37866. var preprocess = require_print_preprocess3();
  37867. var {
  37868. insertPragma
  37869. } = require_pragma5();
  37870. var {
  37871. locStart,
  37872. locEnd
  37873. } = require_loc6();
  37874. var embed = require_embed4();
  37875. var {
  37876. printClosingTagSuffix,
  37877. printClosingTagEnd,
  37878. printOpeningTagPrefix,
  37879. printOpeningTagStart
  37880. } = require_tag();
  37881. var {
  37882. printElement
  37883. } = require_element();
  37884. var {
  37885. printChildren
  37886. } = require_children();
  37887. function genericPrint(path, options, print) {
  37888. const node = path.getValue();
  37889. switch (node.type) {
  37890. case "front-matter":
  37891. return replaceTextEndOfLine(node.raw);
  37892. case "root":
  37893. if (options.__onHtmlRoot) {
  37894. options.__onHtmlRoot(node);
  37895. }
  37896. return [group(printChildren(path, options, print)), hardline];
  37897. case "element":
  37898. case "ieConditionalComment": {
  37899. return printElement(path, options, print);
  37900. }
  37901. case "ieConditionalStartComment":
  37902. case "ieConditionalEndComment":
  37903. return [printOpeningTagStart(node), printClosingTagEnd(node)];
  37904. case "interpolation":
  37905. return [printOpeningTagStart(node, options), ...path.map(print, "children"), printClosingTagEnd(node, options)];
  37906. case "text": {
  37907. if (node.parent.type === "interpolation") {
  37908. const trailingNewlineRegex = /\n[^\S\n]*$/;
  37909. const hasTrailingNewline = trailingNewlineRegex.test(node.value);
  37910. const value = hasTrailingNewline ? node.value.replace(trailingNewlineRegex, "") : node.value;
  37911. return [...replaceTextEndOfLine(value), hasTrailingNewline ? hardline : ""];
  37912. }
  37913. const printed = cleanDoc([printOpeningTagPrefix(node, options), ...getTextValueParts(node), printClosingTagSuffix(node, options)]);
  37914. if (isConcat(printed) || printed.type === "fill") {
  37915. return fill(getDocParts(printed));
  37916. }
  37917. return printed;
  37918. }
  37919. case "docType":
  37920. return [group([printOpeningTagStart(node, options), " ", node.value.replace(/^html\b/i, "html").replace(/\s+/g, " ")]), printClosingTagEnd(node, options)];
  37921. case "comment": {
  37922. return [printOpeningTagPrefix(node, options), ...replaceTextEndOfLine(options.originalText.slice(locStart(node), locEnd(node)), literalline), printClosingTagSuffix(node, options)];
  37923. }
  37924. case "attribute": {
  37925. if (node.value === null) {
  37926. return node.rawName;
  37927. }
  37928. const value = unescapeQuoteEntities(node.value);
  37929. const singleQuoteCount = countChars(value, "'");
  37930. const doubleQuoteCount = countChars(value, '"');
  37931. const quote = singleQuoteCount < doubleQuoteCount ? "'" : '"';
  37932. return [node.rawName, "=", quote, ...replaceTextEndOfLine(quote === '"' ? value.replace(/"/g, "&quot;") : value.replace(/'/g, "&apos;")), quote];
  37933. }
  37934. default:
  37935. throw new Error(`Unexpected node type ${node.type}`);
  37936. }
  37937. }
  37938. module2.exports = {
  37939. preprocess,
  37940. print: genericPrint,
  37941. insertPragma,
  37942. massageAstNode: clean,
  37943. embed
  37944. };
  37945. }
  37946. });
  37947. var require_options6 = __commonJS2({
  37948. "src/language-html/options.js"(exports2, module2) {
  37949. "use strict";
  37950. var commonOptions = require_common_options();
  37951. var CATEGORY_HTML = "HTML";
  37952. module2.exports = {
  37953. bracketSameLine: commonOptions.bracketSameLine,
  37954. htmlWhitespaceSensitivity: {
  37955. since: "1.15.0",
  37956. category: CATEGORY_HTML,
  37957. type: "choice",
  37958. default: "css",
  37959. description: "How to handle whitespaces in HTML.",
  37960. choices: [{
  37961. value: "css",
  37962. description: "Respect the default value of CSS display property."
  37963. }, {
  37964. value: "strict",
  37965. description: "Whitespaces are considered sensitive."
  37966. }, {
  37967. value: "ignore",
  37968. description: "Whitespaces are considered insensitive."
  37969. }]
  37970. },
  37971. singleAttributePerLine: commonOptions.singleAttributePerLine,
  37972. vueIndentScriptAndStyle: {
  37973. since: "1.19.0",
  37974. category: CATEGORY_HTML,
  37975. type: "boolean",
  37976. default: false,
  37977. description: "Indent script and style tags in Vue files."
  37978. }
  37979. };
  37980. }
  37981. });
  37982. var require_parsers6 = __commonJS2({
  37983. "src/language-html/parsers.js"(exports2, module2) {
  37984. "use strict";
  37985. module2.exports = {
  37986. get html() {
  37987. return require("./parser-html.js").parsers.html;
  37988. },
  37989. get vue() {
  37990. return require("./parser-html.js").parsers.vue;
  37991. },
  37992. get angular() {
  37993. return require("./parser-html.js").parsers.angular;
  37994. },
  37995. get lwc() {
  37996. return require("./parser-html.js").parsers.lwc;
  37997. }
  37998. };
  37999. }
  38000. });
  38001. var require_HTML = __commonJS2({
  38002. "node_modules/linguist-languages/data/HTML.json"(exports2, module2) {
  38003. module2.exports = {
  38004. name: "HTML",
  38005. type: "markup",
  38006. tmScope: "text.html.basic",
  38007. aceMode: "html",
  38008. codemirrorMode: "htmlmixed",
  38009. codemirrorMimeType: "text/html",
  38010. color: "#e34c26",
  38011. aliases: ["xhtml"],
  38012. extensions: [".html", ".htm", ".html.hl", ".inc", ".xht", ".xhtml"],
  38013. languageId: 146
  38014. };
  38015. }
  38016. });
  38017. var require_Vue = __commonJS2({
  38018. "node_modules/linguist-languages/data/Vue.json"(exports2, module2) {
  38019. module2.exports = {
  38020. name: "Vue",
  38021. type: "markup",
  38022. color: "#41b883",
  38023. extensions: [".vue"],
  38024. tmScope: "text.html.vue",
  38025. aceMode: "html",
  38026. languageId: 391
  38027. };
  38028. }
  38029. });
  38030. var require_language_html = __commonJS2({
  38031. "src/language-html/index.js"(exports2, module2) {
  38032. "use strict";
  38033. var createLanguage = require_create_language();
  38034. var printer = require_printer_html();
  38035. var options = require_options6();
  38036. var parsers = require_parsers6();
  38037. var languages = [createLanguage(require_HTML(), () => ({
  38038. name: "Angular",
  38039. since: "1.15.0",
  38040. parsers: ["angular"],
  38041. vscodeLanguageIds: ["html"],
  38042. extensions: [".component.html"],
  38043. filenames: []
  38044. })), createLanguage(require_HTML(), (data) => ({
  38045. since: "1.15.0",
  38046. parsers: ["html"],
  38047. vscodeLanguageIds: ["html"],
  38048. extensions: [...data.extensions, ".mjml"]
  38049. })), createLanguage(require_HTML(), () => ({
  38050. name: "Lightning Web Components",
  38051. since: "1.17.0",
  38052. parsers: ["lwc"],
  38053. vscodeLanguageIds: ["html"],
  38054. extensions: [],
  38055. filenames: []
  38056. })), createLanguage(require_Vue(), () => ({
  38057. since: "1.10.0",
  38058. parsers: ["vue"],
  38059. vscodeLanguageIds: ["vue"]
  38060. }))];
  38061. var printers = {
  38062. html: printer
  38063. };
  38064. module2.exports = {
  38065. languages,
  38066. printers,
  38067. options,
  38068. parsers
  38069. };
  38070. }
  38071. });
  38072. var require_pragma6 = __commonJS2({
  38073. "src/language-yaml/pragma.js"(exports2, module2) {
  38074. "use strict";
  38075. function isPragma(text) {
  38076. return /^\s*@(?:prettier|format)\s*$/.test(text);
  38077. }
  38078. function hasPragma(text) {
  38079. return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/.test(text);
  38080. }
  38081. function insertPragma(text) {
  38082. return `# @format
  38083. ${text}`;
  38084. }
  38085. module2.exports = {
  38086. isPragma,
  38087. hasPragma,
  38088. insertPragma
  38089. };
  38090. }
  38091. });
  38092. var require_loc7 = __commonJS2({
  38093. "src/language-yaml/loc.js"(exports2, module2) {
  38094. "use strict";
  38095. function locStart(node) {
  38096. return node.position.start.offset;
  38097. }
  38098. function locEnd(node) {
  38099. return node.position.end.offset;
  38100. }
  38101. module2.exports = {
  38102. locStart,
  38103. locEnd
  38104. };
  38105. }
  38106. });
  38107. var require_embed5 = __commonJS2({
  38108. "src/language-yaml/embed.js"(exports2, module2) {
  38109. "use strict";
  38110. function embed(path, print, textToDoc, options) {
  38111. const node = path.getValue();
  38112. if (node.type === "root" && options.filepath && /(?:[/\\]|^)\.(?:prettier|stylelint)rc$/.test(options.filepath)) {
  38113. return textToDoc(options.originalText, Object.assign(Object.assign({}, options), {}, {
  38114. parser: "json"
  38115. }));
  38116. }
  38117. }
  38118. module2.exports = embed;
  38119. }
  38120. });
  38121. var require_utils12 = __commonJS2({
  38122. "src/language-yaml/utils.js"(exports2, module2) {
  38123. "use strict";
  38124. var {
  38125. getLast,
  38126. isNonEmptyArray
  38127. } = require_util();
  38128. function getAncestorCount(path, filter) {
  38129. let counter = 0;
  38130. const pathStackLength = path.stack.length - 1;
  38131. for (let i = 0; i < pathStackLength; i++) {
  38132. const value = path.stack[i];
  38133. if (isNode(value) && filter(value)) {
  38134. counter++;
  38135. }
  38136. }
  38137. return counter;
  38138. }
  38139. function isNode(value, types) {
  38140. return value && typeof value.type === "string" && (!types || types.includes(value.type));
  38141. }
  38142. function mapNode(node, callback, parent) {
  38143. return callback("children" in node ? Object.assign(Object.assign({}, node), {}, {
  38144. children: node.children.map((childNode) => mapNode(childNode, callback, node))
  38145. }) : node, parent);
  38146. }
  38147. function defineShortcut(x, key, getter) {
  38148. Object.defineProperty(x, key, {
  38149. get: getter,
  38150. enumerable: false
  38151. });
  38152. }
  38153. function isNextLineEmpty(node, text) {
  38154. let newlineCount = 0;
  38155. const textLength = text.length;
  38156. for (let i = node.position.end.offset - 1; i < textLength; i++) {
  38157. const char = text[i];
  38158. if (char === "\n") {
  38159. newlineCount++;
  38160. }
  38161. if (newlineCount === 1 && /\S/.test(char)) {
  38162. return false;
  38163. }
  38164. if (newlineCount === 2) {
  38165. return true;
  38166. }
  38167. }
  38168. return false;
  38169. }
  38170. function isLastDescendantNode(path) {
  38171. const node = path.getValue();
  38172. switch (node.type) {
  38173. case "tag":
  38174. case "anchor":
  38175. case "comment":
  38176. return false;
  38177. }
  38178. const pathStackLength = path.stack.length;
  38179. for (let i = 1; i < pathStackLength; i++) {
  38180. const item = path.stack[i];
  38181. const parentItem = path.stack[i - 1];
  38182. if (Array.isArray(parentItem) && typeof item === "number" && item !== parentItem.length - 1) {
  38183. return false;
  38184. }
  38185. }
  38186. return true;
  38187. }
  38188. function getLastDescendantNode(node) {
  38189. return isNonEmptyArray(node.children) ? getLastDescendantNode(getLast(node.children)) : node;
  38190. }
  38191. function isPrettierIgnore(comment) {
  38192. return comment.value.trim() === "prettier-ignore";
  38193. }
  38194. function hasPrettierIgnore(path) {
  38195. const node = path.getValue();
  38196. if (node.type === "documentBody") {
  38197. const document = path.getParentNode();
  38198. return hasEndComments(document.head) && isPrettierIgnore(getLast(document.head.endComments));
  38199. }
  38200. return hasLeadingComments(node) && isPrettierIgnore(getLast(node.leadingComments));
  38201. }
  38202. function isEmptyNode(node) {
  38203. return !isNonEmptyArray(node.children) && !hasComments(node);
  38204. }
  38205. function hasComments(node) {
  38206. return hasLeadingComments(node) || hasMiddleComments(node) || hasIndicatorComment(node) || hasTrailingComment(node) || hasEndComments(node);
  38207. }
  38208. function hasLeadingComments(node) {
  38209. return node && isNonEmptyArray(node.leadingComments);
  38210. }
  38211. function hasMiddleComments(node) {
  38212. return node && isNonEmptyArray(node.middleComments);
  38213. }
  38214. function hasIndicatorComment(node) {
  38215. return node && node.indicatorComment;
  38216. }
  38217. function hasTrailingComment(node) {
  38218. return node && node.trailingComment;
  38219. }
  38220. function hasEndComments(node) {
  38221. return node && isNonEmptyArray(node.endComments);
  38222. }
  38223. function splitWithSingleSpace(text) {
  38224. const parts = [];
  38225. let lastPart;
  38226. for (const part of text.split(/( +)/)) {
  38227. if (part !== " ") {
  38228. if (lastPart === " ") {
  38229. parts.push(part);
  38230. } else {
  38231. parts.push((parts.pop() || "") + part);
  38232. }
  38233. } else if (lastPart === void 0) {
  38234. parts.unshift("");
  38235. }
  38236. lastPart = part;
  38237. }
  38238. if (lastPart === " ") {
  38239. parts.push((parts.pop() || "") + " ");
  38240. }
  38241. if (parts[0] === "") {
  38242. parts.shift();
  38243. parts.unshift(" " + (parts.shift() || ""));
  38244. }
  38245. return parts;
  38246. }
  38247. function getFlowScalarLineContents(nodeType, content, options) {
  38248. const rawLineContents = content.split("\n").map((lineContent, index, lineContents) => index === 0 && index === lineContents.length - 1 ? lineContent : index !== 0 && index !== lineContents.length - 1 ? lineContent.trim() : index === 0 ? lineContent.trimEnd() : lineContent.trimStart());
  38249. if (options.proseWrap === "preserve") {
  38250. return rawLineContents.map((lineContent) => lineContent.length === 0 ? [] : [lineContent]);
  38251. }
  38252. return rawLineContents.map((lineContent) => lineContent.length === 0 ? [] : splitWithSingleSpace(lineContent)).reduce((reduced, lineContentWords, index) => index !== 0 && rawLineContents[index - 1].length > 0 && lineContentWords.length > 0 && !(nodeType === "quoteDouble" && getLast(getLast(reduced)).endsWith("\\")) ? [...reduced.slice(0, -1), [...getLast(reduced), ...lineContentWords]] : [...reduced, lineContentWords], []).map((lineContentWords) => options.proseWrap === "never" ? [lineContentWords.join(" ")] : lineContentWords);
  38253. }
  38254. function getBlockValueLineContents(node, {
  38255. parentIndent,
  38256. isLastDescendant,
  38257. options
  38258. }) {
  38259. const content = node.position.start.line === node.position.end.line ? "" : options.originalText.slice(node.position.start.offset, node.position.end.offset).match(/^[^\n]*\n(.*)$/s)[1];
  38260. let leadingSpaceCount;
  38261. if (node.indent === null) {
  38262. const matches = content.match(/^(?<leadingSpace> *)[^\n\r ]/m);
  38263. leadingSpaceCount = matches ? matches.groups.leadingSpace.length : Number.POSITIVE_INFINITY;
  38264. } else {
  38265. leadingSpaceCount = node.indent - 1 + parentIndent;
  38266. }
  38267. const rawLineContents = content.split("\n").map((lineContent) => lineContent.slice(leadingSpaceCount));
  38268. if (options.proseWrap === "preserve" || node.type === "blockLiteral") {
  38269. return removeUnnecessaryTrailingNewlines(rawLineContents.map((lineContent) => lineContent.length === 0 ? [] : [lineContent]));
  38270. }
  38271. return removeUnnecessaryTrailingNewlines(rawLineContents.map((lineContent) => lineContent.length === 0 ? [] : splitWithSingleSpace(lineContent)).reduce((reduced, lineContentWords, index) => index !== 0 && rawLineContents[index - 1].length > 0 && lineContentWords.length > 0 && !/^\s/.test(lineContentWords[0]) && !/^\s|\s$/.test(getLast(reduced)) ? [...reduced.slice(0, -1), [...getLast(reduced), ...lineContentWords]] : [...reduced, lineContentWords], []).map((lineContentWords) => lineContentWords.reduce((reduced, word) => reduced.length > 0 && /\s$/.test(getLast(reduced)) ? [...reduced.slice(0, -1), getLast(reduced) + " " + word] : [...reduced, word], [])).map((lineContentWords) => options.proseWrap === "never" ? [lineContentWords.join(" ")] : lineContentWords));
  38272. function removeUnnecessaryTrailingNewlines(lineContents) {
  38273. if (node.chomping === "keep") {
  38274. return getLast(lineContents).length === 0 ? lineContents.slice(0, -1) : lineContents;
  38275. }
  38276. let trailingNewlineCount = 0;
  38277. for (let i = lineContents.length - 1; i >= 0; i--) {
  38278. if (lineContents[i].length === 0) {
  38279. trailingNewlineCount++;
  38280. } else {
  38281. break;
  38282. }
  38283. }
  38284. return trailingNewlineCount === 0 ? lineContents : trailingNewlineCount >= 2 && !isLastDescendant ? lineContents.slice(0, -(trailingNewlineCount - 1)) : lineContents.slice(0, -trailingNewlineCount);
  38285. }
  38286. }
  38287. function isInlineNode(node) {
  38288. if (!node) {
  38289. return true;
  38290. }
  38291. switch (node.type) {
  38292. case "plain":
  38293. case "quoteDouble":
  38294. case "quoteSingle":
  38295. case "alias":
  38296. case "flowMapping":
  38297. case "flowSequence":
  38298. return true;
  38299. default:
  38300. return false;
  38301. }
  38302. }
  38303. module2.exports = {
  38304. getLast,
  38305. getAncestorCount,
  38306. isNode,
  38307. isEmptyNode,
  38308. isInlineNode,
  38309. mapNode,
  38310. defineShortcut,
  38311. isNextLineEmpty,
  38312. isLastDescendantNode,
  38313. getBlockValueLineContents,
  38314. getFlowScalarLineContents,
  38315. getLastDescendantNode,
  38316. hasPrettierIgnore,
  38317. hasLeadingComments,
  38318. hasMiddleComments,
  38319. hasIndicatorComment,
  38320. hasTrailingComment,
  38321. hasEndComments
  38322. };
  38323. }
  38324. });
  38325. var require_print_preprocess4 = __commonJS2({
  38326. "src/language-yaml/print-preprocess.js"(exports2, module2) {
  38327. "use strict";
  38328. var {
  38329. defineShortcut,
  38330. mapNode
  38331. } = require_utils12();
  38332. function preprocess(ast) {
  38333. return mapNode(ast, defineShortcuts);
  38334. }
  38335. function defineShortcuts(node) {
  38336. switch (node.type) {
  38337. case "document":
  38338. defineShortcut(node, "head", () => node.children[0]);
  38339. defineShortcut(node, "body", () => node.children[1]);
  38340. break;
  38341. case "documentBody":
  38342. case "sequenceItem":
  38343. case "flowSequenceItem":
  38344. case "mappingKey":
  38345. case "mappingValue":
  38346. defineShortcut(node, "content", () => node.children[0]);
  38347. break;
  38348. case "mappingItem":
  38349. case "flowMappingItem":
  38350. defineShortcut(node, "key", () => node.children[0]);
  38351. defineShortcut(node, "value", () => node.children[1]);
  38352. break;
  38353. }
  38354. return node;
  38355. }
  38356. module2.exports = preprocess;
  38357. }
  38358. });
  38359. var require_misc2 = __commonJS2({
  38360. "src/language-yaml/print/misc.js"(exports2, module2) {
  38361. "use strict";
  38362. var {
  38363. builders: {
  38364. softline,
  38365. align
  38366. }
  38367. } = require("./doc.js");
  38368. var {
  38369. hasEndComments,
  38370. isNextLineEmpty,
  38371. isNode
  38372. } = require_utils12();
  38373. var printedEmptyLineCache = /* @__PURE__ */ new WeakMap();
  38374. function printNextEmptyLine(path, originalText) {
  38375. const node = path.getValue();
  38376. const root = path.stack[0];
  38377. let isNextEmptyLinePrintedSet;
  38378. if (printedEmptyLineCache.has(root)) {
  38379. isNextEmptyLinePrintedSet = printedEmptyLineCache.get(root);
  38380. } else {
  38381. isNextEmptyLinePrintedSet = /* @__PURE__ */ new Set();
  38382. printedEmptyLineCache.set(root, isNextEmptyLinePrintedSet);
  38383. }
  38384. if (!isNextEmptyLinePrintedSet.has(node.position.end.line)) {
  38385. isNextEmptyLinePrintedSet.add(node.position.end.line);
  38386. if (isNextLineEmpty(node, originalText) && !shouldPrintEndComments(path.getParentNode())) {
  38387. return softline;
  38388. }
  38389. }
  38390. return "";
  38391. }
  38392. function shouldPrintEndComments(node) {
  38393. return hasEndComments(node) && !isNode(node, ["documentHead", "documentBody", "flowMapping", "flowSequence"]);
  38394. }
  38395. function alignWithSpaces(width, doc2) {
  38396. return align(" ".repeat(width), doc2);
  38397. }
  38398. module2.exports = {
  38399. alignWithSpaces,
  38400. shouldPrintEndComments,
  38401. printNextEmptyLine
  38402. };
  38403. }
  38404. });
  38405. var require_flow_mapping_sequence = __commonJS2({
  38406. "src/language-yaml/print/flow-mapping-sequence.js"(exports2, module2) {
  38407. "use strict";
  38408. var {
  38409. builders: {
  38410. ifBreak,
  38411. line,
  38412. softline,
  38413. hardline,
  38414. join
  38415. }
  38416. } = require("./doc.js");
  38417. var {
  38418. isEmptyNode,
  38419. getLast,
  38420. hasEndComments
  38421. } = require_utils12();
  38422. var {
  38423. printNextEmptyLine,
  38424. alignWithSpaces
  38425. } = require_misc2();
  38426. function printFlowMapping(path, print, options) {
  38427. const node = path.getValue();
  38428. const isMapping = node.type === "flowMapping";
  38429. const openMarker = isMapping ? "{" : "[";
  38430. const closeMarker = isMapping ? "}" : "]";
  38431. let bracketSpacing = softline;
  38432. if (isMapping && node.children.length > 0 && options.bracketSpacing) {
  38433. bracketSpacing = line;
  38434. }
  38435. const lastItem = getLast(node.children);
  38436. const isLastItemEmptyMappingItem = lastItem && lastItem.type === "flowMappingItem" && isEmptyNode(lastItem.key) && isEmptyNode(lastItem.value);
  38437. return [openMarker, alignWithSpaces(options.tabWidth, [bracketSpacing, printChildren(path, print, options), options.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node) ? [hardline, join(hardline, path.map(print, "endComments"))] : ""]), isLastItemEmptyMappingItem ? "" : bracketSpacing, closeMarker];
  38438. }
  38439. function printChildren(path, print, options) {
  38440. const node = path.getValue();
  38441. const parts = path.map((childPath, index) => [print(), index === node.children.length - 1 ? "" : [",", line, node.children[index].position.start.line !== node.children[index + 1].position.start.line ? printNextEmptyLine(childPath, options.originalText) : ""]], "children");
  38442. return parts;
  38443. }
  38444. module2.exports = {
  38445. printFlowMapping,
  38446. printFlowSequence: printFlowMapping
  38447. };
  38448. }
  38449. });
  38450. var require_mapping_item = __commonJS2({
  38451. "src/language-yaml/print/mapping-item.js"(exports2, module2) {
  38452. "use strict";
  38453. var {
  38454. builders: {
  38455. conditionalGroup,
  38456. group,
  38457. hardline,
  38458. ifBreak,
  38459. join,
  38460. line
  38461. }
  38462. } = require("./doc.js");
  38463. var {
  38464. hasLeadingComments,
  38465. hasMiddleComments,
  38466. hasTrailingComment,
  38467. hasEndComments,
  38468. isNode,
  38469. isEmptyNode,
  38470. isInlineNode
  38471. } = require_utils12();
  38472. var {
  38473. alignWithSpaces
  38474. } = require_misc2();
  38475. function printMappingItem(node, parentNode, path, print, options) {
  38476. const {
  38477. key,
  38478. value
  38479. } = node;
  38480. const isEmptyMappingKey = isEmptyNode(key);
  38481. const isEmptyMappingValue = isEmptyNode(value);
  38482. if (isEmptyMappingKey && isEmptyMappingValue) {
  38483. return ": ";
  38484. }
  38485. const printedKey = print("key");
  38486. const spaceBeforeColon = needsSpaceInFrontOfMappingValue(node) ? " " : "";
  38487. if (isEmptyMappingValue) {
  38488. if (node.type === "flowMappingItem" && parentNode.type === "flowMapping") {
  38489. return printedKey;
  38490. }
  38491. if (node.type === "mappingItem" && isAbsolutelyPrintedAsSingleLineNode(key.content, options) && !hasTrailingComment(key.content) && (!parentNode.tag || parentNode.tag.value !== "tag:yaml.org,2002:set")) {
  38492. return [printedKey, spaceBeforeColon, ":"];
  38493. }
  38494. return ["? ", alignWithSpaces(2, printedKey)];
  38495. }
  38496. const printedValue = print("value");
  38497. if (isEmptyMappingKey) {
  38498. return [": ", alignWithSpaces(2, printedValue)];
  38499. }
  38500. if (hasLeadingComments(value) || !isInlineNode(key.content)) {
  38501. return ["? ", alignWithSpaces(2, printedKey), hardline, join("", path.map(print, "value", "leadingComments").map((comment) => [comment, hardline])), ": ", alignWithSpaces(2, printedValue)];
  38502. }
  38503. if (isSingleLineNode(key.content) && !hasLeadingComments(key.content) && !hasMiddleComments(key.content) && !hasTrailingComment(key.content) && !hasEndComments(key) && !hasLeadingComments(value.content) && !hasMiddleComments(value.content) && !hasEndComments(value) && isAbsolutelyPrintedAsSingleLineNode(value.content, options)) {
  38504. return [printedKey, spaceBeforeColon, ": ", printedValue];
  38505. }
  38506. const groupId = Symbol("mappingKey");
  38507. const groupedKey = group([ifBreak("? "), group(alignWithSpaces(2, printedKey), {
  38508. id: groupId
  38509. })]);
  38510. const explicitMappingValue = [hardline, ": ", alignWithSpaces(2, printedValue)];
  38511. const implicitMappingValueParts = [spaceBeforeColon, ":"];
  38512. if (hasLeadingComments(value.content) || hasEndComments(value) && value.content && !isNode(value.content, ["mapping", "sequence"]) || parentNode.type === "mapping" && hasTrailingComment(key.content) && isInlineNode(value.content) || isNode(value.content, ["mapping", "sequence"]) && value.content.tag === null && value.content.anchor === null) {
  38513. implicitMappingValueParts.push(hardline);
  38514. } else if (value.content) {
  38515. implicitMappingValueParts.push(line);
  38516. }
  38517. implicitMappingValueParts.push(printedValue);
  38518. const implicitMappingValue = alignWithSpaces(options.tabWidth, implicitMappingValueParts);
  38519. if (isAbsolutelyPrintedAsSingleLineNode(key.content, options) && !hasLeadingComments(key.content) && !hasMiddleComments(key.content) && !hasEndComments(key)) {
  38520. return conditionalGroup([[printedKey, implicitMappingValue]]);
  38521. }
  38522. return conditionalGroup([[groupedKey, ifBreak(explicitMappingValue, implicitMappingValue, {
  38523. groupId
  38524. })]]);
  38525. }
  38526. function isAbsolutelyPrintedAsSingleLineNode(node, options) {
  38527. if (!node) {
  38528. return true;
  38529. }
  38530. switch (node.type) {
  38531. case "plain":
  38532. case "quoteSingle":
  38533. case "quoteDouble":
  38534. break;
  38535. case "alias":
  38536. return true;
  38537. default:
  38538. return false;
  38539. }
  38540. if (options.proseWrap === "preserve") {
  38541. return node.position.start.line === node.position.end.line;
  38542. }
  38543. if (/\\$/m.test(options.originalText.slice(node.position.start.offset, node.position.end.offset))) {
  38544. return false;
  38545. }
  38546. switch (options.proseWrap) {
  38547. case "never":
  38548. return !node.value.includes("\n");
  38549. case "always":
  38550. return !/[\n ]/.test(node.value);
  38551. default:
  38552. return false;
  38553. }
  38554. }
  38555. function needsSpaceInFrontOfMappingValue(node) {
  38556. return node.key.content && node.key.content.type === "alias";
  38557. }
  38558. function isSingleLineNode(node) {
  38559. if (!node) {
  38560. return true;
  38561. }
  38562. switch (node.type) {
  38563. case "plain":
  38564. case "quoteDouble":
  38565. case "quoteSingle":
  38566. return node.position.start.line === node.position.end.line;
  38567. case "alias":
  38568. return true;
  38569. default:
  38570. return false;
  38571. }
  38572. }
  38573. module2.exports = printMappingItem;
  38574. }
  38575. });
  38576. var require_block2 = __commonJS2({
  38577. "src/language-yaml/print/block.js"(exports2, module2) {
  38578. "use strict";
  38579. var {
  38580. builders: {
  38581. dedent,
  38582. dedentToRoot,
  38583. fill,
  38584. hardline,
  38585. join,
  38586. line,
  38587. literalline,
  38588. markAsRoot
  38589. },
  38590. utils: {
  38591. getDocParts
  38592. }
  38593. } = require("./doc.js");
  38594. var {
  38595. getAncestorCount,
  38596. getBlockValueLineContents,
  38597. hasIndicatorComment,
  38598. isLastDescendantNode,
  38599. isNode
  38600. } = require_utils12();
  38601. var {
  38602. alignWithSpaces
  38603. } = require_misc2();
  38604. function printBlock(path, print, options) {
  38605. const node = path.getValue();
  38606. const parentIndent = getAncestorCount(path, (ancestorNode) => isNode(ancestorNode, ["sequence", "mapping"]));
  38607. const isLastDescendant = isLastDescendantNode(path);
  38608. const parts = [node.type === "blockFolded" ? ">" : "|"];
  38609. if (node.indent !== null) {
  38610. parts.push(node.indent.toString());
  38611. }
  38612. if (node.chomping !== "clip") {
  38613. parts.push(node.chomping === "keep" ? "+" : "-");
  38614. }
  38615. if (hasIndicatorComment(node)) {
  38616. parts.push(" ", print("indicatorComment"));
  38617. }
  38618. const lineContents = getBlockValueLineContents(node, {
  38619. parentIndent,
  38620. isLastDescendant,
  38621. options
  38622. });
  38623. const contentsParts = [];
  38624. for (const [index, lineWords] of lineContents.entries()) {
  38625. if (index === 0) {
  38626. contentsParts.push(hardline);
  38627. }
  38628. contentsParts.push(fill(getDocParts(join(line, lineWords))));
  38629. if (index !== lineContents.length - 1) {
  38630. contentsParts.push(lineWords.length === 0 ? hardline : markAsRoot(literalline));
  38631. } else if (node.chomping === "keep" && isLastDescendant) {
  38632. contentsParts.push(dedentToRoot(lineWords.length === 0 ? hardline : literalline));
  38633. }
  38634. }
  38635. if (node.indent === null) {
  38636. parts.push(dedent(alignWithSpaces(options.tabWidth, contentsParts)));
  38637. } else {
  38638. parts.push(dedentToRoot(alignWithSpaces(node.indent - 1 + parentIndent, contentsParts)));
  38639. }
  38640. return parts;
  38641. }
  38642. module2.exports = printBlock;
  38643. }
  38644. });
  38645. var require_printer_yaml = __commonJS2({
  38646. "src/language-yaml/printer-yaml.js"(exports2, module2) {
  38647. "use strict";
  38648. var {
  38649. builders: {
  38650. breakParent,
  38651. fill,
  38652. group,
  38653. hardline,
  38654. join,
  38655. line,
  38656. lineSuffix,
  38657. literalline
  38658. },
  38659. utils: {
  38660. getDocParts,
  38661. replaceTextEndOfLine
  38662. }
  38663. } = require("./doc.js");
  38664. var {
  38665. isPreviousLineEmpty
  38666. } = require_util();
  38667. var {
  38668. insertPragma,
  38669. isPragma
  38670. } = require_pragma6();
  38671. var {
  38672. locStart
  38673. } = require_loc7();
  38674. var embed = require_embed5();
  38675. var {
  38676. getFlowScalarLineContents,
  38677. getLastDescendantNode,
  38678. hasLeadingComments,
  38679. hasMiddleComments,
  38680. hasTrailingComment,
  38681. hasEndComments,
  38682. hasPrettierIgnore,
  38683. isLastDescendantNode,
  38684. isNode,
  38685. isInlineNode
  38686. } = require_utils12();
  38687. var preprocess = require_print_preprocess4();
  38688. var {
  38689. alignWithSpaces,
  38690. printNextEmptyLine,
  38691. shouldPrintEndComments
  38692. } = require_misc2();
  38693. var {
  38694. printFlowMapping,
  38695. printFlowSequence
  38696. } = require_flow_mapping_sequence();
  38697. var printMappingItem = require_mapping_item();
  38698. var printBlock = require_block2();
  38699. function genericPrint(path, options, print) {
  38700. const node = path.getValue();
  38701. const parts = [];
  38702. if (node.type !== "mappingValue" && hasLeadingComments(node)) {
  38703. parts.push([join(hardline, path.map(print, "leadingComments")), hardline]);
  38704. }
  38705. const {
  38706. tag,
  38707. anchor
  38708. } = node;
  38709. if (tag) {
  38710. parts.push(print("tag"));
  38711. }
  38712. if (tag && anchor) {
  38713. parts.push(" ");
  38714. }
  38715. if (anchor) {
  38716. parts.push(print("anchor"));
  38717. }
  38718. let nextEmptyLine = "";
  38719. if (isNode(node, ["mapping", "sequence", "comment", "directive", "mappingItem", "sequenceItem"]) && !isLastDescendantNode(path)) {
  38720. nextEmptyLine = printNextEmptyLine(path, options.originalText);
  38721. }
  38722. if (tag || anchor) {
  38723. if (isNode(node, ["sequence", "mapping"]) && !hasMiddleComments(node)) {
  38724. parts.push(hardline);
  38725. } else {
  38726. parts.push(" ");
  38727. }
  38728. }
  38729. if (hasMiddleComments(node)) {
  38730. parts.push([node.middleComments.length === 1 ? "" : hardline, join(hardline, path.map(print, "middleComments")), hardline]);
  38731. }
  38732. const parentNode = path.getParentNode();
  38733. if (hasPrettierIgnore(path)) {
  38734. parts.push(replaceTextEndOfLine(options.originalText.slice(node.position.start.offset, node.position.end.offset).trimEnd(), literalline));
  38735. } else {
  38736. parts.push(group(printNode(node, parentNode, path, options, print)));
  38737. }
  38738. if (hasTrailingComment(node) && !isNode(node, ["document", "documentHead"])) {
  38739. parts.push(lineSuffix([node.type === "mappingValue" && !node.content ? "" : " ", parentNode.type === "mappingKey" && path.getParentNode(2).type === "mapping" && isInlineNode(node) ? "" : breakParent, print("trailingComment")]));
  38740. }
  38741. if (shouldPrintEndComments(node)) {
  38742. parts.push(alignWithSpaces(node.type === "sequenceItem" ? 2 : 0, [hardline, join(hardline, path.map((path2) => [isPreviousLineEmpty(options.originalText, path2.getValue(), locStart) ? hardline : "", print()], "endComments"))]));
  38743. }
  38744. parts.push(nextEmptyLine);
  38745. return parts;
  38746. }
  38747. function printNode(node, parentNode, path, options, print) {
  38748. switch (node.type) {
  38749. case "root": {
  38750. const {
  38751. children
  38752. } = node;
  38753. const parts = [];
  38754. path.each((childPath, index) => {
  38755. const document = children[index];
  38756. const nextDocument = children[index + 1];
  38757. if (index !== 0) {
  38758. parts.push(hardline);
  38759. }
  38760. parts.push(print());
  38761. if (shouldPrintDocumentEndMarker(document, nextDocument)) {
  38762. parts.push(hardline, "...");
  38763. if (hasTrailingComment(document)) {
  38764. parts.push(" ", print("trailingComment"));
  38765. }
  38766. } else if (nextDocument && !hasTrailingComment(nextDocument.head)) {
  38767. parts.push(hardline, "---");
  38768. }
  38769. }, "children");
  38770. const lastDescendantNode = getLastDescendantNode(node);
  38771. if (!isNode(lastDescendantNode, ["blockLiteral", "blockFolded"]) || lastDescendantNode.chomping !== "keep") {
  38772. parts.push(hardline);
  38773. }
  38774. return parts;
  38775. }
  38776. case "document": {
  38777. const nextDocument = parentNode.children[path.getName() + 1];
  38778. const parts = [];
  38779. if (shouldPrintDocumentHeadEndMarker(node, nextDocument, parentNode, options) === "head") {
  38780. if (node.head.children.length > 0 || node.head.endComments.length > 0) {
  38781. parts.push(print("head"));
  38782. }
  38783. if (hasTrailingComment(node.head)) {
  38784. parts.push(["---", " ", print(["head", "trailingComment"])]);
  38785. } else {
  38786. parts.push("---");
  38787. }
  38788. }
  38789. if (shouldPrintDocumentBody(node)) {
  38790. parts.push(print("body"));
  38791. }
  38792. return join(hardline, parts);
  38793. }
  38794. case "documentHead":
  38795. return join(hardline, [...path.map(print, "children"), ...path.map(print, "endComments")]);
  38796. case "documentBody": {
  38797. const {
  38798. children,
  38799. endComments
  38800. } = node;
  38801. let separator = "";
  38802. if (children.length > 0 && endComments.length > 0) {
  38803. const lastDescendantNode = getLastDescendantNode(node);
  38804. if (isNode(lastDescendantNode, ["blockFolded", "blockLiteral"])) {
  38805. if (lastDescendantNode.chomping !== "keep") {
  38806. separator = [hardline, hardline];
  38807. }
  38808. } else {
  38809. separator = hardline;
  38810. }
  38811. }
  38812. return [join(hardline, path.map(print, "children")), separator, join(hardline, path.map(print, "endComments"))];
  38813. }
  38814. case "directive":
  38815. return ["%", join(" ", [node.name, ...node.parameters])];
  38816. case "comment":
  38817. return ["#", node.value];
  38818. case "alias":
  38819. return ["*", node.value];
  38820. case "tag":
  38821. return options.originalText.slice(node.position.start.offset, node.position.end.offset);
  38822. case "anchor":
  38823. return ["&", node.value];
  38824. case "plain":
  38825. return printFlowScalarContent(node.type, options.originalText.slice(node.position.start.offset, node.position.end.offset), options);
  38826. case "quoteDouble":
  38827. case "quoteSingle": {
  38828. const singleQuote = "'";
  38829. const doubleQuote = '"';
  38830. const raw = options.originalText.slice(node.position.start.offset + 1, node.position.end.offset - 1);
  38831. if (node.type === "quoteSingle" && raw.includes("\\") || node.type === "quoteDouble" && /\\[^"]/.test(raw)) {
  38832. const originalQuote = node.type === "quoteDouble" ? doubleQuote : singleQuote;
  38833. return [originalQuote, printFlowScalarContent(node.type, raw, options), originalQuote];
  38834. }
  38835. if (raw.includes(doubleQuote)) {
  38836. return [singleQuote, printFlowScalarContent(node.type, node.type === "quoteDouble" ? raw.replace(/\\"/g, doubleQuote).replace(/'/g, singleQuote.repeat(2)) : raw, options), singleQuote];
  38837. }
  38838. if (raw.includes(singleQuote)) {
  38839. return [doubleQuote, printFlowScalarContent(node.type, node.type === "quoteSingle" ? raw.replace(/''/g, singleQuote) : raw, options), doubleQuote];
  38840. }
  38841. const quote = options.singleQuote ? singleQuote : doubleQuote;
  38842. return [quote, printFlowScalarContent(node.type, raw, options), quote];
  38843. }
  38844. case "blockFolded":
  38845. case "blockLiteral": {
  38846. return printBlock(path, print, options);
  38847. }
  38848. case "mapping":
  38849. case "sequence":
  38850. return join(hardline, path.map(print, "children"));
  38851. case "sequenceItem":
  38852. return ["- ", alignWithSpaces(2, !node.content ? "" : print("content"))];
  38853. case "mappingKey":
  38854. case "mappingValue":
  38855. return !node.content ? "" : print("content");
  38856. case "mappingItem":
  38857. case "flowMappingItem": {
  38858. return printMappingItem(node, parentNode, path, print, options);
  38859. }
  38860. case "flowMapping":
  38861. return printFlowMapping(path, print, options);
  38862. case "flowSequence":
  38863. return printFlowSequence(path, print, options);
  38864. case "flowSequenceItem":
  38865. return print("content");
  38866. default:
  38867. throw new Error(`Unexpected node type ${node.type}`);
  38868. }
  38869. }
  38870. function shouldPrintDocumentBody(document) {
  38871. return document.body.children.length > 0 || hasEndComments(document.body);
  38872. }
  38873. function shouldPrintDocumentEndMarker(document, nextDocument) {
  38874. return hasTrailingComment(document) || nextDocument && (nextDocument.head.children.length > 0 || hasEndComments(nextDocument.head));
  38875. }
  38876. function shouldPrintDocumentHeadEndMarker(document, nextDocument, root, options) {
  38877. if (root.children[0] === document && /---(?:\s|$)/.test(options.originalText.slice(locStart(document), locStart(document) + 4)) || document.head.children.length > 0 || hasEndComments(document.head) || hasTrailingComment(document.head)) {
  38878. return "head";
  38879. }
  38880. if (shouldPrintDocumentEndMarker(document, nextDocument)) {
  38881. return false;
  38882. }
  38883. return nextDocument ? "root" : false;
  38884. }
  38885. function printFlowScalarContent(nodeType, content, options) {
  38886. const lineContents = getFlowScalarLineContents(nodeType, content, options);
  38887. return join(hardline, lineContents.map((lineContentWords) => fill(getDocParts(join(line, lineContentWords)))));
  38888. }
  38889. function clean(node, newNode) {
  38890. if (isNode(newNode)) {
  38891. delete newNode.position;
  38892. switch (newNode.type) {
  38893. case "comment":
  38894. if (isPragma(newNode.value)) {
  38895. return null;
  38896. }
  38897. break;
  38898. case "quoteDouble":
  38899. case "quoteSingle":
  38900. newNode.type = "quote";
  38901. break;
  38902. }
  38903. }
  38904. }
  38905. module2.exports = {
  38906. preprocess,
  38907. embed,
  38908. print: genericPrint,
  38909. massageAstNode: clean,
  38910. insertPragma
  38911. };
  38912. }
  38913. });
  38914. var require_options7 = __commonJS2({
  38915. "src/language-yaml/options.js"(exports2, module2) {
  38916. "use strict";
  38917. var commonOptions = require_common_options();
  38918. module2.exports = {
  38919. bracketSpacing: commonOptions.bracketSpacing,
  38920. singleQuote: commonOptions.singleQuote,
  38921. proseWrap: commonOptions.proseWrap
  38922. };
  38923. }
  38924. });
  38925. var require_parsers7 = __commonJS2({
  38926. "src/language-yaml/parsers.js"(exports2, module2) {
  38927. "use strict";
  38928. module2.exports = {
  38929. get yaml() {
  38930. return require("./parser-yaml.js").parsers.yaml;
  38931. }
  38932. };
  38933. }
  38934. });
  38935. var require_YAML = __commonJS2({
  38936. "node_modules/linguist-languages/data/YAML.json"(exports2, module2) {
  38937. module2.exports = {
  38938. name: "YAML",
  38939. type: "data",
  38940. color: "#cb171e",
  38941. tmScope: "source.yaml",
  38942. aliases: ["yml"],
  38943. extensions: [".yml", ".mir", ".reek", ".rviz", ".sublime-syntax", ".syntax", ".yaml", ".yaml-tmlanguage", ".yaml.sed", ".yml.mysql"],
  38944. filenames: [".clang-format", ".clang-tidy", ".gemrc", "glide.lock", "yarn.lock"],
  38945. aceMode: "yaml",
  38946. codemirrorMode: "yaml",
  38947. codemirrorMimeType: "text/x-yaml",
  38948. languageId: 407
  38949. };
  38950. }
  38951. });
  38952. var require_language_yaml = __commonJS2({
  38953. "src/language-yaml/index.js"(exports2, module2) {
  38954. "use strict";
  38955. var createLanguage = require_create_language();
  38956. var printer = require_printer_yaml();
  38957. var options = require_options7();
  38958. var parsers = require_parsers7();
  38959. var languages = [createLanguage(require_YAML(), (data) => ({
  38960. since: "1.14.0",
  38961. parsers: ["yaml"],
  38962. vscodeLanguageIds: ["yaml", "ansible", "home-assistant"],
  38963. filenames: [...data.filenames.filter((filename) => filename !== "yarn.lock"), ".prettierrc", ".stylelintrc"]
  38964. }))];
  38965. module2.exports = {
  38966. languages,
  38967. printers: {
  38968. yaml: printer
  38969. },
  38970. options,
  38971. parsers
  38972. };
  38973. }
  38974. });
  38975. var require_languages = __commonJS2({
  38976. "src/languages.js"(exports2, module2) {
  38977. "use strict";
  38978. module2.exports = [require_language_js(), require_language_css(), require_language_handlebars(), require_language_graphql(), require_language_markdown(), require_language_html(), require_language_yaml()];
  38979. }
  38980. });
  38981. var require_load_plugins = __commonJS2({
  38982. "src/common/load-plugins.js"(exports2, module2) {
  38983. "use strict";
  38984. var fs = require("fs");
  38985. var path = require("path");
  38986. var uniqBy = require_uniqBy();
  38987. var partition = require_partition();
  38988. var fastGlob = require_out4();
  38989. var internalPlugins = require_languages();
  38990. var {
  38991. default: mem,
  38992. memClear
  38993. } = require_mem();
  38994. var thirdParty = require("./third-party.js");
  38995. var resolve = require_resolve2();
  38996. var memoizedLoad = mem(load, {
  38997. cacheKey: JSON.stringify
  38998. });
  38999. var memoizedSearch = mem(findPluginsInNodeModules);
  39000. var clearCache = () => {
  39001. memClear(memoizedLoad);
  39002. memClear(memoizedSearch);
  39003. };
  39004. function load(plugins2, pluginSearchDirs) {
  39005. if (!plugins2) {
  39006. plugins2 = [];
  39007. }
  39008. if (pluginSearchDirs === false) {
  39009. pluginSearchDirs = [];
  39010. } else {
  39011. pluginSearchDirs = pluginSearchDirs || [];
  39012. if (pluginSearchDirs.length === 0) {
  39013. const autoLoadDir = thirdParty.findParentDir(__dirname, "node_modules");
  39014. if (autoLoadDir) {
  39015. pluginSearchDirs = [autoLoadDir];
  39016. }
  39017. }
  39018. }
  39019. const [externalPluginNames, externalPluginInstances] = partition(plugins2, (plugin) => typeof plugin === "string");
  39020. const externalManualLoadPluginInfos = externalPluginNames.map((pluginName) => {
  39021. let requirePath;
  39022. try {
  39023. requirePath = resolve(path.resolve(process.cwd(), pluginName));
  39024. } catch {
  39025. requirePath = resolve(pluginName, {
  39026. paths: [process.cwd()]
  39027. });
  39028. }
  39029. return {
  39030. name: pluginName,
  39031. requirePath
  39032. };
  39033. });
  39034. const externalAutoLoadPluginInfos = pluginSearchDirs.flatMap((pluginSearchDir) => {
  39035. const resolvedPluginSearchDir = path.resolve(process.cwd(), pluginSearchDir);
  39036. const nodeModulesDir = path.resolve(resolvedPluginSearchDir, "node_modules");
  39037. if (!isDirectory(nodeModulesDir) && !isDirectory(resolvedPluginSearchDir)) {
  39038. throw new Error(`${pluginSearchDir} does not exist or is not a directory`);
  39039. }
  39040. return memoizedSearch(nodeModulesDir).map((pluginName) => ({
  39041. name: pluginName,
  39042. requirePath: resolve(pluginName, {
  39043. paths: [resolvedPluginSearchDir]
  39044. })
  39045. }));
  39046. });
  39047. const externalPlugins = [...uniqBy([...externalManualLoadPluginInfos, ...externalAutoLoadPluginInfos], "requirePath").map((externalPluginInfo) => Object.assign({
  39048. name: externalPluginInfo.name
  39049. }, require(externalPluginInfo.requirePath))), ...externalPluginInstances];
  39050. return [...internalPlugins, ...externalPlugins];
  39051. }
  39052. function findPluginsInNodeModules(nodeModulesDir) {
  39053. const pluginPackageJsonPaths = fastGlob.sync(["prettier-plugin-*/package.json", "@*/prettier-plugin-*/package.json", "@prettier/plugin-*/package.json"], {
  39054. cwd: nodeModulesDir
  39055. });
  39056. return pluginPackageJsonPaths.map(path.dirname);
  39057. }
  39058. function isDirectory(dir) {
  39059. try {
  39060. return fs.statSync(dir).isDirectory();
  39061. } catch {
  39062. return false;
  39063. }
  39064. }
  39065. module2.exports = {
  39066. loadPlugins: memoizedLoad,
  39067. clearCache
  39068. };
  39069. }
  39070. });
  39071. var {
  39072. version
  39073. } = require("./package.json");
  39074. var core = require_core();
  39075. var {
  39076. getSupportInfo
  39077. } = require_support();
  39078. var getFileInfo = require_get_file_info();
  39079. var sharedUtil = require_util_shared();
  39080. var plugins = require_load_plugins();
  39081. var config = require_resolve_config();
  39082. var doc = require("./doc.js");
  39083. function _withPlugins(fn, optsArgIdx = 1) {
  39084. return (...args) => {
  39085. const opts = args[optsArgIdx] || {};
  39086. args[optsArgIdx] = Object.assign(Object.assign({}, opts), {}, {
  39087. plugins: plugins.loadPlugins(opts.plugins, opts.pluginSearchDirs)
  39088. });
  39089. return fn(...args);
  39090. };
  39091. }
  39092. function withPlugins(fn, optsArgIdx) {
  39093. const resultingFn = _withPlugins(fn, optsArgIdx);
  39094. if (fn.sync) {
  39095. resultingFn.sync = _withPlugins(fn.sync, optsArgIdx);
  39096. }
  39097. return resultingFn;
  39098. }
  39099. var formatWithCursor = withPlugins(core.formatWithCursor);
  39100. module.exports = {
  39101. formatWithCursor,
  39102. format(text, opts) {
  39103. return formatWithCursor(text, opts).formatted;
  39104. },
  39105. check(text, opts) {
  39106. const {
  39107. formatted
  39108. } = formatWithCursor(text, opts);
  39109. return formatted === text;
  39110. },
  39111. doc,
  39112. resolveConfig: config.resolveConfig,
  39113. resolveConfigFile: config.resolveConfigFile,
  39114. clearConfigCache() {
  39115. config.clearCache();
  39116. plugins.clearCache();
  39117. },
  39118. getFileInfo: withPlugins(getFileInfo),
  39119. getSupportInfo: withPlugins(getSupportInfo, 0),
  39120. version,
  39121. util: sharedUtil,
  39122. __internal: {
  39123. errors: require_errors(),
  39124. coreOptions: require_core_options(),
  39125. createIgnorer: require_create_ignorer(),
  39126. optionsModule: require_options(),
  39127. optionsNormalizer: require_options_normalizer(),
  39128. utils: {
  39129. arrayify: require_arrayify(),
  39130. getLast: require_get_last(),
  39131. isNonEmptyArray: require_util().isNonEmptyArray
  39132. }
  39133. },
  39134. __debug: {
  39135. parse: withPlugins(core.parse),
  39136. formatAST: withPlugins(core.formatAST),
  39137. formatDoc: withPlugins(core.formatDoc),
  39138. printToDoc: withPlugins(core.printToDoc),
  39139. printDocToString: withPlugins(core.printDocToString)
  39140. }
  39141. };