| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365 |
- "use strict";
- var __getOwnPropNames = Object.getOwnPropertyNames;
- var __commonJS = (cb, mod) => function __require() {
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
- };
- // node_modules/core-js/internals/global.js
- var require_global = __commonJS({
- "node_modules/core-js/internals/global.js"(exports2, module2) {
- var check = function(it) {
- return it && it.Math == Math && it;
- };
- module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || function() {
- return this;
- }() || Function("return this")();
- }
- });
- // node_modules/core-js/internals/fails.js
- var require_fails = __commonJS({
- "node_modules/core-js/internals/fails.js"(exports2, module2) {
- module2.exports = function(exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- }
- });
- // node_modules/core-js/internals/descriptors.js
- var require_descriptors = __commonJS({
- "node_modules/core-js/internals/descriptors.js"(exports2, module2) {
- var fails = require_fails();
- module2.exports = !fails(function() {
- return Object.defineProperty({}, 1, { get: function() {
- return 7;
- } })[1] != 7;
- });
- }
- });
- // node_modules/core-js/internals/function-bind-native.js
- var require_function_bind_native = __commonJS({
- "node_modules/core-js/internals/function-bind-native.js"(exports2, module2) {
- var fails = require_fails();
- module2.exports = !fails(function() {
- var test = function() {
- }.bind();
- return typeof test != "function" || test.hasOwnProperty("prototype");
- });
- }
- });
- // node_modules/core-js/internals/function-call.js
- var require_function_call = __commonJS({
- "node_modules/core-js/internals/function-call.js"(exports2, module2) {
- var NATIVE_BIND = require_function_bind_native();
- var call = Function.prototype.call;
- module2.exports = NATIVE_BIND ? call.bind(call) : function() {
- return call.apply(call, arguments);
- };
- }
- });
- // node_modules/core-js/internals/object-property-is-enumerable.js
- var require_object_property_is_enumerable = __commonJS({
- "node_modules/core-js/internals/object-property-is-enumerable.js"(exports2) {
- "use strict";
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
- exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : $propertyIsEnumerable;
- }
- });
- // node_modules/core-js/internals/create-property-descriptor.js
- var require_create_property_descriptor = __commonJS({
- "node_modules/core-js/internals/create-property-descriptor.js"(exports2, module2) {
- module2.exports = function(bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value
- };
- };
- }
- });
- // node_modules/core-js/internals/function-uncurry-this.js
- var require_function_uncurry_this = __commonJS({
- "node_modules/core-js/internals/function-uncurry-this.js"(exports2, module2) {
- var NATIVE_BIND = require_function_bind_native();
- var FunctionPrototype = Function.prototype;
- var call = FunctionPrototype.call;
- var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
- module2.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
- return function() {
- return call.apply(fn, arguments);
- };
- };
- }
- });
- // node_modules/core-js/internals/classof-raw.js
- var require_classof_raw = __commonJS({
- "node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var toString = uncurryThis({}.toString);
- var stringSlice = uncurryThis("".slice);
- module2.exports = function(it) {
- return stringSlice(toString(it), 8, -1);
- };
- }
- });
- // node_modules/core-js/internals/indexed-object.js
- var require_indexed_object = __commonJS({
- "node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var fails = require_fails();
- var classof = require_classof_raw();
- var $Object = Object;
- var split = uncurryThis("".split);
- module2.exports = fails(function() {
- return !$Object("z").propertyIsEnumerable(0);
- }) ? function(it) {
- return classof(it) == "String" ? split(it, "") : $Object(it);
- } : $Object;
- }
- });
- // node_modules/core-js/internals/is-null-or-undefined.js
- var require_is_null_or_undefined = __commonJS({
- "node_modules/core-js/internals/is-null-or-undefined.js"(exports2, module2) {
- module2.exports = function(it) {
- return it === null || it === void 0;
- };
- }
- });
- // node_modules/core-js/internals/require-object-coercible.js
- var require_require_object_coercible = __commonJS({
- "node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
- var isNullOrUndefined = require_is_null_or_undefined();
- var $TypeError = TypeError;
- module2.exports = function(it) {
- if (isNullOrUndefined(it))
- throw $TypeError("Can't call method on " + it);
- return it;
- };
- }
- });
- // node_modules/core-js/internals/to-indexed-object.js
- var require_to_indexed_object = __commonJS({
- "node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
- var IndexedObject = require_indexed_object();
- var requireObjectCoercible = require_require_object_coercible();
- module2.exports = function(it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- }
- });
- // node_modules/core-js/internals/document-all.js
- var require_document_all = __commonJS({
- "node_modules/core-js/internals/document-all.js"(exports2, module2) {
- var documentAll = typeof document == "object" && document.all;
- var IS_HTMLDDA = typeof documentAll == "undefined" && documentAll !== void 0;
- module2.exports = {
- all: documentAll,
- IS_HTMLDDA
- };
- }
- });
- // node_modules/core-js/internals/is-callable.js
- var require_is_callable = __commonJS({
- "node_modules/core-js/internals/is-callable.js"(exports2, module2) {
- var $documentAll = require_document_all();
- var documentAll = $documentAll.all;
- module2.exports = $documentAll.IS_HTMLDDA ? function(argument) {
- return typeof argument == "function" || argument === documentAll;
- } : function(argument) {
- return typeof argument == "function";
- };
- }
- });
- // node_modules/core-js/internals/is-object.js
- var require_is_object = __commonJS({
- "node_modules/core-js/internals/is-object.js"(exports2, module2) {
- var isCallable = require_is_callable();
- var $documentAll = require_document_all();
- var documentAll = $documentAll.all;
- module2.exports = $documentAll.IS_HTMLDDA ? function(it) {
- return typeof it == "object" ? it !== null : isCallable(it) || it === documentAll;
- } : function(it) {
- return typeof it == "object" ? it !== null : isCallable(it);
- };
- }
- });
- // node_modules/core-js/internals/get-built-in.js
- var require_get_built_in = __commonJS({
- "node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
- var global2 = require_global();
- var isCallable = require_is_callable();
- var aFunction = function(argument) {
- return isCallable(argument) ? argument : void 0;
- };
- module2.exports = function(namespace, method) {
- return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
- };
- }
- });
- // node_modules/core-js/internals/object-is-prototype-of.js
- var require_object_is_prototype_of = __commonJS({
- "node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- module2.exports = uncurryThis({}.isPrototypeOf);
- }
- });
- // node_modules/core-js/internals/engine-user-agent.js
- var require_engine_user_agent = __commonJS({
- "node_modules/core-js/internals/engine-user-agent.js"(exports2, module2) {
- var getBuiltIn = require_get_built_in();
- module2.exports = getBuiltIn("navigator", "userAgent") || "";
- }
- });
- // node_modules/core-js/internals/engine-v8-version.js
- var require_engine_v8_version = __commonJS({
- "node_modules/core-js/internals/engine-v8-version.js"(exports2, module2) {
- var global2 = require_global();
- var userAgent = require_engine_user_agent();
- var process2 = global2.process;
- var Deno = global2.Deno;
- var versions = process2 && process2.versions || Deno && Deno.version;
- var v8 = versions && versions.v8;
- var match;
- var version;
- if (v8) {
- match = v8.split(".");
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
- }
- if (!version && userAgent) {
- match = userAgent.match(/Edge\/(\d+)/);
- if (!match || match[1] >= 74) {
- match = userAgent.match(/Chrome\/(\d+)/);
- if (match)
- version = +match[1];
- }
- }
- module2.exports = version;
- }
- });
- // node_modules/core-js/internals/symbol-constructor-detection.js
- var require_symbol_constructor_detection = __commonJS({
- "node_modules/core-js/internals/symbol-constructor-detection.js"(exports2, module2) {
- var V8_VERSION = require_engine_v8_version();
- var fails = require_fails();
- module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
- var symbol = Symbol();
- return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
- });
- }
- });
- // node_modules/core-js/internals/use-symbol-as-uid.js
- var require_use_symbol_as_uid = __commonJS({
- "node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
- var NATIVE_SYMBOL = require_symbol_constructor_detection();
- module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
- }
- });
- // node_modules/core-js/internals/is-symbol.js
- var require_is_symbol = __commonJS({
- "node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
- var getBuiltIn = require_get_built_in();
- var isCallable = require_is_callable();
- var isPrototypeOf = require_object_is_prototype_of();
- var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
- var $Object = Object;
- module2.exports = USE_SYMBOL_AS_UID ? function(it) {
- return typeof it == "symbol";
- } : function(it) {
- var $Symbol = getBuiltIn("Symbol");
- return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
- };
- }
- });
- // node_modules/core-js/internals/try-to-string.js
- var require_try_to_string = __commonJS({
- "node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
- var $String = String;
- module2.exports = function(argument) {
- try {
- return $String(argument);
- } catch (error) {
- return "Object";
- }
- };
- }
- });
- // node_modules/core-js/internals/a-callable.js
- var require_a_callable = __commonJS({
- "node_modules/core-js/internals/a-callable.js"(exports2, module2) {
- var isCallable = require_is_callable();
- var tryToString = require_try_to_string();
- var $TypeError = TypeError;
- module2.exports = function(argument) {
- if (isCallable(argument))
- return argument;
- throw $TypeError(tryToString(argument) + " is not a function");
- };
- }
- });
- // node_modules/core-js/internals/get-method.js
- var require_get_method = __commonJS({
- "node_modules/core-js/internals/get-method.js"(exports2, module2) {
- var aCallable = require_a_callable();
- var isNullOrUndefined = require_is_null_or_undefined();
- module2.exports = function(V, P) {
- var func = V[P];
- return isNullOrUndefined(func) ? void 0 : aCallable(func);
- };
- }
- });
- // node_modules/core-js/internals/ordinary-to-primitive.js
- var require_ordinary_to_primitive = __commonJS({
- "node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
- var call = require_function_call();
- var isCallable = require_is_callable();
- var isObject = require_is_object();
- var $TypeError = TypeError;
- module2.exports = function(input, pref) {
- var fn, val;
- if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
- return val;
- if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
- return val;
- if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
- return val;
- throw $TypeError("Can't convert object to primitive value");
- };
- }
- });
- // node_modules/core-js/internals/is-pure.js
- var require_is_pure = __commonJS({
- "node_modules/core-js/internals/is-pure.js"(exports2, module2) {
- module2.exports = false;
- }
- });
- // node_modules/core-js/internals/define-global-property.js
- var require_define_global_property = __commonJS({
- "node_modules/core-js/internals/define-global-property.js"(exports2, module2) {
- var global2 = require_global();
- var defineProperty = Object.defineProperty;
- module2.exports = function(key, value) {
- try {
- defineProperty(global2, key, { value, configurable: true, writable: true });
- } catch (error) {
- global2[key] = value;
- }
- return value;
- };
- }
- });
- // node_modules/core-js/internals/shared-store.js
- var require_shared_store = __commonJS({
- "node_modules/core-js/internals/shared-store.js"(exports2, module2) {
- var global2 = require_global();
- var defineGlobalProperty = require_define_global_property();
- var SHARED = "__core-js_shared__";
- var store = global2[SHARED] || defineGlobalProperty(SHARED, {});
- module2.exports = store;
- }
- });
- // node_modules/core-js/internals/shared.js
- var require_shared = __commonJS({
- "node_modules/core-js/internals/shared.js"(exports2, module2) {
- var IS_PURE = require_is_pure();
- var store = require_shared_store();
- (module2.exports = function(key, value) {
- return store[key] || (store[key] = value !== void 0 ? value : {});
- })("versions", []).push({
- version: "3.26.1",
- mode: IS_PURE ? "pure" : "global",
- copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
- license: "https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",
- source: "https://github.com/zloirock/core-js"
- });
- }
- });
- // node_modules/core-js/internals/to-object.js
- var require_to_object = __commonJS({
- "node_modules/core-js/internals/to-object.js"(exports2, module2) {
- var requireObjectCoercible = require_require_object_coercible();
- var $Object = Object;
- module2.exports = function(argument) {
- return $Object(requireObjectCoercible(argument));
- };
- }
- });
- // node_modules/core-js/internals/has-own-property.js
- var require_has_own_property = __commonJS({
- "node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var toObject = require_to_object();
- var hasOwnProperty = uncurryThis({}.hasOwnProperty);
- module2.exports = Object.hasOwn || function hasOwn(it, key) {
- return hasOwnProperty(toObject(it), key);
- };
- }
- });
- // node_modules/core-js/internals/uid.js
- var require_uid = __commonJS({
- "node_modules/core-js/internals/uid.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var id = 0;
- var postfix = Math.random();
- var toString = uncurryThis(1 .toString);
- module2.exports = function(key) {
- return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
- };
- }
- });
- // node_modules/core-js/internals/well-known-symbol.js
- var require_well_known_symbol = __commonJS({
- "node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
- var global2 = require_global();
- var shared = require_shared();
- var hasOwn = require_has_own_property();
- var uid = require_uid();
- var NATIVE_SYMBOL = require_symbol_constructor_detection();
- var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
- var WellKnownSymbolsStore = shared("wks");
- var Symbol2 = global2.Symbol;
- var symbolFor = Symbol2 && Symbol2["for"];
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
- module2.exports = function(name) {
- if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
- var description = "Symbol." + name;
- if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
- WellKnownSymbolsStore[name] = Symbol2[name];
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
- WellKnownSymbolsStore[name] = symbolFor(description);
- } else {
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
- }
- }
- return WellKnownSymbolsStore[name];
- };
- }
- });
- // node_modules/core-js/internals/to-primitive.js
- var require_to_primitive = __commonJS({
- "node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
- var call = require_function_call();
- var isObject = require_is_object();
- var isSymbol = require_is_symbol();
- var getMethod = require_get_method();
- var ordinaryToPrimitive = require_ordinary_to_primitive();
- var wellKnownSymbol = require_well_known_symbol();
- var $TypeError = TypeError;
- var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
- module2.exports = function(input, pref) {
- if (!isObject(input) || isSymbol(input))
- return input;
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
- var result;
- if (exoticToPrim) {
- if (pref === void 0)
- pref = "default";
- result = call(exoticToPrim, input, pref);
- if (!isObject(result) || isSymbol(result))
- return result;
- throw $TypeError("Can't convert object to primitive value");
- }
- if (pref === void 0)
- pref = "number";
- return ordinaryToPrimitive(input, pref);
- };
- }
- });
- // node_modules/core-js/internals/to-property-key.js
- var require_to_property_key = __commonJS({
- "node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
- var toPrimitive = require_to_primitive();
- var isSymbol = require_is_symbol();
- module2.exports = function(argument) {
- var key = toPrimitive(argument, "string");
- return isSymbol(key) ? key : key + "";
- };
- }
- });
- // node_modules/core-js/internals/document-create-element.js
- var require_document_create_element = __commonJS({
- "node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
- var global2 = require_global();
- var isObject = require_is_object();
- var document2 = global2.document;
- var EXISTS = isObject(document2) && isObject(document2.createElement);
- module2.exports = function(it) {
- return EXISTS ? document2.createElement(it) : {};
- };
- }
- });
- // node_modules/core-js/internals/ie8-dom-define.js
- var require_ie8_dom_define = __commonJS({
- "node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
- var DESCRIPTORS = require_descriptors();
- var fails = require_fails();
- var createElement = require_document_create_element();
- module2.exports = !DESCRIPTORS && !fails(function() {
- return Object.defineProperty(createElement("div"), "a", {
- get: function() {
- return 7;
- }
- }).a != 7;
- });
- }
- });
- // node_modules/core-js/internals/object-get-own-property-descriptor.js
- var require_object_get_own_property_descriptor = __commonJS({
- "node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
- var DESCRIPTORS = require_descriptors();
- var call = require_function_call();
- var propertyIsEnumerableModule = require_object_property_is_enumerable();
- var createPropertyDescriptor = require_create_property_descriptor();
- var toIndexedObject = require_to_indexed_object();
- var toPropertyKey = require_to_property_key();
- var hasOwn = require_has_own_property();
- var IE8_DOM_DEFINE = require_ie8_dom_define();
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPropertyKey(P);
- if (IE8_DOM_DEFINE)
- try {
- return $getOwnPropertyDescriptor(O, P);
- } catch (error) {
- }
- if (hasOwn(O, P))
- return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
- };
- }
- });
- // node_modules/core-js/internals/v8-prototype-define-bug.js
- var require_v8_prototype_define_bug = __commonJS({
- "node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
- var DESCRIPTORS = require_descriptors();
- var fails = require_fails();
- module2.exports = DESCRIPTORS && fails(function() {
- return Object.defineProperty(function() {
- }, "prototype", {
- value: 42,
- writable: false
- }).prototype != 42;
- });
- }
- });
- // node_modules/core-js/internals/an-object.js
- var require_an_object = __commonJS({
- "node_modules/core-js/internals/an-object.js"(exports2, module2) {
- var isObject = require_is_object();
- var $String = String;
- var $TypeError = TypeError;
- module2.exports = function(argument) {
- if (isObject(argument))
- return argument;
- throw $TypeError($String(argument) + " is not an object");
- };
- }
- });
- // node_modules/core-js/internals/object-define-property.js
- var require_object_define_property = __commonJS({
- "node_modules/core-js/internals/object-define-property.js"(exports2) {
- var DESCRIPTORS = require_descriptors();
- var IE8_DOM_DEFINE = require_ie8_dom_define();
- var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
- var anObject = require_an_object();
- var toPropertyKey = require_to_property_key();
- var $TypeError = TypeError;
- var $defineProperty = Object.defineProperty;
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var ENUMERABLE = "enumerable";
- var CONFIGURABLE = "configurable";
- var WRITABLE = "writable";
- exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPropertyKey(P);
- anObject(Attributes);
- if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
- var current = $getOwnPropertyDescriptor(O, P);
- if (current && current[WRITABLE]) {
- O[P] = Attributes.value;
- Attributes = {
- configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
- writable: false
- };
- }
- }
- return $defineProperty(O, P, Attributes);
- } : $defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPropertyKey(P);
- anObject(Attributes);
- if (IE8_DOM_DEFINE)
- try {
- return $defineProperty(O, P, Attributes);
- } catch (error) {
- }
- if ("get" in Attributes || "set" in Attributes)
- throw $TypeError("Accessors not supported");
- if ("value" in Attributes)
- O[P] = Attributes.value;
- return O;
- };
- }
- });
- // node_modules/core-js/internals/create-non-enumerable-property.js
- var require_create_non_enumerable_property = __commonJS({
- "node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
- var DESCRIPTORS = require_descriptors();
- var definePropertyModule = require_object_define_property();
- var createPropertyDescriptor = require_create_property_descriptor();
- module2.exports = DESCRIPTORS ? function(object, key, value) {
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
- } : function(object, key, value) {
- object[key] = value;
- return object;
- };
- }
- });
- // node_modules/core-js/internals/function-name.js
- var require_function_name = __commonJS({
- "node_modules/core-js/internals/function-name.js"(exports2, module2) {
- var DESCRIPTORS = require_descriptors();
- var hasOwn = require_has_own_property();
- var FunctionPrototype = Function.prototype;
- var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
- var EXISTS = hasOwn(FunctionPrototype, "name");
- var PROPER = EXISTS && function something() {
- }.name === "something";
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
- module2.exports = {
- EXISTS,
- PROPER,
- CONFIGURABLE
- };
- }
- });
- // node_modules/core-js/internals/inspect-source.js
- var require_inspect_source = __commonJS({
- "node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var isCallable = require_is_callable();
- var store = require_shared_store();
- var functionToString = uncurryThis(Function.toString);
- if (!isCallable(store.inspectSource)) {
- store.inspectSource = function(it) {
- return functionToString(it);
- };
- }
- module2.exports = store.inspectSource;
- }
- });
- // node_modules/core-js/internals/weak-map-basic-detection.js
- var require_weak_map_basic_detection = __commonJS({
- "node_modules/core-js/internals/weak-map-basic-detection.js"(exports2, module2) {
- var global2 = require_global();
- var isCallable = require_is_callable();
- var WeakMap2 = global2.WeakMap;
- module2.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
- }
- });
- // node_modules/core-js/internals/shared-key.js
- var require_shared_key = __commonJS({
- "node_modules/core-js/internals/shared-key.js"(exports2, module2) {
- var shared = require_shared();
- var uid = require_uid();
- var keys = shared("keys");
- module2.exports = function(key) {
- return keys[key] || (keys[key] = uid(key));
- };
- }
- });
- // node_modules/core-js/internals/hidden-keys.js
- var require_hidden_keys = __commonJS({
- "node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
- module2.exports = {};
- }
- });
- // node_modules/core-js/internals/internal-state.js
- var require_internal_state = __commonJS({
- "node_modules/core-js/internals/internal-state.js"(exports2, module2) {
- var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
- var global2 = require_global();
- var isObject = require_is_object();
- var createNonEnumerableProperty = require_create_non_enumerable_property();
- var hasOwn = require_has_own_property();
- var shared = require_shared_store();
- var sharedKey = require_shared_key();
- var hiddenKeys = require_hidden_keys();
- var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
- var TypeError2 = global2.TypeError;
- var WeakMap2 = global2.WeakMap;
- var set;
- var get;
- var has;
- var enforce = function(it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function(TYPE) {
- return function(it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError2("Incompatible receiver, " + TYPE + " required");
- }
- return state;
- };
- };
- if (NATIVE_WEAK_MAP || shared.state) {
- store = shared.state || (shared.state = new WeakMap2());
- store.get = store.get;
- store.has = store.has;
- store.set = store.set;
- set = function(it, metadata) {
- if (store.has(it))
- throw TypeError2(OBJECT_ALREADY_INITIALIZED);
- metadata.facade = it;
- store.set(it, metadata);
- return metadata;
- };
- get = function(it) {
- return store.get(it) || {};
- };
- has = function(it) {
- return store.has(it);
- };
- } else {
- STATE = sharedKey("state");
- hiddenKeys[STATE] = true;
- set = function(it, metadata) {
- if (hasOwn(it, STATE))
- throw TypeError2(OBJECT_ALREADY_INITIALIZED);
- metadata.facade = it;
- createNonEnumerableProperty(it, STATE, metadata);
- return metadata;
- };
- get = function(it) {
- return hasOwn(it, STATE) ? it[STATE] : {};
- };
- has = function(it) {
- return hasOwn(it, STATE);
- };
- }
- var store;
- var STATE;
- module2.exports = {
- set,
- get,
- has,
- enforce,
- getterFor
- };
- }
- });
- // node_modules/core-js/internals/make-built-in.js
- var require_make_built_in = __commonJS({
- "node_modules/core-js/internals/make-built-in.js"(exports2, module2) {
- var fails = require_fails();
- var isCallable = require_is_callable();
- var hasOwn = require_has_own_property();
- var DESCRIPTORS = require_descriptors();
- var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
- var inspectSource = require_inspect_source();
- var InternalStateModule = require_internal_state();
- var enforceInternalState = InternalStateModule.enforce;
- var getInternalState = InternalStateModule.get;
- var defineProperty = Object.defineProperty;
- var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
- return defineProperty(function() {
- }, "length", { value: 8 }).length !== 8;
- });
- var TEMPLATE = String(String).split("String");
- var makeBuiltIn = module2.exports = function(value, name, options) {
- if (String(name).slice(0, 7) === "Symbol(") {
- name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
- }
- if (options && options.getter)
- name = "get " + name;
- if (options && options.setter)
- name = "set " + name;
- if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
- if (DESCRIPTORS)
- defineProperty(value, "name", { value: name, configurable: true });
- else
- value.name = name;
- }
- if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
- defineProperty(value, "length", { value: options.arity });
- }
- try {
- if (options && hasOwn(options, "constructor") && options.constructor) {
- if (DESCRIPTORS)
- defineProperty(value, "prototype", { writable: false });
- } else if (value.prototype)
- value.prototype = void 0;
- } catch (error) {
- }
- var state = enforceInternalState(value);
- if (!hasOwn(state, "source")) {
- state.source = TEMPLATE.join(typeof name == "string" ? name : "");
- }
- return value;
- };
- Function.prototype.toString = makeBuiltIn(function toString() {
- return isCallable(this) && getInternalState(this).source || inspectSource(this);
- }, "toString");
- }
- });
- // node_modules/core-js/internals/define-built-in.js
- var require_define_built_in = __commonJS({
- "node_modules/core-js/internals/define-built-in.js"(exports2, module2) {
- var isCallable = require_is_callable();
- var definePropertyModule = require_object_define_property();
- var makeBuiltIn = require_make_built_in();
- var defineGlobalProperty = require_define_global_property();
- module2.exports = function(O, key, value, options) {
- if (!options)
- options = {};
- var simple = options.enumerable;
- var name = options.name !== void 0 ? options.name : key;
- if (isCallable(value))
- makeBuiltIn(value, name, options);
- if (options.global) {
- if (simple)
- O[key] = value;
- else
- defineGlobalProperty(key, value);
- } else {
- try {
- if (!options.unsafe)
- delete O[key];
- else if (O[key])
- simple = true;
- } catch (error) {
- }
- if (simple)
- O[key] = value;
- else
- definePropertyModule.f(O, key, {
- value,
- enumerable: false,
- configurable: !options.nonConfigurable,
- writable: !options.nonWritable
- });
- }
- return O;
- };
- }
- });
- // node_modules/core-js/internals/math-trunc.js
- var require_math_trunc = __commonJS({
- "node_modules/core-js/internals/math-trunc.js"(exports2, module2) {
- var ceil = Math.ceil;
- var floor = Math.floor;
- module2.exports = Math.trunc || function trunc(x) {
- var n = +x;
- return (n > 0 ? floor : ceil)(n);
- };
- }
- });
- // node_modules/core-js/internals/to-integer-or-infinity.js
- var require_to_integer_or_infinity = __commonJS({
- "node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
- var trunc = require_math_trunc();
- module2.exports = function(argument) {
- var number = +argument;
- return number !== number || number === 0 ? 0 : trunc(number);
- };
- }
- });
- // node_modules/core-js/internals/to-absolute-index.js
- var require_to_absolute_index = __commonJS({
- "node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
- var toIntegerOrInfinity = require_to_integer_or_infinity();
- var max = Math.max;
- var min = Math.min;
- module2.exports = function(index, length) {
- var integer = toIntegerOrInfinity(index);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- }
- });
- // node_modules/core-js/internals/to-length.js
- var require_to_length = __commonJS({
- "node_modules/core-js/internals/to-length.js"(exports2, module2) {
- var toIntegerOrInfinity = require_to_integer_or_infinity();
- var min = Math.min;
- module2.exports = function(argument) {
- return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
- };
- }
- });
- // node_modules/core-js/internals/length-of-array-like.js
- var require_length_of_array_like = __commonJS({
- "node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
- var toLength = require_to_length();
- module2.exports = function(obj) {
- return toLength(obj.length);
- };
- }
- });
- // node_modules/core-js/internals/array-includes.js
- var require_array_includes = __commonJS({
- "node_modules/core-js/internals/array-includes.js"(exports2, module2) {
- var toIndexedObject = require_to_indexed_object();
- var toAbsoluteIndex = require_to_absolute_index();
- var lengthOfArrayLike = require_length_of_array_like();
- var createMethod = function(IS_INCLUDES) {
- return function($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = lengthOfArrayLike(O);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- if (IS_INCLUDES && el != el)
- while (length > index) {
- value = O[index++];
- if (value != value)
- return true;
- }
- else
- for (; length > index; index++) {
- if ((IS_INCLUDES || index in O) && O[index] === el)
- return IS_INCLUDES || index || 0;
- }
- return !IS_INCLUDES && -1;
- };
- };
- module2.exports = {
- includes: createMethod(true),
- indexOf: createMethod(false)
- };
- }
- });
- // node_modules/core-js/internals/object-keys-internal.js
- var require_object_keys_internal = __commonJS({
- "node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var hasOwn = require_has_own_property();
- var toIndexedObject = require_to_indexed_object();
- var indexOf = require_array_includes().indexOf;
- var hiddenKeys = require_hidden_keys();
- var push = uncurryThis([].push);
- module2.exports = function(object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O)
- !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
- while (names.length > i)
- if (hasOwn(O, key = names[i++])) {
- ~indexOf(result, key) || push(result, key);
- }
- return result;
- };
- }
- });
- // node_modules/core-js/internals/enum-bug-keys.js
- var require_enum_bug_keys = __commonJS({
- "node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
- module2.exports = [
- "constructor",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "toLocaleString",
- "toString",
- "valueOf"
- ];
- }
- });
- // node_modules/core-js/internals/object-get-own-property-names.js
- var require_object_get_own_property_names = __commonJS({
- "node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
- var internalObjectKeys = require_object_keys_internal();
- var enumBugKeys = require_enum_bug_keys();
- var hiddenKeys = enumBugKeys.concat("length", "prototype");
- exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- }
- });
- // node_modules/core-js/internals/object-get-own-property-symbols.js
- var require_object_get_own_property_symbols = __commonJS({
- "node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
- exports2.f = Object.getOwnPropertySymbols;
- }
- });
- // node_modules/core-js/internals/own-keys.js
- var require_own_keys = __commonJS({
- "node_modules/core-js/internals/own-keys.js"(exports2, module2) {
- var getBuiltIn = require_get_built_in();
- var uncurryThis = require_function_uncurry_this();
- var getOwnPropertyNamesModule = require_object_get_own_property_names();
- var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
- var anObject = require_an_object();
- var concat = uncurryThis([].concat);
- module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
- var keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
- };
- }
- });
- // node_modules/core-js/internals/copy-constructor-properties.js
- var require_copy_constructor_properties = __commonJS({
- "node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
- var hasOwn = require_has_own_property();
- var ownKeys = require_own_keys();
- var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
- var definePropertyModule = require_object_define_property();
- module2.exports = function(target, source, exceptions) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
- }
- }
- };
- }
- });
- // node_modules/core-js/internals/is-forced.js
- var require_is_forced = __commonJS({
- "node_modules/core-js/internals/is-forced.js"(exports2, module2) {
- var fails = require_fails();
- var isCallable = require_is_callable();
- var replacement = /#|\.prototype\./;
- var isForced = function(feature, detection) {
- var value = data[normalize(feature)];
- return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
- };
- var normalize = isForced.normalize = function(string) {
- return String(string).replace(replacement, ".").toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = "N";
- var POLYFILL = isForced.POLYFILL = "P";
- module2.exports = isForced;
- }
- });
- // node_modules/core-js/internals/export.js
- var require_export = __commonJS({
- "node_modules/core-js/internals/export.js"(exports2, module2) {
- var global2 = require_global();
- var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
- var createNonEnumerableProperty = require_create_non_enumerable_property();
- var defineBuiltIn = require_define_built_in();
- var defineGlobalProperty = require_define_global_property();
- var copyConstructorProperties = require_copy_constructor_properties();
- var isForced = require_is_forced();
- module2.exports = function(options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
- if (GLOBAL) {
- target = global2;
- } else if (STATIC) {
- target = global2[TARGET] || defineGlobalProperty(TARGET, {});
- } else {
- target = (global2[TARGET] || {}).prototype;
- }
- if (target)
- for (key in source) {
- sourceProperty = source[key];
- if (options.dontCallGetSet) {
- descriptor = getOwnPropertyDescriptor(target, key);
- targetProperty = descriptor && descriptor.value;
- } else
- targetProperty = target[key];
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
- if (!FORCED && targetProperty !== void 0) {
- if (typeof sourceProperty == typeof targetProperty)
- continue;
- copyConstructorProperties(sourceProperty, targetProperty);
- }
- if (options.sham || targetProperty && targetProperty.sham) {
- createNonEnumerableProperty(sourceProperty, "sham", true);
- }
- defineBuiltIn(target, key, sourceProperty, options);
- }
- };
- }
- });
- // node_modules/core-js/internals/function-uncurry-this-clause.js
- var require_function_uncurry_this_clause = __commonJS({
- "node_modules/core-js/internals/function-uncurry-this-clause.js"(exports2, module2) {
- var classofRaw = require_classof_raw();
- var uncurryThis = require_function_uncurry_this();
- module2.exports = function(fn) {
- if (classofRaw(fn) === "Function")
- return uncurryThis(fn);
- };
- }
- });
- // node_modules/core-js/internals/function-bind-context.js
- var require_function_bind_context = __commonJS({
- "node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this_clause();
- var aCallable = require_a_callable();
- var NATIVE_BIND = require_function_bind_native();
- var bind = uncurryThis(uncurryThis.bind);
- module2.exports = function(fn, that) {
- aCallable(fn);
- return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
- return fn.apply(that, arguments);
- };
- };
- }
- });
- // node_modules/core-js/internals/iterators.js
- var require_iterators = __commonJS({
- "node_modules/core-js/internals/iterators.js"(exports2, module2) {
- module2.exports = {};
- }
- });
- // node_modules/core-js/internals/is-array-iterator-method.js
- var require_is_array_iterator_method = __commonJS({
- "node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
- var wellKnownSymbol = require_well_known_symbol();
- var Iterators = require_iterators();
- var ITERATOR = wellKnownSymbol("iterator");
- var ArrayPrototype = Array.prototype;
- module2.exports = function(it) {
- return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- }
- });
- // node_modules/core-js/internals/to-string-tag-support.js
- var require_to_string_tag_support = __commonJS({
- "node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
- var wellKnownSymbol = require_well_known_symbol();
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var test = {};
- test[TO_STRING_TAG] = "z";
- module2.exports = String(test) === "[object z]";
- }
- });
- // node_modules/core-js/internals/classof.js
- var require_classof = __commonJS({
- "node_modules/core-js/internals/classof.js"(exports2, module2) {
- var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
- var isCallable = require_is_callable();
- var classofRaw = require_classof_raw();
- var wellKnownSymbol = require_well_known_symbol();
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var $Object = Object;
- var CORRECT_ARGUMENTS = classofRaw(function() {
- return arguments;
- }()) == "Arguments";
- var tryGet = function(it, key) {
- try {
- return it[key];
- } catch (error) {
- }
- };
- module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
- var O, tag, result;
- return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
- };
- }
- });
- // node_modules/core-js/internals/get-iterator-method.js
- var require_get_iterator_method = __commonJS({
- "node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
- var classof = require_classof();
- var getMethod = require_get_method();
- var isNullOrUndefined = require_is_null_or_undefined();
- var Iterators = require_iterators();
- var wellKnownSymbol = require_well_known_symbol();
- var ITERATOR = wellKnownSymbol("iterator");
- module2.exports = function(it) {
- if (!isNullOrUndefined(it))
- return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
- };
- }
- });
- // node_modules/core-js/internals/get-iterator.js
- var require_get_iterator = __commonJS({
- "node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
- var call = require_function_call();
- var aCallable = require_a_callable();
- var anObject = require_an_object();
- var tryToString = require_try_to_string();
- var getIteratorMethod = require_get_iterator_method();
- var $TypeError = TypeError;
- module2.exports = function(argument, usingIterator) {
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
- if (aCallable(iteratorMethod))
- return anObject(call(iteratorMethod, argument));
- throw $TypeError(tryToString(argument) + " is not iterable");
- };
- }
- });
- // node_modules/core-js/internals/iterator-close.js
- var require_iterator_close = __commonJS({
- "node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
- var call = require_function_call();
- var anObject = require_an_object();
- var getMethod = require_get_method();
- module2.exports = function(iterator, kind, value) {
- var innerResult, innerError;
- anObject(iterator);
- try {
- innerResult = getMethod(iterator, "return");
- if (!innerResult) {
- if (kind === "throw")
- throw value;
- return value;
- }
- innerResult = call(innerResult, iterator);
- } catch (error) {
- innerError = true;
- innerResult = error;
- }
- if (kind === "throw")
- throw value;
- if (innerError)
- throw innerResult;
- anObject(innerResult);
- return value;
- };
- }
- });
- // node_modules/core-js/internals/iterate.js
- var require_iterate = __commonJS({
- "node_modules/core-js/internals/iterate.js"(exports2, module2) {
- var bind = require_function_bind_context();
- var call = require_function_call();
- var anObject = require_an_object();
- var tryToString = require_try_to_string();
- var isArrayIteratorMethod = require_is_array_iterator_method();
- var lengthOfArrayLike = require_length_of_array_like();
- var isPrototypeOf = require_object_is_prototype_of();
- var getIterator = require_get_iterator();
- var getIteratorMethod = require_get_iterator_method();
- var iteratorClose = require_iterator_close();
- var $TypeError = TypeError;
- var Result = function(stopped, result) {
- this.stopped = stopped;
- this.result = result;
- };
- var ResultPrototype = Result.prototype;
- module2.exports = function(iterable, unboundFunction, options) {
- var that = options && options.that;
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
- var IS_RECORD = !!(options && options.IS_RECORD);
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
- var INTERRUPTED = !!(options && options.INTERRUPTED);
- var fn = bind(unboundFunction, that);
- var iterator, iterFn, index, length, result, next, step;
- var stop = function(condition) {
- if (iterator)
- iteratorClose(iterator, "normal", condition);
- return new Result(true, condition);
- };
- var callFn = function(value) {
- if (AS_ENTRIES) {
- anObject(value);
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
- }
- return INTERRUPTED ? fn(value, stop) : fn(value);
- };
- if (IS_RECORD) {
- iterator = iterable.iterator;
- } else if (IS_ITERATOR) {
- iterator = iterable;
- } else {
- iterFn = getIteratorMethod(iterable);
- if (!iterFn)
- throw $TypeError(tryToString(iterable) + " is not iterable");
- if (isArrayIteratorMethod(iterFn)) {
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
- result = callFn(iterable[index]);
- if (result && isPrototypeOf(ResultPrototype, result))
- return result;
- }
- return new Result(false);
- }
- iterator = getIterator(iterable, iterFn);
- }
- next = IS_RECORD ? iterable.next : iterator.next;
- while (!(step = call(next, iterator)).done) {
- try {
- result = callFn(step.value);
- } catch (error) {
- iteratorClose(iterator, "throw", error);
- }
- if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
- return result;
- }
- return new Result(false);
- };
- }
- });
- // node_modules/core-js/internals/create-property.js
- var require_create_property = __commonJS({
- "node_modules/core-js/internals/create-property.js"(exports2, module2) {
- "use strict";
- var toPropertyKey = require_to_property_key();
- var definePropertyModule = require_object_define_property();
- var createPropertyDescriptor = require_create_property_descriptor();
- module2.exports = function(object, key, value) {
- var propertyKey = toPropertyKey(key);
- if (propertyKey in object)
- definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else
- object[propertyKey] = value;
- };
- }
- });
- // node_modules/core-js/modules/es.object.from-entries.js
- var require_es_object_from_entries = __commonJS({
- "node_modules/core-js/modules/es.object.from-entries.js"() {
- var $ = require_export();
- var iterate = require_iterate();
- var createProperty = require_create_property();
- $({ target: "Object", stat: true }, {
- fromEntries: function fromEntries(iterable) {
- var obj = {};
- iterate(iterable, function(k, v) {
- createProperty(obj, k, v);
- }, { AS_ENTRIES: true });
- return obj;
- }
- });
- }
- });
- // node_modules/core-js/internals/is-array.js
- var require_is_array = __commonJS({
- "node_modules/core-js/internals/is-array.js"(exports2, module2) {
- var classof = require_classof_raw();
- module2.exports = Array.isArray || function isArray(argument) {
- return classof(argument) == "Array";
- };
- }
- });
- // node_modules/core-js/internals/does-not-exceed-safe-integer.js
- var require_does_not_exceed_safe_integer = __commonJS({
- "node_modules/core-js/internals/does-not-exceed-safe-integer.js"(exports2, module2) {
- var $TypeError = TypeError;
- var MAX_SAFE_INTEGER = 9007199254740991;
- module2.exports = function(it) {
- if (it > MAX_SAFE_INTEGER)
- throw $TypeError("Maximum allowed index exceeded");
- return it;
- };
- }
- });
- // node_modules/core-js/internals/flatten-into-array.js
- var require_flatten_into_array = __commonJS({
- "node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
- "use strict";
- var isArray = require_is_array();
- var lengthOfArrayLike = require_length_of_array_like();
- var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
- var bind = require_function_bind_context();
- var flattenIntoArray = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
- var targetIndex = start;
- var sourceIndex = 0;
- var mapFn = mapper ? bind(mapper, thisArg) : false;
- var element, elementLen;
- while (sourceIndex < sourceLen) {
- if (sourceIndex in source) {
- element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
- if (depth > 0 && isArray(element)) {
- elementLen = lengthOfArrayLike(element);
- targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
- } else {
- doesNotExceedSafeInteger(targetIndex + 1);
- target[targetIndex] = element;
- }
- targetIndex++;
- }
- sourceIndex++;
- }
- return targetIndex;
- };
- module2.exports = flattenIntoArray;
- }
- });
- // node_modules/core-js/internals/is-constructor.js
- var require_is_constructor = __commonJS({
- "node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
- var uncurryThis = require_function_uncurry_this();
- var fails = require_fails();
- var isCallable = require_is_callable();
- var classof = require_classof();
- var getBuiltIn = require_get_built_in();
- var inspectSource = require_inspect_source();
- var noop = function() {
- };
- var empty = [];
- var construct = getBuiltIn("Reflect", "construct");
- var constructorRegExp = /^\s*(?:class|function)\b/;
- var exec = uncurryThis(constructorRegExp.exec);
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
- var isConstructorModern = function isConstructor(argument) {
- if (!isCallable(argument))
- return false;
- try {
- construct(noop, empty, argument);
- return true;
- } catch (error) {
- return false;
- }
- };
- var isConstructorLegacy = function isConstructor(argument) {
- if (!isCallable(argument))
- return false;
- switch (classof(argument)) {
- case "AsyncFunction":
- case "GeneratorFunction":
- case "AsyncGeneratorFunction":
- return false;
- }
- try {
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
- } catch (error) {
- return true;
- }
- };
- isConstructorLegacy.sham = true;
- module2.exports = !construct || fails(function() {
- var called;
- return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
- called = true;
- }) || called;
- }) ? isConstructorLegacy : isConstructorModern;
- }
- });
- // node_modules/core-js/internals/array-species-constructor.js
- var require_array_species_constructor = __commonJS({
- "node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
- var isArray = require_is_array();
- var isConstructor = require_is_constructor();
- var isObject = require_is_object();
- var wellKnownSymbol = require_well_known_symbol();
- var SPECIES = wellKnownSymbol("species");
- var $Array = Array;
- module2.exports = function(originalArray) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- if (isConstructor(C) && (C === $Array || isArray(C.prototype)))
- C = void 0;
- else if (isObject(C)) {
- C = C[SPECIES];
- if (C === null)
- C = void 0;
- }
- }
- return C === void 0 ? $Array : C;
- };
- }
- });
- // node_modules/core-js/internals/array-species-create.js
- var require_array_species_create = __commonJS({
- "node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
- var arraySpeciesConstructor = require_array_species_constructor();
- module2.exports = function(originalArray, length) {
- return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
- };
- }
- });
- // node_modules/core-js/modules/es.array.flat-map.js
- var require_es_array_flat_map = __commonJS({
- "node_modules/core-js/modules/es.array.flat-map.js"() {
- "use strict";
- var $ = require_export();
- var flattenIntoArray = require_flatten_into_array();
- var aCallable = require_a_callable();
- var toObject = require_to_object();
- var lengthOfArrayLike = require_length_of_array_like();
- var arraySpeciesCreate = require_array_species_create();
- $({ target: "Array", proto: true }, {
- flatMap: function flatMap(callbackfn) {
- var O = toObject(this);
- var sourceLen = lengthOfArrayLike(O);
- var A;
- aCallable(callbackfn);
- A = arraySpeciesCreate(O, 0);
- A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
- return A;
- }
- });
- }
- });
- // node_modules/core-js/modules/es.array.flat.js
- var require_es_array_flat = __commonJS({
- "node_modules/core-js/modules/es.array.flat.js"() {
- "use strict";
- var $ = require_export();
- var flattenIntoArray = require_flatten_into_array();
- var toObject = require_to_object();
- var lengthOfArrayLike = require_length_of_array_like();
- var toIntegerOrInfinity = require_to_integer_or_infinity();
- var arraySpeciesCreate = require_array_species_create();
- $({ target: "Array", proto: true }, {
- flat: function flat() {
- var depthArg = arguments.length ? arguments[0] : void 0;
- var O = toObject(this);
- var sourceLen = lengthOfArrayLike(O);
- var A = arraySpeciesCreate(O, 0);
- A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
- return A;
- }
- });
- }
- });
- // node_modules/core-js/internals/define-built-in-accessor.js
- var require_define_built_in_accessor = __commonJS({
- "node_modules/core-js/internals/define-built-in-accessor.js"(exports2, module2) {
- var makeBuiltIn = require_make_built_in();
- var defineProperty = require_object_define_property();
- module2.exports = function(target, name, descriptor) {
- if (descriptor.get)
- makeBuiltIn(descriptor.get, name, { getter: true });
- if (descriptor.set)
- makeBuiltIn(descriptor.set, name, { setter: true });
- return defineProperty.f(target, name, descriptor);
- };
- }
- });
- // node_modules/core-js/internals/regexp-flags.js
- var require_regexp_flags = __commonJS({
- "node_modules/core-js/internals/regexp-flags.js"(exports2, module2) {
- "use strict";
- var anObject = require_an_object();
- module2.exports = function() {
- var that = anObject(this);
- var result = "";
- if (that.hasIndices)
- result += "d";
- if (that.global)
- result += "g";
- if (that.ignoreCase)
- result += "i";
- if (that.multiline)
- result += "m";
- if (that.dotAll)
- result += "s";
- if (that.unicode)
- result += "u";
- if (that.unicodeSets)
- result += "v";
- if (that.sticky)
- result += "y";
- return result;
- };
- }
- });
- // node_modules/core-js/modules/es.regexp.flags.js
- var require_es_regexp_flags = __commonJS({
- "node_modules/core-js/modules/es.regexp.flags.js"() {
- var global2 = require_global();
- var DESCRIPTORS = require_descriptors();
- var defineBuiltInAccessor = require_define_built_in_accessor();
- var regExpFlags = require_regexp_flags();
- var fails = require_fails();
- var RegExp2 = global2.RegExp;
- var RegExpPrototype = RegExp2.prototype;
- var FORCED = DESCRIPTORS && fails(function() {
- var INDICES_SUPPORT = true;
- try {
- RegExp2(".", "d");
- } catch (error) {
- INDICES_SUPPORT = false;
- }
- var O = {};
- var calls = "";
- var expected = INDICES_SUPPORT ? "dgimsy" : "gimsy";
- var addGetter = function(key2, chr) {
- Object.defineProperty(O, key2, { get: function() {
- calls += chr;
- return true;
- } });
- };
- var pairs = {
- dotAll: "s",
- global: "g",
- ignoreCase: "i",
- multiline: "m",
- sticky: "y"
- };
- if (INDICES_SUPPORT)
- pairs.hasIndices = "d";
- for (var key in pairs)
- addGetter(key, pairs[key]);
- var result = Object.getOwnPropertyDescriptor(RegExpPrototype, "flags").get.call(O);
- return result !== expected || calls !== expected;
- });
- if (FORCED)
- defineBuiltInAccessor(RegExpPrototype, "flags", {
- configurable: true,
- get: regExpFlags
- });
- }
- });
- // dist/_cli.js.cjs.js
- require_es_object_from_entries();
- require_es_array_flat_map();
- require_es_array_flat();
- require_es_regexp_flags();
- var __create = Object.create;
- var __defProp = Object.defineProperty;
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
- var __getProtoOf = Object.getPrototypeOf;
- var __hasOwnProp = Object.prototype.hasOwnProperty;
- var __esm = (fn, res) => function __init() {
- return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
- };
- var __commonJS2 = (cb, mod) => function __require() {
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = {
- exports: {}
- }).exports, mod), mod.exports;
- };
- var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {
- get: all[name],
- enumerable: true
- });
- };
- var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames2(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, {
- get: () => from[key],
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
- });
- }
- return to;
- };
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
- value: mod,
- enumerable: true
- }) : target, mod));
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", {
- value: true
- }), mod);
- var require_fast_json_stable_stringify = __commonJS2({
- "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
- "use strict";
- module2.exports = function(data, opts) {
- if (!opts)
- opts = {};
- if (typeof opts === "function")
- opts = {
- cmp: opts
- };
- var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
- var cmp = opts.cmp && function(f) {
- return function(node) {
- return function(a, b) {
- var aobj = {
- key: a,
- value: node[a]
- };
- var bobj = {
- key: b,
- value: node[b]
- };
- return f(aobj, bobj);
- };
- };
- }(opts.cmp);
- var seen = [];
- return function stringify2(node) {
- if (node && node.toJSON && typeof node.toJSON === "function") {
- node = node.toJSON();
- }
- if (node === void 0)
- return;
- if (typeof node == "number")
- return isFinite(node) ? "" + node : "null";
- if (typeof node !== "object")
- return JSON.stringify(node);
- var i, out;
- if (Array.isArray(node)) {
- out = "[";
- for (i = 0; i < node.length; i++) {
- if (i)
- out += ",";
- out += stringify2(node[i]) || "null";
- }
- return out + "]";
- }
- if (node === null)
- return "null";
- if (seen.indexOf(node) !== -1) {
- if (cycles)
- return JSON.stringify("__cycle__");
- throw new TypeError("Converting circular structure to JSON");
- }
- var seenIndex = seen.push(node) - 1;
- var keys = Object.keys(node).sort(cmp && cmp(node));
- out = "";
- for (i = 0; i < keys.length; i++) {
- var key = keys[i];
- var value = stringify2(node[key]);
- if (!value)
- continue;
- if (out)
- out += ",";
- out += JSON.stringify(key) + ":" + value;
- }
- seen.splice(seenIndex, 1);
- return "{" + out + "}";
- }(data);
- };
- }
- });
- var require_clone = __commonJS2({
- "node_modules/clone/clone.js"(exports2, module2) {
- var clone = function() {
- "use strict";
- function clone2(parent, circular, depth, prototype) {
- var filter;
- if (typeof circular === "object") {
- depth = circular.depth;
- prototype = circular.prototype;
- filter = circular.filter;
- circular = circular.circular;
- }
- var allParents = [];
- var allChildren = [];
- var useBuffer = typeof Buffer != "undefined";
- if (typeof circular == "undefined")
- circular = true;
- if (typeof depth == "undefined")
- depth = Infinity;
- function _clone(parent2, depth2) {
- if (parent2 === null)
- return null;
- if (depth2 == 0)
- return parent2;
- var child;
- var proto2;
- if (typeof parent2 != "object") {
- return parent2;
- }
- if (clone2.__isArray(parent2)) {
- child = [];
- } else if (clone2.__isRegExp(parent2)) {
- child = new RegExp(parent2.source, __getRegExpFlags(parent2));
- if (parent2.lastIndex)
- child.lastIndex = parent2.lastIndex;
- } else if (clone2.__isDate(parent2)) {
- child = new Date(parent2.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent2)) {
- if (Buffer.allocUnsafe) {
- child = Buffer.allocUnsafe(parent2.length);
- } else {
- child = new Buffer(parent2.length);
- }
- parent2.copy(child);
- return child;
- } else {
- if (typeof prototype == "undefined") {
- proto2 = Object.getPrototypeOf(parent2);
- child = Object.create(proto2);
- } else {
- child = Object.create(prototype);
- proto2 = prototype;
- }
- }
- if (circular) {
- var index = allParents.indexOf(parent2);
- if (index != -1) {
- return allChildren[index];
- }
- allParents.push(parent2);
- allChildren.push(child);
- }
- for (var i in parent2) {
- var attrs;
- if (proto2) {
- attrs = Object.getOwnPropertyDescriptor(proto2, i);
- }
- if (attrs && attrs.set == null) {
- continue;
- }
- child[i] = _clone(parent2[i], depth2 - 1);
- }
- return child;
- }
- return _clone(parent, depth);
- }
- clone2.clonePrototype = function clonePrototype(parent) {
- if (parent === null)
- return null;
- var c = function() {
- };
- c.prototype = parent;
- return new c();
- };
- function __objToStr(o) {
- return Object.prototype.toString.call(o);
- }
- ;
- clone2.__objToStr = __objToStr;
- function __isDate(o) {
- return typeof o === "object" && __objToStr(o) === "[object Date]";
- }
- ;
- clone2.__isDate = __isDate;
- function __isArray(o) {
- return typeof o === "object" && __objToStr(o) === "[object Array]";
- }
- ;
- clone2.__isArray = __isArray;
- function __isRegExp(o) {
- return typeof o === "object" && __objToStr(o) === "[object RegExp]";
- }
- ;
- clone2.__isRegExp = __isRegExp;
- function __getRegExpFlags(re) {
- var flags = "";
- if (re.global)
- flags += "g";
- if (re.ignoreCase)
- flags += "i";
- if (re.multiline)
- flags += "m";
- return flags;
- }
- ;
- clone2.__getRegExpFlags = __getRegExpFlags;
- return clone2;
- }();
- if (typeof module2 === "object" && module2.exports) {
- module2.exports = clone;
- }
- }
- });
- var require_defaults = __commonJS2({
- "node_modules/defaults/index.js"(exports2, module2) {
- var clone = require_clone();
- module2.exports = function(options, defaults) {
- options = options || {};
- Object.keys(defaults).forEach(function(key) {
- if (typeof options[key] === "undefined") {
- options[key] = clone(defaults[key]);
- }
- });
- return options;
- };
- }
- });
- var require_combining = __commonJS2({
- "node_modules/wcwidth/combining.js"(exports2, module2) {
- module2.exports = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531], [68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]];
- }
- });
- var require_wcwidth = __commonJS2({
- "node_modules/wcwidth/index.js"(exports2, module2) {
- "use strict";
- var defaults = require_defaults();
- var combining = require_combining();
- var DEFAULTS = {
- nul: 0,
- control: 0
- };
- module2.exports = function wcwidth2(str) {
- return wcswidth(str, DEFAULTS);
- };
- module2.exports.config = function(opts) {
- opts = defaults(opts || {}, DEFAULTS);
- return function wcwidth2(str) {
- return wcswidth(str, opts);
- };
- };
- function wcswidth(str, opts) {
- if (typeof str !== "string")
- return wcwidth(str, opts);
- var s = 0;
- for (var i = 0; i < str.length; i++) {
- var n = wcwidth(str.charCodeAt(i), opts);
- if (n < 0)
- return -1;
- s += n;
- }
- return s;
- }
- function wcwidth(ucs, opts) {
- if (ucs === 0)
- return opts.nul;
- if (ucs < 32 || ucs >= 127 && ucs < 160)
- return opts.control;
- if (bisearch(ucs))
- return 0;
- return 1 + (ucs >= 4352 && (ucs <= 4447 || ucs == 9001 || ucs == 9002 || ucs >= 11904 && ucs <= 42191 && ucs != 12351 || ucs >= 44032 && ucs <= 55203 || ucs >= 63744 && ucs <= 64255 || ucs >= 65040 && ucs <= 65049 || ucs >= 65072 && ucs <= 65135 || ucs >= 65280 && ucs <= 65376 || ucs >= 65504 && ucs <= 65510 || ucs >= 131072 && ucs <= 196605 || ucs >= 196608 && ucs <= 262141));
- }
- function bisearch(ucs) {
- var min = 0;
- var max = combining.length - 1;
- var mid;
- if (ucs < combining[0][0] || ucs > combining[max][1])
- return false;
- while (max >= min) {
- mid = Math.floor((min + max) / 2);
- if (ucs > combining[mid][1])
- min = mid + 1;
- else if (ucs < combining[mid][0])
- max = mid - 1;
- else
- return true;
- }
- return false;
- }
- }
- });
- function ansiRegex({
- onlyFirst = false
- } = {}) {
- 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("|");
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
- }
- var init_ansi_regex = __esm({
- "node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
- }
- });
- var strip_ansi_exports = {};
- __export(strip_ansi_exports, {
- default: () => stripAnsi
- });
- function stripAnsi(string) {
- if (typeof string !== "string") {
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
- }
- return string.replace(ansiRegex(), "");
- }
- var init_strip_ansi = __esm({
- "node_modules/strip-ansi/index.js"() {
- init_ansi_regex();
- }
- });
- function assembleStyles() {
- const codes = /* @__PURE__ */ new Map();
- const styles2 = {
- modifier: {
- reset: [0, 0],
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- overline: [53, 55],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- blackBright: [90, 39],
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
- bgBlackBright: [100, 49],
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
- };
- styles2.color.gray = styles2.color.blackBright;
- styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
- styles2.color.grey = styles2.color.blackBright;
- styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
- for (const [groupName, group] of Object.entries(styles2)) {
- for (const [styleName, style] of Object.entries(group)) {
- styles2[styleName] = {
- open: `\x1B[${style[0]}m`,
- close: `\x1B[${style[1]}m`
- };
- group[styleName] = styles2[styleName];
- codes.set(style[0], style[1]);
- }
- Object.defineProperty(styles2, groupName, {
- value: group,
- enumerable: false
- });
- }
- Object.defineProperty(styles2, "codes", {
- value: codes,
- enumerable: false
- });
- styles2.color.close = "\x1B[39m";
- styles2.bgColor.close = "\x1B[49m";
- styles2.color.ansi = wrapAnsi16();
- styles2.color.ansi256 = wrapAnsi256();
- styles2.color.ansi16m = wrapAnsi16m();
- styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
- styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
- styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
- Object.defineProperties(styles2, {
- rgbToAnsi256: {
- value: (red, green, blue) => {
- if (red === green && green === blue) {
- if (red < 8) {
- return 16;
- }
- if (red > 248) {
- return 231;
- }
- return Math.round((red - 8) / 247 * 24) + 232;
- }
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
- },
- enumerable: false
- },
- hexToRgb: {
- value: (hex) => {
- const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
- if (!matches) {
- return [0, 0, 0];
- }
- let {
- colorString
- } = matches.groups;
- if (colorString.length === 3) {
- colorString = [...colorString].map((character) => character + character).join("");
- }
- const integer = Number.parseInt(colorString, 16);
- return [integer >> 16 & 255, integer >> 8 & 255, integer & 255];
- },
- enumerable: false
- },
- hexToAnsi256: {
- value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
- enumerable: false
- },
- ansi256ToAnsi: {
- value: (code) => {
- if (code < 8) {
- return 30 + code;
- }
- if (code < 16) {
- return 90 + (code - 8);
- }
- let red;
- let green;
- let blue;
- if (code >= 232) {
- red = ((code - 232) * 10 + 8) / 255;
- green = red;
- blue = red;
- } else {
- code -= 16;
- const remainder = code % 36;
- red = Math.floor(code / 36) / 5;
- green = Math.floor(remainder / 6) / 5;
- blue = remainder % 6 / 5;
- }
- const value = Math.max(red, green, blue) * 2;
- if (value === 0) {
- return 30;
- }
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
- if (value === 2) {
- result += 60;
- }
- return result;
- },
- enumerable: false
- },
- rgbToAnsi: {
- value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
- enumerable: false
- },
- hexToAnsi: {
- value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
- enumerable: false
- }
- });
- return styles2;
- }
- var ANSI_BACKGROUND_OFFSET;
- var wrapAnsi16;
- var wrapAnsi256;
- var wrapAnsi16m;
- var ansiStyles;
- var ansi_styles_default;
- var init_ansi_styles = __esm({
- "node_modules/chalk/source/vendor/ansi-styles/index.js"() {
- ANSI_BACKGROUND_OFFSET = 10;
- wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
- wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
- wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
- ansiStyles = assembleStyles();
- ansi_styles_default = ansiStyles;
- }
- });
- function hasFlag(flag, argv = import_node_process.default.argv) {
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
- const position = argv.indexOf(prefix + flag);
- const terminatorPosition = argv.indexOf("--");
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
- }
- function envForceColor() {
- if ("FORCE_COLOR" in env) {
- if (env.FORCE_COLOR === "true") {
- return 1;
- }
- if (env.FORCE_COLOR === "false") {
- return 0;
- }
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
- }
- }
- function translateLevel(level) {
- if (level === 0) {
- return false;
- }
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
- }
- function _supportsColor(haveStream, {
- streamIsTTY,
- sniffFlags = true
- } = {}) {
- const noFlagForceColor = envForceColor();
- if (noFlagForceColor !== void 0) {
- flagForceColor = noFlagForceColor;
- }
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
- if (forceColor === 0) {
- return 0;
- }
- if (sniffFlags) {
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
- return 3;
- }
- if (hasFlag("color=256")) {
- return 2;
- }
- }
- if (haveStream && !streamIsTTY && forceColor === void 0) {
- return 0;
- }
- const min = forceColor || 0;
- if (env.TERM === "dumb") {
- return min;
- }
- if (import_node_process.default.platform === "win32") {
- const osRelease = import_node_os.default.release().split(".");
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
- return 1;
- }
- if ("CI" in env) {
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
- return 1;
- }
- return min;
- }
- if ("TEAMCITY_VERSION" in env) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
- }
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
- return 1;
- }
- if (env.COLORTERM === "truecolor") {
- return 3;
- }
- if ("TERM_PROGRAM" in env) {
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
- switch (env.TERM_PROGRAM) {
- case "iTerm.app":
- return version >= 3 ? 3 : 2;
- case "Apple_Terminal":
- return 2;
- }
- }
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
- if ("COLORTERM" in env) {
- return 1;
- }
- return min;
- }
- function createSupportsColor(stream, options = {}) {
- const level = _supportsColor(stream, Object.assign({
- streamIsTTY: stream && stream.isTTY
- }, options));
- return translateLevel(level);
- }
- var import_node_process;
- var import_node_os;
- var import_node_tty;
- var env;
- var flagForceColor;
- var supportsColor;
- var supports_color_default;
- var init_supports_color = __esm({
- "node_modules/chalk/source/vendor/supports-color/index.js"() {
- import_node_process = __toESM(require("process"), 1);
- import_node_os = __toESM(require("os"), 1);
- import_node_tty = __toESM(require("tty"), 1);
- ({
- env
- } = import_node_process.default);
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
- flagForceColor = 0;
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
- flagForceColor = 1;
- }
- supportsColor = {
- stdout: createSupportsColor({
- isTTY: import_node_tty.default.isatty(1)
- }),
- stderr: createSupportsColor({
- isTTY: import_node_tty.default.isatty(2)
- })
- };
- supports_color_default = supportsColor;
- }
- });
- function stringReplaceAll(string, substring, replacer) {
- let index = string.indexOf(substring);
- if (index === -1) {
- return string;
- }
- const substringLength = substring.length;
- let endIndex = 0;
- let returnValue = "";
- do {
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
- endIndex = index + substringLength;
- index = string.indexOf(substring, endIndex);
- } while (index !== -1);
- returnValue += string.slice(endIndex);
- return returnValue;
- }
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
- let endIndex = 0;
- let returnValue = "";
- do {
- const gotCR = string[index - 1] === "\r";
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
- endIndex = index + 1;
- index = string.indexOf("\n", endIndex);
- } while (index !== -1);
- returnValue += string.slice(endIndex);
- return returnValue;
- }
- var init_utilities = __esm({
- "node_modules/chalk/source/utilities.js"() {
- }
- });
- var source_exports = {};
- __export(source_exports, {
- Chalk: () => Chalk,
- chalkStderr: () => chalkStderr,
- default: () => source_default,
- supportsColor: () => stdoutColor,
- supportsColorStderr: () => stderrColor
- });
- function createChalk(options) {
- return chalkFactory(options);
- }
- var stdoutColor;
- var stderrColor;
- var GENERATOR;
- var STYLER;
- var IS_EMPTY;
- var levelMapping;
- var styles;
- var applyOptions;
- var Chalk;
- var chalkFactory;
- var getModelAnsi;
- var usedModels;
- var proto;
- var createStyler;
- var createBuilder;
- var applyStyle;
- var chalk;
- var chalkStderr;
- var source_default;
- var init_source = __esm({
- "node_modules/chalk/source/index.js"() {
- init_ansi_styles();
- init_supports_color();
- init_utilities();
- ({
- stdout: stdoutColor,
- stderr: stderrColor
- } = supports_color_default);
- GENERATOR = Symbol("GENERATOR");
- STYLER = Symbol("STYLER");
- IS_EMPTY = Symbol("IS_EMPTY");
- levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
- styles = /* @__PURE__ */ Object.create(null);
- applyOptions = (object, options = {}) => {
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
- throw new Error("The `level` option should be an integer from 0 to 3");
- }
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
- object.level = options.level === void 0 ? colorLevel : options.level;
- };
- Chalk = class {
- constructor(options) {
- return chalkFactory(options);
- }
- };
- chalkFactory = (options) => {
- const chalk2 = (...strings) => strings.join(" ");
- applyOptions(chalk2, options);
- Object.setPrototypeOf(chalk2, createChalk.prototype);
- return chalk2;
- };
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
- styles[styleName] = {
- get() {
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
- Object.defineProperty(this, styleName, {
- value: builder
- });
- return builder;
- }
- };
- }
- styles.visible = {
- get() {
- const builder = createBuilder(this, this[STYLER], true);
- Object.defineProperty(this, "visible", {
- value: builder
- });
- return builder;
- }
- };
- getModelAnsi = (model, level, type, ...arguments_) => {
- if (model === "rgb") {
- if (level === "ansi16m") {
- return ansi_styles_default[type].ansi16m(...arguments_);
- }
- if (level === "ansi256") {
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
- }
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
- }
- if (model === "hex") {
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
- }
- return ansi_styles_default[type][model](...arguments_);
- };
- usedModels = ["rgb", "hex", "ansi256"];
- for (const model of usedModels) {
- styles[model] = {
- get() {
- const {
- level
- } = this;
- return function(...arguments_) {
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
- return createBuilder(this, styler, this[IS_EMPTY]);
- };
- }
- };
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
- styles[bgModel] = {
- get() {
- const {
- level
- } = this;
- return function(...arguments_) {
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
- return createBuilder(this, styler, this[IS_EMPTY]);
- };
- }
- };
- }
- proto = Object.defineProperties(() => {
- }, Object.assign(Object.assign({}, styles), {}, {
- level: {
- enumerable: true,
- get() {
- return this[GENERATOR].level;
- },
- set(level) {
- this[GENERATOR].level = level;
- }
- }
- }));
- createStyler = (open, close, parent) => {
- let openAll;
- let closeAll;
- if (parent === void 0) {
- openAll = open;
- closeAll = close;
- } else {
- openAll = parent.openAll + open;
- closeAll = close + parent.closeAll;
- }
- return {
- open,
- close,
- openAll,
- closeAll,
- parent
- };
- };
- createBuilder = (self2, _styler, _isEmpty) => {
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
- Object.setPrototypeOf(builder, proto);
- builder[GENERATOR] = self2;
- builder[STYLER] = _styler;
- builder[IS_EMPTY] = _isEmpty;
- return builder;
- };
- applyStyle = (self2, string) => {
- if (self2.level <= 0 || !string) {
- return self2[IS_EMPTY] ? "" : string;
- }
- let styler = self2[STYLER];
- if (styler === void 0) {
- return string;
- }
- const {
- openAll,
- closeAll
- } = styler;
- if (string.includes("\x1B")) {
- while (styler !== void 0) {
- string = stringReplaceAll(string, styler.close, styler.open);
- styler = styler.parent;
- }
- }
- const lfIndex = string.indexOf("\n");
- if (lfIndex !== -1) {
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
- }
- return openAll + string + closeAll;
- };
- Object.defineProperties(createChalk.prototype, styles);
- chalk = createChalk();
- chalkStderr = createChalk({
- level: stderrColor ? stderrColor.level : 0
- });
- source_default = chalk;
- }
- });
- var require_logger = __commonJS2({
- "src/cli/logger.js"(exports2, module2) {
- "use strict";
- var readline = require("readline");
- var wcwidth = require_wcwidth();
- var {
- default: stripAnsi2
- } = (init_strip_ansi(), __toCommonJS(strip_ansi_exports));
- var {
- default: chalk2,
- chalkStderr: chalkStderr2
- } = (init_source(), __toCommonJS(source_exports));
- var countLines = (stream, text) => {
- const columns = stream.columns || 80;
- let lineCount = 0;
- for (const line of stripAnsi2(text).split("\n")) {
- lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
- }
- return lineCount;
- };
- var clear = (stream, text) => () => {
- const lineCount = countLines(stream, text);
- for (let line = 0; line < lineCount; line++) {
- if (line > 0) {
- readline.moveCursor(stream, 0, -1);
- }
- readline.clearLine(stream, 0);
- readline.cursorTo(stream, 0);
- }
- };
- var emptyLogResult = {
- clear() {
- }
- };
- function createLogger2(logLevel = "log") {
- return {
- logLevel,
- warn: createLogFunc("warn", "yellow"),
- error: createLogFunc("error", "red"),
- debug: createLogFunc("debug", "blue"),
- log: createLogFunc("log")
- };
- function createLogFunc(loggerName, color) {
- if (!shouldLog(loggerName)) {
- return () => emptyLogResult;
- }
- const stream = process[loggerName === "log" ? "stdout" : "stderr"];
- const chalkInstance = loggerName === "log" ? chalk2 : chalkStderr2;
- const prefix = color ? `[${chalkInstance[color](loggerName)}] ` : "";
- return (message, options) => {
- options = Object.assign({
- newline: true,
- clearable: false
- }, options);
- message = message.replace(/^/gm, prefix) + (options.newline ? "\n" : "");
- stream.write(message);
- if (options.clearable) {
- return {
- clear: clear(stream, message)
- };
- }
- };
- }
- function shouldLog(loggerName) {
- switch (logLevel) {
- case "silent":
- return false;
- case "debug":
- if (loggerName === "debug") {
- return true;
- }
- case "log":
- if (loggerName === "log") {
- return true;
- }
- case "warn":
- if (loggerName === "warn") {
- return true;
- }
- case "error":
- return loggerName === "error";
- }
- }
- }
- module2.exports = createLogger2;
- }
- });
- var require_prettier_internal = __commonJS2({
- "src/cli/prettier-internal.js"(exports2, module2) {
- "use strict";
- module2.exports = require("./index.js").__internal;
- }
- });
- var require_lib = __commonJS2({
- "node_modules/outdent/lib/index.js"(exports2, module2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.outdent = void 0;
- function noop() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- }
- function createWeakMap() {
- if (typeof WeakMap !== "undefined") {
- return /* @__PURE__ */ new WeakMap();
- } else {
- return fakeSetOrMap();
- }
- }
- function fakeSetOrMap() {
- return {
- add: noop,
- delete: noop,
- get: noop,
- set: noop,
- has: function(k) {
- return false;
- }
- };
- }
- var hop = Object.prototype.hasOwnProperty;
- var has = function(obj, prop) {
- return hop.call(obj, prop);
- };
- function extend(target, source) {
- for (var prop in source) {
- if (has(source, prop)) {
- target[prop] = source[prop];
- }
- }
- return target;
- }
- var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
- var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
- var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
- var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
- var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
- function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
- var indentationLevel = 0;
- var match = strings[0].match(reDetectIndentation);
- if (match) {
- indentationLevel = match[1].length;
- }
- var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
- var reMatchIndent = new RegExp(reSource, "g");
- if (firstInterpolatedValueSetsIndentationLevel) {
- strings = strings.slice(1);
- }
- var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
- var normalizeNewlines = typeof newline === "string";
- var l = strings.length;
- var outdentedStrings = strings.map(function(v, i) {
- v = v.replace(reMatchIndent, "$1");
- if (i === 0 && trimLeadingNewline) {
- v = v.replace(reLeadingNewline, "");
- }
- if (i === l - 1 && trimTrailingNewline) {
- v = v.replace(reTrailingNewline, "");
- }
- if (normalizeNewlines) {
- v = v.replace(/\r\n|\n|\r/g, function(_) {
- return newline;
- });
- }
- return v;
- });
- return outdentedStrings;
- }
- function concatStringsAndValues(strings, values) {
- var ret = "";
- for (var i = 0, l = strings.length; i < l; i++) {
- ret += strings[i];
- if (i < l - 1) {
- ret += values[i];
- }
- }
- return ret;
- }
- function isTemplateStringsArray(v) {
- return has(v, "raw") && has(v, "length");
- }
- function createInstance(options) {
- var arrayAutoIndentCache = createWeakMap();
- var arrayFirstInterpSetsIndentCache = createWeakMap();
- function outdent(stringsOrOptions) {
- var values = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- values[_i - 1] = arguments[_i];
- }
- if (isTemplateStringsArray(stringsOrOptions)) {
- var strings = stringsOrOptions;
- var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
- var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
- var renderedArray = cache.get(strings);
- if (!renderedArray) {
- renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
- cache.set(strings, renderedArray);
- }
- if (values.length === 0) {
- return renderedArray[0];
- }
- var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
- return rendered;
- } else {
- return createInstance(extend(extend({}, options), stringsOrOptions || {}));
- }
- }
- var fullOutdent = extend(outdent, {
- string: function(str) {
- return _outdentArray([str], false, options)[0];
- }
- });
- return fullOutdent;
- }
- var defaultOutdent = createInstance({
- trimLeadingNewline: true,
- trimTrailingNewline: true
- });
- exports2.outdent = defaultOutdent;
- exports2.default = defaultOutdent;
- if (typeof module2 !== "undefined") {
- try {
- module2.exports = defaultOutdent;
- Object.defineProperty(defaultOutdent, "__esModule", {
- value: true
- });
- defaultOutdent.default = defaultOutdent;
- defaultOutdent.outdent = defaultOutdent;
- } catch (e) {
- }
- }
- }
- });
- var require_constant = __commonJS2({
- "src/cli/constant.js"(exports2, module2) {
- "use strict";
- var {
- outdent
- } = require_lib();
- var {
- coreOptions
- } = require_prettier_internal();
- var categoryOrder = [coreOptions.CATEGORY_OUTPUT, coreOptions.CATEGORY_FORMAT, coreOptions.CATEGORY_CONFIG, coreOptions.CATEGORY_EDITOR, coreOptions.CATEGORY_OTHER];
- var options = {
- cache: {
- default: false,
- description: "Only format changed files. Cannot use with --stdin-filepath.",
- type: "boolean"
- },
- "cache-location": {
- description: "Path to the cache file.",
- type: "path"
- },
- "cache-strategy": {
- choices: [{
- description: "Use the file metadata such as timestamps as cache keys",
- value: "metadata"
- }, {
- description: "Use the file content as cache keys",
- value: "content"
- }],
- description: "Strategy for the cache to use for detecting changed files.",
- type: "choice"
- },
- check: {
- alias: "c",
- category: coreOptions.CATEGORY_OUTPUT,
- description: outdent`
- Check if the given files are formatted, print a human-friendly summary
- message and paths to unformatted files (see also --list-different).
- `,
- type: "boolean"
- },
- color: {
- default: true,
- description: "Colorize error messages.",
- oppositeDescription: "Do not colorize error messages.",
- type: "boolean"
- },
- config: {
- category: coreOptions.CATEGORY_CONFIG,
- description: "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
- exception: (value) => value === false,
- oppositeDescription: "Do not look for a configuration file.",
- type: "path"
- },
- "config-precedence": {
- category: coreOptions.CATEGORY_CONFIG,
- choices: [{
- description: "CLI options take precedence over config file",
- value: "cli-override"
- }, {
- description: "Config file take precedence over CLI options",
- value: "file-override"
- }, {
- description: outdent`
- If a config file is found will evaluate it and ignore other CLI options.
- If no config file is found CLI options will evaluate as normal.
- `,
- value: "prefer-file"
- }],
- default: "cli-override",
- description: "Define in which order config files and CLI options should be evaluated.",
- type: "choice"
- },
- "debug-benchmark": {
- type: "boolean"
- },
- "debug-check": {
- type: "boolean"
- },
- "debug-print-ast": {
- type: "boolean"
- },
- "debug-print-comments": {
- type: "boolean"
- },
- "debug-print-doc": {
- type: "boolean"
- },
- "debug-repeat": {
- default: 0,
- type: "int"
- },
- editorconfig: {
- category: coreOptions.CATEGORY_CONFIG,
- default: true,
- description: "Take .editorconfig into account when parsing configuration.",
- oppositeDescription: "Don't take .editorconfig into account when parsing configuration.",
- type: "boolean"
- },
- "error-on-unmatched-pattern": {
- oppositeDescription: "Prevent errors when pattern is unmatched.",
- type: "boolean"
- },
- "file-info": {
- description: outdent`
- Extract the following info (as JSON) for a given file path. Reported fields:
- * ignored (boolean) - true if file path is filtered by --ignore-path
- * inferredParser (string | null) - name of parser inferred from file path
- `,
- type: "path"
- },
- "find-config-path": {
- category: coreOptions.CATEGORY_CONFIG,
- description: "Find and print the path to a configuration file for the given input file.",
- type: "path"
- },
- help: {
- alias: "h",
- description: outdent`
- Show CLI usage, or details about the given flag.
- Example: --help write
- `,
- exception: (value) => value === "",
- type: "flag"
- },
- "ignore-path": {
- category: coreOptions.CATEGORY_CONFIG,
- default: ".prettierignore",
- description: "Path to a file with patterns describing files to ignore.",
- type: "path"
- },
- "ignore-unknown": {
- alias: "u",
- description: "Ignore unknown files.",
- type: "boolean"
- },
- "list-different": {
- alias: "l",
- category: coreOptions.CATEGORY_OUTPUT,
- description: "Print the names of files that are different from Prettier's formatting (see also --check).",
- type: "boolean"
- },
- loglevel: {
- choices: ["silent", "error", "warn", "log", "debug"],
- default: "log",
- description: "What level of logs to report.",
- type: "choice"
- },
- "plugin-search": {
- oppositeDescription: "Disable plugin autoloading.",
- type: "boolean"
- },
- "support-info": {
- description: "Print support information as JSON.",
- type: "boolean"
- },
- version: {
- alias: "v",
- description: "Print Prettier version.",
- type: "boolean"
- },
- "with-node-modules": {
- category: coreOptions.CATEGORY_CONFIG,
- description: "Process files inside 'node_modules' directory.",
- type: "boolean"
- },
- write: {
- alias: "w",
- category: coreOptions.CATEGORY_OUTPUT,
- description: "Edit files in-place. (Beware!)",
- type: "boolean"
- }
- };
- var usageSummary = outdent`
- Usage: prettier [options] [file/dir/glob ...]
- By default, output is written to stdout.
- Stdin is read if it is piped to Prettier and no files are given.
- `;
- module2.exports = {
- categoryOrder,
- options,
- usageSummary
- };
- }
- });
- var require_dashify = __commonJS2({
- "node_modules/dashify/index.js"(exports2, module2) {
- "use strict";
- module2.exports = (str, options) => {
- if (typeof str !== "string")
- throw new TypeError("expected a string");
- return str.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/\W/g, (m) => /[À-ž]/.test(m) ? m : "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, (m) => options && options.condense ? "-" : m).toLowerCase();
- };
- }
- });
- var require_option_map = __commonJS2({
- "src/cli/options/option-map.js"(exports2, module2) {
- "use strict";
- var dashify = require_dashify();
- var {
- coreOptions
- } = require_prettier_internal();
- function normalizeDetailedOption(name, option) {
- return Object.assign(Object.assign({
- category: coreOptions.CATEGORY_OTHER
- }, option), {}, {
- choices: option.choices && option.choices.map((choice) => {
- const newChoice = Object.assign({
- description: "",
- deprecated: false
- }, typeof choice === "object" ? choice : {
- value: choice
- });
- if (newChoice.value === true) {
- newChoice.value = "";
- }
- return newChoice;
- })
- });
- }
- function normalizeDetailedOptionMap(detailedOptionMap) {
- return Object.fromEntries(Object.entries(detailedOptionMap).sort(([leftName], [rightName]) => leftName.localeCompare(rightName)).map(([name, option]) => [name, normalizeDetailedOption(name, option)]));
- }
- function createDetailedOptionMap(supportOptions) {
- return Object.fromEntries(supportOptions.map((option) => {
- const newOption = Object.assign(Object.assign({}, option), {}, {
- name: option.cliName || dashify(option.name),
- description: option.cliDescription || option.description,
- category: option.cliCategory || coreOptions.CATEGORY_FORMAT,
- forwardToApi: option.name
- });
- if (option.deprecated) {
- delete newOption.forwardToApi;
- delete newOption.description;
- delete newOption.oppositeDescription;
- newOption.deprecated = true;
- }
- return [newOption.name, newOption];
- }));
- }
- module2.exports = {
- normalizeDetailedOptionMap,
- createDetailedOptionMap
- };
- }
- });
- var require_get_context_options = __commonJS2({
- "src/cli/options/get-context-options.js"(exports2, module2) {
- "use strict";
- var prettier2 = require("./index.js");
- var {
- optionsModule,
- utils: {
- arrayify
- }
- } = require_prettier_internal();
- var constant = require_constant();
- var {
- normalizeDetailedOptionMap,
- createDetailedOptionMap
- } = require_option_map();
- function getContextOptions(plugins, pluginSearchDirs) {
- const {
- options: supportOptions,
- languages
- } = prettier2.getSupportInfo({
- showDeprecated: true,
- showUnreleased: true,
- showInternal: true,
- plugins,
- pluginSearchDirs
- });
- const detailedOptionMap = normalizeDetailedOptionMap(Object.assign(Object.assign({}, createDetailedOptionMap(supportOptions)), constant.options));
- const detailedOptions = arrayify(detailedOptionMap, "name");
- const apiDefaultOptions = Object.assign(Object.assign({}, optionsModule.hiddenDefaults), Object.fromEntries(supportOptions.filter(({
- deprecated
- }) => !deprecated).map((option) => [option.name, option.default])));
- return {
- supportOptions,
- detailedOptions,
- detailedOptionMap,
- apiDefaultOptions,
- languages
- };
- }
- module2.exports = getContextOptions;
- }
- });
- var require_camelcase = __commonJS2({
- "node_modules/camelcase/index.js"(exports2, module2) {
- "use strict";
- var UPPERCASE = /[\p{Lu}]/u;
- var LOWERCASE = /[\p{Ll}]/u;
- var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
- var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
- var SEPARATORS = /[_.\- ]+/;
- var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
- var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
- var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
- var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
- let isLastCharLower = false;
- let isLastCharUpper = false;
- let isLastLastCharUpper = false;
- for (let i = 0; i < string.length; i++) {
- const character = string[i];
- if (isLastCharLower && UPPERCASE.test(character)) {
- string = string.slice(0, i) + "-" + string.slice(i);
- isLastCharLower = false;
- isLastLastCharUpper = isLastCharUpper;
- isLastCharUpper = true;
- i++;
- } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
- string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
- isLastLastCharUpper = isLastCharUpper;
- isLastCharUpper = false;
- isLastCharLower = true;
- } else {
- isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
- isLastLastCharUpper = isLastCharUpper;
- isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
- }
- }
- return string;
- };
- var preserveConsecutiveUppercase = (input, toLowerCase) => {
- LEADING_CAPITAL.lastIndex = 0;
- return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
- };
- var postProcess = (input, toUpperCase) => {
- SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
- NUMBERS_AND_IDENTIFIER.lastIndex = 0;
- return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
- };
- var camelCase = (input, options) => {
- if (!(typeof input === "string" || Array.isArray(input))) {
- throw new TypeError("Expected the input to be `string | string[]`");
- }
- options = Object.assign({
- pascalCase: false,
- preserveConsecutiveUppercase: false
- }, options);
- if (Array.isArray(input)) {
- input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
- } else {
- input = input.trim();
- }
- if (input.length === 0) {
- return "";
- }
- const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
- const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
- if (input.length === 1) {
- return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
- }
- const hasUpperCase = input !== toLowerCase(input);
- if (hasUpperCase) {
- input = preserveCamelCase(input, toLowerCase, toUpperCase);
- }
- input = input.replace(LEADING_SEPARATORS, "");
- if (options.preserveConsecutiveUppercase) {
- input = preserveConsecutiveUppercase(input, toLowerCase);
- } else {
- input = toLowerCase(input);
- }
- if (options.pascalCase) {
- input = toUpperCase(input.charAt(0)) + input.slice(1);
- }
- return postProcess(input, toUpperCase);
- };
- module2.exports = camelCase;
- module2.exports.default = camelCase;
- }
- });
- var sdbm_exports = {};
- __export(sdbm_exports, {
- default: () => sdbm
- });
- function sdbm(string) {
- let hash = 0;
- for (let i = 0; i < string.length; i++) {
- hash = string.charCodeAt(i) + (hash << 6) + (hash << 16) - hash;
- }
- return hash >>> 0;
- }
- var init_sdbm = __esm({
- "node_modules/sdbm/index.js"() {
- }
- });
- var require_utils = __commonJS2({
- "src/cli/utils.js"(exports2, module2) {
- "use strict";
- var {
- promises: fs
- } = require("fs");
- var {
- default: sdbm2
- } = (init_sdbm(), __toCommonJS(sdbm_exports));
- var printToScreen2 = console.log.bind(console);
- function groupBy(array2, iteratee) {
- const result = /* @__PURE__ */ Object.create(null);
- for (const value of array2) {
- const key = iteratee(value);
- if (Array.isArray(result[key])) {
- result[key].push(value);
- } else {
- result[key] = [value];
- }
- }
- return result;
- }
- function pick(object, keys) {
- const entries = keys.map((key) => [key, object[key]]);
- return Object.fromEntries(entries);
- }
- function createHash(source) {
- return String(sdbm2(source));
- }
- async function statSafe(filePath) {
- try {
- return await fs.stat(filePath);
- } catch (error) {
- if (error.code !== "ENOENT") {
- throw error;
- }
- }
- }
- function isJson(value) {
- try {
- JSON.parse(value);
- return true;
- } catch {
- return false;
- }
- }
- module2.exports = {
- printToScreen: printToScreen2,
- groupBy,
- pick,
- createHash,
- statSafe,
- isJson
- };
- }
- });
- var require_minimist = __commonJS2({
- "node_modules/minimist/index.js"(exports2, module2) {
- module2.exports = function(args, opts) {
- if (!opts)
- opts = {};
- var flags = {
- bools: {},
- strings: {},
- unknownFn: null
- };
- if (typeof opts["unknown"] === "function") {
- flags.unknownFn = opts["unknown"];
- }
- if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
- flags.allBools = true;
- } else {
- [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
- flags.bools[key2] = true;
- });
- }
- var aliases = {};
- Object.keys(opts.alias || {}).forEach(function(key2) {
- aliases[key2] = [].concat(opts.alias[key2]);
- aliases[key2].forEach(function(x) {
- aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
- return x !== y;
- }));
- });
- });
- [].concat(opts.string).filter(Boolean).forEach(function(key2) {
- flags.strings[key2] = true;
- if (aliases[key2]) {
- flags.strings[aliases[key2]] = true;
- }
- });
- var defaults = opts["default"] || {};
- var argv = {
- _: []
- };
- Object.keys(flags.bools).forEach(function(key2) {
- setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
- });
- var notFlags = [];
- if (args.indexOf("--") !== -1) {
- notFlags = args.slice(args.indexOf("--") + 1);
- args = args.slice(0, args.indexOf("--"));
- }
- function argDefined(key2, arg2) {
- return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
- }
- function setArg(key2, val, arg2) {
- if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
- if (flags.unknownFn(arg2) === false)
- return;
- }
- var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
- setKey(argv, key2.split("."), value2);
- (aliases[key2] || []).forEach(function(x) {
- setKey(argv, x.split("."), value2);
- });
- }
- function setKey(obj, keys, value2) {
- var o = obj;
- for (var i2 = 0; i2 < keys.length - 1; i2++) {
- var key2 = keys[i2];
- if (isConstructorOrProto(o, key2))
- return;
- if (o[key2] === void 0)
- o[key2] = {};
- if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
- o[key2] = {};
- if (o[key2] === Array.prototype)
- o[key2] = [];
- o = o[key2];
- }
- var key2 = keys[keys.length - 1];
- if (isConstructorOrProto(o, key2))
- return;
- if (o === Object.prototype || o === Number.prototype || o === String.prototype)
- o = {};
- if (o === Array.prototype)
- o = [];
- if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
- o[key2] = value2;
- } else if (Array.isArray(o[key2])) {
- o[key2].push(value2);
- } else {
- o[key2] = [o[key2], value2];
- }
- }
- function aliasIsBoolean(key2) {
- return aliases[key2].some(function(x) {
- return flags.bools[x];
- });
- }
- for (var i = 0; i < args.length; i++) {
- var arg = args[i];
- if (/^--.+=/.test(arg)) {
- var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
- var key = m[1];
- var value = m[2];
- if (flags.bools[key]) {
- value = value !== "false";
- }
- setArg(key, value, arg);
- } else if (/^--no-.+/.test(arg)) {
- var key = arg.match(/^--no-(.+)/)[1];
- setArg(key, false, arg);
- } else if (/^--.+/.test(arg)) {
- var key = arg.match(/^--(.+)/)[1];
- var next = args[i + 1];
- if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
- setArg(key, next, arg);
- i++;
- } else if (/^(true|false)$/.test(next)) {
- setArg(key, next === "true", arg);
- i++;
- } else {
- setArg(key, flags.strings[key] ? "" : true, arg);
- }
- } else if (/^-[^-]+/.test(arg)) {
- var letters = arg.slice(1, -1).split("");
- var broken = false;
- for (var j = 0; j < letters.length; j++) {
- var next = arg.slice(j + 2);
- if (next === "-") {
- setArg(letters[j], next, arg);
- continue;
- }
- if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
- setArg(letters[j], next.split("=")[1], arg);
- broken = true;
- break;
- }
- if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
- setArg(letters[j], next, arg);
- broken = true;
- break;
- }
- if (letters[j + 1] && letters[j + 1].match(/\W/)) {
- setArg(letters[j], arg.slice(j + 2), arg);
- broken = true;
- break;
- } else {
- setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
- }
- }
- var key = arg.slice(-1)[0];
- if (!broken && key !== "-") {
- if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
- setArg(key, args[i + 1], arg);
- i++;
- } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
- setArg(key, args[i + 1] === "true", arg);
- i++;
- } else {
- setArg(key, flags.strings[key] ? "" : true, arg);
- }
- }
- } else {
- if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
- argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
- }
- if (opts.stopEarly) {
- argv._.push.apply(argv._, args.slice(i + 1));
- break;
- }
- }
- }
- Object.keys(defaults).forEach(function(key2) {
- if (!hasKey(argv, key2.split("."))) {
- setKey(argv, key2.split("."), defaults[key2]);
- (aliases[key2] || []).forEach(function(x) {
- setKey(argv, x.split("."), defaults[key2]);
- });
- }
- });
- if (opts["--"]) {
- argv["--"] = new Array();
- notFlags.forEach(function(key2) {
- argv["--"].push(key2);
- });
- } else {
- notFlags.forEach(function(key2) {
- argv._.push(key2);
- });
- }
- return argv;
- };
- function hasKey(obj, keys) {
- var o = obj;
- keys.slice(0, -1).forEach(function(key2) {
- o = o[key2] || {};
- });
- var key = keys[keys.length - 1];
- return key in o;
- }
- function isNumber(x) {
- if (typeof x === "number")
- return true;
- if (/^0x[0-9a-f]+$/i.test(x))
- return true;
- return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
- }
- function isConstructorOrProto(obj, key) {
- return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
- }
- }
- });
- var require_minimist2 = __commonJS2({
- "src/cli/options/minimist.js"(exports2, module2) {
- "use strict";
- var minimist = require_minimist();
- var PLACEHOLDER = null;
- module2.exports = function(args, options) {
- const boolean = options.boolean || [];
- const defaults = options.default || {};
- const booleanWithoutDefault = boolean.filter((key) => !(key in defaults));
- const newDefaults = Object.assign(Object.assign({}, defaults), Object.fromEntries(booleanWithoutDefault.map((key) => [key, PLACEHOLDER])));
- const parsed = minimist(args, Object.assign(Object.assign({}, options), {}, {
- default: newDefaults
- }));
- return Object.fromEntries(Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER));
- };
- }
- });
- var require_create_minimist_options = __commonJS2({
- "src/cli/options/create-minimist-options.js"(exports2, module2) {
- "use strict";
- var {
- utils: {
- partition
- }
- } = require_prettier_internal();
- module2.exports = function createMinimistOptions(detailedOptions) {
- const [boolean, string] = partition(detailedOptions, ({
- type
- }) => type === "boolean").map((detailedOptions2) => detailedOptions2.flatMap(({
- name,
- alias
- }) => alias ? [name, alias] : [name]));
- const defaults = Object.fromEntries(detailedOptions.filter((option) => !option.deprecated && (!option.forwardToApi || option.name === "plugin" || option.name === "plugin-search-dir") && option.default !== void 0).map((option) => [option.name, option.default]));
- return {
- alias: {},
- boolean,
- string,
- default: defaults
- };
- };
- }
- });
- var leven_exports = {};
- __export(leven_exports, {
- default: () => leven
- });
- function leven(first, second) {
- if (first === second) {
- return 0;
- }
- const swap = first;
- if (first.length > second.length) {
- first = second;
- second = swap;
- }
- let firstLength = first.length;
- let secondLength = second.length;
- while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
- firstLength--;
- secondLength--;
- }
- let start = 0;
- while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
- start++;
- }
- firstLength -= start;
- secondLength -= start;
- if (firstLength === 0) {
- return secondLength;
- }
- let bCharacterCode;
- let result;
- let temporary;
- let temporary2;
- let index = 0;
- let index2 = 0;
- while (index < firstLength) {
- characterCodeCache[index] = first.charCodeAt(start + index);
- array[index] = ++index;
- }
- while (index2 < secondLength) {
- bCharacterCode = second.charCodeAt(start + index2);
- temporary = index2++;
- result = index2;
- for (index = 0; index < firstLength; index++) {
- temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
- temporary = array[index];
- result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
- }
- }
- return result;
- }
- var array;
- var characterCodeCache;
- var init_leven = __esm({
- "node_modules/leven/index.js"() {
- array = [];
- characterCodeCache = [];
- }
- });
- var require_normalize_cli_options = __commonJS2({
- "src/cli/options/normalize-cli-options.js"(exports2, module2) {
- "use strict";
- var {
- default: chalk2
- } = (init_source(), __toCommonJS(source_exports));
- var {
- default: leven2
- } = (init_leven(), __toCommonJS(leven_exports));
- var {
- optionsNormalizer
- } = require_prettier_internal();
- function normalizeCliOptions(options, optionInfos, opts) {
- return optionsNormalizer.normalizeCliOptions(options, optionInfos, Object.assign({
- colorsModule: chalk2,
- levenshteinDistance: leven2
- }, opts));
- }
- module2.exports = normalizeCliOptions;
- }
- });
- var require_parse_cli_arguments = __commonJS2({
- "src/cli/options/parse-cli-arguments.js"(exports2, module2) {
- "use strict";
- var camelCase = require_camelcase();
- var {
- pick
- } = require_utils();
- var getContextOptions = require_get_context_options();
- var minimist = require_minimist2();
- var createMinimistOptions = require_create_minimist_options();
- var normalizeCliOptions = require_normalize_cli_options();
- function parseArgv(rawArguments, detailedOptions, logger, keys) {
- const minimistOptions = createMinimistOptions(detailedOptions);
- let argv = minimist(rawArguments, minimistOptions);
- if (keys) {
- if (keys.includes("plugin-search-dir") && !keys.includes("plugin-search")) {
- keys.push("plugin-search");
- }
- detailedOptions = detailedOptions.filter((option) => keys.includes(option.name));
- argv = pick(argv, keys);
- }
- const normalized = normalizeCliOptions(argv, detailedOptions, {
- logger
- });
- return Object.assign(Object.assign({}, Object.fromEntries(Object.entries(normalized).map(([key, value]) => {
- const option = detailedOptions.find(({
- name
- }) => name === key) || {};
- return [option.forwardToApi || camelCase(key), value];
- }))), {}, {
- get __raw() {
- return argv;
- }
- });
- }
- var detailedOptionsWithoutPlugins = getContextOptions([], false).detailedOptions;
- function parseArgvWithoutPlugins2(rawArguments, logger, keys) {
- return parseArgv(rawArguments, detailedOptionsWithoutPlugins, logger, typeof keys === "string" ? [keys] : keys);
- }
- module2.exports = {
- parseArgv,
- parseArgvWithoutPlugins: parseArgvWithoutPlugins2
- };
- }
- });
- var require_context = __commonJS2({
- "src/cli/context.js"(exports2, module2) {
- "use strict";
- var {
- utils: {
- getLast
- }
- } = require_prettier_internal();
- var getContextOptions = require_get_context_options();
- var {
- parseArgv,
- parseArgvWithoutPlugins: parseArgvWithoutPlugins2
- } = require_parse_cli_arguments();
- var Context2 = class {
- constructor({
- rawArguments,
- logger
- }) {
- this.rawArguments = rawArguments;
- this.logger = logger;
- this.stack = [];
- const {
- plugins,
- pluginSearchDirs
- } = parseArgvWithoutPlugins2(rawArguments, logger, ["plugin", "plugin-search-dir"]);
- this.pushContextPlugins(plugins, pluginSearchDirs);
- const argv = parseArgv(rawArguments, this.detailedOptions, logger);
- this.argv = argv;
- this.filePatterns = argv._.map(String);
- }
- pushContextPlugins(plugins, pluginSearchDirs) {
- const options = getContextOptions(plugins, pluginSearchDirs);
- this.stack.push(options);
- Object.assign(this, options);
- }
- popContextPlugins() {
- this.stack.pop();
- Object.assign(this, getLast(this.stack));
- }
- get performanceTestFlag() {
- const {
- debugBenchmark,
- debugRepeat
- } = this.argv;
- if (debugBenchmark) {
- return {
- name: "--debug-benchmark",
- debugBenchmark: true
- };
- }
- if (debugRepeat > 0) {
- return {
- name: "--debug-repeat",
- debugRepeat
- };
- }
- const {
- PRETTIER_PERF_REPEAT
- } = process.env;
- if (PRETTIER_PERF_REPEAT && /^\d+$/.test(PRETTIER_PERF_REPEAT)) {
- return {
- name: "PRETTIER_PERF_REPEAT (environment variable)",
- debugRepeat: Number(PRETTIER_PERF_REPEAT)
- };
- }
- }
- };
- module2.exports = Context2;
- }
- });
- var require_usage = __commonJS2({
- "src/cli/usage.js"(exports2, module2) {
- "use strict";
- var camelCase = require_camelcase();
- var constant = require_constant();
- var {
- groupBy
- } = require_utils();
- var OPTION_USAGE_THRESHOLD = 25;
- var CHOICE_USAGE_MARGIN = 3;
- var CHOICE_USAGE_INDENTATION = 2;
- function indent(str, spaces) {
- return str.replace(/^/gm, " ".repeat(spaces));
- }
- function createDefaultValueDisplay(value) {
- return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value;
- }
- function getOptionDefaultValue(context, optionName) {
- if (!(optionName in context.detailedOptionMap)) {
- return;
- }
- const option = context.detailedOptionMap[optionName];
- if (option.default !== void 0) {
- return option.default;
- }
- const optionCamelName = camelCase(optionName);
- if (optionCamelName in context.apiDefaultOptions) {
- return context.apiDefaultOptions[optionCamelName];
- }
- }
- function createOptionUsageHeader(option) {
- const name = `--${option.name}`;
- const alias = option.alias ? `-${option.alias},` : null;
- const type = createOptionUsageType(option);
- return [alias, name, type].filter(Boolean).join(" ");
- }
- function createOptionUsageRow(header, content, threshold) {
- const separator = header.length >= threshold ? `
- ${" ".repeat(threshold)}` : " ".repeat(threshold - header.length);
- const description = content.replace(/\n/g, `
- ${" ".repeat(threshold)}`);
- return `${header}${separator}${description}`;
- }
- function createOptionUsageType(option) {
- switch (option.type) {
- case "boolean":
- return null;
- case "choice":
- return `<${option.choices.filter((choice) => !choice.deprecated && choice.since !== null).map((choice) => choice.value).join("|")}>`;
- default:
- return `<${option.type}>`;
- }
- }
- function createChoiceUsages(choices, margin, indentation) {
- const activeChoices = choices.filter((choice) => !choice.deprecated && choice.since !== null);
- const threshold = Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin;
- return activeChoices.map((choice) => indent(createOptionUsageRow(choice.value, choice.description, threshold), indentation));
- }
- function createOptionUsage(context, option, threshold) {
- const header = createOptionUsageHeader(option);
- const optionDefaultValue = getOptionDefaultValue(context, option.name);
- return createOptionUsageRow(header, `${option.description}${optionDefaultValue === void 0 ? "" : `
- Defaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, threshold);
- }
- function getOptionsWithOpposites(options) {
- const optionsWithOpposites = options.map((option) => [option.description ? option : null, option.oppositeDescription ? Object.assign(Object.assign({}, option), {}, {
- name: `no-${option.name}`,
- type: "boolean",
- description: option.oppositeDescription
- }) : null]);
- return optionsWithOpposites.flat().filter(Boolean);
- }
- function createUsage2(context) {
- const options = getOptionsWithOpposites(context.detailedOptions).filter((option) => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")));
- const groupedOptions = groupBy(options, (option) => option.category);
- const firstCategories = constant.categoryOrder.slice(0, -1);
- const lastCategories = constant.categoryOrder.slice(-1);
- const restCategories = Object.keys(groupedOptions).filter((category) => !constant.categoryOrder.includes(category));
- const allCategories = [...firstCategories, ...restCategories, ...lastCategories];
- const optionsUsage = allCategories.map((category) => {
- const categoryOptions = groupedOptions[category].map((option) => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD)).join("\n");
- return `${category} options:
- ${indent(categoryOptions, 2)}`;
- });
- return [constant.usageSummary, ...optionsUsage, ""].join("\n\n");
- }
- function createDetailedUsage2(context, flag) {
- const option = getOptionsWithOpposites(context.detailedOptions).find((option2) => option2.name === flag || option2.alias === flag);
- const header = createOptionUsageHeader(option);
- const description = `
- ${indent(option.description, 2)}`;
- const choices = option.type !== "choice" ? "" : `
- Valid options:
- ${createChoiceUsages(option.choices, CHOICE_USAGE_MARGIN, CHOICE_USAGE_INDENTATION).join("\n")}`;
- const optionDefaultValue = getOptionDefaultValue(context, option.name);
- const defaults = optionDefaultValue !== void 0 ? `
- Default: ${createDefaultValueDisplay(optionDefaultValue)}` : "";
- const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 ? `
- Plugin defaults:${Object.entries(option.pluginDefaults).map(([key, value]) => `
- * ${key}: ${createDefaultValueDisplay(value)}`)}` : "";
- return `${header}${description}${choices}${defaults}${pluginDefaults}`;
- }
- module2.exports = {
- createUsage: createUsage2,
- createDetailedUsage: createDetailedUsage2
- };
- }
- });
- var require_array = __commonJS2({
- "node_modules/fast-glob/out/utils/array.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.splitWhen = exports2.flatten = void 0;
- function flatten(items) {
- return items.reduce((collection, item) => [].concat(collection, item), []);
- }
- exports2.flatten = flatten;
- function splitWhen(items, predicate) {
- const result = [[]];
- let groupIndex = 0;
- for (const item of items) {
- if (predicate(item)) {
- groupIndex++;
- result[groupIndex] = [];
- } else {
- result[groupIndex].push(item);
- }
- }
- return result;
- }
- exports2.splitWhen = splitWhen;
- }
- });
- var require_errno = __commonJS2({
- "node_modules/fast-glob/out/utils/errno.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.isEnoentCodeError = void 0;
- function isEnoentCodeError(error) {
- return error.code === "ENOENT";
- }
- exports2.isEnoentCodeError = isEnoentCodeError;
- }
- });
- var require_fs = __commonJS2({
- "node_modules/fast-glob/out/utils/fs.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.createDirentFromStats = void 0;
- var DirentFromStats = class {
- constructor(name, stats) {
- this.name = name;
- this.isBlockDevice = stats.isBlockDevice.bind(stats);
- this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
- this.isDirectory = stats.isDirectory.bind(stats);
- this.isFIFO = stats.isFIFO.bind(stats);
- this.isFile = stats.isFile.bind(stats);
- this.isSocket = stats.isSocket.bind(stats);
- this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
- }
- };
- function createDirentFromStats(name, stats) {
- return new DirentFromStats(name, stats);
- }
- exports2.createDirentFromStats = createDirentFromStats;
- }
- });
- var require_path = __commonJS2({
- "node_modules/fast-glob/out/utils/path.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.removeLeadingDotSegment = exports2.escape = exports2.makeAbsolute = exports2.unixify = void 0;
- var path = require("path");
- var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
- var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
- function unixify(filepath) {
- return filepath.replace(/\\/g, "/");
- }
- exports2.unixify = unixify;
- function makeAbsolute(cwd, filepath) {
- return path.resolve(cwd, filepath);
- }
- exports2.makeAbsolute = makeAbsolute;
- function escape(pattern) {
- return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
- }
- exports2.escape = escape;
- function removeLeadingDotSegment(entry) {
- if (entry.charAt(0) === ".") {
- const secondCharactery = entry.charAt(1);
- if (secondCharactery === "/" || secondCharactery === "\\") {
- return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
- }
- }
- return entry;
- }
- exports2.removeLeadingDotSegment = removeLeadingDotSegment;
- }
- });
- var require_is_extglob = __commonJS2({
- "node_modules/is-extglob/index.js"(exports2, module2) {
- module2.exports = function isExtglob(str) {
- if (typeof str !== "string" || str === "") {
- return false;
- }
- var match;
- while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
- if (match[2])
- return true;
- str = str.slice(match.index + match[0].length);
- }
- return false;
- };
- }
- });
- var require_is_glob = __commonJS2({
- "node_modules/is-glob/index.js"(exports2, module2) {
- var isExtglob = require_is_extglob();
- var chars = {
- "{": "}",
- "(": ")",
- "[": "]"
- };
- var strictCheck = function(str) {
- if (str[0] === "!") {
- return true;
- }
- var index = 0;
- var pipeIndex = -2;
- var closeSquareIndex = -2;
- var closeCurlyIndex = -2;
- var closeParenIndex = -2;
- var backSlashIndex = -2;
- while (index < str.length) {
- if (str[index] === "*") {
- return true;
- }
- if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
- return true;
- }
- if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
- if (closeSquareIndex < index) {
- closeSquareIndex = str.indexOf("]", index);
- }
- if (closeSquareIndex > index) {
- if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
- return true;
- }
- backSlashIndex = str.indexOf("\\", index);
- if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
- return true;
- }
- }
- }
- if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
- closeCurlyIndex = str.indexOf("}", index);
- if (closeCurlyIndex > index) {
- backSlashIndex = str.indexOf("\\", index);
- if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
- return true;
- }
- }
- }
- if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
- closeParenIndex = str.indexOf(")", index);
- if (closeParenIndex > index) {
- backSlashIndex = str.indexOf("\\", index);
- if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
- return true;
- }
- }
- }
- if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
- if (pipeIndex < index) {
- pipeIndex = str.indexOf("|", index);
- }
- if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
- closeParenIndex = str.indexOf(")", pipeIndex);
- if (closeParenIndex > pipeIndex) {
- backSlashIndex = str.indexOf("\\", pipeIndex);
- if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
- return true;
- }
- }
- }
- }
- if (str[index] === "\\") {
- var open = str[index + 1];
- index += 2;
- var close = chars[open];
- if (close) {
- var n = str.indexOf(close, index);
- if (n !== -1) {
- index = n + 1;
- }
- }
- if (str[index] === "!") {
- return true;
- }
- } else {
- index++;
- }
- }
- return false;
- };
- var relaxedCheck = function(str) {
- if (str[0] === "!") {
- return true;
- }
- var index = 0;
- while (index < str.length) {
- if (/[*?{}()[\]]/.test(str[index])) {
- return true;
- }
- if (str[index] === "\\") {
- var open = str[index + 1];
- index += 2;
- var close = chars[open];
- if (close) {
- var n = str.indexOf(close, index);
- if (n !== -1) {
- index = n + 1;
- }
- }
- if (str[index] === "!") {
- return true;
- }
- } else {
- index++;
- }
- }
- return false;
- };
- module2.exports = function isGlob(str, options) {
- if (typeof str !== "string" || str === "") {
- return false;
- }
- if (isExtglob(str)) {
- return true;
- }
- var check = strictCheck;
- if (options && options.strict === false) {
- check = relaxedCheck;
- }
- return check(str);
- };
- }
- });
- var require_glob_parent = __commonJS2({
- "node_modules/glob-parent/index.js"(exports2, module2) {
- "use strict";
- var isGlob = require_is_glob();
- var pathPosixDirname = require("path").posix.dirname;
- var isWin32 = require("os").platform() === "win32";
- var slash = "/";
- var backslash = /\\/g;
- var enclosure = /[\{\[].*[\}\]]$/;
- var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
- var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
- module2.exports = function globParent(str, opts) {
- var options = Object.assign({
- flipBackslashes: true
- }, opts);
- if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
- str = str.replace(backslash, slash);
- }
- if (enclosure.test(str)) {
- str += slash;
- }
- str += "a";
- do {
- str = pathPosixDirname(str);
- } while (isGlob(str) || globby.test(str));
- return str.replace(escaped, "$1");
- };
- }
- });
- var require_utils2 = __commonJS2({
- "node_modules/braces/lib/utils.js"(exports2) {
- "use strict";
- exports2.isInteger = (num) => {
- if (typeof num === "number") {
- return Number.isInteger(num);
- }
- if (typeof num === "string" && num.trim() !== "") {
- return Number.isInteger(Number(num));
- }
- return false;
- };
- exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
- exports2.exceedsLimit = (min, max, step = 1, limit) => {
- if (limit === false)
- return false;
- if (!exports2.isInteger(min) || !exports2.isInteger(max))
- return false;
- return (Number(max) - Number(min)) / Number(step) >= limit;
- };
- exports2.escapeNode = (block, n = 0, type) => {
- let node = block.nodes[n];
- if (!node)
- return;
- if (type && node.type === type || node.type === "open" || node.type === "close") {
- if (node.escaped !== true) {
- node.value = "\\" + node.value;
- node.escaped = true;
- }
- }
- };
- exports2.encloseBrace = (node) => {
- if (node.type !== "brace")
- return false;
- if (node.commas >> 0 + node.ranges >> 0 === 0) {
- node.invalid = true;
- return true;
- }
- return false;
- };
- exports2.isInvalidBrace = (block) => {
- if (block.type !== "brace")
- return false;
- if (block.invalid === true || block.dollar)
- return true;
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
- block.invalid = true;
- return true;
- }
- if (block.open !== true || block.close !== true) {
- block.invalid = true;
- return true;
- }
- return false;
- };
- exports2.isOpenOrClose = (node) => {
- if (node.type === "open" || node.type === "close") {
- return true;
- }
- return node.open === true || node.close === true;
- };
- exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
- if (node.type === "text")
- acc.push(node.value);
- if (node.type === "range")
- node.type = "text";
- return acc;
- }, []);
- exports2.flatten = (...args) => {
- const result = [];
- const flat = (arr) => {
- for (let i = 0; i < arr.length; i++) {
- let ele = arr[i];
- Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
- }
- return result;
- };
- flat(args);
- return result;
- };
- }
- });
- var require_stringify = __commonJS2({
- "node_modules/braces/lib/stringify.js"(exports2, module2) {
- "use strict";
- var utils = require_utils2();
- module2.exports = (ast, options = {}) => {
- let stringify2 = (node, parent = {}) => {
- let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
- let output = "";
- if (node.value) {
- if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
- return "\\" + node.value;
- }
- return node.value;
- }
- if (node.value) {
- return node.value;
- }
- if (node.nodes) {
- for (let child of node.nodes) {
- output += stringify2(child);
- }
- }
- return output;
- };
- return stringify2(ast);
- };
- }
- });
- var require_is_number = __commonJS2({
- "node_modules/is-number/index.js"(exports2, module2) {
- "use strict";
- module2.exports = function(num) {
- if (typeof num === "number") {
- return num - num === 0;
- }
- if (typeof num === "string" && num.trim() !== "") {
- return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
- }
- return false;
- };
- }
- });
- var require_to_regex_range = __commonJS2({
- "node_modules/to-regex-range/index.js"(exports2, module2) {
- "use strict";
- var isNumber = require_is_number();
- var toRegexRange = (min, max, options) => {
- if (isNumber(min) === false) {
- throw new TypeError("toRegexRange: expected the first argument to be a number");
- }
- if (max === void 0 || min === max) {
- return String(min);
- }
- if (isNumber(max) === false) {
- throw new TypeError("toRegexRange: expected the second argument to be a number.");
- }
- let opts = Object.assign({
- relaxZeros: true
- }, options);
- if (typeof opts.strictZeros === "boolean") {
- opts.relaxZeros = opts.strictZeros === false;
- }
- let relax = String(opts.relaxZeros);
- let shorthand = String(opts.shorthand);
- let capture = String(opts.capture);
- let wrap = String(opts.wrap);
- let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
- if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
- return toRegexRange.cache[cacheKey].result;
- }
- let a = Math.min(min, max);
- let b = Math.max(min, max);
- if (Math.abs(a - b) === 1) {
- let result = min + "|" + max;
- if (opts.capture) {
- return `(${result})`;
- }
- if (opts.wrap === false) {
- return result;
- }
- return `(?:${result})`;
- }
- let isPadded = hasPadding(min) || hasPadding(max);
- let state = {
- min,
- max,
- a,
- b
- };
- let positives = [];
- let negatives = [];
- if (isPadded) {
- state.isPadded = isPadded;
- state.maxLen = String(state.max).length;
- }
- if (a < 0) {
- let newMin = b < 0 ? Math.abs(b) : 1;
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
- a = state.a = 0;
- }
- if (b >= 0) {
- positives = splitToPatterns(a, b, state, opts);
- }
- state.negatives = negatives;
- state.positives = positives;
- state.result = collatePatterns(negatives, positives, opts);
- if (opts.capture === true) {
- state.result = `(${state.result})`;
- } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
- state.result = `(?:${state.result})`;
- }
- toRegexRange.cache[cacheKey] = state;
- return state.result;
- };
- function collatePatterns(neg, pos, options) {
- let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
- let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
- let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
- let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
- return subpatterns.join("|");
- }
- function splitToRanges(min, max) {
- let nines = 1;
- let zeros = 1;
- let stop = countNines(min, nines);
- let stops = /* @__PURE__ */ new Set([max]);
- while (min <= stop && stop <= max) {
- stops.add(stop);
- nines += 1;
- stop = countNines(min, nines);
- }
- stop = countZeros(max + 1, zeros) - 1;
- while (min < stop && stop <= max) {
- stops.add(stop);
- zeros += 1;
- stop = countZeros(max + 1, zeros) - 1;
- }
- stops = [...stops];
- stops.sort(compare);
- return stops;
- }
- function rangeToPattern(start, stop, options) {
- if (start === stop) {
- return {
- pattern: start,
- count: [],
- digits: 0
- };
- }
- let zipped = zip(start, stop);
- let digits = zipped.length;
- let pattern = "";
- let count = 0;
- for (let i = 0; i < digits; i++) {
- let [startDigit, stopDigit] = zipped[i];
- if (startDigit === stopDigit) {
- pattern += startDigit;
- } else if (startDigit !== "0" || stopDigit !== "9") {
- pattern += toCharacterClass(startDigit, stopDigit, options);
- } else {
- count++;
- }
- }
- if (count) {
- pattern += options.shorthand === true ? "\\d" : "[0-9]";
- }
- return {
- pattern,
- count: [count],
- digits
- };
- }
- function splitToPatterns(min, max, tok, options) {
- let ranges = splitToRanges(min, max);
- let tokens = [];
- let start = min;
- let prev;
- for (let i = 0; i < ranges.length; i++) {
- let max2 = ranges[i];
- let obj = rangeToPattern(String(start), String(max2), options);
- let zeros = "";
- if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
- if (prev.count.length > 1) {
- prev.count.pop();
- }
- prev.count.push(obj.count[0]);
- prev.string = prev.pattern + toQuantifier(prev.count);
- start = max2 + 1;
- continue;
- }
- if (tok.isPadded) {
- zeros = padZeros(max2, tok, options);
- }
- obj.string = zeros + obj.pattern + toQuantifier(obj.count);
- tokens.push(obj);
- start = max2 + 1;
- prev = obj;
- }
- return tokens;
- }
- function filterPatterns(arr, comparison, prefix, intersection, options) {
- let result = [];
- for (let ele of arr) {
- let {
- string
- } = ele;
- if (!intersection && !contains(comparison, "string", string)) {
- result.push(prefix + string);
- }
- if (intersection && contains(comparison, "string", string)) {
- result.push(prefix + string);
- }
- }
- return result;
- }
- function zip(a, b) {
- let arr = [];
- for (let i = 0; i < a.length; i++)
- arr.push([a[i], b[i]]);
- return arr;
- }
- function compare(a, b) {
- return a > b ? 1 : b > a ? -1 : 0;
- }
- function contains(arr, key, val) {
- return arr.some((ele) => ele[key] === val);
- }
- function countNines(min, len) {
- return Number(String(min).slice(0, -len) + "9".repeat(len));
- }
- function countZeros(integer, zeros) {
- return integer - integer % Math.pow(10, zeros);
- }
- function toQuantifier(digits) {
- let [start = 0, stop = ""] = digits;
- if (stop || start > 1) {
- return `{${start + (stop ? "," + stop : "")}}`;
- }
- return "";
- }
- function toCharacterClass(a, b, options) {
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
- }
- function hasPadding(str) {
- return /^-?(0+)\d/.test(str);
- }
- function padZeros(value, tok, options) {
- if (!tok.isPadded) {
- return value;
- }
- let diff = Math.abs(tok.maxLen - String(value).length);
- let relax = options.relaxZeros !== false;
- switch (diff) {
- case 0:
- return "";
- case 1:
- return relax ? "0?" : "0";
- case 2:
- return relax ? "0{0,2}" : "00";
- default: {
- return relax ? `0{0,${diff}}` : `0{${diff}}`;
- }
- }
- }
- toRegexRange.cache = {};
- toRegexRange.clearCache = () => toRegexRange.cache = {};
- module2.exports = toRegexRange;
- }
- });
- var require_fill_range = __commonJS2({
- "node_modules/fill-range/index.js"(exports2, module2) {
- "use strict";
- var util = require("util");
- var toRegexRange = require_to_regex_range();
- var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
- var transform = (toNumber) => {
- return (value) => toNumber === true ? Number(value) : String(value);
- };
- var isValidValue = (value) => {
- return typeof value === "number" || typeof value === "string" && value !== "";
- };
- var isNumber = (num) => Number.isInteger(+num);
- var zeros = (input) => {
- let value = `${input}`;
- let index = -1;
- if (value[0] === "-")
- value = value.slice(1);
- if (value === "0")
- return false;
- while (value[++index] === "0")
- ;
- return index > 0;
- };
- var stringify2 = (start, end, options) => {
- if (typeof start === "string" || typeof end === "string") {
- return true;
- }
- return options.stringify === true;
- };
- var pad = (input, maxLength, toNumber) => {
- if (maxLength > 0) {
- let dash = input[0] === "-" ? "-" : "";
- if (dash)
- input = input.slice(1);
- input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
- }
- if (toNumber === false) {
- return String(input);
- }
- return input;
- };
- var toMaxLen = (input, maxLength) => {
- let negative = input[0] === "-" ? "-" : "";
- if (negative) {
- input = input.slice(1);
- maxLength--;
- }
- while (input.length < maxLength)
- input = "0" + input;
- return negative ? "-" + input : input;
- };
- var toSequence = (parts, options) => {
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
- let prefix = options.capture ? "" : "?:";
- let positives = "";
- let negatives = "";
- let result;
- if (parts.positives.length) {
- positives = parts.positives.join("|");
- }
- if (parts.negatives.length) {
- negatives = `-(${prefix}${parts.negatives.join("|")})`;
- }
- if (positives && negatives) {
- result = `${positives}|${negatives}`;
- } else {
- result = positives || negatives;
- }
- if (options.wrap) {
- return `(${prefix}${result})`;
- }
- return result;
- };
- var toRange = (a, b, isNumbers, options) => {
- if (isNumbers) {
- return toRegexRange(a, b, Object.assign({
- wrap: false
- }, options));
- }
- let start = String.fromCharCode(a);
- if (a === b)
- return start;
- let stop = String.fromCharCode(b);
- return `[${start}-${stop}]`;
- };
- var toRegex = (start, end, options) => {
- if (Array.isArray(start)) {
- let wrap = options.wrap === true;
- let prefix = options.capture ? "" : "?:";
- return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
- }
- return toRegexRange(start, end, options);
- };
- var rangeError = (...args) => {
- return new RangeError("Invalid range arguments: " + util.inspect(...args));
- };
- var invalidRange = (start, end, options) => {
- if (options.strictRanges === true)
- throw rangeError([start, end]);
- return [];
- };
- var invalidStep = (step, options) => {
- if (options.strictRanges === true) {
- throw new TypeError(`Expected step "${step}" to be a number`);
- }
- return [];
- };
- var fillNumbers = (start, end, step = 1, options = {}) => {
- let a = Number(start);
- let b = Number(end);
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
- if (options.strictRanges === true)
- throw rangeError([start, end]);
- return [];
- }
- if (a === 0)
- a = 0;
- if (b === 0)
- b = 0;
- let descending = a > b;
- let startString = String(start);
- let endString = String(end);
- let stepString = String(step);
- step = Math.max(Math.abs(step), 1);
- let padded = zeros(startString) || zeros(endString) || zeros(stepString);
- let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
- let toNumber = padded === false && stringify2(start, end, options) === false;
- let format = options.transform || transform(toNumber);
- if (options.toRegex && step === 1) {
- return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
- }
- let parts = {
- negatives: [],
- positives: []
- };
- let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
- let range = [];
- let index = 0;
- while (descending ? a >= b : a <= b) {
- if (options.toRegex === true && step > 1) {
- push(a);
- } else {
- range.push(pad(format(a, index), maxLen, toNumber));
- }
- a = descending ? a - step : a + step;
- index++;
- }
- if (options.toRegex === true) {
- return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
- wrap: false
- }, options));
- }
- return range;
- };
- var fillLetters = (start, end, step = 1, options = {}) => {
- if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
- return invalidRange(start, end, options);
- }
- let format = options.transform || ((val) => String.fromCharCode(val));
- let a = `${start}`.charCodeAt(0);
- let b = `${end}`.charCodeAt(0);
- let descending = a > b;
- let min = Math.min(a, b);
- let max = Math.max(a, b);
- if (options.toRegex && step === 1) {
- return toRange(min, max, false, options);
- }
- let range = [];
- let index = 0;
- while (descending ? a >= b : a <= b) {
- range.push(format(a, index));
- a = descending ? a - step : a + step;
- index++;
- }
- if (options.toRegex === true) {
- return toRegex(range, null, {
- wrap: false,
- options
- });
- }
- return range;
- };
- var fill = (start, end, step, options = {}) => {
- if (end == null && isValidValue(start)) {
- return [start];
- }
- if (!isValidValue(start) || !isValidValue(end)) {
- return invalidRange(start, end, options);
- }
- if (typeof step === "function") {
- return fill(start, end, 1, {
- transform: step
- });
- }
- if (isObject(step)) {
- return fill(start, end, 0, step);
- }
- let opts = Object.assign({}, options);
- if (opts.capture === true)
- opts.wrap = true;
- step = step || opts.step || 1;
- if (!isNumber(step)) {
- if (step != null && !isObject(step))
- return invalidStep(step, opts);
- return fill(start, end, 1, step);
- }
- if (isNumber(start) && isNumber(end)) {
- return fillNumbers(start, end, step, opts);
- }
- return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
- };
- module2.exports = fill;
- }
- });
- var require_compile = __commonJS2({
- "node_modules/braces/lib/compile.js"(exports2, module2) {
- "use strict";
- var fill = require_fill_range();
- var utils = require_utils2();
- var compile = (ast, options = {}) => {
- let walk = (node, parent = {}) => {
- let invalidBlock = utils.isInvalidBrace(parent);
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
- let invalid = invalidBlock === true || invalidNode === true;
- let prefix = options.escapeInvalid === true ? "\\" : "";
- let output = "";
- if (node.isOpen === true) {
- return prefix + node.value;
- }
- if (node.isClose === true) {
- return prefix + node.value;
- }
- if (node.type === "open") {
- return invalid ? prefix + node.value : "(";
- }
- if (node.type === "close") {
- return invalid ? prefix + node.value : ")";
- }
- if (node.type === "comma") {
- return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
- }
- if (node.value) {
- return node.value;
- }
- if (node.nodes && node.ranges > 0) {
- let args = utils.reduce(node.nodes);
- let range = fill(...args, Object.assign(Object.assign({}, options), {}, {
- wrap: false,
- toRegex: true
- }));
- if (range.length !== 0) {
- return args.length > 1 && range.length > 1 ? `(${range})` : range;
- }
- }
- if (node.nodes) {
- for (let child of node.nodes) {
- output += walk(child, node);
- }
- }
- return output;
- };
- return walk(ast);
- };
- module2.exports = compile;
- }
- });
- var require_expand = __commonJS2({
- "node_modules/braces/lib/expand.js"(exports2, module2) {
- "use strict";
- var fill = require_fill_range();
- var stringify2 = require_stringify();
- var utils = require_utils2();
- var append = (queue = "", stash = "", enclose = false) => {
- let result = [];
- queue = [].concat(queue);
- stash = [].concat(stash);
- if (!stash.length)
- return queue;
- if (!queue.length) {
- return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
- }
- for (let item of queue) {
- if (Array.isArray(item)) {
- for (let value of item) {
- result.push(append(value, stash, enclose));
- }
- } else {
- for (let ele of stash) {
- if (enclose === true && typeof ele === "string")
- ele = `{${ele}}`;
- result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
- }
- }
- }
- return utils.flatten(result);
- };
- var expand = (ast, options = {}) => {
- let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
- let walk = (node, parent = {}) => {
- node.queue = [];
- let p = parent;
- let q = parent.queue;
- while (p.type !== "brace" && p.type !== "root" && p.parent) {
- p = p.parent;
- q = p.queue;
- }
- if (node.invalid || node.dollar) {
- q.push(append(q.pop(), stringify2(node, options)));
- return;
- }
- if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
- q.push(append(q.pop(), ["{}"]));
- return;
- }
- if (node.nodes && node.ranges > 0) {
- let args = utils.reduce(node.nodes);
- if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
- throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
- }
- let range = fill(...args, options);
- if (range.length === 0) {
- range = stringify2(node, options);
- }
- q.push(append(q.pop(), range));
- node.nodes = [];
- return;
- }
- let enclose = utils.encloseBrace(node);
- let queue = node.queue;
- let block = node;
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
- block = block.parent;
- queue = block.queue;
- }
- for (let i = 0; i < node.nodes.length; i++) {
- let child = node.nodes[i];
- if (child.type === "comma" && node.type === "brace") {
- if (i === 1)
- queue.push("");
- queue.push("");
- continue;
- }
- if (child.type === "close") {
- q.push(append(q.pop(), queue, enclose));
- continue;
- }
- if (child.value && child.type !== "open") {
- queue.push(append(queue.pop(), child.value));
- continue;
- }
- if (child.nodes) {
- walk(child, node);
- }
- }
- return queue;
- };
- return utils.flatten(walk(ast));
- };
- module2.exports = expand;
- }
- });
- var require_constants = __commonJS2({
- "node_modules/braces/lib/constants.js"(exports2, module2) {
- "use strict";
- module2.exports = {
- MAX_LENGTH: 1024 * 64,
- CHAR_0: "0",
- CHAR_9: "9",
- CHAR_UPPERCASE_A: "A",
- CHAR_LOWERCASE_A: "a",
- CHAR_UPPERCASE_Z: "Z",
- CHAR_LOWERCASE_Z: "z",
- CHAR_LEFT_PARENTHESES: "(",
- CHAR_RIGHT_PARENTHESES: ")",
- CHAR_ASTERISK: "*",
- CHAR_AMPERSAND: "&",
- CHAR_AT: "@",
- CHAR_BACKSLASH: "\\",
- CHAR_BACKTICK: "`",
- CHAR_CARRIAGE_RETURN: "\r",
- CHAR_CIRCUMFLEX_ACCENT: "^",
- CHAR_COLON: ":",
- CHAR_COMMA: ",",
- CHAR_DOLLAR: "$",
- CHAR_DOT: ".",
- CHAR_DOUBLE_QUOTE: '"',
- CHAR_EQUAL: "=",
- CHAR_EXCLAMATION_MARK: "!",
- CHAR_FORM_FEED: "\f",
- CHAR_FORWARD_SLASH: "/",
- CHAR_HASH: "#",
- CHAR_HYPHEN_MINUS: "-",
- CHAR_LEFT_ANGLE_BRACKET: "<",
- CHAR_LEFT_CURLY_BRACE: "{",
- CHAR_LEFT_SQUARE_BRACKET: "[",
- CHAR_LINE_FEED: "\n",
- CHAR_NO_BREAK_SPACE: "\xA0",
- CHAR_PERCENT: "%",
- CHAR_PLUS: "+",
- CHAR_QUESTION_MARK: "?",
- CHAR_RIGHT_ANGLE_BRACKET: ">",
- CHAR_RIGHT_CURLY_BRACE: "}",
- CHAR_RIGHT_SQUARE_BRACKET: "]",
- CHAR_SEMICOLON: ";",
- CHAR_SINGLE_QUOTE: "'",
- CHAR_SPACE: " ",
- CHAR_TAB: " ",
- CHAR_UNDERSCORE: "_",
- CHAR_VERTICAL_LINE: "|",
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
- };
- }
- });
- var require_parse = __commonJS2({
- "node_modules/braces/lib/parse.js"(exports2, module2) {
- "use strict";
- var stringify2 = require_stringify();
- var {
- MAX_LENGTH,
- CHAR_BACKSLASH,
- CHAR_BACKTICK,
- CHAR_COMMA,
- CHAR_DOT,
- CHAR_LEFT_PARENTHESES,
- CHAR_RIGHT_PARENTHESES,
- CHAR_LEFT_CURLY_BRACE,
- CHAR_RIGHT_CURLY_BRACE,
- CHAR_LEFT_SQUARE_BRACKET,
- CHAR_RIGHT_SQUARE_BRACKET,
- CHAR_DOUBLE_QUOTE,
- CHAR_SINGLE_QUOTE,
- CHAR_NO_BREAK_SPACE,
- CHAR_ZERO_WIDTH_NOBREAK_SPACE
- } = require_constants();
- var parse = (input, options = {}) => {
- if (typeof input !== "string") {
- throw new TypeError("Expected a string");
- }
- let opts = options || {};
- let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- if (input.length > max) {
- throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
- }
- let ast = {
- type: "root",
- input,
- nodes: []
- };
- let stack = [ast];
- let block = ast;
- let prev = ast;
- let brackets = 0;
- let length = input.length;
- let index = 0;
- let depth = 0;
- let value;
- let memo = {};
- const advance = () => input[index++];
- const push = (node) => {
- if (node.type === "text" && prev.type === "dot") {
- prev.type = "text";
- }
- if (prev && prev.type === "text" && node.type === "text") {
- prev.value += node.value;
- return;
- }
- block.nodes.push(node);
- node.parent = block;
- node.prev = prev;
- prev = node;
- return node;
- };
- push({
- type: "bos"
- });
- while (index < length) {
- block = stack[stack.length - 1];
- value = advance();
- if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
- continue;
- }
- if (value === CHAR_BACKSLASH) {
- push({
- type: "text",
- value: (options.keepEscaping ? value : "") + advance()
- });
- continue;
- }
- if (value === CHAR_RIGHT_SQUARE_BRACKET) {
- push({
- type: "text",
- value: "\\" + value
- });
- continue;
- }
- if (value === CHAR_LEFT_SQUARE_BRACKET) {
- brackets++;
- let closed = true;
- let next;
- while (index < length && (next = advance())) {
- value += next;
- if (next === CHAR_LEFT_SQUARE_BRACKET) {
- brackets++;
- continue;
- }
- if (next === CHAR_BACKSLASH) {
- value += advance();
- continue;
- }
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- brackets--;
- if (brackets === 0) {
- break;
- }
- }
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- if (value === CHAR_LEFT_PARENTHESES) {
- block = push({
- type: "paren",
- nodes: []
- });
- stack.push(block);
- push({
- type: "text",
- value
- });
- continue;
- }
- if (value === CHAR_RIGHT_PARENTHESES) {
- if (block.type !== "paren") {
- push({
- type: "text",
- value
- });
- continue;
- }
- block = stack.pop();
- push({
- type: "text",
- value
- });
- block = stack[stack.length - 1];
- continue;
- }
- if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
- let open = value;
- let next;
- if (options.keepQuotes !== true) {
- value = "";
- }
- while (index < length && (next = advance())) {
- if (next === CHAR_BACKSLASH) {
- value += next + advance();
- continue;
- }
- if (next === open) {
- if (options.keepQuotes === true)
- value += next;
- break;
- }
- value += next;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- if (value === CHAR_LEFT_CURLY_BRACE) {
- depth++;
- let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
- let brace = {
- type: "brace",
- open: true,
- close: false,
- dollar,
- depth,
- commas: 0,
- ranges: 0,
- nodes: []
- };
- block = push(brace);
- stack.push(block);
- push({
- type: "open",
- value
- });
- continue;
- }
- if (value === CHAR_RIGHT_CURLY_BRACE) {
- if (block.type !== "brace") {
- push({
- type: "text",
- value
- });
- continue;
- }
- let type = "close";
- block = stack.pop();
- block.close = true;
- push({
- type,
- value
- });
- depth--;
- block = stack[stack.length - 1];
- continue;
- }
- if (value === CHAR_COMMA && depth > 0) {
- if (block.ranges > 0) {
- block.ranges = 0;
- let open = block.nodes.shift();
- block.nodes = [open, {
- type: "text",
- value: stringify2(block)
- }];
- }
- push({
- type: "comma",
- value
- });
- block.commas++;
- continue;
- }
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
- let siblings = block.nodes;
- if (depth === 0 || siblings.length === 0) {
- push({
- type: "text",
- value
- });
- continue;
- }
- if (prev.type === "dot") {
- block.range = [];
- prev.value += value;
- prev.type = "range";
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
- block.invalid = true;
- block.ranges = 0;
- prev.type = "text";
- continue;
- }
- block.ranges++;
- block.args = [];
- continue;
- }
- if (prev.type === "range") {
- siblings.pop();
- let before = siblings[siblings.length - 1];
- before.value += prev.value + value;
- prev = before;
- block.ranges--;
- continue;
- }
- push({
- type: "dot",
- value
- });
- continue;
- }
- push({
- type: "text",
- value
- });
- }
- do {
- block = stack.pop();
- if (block.type !== "root") {
- block.nodes.forEach((node) => {
- if (!node.nodes) {
- if (node.type === "open")
- node.isOpen = true;
- if (node.type === "close")
- node.isClose = true;
- if (!node.nodes)
- node.type = "text";
- node.invalid = true;
- }
- });
- let parent = stack[stack.length - 1];
- let index2 = parent.nodes.indexOf(block);
- parent.nodes.splice(index2, 1, ...block.nodes);
- }
- } while (stack.length > 0);
- push({
- type: "eos"
- });
- return ast;
- };
- module2.exports = parse;
- }
- });
- var require_braces = __commonJS2({
- "node_modules/braces/index.js"(exports2, module2) {
- "use strict";
- var stringify2 = require_stringify();
- var compile = require_compile();
- var expand = require_expand();
- var parse = require_parse();
- var braces = (input, options = {}) => {
- let output = [];
- if (Array.isArray(input)) {
- for (let pattern of input) {
- let result = braces.create(pattern, options);
- if (Array.isArray(result)) {
- output.push(...result);
- } else {
- output.push(result);
- }
- }
- } else {
- output = [].concat(braces.create(input, options));
- }
- if (options && options.expand === true && options.nodupes === true) {
- output = [...new Set(output)];
- }
- return output;
- };
- braces.parse = (input, options = {}) => parse(input, options);
- braces.stringify = (input, options = {}) => {
- if (typeof input === "string") {
- return stringify2(braces.parse(input, options), options);
- }
- return stringify2(input, options);
- };
- braces.compile = (input, options = {}) => {
- if (typeof input === "string") {
- input = braces.parse(input, options);
- }
- return compile(input, options);
- };
- braces.expand = (input, options = {}) => {
- if (typeof input === "string") {
- input = braces.parse(input, options);
- }
- let result = expand(input, options);
- if (options.noempty === true) {
- result = result.filter(Boolean);
- }
- if (options.nodupes === true) {
- result = [...new Set(result)];
- }
- return result;
- };
- braces.create = (input, options = {}) => {
- if (input === "" || input.length < 3) {
- return [input];
- }
- return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
- };
- module2.exports = braces;
- }
- });
- var require_constants2 = __commonJS2({
- "node_modules/picomatch/lib/constants.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var WIN_SLASH = "\\\\/";
- var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
- var DOT_LITERAL = "\\.";
- var PLUS_LITERAL = "\\+";
- var QMARK_LITERAL = "\\?";
- var SLASH_LITERAL = "\\/";
- var ONE_CHAR = "(?=.)";
- var QMARK = "[^/]";
- var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
- var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
- var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
- var NO_DOT = `(?!${DOT_LITERAL})`;
- var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
- var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
- var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
- var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
- var STAR = `${QMARK}*?`;
- var POSIX_CHARS = {
- DOT_LITERAL,
- PLUS_LITERAL,
- QMARK_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- QMARK,
- END_ANCHOR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- };
- var WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
- SLASH_LITERAL: `[${WIN_SLASH}]`,
- QMARK: WIN_NO_SLASH,
- STAR: `${WIN_NO_SLASH}*?`,
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
- });
- var POSIX_REGEX_SOURCE = {
- alnum: "a-zA-Z0-9",
- alpha: "a-zA-Z",
- ascii: "\\x00-\\x7F",
- blank: " \\t",
- cntrl: "\\x00-\\x1F\\x7F",
- digit: "0-9",
- graph: "\\x21-\\x7E",
- lower: "a-z",
- print: "\\x20-\\x7E ",
- punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
- space: " \\t\\r\\n\\v\\f",
- upper: "A-Z",
- word: "A-Za-z0-9_",
- xdigit: "A-Fa-f0-9"
- };
- module2.exports = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE,
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
- REPLACEMENTS: {
- "***": "*",
- "**/**": "**",
- "**/**/**": "**"
- },
- CHAR_0: 48,
- CHAR_9: 57,
- CHAR_UPPERCASE_A: 65,
- CHAR_LOWERCASE_A: 97,
- CHAR_UPPERCASE_Z: 90,
- CHAR_LOWERCASE_Z: 122,
- CHAR_LEFT_PARENTHESES: 40,
- CHAR_RIGHT_PARENTHESES: 41,
- CHAR_ASTERISK: 42,
- CHAR_AMPERSAND: 38,
- CHAR_AT: 64,
- CHAR_BACKWARD_SLASH: 92,
- CHAR_CARRIAGE_RETURN: 13,
- CHAR_CIRCUMFLEX_ACCENT: 94,
- CHAR_COLON: 58,
- CHAR_COMMA: 44,
- CHAR_DOT: 46,
- CHAR_DOUBLE_QUOTE: 34,
- CHAR_EQUAL: 61,
- CHAR_EXCLAMATION_MARK: 33,
- CHAR_FORM_FEED: 12,
- CHAR_FORWARD_SLASH: 47,
- CHAR_GRAVE_ACCENT: 96,
- CHAR_HASH: 35,
- CHAR_HYPHEN_MINUS: 45,
- CHAR_LEFT_ANGLE_BRACKET: 60,
- CHAR_LEFT_CURLY_BRACE: 123,
- CHAR_LEFT_SQUARE_BRACKET: 91,
- CHAR_LINE_FEED: 10,
- CHAR_NO_BREAK_SPACE: 160,
- CHAR_PERCENT: 37,
- CHAR_PLUS: 43,
- CHAR_QUESTION_MARK: 63,
- CHAR_RIGHT_ANGLE_BRACKET: 62,
- CHAR_RIGHT_CURLY_BRACE: 125,
- CHAR_RIGHT_SQUARE_BRACKET: 93,
- CHAR_SEMICOLON: 59,
- CHAR_SINGLE_QUOTE: 39,
- CHAR_SPACE: 32,
- CHAR_TAB: 9,
- CHAR_UNDERSCORE: 95,
- CHAR_VERTICAL_LINE: 124,
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
- SEP: path.sep,
- extglobChars(chars) {
- return {
- "!": {
- type: "negate",
- open: "(?:(?!(?:",
- close: `))${chars.STAR})`
- },
- "?": {
- type: "qmark",
- open: "(?:",
- close: ")?"
- },
- "+": {
- type: "plus",
- open: "(?:",
- close: ")+"
- },
- "*": {
- type: "star",
- open: "(?:",
- close: ")*"
- },
- "@": {
- type: "at",
- open: "(?:",
- close: ")"
- }
- };
- },
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
- }
- };
- }
- });
- var require_utils3 = __commonJS2({
- "node_modules/picomatch/lib/utils.js"(exports2) {
- "use strict";
- var path = require("path");
- var win32 = process.platform === "win32";
- var {
- REGEX_BACKSLASH,
- REGEX_REMOVE_BACKSLASH,
- REGEX_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_GLOBAL
- } = require_constants2();
- exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
- exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
- exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
- exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
- exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
- exports2.removeBackslashes = (str) => {
- return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
- return match === "\\" ? "" : match;
- });
- };
- exports2.supportsLookbehinds = () => {
- const segs = process.version.slice(1).split(".").map(Number);
- if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
- return true;
- }
- return false;
- };
- exports2.isWindows = (options) => {
- if (options && typeof options.windows === "boolean") {
- return options.windows;
- }
- return win32 === true || path.sep === "\\";
- };
- exports2.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1)
- return input;
- if (input[idx - 1] === "\\")
- return exports2.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
- };
- exports2.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith("./")) {
- output = output.slice(2);
- state.prefix = "./";
- }
- return output;
- };
- exports2.wrapOutput = (input, state = {}, options = {}) => {
- const prepend = options.contains ? "" : "^";
- const append = options.contains ? "" : "$";
- let output = `${prepend}(?:${input})${append}`;
- if (state.negated === true) {
- output = `(?:^(?!${output}).*$)`;
- }
- return output;
- };
- }
- });
- var require_scan = __commonJS2({
- "node_modules/picomatch/lib/scan.js"(exports2, module2) {
- "use strict";
- var utils = require_utils3();
- var {
- CHAR_ASTERISK,
- CHAR_AT,
- CHAR_BACKWARD_SLASH,
- CHAR_COMMA,
- CHAR_DOT,
- CHAR_EXCLAMATION_MARK,
- CHAR_FORWARD_SLASH,
- CHAR_LEFT_CURLY_BRACE,
- CHAR_LEFT_PARENTHESES,
- CHAR_LEFT_SQUARE_BRACKET,
- CHAR_PLUS,
- CHAR_QUESTION_MARK,
- CHAR_RIGHT_CURLY_BRACE,
- CHAR_RIGHT_PARENTHESES,
- CHAR_RIGHT_SQUARE_BRACKET
- } = require_constants2();
- var isPathSeparator = (code) => {
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
- };
- var depth = (token) => {
- if (token.isPrefix !== true) {
- token.depth = token.isGlobstar ? Infinity : 1;
- }
- };
- var scan = (input, options) => {
- const opts = options || {};
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let negatedExtglob = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = {
- value: "",
- depth: 0,
- isGlob: false
- };
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
- while (index < length) {
- code = advance();
- let next;
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braceEscaped = true;
- }
- continue;
- }
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- continue;
- }
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (braceEscaped !== true && code === CHAR_COMMA) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_RIGHT_CURLY_BRACE) {
- braces--;
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_FORWARD_SLASH) {
- slashes.push(index);
- tokens.push(token);
- token = {
- value: "",
- depth: 0,
- isGlob: false
- };
- if (finished === true)
- continue;
- if (prev === CHAR_DOT && index === start + 1) {
- start += 2;
- continue;
- }
- lastIndex = index + 1;
- continue;
- }
- if (opts.noext !== true) {
- const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
- if (code === CHAR_EXCLAMATION_MARK && index === start) {
- negatedExtglob = true;
- }
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
- if (code === CHAR_RIGHT_PARENTHESES) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
- if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK)
- isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_QUESTION_MARK) {
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
- if (code === CHAR_RIGHT_PARENTHESES) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- if (isGlob === true) {
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- }
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
- let base = str;
- let prefix = "";
- let glob = "";
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = "";
- glob = str;
- } else {
- base = str;
- }
- if (base && base !== "" && base !== "/" && base !== str) {
- if (isPathSeparator(base.charCodeAt(base.length - 1))) {
- base = base.slice(0, -1);
- }
- }
- if (opts.unescape === true) {
- if (glob)
- glob = utils.removeBackslashes(glob);
- if (base && backslashes === true) {
- base = utils.removeBackslashes(base);
- }
- }
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated,
- negatedExtglob
- };
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator(code)) {
- tokens.push(token);
- }
- state.tokens = tokens;
- }
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else {
- tokens[idx].value = value;
- }
- depth(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== "") {
- parts.push(value);
- }
- prevIndex = i;
- }
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
- state.slashes = slashes;
- state.parts = parts;
- }
- return state;
- };
- module2.exports = scan;
- }
- });
- var require_parse2 = __commonJS2({
- "node_modules/picomatch/lib/parse.js"(exports2, module2) {
- "use strict";
- var constants = require_constants2();
- var utils = require_utils3();
- var {
- MAX_LENGTH,
- POSIX_REGEX_SOURCE,
- REGEX_NON_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_BACKREF,
- REPLACEMENTS
- } = constants;
- var expandRange = (args, options) => {
- if (typeof options.expandRange === "function") {
- return options.expandRange(...args, options);
- }
- args.sort();
- const value = `[${args.join("-")}]`;
- try {
- new RegExp(value);
- } catch (ex) {
- return args.map((v) => utils.escapeRegex(v)).join("..");
- }
- return value;
- };
- var syntaxError = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
- };
- var parse = (input, options) => {
- if (typeof input !== "string") {
- throw new TypeError("Expected a string");
- }
- input = REPLACEMENTS[input] || input;
- const opts = Object.assign({}, options);
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- let len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
- const bos = {
- type: "bos",
- value: "",
- output: opts.prepend || ""
- };
- const tokens = [bos];
- const capture = opts.capture ? "" : "?:";
- const win32 = utils.isWindows(options);
- const PLATFORM_CHARS = constants.globChars(win32);
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
- const {
- DOT_LITERAL,
- PLUS_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- } = PLATFORM_CHARS;
- const globstar = (opts2) => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
- const nodot = opts.dot ? "" : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
- if (opts.capture) {
- star = `(${star})`;
- }
- if (typeof opts.noext === "boolean") {
- opts.noextglob = opts.noext;
- }
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: "",
- output: "",
- prefix: "",
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
- input = utils.removePrefix(input, state);
- len = input.length;
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index] || "";
- const remaining = () => input.slice(state.index + 1);
- const consume = (value2 = "", num = 0) => {
- state.consumed += value2;
- state.index += num;
- };
- const append = (token) => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
- const negate = () => {
- let count = 1;
- while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
- advance();
- state.start++;
- count++;
- }
- if (count % 2 === 0) {
- return false;
- }
- state.negated = true;
- state.start++;
- return true;
- };
- const increment = (type) => {
- state[type]++;
- stack.push(type);
- };
- const decrement = (type) => {
- state[type]--;
- stack.pop();
- };
- const push = (tok) => {
- if (prev.type === "globstar") {
- const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
- const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
- if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = "star";
- prev.value = "*";
- prev.output = star;
- state.output += prev.output;
- }
- }
- if (extglobs.length && tok.type !== "paren") {
- extglobs[extglobs.length - 1].inner += tok.value;
- }
- if (tok.value || tok.output)
- append(tok);
- if (prev && prev.type === "text" && tok.type === "text") {
- prev.value += tok.value;
- prev.output = (prev.output || "") + tok.value;
- return;
- }
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
- const extglobOpen = (type, value2) => {
- const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value2]), {}, {
- conditions: 1,
- inner: ""
- });
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? "(" : "") + token.open;
- increment("parens");
- push({
- type,
- value: value2,
- output: state.output ? "" : ONE_CHAR
- });
- push({
- type: "paren",
- extglob: true,
- value: advance(),
- output
- });
- extglobs.push(token);
- };
- const extglobClose = (token) => {
- let output = token.close + (opts.capture ? ")" : "");
- let rest;
- if (token.type === "negate") {
- let extglobStar = star;
- if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
- extglobStar = globstar(opts);
- }
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
- output = token.close = `)$))${extglobStar}`;
- }
- if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
- const expression = parse(rest, Object.assign(Object.assign({}, options), {}, {
- fastpaths: false
- })).output;
- output = token.close = `)${expression})${extglobStar})`;
- }
- if (token.prev.type === "bos") {
- state.negatedExtglob = true;
- }
- }
- push({
- type: "paren",
- extglob: true,
- value,
- output
- });
- decrement("parens");
- };
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
- if (first === "\\") {
- backslashes = true;
- return m;
- }
- if (first === "?") {
- if (esc) {
- return esc + first + (rest ? QMARK.repeat(rest.length) : "");
- }
- if (index === 0) {
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
- }
- return QMARK.repeat(chars.length);
- }
- if (first === ".") {
- return DOT_LITERAL.repeat(chars.length);
- }
- if (first === "*") {
- if (esc) {
- return esc + first + (rest ? star : "");
- }
- return star;
- }
- return esc ? m : `\\${m}`;
- });
- if (backslashes === true) {
- if (opts.unescape === true) {
- output = output.replace(/\\/g, "");
- } else {
- output = output.replace(/\\+/g, (m) => {
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
- });
- }
- }
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
- state.output = utils.wrapOutput(output, state, options);
- return state;
- }
- while (!eos()) {
- value = advance();
- if (value === "\0") {
- continue;
- }
- if (value === "\\") {
- const next = peek();
- if (next === "/" && opts.bash !== true) {
- continue;
- }
- if (next === "." || next === ";") {
- continue;
- }
- if (!next) {
- value += "\\";
- push({
- type: "text",
- value
- });
- continue;
- }
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) {
- value += "\\";
- }
- }
- if (opts.unescape === true) {
- value = advance();
- } else {
- value += advance();
- }
- if (state.brackets === 0) {
- push({
- type: "text",
- value
- });
- continue;
- }
- }
- if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
- if (opts.posix !== false && value === ":") {
- const inner = prev.value.slice(1);
- if (inner.includes("[")) {
- prev.posix = true;
- if (inner.includes(":")) {
- const idx = prev.value.lastIndexOf("[");
- const pre = prev.value.slice(0, idx);
- const rest2 = prev.value.slice(idx + 2);
- const posix = POSIX_REGEX_SOURCE[rest2];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
- if (!bos.output && tokens.indexOf(prev) === 1) {
- bos.output = ONE_CHAR;
- }
- continue;
- }
- }
- }
- }
- if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
- value = `\\${value}`;
- }
- if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
- value = `\\${value}`;
- }
- if (opts.posix === true && value === "!" && prev.value === "[") {
- value = "^";
- }
- prev.value += value;
- append({
- value
- });
- continue;
- }
- if (state.quotes === 1 && value !== '"') {
- value = utils.escapeRegex(value);
- prev.value += value;
- append({
- value
- });
- continue;
- }
- if (value === '"') {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) {
- push({
- type: "text",
- value
- });
- }
- continue;
- }
- if (value === "(") {
- increment("parens");
- push({
- type: "paren",
- value
- });
- continue;
- }
- if (value === ")") {
- if (state.parens === 0 && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError("opening", "("));
- }
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
- push({
- type: "paren",
- value,
- output: state.parens ? ")" : "\\)"
- });
- decrement("parens");
- continue;
- }
- if (value === "[") {
- if (opts.nobracket === true || !remaining().includes("]")) {
- if (opts.nobracket !== true && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError("closing", "]"));
- }
- value = `\\${value}`;
- } else {
- increment("brackets");
- }
- push({
- type: "bracket",
- value
- });
- continue;
- }
- if (value === "]") {
- if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
- push({
- type: "text",
- value,
- output: `\\${value}`
- });
- continue;
- }
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError("opening", "["));
- }
- push({
- type: "text",
- value,
- output: `\\${value}`
- });
- continue;
- }
- decrement("brackets");
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
- value = `/${value}`;
- }
- prev.value += value;
- append({
- value
- });
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
- continue;
- }
- const escaped = utils.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
- if (value === "{" && opts.nobrace !== true) {
- increment("braces");
- const open = {
- type: "brace",
- value,
- output: "(",
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
- braces.push(open);
- push(open);
- continue;
- }
- if (value === "}") {
- const brace = braces[braces.length - 1];
- if (opts.nobrace === true || !brace) {
- push({
- type: "text",
- value,
- output: value
- });
- continue;
- }
- let output = ")";
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === "brace") {
- break;
- }
- if (arr[i].type !== "dots") {
- range.unshift(arr[i].value);
- }
- }
- output = expandRange(range, opts);
- state.backtrack = true;
- }
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = "\\{";
- value = output = "\\}";
- state.output = out;
- for (const t of toks) {
- state.output += t.output || t.value;
- }
- }
- push({
- type: "brace",
- value,
- output
- });
- decrement("braces");
- braces.pop();
- continue;
- }
- if (value === "|") {
- if (extglobs.length > 0) {
- extglobs[extglobs.length - 1].conditions++;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- if (value === ",") {
- let output = value;
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === "braces") {
- brace.comma = true;
- output = "|";
- }
- push({
- type: "comma",
- value,
- output
- });
- continue;
- }
- if (value === "/") {
- if (prev.type === "dot" && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = "";
- state.output = "";
- tokens.pop();
- prev = bos;
- continue;
- }
- push({
- type: "slash",
- value,
- output: SLASH_LITERAL
- });
- continue;
- }
- if (value === ".") {
- if (state.braces > 0 && prev.type === "dot") {
- if (prev.value === ".")
- prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = "dots";
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
- if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
- push({
- type: "text",
- value,
- output: DOT_LITERAL
- });
- continue;
- }
- push({
- type: "dot",
- value,
- output: DOT_LITERAL
- });
- continue;
- }
- if (value === "?") {
- const isGroup = prev && prev.value === "(";
- if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
- extglobOpen("qmark", value);
- continue;
- }
- if (prev && prev.type === "paren") {
- const next = peek();
- let output = value;
- if (next === "<" && !utils.supportsLookbehinds()) {
- throw new Error("Node.js v10 or higher is required for regex lookbehinds");
- }
- if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
- output = `\\${value}`;
- }
- push({
- type: "text",
- value,
- output
- });
- continue;
- }
- if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
- push({
- type: "qmark",
- value,
- output: QMARK_NO_DOT
- });
- continue;
- }
- push({
- type: "qmark",
- value,
- output: QMARK
- });
- continue;
- }
- if (value === "!") {
- if (opts.noextglob !== true && peek() === "(") {
- if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
- extglobOpen("negate", value);
- continue;
- }
- }
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
- if (value === "+") {
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
- extglobOpen("plus", value);
- continue;
- }
- if (prev && prev.value === "(" || opts.regex === false) {
- push({
- type: "plus",
- value,
- output: PLUS_LITERAL
- });
- continue;
- }
- if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
- push({
- type: "plus",
- value
- });
- continue;
- }
- push({
- type: "plus",
- value: PLUS_LITERAL
- });
- continue;
- }
- if (value === "@") {
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
- push({
- type: "at",
- extglob: true,
- value,
- output: ""
- });
- continue;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- if (value !== "*") {
- if (value === "$" || value === "^") {
- value = `\\${value}`;
- }
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- if (prev && (prev.type === "globstar" || prev.star === true)) {
- prev.type = "star";
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen("star", value);
- continue;
- }
- if (prev.type === "star") {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === "slash" || prior.type === "bos";
- const afterStar = before && (before.type === "star" || before.type === "globstar");
- if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
- push({
- type: "star",
- value,
- output: ""
- });
- continue;
- }
- const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
- const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
- if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
- push({
- type: "star",
- value,
- output: ""
- });
- continue;
- }
- while (rest.slice(0, 3) === "/**") {
- const after = input[state.index + 4];
- if (after && after !== "/") {
- break;
- }
- rest = rest.slice(3);
- consume("/**", 3);
- }
- if (prior.type === "bos" && eos()) {
- prev.type = "globstar";
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
- if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
- prev.type = "globstar";
- prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
- if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
- const end = rest[1] !== void 0 ? "|$" : "";
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
- prev.type = "globstar";
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
- state.output += prior.output + prev.output;
- state.globstar = true;
- consume(value + advance());
- push({
- type: "slash",
- value: "/",
- output: ""
- });
- continue;
- }
- if (prior.type === "bos" && rest[0] === "/") {
- prev.type = "globstar";
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({
- type: "slash",
- value: "/",
- output: ""
- });
- continue;
- }
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = "globstar";
- prev.output = globstar(opts);
- prev.value += value;
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
- const token = {
- type: "star",
- value,
- output: star
- };
- if (opts.bash === true) {
- token.output = ".*?";
- if (prev.type === "bos" || prev.type === "slash") {
- token.output = nodot + token.output;
- }
- push(token);
- continue;
- }
- if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
- if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
- if (prev.type === "dot") {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
- if (peek() !== "*") {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
- push(token);
- }
- while (state.brackets > 0) {
- if (opts.strictBrackets === true)
- throw new SyntaxError(syntaxError("closing", "]"));
- state.output = utils.escapeLast(state.output, "[");
- decrement("brackets");
- }
- while (state.parens > 0) {
- if (opts.strictBrackets === true)
- throw new SyntaxError(syntaxError("closing", ")"));
- state.output = utils.escapeLast(state.output, "(");
- decrement("parens");
- }
- while (state.braces > 0) {
- if (opts.strictBrackets === true)
- throw new SyntaxError(syntaxError("closing", "}"));
- state.output = utils.escapeLast(state.output, "{");
- decrement("braces");
- }
- if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
- push({
- type: "maybe_slash",
- value: "",
- output: `${SLASH_LITERAL}?`
- });
- }
- if (state.backtrack === true) {
- state.output = "";
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
- if (token.suffix) {
- state.output += token.suffix;
- }
- }
- }
- return state;
- };
- parse.fastpaths = (input, options) => {
- const opts = Object.assign({}, options);
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- const len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
- input = REPLACEMENTS[input] || input;
- const win32 = utils.isWindows(options);
- const {
- DOT_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOTS_SLASH,
- STAR,
- START_ANCHOR
- } = constants.globChars(win32);
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? "" : "?:";
- const state = {
- negated: false,
- prefix: ""
- };
- let star = opts.bash === true ? ".*?" : STAR;
- if (opts.capture) {
- star = `(${star})`;
- }
- const globstar = (opts2) => {
- if (opts2.noglobstar === true)
- return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
- const create = (str) => {
- switch (str) {
- case "*":
- return `${nodot}${ONE_CHAR}${star}`;
- case ".*":
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
- case "*.*":
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
- case "*/*":
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
- case "**":
- return nodot + globstar(opts);
- case "**/*":
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
- case "**/*.*":
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
- case "**/.*":
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match)
- return;
- const source2 = create(match[1]);
- if (!source2)
- return;
- return source2 + DOT_LITERAL + match[2];
- }
- }
- };
- const output = utils.removePrefix(input, state);
- let source = create(output);
- if (source && opts.strictSlashes !== true) {
- source += `${SLASH_LITERAL}?`;
- }
- return source;
- };
- module2.exports = parse;
- }
- });
- var require_picomatch = __commonJS2({
- "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var scan = require_scan();
- var parse = require_parse2();
- var utils = require_utils3();
- var constants = require_constants2();
- var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
- var picomatch = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map((input) => picomatch(input, options, returnState));
- const arrayMatcher = (str) => {
- for (const isMatch of fns) {
- const state2 = isMatch(str);
- if (state2)
- return state2;
- }
- return false;
- };
- return arrayMatcher;
- }
- const isState = isObject(glob) && glob.tokens && glob.input;
- if (glob === "" || typeof glob !== "string" && !isState) {
- throw new TypeError("Expected pattern to be a non-empty string");
- }
- const opts = options || {};
- const posix = utils.isWindows(options);
- const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
- const state = regex.state;
- delete regex.state;
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
- ignore: null,
- onMatch: null,
- onResult: null
- });
- isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
- }
- const matcher = (input, returnObject = false) => {
- const {
- isMatch,
- match,
- output
- } = picomatch.test(input, regex, options, {
- glob,
- posix
- });
- const result = {
- glob,
- state,
- regex,
- posix,
- input,
- output,
- match,
- isMatch
- };
- if (typeof opts.onResult === "function") {
- opts.onResult(result);
- }
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === "function") {
- opts.onIgnore(result);
- }
- result.isMatch = false;
- return returnObject ? result : false;
- }
- if (typeof opts.onMatch === "function") {
- opts.onMatch(result);
- }
- return returnObject ? result : true;
- };
- if (returnState) {
- matcher.state = state;
- }
- return matcher;
- };
- picomatch.test = (input, regex, options, {
- glob,
- posix
- } = {}) => {
- if (typeof input !== "string") {
- throw new TypeError("Expected input to be a string");
- }
- if (input === "") {
- return {
- isMatch: false,
- output: ""
- };
- }
- const opts = options || {};
- const format = opts.format || (posix ? utils.toPosixSlashes : null);
- let match = input === glob;
- let output = match && format ? format(input) : input;
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
- if (match === false || opts.capture === true) {
- if (opts.matchBase === true || opts.basename === true) {
- match = picomatch.matchBase(input, regex, options, posix);
- } else {
- match = regex.exec(output);
- }
- }
- return {
- isMatch: Boolean(match),
- match,
- output
- };
- };
- picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
- const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
- return regex.test(path.basename(input));
- };
- picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
- picomatch.parse = (pattern, options) => {
- if (Array.isArray(pattern))
- return pattern.map((p) => picomatch.parse(p, options));
- return parse(pattern, Object.assign(Object.assign({}, options), {}, {
- fastpaths: false
- }));
- };
- picomatch.scan = (input, options) => scan(input, options);
- picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) {
- return state.output;
- }
- const opts = options || {};
- const prepend = opts.contains ? "" : "^";
- const append = opts.contains ? "" : "$";
- let source = `${prepend}(?:${state.output})${append}`;
- if (state && state.negated === true) {
- source = `^(?!${source}).*$`;
- }
- const regex = picomatch.toRegex(source, options);
- if (returnState === true) {
- regex.state = state;
- }
- return regex;
- };
- picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== "string") {
- throw new TypeError("Expected a non-empty string");
- }
- let parsed = {
- negated: false,
- fastpaths: true
- };
- if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
- parsed.output = parse.fastpaths(input, options);
- }
- if (!parsed.output) {
- parsed = parse(input, options);
- }
- return picomatch.compileRe(parsed, options, returnOutput, returnState);
- };
- picomatch.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
- } catch (err) {
- if (options && options.debug === true)
- throw err;
- return /$^/;
- }
- };
- picomatch.constants = constants;
- module2.exports = picomatch;
- }
- });
- var require_picomatch2 = __commonJS2({
- "node_modules/picomatch/index.js"(exports2, module2) {
- "use strict";
- module2.exports = require_picomatch();
- }
- });
- var require_micromatch = __commonJS2({
- "node_modules/micromatch/index.js"(exports2, module2) {
- "use strict";
- var util = require("util");
- var braces = require_braces();
- var picomatch = require_picomatch2();
- var utils = require_utils3();
- var isEmptyString = (val) => val === "" || val === "./";
- var micromatch = (list, patterns, options) => {
- patterns = [].concat(patterns);
- list = [].concat(list);
- let omit = /* @__PURE__ */ new Set();
- let keep = /* @__PURE__ */ new Set();
- let items = /* @__PURE__ */ new Set();
- let negatives = 0;
- let onResult = (state) => {
- items.add(state.output);
- if (options && options.onResult) {
- options.onResult(state);
- }
- };
- for (let i = 0; i < patterns.length; i++) {
- let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
- onResult
- }), true);
- let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
- if (negated)
- negatives++;
- for (let item of list) {
- let matched = isMatch(item, true);
- let match = negated ? !matched.isMatch : matched.isMatch;
- if (!match)
- continue;
- if (negated) {
- omit.add(matched.output);
- } else {
- omit.delete(matched.output);
- keep.add(matched.output);
- }
- }
- }
- let result = negatives === patterns.length ? [...items] : [...keep];
- let matches = result.filter((item) => !omit.has(item));
- if (options && matches.length === 0) {
- if (options.failglob === true) {
- throw new Error(`No matches found for "${patterns.join(", ")}"`);
- }
- if (options.nonull === true || options.nullglob === true) {
- return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
- }
- }
- return matches;
- };
- micromatch.match = micromatch;
- micromatch.matcher = (pattern, options) => picomatch(pattern, options);
- micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
- micromatch.any = micromatch.isMatch;
- micromatch.not = (list, patterns, options = {}) => {
- patterns = [].concat(patterns).map(String);
- let result = /* @__PURE__ */ new Set();
- let items = [];
- let onResult = (state) => {
- if (options.onResult)
- options.onResult(state);
- items.push(state.output);
- };
- let matches = new Set(micromatch(list, patterns, Object.assign(Object.assign({}, options), {}, {
- onResult
- })));
- for (let item of items) {
- if (!matches.has(item)) {
- result.add(item);
- }
- }
- return [...result];
- };
- micromatch.contains = (str, pattern, options) => {
- if (typeof str !== "string") {
- throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
- }
- if (Array.isArray(pattern)) {
- return pattern.some((p) => micromatch.contains(str, p, options));
- }
- if (typeof pattern === "string") {
- if (isEmptyString(str) || isEmptyString(pattern)) {
- return false;
- }
- if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
- return true;
- }
- }
- return micromatch.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
- contains: true
- }));
- };
- micromatch.matchKeys = (obj, patterns, options) => {
- if (!utils.isObject(obj)) {
- throw new TypeError("Expected the first argument to be an object");
- }
- let keys = micromatch(Object.keys(obj), patterns, options);
- let res = {};
- for (let key of keys)
- res[key] = obj[key];
- return res;
- };
- micromatch.some = (list, patterns, options) => {
- let items = [].concat(list);
- for (let pattern of [].concat(patterns)) {
- let isMatch = picomatch(String(pattern), options);
- if (items.some((item) => isMatch(item))) {
- return true;
- }
- }
- return false;
- };
- micromatch.every = (list, patterns, options) => {
- let items = [].concat(list);
- for (let pattern of [].concat(patterns)) {
- let isMatch = picomatch(String(pattern), options);
- if (!items.every((item) => isMatch(item))) {
- return false;
- }
- }
- return true;
- };
- micromatch.all = (str, patterns, options) => {
- if (typeof str !== "string") {
- throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
- }
- return [].concat(patterns).every((p) => picomatch(p, options)(str));
- };
- micromatch.capture = (glob, input, options) => {
- let posix = utils.isWindows(options);
- let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
- capture: true
- }));
- let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
- if (match) {
- return match.slice(1).map((v) => v === void 0 ? "" : v);
- }
- };
- micromatch.makeRe = (...args) => picomatch.makeRe(...args);
- micromatch.scan = (...args) => picomatch.scan(...args);
- micromatch.parse = (patterns, options) => {
- let res = [];
- for (let pattern of [].concat(patterns || [])) {
- for (let str of braces(String(pattern), options)) {
- res.push(picomatch.parse(str, options));
- }
- }
- return res;
- };
- micromatch.braces = (pattern, options) => {
- if (typeof pattern !== "string")
- throw new TypeError("Expected a string");
- if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
- return [pattern];
- }
- return braces(pattern, options);
- };
- micromatch.braceExpand = (pattern, options) => {
- if (typeof pattern !== "string")
- throw new TypeError("Expected a string");
- return micromatch.braces(pattern, Object.assign(Object.assign({}, options), {}, {
- expand: true
- }));
- };
- module2.exports = micromatch;
- }
- });
- var require_pattern = __commonJS2({
- "node_modules/fast-glob/out/utils/pattern.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- 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;
- var path = require("path");
- var globParent = require_glob_parent();
- var micromatch = require_micromatch();
- var GLOBSTAR = "**";
- var ESCAPE_SYMBOL = "\\";
- var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
- var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
- var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
- var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
- var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
- function isStaticPattern(pattern, options = {}) {
- return !isDynamicPattern(pattern, options);
- }
- exports2.isStaticPattern = isStaticPattern;
- function isDynamicPattern(pattern, options = {}) {
- if (pattern === "") {
- return false;
- }
- if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
- return true;
- }
- if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
- return true;
- }
- if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
- return true;
- }
- if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
- return true;
- }
- return false;
- }
- exports2.isDynamicPattern = isDynamicPattern;
- function hasBraceExpansion(pattern) {
- const openingBraceIndex = pattern.indexOf("{");
- if (openingBraceIndex === -1) {
- return false;
- }
- const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
- if (closingBraceIndex === -1) {
- return false;
- }
- const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
- return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
- }
- function convertToPositivePattern(pattern) {
- return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
- }
- exports2.convertToPositivePattern = convertToPositivePattern;
- function convertToNegativePattern(pattern) {
- return "!" + pattern;
- }
- exports2.convertToNegativePattern = convertToNegativePattern;
- function isNegativePattern(pattern) {
- return pattern.startsWith("!") && pattern[1] !== "(";
- }
- exports2.isNegativePattern = isNegativePattern;
- function isPositivePattern(pattern) {
- return !isNegativePattern(pattern);
- }
- exports2.isPositivePattern = isPositivePattern;
- function getNegativePatterns(patterns) {
- return patterns.filter(isNegativePattern);
- }
- exports2.getNegativePatterns = getNegativePatterns;
- function getPositivePatterns(patterns) {
- return patterns.filter(isPositivePattern);
- }
- exports2.getPositivePatterns = getPositivePatterns;
- function getPatternsInsideCurrentDirectory(patterns) {
- return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
- }
- exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
- function getPatternsOutsideCurrentDirectory(patterns) {
- return patterns.filter(isPatternRelatedToParentDirectory);
- }
- exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
- function isPatternRelatedToParentDirectory(pattern) {
- return pattern.startsWith("..") || pattern.startsWith("./..");
- }
- exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
- function getBaseDirectory(pattern) {
- return globParent(pattern, {
- flipBackslashes: false
- });
- }
- exports2.getBaseDirectory = getBaseDirectory;
- function hasGlobStar(pattern) {
- return pattern.includes(GLOBSTAR);
- }
- exports2.hasGlobStar = hasGlobStar;
- function endsWithSlashGlobStar(pattern) {
- return pattern.endsWith("/" + GLOBSTAR);
- }
- exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
- function isAffectDepthOfReadingPattern(pattern) {
- const basename = path.basename(pattern);
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
- }
- exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
- function expandPatternsWithBraceExpansion(patterns) {
- return patterns.reduce((collection, pattern) => {
- return collection.concat(expandBraceExpansion(pattern));
- }, []);
- }
- exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
- function expandBraceExpansion(pattern) {
- return micromatch.braces(pattern, {
- expand: true,
- nodupes: true
- });
- }
- exports2.expandBraceExpansion = expandBraceExpansion;
- function getPatternParts(pattern, options) {
- let {
- parts
- } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
- parts: true
- }));
- if (parts.length === 0) {
- parts = [pattern];
- }
- if (parts[0].startsWith("/")) {
- parts[0] = parts[0].slice(1);
- parts.unshift("");
- }
- return parts;
- }
- exports2.getPatternParts = getPatternParts;
- function makeRe(pattern, options) {
- return micromatch.makeRe(pattern, options);
- }
- exports2.makeRe = makeRe;
- function convertPatternsToRe(patterns, options) {
- return patterns.map((pattern) => makeRe(pattern, options));
- }
- exports2.convertPatternsToRe = convertPatternsToRe;
- function matchAny(entry, patternsRe) {
- return patternsRe.some((patternRe) => patternRe.test(entry));
- }
- exports2.matchAny = matchAny;
- }
- });
- var require_merge2 = __commonJS2({
- "node_modules/merge2/index.js"(exports2, module2) {
- "use strict";
- var Stream = require("stream");
- var PassThrough = Stream.PassThrough;
- var slice = Array.prototype.slice;
- module2.exports = merge2;
- function merge2() {
- const streamsQueue = [];
- const args = slice.call(arguments);
- let merging = false;
- let options = args[args.length - 1];
- if (options && !Array.isArray(options) && options.pipe == null) {
- args.pop();
- } else {
- options = {};
- }
- const doEnd = options.end !== false;
- const doPipeError = options.pipeError === true;
- if (options.objectMode == null) {
- options.objectMode = true;
- }
- if (options.highWaterMark == null) {
- options.highWaterMark = 64 * 1024;
- }
- const mergedStream = PassThrough(options);
- function addStream() {
- for (let i = 0, len = arguments.length; i < len; i++) {
- streamsQueue.push(pauseStreams(arguments[i], options));
- }
- mergeStream();
- return this;
- }
- function mergeStream() {
- if (merging) {
- return;
- }
- merging = true;
- let streams = streamsQueue.shift();
- if (!streams) {
- process.nextTick(endStream);
- return;
- }
- if (!Array.isArray(streams)) {
- streams = [streams];
- }
- let pipesCount = streams.length + 1;
- function next() {
- if (--pipesCount > 0) {
- return;
- }
- merging = false;
- mergeStream();
- }
- function pipe(stream) {
- function onend() {
- stream.removeListener("merge2UnpipeEnd", onend);
- stream.removeListener("end", onend);
- if (doPipeError) {
- stream.removeListener("error", onerror);
- }
- next();
- }
- function onerror(err) {
- mergedStream.emit("error", err);
- }
- if (stream._readableState.endEmitted) {
- return next();
- }
- stream.on("merge2UnpipeEnd", onend);
- stream.on("end", onend);
- if (doPipeError) {
- stream.on("error", onerror);
- }
- stream.pipe(mergedStream, {
- end: false
- });
- stream.resume();
- }
- for (let i = 0; i < streams.length; i++) {
- pipe(streams[i]);
- }
- next();
- }
- function endStream() {
- merging = false;
- mergedStream.emit("queueDrain");
- if (doEnd) {
- mergedStream.end();
- }
- }
- mergedStream.setMaxListeners(0);
- mergedStream.add = addStream;
- mergedStream.on("unpipe", function(stream) {
- stream.emit("merge2UnpipeEnd");
- });
- if (args.length) {
- addStream.apply(null, args);
- }
- return mergedStream;
- }
- function pauseStreams(streams, options) {
- if (!Array.isArray(streams)) {
- if (!streams._readableState && streams.pipe) {
- streams = streams.pipe(PassThrough(options));
- }
- if (!streams._readableState || !streams.pause || !streams.pipe) {
- throw new Error("Only readable stream can be merged.");
- }
- streams.pause();
- } else {
- for (let i = 0, len = streams.length; i < len; i++) {
- streams[i] = pauseStreams(streams[i], options);
- }
- }
- return streams;
- }
- }
- });
- var require_stream = __commonJS2({
- "node_modules/fast-glob/out/utils/stream.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.merge = void 0;
- var merge2 = require_merge2();
- function merge(streams) {
- const mergedStream = merge2(streams);
- streams.forEach((stream) => {
- stream.once("error", (error) => mergedStream.emit("error", error));
- });
- mergedStream.once("close", () => propagateCloseEventToSources(streams));
- mergedStream.once("end", () => propagateCloseEventToSources(streams));
- return mergedStream;
- }
- exports2.merge = merge;
- function propagateCloseEventToSources(streams) {
- streams.forEach((stream) => stream.emit("close"));
- }
- }
- });
- var require_string = __commonJS2({
- "node_modules/fast-glob/out/utils/string.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.isEmpty = exports2.isString = void 0;
- function isString(input) {
- return typeof input === "string";
- }
- exports2.isString = isString;
- function isEmpty(input) {
- return input === "";
- }
- exports2.isEmpty = isEmpty;
- }
- });
- var require_utils4 = __commonJS2({
- "node_modules/fast-glob/out/utils/index.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
- var array2 = require_array();
- exports2.array = array2;
- var errno = require_errno();
- exports2.errno = errno;
- var fs = require_fs();
- exports2.fs = fs;
- var path = require_path();
- exports2.path = path;
- var pattern = require_pattern();
- exports2.pattern = pattern;
- var stream = require_stream();
- exports2.stream = stream;
- var string = require_string();
- exports2.string = string;
- }
- });
- var require_tasks = __commonJS2({
- "node_modules/fast-glob/out/managers/tasks.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
- var utils = require_utils4();
- function generate(patterns, settings) {
- const positivePatterns = getPositivePatterns(patterns);
- const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
- const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
- const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
- return staticTasks.concat(dynamicTasks);
- }
- exports2.generate = generate;
- function convertPatternsToTasks(positive, negative, dynamic) {
- const tasks = [];
- const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
- const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
- const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
- const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
- tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
- if ("." in insideCurrentDirectoryGroup) {
- tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
- } else {
- tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
- }
- return tasks;
- }
- exports2.convertPatternsToTasks = convertPatternsToTasks;
- function getPositivePatterns(patterns) {
- return utils.pattern.getPositivePatterns(patterns);
- }
- exports2.getPositivePatterns = getPositivePatterns;
- function getNegativePatternsAsPositive(patterns, ignore) {
- const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
- const positive = negative.map(utils.pattern.convertToPositivePattern);
- return positive;
- }
- exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
- function groupPatternsByBaseDirectory(patterns) {
- const group = {};
- return patterns.reduce((collection, pattern) => {
- const base = utils.pattern.getBaseDirectory(pattern);
- if (base in collection) {
- collection[base].push(pattern);
- } else {
- collection[base] = [pattern];
- }
- return collection;
- }, group);
- }
- exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
- function convertPatternGroupsToTasks(positive, negative, dynamic) {
- return Object.keys(positive).map((base) => {
- return convertPatternGroupToTask(base, positive[base], negative, dynamic);
- });
- }
- exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
- function convertPatternGroupToTask(base, positive, negative, dynamic) {
- return {
- dynamic,
- positive,
- negative,
- base,
- patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
- };
- }
- exports2.convertPatternGroupToTask = convertPatternGroupToTask;
- }
- });
- var require_patterns = __commonJS2({
- "node_modules/fast-glob/out/managers/patterns.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.removeDuplicateSlashes = exports2.transform = void 0;
- var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
- function transform(patterns) {
- return patterns.map((pattern) => removeDuplicateSlashes(pattern));
- }
- exports2.transform = transform;
- function removeDuplicateSlashes(pattern) {
- return pattern.replace(DOUBLE_SLASH_RE, "/");
- }
- exports2.removeDuplicateSlashes = removeDuplicateSlashes;
- }
- });
- var require_async = __commonJS2({
- "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.read = void 0;
- function read(path, settings, callback) {
- settings.fs.lstat(path, (lstatError, lstat) => {
- if (lstatError !== null) {
- callFailureCallback(callback, lstatError);
- return;
- }
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
- callSuccessCallback(callback, lstat);
- return;
- }
- settings.fs.stat(path, (statError, stat) => {
- if (statError !== null) {
- if (settings.throwErrorOnBrokenSymbolicLink) {
- callFailureCallback(callback, statError);
- return;
- }
- callSuccessCallback(callback, lstat);
- return;
- }
- if (settings.markSymbolicLink) {
- stat.isSymbolicLink = () => true;
- }
- callSuccessCallback(callback, stat);
- });
- });
- }
- exports2.read = read;
- function callFailureCallback(callback, error) {
- callback(error);
- }
- function callSuccessCallback(callback, result) {
- callback(null, result);
- }
- }
- });
- var require_sync = __commonJS2({
- "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.read = void 0;
- function read(path, settings) {
- const lstat = settings.fs.lstatSync(path);
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
- return lstat;
- }
- try {
- const stat = settings.fs.statSync(path);
- if (settings.markSymbolicLink) {
- stat.isSymbolicLink = () => true;
- }
- return stat;
- } catch (error) {
- if (!settings.throwErrorOnBrokenSymbolicLink) {
- return lstat;
- }
- throw error;
- }
- }
- exports2.read = read;
- }
- });
- var require_fs2 = __commonJS2({
- "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
- var fs = require("fs");
- exports2.FILE_SYSTEM_ADAPTER = {
- lstat: fs.lstat,
- stat: fs.stat,
- lstatSync: fs.lstatSync,
- statSync: fs.statSync
- };
- function createFileSystemAdapter(fsMethods) {
- if (fsMethods === void 0) {
- return exports2.FILE_SYSTEM_ADAPTER;
- }
- return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
- }
- exports2.createFileSystemAdapter = createFileSystemAdapter;
- }
- });
- var require_settings = __commonJS2({
- "node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var fs = require_fs2();
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
- this.fs = fs.createFileSystemAdapter(this._options.fs);
- this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
- }
- _getValue(option, value) {
- return option !== null && option !== void 0 ? option : value;
- }
- };
- exports2.default = Settings;
- }
- });
- var require_out = __commonJS2({
- "node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.statSync = exports2.stat = exports2.Settings = void 0;
- var async = require_async();
- var sync = require_sync();
- var settings_1 = require_settings();
- exports2.Settings = settings_1.default;
- function stat(path, optionsOrSettingsOrCallback, callback) {
- if (typeof optionsOrSettingsOrCallback === "function") {
- async.read(path, getSettings(), optionsOrSettingsOrCallback);
- return;
- }
- async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
- }
- exports2.stat = stat;
- function statSync(path, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- return sync.read(path, settings);
- }
- exports2.statSync = statSync;
- function getSettings(settingsOrOptions = {}) {
- if (settingsOrOptions instanceof settings_1.default) {
- return settingsOrOptions;
- }
- return new settings_1.default(settingsOrOptions);
- }
- }
- });
- var require_queue_microtask = __commonJS2({
- "node_modules/queue-microtask/index.js"(exports2, module2) {
- var promise;
- module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
- throw err;
- }, 0));
- }
- });
- var require_run_parallel = __commonJS2({
- "node_modules/run-parallel/index.js"(exports2, module2) {
- module2.exports = runParallel;
- var queueMicrotask2 = require_queue_microtask();
- function runParallel(tasks, cb) {
- let results, pending, keys;
- let isSync = true;
- if (Array.isArray(tasks)) {
- results = [];
- pending = tasks.length;
- } else {
- keys = Object.keys(tasks);
- results = {};
- pending = keys.length;
- }
- function done(err) {
- function end() {
- if (cb)
- cb(err, results);
- cb = null;
- }
- if (isSync)
- queueMicrotask2(end);
- else
- end();
- }
- function each(i, err, result) {
- results[i] = result;
- if (--pending === 0 || err) {
- done(err);
- }
- }
- if (!pending) {
- done(null);
- } else if (keys) {
- keys.forEach(function(key) {
- tasks[key](function(err, result) {
- each(key, err, result);
- });
- });
- } else {
- tasks.forEach(function(task, i) {
- task(function(err, result) {
- each(i, err, result);
- });
- });
- }
- isSync = false;
- }
- }
- });
- var require_constants3 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
- var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
- if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
- throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
- }
- var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
- var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
- var SUPPORTED_MAJOR_VERSION = 10;
- var SUPPORTED_MINOR_VERSION = 10;
- var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
- var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
- exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
- }
- });
- var require_fs3 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.createDirentFromStats = void 0;
- var DirentFromStats = class {
- constructor(name, stats) {
- this.name = name;
- this.isBlockDevice = stats.isBlockDevice.bind(stats);
- this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
- this.isDirectory = stats.isDirectory.bind(stats);
- this.isFIFO = stats.isFIFO.bind(stats);
- this.isFile = stats.isFile.bind(stats);
- this.isSocket = stats.isSocket.bind(stats);
- this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
- }
- };
- function createDirentFromStats(name, stats) {
- return new DirentFromStats(name, stats);
- }
- exports2.createDirentFromStats = createDirentFromStats;
- }
- });
- var require_utils5 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.fs = void 0;
- var fs = require_fs3();
- exports2.fs = fs;
- }
- });
- var require_common = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.joinPathSegments = void 0;
- function joinPathSegments(a, b, separator) {
- if (a.endsWith(separator)) {
- return a + b;
- }
- return a + separator + b;
- }
- exports2.joinPathSegments = joinPathSegments;
- }
- });
- var require_async2 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
- var fsStat = require_out();
- var rpl = require_run_parallel();
- var constants_1 = require_constants3();
- var utils = require_utils5();
- var common = require_common();
- function read(directory, settings, callback) {
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
- readdirWithFileTypes(directory, settings, callback);
- return;
- }
- readdir(directory, settings, callback);
- }
- exports2.read = read;
- function readdirWithFileTypes(directory, settings, callback) {
- settings.fs.readdir(directory, {
- withFileTypes: true
- }, (readdirError, dirents) => {
- if (readdirError !== null) {
- callFailureCallback(callback, readdirError);
- return;
- }
- const entries = dirents.map((dirent) => ({
- dirent,
- name: dirent.name,
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
- }));
- if (!settings.followSymbolicLinks) {
- callSuccessCallback(callback, entries);
- return;
- }
- const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
- rpl(tasks, (rplError, rplEntries) => {
- if (rplError !== null) {
- callFailureCallback(callback, rplError);
- return;
- }
- callSuccessCallback(callback, rplEntries);
- });
- });
- }
- exports2.readdirWithFileTypes = readdirWithFileTypes;
- function makeRplTaskEntry(entry, settings) {
- return (done) => {
- if (!entry.dirent.isSymbolicLink()) {
- done(null, entry);
- return;
- }
- settings.fs.stat(entry.path, (statError, stats) => {
- if (statError !== null) {
- if (settings.throwErrorOnBrokenSymbolicLink) {
- done(statError);
- return;
- }
- done(null, entry);
- return;
- }
- entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
- done(null, entry);
- });
- };
- }
- function readdir(directory, settings, callback) {
- settings.fs.readdir(directory, (readdirError, names) => {
- if (readdirError !== null) {
- callFailureCallback(callback, readdirError);
- return;
- }
- const tasks = names.map((name) => {
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
- return (done) => {
- fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
- if (error !== null) {
- done(error);
- return;
- }
- const entry = {
- name,
- path,
- dirent: utils.fs.createDirentFromStats(name, stats)
- };
- if (settings.stats) {
- entry.stats = stats;
- }
- done(null, entry);
- });
- };
- });
- rpl(tasks, (rplError, entries) => {
- if (rplError !== null) {
- callFailureCallback(callback, rplError);
- return;
- }
- callSuccessCallback(callback, entries);
- });
- });
- }
- exports2.readdir = readdir;
- function callFailureCallback(callback, error) {
- callback(error);
- }
- function callSuccessCallback(callback, result) {
- callback(null, result);
- }
- }
- });
- var require_sync2 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
- var fsStat = require_out();
- var constants_1 = require_constants3();
- var utils = require_utils5();
- var common = require_common();
- function read(directory, settings) {
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
- return readdirWithFileTypes(directory, settings);
- }
- return readdir(directory, settings);
- }
- exports2.read = read;
- function readdirWithFileTypes(directory, settings) {
- const dirents = settings.fs.readdirSync(directory, {
- withFileTypes: true
- });
- return dirents.map((dirent) => {
- const entry = {
- dirent,
- name: dirent.name,
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
- };
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
- try {
- const stats = settings.fs.statSync(entry.path);
- entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
- } catch (error) {
- if (settings.throwErrorOnBrokenSymbolicLink) {
- throw error;
- }
- }
- }
- return entry;
- });
- }
- exports2.readdirWithFileTypes = readdirWithFileTypes;
- function readdir(directory, settings) {
- const names = settings.fs.readdirSync(directory);
- return names.map((name) => {
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
- const entry = {
- name,
- path: entryPath,
- dirent: utils.fs.createDirentFromStats(name, stats)
- };
- if (settings.stats) {
- entry.stats = stats;
- }
- return entry;
- });
- }
- exports2.readdir = readdir;
- }
- });
- var require_fs4 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
- var fs = require("fs");
- exports2.FILE_SYSTEM_ADAPTER = {
- lstat: fs.lstat,
- stat: fs.stat,
- lstatSync: fs.lstatSync,
- statSync: fs.statSync,
- readdir: fs.readdir,
- readdirSync: fs.readdirSync
- };
- function createFileSystemAdapter(fsMethods) {
- if (fsMethods === void 0) {
- return exports2.FILE_SYSTEM_ADAPTER;
- }
- return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
- }
- exports2.createFileSystemAdapter = createFileSystemAdapter;
- }
- });
- var require_settings2 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var path = require("path");
- var fsStat = require_out();
- var fs = require_fs4();
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
- this.fs = fs.createFileSystemAdapter(this._options.fs);
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
- this.stats = this._getValue(this._options.stats, false);
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
- this.fsStatSettings = new fsStat.Settings({
- followSymbolicLink: this.followSymbolicLinks,
- fs: this.fs,
- throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
- });
- }
- _getValue(option, value) {
- return option !== null && option !== void 0 ? option : value;
- }
- };
- exports2.default = Settings;
- }
- });
- var require_out2 = __commonJS2({
- "node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
- var async = require_async2();
- var sync = require_sync2();
- var settings_1 = require_settings2();
- exports2.Settings = settings_1.default;
- function scandir(path, optionsOrSettingsOrCallback, callback) {
- if (typeof optionsOrSettingsOrCallback === "function") {
- async.read(path, getSettings(), optionsOrSettingsOrCallback);
- return;
- }
- async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
- }
- exports2.scandir = scandir;
- function scandirSync(path, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- return sync.read(path, settings);
- }
- exports2.scandirSync = scandirSync;
- function getSettings(settingsOrOptions = {}) {
- if (settingsOrOptions instanceof settings_1.default) {
- return settingsOrOptions;
- }
- return new settings_1.default(settingsOrOptions);
- }
- }
- });
- var require_reusify = __commonJS2({
- "node_modules/reusify/reusify.js"(exports2, module2) {
- "use strict";
- function reusify(Constructor) {
- var head = new Constructor();
- var tail = head;
- function get() {
- var current = head;
- if (current.next) {
- head = current.next;
- } else {
- head = new Constructor();
- tail = head;
- }
- current.next = null;
- return current;
- }
- function release(obj) {
- tail.next = obj;
- tail = obj;
- }
- return {
- get,
- release
- };
- }
- module2.exports = reusify;
- }
- });
- var require_queue = __commonJS2({
- "node_modules/fastq/queue.js"(exports2, module2) {
- "use strict";
- var reusify = require_reusify();
- function fastqueue(context, worker, concurrency) {
- if (typeof context === "function") {
- concurrency = worker;
- worker = context;
- context = null;
- }
- if (concurrency < 1) {
- throw new Error("fastqueue concurrency must be greater than 1");
- }
- var cache = reusify(Task);
- var queueHead = null;
- var queueTail = null;
- var _running = 0;
- var errorHandler = null;
- var self2 = {
- push,
- drain: noop,
- saturated: noop,
- pause,
- paused: false,
- concurrency,
- running,
- resume,
- idle,
- length,
- getQueue,
- unshift,
- empty: noop,
- kill,
- killAndDrain,
- error
- };
- return self2;
- function running() {
- return _running;
- }
- function pause() {
- self2.paused = true;
- }
- function length() {
- var current = queueHead;
- var counter = 0;
- while (current) {
- current = current.next;
- counter++;
- }
- return counter;
- }
- function getQueue() {
- var current = queueHead;
- var tasks = [];
- while (current) {
- tasks.push(current.value);
- current = current.next;
- }
- return tasks;
- }
- function resume() {
- if (!self2.paused)
- return;
- self2.paused = false;
- for (var i = 0; i < self2.concurrency; i++) {
- _running++;
- release();
- }
- }
- function idle() {
- return _running === 0 && self2.length() === 0;
- }
- function push(value, done) {
- var current = cache.get();
- current.context = context;
- current.release = release;
- current.value = value;
- current.callback = done || noop;
- current.errorHandler = errorHandler;
- if (_running === self2.concurrency || self2.paused) {
- if (queueTail) {
- queueTail.next = current;
- queueTail = current;
- } else {
- queueHead = current;
- queueTail = current;
- self2.saturated();
- }
- } else {
- _running++;
- worker.call(context, current.value, current.worked);
- }
- }
- function unshift(value, done) {
- var current = cache.get();
- current.context = context;
- current.release = release;
- current.value = value;
- current.callback = done || noop;
- if (_running === self2.concurrency || self2.paused) {
- if (queueHead) {
- current.next = queueHead;
- queueHead = current;
- } else {
- queueHead = current;
- queueTail = current;
- self2.saturated();
- }
- } else {
- _running++;
- worker.call(context, current.value, current.worked);
- }
- }
- function release(holder) {
- if (holder) {
- cache.release(holder);
- }
- var next = queueHead;
- if (next) {
- if (!self2.paused) {
- if (queueTail === queueHead) {
- queueTail = null;
- }
- queueHead = next.next;
- next.next = null;
- worker.call(context, next.value, next.worked);
- if (queueTail === null) {
- self2.empty();
- }
- } else {
- _running--;
- }
- } else if (--_running === 0) {
- self2.drain();
- }
- }
- function kill() {
- queueHead = null;
- queueTail = null;
- self2.drain = noop;
- }
- function killAndDrain() {
- queueHead = null;
- queueTail = null;
- self2.drain();
- self2.drain = noop;
- }
- function error(handler) {
- errorHandler = handler;
- }
- }
- function noop() {
- }
- function Task() {
- this.value = null;
- this.callback = noop;
- this.next = null;
- this.release = noop;
- this.context = null;
- this.errorHandler = null;
- var self2 = this;
- this.worked = function worked(err, result) {
- var callback = self2.callback;
- var errorHandler = self2.errorHandler;
- var val = self2.value;
- self2.value = null;
- self2.callback = noop;
- if (self2.errorHandler) {
- errorHandler(err, val);
- }
- callback.call(self2.context, err, result);
- self2.release(self2);
- };
- }
- function queueAsPromised(context, worker, concurrency) {
- if (typeof context === "function") {
- concurrency = worker;
- worker = context;
- context = null;
- }
- function asyncWrapper(arg, cb) {
- worker.call(this, arg).then(function(res) {
- cb(null, res);
- }, cb);
- }
- var queue = fastqueue(context, asyncWrapper, concurrency);
- var pushCb = queue.push;
- var unshiftCb = queue.unshift;
- queue.push = push;
- queue.unshift = unshift;
- queue.drained = drained;
- return queue;
- function push(value) {
- var p = new Promise(function(resolve, reject) {
- pushCb(value, function(err, result) {
- if (err) {
- reject(err);
- return;
- }
- resolve(result);
- });
- });
- p.catch(noop);
- return p;
- }
- function unshift(value) {
- var p = new Promise(function(resolve, reject) {
- unshiftCb(value, function(err, result) {
- if (err) {
- reject(err);
- return;
- }
- resolve(result);
- });
- });
- p.catch(noop);
- return p;
- }
- function drained() {
- var previousDrain = queue.drain;
- var p = new Promise(function(resolve) {
- queue.drain = function() {
- previousDrain();
- resolve();
- };
- });
- return p;
- }
- }
- module2.exports = fastqueue;
- module2.exports.promise = queueAsPromised;
- }
- });
- var require_common2 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
- function isFatalError(settings, error) {
- if (settings.errorFilter === null) {
- return true;
- }
- return !settings.errorFilter(error);
- }
- exports2.isFatalError = isFatalError;
- function isAppliedFilter(filter, value) {
- return filter === null || filter(value);
- }
- exports2.isAppliedFilter = isAppliedFilter;
- function replacePathSegmentSeparator(filepath, separator) {
- return filepath.split(/[/\\]/).join(separator);
- }
- exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;
- function joinPathSegments(a, b, separator) {
- if (a === "") {
- return b;
- }
- if (a.endsWith(separator)) {
- return a + b;
- }
- return a + separator + b;
- }
- exports2.joinPathSegments = joinPathSegments;
- }
- });
- var require_reader = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var common = require_common2();
- var Reader = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
- }
- };
- exports2.default = Reader;
- }
- });
- var require_async3 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var events_1 = require("events");
- var fsScandir = require_out2();
- var fastq = require_queue();
- var common = require_common2();
- var reader_1 = require_reader();
- var AsyncReader = class extends reader_1.default {
- constructor(_root, _settings) {
- super(_root, _settings);
- this._settings = _settings;
- this._scandir = fsScandir.scandir;
- this._emitter = new events_1.EventEmitter();
- this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
- this._isFatalError = false;
- this._isDestroyed = false;
- this._queue.drain = () => {
- if (!this._isFatalError) {
- this._emitter.emit("end");
- }
- };
- }
- read() {
- this._isFatalError = false;
- this._isDestroyed = false;
- setImmediate(() => {
- this._pushToQueue(this._root, this._settings.basePath);
- });
- return this._emitter;
- }
- get isDestroyed() {
- return this._isDestroyed;
- }
- destroy() {
- if (this._isDestroyed) {
- throw new Error("The reader is already destroyed");
- }
- this._isDestroyed = true;
- this._queue.killAndDrain();
- }
- onEntry(callback) {
- this._emitter.on("entry", callback);
- }
- onError(callback) {
- this._emitter.once("error", callback);
- }
- onEnd(callback) {
- this._emitter.once("end", callback);
- }
- _pushToQueue(directory, base) {
- const queueItem = {
- directory,
- base
- };
- this._queue.push(queueItem, (error) => {
- if (error !== null) {
- this._handleError(error);
- }
- });
- }
- _worker(item, done) {
- this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
- if (error !== null) {
- done(error, void 0);
- return;
- }
- for (const entry of entries) {
- this._handleEntry(entry, item.base);
- }
- done(null, void 0);
- });
- }
- _handleError(error) {
- if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
- return;
- }
- this._isFatalError = true;
- this._isDestroyed = true;
- this._emitter.emit("error", error);
- }
- _handleEntry(entry, base) {
- if (this._isDestroyed || this._isFatalError) {
- return;
- }
- const fullpath = entry.path;
- if (base !== void 0) {
- entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
- }
- if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
- this._emitEntry(entry);
- }
- if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
- this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
- }
- }
- _emitEntry(entry) {
- this._emitter.emit("entry", entry);
- }
- };
- exports2.default = AsyncReader;
- }
- });
- var require_async4 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var async_1 = require_async3();
- var AsyncProvider = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._reader = new async_1.default(this._root, this._settings);
- this._storage = [];
- }
- read(callback) {
- this._reader.onError((error) => {
- callFailureCallback(callback, error);
- });
- this._reader.onEntry((entry) => {
- this._storage.push(entry);
- });
- this._reader.onEnd(() => {
- callSuccessCallback(callback, this._storage);
- });
- this._reader.read();
- }
- };
- exports2.default = AsyncProvider;
- function callFailureCallback(callback, error) {
- callback(error);
- }
- function callSuccessCallback(callback, entries) {
- callback(null, entries);
- }
- }
- });
- var require_stream2 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var stream_1 = require("stream");
- var async_1 = require_async3();
- var StreamProvider = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._reader = new async_1.default(this._root, this._settings);
- this._stream = new stream_1.Readable({
- objectMode: true,
- read: () => {
- },
- destroy: () => {
- if (!this._reader.isDestroyed) {
- this._reader.destroy();
- }
- }
- });
- }
- read() {
- this._reader.onError((error) => {
- this._stream.emit("error", error);
- });
- this._reader.onEntry((entry) => {
- this._stream.push(entry);
- });
- this._reader.onEnd(() => {
- this._stream.push(null);
- });
- this._reader.read();
- return this._stream;
- }
- };
- exports2.default = StreamProvider;
- }
- });
- var require_sync3 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var fsScandir = require_out2();
- var common = require_common2();
- var reader_1 = require_reader();
- var SyncReader = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._scandir = fsScandir.scandirSync;
- this._storage = [];
- this._queue = /* @__PURE__ */ new Set();
- }
- read() {
- this._pushToQueue(this._root, this._settings.basePath);
- this._handleQueue();
- return this._storage;
- }
- _pushToQueue(directory, base) {
- this._queue.add({
- directory,
- base
- });
- }
- _handleQueue() {
- for (const item of this._queue.values()) {
- this._handleDirectory(item.directory, item.base);
- }
- }
- _handleDirectory(directory, base) {
- try {
- const entries = this._scandir(directory, this._settings.fsScandirSettings);
- for (const entry of entries) {
- this._handleEntry(entry, base);
- }
- } catch (error) {
- this._handleError(error);
- }
- }
- _handleError(error) {
- if (!common.isFatalError(this._settings, error)) {
- return;
- }
- throw error;
- }
- _handleEntry(entry, base) {
- const fullpath = entry.path;
- if (base !== void 0) {
- entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
- }
- if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
- this._pushToStorage(entry);
- }
- if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
- this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
- }
- }
- _pushToStorage(entry) {
- this._storage.push(entry);
- }
- };
- exports2.default = SyncReader;
- }
- });
- var require_sync4 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var sync_1 = require_sync3();
- var SyncProvider = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._reader = new sync_1.default(this._root, this._settings);
- }
- read() {
- return this._reader.read();
- }
- };
- exports2.default = SyncProvider;
- }
- });
- var require_settings3 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var path = require("path");
- var fsScandir = require_out2();
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.basePath = this._getValue(this._options.basePath, void 0);
- this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
- this.deepFilter = this._getValue(this._options.deepFilter, null);
- this.entryFilter = this._getValue(this._options.entryFilter, null);
- this.errorFilter = this._getValue(this._options.errorFilter, null);
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
- this.fsScandirSettings = new fsScandir.Settings({
- followSymbolicLinks: this._options.followSymbolicLinks,
- fs: this._options.fs,
- pathSegmentSeparator: this._options.pathSegmentSeparator,
- stats: this._options.stats,
- throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
- });
- }
- _getValue(option, value) {
- return option !== null && option !== void 0 ? option : value;
- }
- };
- exports2.default = Settings;
- }
- });
- var require_out3 = __commonJS2({
- "node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
- var async_1 = require_async4();
- var stream_1 = require_stream2();
- var sync_1 = require_sync4();
- var settings_1 = require_settings3();
- exports2.Settings = settings_1.default;
- function walk(directory, optionsOrSettingsOrCallback, callback) {
- if (typeof optionsOrSettingsOrCallback === "function") {
- new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
- return;
- }
- new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
- }
- exports2.walk = walk;
- function walkSync(directory, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- const provider = new sync_1.default(directory, settings);
- return provider.read();
- }
- exports2.walkSync = walkSync;
- function walkStream(directory, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- const provider = new stream_1.default(directory, settings);
- return provider.read();
- }
- exports2.walkStream = walkStream;
- function getSettings(settingsOrOptions = {}) {
- if (settingsOrOptions instanceof settings_1.default) {
- return settingsOrOptions;
- }
- return new settings_1.default(settingsOrOptions);
- }
- }
- });
- var require_reader2 = __commonJS2({
- "node_modules/fast-glob/out/readers/reader.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var path = require("path");
- var fsStat = require_out();
- var utils = require_utils4();
- var Reader = class {
- constructor(_settings) {
- this._settings = _settings;
- this._fsStatSettings = new fsStat.Settings({
- followSymbolicLink: this._settings.followSymbolicLinks,
- fs: this._settings.fs,
- throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
- });
- }
- _getFullEntryPath(filepath) {
- return path.resolve(this._settings.cwd, filepath);
- }
- _makeEntry(stats, pattern) {
- const entry = {
- name: pattern,
- path: pattern,
- dirent: utils.fs.createDirentFromStats(pattern, stats)
- };
- if (this._settings.stats) {
- entry.stats = stats;
- }
- return entry;
- }
- _isFatalError(error) {
- return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
- }
- };
- exports2.default = Reader;
- }
- });
- var require_stream3 = __commonJS2({
- "node_modules/fast-glob/out/readers/stream.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var stream_1 = require("stream");
- var fsStat = require_out();
- var fsWalk = require_out3();
- var reader_1 = require_reader2();
- var ReaderStream = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._walkStream = fsWalk.walkStream;
- this._stat = fsStat.stat;
- }
- dynamic(root, options) {
- return this._walkStream(root, options);
- }
- static(patterns, options) {
- const filepaths = patterns.map(this._getFullEntryPath, this);
- const stream = new stream_1.PassThrough({
- objectMode: true
- });
- stream._write = (index, _enc, done) => {
- return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
- if (entry !== null && options.entryFilter(entry)) {
- stream.push(entry);
- }
- if (index === filepaths.length - 1) {
- stream.end();
- }
- done();
- }).catch(done);
- };
- for (let i = 0; i < filepaths.length; i++) {
- stream.write(i);
- }
- return stream;
- }
- _getEntry(filepath, pattern, options) {
- return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
- if (options.errorFilter(error)) {
- return null;
- }
- throw error;
- });
- }
- _getStat(filepath) {
- return new Promise((resolve, reject) => {
- this._stat(filepath, this._fsStatSettings, (error, stats) => {
- return error === null ? resolve(stats) : reject(error);
- });
- });
- }
- };
- exports2.default = ReaderStream;
- }
- });
- var require_async5 = __commonJS2({
- "node_modules/fast-glob/out/readers/async.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var fsWalk = require_out3();
- var reader_1 = require_reader2();
- var stream_1 = require_stream3();
- var ReaderAsync = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._walkAsync = fsWalk.walk;
- this._readerStream = new stream_1.default(this._settings);
- }
- dynamic(root, options) {
- return new Promise((resolve, reject) => {
- this._walkAsync(root, options, (error, entries) => {
- if (error === null) {
- resolve(entries);
- } else {
- reject(error);
- }
- });
- });
- }
- async static(patterns, options) {
- const entries = [];
- const stream = this._readerStream.static(patterns, options);
- return new Promise((resolve, reject) => {
- stream.once("error", reject);
- stream.on("data", (entry) => entries.push(entry));
- stream.once("end", () => resolve(entries));
- });
- }
- };
- exports2.default = ReaderAsync;
- }
- });
- var require_matcher = __commonJS2({
- "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var utils = require_utils4();
- var Matcher = class {
- constructor(_patterns, _settings, _micromatchOptions) {
- this._patterns = _patterns;
- this._settings = _settings;
- this._micromatchOptions = _micromatchOptions;
- this._storage = [];
- this._fillStorage();
- }
- _fillStorage() {
- const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
- for (const pattern of patterns) {
- const segments = this._getPatternSegments(pattern);
- const sections = this._splitSegmentsIntoSections(segments);
- this._storage.push({
- complete: sections.length <= 1,
- pattern,
- segments,
- sections
- });
- }
- }
- _getPatternSegments(pattern) {
- const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
- return parts.map((part) => {
- const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
- if (!dynamic) {
- return {
- dynamic: false,
- pattern: part
- };
- }
- return {
- dynamic: true,
- pattern: part,
- patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
- };
- });
- }
- _splitSegmentsIntoSections(segments) {
- return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
- }
- };
- exports2.default = Matcher;
- }
- });
- var require_partial = __commonJS2({
- "node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var matcher_1 = require_matcher();
- var PartialMatcher = class extends matcher_1.default {
- match(filepath) {
- const parts = filepath.split("/");
- const levels = parts.length;
- const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
- for (const pattern of patterns) {
- const section = pattern.sections[0];
- if (!pattern.complete && levels > section.length) {
- return true;
- }
- const match = parts.every((part, index) => {
- const segment = pattern.segments[index];
- if (segment.dynamic && segment.patternRe.test(part)) {
- return true;
- }
- if (!segment.dynamic && segment.pattern === part) {
- return true;
- }
- return false;
- });
- if (match) {
- return true;
- }
- }
- return false;
- }
- };
- exports2.default = PartialMatcher;
- }
- });
- var require_deep = __commonJS2({
- "node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var utils = require_utils4();
- var partial_1 = require_partial();
- var DeepFilter = class {
- constructor(_settings, _micromatchOptions) {
- this._settings = _settings;
- this._micromatchOptions = _micromatchOptions;
- }
- getFilter(basePath, positive, negative) {
- const matcher = this._getMatcher(positive);
- const negativeRe = this._getNegativePatternsRe(negative);
- return (entry) => this._filter(basePath, entry, matcher, negativeRe);
- }
- _getMatcher(patterns) {
- return new partial_1.default(patterns, this._settings, this._micromatchOptions);
- }
- _getNegativePatternsRe(patterns) {
- const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
- return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
- }
- _filter(basePath, entry, matcher, negativeRe) {
- if (this._isSkippedByDeep(basePath, entry.path)) {
- return false;
- }
- if (this._isSkippedSymbolicLink(entry)) {
- return false;
- }
- const filepath = utils.path.removeLeadingDotSegment(entry.path);
- if (this._isSkippedByPositivePatterns(filepath, matcher)) {
- return false;
- }
- return this._isSkippedByNegativePatterns(filepath, negativeRe);
- }
- _isSkippedByDeep(basePath, entryPath) {
- if (this._settings.deep === Infinity) {
- return false;
- }
- return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
- }
- _getEntryLevel(basePath, entryPath) {
- const entryPathDepth = entryPath.split("/").length;
- if (basePath === "") {
- return entryPathDepth;
- }
- const basePathDepth = basePath.split("/").length;
- return entryPathDepth - basePathDepth;
- }
- _isSkippedSymbolicLink(entry) {
- return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
- }
- _isSkippedByPositivePatterns(entryPath, matcher) {
- return !this._settings.baseNameMatch && !matcher.match(entryPath);
- }
- _isSkippedByNegativePatterns(entryPath, patternsRe) {
- return !utils.pattern.matchAny(entryPath, patternsRe);
- }
- };
- exports2.default = DeepFilter;
- }
- });
- var require_entry = __commonJS2({
- "node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var utils = require_utils4();
- var EntryFilter = class {
- constructor(_settings, _micromatchOptions) {
- this._settings = _settings;
- this._micromatchOptions = _micromatchOptions;
- this.index = /* @__PURE__ */ new Map();
- }
- getFilter(positive, negative) {
- const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
- const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
- return (entry) => this._filter(entry, positiveRe, negativeRe);
- }
- _filter(entry, positiveRe, negativeRe) {
- if (this._settings.unique && this._isDuplicateEntry(entry)) {
- return false;
- }
- if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
- return false;
- }
- if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
- return false;
- }
- const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
- const isDirectory = entry.dirent.isDirectory();
- const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
- if (this._settings.unique && isMatched) {
- this._createIndexRecord(entry);
- }
- return isMatched;
- }
- _isDuplicateEntry(entry) {
- return this.index.has(entry.path);
- }
- _createIndexRecord(entry) {
- this.index.set(entry.path, void 0);
- }
- _onlyFileFilter(entry) {
- return this._settings.onlyFiles && !entry.dirent.isFile();
- }
- _onlyDirectoryFilter(entry) {
- return this._settings.onlyDirectories && !entry.dirent.isDirectory();
- }
- _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
- if (!this._settings.absolute) {
- return false;
- }
- const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
- return utils.pattern.matchAny(fullpath, patternsRe);
- }
- _isMatchToPatterns(entryPath, patternsRe, isDirectory) {
- const filepath = utils.path.removeLeadingDotSegment(entryPath);
- const isMatched = utils.pattern.matchAny(filepath, patternsRe);
- if (!isMatched && isDirectory) {
- return utils.pattern.matchAny(filepath + "/", patternsRe);
- }
- return isMatched;
- }
- };
- exports2.default = EntryFilter;
- }
- });
- var require_error = __commonJS2({
- "node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var utils = require_utils4();
- var ErrorFilter = class {
- constructor(_settings) {
- this._settings = _settings;
- }
- getFilter() {
- return (error) => this._isNonFatalError(error);
- }
- _isNonFatalError(error) {
- return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
- }
- };
- exports2.default = ErrorFilter;
- }
- });
- var require_entry2 = __commonJS2({
- "node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var utils = require_utils4();
- var EntryTransformer = class {
- constructor(_settings) {
- this._settings = _settings;
- }
- getTransformer() {
- return (entry) => this._transform(entry);
- }
- _transform(entry) {
- let filepath = entry.path;
- if (this._settings.absolute) {
- filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
- filepath = utils.path.unixify(filepath);
- }
- if (this._settings.markDirectories && entry.dirent.isDirectory()) {
- filepath += "/";
- }
- if (!this._settings.objectMode) {
- return filepath;
- }
- return Object.assign(Object.assign({}, entry), {
- path: filepath
- });
- }
- };
- exports2.default = EntryTransformer;
- }
- });
- var require_provider = __commonJS2({
- "node_modules/fast-glob/out/providers/provider.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var path = require("path");
- var deep_1 = require_deep();
- var entry_1 = require_entry();
- var error_1 = require_error();
- var entry_2 = require_entry2();
- var Provider = class {
- constructor(_settings) {
- this._settings = _settings;
- this.errorFilter = new error_1.default(this._settings);
- this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
- this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
- this.entryTransformer = new entry_2.default(this._settings);
- }
- _getRootDirectory(task) {
- return path.resolve(this._settings.cwd, task.base);
- }
- _getReaderOptions(task) {
- const basePath = task.base === "." ? "" : task.base;
- return {
- basePath,
- pathSegmentSeparator: "/",
- concurrency: this._settings.concurrency,
- deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
- entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
- errorFilter: this.errorFilter.getFilter(),
- followSymbolicLinks: this._settings.followSymbolicLinks,
- fs: this._settings.fs,
- stats: this._settings.stats,
- throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
- transform: this.entryTransformer.getTransformer()
- };
- }
- _getMicromatchOptions() {
- return {
- dot: this._settings.dot,
- matchBase: this._settings.baseNameMatch,
- nobrace: !this._settings.braceExpansion,
- nocase: !this._settings.caseSensitiveMatch,
- noext: !this._settings.extglob,
- noglobstar: !this._settings.globstar,
- posix: true,
- strictSlashes: false
- };
- }
- };
- exports2.default = Provider;
- }
- });
- var require_async6 = __commonJS2({
- "node_modules/fast-glob/out/providers/async.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var async_1 = require_async5();
- var provider_1 = require_provider();
- var ProviderAsync = class extends provider_1.default {
- constructor() {
- super(...arguments);
- this._reader = new async_1.default(this._settings);
- }
- async read(task) {
- const root = this._getRootDirectory(task);
- const options = this._getReaderOptions(task);
- const entries = await this.api(root, task, options);
- return entries.map((entry) => options.transform(entry));
- }
- api(root, task, options) {
- if (task.dynamic) {
- return this._reader.dynamic(root, options);
- }
- return this._reader.static(task.patterns, options);
- }
- };
- exports2.default = ProviderAsync;
- }
- });
- var require_stream4 = __commonJS2({
- "node_modules/fast-glob/out/providers/stream.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var stream_1 = require("stream");
- var stream_2 = require_stream3();
- var provider_1 = require_provider();
- var ProviderStream = class extends provider_1.default {
- constructor() {
- super(...arguments);
- this._reader = new stream_2.default(this._settings);
- }
- read(task) {
- const root = this._getRootDirectory(task);
- const options = this._getReaderOptions(task);
- const source = this.api(root, task, options);
- const destination = new stream_1.Readable({
- objectMode: true,
- read: () => {
- }
- });
- source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
- destination.once("close", () => source.destroy());
- return destination;
- }
- api(root, task, options) {
- if (task.dynamic) {
- return this._reader.dynamic(root, options);
- }
- return this._reader.static(task.patterns, options);
- }
- };
- exports2.default = ProviderStream;
- }
- });
- var require_sync5 = __commonJS2({
- "node_modules/fast-glob/out/readers/sync.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var fsStat = require_out();
- var fsWalk = require_out3();
- var reader_1 = require_reader2();
- var ReaderSync = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._walkSync = fsWalk.walkSync;
- this._statSync = fsStat.statSync;
- }
- dynamic(root, options) {
- return this._walkSync(root, options);
- }
- static(patterns, options) {
- const entries = [];
- for (const pattern of patterns) {
- const filepath = this._getFullEntryPath(pattern);
- const entry = this._getEntry(filepath, pattern, options);
- if (entry === null || !options.entryFilter(entry)) {
- continue;
- }
- entries.push(entry);
- }
- return entries;
- }
- _getEntry(filepath, pattern, options) {
- try {
- const stats = this._getStat(filepath);
- return this._makeEntry(stats, pattern);
- } catch (error) {
- if (options.errorFilter(error)) {
- return null;
- }
- throw error;
- }
- }
- _getStat(filepath) {
- return this._statSync(filepath, this._fsStatSettings);
- }
- };
- exports2.default = ReaderSync;
- }
- });
- var require_sync6 = __commonJS2({
- "node_modules/fast-glob/out/providers/sync.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var sync_1 = require_sync5();
- var provider_1 = require_provider();
- var ProviderSync = class extends provider_1.default {
- constructor() {
- super(...arguments);
- this._reader = new sync_1.default(this._settings);
- }
- read(task) {
- const root = this._getRootDirectory(task);
- const options = this._getReaderOptions(task);
- const entries = this.api(root, task, options);
- return entries.map(options.transform);
- }
- api(root, task, options) {
- if (task.dynamic) {
- return this._reader.dynamic(root, options);
- }
- return this._reader.static(task.patterns, options);
- }
- };
- exports2.default = ProviderSync;
- }
- });
- var require_settings4 = __commonJS2({
- "node_modules/fast-glob/out/settings.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
- var fs = require("fs");
- var os2 = require("os");
- var CPU_COUNT = Math.max(os2.cpus().length, 1);
- exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
- lstat: fs.lstat,
- lstatSync: fs.lstatSync,
- stat: fs.stat,
- statSync: fs.statSync,
- readdir: fs.readdir,
- readdirSync: fs.readdirSync
- };
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.absolute = this._getValue(this._options.absolute, false);
- this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
- this.braceExpansion = this._getValue(this._options.braceExpansion, true);
- this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
- this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
- this.cwd = this._getValue(this._options.cwd, process.cwd());
- this.deep = this._getValue(this._options.deep, Infinity);
- this.dot = this._getValue(this._options.dot, false);
- this.extglob = this._getValue(this._options.extglob, true);
- this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
- this.fs = this._getFileSystemMethods(this._options.fs);
- this.globstar = this._getValue(this._options.globstar, true);
- this.ignore = this._getValue(this._options.ignore, []);
- this.markDirectories = this._getValue(this._options.markDirectories, false);
- this.objectMode = this._getValue(this._options.objectMode, false);
- this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
- this.onlyFiles = this._getValue(this._options.onlyFiles, true);
- this.stats = this._getValue(this._options.stats, false);
- this.suppressErrors = this._getValue(this._options.suppressErrors, false);
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
- this.unique = this._getValue(this._options.unique, true);
- if (this.onlyDirectories) {
- this.onlyFiles = false;
- }
- if (this.stats) {
- this.objectMode = true;
- }
- }
- _getValue(option, value) {
- return option === void 0 ? value : option;
- }
- _getFileSystemMethods(methods = {}) {
- return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
- }
- };
- exports2.default = Settings;
- }
- });
- var require_out4 = __commonJS2({
- "node_modules/fast-glob/out/index.js"(exports2, module2) {
- "use strict";
- var taskManager = require_tasks();
- var patternManager = require_patterns();
- var async_1 = require_async6();
- var stream_1 = require_stream4();
- var sync_1 = require_sync6();
- var settings_1 = require_settings4();
- var utils = require_utils4();
- async function FastGlob(source, options) {
- assertPatternsInput(source);
- const works = getWorks(source, async_1.default, options);
- const result = await Promise.all(works);
- return utils.array.flatten(result);
- }
- (function(FastGlob2) {
- function sync(source, options) {
- assertPatternsInput(source);
- const works = getWorks(source, sync_1.default, options);
- return utils.array.flatten(works);
- }
- FastGlob2.sync = sync;
- function stream(source, options) {
- assertPatternsInput(source);
- const works = getWorks(source, stream_1.default, options);
- return utils.stream.merge(works);
- }
- FastGlob2.stream = stream;
- function generateTasks(source, options) {
- assertPatternsInput(source);
- const patterns = patternManager.transform([].concat(source));
- const settings = new settings_1.default(options);
- return taskManager.generate(patterns, settings);
- }
- FastGlob2.generateTasks = generateTasks;
- function isDynamicPattern(source, options) {
- assertPatternsInput(source);
- const settings = new settings_1.default(options);
- return utils.pattern.isDynamicPattern(source, settings);
- }
- FastGlob2.isDynamicPattern = isDynamicPattern;
- function escapePath(source) {
- assertPatternsInput(source);
- return utils.path.escape(source);
- }
- FastGlob2.escapePath = escapePath;
- })(FastGlob || (FastGlob = {}));
- function getWorks(source, _Provider, options) {
- const patterns = patternManager.transform([].concat(source));
- const settings = new settings_1.default(options);
- const tasks = taskManager.generate(patterns, settings);
- const provider = new _Provider(settings);
- return tasks.map(provider.read, provider);
- }
- function assertPatternsInput(input) {
- const source = [].concat(input);
- const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
- if (!isValidSource) {
- throw new TypeError("Patterns must be a string (non empty) or an array of strings");
- }
- }
- module2.exports = FastGlob;
- }
- });
- var require_expand_patterns = __commonJS2({
- "src/cli/expand-patterns.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var fastGlob = require_out4();
- var {
- statSafe
- } = require_utils();
- async function* expandPatterns(context) {
- const cwd = process.cwd();
- const seen = /* @__PURE__ */ new Set();
- let noResults = true;
- for await (const pathOrError of expandPatternsInternal(context)) {
- noResults = false;
- if (typeof pathOrError !== "string") {
- yield pathOrError;
- continue;
- }
- const relativePath = path.relative(cwd, pathOrError);
- if (seen.has(relativePath)) {
- continue;
- }
- seen.add(relativePath);
- yield relativePath;
- }
- if (noResults && context.argv.errorOnUnmatchedPattern !== false) {
- yield {
- error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`
- };
- }
- }
- async function* expandPatternsInternal(context) {
- const silentlyIgnoredDirs = [".git", ".sl", ".svn", ".hg"];
- if (context.argv.withNodeModules !== true) {
- silentlyIgnoredDirs.push("node_modules");
- }
- const globOptions = {
- dot: true,
- ignore: silentlyIgnoredDirs.map((dir) => "**/" + dir)
- };
- let supportedFilesGlob;
- const cwd = process.cwd();
- const entries = [];
- for (const pattern of context.filePatterns) {
- const absolutePath = path.resolve(cwd, pattern);
- if (containsIgnoredPathSegment(absolutePath, cwd, silentlyIgnoredDirs)) {
- continue;
- }
- const stat = await statSafe(absolutePath);
- if (stat) {
- if (stat.isFile()) {
- entries.push({
- type: "file",
- glob: escapePathForGlob(fixWindowsSlashes(pattern)),
- input: pattern
- });
- } else if (stat.isDirectory()) {
- const relativePath = path.relative(cwd, absolutePath) || ".";
- entries.push({
- type: "dir",
- glob: escapePathForGlob(fixWindowsSlashes(relativePath)) + "/" + getSupportedFilesGlob(),
- input: pattern
- });
- }
- } else if (pattern[0] === "!") {
- globOptions.ignore.push(fixWindowsSlashes(pattern.slice(1)));
- } else {
- entries.push({
- type: "glob",
- glob: fixWindowsSlashes(pattern),
- input: pattern
- });
- }
- }
- for (const {
- type,
- glob,
- input
- } of entries) {
- let result;
- try {
- result = await fastGlob(glob, globOptions);
- } catch ({
- message
- }) {
- yield {
- error: `${errorMessages.globError[type]}: ${input}
- ${message}`
- };
- continue;
- }
- if (result.length === 0) {
- if (context.argv.errorOnUnmatchedPattern !== false) {
- yield {
- error: `${errorMessages.emptyResults[type]}: "${input}".`
- };
- }
- } else {
- yield* sortPaths(result);
- }
- }
- function getSupportedFilesGlob() {
- if (!supportedFilesGlob) {
- const extensions = context.languages.flatMap((lang) => lang.extensions || []);
- const filenames = context.languages.flatMap((lang) => lang.filenames || []);
- supportedFilesGlob = `**/{${[...extensions.map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)), ...filenames]}}`;
- }
- return supportedFilesGlob;
- }
- }
- var errorMessages = {
- globError: {
- file: "Unable to resolve file",
- dir: "Unable to expand directory",
- glob: "Unable to expand glob pattern"
- },
- emptyResults: {
- file: "Explicitly specified file was ignored due to negative glob patterns",
- dir: "No supported files were found in the directory",
- glob: "No files matching the pattern were found"
- }
- };
- function containsIgnoredPathSegment(absolutePath, cwd, ignoredDirectories) {
- return path.relative(cwd, absolutePath).split(path.sep).some((dir) => ignoredDirectories.includes(dir));
- }
- function sortPaths(paths) {
- return paths.sort((a, b) => a.localeCompare(b));
- }
- function escapePathForGlob(path2) {
- return fastGlob.escapePath(path2.replace(/\\/g, "\0")).replace(/\\!/g, "@(!)").replace(/\0/g, "@(\\\\)");
- }
- var isWindows = path.sep === "\\";
- function fixWindowsSlashes(pattern) {
- return isWindows ? pattern.replace(/\\/g, "/") : pattern;
- }
- module2.exports = {
- expandPatterns,
- fixWindowsSlashes
- };
- }
- });
- var require_get_options_for_file = __commonJS2({
- "src/cli/options/get-options-for-file.js"(exports2, module2) {
- "use strict";
- var dashify = require_dashify();
- var prettier2 = require("./index.js");
- var {
- optionsNormalizer
- } = require_prettier_internal();
- var minimist = require_minimist2();
- var createMinimistOptions = require_create_minimist_options();
- var normalizeCliOptions = require_normalize_cli_options();
- function getOptions(argv, detailedOptions) {
- return Object.fromEntries(detailedOptions.filter(({
- forwardToApi
- }) => forwardToApi).map(({
- forwardToApi,
- name
- }) => [forwardToApi, argv[name]]));
- }
- function cliifyOptions(object, apiDetailedOptionMap) {
- return Object.fromEntries(Object.entries(object || {}).map(([key, value]) => {
- const apiOption = apiDetailedOptionMap[key];
- const cliKey = apiOption ? apiOption.name : key;
- return [dashify(cliKey), value];
- }));
- }
- function createApiDetailedOptionMap(detailedOptions) {
- return Object.fromEntries(detailedOptions.filter((option) => option.forwardToApi && option.forwardToApi !== option.name).map((option) => [option.forwardToApi, option]));
- }
- function parseArgsToOptions(context, overrideDefaults) {
- const minimistOptions = createMinimistOptions(context.detailedOptions);
- const apiDetailedOptionMap = createApiDetailedOptionMap(context.detailedOptions);
- return getOptions(normalizeCliOptions(minimist(context.rawArguments, {
- string: minimistOptions.string,
- boolean: minimistOptions.boolean,
- default: cliifyOptions(overrideDefaults, apiDetailedOptionMap)
- }), context.detailedOptions, {
- logger: false
- }), context.detailedOptions);
- }
- async function getOptionsOrDie(context, filePath) {
- try {
- if (context.argv.config === false) {
- context.logger.debug("'--no-config' option found, skip loading config file.");
- return null;
- }
- context.logger.debug(context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'`);
- const options = await prettier2.resolveConfig(filePath, {
- editorconfig: context.argv.editorconfig,
- config: context.argv.config
- });
- context.logger.debug("loaded options `" + JSON.stringify(options) + "`");
- return options;
- } catch (error) {
- context.logger.error(`Invalid configuration file \`${filePath}\`: ` + error.message);
- process.exit(2);
- }
- }
- function applyConfigPrecedence(context, options) {
- try {
- switch (context.argv.configPrecedence) {
- case "cli-override":
- return parseArgsToOptions(context, options);
- case "file-override":
- return Object.assign(Object.assign({}, parseArgsToOptions(context)), options);
- case "prefer-file":
- return options || parseArgsToOptions(context);
- }
- } catch (error) {
- context.logger.error(error.toString());
- process.exit(2);
- }
- }
- async function getOptionsForFile(context, filepath) {
- const options = await getOptionsOrDie(context, filepath);
- const hasPlugins = options && options.plugins;
- if (hasPlugins) {
- context.pushContextPlugins(options.plugins);
- }
- const appliedOptions = Object.assign({
- filepath
- }, applyConfigPrecedence(context, options && optionsNormalizer.normalizeApiOptions(options, context.supportOptions, {
- logger: context.logger
- })));
- context.logger.debug(`applied config-precedence (${context.argv.configPrecedence}): ${JSON.stringify(appliedOptions)}`);
- if (hasPlugins) {
- context.popContextPlugins();
- }
- return appliedOptions;
- }
- module2.exports = getOptionsForFile;
- }
- });
- var require_is_tty = __commonJS2({
- "src/cli/is-tty.js"(exports2, module2) {
- "use strict";
- var {
- isCI
- } = require("./third-party.js");
- module2.exports = function isTTY() {
- return process.stdout.isTTY && !isCI();
- };
- }
- });
- var require_commondir = __commonJS2({
- "node_modules/commondir/index.js"(exports2, module2) {
- var path = require("path");
- module2.exports = function(basedir, relfiles) {
- if (relfiles) {
- var files = relfiles.map(function(r) {
- return path.resolve(basedir, r);
- });
- } else {
- var files = basedir;
- }
- var res = files.slice(1).reduce(function(ps, file) {
- if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
- throw new Error("relative path without a basedir");
- }
- var xs = file.split(/\/+|\\+/);
- for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++)
- ;
- return ps.slice(0, i);
- }, files[0].split(/\/+|\\+/));
- return res.length > 1 ? res.join("/") : "/";
- };
- }
- });
- var require_p_try = __commonJS2({
- "node_modules/p-try/index.js"(exports2, module2) {
- "use strict";
- var pTry = (fn, ...arguments_) => new Promise((resolve) => {
- resolve(fn(...arguments_));
- });
- module2.exports = pTry;
- module2.exports.default = pTry;
- }
- });
- var require_p_limit = __commonJS2({
- "node_modules/pkg-dir/node_modules/p-limit/index.js"(exports2, module2) {
- "use strict";
- var pTry = require_p_try();
- var pLimit = (concurrency) => {
- if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
- return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
- }
- const queue = [];
- let activeCount = 0;
- const next = () => {
- activeCount--;
- if (queue.length > 0) {
- queue.shift()();
- }
- };
- const run2 = (fn, resolve, ...args) => {
- activeCount++;
- const result = pTry(fn, ...args);
- resolve(result);
- result.then(next, next);
- };
- const enqueue = (fn, resolve, ...args) => {
- if (activeCount < concurrency) {
- run2(fn, resolve, ...args);
- } else {
- queue.push(run2.bind(null, fn, resolve, ...args));
- }
- };
- const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
- Object.defineProperties(generator, {
- activeCount: {
- get: () => activeCount
- },
- pendingCount: {
- get: () => queue.length
- },
- clearQueue: {
- value: () => {
- queue.length = 0;
- }
- }
- });
- return generator;
- };
- module2.exports = pLimit;
- module2.exports.default = pLimit;
- }
- });
- var require_p_locate = __commonJS2({
- "node_modules/pkg-dir/node_modules/p-locate/index.js"(exports2, module2) {
- "use strict";
- var pLimit = require_p_limit();
- var EndError = class extends Error {
- constructor(value) {
- super();
- this.value = value;
- }
- };
- var testElement = async (element, tester) => tester(await element);
- var finder = async (element) => {
- const values = await Promise.all(element);
- if (values[1] === true) {
- throw new EndError(values[0]);
- }
- return false;
- };
- var pLocate = async (iterable, tester, options) => {
- options = Object.assign({
- concurrency: Infinity,
- preserveOrder: true
- }, options);
- const limit = pLimit(options.concurrency);
- const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
- const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
- try {
- await Promise.all(items.map((element) => checkLimit(finder, element)));
- } catch (error) {
- if (error instanceof EndError) {
- return error.value;
- }
- throw error;
- }
- };
- module2.exports = pLocate;
- module2.exports.default = pLocate;
- }
- });
- var require_locate_path = __commonJS2({
- "node_modules/pkg-dir/node_modules/locate-path/index.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var fs = require("fs");
- var {
- promisify
- } = require("util");
- var pLocate = require_p_locate();
- var fsStat = promisify(fs.stat);
- var fsLStat = promisify(fs.lstat);
- var typeMappings = {
- directory: "isDirectory",
- file: "isFile"
- };
- function checkType({
- type
- }) {
- if (type in typeMappings) {
- return;
- }
- throw new Error(`Invalid type specified: ${type}`);
- }
- var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
- module2.exports = async (paths, options) => {
- options = Object.assign({
- cwd: process.cwd(),
- type: "file",
- allowSymlinks: true
- }, options);
- checkType(options);
- const statFn = options.allowSymlinks ? fsStat : fsLStat;
- return pLocate(paths, async (path_) => {
- try {
- const stat = await statFn(path.resolve(options.cwd, path_));
- return matchType(options.type, stat);
- } catch (_) {
- return false;
- }
- }, options);
- };
- module2.exports.sync = (paths, options) => {
- options = Object.assign({
- cwd: process.cwd(),
- allowSymlinks: true,
- type: "file"
- }, options);
- checkType(options);
- const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
- for (const path_ of paths) {
- try {
- const stat = statFn(path.resolve(options.cwd, path_));
- if (matchType(options.type, stat)) {
- return path_;
- }
- } catch (_) {
- }
- }
- };
- }
- });
- var require_path_exists = __commonJS2({
- "node_modules/path-exists/index.js"(exports2, module2) {
- "use strict";
- var fs = require("fs");
- var {
- promisify
- } = require("util");
- var pAccess = promisify(fs.access);
- module2.exports = async (path) => {
- try {
- await pAccess(path);
- return true;
- } catch (_) {
- return false;
- }
- };
- module2.exports.sync = (path) => {
- try {
- fs.accessSync(path);
- return true;
- } catch (_) {
- return false;
- }
- };
- }
- });
- var require_find_up = __commonJS2({
- "node_modules/pkg-dir/node_modules/find-up/index.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var locatePath = require_locate_path();
- var pathExists = require_path_exists();
- var stop = Symbol("findUp.stop");
- module2.exports = async (name, options = {}) => {
- let directory = path.resolve(options.cwd || "");
- const {
- root
- } = path.parse(directory);
- const paths = [].concat(name);
- const runMatcher = async (locateOptions) => {
- if (typeof name !== "function") {
- return locatePath(paths, locateOptions);
- }
- const foundPath = await name(locateOptions.cwd);
- if (typeof foundPath === "string") {
- return locatePath([foundPath], locateOptions);
- }
- return foundPath;
- };
- while (true) {
- const foundPath = await runMatcher(Object.assign(Object.assign({}, options), {}, {
- cwd: directory
- }));
- if (foundPath === stop) {
- return;
- }
- if (foundPath) {
- return path.resolve(directory, foundPath);
- }
- if (directory === root) {
- return;
- }
- directory = path.dirname(directory);
- }
- };
- module2.exports.sync = (name, options = {}) => {
- let directory = path.resolve(options.cwd || "");
- const {
- root
- } = path.parse(directory);
- const paths = [].concat(name);
- const runMatcher = (locateOptions) => {
- if (typeof name !== "function") {
- return locatePath.sync(paths, locateOptions);
- }
- const foundPath = name(locateOptions.cwd);
- if (typeof foundPath === "string") {
- return locatePath.sync([foundPath], locateOptions);
- }
- return foundPath;
- };
- while (true) {
- const foundPath = runMatcher(Object.assign(Object.assign({}, options), {}, {
- cwd: directory
- }));
- if (foundPath === stop) {
- return;
- }
- if (foundPath) {
- return path.resolve(directory, foundPath);
- }
- if (directory === root) {
- return;
- }
- directory = path.dirname(directory);
- }
- };
- module2.exports.exists = pathExists;
- module2.exports.sync.exists = pathExists.sync;
- module2.exports.stop = stop;
- }
- });
- var require_pkg_dir = __commonJS2({
- "node_modules/pkg-dir/index.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var findUp = require_find_up();
- var pkgDir = async (cwd) => {
- const filePath = await findUp("package.json", {
- cwd
- });
- return filePath && path.dirname(filePath);
- };
- module2.exports = pkgDir;
- module2.exports.default = pkgDir;
- module2.exports.sync = (cwd) => {
- const filePath = findUp.sync("package.json", {
- cwd
- });
- return filePath && path.dirname(filePath);
- };
- }
- });
- var require_semver = __commonJS2({
- "node_modules/make-dir/node_modules/semver/semver.js"(exports2, module2) {
- exports2 = module2.exports = SemVer;
- var debug;
- if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
- debug = function() {
- var args = Array.prototype.slice.call(arguments, 0);
- args.unshift("SEMVER");
- console.log.apply(console, args);
- };
- } else {
- debug = function() {
- };
- }
- exports2.SEMVER_SPEC_VERSION = "2.0.0";
- var MAX_LENGTH = 256;
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
- var MAX_SAFE_COMPONENT_LENGTH = 16;
- var re = exports2.re = [];
- var src = exports2.src = [];
- var t = exports2.tokens = {};
- var R = 0;
- function tok(n) {
- t[n] = R++;
- }
- tok("NUMERICIDENTIFIER");
- src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
- tok("NUMERICIDENTIFIERLOOSE");
- src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+";
- tok("NONNUMERICIDENTIFIER");
- src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
- tok("MAINVERSION");
- src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
- tok("MAINVERSIONLOOSE");
- src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
- tok("PRERELEASEIDENTIFIER");
- src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
- tok("PRERELEASEIDENTIFIERLOOSE");
- src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
- tok("PRERELEASE");
- src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
- tok("PRERELEASELOOSE");
- src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
- tok("BUILDIDENTIFIER");
- src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+";
- tok("BUILD");
- src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
- tok("FULL");
- tok("FULLPLAIN");
- src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
- src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
- tok("LOOSEPLAIN");
- src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
- tok("LOOSE");
- src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
- tok("GTLT");
- src[t.GTLT] = "((?:<|>)?=?)";
- tok("XRANGEIDENTIFIERLOOSE");
- src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
- tok("XRANGEIDENTIFIER");
- src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
- tok("XRANGEPLAIN");
- src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
- tok("XRANGEPLAINLOOSE");
- src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
- tok("XRANGE");
- src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
- tok("XRANGELOOSE");
- src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
- tok("COERCE");
- src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
- tok("COERCERTL");
- re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
- tok("LONETILDE");
- src[t.LONETILDE] = "(?:~>?)";
- tok("TILDETRIM");
- src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
- re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
- var tildeTrimReplace = "$1~";
- tok("TILDE");
- src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
- tok("TILDELOOSE");
- src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
- tok("LONECARET");
- src[t.LONECARET] = "(?:\\^)";
- tok("CARETTRIM");
- src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
- re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
- var caretTrimReplace = "$1^";
- tok("CARET");
- src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
- tok("CARETLOOSE");
- src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
- tok("COMPARATORLOOSE");
- src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
- tok("COMPARATOR");
- src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
- tok("COMPARATORTRIM");
- src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
- re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
- var comparatorTrimReplace = "$1$2$3";
- tok("HYPHENRANGE");
- src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
- tok("HYPHENRANGELOOSE");
- src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
- tok("STAR");
- src[t.STAR] = "(<|>)?=?\\s*\\*";
- for (i = 0; i < R; i++) {
- debug(i, src[i]);
- if (!re[i]) {
- re[i] = new RegExp(src[i]);
- }
- }
- var i;
- exports2.parse = parse;
- function parse(version, options) {
- if (!options || typeof options !== "object") {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (version instanceof SemVer) {
- return version;
- }
- if (typeof version !== "string") {
- return null;
- }
- if (version.length > MAX_LENGTH) {
- return null;
- }
- var r = options.loose ? re[t.LOOSE] : re[t.FULL];
- if (!r.test(version)) {
- return null;
- }
- try {
- return new SemVer(version, options);
- } catch (er) {
- return null;
- }
- }
- exports2.valid = valid;
- function valid(version, options) {
- var v = parse(version, options);
- return v ? v.version : null;
- }
- exports2.clean = clean;
- function clean(version, options) {
- var s = parse(version.trim().replace(/^[=v]+/, ""), options);
- return s ? s.version : null;
- }
- exports2.SemVer = SemVer;
- function SemVer(version, options) {
- if (!options || typeof options !== "object") {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (version instanceof SemVer) {
- if (version.loose === options.loose) {
- return version;
- } else {
- version = version.version;
- }
- } else if (typeof version !== "string") {
- throw new TypeError("Invalid Version: " + version);
- }
- if (version.length > MAX_LENGTH) {
- throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
- }
- if (!(this instanceof SemVer)) {
- return new SemVer(version, options);
- }
- debug("SemVer", version, options);
- this.options = options;
- this.loose = !!options.loose;
- var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
- if (!m) {
- throw new TypeError("Invalid Version: " + version);
- }
- this.raw = version;
- this.major = +m[1];
- this.minor = +m[2];
- this.patch = +m[3];
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
- throw new TypeError("Invalid major version");
- }
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
- throw new TypeError("Invalid minor version");
- }
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
- throw new TypeError("Invalid patch version");
- }
- if (!m[4]) {
- this.prerelease = [];
- } else {
- this.prerelease = m[4].split(".").map(function(id) {
- if (/^[0-9]+$/.test(id)) {
- var num = +id;
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
- return num;
- }
- }
- return id;
- });
- }
- this.build = m[5] ? m[5].split(".") : [];
- this.format();
- }
- SemVer.prototype.format = function() {
- this.version = this.major + "." + this.minor + "." + this.patch;
- if (this.prerelease.length) {
- this.version += "-" + this.prerelease.join(".");
- }
- return this.version;
- };
- SemVer.prototype.toString = function() {
- return this.version;
- };
- SemVer.prototype.compare = function(other) {
- debug("SemVer.compare", this.version, this.options, other);
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- return this.compareMain(other) || this.comparePre(other);
- };
- SemVer.prototype.compareMain = function(other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
- };
- SemVer.prototype.comparePre = function(other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- if (this.prerelease.length && !other.prerelease.length) {
- return -1;
- } else if (!this.prerelease.length && other.prerelease.length) {
- return 1;
- } else if (!this.prerelease.length && !other.prerelease.length) {
- return 0;
- }
- var i2 = 0;
- do {
- var a = this.prerelease[i2];
- var b = other.prerelease[i2];
- debug("prerelease compare", i2, a, b);
- if (a === void 0 && b === void 0) {
- return 0;
- } else if (b === void 0) {
- return 1;
- } else if (a === void 0) {
- return -1;
- } else if (a === b) {
- continue;
- } else {
- return compareIdentifiers(a, b);
- }
- } while (++i2);
- };
- SemVer.prototype.compareBuild = function(other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- var i2 = 0;
- do {
- var a = this.build[i2];
- var b = other.build[i2];
- debug("prerelease compare", i2, a, b);
- if (a === void 0 && b === void 0) {
- return 0;
- } else if (b === void 0) {
- return 1;
- } else if (a === void 0) {
- return -1;
- } else if (a === b) {
- continue;
- } else {
- return compareIdentifiers(a, b);
- }
- } while (++i2);
- };
- SemVer.prototype.inc = function(release, identifier) {
- switch (release) {
- case "premajor":
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor = 0;
- this.major++;
- this.inc("pre", identifier);
- break;
- case "preminor":
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor++;
- this.inc("pre", identifier);
- break;
- case "prepatch":
- this.prerelease.length = 0;
- this.inc("patch", identifier);
- this.inc("pre", identifier);
- break;
- case "prerelease":
- if (this.prerelease.length === 0) {
- this.inc("patch", identifier);
- }
- this.inc("pre", identifier);
- break;
- case "major":
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
- this.major++;
- }
- this.minor = 0;
- this.patch = 0;
- this.prerelease = [];
- break;
- case "minor":
- if (this.patch !== 0 || this.prerelease.length === 0) {
- this.minor++;
- }
- this.patch = 0;
- this.prerelease = [];
- break;
- case "patch":
- if (this.prerelease.length === 0) {
- this.patch++;
- }
- this.prerelease = [];
- break;
- case "pre":
- if (this.prerelease.length === 0) {
- this.prerelease = [0];
- } else {
- var i2 = this.prerelease.length;
- while (--i2 >= 0) {
- if (typeof this.prerelease[i2] === "number") {
- this.prerelease[i2]++;
- i2 = -2;
- }
- }
- if (i2 === -1) {
- this.prerelease.push(0);
- }
- }
- if (identifier) {
- if (this.prerelease[0] === identifier) {
- if (isNaN(this.prerelease[1])) {
- this.prerelease = [identifier, 0];
- }
- } else {
- this.prerelease = [identifier, 0];
- }
- }
- break;
- default:
- throw new Error("invalid increment argument: " + release);
- }
- this.format();
- this.raw = this.version;
- return this;
- };
- exports2.inc = inc;
- function inc(version, release, loose, identifier) {
- if (typeof loose === "string") {
- identifier = loose;
- loose = void 0;
- }
- try {
- return new SemVer(version, loose).inc(release, identifier).version;
- } catch (er) {
- return null;
- }
- }
- exports2.diff = diff;
- function diff(version1, version2) {
- if (eq(version1, version2)) {
- return null;
- } else {
- var v1 = parse(version1);
- var v2 = parse(version2);
- var prefix = "";
- if (v1.prerelease.length || v2.prerelease.length) {
- prefix = "pre";
- var defaultResult = "prerelease";
- }
- for (var key in v1) {
- if (key === "major" || key === "minor" || key === "patch") {
- if (v1[key] !== v2[key]) {
- return prefix + key;
- }
- }
- }
- return defaultResult;
- }
- }
- exports2.compareIdentifiers = compareIdentifiers;
- var numeric = /^[0-9]+$/;
- function compareIdentifiers(a, b) {
- var anum = numeric.test(a);
- var bnum = numeric.test(b);
- if (anum && bnum) {
- a = +a;
- b = +b;
- }
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
- }
- exports2.rcompareIdentifiers = rcompareIdentifiers;
- function rcompareIdentifiers(a, b) {
- return compareIdentifiers(b, a);
- }
- exports2.major = major;
- function major(a, loose) {
- return new SemVer(a, loose).major;
- }
- exports2.minor = minor;
- function minor(a, loose) {
- return new SemVer(a, loose).minor;
- }
- exports2.patch = patch;
- function patch(a, loose) {
- return new SemVer(a, loose).patch;
- }
- exports2.compare = compare;
- function compare(a, b, loose) {
- return new SemVer(a, loose).compare(new SemVer(b, loose));
- }
- exports2.compareLoose = compareLoose;
- function compareLoose(a, b) {
- return compare(a, b, true);
- }
- exports2.compareBuild = compareBuild;
- function compareBuild(a, b, loose) {
- var versionA = new SemVer(a, loose);
- var versionB = new SemVer(b, loose);
- return versionA.compare(versionB) || versionA.compareBuild(versionB);
- }
- exports2.rcompare = rcompare;
- function rcompare(a, b, loose) {
- return compare(b, a, loose);
- }
- exports2.sort = sort;
- function sort(list, loose) {
- return list.sort(function(a, b) {
- return exports2.compareBuild(a, b, loose);
- });
- }
- exports2.rsort = rsort;
- function rsort(list, loose) {
- return list.sort(function(a, b) {
- return exports2.compareBuild(b, a, loose);
- });
- }
- exports2.gt = gt;
- function gt(a, b, loose) {
- return compare(a, b, loose) > 0;
- }
- exports2.lt = lt;
- function lt(a, b, loose) {
- return compare(a, b, loose) < 0;
- }
- exports2.eq = eq;
- function eq(a, b, loose) {
- return compare(a, b, loose) === 0;
- }
- exports2.neq = neq;
- function neq(a, b, loose) {
- return compare(a, b, loose) !== 0;
- }
- exports2.gte = gte;
- function gte(a, b, loose) {
- return compare(a, b, loose) >= 0;
- }
- exports2.lte = lte;
- function lte(a, b, loose) {
- return compare(a, b, loose) <= 0;
- }
- exports2.cmp = cmp;
- function cmp(a, op, b, loose) {
- switch (op) {
- case "===":
- if (typeof a === "object")
- a = a.version;
- if (typeof b === "object")
- b = b.version;
- return a === b;
- case "!==":
- if (typeof a === "object")
- a = a.version;
- if (typeof b === "object")
- b = b.version;
- return a !== b;
- case "":
- case "=":
- case "==":
- return eq(a, b, loose);
- case "!=":
- return neq(a, b, loose);
- case ">":
- return gt(a, b, loose);
- case ">=":
- return gte(a, b, loose);
- case "<":
- return lt(a, b, loose);
- case "<=":
- return lte(a, b, loose);
- default:
- throw new TypeError("Invalid operator: " + op);
- }
- }
- exports2.Comparator = Comparator;
- function Comparator(comp, options) {
- if (!options || typeof options !== "object") {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (comp instanceof Comparator) {
- if (comp.loose === !!options.loose) {
- return comp;
- } else {
- comp = comp.value;
- }
- }
- if (!(this instanceof Comparator)) {
- return new Comparator(comp, options);
- }
- debug("comparator", comp, options);
- this.options = options;
- this.loose = !!options.loose;
- this.parse(comp);
- if (this.semver === ANY) {
- this.value = "";
- } else {
- this.value = this.operator + this.semver.version;
- }
- debug("comp", this);
- }
- var ANY = {};
- Comparator.prototype.parse = function(comp) {
- var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
- var m = comp.match(r);
- if (!m) {
- throw new TypeError("Invalid comparator: " + comp);
- }
- this.operator = m[1] !== void 0 ? m[1] : "";
- if (this.operator === "=") {
- this.operator = "";
- }
- if (!m[2]) {
- this.semver = ANY;
- } else {
- this.semver = new SemVer(m[2], this.options.loose);
- }
- };
- Comparator.prototype.toString = function() {
- return this.value;
- };
- Comparator.prototype.test = function(version) {
- debug("Comparator.test", version, this.options.loose);
- if (this.semver === ANY || version === ANY) {
- return true;
- }
- if (typeof version === "string") {
- try {
- version = new SemVer(version, this.options);
- } catch (er) {
- return false;
- }
- }
- return cmp(version, this.operator, this.semver, this.options);
- };
- Comparator.prototype.intersects = function(comp, options) {
- if (!(comp instanceof Comparator)) {
- throw new TypeError("a Comparator is required");
- }
- if (!options || typeof options !== "object") {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- var rangeTmp;
- if (this.operator === "") {
- if (this.value === "") {
- return true;
- }
- rangeTmp = new Range(comp.value, options);
- return satisfies(this.value, rangeTmp, options);
- } else if (comp.operator === "") {
- if (comp.value === "") {
- return true;
- }
- rangeTmp = new Range(this.value, options);
- return satisfies(comp.semver, rangeTmp, options);
- }
- var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
- var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
- var sameSemVer = this.semver.version === comp.semver.version;
- var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
- var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
- var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
- return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
- };
- exports2.Range = Range;
- function Range(range, options) {
- if (!options || typeof options !== "object") {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (range instanceof Range) {
- if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
- return range;
- } else {
- return new Range(range.raw, options);
- }
- }
- if (range instanceof Comparator) {
- return new Range(range.value, options);
- }
- if (!(this instanceof Range)) {
- return new Range(range, options);
- }
- this.options = options;
- this.loose = !!options.loose;
- this.includePrerelease = !!options.includePrerelease;
- this.raw = range;
- this.set = range.split(/\s*\|\|\s*/).map(function(range2) {
- return this.parseRange(range2.trim());
- }, this).filter(function(c) {
- return c.length;
- });
- if (!this.set.length) {
- throw new TypeError("Invalid SemVer Range: " + range);
- }
- this.format();
- }
- Range.prototype.format = function() {
- this.range = this.set.map(function(comps) {
- return comps.join(" ").trim();
- }).join("||").trim();
- return this.range;
- };
- Range.prototype.toString = function() {
- return this.range;
- };
- Range.prototype.parseRange = function(range) {
- var loose = this.options.loose;
- range = range.trim();
- var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
- range = range.replace(hr, hyphenReplace);
- debug("hyphen replace", range);
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
- debug("comparator trim", range, re[t.COMPARATORTRIM]);
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
- range = range.split(/\s+/).join(" ");
- var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
- var set = range.split(" ").map(function(comp) {
- return parseComparator(comp, this.options);
- }, this).join(" ").split(/\s+/);
- if (this.options.loose) {
- set = set.filter(function(comp) {
- return !!comp.match(compRe);
- });
- }
- set = set.map(function(comp) {
- return new Comparator(comp, this.options);
- }, this);
- return set;
- };
- Range.prototype.intersects = function(range, options) {
- if (!(range instanceof Range)) {
- throw new TypeError("a Range is required");
- }
- return this.set.some(function(thisComparators) {
- return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
- return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
- return rangeComparators.every(function(rangeComparator) {
- return thisComparator.intersects(rangeComparator, options);
- });
- });
- });
- });
- };
- function isSatisfiable(comparators, options) {
- var result = true;
- var remainingComparators = comparators.slice();
- var testComparator = remainingComparators.pop();
- while (result && remainingComparators.length) {
- result = remainingComparators.every(function(otherComparator) {
- return testComparator.intersects(otherComparator, options);
- });
- testComparator = remainingComparators.pop();
- }
- return result;
- }
- exports2.toComparators = toComparators;
- function toComparators(range, options) {
- return new Range(range, options).set.map(function(comp) {
- return comp.map(function(c) {
- return c.value;
- }).join(" ").trim().split(" ");
- });
- }
- function parseComparator(comp, options) {
- debug("comp", comp, options);
- comp = replaceCarets(comp, options);
- debug("caret", comp);
- comp = replaceTildes(comp, options);
- debug("tildes", comp);
- comp = replaceXRanges(comp, options);
- debug("xrange", comp);
- comp = replaceStars(comp, options);
- debug("stars", comp);
- return comp;
- }
- function isX(id) {
- return !id || id.toLowerCase() === "x" || id === "*";
- }
- function replaceTildes(comp, options) {
- return comp.trim().split(/\s+/).map(function(comp2) {
- return replaceTilde(comp2, options);
- }).join(" ");
- }
- function replaceTilde(comp, options) {
- var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
- return comp.replace(r, function(_, M, m, p, pr) {
- debug("tilde", comp, _, M, m, p, pr);
- var ret;
- if (isX(M)) {
- ret = "";
- } else if (isX(m)) {
- ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
- } else if (isX(p)) {
- ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
- } else if (pr) {
- debug("replaceTilde pr", pr);
- ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
- } else {
- ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
- }
- debug("tilde return", ret);
- return ret;
- });
- }
- function replaceCarets(comp, options) {
- return comp.trim().split(/\s+/).map(function(comp2) {
- return replaceCaret(comp2, options);
- }).join(" ");
- }
- function replaceCaret(comp, options) {
- debug("caret", comp, options);
- var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
- return comp.replace(r, function(_, M, m, p, pr) {
- debug("caret", comp, _, M, m, p, pr);
- var ret;
- if (isX(M)) {
- ret = "";
- } else if (isX(m)) {
- ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
- } else if (isX(p)) {
- if (M === "0") {
- ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
- } else {
- ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
- }
- } else if (pr) {
- debug("replaceCaret pr", pr);
- if (M === "0") {
- if (m === "0") {
- ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
- } else {
- ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
- }
- } else {
- ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
- }
- } else {
- debug("no pr");
- if (M === "0") {
- if (m === "0") {
- ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
- } else {
- ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
- }
- } else {
- ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
- }
- }
- debug("caret return", ret);
- return ret;
- });
- }
- function replaceXRanges(comp, options) {
- debug("replaceXRanges", comp, options);
- return comp.split(/\s+/).map(function(comp2) {
- return replaceXRange(comp2, options);
- }).join(" ");
- }
- function replaceXRange(comp, options) {
- comp = comp.trim();
- var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
- return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
- debug("xRange", comp, ret, gtlt, M, m, p, pr);
- var xM = isX(M);
- var xm = xM || isX(m);
- var xp = xm || isX(p);
- var anyX = xp;
- if (gtlt === "=" && anyX) {
- gtlt = "";
- }
- pr = options.includePrerelease ? "-0" : "";
- if (xM) {
- if (gtlt === ">" || gtlt === "<") {
- ret = "<0.0.0-0";
- } else {
- ret = "*";
- }
- } else if (gtlt && anyX) {
- if (xm) {
- m = 0;
- }
- p = 0;
- if (gtlt === ">") {
- gtlt = ">=";
- if (xm) {
- M = +M + 1;
- m = 0;
- p = 0;
- } else {
- m = +m + 1;
- p = 0;
- }
- } else if (gtlt === "<=") {
- gtlt = "<";
- if (xm) {
- M = +M + 1;
- } else {
- m = +m + 1;
- }
- }
- ret = gtlt + M + "." + m + "." + p + pr;
- } else if (xm) {
- ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
- } else if (xp) {
- ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
- }
- debug("xRange return", ret);
- return ret;
- });
- }
- function replaceStars(comp, options) {
- debug("replaceStars", comp, options);
- return comp.trim().replace(re[t.STAR], "");
- }
- function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
- if (isX(fM)) {
- from = "";
- } else if (isX(fm)) {
- from = ">=" + fM + ".0.0";
- } else if (isX(fp)) {
- from = ">=" + fM + "." + fm + ".0";
- } else {
- from = ">=" + from;
- }
- if (isX(tM)) {
- to = "";
- } else if (isX(tm)) {
- to = "<" + (+tM + 1) + ".0.0";
- } else if (isX(tp)) {
- to = "<" + tM + "." + (+tm + 1) + ".0";
- } else if (tpr) {
- to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
- } else {
- to = "<=" + to;
- }
- return (from + " " + to).trim();
- }
- Range.prototype.test = function(version) {
- if (!version) {
- return false;
- }
- if (typeof version === "string") {
- try {
- version = new SemVer(version, this.options);
- } catch (er) {
- return false;
- }
- }
- for (var i2 = 0; i2 < this.set.length; i2++) {
- if (testSet(this.set[i2], version, this.options)) {
- return true;
- }
- }
- return false;
- };
- function testSet(set, version, options) {
- for (var i2 = 0; i2 < set.length; i2++) {
- if (!set[i2].test(version)) {
- return false;
- }
- }
- if (version.prerelease.length && !options.includePrerelease) {
- for (i2 = 0; i2 < set.length; i2++) {
- debug(set[i2].semver);
- if (set[i2].semver === ANY) {
- continue;
- }
- if (set[i2].semver.prerelease.length > 0) {
- var allowed = set[i2].semver;
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
- return true;
- }
- }
- }
- return false;
- }
- return true;
- }
- exports2.satisfies = satisfies;
- function satisfies(version, range, options) {
- try {
- range = new Range(range, options);
- } catch (er) {
- return false;
- }
- return range.test(version);
- }
- exports2.maxSatisfying = maxSatisfying;
- function maxSatisfying(versions, range, options) {
- var max = null;
- var maxSV = null;
- try {
- var rangeObj = new Range(range, options);
- } catch (er) {
- return null;
- }
- versions.forEach(function(v) {
- if (rangeObj.test(v)) {
- if (!max || maxSV.compare(v) === -1) {
- max = v;
- maxSV = new SemVer(max, options);
- }
- }
- });
- return max;
- }
- exports2.minSatisfying = minSatisfying;
- function minSatisfying(versions, range, options) {
- var min = null;
- var minSV = null;
- try {
- var rangeObj = new Range(range, options);
- } catch (er) {
- return null;
- }
- versions.forEach(function(v) {
- if (rangeObj.test(v)) {
- if (!min || minSV.compare(v) === 1) {
- min = v;
- minSV = new SemVer(min, options);
- }
- }
- });
- return min;
- }
- exports2.minVersion = minVersion;
- function minVersion(range, loose) {
- range = new Range(range, loose);
- var minver = new SemVer("0.0.0");
- if (range.test(minver)) {
- return minver;
- }
- minver = new SemVer("0.0.0-0");
- if (range.test(minver)) {
- return minver;
- }
- minver = null;
- for (var i2 = 0; i2 < range.set.length; ++i2) {
- var comparators = range.set[i2];
- comparators.forEach(function(comparator) {
- var compver = new SemVer(comparator.semver.version);
- switch (comparator.operator) {
- case ">":
- if (compver.prerelease.length === 0) {
- compver.patch++;
- } else {
- compver.prerelease.push(0);
- }
- compver.raw = compver.format();
- case "":
- case ">=":
- if (!minver || gt(minver, compver)) {
- minver = compver;
- }
- break;
- case "<":
- case "<=":
- break;
- default:
- throw new Error("Unexpected operation: " + comparator.operator);
- }
- });
- }
- if (minver && range.test(minver)) {
- return minver;
- }
- return null;
- }
- exports2.validRange = validRange;
- function validRange(range, options) {
- try {
- return new Range(range, options).range || "*";
- } catch (er) {
- return null;
- }
- }
- exports2.ltr = ltr;
- function ltr(version, range, options) {
- return outside(version, range, "<", options);
- }
- exports2.gtr = gtr;
- function gtr(version, range, options) {
- return outside(version, range, ">", options);
- }
- exports2.outside = outside;
- function outside(version, range, hilo, options) {
- version = new SemVer(version, options);
- range = new Range(range, options);
- var gtfn, ltefn, ltfn, comp, ecomp;
- switch (hilo) {
- case ">":
- gtfn = gt;
- ltefn = lte;
- ltfn = lt;
- comp = ">";
- ecomp = ">=";
- break;
- case "<":
- gtfn = lt;
- ltefn = gte;
- ltfn = gt;
- comp = "<";
- ecomp = "<=";
- break;
- default:
- throw new TypeError('Must provide a hilo val of "<" or ">"');
- }
- if (satisfies(version, range, options)) {
- return false;
- }
- for (var i2 = 0; i2 < range.set.length; ++i2) {
- var comparators = range.set[i2];
- var high = null;
- var low = null;
- comparators.forEach(function(comparator) {
- if (comparator.semver === ANY) {
- comparator = new Comparator(">=0.0.0");
- }
- high = high || comparator;
- low = low || comparator;
- if (gtfn(comparator.semver, high.semver, options)) {
- high = comparator;
- } else if (ltfn(comparator.semver, low.semver, options)) {
- low = comparator;
- }
- });
- if (high.operator === comp || high.operator === ecomp) {
- return false;
- }
- if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
- return false;
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
- return false;
- }
- }
- return true;
- }
- exports2.prerelease = prerelease;
- function prerelease(version, options) {
- var parsed = parse(version, options);
- return parsed && parsed.prerelease.length ? parsed.prerelease : null;
- }
- exports2.intersects = intersects;
- function intersects(r1, r2, options) {
- r1 = new Range(r1, options);
- r2 = new Range(r2, options);
- return r1.intersects(r2);
- }
- exports2.coerce = coerce;
- function coerce(version, options) {
- if (version instanceof SemVer) {
- return version;
- }
- if (typeof version === "number") {
- version = String(version);
- }
- if (typeof version !== "string") {
- return null;
- }
- options = options || {};
- var match = null;
- if (!options.rtl) {
- match = version.match(re[t.COERCE]);
- } else {
- var next;
- while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
- match = next;
- }
- re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
- }
- re[t.COERCERTL].lastIndex = -1;
- }
- if (match === null) {
- return null;
- }
- return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
- }
- }
- });
- var require_make_dir = __commonJS2({
- "node_modules/make-dir/index.js"(exports2, module2) {
- "use strict";
- var fs = require("fs");
- var path = require("path");
- var {
- promisify
- } = require("util");
- var semver = require_semver();
- var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0");
- var checkPath = (pth) => {
- if (process.platform === "win32") {
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
- if (pathHasInvalidWinCharacters) {
- const error = new Error(`Path contains invalid characters: ${pth}`);
- error.code = "EINVAL";
- throw error;
- }
- }
- };
- var processOptions = (options) => {
- const defaults = {
- mode: 511,
- fs
- };
- return Object.assign(Object.assign({}, defaults), options);
- };
- var permissionError = (pth) => {
- const error = new Error(`operation not permitted, mkdir '${pth}'`);
- error.code = "EPERM";
- error.errno = -4048;
- error.path = pth;
- error.syscall = "mkdir";
- return error;
- };
- var makeDir = async (input, options) => {
- checkPath(input);
- options = processOptions(options);
- const mkdir = promisify(options.fs.mkdir);
- const stat = promisify(options.fs.stat);
- if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
- const pth = path.resolve(input);
- await mkdir(pth, {
- mode: options.mode,
- recursive: true
- });
- return pth;
- }
- const make = async (pth) => {
- try {
- await mkdir(pth, options.mode);
- return pth;
- } catch (error) {
- if (error.code === "EPERM") {
- throw error;
- }
- if (error.code === "ENOENT") {
- if (path.dirname(pth) === pth) {
- throw permissionError(pth);
- }
- if (error.message.includes("null bytes")) {
- throw error;
- }
- await make(path.dirname(pth));
- return make(pth);
- }
- try {
- const stats = await stat(pth);
- if (!stats.isDirectory()) {
- throw new Error("The path is not a directory");
- }
- } catch (_) {
- throw error;
- }
- return pth;
- }
- };
- return make(path.resolve(input));
- };
- module2.exports = makeDir;
- module2.exports.sync = (input, options) => {
- checkPath(input);
- options = processOptions(options);
- if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
- const pth = path.resolve(input);
- fs.mkdirSync(pth, {
- mode: options.mode,
- recursive: true
- });
- return pth;
- }
- const make = (pth) => {
- try {
- options.fs.mkdirSync(pth, options.mode);
- } catch (error) {
- if (error.code === "EPERM") {
- throw error;
- }
- if (error.code === "ENOENT") {
- if (path.dirname(pth) === pth) {
- throw permissionError(pth);
- }
- if (error.message.includes("null bytes")) {
- throw error;
- }
- make(path.dirname(pth));
- return make(pth);
- }
- try {
- if (!options.fs.statSync(pth).isDirectory()) {
- throw new Error("The path is not a directory");
- }
- } catch (_) {
- throw error;
- }
- }
- return pth;
- };
- return make(path.resolve(input));
- };
- }
- });
- var require_find_cache_dir = __commonJS2({
- "node_modules/find-cache-dir/index.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var fs = require("fs");
- var commonDir = require_commondir();
- var pkgDir = require_pkg_dir();
- var makeDir = require_make_dir();
- var {
- env: env2,
- cwd
- } = process;
- var isWritable = (path2) => {
- try {
- fs.accessSync(path2, fs.constants.W_OK);
- return true;
- } catch (_) {
- return false;
- }
- };
- function useDirectory(directory, options) {
- if (options.create) {
- makeDir.sync(directory);
- }
- if (options.thunk) {
- return (...arguments_) => path.join(directory, ...arguments_);
- }
- return directory;
- }
- function getNodeModuleDirectory(directory) {
- const nodeModules = path.join(directory, "node_modules");
- if (!isWritable(nodeModules) && (fs.existsSync(nodeModules) || !isWritable(path.join(directory)))) {
- return;
- }
- return nodeModules;
- }
- module2.exports = (options = {}) => {
- if (env2.CACHE_DIR && !["true", "false", "1", "0"].includes(env2.CACHE_DIR)) {
- return useDirectory(path.join(env2.CACHE_DIR, options.name), options);
- }
- let {
- cwd: directory = cwd()
- } = options;
- if (options.files) {
- directory = commonDir(directory, options.files);
- }
- directory = pkgDir.sync(directory);
- if (!directory) {
- return;
- }
- const nodeModules = getNodeModuleDirectory(directory);
- if (!nodeModules) {
- return void 0;
- }
- return useDirectory(path.join(directory, "node_modules", ".cache", options.name), options);
- };
- }
- });
- var require_find_cache_file = __commonJS2({
- "src/cli/find-cache-file.js"(exports2, module2) {
- "use strict";
- var fs = require("fs").promises;
- var os2 = require("os");
- var path = require("path");
- var findCacheDir = require_find_cache_dir();
- var {
- statSafe,
- isJson
- } = require_utils();
- function findDefaultCacheFile() {
- const cacheDir = findCacheDir({
- name: "prettier",
- create: true
- }) || os2.tmpdir();
- const cacheFilePath = path.join(cacheDir, ".prettier-cache");
- return cacheFilePath;
- }
- async function findCacheFileFromOption(cacheLocation) {
- const cacheFile = path.resolve(cacheLocation);
- const stat = await statSafe(cacheFile);
- if (stat) {
- if (stat.isDirectory()) {
- throw new Error(`Resolved --cache-location '${cacheFile}' is a directory`);
- }
- const data = await fs.readFile(cacheFile, "utf8");
- if (!isJson(data)) {
- throw new Error(`'${cacheFile}' isn't a valid JSON file`);
- }
- }
- return cacheFile;
- }
- async function findCacheFile(cacheLocation) {
- if (!cacheLocation) {
- return findDefaultCacheFile();
- }
- const cacheFile = await findCacheFileFromOption(cacheLocation);
- return cacheFile;
- }
- module2.exports = findCacheFile;
- }
- });
- var require_cjs = __commonJS2({
- "node_modules/flatted/cjs/index.js"(exports2) {
- "use strict";
- var {
- parse: $parse,
- stringify: $stringify
- } = JSON;
- var {
- keys
- } = Object;
- var Primitive = String;
- var primitive = "string";
- var ignore = {};
- var object = "object";
- var noop = (_, value) => value;
- var primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
- var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
- var revive = (input, parsed, output, $) => {
- const lazy = [];
- for (let ke = keys(output), {
- length
- } = ke, y = 0; y < length; y++) {
- const k = ke[y];
- const value = output[k];
- if (value instanceof Primitive) {
- const tmp = input[value];
- if (typeof tmp === object && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[k] = ignore;
- lazy.push({
- k,
- a: [input, parsed, tmp, $]
- });
- } else
- output[k] = $.call(output, k, tmp);
- } else if (output[k] !== ignore)
- output[k] = $.call(output, k, value);
- }
- for (let {
- length
- } = lazy, i = 0; i < length; i++) {
- const {
- k,
- a
- } = lazy[i];
- output[k] = $.call(output, k, revive.apply(null, a));
- }
- return output;
- };
- var set = (known, input, value) => {
- const index = Primitive(input.push(value) - 1);
- known.set(value, index);
- return index;
- };
- var parse = (text, reviver) => {
- const input = $parse(text, Primitives).map(primitives);
- const value = input[0];
- const $ = reviver || noop;
- const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value;
- return $.call({
- "": tmp
- }, "", tmp);
- };
- exports2.parse = parse;
- var stringify2 = (value, replacer, space) => {
- const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop;
- const known = /* @__PURE__ */ new Map();
- const input = [];
- const output = [];
- let i = +set(known, input, $.call({
- "": value
- }, "", value));
- let firstRun = !i;
- while (i < input.length) {
- firstRun = true;
- output[i] = $stringify(input[i++], replace, space);
- }
- return "[" + output.join(",") + "]";
- function replace(key, value2) {
- if (firstRun) {
- firstRun = !firstRun;
- return value2;
- }
- const after = $.call(this, key, value2);
- switch (typeof after) {
- case object:
- if (after === null)
- return after;
- case primitive:
- return known.get(after) || set(known, input, after);
- }
- return after;
- }
- };
- exports2.stringify = stringify2;
- var toJSON = (any) => $parse(stringify2(any));
- exports2.toJSON = toJSON;
- var fromJSON = (any) => parse($stringify(any));
- exports2.fromJSON = fromJSON;
- }
- });
- var require_utils6 = __commonJS2({
- "node_modules/flat-cache/src/utils.js"(exports2, module2) {
- var fs = require("fs");
- var path = require("path");
- var flatted = require_cjs();
- module2.exports = {
- tryParse: function(filePath, defaultValue) {
- var result;
- try {
- result = this.readJSON(filePath);
- } catch (ex) {
- result = defaultValue;
- }
- return result;
- },
- readJSON: function(filePath) {
- return flatted.parse(fs.readFileSync(filePath, {
- encoding: "utf8"
- }));
- },
- writeJSON: function(filePath, data) {
- fs.mkdirSync(path.dirname(filePath), {
- recursive: true
- });
- fs.writeFileSync(filePath, flatted.stringify(data));
- }
- };
- }
- });
- var require_old = __commonJS2({
- "node_modules/fs.realpath/old.js"(exports2) {
- var pathModule = require("path");
- var isWindows = process.platform === "win32";
- var fs = require("fs");
- var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
- function rethrow() {
- var callback;
- if (DEBUG) {
- var backtrace = new Error();
- callback = debugCallback;
- } else
- callback = missingCallback;
- return callback;
- function debugCallback(err) {
- if (err) {
- backtrace.message = err.message;
- err = backtrace;
- missingCallback(err);
- }
- }
- function missingCallback(err) {
- if (err) {
- if (process.throwDeprecation)
- throw err;
- else if (!process.noDeprecation) {
- var msg = "fs: missing callback " + (err.stack || err.message);
- if (process.traceDeprecation)
- console.trace(msg);
- else
- console.error(msg);
- }
- }
- }
- }
- function maybeCallback(cb) {
- return typeof cb === "function" ? cb : rethrow();
- }
- var normalize = pathModule.normalize;
- if (isWindows) {
- nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
- } else {
- nextPartRe = /(.*?)(?:[\/]+|$)/g;
- }
- var nextPartRe;
- if (isWindows) {
- splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
- } else {
- splitRootRe = /^[\/]*/;
- }
- var splitRootRe;
- exports2.realpathSync = function realpathSync(p, cache) {
- p = pathModule.resolve(p);
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
- return cache[p];
- }
- var original = p, seenLinks = {}, knownHard = {};
- var pos;
- var current;
- var base;
- var previous;
- start();
- function start() {
- var m = splitRootRe.exec(p);
- pos = m[0].length;
- current = m[0];
- base = m[0];
- previous = "";
- if (isWindows && !knownHard[base]) {
- fs.lstatSync(base);
- knownHard[base] = true;
- }
- }
- while (pos < p.length) {
- nextPartRe.lastIndex = pos;
- var result = nextPartRe.exec(p);
- previous = current;
- current += result[0];
- base = previous + result[1];
- pos = nextPartRe.lastIndex;
- if (knownHard[base] || cache && cache[base] === base) {
- continue;
- }
- var resolvedLink;
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
- resolvedLink = cache[base];
- } else {
- var stat = fs.lstatSync(base);
- if (!stat.isSymbolicLink()) {
- knownHard[base] = true;
- if (cache)
- cache[base] = base;
- continue;
- }
- var linkTarget = null;
- if (!isWindows) {
- var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
- if (seenLinks.hasOwnProperty(id)) {
- linkTarget = seenLinks[id];
- }
- }
- if (linkTarget === null) {
- fs.statSync(base);
- linkTarget = fs.readlinkSync(base);
- }
- resolvedLink = pathModule.resolve(previous, linkTarget);
- if (cache)
- cache[base] = resolvedLink;
- if (!isWindows)
- seenLinks[id] = linkTarget;
- }
- p = pathModule.resolve(resolvedLink, p.slice(pos));
- start();
- }
- if (cache)
- cache[original] = p;
- return p;
- };
- exports2.realpath = function realpath(p, cache, cb) {
- if (typeof cb !== "function") {
- cb = maybeCallback(cache);
- cache = null;
- }
- p = pathModule.resolve(p);
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
- return process.nextTick(cb.bind(null, null, cache[p]));
- }
- var original = p, seenLinks = {}, knownHard = {};
- var pos;
- var current;
- var base;
- var previous;
- start();
- function start() {
- var m = splitRootRe.exec(p);
- pos = m[0].length;
- current = m[0];
- base = m[0];
- previous = "";
- if (isWindows && !knownHard[base]) {
- fs.lstat(base, function(err) {
- if (err)
- return cb(err);
- knownHard[base] = true;
- LOOP();
- });
- } else {
- process.nextTick(LOOP);
- }
- }
- function LOOP() {
- if (pos >= p.length) {
- if (cache)
- cache[original] = p;
- return cb(null, p);
- }
- nextPartRe.lastIndex = pos;
- var result = nextPartRe.exec(p);
- previous = current;
- current += result[0];
- base = previous + result[1];
- pos = nextPartRe.lastIndex;
- if (knownHard[base] || cache && cache[base] === base) {
- return process.nextTick(LOOP);
- }
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
- return gotResolvedLink(cache[base]);
- }
- return fs.lstat(base, gotStat);
- }
- function gotStat(err, stat) {
- if (err)
- return cb(err);
- if (!stat.isSymbolicLink()) {
- knownHard[base] = true;
- if (cache)
- cache[base] = base;
- return process.nextTick(LOOP);
- }
- if (!isWindows) {
- var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
- if (seenLinks.hasOwnProperty(id)) {
- return gotTarget(null, seenLinks[id], base);
- }
- }
- fs.stat(base, function(err2) {
- if (err2)
- return cb(err2);
- fs.readlink(base, function(err3, target) {
- if (!isWindows)
- seenLinks[id] = target;
- gotTarget(err3, target);
- });
- });
- }
- function gotTarget(err, target, base2) {
- if (err)
- return cb(err);
- var resolvedLink = pathModule.resolve(previous, target);
- if (cache)
- cache[base2] = resolvedLink;
- gotResolvedLink(resolvedLink);
- }
- function gotResolvedLink(resolvedLink) {
- p = pathModule.resolve(resolvedLink, p.slice(pos));
- start();
- }
- };
- }
- });
- var require_fs5 = __commonJS2({
- "node_modules/fs.realpath/index.js"(exports2, module2) {
- module2.exports = realpath;
- realpath.realpath = realpath;
- realpath.sync = realpathSync;
- realpath.realpathSync = realpathSync;
- realpath.monkeypatch = monkeypatch;
- realpath.unmonkeypatch = unmonkeypatch;
- var fs = require("fs");
- var origRealpath = fs.realpath;
- var origRealpathSync = fs.realpathSync;
- var version = process.version;
- var ok = /^v[0-5]\./.test(version);
- var old = require_old();
- function newError(er) {
- return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
- }
- function realpath(p, cache, cb) {
- if (ok) {
- return origRealpath(p, cache, cb);
- }
- if (typeof cache === "function") {
- cb = cache;
- cache = null;
- }
- origRealpath(p, cache, function(er, result) {
- if (newError(er)) {
- old.realpath(p, cache, cb);
- } else {
- cb(er, result);
- }
- });
- }
- function realpathSync(p, cache) {
- if (ok) {
- return origRealpathSync(p, cache);
- }
- try {
- return origRealpathSync(p, cache);
- } catch (er) {
- if (newError(er)) {
- return old.realpathSync(p, cache);
- } else {
- throw er;
- }
- }
- }
- function monkeypatch() {
- fs.realpath = realpath;
- fs.realpathSync = realpathSync;
- }
- function unmonkeypatch() {
- fs.realpath = origRealpath;
- fs.realpathSync = origRealpathSync;
- }
- }
- });
- var require_concat_map = __commonJS2({
- "node_modules/concat-map/index.js"(exports2, module2) {
- module2.exports = function(xs, fn) {
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- var x = fn(xs[i], i);
- if (isArray(x))
- res.push.apply(res, x);
- else
- res.push(x);
- }
- return res;
- };
- var isArray = Array.isArray || function(xs) {
- return Object.prototype.toString.call(xs) === "[object Array]";
- };
- }
- });
- var require_balanced_match = __commonJS2({
- "node_modules/balanced-match/index.js"(exports2, module2) {
- "use strict";
- module2.exports = balanced;
- function balanced(a, b, str) {
- if (a instanceof RegExp)
- a = maybeMatch(a, str);
- if (b instanceof RegExp)
- b = maybeMatch(b, str);
- var r = range(a, b, str);
- return r && {
- start: r[0],
- end: r[1],
- pre: str.slice(0, r[0]),
- body: str.slice(r[0] + a.length, r[1]),
- post: str.slice(r[1] + b.length)
- };
- }
- function maybeMatch(reg, str) {
- var m = str.match(reg);
- return m ? m[0] : null;
- }
- balanced.range = range;
- function range(a, b, str) {
- var begs, beg, left, right, result;
- var ai = str.indexOf(a);
- var bi = str.indexOf(b, ai + 1);
- var i = ai;
- if (ai >= 0 && bi > 0) {
- if (a === b) {
- return [ai, bi];
- }
- begs = [];
- left = str.length;
- while (i >= 0 && !result) {
- if (i == ai) {
- begs.push(i);
- ai = str.indexOf(a, i + 1);
- } else if (begs.length == 1) {
- result = [begs.pop(), bi];
- } else {
- beg = begs.pop();
- if (beg < left) {
- left = beg;
- right = bi;
- }
- bi = str.indexOf(b, i + 1);
- }
- i = ai < bi && ai >= 0 ? ai : bi;
- }
- if (begs.length) {
- result = [left, right];
- }
- }
- return result;
- }
- }
- });
- var require_brace_expansion = __commonJS2({
- "node_modules/brace-expansion/index.js"(exports2, module2) {
- var concatMap = require_concat_map();
- var balanced = require_balanced_match();
- module2.exports = expandTop;
- var escSlash = "\0SLASH" + Math.random() + "\0";
- var escOpen = "\0OPEN" + Math.random() + "\0";
- var escClose = "\0CLOSE" + Math.random() + "\0";
- var escComma = "\0COMMA" + Math.random() + "\0";
- var escPeriod = "\0PERIOD" + Math.random() + "\0";
- function numeric(str) {
- return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
- }
- function escapeBraces(str) {
- return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
- }
- function unescapeBraces(str) {
- return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
- }
- function parseCommaParts(str) {
- if (!str)
- return [""];
- var parts = [];
- var m = balanced("{", "}", str);
- if (!m)
- return str.split(",");
- var pre = m.pre;
- var body = m.body;
- var post = m.post;
- var p = pre.split(",");
- p[p.length - 1] += "{" + body + "}";
- var postParts = parseCommaParts(post);
- if (post.length) {
- p[p.length - 1] += postParts.shift();
- p.push.apply(p, postParts);
- }
- parts.push.apply(parts, p);
- return parts;
- }
- function expandTop(str) {
- if (!str)
- return [];
- if (str.substr(0, 2) === "{}") {
- str = "\\{\\}" + str.substr(2);
- }
- return expand(escapeBraces(str), true).map(unescapeBraces);
- }
- function embrace(str) {
- return "{" + str + "}";
- }
- function isPadded(el) {
- return /^-?0\d/.test(el);
- }
- function lte(i, y) {
- return i <= y;
- }
- function gte(i, y) {
- return i >= y;
- }
- function expand(str, isTop) {
- var expansions = [];
- var m = balanced("{", "}", str);
- if (!m || /\$$/.test(m.pre))
- return [str];
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
- var isSequence = isNumericSequence || isAlphaSequence;
- var isOptions = m.body.indexOf(",") >= 0;
- if (!isSequence && !isOptions) {
- if (m.post.match(/,.*\}/)) {
- str = m.pre + "{" + m.body + escClose + m.post;
- return expand(str);
- }
- return [str];
- }
- var n;
- if (isSequence) {
- n = m.body.split(/\.\./);
- } else {
- n = parseCommaParts(m.body);
- if (n.length === 1) {
- n = expand(n[0], false).map(embrace);
- if (n.length === 1) {
- var post = m.post.length ? expand(m.post, false) : [""];
- return post.map(function(p) {
- return m.pre + n[0] + p;
- });
- }
- }
- }
- var pre = m.pre;
- var post = m.post.length ? expand(m.post, false) : [""];
- var N;
- if (isSequence) {
- var x = numeric(n[0]);
- var y = numeric(n[1]);
- var width = Math.max(n[0].length, n[1].length);
- var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
- var test = lte;
- var reverse = y < x;
- if (reverse) {
- incr *= -1;
- test = gte;
- }
- var pad = n.some(isPadded);
- N = [];
- for (var i = x; test(i, y); i += incr) {
- var c;
- if (isAlphaSequence) {
- c = String.fromCharCode(i);
- if (c === "\\")
- c = "";
- } else {
- c = String(i);
- if (pad) {
- var need = width - c.length;
- if (need > 0) {
- var z = new Array(need + 1).join("0");
- if (i < 0)
- c = "-" + z + c.slice(1);
- else
- c = z + c;
- }
- }
- }
- N.push(c);
- }
- } else {
- N = concatMap(n, function(el) {
- return expand(el, false);
- });
- }
- for (var j = 0; j < N.length; j++) {
- for (var k = 0; k < post.length; k++) {
- var expansion = pre + N[j] + post[k];
- if (!isTop || isSequence || expansion)
- expansions.push(expansion);
- }
- }
- return expansions;
- }
- }
- });
- var require_minimatch = __commonJS2({
- "node_modules/minimatch/minimatch.js"(exports2, module2) {
- module2.exports = minimatch;
- minimatch.Minimatch = Minimatch;
- var path = function() {
- try {
- return require("path");
- } catch (e) {
- }
- }() || {
- sep: "/"
- };
- minimatch.sep = path.sep;
- var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
- var expand = require_brace_expansion();
- var plTypes = {
- "!": {
- open: "(?:(?!(?:",
- close: "))[^/]*?)"
- },
- "?": {
- open: "(?:",
- close: ")?"
- },
- "+": {
- open: "(?:",
- close: ")+"
- },
- "*": {
- open: "(?:",
- close: ")*"
- },
- "@": {
- open: "(?:",
- close: ")"
- }
- };
- var qmark = "[^/]";
- var star = qmark + "*?";
- var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
- var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
- var reSpecials = charSet("().*{}+?[]^$\\!");
- function charSet(s) {
- return s.split("").reduce(function(set, c) {
- set[c] = true;
- return set;
- }, {});
- }
- var slashSplit = /\/+/;
- minimatch.filter = filter;
- function filter(pattern, options) {
- options = options || {};
- return function(p, i, list) {
- return minimatch(p, pattern, options);
- };
- }
- function ext(a, b) {
- b = b || {};
- var t = {};
- Object.keys(a).forEach(function(k) {
- t[k] = a[k];
- });
- Object.keys(b).forEach(function(k) {
- t[k] = b[k];
- });
- return t;
- }
- minimatch.defaults = function(def) {
- if (!def || typeof def !== "object" || !Object.keys(def).length) {
- return minimatch;
- }
- var orig = minimatch;
- var m = function minimatch2(p, pattern, options) {
- return orig(p, pattern, ext(def, options));
- };
- m.Minimatch = function Minimatch2(pattern, options) {
- return new orig.Minimatch(pattern, ext(def, options));
- };
- m.Minimatch.defaults = function defaults(options) {
- return orig.defaults(ext(def, options)).Minimatch;
- };
- m.filter = function filter2(pattern, options) {
- return orig.filter(pattern, ext(def, options));
- };
- m.defaults = function defaults(options) {
- return orig.defaults(ext(def, options));
- };
- m.makeRe = function makeRe2(pattern, options) {
- return orig.makeRe(pattern, ext(def, options));
- };
- m.braceExpand = function braceExpand2(pattern, options) {
- return orig.braceExpand(pattern, ext(def, options));
- };
- m.match = function(list, pattern, options) {
- return orig.match(list, pattern, ext(def, options));
- };
- return m;
- };
- Minimatch.defaults = function(def) {
- return minimatch.defaults(def).Minimatch;
- };
- function minimatch(p, pattern, options) {
- assertValidPattern(pattern);
- if (!options)
- options = {};
- if (!options.nocomment && pattern.charAt(0) === "#") {
- return false;
- }
- return new Minimatch(pattern, options).match(p);
- }
- function Minimatch(pattern, options) {
- if (!(this instanceof Minimatch)) {
- return new Minimatch(pattern, options);
- }
- assertValidPattern(pattern);
- if (!options)
- options = {};
- pattern = pattern.trim();
- if (!options.allowWindowsEscape && path.sep !== "/") {
- pattern = pattern.split(path.sep).join("/");
- }
- this.options = options;
- this.set = [];
- this.pattern = pattern;
- this.regexp = null;
- this.negate = false;
- this.comment = false;
- this.empty = false;
- this.partial = !!options.partial;
- this.make();
- }
- Minimatch.prototype.debug = function() {
- };
- Minimatch.prototype.make = make;
- function make() {
- var pattern = this.pattern;
- var options = this.options;
- if (!options.nocomment && pattern.charAt(0) === "#") {
- this.comment = true;
- return;
- }
- if (!pattern) {
- this.empty = true;
- return;
- }
- this.parseNegate();
- var set = this.globSet = this.braceExpand();
- if (options.debug)
- this.debug = function debug() {
- console.error.apply(console, arguments);
- };
- this.debug(this.pattern, set);
- set = this.globParts = set.map(function(s) {
- return s.split(slashSplit);
- });
- this.debug(this.pattern, set);
- set = set.map(function(s, si, set2) {
- return s.map(this.parse, this);
- }, this);
- this.debug(this.pattern, set);
- set = set.filter(function(s) {
- return s.indexOf(false) === -1;
- });
- this.debug(this.pattern, set);
- this.set = set;
- }
- Minimatch.prototype.parseNegate = parseNegate;
- function parseNegate() {
- var pattern = this.pattern;
- var negate = false;
- var options = this.options;
- var negateOffset = 0;
- if (options.nonegate)
- return;
- for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
- negate = !negate;
- negateOffset++;
- }
- if (negateOffset)
- this.pattern = pattern.substr(negateOffset);
- this.negate = negate;
- }
- minimatch.braceExpand = function(pattern, options) {
- return braceExpand(pattern, options);
- };
- Minimatch.prototype.braceExpand = braceExpand;
- function braceExpand(pattern, options) {
- if (!options) {
- if (this instanceof Minimatch) {
- options = this.options;
- } else {
- options = {};
- }
- }
- pattern = typeof pattern === "undefined" ? this.pattern : pattern;
- assertValidPattern(pattern);
- if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
- return [pattern];
- }
- return expand(pattern);
- }
- var MAX_PATTERN_LENGTH = 1024 * 64;
- var assertValidPattern = function(pattern) {
- if (typeof pattern !== "string") {
- throw new TypeError("invalid pattern");
- }
- if (pattern.length > MAX_PATTERN_LENGTH) {
- throw new TypeError("pattern is too long");
- }
- };
- Minimatch.prototype.parse = parse;
- var SUBPARSE = {};
- function parse(pattern, isSub) {
- assertValidPattern(pattern);
- var options = this.options;
- if (pattern === "**") {
- if (!options.noglobstar)
- return GLOBSTAR;
- else
- pattern = "*";
- }
- if (pattern === "")
- return "";
- var re = "";
- var hasMagic = !!options.nocase;
- var escaping = false;
- var patternListStack = [];
- var negativeLists = [];
- var stateChar;
- var inClass = false;
- var reClassStart = -1;
- var classStart = -1;
- var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
- var self2 = this;
- function clearStateChar() {
- if (stateChar) {
- switch (stateChar) {
- case "*":
- re += star;
- hasMagic = true;
- break;
- case "?":
- re += qmark;
- hasMagic = true;
- break;
- default:
- re += "\\" + stateChar;
- break;
- }
- self2.debug("clearStateChar %j %j", stateChar, re);
- stateChar = false;
- }
- }
- for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
- this.debug("%s %s %s %j", pattern, i, re, c);
- if (escaping && reSpecials[c]) {
- re += "\\" + c;
- escaping = false;
- continue;
- }
- switch (c) {
- case "/": {
- return false;
- }
- case "\\":
- clearStateChar();
- escaping = true;
- continue;
- case "?":
- case "*":
- case "+":
- case "@":
- case "!":
- this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
- if (inClass) {
- this.debug(" in class");
- if (c === "!" && i === classStart + 1)
- c = "^";
- re += c;
- continue;
- }
- self2.debug("call clearStateChar %j", stateChar);
- clearStateChar();
- stateChar = c;
- if (options.noext)
- clearStateChar();
- continue;
- case "(":
- if (inClass) {
- re += "(";
- continue;
- }
- if (!stateChar) {
- re += "\\(";
- continue;
- }
- patternListStack.push({
- type: stateChar,
- start: i - 1,
- reStart: re.length,
- open: plTypes[stateChar].open,
- close: plTypes[stateChar].close
- });
- re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
- this.debug("plType %j %j", stateChar, re);
- stateChar = false;
- continue;
- case ")":
- if (inClass || !patternListStack.length) {
- re += "\\)";
- continue;
- }
- clearStateChar();
- hasMagic = true;
- var pl = patternListStack.pop();
- re += pl.close;
- if (pl.type === "!") {
- negativeLists.push(pl);
- }
- pl.reEnd = re.length;
- continue;
- case "|":
- if (inClass || !patternListStack.length || escaping) {
- re += "\\|";
- escaping = false;
- continue;
- }
- clearStateChar();
- re += "|";
- continue;
- case "[":
- clearStateChar();
- if (inClass) {
- re += "\\" + c;
- continue;
- }
- inClass = true;
- classStart = i;
- reClassStart = re.length;
- re += c;
- continue;
- case "]":
- if (i === classStart + 1 || !inClass) {
- re += "\\" + c;
- escaping = false;
- continue;
- }
- var cs = pattern.substring(classStart + 1, i);
- try {
- RegExp("[" + cs + "]");
- } catch (er) {
- var sp = this.parse(cs, SUBPARSE);
- re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
- hasMagic = hasMagic || sp[1];
- inClass = false;
- continue;
- }
- hasMagic = true;
- inClass = false;
- re += c;
- continue;
- default:
- clearStateChar();
- if (escaping) {
- escaping = false;
- } else if (reSpecials[c] && !(c === "^" && inClass)) {
- re += "\\";
- }
- re += c;
- }
- }
- if (inClass) {
- cs = pattern.substr(classStart + 1);
- sp = this.parse(cs, SUBPARSE);
- re = re.substr(0, reClassStart) + "\\[" + sp[0];
- hasMagic = hasMagic || sp[1];
- }
- for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
- var tail = re.slice(pl.reStart + pl.open.length);
- this.debug("setting tail", re, pl);
- tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
- if (!$2) {
- $2 = "\\";
- }
- return $1 + $1 + $2 + "|";
- });
- this.debug("tail=%j\n %s", tail, tail, pl, re);
- var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
- hasMagic = true;
- re = re.slice(0, pl.reStart) + t + "\\(" + tail;
- }
- clearStateChar();
- if (escaping) {
- re += "\\\\";
- }
- var addPatternStart = false;
- switch (re.charAt(0)) {
- case "[":
- case ".":
- case "(":
- addPatternStart = true;
- }
- for (var n = negativeLists.length - 1; n > -1; n--) {
- var nl = negativeLists[n];
- var nlBefore = re.slice(0, nl.reStart);
- var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
- var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
- var nlAfter = re.slice(nl.reEnd);
- nlLast += nlAfter;
- var openParensBefore = nlBefore.split("(").length - 1;
- var cleanAfter = nlAfter;
- for (i = 0; i < openParensBefore; i++) {
- cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
- }
- nlAfter = cleanAfter;
- var dollar = "";
- if (nlAfter === "" && isSub !== SUBPARSE) {
- dollar = "$";
- }
- var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
- re = newRe;
- }
- if (re !== "" && hasMagic) {
- re = "(?=.)" + re;
- }
- if (addPatternStart) {
- re = patternStart + re;
- }
- if (isSub === SUBPARSE) {
- return [re, hasMagic];
- }
- if (!hasMagic) {
- return globUnescape(pattern);
- }
- var flags = options.nocase ? "i" : "";
- try {
- var regExp = new RegExp("^" + re + "$", flags);
- } catch (er) {
- return new RegExp("$.");
- }
- regExp._glob = pattern;
- regExp._src = re;
- return regExp;
- }
- minimatch.makeRe = function(pattern, options) {
- return new Minimatch(pattern, options || {}).makeRe();
- };
- Minimatch.prototype.makeRe = makeRe;
- function makeRe() {
- if (this.regexp || this.regexp === false)
- return this.regexp;
- var set = this.set;
- if (!set.length) {
- this.regexp = false;
- return this.regexp;
- }
- var options = this.options;
- var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
- var flags = options.nocase ? "i" : "";
- var re = set.map(function(pattern) {
- return pattern.map(function(p) {
- return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
- }).join("\\/");
- }).join("|");
- re = "^(?:" + re + ")$";
- if (this.negate)
- re = "^(?!" + re + ").*$";
- try {
- this.regexp = new RegExp(re, flags);
- } catch (ex) {
- this.regexp = false;
- }
- return this.regexp;
- }
- minimatch.match = function(list, pattern, options) {
- options = options || {};
- var mm = new Minimatch(pattern, options);
- list = list.filter(function(f) {
- return mm.match(f);
- });
- if (mm.options.nonull && !list.length) {
- list.push(pattern);
- }
- return list;
- };
- Minimatch.prototype.match = function match(f, partial) {
- if (typeof partial === "undefined")
- partial = this.partial;
- this.debug("match", f, this.pattern);
- if (this.comment)
- return false;
- if (this.empty)
- return f === "";
- if (f === "/" && partial)
- return true;
- var options = this.options;
- if (path.sep !== "/") {
- f = f.split(path.sep).join("/");
- }
- f = f.split(slashSplit);
- this.debug(this.pattern, "split", f);
- var set = this.set;
- this.debug(this.pattern, "set", set);
- var filename;
- var i;
- for (i = f.length - 1; i >= 0; i--) {
- filename = f[i];
- if (filename)
- break;
- }
- for (i = 0; i < set.length; i++) {
- var pattern = set[i];
- var file = f;
- if (options.matchBase && pattern.length === 1) {
- file = [filename];
- }
- var hit = this.matchOne(file, pattern, partial);
- if (hit) {
- if (options.flipNegate)
- return true;
- return !this.negate;
- }
- }
- if (options.flipNegate)
- return false;
- return this.negate;
- };
- Minimatch.prototype.matchOne = function(file, pattern, partial) {
- var options = this.options;
- this.debug("matchOne", {
- "this": this,
- file,
- pattern
- });
- this.debug("matchOne", file.length, pattern.length);
- for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
- this.debug("matchOne loop");
- var p = pattern[pi];
- var f = file[fi];
- this.debug(pattern, p, f);
- if (p === false)
- return false;
- if (p === GLOBSTAR) {
- this.debug("GLOBSTAR", [pattern, p, f]);
- var fr = fi;
- var pr = pi + 1;
- if (pr === pl) {
- this.debug("** at the end");
- for (; fi < fl; fi++) {
- if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
- return false;
- }
- return true;
- }
- while (fr < fl) {
- var swallowee = file[fr];
- this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
- this.debug("globstar found match!", fr, fl, swallowee);
- return true;
- } else {
- if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
- this.debug("dot detected!", file, fr, pattern, pr);
- break;
- }
- this.debug("globstar swallow a segment, and continue");
- fr++;
- }
- }
- if (partial) {
- this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
- if (fr === fl)
- return true;
- }
- return false;
- }
- var hit;
- if (typeof p === "string") {
- hit = f === p;
- this.debug("string match", p, f, hit);
- } else {
- hit = f.match(p);
- this.debug("pattern match", p, f, hit);
- }
- if (!hit)
- return false;
- }
- if (fi === fl && pi === pl) {
- return true;
- } else if (fi === fl) {
- return partial;
- } else if (pi === pl) {
- return fi === fl - 1 && file[fi] === "";
- }
- throw new Error("wtf?");
- };
- function globUnescape(s) {
- return s.replace(/\\(.)/g, "$1");
- }
- function regExpEscape(s) {
- return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
- }
- }
- });
- var require_inherits_browser = __commonJS2({
- "node_modules/inherits/inherits_browser.js"(exports2, module2) {
- if (typeof Object.create === "function") {
- module2.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- }
- };
- } else {
- module2.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- var TempCtor = function() {
- };
- TempCtor.prototype = superCtor.prototype;
- ctor.prototype = new TempCtor();
- ctor.prototype.constructor = ctor;
- }
- };
- }
- }
- });
- var require_inherits = __commonJS2({
- "node_modules/inherits/inherits.js"(exports2, module2) {
- try {
- util = require("util");
- if (typeof util.inherits !== "function")
- throw "";
- module2.exports = util.inherits;
- } catch (e) {
- module2.exports = require_inherits_browser();
- }
- var util;
- }
- });
- var require_path_is_absolute = __commonJS2({
- "node_modules/path-is-absolute/index.js"(exports2, module2) {
- "use strict";
- function posix(path) {
- return path.charAt(0) === "/";
- }
- function win32(path) {
- var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
- var result = splitDeviceRe.exec(path);
- var device = result[1] || "";
- var isUnc = Boolean(device && device.charAt(1) !== ":");
- return Boolean(result[2] || isUnc);
- }
- module2.exports = process.platform === "win32" ? win32 : posix;
- module2.exports.posix = posix;
- module2.exports.win32 = win32;
- }
- });
- var require_common3 = __commonJS2({
- "node_modules/glob/common.js"(exports2) {
- exports2.setopts = setopts;
- exports2.ownProp = ownProp;
- exports2.makeAbs = makeAbs;
- exports2.finish = finish;
- exports2.mark = mark;
- exports2.isIgnored = isIgnored;
- exports2.childrenIgnored = childrenIgnored;
- function ownProp(obj, field) {
- return Object.prototype.hasOwnProperty.call(obj, field);
- }
- var fs = require("fs");
- var path = require("path");
- var minimatch = require_minimatch();
- var isAbsolute = require_path_is_absolute();
- var Minimatch = minimatch.Minimatch;
- function alphasort(a, b) {
- return a.localeCompare(b, "en");
- }
- function setupIgnores(self2, options) {
- self2.ignore = options.ignore || [];
- if (!Array.isArray(self2.ignore))
- self2.ignore = [self2.ignore];
- if (self2.ignore.length) {
- self2.ignore = self2.ignore.map(ignoreMap);
- }
- }
- function ignoreMap(pattern) {
- var gmatcher = null;
- if (pattern.slice(-3) === "/**") {
- var gpattern = pattern.replace(/(\/\*\*)+$/, "");
- gmatcher = new Minimatch(gpattern, {
- dot: true
- });
- }
- return {
- matcher: new Minimatch(pattern, {
- dot: true
- }),
- gmatcher
- };
- }
- function setopts(self2, pattern, options) {
- if (!options)
- options = {};
- if (options.matchBase && -1 === pattern.indexOf("/")) {
- if (options.noglobstar) {
- throw new Error("base matching requires globstar");
- }
- pattern = "**/" + pattern;
- }
- self2.silent = !!options.silent;
- self2.pattern = pattern;
- self2.strict = options.strict !== false;
- self2.realpath = !!options.realpath;
- self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
- self2.follow = !!options.follow;
- self2.dot = !!options.dot;
- self2.mark = !!options.mark;
- self2.nodir = !!options.nodir;
- if (self2.nodir)
- self2.mark = true;
- self2.sync = !!options.sync;
- self2.nounique = !!options.nounique;
- self2.nonull = !!options.nonull;
- self2.nosort = !!options.nosort;
- self2.nocase = !!options.nocase;
- self2.stat = !!options.stat;
- self2.noprocess = !!options.noprocess;
- self2.absolute = !!options.absolute;
- self2.fs = options.fs || fs;
- self2.maxLength = options.maxLength || Infinity;
- self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
- self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
- self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
- setupIgnores(self2, options);
- self2.changedCwd = false;
- var cwd = process.cwd();
- if (!ownProp(options, "cwd"))
- self2.cwd = cwd;
- else {
- self2.cwd = path.resolve(options.cwd);
- self2.changedCwd = self2.cwd !== cwd;
- }
- self2.root = options.root || path.resolve(self2.cwd, "/");
- self2.root = path.resolve(self2.root);
- if (process.platform === "win32")
- self2.root = self2.root.replace(/\\/g, "/");
- self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
- if (process.platform === "win32")
- self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
- self2.nomount = !!options.nomount;
- options.nonegate = true;
- options.nocomment = true;
- options.allowWindowsEscape = false;
- self2.minimatch = new Minimatch(pattern, options);
- self2.options = self2.minimatch.options;
- }
- function finish(self2) {
- var nou = self2.nounique;
- var all = nou ? [] : /* @__PURE__ */ Object.create(null);
- for (var i = 0, l = self2.matches.length; i < l; i++) {
- var matches = self2.matches[i];
- if (!matches || Object.keys(matches).length === 0) {
- if (self2.nonull) {
- var literal = self2.minimatch.globSet[i];
- if (nou)
- all.push(literal);
- else
- all[literal] = true;
- }
- } else {
- var m = Object.keys(matches);
- if (nou)
- all.push.apply(all, m);
- else
- m.forEach(function(m2) {
- all[m2] = true;
- });
- }
- }
- if (!nou)
- all = Object.keys(all);
- if (!self2.nosort)
- all = all.sort(alphasort);
- if (self2.mark) {
- for (var i = 0; i < all.length; i++) {
- all[i] = self2._mark(all[i]);
- }
- if (self2.nodir) {
- all = all.filter(function(e) {
- var notDir = !/\/$/.test(e);
- var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
- if (notDir && c)
- notDir = c !== "DIR" && !Array.isArray(c);
- return notDir;
- });
- }
- }
- if (self2.ignore.length)
- all = all.filter(function(m2) {
- return !isIgnored(self2, m2);
- });
- self2.found = all;
- }
- function mark(self2, p) {
- var abs = makeAbs(self2, p);
- var c = self2.cache[abs];
- var m = p;
- if (c) {
- var isDir = c === "DIR" || Array.isArray(c);
- var slash = p.slice(-1) === "/";
- if (isDir && !slash)
- m += "/";
- else if (!isDir && slash)
- m = m.slice(0, -1);
- if (m !== p) {
- var mabs = makeAbs(self2, m);
- self2.statCache[mabs] = self2.statCache[abs];
- self2.cache[mabs] = self2.cache[abs];
- }
- }
- return m;
- }
- function makeAbs(self2, f) {
- var abs = f;
- if (f.charAt(0) === "/") {
- abs = path.join(self2.root, f);
- } else if (isAbsolute(f) || f === "") {
- abs = f;
- } else if (self2.changedCwd) {
- abs = path.resolve(self2.cwd, f);
- } else {
- abs = path.resolve(f);
- }
- if (process.platform === "win32")
- abs = abs.replace(/\\/g, "/");
- return abs;
- }
- function isIgnored(self2, path2) {
- if (!self2.ignore.length)
- return false;
- return self2.ignore.some(function(item) {
- return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
- });
- }
- function childrenIgnored(self2, path2) {
- if (!self2.ignore.length)
- return false;
- return self2.ignore.some(function(item) {
- return !!(item.gmatcher && item.gmatcher.match(path2));
- });
- }
- }
- });
- var require_sync7 = __commonJS2({
- "node_modules/glob/sync.js"(exports2, module2) {
- module2.exports = globSync;
- globSync.GlobSync = GlobSync;
- var rp = require_fs5();
- var minimatch = require_minimatch();
- var Minimatch = minimatch.Minimatch;
- var Glob = require_glob().Glob;
- var util = require("util");
- var path = require("path");
- var assert = require("assert");
- var isAbsolute = require_path_is_absolute();
- var common = require_common3();
- var setopts = common.setopts;
- var ownProp = common.ownProp;
- var childrenIgnored = common.childrenIgnored;
- var isIgnored = common.isIgnored;
- function globSync(pattern, options) {
- if (typeof options === "function" || arguments.length === 3)
- throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
- return new GlobSync(pattern, options).found;
- }
- function GlobSync(pattern, options) {
- if (!pattern)
- throw new Error("must provide pattern");
- if (typeof options === "function" || arguments.length === 3)
- throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
- if (!(this instanceof GlobSync))
- return new GlobSync(pattern, options);
- setopts(this, pattern, options);
- if (this.noprocess)
- return this;
- var n = this.minimatch.set.length;
- this.matches = new Array(n);
- for (var i = 0; i < n; i++) {
- this._process(this.minimatch.set[i], i, false);
- }
- this._finish();
- }
- GlobSync.prototype._finish = function() {
- assert.ok(this instanceof GlobSync);
- if (this.realpath) {
- var self2 = this;
- this.matches.forEach(function(matchset, index) {
- var set = self2.matches[index] = /* @__PURE__ */ Object.create(null);
- for (var p in matchset) {
- try {
- p = self2._makeAbs(p);
- var real = rp.realpathSync(p, self2.realpathCache);
- set[real] = true;
- } catch (er) {
- if (er.syscall === "stat")
- set[self2._makeAbs(p)] = true;
- else
- throw er;
- }
- }
- });
- }
- common.finish(this);
- };
- GlobSync.prototype._process = function(pattern, index, inGlobStar) {
- assert.ok(this instanceof GlobSync);
- var n = 0;
- while (typeof pattern[n] === "string") {
- n++;
- }
- var prefix;
- switch (n) {
- case pattern.length:
- this._processSimple(pattern.join("/"), index);
- return;
- case 0:
- prefix = null;
- break;
- default:
- prefix = pattern.slice(0, n).join("/");
- break;
- }
- var remain = pattern.slice(n);
- var read;
- if (prefix === null)
- read = ".";
- else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
- return typeof p === "string" ? p : "[*]";
- }).join("/"))) {
- if (!prefix || !isAbsolute(prefix))
- prefix = "/" + prefix;
- read = prefix;
- } else
- read = prefix;
- var abs = this._makeAbs(read);
- if (childrenIgnored(this, read))
- return;
- var isGlobStar = remain[0] === minimatch.GLOBSTAR;
- if (isGlobStar)
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
- else
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
- };
- GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
- var entries = this._readdir(abs, inGlobStar);
- if (!entries)
- return;
- var pn = remain[0];
- var negate = !!this.minimatch.negate;
- var rawGlob = pn._glob;
- var dotOk = this.dot || rawGlob.charAt(0) === ".";
- var matchedEntries = [];
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i];
- if (e.charAt(0) !== "." || dotOk) {
- var m;
- if (negate && !prefix) {
- m = !e.match(pn);
- } else {
- m = e.match(pn);
- }
- if (m)
- matchedEntries.push(e);
- }
- }
- var len = matchedEntries.length;
- if (len === 0)
- return;
- if (remain.length === 1 && !this.mark && !this.stat) {
- if (!this.matches[index])
- this.matches[index] = /* @__PURE__ */ Object.create(null);
- for (var i = 0; i < len; i++) {
- var e = matchedEntries[i];
- if (prefix) {
- if (prefix.slice(-1) !== "/")
- e = prefix + "/" + e;
- else
- e = prefix + e;
- }
- if (e.charAt(0) === "/" && !this.nomount) {
- e = path.join(this.root, e);
- }
- this._emitMatch(index, e);
- }
- return;
- }
- remain.shift();
- for (var i = 0; i < len; i++) {
- var e = matchedEntries[i];
- var newPattern;
- if (prefix)
- newPattern = [prefix, e];
- else
- newPattern = [e];
- this._process(newPattern.concat(remain), index, inGlobStar);
- }
- };
- GlobSync.prototype._emitMatch = function(index, e) {
- if (isIgnored(this, e))
- return;
- var abs = this._makeAbs(e);
- if (this.mark)
- e = this._mark(e);
- if (this.absolute) {
- e = abs;
- }
- if (this.matches[index][e])
- return;
- if (this.nodir) {
- var c = this.cache[abs];
- if (c === "DIR" || Array.isArray(c))
- return;
- }
- this.matches[index][e] = true;
- if (this.stat)
- this._stat(e);
- };
- GlobSync.prototype._readdirInGlobStar = function(abs) {
- if (this.follow)
- return this._readdir(abs, false);
- var entries;
- var lstat;
- var stat;
- try {
- lstat = this.fs.lstatSync(abs);
- } catch (er) {
- if (er.code === "ENOENT") {
- return null;
- }
- }
- var isSym = lstat && lstat.isSymbolicLink();
- this.symlinks[abs] = isSym;
- if (!isSym && lstat && !lstat.isDirectory())
- this.cache[abs] = "FILE";
- else
- entries = this._readdir(abs, false);
- return entries;
- };
- GlobSync.prototype._readdir = function(abs, inGlobStar) {
- var entries;
- if (inGlobStar && !ownProp(this.symlinks, abs))
- return this._readdirInGlobStar(abs);
- if (ownProp(this.cache, abs)) {
- var c = this.cache[abs];
- if (!c || c === "FILE")
- return null;
- if (Array.isArray(c))
- return c;
- }
- try {
- return this._readdirEntries(abs, this.fs.readdirSync(abs));
- } catch (er) {
- this._readdirError(abs, er);
- return null;
- }
- };
- GlobSync.prototype._readdirEntries = function(abs, entries) {
- if (!this.mark && !this.stat) {
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i];
- if (abs === "/")
- e = abs + e;
- else
- e = abs + "/" + e;
- this.cache[e] = true;
- }
- }
- this.cache[abs] = entries;
- return entries;
- };
- GlobSync.prototype._readdirError = function(f, er) {
- switch (er.code) {
- case "ENOTSUP":
- case "ENOTDIR":
- var abs = this._makeAbs(f);
- this.cache[abs] = "FILE";
- if (abs === this.cwdAbs) {
- var error = new Error(er.code + " invalid cwd " + this.cwd);
- error.path = this.cwd;
- error.code = er.code;
- throw error;
- }
- break;
- case "ENOENT":
- case "ELOOP":
- case "ENAMETOOLONG":
- case "UNKNOWN":
- this.cache[this._makeAbs(f)] = false;
- break;
- default:
- this.cache[this._makeAbs(f)] = false;
- if (this.strict)
- throw er;
- if (!this.silent)
- console.error("glob error", er);
- break;
- }
- };
- GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
- var entries = this._readdir(abs, inGlobStar);
- if (!entries)
- return;
- var remainWithoutGlobStar = remain.slice(1);
- var gspref = prefix ? [prefix] : [];
- var noGlobStar = gspref.concat(remainWithoutGlobStar);
- this._process(noGlobStar, index, false);
- var len = entries.length;
- var isSym = this.symlinks[abs];
- if (isSym && inGlobStar)
- return;
- for (var i = 0; i < len; i++) {
- var e = entries[i];
- if (e.charAt(0) === "." && !this.dot)
- continue;
- var instead = gspref.concat(entries[i], remainWithoutGlobStar);
- this._process(instead, index, true);
- var below = gspref.concat(entries[i], remain);
- this._process(below, index, true);
- }
- };
- GlobSync.prototype._processSimple = function(prefix, index) {
- var exists = this._stat(prefix);
- if (!this.matches[index])
- this.matches[index] = /* @__PURE__ */ Object.create(null);
- if (!exists)
- return;
- if (prefix && isAbsolute(prefix) && !this.nomount) {
- var trail = /[\/\\]$/.test(prefix);
- if (prefix.charAt(0) === "/") {
- prefix = path.join(this.root, prefix);
- } else {
- prefix = path.resolve(this.root, prefix);
- if (trail)
- prefix += "/";
- }
- }
- if (process.platform === "win32")
- prefix = prefix.replace(/\\/g, "/");
- this._emitMatch(index, prefix);
- };
- GlobSync.prototype._stat = function(f) {
- var abs = this._makeAbs(f);
- var needDir = f.slice(-1) === "/";
- if (f.length > this.maxLength)
- return false;
- if (!this.stat && ownProp(this.cache, abs)) {
- var c = this.cache[abs];
- if (Array.isArray(c))
- c = "DIR";
- if (!needDir || c === "DIR")
- return c;
- if (needDir && c === "FILE")
- return false;
- }
- var exists;
- var stat = this.statCache[abs];
- if (!stat) {
- var lstat;
- try {
- lstat = this.fs.lstatSync(abs);
- } catch (er) {
- if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
- this.statCache[abs] = false;
- return false;
- }
- }
- if (lstat && lstat.isSymbolicLink()) {
- try {
- stat = this.fs.statSync(abs);
- } catch (er) {
- stat = lstat;
- }
- } else {
- stat = lstat;
- }
- }
- this.statCache[abs] = stat;
- var c = true;
- if (stat)
- c = stat.isDirectory() ? "DIR" : "FILE";
- this.cache[abs] = this.cache[abs] || c;
- if (needDir && c === "FILE")
- return false;
- return c;
- };
- GlobSync.prototype._mark = function(p) {
- return common.mark(this, p);
- };
- GlobSync.prototype._makeAbs = function(f) {
- return common.makeAbs(this, f);
- };
- }
- });
- var require_wrappy = __commonJS2({
- "node_modules/wrappy/wrappy.js"(exports2, module2) {
- module2.exports = wrappy;
- function wrappy(fn, cb) {
- if (fn && cb)
- return wrappy(fn)(cb);
- if (typeof fn !== "function")
- throw new TypeError("need wrapper function");
- Object.keys(fn).forEach(function(k) {
- wrapper[k] = fn[k];
- });
- return wrapper;
- function wrapper() {
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
- var ret = fn.apply(this, args);
- var cb2 = args[args.length - 1];
- if (typeof ret === "function" && ret !== cb2) {
- Object.keys(cb2).forEach(function(k) {
- ret[k] = cb2[k];
- });
- }
- return ret;
- }
- }
- }
- });
- var require_once = __commonJS2({
- "node_modules/once/once.js"(exports2, module2) {
- var wrappy = require_wrappy();
- module2.exports = wrappy(once);
- module2.exports.strict = wrappy(onceStrict);
- once.proto = once(function() {
- Object.defineProperty(Function.prototype, "once", {
- value: function() {
- return once(this);
- },
- configurable: true
- });
- Object.defineProperty(Function.prototype, "onceStrict", {
- value: function() {
- return onceStrict(this);
- },
- configurable: true
- });
- });
- function once(fn) {
- var f = function() {
- if (f.called)
- return f.value;
- f.called = true;
- return f.value = fn.apply(this, arguments);
- };
- f.called = false;
- return f;
- }
- function onceStrict(fn) {
- var f = function() {
- if (f.called)
- throw new Error(f.onceError);
- f.called = true;
- return f.value = fn.apply(this, arguments);
- };
- var name = fn.name || "Function wrapped with `once`";
- f.onceError = name + " shouldn't be called more than once";
- f.called = false;
- return f;
- }
- }
- });
- var require_inflight = __commonJS2({
- "node_modules/inflight/inflight.js"(exports2, module2) {
- var wrappy = require_wrappy();
- var reqs = /* @__PURE__ */ Object.create(null);
- var once = require_once();
- module2.exports = wrappy(inflight);
- function inflight(key, cb) {
- if (reqs[key]) {
- reqs[key].push(cb);
- return null;
- } else {
- reqs[key] = [cb];
- return makeres(key);
- }
- }
- function makeres(key) {
- return once(function RES() {
- var cbs = reqs[key];
- var len = cbs.length;
- var args = slice(arguments);
- try {
- for (var i = 0; i < len; i++) {
- cbs[i].apply(null, args);
- }
- } finally {
- if (cbs.length > len) {
- cbs.splice(0, len);
- process.nextTick(function() {
- RES.apply(null, args);
- });
- } else {
- delete reqs[key];
- }
- }
- });
- }
- function slice(args) {
- var length = args.length;
- var array2 = [];
- for (var i = 0; i < length; i++)
- array2[i] = args[i];
- return array2;
- }
- }
- });
- var require_glob = __commonJS2({
- "node_modules/glob/glob.js"(exports2, module2) {
- module2.exports = glob;
- var rp = require_fs5();
- var minimatch = require_minimatch();
- var Minimatch = minimatch.Minimatch;
- var inherits = require_inherits();
- var EE = require("events").EventEmitter;
- var path = require("path");
- var assert = require("assert");
- var isAbsolute = require_path_is_absolute();
- var globSync = require_sync7();
- var common = require_common3();
- var setopts = common.setopts;
- var ownProp = common.ownProp;
- var inflight = require_inflight();
- var util = require("util");
- var childrenIgnored = common.childrenIgnored;
- var isIgnored = common.isIgnored;
- var once = require_once();
- function glob(pattern, options, cb) {
- if (typeof options === "function")
- cb = options, options = {};
- if (!options)
- options = {};
- if (options.sync) {
- if (cb)
- throw new TypeError("callback provided to sync glob");
- return globSync(pattern, options);
- }
- return new Glob(pattern, options, cb);
- }
- glob.sync = globSync;
- var GlobSync = glob.GlobSync = globSync.GlobSync;
- glob.glob = glob;
- function extend(origin, add) {
- if (add === null || typeof add !== "object") {
- return origin;
- }
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
- }
- glob.hasMagic = function(pattern, options_) {
- var options = extend({}, options_);
- options.noprocess = true;
- var g = new Glob(pattern, options);
- var set = g.minimatch.set;
- if (!pattern)
- return false;
- if (set.length > 1)
- return true;
- for (var j = 0; j < set[0].length; j++) {
- if (typeof set[0][j] !== "string")
- return true;
- }
- return false;
- };
- glob.Glob = Glob;
- inherits(Glob, EE);
- function Glob(pattern, options, cb) {
- if (typeof options === "function") {
- cb = options;
- options = null;
- }
- if (options && options.sync) {
- if (cb)
- throw new TypeError("callback provided to sync glob");
- return new GlobSync(pattern, options);
- }
- if (!(this instanceof Glob))
- return new Glob(pattern, options, cb);
- setopts(this, pattern, options);
- this._didRealPath = false;
- var n = this.minimatch.set.length;
- this.matches = new Array(n);
- if (typeof cb === "function") {
- cb = once(cb);
- this.on("error", cb);
- this.on("end", function(matches) {
- cb(null, matches);
- });
- }
- var self2 = this;
- this._processing = 0;
- this._emitQueue = [];
- this._processQueue = [];
- this.paused = false;
- if (this.noprocess)
- return this;
- if (n === 0)
- return done();
- var sync = true;
- for (var i = 0; i < n; i++) {
- this._process(this.minimatch.set[i], i, false, done);
- }
- sync = false;
- function done() {
- --self2._processing;
- if (self2._processing <= 0) {
- if (sync) {
- process.nextTick(function() {
- self2._finish();
- });
- } else {
- self2._finish();
- }
- }
- }
- }
- Glob.prototype._finish = function() {
- assert(this instanceof Glob);
- if (this.aborted)
- return;
- if (this.realpath && !this._didRealpath)
- return this._realpath();
- common.finish(this);
- this.emit("end", this.found);
- };
- Glob.prototype._realpath = function() {
- if (this._didRealpath)
- return;
- this._didRealpath = true;
- var n = this.matches.length;
- if (n === 0)
- return this._finish();
- var self2 = this;
- for (var i = 0; i < this.matches.length; i++)
- this._realpathSet(i, next);
- function next() {
- if (--n === 0)
- self2._finish();
- }
- };
- Glob.prototype._realpathSet = function(index, cb) {
- var matchset = this.matches[index];
- if (!matchset)
- return cb();
- var found = Object.keys(matchset);
- var self2 = this;
- var n = found.length;
- if (n === 0)
- return cb();
- var set = this.matches[index] = /* @__PURE__ */ Object.create(null);
- found.forEach(function(p, i) {
- p = self2._makeAbs(p);
- rp.realpath(p, self2.realpathCache, function(er, real) {
- if (!er)
- set[real] = true;
- else if (er.syscall === "stat")
- set[p] = true;
- else
- self2.emit("error", er);
- if (--n === 0) {
- self2.matches[index] = set;
- cb();
- }
- });
- });
- };
- Glob.prototype._mark = function(p) {
- return common.mark(this, p);
- };
- Glob.prototype._makeAbs = function(f) {
- return common.makeAbs(this, f);
- };
- Glob.prototype.abort = function() {
- this.aborted = true;
- this.emit("abort");
- };
- Glob.prototype.pause = function() {
- if (!this.paused) {
- this.paused = true;
- this.emit("pause");
- }
- };
- Glob.prototype.resume = function() {
- if (this.paused) {
- this.emit("resume");
- this.paused = false;
- if (this._emitQueue.length) {
- var eq = this._emitQueue.slice(0);
- this._emitQueue.length = 0;
- for (var i = 0; i < eq.length; i++) {
- var e = eq[i];
- this._emitMatch(e[0], e[1]);
- }
- }
- if (this._processQueue.length) {
- var pq = this._processQueue.slice(0);
- this._processQueue.length = 0;
- for (var i = 0; i < pq.length; i++) {
- var p = pq[i];
- this._processing--;
- this._process(p[0], p[1], p[2], p[3]);
- }
- }
- }
- };
- Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
- assert(this instanceof Glob);
- assert(typeof cb === "function");
- if (this.aborted)
- return;
- this._processing++;
- if (this.paused) {
- this._processQueue.push([pattern, index, inGlobStar, cb]);
- return;
- }
- var n = 0;
- while (typeof pattern[n] === "string") {
- n++;
- }
- var prefix;
- switch (n) {
- case pattern.length:
- this._processSimple(pattern.join("/"), index, cb);
- return;
- case 0:
- prefix = null;
- break;
- default:
- prefix = pattern.slice(0, n).join("/");
- break;
- }
- var remain = pattern.slice(n);
- var read;
- if (prefix === null)
- read = ".";
- else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
- return typeof p === "string" ? p : "[*]";
- }).join("/"))) {
- if (!prefix || !isAbsolute(prefix))
- prefix = "/" + prefix;
- read = prefix;
- } else
- read = prefix;
- var abs = this._makeAbs(read);
- if (childrenIgnored(this, read))
- return cb();
- var isGlobStar = remain[0] === minimatch.GLOBSTAR;
- if (isGlobStar)
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
- else
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
- };
- Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
- var self2 = this;
- this._readdir(abs, inGlobStar, function(er, entries) {
- return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
- });
- };
- Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
- if (!entries)
- return cb();
- var pn = remain[0];
- var negate = !!this.minimatch.negate;
- var rawGlob = pn._glob;
- var dotOk = this.dot || rawGlob.charAt(0) === ".";
- var matchedEntries = [];
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i];
- if (e.charAt(0) !== "." || dotOk) {
- var m;
- if (negate && !prefix) {
- m = !e.match(pn);
- } else {
- m = e.match(pn);
- }
- if (m)
- matchedEntries.push(e);
- }
- }
- var len = matchedEntries.length;
- if (len === 0)
- return cb();
- if (remain.length === 1 && !this.mark && !this.stat) {
- if (!this.matches[index])
- this.matches[index] = /* @__PURE__ */ Object.create(null);
- for (var i = 0; i < len; i++) {
- var e = matchedEntries[i];
- if (prefix) {
- if (prefix !== "/")
- e = prefix + "/" + e;
- else
- e = prefix + e;
- }
- if (e.charAt(0) === "/" && !this.nomount) {
- e = path.join(this.root, e);
- }
- this._emitMatch(index, e);
- }
- return cb();
- }
- remain.shift();
- for (var i = 0; i < len; i++) {
- var e = matchedEntries[i];
- var newPattern;
- if (prefix) {
- if (prefix !== "/")
- e = prefix + "/" + e;
- else
- e = prefix + e;
- }
- this._process([e].concat(remain), index, inGlobStar, cb);
- }
- cb();
- };
- Glob.prototype._emitMatch = function(index, e) {
- if (this.aborted)
- return;
- if (isIgnored(this, e))
- return;
- if (this.paused) {
- this._emitQueue.push([index, e]);
- return;
- }
- var abs = isAbsolute(e) ? e : this._makeAbs(e);
- if (this.mark)
- e = this._mark(e);
- if (this.absolute)
- e = abs;
- if (this.matches[index][e])
- return;
- if (this.nodir) {
- var c = this.cache[abs];
- if (c === "DIR" || Array.isArray(c))
- return;
- }
- this.matches[index][e] = true;
- var st = this.statCache[abs];
- if (st)
- this.emit("stat", e, st);
- this.emit("match", e);
- };
- Glob.prototype._readdirInGlobStar = function(abs, cb) {
- if (this.aborted)
- return;
- if (this.follow)
- return this._readdir(abs, false, cb);
- var lstatkey = "lstat\0" + abs;
- var self2 = this;
- var lstatcb = inflight(lstatkey, lstatcb_);
- if (lstatcb)
- self2.fs.lstat(abs, lstatcb);
- function lstatcb_(er, lstat) {
- if (er && er.code === "ENOENT")
- return cb();
- var isSym = lstat && lstat.isSymbolicLink();
- self2.symlinks[abs] = isSym;
- if (!isSym && lstat && !lstat.isDirectory()) {
- self2.cache[abs] = "FILE";
- cb();
- } else
- self2._readdir(abs, false, cb);
- }
- };
- Glob.prototype._readdir = function(abs, inGlobStar, cb) {
- if (this.aborted)
- return;
- cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
- if (!cb)
- return;
- if (inGlobStar && !ownProp(this.symlinks, abs))
- return this._readdirInGlobStar(abs, cb);
- if (ownProp(this.cache, abs)) {
- var c = this.cache[abs];
- if (!c || c === "FILE")
- return cb();
- if (Array.isArray(c))
- return cb(null, c);
- }
- var self2 = this;
- self2.fs.readdir(abs, readdirCb(this, abs, cb));
- };
- function readdirCb(self2, abs, cb) {
- return function(er, entries) {
- if (er)
- self2._readdirError(abs, er, cb);
- else
- self2._readdirEntries(abs, entries, cb);
- };
- }
- Glob.prototype._readdirEntries = function(abs, entries, cb) {
- if (this.aborted)
- return;
- if (!this.mark && !this.stat) {
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i];
- if (abs === "/")
- e = abs + e;
- else
- e = abs + "/" + e;
- this.cache[e] = true;
- }
- }
- this.cache[abs] = entries;
- return cb(null, entries);
- };
- Glob.prototype._readdirError = function(f, er, cb) {
- if (this.aborted)
- return;
- switch (er.code) {
- case "ENOTSUP":
- case "ENOTDIR":
- var abs = this._makeAbs(f);
- this.cache[abs] = "FILE";
- if (abs === this.cwdAbs) {
- var error = new Error(er.code + " invalid cwd " + this.cwd);
- error.path = this.cwd;
- error.code = er.code;
- this.emit("error", error);
- this.abort();
- }
- break;
- case "ENOENT":
- case "ELOOP":
- case "ENAMETOOLONG":
- case "UNKNOWN":
- this.cache[this._makeAbs(f)] = false;
- break;
- default:
- this.cache[this._makeAbs(f)] = false;
- if (this.strict) {
- this.emit("error", er);
- this.abort();
- }
- if (!this.silent)
- console.error("glob error", er);
- break;
- }
- return cb();
- };
- Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
- var self2 = this;
- this._readdir(abs, inGlobStar, function(er, entries) {
- self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
- });
- };
- Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
- if (!entries)
- return cb();
- var remainWithoutGlobStar = remain.slice(1);
- var gspref = prefix ? [prefix] : [];
- var noGlobStar = gspref.concat(remainWithoutGlobStar);
- this._process(noGlobStar, index, false, cb);
- var isSym = this.symlinks[abs];
- var len = entries.length;
- if (isSym && inGlobStar)
- return cb();
- for (var i = 0; i < len; i++) {
- var e = entries[i];
- if (e.charAt(0) === "." && !this.dot)
- continue;
- var instead = gspref.concat(entries[i], remainWithoutGlobStar);
- this._process(instead, index, true, cb);
- var below = gspref.concat(entries[i], remain);
- this._process(below, index, true, cb);
- }
- cb();
- };
- Glob.prototype._processSimple = function(prefix, index, cb) {
- var self2 = this;
- this._stat(prefix, function(er, exists) {
- self2._processSimple2(prefix, index, er, exists, cb);
- });
- };
- Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
- if (!this.matches[index])
- this.matches[index] = /* @__PURE__ */ Object.create(null);
- if (!exists)
- return cb();
- if (prefix && isAbsolute(prefix) && !this.nomount) {
- var trail = /[\/\\]$/.test(prefix);
- if (prefix.charAt(0) === "/") {
- prefix = path.join(this.root, prefix);
- } else {
- prefix = path.resolve(this.root, prefix);
- if (trail)
- prefix += "/";
- }
- }
- if (process.platform === "win32")
- prefix = prefix.replace(/\\/g, "/");
- this._emitMatch(index, prefix);
- cb();
- };
- Glob.prototype._stat = function(f, cb) {
- var abs = this._makeAbs(f);
- var needDir = f.slice(-1) === "/";
- if (f.length > this.maxLength)
- return cb();
- if (!this.stat && ownProp(this.cache, abs)) {
- var c = this.cache[abs];
- if (Array.isArray(c))
- c = "DIR";
- if (!needDir || c === "DIR")
- return cb(null, c);
- if (needDir && c === "FILE")
- return cb();
- }
- var exists;
- var stat = this.statCache[abs];
- if (stat !== void 0) {
- if (stat === false)
- return cb(null, stat);
- else {
- var type = stat.isDirectory() ? "DIR" : "FILE";
- if (needDir && type === "FILE")
- return cb();
- else
- return cb(null, type, stat);
- }
- }
- var self2 = this;
- var statcb = inflight("stat\0" + abs, lstatcb_);
- if (statcb)
- self2.fs.lstat(abs, statcb);
- function lstatcb_(er, lstat) {
- if (lstat && lstat.isSymbolicLink()) {
- return self2.fs.stat(abs, function(er2, stat2) {
- if (er2)
- self2._stat2(f, abs, null, lstat, cb);
- else
- self2._stat2(f, abs, er2, stat2, cb);
- });
- } else {
- self2._stat2(f, abs, er, lstat, cb);
- }
- }
- };
- Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
- if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
- this.statCache[abs] = false;
- return cb();
- }
- var needDir = f.slice(-1) === "/";
- this.statCache[abs] = stat;
- if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
- return cb(null, false, stat);
- var c = true;
- if (stat)
- c = stat.isDirectory() ? "DIR" : "FILE";
- this.cache[abs] = this.cache[abs] || c;
- if (needDir && c === "FILE")
- return cb();
- return cb(null, c, stat);
- };
- }
- });
- var require_rimraf = __commonJS2({
- "node_modules/rimraf/rimraf.js"(exports2, module2) {
- var assert = require("assert");
- var path = require("path");
- var fs = require("fs");
- var glob = void 0;
- try {
- glob = require_glob();
- } catch (_err) {
- }
- var defaultGlobOpts = {
- nosort: true,
- silent: true
- };
- var timeout = 0;
- var isWindows = process.platform === "win32";
- var defaults = (options) => {
- const methods = ["unlink", "chmod", "stat", "lstat", "rmdir", "readdir"];
- methods.forEach((m) => {
- options[m] = options[m] || fs[m];
- m = m + "Sync";
- options[m] = options[m] || fs[m];
- });
- options.maxBusyTries = options.maxBusyTries || 3;
- options.emfileWait = options.emfileWait || 1e3;
- if (options.glob === false) {
- options.disableGlob = true;
- }
- if (options.disableGlob !== true && glob === void 0) {
- throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
- }
- options.disableGlob = options.disableGlob || false;
- options.glob = options.glob || defaultGlobOpts;
- };
- var rimraf = (p, options, cb) => {
- if (typeof options === "function") {
- cb = options;
- options = {};
- }
- assert(p, "rimraf: missing path");
- assert.equal(typeof p, "string", "rimraf: path should be a string");
- assert.equal(typeof cb, "function", "rimraf: callback function required");
- assert(options, "rimraf: invalid options argument provided");
- assert.equal(typeof options, "object", "rimraf: options should be object");
- defaults(options);
- let busyTries = 0;
- let errState = null;
- let n = 0;
- const next = (er) => {
- errState = errState || er;
- if (--n === 0)
- cb(errState);
- };
- const afterGlob = (er, results) => {
- if (er)
- return cb(er);
- n = results.length;
- if (n === 0)
- return cb();
- results.forEach((p2) => {
- const CB = (er2) => {
- if (er2) {
- if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
- busyTries++;
- return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
- }
- if (er2.code === "EMFILE" && timeout < options.emfileWait) {
- return setTimeout(() => rimraf_(p2, options, CB), timeout++);
- }
- if (er2.code === "ENOENT")
- er2 = null;
- }
- timeout = 0;
- next(er2);
- };
- rimraf_(p2, options, CB);
- });
- };
- if (options.disableGlob || !glob.hasMagic(p))
- return afterGlob(null, [p]);
- options.lstat(p, (er, stat) => {
- if (!er)
- return afterGlob(null, [p]);
- glob(p, options.glob, afterGlob);
- });
- };
- var rimraf_ = (p, options, cb) => {
- assert(p);
- assert(options);
- assert(typeof cb === "function");
- options.lstat(p, (er, st) => {
- if (er && er.code === "ENOENT")
- return cb(null);
- if (er && er.code === "EPERM" && isWindows)
- fixWinEPERM(p, options, er, cb);
- if (st && st.isDirectory())
- return rmdir(p, options, er, cb);
- options.unlink(p, (er2) => {
- if (er2) {
- if (er2.code === "ENOENT")
- return cb(null);
- if (er2.code === "EPERM")
- return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
- if (er2.code === "EISDIR")
- return rmdir(p, options, er2, cb);
- }
- return cb(er2);
- });
- });
- };
- var fixWinEPERM = (p, options, er, cb) => {
- assert(p);
- assert(options);
- assert(typeof cb === "function");
- options.chmod(p, 438, (er2) => {
- if (er2)
- cb(er2.code === "ENOENT" ? null : er);
- else
- options.stat(p, (er3, stats) => {
- if (er3)
- cb(er3.code === "ENOENT" ? null : er);
- else if (stats.isDirectory())
- rmdir(p, options, er, cb);
- else
- options.unlink(p, cb);
- });
- });
- };
- var fixWinEPERMSync = (p, options, er) => {
- assert(p);
- assert(options);
- try {
- options.chmodSync(p, 438);
- } catch (er2) {
- if (er2.code === "ENOENT")
- return;
- else
- throw er;
- }
- let stats;
- try {
- stats = options.statSync(p);
- } catch (er3) {
- if (er3.code === "ENOENT")
- return;
- else
- throw er;
- }
- if (stats.isDirectory())
- rmdirSync(p, options, er);
- else
- options.unlinkSync(p);
- };
- var rmdir = (p, options, originalEr, cb) => {
- assert(p);
- assert(options);
- assert(typeof cb === "function");
- options.rmdir(p, (er) => {
- if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
- rmkids(p, options, cb);
- else if (er && er.code === "ENOTDIR")
- cb(originalEr);
- else
- cb(er);
- });
- };
- var rmkids = (p, options, cb) => {
- assert(p);
- assert(options);
- assert(typeof cb === "function");
- options.readdir(p, (er, files) => {
- if (er)
- return cb(er);
- let n = files.length;
- if (n === 0)
- return options.rmdir(p, cb);
- let errState;
- files.forEach((f) => {
- rimraf(path.join(p, f), options, (er2) => {
- if (errState)
- return;
- if (er2)
- return cb(errState = er2);
- if (--n === 0)
- options.rmdir(p, cb);
- });
- });
- });
- };
- var rimrafSync = (p, options) => {
- options = options || {};
- defaults(options);
- assert(p, "rimraf: missing path");
- assert.equal(typeof p, "string", "rimraf: path should be a string");
- assert(options, "rimraf: missing options");
- assert.equal(typeof options, "object", "rimraf: options should be object");
- let results;
- if (options.disableGlob || !glob.hasMagic(p)) {
- results = [p];
- } else {
- try {
- options.lstatSync(p);
- results = [p];
- } catch (er) {
- results = glob.sync(p, options.glob);
- }
- }
- if (!results.length)
- return;
- for (let i = 0; i < results.length; i++) {
- const p2 = results[i];
- let st;
- try {
- st = options.lstatSync(p2);
- } catch (er) {
- if (er.code === "ENOENT")
- return;
- if (er.code === "EPERM" && isWindows)
- fixWinEPERMSync(p2, options, er);
- }
- try {
- if (st && st.isDirectory())
- rmdirSync(p2, options, null);
- else
- options.unlinkSync(p2);
- } catch (er) {
- if (er.code === "ENOENT")
- return;
- if (er.code === "EPERM")
- return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
- if (er.code !== "EISDIR")
- throw er;
- rmdirSync(p2, options, er);
- }
- }
- };
- var rmdirSync = (p, options, originalEr) => {
- assert(p);
- assert(options);
- try {
- options.rmdirSync(p);
- } catch (er) {
- if (er.code === "ENOENT")
- return;
- if (er.code === "ENOTDIR")
- throw originalEr;
- if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
- rmkidsSync(p, options);
- }
- };
- var rmkidsSync = (p, options) => {
- assert(p);
- assert(options);
- options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options));
- const retries = isWindows ? 100 : 1;
- let i = 0;
- do {
- let threw = true;
- try {
- const ret = options.rmdirSync(p, options);
- threw = false;
- return ret;
- } finally {
- if (++i < retries && threw)
- continue;
- }
- } while (true);
- };
- module2.exports = rimraf;
- rimraf.sync = rimrafSync;
- }
- });
- var require_del = __commonJS2({
- "node_modules/flat-cache/src/del.js"(exports2, module2) {
- var rimraf = require_rimraf().sync;
- var fs = require("fs");
- module2.exports = function del(file) {
- if (fs.existsSync(file)) {
- rimraf(file, {
- glob: false
- });
- return true;
- }
- return false;
- };
- }
- });
- var require_cache = __commonJS2({
- "node_modules/flat-cache/src/cache.js"(exports2, module2) {
- var path = require("path");
- var fs = require("fs");
- var utils = require_utils6();
- var del = require_del();
- var writeJSON = utils.writeJSON;
- var cache = {
- load: function(docId, cacheDir) {
- var me = this;
- me._visited = {};
- me._persisted = {};
- me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
- if (fs.existsSync(me._pathToFile)) {
- me._persisted = utils.tryParse(me._pathToFile, {});
- }
- },
- loadFile: function(pathToFile) {
- var me = this;
- var dir = path.dirname(pathToFile);
- var fName = path.basename(pathToFile);
- me.load(fName, dir);
- },
- all: function() {
- return this._persisted;
- },
- keys: function() {
- return Object.keys(this._persisted);
- },
- setKey: function(key, value) {
- this._visited[key] = true;
- this._persisted[key] = value;
- },
- removeKey: function(key) {
- delete this._visited[key];
- delete this._persisted[key];
- },
- getKey: function(key) {
- this._visited[key] = true;
- return this._persisted[key];
- },
- _prune: function() {
- var me = this;
- var obj = {};
- var keys = Object.keys(me._visited);
- if (keys.length === 0) {
- return;
- }
- keys.forEach(function(key) {
- obj[key] = me._persisted[key];
- });
- me._visited = {};
- me._persisted = obj;
- },
- save: function(noPrune) {
- var me = this;
- !noPrune && me._prune();
- writeJSON(me._pathToFile, me._persisted);
- },
- removeCacheFile: function() {
- return del(this._pathToFile);
- },
- destroy: function() {
- var me = this;
- me._visited = {};
- me._persisted = {};
- me.removeCacheFile();
- }
- };
- module2.exports = {
- load: function(docId, cacheDir) {
- return this.create(docId, cacheDir);
- },
- create: function(docId, cacheDir) {
- var obj = Object.create(cache);
- obj.load(docId, cacheDir);
- return obj;
- },
- createFromFile: function(filePath) {
- var obj = Object.create(cache);
- obj.loadFile(filePath);
- return obj;
- },
- clearCacheById: function(docId, cacheDir) {
- var filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
- return del(filePath);
- },
- clearAll: function(cacheDir) {
- var filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, "../.cache/");
- return del(filePath);
- }
- };
- }
- });
- var require_cache2 = __commonJS2({
- "node_modules/file-entry-cache/cache.js"(exports2, module2) {
- var path = require("path");
- var crypto = require("crypto");
- module2.exports = {
- createFromFile: function(filePath, useChecksum) {
- var fname = path.basename(filePath);
- var dir = path.dirname(filePath);
- return this.create(fname, dir, useChecksum);
- },
- create: function(cacheId, _path, useChecksum) {
- var fs = require("fs");
- var flatCache = require_cache();
- var cache = flatCache.load(cacheId, _path);
- var normalizedEntries = {};
- var removeNotFoundFiles = function removeNotFoundFiles2() {
- const cachedEntries = cache.keys();
- cachedEntries.forEach(function remover(fPath) {
- try {
- fs.statSync(fPath);
- } catch (err) {
- if (err.code === "ENOENT") {
- cache.removeKey(fPath);
- }
- }
- });
- };
- removeNotFoundFiles();
- return {
- cache,
- getHash: function(buffer) {
- return crypto.createHash("md5").update(buffer).digest("hex");
- },
- hasFileChanged: function(file) {
- return this.getFileDescriptor(file).changed;
- },
- analyzeFiles: function(files) {
- var me = this;
- files = files || [];
- var res = {
- changedFiles: [],
- notFoundFiles: [],
- notChangedFiles: []
- };
- me.normalizeEntries(files).forEach(function(entry) {
- if (entry.changed) {
- res.changedFiles.push(entry.key);
- return;
- }
- if (entry.notFound) {
- res.notFoundFiles.push(entry.key);
- return;
- }
- res.notChangedFiles.push(entry.key);
- });
- return res;
- },
- getFileDescriptor: function(file) {
- var fstat;
- try {
- fstat = fs.statSync(file);
- } catch (ex) {
- this.removeEntry(file);
- return {
- key: file,
- notFound: true,
- err: ex
- };
- }
- if (useChecksum) {
- return this._getFileDescriptorUsingChecksum(file);
- }
- return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
- },
- _getFileDescriptorUsingMtimeAndSize: function(file, fstat) {
- var meta = cache.getKey(file);
- var cacheExists = !!meta;
- var cSize = fstat.size;
- var cTime = fstat.mtime.getTime();
- var isDifferentDate;
- var isDifferentSize;
- if (!meta) {
- meta = {
- size: cSize,
- mtime: cTime
- };
- } else {
- isDifferentDate = cTime !== meta.mtime;
- isDifferentSize = cSize !== meta.size;
- }
- var nEntry = normalizedEntries[file] = {
- key: file,
- changed: !cacheExists || isDifferentDate || isDifferentSize,
- meta
- };
- return nEntry;
- },
- _getFileDescriptorUsingChecksum: function(file) {
- var meta = cache.getKey(file);
- var cacheExists = !!meta;
- var contentBuffer;
- try {
- contentBuffer = fs.readFileSync(file);
- } catch (ex) {
- contentBuffer = "";
- }
- var isDifferent = true;
- var hash = this.getHash(contentBuffer);
- if (!meta) {
- meta = {
- hash
- };
- } else {
- isDifferent = hash !== meta.hash;
- }
- var nEntry = normalizedEntries[file] = {
- key: file,
- changed: !cacheExists || isDifferent,
- meta
- };
- return nEntry;
- },
- getUpdatedFiles: function(files) {
- var me = this;
- files = files || [];
- return me.normalizeEntries(files).filter(function(entry) {
- return entry.changed;
- }).map(function(entry) {
- return entry.key;
- });
- },
- normalizeEntries: function(files) {
- files = files || [];
- var me = this;
- var nEntries = files.map(function(file) {
- return me.getFileDescriptor(file);
- });
- return nEntries;
- },
- removeEntry: function(entryName) {
- delete normalizedEntries[entryName];
- cache.removeKey(entryName);
- },
- deleteCacheFile: function() {
- cache.removeCacheFile();
- },
- destroy: function() {
- normalizedEntries = {};
- cache.destroy();
- },
- _getMetaForFileUsingCheckSum: function(cacheEntry) {
- var contentBuffer = fs.readFileSync(cacheEntry.key);
- var hash = this.getHash(contentBuffer);
- var meta = Object.assign(cacheEntry.meta, {
- hash
- });
- delete meta.size;
- delete meta.mtime;
- return meta;
- },
- _getMetaForFileUsingMtimeAndSize: function(cacheEntry) {
- var stat = fs.statSync(cacheEntry.key);
- var meta = Object.assign(cacheEntry.meta, {
- size: stat.size,
- mtime: stat.mtime.getTime()
- });
- delete meta.hash;
- return meta;
- },
- reconcile: function(noPrune) {
- removeNotFoundFiles();
- noPrune = typeof noPrune === "undefined" ? true : noPrune;
- var entries = normalizedEntries;
- var keys = Object.keys(entries);
- if (keys.length === 0) {
- return;
- }
- var me = this;
- keys.forEach(function(entryName) {
- var cacheEntry = entries[entryName];
- try {
- var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
- cache.setKey(entryName, meta);
- } catch (err) {
- if (err.code !== "ENOENT") {
- throw err;
- }
- }
- });
- cache.save(noPrune);
- }
- };
- }
- };
- }
- });
- var require_format_results_cache = __commonJS2({
- "src/cli/format-results-cache.js"(exports2, module2) {
- "use strict";
- var fileEntryCache = require_cache2();
- var stringify2 = require_fast_json_stable_stringify();
- var {
- version: prettierVersion
- } = require("./index.js");
- var {
- createHash
- } = require_utils();
- var optionsHashCache = /* @__PURE__ */ new WeakMap();
- var nodeVersion = process && process.version;
- function getHashOfOptions(options) {
- if (optionsHashCache.has(options)) {
- return optionsHashCache.get(options);
- }
- const hash = createHash(`${prettierVersion}_${nodeVersion}_${stringify2(options)}`);
- optionsHashCache.set(options, hash);
- return hash;
- }
- function getMetadataFromFileDescriptor(fileDescriptor) {
- return fileDescriptor.meta;
- }
- var FormatResultsCache = class {
- constructor(cacheFileLocation, cacheStrategy) {
- const useChecksum = cacheStrategy === "content";
- this.cacheFileLocation = cacheFileLocation;
- this.fileEntryCache = fileEntryCache.create(cacheFileLocation, void 0, useChecksum);
- }
- existsAvailableFormatResultsCache(filePath, options) {
- const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
- if (fileDescriptor.notFound) {
- return false;
- }
- const hashOfOptions = getHashOfOptions(options);
- const meta = getMetadataFromFileDescriptor(fileDescriptor);
- const changed = fileDescriptor.changed || meta.hashOfOptions !== hashOfOptions;
- return !changed;
- }
- setFormatResultsCache(filePath, options) {
- const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
- const meta = getMetadataFromFileDescriptor(fileDescriptor);
- if (fileDescriptor && !fileDescriptor.notFound) {
- meta.hashOfOptions = getHashOfOptions(options);
- }
- }
- removeFormatResultsCache(filePath) {
- this.fileEntryCache.removeEntry(filePath);
- }
- reconcile() {
- this.fileEntryCache.reconcile();
- }
- };
- module2.exports = FormatResultsCache;
- }
- });
- var require_base = __commonJS2({
- "node_modules/diff/lib/diff/base.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2["default"] = Diff;
- function Diff() {
- }
- Diff.prototype = {
- diff: function diff(oldString, newString) {
- var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var callback = options.callback;
- if (typeof options === "function") {
- callback = options;
- options = {};
- }
- this.options = options;
- var self2 = this;
- function done(value) {
- if (callback) {
- setTimeout(function() {
- callback(void 0, value);
- }, 0);
- return true;
- } else {
- return value;
- }
- }
- oldString = this.castInput(oldString);
- newString = this.castInput(newString);
- oldString = this.removeEmpty(this.tokenize(oldString));
- newString = this.removeEmpty(this.tokenize(newString));
- var newLen = newString.length, oldLen = oldString.length;
- var editLength = 1;
- var maxEditLength = newLen + oldLen;
- var bestPath = [{
- newPos: -1,
- components: []
- }];
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
- if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
- return done([{
- value: this.join(newString),
- count: newString.length
- }]);
- }
- function execEditLength() {
- for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
- var basePath = void 0;
- var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
- if (addPath) {
- bestPath[diagonalPath - 1] = void 0;
- }
- var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
- if (!canAdd && !canRemove) {
- bestPath[diagonalPath] = void 0;
- continue;
- }
- if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
- basePath = clonePath(removePath);
- self2.pushComponent(basePath.components, void 0, true);
- } else {
- basePath = addPath;
- basePath.newPos++;
- self2.pushComponent(basePath.components, true, void 0);
- }
- _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath);
- if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
- return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken));
- } else {
- bestPath[diagonalPath] = basePath;
- }
- }
- editLength++;
- }
- if (callback) {
- (function exec() {
- setTimeout(function() {
- if (editLength > maxEditLength) {
- return callback();
- }
- if (!execEditLength()) {
- exec();
- }
- }, 0);
- })();
- } else {
- while (editLength <= maxEditLength) {
- var ret = execEditLength();
- if (ret) {
- return ret;
- }
- }
- }
- },
- pushComponent: function pushComponent(components, added, removed) {
- var last = components[components.length - 1];
- if (last && last.added === added && last.removed === removed) {
- components[components.length - 1] = {
- count: last.count + 1,
- added,
- removed
- };
- } else {
- components.push({
- count: 1,
- added,
- removed
- });
- }
- },
- extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
- var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
- while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
- newPos++;
- oldPos++;
- commonCount++;
- }
- if (commonCount) {
- basePath.components.push({
- count: commonCount
- });
- }
- basePath.newPos = newPos;
- return oldPos;
- },
- equals: function equals(left, right) {
- if (this.options.comparator) {
- return this.options.comparator(left, right);
- } else {
- return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
- }
- },
- removeEmpty: function removeEmpty(array2) {
- var ret = [];
- for (var i = 0; i < array2.length; i++) {
- if (array2[i]) {
- ret.push(array2[i]);
- }
- }
- return ret;
- },
- castInput: function castInput(value) {
- return value;
- },
- tokenize: function tokenize(value) {
- return value.split("");
- },
- join: function join(chars) {
- return chars.join("");
- }
- };
- function buildValues(diff, components, newString, oldString, useLongestToken) {
- var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
- for (; componentPos < componentLen; componentPos++) {
- var component = components[componentPos];
- if (!component.removed) {
- if (!component.added && useLongestToken) {
- var value = newString.slice(newPos, newPos + component.count);
- value = value.map(function(value2, i) {
- var oldValue = oldString[oldPos + i];
- return oldValue.length > value2.length ? oldValue : value2;
- });
- component.value = diff.join(value);
- } else {
- component.value = diff.join(newString.slice(newPos, newPos + component.count));
- }
- newPos += component.count;
- if (!component.added) {
- oldPos += component.count;
- }
- } else {
- component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
- oldPos += component.count;
- if (componentPos && components[componentPos - 1].added) {
- var tmp = components[componentPos - 1];
- components[componentPos - 1] = components[componentPos];
- components[componentPos] = tmp;
- }
- }
- }
- var lastComponent = components[componentLen - 1];
- if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
- components[componentLen - 2].value += lastComponent.value;
- components.pop();
- }
- return components;
- }
- function clonePath(path) {
- return {
- newPos: path.newPos,
- components: path.components.slice(0)
- };
- }
- }
- });
- var require_params = __commonJS2({
- "node_modules/diff/lib/util/params.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.generateOptions = generateOptions;
- function generateOptions(options, defaults) {
- if (typeof options === "function") {
- defaults.callback = options;
- } else if (options) {
- for (var name in options) {
- if (options.hasOwnProperty(name)) {
- defaults[name] = options[name];
- }
- }
- }
- return defaults;
- }
- }
- });
- var require_line = __commonJS2({
- "node_modules/diff/lib/diff/line.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.diffLines = diffLines;
- exports2.diffTrimmedLines = diffTrimmedLines;
- exports2.lineDiff = void 0;
- var _base = _interopRequireDefault(require_base());
- var _params = require_params();
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- var lineDiff = new _base["default"]();
- exports2.lineDiff = lineDiff;
- lineDiff.tokenize = function(value) {
- var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
- if (!linesAndNewlines[linesAndNewlines.length - 1]) {
- linesAndNewlines.pop();
- }
- for (var i = 0; i < linesAndNewlines.length; i++) {
- var line = linesAndNewlines[i];
- if (i % 2 && !this.options.newlineIsToken) {
- retLines[retLines.length - 1] += line;
- } else {
- if (this.options.ignoreWhitespace) {
- line = line.trim();
- }
- retLines.push(line);
- }
- }
- return retLines;
- };
- function diffLines(oldStr, newStr, callback) {
- return lineDiff.diff(oldStr, newStr, callback);
- }
- function diffTrimmedLines(oldStr, newStr, callback) {
- var options = (0, _params.generateOptions)(callback, {
- ignoreWhitespace: true
- });
- return lineDiff.diff(oldStr, newStr, options);
- }
- }
- });
- var require_create = __commonJS2({
- "node_modules/diff/lib/patch/create.js"(exports2) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.structuredPatch = structuredPatch;
- exports2.formatPatch = formatPatch;
- exports2.createTwoFilesPatch = createTwoFilesPatch;
- exports2.createPatch = createPatch;
- var _line = require_line();
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o)
- return;
- if (typeof o === "string")
- return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor)
- n = o.constructor.name;
- if (n === "Map" || n === "Set")
- return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
- return _arrayLikeToArray(o, minLen);
- }
- function _iterableToArray(iter) {
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
- return Array.from(iter);
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr))
- return _arrayLikeToArray(arr);
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i];
- }
- return arr2;
- }
- function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
- if (!options) {
- options = {};
- }
- if (typeof options.context === "undefined") {
- options.context = 4;
- }
- var diff = (0, _line.diffLines)(oldStr, newStr, options);
- diff.push({
- value: "",
- lines: []
- });
- function contextLines(lines) {
- return lines.map(function(entry) {
- return " " + entry;
- });
- }
- var hunks = [];
- var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
- var _loop = function _loop2(i2) {
- var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
- current.lines = lines;
- if (current.added || current.removed) {
- var _curRange;
- if (!oldRangeStart) {
- var prev = diff[i2 - 1];
- oldRangeStart = oldLine;
- newRangeStart = newLine;
- if (prev) {
- curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
- oldRangeStart -= curRange.length;
- newRangeStart -= curRange.length;
- }
- }
- (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
- return (current.added ? "+" : "-") + entry;
- })));
- if (current.added) {
- newLine += lines.length;
- } else {
- oldLine += lines.length;
- }
- } else {
- if (oldRangeStart) {
- if (lines.length <= options.context * 2 && i2 < diff.length - 2) {
- var _curRange2;
- (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
- } else {
- var _curRange3;
- var contextSize = Math.min(lines.length, options.context);
- (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
- var hunk = {
- oldStart: oldRangeStart,
- oldLines: oldLine - oldRangeStart + contextSize,
- newStart: newRangeStart,
- newLines: newLine - newRangeStart + contextSize,
- lines: curRange
- };
- if (i2 >= diff.length - 2 && lines.length <= options.context) {
- var oldEOFNewline = /\n$/.test(oldStr);
- var newEOFNewline = /\n$/.test(newStr);
- var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
- if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
- curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file");
- }
- if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
- curRange.push("\\ No newline at end of file");
- }
- }
- hunks.push(hunk);
- oldRangeStart = 0;
- newRangeStart = 0;
- curRange = [];
- }
- }
- oldLine += lines.length;
- newLine += lines.length;
- }
- };
- for (var i = 0; i < diff.length; i++) {
- _loop(i);
- }
- return {
- oldFileName,
- newFileName,
- oldHeader,
- newHeader,
- hunks
- };
- }
- function formatPatch(diff) {
- var ret = [];
- if (diff.oldFileName == diff.newFileName) {
- ret.push("Index: " + diff.oldFileName);
- }
- ret.push("===================================================================");
- ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
- ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
- for (var i = 0; i < diff.hunks.length; i++) {
- var hunk = diff.hunks[i];
- if (hunk.oldLines === 0) {
- hunk.oldStart -= 1;
- }
- if (hunk.newLines === 0) {
- hunk.newStart -= 1;
- }
- ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
- ret.push.apply(ret, hunk.lines);
- }
- return ret.join("\n") + "\n";
- }
- function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
- return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
- }
- function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
- return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
- }
- }
- });
- var require_format = __commonJS2({
- "src/cli/format.js"(exports2, module2) {
- "use strict";
- var {
- promises: fs
- } = require("fs");
- var path = require("path");
- var {
- default: chalk2
- } = (init_source(), __toCommonJS(source_exports));
- var prettier2 = require("./index.js");
- var {
- getStdin
- } = require("./third-party.js");
- var {
- createIgnorer,
- errors
- } = require_prettier_internal();
- var {
- expandPatterns,
- fixWindowsSlashes
- } = require_expand_patterns();
- var getOptionsForFile = require_get_options_for_file();
- var isTTY = require_is_tty();
- var findCacheFile = require_find_cache_file();
- var FormatResultsCache = require_format_results_cache();
- var {
- statSafe
- } = require_utils();
- function diff(a, b) {
- return require_create().createTwoFilesPatch("", "", a, b, "", "", {
- context: 2
- });
- }
- function handleError(context, filename, error, printedFilename) {
- if (error instanceof errors.UndefinedParserError) {
- if ((context.argv.write || context.argv.ignoreUnknown) && printedFilename) {
- printedFilename.clear();
- }
- if (context.argv.ignoreUnknown) {
- return;
- }
- if (!context.argv.check && !context.argv.listDifferent) {
- process.exitCode = 2;
- }
- context.logger.error(error.message);
- return;
- }
- if (context.argv.write) {
- process.stdout.write("\n");
- }
- const isParseError = Boolean(error && error.loc);
- const isValidationError = /^Invalid \S+ value\./.test(error && error.message);
- if (isParseError) {
- context.logger.error(`${filename}: ${String(error)}`);
- } else if (isValidationError || error instanceof errors.ConfigError) {
- context.logger.error(error.message);
- process.exit(1);
- } else if (error instanceof errors.DebugError) {
- context.logger.error(`${filename}: ${error.message}`);
- } else {
- context.logger.error(filename + ": " + (error.stack || error));
- }
- process.exitCode = 2;
- }
- function writeOutput(context, result, options) {
- process.stdout.write(context.argv.debugCheck ? result.filepath : result.formatted);
- if (options && options.cursorOffset >= 0) {
- process.stderr.write(result.cursorOffset + "\n");
- }
- }
- function listDifferent(context, input, options, filename) {
- if (!context.argv.check && !context.argv.listDifferent) {
- return;
- }
- try {
- if (!options.filepath && !options.parser) {
- throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
- }
- if (!prettier2.check(input, options)) {
- if (!context.argv.write) {
- context.logger.log(filename);
- process.exitCode = 1;
- }
- }
- } catch (error) {
- context.logger.error(error.message);
- }
- return true;
- }
- function format(context, input, opt) {
- if (!opt.parser && !opt.filepath) {
- throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
- }
- if (context.argv.debugPrintDoc) {
- const doc = prettier2.__debug.printToDoc(input, opt);
- return {
- formatted: prettier2.__debug.formatDoc(doc) + "\n"
- };
- }
- if (context.argv.debugPrintComments) {
- return {
- formatted: prettier2.format(JSON.stringify(prettier2.formatWithCursor(input, opt).comments || []), {
- parser: "json"
- })
- };
- }
- if (context.argv.debugPrintAst) {
- const {
- ast
- } = prettier2.__debug.parse(input, opt);
- return {
- formatted: JSON.stringify(ast)
- };
- }
- if (context.argv.debugCheck) {
- const pp = prettier2.format(input, opt);
- const pppp = prettier2.format(pp, opt);
- if (pp !== pppp) {
- throw new errors.DebugError("prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp));
- } else {
- const stringify2 = (obj) => JSON.stringify(obj, null, 2);
- const ast = stringify2(prettier2.__debug.parse(input, opt, true).ast);
- const past = stringify2(prettier2.__debug.parse(pp, opt, true).ast);
- if (ast !== past) {
- const MAX_AST_SIZE = 2097152;
- const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past);
- throw new errors.DebugError("ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp));
- }
- }
- return {
- formatted: pp,
- filepath: opt.filepath || "(stdin)\n"
- };
- }
- const {
- performanceTestFlag
- } = context;
- if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugBenchmark) {
- let benchmark;
- try {
- benchmark = require("benchmark");
- } catch {
- context.logger.debug("'--debug-benchmark' requires the 'benchmark' package to be installed.");
- process.exit(2);
- }
- context.logger.debug("'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module.");
- const suite = new benchmark.Suite();
- suite.add("format", () => {
- prettier2.formatWithCursor(input, opt);
- }).on("cycle", (event) => {
- const results = {
- benchmark: String(event.target),
- hz: event.target.hz,
- ms: event.target.times.cycle * 1e3
- };
- context.logger.debug("'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
- }).run({
- async: false
- });
- } else if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugRepeat) {
- const repeat = context.argv.debugRepeat;
- context.logger.debug("'--debug-repeat' option found, running formatWithCursor " + repeat + " times.");
- let totalMs = 0;
- for (let i = 0; i < repeat; ++i) {
- const startMs = Date.now();
- prettier2.formatWithCursor(input, opt);
- totalMs += Date.now() - startMs;
- }
- const averageMs = totalMs / repeat;
- const results = {
- repeat,
- hz: 1e3 / averageMs,
- ms: averageMs
- };
- context.logger.debug("'--debug-repeat' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
- }
- return prettier2.formatWithCursor(input, opt);
- }
- async function createIgnorerFromContextOrDie(context) {
- try {
- return await createIgnorer(context.argv.ignorePath, context.argv.withNodeModules);
- } catch (e) {
- context.logger.error(e.message);
- process.exit(2);
- }
- }
- async function formatStdin2(context) {
- const filepath = context.argv.filepath ? path.resolve(process.cwd(), context.argv.filepath) : process.cwd();
- const ignorer = await createIgnorerFromContextOrDie(context);
- const relativeFilepath = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filepath) : path.relative(process.cwd(), filepath);
- try {
- const input = await getStdin();
- if (relativeFilepath && ignorer.ignores(fixWindowsSlashes(relativeFilepath))) {
- writeOutput(context, {
- formatted: input
- });
- return;
- }
- const options = await getOptionsForFile(context, filepath);
- if (listDifferent(context, input, options, "(stdin)")) {
- return;
- }
- const formatted = format(context, input, options);
- const {
- performanceTestFlag
- } = context;
- if (performanceTestFlag) {
- context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code to screen.`);
- return;
- }
- writeOutput(context, formatted, options);
- } catch (error) {
- handleError(context, relativeFilepath || "stdin", error);
- }
- }
- async function formatFiles2(context) {
- var _formatResultsCache4;
- const ignorer = await createIgnorerFromContextOrDie(context);
- let numberOfUnformattedFilesFound = 0;
- const {
- performanceTestFlag
- } = context;
- if (context.argv.check && !performanceTestFlag) {
- context.logger.log("Checking formatting...");
- }
- let formatResultsCache;
- const cacheFilePath = await findCacheFile(context.argv.cacheLocation);
- if (context.argv.cache) {
- formatResultsCache = new FormatResultsCache(cacheFilePath, context.argv.cacheStrategy || "content");
- } else {
- if (context.argv.cacheStrategy) {
- context.logger.error("`--cache-strategy` cannot be used without `--cache`.");
- process.exit(2);
- }
- if (!context.argv.cacheLocation) {
- const stat = await statSafe(cacheFilePath);
- if (stat) {
- await fs.unlink(cacheFilePath);
- }
- }
- }
- for await (const pathOrError of expandPatterns(context)) {
- var _formatResultsCache;
- if (typeof pathOrError === "object") {
- context.logger.error(pathOrError.error);
- process.exitCode = 2;
- continue;
- }
- const filename = pathOrError;
- const ignoreFilename = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filename) : filename;
- const fileIgnored = ignorer.ignores(fixWindowsSlashes(ignoreFilename));
- if (fileIgnored && (context.argv.debugCheck || context.argv.write || context.argv.check || context.argv.listDifferent)) {
- continue;
- }
- const options = Object.assign(Object.assign({}, await getOptionsForFile(context, filename)), {}, {
- filepath: filename
- });
- let printedFilename;
- if (isTTY()) {
- printedFilename = context.logger.log(filename, {
- newline: false,
- clearable: true
- });
- }
- let input;
- try {
- input = await fs.readFile(filename, "utf8");
- } catch (error) {
- context.logger.log("");
- context.logger.error(`Unable to read file: ${filename}
- ${error.message}`);
- process.exitCode = 2;
- continue;
- }
- if (fileIgnored) {
- writeOutput(context, {
- formatted: input
- }, options);
- continue;
- }
- const start = Date.now();
- const isCacheExists = (_formatResultsCache = formatResultsCache) === null || _formatResultsCache === void 0 ? void 0 : _formatResultsCache.existsAvailableFormatResultsCache(filename, options);
- let result;
- let output;
- try {
- if (isCacheExists) {
- result = {
- formatted: input
- };
- } else {
- result = format(context, input, options);
- }
- output = result.formatted;
- } catch (error) {
- handleError(context, filename, error, printedFilename);
- continue;
- }
- const isDifferent = output !== input;
- let shouldSetCache = !isDifferent;
- if (printedFilename) {
- printedFilename.clear();
- }
- if (performanceTestFlag) {
- context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code or write files.`);
- return;
- }
- if (context.argv.write) {
- if (isDifferent) {
- if (!context.argv.check && !context.argv.listDifferent) {
- context.logger.log(`${filename} ${Date.now() - start}ms`);
- }
- try {
- await fs.writeFile(filename, output, "utf8");
- shouldSetCache = true;
- } catch (error) {
- context.logger.error(`Unable to write file: ${filename}
- ${error.message}`);
- process.exitCode = 2;
- }
- } else if (!context.argv.check && !context.argv.listDifferent) {
- const message = `${chalk2.grey(filename)} ${Date.now() - start}ms`;
- if (isCacheExists) {
- context.logger.log(`${message} (cached)`);
- } else {
- context.logger.log(message);
- }
- }
- } else if (context.argv.debugCheck) {
- if (result.filepath) {
- context.logger.log(result.filepath);
- } else {
- process.exitCode = 2;
- }
- } else if (!context.argv.check && !context.argv.listDifferent) {
- writeOutput(context, result, options);
- }
- if (shouldSetCache) {
- var _formatResultsCache2;
- (_formatResultsCache2 = formatResultsCache) === null || _formatResultsCache2 === void 0 ? void 0 : _formatResultsCache2.setFormatResultsCache(filename, options);
- } else {
- var _formatResultsCache3;
- (_formatResultsCache3 = formatResultsCache) === null || _formatResultsCache3 === void 0 ? void 0 : _formatResultsCache3.removeFormatResultsCache(filename);
- }
- if (isDifferent) {
- if (context.argv.check) {
- context.logger.warn(filename);
- } else if (context.argv.listDifferent) {
- context.logger.log(filename);
- }
- numberOfUnformattedFilesFound += 1;
- }
- }
- (_formatResultsCache4 = formatResultsCache) === null || _formatResultsCache4 === void 0 ? void 0 : _formatResultsCache4.reconcile();
- if (context.argv.check) {
- if (numberOfUnformattedFilesFound === 0) {
- context.logger.log("All matched files use Prettier code style!");
- } else if (numberOfUnformattedFilesFound === 1) {
- context.logger.warn(context.argv.write ? "Code style issues fixed in the above file." : "Code style issues found in the above file. Forgot to run Prettier?");
- } else {
- context.logger.warn(context.argv.write ? "Code style issues found in " + numberOfUnformattedFilesFound + " files." : "Code style issues found in " + numberOfUnformattedFilesFound + " files. Forgot to run Prettier?");
- }
- }
- if ((context.argv.check || context.argv.listDifferent) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) {
- process.exitCode = 1;
- }
- }
- module2.exports = {
- formatStdin: formatStdin2,
- formatFiles: formatFiles2
- };
- }
- });
- var require_file_info = __commonJS2({
- "src/cli/file-info.js"(exports2, module2) {
- "use strict";
- var stringify2 = require_fast_json_stable_stringify();
- var prettier2 = require("./index.js");
- var {
- printToScreen: printToScreen2
- } = require_utils();
- async function logFileInfoOrDie2(context) {
- const {
- fileInfo: file,
- ignorePath,
- withNodeModules,
- plugins,
- pluginSearchDirs,
- config
- } = context.argv;
- const fileInfo = await prettier2.getFileInfo(file, {
- ignorePath,
- withNodeModules,
- plugins,
- pluginSearchDirs,
- resolveConfig: config !== false
- });
- printToScreen2(prettier2.format(stringify2(fileInfo), {
- parser: "json"
- }));
- }
- module2.exports = logFileInfoOrDie2;
- }
- });
- var require_find_config_path = __commonJS2({
- "src/cli/find-config-path.js"(exports2, module2) {
- "use strict";
- var path = require("path");
- var prettier2 = require("./index.js");
- var {
- printToScreen: printToScreen2
- } = require_utils();
- async function logResolvedConfigPathOrDie2(context) {
- const file = context.argv.findConfigPath;
- const configFile = await prettier2.resolveConfigFile(file);
- if (configFile) {
- printToScreen2(path.relative(process.cwd(), configFile));
- } else {
- throw new Error(`Can not find configure file for "${file}"`);
- }
- }
- module2.exports = logResolvedConfigPathOrDie2;
- }
- });
- var stringify = require_fast_json_stable_stringify();
- var prettier = require("./index.js");
- var createLogger = require_logger();
- var Context = require_context();
- var {
- parseArgvWithoutPlugins
- } = require_parse_cli_arguments();
- var {
- createDetailedUsage,
- createUsage
- } = require_usage();
- var {
- formatStdin,
- formatFiles
- } = require_format();
- var logFileInfoOrDie = require_file_info();
- var logResolvedConfigPathOrDie = require_find_config_path();
- var {
- utils: {
- isNonEmptyArray
- }
- } = require_prettier_internal();
- var {
- printToScreen
- } = require_utils();
- async function run(rawArguments) {
- let logger = createLogger();
- try {
- const logLevel = parseArgvWithoutPlugins(rawArguments, logger, "loglevel").loglevel;
- if (logLevel !== logger.logLevel) {
- logger = createLogger(logLevel);
- }
- const context = new Context({
- rawArguments,
- logger
- });
- if (logger.logLevel !== "debug" && context.performanceTestFlag) {
- context.logger = createLogger("debug");
- }
- await main(context);
- } catch (error) {
- logger.error(error.message);
- process.exitCode = 1;
- }
- }
- async function main(context) {
- context.logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`);
- if (context.argv.pluginSearch === false) {
- const rawPluginSearchDirs = context.argv.__raw["plugin-search-dir"];
- if (typeof rawPluginSearchDirs === "string" || isNonEmptyArray(rawPluginSearchDirs)) {
- throw new Error("Cannot use --no-plugin-search and --plugin-search-dir together.");
- }
- }
- if (context.argv.check && context.argv.listDifferent) {
- throw new Error("Cannot use --check and --list-different together.");
- }
- if (context.argv.write && context.argv.debugCheck) {
- throw new Error("Cannot use --write and --debug-check together.");
- }
- if (context.argv.findConfigPath && context.filePatterns.length > 0) {
- throw new Error("Cannot use --find-config-path with multiple files");
- }
- if (context.argv.fileInfo && context.filePatterns.length > 0) {
- throw new Error("Cannot use --file-info with multiple files");
- }
- if (context.argv.version) {
- printToScreen(prettier.version);
- return;
- }
- if (context.argv.help !== void 0) {
- printToScreen(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
- return;
- }
- if (context.argv.supportInfo) {
- printToScreen(prettier.format(stringify(prettier.getSupportInfo()), {
- parser: "json"
- }));
- return;
- }
- const hasFilePatterns = context.filePatterns.length > 0;
- const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv.filePath);
- if (context.argv.findConfigPath) {
- await logResolvedConfigPathOrDie(context);
- } else if (context.argv.fileInfo) {
- await logFileInfoOrDie(context);
- } else if (useStdin) {
- if (context.argv.cache) {
- context.logger.error("`--cache` cannot be used with stdin.");
- process.exit(2);
- }
- await formatStdin(context);
- } else if (hasFilePatterns) {
- await formatFiles(context);
- } else {
- process.exitCode = 1;
- printToScreen(createUsage(context));
- }
- }
- module.exports = {
- run
- };
|