index.js 1.0 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["expect"] = factory();
  8. else
  9. root["expect"] = factory();
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./packages/expect/src/index.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "./node_modules/@babel/code-frame/lib/index.js":
  99. /*!*****************************************************!*\
  100. !*** ./node_modules/@babel/code-frame/lib/index.js ***!
  101. \*****************************************************/
  102. /*! no static exports found */
  103. /***/ (function(module, exports, __webpack_require__) {
  104. "use strict";
  105. /* WEBPACK VAR INJECTION */(function(process) {
  106. Object.defineProperty(exports, "__esModule", {
  107. value: true
  108. });
  109. exports.codeFrameColumns = codeFrameColumns;
  110. exports.default = _default;
  111. function _highlight() {
  112. var data = _interopRequireWildcard(__webpack_require__(/*! @babel/highlight */ "./node_modules/@babel/highlight/lib/index.js"));
  113. _highlight = function _highlight() {
  114. return data;
  115. };
  116. return data;
  117. }
  118. function _interopRequireWildcard(obj) {
  119. if (obj && obj.__esModule) {
  120. return obj;
  121. } else {
  122. var newObj = {};
  123. if (obj != null) {
  124. for (var key in obj) {
  125. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  126. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  127. if (desc.get || desc.set) {
  128. Object.defineProperty(newObj, key, desc);
  129. } else {
  130. newObj[key] = obj[key];
  131. }
  132. }
  133. }
  134. }
  135. newObj.default = obj;
  136. return newObj;
  137. }
  138. }
  139. var deprecationWarningShown = false;
  140. function getDefs(chalk) {
  141. return {
  142. gutter: chalk.grey,
  143. marker: chalk.red.bold,
  144. message: chalk.red.bold
  145. };
  146. }
  147. var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
  148. function getMarkerLines(loc, source, opts) {
  149. var startLoc = Object.assign({
  150. column: 0,
  151. line: -1
  152. }, loc.start);
  153. var endLoc = Object.assign({}, startLoc, loc.end);
  154. var _ref = opts || {},
  155. _ref$linesAbove = _ref.linesAbove,
  156. linesAbove = _ref$linesAbove === void 0 ? 2 : _ref$linesAbove,
  157. _ref$linesBelow = _ref.linesBelow,
  158. linesBelow = _ref$linesBelow === void 0 ? 3 : _ref$linesBelow;
  159. var startLine = startLoc.line;
  160. var startColumn = startLoc.column;
  161. var endLine = endLoc.line;
  162. var endColumn = endLoc.column;
  163. var start = Math.max(startLine - (linesAbove + 1), 0);
  164. var end = Math.min(source.length, endLine + linesBelow);
  165. if (startLine === -1) {
  166. start = 0;
  167. }
  168. if (endLine === -1) {
  169. end = source.length;
  170. }
  171. var lineDiff = endLine - startLine;
  172. var markerLines = {};
  173. if (lineDiff) {
  174. for (var i = 0; i <= lineDiff; i++) {
  175. var lineNumber = i + startLine;
  176. if (!startColumn) {
  177. markerLines[lineNumber] = true;
  178. } else if (i === 0) {
  179. var sourceLength = source[lineNumber - 1].length;
  180. markerLines[lineNumber] = [startColumn, sourceLength - startColumn];
  181. } else if (i === lineDiff) {
  182. markerLines[lineNumber] = [0, endColumn];
  183. } else {
  184. var _sourceLength = source[lineNumber - i].length;
  185. markerLines[lineNumber] = [0, _sourceLength];
  186. }
  187. }
  188. } else {
  189. if (startColumn === endColumn) {
  190. if (startColumn) {
  191. markerLines[startLine] = [startColumn, 0];
  192. } else {
  193. markerLines[startLine] = true;
  194. }
  195. } else {
  196. markerLines[startLine] = [startColumn, endColumn - startColumn];
  197. }
  198. }
  199. return {
  200. start: start,
  201. end: end,
  202. markerLines: markerLines
  203. };
  204. }
  205. function codeFrameColumns(rawLines, loc) {
  206. var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  207. var highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts);
  208. var chalk = (0, _highlight().getChalk)(opts);
  209. var defs = getDefs(chalk);
  210. var maybeHighlight = function maybeHighlight(chalkFn, string) {
  211. return highlighted ? chalkFn(string) : string;
  212. };
  213. if (highlighted) rawLines = (0, _highlight().default)(rawLines, opts);
  214. var lines = rawLines.split(NEWLINE);
  215. var _getMarkerLines = getMarkerLines(loc, lines, opts),
  216. start = _getMarkerLines.start,
  217. end = _getMarkerLines.end,
  218. markerLines = _getMarkerLines.markerLines;
  219. var hasColumns = loc.start && typeof loc.start.column === "number";
  220. var numberMaxWidth = String(end).length;
  221. var frame = lines.slice(start, end).map(function (line, index) {
  222. var number = start + 1 + index;
  223. var paddedNumber = " ".concat(number).slice(-numberMaxWidth);
  224. var gutter = " ".concat(paddedNumber, " | ");
  225. var hasMarker = markerLines[number];
  226. var lastMarkerLine = !markerLines[number + 1];
  227. if (hasMarker) {
  228. var markerLine = "";
  229. if (Array.isArray(hasMarker)) {
  230. var markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
  231. var numberOfMarkers = hasMarker[1] || 1;
  232. markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
  233. if (lastMarkerLine && opts.message) {
  234. markerLine += " " + maybeHighlight(defs.message, opts.message);
  235. }
  236. }
  237. return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
  238. } else {
  239. return " ".concat(maybeHighlight(defs.gutter, gutter)).concat(line);
  240. }
  241. }).join("\n");
  242. if (opts.message && !hasColumns) {
  243. frame = "".concat(" ".repeat(numberMaxWidth + 1)).concat(opts.message, "\n").concat(frame);
  244. }
  245. if (highlighted) {
  246. return chalk.reset(frame);
  247. } else {
  248. return frame;
  249. }
  250. }
  251. function _default(rawLines, lineNumber, colNumber) {
  252. var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  253. if (!deprecationWarningShown) {
  254. deprecationWarningShown = true;
  255. var message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
  256. if (process.emitWarning) {
  257. process.emitWarning(message, "DeprecationWarning");
  258. } else {
  259. var deprecationError = new Error(message);
  260. deprecationError.name = "DeprecationWarning";
  261. console.warn(new Error(message));
  262. }
  263. }
  264. colNumber = Math.max(colNumber, 0);
  265. var location = {
  266. start: {
  267. column: colNumber,
  268. line: lineNumber
  269. }
  270. };
  271. return codeFrameColumns(rawLines, location, opts);
  272. }
  273. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js")))
  274. /***/ }),
  275. /***/ "./node_modules/@babel/highlight/lib/index.js":
  276. /*!****************************************************!*\
  277. !*** ./node_modules/@babel/highlight/lib/index.js ***!
  278. \****************************************************/
  279. /*! no static exports found */
  280. /***/ (function(module, exports, __webpack_require__) {
  281. "use strict";
  282. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
  283. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
  284. function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  285. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  286. Object.defineProperty(exports, "__esModule", {
  287. value: true
  288. });
  289. exports.shouldHighlight = shouldHighlight;
  290. exports.getChalk = getChalk;
  291. exports.default = highlight;
  292. function _jsTokens() {
  293. var data = _interopRequireWildcard(__webpack_require__(/*! js-tokens */ "./node_modules/js-tokens/index.js"));
  294. _jsTokens = function _jsTokens() {
  295. return data;
  296. };
  297. return data;
  298. }
  299. function _esutils() {
  300. var data = _interopRequireDefault(__webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js"));
  301. _esutils = function _esutils() {
  302. return data;
  303. };
  304. return data;
  305. }
  306. function _chalk() {
  307. var data = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  308. _chalk = function _chalk() {
  309. return data;
  310. };
  311. return data;
  312. }
  313. function _interopRequireDefault(obj) {
  314. return obj && obj.__esModule ? obj : {
  315. default: obj
  316. };
  317. }
  318. function _interopRequireWildcard(obj) {
  319. if (obj && obj.__esModule) {
  320. return obj;
  321. } else {
  322. var newObj = {};
  323. if (obj != null) {
  324. for (var key in obj) {
  325. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  326. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  327. if (desc.get || desc.set) {
  328. Object.defineProperty(newObj, key, desc);
  329. } else {
  330. newObj[key] = obj[key];
  331. }
  332. }
  333. }
  334. }
  335. newObj.default = obj;
  336. return newObj;
  337. }
  338. }
  339. function getDefs(chalk) {
  340. return {
  341. keyword: chalk.cyan,
  342. capitalized: chalk.yellow,
  343. jsx_tag: chalk.yellow,
  344. punctuator: chalk.yellow,
  345. number: chalk.magenta,
  346. string: chalk.green,
  347. regex: chalk.magenta,
  348. comment: chalk.grey,
  349. invalid: chalk.white.bgRed.bold
  350. };
  351. }
  352. var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
  353. var JSX_TAG = /^[a-z][\w-]*$/i;
  354. var BRACKET = /^[()[\]{}]$/;
  355. function getTokenType(match) {
  356. var _match$slice = match.slice(-2),
  357. _match$slice2 = _slicedToArray(_match$slice, 2),
  358. offset = _match$slice2[0],
  359. text = _match$slice2[1];
  360. var token = (0, _jsTokens().matchToToken)(match);
  361. if (token.type === "name") {
  362. if (_esutils().default.keyword.isReservedWordES6(token.value)) {
  363. return "keyword";
  364. }
  365. if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
  366. return "jsx_tag";
  367. }
  368. if (token.value[0] !== token.value[0].toLowerCase()) {
  369. return "capitalized";
  370. }
  371. }
  372. if (token.type === "punctuator" && BRACKET.test(token.value)) {
  373. return "bracket";
  374. }
  375. if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
  376. return "punctuator";
  377. }
  378. return token.type;
  379. }
  380. function highlightTokens(defs, text) {
  381. return text.replace(_jsTokens().default, function () {
  382. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  383. args[_key] = arguments[_key];
  384. }
  385. var type = getTokenType(args);
  386. var colorize = defs[type];
  387. if (colorize) {
  388. return args[0].split(NEWLINE).map(function (str) {
  389. return colorize(str);
  390. }).join("\n");
  391. } else {
  392. return args[0];
  393. }
  394. });
  395. }
  396. function shouldHighlight(options) {
  397. return _chalk().default.supportsColor || options.forceColor;
  398. }
  399. function getChalk(options) {
  400. var chalk = _chalk().default;
  401. if (options.forceColor) {
  402. chalk = new (_chalk().default.constructor)({
  403. enabled: true,
  404. level: 1
  405. });
  406. }
  407. return chalk;
  408. }
  409. function highlight(code) {
  410. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  411. if (shouldHighlight(options)) {
  412. var chalk = getChalk(options);
  413. var defs = getDefs(chalk);
  414. return highlightTokens(defs, code);
  415. } else {
  416. return code;
  417. }
  418. }
  419. /***/ }),
  420. /***/ "./node_modules/ansi-regex/index.js":
  421. /*!******************************************!*\
  422. !*** ./node_modules/ansi-regex/index.js ***!
  423. \******************************************/
  424. /*! no static exports found */
  425. /***/ (function(module, exports, __webpack_require__) {
  426. "use strict";
  427. module.exports = function (options) {
  428. options = Object.assign({
  429. onlyFirst: false
  430. }, options);
  431. var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
  432. return new RegExp(pattern, options.onlyFirst ? undefined : 'g');
  433. };
  434. /***/ }),
  435. /***/ "./node_modules/ansi-styles/index.js":
  436. /*!*******************************************!*\
  437. !*** ./node_modules/ansi-styles/index.js ***!
  438. \*******************************************/
  439. /*! no static exports found */
  440. /***/ (function(module, exports, __webpack_require__) {
  441. "use strict";
  442. /* WEBPACK VAR INJECTION */(function(module) {
  443. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  444. var colorConvert = __webpack_require__(/*! color-convert */ "./node_modules/color-convert/index.js");
  445. var wrapAnsi16 = function wrapAnsi16(fn, offset) {
  446. return function () {
  447. var code = fn.apply(colorConvert, arguments);
  448. return "\x1B[".concat(code + offset, "m");
  449. };
  450. };
  451. var wrapAnsi256 = function wrapAnsi256(fn, offset) {
  452. return function () {
  453. var code = fn.apply(colorConvert, arguments);
  454. return "\x1B[".concat(38 + offset, ";5;").concat(code, "m");
  455. };
  456. };
  457. var wrapAnsi16m = function wrapAnsi16m(fn, offset) {
  458. return function () {
  459. var rgb = fn.apply(colorConvert, arguments);
  460. return "\x1B[".concat(38 + offset, ";2;").concat(rgb[0], ";").concat(rgb[1], ";").concat(rgb[2], "m");
  461. };
  462. };
  463. function assembleStyles() {
  464. var codes = new Map();
  465. var styles = {
  466. modifier: {
  467. reset: [0, 0],
  468. // 21 isn't widely supported and 22 does the same thing
  469. bold: [1, 22],
  470. dim: [2, 22],
  471. italic: [3, 23],
  472. underline: [4, 24],
  473. inverse: [7, 27],
  474. hidden: [8, 28],
  475. strikethrough: [9, 29]
  476. },
  477. color: {
  478. black: [30, 39],
  479. red: [31, 39],
  480. green: [32, 39],
  481. yellow: [33, 39],
  482. blue: [34, 39],
  483. magenta: [35, 39],
  484. cyan: [36, 39],
  485. white: [37, 39],
  486. gray: [90, 39],
  487. // Bright color
  488. redBright: [91, 39],
  489. greenBright: [92, 39],
  490. yellowBright: [93, 39],
  491. blueBright: [94, 39],
  492. magentaBright: [95, 39],
  493. cyanBright: [96, 39],
  494. whiteBright: [97, 39]
  495. },
  496. bgColor: {
  497. bgBlack: [40, 49],
  498. bgRed: [41, 49],
  499. bgGreen: [42, 49],
  500. bgYellow: [43, 49],
  501. bgBlue: [44, 49],
  502. bgMagenta: [45, 49],
  503. bgCyan: [46, 49],
  504. bgWhite: [47, 49],
  505. // Bright color
  506. bgBlackBright: [100, 49],
  507. bgRedBright: [101, 49],
  508. bgGreenBright: [102, 49],
  509. bgYellowBright: [103, 49],
  510. bgBlueBright: [104, 49],
  511. bgMagentaBright: [105, 49],
  512. bgCyanBright: [106, 49],
  513. bgWhiteBright: [107, 49]
  514. }
  515. }; // Fix humans
  516. styles.color.grey = styles.color.gray;
  517. var _arr = Object.keys(styles);
  518. for (var _i = 0; _i < _arr.length; _i++) {
  519. var groupName = _arr[_i];
  520. var group = styles[groupName];
  521. var _arr3 = Object.keys(group);
  522. for (var _i3 = 0; _i3 < _arr3.length; _i3++) {
  523. var styleName = _arr3[_i3];
  524. var style = group[styleName];
  525. styles[styleName] = {
  526. open: "\x1B[".concat(style[0], "m"),
  527. close: "\x1B[".concat(style[1], "m")
  528. };
  529. group[styleName] = styles[styleName];
  530. codes.set(style[0], style[1]);
  531. }
  532. Object.defineProperty(styles, groupName, {
  533. value: group,
  534. enumerable: false
  535. });
  536. Object.defineProperty(styles, 'codes', {
  537. value: codes,
  538. enumerable: false
  539. });
  540. }
  541. var ansi2ansi = function ansi2ansi(n) {
  542. return n;
  543. };
  544. var rgb2rgb = function rgb2rgb(r, g, b) {
  545. return [r, g, b];
  546. };
  547. styles.color.close = "\x1B[39m";
  548. styles.bgColor.close = "\x1B[49m";
  549. styles.color.ansi = {
  550. ansi: wrapAnsi16(ansi2ansi, 0)
  551. };
  552. styles.color.ansi256 = {
  553. ansi256: wrapAnsi256(ansi2ansi, 0)
  554. };
  555. styles.color.ansi16m = {
  556. rgb: wrapAnsi16m(rgb2rgb, 0)
  557. };
  558. styles.bgColor.ansi = {
  559. ansi: wrapAnsi16(ansi2ansi, 10)
  560. };
  561. styles.bgColor.ansi256 = {
  562. ansi256: wrapAnsi256(ansi2ansi, 10)
  563. };
  564. styles.bgColor.ansi16m = {
  565. rgb: wrapAnsi16m(rgb2rgb, 10)
  566. };
  567. var _arr2 = Object.keys(colorConvert);
  568. for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
  569. var key = _arr2[_i2];
  570. if (_typeof(colorConvert[key]) !== 'object') {
  571. continue;
  572. }
  573. var suite = colorConvert[key];
  574. if (key === 'ansi16') {
  575. key = 'ansi';
  576. }
  577. if ('ansi16' in suite) {
  578. styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
  579. styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
  580. }
  581. if ('ansi256' in suite) {
  582. styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
  583. styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
  584. }
  585. if ('rgb' in suite) {
  586. styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
  587. styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
  588. }
  589. }
  590. return styles;
  591. } // Make the export immutable
  592. Object.defineProperty(module, 'exports', {
  593. enumerable: true,
  594. get: assembleStyles
  595. });
  596. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  597. /***/ }),
  598. /***/ "./node_modules/arr-diff/index.js":
  599. /*!****************************************!*\
  600. !*** ./node_modules/arr-diff/index.js ***!
  601. \****************************************/
  602. /*! no static exports found */
  603. /***/ (function(module, exports, __webpack_require__) {
  604. "use strict";
  605. /*!
  606. * arr-diff <https://github.com/jonschlinkert/arr-diff>
  607. *
  608. * Copyright (c) 2014-2017, Jon Schlinkert.
  609. * Released under the MIT License.
  610. */
  611. module.exports = function diff(arr
  612. /*, arrays*/
  613. ) {
  614. var len = arguments.length;
  615. var idx = 0;
  616. while (++idx < len) {
  617. arr = diffArray(arr, arguments[idx]);
  618. }
  619. return arr;
  620. };
  621. function diffArray(one, two) {
  622. if (!Array.isArray(two)) {
  623. return one.slice();
  624. }
  625. var tlen = two.length;
  626. var olen = one.length;
  627. var idx = -1;
  628. var arr = [];
  629. while (++idx < olen) {
  630. var ele = one[idx];
  631. var hasEle = false;
  632. for (var i = 0; i < tlen; i++) {
  633. var val = two[i];
  634. if (ele === val) {
  635. hasEle = true;
  636. break;
  637. }
  638. }
  639. if (hasEle === false) {
  640. arr.push(ele);
  641. }
  642. }
  643. return arr;
  644. }
  645. /***/ }),
  646. /***/ "./node_modules/arr-flatten/index.js":
  647. /*!*******************************************!*\
  648. !*** ./node_modules/arr-flatten/index.js ***!
  649. \*******************************************/
  650. /*! no static exports found */
  651. /***/ (function(module, exports, __webpack_require__) {
  652. "use strict";
  653. /*!
  654. * arr-flatten <https://github.com/jonschlinkert/arr-flatten>
  655. *
  656. * Copyright (c) 2014-2017, Jon Schlinkert.
  657. * Released under the MIT License.
  658. */
  659. module.exports = function (arr) {
  660. return flat(arr, []);
  661. };
  662. function flat(arr, res) {
  663. var i = 0,
  664. cur;
  665. var len = arr.length;
  666. for (; i < len; i++) {
  667. cur = arr[i];
  668. Array.isArray(cur) ? flat(cur, res) : res.push(cur);
  669. }
  670. return res;
  671. }
  672. /***/ }),
  673. /***/ "./node_modules/arr-union/index.js":
  674. /*!*****************************************!*\
  675. !*** ./node_modules/arr-union/index.js ***!
  676. \*****************************************/
  677. /*! no static exports found */
  678. /***/ (function(module, exports, __webpack_require__) {
  679. "use strict";
  680. module.exports = function union(init) {
  681. if (!Array.isArray(init)) {
  682. throw new TypeError('arr-union expects the first argument to be an array.');
  683. }
  684. var len = arguments.length;
  685. var i = 0;
  686. while (++i < len) {
  687. var arg = arguments[i];
  688. if (!arg) continue;
  689. if (!Array.isArray(arg)) {
  690. arg = [arg];
  691. }
  692. for (var j = 0; j < arg.length; j++) {
  693. var ele = arg[j];
  694. if (init.indexOf(ele) >= 0) {
  695. continue;
  696. }
  697. init.push(ele);
  698. }
  699. }
  700. return init;
  701. };
  702. /***/ }),
  703. /***/ "./node_modules/array-unique/index.js":
  704. /*!********************************************!*\
  705. !*** ./node_modules/array-unique/index.js ***!
  706. \********************************************/
  707. /*! no static exports found */
  708. /***/ (function(module, exports, __webpack_require__) {
  709. "use strict";
  710. /*!
  711. * array-unique <https://github.com/jonschlinkert/array-unique>
  712. *
  713. * Copyright (c) 2014-2015, Jon Schlinkert.
  714. * Licensed under the MIT License.
  715. */
  716. module.exports = function unique(arr) {
  717. if (!Array.isArray(arr)) {
  718. throw new TypeError('array-unique expects an array.');
  719. }
  720. var len = arr.length;
  721. var i = -1;
  722. while (i++ < len) {
  723. var j = i + 1;
  724. for (; j < arr.length; ++j) {
  725. if (arr[i] === arr[j]) {
  726. arr.splice(j--, 1);
  727. }
  728. }
  729. }
  730. return arr;
  731. };
  732. module.exports.immutable = function uniqueImmutable(arr) {
  733. if (!Array.isArray(arr)) {
  734. throw new TypeError('array-unique expects an array.');
  735. }
  736. var arrLen = arr.length;
  737. var newArr = new Array(arrLen);
  738. for (var i = 0; i < arrLen; i++) {
  739. newArr[i] = arr[i];
  740. }
  741. return module.exports(newArr);
  742. };
  743. /***/ }),
  744. /***/ "./node_modules/assign-symbols/index.js":
  745. /*!**********************************************!*\
  746. !*** ./node_modules/assign-symbols/index.js ***!
  747. \**********************************************/
  748. /*! no static exports found */
  749. /***/ (function(module, exports, __webpack_require__) {
  750. "use strict";
  751. /*!
  752. * assign-symbols <https://github.com/jonschlinkert/assign-symbols>
  753. *
  754. * Copyright (c) 2015, Jon Schlinkert.
  755. * Licensed under the MIT License.
  756. */
  757. module.exports = function (receiver, objects) {
  758. if (receiver === null || typeof receiver === 'undefined') {
  759. throw new TypeError('expected first argument to be an object.');
  760. }
  761. if (typeof objects === 'undefined' || typeof Symbol === 'undefined') {
  762. return receiver;
  763. }
  764. if (typeof Object.getOwnPropertySymbols !== 'function') {
  765. return receiver;
  766. }
  767. var isEnumerable = Object.prototype.propertyIsEnumerable;
  768. var target = Object(receiver);
  769. var len = arguments.length,
  770. i = 0;
  771. while (++i < len) {
  772. var provider = Object(arguments[i]);
  773. var names = Object.getOwnPropertySymbols(provider);
  774. for (var j = 0; j < names.length; j++) {
  775. var key = names[j];
  776. if (isEnumerable.call(provider, key)) {
  777. target[key] = provider[key];
  778. }
  779. }
  780. }
  781. return target;
  782. };
  783. /***/ }),
  784. /***/ "./node_modules/base/index.js":
  785. /*!************************************!*\
  786. !*** ./node_modules/base/index.js ***!
  787. \************************************/
  788. /*! no static exports found */
  789. /***/ (function(module, exports, __webpack_require__) {
  790. "use strict";
  791. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  792. var define = __webpack_require__(/*! define-property */ "./node_modules/base/node_modules/define-property/index.js");
  793. var CacheBase = __webpack_require__(/*! cache-base */ "./node_modules/cache-base/index.js");
  794. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/base/node_modules/component-emitter/index.js");
  795. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  796. var merge = __webpack_require__(/*! mixin-deep */ "./node_modules/mixin-deep/index.js");
  797. var pascal = __webpack_require__(/*! pascalcase */ "./node_modules/pascalcase/index.js");
  798. var cu = __webpack_require__(/*! class-utils */ "./node_modules/class-utils/index.js");
  799. /**
  800. * Optionally define a custom `cache` namespace to use.
  801. */
  802. function namespace(name) {
  803. var Cache = name ? CacheBase.namespace(name) : CacheBase;
  804. var fns = [];
  805. /**
  806. * Create an instance of `Base` with the given `config` and `options`.
  807. *
  808. * ```js
  809. * // initialize with `config` and `options`
  810. * var app = new Base({isApp: true}, {abc: true});
  811. * app.set('foo', 'bar');
  812. *
  813. * // values defined with the given `config` object will be on the root of the instance
  814. * console.log(app.baz); //=> undefined
  815. * console.log(app.foo); //=> 'bar'
  816. * // or use `.get`
  817. * console.log(app.get('isApp')); //=> true
  818. * console.log(app.get('foo')); //=> 'bar'
  819. *
  820. * // values defined with the given `options` object will be on `app.options
  821. * console.log(app.options.abc); //=> true
  822. * ```
  823. *
  824. * @param {Object} `config` If supplied, this object is passed to [cache-base][] to merge onto the the instance upon instantiation.
  825. * @param {Object} `options` If supplied, this object is used to initialize the `base.options` object.
  826. * @api public
  827. */
  828. function Base(config, options) {
  829. if (!(this instanceof Base)) {
  830. return new Base(config, options);
  831. }
  832. Cache.call(this, config);
  833. this.is('base');
  834. this.initBase(config, options);
  835. }
  836. /**
  837. * Inherit cache-base
  838. */
  839. util.inherits(Base, Cache);
  840. /**
  841. * Add static emitter methods
  842. */
  843. Emitter(Base);
  844. /**
  845. * Initialize `Base` defaults with the given `config` object
  846. */
  847. Base.prototype.initBase = function (config, options) {
  848. this.options = merge({}, this.options, options);
  849. this.cache = this.cache || {};
  850. this.define('registered', {});
  851. if (name) this[name] = {}; // make `app._callbacks` non-enumerable
  852. this.define('_callbacks', this._callbacks);
  853. if (isObject(config)) {
  854. this.visit('set', config);
  855. }
  856. Base.run(this, 'use', fns);
  857. };
  858. /**
  859. * Set the given `name` on `app._name` and `app.is*` properties. Used for doing
  860. * lookups in plugins.
  861. *
  862. * ```js
  863. * app.is('foo');
  864. * console.log(app._name);
  865. * //=> 'foo'
  866. * console.log(app.isFoo);
  867. * //=> true
  868. * app.is('bar');
  869. * console.log(app.isFoo);
  870. * //=> true
  871. * console.log(app.isBar);
  872. * //=> true
  873. * console.log(app._name);
  874. * //=> 'bar'
  875. * ```
  876. * @name .is
  877. * @param {String} `name`
  878. * @return {Boolean}
  879. * @api public
  880. */
  881. Base.prototype.is = function (name) {
  882. if (typeof name !== 'string') {
  883. throw new TypeError('expected name to be a string');
  884. }
  885. this.define('is' + pascal(name), true);
  886. this.define('_name', name);
  887. this.define('_appname', name);
  888. return this;
  889. };
  890. /**
  891. * Returns true if a plugin has already been registered on an instance.
  892. *
  893. * Plugin implementors are encouraged to use this first thing in a plugin
  894. * to prevent the plugin from being called more than once on the same
  895. * instance.
  896. *
  897. * ```js
  898. * var base = new Base();
  899. * base.use(function(app) {
  900. * if (app.isRegistered('myPlugin')) return;
  901. * // do stuff to `app`
  902. * });
  903. *
  904. * // to also record the plugin as being registered
  905. * base.use(function(app) {
  906. * if (app.isRegistered('myPlugin', true)) return;
  907. * // do stuff to `app`
  908. * });
  909. * ```
  910. * @name .isRegistered
  911. * @emits `plugin` Emits the name of the plugin being registered. Useful for unit tests, to ensure plugins are only registered once.
  912. * @param {String} `name` The plugin name.
  913. * @param {Boolean} `register` If the plugin if not already registered, to record it as being registered pass `true` as the second argument.
  914. * @return {Boolean} Returns true if a plugin is already registered.
  915. * @api public
  916. */
  917. Base.prototype.isRegistered = function (name, register) {
  918. if (this.registered.hasOwnProperty(name)) {
  919. return true;
  920. }
  921. if (register !== false) {
  922. this.registered[name] = true;
  923. this.emit('plugin', name);
  924. }
  925. return false;
  926. };
  927. /**
  928. * Define a plugin function to be called immediately upon init. Plugins are chainable
  929. * and expose the following arguments to the plugin function:
  930. *
  931. * - `app`: the current instance of `Base`
  932. * - `base`: the [first ancestor instance](#base) of `Base`
  933. *
  934. * ```js
  935. * var app = new Base()
  936. * .use(foo)
  937. * .use(bar)
  938. * .use(baz)
  939. * ```
  940. * @name .use
  941. * @param {Function} `fn` plugin function to call
  942. * @return {Object} Returns the item instance for chaining.
  943. * @api public
  944. */
  945. Base.prototype.use = function (fn) {
  946. fn.call(this, this);
  947. return this;
  948. };
  949. /**
  950. * The `.define` method is used for adding non-enumerable property on the instance.
  951. * Dot-notation is **not supported** with `define`.
  952. *
  953. * ```js
  954. * // arbitrary `render` function using lodash `template`
  955. * app.define('render', function(str, locals) {
  956. * return _.template(str)(locals);
  957. * });
  958. * ```
  959. * @name .define
  960. * @param {String} `key` The name of the property to define.
  961. * @param {any} `value`
  962. * @return {Object} Returns the instance for chaining.
  963. * @api public
  964. */
  965. Base.prototype.define = function (key, val) {
  966. if (isObject(key)) {
  967. return this.visit('define', key);
  968. }
  969. define(this, key, val);
  970. return this;
  971. };
  972. /**
  973. * Mix property `key` onto the Base prototype. If base is inherited using
  974. * `Base.extend` this method will be overridden by a new `mixin` method that will
  975. * only add properties to the prototype of the inheriting application.
  976. *
  977. * ```js
  978. * app.mixin('foo', function() {
  979. * // do stuff
  980. * });
  981. * ```
  982. * @name .mixin
  983. * @param {String} `key`
  984. * @param {Object|Array} `val`
  985. * @return {Object} Returns the `base` instance for chaining.
  986. * @api public
  987. */
  988. Base.prototype.mixin = function (key, val) {
  989. Base.prototype[key] = val;
  990. return this;
  991. };
  992. /**
  993. * Non-enumberable mixin array, used by the static [Base.mixin]() method.
  994. */
  995. Base.prototype.mixins = Base.prototype.mixins || [];
  996. /**
  997. * Getter/setter used when creating nested instances of `Base`, for storing a reference
  998. * to the first ancestor instance. This works by setting an instance of `Base` on the `parent`
  999. * property of a "child" instance. The `base` property defaults to the current instance if
  1000. * no `parent` property is defined.
  1001. *
  1002. * ```js
  1003. * // create an instance of `Base`, this is our first ("base") instance
  1004. * var first = new Base();
  1005. * first.foo = 'bar'; // arbitrary property, to make it easier to see what's happening later
  1006. *
  1007. * // create another instance
  1008. * var second = new Base();
  1009. * // create a reference to the first instance (`first`)
  1010. * second.parent = first;
  1011. *
  1012. * // create another instance
  1013. * var third = new Base();
  1014. * // create a reference to the previous instance (`second`)
  1015. * // repeat this pattern every time a "child" instance is created
  1016. * third.parent = second;
  1017. *
  1018. * // we can always access the first instance using the `base` property
  1019. * console.log(first.base.foo);
  1020. * //=> 'bar'
  1021. * console.log(second.base.foo);
  1022. * //=> 'bar'
  1023. * console.log(third.base.foo);
  1024. * //=> 'bar'
  1025. * // and now you know how to get to third base ;)
  1026. * ```
  1027. * @name .base
  1028. * @api public
  1029. */
  1030. Object.defineProperty(Base.prototype, 'base', {
  1031. configurable: true,
  1032. get: function get() {
  1033. return this.parent ? this.parent.base : this;
  1034. }
  1035. });
  1036. /**
  1037. * Static method for adding global plugin functions that will
  1038. * be added to an instance when created.
  1039. *
  1040. * ```js
  1041. * Base.use(function(app) {
  1042. * app.foo = 'bar';
  1043. * });
  1044. * var app = new Base();
  1045. * console.log(app.foo);
  1046. * //=> 'bar'
  1047. * ```
  1048. * @name #use
  1049. * @param {Function} `fn` Plugin function to use on each instance.
  1050. * @return {Object} Returns the `Base` constructor for chaining
  1051. * @api public
  1052. */
  1053. define(Base, 'use', function (fn) {
  1054. fns.push(fn);
  1055. return Base;
  1056. });
  1057. /**
  1058. * Run an array of functions by passing each function
  1059. * to a method on the given object specified by the given property.
  1060. *
  1061. * @param {Object} `obj` Object containing method to use.
  1062. * @param {String} `prop` Name of the method on the object to use.
  1063. * @param {Array} `arr` Array of functions to pass to the method.
  1064. */
  1065. define(Base, 'run', function (obj, prop, arr) {
  1066. var len = arr.length,
  1067. i = 0;
  1068. while (len--) {
  1069. obj[prop](arr[i++]);
  1070. }
  1071. return Base;
  1072. });
  1073. /**
  1074. * Static method for inheriting the prototype and static methods of the `Base` class.
  1075. * This method greatly simplifies the process of creating inheritance-based applications.
  1076. * See [static-extend][] for more details.
  1077. *
  1078. * ```js
  1079. * var extend = cu.extend(Parent);
  1080. * Parent.extend(Child);
  1081. *
  1082. * // optional methods
  1083. * Parent.extend(Child, {
  1084. * foo: function() {},
  1085. * bar: function() {}
  1086. * });
  1087. * ```
  1088. * @name #extend
  1089. * @param {Function} `Ctor` constructor to extend
  1090. * @param {Object} `methods` Optional prototype properties to mix in.
  1091. * @return {Object} Returns the `Base` constructor for chaining
  1092. * @api public
  1093. */
  1094. define(Base, 'extend', cu.extend(Base, function (Ctor, Parent) {
  1095. Ctor.prototype.mixins = Ctor.prototype.mixins || [];
  1096. define(Ctor, 'mixin', function (fn) {
  1097. var mixin = fn(Ctor.prototype, Ctor);
  1098. if (typeof mixin === 'function') {
  1099. Ctor.prototype.mixins.push(mixin);
  1100. }
  1101. return Ctor;
  1102. });
  1103. define(Ctor, 'mixins', function (Child) {
  1104. Base.run(Child, 'mixin', Ctor.prototype.mixins);
  1105. return Ctor;
  1106. });
  1107. Ctor.prototype.mixin = function (key, value) {
  1108. Ctor.prototype[key] = value;
  1109. return this;
  1110. };
  1111. return Base;
  1112. }));
  1113. /**
  1114. * Used for adding methods to the `Base` prototype, and/or to the prototype of child instances.
  1115. * When a mixin function returns a function, the returned function is pushed onto the `.mixins`
  1116. * array, making it available to be used on inheriting classes whenever `Base.mixins()` is
  1117. * called (e.g. `Base.mixins(Child)`).
  1118. *
  1119. * ```js
  1120. * Base.mixin(function(proto) {
  1121. * proto.foo = function(msg) {
  1122. * return 'foo ' + msg;
  1123. * };
  1124. * });
  1125. * ```
  1126. * @name #mixin
  1127. * @param {Function} `fn` Function to call
  1128. * @return {Object} Returns the `Base` constructor for chaining
  1129. * @api public
  1130. */
  1131. define(Base, 'mixin', function (fn) {
  1132. var mixin = fn(Base.prototype, Base);
  1133. if (typeof mixin === 'function') {
  1134. Base.prototype.mixins.push(mixin);
  1135. }
  1136. return Base;
  1137. });
  1138. /**
  1139. * Static method for running global mixin functions against a child constructor.
  1140. * Mixins must be registered before calling this method.
  1141. *
  1142. * ```js
  1143. * Base.extend(Child);
  1144. * Base.mixins(Child);
  1145. * ```
  1146. * @name #mixins
  1147. * @param {Function} `Child` Constructor function of a child class
  1148. * @return {Object} Returns the `Base` constructor for chaining
  1149. * @api public
  1150. */
  1151. define(Base, 'mixins', function (Child) {
  1152. Base.run(Child, 'mixin', Base.prototype.mixins);
  1153. return Base;
  1154. });
  1155. /**
  1156. * Similar to `util.inherit`, but copies all static properties, prototype properties, and
  1157. * getters/setters from `Provider` to `Receiver`. See [class-utils][]{#inherit} for more details.
  1158. *
  1159. * ```js
  1160. * Base.inherit(Foo, Bar);
  1161. * ```
  1162. * @name #inherit
  1163. * @param {Function} `Receiver` Receiving (child) constructor
  1164. * @param {Function} `Provider` Providing (parent) constructor
  1165. * @return {Object} Returns the `Base` constructor for chaining
  1166. * @api public
  1167. */
  1168. define(Base, 'inherit', cu.inherit);
  1169. define(Base, 'bubble', cu.bubble);
  1170. return Base;
  1171. }
  1172. /**
  1173. * Expose `Base` with default settings
  1174. */
  1175. module.exports = namespace();
  1176. /**
  1177. * Allow users to define a namespace
  1178. */
  1179. module.exports.namespace = namespace;
  1180. /***/ }),
  1181. /***/ "./node_modules/base/node_modules/component-emitter/index.js":
  1182. /*!*******************************************************************!*\
  1183. !*** ./node_modules/base/node_modules/component-emitter/index.js ***!
  1184. \*******************************************************************/
  1185. /*! no static exports found */
  1186. /***/ (function(module, exports, __webpack_require__) {
  1187. "use strict";
  1188. /**
  1189. * Expose `Emitter`.
  1190. */
  1191. if (true) {
  1192. module.exports = Emitter;
  1193. }
  1194. /**
  1195. * Initialize a new `Emitter`.
  1196. *
  1197. * @api public
  1198. */
  1199. function Emitter(obj) {
  1200. if (obj) return mixin(obj);
  1201. }
  1202. ;
  1203. /**
  1204. * Mixin the emitter properties.
  1205. *
  1206. * @param {Object} obj
  1207. * @return {Object}
  1208. * @api private
  1209. */
  1210. function mixin(obj) {
  1211. for (var key in Emitter.prototype) {
  1212. obj[key] = Emitter.prototype[key];
  1213. }
  1214. return obj;
  1215. }
  1216. /**
  1217. * Listen on the given `event` with `fn`.
  1218. *
  1219. * @param {String} event
  1220. * @param {Function} fn
  1221. * @return {Emitter}
  1222. * @api public
  1223. */
  1224. Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
  1225. this._callbacks = this._callbacks || {};
  1226. (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);
  1227. return this;
  1228. };
  1229. /**
  1230. * Adds an `event` listener that will be invoked a single
  1231. * time then automatically removed.
  1232. *
  1233. * @param {String} event
  1234. * @param {Function} fn
  1235. * @return {Emitter}
  1236. * @api public
  1237. */
  1238. Emitter.prototype.once = function (event, fn) {
  1239. function on() {
  1240. this.off(event, on);
  1241. fn.apply(this, arguments);
  1242. }
  1243. on.fn = fn;
  1244. this.on(event, on);
  1245. return this;
  1246. };
  1247. /**
  1248. * Remove the given callback for `event` or all
  1249. * registered callbacks.
  1250. *
  1251. * @param {String} event
  1252. * @param {Function} fn
  1253. * @return {Emitter}
  1254. * @api public
  1255. */
  1256. Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
  1257. this._callbacks = this._callbacks || {}; // all
  1258. if (0 == arguments.length) {
  1259. this._callbacks = {};
  1260. return this;
  1261. } // specific event
  1262. var callbacks = this._callbacks['$' + event];
  1263. if (!callbacks) return this; // remove all handlers
  1264. if (1 == arguments.length) {
  1265. delete this._callbacks['$' + event];
  1266. return this;
  1267. } // remove specific handler
  1268. var cb;
  1269. for (var i = 0; i < callbacks.length; i++) {
  1270. cb = callbacks[i];
  1271. if (cb === fn || cb.fn === fn) {
  1272. callbacks.splice(i, 1);
  1273. break;
  1274. }
  1275. } // Remove event specific arrays for event types that no
  1276. // one is subscribed for to avoid memory leak.
  1277. if (callbacks.length === 0) {
  1278. delete this._callbacks['$' + event];
  1279. }
  1280. return this;
  1281. };
  1282. /**
  1283. * Emit `event` with the given args.
  1284. *
  1285. * @param {String} event
  1286. * @param {Mixed} ...
  1287. * @return {Emitter}
  1288. */
  1289. Emitter.prototype.emit = function (event) {
  1290. this._callbacks = this._callbacks || {};
  1291. var args = new Array(arguments.length - 1),
  1292. callbacks = this._callbacks['$' + event];
  1293. for (var i = 1; i < arguments.length; i++) {
  1294. args[i - 1] = arguments[i];
  1295. }
  1296. if (callbacks) {
  1297. callbacks = callbacks.slice(0);
  1298. for (var i = 0, len = callbacks.length; i < len; ++i) {
  1299. callbacks[i].apply(this, args);
  1300. }
  1301. }
  1302. return this;
  1303. };
  1304. /**
  1305. * Return array of callbacks for `event`.
  1306. *
  1307. * @param {String} event
  1308. * @return {Array}
  1309. * @api public
  1310. */
  1311. Emitter.prototype.listeners = function (event) {
  1312. this._callbacks = this._callbacks || {};
  1313. return this._callbacks['$' + event] || [];
  1314. };
  1315. /**
  1316. * Check if this emitter has `event` handlers.
  1317. *
  1318. * @param {String} event
  1319. * @return {Boolean}
  1320. * @api public
  1321. */
  1322. Emitter.prototype.hasListeners = function (event) {
  1323. return !!this.listeners(event).length;
  1324. };
  1325. /***/ }),
  1326. /***/ "./node_modules/base/node_modules/define-property/index.js":
  1327. /*!*****************************************************************!*\
  1328. !*** ./node_modules/base/node_modules/define-property/index.js ***!
  1329. \*****************************************************************/
  1330. /*! no static exports found */
  1331. /***/ (function(module, exports, __webpack_require__) {
  1332. "use strict";
  1333. /*!
  1334. * define-property <https://github.com/jonschlinkert/define-property>
  1335. *
  1336. * Copyright (c) 2015, 2017, Jon Schlinkert.
  1337. * Released under the MIT License.
  1338. */
  1339. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1340. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/is-descriptor/index.js");
  1341. module.exports = function defineProperty(obj, prop, val) {
  1342. if (_typeof(obj) !== 'object' && typeof obj !== 'function') {
  1343. throw new TypeError('expected an object or function.');
  1344. }
  1345. if (typeof prop !== 'string') {
  1346. throw new TypeError('expected `prop` to be a string.');
  1347. }
  1348. if (isDescriptor(val) && ('set' in val || 'get' in val)) {
  1349. return Object.defineProperty(obj, prop, val);
  1350. }
  1351. return Object.defineProperty(obj, prop, {
  1352. configurable: true,
  1353. enumerable: false,
  1354. writable: true,
  1355. value: val
  1356. });
  1357. };
  1358. /***/ }),
  1359. /***/ "./node_modules/braces/index.js":
  1360. /*!**************************************!*\
  1361. !*** ./node_modules/braces/index.js ***!
  1362. \**************************************/
  1363. /*! no static exports found */
  1364. /***/ (function(module, exports, __webpack_require__) {
  1365. "use strict";
  1366. /**
  1367. * Module dependencies
  1368. */
  1369. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  1370. var unique = __webpack_require__(/*! array-unique */ "./node_modules/array-unique/index.js");
  1371. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  1372. /**
  1373. * Local dependencies
  1374. */
  1375. var compilers = __webpack_require__(/*! ./lib/compilers */ "./node_modules/braces/lib/compilers.js");
  1376. var parsers = __webpack_require__(/*! ./lib/parsers */ "./node_modules/braces/lib/parsers.js");
  1377. var Braces = __webpack_require__(/*! ./lib/braces */ "./node_modules/braces/lib/braces.js");
  1378. var utils = __webpack_require__(/*! ./lib/utils */ "./node_modules/braces/lib/utils.js");
  1379. var MAX_LENGTH = 1024 * 64;
  1380. var cache = {};
  1381. /**
  1382. * Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)).
  1383. *
  1384. * ```js
  1385. * var braces = require('braces');
  1386. * console.log(braces('{a,b,c}'));
  1387. * //=> ['(a|b|c)']
  1388. *
  1389. * console.log(braces('{a,b,c}', {expand: true}));
  1390. * //=> ['a', 'b', 'c']
  1391. * ```
  1392. * @param {String} `str`
  1393. * @param {Object} `options`
  1394. * @return {String}
  1395. * @api public
  1396. */
  1397. function braces(pattern, options) {
  1398. var key = utils.createKey(String(pattern), options);
  1399. var arr = [];
  1400. var disabled = options && options.cache === false;
  1401. if (!disabled && cache.hasOwnProperty(key)) {
  1402. return cache[key];
  1403. }
  1404. if (Array.isArray(pattern)) {
  1405. for (var i = 0; i < pattern.length; i++) {
  1406. arr.push.apply(arr, braces.create(pattern[i], options));
  1407. }
  1408. } else {
  1409. arr = braces.create(pattern, options);
  1410. }
  1411. if (options && options.nodupes === true) {
  1412. arr = unique(arr);
  1413. }
  1414. if (!disabled) {
  1415. cache[key] = arr;
  1416. }
  1417. return arr;
  1418. }
  1419. /**
  1420. * Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead.
  1421. *
  1422. * ```js
  1423. * var braces = require('braces');
  1424. * console.log(braces.expand('a/{b,c}/d'));
  1425. * //=> ['a/b/d', 'a/c/d'];
  1426. * ```
  1427. * @param {String} `pattern` Brace pattern
  1428. * @param {Object} `options`
  1429. * @return {Array} Returns an array of expanded values.
  1430. * @api public
  1431. */
  1432. braces.expand = function (pattern, options) {
  1433. return braces.create(pattern, extend({}, options, {
  1434. expand: true
  1435. }));
  1436. };
  1437. /**
  1438. * Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default.
  1439. *
  1440. * ```js
  1441. * var braces = require('braces');
  1442. * console.log(braces.expand('a/{b,c}/d'));
  1443. * //=> ['a/(b|c)/d']
  1444. * ```
  1445. * @param {String} `pattern` Brace pattern
  1446. * @param {Object} `options`
  1447. * @return {Array} Returns an array of expanded values.
  1448. * @api public
  1449. */
  1450. braces.optimize = function (pattern, options) {
  1451. return braces.create(pattern, options);
  1452. };
  1453. /**
  1454. * Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function.
  1455. *
  1456. * ```js
  1457. * var braces = require('braces');
  1458. * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
  1459. * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
  1460. * ```
  1461. * @param {String} `pattern` Brace pattern
  1462. * @param {Object} `options`
  1463. * @return {Array} Returns an array of expanded values.
  1464. * @api public
  1465. */
  1466. braces.create = function (pattern, options) {
  1467. if (typeof pattern !== 'string') {
  1468. throw new TypeError('expected a string');
  1469. }
  1470. var maxLength = options && options.maxLength || MAX_LENGTH;
  1471. if (pattern.length >= maxLength) {
  1472. throw new Error('expected pattern to be less than ' + maxLength + ' characters');
  1473. }
  1474. function create() {
  1475. if (pattern === '' || pattern.length < 3) {
  1476. return [pattern];
  1477. }
  1478. if (utils.isEmptySets(pattern)) {
  1479. return [];
  1480. }
  1481. if (utils.isQuotedString(pattern)) {
  1482. return [pattern.slice(1, -1)];
  1483. }
  1484. var proto = new Braces(options);
  1485. var result = !options || options.expand !== true ? proto.optimize(pattern, options) : proto.expand(pattern, options); // get the generated pattern(s)
  1486. var arr = result.output; // filter out empty strings if specified
  1487. if (options && options.noempty === true) {
  1488. arr = arr.filter(Boolean);
  1489. } // filter out duplicates if specified
  1490. if (options && options.nodupes === true) {
  1491. arr = unique(arr);
  1492. }
  1493. Object.defineProperty(arr, 'result', {
  1494. enumerable: false,
  1495. value: result
  1496. });
  1497. return arr;
  1498. }
  1499. return memoize('create', pattern, options, create);
  1500. };
  1501. /**
  1502. * Create a regular expression from the given string `pattern`.
  1503. *
  1504. * ```js
  1505. * var braces = require('braces');
  1506. *
  1507. * console.log(braces.makeRe('id-{200..300}'));
  1508. * //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/
  1509. * ```
  1510. * @param {String} `pattern` The pattern to convert to regex.
  1511. * @param {Object} `options`
  1512. * @return {RegExp}
  1513. * @api public
  1514. */
  1515. braces.makeRe = function (pattern, options) {
  1516. if (typeof pattern !== 'string') {
  1517. throw new TypeError('expected a string');
  1518. }
  1519. var maxLength = options && options.maxLength || MAX_LENGTH;
  1520. if (pattern.length >= maxLength) {
  1521. throw new Error('expected pattern to be less than ' + maxLength + ' characters');
  1522. }
  1523. function makeRe() {
  1524. var arr = braces(pattern, options);
  1525. var opts = extend({
  1526. strictErrors: false
  1527. }, options);
  1528. return toRegex(arr, opts);
  1529. }
  1530. return memoize('makeRe', pattern, options, makeRe);
  1531. };
  1532. /**
  1533. * Parse the given `str` with the given `options`.
  1534. *
  1535. * ```js
  1536. * var braces = require('braces');
  1537. * var ast = braces.parse('a/{b,c}/d');
  1538. * console.log(ast);
  1539. * // { type: 'root',
  1540. * // errors: [],
  1541. * // input: 'a/{b,c}/d',
  1542. * // nodes:
  1543. * // [ { type: 'bos', val: '' },
  1544. * // { type: 'text', val: 'a/' },
  1545. * // { type: 'brace',
  1546. * // nodes:
  1547. * // [ { type: 'brace.open', val: '{' },
  1548. * // { type: 'text', val: 'b,c' },
  1549. * // { type: 'brace.close', val: '}' } ] },
  1550. * // { type: 'text', val: '/d' },
  1551. * // { type: 'eos', val: '' } ] }
  1552. * ```
  1553. * @param {String} `pattern` Brace pattern to parse
  1554. * @param {Object} `options`
  1555. * @return {Object} Returns an AST
  1556. * @api public
  1557. */
  1558. braces.parse = function (pattern, options) {
  1559. var proto = new Braces(options);
  1560. return proto.parse(pattern, options);
  1561. };
  1562. /**
  1563. * Compile the given `ast` or string with the given `options`.
  1564. *
  1565. * ```js
  1566. * var braces = require('braces');
  1567. * var ast = braces.parse('a/{b,c}/d');
  1568. * console.log(braces.compile(ast));
  1569. * // { options: { source: 'string' },
  1570. * // state: {},
  1571. * // compilers:
  1572. * // { eos: [Function],
  1573. * // noop: [Function],
  1574. * // bos: [Function],
  1575. * // brace: [Function],
  1576. * // 'brace.open': [Function],
  1577. * // text: [Function],
  1578. * // 'brace.close': [Function] },
  1579. * // output: [ 'a/(b|c)/d' ],
  1580. * // ast:
  1581. * // { ... },
  1582. * // parsingErrors: [] }
  1583. * ```
  1584. * @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first.
  1585. * @param {Object} `options`
  1586. * @return {Object} Returns an object that has an `output` property with the compiled string.
  1587. * @api public
  1588. */
  1589. braces.compile = function (ast, options) {
  1590. var proto = new Braces(options);
  1591. return proto.compile(ast, options);
  1592. };
  1593. /**
  1594. * Clear the regex cache.
  1595. *
  1596. * ```js
  1597. * braces.clearCache();
  1598. * ```
  1599. * @api public
  1600. */
  1601. braces.clearCache = function () {
  1602. cache = braces.cache = {};
  1603. };
  1604. /**
  1605. * Memoize a generated regex or function. A unique key is generated
  1606. * from the method name, pattern, and user-defined options. Set
  1607. * options.memoize to false to disable.
  1608. */
  1609. function memoize(type, pattern, options, fn) {
  1610. var key = utils.createKey(type + ':' + pattern, options);
  1611. var disabled = options && options.cache === false;
  1612. if (disabled) {
  1613. braces.clearCache();
  1614. return fn(pattern, options);
  1615. }
  1616. if (cache.hasOwnProperty(key)) {
  1617. return cache[key];
  1618. }
  1619. var res = fn(pattern, options);
  1620. cache[key] = res;
  1621. return res;
  1622. }
  1623. /**
  1624. * Expose `Braces` constructor and methods
  1625. * @type {Function}
  1626. */
  1627. braces.Braces = Braces;
  1628. braces.compilers = compilers;
  1629. braces.parsers = parsers;
  1630. braces.cache = cache;
  1631. /**
  1632. * Expose `braces`
  1633. * @type {Function}
  1634. */
  1635. module.exports = braces;
  1636. /***/ }),
  1637. /***/ "./node_modules/braces/lib/braces.js":
  1638. /*!*******************************************!*\
  1639. !*** ./node_modules/braces/lib/braces.js ***!
  1640. \*******************************************/
  1641. /*! no static exports found */
  1642. /***/ (function(module, exports, __webpack_require__) {
  1643. "use strict";
  1644. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1645. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  1646. var Snapdragon = __webpack_require__(/*! snapdragon */ "./node_modules/snapdragon/index.js");
  1647. var compilers = __webpack_require__(/*! ./compilers */ "./node_modules/braces/lib/compilers.js");
  1648. var parsers = __webpack_require__(/*! ./parsers */ "./node_modules/braces/lib/parsers.js");
  1649. var utils = __webpack_require__(/*! ./utils */ "./node_modules/braces/lib/utils.js");
  1650. /**
  1651. * Customize Snapdragon parser and renderer
  1652. */
  1653. function Braces(options) {
  1654. this.options = extend({}, options);
  1655. }
  1656. /**
  1657. * Initialize braces
  1658. */
  1659. Braces.prototype.init = function (options) {
  1660. if (this.isInitialized) return;
  1661. this.isInitialized = true;
  1662. var opts = utils.createOptions({}, this.options, options);
  1663. this.snapdragon = this.options.snapdragon || new Snapdragon(opts);
  1664. this.compiler = this.snapdragon.compiler;
  1665. this.parser = this.snapdragon.parser;
  1666. compilers(this.snapdragon, opts);
  1667. parsers(this.snapdragon, opts);
  1668. /**
  1669. * Call Snapdragon `.parse` method. When AST is returned, we check to
  1670. * see if any unclosed braces are left on the stack and, if so, we iterate
  1671. * over the stack and correct the AST so that compilers are called in the correct
  1672. * order and unbalance braces are properly escaped.
  1673. */
  1674. utils.define(this.snapdragon, 'parse', function (pattern, options) {
  1675. var parsed = Snapdragon.prototype.parse.apply(this, arguments);
  1676. this.parser.ast.input = pattern;
  1677. var stack = this.parser.stack;
  1678. while (stack.length) {
  1679. addParent({
  1680. type: 'brace.close',
  1681. val: ''
  1682. }, stack.pop());
  1683. }
  1684. function addParent(node, parent) {
  1685. utils.define(node, 'parent', parent);
  1686. parent.nodes.push(node);
  1687. } // add non-enumerable parser reference
  1688. utils.define(parsed, 'parser', this.parser);
  1689. return parsed;
  1690. });
  1691. };
  1692. /**
  1693. * Decorate `.parse` method
  1694. */
  1695. Braces.prototype.parse = function (ast, options) {
  1696. if (ast && _typeof(ast) === 'object' && ast.nodes) return ast;
  1697. this.init(options);
  1698. return this.snapdragon.parse(ast, options);
  1699. };
  1700. /**
  1701. * Decorate `.compile` method
  1702. */
  1703. Braces.prototype.compile = function (ast, options) {
  1704. if (typeof ast === 'string') {
  1705. ast = this.parse(ast, options);
  1706. } else {
  1707. this.init(options);
  1708. }
  1709. return this.snapdragon.compile(ast, options);
  1710. };
  1711. /**
  1712. * Expand
  1713. */
  1714. Braces.prototype.expand = function (pattern) {
  1715. var ast = this.parse(pattern, {
  1716. expand: true
  1717. });
  1718. return this.compile(ast, {
  1719. expand: true
  1720. });
  1721. };
  1722. /**
  1723. * Optimize
  1724. */
  1725. Braces.prototype.optimize = function (pattern) {
  1726. var ast = this.parse(pattern, {
  1727. optimize: true
  1728. });
  1729. return this.compile(ast, {
  1730. optimize: true
  1731. });
  1732. };
  1733. /**
  1734. * Expose `Braces`
  1735. */
  1736. module.exports = Braces;
  1737. /***/ }),
  1738. /***/ "./node_modules/braces/lib/compilers.js":
  1739. /*!**********************************************!*\
  1740. !*** ./node_modules/braces/lib/compilers.js ***!
  1741. \**********************************************/
  1742. /*! no static exports found */
  1743. /***/ (function(module, exports, __webpack_require__) {
  1744. "use strict";
  1745. var utils = __webpack_require__(/*! ./utils */ "./node_modules/braces/lib/utils.js");
  1746. module.exports = function (braces, options) {
  1747. braces.compiler
  1748. /**
  1749. * bos
  1750. */
  1751. .set('bos', function () {
  1752. if (this.output) return;
  1753. this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : [];
  1754. this.ast.count = 1;
  1755. })
  1756. /**
  1757. * Square brackets
  1758. */
  1759. .set('bracket', function (node) {
  1760. var close = node.close;
  1761. var open = !node.escaped ? '[' : '\\[';
  1762. var negated = node.negated;
  1763. var inner = node.inner;
  1764. inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\');
  1765. if (inner === ']-') {
  1766. inner = '\\]\\-';
  1767. }
  1768. if (negated && inner.indexOf('.') === -1) {
  1769. inner += '.';
  1770. }
  1771. if (negated && inner.indexOf('/') === -1) {
  1772. inner += '/';
  1773. }
  1774. var val = open + negated + inner + close;
  1775. var queue = node.parent.queue;
  1776. var last = utils.arrayify(queue.pop());
  1777. queue.push(utils.join(last, val));
  1778. queue.push.apply(queue, []);
  1779. })
  1780. /**
  1781. * Brace
  1782. */
  1783. .set('brace', function (node) {
  1784. node.queue = isEscaped(node) ? [node.val] : [];
  1785. node.count = 1;
  1786. return this.mapVisit(node.nodes);
  1787. })
  1788. /**
  1789. * Open
  1790. */
  1791. .set('brace.open', function (node) {
  1792. node.parent.open = node.val;
  1793. })
  1794. /**
  1795. * Inner
  1796. */
  1797. .set('text', function (node) {
  1798. var queue = node.parent.queue;
  1799. var escaped = node.escaped;
  1800. var segs = [node.val];
  1801. if (node.optimize === false) {
  1802. options = utils.extend({}, options, {
  1803. optimize: false
  1804. });
  1805. }
  1806. if (node.multiplier > 1) {
  1807. node.parent.count *= node.multiplier;
  1808. }
  1809. if (options.quantifiers === true && utils.isQuantifier(node.val)) {
  1810. escaped = true;
  1811. } else if (node.val.length > 1) {
  1812. if (isType(node.parent, 'brace') && !isEscaped(node)) {
  1813. var expanded = utils.expand(node.val, options);
  1814. segs = expanded.segs;
  1815. if (expanded.isOptimized) {
  1816. node.parent.isOptimized = true;
  1817. } // if nothing was expanded, we probably have a literal brace
  1818. if (!segs.length) {
  1819. var val = expanded.val || node.val;
  1820. if (options.unescape !== false) {
  1821. // unescape unexpanded brace sequence/set separators
  1822. val = val.replace(/\\([,.])/g, '$1'); // strip quotes
  1823. val = val.replace(/["'`]/g, '');
  1824. }
  1825. segs = [val];
  1826. escaped = true;
  1827. }
  1828. }
  1829. } else if (node.val === ',') {
  1830. if (options.expand) {
  1831. node.parent.queue.push(['']);
  1832. segs = [''];
  1833. } else {
  1834. segs = ['|'];
  1835. }
  1836. } else {
  1837. escaped = true;
  1838. }
  1839. if (escaped && isType(node.parent, 'brace')) {
  1840. if (node.parent.nodes.length <= 4 && node.parent.count === 1) {
  1841. node.parent.escaped = true;
  1842. } else if (node.parent.length <= 3) {
  1843. node.parent.escaped = true;
  1844. }
  1845. }
  1846. if (!hasQueue(node.parent)) {
  1847. node.parent.queue = segs;
  1848. return;
  1849. }
  1850. var last = utils.arrayify(queue.pop());
  1851. if (node.parent.count > 1 && options.expand) {
  1852. last = multiply(last, node.parent.count);
  1853. node.parent.count = 1;
  1854. }
  1855. queue.push(utils.join(utils.flatten(last), segs.shift()));
  1856. queue.push.apply(queue, segs);
  1857. })
  1858. /**
  1859. * Close
  1860. */
  1861. .set('brace.close', function (node) {
  1862. var queue = node.parent.queue;
  1863. var prev = node.parent.parent;
  1864. var last = prev.queue.pop();
  1865. var open = node.parent.open;
  1866. var close = node.val;
  1867. if (open && close && isOptimized(node, options)) {
  1868. open = '(';
  1869. close = ')';
  1870. } // if a close brace exists, and the previous segment is one character
  1871. // don't wrap the result in braces or parens
  1872. var ele = utils.last(queue);
  1873. if (node.parent.count > 1 && options.expand) {
  1874. ele = multiply(queue.pop(), node.parent.count);
  1875. node.parent.count = 1;
  1876. queue.push(ele);
  1877. }
  1878. if (close && typeof ele === 'string' && ele.length === 1) {
  1879. open = '';
  1880. close = '';
  1881. }
  1882. if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) {
  1883. queue.push(utils.join(open, queue.pop() || ''));
  1884. queue = utils.flatten(utils.join(queue, close));
  1885. }
  1886. if (typeof last === 'undefined') {
  1887. prev.queue = [queue];
  1888. } else {
  1889. prev.queue.push(utils.flatten(utils.join(last, queue)));
  1890. }
  1891. })
  1892. /**
  1893. * eos
  1894. */
  1895. .set('eos', function (node) {
  1896. if (this.input) return;
  1897. if (options.optimize !== false) {
  1898. this.output = utils.last(utils.flatten(this.ast.queue));
  1899. } else if (Array.isArray(utils.last(this.ast.queue))) {
  1900. this.output = utils.flatten(this.ast.queue.pop());
  1901. } else {
  1902. this.output = utils.flatten(this.ast.queue);
  1903. }
  1904. if (node.parent.count > 1 && options.expand) {
  1905. this.output = multiply(this.output, node.parent.count);
  1906. }
  1907. this.output = utils.arrayify(this.output);
  1908. this.ast.queue = [];
  1909. });
  1910. };
  1911. /**
  1912. * Multiply the segments in the current brace level
  1913. */
  1914. function multiply(queue, n, options) {
  1915. return utils.flatten(utils.repeat(utils.arrayify(queue), n));
  1916. }
  1917. /**
  1918. * Return true if `node` is escaped
  1919. */
  1920. function isEscaped(node) {
  1921. return node.escaped === true;
  1922. }
  1923. /**
  1924. * Returns true if regex parens should be used for sets. If the parent `type`
  1925. * is not `brace`, then we're on a root node, which means we should never
  1926. * expand segments and open/close braces should be `{}` (since this indicates
  1927. * a brace is missing from the set)
  1928. */
  1929. function isOptimized(node, options) {
  1930. if (node.parent.isOptimized) return true;
  1931. return isType(node.parent, 'brace') && !isEscaped(node.parent) && options.expand !== true;
  1932. }
  1933. /**
  1934. * Returns true if the value in `node` should be wrapped in a literal brace.
  1935. * @return {Boolean}
  1936. */
  1937. function isLiteralBrace(node, options) {
  1938. return isEscaped(node.parent) || options.optimize !== false;
  1939. }
  1940. /**
  1941. * Returns true if the given `node` does not have an inner value.
  1942. * @return {Boolean}
  1943. */
  1944. function noInner(node, type) {
  1945. if (node.parent.queue.length === 1) {
  1946. return true;
  1947. }
  1948. var nodes = node.parent.nodes;
  1949. return nodes.length === 3 && isType(nodes[0], 'brace.open') && !isType(nodes[1], 'text') && isType(nodes[2], 'brace.close');
  1950. }
  1951. /**
  1952. * Returns true if the given `node` is the given `type`
  1953. * @return {Boolean}
  1954. */
  1955. function isType(node, type) {
  1956. return typeof node !== 'undefined' && node.type === type;
  1957. }
  1958. /**
  1959. * Returns true if the given `node` has a non-empty queue.
  1960. * @return {Boolean}
  1961. */
  1962. function hasQueue(node) {
  1963. return Array.isArray(node.queue) && node.queue.length;
  1964. }
  1965. /***/ }),
  1966. /***/ "./node_modules/braces/lib/parsers.js":
  1967. /*!********************************************!*\
  1968. !*** ./node_modules/braces/lib/parsers.js ***!
  1969. \********************************************/
  1970. /*! no static exports found */
  1971. /***/ (function(module, exports, __webpack_require__) {
  1972. "use strict";
  1973. var Node = __webpack_require__(/*! snapdragon-node */ "./node_modules/snapdragon-node/index.js");
  1974. var utils = __webpack_require__(/*! ./utils */ "./node_modules/braces/lib/utils.js");
  1975. /**
  1976. * Braces parsers
  1977. */
  1978. module.exports = function (braces, options) {
  1979. braces.parser.set('bos', function () {
  1980. if (!this.parsed) {
  1981. this.ast = this.nodes[0] = new Node(this.ast);
  1982. }
  1983. })
  1984. /**
  1985. * Character parsers
  1986. */
  1987. .set('escape', function () {
  1988. var pos = this.position();
  1989. var m = this.match(/^(?:\\(.)|\$\{)/);
  1990. if (!m) return;
  1991. var prev = this.prev();
  1992. var last = utils.last(prev.nodes);
  1993. var node = pos(new Node({
  1994. type: 'text',
  1995. multiplier: 1,
  1996. val: m[0]
  1997. }));
  1998. if (node.val === '\\\\') {
  1999. return node;
  2000. }
  2001. if (node.val === '${') {
  2002. var str = this.input;
  2003. var idx = -1;
  2004. var ch;
  2005. while (ch = str[++idx]) {
  2006. this.consume(1);
  2007. node.val += ch;
  2008. if (ch === '\\') {
  2009. node.val += str[++idx];
  2010. continue;
  2011. }
  2012. if (ch === '}') {
  2013. break;
  2014. }
  2015. }
  2016. }
  2017. if (this.options.unescape !== false) {
  2018. node.val = node.val.replace(/\\([{}])/g, '$1');
  2019. }
  2020. if (last.val === '"' && this.input.charAt(0) === '"') {
  2021. last.val = node.val;
  2022. this.consume(1);
  2023. return;
  2024. }
  2025. return concatNodes.call(this, pos, node, prev, options);
  2026. })
  2027. /**
  2028. * Brackets: "[...]" (basic, this is overridden by
  2029. * other parsers in more advanced implementations)
  2030. */
  2031. .set('bracket', function () {
  2032. var isInside = this.isInside('brace');
  2033. var pos = this.position();
  2034. var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/);
  2035. if (!m) return;
  2036. var prev = this.prev();
  2037. var val = m[0];
  2038. var negated = m[1] ? '^' : '';
  2039. var inner = m[2] || '';
  2040. var close = m[3] || '';
  2041. if (isInside && prev.type === 'brace') {
  2042. prev.text = prev.text || '';
  2043. prev.text += val;
  2044. }
  2045. var esc = this.input.slice(0, 2);
  2046. if (inner === '' && esc === '\\]') {
  2047. inner += esc;
  2048. this.consume(2);
  2049. var str = this.input;
  2050. var idx = -1;
  2051. var ch;
  2052. while (ch = str[++idx]) {
  2053. this.consume(1);
  2054. if (ch === ']') {
  2055. close = ch;
  2056. break;
  2057. }
  2058. inner += ch;
  2059. }
  2060. }
  2061. return pos(new Node({
  2062. type: 'bracket',
  2063. val: val,
  2064. escaped: close !== ']',
  2065. negated: negated,
  2066. inner: inner,
  2067. close: close
  2068. }));
  2069. })
  2070. /**
  2071. * Empty braces (we capture these early to
  2072. * speed up processing in the compiler)
  2073. */
  2074. .set('multiplier', function () {
  2075. var isInside = this.isInside('brace');
  2076. var pos = this.position();
  2077. var m = this.match(/^\{((?:,|\{,+\})+)\}/);
  2078. if (!m) return;
  2079. this.multiplier = true;
  2080. var prev = this.prev();
  2081. var val = m[0];
  2082. if (isInside && prev.type === 'brace') {
  2083. prev.text = prev.text || '';
  2084. prev.text += val;
  2085. }
  2086. var node = pos(new Node({
  2087. type: 'text',
  2088. multiplier: 1,
  2089. match: m,
  2090. val: val
  2091. }));
  2092. return concatNodes.call(this, pos, node, prev, options);
  2093. })
  2094. /**
  2095. * Open
  2096. */
  2097. .set('brace.open', function () {
  2098. var pos = this.position();
  2099. var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/);
  2100. if (!m) return;
  2101. var prev = this.prev();
  2102. var last = utils.last(prev.nodes); // if the last parsed character was an extglob character
  2103. // we need to _not optimize_ the brace pattern because
  2104. // it might be mistaken for an extglob by a downstream parser
  2105. if (last && last.val && isExtglobChar(last.val.slice(-1))) {
  2106. last.optimize = false;
  2107. }
  2108. var open = pos(new Node({
  2109. type: 'brace.open',
  2110. val: m[0]
  2111. }));
  2112. var node = pos(new Node({
  2113. type: 'brace',
  2114. nodes: []
  2115. }));
  2116. node.push(open);
  2117. prev.push(node);
  2118. this.push('brace', node);
  2119. })
  2120. /**
  2121. * Close
  2122. */
  2123. .set('brace.close', function () {
  2124. var pos = this.position();
  2125. var m = this.match(/^\}/);
  2126. if (!m || !m[0]) return;
  2127. var brace = this.pop('brace');
  2128. var node = pos(new Node({
  2129. type: 'brace.close',
  2130. val: m[0]
  2131. }));
  2132. if (!this.isType(brace, 'brace')) {
  2133. if (this.options.strict) {
  2134. throw new Error('missing opening "{"');
  2135. }
  2136. node.type = 'text';
  2137. node.multiplier = 0;
  2138. node.escaped = true;
  2139. return node;
  2140. }
  2141. var prev = this.prev();
  2142. var last = utils.last(prev.nodes);
  2143. if (last.text) {
  2144. var lastNode = utils.last(last.nodes);
  2145. if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) {
  2146. var open = last.nodes[0];
  2147. var text = last.nodes[1];
  2148. if (open.type === 'brace.open' && text && text.type === 'text') {
  2149. text.optimize = false;
  2150. }
  2151. }
  2152. }
  2153. if (brace.nodes.length > 2) {
  2154. var first = brace.nodes[1];
  2155. if (first.type === 'text' && first.val === ',') {
  2156. brace.nodes.splice(1, 1);
  2157. brace.nodes.push(first);
  2158. }
  2159. }
  2160. brace.push(node);
  2161. })
  2162. /**
  2163. * Capture boundary characters
  2164. */
  2165. .set('boundary', function () {
  2166. var pos = this.position();
  2167. var m = this.match(/^[$^](?!\{)/);
  2168. if (!m) return;
  2169. return pos(new Node({
  2170. type: 'text',
  2171. val: m[0]
  2172. }));
  2173. })
  2174. /**
  2175. * One or zero, non-comma characters wrapped in braces
  2176. */
  2177. .set('nobrace', function () {
  2178. var isInside = this.isInside('brace');
  2179. var pos = this.position();
  2180. var m = this.match(/^\{[^,]?\}/);
  2181. if (!m) return;
  2182. var prev = this.prev();
  2183. var val = m[0];
  2184. if (isInside && prev.type === 'brace') {
  2185. prev.text = prev.text || '';
  2186. prev.text += val;
  2187. }
  2188. return pos(new Node({
  2189. type: 'text',
  2190. multiplier: 0,
  2191. val: val
  2192. }));
  2193. })
  2194. /**
  2195. * Text
  2196. */
  2197. .set('text', function () {
  2198. var isInside = this.isInside('brace');
  2199. var pos = this.position();
  2200. var m = this.match(/^((?!\\)[^${}[\]])+/);
  2201. if (!m) return;
  2202. var prev = this.prev();
  2203. var val = m[0];
  2204. if (isInside && prev.type === 'brace') {
  2205. prev.text = prev.text || '';
  2206. prev.text += val;
  2207. }
  2208. var node = pos(new Node({
  2209. type: 'text',
  2210. multiplier: 1,
  2211. val: val
  2212. }));
  2213. return concatNodes.call(this, pos, node, prev, options);
  2214. });
  2215. };
  2216. /**
  2217. * Returns true if the character is an extglob character.
  2218. */
  2219. function isExtglobChar(ch) {
  2220. return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';
  2221. }
  2222. /**
  2223. * Combine text nodes, and calculate empty sets (`{,,}`)
  2224. * @param {Function} `pos` Function to calculate node position
  2225. * @param {Object} `node` AST node
  2226. * @return {Object}
  2227. */
  2228. function concatNodes(pos, node, parent, options) {
  2229. node.orig = node.val;
  2230. var prev = this.prev();
  2231. var last = utils.last(prev.nodes);
  2232. var isEscaped = false;
  2233. if (node.val.length > 1) {
  2234. var a = node.val.charAt(0);
  2235. var b = node.val.slice(-1);
  2236. isEscaped = a === '"' && b === '"' || a === "'" && b === "'" || a === '`' && b === '`';
  2237. }
  2238. if (isEscaped && options.unescape !== false) {
  2239. node.val = node.val.slice(1, node.val.length - 1);
  2240. node.escaped = true;
  2241. }
  2242. if (node.match) {
  2243. var match = node.match[1];
  2244. if (!match || match.indexOf('}') === -1) {
  2245. match = node.match[0];
  2246. } // replace each set with a single ","
  2247. var val = match.replace(/\{/g, ',').replace(/\}/g, '');
  2248. node.multiplier *= val.length;
  2249. node.val = '';
  2250. }
  2251. var simpleText = last.type === 'text' && last.multiplier === 1 && node.multiplier === 1 && node.val;
  2252. if (simpleText) {
  2253. last.val += node.val;
  2254. return;
  2255. }
  2256. prev.push(node);
  2257. }
  2258. /***/ }),
  2259. /***/ "./node_modules/braces/lib/utils.js":
  2260. /*!******************************************!*\
  2261. !*** ./node_modules/braces/lib/utils.js ***!
  2262. \******************************************/
  2263. /*! no static exports found */
  2264. /***/ (function(module, exports, __webpack_require__) {
  2265. "use strict";
  2266. var splitString = __webpack_require__(/*! split-string */ "./node_modules/split-string/index.js");
  2267. var utils = module.exports;
  2268. /**
  2269. * Module dependencies
  2270. */
  2271. utils.extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  2272. utils.flatten = __webpack_require__(/*! arr-flatten */ "./node_modules/arr-flatten/index.js");
  2273. utils.isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  2274. utils.fillRange = __webpack_require__(/*! fill-range */ "./node_modules/fill-range/index.js");
  2275. utils.repeat = __webpack_require__(/*! repeat-element */ "./node_modules/repeat-element/index.js");
  2276. utils.unique = __webpack_require__(/*! array-unique */ "./node_modules/array-unique/index.js");
  2277. utils.define = function (obj, key, val) {
  2278. Object.defineProperty(obj, key, {
  2279. writable: true,
  2280. configurable: true,
  2281. enumerable: false,
  2282. value: val
  2283. });
  2284. };
  2285. /**
  2286. * Returns true if the given string contains only empty brace sets.
  2287. */
  2288. utils.isEmptySets = function (str) {
  2289. return /^(?:\{,\})+$/.test(str);
  2290. };
  2291. /**
  2292. * Returns true if the given string contains only empty brace sets.
  2293. */
  2294. utils.isQuotedString = function (str) {
  2295. var open = str.charAt(0);
  2296. if (open === '\'' || open === '"' || open === '`') {
  2297. return str.slice(-1) === open;
  2298. }
  2299. return false;
  2300. };
  2301. /**
  2302. * Create the key to use for memoization. The unique key is generated
  2303. * by iterating over the options and concatenating key-value pairs
  2304. * to the pattern string.
  2305. */
  2306. utils.createKey = function (pattern, options) {
  2307. var id = pattern;
  2308. if (typeof options === 'undefined') {
  2309. return id;
  2310. }
  2311. var keys = Object.keys(options);
  2312. for (var i = 0; i < keys.length; i++) {
  2313. var key = keys[i];
  2314. id += ';' + key + '=' + String(options[key]);
  2315. }
  2316. return id;
  2317. };
  2318. /**
  2319. * Normalize options
  2320. */
  2321. utils.createOptions = function (options) {
  2322. var opts = utils.extend.apply(null, arguments);
  2323. if (typeof opts.expand === 'boolean') {
  2324. opts.optimize = !opts.expand;
  2325. }
  2326. if (typeof opts.optimize === 'boolean') {
  2327. opts.expand = !opts.optimize;
  2328. }
  2329. if (opts.optimize === true) {
  2330. opts.makeRe = true;
  2331. }
  2332. return opts;
  2333. };
  2334. /**
  2335. * Join patterns in `a` to patterns in `b`
  2336. */
  2337. utils.join = function (a, b, options) {
  2338. options = options || {};
  2339. a = utils.arrayify(a);
  2340. b = utils.arrayify(b);
  2341. if (!a.length) return b;
  2342. if (!b.length) return a;
  2343. var len = a.length;
  2344. var idx = -1;
  2345. var arr = [];
  2346. while (++idx < len) {
  2347. var val = a[idx];
  2348. if (Array.isArray(val)) {
  2349. for (var i = 0; i < val.length; i++) {
  2350. val[i] = utils.join(val[i], b, options);
  2351. }
  2352. arr.push(val);
  2353. continue;
  2354. }
  2355. for (var j = 0; j < b.length; j++) {
  2356. var bval = b[j];
  2357. if (Array.isArray(bval)) {
  2358. arr.push(utils.join(val, bval, options));
  2359. } else {
  2360. arr.push(val + bval);
  2361. }
  2362. }
  2363. }
  2364. return arr;
  2365. };
  2366. /**
  2367. * Split the given string on `,` if not escaped.
  2368. */
  2369. utils.split = function (str, options) {
  2370. var opts = utils.extend({
  2371. sep: ','
  2372. }, options);
  2373. if (typeof opts.keepQuotes !== 'boolean') {
  2374. opts.keepQuotes = true;
  2375. }
  2376. if (opts.unescape === false) {
  2377. opts.keepEscaping = true;
  2378. }
  2379. return splitString(str, opts, utils.escapeBrackets(opts));
  2380. };
  2381. /**
  2382. * Expand ranges or sets in the given `pattern`.
  2383. *
  2384. * @param {String} `str`
  2385. * @param {Object} `options`
  2386. * @return {Object}
  2387. */
  2388. utils.expand = function (str, options) {
  2389. var opts = utils.extend({
  2390. rangeLimit: 10000
  2391. }, options);
  2392. var segs = utils.split(str, opts);
  2393. var tok = {
  2394. segs: segs
  2395. };
  2396. if (utils.isQuotedString(str)) {
  2397. return tok;
  2398. }
  2399. if (opts.rangeLimit === true) {
  2400. opts.rangeLimit = 10000;
  2401. }
  2402. if (segs.length > 1) {
  2403. if (opts.optimize === false) {
  2404. tok.val = segs[0];
  2405. return tok;
  2406. }
  2407. tok.segs = utils.stringifyArray(tok.segs);
  2408. } else if (segs.length === 1) {
  2409. var arr = str.split('..');
  2410. if (arr.length === 1) {
  2411. tok.val = tok.segs[tok.segs.length - 1] || tok.val || str;
  2412. tok.segs = [];
  2413. return tok;
  2414. }
  2415. if (arr.length === 2 && arr[0] === arr[1]) {
  2416. tok.escaped = true;
  2417. tok.val = arr[0];
  2418. tok.segs = [];
  2419. return tok;
  2420. }
  2421. if (arr.length > 1) {
  2422. if (opts.optimize !== false) {
  2423. opts.optimize = true;
  2424. delete opts.expand;
  2425. }
  2426. if (opts.optimize !== true) {
  2427. var min = Math.min(arr[0], arr[1]);
  2428. var max = Math.max(arr[0], arr[1]);
  2429. var step = arr[2] || 1;
  2430. if (opts.rangeLimit !== false && (max - min) / step >= opts.rangeLimit) {
  2431. throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
  2432. }
  2433. }
  2434. arr.push(opts);
  2435. tok.segs = utils.fillRange.apply(null, arr);
  2436. if (!tok.segs.length) {
  2437. tok.escaped = true;
  2438. tok.val = str;
  2439. return tok;
  2440. }
  2441. if (opts.optimize === true) {
  2442. tok.segs = utils.stringifyArray(tok.segs);
  2443. }
  2444. if (tok.segs === '') {
  2445. tok.val = str;
  2446. } else {
  2447. tok.val = tok.segs[0];
  2448. }
  2449. return tok;
  2450. }
  2451. } else {
  2452. tok.val = str;
  2453. }
  2454. return tok;
  2455. };
  2456. /**
  2457. * Ensure commas inside brackets and parens are not split.
  2458. * @param {Object} `tok` Token from the `split-string` module
  2459. * @return {undefined}
  2460. */
  2461. utils.escapeBrackets = function (options) {
  2462. return function (tok) {
  2463. if (tok.escaped && tok.val === 'b') {
  2464. tok.val = '\\b';
  2465. return;
  2466. }
  2467. if (tok.val !== '(' && tok.val !== '[') return;
  2468. var opts = utils.extend({}, options);
  2469. var brackets = [];
  2470. var parens = [];
  2471. var stack = [];
  2472. var val = tok.val;
  2473. var str = tok.str;
  2474. var i = tok.idx - 1;
  2475. while (++i < str.length) {
  2476. var ch = str[i];
  2477. if (ch === '\\') {
  2478. val += (opts.keepEscaping === false ? '' : ch) + str[++i];
  2479. continue;
  2480. }
  2481. if (ch === '(') {
  2482. parens.push(ch);
  2483. stack.push(ch);
  2484. }
  2485. if (ch === '[') {
  2486. brackets.push(ch);
  2487. stack.push(ch);
  2488. }
  2489. if (ch === ')') {
  2490. parens.pop();
  2491. stack.pop();
  2492. if (!stack.length) {
  2493. val += ch;
  2494. break;
  2495. }
  2496. }
  2497. if (ch === ']') {
  2498. brackets.pop();
  2499. stack.pop();
  2500. if (!stack.length) {
  2501. val += ch;
  2502. break;
  2503. }
  2504. }
  2505. val += ch;
  2506. }
  2507. tok.split = false;
  2508. tok.val = val.slice(1);
  2509. tok.idx = i;
  2510. };
  2511. };
  2512. /**
  2513. * Returns true if the given string looks like a regex quantifier
  2514. * @return {Boolean}
  2515. */
  2516. utils.isQuantifier = function (str) {
  2517. return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str);
  2518. };
  2519. /**
  2520. * Cast `val` to an array.
  2521. * @param {*} `val`
  2522. */
  2523. utils.stringifyArray = function (arr) {
  2524. return [utils.arrayify(arr).join('|')];
  2525. };
  2526. /**
  2527. * Cast `val` to an array.
  2528. * @param {*} `val`
  2529. */
  2530. utils.arrayify = function (arr) {
  2531. if (typeof arr === 'undefined') {
  2532. return [];
  2533. }
  2534. if (typeof arr === 'string') {
  2535. return [arr];
  2536. }
  2537. return arr;
  2538. };
  2539. /**
  2540. * Returns true if the given `str` is a non-empty string
  2541. * @return {Boolean}
  2542. */
  2543. utils.isString = function (str) {
  2544. return str != null && typeof str === 'string';
  2545. };
  2546. /**
  2547. * Get the last element from `array`
  2548. * @param {Array} `array`
  2549. * @return {*}
  2550. */
  2551. utils.last = function (arr, n) {
  2552. return arr[arr.length - (n || 1)];
  2553. };
  2554. utils.escapeRegex = function (str) {
  2555. return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1');
  2556. };
  2557. /***/ }),
  2558. /***/ "./node_modules/cache-base/index.js":
  2559. /*!******************************************!*\
  2560. !*** ./node_modules/cache-base/index.js ***!
  2561. \******************************************/
  2562. /*! no static exports found */
  2563. /***/ (function(module, exports, __webpack_require__) {
  2564. "use strict";
  2565. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  2566. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/cache-base/node_modules/component-emitter/index.js");
  2567. var visit = __webpack_require__(/*! collection-visit */ "./node_modules/collection-visit/index.js");
  2568. var toPath = __webpack_require__(/*! to-object-path */ "./node_modules/to-object-path/index.js");
  2569. var union = __webpack_require__(/*! union-value */ "./node_modules/union-value/index.js");
  2570. var del = __webpack_require__(/*! unset-value */ "./node_modules/unset-value/index.js");
  2571. var get = __webpack_require__(/*! get-value */ "./node_modules/get-value/index.js");
  2572. var has = __webpack_require__(/*! has-value */ "./node_modules/has-value/index.js");
  2573. var set = __webpack_require__(/*! set-value */ "./node_modules/set-value/index.js");
  2574. /**
  2575. * Create a `Cache` constructor that when instantiated will
  2576. * store values on the given `prop`.
  2577. *
  2578. * ```js
  2579. * var Cache = require('cache-base').namespace('data');
  2580. * var cache = new Cache();
  2581. *
  2582. * cache.set('foo', 'bar');
  2583. * //=> {data: {foo: 'bar'}}
  2584. * ```
  2585. * @param {String} `prop` The property name to use for storing values.
  2586. * @return {Function} Returns a custom `Cache` constructor
  2587. * @api public
  2588. */
  2589. function namespace(prop) {
  2590. /**
  2591. * Create a new `Cache`. Internally the `Cache` constructor is created using
  2592. * the `namespace` function, with `cache` defined as the storage object.
  2593. *
  2594. * ```js
  2595. * var app = new Cache();
  2596. * ```
  2597. * @param {Object} `cache` Optionally pass an object to initialize with.
  2598. * @constructor
  2599. * @api public
  2600. */
  2601. function Cache(cache) {
  2602. if (prop) {
  2603. this[prop] = {};
  2604. }
  2605. if (cache) {
  2606. this.set(cache);
  2607. }
  2608. }
  2609. /**
  2610. * Inherit Emitter
  2611. */
  2612. Emitter(Cache.prototype);
  2613. /**
  2614. * Assign `value` to `key`. Also emits `set` with
  2615. * the key and value.
  2616. *
  2617. * ```js
  2618. * app.on('set', function(key, val) {
  2619. * // do something when `set` is emitted
  2620. * });
  2621. *
  2622. * app.set(key, value);
  2623. *
  2624. * // also takes an object or array
  2625. * app.set({name: 'Halle'});
  2626. * app.set([{foo: 'bar'}, {baz: 'quux'}]);
  2627. * console.log(app);
  2628. * //=> {name: 'Halle', foo: 'bar', baz: 'quux'}
  2629. * ```
  2630. *
  2631. * @name .set
  2632. * @emits `set` with `key` and `value` as arguments.
  2633. * @param {String} `key`
  2634. * @param {any} `value`
  2635. * @return {Object} Returns the instance for chaining.
  2636. * @api public
  2637. */
  2638. Cache.prototype.set = function (key, val) {
  2639. if (Array.isArray(key) && arguments.length === 2) {
  2640. key = toPath(key);
  2641. }
  2642. if (isObject(key) || Array.isArray(key)) {
  2643. this.visit('set', key);
  2644. } else {
  2645. set(prop ? this[prop] : this, key, val);
  2646. this.emit('set', key, val);
  2647. }
  2648. return this;
  2649. };
  2650. /**
  2651. * Union `array` to `key`. Also emits `set` with
  2652. * the key and value.
  2653. *
  2654. * ```js
  2655. * app.union('a.b', ['foo']);
  2656. * app.union('a.b', ['bar']);
  2657. * console.log(app.get('a'));
  2658. * //=> {b: ['foo', 'bar']}
  2659. * ```
  2660. * @name .union
  2661. * @param {String} `key`
  2662. * @param {any} `value`
  2663. * @return {Object} Returns the instance for chaining.
  2664. * @api public
  2665. */
  2666. Cache.prototype.union = function (key, val) {
  2667. if (Array.isArray(key) && arguments.length === 2) {
  2668. key = toPath(key);
  2669. }
  2670. var ctx = prop ? this[prop] : this;
  2671. union(ctx, key, arrayify(val));
  2672. this.emit('union', val);
  2673. return this;
  2674. };
  2675. /**
  2676. * Return the value of `key`. Dot notation may be used
  2677. * to get [nested property values][get-value].
  2678. *
  2679. * ```js
  2680. * app.set('a.b.c', 'd');
  2681. * app.get('a.b');
  2682. * //=> {c: 'd'}
  2683. *
  2684. * app.get(['a', 'b']);
  2685. * //=> {c: 'd'}
  2686. * ```
  2687. *
  2688. * @name .get
  2689. * @emits `get` with `key` and `value` as arguments.
  2690. * @param {String} `key` The name of the property to get. Dot-notation may be used.
  2691. * @return {any} Returns the value of `key`
  2692. * @api public
  2693. */
  2694. Cache.prototype.get = function (key) {
  2695. key = toPath(arguments);
  2696. var ctx = prop ? this[prop] : this;
  2697. var val = get(ctx, key);
  2698. this.emit('get', key, val);
  2699. return val;
  2700. };
  2701. /**
  2702. * Return true if app has a stored value for `key`,
  2703. * false only if value is `undefined`.
  2704. *
  2705. * ```js
  2706. * app.set('foo', 'bar');
  2707. * app.has('foo');
  2708. * //=> true
  2709. * ```
  2710. *
  2711. * @name .has
  2712. * @emits `has` with `key` and true or false as arguments.
  2713. * @param {String} `key`
  2714. * @return {Boolean}
  2715. * @api public
  2716. */
  2717. Cache.prototype.has = function (key) {
  2718. key = toPath(arguments);
  2719. var ctx = prop ? this[prop] : this;
  2720. var val = get(ctx, key);
  2721. var has = typeof val !== 'undefined';
  2722. this.emit('has', key, has);
  2723. return has;
  2724. };
  2725. /**
  2726. * Delete one or more properties from the instance.
  2727. *
  2728. * ```js
  2729. * app.del(); // delete all
  2730. * // or
  2731. * app.del('foo');
  2732. * // or
  2733. * app.del(['foo', 'bar']);
  2734. * ```
  2735. * @name .del
  2736. * @emits `del` with the `key` as the only argument.
  2737. * @param {String|Array} `key` Property name or array of property names.
  2738. * @return {Object} Returns the instance for chaining.
  2739. * @api public
  2740. */
  2741. Cache.prototype.del = function (key) {
  2742. if (Array.isArray(key)) {
  2743. this.visit('del', key);
  2744. } else {
  2745. del(prop ? this[prop] : this, key);
  2746. this.emit('del', key);
  2747. }
  2748. return this;
  2749. };
  2750. /**
  2751. * Reset the entire cache to an empty object.
  2752. *
  2753. * ```js
  2754. * app.clear();
  2755. * ```
  2756. * @api public
  2757. */
  2758. Cache.prototype.clear = function () {
  2759. if (prop) {
  2760. this[prop] = {};
  2761. }
  2762. };
  2763. /**
  2764. * Visit `method` over the properties in the given object, or map
  2765. * visit over the object-elements in an array.
  2766. *
  2767. * @name .visit
  2768. * @param {String} `method` The name of the `base` method to call.
  2769. * @param {Object|Array} `val` The object or array to iterate over.
  2770. * @return {Object} Returns the instance for chaining.
  2771. * @api public
  2772. */
  2773. Cache.prototype.visit = function (method, val) {
  2774. visit(this, method, val);
  2775. return this;
  2776. };
  2777. return Cache;
  2778. }
  2779. /**
  2780. * Cast val to an array
  2781. */
  2782. function arrayify(val) {
  2783. return val ? Array.isArray(val) ? val : [val] : [];
  2784. }
  2785. /**
  2786. * Expose `Cache`
  2787. */
  2788. module.exports = namespace();
  2789. /**
  2790. * Expose `Cache.namespace`
  2791. */
  2792. module.exports.namespace = namespace;
  2793. /***/ }),
  2794. /***/ "./node_modules/cache-base/node_modules/component-emitter/index.js":
  2795. /*!*************************************************************************!*\
  2796. !*** ./node_modules/cache-base/node_modules/component-emitter/index.js ***!
  2797. \*************************************************************************/
  2798. /*! no static exports found */
  2799. /***/ (function(module, exports, __webpack_require__) {
  2800. "use strict";
  2801. /**
  2802. * Expose `Emitter`.
  2803. */
  2804. if (true) {
  2805. module.exports = Emitter;
  2806. }
  2807. /**
  2808. * Initialize a new `Emitter`.
  2809. *
  2810. * @api public
  2811. */
  2812. function Emitter(obj) {
  2813. if (obj) return mixin(obj);
  2814. }
  2815. ;
  2816. /**
  2817. * Mixin the emitter properties.
  2818. *
  2819. * @param {Object} obj
  2820. * @return {Object}
  2821. * @api private
  2822. */
  2823. function mixin(obj) {
  2824. for (var key in Emitter.prototype) {
  2825. obj[key] = Emitter.prototype[key];
  2826. }
  2827. return obj;
  2828. }
  2829. /**
  2830. * Listen on the given `event` with `fn`.
  2831. *
  2832. * @param {String} event
  2833. * @param {Function} fn
  2834. * @return {Emitter}
  2835. * @api public
  2836. */
  2837. Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
  2838. this._callbacks = this._callbacks || {};
  2839. (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);
  2840. return this;
  2841. };
  2842. /**
  2843. * Adds an `event` listener that will be invoked a single
  2844. * time then automatically removed.
  2845. *
  2846. * @param {String} event
  2847. * @param {Function} fn
  2848. * @return {Emitter}
  2849. * @api public
  2850. */
  2851. Emitter.prototype.once = function (event, fn) {
  2852. function on() {
  2853. this.off(event, on);
  2854. fn.apply(this, arguments);
  2855. }
  2856. on.fn = fn;
  2857. this.on(event, on);
  2858. return this;
  2859. };
  2860. /**
  2861. * Remove the given callback for `event` or all
  2862. * registered callbacks.
  2863. *
  2864. * @param {String} event
  2865. * @param {Function} fn
  2866. * @return {Emitter}
  2867. * @api public
  2868. */
  2869. Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
  2870. this._callbacks = this._callbacks || {}; // all
  2871. if (0 == arguments.length) {
  2872. this._callbacks = {};
  2873. return this;
  2874. } // specific event
  2875. var callbacks = this._callbacks['$' + event];
  2876. if (!callbacks) return this; // remove all handlers
  2877. if (1 == arguments.length) {
  2878. delete this._callbacks['$' + event];
  2879. return this;
  2880. } // remove specific handler
  2881. var cb;
  2882. for (var i = 0; i < callbacks.length; i++) {
  2883. cb = callbacks[i];
  2884. if (cb === fn || cb.fn === fn) {
  2885. callbacks.splice(i, 1);
  2886. break;
  2887. }
  2888. } // Remove event specific arrays for event types that no
  2889. // one is subscribed for to avoid memory leak.
  2890. if (callbacks.length === 0) {
  2891. delete this._callbacks['$' + event];
  2892. }
  2893. return this;
  2894. };
  2895. /**
  2896. * Emit `event` with the given args.
  2897. *
  2898. * @param {String} event
  2899. * @param {Mixed} ...
  2900. * @return {Emitter}
  2901. */
  2902. Emitter.prototype.emit = function (event) {
  2903. this._callbacks = this._callbacks || {};
  2904. var args = new Array(arguments.length - 1),
  2905. callbacks = this._callbacks['$' + event];
  2906. for (var i = 1; i < arguments.length; i++) {
  2907. args[i - 1] = arguments[i];
  2908. }
  2909. if (callbacks) {
  2910. callbacks = callbacks.slice(0);
  2911. for (var i = 0, len = callbacks.length; i < len; ++i) {
  2912. callbacks[i].apply(this, args);
  2913. }
  2914. }
  2915. return this;
  2916. };
  2917. /**
  2918. * Return array of callbacks for `event`.
  2919. *
  2920. * @param {String} event
  2921. * @return {Array}
  2922. * @api public
  2923. */
  2924. Emitter.prototype.listeners = function (event) {
  2925. this._callbacks = this._callbacks || {};
  2926. return this._callbacks['$' + event] || [];
  2927. };
  2928. /**
  2929. * Check if this emitter has `event` handlers.
  2930. *
  2931. * @param {String} event
  2932. * @return {Boolean}
  2933. * @api public
  2934. */
  2935. Emitter.prototype.hasListeners = function (event) {
  2936. return !!this.listeners(event).length;
  2937. };
  2938. /***/ }),
  2939. /***/ "./node_modules/class-utils/index.js":
  2940. /*!*******************************************!*\
  2941. !*** ./node_modules/class-utils/index.js ***!
  2942. \*******************************************/
  2943. /*! no static exports found */
  2944. /***/ (function(module, exports, __webpack_require__) {
  2945. "use strict";
  2946. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  2947. var union = __webpack_require__(/*! arr-union */ "./node_modules/arr-union/index.js");
  2948. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  2949. var staticExtend = __webpack_require__(/*! static-extend */ "./node_modules/static-extend/index.js");
  2950. var isObj = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  2951. /**
  2952. * Expose class utils
  2953. */
  2954. var cu = module.exports;
  2955. /**
  2956. * Expose class utils: `cu`
  2957. */
  2958. cu.isObject = function isObject(val) {
  2959. return isObj(val) || typeof val === 'function';
  2960. };
  2961. /**
  2962. * Returns true if an array has any of the given elements, or an
  2963. * object has any of the give keys.
  2964. *
  2965. * ```js
  2966. * cu.has(['a', 'b', 'c'], 'c');
  2967. * //=> true
  2968. *
  2969. * cu.has(['a', 'b', 'c'], ['c', 'z']);
  2970. * //=> true
  2971. *
  2972. * cu.has({a: 'b', c: 'd'}, ['c', 'z']);
  2973. * //=> true
  2974. * ```
  2975. * @param {Object} `obj`
  2976. * @param {String|Array} `val`
  2977. * @return {Boolean}
  2978. * @api public
  2979. */
  2980. cu.has = function has(obj, val) {
  2981. val = cu.arrayify(val);
  2982. var len = val.length;
  2983. if (cu.isObject(obj)) {
  2984. for (var key in obj) {
  2985. if (val.indexOf(key) > -1) {
  2986. return true;
  2987. }
  2988. }
  2989. var keys = cu.nativeKeys(obj);
  2990. return cu.has(keys, val);
  2991. }
  2992. if (Array.isArray(obj)) {
  2993. var arr = obj;
  2994. while (len--) {
  2995. if (arr.indexOf(val[len]) > -1) {
  2996. return true;
  2997. }
  2998. }
  2999. return false;
  3000. }
  3001. throw new TypeError('expected an array or object.');
  3002. };
  3003. /**
  3004. * Returns true if an array or object has all of the given values.
  3005. *
  3006. * ```js
  3007. * cu.hasAll(['a', 'b', 'c'], 'c');
  3008. * //=> true
  3009. *
  3010. * cu.hasAll(['a', 'b', 'c'], ['c', 'z']);
  3011. * //=> false
  3012. *
  3013. * cu.hasAll({a: 'b', c: 'd'}, ['c', 'z']);
  3014. * //=> false
  3015. * ```
  3016. * @param {Object|Array} `val`
  3017. * @param {String|Array} `values`
  3018. * @return {Boolean}
  3019. * @api public
  3020. */
  3021. cu.hasAll = function hasAll(val, values) {
  3022. values = cu.arrayify(values);
  3023. var len = values.length;
  3024. while (len--) {
  3025. if (!cu.has(val, values[len])) {
  3026. return false;
  3027. }
  3028. }
  3029. return true;
  3030. };
  3031. /**
  3032. * Cast the given value to an array.
  3033. *
  3034. * ```js
  3035. * cu.arrayify('foo');
  3036. * //=> ['foo']
  3037. *
  3038. * cu.arrayify(['foo']);
  3039. * //=> ['foo']
  3040. * ```
  3041. *
  3042. * @param {String|Array} `val`
  3043. * @return {Array}
  3044. * @api public
  3045. */
  3046. cu.arrayify = function arrayify(val) {
  3047. return val ? Array.isArray(val) ? val : [val] : [];
  3048. };
  3049. /**
  3050. * Noop
  3051. */
  3052. cu.noop = function noop() {
  3053. return;
  3054. };
  3055. /**
  3056. * Returns the first argument passed to the function.
  3057. */
  3058. cu.identity = function identity(val) {
  3059. return val;
  3060. };
  3061. /**
  3062. * Returns true if a value has a `contructor`
  3063. *
  3064. * ```js
  3065. * cu.hasConstructor({});
  3066. * //=> true
  3067. *
  3068. * cu.hasConstructor(Object.create(null));
  3069. * //=> false
  3070. * ```
  3071. * @param {Object} `value`
  3072. * @return {Boolean}
  3073. * @api public
  3074. */
  3075. cu.hasConstructor = function hasConstructor(val) {
  3076. return cu.isObject(val) && typeof val.constructor !== 'undefined';
  3077. };
  3078. /**
  3079. * Get the native `ownPropertyNames` from the constructor of the
  3080. * given `object`. An empty array is returned if the object does
  3081. * not have a constructor.
  3082. *
  3083. * ```js
  3084. * cu.nativeKeys({a: 'b', b: 'c', c: 'd'})
  3085. * //=> ['a', 'b', 'c']
  3086. *
  3087. * cu.nativeKeys(function(){})
  3088. * //=> ['length', 'caller']
  3089. * ```
  3090. *
  3091. * @param {Object} `obj` Object that has a `constructor`.
  3092. * @return {Array} Array of keys.
  3093. * @api public
  3094. */
  3095. cu.nativeKeys = function nativeKeys(val) {
  3096. if (!cu.hasConstructor(val)) return [];
  3097. var keys = Object.getOwnPropertyNames(val);
  3098. if ('caller' in val) keys.push('caller');
  3099. return keys;
  3100. };
  3101. /**
  3102. * Returns property descriptor `key` if it's an "own" property
  3103. * of the given object.
  3104. *
  3105. * ```js
  3106. * function App() {}
  3107. * Object.defineProperty(App.prototype, 'count', {
  3108. * get: function() {
  3109. * return Object.keys(this).length;
  3110. * }
  3111. * });
  3112. * cu.getDescriptor(App.prototype, 'count');
  3113. * // returns:
  3114. * // {
  3115. * // get: [Function],
  3116. * // set: undefined,
  3117. * // enumerable: false,
  3118. * // configurable: false
  3119. * // }
  3120. * ```
  3121. *
  3122. * @param {Object} `obj`
  3123. * @param {String} `key`
  3124. * @return {Object} Returns descriptor `key`
  3125. * @api public
  3126. */
  3127. cu.getDescriptor = function getDescriptor(obj, key) {
  3128. if (!cu.isObject(obj)) {
  3129. throw new TypeError('expected an object.');
  3130. }
  3131. if (typeof key !== 'string') {
  3132. throw new TypeError('expected key to be a string.');
  3133. }
  3134. return Object.getOwnPropertyDescriptor(obj, key);
  3135. };
  3136. /**
  3137. * Copy a descriptor from one object to another.
  3138. *
  3139. * ```js
  3140. * function App() {}
  3141. * Object.defineProperty(App.prototype, 'count', {
  3142. * get: function() {
  3143. * return Object.keys(this).length;
  3144. * }
  3145. * });
  3146. * var obj = {};
  3147. * cu.copyDescriptor(obj, App.prototype, 'count');
  3148. * ```
  3149. * @param {Object} `receiver`
  3150. * @param {Object} `provider`
  3151. * @param {String} `name`
  3152. * @return {Object}
  3153. * @api public
  3154. */
  3155. cu.copyDescriptor = function copyDescriptor(receiver, provider, name) {
  3156. if (!cu.isObject(receiver)) {
  3157. throw new TypeError('expected receiving object to be an object.');
  3158. }
  3159. if (!cu.isObject(provider)) {
  3160. throw new TypeError('expected providing object to be an object.');
  3161. }
  3162. if (typeof name !== 'string') {
  3163. throw new TypeError('expected name to be a string.');
  3164. }
  3165. var val = cu.getDescriptor(provider, name);
  3166. if (val) Object.defineProperty(receiver, name, val);
  3167. };
  3168. /**
  3169. * Copy static properties, prototype properties, and descriptors
  3170. * from one object to another.
  3171. *
  3172. * @param {Object} `receiver`
  3173. * @param {Object} `provider`
  3174. * @param {String|Array} `omit` One or more properties to omit
  3175. * @return {Object}
  3176. * @api public
  3177. */
  3178. cu.copy = function copy(receiver, provider, omit) {
  3179. if (!cu.isObject(receiver)) {
  3180. throw new TypeError('expected receiving object to be an object.');
  3181. }
  3182. if (!cu.isObject(provider)) {
  3183. throw new TypeError('expected providing object to be an object.');
  3184. }
  3185. var props = Object.getOwnPropertyNames(provider);
  3186. var keys = Object.keys(provider);
  3187. var len = props.length,
  3188. key;
  3189. omit = cu.arrayify(omit);
  3190. while (len--) {
  3191. key = props[len];
  3192. if (cu.has(keys, key)) {
  3193. define(receiver, key, provider[key]);
  3194. } else if (!(key in receiver) && !cu.has(omit, key)) {
  3195. cu.copyDescriptor(receiver, provider, key);
  3196. }
  3197. }
  3198. };
  3199. /**
  3200. * Inherit the static properties, prototype properties, and descriptors
  3201. * from of an object.
  3202. *
  3203. * @param {Object} `receiver`
  3204. * @param {Object} `provider`
  3205. * @param {String|Array} `omit` One or more properties to omit
  3206. * @return {Object}
  3207. * @api public
  3208. */
  3209. cu.inherit = function inherit(receiver, provider, omit) {
  3210. if (!cu.isObject(receiver)) {
  3211. throw new TypeError('expected receiving object to be an object.');
  3212. }
  3213. if (!cu.isObject(provider)) {
  3214. throw new TypeError('expected providing object to be an object.');
  3215. }
  3216. var keys = [];
  3217. for (var key in provider) {
  3218. keys.push(key);
  3219. receiver[key] = provider[key];
  3220. }
  3221. keys = keys.concat(cu.arrayify(omit));
  3222. var a = provider.prototype || provider;
  3223. var b = receiver.prototype || receiver;
  3224. cu.copy(b, a, keys);
  3225. };
  3226. /**
  3227. * Returns a function for extending the static properties,
  3228. * prototype properties, and descriptors from the `Parent`
  3229. * constructor onto `Child` constructors.
  3230. *
  3231. * ```js
  3232. * var extend = cu.extend(Parent);
  3233. * Parent.extend(Child);
  3234. *
  3235. * // optional methods
  3236. * Parent.extend(Child, {
  3237. * foo: function() {},
  3238. * bar: function() {}
  3239. * });
  3240. * ```
  3241. * @param {Function} `Parent` Parent ctor
  3242. * @param {Function} `extend` Optional extend function to handle custom extensions. Useful when updating methods that require a specific prototype.
  3243. * @param {Function} `Child` Child ctor
  3244. * @param {Object} `proto` Optionally pass additional prototype properties to inherit.
  3245. * @return {Object}
  3246. * @api public
  3247. */
  3248. cu.extend = function () {
  3249. // keep it lazy, instead of assigning to `cu.extend`
  3250. return staticExtend.apply(null, arguments);
  3251. };
  3252. /**
  3253. * Bubble up events emitted from static methods on the Parent ctor.
  3254. *
  3255. * @param {Object} `Parent`
  3256. * @param {Array} `events` Event names to bubble up
  3257. * @api public
  3258. */
  3259. cu.bubble = function (Parent, events) {
  3260. events = events || [];
  3261. Parent.bubble = function (Child, arr) {
  3262. if (Array.isArray(arr)) {
  3263. events = union([], events, arr);
  3264. }
  3265. var len = events.length;
  3266. var idx = -1;
  3267. while (++idx < len) {
  3268. var name = events[idx];
  3269. Parent.on(name, Child.emit.bind(Child, name));
  3270. }
  3271. cu.bubble(Child, events);
  3272. };
  3273. };
  3274. /***/ }),
  3275. /***/ "./node_modules/collection-visit/index.js":
  3276. /*!************************************************!*\
  3277. !*** ./node_modules/collection-visit/index.js ***!
  3278. \************************************************/
  3279. /*! no static exports found */
  3280. /***/ (function(module, exports, __webpack_require__) {
  3281. "use strict";
  3282. /*!
  3283. * collection-visit <https://github.com/jonschlinkert/collection-visit>
  3284. *
  3285. * Copyright (c) 2015, 2017, Jon Schlinkert.
  3286. * Released under the MIT License.
  3287. */
  3288. var visit = __webpack_require__(/*! object-visit */ "./node_modules/object-visit/index.js");
  3289. var mapVisit = __webpack_require__(/*! map-visit */ "./node_modules/map-visit/index.js");
  3290. module.exports = function (collection, method, val) {
  3291. var result;
  3292. if (typeof val === 'string' && method in collection) {
  3293. var args = [].slice.call(arguments, 2);
  3294. result = collection[method].apply(collection, args);
  3295. } else if (Array.isArray(val)) {
  3296. result = mapVisit.apply(null, arguments);
  3297. } else {
  3298. result = visit.apply(null, arguments);
  3299. }
  3300. if (typeof result !== 'undefined') {
  3301. return result;
  3302. }
  3303. return collection;
  3304. };
  3305. /***/ }),
  3306. /***/ "./node_modules/color-convert/conversions.js":
  3307. /*!***************************************************!*\
  3308. !*** ./node_modules/color-convert/conversions.js ***!
  3309. \***************************************************/
  3310. /*! no static exports found */
  3311. /***/ (function(module, exports, __webpack_require__) {
  3312. "use strict";
  3313. /* MIT license */
  3314. var cssKeywords = __webpack_require__(/*! color-name */ "./node_modules/color-name/index.js"); // NOTE: conversions should only return primitive values (i.e. arrays, or
  3315. // values that give correct `typeof` results).
  3316. // do not use box values types (i.e. Number(), String(), etc.)
  3317. var reverseKeywords = {};
  3318. for (var key in cssKeywords) {
  3319. if (cssKeywords.hasOwnProperty(key)) {
  3320. reverseKeywords[cssKeywords[key]] = key;
  3321. }
  3322. }
  3323. var convert = module.exports = {
  3324. rgb: {
  3325. channels: 3,
  3326. labels: 'rgb'
  3327. },
  3328. hsl: {
  3329. channels: 3,
  3330. labels: 'hsl'
  3331. },
  3332. hsv: {
  3333. channels: 3,
  3334. labels: 'hsv'
  3335. },
  3336. hwb: {
  3337. channels: 3,
  3338. labels: 'hwb'
  3339. },
  3340. cmyk: {
  3341. channels: 4,
  3342. labels: 'cmyk'
  3343. },
  3344. xyz: {
  3345. channels: 3,
  3346. labels: 'xyz'
  3347. },
  3348. lab: {
  3349. channels: 3,
  3350. labels: 'lab'
  3351. },
  3352. lch: {
  3353. channels: 3,
  3354. labels: 'lch'
  3355. },
  3356. hex: {
  3357. channels: 1,
  3358. labels: ['hex']
  3359. },
  3360. keyword: {
  3361. channels: 1,
  3362. labels: ['keyword']
  3363. },
  3364. ansi16: {
  3365. channels: 1,
  3366. labels: ['ansi16']
  3367. },
  3368. ansi256: {
  3369. channels: 1,
  3370. labels: ['ansi256']
  3371. },
  3372. hcg: {
  3373. channels: 3,
  3374. labels: ['h', 'c', 'g']
  3375. },
  3376. apple: {
  3377. channels: 3,
  3378. labels: ['r16', 'g16', 'b16']
  3379. },
  3380. gray: {
  3381. channels: 1,
  3382. labels: ['gray']
  3383. }
  3384. }; // hide .channels and .labels properties
  3385. for (var model in convert) {
  3386. if (convert.hasOwnProperty(model)) {
  3387. if (!('channels' in convert[model])) {
  3388. throw new Error('missing channels property: ' + model);
  3389. }
  3390. if (!('labels' in convert[model])) {
  3391. throw new Error('missing channel labels property: ' + model);
  3392. }
  3393. if (convert[model].labels.length !== convert[model].channels) {
  3394. throw new Error('channel and label counts mismatch: ' + model);
  3395. }
  3396. var channels = convert[model].channels;
  3397. var labels = convert[model].labels;
  3398. delete convert[model].channels;
  3399. delete convert[model].labels;
  3400. Object.defineProperty(convert[model], 'channels', {
  3401. value: channels
  3402. });
  3403. Object.defineProperty(convert[model], 'labels', {
  3404. value: labels
  3405. });
  3406. }
  3407. }
  3408. convert.rgb.hsl = function (rgb) {
  3409. var r = rgb[0] / 255;
  3410. var g = rgb[1] / 255;
  3411. var b = rgb[2] / 255;
  3412. var min = Math.min(r, g, b);
  3413. var max = Math.max(r, g, b);
  3414. var delta = max - min;
  3415. var h;
  3416. var s;
  3417. var l;
  3418. if (max === min) {
  3419. h = 0;
  3420. } else if (r === max) {
  3421. h = (g - b) / delta;
  3422. } else if (g === max) {
  3423. h = 2 + (b - r) / delta;
  3424. } else if (b === max) {
  3425. h = 4 + (r - g) / delta;
  3426. }
  3427. h = Math.min(h * 60, 360);
  3428. if (h < 0) {
  3429. h += 360;
  3430. }
  3431. l = (min + max) / 2;
  3432. if (max === min) {
  3433. s = 0;
  3434. } else if (l <= 0.5) {
  3435. s = delta / (max + min);
  3436. } else {
  3437. s = delta / (2 - max - min);
  3438. }
  3439. return [h, s * 100, l * 100];
  3440. };
  3441. convert.rgb.hsv = function (rgb) {
  3442. var rdif;
  3443. var gdif;
  3444. var bdif;
  3445. var h;
  3446. var s;
  3447. var r = rgb[0] / 255;
  3448. var g = rgb[1] / 255;
  3449. var b = rgb[2] / 255;
  3450. var v = Math.max(r, g, b);
  3451. var diff = v - Math.min(r, g, b);
  3452. var diffc = function diffc(c) {
  3453. return (v - c) / 6 / diff + 1 / 2;
  3454. };
  3455. if (diff === 0) {
  3456. h = s = 0;
  3457. } else {
  3458. s = diff / v;
  3459. rdif = diffc(r);
  3460. gdif = diffc(g);
  3461. bdif = diffc(b);
  3462. if (r === v) {
  3463. h = bdif - gdif;
  3464. } else if (g === v) {
  3465. h = 1 / 3 + rdif - bdif;
  3466. } else if (b === v) {
  3467. h = 2 / 3 + gdif - rdif;
  3468. }
  3469. if (h < 0) {
  3470. h += 1;
  3471. } else if (h > 1) {
  3472. h -= 1;
  3473. }
  3474. }
  3475. return [h * 360, s * 100, v * 100];
  3476. };
  3477. convert.rgb.hwb = function (rgb) {
  3478. var r = rgb[0];
  3479. var g = rgb[1];
  3480. var b = rgb[2];
  3481. var h = convert.rgb.hsl(rgb)[0];
  3482. var w = 1 / 255 * Math.min(r, Math.min(g, b));
  3483. b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
  3484. return [h, w * 100, b * 100];
  3485. };
  3486. convert.rgb.cmyk = function (rgb) {
  3487. var r = rgb[0] / 255;
  3488. var g = rgb[1] / 255;
  3489. var b = rgb[2] / 255;
  3490. var c;
  3491. var m;
  3492. var y;
  3493. var k;
  3494. k = Math.min(1 - r, 1 - g, 1 - b);
  3495. c = (1 - r - k) / (1 - k) || 0;
  3496. m = (1 - g - k) / (1 - k) || 0;
  3497. y = (1 - b - k) / (1 - k) || 0;
  3498. return [c * 100, m * 100, y * 100, k * 100];
  3499. };
  3500. /**
  3501. * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
  3502. * */
  3503. function comparativeDistance(x, y) {
  3504. return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
  3505. }
  3506. convert.rgb.keyword = function (rgb) {
  3507. var reversed = reverseKeywords[rgb];
  3508. if (reversed) {
  3509. return reversed;
  3510. }
  3511. var currentClosestDistance = Infinity;
  3512. var currentClosestKeyword;
  3513. for (var keyword in cssKeywords) {
  3514. if (cssKeywords.hasOwnProperty(keyword)) {
  3515. var value = cssKeywords[keyword]; // Compute comparative distance
  3516. var distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
  3517. if (distance < currentClosestDistance) {
  3518. currentClosestDistance = distance;
  3519. currentClosestKeyword = keyword;
  3520. }
  3521. }
  3522. }
  3523. return currentClosestKeyword;
  3524. };
  3525. convert.keyword.rgb = function (keyword) {
  3526. return cssKeywords[keyword];
  3527. };
  3528. convert.rgb.xyz = function (rgb) {
  3529. var r = rgb[0] / 255;
  3530. var g = rgb[1] / 255;
  3531. var b = rgb[2] / 255; // assume sRGB
  3532. r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
  3533. g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
  3534. b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
  3535. var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
  3536. var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
  3537. var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
  3538. return [x * 100, y * 100, z * 100];
  3539. };
  3540. convert.rgb.lab = function (rgb) {
  3541. var xyz = convert.rgb.xyz(rgb);
  3542. var x = xyz[0];
  3543. var y = xyz[1];
  3544. var z = xyz[2];
  3545. var l;
  3546. var a;
  3547. var b;
  3548. x /= 95.047;
  3549. y /= 100;
  3550. z /= 108.883;
  3551. x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
  3552. y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
  3553. z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
  3554. l = 116 * y - 16;
  3555. a = 500 * (x - y);
  3556. b = 200 * (y - z);
  3557. return [l, a, b];
  3558. };
  3559. convert.hsl.rgb = function (hsl) {
  3560. var h = hsl[0] / 360;
  3561. var s = hsl[1] / 100;
  3562. var l = hsl[2] / 100;
  3563. var t1;
  3564. var t2;
  3565. var t3;
  3566. var rgb;
  3567. var val;
  3568. if (s === 0) {
  3569. val = l * 255;
  3570. return [val, val, val];
  3571. }
  3572. if (l < 0.5) {
  3573. t2 = l * (1 + s);
  3574. } else {
  3575. t2 = l + s - l * s;
  3576. }
  3577. t1 = 2 * l - t2;
  3578. rgb = [0, 0, 0];
  3579. for (var i = 0; i < 3; i++) {
  3580. t3 = h + 1 / 3 * -(i - 1);
  3581. if (t3 < 0) {
  3582. t3++;
  3583. }
  3584. if (t3 > 1) {
  3585. t3--;
  3586. }
  3587. if (6 * t3 < 1) {
  3588. val = t1 + (t2 - t1) * 6 * t3;
  3589. } else if (2 * t3 < 1) {
  3590. val = t2;
  3591. } else if (3 * t3 < 2) {
  3592. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  3593. } else {
  3594. val = t1;
  3595. }
  3596. rgb[i] = val * 255;
  3597. }
  3598. return rgb;
  3599. };
  3600. convert.hsl.hsv = function (hsl) {
  3601. var h = hsl[0];
  3602. var s = hsl[1] / 100;
  3603. var l = hsl[2] / 100;
  3604. var smin = s;
  3605. var lmin = Math.max(l, 0.01);
  3606. var sv;
  3607. var v;
  3608. l *= 2;
  3609. s *= l <= 1 ? l : 2 - l;
  3610. smin *= lmin <= 1 ? lmin : 2 - lmin;
  3611. v = (l + s) / 2;
  3612. sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
  3613. return [h, sv * 100, v * 100];
  3614. };
  3615. convert.hsv.rgb = function (hsv) {
  3616. var h = hsv[0] / 60;
  3617. var s = hsv[1] / 100;
  3618. var v = hsv[2] / 100;
  3619. var hi = Math.floor(h) % 6;
  3620. var f = h - Math.floor(h);
  3621. var p = 255 * v * (1 - s);
  3622. var q = 255 * v * (1 - s * f);
  3623. var t = 255 * v * (1 - s * (1 - f));
  3624. v *= 255;
  3625. switch (hi) {
  3626. case 0:
  3627. return [v, t, p];
  3628. case 1:
  3629. return [q, v, p];
  3630. case 2:
  3631. return [p, v, t];
  3632. case 3:
  3633. return [p, q, v];
  3634. case 4:
  3635. return [t, p, v];
  3636. case 5:
  3637. return [v, p, q];
  3638. }
  3639. };
  3640. convert.hsv.hsl = function (hsv) {
  3641. var h = hsv[0];
  3642. var s = hsv[1] / 100;
  3643. var v = hsv[2] / 100;
  3644. var vmin = Math.max(v, 0.01);
  3645. var lmin;
  3646. var sl;
  3647. var l;
  3648. l = (2 - s) * v;
  3649. lmin = (2 - s) * vmin;
  3650. sl = s * vmin;
  3651. sl /= lmin <= 1 ? lmin : 2 - lmin;
  3652. sl = sl || 0;
  3653. l /= 2;
  3654. return [h, sl * 100, l * 100];
  3655. }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  3656. convert.hwb.rgb = function (hwb) {
  3657. var h = hwb[0] / 360;
  3658. var wh = hwb[1] / 100;
  3659. var bl = hwb[2] / 100;
  3660. var ratio = wh + bl;
  3661. var i;
  3662. var v;
  3663. var f;
  3664. var n; // wh + bl cant be > 1
  3665. if (ratio > 1) {
  3666. wh /= ratio;
  3667. bl /= ratio;
  3668. }
  3669. i = Math.floor(6 * h);
  3670. v = 1 - bl;
  3671. f = 6 * h - i;
  3672. if ((i & 0x01) !== 0) {
  3673. f = 1 - f;
  3674. }
  3675. n = wh + f * (v - wh); // linear interpolation
  3676. var r;
  3677. var g;
  3678. var b;
  3679. switch (i) {
  3680. default:
  3681. case 6:
  3682. case 0:
  3683. r = v;
  3684. g = n;
  3685. b = wh;
  3686. break;
  3687. case 1:
  3688. r = n;
  3689. g = v;
  3690. b = wh;
  3691. break;
  3692. case 2:
  3693. r = wh;
  3694. g = v;
  3695. b = n;
  3696. break;
  3697. case 3:
  3698. r = wh;
  3699. g = n;
  3700. b = v;
  3701. break;
  3702. case 4:
  3703. r = n;
  3704. g = wh;
  3705. b = v;
  3706. break;
  3707. case 5:
  3708. r = v;
  3709. g = wh;
  3710. b = n;
  3711. break;
  3712. }
  3713. return [r * 255, g * 255, b * 255];
  3714. };
  3715. convert.cmyk.rgb = function (cmyk) {
  3716. var c = cmyk[0] / 100;
  3717. var m = cmyk[1] / 100;
  3718. var y = cmyk[2] / 100;
  3719. var k = cmyk[3] / 100;
  3720. var r;
  3721. var g;
  3722. var b;
  3723. r = 1 - Math.min(1, c * (1 - k) + k);
  3724. g = 1 - Math.min(1, m * (1 - k) + k);
  3725. b = 1 - Math.min(1, y * (1 - k) + k);
  3726. return [r * 255, g * 255, b * 255];
  3727. };
  3728. convert.xyz.rgb = function (xyz) {
  3729. var x = xyz[0] / 100;
  3730. var y = xyz[1] / 100;
  3731. var z = xyz[2] / 100;
  3732. var r;
  3733. var g;
  3734. var b;
  3735. r = x * 3.2406 + y * -1.5372 + z * -0.4986;
  3736. g = x * -0.9689 + y * 1.8758 + z * 0.0415;
  3737. b = x * 0.0557 + y * -0.2040 + z * 1.0570; // assume sRGB
  3738. r = r > 0.0031308 ? 1.055 * Math.pow(r, 1.0 / 2.4) - 0.055 : r * 12.92;
  3739. g = g > 0.0031308 ? 1.055 * Math.pow(g, 1.0 / 2.4) - 0.055 : g * 12.92;
  3740. b = b > 0.0031308 ? 1.055 * Math.pow(b, 1.0 / 2.4) - 0.055 : b * 12.92;
  3741. r = Math.min(Math.max(0, r), 1);
  3742. g = Math.min(Math.max(0, g), 1);
  3743. b = Math.min(Math.max(0, b), 1);
  3744. return [r * 255, g * 255, b * 255];
  3745. };
  3746. convert.xyz.lab = function (xyz) {
  3747. var x = xyz[0];
  3748. var y = xyz[1];
  3749. var z = xyz[2];
  3750. var l;
  3751. var a;
  3752. var b;
  3753. x /= 95.047;
  3754. y /= 100;
  3755. z /= 108.883;
  3756. x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
  3757. y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
  3758. z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
  3759. l = 116 * y - 16;
  3760. a = 500 * (x - y);
  3761. b = 200 * (y - z);
  3762. return [l, a, b];
  3763. };
  3764. convert.lab.xyz = function (lab) {
  3765. var l = lab[0];
  3766. var a = lab[1];
  3767. var b = lab[2];
  3768. var x;
  3769. var y;
  3770. var z;
  3771. y = (l + 16) / 116;
  3772. x = a / 500 + y;
  3773. z = y - b / 200;
  3774. var y2 = Math.pow(y, 3);
  3775. var x2 = Math.pow(x, 3);
  3776. var z2 = Math.pow(z, 3);
  3777. y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
  3778. x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
  3779. z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
  3780. x *= 95.047;
  3781. y *= 100;
  3782. z *= 108.883;
  3783. return [x, y, z];
  3784. };
  3785. convert.lab.lch = function (lab) {
  3786. var l = lab[0];
  3787. var a = lab[1];
  3788. var b = lab[2];
  3789. var hr;
  3790. var h;
  3791. var c;
  3792. hr = Math.atan2(b, a);
  3793. h = hr * 360 / 2 / Math.PI;
  3794. if (h < 0) {
  3795. h += 360;
  3796. }
  3797. c = Math.sqrt(a * a + b * b);
  3798. return [l, c, h];
  3799. };
  3800. convert.lch.lab = function (lch) {
  3801. var l = lch[0];
  3802. var c = lch[1];
  3803. var h = lch[2];
  3804. var a;
  3805. var b;
  3806. var hr;
  3807. hr = h / 360 * 2 * Math.PI;
  3808. a = c * Math.cos(hr);
  3809. b = c * Math.sin(hr);
  3810. return [l, a, b];
  3811. };
  3812. convert.rgb.ansi16 = function (args) {
  3813. var r = args[0];
  3814. var g = args[1];
  3815. var b = args[2];
  3816. var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
  3817. value = Math.round(value / 50);
  3818. if (value === 0) {
  3819. return 30;
  3820. }
  3821. var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
  3822. if (value === 2) {
  3823. ansi += 60;
  3824. }
  3825. return ansi;
  3826. };
  3827. convert.hsv.ansi16 = function (args) {
  3828. // optimization here; we already know the value and don't need to get
  3829. // it converted for us.
  3830. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
  3831. };
  3832. convert.rgb.ansi256 = function (args) {
  3833. var r = args[0];
  3834. var g = args[1];
  3835. var b = args[2]; // we use the extended greyscale palette here, with the exception of
  3836. // black and white. normal palette only has 4 greyscale shades.
  3837. if (r === g && g === b) {
  3838. if (r < 8) {
  3839. return 16;
  3840. }
  3841. if (r > 248) {
  3842. return 231;
  3843. }
  3844. return Math.round((r - 8) / 247 * 24) + 232;
  3845. }
  3846. var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
  3847. return ansi;
  3848. };
  3849. convert.ansi16.rgb = function (args) {
  3850. var color = args % 10; // handle greyscale
  3851. if (color === 0 || color === 7) {
  3852. if (args > 50) {
  3853. color += 3.5;
  3854. }
  3855. color = color / 10.5 * 255;
  3856. return [color, color, color];
  3857. }
  3858. var mult = (~~(args > 50) + 1) * 0.5;
  3859. var r = (color & 1) * mult * 255;
  3860. var g = (color >> 1 & 1) * mult * 255;
  3861. var b = (color >> 2 & 1) * mult * 255;
  3862. return [r, g, b];
  3863. };
  3864. convert.ansi256.rgb = function (args) {
  3865. // handle greyscale
  3866. if (args >= 232) {
  3867. var c = (args - 232) * 10 + 8;
  3868. return [c, c, c];
  3869. }
  3870. args -= 16;
  3871. var rem;
  3872. var r = Math.floor(args / 36) / 5 * 255;
  3873. var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
  3874. var b = rem % 6 / 5 * 255;
  3875. return [r, g, b];
  3876. };
  3877. convert.rgb.hex = function (args) {
  3878. var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
  3879. var string = integer.toString(16).toUpperCase();
  3880. return '000000'.substring(string.length) + string;
  3881. };
  3882. convert.hex.rgb = function (args) {
  3883. var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
  3884. if (!match) {
  3885. return [0, 0, 0];
  3886. }
  3887. var colorString = match[0];
  3888. if (match[0].length === 3) {
  3889. colorString = colorString.split('').map(function (char) {
  3890. return char + char;
  3891. }).join('');
  3892. }
  3893. var integer = parseInt(colorString, 16);
  3894. var r = integer >> 16 & 0xFF;
  3895. var g = integer >> 8 & 0xFF;
  3896. var b = integer & 0xFF;
  3897. return [r, g, b];
  3898. };
  3899. convert.rgb.hcg = function (rgb) {
  3900. var r = rgb[0] / 255;
  3901. var g = rgb[1] / 255;
  3902. var b = rgb[2] / 255;
  3903. var max = Math.max(Math.max(r, g), b);
  3904. var min = Math.min(Math.min(r, g), b);
  3905. var chroma = max - min;
  3906. var grayscale;
  3907. var hue;
  3908. if (chroma < 1) {
  3909. grayscale = min / (1 - chroma);
  3910. } else {
  3911. grayscale = 0;
  3912. }
  3913. if (chroma <= 0) {
  3914. hue = 0;
  3915. } else if (max === r) {
  3916. hue = (g - b) / chroma % 6;
  3917. } else if (max === g) {
  3918. hue = 2 + (b - r) / chroma;
  3919. } else {
  3920. hue = 4 + (r - g) / chroma + 4;
  3921. }
  3922. hue /= 6;
  3923. hue %= 1;
  3924. return [hue * 360, chroma * 100, grayscale * 100];
  3925. };
  3926. convert.hsl.hcg = function (hsl) {
  3927. var s = hsl[1] / 100;
  3928. var l = hsl[2] / 100;
  3929. var c = 1;
  3930. var f = 0;
  3931. if (l < 0.5) {
  3932. c = 2.0 * s * l;
  3933. } else {
  3934. c = 2.0 * s * (1.0 - l);
  3935. }
  3936. if (c < 1.0) {
  3937. f = (l - 0.5 * c) / (1.0 - c);
  3938. }
  3939. return [hsl[0], c * 100, f * 100];
  3940. };
  3941. convert.hsv.hcg = function (hsv) {
  3942. var s = hsv[1] / 100;
  3943. var v = hsv[2] / 100;
  3944. var c = s * v;
  3945. var f = 0;
  3946. if (c < 1.0) {
  3947. f = (v - c) / (1 - c);
  3948. }
  3949. return [hsv[0], c * 100, f * 100];
  3950. };
  3951. convert.hcg.rgb = function (hcg) {
  3952. var h = hcg[0] / 360;
  3953. var c = hcg[1] / 100;
  3954. var g = hcg[2] / 100;
  3955. if (c === 0.0) {
  3956. return [g * 255, g * 255, g * 255];
  3957. }
  3958. var pure = [0, 0, 0];
  3959. var hi = h % 1 * 6;
  3960. var v = hi % 1;
  3961. var w = 1 - v;
  3962. var mg = 0;
  3963. switch (Math.floor(hi)) {
  3964. case 0:
  3965. pure[0] = 1;
  3966. pure[1] = v;
  3967. pure[2] = 0;
  3968. break;
  3969. case 1:
  3970. pure[0] = w;
  3971. pure[1] = 1;
  3972. pure[2] = 0;
  3973. break;
  3974. case 2:
  3975. pure[0] = 0;
  3976. pure[1] = 1;
  3977. pure[2] = v;
  3978. break;
  3979. case 3:
  3980. pure[0] = 0;
  3981. pure[1] = w;
  3982. pure[2] = 1;
  3983. break;
  3984. case 4:
  3985. pure[0] = v;
  3986. pure[1] = 0;
  3987. pure[2] = 1;
  3988. break;
  3989. default:
  3990. pure[0] = 1;
  3991. pure[1] = 0;
  3992. pure[2] = w;
  3993. }
  3994. mg = (1.0 - c) * g;
  3995. return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
  3996. };
  3997. convert.hcg.hsv = function (hcg) {
  3998. var c = hcg[1] / 100;
  3999. var g = hcg[2] / 100;
  4000. var v = c + g * (1.0 - c);
  4001. var f = 0;
  4002. if (v > 0.0) {
  4003. f = c / v;
  4004. }
  4005. return [hcg[0], f * 100, v * 100];
  4006. };
  4007. convert.hcg.hsl = function (hcg) {
  4008. var c = hcg[1] / 100;
  4009. var g = hcg[2] / 100;
  4010. var l = g * (1.0 - c) + 0.5 * c;
  4011. var s = 0;
  4012. if (l > 0.0 && l < 0.5) {
  4013. s = c / (2 * l);
  4014. } else if (l >= 0.5 && l < 1.0) {
  4015. s = c / (2 * (1 - l));
  4016. }
  4017. return [hcg[0], s * 100, l * 100];
  4018. };
  4019. convert.hcg.hwb = function (hcg) {
  4020. var c = hcg[1] / 100;
  4021. var g = hcg[2] / 100;
  4022. var v = c + g * (1.0 - c);
  4023. return [hcg[0], (v - c) * 100, (1 - v) * 100];
  4024. };
  4025. convert.hwb.hcg = function (hwb) {
  4026. var w = hwb[1] / 100;
  4027. var b = hwb[2] / 100;
  4028. var v = 1 - b;
  4029. var c = v - w;
  4030. var g = 0;
  4031. if (c < 1) {
  4032. g = (v - c) / (1 - c);
  4033. }
  4034. return [hwb[0], c * 100, g * 100];
  4035. };
  4036. convert.apple.rgb = function (apple) {
  4037. return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
  4038. };
  4039. convert.rgb.apple = function (rgb) {
  4040. return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
  4041. };
  4042. convert.gray.rgb = function (args) {
  4043. return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
  4044. };
  4045. convert.gray.hsl = convert.gray.hsv = function (args) {
  4046. return [0, 0, args[0]];
  4047. };
  4048. convert.gray.hwb = function (gray) {
  4049. return [0, 100, gray[0]];
  4050. };
  4051. convert.gray.cmyk = function (gray) {
  4052. return [0, 0, 0, gray[0]];
  4053. };
  4054. convert.gray.lab = function (gray) {
  4055. return [gray[0], 0, 0];
  4056. };
  4057. convert.gray.hex = function (gray) {
  4058. var val = Math.round(gray[0] / 100 * 255) & 0xFF;
  4059. var integer = (val << 16) + (val << 8) + val;
  4060. var string = integer.toString(16).toUpperCase();
  4061. return '000000'.substring(string.length) + string;
  4062. };
  4063. convert.rgb.gray = function (rgb) {
  4064. var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
  4065. return [val / 255 * 100];
  4066. };
  4067. /***/ }),
  4068. /***/ "./node_modules/color-convert/index.js":
  4069. /*!*********************************************!*\
  4070. !*** ./node_modules/color-convert/index.js ***!
  4071. \*********************************************/
  4072. /*! no static exports found */
  4073. /***/ (function(module, exports, __webpack_require__) {
  4074. "use strict";
  4075. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4076. var conversions = __webpack_require__(/*! ./conversions */ "./node_modules/color-convert/conversions.js");
  4077. var route = __webpack_require__(/*! ./route */ "./node_modules/color-convert/route.js");
  4078. var convert = {};
  4079. var models = Object.keys(conversions);
  4080. function wrapRaw(fn) {
  4081. var wrappedFn = function wrappedFn(args) {
  4082. if (args === undefined || args === null) {
  4083. return args;
  4084. }
  4085. if (arguments.length > 1) {
  4086. args = Array.prototype.slice.call(arguments);
  4087. }
  4088. return fn(args);
  4089. }; // preserve .conversion property if there is one
  4090. if ('conversion' in fn) {
  4091. wrappedFn.conversion = fn.conversion;
  4092. }
  4093. return wrappedFn;
  4094. }
  4095. function wrapRounded(fn) {
  4096. var wrappedFn = function wrappedFn(args) {
  4097. if (args === undefined || args === null) {
  4098. return args;
  4099. }
  4100. if (arguments.length > 1) {
  4101. args = Array.prototype.slice.call(arguments);
  4102. }
  4103. var result = fn(args); // we're assuming the result is an array here.
  4104. // see notice in conversions.js; don't use box types
  4105. // in conversion functions.
  4106. if (_typeof(result) === 'object') {
  4107. for (var len = result.length, i = 0; i < len; i++) {
  4108. result[i] = Math.round(result[i]);
  4109. }
  4110. }
  4111. return result;
  4112. }; // preserve .conversion property if there is one
  4113. if ('conversion' in fn) {
  4114. wrappedFn.conversion = fn.conversion;
  4115. }
  4116. return wrappedFn;
  4117. }
  4118. models.forEach(function (fromModel) {
  4119. convert[fromModel] = {};
  4120. Object.defineProperty(convert[fromModel], 'channels', {
  4121. value: conversions[fromModel].channels
  4122. });
  4123. Object.defineProperty(convert[fromModel], 'labels', {
  4124. value: conversions[fromModel].labels
  4125. });
  4126. var routes = route(fromModel);
  4127. var routeModels = Object.keys(routes);
  4128. routeModels.forEach(function (toModel) {
  4129. var fn = routes[toModel];
  4130. convert[fromModel][toModel] = wrapRounded(fn);
  4131. convert[fromModel][toModel].raw = wrapRaw(fn);
  4132. });
  4133. });
  4134. module.exports = convert;
  4135. /***/ }),
  4136. /***/ "./node_modules/color-convert/route.js":
  4137. /*!*********************************************!*\
  4138. !*** ./node_modules/color-convert/route.js ***!
  4139. \*********************************************/
  4140. /*! no static exports found */
  4141. /***/ (function(module, exports, __webpack_require__) {
  4142. "use strict";
  4143. var conversions = __webpack_require__(/*! ./conversions */ "./node_modules/color-convert/conversions.js");
  4144. /*
  4145. this function routes a model to all other models.
  4146. all functions that are routed have a property `.conversion` attached
  4147. to the returned synthetic function. This property is an array
  4148. of strings, each with the steps in between the 'from' and 'to'
  4149. color models (inclusive).
  4150. conversions that are not possible simply are not included.
  4151. */
  4152. function buildGraph() {
  4153. var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
  4154. var models = Object.keys(conversions);
  4155. for (var len = models.length, i = 0; i < len; i++) {
  4156. graph[models[i]] = {
  4157. // http://jsperf.com/1-vs-infinity
  4158. // micro-opt, but this is simple.
  4159. distance: -1,
  4160. parent: null
  4161. };
  4162. }
  4163. return graph;
  4164. } // https://en.wikipedia.org/wiki/Breadth-first_search
  4165. function deriveBFS(fromModel) {
  4166. var graph = buildGraph();
  4167. var queue = [fromModel]; // unshift -> queue -> pop
  4168. graph[fromModel].distance = 0;
  4169. while (queue.length) {
  4170. var current = queue.pop();
  4171. var adjacents = Object.keys(conversions[current]);
  4172. for (var len = adjacents.length, i = 0; i < len; i++) {
  4173. var adjacent = adjacents[i];
  4174. var node = graph[adjacent];
  4175. if (node.distance === -1) {
  4176. node.distance = graph[current].distance + 1;
  4177. node.parent = current;
  4178. queue.unshift(adjacent);
  4179. }
  4180. }
  4181. }
  4182. return graph;
  4183. }
  4184. function link(from, to) {
  4185. return function (args) {
  4186. return to(from(args));
  4187. };
  4188. }
  4189. function wrapConversion(toModel, graph) {
  4190. var path = [graph[toModel].parent, toModel];
  4191. var fn = conversions[graph[toModel].parent][toModel];
  4192. var cur = graph[toModel].parent;
  4193. while (graph[cur].parent) {
  4194. path.unshift(graph[cur].parent);
  4195. fn = link(conversions[graph[cur].parent][cur], fn);
  4196. cur = graph[cur].parent;
  4197. }
  4198. fn.conversion = path;
  4199. return fn;
  4200. }
  4201. module.exports = function (fromModel) {
  4202. var graph = deriveBFS(fromModel);
  4203. var conversion = {};
  4204. var models = Object.keys(graph);
  4205. for (var len = models.length, i = 0; i < len; i++) {
  4206. var toModel = models[i];
  4207. var node = graph[toModel];
  4208. if (node.parent === null) {
  4209. // no possible conversion, or this node is the source model.
  4210. continue;
  4211. }
  4212. conversion[toModel] = wrapConversion(toModel, graph);
  4213. }
  4214. return conversion;
  4215. };
  4216. /***/ }),
  4217. /***/ "./node_modules/color-name/index.js":
  4218. /*!******************************************!*\
  4219. !*** ./node_modules/color-name/index.js ***!
  4220. \******************************************/
  4221. /*! no static exports found */
  4222. /***/ (function(module, exports, __webpack_require__) {
  4223. "use strict";
  4224. module.exports = {
  4225. "aliceblue": [240, 248, 255],
  4226. "antiquewhite": [250, 235, 215],
  4227. "aqua": [0, 255, 255],
  4228. "aquamarine": [127, 255, 212],
  4229. "azure": [240, 255, 255],
  4230. "beige": [245, 245, 220],
  4231. "bisque": [255, 228, 196],
  4232. "black": [0, 0, 0],
  4233. "blanchedalmond": [255, 235, 205],
  4234. "blue": [0, 0, 255],
  4235. "blueviolet": [138, 43, 226],
  4236. "brown": [165, 42, 42],
  4237. "burlywood": [222, 184, 135],
  4238. "cadetblue": [95, 158, 160],
  4239. "chartreuse": [127, 255, 0],
  4240. "chocolate": [210, 105, 30],
  4241. "coral": [255, 127, 80],
  4242. "cornflowerblue": [100, 149, 237],
  4243. "cornsilk": [255, 248, 220],
  4244. "crimson": [220, 20, 60],
  4245. "cyan": [0, 255, 255],
  4246. "darkblue": [0, 0, 139],
  4247. "darkcyan": [0, 139, 139],
  4248. "darkgoldenrod": [184, 134, 11],
  4249. "darkgray": [169, 169, 169],
  4250. "darkgreen": [0, 100, 0],
  4251. "darkgrey": [169, 169, 169],
  4252. "darkkhaki": [189, 183, 107],
  4253. "darkmagenta": [139, 0, 139],
  4254. "darkolivegreen": [85, 107, 47],
  4255. "darkorange": [255, 140, 0],
  4256. "darkorchid": [153, 50, 204],
  4257. "darkred": [139, 0, 0],
  4258. "darksalmon": [233, 150, 122],
  4259. "darkseagreen": [143, 188, 143],
  4260. "darkslateblue": [72, 61, 139],
  4261. "darkslategray": [47, 79, 79],
  4262. "darkslategrey": [47, 79, 79],
  4263. "darkturquoise": [0, 206, 209],
  4264. "darkviolet": [148, 0, 211],
  4265. "deeppink": [255, 20, 147],
  4266. "deepskyblue": [0, 191, 255],
  4267. "dimgray": [105, 105, 105],
  4268. "dimgrey": [105, 105, 105],
  4269. "dodgerblue": [30, 144, 255],
  4270. "firebrick": [178, 34, 34],
  4271. "floralwhite": [255, 250, 240],
  4272. "forestgreen": [34, 139, 34],
  4273. "fuchsia": [255, 0, 255],
  4274. "gainsboro": [220, 220, 220],
  4275. "ghostwhite": [248, 248, 255],
  4276. "gold": [255, 215, 0],
  4277. "goldenrod": [218, 165, 32],
  4278. "gray": [128, 128, 128],
  4279. "green": [0, 128, 0],
  4280. "greenyellow": [173, 255, 47],
  4281. "grey": [128, 128, 128],
  4282. "honeydew": [240, 255, 240],
  4283. "hotpink": [255, 105, 180],
  4284. "indianred": [205, 92, 92],
  4285. "indigo": [75, 0, 130],
  4286. "ivory": [255, 255, 240],
  4287. "khaki": [240, 230, 140],
  4288. "lavender": [230, 230, 250],
  4289. "lavenderblush": [255, 240, 245],
  4290. "lawngreen": [124, 252, 0],
  4291. "lemonchiffon": [255, 250, 205],
  4292. "lightblue": [173, 216, 230],
  4293. "lightcoral": [240, 128, 128],
  4294. "lightcyan": [224, 255, 255],
  4295. "lightgoldenrodyellow": [250, 250, 210],
  4296. "lightgray": [211, 211, 211],
  4297. "lightgreen": [144, 238, 144],
  4298. "lightgrey": [211, 211, 211],
  4299. "lightpink": [255, 182, 193],
  4300. "lightsalmon": [255, 160, 122],
  4301. "lightseagreen": [32, 178, 170],
  4302. "lightskyblue": [135, 206, 250],
  4303. "lightslategray": [119, 136, 153],
  4304. "lightslategrey": [119, 136, 153],
  4305. "lightsteelblue": [176, 196, 222],
  4306. "lightyellow": [255, 255, 224],
  4307. "lime": [0, 255, 0],
  4308. "limegreen": [50, 205, 50],
  4309. "linen": [250, 240, 230],
  4310. "magenta": [255, 0, 255],
  4311. "maroon": [128, 0, 0],
  4312. "mediumaquamarine": [102, 205, 170],
  4313. "mediumblue": [0, 0, 205],
  4314. "mediumorchid": [186, 85, 211],
  4315. "mediumpurple": [147, 112, 219],
  4316. "mediumseagreen": [60, 179, 113],
  4317. "mediumslateblue": [123, 104, 238],
  4318. "mediumspringgreen": [0, 250, 154],
  4319. "mediumturquoise": [72, 209, 204],
  4320. "mediumvioletred": [199, 21, 133],
  4321. "midnightblue": [25, 25, 112],
  4322. "mintcream": [245, 255, 250],
  4323. "mistyrose": [255, 228, 225],
  4324. "moccasin": [255, 228, 181],
  4325. "navajowhite": [255, 222, 173],
  4326. "navy": [0, 0, 128],
  4327. "oldlace": [253, 245, 230],
  4328. "olive": [128, 128, 0],
  4329. "olivedrab": [107, 142, 35],
  4330. "orange": [255, 165, 0],
  4331. "orangered": [255, 69, 0],
  4332. "orchid": [218, 112, 214],
  4333. "palegoldenrod": [238, 232, 170],
  4334. "palegreen": [152, 251, 152],
  4335. "paleturquoise": [175, 238, 238],
  4336. "palevioletred": [219, 112, 147],
  4337. "papayawhip": [255, 239, 213],
  4338. "peachpuff": [255, 218, 185],
  4339. "peru": [205, 133, 63],
  4340. "pink": [255, 192, 203],
  4341. "plum": [221, 160, 221],
  4342. "powderblue": [176, 224, 230],
  4343. "purple": [128, 0, 128],
  4344. "rebeccapurple": [102, 51, 153],
  4345. "red": [255, 0, 0],
  4346. "rosybrown": [188, 143, 143],
  4347. "royalblue": [65, 105, 225],
  4348. "saddlebrown": [139, 69, 19],
  4349. "salmon": [250, 128, 114],
  4350. "sandybrown": [244, 164, 96],
  4351. "seagreen": [46, 139, 87],
  4352. "seashell": [255, 245, 238],
  4353. "sienna": [160, 82, 45],
  4354. "silver": [192, 192, 192],
  4355. "skyblue": [135, 206, 235],
  4356. "slateblue": [106, 90, 205],
  4357. "slategray": [112, 128, 144],
  4358. "slategrey": [112, 128, 144],
  4359. "snow": [255, 250, 250],
  4360. "springgreen": [0, 255, 127],
  4361. "steelblue": [70, 130, 180],
  4362. "tan": [210, 180, 140],
  4363. "teal": [0, 128, 128],
  4364. "thistle": [216, 191, 216],
  4365. "tomato": [255, 99, 71],
  4366. "turquoise": [64, 224, 208],
  4367. "violet": [238, 130, 238],
  4368. "wheat": [245, 222, 179],
  4369. "white": [255, 255, 255],
  4370. "whitesmoke": [245, 245, 245],
  4371. "yellow": [255, 255, 0],
  4372. "yellowgreen": [154, 205, 50]
  4373. };
  4374. /***/ }),
  4375. /***/ "./node_modules/copy-descriptor/index.js":
  4376. /*!***********************************************!*\
  4377. !*** ./node_modules/copy-descriptor/index.js ***!
  4378. \***********************************************/
  4379. /*! no static exports found */
  4380. /***/ (function(module, exports, __webpack_require__) {
  4381. "use strict";
  4382. /*!
  4383. * copy-descriptor <https://github.com/jonschlinkert/copy-descriptor>
  4384. *
  4385. * Copyright (c) 2015, Jon Schlinkert.
  4386. * Licensed under the MIT License.
  4387. */
  4388. /**
  4389. * Copy a descriptor from one object to another.
  4390. *
  4391. * ```js
  4392. * function App() {
  4393. * this.cache = {};
  4394. * }
  4395. * App.prototype.set = function(key, val) {
  4396. * this.cache[key] = val;
  4397. * return this;
  4398. * };
  4399. * Object.defineProperty(App.prototype, 'count', {
  4400. * get: function() {
  4401. * return Object.keys(this.cache).length;
  4402. * }
  4403. * });
  4404. *
  4405. * copy(App.prototype, 'count', 'len');
  4406. *
  4407. * // create an instance
  4408. * var app = new App();
  4409. *
  4410. * app.set('a', true);
  4411. * app.set('b', true);
  4412. * app.set('c', true);
  4413. *
  4414. * console.log(app.count);
  4415. * //=> 3
  4416. * console.log(app.len);
  4417. * //=> 3
  4418. * ```
  4419. * @name copy
  4420. * @param {Object} `receiver` The target object
  4421. * @param {Object} `provider` The provider object
  4422. * @param {String} `from` The key to copy on provider.
  4423. * @param {String} `to` Optionally specify a new key name to use.
  4424. * @return {Object}
  4425. * @api public
  4426. */
  4427. module.exports = function copyDescriptor(receiver, provider, from, to) {
  4428. if (!isObject(provider) && typeof provider !== 'function') {
  4429. to = from;
  4430. from = provider;
  4431. provider = receiver;
  4432. }
  4433. if (!isObject(receiver) && typeof receiver !== 'function') {
  4434. throw new TypeError('expected the first argument to be an object');
  4435. }
  4436. if (!isObject(provider) && typeof provider !== 'function') {
  4437. throw new TypeError('expected provider to be an object');
  4438. }
  4439. if (typeof to !== 'string') {
  4440. to = from;
  4441. }
  4442. if (typeof from !== 'string') {
  4443. throw new TypeError('expected key to be a string');
  4444. }
  4445. if (!(from in provider)) {
  4446. throw new Error('property "' + from + '" does not exist');
  4447. }
  4448. var val = Object.getOwnPropertyDescriptor(provider, from);
  4449. if (val) Object.defineProperty(receiver, to, val);
  4450. };
  4451. function isObject(val) {
  4452. return {}.toString.call(val) === '[object Object]';
  4453. }
  4454. /***/ }),
  4455. /***/ "./node_modules/define-property/index.js":
  4456. /*!***********************************************!*\
  4457. !*** ./node_modules/define-property/index.js ***!
  4458. \***********************************************/
  4459. /*! no static exports found */
  4460. /***/ (function(module, exports, __webpack_require__) {
  4461. "use strict";
  4462. /*!
  4463. * define-property <https://github.com/jonschlinkert/define-property>
  4464. *
  4465. * Copyright (c) 2015, Jon Schlinkert.
  4466. * Licensed under the MIT License.
  4467. */
  4468. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4469. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/define-property/node_modules/is-descriptor/index.js");
  4470. module.exports = function defineProperty(obj, prop, val) {
  4471. if (_typeof(obj) !== 'object' && typeof obj !== 'function') {
  4472. throw new TypeError('expected an object or function.');
  4473. }
  4474. if (typeof prop !== 'string') {
  4475. throw new TypeError('expected `prop` to be a string.');
  4476. }
  4477. if (isDescriptor(val) && ('set' in val || 'get' in val)) {
  4478. return Object.defineProperty(obj, prop, val);
  4479. }
  4480. return Object.defineProperty(obj, prop, {
  4481. configurable: true,
  4482. enumerable: false,
  4483. writable: true,
  4484. value: val
  4485. });
  4486. };
  4487. /***/ }),
  4488. /***/ "./node_modules/define-property/node_modules/is-accessor-descriptor/index.js":
  4489. /*!***********************************************************************************!*\
  4490. !*** ./node_modules/define-property/node_modules/is-accessor-descriptor/index.js ***!
  4491. \***********************************************************************************/
  4492. /*! no static exports found */
  4493. /***/ (function(module, exports, __webpack_require__) {
  4494. "use strict";
  4495. /*!
  4496. * is-accessor-descriptor <https://github.com/jonschlinkert/is-accessor-descriptor>
  4497. *
  4498. * Copyright (c) 2015, Jon Schlinkert.
  4499. * Licensed under the MIT License.
  4500. */
  4501. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/define-property/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js"); // accessor descriptor properties
  4502. var accessor = {
  4503. get: 'function',
  4504. set: 'function',
  4505. configurable: 'boolean',
  4506. enumerable: 'boolean'
  4507. };
  4508. function isAccessorDescriptor(obj, prop) {
  4509. if (typeof prop === 'string') {
  4510. var val = Object.getOwnPropertyDescriptor(obj, prop);
  4511. return typeof val !== 'undefined';
  4512. }
  4513. if (typeOf(obj) !== 'object') {
  4514. return false;
  4515. }
  4516. if (has(obj, 'value') || has(obj, 'writable')) {
  4517. return false;
  4518. }
  4519. if (!has(obj, 'get') || typeof obj.get !== 'function') {
  4520. return false;
  4521. } // tldr: it's valid to have "set" be undefined
  4522. // "set" might be undefined if `Object.getOwnPropertyDescriptor`
  4523. // was used to get the value, and only `get` was defined by the user
  4524. if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') {
  4525. return false;
  4526. }
  4527. for (var key in obj) {
  4528. if (!accessor.hasOwnProperty(key)) {
  4529. continue;
  4530. }
  4531. if (typeOf(obj[key]) === accessor[key]) {
  4532. continue;
  4533. }
  4534. if (typeof obj[key] !== 'undefined') {
  4535. return false;
  4536. }
  4537. }
  4538. return true;
  4539. }
  4540. function has(obj, key) {
  4541. return {}.hasOwnProperty.call(obj, key);
  4542. }
  4543. /**
  4544. * Expose `isAccessorDescriptor`
  4545. */
  4546. module.exports = isAccessorDescriptor;
  4547. /***/ }),
  4548. /***/ "./node_modules/define-property/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js":
  4549. /*!********************************************************************************************************!*\
  4550. !*** ./node_modules/define-property/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js ***!
  4551. \********************************************************************************************************/
  4552. /*! no static exports found */
  4553. /***/ (function(module, exports, __webpack_require__) {
  4554. "use strict";
  4555. var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/is-buffer/index.js");
  4556. var toString = Object.prototype.toString;
  4557. /**
  4558. * Get the native `typeof` a value.
  4559. *
  4560. * @param {*} `val`
  4561. * @return {*} Native javascript type
  4562. */
  4563. module.exports = function kindOf(val) {
  4564. // primitivies
  4565. if (typeof val === 'undefined') {
  4566. return 'undefined';
  4567. }
  4568. if (val === null) {
  4569. return 'null';
  4570. }
  4571. if (val === true || val === false || val instanceof Boolean) {
  4572. return 'boolean';
  4573. }
  4574. if (typeof val === 'string' || val instanceof String) {
  4575. return 'string';
  4576. }
  4577. if (typeof val === 'number' || val instanceof Number) {
  4578. return 'number';
  4579. } // functions
  4580. if (typeof val === 'function' || val instanceof Function) {
  4581. return 'function';
  4582. } // array
  4583. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  4584. return 'array';
  4585. } // check for instances of RegExp and Date before calling `toString`
  4586. if (val instanceof RegExp) {
  4587. return 'regexp';
  4588. }
  4589. if (val instanceof Date) {
  4590. return 'date';
  4591. } // other objects
  4592. var type = toString.call(val);
  4593. if (type === '[object RegExp]') {
  4594. return 'regexp';
  4595. }
  4596. if (type === '[object Date]') {
  4597. return 'date';
  4598. }
  4599. if (type === '[object Arguments]') {
  4600. return 'arguments';
  4601. }
  4602. if (type === '[object Error]') {
  4603. return 'error';
  4604. } // buffer
  4605. if (isBuffer(val)) {
  4606. return 'buffer';
  4607. } // es6: Map, WeakMap, Set, WeakSet
  4608. if (type === '[object Set]') {
  4609. return 'set';
  4610. }
  4611. if (type === '[object WeakSet]') {
  4612. return 'weakset';
  4613. }
  4614. if (type === '[object Map]') {
  4615. return 'map';
  4616. }
  4617. if (type === '[object WeakMap]') {
  4618. return 'weakmap';
  4619. }
  4620. if (type === '[object Symbol]') {
  4621. return 'symbol';
  4622. } // typed arrays
  4623. if (type === '[object Int8Array]') {
  4624. return 'int8array';
  4625. }
  4626. if (type === '[object Uint8Array]') {
  4627. return 'uint8array';
  4628. }
  4629. if (type === '[object Uint8ClampedArray]') {
  4630. return 'uint8clampedarray';
  4631. }
  4632. if (type === '[object Int16Array]') {
  4633. return 'int16array';
  4634. }
  4635. if (type === '[object Uint16Array]') {
  4636. return 'uint16array';
  4637. }
  4638. if (type === '[object Int32Array]') {
  4639. return 'int32array';
  4640. }
  4641. if (type === '[object Uint32Array]') {
  4642. return 'uint32array';
  4643. }
  4644. if (type === '[object Float32Array]') {
  4645. return 'float32array';
  4646. }
  4647. if (type === '[object Float64Array]') {
  4648. return 'float64array';
  4649. } // must be a plain object
  4650. return 'object';
  4651. };
  4652. /***/ }),
  4653. /***/ "./node_modules/define-property/node_modules/is-data-descriptor/index.js":
  4654. /*!*******************************************************************************!*\
  4655. !*** ./node_modules/define-property/node_modules/is-data-descriptor/index.js ***!
  4656. \*******************************************************************************/
  4657. /*! no static exports found */
  4658. /***/ (function(module, exports, __webpack_require__) {
  4659. "use strict";
  4660. /*!
  4661. * is-data-descriptor <https://github.com/jonschlinkert/is-data-descriptor>
  4662. *
  4663. * Copyright (c) 2015, Jon Schlinkert.
  4664. * Licensed under the MIT License.
  4665. */
  4666. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/define-property/node_modules/is-data-descriptor/node_modules/kind-of/index.js"); // data descriptor properties
  4667. var data = {
  4668. configurable: 'boolean',
  4669. enumerable: 'boolean',
  4670. writable: 'boolean'
  4671. };
  4672. function isDataDescriptor(obj, prop) {
  4673. if (typeOf(obj) !== 'object') {
  4674. return false;
  4675. }
  4676. if (typeof prop === 'string') {
  4677. var val = Object.getOwnPropertyDescriptor(obj, prop);
  4678. return typeof val !== 'undefined';
  4679. }
  4680. if (!('value' in obj) && !('writable' in obj)) {
  4681. return false;
  4682. }
  4683. for (var key in obj) {
  4684. if (key === 'value') continue;
  4685. if (!data.hasOwnProperty(key)) {
  4686. continue;
  4687. }
  4688. if (typeOf(obj[key]) === data[key]) {
  4689. continue;
  4690. }
  4691. if (typeof obj[key] !== 'undefined') {
  4692. return false;
  4693. }
  4694. }
  4695. return true;
  4696. }
  4697. /**
  4698. * Expose `isDataDescriptor`
  4699. */
  4700. module.exports = isDataDescriptor;
  4701. /***/ }),
  4702. /***/ "./node_modules/define-property/node_modules/is-data-descriptor/node_modules/kind-of/index.js":
  4703. /*!****************************************************************************************************!*\
  4704. !*** ./node_modules/define-property/node_modules/is-data-descriptor/node_modules/kind-of/index.js ***!
  4705. \****************************************************************************************************/
  4706. /*! no static exports found */
  4707. /***/ (function(module, exports, __webpack_require__) {
  4708. "use strict";
  4709. var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/is-buffer/index.js");
  4710. var toString = Object.prototype.toString;
  4711. /**
  4712. * Get the native `typeof` a value.
  4713. *
  4714. * @param {*} `val`
  4715. * @return {*} Native javascript type
  4716. */
  4717. module.exports = function kindOf(val) {
  4718. // primitivies
  4719. if (typeof val === 'undefined') {
  4720. return 'undefined';
  4721. }
  4722. if (val === null) {
  4723. return 'null';
  4724. }
  4725. if (val === true || val === false || val instanceof Boolean) {
  4726. return 'boolean';
  4727. }
  4728. if (typeof val === 'string' || val instanceof String) {
  4729. return 'string';
  4730. }
  4731. if (typeof val === 'number' || val instanceof Number) {
  4732. return 'number';
  4733. } // functions
  4734. if (typeof val === 'function' || val instanceof Function) {
  4735. return 'function';
  4736. } // array
  4737. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  4738. return 'array';
  4739. } // check for instances of RegExp and Date before calling `toString`
  4740. if (val instanceof RegExp) {
  4741. return 'regexp';
  4742. }
  4743. if (val instanceof Date) {
  4744. return 'date';
  4745. } // other objects
  4746. var type = toString.call(val);
  4747. if (type === '[object RegExp]') {
  4748. return 'regexp';
  4749. }
  4750. if (type === '[object Date]') {
  4751. return 'date';
  4752. }
  4753. if (type === '[object Arguments]') {
  4754. return 'arguments';
  4755. }
  4756. if (type === '[object Error]') {
  4757. return 'error';
  4758. } // buffer
  4759. if (isBuffer(val)) {
  4760. return 'buffer';
  4761. } // es6: Map, WeakMap, Set, WeakSet
  4762. if (type === '[object Set]') {
  4763. return 'set';
  4764. }
  4765. if (type === '[object WeakSet]') {
  4766. return 'weakset';
  4767. }
  4768. if (type === '[object Map]') {
  4769. return 'map';
  4770. }
  4771. if (type === '[object WeakMap]') {
  4772. return 'weakmap';
  4773. }
  4774. if (type === '[object Symbol]') {
  4775. return 'symbol';
  4776. } // typed arrays
  4777. if (type === '[object Int8Array]') {
  4778. return 'int8array';
  4779. }
  4780. if (type === '[object Uint8Array]') {
  4781. return 'uint8array';
  4782. }
  4783. if (type === '[object Uint8ClampedArray]') {
  4784. return 'uint8clampedarray';
  4785. }
  4786. if (type === '[object Int16Array]') {
  4787. return 'int16array';
  4788. }
  4789. if (type === '[object Uint16Array]') {
  4790. return 'uint16array';
  4791. }
  4792. if (type === '[object Int32Array]') {
  4793. return 'int32array';
  4794. }
  4795. if (type === '[object Uint32Array]') {
  4796. return 'uint32array';
  4797. }
  4798. if (type === '[object Float32Array]') {
  4799. return 'float32array';
  4800. }
  4801. if (type === '[object Float64Array]') {
  4802. return 'float64array';
  4803. } // must be a plain object
  4804. return 'object';
  4805. };
  4806. /***/ }),
  4807. /***/ "./node_modules/define-property/node_modules/is-descriptor/index.js":
  4808. /*!**************************************************************************!*\
  4809. !*** ./node_modules/define-property/node_modules/is-descriptor/index.js ***!
  4810. \**************************************************************************/
  4811. /*! no static exports found */
  4812. /***/ (function(module, exports, __webpack_require__) {
  4813. "use strict";
  4814. /*!
  4815. * is-descriptor <https://github.com/jonschlinkert/is-descriptor>
  4816. *
  4817. * Copyright (c) 2015-2017, Jon Schlinkert.
  4818. * Released under the MIT License.
  4819. */
  4820. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/define-property/node_modules/kind-of/index.js");
  4821. var isAccessor = __webpack_require__(/*! is-accessor-descriptor */ "./node_modules/define-property/node_modules/is-accessor-descriptor/index.js");
  4822. var isData = __webpack_require__(/*! is-data-descriptor */ "./node_modules/define-property/node_modules/is-data-descriptor/index.js");
  4823. module.exports = function isDescriptor(obj, key) {
  4824. if (typeOf(obj) !== 'object') {
  4825. return false;
  4826. }
  4827. if ('get' in obj) {
  4828. return isAccessor(obj, key);
  4829. }
  4830. return isData(obj, key);
  4831. };
  4832. /***/ }),
  4833. /***/ "./node_modules/define-property/node_modules/kind-of/index.js":
  4834. /*!********************************************************************!*\
  4835. !*** ./node_modules/define-property/node_modules/kind-of/index.js ***!
  4836. \********************************************************************/
  4837. /*! no static exports found */
  4838. /***/ (function(module, exports, __webpack_require__) {
  4839. "use strict";
  4840. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4841. var toString = Object.prototype.toString;
  4842. /**
  4843. * Get the native `typeof` a value.
  4844. *
  4845. * @param {*} `val`
  4846. * @return {*} Native javascript type
  4847. */
  4848. module.exports = function kindOf(val) {
  4849. var type = _typeof(val); // primitivies
  4850. if (type === 'undefined') {
  4851. return 'undefined';
  4852. }
  4853. if (val === null) {
  4854. return 'null';
  4855. }
  4856. if (val === true || val === false || val instanceof Boolean) {
  4857. return 'boolean';
  4858. }
  4859. if (type === 'string' || val instanceof String) {
  4860. return 'string';
  4861. }
  4862. if (type === 'number' || val instanceof Number) {
  4863. return 'number';
  4864. } // functions
  4865. if (type === 'function' || val instanceof Function) {
  4866. if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') {
  4867. return 'generatorfunction';
  4868. }
  4869. return 'function';
  4870. } // array
  4871. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  4872. return 'array';
  4873. } // check for instances of RegExp and Date before calling `toString`
  4874. if (val instanceof RegExp) {
  4875. return 'regexp';
  4876. }
  4877. if (val instanceof Date) {
  4878. return 'date';
  4879. } // other objects
  4880. type = toString.call(val);
  4881. if (type === '[object RegExp]') {
  4882. return 'regexp';
  4883. }
  4884. if (type === '[object Date]') {
  4885. return 'date';
  4886. }
  4887. if (type === '[object Arguments]') {
  4888. return 'arguments';
  4889. }
  4890. if (type === '[object Error]') {
  4891. return 'error';
  4892. }
  4893. if (type === '[object Promise]') {
  4894. return 'promise';
  4895. } // buffer
  4896. if (isBuffer(val)) {
  4897. return 'buffer';
  4898. } // es6: Map, WeakMap, Set, WeakSet
  4899. if (type === '[object Set]') {
  4900. return 'set';
  4901. }
  4902. if (type === '[object WeakSet]') {
  4903. return 'weakset';
  4904. }
  4905. if (type === '[object Map]') {
  4906. return 'map';
  4907. }
  4908. if (type === '[object WeakMap]') {
  4909. return 'weakmap';
  4910. }
  4911. if (type === '[object Symbol]') {
  4912. return 'symbol';
  4913. }
  4914. if (type === '[object Map Iterator]') {
  4915. return 'mapiterator';
  4916. }
  4917. if (type === '[object Set Iterator]') {
  4918. return 'setiterator';
  4919. }
  4920. if (type === '[object String Iterator]') {
  4921. return 'stringiterator';
  4922. }
  4923. if (type === '[object Array Iterator]') {
  4924. return 'arrayiterator';
  4925. } // typed arrays
  4926. if (type === '[object Int8Array]') {
  4927. return 'int8array';
  4928. }
  4929. if (type === '[object Uint8Array]') {
  4930. return 'uint8array';
  4931. }
  4932. if (type === '[object Uint8ClampedArray]') {
  4933. return 'uint8clampedarray';
  4934. }
  4935. if (type === '[object Int16Array]') {
  4936. return 'int16array';
  4937. }
  4938. if (type === '[object Uint16Array]') {
  4939. return 'uint16array';
  4940. }
  4941. if (type === '[object Int32Array]') {
  4942. return 'int32array';
  4943. }
  4944. if (type === '[object Uint32Array]') {
  4945. return 'uint32array';
  4946. }
  4947. if (type === '[object Float32Array]') {
  4948. return 'float32array';
  4949. }
  4950. if (type === '[object Float64Array]') {
  4951. return 'float64array';
  4952. } // must be a plain object
  4953. return 'object';
  4954. };
  4955. /**
  4956. * If you need to support Safari 5-7 (8-10 yr-old browser),
  4957. * take a look at https://github.com/feross/is-buffer
  4958. */
  4959. function isBuffer(val) {
  4960. return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  4961. }
  4962. /***/ }),
  4963. /***/ "./node_modules/esutils/lib/ast.js":
  4964. /*!*****************************************!*\
  4965. !*** ./node_modules/esutils/lib/ast.js ***!
  4966. \*****************************************/
  4967. /*! no static exports found */
  4968. /***/ (function(module, exports, __webpack_require__) {
  4969. "use strict";
  4970. /*
  4971. Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
  4972. Redistribution and use in source and binary forms, with or without
  4973. modification, are permitted provided that the following conditions are met:
  4974. * Redistributions of source code must retain the above copyright
  4975. notice, this list of conditions and the following disclaimer.
  4976. * Redistributions in binary form must reproduce the above copyright
  4977. notice, this list of conditions and the following disclaimer in the
  4978. documentation and/or other materials provided with the distribution.
  4979. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
  4980. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  4981. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  4982. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  4983. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  4984. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  4985. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  4986. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  4987. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  4988. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  4989. */
  4990. (function () {
  4991. 'use strict';
  4992. function isExpression(node) {
  4993. if (node == null) {
  4994. return false;
  4995. }
  4996. switch (node.type) {
  4997. case 'ArrayExpression':
  4998. case 'AssignmentExpression':
  4999. case 'BinaryExpression':
  5000. case 'CallExpression':
  5001. case 'ConditionalExpression':
  5002. case 'FunctionExpression':
  5003. case 'Identifier':
  5004. case 'Literal':
  5005. case 'LogicalExpression':
  5006. case 'MemberExpression':
  5007. case 'NewExpression':
  5008. case 'ObjectExpression':
  5009. case 'SequenceExpression':
  5010. case 'ThisExpression':
  5011. case 'UnaryExpression':
  5012. case 'UpdateExpression':
  5013. return true;
  5014. }
  5015. return false;
  5016. }
  5017. function isIterationStatement(node) {
  5018. if (node == null) {
  5019. return false;
  5020. }
  5021. switch (node.type) {
  5022. case 'DoWhileStatement':
  5023. case 'ForInStatement':
  5024. case 'ForStatement':
  5025. case 'WhileStatement':
  5026. return true;
  5027. }
  5028. return false;
  5029. }
  5030. function isStatement(node) {
  5031. if (node == null) {
  5032. return false;
  5033. }
  5034. switch (node.type) {
  5035. case 'BlockStatement':
  5036. case 'BreakStatement':
  5037. case 'ContinueStatement':
  5038. case 'DebuggerStatement':
  5039. case 'DoWhileStatement':
  5040. case 'EmptyStatement':
  5041. case 'ExpressionStatement':
  5042. case 'ForInStatement':
  5043. case 'ForStatement':
  5044. case 'IfStatement':
  5045. case 'LabeledStatement':
  5046. case 'ReturnStatement':
  5047. case 'SwitchStatement':
  5048. case 'ThrowStatement':
  5049. case 'TryStatement':
  5050. case 'VariableDeclaration':
  5051. case 'WhileStatement':
  5052. case 'WithStatement':
  5053. return true;
  5054. }
  5055. return false;
  5056. }
  5057. function isSourceElement(node) {
  5058. return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
  5059. }
  5060. function trailingStatement(node) {
  5061. switch (node.type) {
  5062. case 'IfStatement':
  5063. if (node.alternate != null) {
  5064. return node.alternate;
  5065. }
  5066. return node.consequent;
  5067. case 'LabeledStatement':
  5068. case 'ForStatement':
  5069. case 'ForInStatement':
  5070. case 'WhileStatement':
  5071. case 'WithStatement':
  5072. return node.body;
  5073. }
  5074. return null;
  5075. }
  5076. function isProblematicIfStatement(node) {
  5077. var current;
  5078. if (node.type !== 'IfStatement') {
  5079. return false;
  5080. }
  5081. if (node.alternate == null) {
  5082. return false;
  5083. }
  5084. current = node.consequent;
  5085. do {
  5086. if (current.type === 'IfStatement') {
  5087. if (current.alternate == null) {
  5088. return true;
  5089. }
  5090. }
  5091. current = trailingStatement(current);
  5092. } while (current);
  5093. return false;
  5094. }
  5095. module.exports = {
  5096. isExpression: isExpression,
  5097. isStatement: isStatement,
  5098. isIterationStatement: isIterationStatement,
  5099. isSourceElement: isSourceElement,
  5100. isProblematicIfStatement: isProblematicIfStatement,
  5101. trailingStatement: trailingStatement
  5102. };
  5103. })();
  5104. /* vim: set sw=4 ts=4 et tw=80 : */
  5105. /***/ }),
  5106. /***/ "./node_modules/esutils/lib/code.js":
  5107. /*!******************************************!*\
  5108. !*** ./node_modules/esutils/lib/code.js ***!
  5109. \******************************************/
  5110. /*! no static exports found */
  5111. /***/ (function(module, exports, __webpack_require__) {
  5112. "use strict";
  5113. /*
  5114. Copyright (C) 2013-2014 Yusuke Suzuki <utatane.tea@gmail.com>
  5115. Copyright (C) 2014 Ivan Nikulin <ifaaan@gmail.com>
  5116. Redistribution and use in source and binary forms, with or without
  5117. modification, are permitted provided that the following conditions are met:
  5118. * Redistributions of source code must retain the above copyright
  5119. notice, this list of conditions and the following disclaimer.
  5120. * Redistributions in binary form must reproduce the above copyright
  5121. notice, this list of conditions and the following disclaimer in the
  5122. documentation and/or other materials provided with the distribution.
  5123. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  5124. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  5125. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  5126. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  5127. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  5128. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  5129. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  5130. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  5131. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  5132. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5133. */
  5134. (function () {
  5135. 'use strict';
  5136. var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; // See `tools/generate-identifier-regex.js`.
  5137. ES5Regex = {
  5138. // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart:
  5139. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
  5140. // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart:
  5141. NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
  5142. };
  5143. ES6Regex = {
  5144. // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart:
  5145. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,
  5146. // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart:
  5147. NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
  5148. };
  5149. function isDecimalDigit(ch) {
  5150. return 0x30 <= ch && ch <= 0x39; // 0..9
  5151. }
  5152. function isHexDigit(ch) {
  5153. return 0x30 <= ch && ch <= 0x39 || // 0..9
  5154. 0x61 <= ch && ch <= 0x66 || // a..f
  5155. 0x41 <= ch && ch <= 0x46; // A..F
  5156. }
  5157. function isOctalDigit(ch) {
  5158. return ch >= 0x30 && ch <= 0x37; // 0..7
  5159. } // 7.2 White Space
  5160. NON_ASCII_WHITESPACES = [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF];
  5161. function isWhiteSpace(ch) {
  5162. return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
  5163. } // 7.3 Line Terminators
  5164. function isLineTerminator(ch) {
  5165. return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
  5166. } // 7.6 Identifier Names and Identifiers
  5167. function fromCodePoint(cp) {
  5168. if (cp <= 0xFFFF) {
  5169. return String.fromCharCode(cp);
  5170. }
  5171. var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
  5172. var cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00);
  5173. return cu1 + cu2;
  5174. }
  5175. IDENTIFIER_START = new Array(0x80);
  5176. for (ch = 0; ch < 0x80; ++ch) {
  5177. IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || // a..z
  5178. ch >= 0x41 && ch <= 0x5A || // A..Z
  5179. ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
  5180. }
  5181. IDENTIFIER_PART = new Array(0x80);
  5182. for (ch = 0; ch < 0x80; ++ch) {
  5183. IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || // a..z
  5184. ch >= 0x41 && ch <= 0x5A || // A..Z
  5185. ch >= 0x30 && ch <= 0x39 || // 0..9
  5186. ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
  5187. }
  5188. function isIdentifierStartES5(ch) {
  5189. return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
  5190. }
  5191. function isIdentifierPartES5(ch) {
  5192. return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
  5193. }
  5194. function isIdentifierStartES6(ch) {
  5195. return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
  5196. }
  5197. function isIdentifierPartES6(ch) {
  5198. return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
  5199. }
  5200. module.exports = {
  5201. isDecimalDigit: isDecimalDigit,
  5202. isHexDigit: isHexDigit,
  5203. isOctalDigit: isOctalDigit,
  5204. isWhiteSpace: isWhiteSpace,
  5205. isLineTerminator: isLineTerminator,
  5206. isIdentifierStartES5: isIdentifierStartES5,
  5207. isIdentifierPartES5: isIdentifierPartES5,
  5208. isIdentifierStartES6: isIdentifierStartES6,
  5209. isIdentifierPartES6: isIdentifierPartES6
  5210. };
  5211. })();
  5212. /* vim: set sw=4 ts=4 et tw=80 : */
  5213. /***/ }),
  5214. /***/ "./node_modules/esutils/lib/keyword.js":
  5215. /*!*********************************************!*\
  5216. !*** ./node_modules/esutils/lib/keyword.js ***!
  5217. \*********************************************/
  5218. /*! no static exports found */
  5219. /***/ (function(module, exports, __webpack_require__) {
  5220. "use strict";
  5221. /*
  5222. Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
  5223. Redistribution and use in source and binary forms, with or without
  5224. modification, are permitted provided that the following conditions are met:
  5225. * Redistributions of source code must retain the above copyright
  5226. notice, this list of conditions and the following disclaimer.
  5227. * Redistributions in binary form must reproduce the above copyright
  5228. notice, this list of conditions and the following disclaimer in the
  5229. documentation and/or other materials provided with the distribution.
  5230. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  5231. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  5232. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  5233. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  5234. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  5235. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  5236. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  5237. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  5238. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  5239. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5240. */
  5241. (function () {
  5242. 'use strict';
  5243. var code = __webpack_require__(/*! ./code */ "./node_modules/esutils/lib/code.js");
  5244. function isStrictModeReservedWordES6(id) {
  5245. switch (id) {
  5246. case 'implements':
  5247. case 'interface':
  5248. case 'package':
  5249. case 'private':
  5250. case 'protected':
  5251. case 'public':
  5252. case 'static':
  5253. case 'let':
  5254. return true;
  5255. default:
  5256. return false;
  5257. }
  5258. }
  5259. function isKeywordES5(id, strict) {
  5260. // yield should not be treated as keyword under non-strict mode.
  5261. if (!strict && id === 'yield') {
  5262. return false;
  5263. }
  5264. return isKeywordES6(id, strict);
  5265. }
  5266. function isKeywordES6(id, strict) {
  5267. if (strict && isStrictModeReservedWordES6(id)) {
  5268. return true;
  5269. }
  5270. switch (id.length) {
  5271. case 2:
  5272. return id === 'if' || id === 'in' || id === 'do';
  5273. case 3:
  5274. return id === 'var' || id === 'for' || id === 'new' || id === 'try';
  5275. case 4:
  5276. return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';
  5277. case 5:
  5278. return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super';
  5279. case 6:
  5280. return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';
  5281. case 7:
  5282. return id === 'default' || id === 'finally' || id === 'extends';
  5283. case 8:
  5284. return id === 'function' || id === 'continue' || id === 'debugger';
  5285. case 10:
  5286. return id === 'instanceof';
  5287. default:
  5288. return false;
  5289. }
  5290. }
  5291. function isReservedWordES5(id, strict) {
  5292. return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
  5293. }
  5294. function isReservedWordES6(id, strict) {
  5295. return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
  5296. }
  5297. function isRestrictedWord(id) {
  5298. return id === 'eval' || id === 'arguments';
  5299. }
  5300. function isIdentifierNameES5(id) {
  5301. var i, iz, ch;
  5302. if (id.length === 0) {
  5303. return false;
  5304. }
  5305. ch = id.charCodeAt(0);
  5306. if (!code.isIdentifierStartES5(ch)) {
  5307. return false;
  5308. }
  5309. for (i = 1, iz = id.length; i < iz; ++i) {
  5310. ch = id.charCodeAt(i);
  5311. if (!code.isIdentifierPartES5(ch)) {
  5312. return false;
  5313. }
  5314. }
  5315. return true;
  5316. }
  5317. function decodeUtf16(lead, trail) {
  5318. return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
  5319. }
  5320. function isIdentifierNameES6(id) {
  5321. var i, iz, ch, lowCh, check;
  5322. if (id.length === 0) {
  5323. return false;
  5324. }
  5325. check = code.isIdentifierStartES6;
  5326. for (i = 0, iz = id.length; i < iz; ++i) {
  5327. ch = id.charCodeAt(i);
  5328. if (0xD800 <= ch && ch <= 0xDBFF) {
  5329. ++i;
  5330. if (i >= iz) {
  5331. return false;
  5332. }
  5333. lowCh = id.charCodeAt(i);
  5334. if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
  5335. return false;
  5336. }
  5337. ch = decodeUtf16(ch, lowCh);
  5338. }
  5339. if (!check(ch)) {
  5340. return false;
  5341. }
  5342. check = code.isIdentifierPartES6;
  5343. }
  5344. return true;
  5345. }
  5346. function isIdentifierES5(id, strict) {
  5347. return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
  5348. }
  5349. function isIdentifierES6(id, strict) {
  5350. return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
  5351. }
  5352. module.exports = {
  5353. isKeywordES5: isKeywordES5,
  5354. isKeywordES6: isKeywordES6,
  5355. isReservedWordES5: isReservedWordES5,
  5356. isReservedWordES6: isReservedWordES6,
  5357. isRestrictedWord: isRestrictedWord,
  5358. isIdentifierNameES5: isIdentifierNameES5,
  5359. isIdentifierNameES6: isIdentifierNameES6,
  5360. isIdentifierES5: isIdentifierES5,
  5361. isIdentifierES6: isIdentifierES6
  5362. };
  5363. })();
  5364. /* vim: set sw=4 ts=4 et tw=80 : */
  5365. /***/ }),
  5366. /***/ "./node_modules/esutils/lib/utils.js":
  5367. /*!*******************************************!*\
  5368. !*** ./node_modules/esutils/lib/utils.js ***!
  5369. \*******************************************/
  5370. /*! no static exports found */
  5371. /***/ (function(module, exports, __webpack_require__) {
  5372. "use strict";
  5373. /*
  5374. Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
  5375. Redistribution and use in source and binary forms, with or without
  5376. modification, are permitted provided that the following conditions are met:
  5377. * Redistributions of source code must retain the above copyright
  5378. notice, this list of conditions and the following disclaimer.
  5379. * Redistributions in binary form must reproduce the above copyright
  5380. notice, this list of conditions and the following disclaimer in the
  5381. documentation and/or other materials provided with the distribution.
  5382. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  5383. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  5384. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  5385. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  5386. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  5387. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  5388. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  5389. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  5390. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  5391. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5392. */
  5393. (function () {
  5394. 'use strict';
  5395. exports.ast = __webpack_require__(/*! ./ast */ "./node_modules/esutils/lib/ast.js");
  5396. exports.code = __webpack_require__(/*! ./code */ "./node_modules/esutils/lib/code.js");
  5397. exports.keyword = __webpack_require__(/*! ./keyword */ "./node_modules/esutils/lib/keyword.js");
  5398. })();
  5399. /* vim: set sw=4 ts=4 et tw=80 : */
  5400. /***/ }),
  5401. /***/ "./node_modules/expand-brackets/index.js":
  5402. /*!***********************************************!*\
  5403. !*** ./node_modules/expand-brackets/index.js ***!
  5404. \***********************************************/
  5405. /*! no static exports found */
  5406. /***/ (function(module, exports, __webpack_require__) {
  5407. "use strict";
  5408. /* WEBPACK VAR INJECTION */(function(__filename) {
  5409. /**
  5410. * Local dependencies
  5411. */
  5412. var compilers = __webpack_require__(/*! ./lib/compilers */ "./node_modules/expand-brackets/lib/compilers.js");
  5413. var parsers = __webpack_require__(/*! ./lib/parsers */ "./node_modules/expand-brackets/lib/parsers.js");
  5414. /**
  5415. * Module dependencies
  5416. */
  5417. var debug = __webpack_require__(/*! debug */ "./node_modules/expand-brackets/node_modules/debug/src/browser.js")('expand-brackets');
  5418. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  5419. var Snapdragon = __webpack_require__(/*! snapdragon */ "./node_modules/snapdragon/index.js");
  5420. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  5421. /**
  5422. * Parses the given POSIX character class `pattern` and returns a
  5423. * string that can be used for creating regular expressions for matching.
  5424. *
  5425. * @param {String} `pattern`
  5426. * @param {Object} `options`
  5427. * @return {Object}
  5428. * @api public
  5429. */
  5430. function brackets(pattern, options) {
  5431. debug('initializing from <%s>', __filename);
  5432. var res = brackets.create(pattern, options);
  5433. return res.output;
  5434. }
  5435. /**
  5436. * Takes an array of strings and a POSIX character class pattern, and returns a new
  5437. * array with only the strings that matched the pattern.
  5438. *
  5439. * ```js
  5440. * var brackets = require('expand-brackets');
  5441. * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]'));
  5442. * //=> ['a']
  5443. *
  5444. * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+'));
  5445. * //=> ['a', 'ab']
  5446. * ```
  5447. * @param {Array} `arr` Array of strings to match
  5448. * @param {String} `pattern` POSIX character class pattern(s)
  5449. * @param {Object} `options`
  5450. * @return {Array}
  5451. * @api public
  5452. */
  5453. brackets.match = function (arr, pattern, options) {
  5454. arr = [].concat(arr);
  5455. var opts = extend({}, options);
  5456. var isMatch = brackets.matcher(pattern, opts);
  5457. var len = arr.length;
  5458. var idx = -1;
  5459. var res = [];
  5460. while (++idx < len) {
  5461. var ele = arr[idx];
  5462. if (isMatch(ele)) {
  5463. res.push(ele);
  5464. }
  5465. }
  5466. if (res.length === 0) {
  5467. if (opts.failglob === true) {
  5468. throw new Error('no matches found for "' + pattern + '"');
  5469. }
  5470. if (opts.nonull === true || opts.nullglob === true) {
  5471. return [pattern.split('\\').join('')];
  5472. }
  5473. }
  5474. return res;
  5475. };
  5476. /**
  5477. * Returns true if the specified `string` matches the given
  5478. * brackets `pattern`.
  5479. *
  5480. * ```js
  5481. * var brackets = require('expand-brackets');
  5482. *
  5483. * console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]'));
  5484. * //=> true
  5485. * console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]'));
  5486. * //=> false
  5487. * ```
  5488. * @param {String} `string` String to match
  5489. * @param {String} `pattern` Poxis pattern
  5490. * @param {String} `options`
  5491. * @return {Boolean}
  5492. * @api public
  5493. */
  5494. brackets.isMatch = function (str, pattern, options) {
  5495. return brackets.matcher(pattern, options)(str);
  5496. };
  5497. /**
  5498. * Takes a POSIX character class pattern and returns a matcher function. The returned
  5499. * function takes the string to match as its only argument.
  5500. *
  5501. * ```js
  5502. * var brackets = require('expand-brackets');
  5503. * var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]');
  5504. *
  5505. * console.log(isMatch('a.a'));
  5506. * //=> false
  5507. * console.log(isMatch('a.A'));
  5508. * //=> true
  5509. * ```
  5510. * @param {String} `pattern` Poxis pattern
  5511. * @param {String} `options`
  5512. * @return {Boolean}
  5513. * @api public
  5514. */
  5515. brackets.matcher = function (pattern, options) {
  5516. var re = brackets.makeRe(pattern, options);
  5517. return function (str) {
  5518. return re.test(str);
  5519. };
  5520. };
  5521. /**
  5522. * Create a regular expression from the given `pattern`.
  5523. *
  5524. * ```js
  5525. * var brackets = require('expand-brackets');
  5526. * var re = brackets.makeRe('[[:alpha:]]');
  5527. * console.log(re);
  5528. * //=> /^(?:[a-zA-Z])$/
  5529. * ```
  5530. * @param {String} `pattern` The pattern to convert to regex.
  5531. * @param {Object} `options`
  5532. * @return {RegExp}
  5533. * @api public
  5534. */
  5535. brackets.makeRe = function (pattern, options) {
  5536. var res = brackets.create(pattern, options);
  5537. var opts = extend({
  5538. strictErrors: false
  5539. }, options);
  5540. return toRegex(res.output, opts);
  5541. };
  5542. /**
  5543. * Parses the given POSIX character class `pattern` and returns an object
  5544. * with the compiled `output` and optional source `map`.
  5545. *
  5546. * ```js
  5547. * var brackets = require('expand-brackets');
  5548. * console.log(brackets('[[:alpha:]]'));
  5549. * // { options: { source: 'string' },
  5550. * // input: '[[:alpha:]]',
  5551. * // state: {},
  5552. * // compilers:
  5553. * // { eos: [Function],
  5554. * // noop: [Function],
  5555. * // bos: [Function],
  5556. * // not: [Function],
  5557. * // escape: [Function],
  5558. * // text: [Function],
  5559. * // posix: [Function],
  5560. * // bracket: [Function],
  5561. * // 'bracket.open': [Function],
  5562. * // 'bracket.inner': [Function],
  5563. * // 'bracket.literal': [Function],
  5564. * // 'bracket.close': [Function] },
  5565. * // output: '[a-zA-Z]',
  5566. * // ast:
  5567. * // { type: 'root',
  5568. * // errors: [],
  5569. * // nodes: [ [Object], [Object], [Object] ] },
  5570. * // parsingErrors: [] }
  5571. * ```
  5572. * @param {String} `pattern`
  5573. * @param {Object} `options`
  5574. * @return {Object}
  5575. * @api public
  5576. */
  5577. brackets.create = function (pattern, options) {
  5578. var snapdragon = options && options.snapdragon || new Snapdragon(options);
  5579. compilers(snapdragon);
  5580. parsers(snapdragon);
  5581. var ast = snapdragon.parse(pattern, options);
  5582. ast.input = pattern;
  5583. var res = snapdragon.compile(ast, options);
  5584. res.input = pattern;
  5585. return res;
  5586. };
  5587. /**
  5588. * Expose `brackets` constructor, parsers and compilers
  5589. */
  5590. brackets.compilers = compilers;
  5591. brackets.parsers = parsers;
  5592. /**
  5593. * Expose `brackets`
  5594. * @type {Function}
  5595. */
  5596. module.exports = brackets;
  5597. /* WEBPACK VAR INJECTION */}.call(this, "/index.js"))
  5598. /***/ }),
  5599. /***/ "./node_modules/expand-brackets/lib/compilers.js":
  5600. /*!*******************************************************!*\
  5601. !*** ./node_modules/expand-brackets/lib/compilers.js ***!
  5602. \*******************************************************/
  5603. /*! no static exports found */
  5604. /***/ (function(module, exports, __webpack_require__) {
  5605. "use strict";
  5606. var posix = __webpack_require__(/*! posix-character-classes */ "./node_modules/posix-character-classes/index.js");
  5607. module.exports = function (brackets) {
  5608. brackets.compiler
  5609. /**
  5610. * Escaped characters
  5611. */
  5612. .set('escape', function (node) {
  5613. return this.emit('\\' + node.val.replace(/^\\/, ''), node);
  5614. })
  5615. /**
  5616. * Text
  5617. */
  5618. .set('text', function (node) {
  5619. return this.emit(node.val.replace(/([{}])/g, '\\$1'), node);
  5620. })
  5621. /**
  5622. * POSIX character classes
  5623. */
  5624. .set('posix', function (node) {
  5625. if (node.val === '[::]') {
  5626. return this.emit('\\[::\\]', node);
  5627. }
  5628. var val = posix[node.inner];
  5629. if (typeof val === 'undefined') {
  5630. val = '[' + node.inner + ']';
  5631. }
  5632. return this.emit(val, node);
  5633. })
  5634. /**
  5635. * Non-posix brackets
  5636. */
  5637. .set('bracket', function (node) {
  5638. return this.mapVisit(node.nodes);
  5639. }).set('bracket.open', function (node) {
  5640. return this.emit(node.val, node);
  5641. }).set('bracket.inner', function (node) {
  5642. var inner = node.val;
  5643. if (inner === '[' || inner === ']') {
  5644. return this.emit('\\' + node.val, node);
  5645. }
  5646. if (inner === '^]') {
  5647. return this.emit('^\\]', node);
  5648. }
  5649. if (inner === '^') {
  5650. return this.emit('^', node);
  5651. }
  5652. if (/-/.test(inner) && !/(\d-\d|\w-\w)/.test(inner)) {
  5653. inner = inner.split('-').join('\\-');
  5654. }
  5655. var isNegated = inner.charAt(0) === '^'; // add slashes to negated brackets, per spec
  5656. if (isNegated && inner.indexOf('/') === -1) {
  5657. inner += '/';
  5658. }
  5659. if (isNegated && inner.indexOf('.') === -1) {
  5660. inner += '.';
  5661. } // don't unescape `0` (octal literal)
  5662. inner = inner.replace(/\\([1-9])/g, '$1');
  5663. return this.emit(inner, node);
  5664. }).set('bracket.close', function (node) {
  5665. var val = node.val.replace(/^\\/, '');
  5666. if (node.parent.escaped === true) {
  5667. return this.emit('\\' + val, node);
  5668. }
  5669. return this.emit(val, node);
  5670. });
  5671. };
  5672. /***/ }),
  5673. /***/ "./node_modules/expand-brackets/lib/parsers.js":
  5674. /*!*****************************************************!*\
  5675. !*** ./node_modules/expand-brackets/lib/parsers.js ***!
  5676. \*****************************************************/
  5677. /*! no static exports found */
  5678. /***/ (function(module, exports, __webpack_require__) {
  5679. "use strict";
  5680. var utils = __webpack_require__(/*! ./utils */ "./node_modules/expand-brackets/lib/utils.js");
  5681. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  5682. /**
  5683. * Text regex
  5684. */
  5685. var TEXT_REGEX = '(\\[(?=.*\\])|\\])+';
  5686. var not = utils.createRegex(TEXT_REGEX);
  5687. /**
  5688. * Brackets parsers
  5689. */
  5690. function parsers(brackets) {
  5691. brackets.state = brackets.state || {};
  5692. brackets.parser.sets.bracket = brackets.parser.sets.bracket || [];
  5693. brackets.parser.capture('escape', function () {
  5694. if (this.isInside('bracket')) return;
  5695. var pos = this.position();
  5696. var m = this.match(/^\\(.)/);
  5697. if (!m) return;
  5698. return pos({
  5699. type: 'escape',
  5700. val: m[0]
  5701. });
  5702. })
  5703. /**
  5704. * Text parser
  5705. */
  5706. .capture('text', function () {
  5707. if (this.isInside('bracket')) return;
  5708. var pos = this.position();
  5709. var m = this.match(not);
  5710. if (!m || !m[0]) return;
  5711. return pos({
  5712. type: 'text',
  5713. val: m[0]
  5714. });
  5715. })
  5716. /**
  5717. * POSIX character classes: "[[:alpha:][:digits:]]"
  5718. */
  5719. .capture('posix', function () {
  5720. var pos = this.position();
  5721. var m = this.match(/^\[:(.*?):\](?=.*\])/);
  5722. if (!m) return;
  5723. var inside = this.isInside('bracket');
  5724. if (inside) {
  5725. brackets.posix++;
  5726. }
  5727. return pos({
  5728. type: 'posix',
  5729. insideBracket: inside,
  5730. inner: m[1],
  5731. val: m[0]
  5732. });
  5733. })
  5734. /**
  5735. * Bracket (noop)
  5736. */
  5737. .capture('bracket', function () {})
  5738. /**
  5739. * Open: '['
  5740. */
  5741. .capture('bracket.open', function () {
  5742. var parsed = this.parsed;
  5743. var pos = this.position();
  5744. var m = this.match(/^\[(?=.*\])/);
  5745. if (!m) return;
  5746. var prev = this.prev();
  5747. var last = utils.last(prev.nodes);
  5748. if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) {
  5749. last.val = last.val.slice(0, last.val.length - 1);
  5750. return pos({
  5751. type: 'escape',
  5752. val: m[0]
  5753. });
  5754. }
  5755. var open = pos({
  5756. type: 'bracket.open',
  5757. val: m[0]
  5758. });
  5759. if (last.type === 'bracket.open' || this.isInside('bracket')) {
  5760. open.val = '\\' + open.val;
  5761. open.type = 'bracket.inner';
  5762. open.escaped = true;
  5763. return open;
  5764. }
  5765. var node = pos({
  5766. type: 'bracket',
  5767. nodes: [open]
  5768. });
  5769. define(node, 'parent', prev);
  5770. define(open, 'parent', node);
  5771. this.push('bracket', node);
  5772. prev.nodes.push(node);
  5773. })
  5774. /**
  5775. * Bracket text
  5776. */
  5777. .capture('bracket.inner', function () {
  5778. if (!this.isInside('bracket')) return;
  5779. var pos = this.position();
  5780. var m = this.match(not);
  5781. if (!m || !m[0]) return;
  5782. var next = this.input.charAt(0);
  5783. var val = m[0];
  5784. var node = pos({
  5785. type: 'bracket.inner',
  5786. val: val
  5787. });
  5788. if (val === '\\\\') {
  5789. return node;
  5790. }
  5791. var first = val.charAt(0);
  5792. var last = val.slice(-1);
  5793. if (first === '!') {
  5794. val = '^' + val.slice(1);
  5795. }
  5796. if (last === '\\' || val === '^' && next === ']') {
  5797. val += this.input[0];
  5798. this.consume(1);
  5799. }
  5800. node.val = val;
  5801. return node;
  5802. })
  5803. /**
  5804. * Close: ']'
  5805. */
  5806. .capture('bracket.close', function () {
  5807. var parsed = this.parsed;
  5808. var pos = this.position();
  5809. var m = this.match(/^\]/);
  5810. if (!m) return;
  5811. var prev = this.prev();
  5812. var last = utils.last(prev.nodes);
  5813. if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) {
  5814. last.val = last.val.slice(0, last.val.length - 1);
  5815. return pos({
  5816. type: 'escape',
  5817. val: m[0]
  5818. });
  5819. }
  5820. var node = pos({
  5821. type: 'bracket.close',
  5822. rest: this.input,
  5823. val: m[0]
  5824. });
  5825. if (last.type === 'bracket.open') {
  5826. node.type = 'bracket.inner';
  5827. node.escaped = true;
  5828. return node;
  5829. }
  5830. var bracket = this.pop('bracket');
  5831. if (!this.isType(bracket, 'bracket')) {
  5832. if (this.options.strict) {
  5833. throw new Error('missing opening "["');
  5834. }
  5835. node.type = 'bracket.inner';
  5836. node.escaped = true;
  5837. return node;
  5838. }
  5839. bracket.nodes.push(node);
  5840. define(node, 'parent', bracket);
  5841. });
  5842. }
  5843. /**
  5844. * Brackets parsers
  5845. */
  5846. module.exports = parsers;
  5847. /**
  5848. * Expose text regex
  5849. */
  5850. module.exports.TEXT_REGEX = TEXT_REGEX;
  5851. /***/ }),
  5852. /***/ "./node_modules/expand-brackets/lib/utils.js":
  5853. /*!***************************************************!*\
  5854. !*** ./node_modules/expand-brackets/lib/utils.js ***!
  5855. \***************************************************/
  5856. /*! no static exports found */
  5857. /***/ (function(module, exports, __webpack_require__) {
  5858. "use strict";
  5859. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  5860. var regexNot = __webpack_require__(/*! regex-not */ "./node_modules/regex-not/index.js");
  5861. var cached;
  5862. /**
  5863. * Get the last element from `array`
  5864. * @param {Array} `array`
  5865. * @return {*}
  5866. */
  5867. exports.last = function (arr) {
  5868. return arr[arr.length - 1];
  5869. };
  5870. /**
  5871. * Create and cache regex to use for text nodes
  5872. */
  5873. exports.createRegex = function (pattern, include) {
  5874. if (cached) return cached;
  5875. var opts = {
  5876. contains: true,
  5877. strictClose: false
  5878. };
  5879. var not = regexNot.create(pattern, opts);
  5880. var re;
  5881. if (typeof include === 'string') {
  5882. re = toRegex('^(?:' + include + '|' + not + ')', opts);
  5883. } else {
  5884. re = toRegex(not, opts);
  5885. }
  5886. return cached = re;
  5887. };
  5888. /***/ }),
  5889. /***/ "./node_modules/expand-brackets/node_modules/debug/src/browser.js":
  5890. /*!************************************************************************!*\
  5891. !*** ./node_modules/expand-brackets/node_modules/debug/src/browser.js ***!
  5892. \************************************************************************/
  5893. /*! no static exports found */
  5894. /***/ (function(module, exports, __webpack_require__) {
  5895. "use strict";
  5896. /* WEBPACK VAR INJECTION */(function(process) {
  5897. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5898. /**
  5899. * This is the web browser implementation of `debug()`.
  5900. *
  5901. * Expose `debug()` as the module.
  5902. */
  5903. exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/expand-brackets/node_modules/debug/src/debug.js");
  5904. exports.log = log;
  5905. exports.formatArgs = formatArgs;
  5906. exports.save = save;
  5907. exports.load = load;
  5908. exports.useColors = useColors;
  5909. exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
  5910. /**
  5911. * Colors.
  5912. */
  5913. exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson'];
  5914. /**
  5915. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  5916. * and the Firebug extension (any Firefox version) are known
  5917. * to support "%c" CSS customizations.
  5918. *
  5919. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  5920. */
  5921. function useColors() {
  5922. // NB: In an Electron preload script, document will be defined but not fully
  5923. // initialized. Since we know we're in Chrome, we'll just detect this case
  5924. // explicitly
  5925. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  5926. return true;
  5927. } // is webkit? http://stackoverflow.com/a/16459606/376773
  5928. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  5929. return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
  5930. typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
  5931. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  5932. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
  5933. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  5934. }
  5935. /**
  5936. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  5937. */
  5938. exports.formatters.j = function (v) {
  5939. try {
  5940. return JSON.stringify(v);
  5941. } catch (err) {
  5942. return '[UnexpectedJSONParseError]: ' + err.message;
  5943. }
  5944. };
  5945. /**
  5946. * Colorize log arguments if enabled.
  5947. *
  5948. * @api public
  5949. */
  5950. function formatArgs(args) {
  5951. var useColors = this.useColors;
  5952. args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
  5953. if (!useColors) return;
  5954. var c = 'color: ' + this.color;
  5955. args.splice(1, 0, c, 'color: inherit'); // the final "%c" is somewhat tricky, because there could be other
  5956. // arguments passed either before or after the %c, so we need to
  5957. // figure out the correct index to insert the CSS into
  5958. var index = 0;
  5959. var lastC = 0;
  5960. args[0].replace(/%[a-zA-Z%]/g, function (match) {
  5961. if ('%%' === match) return;
  5962. index++;
  5963. if ('%c' === match) {
  5964. // we only are interested in the *last* %c
  5965. // (the user may have provided their own)
  5966. lastC = index;
  5967. }
  5968. });
  5969. args.splice(lastC, 0, c);
  5970. }
  5971. /**
  5972. * Invokes `console.log()` when available.
  5973. * No-op when `console.log` is not a "function".
  5974. *
  5975. * @api public
  5976. */
  5977. function log() {
  5978. // this hackery is required for IE8/9, where
  5979. // the `console.log` function doesn't have 'apply'
  5980. return 'object' === (typeof console === "undefined" ? "undefined" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);
  5981. }
  5982. /**
  5983. * Save `namespaces`.
  5984. *
  5985. * @param {String} namespaces
  5986. * @api private
  5987. */
  5988. function save(namespaces) {
  5989. try {
  5990. if (null == namespaces) {
  5991. exports.storage.removeItem('debug');
  5992. } else {
  5993. exports.storage.debug = namespaces;
  5994. }
  5995. } catch (e) {}
  5996. }
  5997. /**
  5998. * Load `namespaces`.
  5999. *
  6000. * @return {String} returns the previously persisted debug modes
  6001. * @api private
  6002. */
  6003. function load() {
  6004. var r;
  6005. try {
  6006. r = exports.storage.debug;
  6007. } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  6008. if (!r && typeof process !== 'undefined' && 'env' in process) {
  6009. r = process.env.DEBUG;
  6010. }
  6011. return r;
  6012. }
  6013. /**
  6014. * Enable namespaces listed in `localStorage.debug` initially.
  6015. */
  6016. exports.enable(load());
  6017. /**
  6018. * Localstorage attempts to return the localstorage.
  6019. *
  6020. * This is necessary because safari throws
  6021. * when a user disables cookies/localstorage
  6022. * and you attempt to access it.
  6023. *
  6024. * @return {LocalStorage}
  6025. * @api private
  6026. */
  6027. function localstorage() {
  6028. try {
  6029. return window.localStorage;
  6030. } catch (e) {}
  6031. }
  6032. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  6033. /***/ }),
  6034. /***/ "./node_modules/expand-brackets/node_modules/debug/src/debug.js":
  6035. /*!**********************************************************************!*\
  6036. !*** ./node_modules/expand-brackets/node_modules/debug/src/debug.js ***!
  6037. \**********************************************************************/
  6038. /*! no static exports found */
  6039. /***/ (function(module, exports, __webpack_require__) {
  6040. "use strict";
  6041. /**
  6042. * This is the common logic for both the Node.js and web browser
  6043. * implementations of `debug()`.
  6044. *
  6045. * Expose `debug()` as the module.
  6046. */
  6047. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  6048. exports.coerce = coerce;
  6049. exports.disable = disable;
  6050. exports.enable = enable;
  6051. exports.enabled = enabled;
  6052. exports.humanize = __webpack_require__(/*! ms */ "./node_modules/expand-brackets/node_modules/ms/index.js");
  6053. /**
  6054. * The currently active debug mode names, and names to skip.
  6055. */
  6056. exports.names = [];
  6057. exports.skips = [];
  6058. /**
  6059. * Map of special "%n" handling functions, for the debug "format" argument.
  6060. *
  6061. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  6062. */
  6063. exports.formatters = {};
  6064. /**
  6065. * Previous log timestamp.
  6066. */
  6067. var prevTime;
  6068. /**
  6069. * Select a color.
  6070. * @param {String} namespace
  6071. * @return {Number}
  6072. * @api private
  6073. */
  6074. function selectColor(namespace) {
  6075. var hash = 0,
  6076. i;
  6077. for (i in namespace) {
  6078. hash = (hash << 5) - hash + namespace.charCodeAt(i);
  6079. hash |= 0; // Convert to 32bit integer
  6080. }
  6081. return exports.colors[Math.abs(hash) % exports.colors.length];
  6082. }
  6083. /**
  6084. * Create a debugger with the given `namespace`.
  6085. *
  6086. * @param {String} namespace
  6087. * @return {Function}
  6088. * @api public
  6089. */
  6090. function createDebug(namespace) {
  6091. function debug() {
  6092. // disabled?
  6093. if (!debug.enabled) return;
  6094. var self = debug; // set `diff` timestamp
  6095. var curr = +new Date();
  6096. var ms = curr - (prevTime || curr);
  6097. self.diff = ms;
  6098. self.prev = prevTime;
  6099. self.curr = curr;
  6100. prevTime = curr; // turn the `arguments` into a proper Array
  6101. var args = new Array(arguments.length);
  6102. for (var i = 0; i < args.length; i++) {
  6103. args[i] = arguments[i];
  6104. }
  6105. args[0] = exports.coerce(args[0]);
  6106. if ('string' !== typeof args[0]) {
  6107. // anything else let's inspect with %O
  6108. args.unshift('%O');
  6109. } // apply any `formatters` transformations
  6110. var index = 0;
  6111. args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
  6112. // if we encounter an escaped % then don't increase the array index
  6113. if (match === '%%') return match;
  6114. index++;
  6115. var formatter = exports.formatters[format];
  6116. if ('function' === typeof formatter) {
  6117. var val = args[index];
  6118. match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`
  6119. args.splice(index, 1);
  6120. index--;
  6121. }
  6122. return match;
  6123. }); // apply env-specific formatting (colors, etc.)
  6124. exports.formatArgs.call(self, args);
  6125. var logFn = debug.log || exports.log || console.log.bind(console);
  6126. logFn.apply(self, args);
  6127. }
  6128. debug.namespace = namespace;
  6129. debug.enabled = exports.enabled(namespace);
  6130. debug.useColors = exports.useColors();
  6131. debug.color = selectColor(namespace); // env-specific initialization logic for debug instances
  6132. if ('function' === typeof exports.init) {
  6133. exports.init(debug);
  6134. }
  6135. return debug;
  6136. }
  6137. /**
  6138. * Enables a debug mode by namespaces. This can include modes
  6139. * separated by a colon and wildcards.
  6140. *
  6141. * @param {String} namespaces
  6142. * @api public
  6143. */
  6144. function enable(namespaces) {
  6145. exports.save(namespaces);
  6146. exports.names = [];
  6147. exports.skips = [];
  6148. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  6149. var len = split.length;
  6150. for (var i = 0; i < len; i++) {
  6151. if (!split[i]) continue; // ignore empty strings
  6152. namespaces = split[i].replace(/\*/g, '.*?');
  6153. if (namespaces[0] === '-') {
  6154. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  6155. } else {
  6156. exports.names.push(new RegExp('^' + namespaces + '$'));
  6157. }
  6158. }
  6159. }
  6160. /**
  6161. * Disable debug output.
  6162. *
  6163. * @api public
  6164. */
  6165. function disable() {
  6166. exports.enable('');
  6167. }
  6168. /**
  6169. * Returns true if the given mode name is enabled, false otherwise.
  6170. *
  6171. * @param {String} name
  6172. * @return {Boolean}
  6173. * @api public
  6174. */
  6175. function enabled(name) {
  6176. var i, len;
  6177. for (i = 0, len = exports.skips.length; i < len; i++) {
  6178. if (exports.skips[i].test(name)) {
  6179. return false;
  6180. }
  6181. }
  6182. for (i = 0, len = exports.names.length; i < len; i++) {
  6183. if (exports.names[i].test(name)) {
  6184. return true;
  6185. }
  6186. }
  6187. return false;
  6188. }
  6189. /**
  6190. * Coerce `val`.
  6191. *
  6192. * @param {Mixed} val
  6193. * @return {Mixed}
  6194. * @api private
  6195. */
  6196. function coerce(val) {
  6197. if (val instanceof Error) return val.stack || val.message;
  6198. return val;
  6199. }
  6200. /***/ }),
  6201. /***/ "./node_modules/expand-brackets/node_modules/ms/index.js":
  6202. /*!***************************************************************!*\
  6203. !*** ./node_modules/expand-brackets/node_modules/ms/index.js ***!
  6204. \***************************************************************/
  6205. /*! no static exports found */
  6206. /***/ (function(module, exports, __webpack_require__) {
  6207. "use strict";
  6208. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6209. /**
  6210. * Helpers.
  6211. */
  6212. var s = 1000;
  6213. var m = s * 60;
  6214. var h = m * 60;
  6215. var d = h * 24;
  6216. var y = d * 365.25;
  6217. /**
  6218. * Parse or format the given `val`.
  6219. *
  6220. * Options:
  6221. *
  6222. * - `long` verbose formatting [false]
  6223. *
  6224. * @param {String|Number} val
  6225. * @param {Object} [options]
  6226. * @throws {Error} throw an error if val is not a non-empty string or a number
  6227. * @return {String|Number}
  6228. * @api public
  6229. */
  6230. module.exports = function (val, options) {
  6231. options = options || {};
  6232. var type = _typeof(val);
  6233. if (type === 'string' && val.length > 0) {
  6234. return parse(val);
  6235. } else if (type === 'number' && isNaN(val) === false) {
  6236. return options.long ? fmtLong(val) : fmtShort(val);
  6237. }
  6238. throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
  6239. };
  6240. /**
  6241. * Parse the given `str` and return milliseconds.
  6242. *
  6243. * @param {String} str
  6244. * @return {Number}
  6245. * @api private
  6246. */
  6247. function parse(str) {
  6248. str = String(str);
  6249. if (str.length > 100) {
  6250. return;
  6251. }
  6252. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
  6253. if (!match) {
  6254. return;
  6255. }
  6256. var n = parseFloat(match[1]);
  6257. var type = (match[2] || 'ms').toLowerCase();
  6258. switch (type) {
  6259. case 'years':
  6260. case 'year':
  6261. case 'yrs':
  6262. case 'yr':
  6263. case 'y':
  6264. return n * y;
  6265. case 'days':
  6266. case 'day':
  6267. case 'd':
  6268. return n * d;
  6269. case 'hours':
  6270. case 'hour':
  6271. case 'hrs':
  6272. case 'hr':
  6273. case 'h':
  6274. return n * h;
  6275. case 'minutes':
  6276. case 'minute':
  6277. case 'mins':
  6278. case 'min':
  6279. case 'm':
  6280. return n * m;
  6281. case 'seconds':
  6282. case 'second':
  6283. case 'secs':
  6284. case 'sec':
  6285. case 's':
  6286. return n * s;
  6287. case 'milliseconds':
  6288. case 'millisecond':
  6289. case 'msecs':
  6290. case 'msec':
  6291. case 'ms':
  6292. return n;
  6293. default:
  6294. return undefined;
  6295. }
  6296. }
  6297. /**
  6298. * Short format for `ms`.
  6299. *
  6300. * @param {Number} ms
  6301. * @return {String}
  6302. * @api private
  6303. */
  6304. function fmtShort(ms) {
  6305. if (ms >= d) {
  6306. return Math.round(ms / d) + 'd';
  6307. }
  6308. if (ms >= h) {
  6309. return Math.round(ms / h) + 'h';
  6310. }
  6311. if (ms >= m) {
  6312. return Math.round(ms / m) + 'm';
  6313. }
  6314. if (ms >= s) {
  6315. return Math.round(ms / s) + 's';
  6316. }
  6317. return ms + 'ms';
  6318. }
  6319. /**
  6320. * Long format for `ms`.
  6321. *
  6322. * @param {Number} ms
  6323. * @return {String}
  6324. * @api private
  6325. */
  6326. function fmtLong(ms) {
  6327. return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
  6328. }
  6329. /**
  6330. * Pluralization helper.
  6331. */
  6332. function plural(ms, n, name) {
  6333. if (ms < n) {
  6334. return;
  6335. }
  6336. if (ms < n * 1.5) {
  6337. return Math.floor(ms / n) + ' ' + name;
  6338. }
  6339. return Math.ceil(ms / n) + ' ' + name + 's';
  6340. }
  6341. /***/ }),
  6342. /***/ "./node_modules/extend-shallow/index.js":
  6343. /*!**********************************************!*\
  6344. !*** ./node_modules/extend-shallow/index.js ***!
  6345. \**********************************************/
  6346. /*! no static exports found */
  6347. /***/ (function(module, exports, __webpack_require__) {
  6348. "use strict";
  6349. var isObject = __webpack_require__(/*! is-extendable */ "./node_modules/is-extendable/index.js");
  6350. module.exports = function extend(o
  6351. /*, objects*/
  6352. ) {
  6353. if (!isObject(o)) {
  6354. o = {};
  6355. }
  6356. var len = arguments.length;
  6357. for (var i = 1; i < len; i++) {
  6358. var obj = arguments[i];
  6359. if (isObject(obj)) {
  6360. assign(o, obj);
  6361. }
  6362. }
  6363. return o;
  6364. };
  6365. function assign(a, b) {
  6366. for (var key in b) {
  6367. if (hasOwn(b, key)) {
  6368. a[key] = b[key];
  6369. }
  6370. }
  6371. }
  6372. /**
  6373. * Returns true if the given `key` is an own property of `obj`.
  6374. */
  6375. function hasOwn(obj, key) {
  6376. return Object.prototype.hasOwnProperty.call(obj, key);
  6377. }
  6378. /***/ }),
  6379. /***/ "./node_modules/extglob/index.js":
  6380. /*!***************************************!*\
  6381. !*** ./node_modules/extglob/index.js ***!
  6382. \***************************************/
  6383. /*! no static exports found */
  6384. /***/ (function(module, exports, __webpack_require__) {
  6385. "use strict";
  6386. /**
  6387. * Module dependencies
  6388. */
  6389. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  6390. var unique = __webpack_require__(/*! array-unique */ "./node_modules/array-unique/index.js");
  6391. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  6392. /**
  6393. * Local dependencies
  6394. */
  6395. var compilers = __webpack_require__(/*! ./lib/compilers */ "./node_modules/extglob/lib/compilers.js");
  6396. var parsers = __webpack_require__(/*! ./lib/parsers */ "./node_modules/extglob/lib/parsers.js");
  6397. var Extglob = __webpack_require__(/*! ./lib/extglob */ "./node_modules/extglob/lib/extglob.js");
  6398. var utils = __webpack_require__(/*! ./lib/utils */ "./node_modules/extglob/lib/utils.js");
  6399. var MAX_LENGTH = 1024 * 64;
  6400. /**
  6401. * Convert the given `extglob` pattern into a regex-compatible string. Returns
  6402. * an object with the compiled result and the parsed AST.
  6403. *
  6404. * ```js
  6405. * var extglob = require('extglob');
  6406. * console.log(extglob('*.!(*a)'));
  6407. * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?'
  6408. * ```
  6409. * @param {String} `pattern`
  6410. * @param {Object} `options`
  6411. * @return {String}
  6412. * @api public
  6413. */
  6414. function extglob(pattern, options) {
  6415. return extglob.create(pattern, options).output;
  6416. }
  6417. /**
  6418. * Takes an array of strings and an extglob pattern and returns a new
  6419. * array that contains only the strings that match the pattern.
  6420. *
  6421. * ```js
  6422. * var extglob = require('extglob');
  6423. * console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)'));
  6424. * //=> ['a.b', 'a.c']
  6425. * ```
  6426. * @param {Array} `list` Array of strings to match
  6427. * @param {String} `pattern` Extglob pattern
  6428. * @param {Object} `options`
  6429. * @return {Array} Returns an array of matches
  6430. * @api public
  6431. */
  6432. extglob.match = function (list, pattern, options) {
  6433. if (typeof pattern !== 'string') {
  6434. throw new TypeError('expected pattern to be a string');
  6435. }
  6436. list = utils.arrayify(list);
  6437. var isMatch = extglob.matcher(pattern, options);
  6438. var len = list.length;
  6439. var idx = -1;
  6440. var matches = [];
  6441. while (++idx < len) {
  6442. var ele = list[idx];
  6443. if (isMatch(ele)) {
  6444. matches.push(ele);
  6445. }
  6446. } // if no options were passed, uniquify results and return
  6447. if (typeof options === 'undefined') {
  6448. return unique(matches);
  6449. }
  6450. if (matches.length === 0) {
  6451. if (options.failglob === true) {
  6452. throw new Error('no matches found for "' + pattern + '"');
  6453. }
  6454. if (options.nonull === true || options.nullglob === true) {
  6455. return [pattern.split('\\').join('')];
  6456. }
  6457. }
  6458. return options.nodupes !== false ? unique(matches) : matches;
  6459. };
  6460. /**
  6461. * Returns true if the specified `string` matches the given
  6462. * extglob `pattern`.
  6463. *
  6464. * ```js
  6465. * var extglob = require('extglob');
  6466. *
  6467. * console.log(extglob.isMatch('a.a', '*.!(*a)'));
  6468. * //=> false
  6469. * console.log(extglob.isMatch('a.b', '*.!(*a)'));
  6470. * //=> true
  6471. * ```
  6472. * @param {String} `string` String to match
  6473. * @param {String} `pattern` Extglob pattern
  6474. * @param {String} `options`
  6475. * @return {Boolean}
  6476. * @api public
  6477. */
  6478. extglob.isMatch = function (str, pattern, options) {
  6479. if (typeof pattern !== 'string') {
  6480. throw new TypeError('expected pattern to be a string');
  6481. }
  6482. if (typeof str !== 'string') {
  6483. throw new TypeError('expected a string');
  6484. }
  6485. if (pattern === str) {
  6486. return true;
  6487. }
  6488. if (pattern === '' || pattern === ' ' || pattern === '.') {
  6489. return pattern === str;
  6490. }
  6491. var isMatch = utils.memoize('isMatch', pattern, options, extglob.matcher);
  6492. return isMatch(str);
  6493. };
  6494. /**
  6495. * Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but
  6496. * the pattern can match any part of the string.
  6497. *
  6498. * ```js
  6499. * var extglob = require('extglob');
  6500. * console.log(extglob.contains('aa/bb/cc', '*b'));
  6501. * //=> true
  6502. * console.log(extglob.contains('aa/bb/cc', '*d'));
  6503. * //=> false
  6504. * ```
  6505. * @param {String} `str` The string to match.
  6506. * @param {String} `pattern` Glob pattern to use for matching.
  6507. * @param {Object} `options`
  6508. * @return {Boolean} Returns true if the patter matches any part of `str`.
  6509. * @api public
  6510. */
  6511. extglob.contains = function (str, pattern, options) {
  6512. if (typeof str !== 'string') {
  6513. throw new TypeError('expected a string');
  6514. }
  6515. if (pattern === '' || pattern === ' ' || pattern === '.') {
  6516. return pattern === str;
  6517. }
  6518. var opts = extend({}, options, {
  6519. contains: true
  6520. });
  6521. opts.strictClose = false;
  6522. opts.strictOpen = false;
  6523. return extglob.isMatch(str, pattern, opts);
  6524. };
  6525. /**
  6526. * Takes an extglob pattern and returns a matcher function. The returned
  6527. * function takes the string to match as its only argument.
  6528. *
  6529. * ```js
  6530. * var extglob = require('extglob');
  6531. * var isMatch = extglob.matcher('*.!(*a)');
  6532. *
  6533. * console.log(isMatch('a.a'));
  6534. * //=> false
  6535. * console.log(isMatch('a.b'));
  6536. * //=> true
  6537. * ```
  6538. * @param {String} `pattern` Extglob pattern
  6539. * @param {String} `options`
  6540. * @return {Boolean}
  6541. * @api public
  6542. */
  6543. extglob.matcher = function (pattern, options) {
  6544. if (typeof pattern !== 'string') {
  6545. throw new TypeError('expected pattern to be a string');
  6546. }
  6547. function matcher() {
  6548. var re = extglob.makeRe(pattern, options);
  6549. return function (str) {
  6550. return re.test(str);
  6551. };
  6552. }
  6553. return utils.memoize('matcher', pattern, options, matcher);
  6554. };
  6555. /**
  6556. * Convert the given `extglob` pattern into a regex-compatible string. Returns
  6557. * an object with the compiled result and the parsed AST.
  6558. *
  6559. * ```js
  6560. * var extglob = require('extglob');
  6561. * console.log(extglob.create('*.!(*a)').output);
  6562. * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?'
  6563. * ```
  6564. * @param {String} `str`
  6565. * @param {Object} `options`
  6566. * @return {String}
  6567. * @api public
  6568. */
  6569. extglob.create = function (pattern, options) {
  6570. if (typeof pattern !== 'string') {
  6571. throw new TypeError('expected pattern to be a string');
  6572. }
  6573. function create() {
  6574. var ext = new Extglob(options);
  6575. var ast = ext.parse(pattern, options);
  6576. return ext.compile(ast, options);
  6577. }
  6578. return utils.memoize('create', pattern, options, create);
  6579. };
  6580. /**
  6581. * Returns an array of matches captured by `pattern` in `string`, or `null`
  6582. * if the pattern did not match.
  6583. *
  6584. * ```js
  6585. * var extglob = require('extglob');
  6586. * extglob.capture(pattern, string[, options]);
  6587. *
  6588. * console.log(extglob.capture('test/*.js', 'test/foo.js'));
  6589. * //=> ['foo']
  6590. * console.log(extglob.capture('test/*.js', 'foo/bar.css'));
  6591. * //=> null
  6592. * ```
  6593. * @param {String} `pattern` Glob pattern to use for matching.
  6594. * @param {String} `string` String to match
  6595. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  6596. * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`.
  6597. * @api public
  6598. */
  6599. extglob.capture = function (pattern, str, options) {
  6600. var re = extglob.makeRe(pattern, extend({
  6601. capture: true
  6602. }, options));
  6603. function match() {
  6604. return function (string) {
  6605. var match = re.exec(string);
  6606. if (!match) {
  6607. return null;
  6608. }
  6609. return match.slice(1);
  6610. };
  6611. }
  6612. var capture = utils.memoize('capture', pattern, options, match);
  6613. return capture(str);
  6614. };
  6615. /**
  6616. * Create a regular expression from the given `pattern` and `options`.
  6617. *
  6618. * ```js
  6619. * var extglob = require('extglob');
  6620. * var re = extglob.makeRe('*.!(*a)');
  6621. * console.log(re);
  6622. * //=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/
  6623. * ```
  6624. * @param {String} `pattern` The pattern to convert to regex.
  6625. * @param {Object} `options`
  6626. * @return {RegExp}
  6627. * @api public
  6628. */
  6629. extglob.makeRe = function (pattern, options) {
  6630. if (pattern instanceof RegExp) {
  6631. return pattern;
  6632. }
  6633. if (typeof pattern !== 'string') {
  6634. throw new TypeError('expected pattern to be a string');
  6635. }
  6636. if (pattern.length > MAX_LENGTH) {
  6637. throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
  6638. }
  6639. function makeRe() {
  6640. var opts = extend({
  6641. strictErrors: false
  6642. }, options);
  6643. if (opts.strictErrors === true) opts.strict = true;
  6644. var res = extglob.create(pattern, opts);
  6645. return toRegex(res.output, opts);
  6646. }
  6647. var regex = utils.memoize('makeRe', pattern, options, makeRe);
  6648. if (regex.source.length > MAX_LENGTH) {
  6649. throw new SyntaxError('potentially malicious regex detected');
  6650. }
  6651. return regex;
  6652. };
  6653. /**
  6654. * Cache
  6655. */
  6656. extglob.cache = utils.cache;
  6657. extglob.clearCache = function () {
  6658. extglob.cache.__data__ = {};
  6659. };
  6660. /**
  6661. * Expose `Extglob` constructor, parsers and compilers
  6662. */
  6663. extglob.Extglob = Extglob;
  6664. extglob.compilers = compilers;
  6665. extglob.parsers = parsers;
  6666. /**
  6667. * Expose `extglob`
  6668. * @type {Function}
  6669. */
  6670. module.exports = extglob;
  6671. /***/ }),
  6672. /***/ "./node_modules/extglob/lib/compilers.js":
  6673. /*!***********************************************!*\
  6674. !*** ./node_modules/extglob/lib/compilers.js ***!
  6675. \***********************************************/
  6676. /*! no static exports found */
  6677. /***/ (function(module, exports, __webpack_require__) {
  6678. "use strict";
  6679. var brackets = __webpack_require__(/*! expand-brackets */ "./node_modules/expand-brackets/index.js");
  6680. /**
  6681. * Extglob compilers
  6682. */
  6683. module.exports = function (extglob) {
  6684. function star() {
  6685. if (typeof extglob.options.star === 'function') {
  6686. return extglob.options.star.apply(this, arguments);
  6687. }
  6688. if (typeof extglob.options.star === 'string') {
  6689. return extglob.options.star;
  6690. }
  6691. return '.*?';
  6692. }
  6693. /**
  6694. * Use `expand-brackets` compilers
  6695. */
  6696. extglob.use(brackets.compilers);
  6697. extglob.compiler
  6698. /**
  6699. * Escaped: "\\*"
  6700. */
  6701. .set('escape', function (node) {
  6702. return this.emit(node.val, node);
  6703. })
  6704. /**
  6705. * Dot: "."
  6706. */
  6707. .set('dot', function (node) {
  6708. return this.emit('\\' + node.val, node);
  6709. })
  6710. /**
  6711. * Question mark: "?"
  6712. */
  6713. .set('qmark', function (node) {
  6714. var val = '[^\\\\/.]';
  6715. var prev = this.prev();
  6716. if (node.parsed.slice(-1) === '(') {
  6717. var ch = node.rest.charAt(0);
  6718. if (ch !== '!' && ch !== '=' && ch !== ':') {
  6719. return this.emit(val, node);
  6720. }
  6721. return this.emit(node.val, node);
  6722. }
  6723. if (prev.type === 'text' && prev.val) {
  6724. return this.emit(val, node);
  6725. }
  6726. if (node.val.length > 1) {
  6727. val += '{' + node.val.length + '}';
  6728. }
  6729. return this.emit(val, node);
  6730. })
  6731. /**
  6732. * Plus: "+"
  6733. */
  6734. .set('plus', function (node) {
  6735. var prev = node.parsed.slice(-1);
  6736. if (prev === ']' || prev === ')') {
  6737. return this.emit(node.val, node);
  6738. }
  6739. var ch = this.output.slice(-1);
  6740. if (!this.output || /[?*+]/.test(ch) && node.parent.type !== 'bracket') {
  6741. return this.emit('\\+', node);
  6742. }
  6743. if (/\w/.test(ch) && !node.inside) {
  6744. return this.emit('+\\+?', node);
  6745. }
  6746. return this.emit('+', node);
  6747. })
  6748. /**
  6749. * Star: "*"
  6750. */
  6751. .set('star', function (node) {
  6752. var prev = this.prev();
  6753. var prefix = prev.type !== 'text' && prev.type !== 'escape' ? '(?!\\.)' : '';
  6754. return this.emit(prefix + star.call(this, node), node);
  6755. })
  6756. /**
  6757. * Parens
  6758. */
  6759. .set('paren', function (node) {
  6760. return this.mapVisit(node.nodes);
  6761. }).set('paren.open', function (node) {
  6762. var capture = this.options.capture ? '(' : '';
  6763. switch (node.parent.prefix) {
  6764. case '!':
  6765. case '^':
  6766. return this.emit(capture + '(?:(?!(?:', node);
  6767. case '*':
  6768. case '+':
  6769. case '?':
  6770. case '@':
  6771. return this.emit(capture + '(?:', node);
  6772. default:
  6773. {
  6774. var val = node.val;
  6775. if (this.options.bash === true) {
  6776. val = '\\' + val;
  6777. } else if (!this.options.capture && val === '(' && node.parent.rest[0] !== '?') {
  6778. val += '?:';
  6779. }
  6780. return this.emit(val, node);
  6781. }
  6782. }
  6783. }).set('paren.close', function (node) {
  6784. var capture = this.options.capture ? ')' : '';
  6785. switch (node.prefix) {
  6786. case '!':
  6787. case '^':
  6788. var prefix = /^(\)|$)/.test(node.rest) ? '$' : '';
  6789. var str = star.call(this, node); // if the extglob has a slash explicitly defined, we know the user wants
  6790. // to match slashes, so we need to ensure the "star" regex allows for it
  6791. if (node.parent.hasSlash && !this.options.star && this.options.slash !== false) {
  6792. str = '.*?';
  6793. }
  6794. return this.emit(prefix + ('))' + str + ')') + capture, node);
  6795. case '*':
  6796. case '+':
  6797. case '?':
  6798. return this.emit(')' + node.prefix + capture, node);
  6799. case '@':
  6800. return this.emit(')' + capture, node);
  6801. default:
  6802. {
  6803. var val = (this.options.bash === true ? '\\' : '') + ')';
  6804. return this.emit(val, node);
  6805. }
  6806. }
  6807. })
  6808. /**
  6809. * Text
  6810. */
  6811. .set('text', function (node) {
  6812. var val = node.val.replace(/[\[\]]/g, '\\$&');
  6813. return this.emit(val, node);
  6814. });
  6815. };
  6816. /***/ }),
  6817. /***/ "./node_modules/extglob/lib/extglob.js":
  6818. /*!*********************************************!*\
  6819. !*** ./node_modules/extglob/lib/extglob.js ***!
  6820. \*********************************************/
  6821. /*! no static exports found */
  6822. /***/ (function(module, exports, __webpack_require__) {
  6823. "use strict";
  6824. /**
  6825. * Module dependencies
  6826. */
  6827. var Snapdragon = __webpack_require__(/*! snapdragon */ "./node_modules/snapdragon/index.js");
  6828. var define = __webpack_require__(/*! define-property */ "./node_modules/extglob/node_modules/define-property/index.js");
  6829. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  6830. /**
  6831. * Local dependencies
  6832. */
  6833. var compilers = __webpack_require__(/*! ./compilers */ "./node_modules/extglob/lib/compilers.js");
  6834. var parsers = __webpack_require__(/*! ./parsers */ "./node_modules/extglob/lib/parsers.js");
  6835. /**
  6836. * Customize Snapdragon parser and renderer
  6837. */
  6838. function Extglob(options) {
  6839. this.options = extend({
  6840. source: 'extglob'
  6841. }, options);
  6842. this.snapdragon = this.options.snapdragon || new Snapdragon(this.options);
  6843. this.snapdragon.patterns = this.snapdragon.patterns || {};
  6844. this.compiler = this.snapdragon.compiler;
  6845. this.parser = this.snapdragon.parser;
  6846. compilers(this.snapdragon);
  6847. parsers(this.snapdragon);
  6848. /**
  6849. * Override Snapdragon `.parse` method
  6850. */
  6851. define(this.snapdragon, 'parse', function (str, options) {
  6852. var parsed = Snapdragon.prototype.parse.apply(this, arguments);
  6853. parsed.input = str; // escape unmatched brace/bracket/parens
  6854. var last = this.parser.stack.pop();
  6855. if (last && this.options.strict !== true) {
  6856. var node = last.nodes[0];
  6857. node.val = '\\' + node.val;
  6858. var sibling = node.parent.nodes[1];
  6859. if (sibling.type === 'star') {
  6860. sibling.loose = true;
  6861. }
  6862. } // add non-enumerable parser reference
  6863. define(parsed, 'parser', this.parser);
  6864. return parsed;
  6865. });
  6866. /**
  6867. * Decorate `.parse` method
  6868. */
  6869. define(this, 'parse', function (ast, options) {
  6870. return this.snapdragon.parse.apply(this.snapdragon, arguments);
  6871. });
  6872. /**
  6873. * Decorate `.compile` method
  6874. */
  6875. define(this, 'compile', function (ast, options) {
  6876. return this.snapdragon.compile.apply(this.snapdragon, arguments);
  6877. });
  6878. }
  6879. /**
  6880. * Expose `Extglob`
  6881. */
  6882. module.exports = Extglob;
  6883. /***/ }),
  6884. /***/ "./node_modules/extglob/lib/parsers.js":
  6885. /*!*********************************************!*\
  6886. !*** ./node_modules/extglob/lib/parsers.js ***!
  6887. \*********************************************/
  6888. /*! no static exports found */
  6889. /***/ (function(module, exports, __webpack_require__) {
  6890. "use strict";
  6891. var brackets = __webpack_require__(/*! expand-brackets */ "./node_modules/expand-brackets/index.js");
  6892. var define = __webpack_require__(/*! define-property */ "./node_modules/extglob/node_modules/define-property/index.js");
  6893. var utils = __webpack_require__(/*! ./utils */ "./node_modules/extglob/lib/utils.js");
  6894. /**
  6895. * Characters to use in text regex (we want to "not" match
  6896. * characters that are matched by other parsers)
  6897. */
  6898. var TEXT_REGEX = '([!@*?+]?\\(|\\)|[*?.+\\\\]|\\[:?(?=.*\\])|:?\\])+';
  6899. var not = utils.createRegex(TEXT_REGEX);
  6900. /**
  6901. * Extglob parsers
  6902. */
  6903. function parsers(extglob) {
  6904. extglob.state = extglob.state || {};
  6905. /**
  6906. * Use `expand-brackets` parsers
  6907. */
  6908. extglob.use(brackets.parsers);
  6909. extglob.parser.sets.paren = extglob.parser.sets.paren || [];
  6910. extglob.parser
  6911. /**
  6912. * Extglob open: "*("
  6913. */
  6914. .capture('paren.open', function () {
  6915. var parsed = this.parsed;
  6916. var pos = this.position();
  6917. var m = this.match(/^([!@*?+])?\(/);
  6918. if (!m) return;
  6919. var prev = this.prev();
  6920. var prefix = m[1];
  6921. var val = m[0];
  6922. var open = pos({
  6923. type: 'paren.open',
  6924. parsed: parsed,
  6925. val: val
  6926. });
  6927. var node = pos({
  6928. type: 'paren',
  6929. prefix: prefix,
  6930. nodes: [open]
  6931. }); // if nested negation extglobs, just cancel them out to simplify
  6932. if (prefix === '!' && prev.type === 'paren' && prev.prefix === '!') {
  6933. prev.prefix = '@';
  6934. node.prefix = '@';
  6935. }
  6936. define(node, 'rest', this.input);
  6937. define(node, 'parsed', parsed);
  6938. define(node, 'parent', prev);
  6939. define(open, 'parent', node);
  6940. this.push('paren', node);
  6941. prev.nodes.push(node);
  6942. })
  6943. /**
  6944. * Extglob close: ")"
  6945. */
  6946. .capture('paren.close', function () {
  6947. var parsed = this.parsed;
  6948. var pos = this.position();
  6949. var m = this.match(/^\)/);
  6950. if (!m) return;
  6951. var parent = this.pop('paren');
  6952. var node = pos({
  6953. type: 'paren.close',
  6954. rest: this.input,
  6955. parsed: parsed,
  6956. val: m[0]
  6957. });
  6958. if (!this.isType(parent, 'paren')) {
  6959. if (this.options.strict) {
  6960. throw new Error('missing opening paren: "("');
  6961. }
  6962. node.escaped = true;
  6963. return node;
  6964. }
  6965. node.prefix = parent.prefix;
  6966. parent.nodes.push(node);
  6967. define(node, 'parent', parent);
  6968. })
  6969. /**
  6970. * Escape: "\\."
  6971. */
  6972. .capture('escape', function () {
  6973. var pos = this.position();
  6974. var m = this.match(/^\\(.)/);
  6975. if (!m) return;
  6976. return pos({
  6977. type: 'escape',
  6978. val: m[0],
  6979. ch: m[1]
  6980. });
  6981. })
  6982. /**
  6983. * Question marks: "?"
  6984. */
  6985. .capture('qmark', function () {
  6986. var parsed = this.parsed;
  6987. var pos = this.position();
  6988. var m = this.match(/^\?+(?!\()/);
  6989. if (!m) return;
  6990. extglob.state.metachar = true;
  6991. return pos({
  6992. type: 'qmark',
  6993. rest: this.input,
  6994. parsed: parsed,
  6995. val: m[0]
  6996. });
  6997. })
  6998. /**
  6999. * Character parsers
  7000. */
  7001. .capture('star', /^\*(?!\()/).capture('plus', /^\+(?!\()/).capture('dot', /^\./).capture('text', not);
  7002. }
  7003. ;
  7004. /**
  7005. * Expose text regex string
  7006. */
  7007. module.exports.TEXT_REGEX = TEXT_REGEX;
  7008. /**
  7009. * Extglob parsers
  7010. */
  7011. module.exports = parsers;
  7012. /***/ }),
  7013. /***/ "./node_modules/extglob/lib/utils.js":
  7014. /*!*******************************************!*\
  7015. !*** ./node_modules/extglob/lib/utils.js ***!
  7016. \*******************************************/
  7017. /*! no static exports found */
  7018. /***/ (function(module, exports, __webpack_require__) {
  7019. "use strict";
  7020. var regex = __webpack_require__(/*! regex-not */ "./node_modules/regex-not/index.js");
  7021. var Cache = __webpack_require__(/*! fragment-cache */ "./node_modules/fragment-cache/index.js");
  7022. /**
  7023. * Utils
  7024. */
  7025. var utils = module.exports;
  7026. var cache = utils.cache = new Cache();
  7027. /**
  7028. * Cast `val` to an array
  7029. * @return {Array}
  7030. */
  7031. utils.arrayify = function (val) {
  7032. if (!Array.isArray(val)) {
  7033. return [val];
  7034. }
  7035. return val;
  7036. };
  7037. /**
  7038. * Memoize a generated regex or function
  7039. */
  7040. utils.memoize = function (type, pattern, options, fn) {
  7041. var key = utils.createKey(type + pattern, options);
  7042. if (cache.has(type, key)) {
  7043. return cache.get(type, key);
  7044. }
  7045. var val = fn(pattern, options);
  7046. if (options && options.cache === false) {
  7047. return val;
  7048. }
  7049. cache.set(type, key, val);
  7050. return val;
  7051. };
  7052. /**
  7053. * Create the key to use for memoization. The key is generated
  7054. * by iterating over the options and concatenating key-value pairs
  7055. * to the pattern string.
  7056. */
  7057. utils.createKey = function (pattern, options) {
  7058. var key = pattern;
  7059. if (typeof options === 'undefined') {
  7060. return key;
  7061. }
  7062. for (var prop in options) {
  7063. key += ';' + prop + '=' + String(options[prop]);
  7064. }
  7065. return key;
  7066. };
  7067. /**
  7068. * Create the regex to use for matching text
  7069. */
  7070. utils.createRegex = function (str) {
  7071. var opts = {
  7072. contains: true,
  7073. strictClose: false
  7074. };
  7075. return regex(str, opts);
  7076. };
  7077. /***/ }),
  7078. /***/ "./node_modules/extglob/node_modules/define-property/index.js":
  7079. /*!********************************************************************!*\
  7080. !*** ./node_modules/extglob/node_modules/define-property/index.js ***!
  7081. \********************************************************************/
  7082. /*! no static exports found */
  7083. /***/ (function(module, exports, __webpack_require__) {
  7084. "use strict";
  7085. /*!
  7086. * define-property <https://github.com/jonschlinkert/define-property>
  7087. *
  7088. * Copyright (c) 2015, 2017, Jon Schlinkert.
  7089. * Released under the MIT License.
  7090. */
  7091. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7092. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/is-descriptor/index.js");
  7093. module.exports = function defineProperty(obj, prop, val) {
  7094. if (_typeof(obj) !== 'object' && typeof obj !== 'function') {
  7095. throw new TypeError('expected an object or function.');
  7096. }
  7097. if (typeof prop !== 'string') {
  7098. throw new TypeError('expected `prop` to be a string.');
  7099. }
  7100. if (isDescriptor(val) && ('set' in val || 'get' in val)) {
  7101. return Object.defineProperty(obj, prop, val);
  7102. }
  7103. return Object.defineProperty(obj, prop, {
  7104. configurable: true,
  7105. enumerable: false,
  7106. writable: true,
  7107. value: val
  7108. });
  7109. };
  7110. /***/ }),
  7111. /***/ "./node_modules/fill-range/index.js":
  7112. /*!******************************************!*\
  7113. !*** ./node_modules/fill-range/index.js ***!
  7114. \******************************************/
  7115. /*! no static exports found */
  7116. /***/ (function(module, exports, __webpack_require__) {
  7117. "use strict";
  7118. /*!
  7119. * fill-range <https://github.com/jonschlinkert/fill-range>
  7120. *
  7121. * Copyright (c) 2014-2015, 2017, Jon Schlinkert.
  7122. * Released under the MIT License.
  7123. */
  7124. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  7125. var isNumber = __webpack_require__(/*! is-number */ "./node_modules/is-number/index.js");
  7126. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  7127. var repeat = __webpack_require__(/*! repeat-string */ "./node_modules/repeat-string/index.js");
  7128. var toRegex = __webpack_require__(/*! to-regex-range */ "./node_modules/to-regex-range/index.js");
  7129. /**
  7130. * Return a range of numbers or letters.
  7131. *
  7132. * @param {String} `start` Start of the range
  7133. * @param {String} `stop` End of the range
  7134. * @param {String} `step` Increment or decrement to use.
  7135. * @param {Function} `fn` Custom function to modify each element in the range.
  7136. * @return {Array}
  7137. */
  7138. function fillRange(start, stop, step, options) {
  7139. if (typeof start === 'undefined') {
  7140. return [];
  7141. }
  7142. if (typeof stop === 'undefined' || start === stop) {
  7143. // special case, for handling negative zero
  7144. var isString = typeof start === 'string';
  7145. if (isNumber(start) && !toNumber(start)) {
  7146. return [isString ? '0' : 0];
  7147. }
  7148. return [start];
  7149. }
  7150. if (typeof step !== 'number' && typeof step !== 'string') {
  7151. options = step;
  7152. step = undefined;
  7153. }
  7154. if (typeof options === 'function') {
  7155. options = {
  7156. transform: options
  7157. };
  7158. }
  7159. var opts = extend({
  7160. step: step
  7161. }, options);
  7162. if (opts.step && !isValidNumber(opts.step)) {
  7163. if (opts.strictRanges === true) {
  7164. throw new TypeError('expected options.step to be a number');
  7165. }
  7166. return [];
  7167. }
  7168. opts.isNumber = isValidNumber(start) && isValidNumber(stop);
  7169. if (!opts.isNumber && !isValid(start, stop)) {
  7170. if (opts.strictRanges === true) {
  7171. throw new RangeError('invalid range arguments: ' + util.inspect([start, stop]));
  7172. }
  7173. return [];
  7174. }
  7175. opts.isPadded = isPadded(start) || isPadded(stop);
  7176. opts.toString = opts.stringify || typeof opts.step === 'string' || typeof start === 'string' || typeof stop === 'string' || !opts.isNumber;
  7177. if (opts.isPadded) {
  7178. opts.maxLength = Math.max(String(start).length, String(stop).length);
  7179. } // support legacy minimatch/fill-range options
  7180. if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize;
  7181. if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe;
  7182. return expand(start, stop, opts);
  7183. }
  7184. function expand(start, stop, options) {
  7185. var a = options.isNumber ? toNumber(start) : start.charCodeAt(0);
  7186. var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0);
  7187. var step = Math.abs(toNumber(options.step)) || 1;
  7188. if (options.toRegex && step === 1) {
  7189. return toRange(a, b, start, stop, options);
  7190. }
  7191. var zero = {
  7192. greater: [],
  7193. lesser: []
  7194. };
  7195. var asc = a < b;
  7196. var arr = new Array(Math.round((asc ? b - a : a - b) / step));
  7197. var idx = 0;
  7198. while (asc ? a <= b : a >= b) {
  7199. var val = options.isNumber ? a : String.fromCharCode(a);
  7200. if (options.toRegex && (val >= 0 || !options.isNumber)) {
  7201. zero.greater.push(val);
  7202. } else {
  7203. zero.lesser.push(Math.abs(val));
  7204. }
  7205. if (options.isPadded) {
  7206. val = zeros(val, options);
  7207. }
  7208. if (options.toString) {
  7209. val = String(val);
  7210. }
  7211. if (typeof options.transform === 'function') {
  7212. arr[idx++] = options.transform(val, a, b, step, idx, arr, options);
  7213. } else {
  7214. arr[idx++] = val;
  7215. }
  7216. if (asc) {
  7217. a += step;
  7218. } else {
  7219. a -= step;
  7220. }
  7221. }
  7222. if (options.toRegex === true) {
  7223. return toSequence(arr, zero, options);
  7224. }
  7225. return arr;
  7226. }
  7227. function toRange(a, b, start, stop, options) {
  7228. if (options.isPadded) {
  7229. return toRegex(start, stop, options);
  7230. }
  7231. if (options.isNumber) {
  7232. return toRegex(Math.min(a, b), Math.max(a, b), options);
  7233. }
  7234. var start = String.fromCharCode(Math.min(a, b));
  7235. var stop = String.fromCharCode(Math.max(a, b));
  7236. return '[' + start + '-' + stop + ']';
  7237. }
  7238. function toSequence(arr, zeros, options) {
  7239. var greater = '',
  7240. lesser = '';
  7241. if (zeros.greater.length) {
  7242. greater = zeros.greater.join('|');
  7243. }
  7244. if (zeros.lesser.length) {
  7245. lesser = '-(' + zeros.lesser.join('|') + ')';
  7246. }
  7247. var res = greater && lesser ? greater + '|' + lesser : greater || lesser;
  7248. if (options.capture) {
  7249. return '(' + res + ')';
  7250. }
  7251. return res;
  7252. }
  7253. function zeros(val, options) {
  7254. if (options.isPadded) {
  7255. var str = String(val);
  7256. var len = str.length;
  7257. var dash = '';
  7258. if (str.charAt(0) === '-') {
  7259. dash = '-';
  7260. str = str.slice(1);
  7261. }
  7262. var diff = options.maxLength - len;
  7263. var pad = repeat('0', diff);
  7264. val = dash + pad + str;
  7265. }
  7266. if (options.stringify) {
  7267. return String(val);
  7268. }
  7269. return val;
  7270. }
  7271. function toNumber(val) {
  7272. return Number(val) || 0;
  7273. }
  7274. function isPadded(str) {
  7275. return /^-?0\d/.test(str);
  7276. }
  7277. function isValid(min, max) {
  7278. return (isValidNumber(min) || isValidLetter(min)) && (isValidNumber(max) || isValidLetter(max));
  7279. }
  7280. function isValidLetter(ch) {
  7281. return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch);
  7282. }
  7283. function isValidNumber(n) {
  7284. return isNumber(n) && !/\./.test(n);
  7285. }
  7286. /**
  7287. * Expose `fillRange`
  7288. * @type {Function}
  7289. */
  7290. module.exports = fillRange;
  7291. /***/ }),
  7292. /***/ "./node_modules/for-in/index.js":
  7293. /*!**************************************!*\
  7294. !*** ./node_modules/for-in/index.js ***!
  7295. \**************************************/
  7296. /*! no static exports found */
  7297. /***/ (function(module, exports, __webpack_require__) {
  7298. "use strict";
  7299. /*!
  7300. * for-in <https://github.com/jonschlinkert/for-in>
  7301. *
  7302. * Copyright (c) 2014-2017, Jon Schlinkert.
  7303. * Released under the MIT License.
  7304. */
  7305. module.exports = function forIn(obj, fn, thisArg) {
  7306. for (var key in obj) {
  7307. if (fn.call(thisArg, obj[key], key, obj) === false) {
  7308. break;
  7309. }
  7310. }
  7311. };
  7312. /***/ }),
  7313. /***/ "./node_modules/fragment-cache/index.js":
  7314. /*!**********************************************!*\
  7315. !*** ./node_modules/fragment-cache/index.js ***!
  7316. \**********************************************/
  7317. /*! no static exports found */
  7318. /***/ (function(module, exports, __webpack_require__) {
  7319. "use strict";
  7320. /*!
  7321. * fragment-cache <https://github.com/jonschlinkert/fragment-cache>
  7322. *
  7323. * Copyright (c) 2016-2017, Jon Schlinkert.
  7324. * Released under the MIT License.
  7325. */
  7326. var MapCache = __webpack_require__(/*! map-cache */ "./node_modules/map-cache/index.js");
  7327. /**
  7328. * Create a new `FragmentCache` with an optional object to use for `caches`.
  7329. *
  7330. * ```js
  7331. * var fragment = new FragmentCache();
  7332. * ```
  7333. * @name FragmentCache
  7334. * @param {String} `cacheName`
  7335. * @return {Object} Returns the [map-cache][] instance.
  7336. * @api public
  7337. */
  7338. function FragmentCache(caches) {
  7339. this.caches = caches || {};
  7340. }
  7341. /**
  7342. * Prototype
  7343. */
  7344. FragmentCache.prototype = {
  7345. /**
  7346. * Get cache `name` from the `fragment.caches` object. Creates a new
  7347. * `MapCache` if it doesn't already exist.
  7348. *
  7349. * ```js
  7350. * var cache = fragment.cache('files');
  7351. * console.log(fragment.caches.hasOwnProperty('files'));
  7352. * //=> true
  7353. * ```
  7354. * @name .cache
  7355. * @param {String} `cacheName`
  7356. * @return {Object} Returns the [map-cache][] instance.
  7357. * @api public
  7358. */
  7359. cache: function cache(cacheName) {
  7360. return this.caches[cacheName] || (this.caches[cacheName] = new MapCache());
  7361. },
  7362. /**
  7363. * Set a value for property `key` on cache `name`
  7364. *
  7365. * ```js
  7366. * fragment.set('files', 'somefile.js', new File({path: 'somefile.js'}));
  7367. * ```
  7368. * @name .set
  7369. * @param {String} `name`
  7370. * @param {String} `key` Property name to set
  7371. * @param {any} `val` The value of `key`
  7372. * @return {Object} The cache instance for chaining
  7373. * @api public
  7374. */
  7375. set: function set(cacheName, key, val) {
  7376. var cache = this.cache(cacheName);
  7377. cache.set(key, val);
  7378. return cache;
  7379. },
  7380. /**
  7381. * Returns true if a non-undefined value is set for `key` on fragment cache `name`.
  7382. *
  7383. * ```js
  7384. * var cache = fragment.cache('files');
  7385. * cache.set('somefile.js');
  7386. *
  7387. * console.log(cache.has('somefile.js'));
  7388. * //=> true
  7389. *
  7390. * console.log(cache.has('some-other-file.js'));
  7391. * //=> false
  7392. * ```
  7393. * @name .has
  7394. * @param {String} `name` Cache name
  7395. * @param {String} `key` Optionally specify a property to check for on cache `name`
  7396. * @return {Boolean}
  7397. * @api public
  7398. */
  7399. has: function has(cacheName, key) {
  7400. return typeof this.get(cacheName, key) !== 'undefined';
  7401. },
  7402. /**
  7403. * Get `name`, or if specified, the value of `key`. Invokes the [cache]() method,
  7404. * so that cache `name` will be created it doesn't already exist. If `key` is not passed,
  7405. * the entire cache (`name`) is returned.
  7406. *
  7407. * ```js
  7408. * var Vinyl = require('vinyl');
  7409. * var cache = fragment.cache('files');
  7410. * cache.set('somefile.js', new Vinyl({path: 'somefile.js'}));
  7411. * console.log(cache.get('somefile.js'));
  7412. * //=> <File "somefile.js">
  7413. * ```
  7414. * @name .get
  7415. * @param {String} `name`
  7416. * @return {Object} Returns cache `name`, or the value of `key` if specified
  7417. * @api public
  7418. */
  7419. get: function get(name, key) {
  7420. var cache = this.cache(name);
  7421. if (typeof key === 'string') {
  7422. return cache.get(key);
  7423. }
  7424. return cache;
  7425. }
  7426. };
  7427. /**
  7428. * Expose `FragmentCache`
  7429. */
  7430. exports = module.exports = FragmentCache;
  7431. /***/ }),
  7432. /***/ "./node_modules/get-value/index.js":
  7433. /*!*****************************************!*\
  7434. !*** ./node_modules/get-value/index.js ***!
  7435. \*****************************************/
  7436. /*! no static exports found */
  7437. /***/ (function(module, exports, __webpack_require__) {
  7438. "use strict";
  7439. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7440. /*!
  7441. * get-value <https://github.com/jonschlinkert/get-value>
  7442. *
  7443. * Copyright (c) 2014-2015, Jon Schlinkert.
  7444. * Licensed under the MIT License.
  7445. */
  7446. module.exports = function (obj, prop, a, b, c) {
  7447. if (!isObject(obj) || !prop) {
  7448. return obj;
  7449. }
  7450. prop = toString(prop); // allowing for multiple properties to be passed as
  7451. // a string or array, but much faster (3-4x) than doing
  7452. // `[].slice.call(arguments)`
  7453. if (a) prop += '.' + toString(a);
  7454. if (b) prop += '.' + toString(b);
  7455. if (c) prop += '.' + toString(c);
  7456. if (prop in obj) {
  7457. return obj[prop];
  7458. }
  7459. var segs = prop.split('.');
  7460. var len = segs.length;
  7461. var i = -1;
  7462. while (obj && ++i < len) {
  7463. var key = segs[i];
  7464. while (key[key.length - 1] === '\\') {
  7465. key = key.slice(0, -1) + '.' + segs[++i];
  7466. }
  7467. obj = obj[key];
  7468. }
  7469. return obj;
  7470. };
  7471. function isObject(val) {
  7472. return val !== null && (_typeof(val) === 'object' || typeof val === 'function');
  7473. }
  7474. function toString(val) {
  7475. if (!val) return '';
  7476. if (Array.isArray(val)) {
  7477. return val.join('.');
  7478. }
  7479. return val;
  7480. }
  7481. /***/ }),
  7482. /***/ "./node_modules/has-value/index.js":
  7483. /*!*****************************************!*\
  7484. !*** ./node_modules/has-value/index.js ***!
  7485. \*****************************************/
  7486. /*! no static exports found */
  7487. /***/ (function(module, exports, __webpack_require__) {
  7488. "use strict";
  7489. /*!
  7490. * has-value <https://github.com/jonschlinkert/has-value>
  7491. *
  7492. * Copyright (c) 2014-2017, Jon Schlinkert.
  7493. * Licensed under the MIT License.
  7494. */
  7495. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  7496. var hasValues = __webpack_require__(/*! has-values */ "./node_modules/has-values/index.js");
  7497. var get = __webpack_require__(/*! get-value */ "./node_modules/get-value/index.js");
  7498. module.exports = function (val, prop) {
  7499. return hasValues(isObject(val) && prop ? get(val, prop) : val);
  7500. };
  7501. /***/ }),
  7502. /***/ "./node_modules/has-values/index.js":
  7503. /*!******************************************!*\
  7504. !*** ./node_modules/has-values/index.js ***!
  7505. \******************************************/
  7506. /*! no static exports found */
  7507. /***/ (function(module, exports, __webpack_require__) {
  7508. "use strict";
  7509. /*!
  7510. * has-values <https://github.com/jonschlinkert/has-values>
  7511. *
  7512. * Copyright (c) 2014-2015, 2017, Jon Schlinkert.
  7513. * Released under the MIT License.
  7514. */
  7515. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/has-values/node_modules/kind-of/index.js");
  7516. var isNumber = __webpack_require__(/*! is-number */ "./node_modules/is-number/index.js");
  7517. module.exports = function hasValue(val) {
  7518. // is-number checks for NaN and other edge cases
  7519. if (isNumber(val)) {
  7520. return true;
  7521. }
  7522. switch (typeOf(val)) {
  7523. case 'null':
  7524. case 'boolean':
  7525. case 'function':
  7526. return true;
  7527. case 'string':
  7528. case 'arguments':
  7529. return val.length !== 0;
  7530. case 'error':
  7531. return val.message !== '';
  7532. case 'array':
  7533. var len = val.length;
  7534. if (len === 0) {
  7535. return false;
  7536. }
  7537. for (var i = 0; i < len; i++) {
  7538. if (hasValue(val[i])) {
  7539. return true;
  7540. }
  7541. }
  7542. return false;
  7543. case 'file':
  7544. case 'map':
  7545. case 'set':
  7546. return val.size !== 0;
  7547. case 'object':
  7548. var keys = Object.keys(val);
  7549. if (keys.length === 0) {
  7550. return false;
  7551. }
  7552. for (var i = 0; i < keys.length; i++) {
  7553. var key = keys[i];
  7554. if (hasValue(val[key])) {
  7555. return true;
  7556. }
  7557. }
  7558. return false;
  7559. default:
  7560. {
  7561. return false;
  7562. }
  7563. }
  7564. };
  7565. /***/ }),
  7566. /***/ "./node_modules/has-values/node_modules/kind-of/index.js":
  7567. /*!***************************************************************!*\
  7568. !*** ./node_modules/has-values/node_modules/kind-of/index.js ***!
  7569. \***************************************************************/
  7570. /*! no static exports found */
  7571. /***/ (function(module, exports, __webpack_require__) {
  7572. "use strict";
  7573. var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/is-buffer/index.js");
  7574. var toString = Object.prototype.toString;
  7575. /**
  7576. * Get the native `typeof` a value.
  7577. *
  7578. * @param {*} `val`
  7579. * @return {*} Native javascript type
  7580. */
  7581. module.exports = function kindOf(val) {
  7582. // primitivies
  7583. if (typeof val === 'undefined') {
  7584. return 'undefined';
  7585. }
  7586. if (val === null) {
  7587. return 'null';
  7588. }
  7589. if (val === true || val === false || val instanceof Boolean) {
  7590. return 'boolean';
  7591. }
  7592. if (typeof val === 'string' || val instanceof String) {
  7593. return 'string';
  7594. }
  7595. if (typeof val === 'number' || val instanceof Number) {
  7596. return 'number';
  7597. } // functions
  7598. if (typeof val === 'function' || val instanceof Function) {
  7599. return 'function';
  7600. } // array
  7601. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  7602. return 'array';
  7603. } // check for instances of RegExp and Date before calling `toString`
  7604. if (val instanceof RegExp) {
  7605. return 'regexp';
  7606. }
  7607. if (val instanceof Date) {
  7608. return 'date';
  7609. } // other objects
  7610. var type = toString.call(val);
  7611. if (type === '[object RegExp]') {
  7612. return 'regexp';
  7613. }
  7614. if (type === '[object Date]') {
  7615. return 'date';
  7616. }
  7617. if (type === '[object Arguments]') {
  7618. return 'arguments';
  7619. }
  7620. if (type === '[object Error]') {
  7621. return 'error';
  7622. }
  7623. if (type === '[object Promise]') {
  7624. return 'promise';
  7625. } // buffer
  7626. if (isBuffer(val)) {
  7627. return 'buffer';
  7628. } // es6: Map, WeakMap, Set, WeakSet
  7629. if (type === '[object Set]') {
  7630. return 'set';
  7631. }
  7632. if (type === '[object WeakSet]') {
  7633. return 'weakset';
  7634. }
  7635. if (type === '[object Map]') {
  7636. return 'map';
  7637. }
  7638. if (type === '[object WeakMap]') {
  7639. return 'weakmap';
  7640. }
  7641. if (type === '[object Symbol]') {
  7642. return 'symbol';
  7643. } // typed arrays
  7644. if (type === '[object Int8Array]') {
  7645. return 'int8array';
  7646. }
  7647. if (type === '[object Uint8Array]') {
  7648. return 'uint8array';
  7649. }
  7650. if (type === '[object Uint8ClampedArray]') {
  7651. return 'uint8clampedarray';
  7652. }
  7653. if (type === '[object Int16Array]') {
  7654. return 'int16array';
  7655. }
  7656. if (type === '[object Uint16Array]') {
  7657. return 'uint16array';
  7658. }
  7659. if (type === '[object Int32Array]') {
  7660. return 'int32array';
  7661. }
  7662. if (type === '[object Uint32Array]') {
  7663. return 'uint32array';
  7664. }
  7665. if (type === '[object Float32Array]') {
  7666. return 'float32array';
  7667. }
  7668. if (type === '[object Float64Array]') {
  7669. return 'float64array';
  7670. } // must be a plain object
  7671. return 'object';
  7672. };
  7673. /***/ }),
  7674. /***/ "./node_modules/is-accessor-descriptor/index.js":
  7675. /*!******************************************************!*\
  7676. !*** ./node_modules/is-accessor-descriptor/index.js ***!
  7677. \******************************************************/
  7678. /*! no static exports found */
  7679. /***/ (function(module, exports, __webpack_require__) {
  7680. "use strict";
  7681. /*!
  7682. * is-accessor-descriptor <https://github.com/jonschlinkert/is-accessor-descriptor>
  7683. *
  7684. * Copyright (c) 2015-2017, Jon Schlinkert.
  7685. * Released under the MIT License.
  7686. */
  7687. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/is-accessor-descriptor/node_modules/kind-of/index.js"); // accessor descriptor properties
  7688. var accessor = {
  7689. get: 'function',
  7690. set: 'function',
  7691. configurable: 'boolean',
  7692. enumerable: 'boolean'
  7693. };
  7694. function isAccessorDescriptor(obj, prop) {
  7695. if (typeof prop === 'string') {
  7696. var val = Object.getOwnPropertyDescriptor(obj, prop);
  7697. return typeof val !== 'undefined';
  7698. }
  7699. if (typeOf(obj) !== 'object') {
  7700. return false;
  7701. }
  7702. if (has(obj, 'value') || has(obj, 'writable')) {
  7703. return false;
  7704. }
  7705. if (!has(obj, 'get') || typeof obj.get !== 'function') {
  7706. return false;
  7707. } // tldr: it's valid to have "set" be undefined
  7708. // "set" might be undefined if `Object.getOwnPropertyDescriptor`
  7709. // was used to get the value, and only `get` was defined by the user
  7710. if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') {
  7711. return false;
  7712. }
  7713. for (var key in obj) {
  7714. if (!accessor.hasOwnProperty(key)) {
  7715. continue;
  7716. }
  7717. if (typeOf(obj[key]) === accessor[key]) {
  7718. continue;
  7719. }
  7720. if (typeof obj[key] !== 'undefined') {
  7721. return false;
  7722. }
  7723. }
  7724. return true;
  7725. }
  7726. function has(obj, key) {
  7727. return {}.hasOwnProperty.call(obj, key);
  7728. }
  7729. /**
  7730. * Expose `isAccessorDescriptor`
  7731. */
  7732. module.exports = isAccessorDescriptor;
  7733. /***/ }),
  7734. /***/ "./node_modules/is-accessor-descriptor/node_modules/kind-of/index.js":
  7735. /*!***************************************************************************!*\
  7736. !*** ./node_modules/is-accessor-descriptor/node_modules/kind-of/index.js ***!
  7737. \***************************************************************************/
  7738. /*! no static exports found */
  7739. /***/ (function(module, exports, __webpack_require__) {
  7740. "use strict";
  7741. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7742. var toString = Object.prototype.toString;
  7743. module.exports = function kindOf(val) {
  7744. if (val === void 0) return 'undefined';
  7745. if (val === null) return 'null';
  7746. var type = _typeof(val);
  7747. if (type === 'boolean') return 'boolean';
  7748. if (type === 'string') return 'string';
  7749. if (type === 'number') return 'number';
  7750. if (type === 'symbol') return 'symbol';
  7751. if (type === 'function') {
  7752. return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  7753. }
  7754. if (isArray(val)) return 'array';
  7755. if (isBuffer(val)) return 'buffer';
  7756. if (isArguments(val)) return 'arguments';
  7757. if (isDate(val)) return 'date';
  7758. if (isError(val)) return 'error';
  7759. if (isRegexp(val)) return 'regexp';
  7760. switch (ctorName(val)) {
  7761. case 'Symbol':
  7762. return 'symbol';
  7763. case 'Promise':
  7764. return 'promise';
  7765. // Set, Map, WeakSet, WeakMap
  7766. case 'WeakMap':
  7767. return 'weakmap';
  7768. case 'WeakSet':
  7769. return 'weakset';
  7770. case 'Map':
  7771. return 'map';
  7772. case 'Set':
  7773. return 'set';
  7774. // 8-bit typed arrays
  7775. case 'Int8Array':
  7776. return 'int8array';
  7777. case 'Uint8Array':
  7778. return 'uint8array';
  7779. case 'Uint8ClampedArray':
  7780. return 'uint8clampedarray';
  7781. // 16-bit typed arrays
  7782. case 'Int16Array':
  7783. return 'int16array';
  7784. case 'Uint16Array':
  7785. return 'uint16array';
  7786. // 32-bit typed arrays
  7787. case 'Int32Array':
  7788. return 'int32array';
  7789. case 'Uint32Array':
  7790. return 'uint32array';
  7791. case 'Float32Array':
  7792. return 'float32array';
  7793. case 'Float64Array':
  7794. return 'float64array';
  7795. }
  7796. if (isGeneratorObj(val)) {
  7797. return 'generator';
  7798. } // Non-plain objects
  7799. type = toString.call(val);
  7800. switch (type) {
  7801. case '[object Object]':
  7802. return 'object';
  7803. // iterators
  7804. case '[object Map Iterator]':
  7805. return 'mapiterator';
  7806. case '[object Set Iterator]':
  7807. return 'setiterator';
  7808. case '[object String Iterator]':
  7809. return 'stringiterator';
  7810. case '[object Array Iterator]':
  7811. return 'arrayiterator';
  7812. } // other
  7813. return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
  7814. };
  7815. function ctorName(val) {
  7816. return val.constructor ? val.constructor.name : null;
  7817. }
  7818. function isArray(val) {
  7819. if (Array.isArray) return Array.isArray(val);
  7820. return val instanceof Array;
  7821. }
  7822. function isError(val) {
  7823. return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
  7824. }
  7825. function isDate(val) {
  7826. if (val instanceof Date) return true;
  7827. return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
  7828. }
  7829. function isRegexp(val) {
  7830. if (val instanceof RegExp) return true;
  7831. return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
  7832. }
  7833. function isGeneratorFn(name, val) {
  7834. return ctorName(name) === 'GeneratorFunction';
  7835. }
  7836. function isGeneratorObj(val) {
  7837. return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
  7838. }
  7839. function isArguments(val) {
  7840. try {
  7841. if (typeof val.length === 'number' && typeof val.callee === 'function') {
  7842. return true;
  7843. }
  7844. } catch (err) {
  7845. if (err.message.indexOf('callee') !== -1) {
  7846. return true;
  7847. }
  7848. }
  7849. return false;
  7850. }
  7851. /**
  7852. * If you need to support Safari 5-7 (8-10 yr-old browser),
  7853. * take a look at https://github.com/feross/is-buffer
  7854. */
  7855. function isBuffer(val) {
  7856. if (val.constructor && typeof val.constructor.isBuffer === 'function') {
  7857. return val.constructor.isBuffer(val);
  7858. }
  7859. return false;
  7860. }
  7861. /***/ }),
  7862. /***/ "./node_modules/is-buffer/index.js":
  7863. /*!*****************************************!*\
  7864. !*** ./node_modules/is-buffer/index.js ***!
  7865. \*****************************************/
  7866. /*! no static exports found */
  7867. /***/ (function(module, exports, __webpack_require__) {
  7868. "use strict";
  7869. /*!
  7870. * Determine if an object is a Buffer
  7871. *
  7872. * @author Feross Aboukhadijeh <https://feross.org>
  7873. * @license MIT
  7874. */
  7875. // The _isBuffer check is for Safari 5-7 support, because it's missing
  7876. // Object.prototype.constructor. Remove this eventually
  7877. module.exports = function (obj) {
  7878. return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
  7879. };
  7880. function isBuffer(obj) {
  7881. return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
  7882. } // For Node v0.10 support. Remove this eventually.
  7883. function isSlowBuffer(obj) {
  7884. return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0));
  7885. }
  7886. /***/ }),
  7887. /***/ "./node_modules/is-data-descriptor/index.js":
  7888. /*!**************************************************!*\
  7889. !*** ./node_modules/is-data-descriptor/index.js ***!
  7890. \**************************************************/
  7891. /*! no static exports found */
  7892. /***/ (function(module, exports, __webpack_require__) {
  7893. "use strict";
  7894. /*!
  7895. * is-data-descriptor <https://github.com/jonschlinkert/is-data-descriptor>
  7896. *
  7897. * Copyright (c) 2015-2017, Jon Schlinkert.
  7898. * Released under the MIT License.
  7899. */
  7900. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/is-data-descriptor/node_modules/kind-of/index.js");
  7901. module.exports = function isDataDescriptor(obj, prop) {
  7902. // data descriptor properties
  7903. var data = {
  7904. configurable: 'boolean',
  7905. enumerable: 'boolean',
  7906. writable: 'boolean'
  7907. };
  7908. if (typeOf(obj) !== 'object') {
  7909. return false;
  7910. }
  7911. if (typeof prop === 'string') {
  7912. var val = Object.getOwnPropertyDescriptor(obj, prop);
  7913. return typeof val !== 'undefined';
  7914. }
  7915. if (!('value' in obj) && !('writable' in obj)) {
  7916. return false;
  7917. }
  7918. for (var key in obj) {
  7919. if (key === 'value') continue;
  7920. if (!data.hasOwnProperty(key)) {
  7921. continue;
  7922. }
  7923. if (typeOf(obj[key]) === data[key]) {
  7924. continue;
  7925. }
  7926. if (typeof obj[key] !== 'undefined') {
  7927. return false;
  7928. }
  7929. }
  7930. return true;
  7931. };
  7932. /***/ }),
  7933. /***/ "./node_modules/is-data-descriptor/node_modules/kind-of/index.js":
  7934. /*!***********************************************************************!*\
  7935. !*** ./node_modules/is-data-descriptor/node_modules/kind-of/index.js ***!
  7936. \***********************************************************************/
  7937. /*! no static exports found */
  7938. /***/ (function(module, exports, __webpack_require__) {
  7939. "use strict";
  7940. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7941. var toString = Object.prototype.toString;
  7942. module.exports = function kindOf(val) {
  7943. if (val === void 0) return 'undefined';
  7944. if (val === null) return 'null';
  7945. var type = _typeof(val);
  7946. if (type === 'boolean') return 'boolean';
  7947. if (type === 'string') return 'string';
  7948. if (type === 'number') return 'number';
  7949. if (type === 'symbol') return 'symbol';
  7950. if (type === 'function') {
  7951. return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  7952. }
  7953. if (isArray(val)) return 'array';
  7954. if (isBuffer(val)) return 'buffer';
  7955. if (isArguments(val)) return 'arguments';
  7956. if (isDate(val)) return 'date';
  7957. if (isError(val)) return 'error';
  7958. if (isRegexp(val)) return 'regexp';
  7959. switch (ctorName(val)) {
  7960. case 'Symbol':
  7961. return 'symbol';
  7962. case 'Promise':
  7963. return 'promise';
  7964. // Set, Map, WeakSet, WeakMap
  7965. case 'WeakMap':
  7966. return 'weakmap';
  7967. case 'WeakSet':
  7968. return 'weakset';
  7969. case 'Map':
  7970. return 'map';
  7971. case 'Set':
  7972. return 'set';
  7973. // 8-bit typed arrays
  7974. case 'Int8Array':
  7975. return 'int8array';
  7976. case 'Uint8Array':
  7977. return 'uint8array';
  7978. case 'Uint8ClampedArray':
  7979. return 'uint8clampedarray';
  7980. // 16-bit typed arrays
  7981. case 'Int16Array':
  7982. return 'int16array';
  7983. case 'Uint16Array':
  7984. return 'uint16array';
  7985. // 32-bit typed arrays
  7986. case 'Int32Array':
  7987. return 'int32array';
  7988. case 'Uint32Array':
  7989. return 'uint32array';
  7990. case 'Float32Array':
  7991. return 'float32array';
  7992. case 'Float64Array':
  7993. return 'float64array';
  7994. }
  7995. if (isGeneratorObj(val)) {
  7996. return 'generator';
  7997. } // Non-plain objects
  7998. type = toString.call(val);
  7999. switch (type) {
  8000. case '[object Object]':
  8001. return 'object';
  8002. // iterators
  8003. case '[object Map Iterator]':
  8004. return 'mapiterator';
  8005. case '[object Set Iterator]':
  8006. return 'setiterator';
  8007. case '[object String Iterator]':
  8008. return 'stringiterator';
  8009. case '[object Array Iterator]':
  8010. return 'arrayiterator';
  8011. } // other
  8012. return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
  8013. };
  8014. function ctorName(val) {
  8015. return val.constructor ? val.constructor.name : null;
  8016. }
  8017. function isArray(val) {
  8018. if (Array.isArray) return Array.isArray(val);
  8019. return val instanceof Array;
  8020. }
  8021. function isError(val) {
  8022. return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
  8023. }
  8024. function isDate(val) {
  8025. if (val instanceof Date) return true;
  8026. return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
  8027. }
  8028. function isRegexp(val) {
  8029. if (val instanceof RegExp) return true;
  8030. return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
  8031. }
  8032. function isGeneratorFn(name, val) {
  8033. return ctorName(name) === 'GeneratorFunction';
  8034. }
  8035. function isGeneratorObj(val) {
  8036. return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
  8037. }
  8038. function isArguments(val) {
  8039. try {
  8040. if (typeof val.length === 'number' && typeof val.callee === 'function') {
  8041. return true;
  8042. }
  8043. } catch (err) {
  8044. if (err.message.indexOf('callee') !== -1) {
  8045. return true;
  8046. }
  8047. }
  8048. return false;
  8049. }
  8050. /**
  8051. * If you need to support Safari 5-7 (8-10 yr-old browser),
  8052. * take a look at https://github.com/feross/is-buffer
  8053. */
  8054. function isBuffer(val) {
  8055. if (val.constructor && typeof val.constructor.isBuffer === 'function') {
  8056. return val.constructor.isBuffer(val);
  8057. }
  8058. return false;
  8059. }
  8060. /***/ }),
  8061. /***/ "./node_modules/is-descriptor/index.js":
  8062. /*!*********************************************!*\
  8063. !*** ./node_modules/is-descriptor/index.js ***!
  8064. \*********************************************/
  8065. /*! no static exports found */
  8066. /***/ (function(module, exports, __webpack_require__) {
  8067. "use strict";
  8068. /*!
  8069. * is-descriptor <https://github.com/jonschlinkert/is-descriptor>
  8070. *
  8071. * Copyright (c) 2015-2017, Jon Schlinkert.
  8072. * Released under the MIT License.
  8073. */
  8074. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/is-descriptor/node_modules/kind-of/index.js");
  8075. var isAccessor = __webpack_require__(/*! is-accessor-descriptor */ "./node_modules/is-accessor-descriptor/index.js");
  8076. var isData = __webpack_require__(/*! is-data-descriptor */ "./node_modules/is-data-descriptor/index.js");
  8077. module.exports = function isDescriptor(obj, key) {
  8078. if (typeOf(obj) !== 'object') {
  8079. return false;
  8080. }
  8081. if ('get' in obj) {
  8082. return isAccessor(obj, key);
  8083. }
  8084. return isData(obj, key);
  8085. };
  8086. /***/ }),
  8087. /***/ "./node_modules/is-descriptor/node_modules/kind-of/index.js":
  8088. /*!******************************************************************!*\
  8089. !*** ./node_modules/is-descriptor/node_modules/kind-of/index.js ***!
  8090. \******************************************************************/
  8091. /*! no static exports found */
  8092. /***/ (function(module, exports, __webpack_require__) {
  8093. "use strict";
  8094. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8095. var toString = Object.prototype.toString;
  8096. module.exports = function kindOf(val) {
  8097. if (val === void 0) return 'undefined';
  8098. if (val === null) return 'null';
  8099. var type = _typeof(val);
  8100. if (type === 'boolean') return 'boolean';
  8101. if (type === 'string') return 'string';
  8102. if (type === 'number') return 'number';
  8103. if (type === 'symbol') return 'symbol';
  8104. if (type === 'function') {
  8105. return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  8106. }
  8107. if (isArray(val)) return 'array';
  8108. if (isBuffer(val)) return 'buffer';
  8109. if (isArguments(val)) return 'arguments';
  8110. if (isDate(val)) return 'date';
  8111. if (isError(val)) return 'error';
  8112. if (isRegexp(val)) return 'regexp';
  8113. switch (ctorName(val)) {
  8114. case 'Symbol':
  8115. return 'symbol';
  8116. case 'Promise':
  8117. return 'promise';
  8118. // Set, Map, WeakSet, WeakMap
  8119. case 'WeakMap':
  8120. return 'weakmap';
  8121. case 'WeakSet':
  8122. return 'weakset';
  8123. case 'Map':
  8124. return 'map';
  8125. case 'Set':
  8126. return 'set';
  8127. // 8-bit typed arrays
  8128. case 'Int8Array':
  8129. return 'int8array';
  8130. case 'Uint8Array':
  8131. return 'uint8array';
  8132. case 'Uint8ClampedArray':
  8133. return 'uint8clampedarray';
  8134. // 16-bit typed arrays
  8135. case 'Int16Array':
  8136. return 'int16array';
  8137. case 'Uint16Array':
  8138. return 'uint16array';
  8139. // 32-bit typed arrays
  8140. case 'Int32Array':
  8141. return 'int32array';
  8142. case 'Uint32Array':
  8143. return 'uint32array';
  8144. case 'Float32Array':
  8145. return 'float32array';
  8146. case 'Float64Array':
  8147. return 'float64array';
  8148. }
  8149. if (isGeneratorObj(val)) {
  8150. return 'generator';
  8151. } // Non-plain objects
  8152. type = toString.call(val);
  8153. switch (type) {
  8154. case '[object Object]':
  8155. return 'object';
  8156. // iterators
  8157. case '[object Map Iterator]':
  8158. return 'mapiterator';
  8159. case '[object Set Iterator]':
  8160. return 'setiterator';
  8161. case '[object String Iterator]':
  8162. return 'stringiterator';
  8163. case '[object Array Iterator]':
  8164. return 'arrayiterator';
  8165. } // other
  8166. return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
  8167. };
  8168. function ctorName(val) {
  8169. return val.constructor ? val.constructor.name : null;
  8170. }
  8171. function isArray(val) {
  8172. if (Array.isArray) return Array.isArray(val);
  8173. return val instanceof Array;
  8174. }
  8175. function isError(val) {
  8176. return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
  8177. }
  8178. function isDate(val) {
  8179. if (val instanceof Date) return true;
  8180. return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
  8181. }
  8182. function isRegexp(val) {
  8183. if (val instanceof RegExp) return true;
  8184. return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
  8185. }
  8186. function isGeneratorFn(name, val) {
  8187. return ctorName(name) === 'GeneratorFunction';
  8188. }
  8189. function isGeneratorObj(val) {
  8190. return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
  8191. }
  8192. function isArguments(val) {
  8193. try {
  8194. if (typeof val.length === 'number' && typeof val.callee === 'function') {
  8195. return true;
  8196. }
  8197. } catch (err) {
  8198. if (err.message.indexOf('callee') !== -1) {
  8199. return true;
  8200. }
  8201. }
  8202. return false;
  8203. }
  8204. /**
  8205. * If you need to support Safari 5-7 (8-10 yr-old browser),
  8206. * take a look at https://github.com/feross/is-buffer
  8207. */
  8208. function isBuffer(val) {
  8209. if (val.constructor && typeof val.constructor.isBuffer === 'function') {
  8210. return val.constructor.isBuffer(val);
  8211. }
  8212. return false;
  8213. }
  8214. /***/ }),
  8215. /***/ "./node_modules/is-extendable/index.js":
  8216. /*!*********************************************!*\
  8217. !*** ./node_modules/is-extendable/index.js ***!
  8218. \*********************************************/
  8219. /*! no static exports found */
  8220. /***/ (function(module, exports, __webpack_require__) {
  8221. "use strict";
  8222. /*!
  8223. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  8224. *
  8225. * Copyright (c) 2015, Jon Schlinkert.
  8226. * Licensed under the MIT License.
  8227. */
  8228. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8229. module.exports = function isExtendable(val) {
  8230. return typeof val !== 'undefined' && val !== null && (_typeof(val) === 'object' || typeof val === 'function');
  8231. };
  8232. /***/ }),
  8233. /***/ "./node_modules/is-number/index.js":
  8234. /*!*****************************************!*\
  8235. !*** ./node_modules/is-number/index.js ***!
  8236. \*****************************************/
  8237. /*! no static exports found */
  8238. /***/ (function(module, exports, __webpack_require__) {
  8239. "use strict";
  8240. /*!
  8241. * is-number <https://github.com/jonschlinkert/is-number>
  8242. *
  8243. * Copyright (c) 2014-2015, Jon Schlinkert.
  8244. * Licensed under the MIT License.
  8245. */
  8246. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/kind-of/index.js");
  8247. module.exports = function isNumber(num) {
  8248. var type = typeOf(num);
  8249. if (type === 'string') {
  8250. if (!num.trim()) return false;
  8251. } else if (type !== 'number') {
  8252. return false;
  8253. }
  8254. return num - num + 1 >= 0;
  8255. };
  8256. /***/ }),
  8257. /***/ "./node_modules/is-plain-object/index.js":
  8258. /*!***********************************************!*\
  8259. !*** ./node_modules/is-plain-object/index.js ***!
  8260. \***********************************************/
  8261. /*! no static exports found */
  8262. /***/ (function(module, exports, __webpack_require__) {
  8263. "use strict";
  8264. /*!
  8265. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  8266. *
  8267. * Copyright (c) 2014-2017, Jon Schlinkert.
  8268. * Released under the MIT License.
  8269. */
  8270. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  8271. function isObjectObject(o) {
  8272. return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]';
  8273. }
  8274. module.exports = function isPlainObject(o) {
  8275. var ctor, prot;
  8276. if (isObjectObject(o) === false) return false; // If has modified constructor
  8277. ctor = o.constructor;
  8278. if (typeof ctor !== 'function') return false; // If has modified prototype
  8279. prot = ctor.prototype;
  8280. if (isObjectObject(prot) === false) return false; // If constructor does not have an Object-specific method
  8281. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  8282. return false;
  8283. } // Most likely a plain Object
  8284. return true;
  8285. };
  8286. /***/ }),
  8287. /***/ "./node_modules/is-windows/index.js":
  8288. /*!******************************************!*\
  8289. !*** ./node_modules/is-windows/index.js ***!
  8290. \******************************************/
  8291. /*! no static exports found */
  8292. /***/ (function(module, exports, __webpack_require__) {
  8293. "use strict";
  8294. /* WEBPACK VAR INJECTION */(function(process) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  8295. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8296. /*!
  8297. * is-windows <https://github.com/jonschlinkert/is-windows>
  8298. *
  8299. * Copyright © 2015-2018, Jon Schlinkert.
  8300. * Released under the MIT License.
  8301. */
  8302. (function (factory) {
  8303. if (exports && ( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined') {
  8304. module.exports = factory();
  8305. } else if (true) {
  8306. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  8307. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  8308. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  8309. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8310. } else {}
  8311. })(function () {
  8312. 'use strict';
  8313. return function isWindows() {
  8314. return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE));
  8315. };
  8316. });
  8317. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  8318. /***/ }),
  8319. /***/ "./node_modules/isarray/index.js":
  8320. /*!***************************************!*\
  8321. !*** ./node_modules/isarray/index.js ***!
  8322. \***************************************/
  8323. /*! no static exports found */
  8324. /***/ (function(module, exports, __webpack_require__) {
  8325. "use strict";
  8326. var toString = {}.toString;
  8327. module.exports = Array.isArray || function (arr) {
  8328. return toString.call(arr) == '[object Array]';
  8329. };
  8330. /***/ }),
  8331. /***/ "./node_modules/isobject/index.js":
  8332. /*!****************************************!*\
  8333. !*** ./node_modules/isobject/index.js ***!
  8334. \****************************************/
  8335. /*! no static exports found */
  8336. /***/ (function(module, exports, __webpack_require__) {
  8337. "use strict";
  8338. /*!
  8339. * isobject <https://github.com/jonschlinkert/isobject>
  8340. *
  8341. * Copyright (c) 2014-2017, Jon Schlinkert.
  8342. * Released under the MIT License.
  8343. */
  8344. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8345. module.exports = function isObject(val) {
  8346. return val != null && _typeof(val) === 'object' && Array.isArray(val) === false;
  8347. };
  8348. /***/ }),
  8349. /***/ "./node_modules/js-tokens/index.js":
  8350. /*!*****************************************!*\
  8351. !*** ./node_modules/js-tokens/index.js ***!
  8352. \*****************************************/
  8353. /*! no static exports found */
  8354. /***/ (function(module, exports, __webpack_require__) {
  8355. "use strict";
  8356. // Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
  8357. // License: MIT. (See LICENSE.)
  8358. Object.defineProperty(exports, "__esModule", {
  8359. value: true
  8360. }); // This regex comes from regex.coffee, and is inserted here by generate-index.js
  8361. // (run `npm run build`).
  8362. exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
  8363. exports.matchToToken = function (match) {
  8364. var token = {
  8365. type: "invalid",
  8366. value: match[0],
  8367. closed: undefined
  8368. };
  8369. if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace";
  8370. return token;
  8371. };
  8372. /***/ }),
  8373. /***/ "./node_modules/kind-of/index.js":
  8374. /*!***************************************!*\
  8375. !*** ./node_modules/kind-of/index.js ***!
  8376. \***************************************/
  8377. /*! no static exports found */
  8378. /***/ (function(module, exports, __webpack_require__) {
  8379. "use strict";
  8380. var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/is-buffer/index.js");
  8381. var toString = Object.prototype.toString;
  8382. /**
  8383. * Get the native `typeof` a value.
  8384. *
  8385. * @param {*} `val`
  8386. * @return {*} Native javascript type
  8387. */
  8388. module.exports = function kindOf(val) {
  8389. // primitivies
  8390. if (typeof val === 'undefined') {
  8391. return 'undefined';
  8392. }
  8393. if (val === null) {
  8394. return 'null';
  8395. }
  8396. if (val === true || val === false || val instanceof Boolean) {
  8397. return 'boolean';
  8398. }
  8399. if (typeof val === 'string' || val instanceof String) {
  8400. return 'string';
  8401. }
  8402. if (typeof val === 'number' || val instanceof Number) {
  8403. return 'number';
  8404. } // functions
  8405. if (typeof val === 'function' || val instanceof Function) {
  8406. return 'function';
  8407. } // array
  8408. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  8409. return 'array';
  8410. } // check for instances of RegExp and Date before calling `toString`
  8411. if (val instanceof RegExp) {
  8412. return 'regexp';
  8413. }
  8414. if (val instanceof Date) {
  8415. return 'date';
  8416. } // other objects
  8417. var type = toString.call(val);
  8418. if (type === '[object RegExp]') {
  8419. return 'regexp';
  8420. }
  8421. if (type === '[object Date]') {
  8422. return 'date';
  8423. }
  8424. if (type === '[object Arguments]') {
  8425. return 'arguments';
  8426. }
  8427. if (type === '[object Error]') {
  8428. return 'error';
  8429. } // buffer
  8430. if (isBuffer(val)) {
  8431. return 'buffer';
  8432. } // es6: Map, WeakMap, Set, WeakSet
  8433. if (type === '[object Set]') {
  8434. return 'set';
  8435. }
  8436. if (type === '[object WeakSet]') {
  8437. return 'weakset';
  8438. }
  8439. if (type === '[object Map]') {
  8440. return 'map';
  8441. }
  8442. if (type === '[object WeakMap]') {
  8443. return 'weakmap';
  8444. }
  8445. if (type === '[object Symbol]') {
  8446. return 'symbol';
  8447. } // typed arrays
  8448. if (type === '[object Int8Array]') {
  8449. return 'int8array';
  8450. }
  8451. if (type === '[object Uint8Array]') {
  8452. return 'uint8array';
  8453. }
  8454. if (type === '[object Uint8ClampedArray]') {
  8455. return 'uint8clampedarray';
  8456. }
  8457. if (type === '[object Int16Array]') {
  8458. return 'int16array';
  8459. }
  8460. if (type === '[object Uint16Array]') {
  8461. return 'uint16array';
  8462. }
  8463. if (type === '[object Int32Array]') {
  8464. return 'int32array';
  8465. }
  8466. if (type === '[object Uint32Array]') {
  8467. return 'uint32array';
  8468. }
  8469. if (type === '[object Float32Array]') {
  8470. return 'float32array';
  8471. }
  8472. if (type === '[object Float64Array]') {
  8473. return 'float64array';
  8474. } // must be a plain object
  8475. return 'object';
  8476. };
  8477. /***/ }),
  8478. /***/ "./node_modules/map-cache/index.js":
  8479. /*!*****************************************!*\
  8480. !*** ./node_modules/map-cache/index.js ***!
  8481. \*****************************************/
  8482. /*! no static exports found */
  8483. /***/ (function(module, exports, __webpack_require__) {
  8484. "use strict";
  8485. /*!
  8486. * map-cache <https://github.com/jonschlinkert/map-cache>
  8487. *
  8488. * Copyright (c) 2015, Jon Schlinkert.
  8489. * Licensed under the MIT License.
  8490. */
  8491. var hasOwn = Object.prototype.hasOwnProperty;
  8492. /**
  8493. * Expose `MapCache`
  8494. */
  8495. module.exports = MapCache;
  8496. /**
  8497. * Creates a cache object to store key/value pairs.
  8498. *
  8499. * ```js
  8500. * var cache = new MapCache();
  8501. * ```
  8502. *
  8503. * @api public
  8504. */
  8505. function MapCache(data) {
  8506. this.__data__ = data || {};
  8507. }
  8508. /**
  8509. * Adds `value` to `key` on the cache.
  8510. *
  8511. * ```js
  8512. * cache.set('foo', 'bar');
  8513. * ```
  8514. *
  8515. * @param {String} `key` The key of the value to cache.
  8516. * @param {*} `value` The value to cache.
  8517. * @returns {Object} Returns the `Cache` object for chaining.
  8518. * @api public
  8519. */
  8520. MapCache.prototype.set = function mapSet(key, value) {
  8521. if (key !== '__proto__') {
  8522. this.__data__[key] = value;
  8523. }
  8524. return this;
  8525. };
  8526. /**
  8527. * Gets the cached value for `key`.
  8528. *
  8529. * ```js
  8530. * cache.get('foo');
  8531. * //=> 'bar'
  8532. * ```
  8533. *
  8534. * @param {String} `key` The key of the value to get.
  8535. * @returns {*} Returns the cached value.
  8536. * @api public
  8537. */
  8538. MapCache.prototype.get = function mapGet(key) {
  8539. return key === '__proto__' ? undefined : this.__data__[key];
  8540. };
  8541. /**
  8542. * Checks if a cached value for `key` exists.
  8543. *
  8544. * ```js
  8545. * cache.has('foo');
  8546. * //=> true
  8547. * ```
  8548. *
  8549. * @param {String} `key` The key of the entry to check.
  8550. * @returns {Boolean} Returns `true` if an entry for `key` exists, else `false`.
  8551. * @api public
  8552. */
  8553. MapCache.prototype.has = function mapHas(key) {
  8554. return key !== '__proto__' && hasOwn.call(this.__data__, key);
  8555. };
  8556. /**
  8557. * Removes `key` and its value from the cache.
  8558. *
  8559. * ```js
  8560. * cache.del('foo');
  8561. * ```
  8562. * @title .del
  8563. * @param {String} `key` The key of the value to remove.
  8564. * @returns {Boolean} Returns `true` if the entry was removed successfully, else `false`.
  8565. * @api public
  8566. */
  8567. MapCache.prototype.del = function mapDelete(key) {
  8568. return this.has(key) && delete this.__data__[key];
  8569. };
  8570. /***/ }),
  8571. /***/ "./node_modules/map-visit/index.js":
  8572. /*!*****************************************!*\
  8573. !*** ./node_modules/map-visit/index.js ***!
  8574. \*****************************************/
  8575. /*! no static exports found */
  8576. /***/ (function(module, exports, __webpack_require__) {
  8577. "use strict";
  8578. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8579. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  8580. var visit = __webpack_require__(/*! object-visit */ "./node_modules/object-visit/index.js");
  8581. /**
  8582. * Map `visit` over an array of objects.
  8583. *
  8584. * @param {Object} `collection` The context in which to invoke `method`
  8585. * @param {String} `method` Name of the method to call on `collection`
  8586. * @param {Object} `arr` Array of objects.
  8587. */
  8588. module.exports = function mapVisit(collection, method, val) {
  8589. if (isObject(val)) {
  8590. return visit.apply(null, arguments);
  8591. }
  8592. if (!Array.isArray(val)) {
  8593. throw new TypeError('expected an array: ' + util.inspect(val));
  8594. }
  8595. var args = [].slice.call(arguments, 3);
  8596. for (var i = 0; i < val.length; i++) {
  8597. var ele = val[i];
  8598. if (isObject(ele)) {
  8599. visit.apply(null, [collection, method, ele].concat(args));
  8600. } else {
  8601. collection[method].apply(collection, [ele].concat(args));
  8602. }
  8603. }
  8604. };
  8605. function isObject(val) {
  8606. return val && (typeof val === 'function' || !Array.isArray(val) && _typeof(val) === 'object');
  8607. }
  8608. /***/ }),
  8609. /***/ "./node_modules/micromatch/index.js":
  8610. /*!******************************************!*\
  8611. !*** ./node_modules/micromatch/index.js ***!
  8612. \******************************************/
  8613. /*! no static exports found */
  8614. /***/ (function(module, exports, __webpack_require__) {
  8615. "use strict";
  8616. /**
  8617. * Module dependencies
  8618. */
  8619. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  8620. var braces = __webpack_require__(/*! braces */ "./node_modules/braces/index.js");
  8621. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  8622. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/micromatch/node_modules/extend-shallow/index.js");
  8623. /**
  8624. * Local dependencies
  8625. */
  8626. var compilers = __webpack_require__(/*! ./lib/compilers */ "./node_modules/micromatch/lib/compilers.js");
  8627. var parsers = __webpack_require__(/*! ./lib/parsers */ "./node_modules/micromatch/lib/parsers.js");
  8628. var cache = __webpack_require__(/*! ./lib/cache */ "./node_modules/micromatch/lib/cache.js");
  8629. var utils = __webpack_require__(/*! ./lib/utils */ "./node_modules/micromatch/lib/utils.js");
  8630. var MAX_LENGTH = 1024 * 64;
  8631. /**
  8632. * The main function takes a list of strings and one or more
  8633. * glob patterns to use for matching.
  8634. *
  8635. * ```js
  8636. * var mm = require('micromatch');
  8637. * mm(list, patterns[, options]);
  8638. *
  8639. * console.log(mm(['a.js', 'a.txt'], ['*.js']));
  8640. * //=> [ 'a.js' ]
  8641. * ```
  8642. * @param {Array} `list` A list of strings to match
  8643. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  8644. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8645. * @return {Array} Returns an array of matches
  8646. * @summary false
  8647. * @api public
  8648. */
  8649. function micromatch(list, patterns, options) {
  8650. patterns = utils.arrayify(patterns);
  8651. list = utils.arrayify(list);
  8652. var len = patterns.length;
  8653. if (list.length === 0 || len === 0) {
  8654. return [];
  8655. }
  8656. if (len === 1) {
  8657. return micromatch.match(list, patterns[0], options);
  8658. }
  8659. var omit = [];
  8660. var keep = [];
  8661. var idx = -1;
  8662. while (++idx < len) {
  8663. var pattern = patterns[idx];
  8664. if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33
  8665. /* ! */
  8666. ) {
  8667. omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options));
  8668. } else {
  8669. keep.push.apply(keep, micromatch.match(list, pattern, options));
  8670. }
  8671. }
  8672. var matches = utils.diff(keep, omit);
  8673. if (!options || options.nodupes !== false) {
  8674. return utils.unique(matches);
  8675. }
  8676. return matches;
  8677. }
  8678. /**
  8679. * Similar to the main function, but `pattern` must be a string.
  8680. *
  8681. * ```js
  8682. * var mm = require('micromatch');
  8683. * mm.match(list, pattern[, options]);
  8684. *
  8685. * console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a'));
  8686. * //=> ['a.a', 'a.aa']
  8687. * ```
  8688. * @param {Array} `list` Array of strings to match
  8689. * @param {String} `pattern` Glob pattern to use for matching.
  8690. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8691. * @return {Array} Returns an array of matches
  8692. * @api public
  8693. */
  8694. micromatch.match = function (list, pattern, options) {
  8695. if (Array.isArray(pattern)) {
  8696. throw new TypeError('expected pattern to be a string');
  8697. }
  8698. var unixify = utils.unixify(options);
  8699. var isMatch = memoize('match', pattern, options, micromatch.matcher);
  8700. var matches = [];
  8701. list = utils.arrayify(list);
  8702. var len = list.length;
  8703. var idx = -1;
  8704. while (++idx < len) {
  8705. var ele = list[idx];
  8706. if (ele === pattern || isMatch(ele)) {
  8707. matches.push(utils.value(ele, unixify, options));
  8708. }
  8709. } // if no options were passed, uniquify results and return
  8710. if (typeof options === 'undefined') {
  8711. return utils.unique(matches);
  8712. }
  8713. if (matches.length === 0) {
  8714. if (options.failglob === true) {
  8715. throw new Error('no matches found for "' + pattern + '"');
  8716. }
  8717. if (options.nonull === true || options.nullglob === true) {
  8718. return [options.unescape ? utils.unescape(pattern) : pattern];
  8719. }
  8720. } // if `opts.ignore` was defined, diff ignored list
  8721. if (options.ignore) {
  8722. matches = micromatch.not(matches, options.ignore, options);
  8723. }
  8724. return options.nodupes !== false ? utils.unique(matches) : matches;
  8725. };
  8726. /**
  8727. * Returns true if the specified `string` matches the given glob `pattern`.
  8728. *
  8729. * ```js
  8730. * var mm = require('micromatch');
  8731. * mm.isMatch(string, pattern[, options]);
  8732. *
  8733. * console.log(mm.isMatch('a.a', '*.a'));
  8734. * //=> true
  8735. * console.log(mm.isMatch('a.b', '*.a'));
  8736. * //=> false
  8737. * ```
  8738. * @param {String} `string` String to match
  8739. * @param {String} `pattern` Glob pattern to use for matching.
  8740. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8741. * @return {Boolean} Returns true if the string matches the glob pattern.
  8742. * @api public
  8743. */
  8744. micromatch.isMatch = function (str, pattern, options) {
  8745. if (typeof str !== 'string') {
  8746. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  8747. }
  8748. if (isEmptyString(str) || isEmptyString(pattern)) {
  8749. return false;
  8750. }
  8751. var equals = utils.equalsPattern(options);
  8752. if (equals(str)) {
  8753. return true;
  8754. }
  8755. var isMatch = memoize('isMatch', pattern, options, micromatch.matcher);
  8756. return isMatch(str);
  8757. };
  8758. /**
  8759. * Returns true if some of the strings in the given `list` match any of the
  8760. * given glob `patterns`.
  8761. *
  8762. * ```js
  8763. * var mm = require('micromatch');
  8764. * mm.some(list, patterns[, options]);
  8765. *
  8766. * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  8767. * // true
  8768. * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
  8769. * // false
  8770. * ```
  8771. * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
  8772. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  8773. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8774. * @return {Boolean} Returns true if any patterns match `str`
  8775. * @api public
  8776. */
  8777. micromatch.some = function (list, patterns, options) {
  8778. if (typeof list === 'string') {
  8779. list = [list];
  8780. }
  8781. for (var i = 0; i < list.length; i++) {
  8782. if (micromatch(list[i], patterns, options).length === 1) {
  8783. return true;
  8784. }
  8785. }
  8786. return false;
  8787. };
  8788. /**
  8789. * Returns true if every string in the given `list` matches
  8790. * any of the given glob `patterns`.
  8791. *
  8792. * ```js
  8793. * var mm = require('micromatch');
  8794. * mm.every(list, patterns[, options]);
  8795. *
  8796. * console.log(mm.every('foo.js', ['foo.js']));
  8797. * // true
  8798. * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
  8799. * // true
  8800. * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  8801. * // false
  8802. * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
  8803. * // false
  8804. * ```
  8805. * @param {String|Array} `list` The string or array of strings to test.
  8806. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  8807. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8808. * @return {Boolean} Returns true if any patterns match `str`
  8809. * @api public
  8810. */
  8811. micromatch.every = function (list, patterns, options) {
  8812. if (typeof list === 'string') {
  8813. list = [list];
  8814. }
  8815. for (var i = 0; i < list.length; i++) {
  8816. if (micromatch(list[i], patterns, options).length !== 1) {
  8817. return false;
  8818. }
  8819. }
  8820. return true;
  8821. };
  8822. /**
  8823. * Returns true if **any** of the given glob `patterns`
  8824. * match the specified `string`.
  8825. *
  8826. * ```js
  8827. * var mm = require('micromatch');
  8828. * mm.any(string, patterns[, options]);
  8829. *
  8830. * console.log(mm.any('a.a', ['b.*', '*.a']));
  8831. * //=> true
  8832. * console.log(mm.any('a.a', 'b.*'));
  8833. * //=> false
  8834. * ```
  8835. * @param {String|Array} `str` The string to test.
  8836. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  8837. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8838. * @return {Boolean} Returns true if any patterns match `str`
  8839. * @api public
  8840. */
  8841. micromatch.any = function (str, patterns, options) {
  8842. if (typeof str !== 'string') {
  8843. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  8844. }
  8845. if (isEmptyString(str) || isEmptyString(patterns)) {
  8846. return false;
  8847. }
  8848. if (typeof patterns === 'string') {
  8849. patterns = [patterns];
  8850. }
  8851. for (var i = 0; i < patterns.length; i++) {
  8852. if (micromatch.isMatch(str, patterns[i], options)) {
  8853. return true;
  8854. }
  8855. }
  8856. return false;
  8857. };
  8858. /**
  8859. * Returns true if **all** of the given `patterns` match
  8860. * the specified string.
  8861. *
  8862. * ```js
  8863. * var mm = require('micromatch');
  8864. * mm.all(string, patterns[, options]);
  8865. *
  8866. * console.log(mm.all('foo.js', ['foo.js']));
  8867. * // true
  8868. *
  8869. * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
  8870. * // false
  8871. *
  8872. * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
  8873. * // true
  8874. *
  8875. * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
  8876. * // true
  8877. * ```
  8878. * @param {String|Array} `str` The string to test.
  8879. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  8880. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8881. * @return {Boolean} Returns true if any patterns match `str`
  8882. * @api public
  8883. */
  8884. micromatch.all = function (str, patterns, options) {
  8885. if (typeof str !== 'string') {
  8886. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  8887. }
  8888. if (typeof patterns === 'string') {
  8889. patterns = [patterns];
  8890. }
  8891. for (var i = 0; i < patterns.length; i++) {
  8892. if (!micromatch.isMatch(str, patterns[i], options)) {
  8893. return false;
  8894. }
  8895. }
  8896. return true;
  8897. };
  8898. /**
  8899. * Returns a list of strings that _**do not match any**_ of the given `patterns`.
  8900. *
  8901. * ```js
  8902. * var mm = require('micromatch');
  8903. * mm.not(list, patterns[, options]);
  8904. *
  8905. * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
  8906. * //=> ['b.b', 'c.c']
  8907. * ```
  8908. * @param {Array} `list` Array of strings to match.
  8909. * @param {String|Array} `patterns` One or more glob pattern to use for matching.
  8910. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8911. * @return {Array} Returns an array of strings that **do not match** the given patterns.
  8912. * @api public
  8913. */
  8914. micromatch.not = function (list, patterns, options) {
  8915. var opts = extend({}, options);
  8916. var ignore = opts.ignore;
  8917. delete opts.ignore;
  8918. var unixify = utils.unixify(opts);
  8919. list = utils.arrayify(list).map(unixify);
  8920. var matches = utils.diff(list, micromatch(list, patterns, opts));
  8921. if (ignore) {
  8922. matches = utils.diff(matches, micromatch(list, ignore));
  8923. }
  8924. return opts.nodupes !== false ? utils.unique(matches) : matches;
  8925. };
  8926. /**
  8927. * Returns true if the given `string` contains the given pattern. Similar
  8928. * to [.isMatch](#isMatch) but the pattern can match any part of the string.
  8929. *
  8930. * ```js
  8931. * var mm = require('micromatch');
  8932. * mm.contains(string, pattern[, options]);
  8933. *
  8934. * console.log(mm.contains('aa/bb/cc', '*b'));
  8935. * //=> true
  8936. * console.log(mm.contains('aa/bb/cc', '*d'));
  8937. * //=> false
  8938. * ```
  8939. * @param {String} `str` The string to match.
  8940. * @param {String|Array} `patterns` Glob pattern to use for matching.
  8941. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8942. * @return {Boolean} Returns true if the patter matches any part of `str`.
  8943. * @api public
  8944. */
  8945. micromatch.contains = function (str, patterns, options) {
  8946. if (typeof str !== 'string') {
  8947. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  8948. }
  8949. if (typeof patterns === 'string') {
  8950. if (isEmptyString(str) || isEmptyString(patterns)) {
  8951. return false;
  8952. }
  8953. var equals = utils.equalsPattern(patterns, options);
  8954. if (equals(str)) {
  8955. return true;
  8956. }
  8957. var contains = utils.containsPattern(patterns, options);
  8958. if (contains(str)) {
  8959. return true;
  8960. }
  8961. }
  8962. var opts = extend({}, options, {
  8963. contains: true
  8964. });
  8965. return micromatch.any(str, patterns, opts);
  8966. };
  8967. /**
  8968. * Returns true if the given pattern and options should enable
  8969. * the `matchBase` option.
  8970. * @return {Boolean}
  8971. * @api private
  8972. */
  8973. micromatch.matchBase = function (pattern, options) {
  8974. if (pattern && pattern.indexOf('/') !== -1 || !options) return false;
  8975. return options.basename === true || options.matchBase === true;
  8976. };
  8977. /**
  8978. * Filter the keys of the given object with the given `glob` pattern
  8979. * and `options`. Does not attempt to match nested keys. If you need this feature,
  8980. * use [glob-object][] instead.
  8981. *
  8982. * ```js
  8983. * var mm = require('micromatch');
  8984. * mm.matchKeys(object, patterns[, options]);
  8985. *
  8986. * var obj = { aa: 'a', ab: 'b', ac: 'c' };
  8987. * console.log(mm.matchKeys(obj, '*b'));
  8988. * //=> { ab: 'b' }
  8989. * ```
  8990. * @param {Object} `object` The object with keys to filter.
  8991. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  8992. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  8993. * @return {Object} Returns an object with only keys that match the given patterns.
  8994. * @api public
  8995. */
  8996. micromatch.matchKeys = function (obj, patterns, options) {
  8997. if (!utils.isObject(obj)) {
  8998. throw new TypeError('expected the first argument to be an object');
  8999. }
  9000. var keys = micromatch(Object.keys(obj), patterns, options);
  9001. return utils.pick(obj, keys);
  9002. };
  9003. /**
  9004. * Returns a memoized matcher function from the given glob `pattern` and `options`.
  9005. * The returned function takes a string to match as its only argument and returns
  9006. * true if the string is a match.
  9007. *
  9008. * ```js
  9009. * var mm = require('micromatch');
  9010. * mm.matcher(pattern[, options]);
  9011. *
  9012. * var isMatch = mm.matcher('*.!(*a)');
  9013. * console.log(isMatch('a.a'));
  9014. * //=> false
  9015. * console.log(isMatch('a.b'));
  9016. * //=> true
  9017. * ```
  9018. * @param {String} `pattern` Glob pattern
  9019. * @param {Object} `options` See available [options](#options) for changing how matches are performed.
  9020. * @return {Function} Returns a matcher function.
  9021. * @api public
  9022. */
  9023. micromatch.matcher = function matcher(pattern, options) {
  9024. if (Array.isArray(pattern)) {
  9025. return compose(pattern, options, matcher);
  9026. } // if pattern is a regex
  9027. if (pattern instanceof RegExp) {
  9028. return test(pattern);
  9029. } // if pattern is invalid
  9030. if (!utils.isString(pattern)) {
  9031. throw new TypeError('expected pattern to be an array, string or regex');
  9032. } // if pattern is a non-glob string
  9033. if (!utils.hasSpecialChars(pattern)) {
  9034. if (options && options.nocase === true) {
  9035. pattern = pattern.toLowerCase();
  9036. }
  9037. return utils.matchPath(pattern, options);
  9038. } // if pattern is a glob string
  9039. var re = micromatch.makeRe(pattern, options); // if `options.matchBase` or `options.basename` is defined
  9040. if (micromatch.matchBase(pattern, options)) {
  9041. return utils.matchBasename(re, options);
  9042. }
  9043. function test(regex) {
  9044. var equals = utils.equalsPattern(options);
  9045. var unixify = utils.unixify(options);
  9046. return function (str) {
  9047. if (equals(str)) {
  9048. return true;
  9049. }
  9050. if (regex.test(unixify(str))) {
  9051. return true;
  9052. }
  9053. return false;
  9054. };
  9055. }
  9056. var fn = test(re);
  9057. Object.defineProperty(fn, 'result', {
  9058. configurable: true,
  9059. enumerable: false,
  9060. value: re.result
  9061. });
  9062. return fn;
  9063. };
  9064. /**
  9065. * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
  9066. *
  9067. * ```js
  9068. * var mm = require('micromatch');
  9069. * mm.capture(pattern, string[, options]);
  9070. *
  9071. * console.log(mm.capture('test/*.js', 'test/foo.js'));
  9072. * //=> ['foo']
  9073. * console.log(mm.capture('test/*.js', 'foo/bar.css'));
  9074. * //=> null
  9075. * ```
  9076. * @param {String} `pattern` Glob pattern to use for matching.
  9077. * @param {String} `string` String to match
  9078. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  9079. * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`.
  9080. * @api public
  9081. */
  9082. micromatch.capture = function (pattern, str, options) {
  9083. var re = micromatch.makeRe(pattern, extend({
  9084. capture: true
  9085. }, options));
  9086. var unixify = utils.unixify(options);
  9087. function match() {
  9088. return function (string) {
  9089. var match = re.exec(unixify(string));
  9090. if (!match) {
  9091. return null;
  9092. }
  9093. return match.slice(1);
  9094. };
  9095. }
  9096. var capture = memoize('capture', pattern, options, match);
  9097. return capture(str);
  9098. };
  9099. /**
  9100. * Create a regular expression from the given glob `pattern`.
  9101. *
  9102. * ```js
  9103. * var mm = require('micromatch');
  9104. * mm.makeRe(pattern[, options]);
  9105. *
  9106. * console.log(mm.makeRe('*.js'));
  9107. * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
  9108. * ```
  9109. * @param {String} `pattern` A glob pattern to convert to regex.
  9110. * @param {Object} `options` See available [options](#options) for changing how matches are performed.
  9111. * @return {RegExp} Returns a regex created from the given pattern.
  9112. * @api public
  9113. */
  9114. micromatch.makeRe = function (pattern, options) {
  9115. if (typeof pattern !== 'string') {
  9116. throw new TypeError('expected pattern to be a string');
  9117. }
  9118. if (pattern.length > MAX_LENGTH) {
  9119. throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
  9120. }
  9121. function makeRe() {
  9122. var result = micromatch.create(pattern, options);
  9123. var ast_array = [];
  9124. var output = result.map(function (obj) {
  9125. obj.ast.state = obj.state;
  9126. ast_array.push(obj.ast);
  9127. return obj.output;
  9128. });
  9129. var regex = toRegex(output.join('|'), options);
  9130. Object.defineProperty(regex, 'result', {
  9131. configurable: true,
  9132. enumerable: false,
  9133. value: ast_array
  9134. });
  9135. return regex;
  9136. }
  9137. return memoize('makeRe', pattern, options, makeRe);
  9138. };
  9139. /**
  9140. * Expand the given brace `pattern`.
  9141. *
  9142. * ```js
  9143. * var mm = require('micromatch');
  9144. * console.log(mm.braces('foo/{a,b}/bar'));
  9145. * //=> ['foo/(a|b)/bar']
  9146. *
  9147. * console.log(mm.braces('foo/{a,b}/bar', {expand: true}));
  9148. * //=> ['foo/(a|b)/bar']
  9149. * ```
  9150. * @param {String} `pattern` String with brace pattern to expand.
  9151. * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
  9152. * @return {Array}
  9153. * @api public
  9154. */
  9155. micromatch.braces = function (pattern, options) {
  9156. if (typeof pattern !== 'string' && !Array.isArray(pattern)) {
  9157. throw new TypeError('expected pattern to be an array or string');
  9158. }
  9159. function expand() {
  9160. if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
  9161. return utils.arrayify(pattern);
  9162. }
  9163. return braces(pattern, options);
  9164. }
  9165. return memoize('braces', pattern, options, expand);
  9166. };
  9167. /**
  9168. * Proxy to the [micromatch.braces](#method), for parity with
  9169. * minimatch.
  9170. */
  9171. micromatch.braceExpand = function (pattern, options) {
  9172. var opts = extend({}, options, {
  9173. expand: true
  9174. });
  9175. return micromatch.braces(pattern, opts);
  9176. };
  9177. /**
  9178. * Parses the given glob `pattern` and returns an array of abstract syntax
  9179. * trees (ASTs), with the compiled `output` and optional source `map` on
  9180. * each AST.
  9181. *
  9182. * ```js
  9183. * var mm = require('micromatch');
  9184. * mm.create(pattern[, options]);
  9185. *
  9186. * console.log(mm.create('abc/*.js'));
  9187. * // [{ options: { source: 'string', sourcemap: true },
  9188. * // state: {},
  9189. * // compilers:
  9190. * // { ... },
  9191. * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js',
  9192. * // ast:
  9193. * // { type: 'root',
  9194. * // errors: [],
  9195. * // nodes:
  9196. * // [ ... ],
  9197. * // dot: false,
  9198. * // input: 'abc/*.js' },
  9199. * // parsingErrors: [],
  9200. * // map:
  9201. * // { version: 3,
  9202. * // sources: [ 'string' ],
  9203. * // names: [],
  9204. * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE',
  9205. * // sourcesContent: [ 'abc/*.js' ] },
  9206. * // position: { line: 1, column: 28 },
  9207. * // content: {},
  9208. * // files: {},
  9209. * // idx: 6 }]
  9210. * ```
  9211. * @param {String} `pattern` Glob pattern to parse and compile.
  9212. * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed.
  9213. * @return {Object} Returns an object with the parsed AST, compiled string and optional source map.
  9214. * @api public
  9215. */
  9216. micromatch.create = function (pattern, options) {
  9217. return memoize('create', pattern, options, function () {
  9218. function create(str, opts) {
  9219. return micromatch.compile(micromatch.parse(str, opts), opts);
  9220. }
  9221. pattern = micromatch.braces(pattern, options);
  9222. var len = pattern.length;
  9223. var idx = -1;
  9224. var res = [];
  9225. while (++idx < len) {
  9226. res.push(create(pattern[idx], options));
  9227. }
  9228. return res;
  9229. });
  9230. };
  9231. /**
  9232. * Parse the given `str` with the given `options`.
  9233. *
  9234. * ```js
  9235. * var mm = require('micromatch');
  9236. * mm.parse(pattern[, options]);
  9237. *
  9238. * var ast = mm.parse('a/{b,c}/d');
  9239. * console.log(ast);
  9240. * // { type: 'root',
  9241. * // errors: [],
  9242. * // input: 'a/{b,c}/d',
  9243. * // nodes:
  9244. * // [ { type: 'bos', val: '' },
  9245. * // { type: 'text', val: 'a/' },
  9246. * // { type: 'brace',
  9247. * // nodes:
  9248. * // [ { type: 'brace.open', val: '{' },
  9249. * // { type: 'text', val: 'b,c' },
  9250. * // { type: 'brace.close', val: '}' } ] },
  9251. * // { type: 'text', val: '/d' },
  9252. * // { type: 'eos', val: '' } ] }
  9253. * ```
  9254. * @param {String} `str`
  9255. * @param {Object} `options`
  9256. * @return {Object} Returns an AST
  9257. * @api public
  9258. */
  9259. micromatch.parse = function (pattern, options) {
  9260. if (typeof pattern !== 'string') {
  9261. throw new TypeError('expected a string');
  9262. }
  9263. function parse() {
  9264. var snapdragon = utils.instantiate(null, options);
  9265. parsers(snapdragon, options);
  9266. var ast = snapdragon.parse(pattern, options);
  9267. utils.define(ast, 'snapdragon', snapdragon);
  9268. ast.input = pattern;
  9269. return ast;
  9270. }
  9271. return memoize('parse', pattern, options, parse);
  9272. };
  9273. /**
  9274. * Compile the given `ast` or string with the given `options`.
  9275. *
  9276. * ```js
  9277. * var mm = require('micromatch');
  9278. * mm.compile(ast[, options]);
  9279. *
  9280. * var ast = mm.parse('a/{b,c}/d');
  9281. * console.log(mm.compile(ast));
  9282. * // { options: { source: 'string' },
  9283. * // state: {},
  9284. * // compilers:
  9285. * // { eos: [Function],
  9286. * // noop: [Function],
  9287. * // bos: [Function],
  9288. * // brace: [Function],
  9289. * // 'brace.open': [Function],
  9290. * // text: [Function],
  9291. * // 'brace.close': [Function] },
  9292. * // output: [ 'a/(b|c)/d' ],
  9293. * // ast:
  9294. * // { ... },
  9295. * // parsingErrors: [] }
  9296. * ```
  9297. * @param {Object|String} `ast`
  9298. * @param {Object} `options`
  9299. * @return {Object} Returns an object that has an `output` property with the compiled string.
  9300. * @api public
  9301. */
  9302. micromatch.compile = function (ast, options) {
  9303. if (typeof ast === 'string') {
  9304. ast = micromatch.parse(ast, options);
  9305. }
  9306. return memoize('compile', ast.input, options, function () {
  9307. var snapdragon = utils.instantiate(ast, options);
  9308. compilers(snapdragon, options);
  9309. return snapdragon.compile(ast, options);
  9310. });
  9311. };
  9312. /**
  9313. * Clear the regex cache.
  9314. *
  9315. * ```js
  9316. * mm.clearCache();
  9317. * ```
  9318. * @api public
  9319. */
  9320. micromatch.clearCache = function () {
  9321. micromatch.cache.caches = {};
  9322. };
  9323. /**
  9324. * Returns true if the given value is effectively an empty string
  9325. */
  9326. function isEmptyString(val) {
  9327. return String(val) === '' || String(val) === './';
  9328. }
  9329. /**
  9330. * Compose a matcher function with the given patterns.
  9331. * This allows matcher functions to be compiled once and
  9332. * called multiple times.
  9333. */
  9334. function compose(patterns, options, matcher) {
  9335. var matchers;
  9336. return memoize('compose', String(patterns), options, function () {
  9337. return function (file) {
  9338. // delay composition until it's invoked the first time,
  9339. // after that it won't be called again
  9340. if (!matchers) {
  9341. matchers = [];
  9342. for (var i = 0; i < patterns.length; i++) {
  9343. matchers.push(matcher(patterns[i], options));
  9344. }
  9345. }
  9346. var len = matchers.length;
  9347. while (len--) {
  9348. if (matchers[len](file) === true) {
  9349. return true;
  9350. }
  9351. }
  9352. return false;
  9353. };
  9354. });
  9355. }
  9356. /**
  9357. * Memoize a generated regex or function. A unique key is generated
  9358. * from the `type` (usually method name), the `pattern`, and
  9359. * user-defined options.
  9360. */
  9361. function memoize(type, pattern, options, fn) {
  9362. var key = utils.createKey(type + '=' + pattern, options);
  9363. if (options && options.cache === false) {
  9364. return fn(pattern, options);
  9365. }
  9366. if (cache.has(type, key)) {
  9367. return cache.get(type, key);
  9368. }
  9369. var val = fn(pattern, options);
  9370. cache.set(type, key, val);
  9371. return val;
  9372. }
  9373. /**
  9374. * Expose compiler, parser and cache on `micromatch`
  9375. */
  9376. micromatch.compilers = compilers;
  9377. micromatch.parsers = parsers;
  9378. micromatch.caches = cache.caches;
  9379. /**
  9380. * Expose `micromatch`
  9381. * @type {Function}
  9382. */
  9383. module.exports = micromatch;
  9384. /***/ }),
  9385. /***/ "./node_modules/micromatch/lib/cache.js":
  9386. /*!**********************************************!*\
  9387. !*** ./node_modules/micromatch/lib/cache.js ***!
  9388. \**********************************************/
  9389. /*! no static exports found */
  9390. /***/ (function(module, exports, __webpack_require__) {
  9391. "use strict";
  9392. module.exports = new (__webpack_require__(/*! fragment-cache */ "./node_modules/fragment-cache/index.js"))();
  9393. /***/ }),
  9394. /***/ "./node_modules/micromatch/lib/compilers.js":
  9395. /*!**************************************************!*\
  9396. !*** ./node_modules/micromatch/lib/compilers.js ***!
  9397. \**************************************************/
  9398. /*! no static exports found */
  9399. /***/ (function(module, exports, __webpack_require__) {
  9400. "use strict";
  9401. var nanomatch = __webpack_require__(/*! nanomatch */ "./node_modules/nanomatch/index.js");
  9402. var extglob = __webpack_require__(/*! extglob */ "./node_modules/extglob/index.js");
  9403. module.exports = function (snapdragon) {
  9404. var compilers = snapdragon.compiler.compilers;
  9405. var opts = snapdragon.options; // register nanomatch compilers
  9406. snapdragon.use(nanomatch.compilers); // get references to some specific nanomatch compilers before they
  9407. // are overridden by the extglob and/or custom compilers
  9408. var escape = compilers.escape;
  9409. var qmark = compilers.qmark;
  9410. var slash = compilers.slash;
  9411. var star = compilers.star;
  9412. var text = compilers.text;
  9413. var plus = compilers.plus;
  9414. var dot = compilers.dot; // register extglob compilers or escape exglobs if disabled
  9415. if (opts.extglob === false || opts.noext === true) {
  9416. snapdragon.compiler.use(escapeExtglobs);
  9417. } else {
  9418. snapdragon.use(extglob.compilers);
  9419. }
  9420. snapdragon.use(function () {
  9421. this.options.star = this.options.star || function ()
  9422. /*node*/
  9423. {
  9424. return '[^\\\\/]*?';
  9425. };
  9426. }); // custom micromatch compilers
  9427. snapdragon.compiler // reset referenced compiler
  9428. .set('dot', dot).set('escape', escape).set('plus', plus).set('slash', slash).set('qmark', qmark).set('star', star).set('text', text);
  9429. };
  9430. function escapeExtglobs(compiler) {
  9431. compiler.set('paren', function (node) {
  9432. var val = '';
  9433. visit(node, function (tok) {
  9434. if (tok.val) val += (/^\W/.test(tok.val) ? '\\' : '') + tok.val;
  9435. });
  9436. return this.emit(val, node);
  9437. });
  9438. /**
  9439. * Visit `node` with the given `fn`
  9440. */
  9441. function visit(node, fn) {
  9442. return node.nodes ? mapVisit(node.nodes, fn) : fn(node);
  9443. }
  9444. /**
  9445. * Map visit over array of `nodes`.
  9446. */
  9447. function mapVisit(nodes, fn) {
  9448. var len = nodes.length;
  9449. var idx = -1;
  9450. while (++idx < len) {
  9451. visit(nodes[idx], fn);
  9452. }
  9453. }
  9454. }
  9455. /***/ }),
  9456. /***/ "./node_modules/micromatch/lib/parsers.js":
  9457. /*!************************************************!*\
  9458. !*** ./node_modules/micromatch/lib/parsers.js ***!
  9459. \************************************************/
  9460. /*! no static exports found */
  9461. /***/ (function(module, exports, __webpack_require__) {
  9462. "use strict";
  9463. var extglob = __webpack_require__(/*! extglob */ "./node_modules/extglob/index.js");
  9464. var nanomatch = __webpack_require__(/*! nanomatch */ "./node_modules/nanomatch/index.js");
  9465. var regexNot = __webpack_require__(/*! regex-not */ "./node_modules/regex-not/index.js");
  9466. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  9467. var not;
  9468. /**
  9469. * Characters to use in negation regex (we want to "not" match
  9470. * characters that are matched by other parsers)
  9471. */
  9472. var TEXT = '([!@*?+]?\\(|\\)|\\[:?(?=.*?:?\\])|:?\\]|[*+?!^$.\\\\/])+';
  9473. var createNotRegex = function createNotRegex(opts) {
  9474. return not || (not = textRegex(TEXT));
  9475. };
  9476. /**
  9477. * Parsers
  9478. */
  9479. module.exports = function (snapdragon) {
  9480. var parsers = snapdragon.parser.parsers; // register nanomatch parsers
  9481. snapdragon.use(nanomatch.parsers); // get references to some specific nanomatch parsers before they
  9482. // are overridden by the extglob and/or parsers
  9483. var escape = parsers.escape;
  9484. var slash = parsers.slash;
  9485. var qmark = parsers.qmark;
  9486. var plus = parsers.plus;
  9487. var star = parsers.star;
  9488. var dot = parsers.dot; // register extglob parsers
  9489. snapdragon.use(extglob.parsers); // custom micromatch parsers
  9490. snapdragon.parser.use(function () {
  9491. // override "notRegex" created in nanomatch parser
  9492. this.notRegex = /^\!+(?!\()/;
  9493. }) // reset the referenced parsers
  9494. .capture('escape', escape).capture('slash', slash).capture('qmark', qmark).capture('star', star).capture('plus', plus).capture('dot', dot)
  9495. /**
  9496. * Override `text` parser
  9497. */
  9498. .capture('text', function () {
  9499. if (this.isInside('bracket')) return;
  9500. var pos = this.position();
  9501. var m = this.match(createNotRegex(this.options));
  9502. if (!m || !m[0]) return; // escape regex boundary characters and simple brackets
  9503. var val = m[0].replace(/([[\]^$])/g, '\\$1');
  9504. return pos({
  9505. type: 'text',
  9506. val: val
  9507. });
  9508. });
  9509. };
  9510. /**
  9511. * Create text regex
  9512. */
  9513. function textRegex(pattern) {
  9514. var notStr = regexNot.create(pattern, {
  9515. contains: true,
  9516. strictClose: false
  9517. });
  9518. var prefix = '(?:[\\^]|\\\\|';
  9519. return toRegex(prefix + notStr + ')', {
  9520. strictClose: false
  9521. });
  9522. }
  9523. /***/ }),
  9524. /***/ "./node_modules/micromatch/lib/utils.js":
  9525. /*!**********************************************!*\
  9526. !*** ./node_modules/micromatch/lib/utils.js ***!
  9527. \**********************************************/
  9528. /*! no static exports found */
  9529. /***/ (function(module, exports, __webpack_require__) {
  9530. "use strict";
  9531. /* WEBPACK VAR INJECTION */(function(process) {
  9532. var utils = module.exports;
  9533. var path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js");
  9534. /**
  9535. * Module dependencies
  9536. */
  9537. var Snapdragon = __webpack_require__(/*! snapdragon */ "./node_modules/snapdragon/index.js");
  9538. utils.define = __webpack_require__(/*! define-property */ "./node_modules/micromatch/node_modules/define-property/index.js");
  9539. utils.diff = __webpack_require__(/*! arr-diff */ "./node_modules/arr-diff/index.js");
  9540. utils.extend = __webpack_require__(/*! extend-shallow */ "./node_modules/micromatch/node_modules/extend-shallow/index.js");
  9541. utils.pick = __webpack_require__(/*! object.pick */ "./node_modules/object.pick/index.js");
  9542. utils.typeOf = __webpack_require__(/*! kind-of */ "./node_modules/micromatch/node_modules/kind-of/index.js");
  9543. utils.unique = __webpack_require__(/*! array-unique */ "./node_modules/array-unique/index.js");
  9544. /**
  9545. * Returns true if the platform is windows, or `path.sep` is `\\`.
  9546. * This is defined as a function to allow `path.sep` to be set in unit tests,
  9547. * or by the user, if there is a reason to do so.
  9548. * @return {Boolean}
  9549. */
  9550. utils.isWindows = function () {
  9551. return path.sep === '\\' || process.platform === 'win32';
  9552. };
  9553. /**
  9554. * Get the `Snapdragon` instance to use
  9555. */
  9556. utils.instantiate = function (ast, options) {
  9557. var snapdragon; // if an instance was created by `.parse`, use that instance
  9558. if (utils.typeOf(ast) === 'object' && ast.snapdragon) {
  9559. snapdragon = ast.snapdragon; // if the user supplies an instance on options, use that instance
  9560. } else if (utils.typeOf(options) === 'object' && options.snapdragon) {
  9561. snapdragon = options.snapdragon; // create a new instance
  9562. } else {
  9563. snapdragon = new Snapdragon(options);
  9564. }
  9565. utils.define(snapdragon, 'parse', function (str, options) {
  9566. var parsed = Snapdragon.prototype.parse.apply(this, arguments);
  9567. parsed.input = str; // escape unmatched brace/bracket/parens
  9568. var last = this.parser.stack.pop();
  9569. if (last && this.options.strictErrors !== true) {
  9570. var open = last.nodes[0];
  9571. var inner = last.nodes[1];
  9572. if (last.type === 'bracket') {
  9573. if (inner.val.charAt(0) === '[') {
  9574. inner.val = '\\' + inner.val;
  9575. }
  9576. } else {
  9577. open.val = '\\' + open.val;
  9578. var sibling = open.parent.nodes[1];
  9579. if (sibling.type === 'star') {
  9580. sibling.loose = true;
  9581. }
  9582. }
  9583. } // add non-enumerable parser reference
  9584. utils.define(parsed, 'parser', this.parser);
  9585. return parsed;
  9586. });
  9587. return snapdragon;
  9588. };
  9589. /**
  9590. * Create the key to use for memoization. The key is generated
  9591. * by iterating over the options and concatenating key-value pairs
  9592. * to the pattern string.
  9593. */
  9594. utils.createKey = function (pattern, options) {
  9595. if (utils.typeOf(options) !== 'object') {
  9596. return pattern;
  9597. }
  9598. var val = pattern;
  9599. var keys = Object.keys(options);
  9600. for (var i = 0; i < keys.length; i++) {
  9601. var key = keys[i];
  9602. val += ';' + key + '=' + String(options[key]);
  9603. }
  9604. return val;
  9605. };
  9606. /**
  9607. * Cast `val` to an array
  9608. * @return {Array}
  9609. */
  9610. utils.arrayify = function (val) {
  9611. if (typeof val === 'string') return [val];
  9612. return val ? Array.isArray(val) ? val : [val] : [];
  9613. };
  9614. /**
  9615. * Return true if `val` is a non-empty string
  9616. */
  9617. utils.isString = function (val) {
  9618. return typeof val === 'string';
  9619. };
  9620. /**
  9621. * Return true if `val` is a non-empty string
  9622. */
  9623. utils.isObject = function (val) {
  9624. return utils.typeOf(val) === 'object';
  9625. };
  9626. /**
  9627. * Returns true if the given `str` has special characters
  9628. */
  9629. utils.hasSpecialChars = function (str) {
  9630. return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str);
  9631. };
  9632. /**
  9633. * Escape regex characters in the given string
  9634. */
  9635. utils.escapeRegex = function (str) {
  9636. return str.replace(/[-[\]{}()^$|*+?.\\\/\s]/g, '\\$&');
  9637. };
  9638. /**
  9639. * Normalize slashes in the given filepath.
  9640. *
  9641. * @param {String} `filepath`
  9642. * @return {String}
  9643. */
  9644. utils.toPosixPath = function (str) {
  9645. return str.replace(/\\+/g, '/');
  9646. };
  9647. /**
  9648. * Strip backslashes before special characters in a string.
  9649. *
  9650. * @param {String} `str`
  9651. * @return {String}
  9652. */
  9653. utils.unescape = function (str) {
  9654. return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, ''));
  9655. };
  9656. /**
  9657. * Strip the prefix from a filepath
  9658. * @param {String} `fp`
  9659. * @return {String}
  9660. */
  9661. utils.stripPrefix = function (str) {
  9662. if (str.charAt(0) !== '.') {
  9663. return str;
  9664. }
  9665. var ch = str.charAt(1);
  9666. if (utils.isSlash(ch)) {
  9667. return str.slice(2);
  9668. }
  9669. return str;
  9670. };
  9671. /**
  9672. * Returns true if the given str is an escaped or
  9673. * unescaped path character
  9674. */
  9675. utils.isSlash = function (str) {
  9676. return str === '/' || str === '\\/' || str === '\\' || str === '\\\\';
  9677. };
  9678. /**
  9679. * Returns a function that returns true if the given
  9680. * pattern matches or contains a `filepath`
  9681. *
  9682. * @param {String} `pattern`
  9683. * @return {Function}
  9684. */
  9685. utils.matchPath = function (pattern, options) {
  9686. return options && options.contains ? utils.containsPattern(pattern, options) : utils.equalsPattern(pattern, options);
  9687. };
  9688. /**
  9689. * Returns true if the given (original) filepath or unixified path are equal
  9690. * to the given pattern.
  9691. */
  9692. utils._equals = function (filepath, unixPath, pattern) {
  9693. return pattern === filepath || pattern === unixPath;
  9694. };
  9695. /**
  9696. * Returns true if the given (original) filepath or unixified path contain
  9697. * the given pattern.
  9698. */
  9699. utils._contains = function (filepath, unixPath, pattern) {
  9700. return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1;
  9701. };
  9702. /**
  9703. * Returns a function that returns true if the given
  9704. * pattern is the same as a given `filepath`
  9705. *
  9706. * @param {String} `pattern`
  9707. * @return {Function}
  9708. */
  9709. utils.equalsPattern = function (pattern, options) {
  9710. var unixify = utils.unixify(options);
  9711. options = options || {};
  9712. return function fn(filepath) {
  9713. var equal = utils._equals(filepath, unixify(filepath), pattern);
  9714. if (equal === true || options.nocase !== true) {
  9715. return equal;
  9716. }
  9717. var lower = filepath.toLowerCase();
  9718. return utils._equals(lower, unixify(lower), pattern);
  9719. };
  9720. };
  9721. /**
  9722. * Returns a function that returns true if the given
  9723. * pattern contains a `filepath`
  9724. *
  9725. * @param {String} `pattern`
  9726. * @return {Function}
  9727. */
  9728. utils.containsPattern = function (pattern, options) {
  9729. var unixify = utils.unixify(options);
  9730. options = options || {};
  9731. return function (filepath) {
  9732. var contains = utils._contains(filepath, unixify(filepath), pattern);
  9733. if (contains === true || options.nocase !== true) {
  9734. return contains;
  9735. }
  9736. var lower = filepath.toLowerCase();
  9737. return utils._contains(lower, unixify(lower), pattern);
  9738. };
  9739. };
  9740. /**
  9741. * Returns a function that returns true if the given
  9742. * regex matches the `filename` of a file path.
  9743. *
  9744. * @param {RegExp} `re` Matching regex
  9745. * @return {Function}
  9746. */
  9747. utils.matchBasename = function (re) {
  9748. return function (filepath) {
  9749. return re.test(path.basename(filepath));
  9750. };
  9751. };
  9752. /**
  9753. * Determines the filepath to return based on the provided options.
  9754. * @return {any}
  9755. */
  9756. utils.value = function (str, unixify, options) {
  9757. if (options && options.unixify === false) {
  9758. return str;
  9759. }
  9760. return unixify(str);
  9761. };
  9762. /**
  9763. * Returns a function that normalizes slashes in a string to forward
  9764. * slashes, strips `./` from beginning of paths, and optionally unescapes
  9765. * special characters.
  9766. * @return {Function}
  9767. */
  9768. utils.unixify = function (options) {
  9769. options = options || {};
  9770. return function (filepath) {
  9771. if (utils.isWindows() || options.unixify === true) {
  9772. filepath = utils.toPosixPath(filepath);
  9773. }
  9774. if (options.stripPrefix !== false) {
  9775. filepath = utils.stripPrefix(filepath);
  9776. }
  9777. if (options.unescape === true) {
  9778. filepath = utils.unescape(filepath);
  9779. }
  9780. return filepath;
  9781. };
  9782. };
  9783. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  9784. /***/ }),
  9785. /***/ "./node_modules/micromatch/node_modules/define-property/index.js":
  9786. /*!***********************************************************************!*\
  9787. !*** ./node_modules/micromatch/node_modules/define-property/index.js ***!
  9788. \***********************************************************************/
  9789. /*! no static exports found */
  9790. /***/ (function(module, exports, __webpack_require__) {
  9791. "use strict";
  9792. /*!
  9793. * define-property <https://github.com/jonschlinkert/define-property>
  9794. *
  9795. * Copyright (c) 2015-2018, Jon Schlinkert.
  9796. * Released under the MIT License.
  9797. */
  9798. var isobject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  9799. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/is-descriptor/index.js");
  9800. var define = typeof Reflect !== 'undefined' && Reflect.defineProperty ? Reflect.defineProperty : Object.defineProperty;
  9801. module.exports = function defineProperty(obj, key, val) {
  9802. if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) {
  9803. throw new TypeError('expected an object, function, or array');
  9804. }
  9805. if (typeof key !== 'string') {
  9806. throw new TypeError('expected "key" to be a string');
  9807. }
  9808. if (isDescriptor(val)) {
  9809. define(obj, key, val);
  9810. return obj;
  9811. }
  9812. define(obj, key, {
  9813. configurable: true,
  9814. enumerable: false,
  9815. writable: true,
  9816. value: val
  9817. });
  9818. return obj;
  9819. };
  9820. /***/ }),
  9821. /***/ "./node_modules/micromatch/node_modules/extend-shallow/index.js":
  9822. /*!**********************************************************************!*\
  9823. !*** ./node_modules/micromatch/node_modules/extend-shallow/index.js ***!
  9824. \**********************************************************************/
  9825. /*! no static exports found */
  9826. /***/ (function(module, exports, __webpack_require__) {
  9827. "use strict";
  9828. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9829. var isExtendable = __webpack_require__(/*! is-extendable */ "./node_modules/micromatch/node_modules/is-extendable/index.js");
  9830. var assignSymbols = __webpack_require__(/*! assign-symbols */ "./node_modules/assign-symbols/index.js");
  9831. module.exports = Object.assign || function (obj
  9832. /*, objects*/
  9833. ) {
  9834. if (obj === null || typeof obj === 'undefined') {
  9835. throw new TypeError('Cannot convert undefined or null to object');
  9836. }
  9837. if (!isObject(obj)) {
  9838. obj = {};
  9839. }
  9840. for (var i = 1; i < arguments.length; i++) {
  9841. var val = arguments[i];
  9842. if (isString(val)) {
  9843. val = toObject(val);
  9844. }
  9845. if (isObject(val)) {
  9846. assign(obj, val);
  9847. assignSymbols(obj, val);
  9848. }
  9849. }
  9850. return obj;
  9851. };
  9852. function assign(a, b) {
  9853. for (var key in b) {
  9854. if (hasOwn(b, key)) {
  9855. a[key] = b[key];
  9856. }
  9857. }
  9858. }
  9859. function isString(val) {
  9860. return val && typeof val === 'string';
  9861. }
  9862. function toObject(str) {
  9863. var obj = {};
  9864. for (var i in str) {
  9865. obj[i] = str[i];
  9866. }
  9867. return obj;
  9868. }
  9869. function isObject(val) {
  9870. return val && _typeof(val) === 'object' || isExtendable(val);
  9871. }
  9872. /**
  9873. * Returns true if the given `key` is an own property of `obj`.
  9874. */
  9875. function hasOwn(obj, key) {
  9876. return Object.prototype.hasOwnProperty.call(obj, key);
  9877. }
  9878. function isEnum(obj, key) {
  9879. return Object.prototype.propertyIsEnumerable.call(obj, key);
  9880. }
  9881. /***/ }),
  9882. /***/ "./node_modules/micromatch/node_modules/is-extendable/index.js":
  9883. /*!*********************************************************************!*\
  9884. !*** ./node_modules/micromatch/node_modules/is-extendable/index.js ***!
  9885. \*********************************************************************/
  9886. /*! no static exports found */
  9887. /***/ (function(module, exports, __webpack_require__) {
  9888. "use strict";
  9889. /*!
  9890. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  9891. *
  9892. * Copyright (c) 2015-2017, Jon Schlinkert.
  9893. * Released under the MIT License.
  9894. */
  9895. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  9896. module.exports = function isExtendable(val) {
  9897. return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
  9898. };
  9899. /***/ }),
  9900. /***/ "./node_modules/micromatch/node_modules/kind-of/index.js":
  9901. /*!***************************************************************!*\
  9902. !*** ./node_modules/micromatch/node_modules/kind-of/index.js ***!
  9903. \***************************************************************/
  9904. /*! no static exports found */
  9905. /***/ (function(module, exports, __webpack_require__) {
  9906. "use strict";
  9907. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9908. var toString = Object.prototype.toString;
  9909. module.exports = function kindOf(val) {
  9910. if (val === void 0) return 'undefined';
  9911. if (val === null) return 'null';
  9912. var type = _typeof(val);
  9913. if (type === 'boolean') return 'boolean';
  9914. if (type === 'string') return 'string';
  9915. if (type === 'number') return 'number';
  9916. if (type === 'symbol') return 'symbol';
  9917. if (type === 'function') {
  9918. return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  9919. }
  9920. if (isArray(val)) return 'array';
  9921. if (isBuffer(val)) return 'buffer';
  9922. if (isArguments(val)) return 'arguments';
  9923. if (isDate(val)) return 'date';
  9924. if (isError(val)) return 'error';
  9925. if (isRegexp(val)) return 'regexp';
  9926. switch (ctorName(val)) {
  9927. case 'Symbol':
  9928. return 'symbol';
  9929. case 'Promise':
  9930. return 'promise';
  9931. // Set, Map, WeakSet, WeakMap
  9932. case 'WeakMap':
  9933. return 'weakmap';
  9934. case 'WeakSet':
  9935. return 'weakset';
  9936. case 'Map':
  9937. return 'map';
  9938. case 'Set':
  9939. return 'set';
  9940. // 8-bit typed arrays
  9941. case 'Int8Array':
  9942. return 'int8array';
  9943. case 'Uint8Array':
  9944. return 'uint8array';
  9945. case 'Uint8ClampedArray':
  9946. return 'uint8clampedarray';
  9947. // 16-bit typed arrays
  9948. case 'Int16Array':
  9949. return 'int16array';
  9950. case 'Uint16Array':
  9951. return 'uint16array';
  9952. // 32-bit typed arrays
  9953. case 'Int32Array':
  9954. return 'int32array';
  9955. case 'Uint32Array':
  9956. return 'uint32array';
  9957. case 'Float32Array':
  9958. return 'float32array';
  9959. case 'Float64Array':
  9960. return 'float64array';
  9961. }
  9962. if (isGeneratorObj(val)) {
  9963. return 'generator';
  9964. } // Non-plain objects
  9965. type = toString.call(val);
  9966. switch (type) {
  9967. case '[object Object]':
  9968. return 'object';
  9969. // iterators
  9970. case '[object Map Iterator]':
  9971. return 'mapiterator';
  9972. case '[object Set Iterator]':
  9973. return 'setiterator';
  9974. case '[object String Iterator]':
  9975. return 'stringiterator';
  9976. case '[object Array Iterator]':
  9977. return 'arrayiterator';
  9978. } // other
  9979. return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
  9980. };
  9981. function ctorName(val) {
  9982. return val.constructor ? val.constructor.name : null;
  9983. }
  9984. function isArray(val) {
  9985. if (Array.isArray) return Array.isArray(val);
  9986. return val instanceof Array;
  9987. }
  9988. function isError(val) {
  9989. return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
  9990. }
  9991. function isDate(val) {
  9992. if (val instanceof Date) return true;
  9993. return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
  9994. }
  9995. function isRegexp(val) {
  9996. if (val instanceof RegExp) return true;
  9997. return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
  9998. }
  9999. function isGeneratorFn(name, val) {
  10000. return ctorName(name) === 'GeneratorFunction';
  10001. }
  10002. function isGeneratorObj(val) {
  10003. return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
  10004. }
  10005. function isArguments(val) {
  10006. try {
  10007. if (typeof val.length === 'number' && typeof val.callee === 'function') {
  10008. return true;
  10009. }
  10010. } catch (err) {
  10011. if (err.message.indexOf('callee') !== -1) {
  10012. return true;
  10013. }
  10014. }
  10015. return false;
  10016. }
  10017. /**
  10018. * If you need to support Safari 5-7 (8-10 yr-old browser),
  10019. * take a look at https://github.com/feross/is-buffer
  10020. */
  10021. function isBuffer(val) {
  10022. if (val.constructor && typeof val.constructor.isBuffer === 'function') {
  10023. return val.constructor.isBuffer(val);
  10024. }
  10025. return false;
  10026. }
  10027. /***/ }),
  10028. /***/ "./node_modules/mixin-deep/index.js":
  10029. /*!******************************************!*\
  10030. !*** ./node_modules/mixin-deep/index.js ***!
  10031. \******************************************/
  10032. /*! no static exports found */
  10033. /***/ (function(module, exports, __webpack_require__) {
  10034. "use strict";
  10035. var isExtendable = __webpack_require__(/*! is-extendable */ "./node_modules/mixin-deep/node_modules/is-extendable/index.js");
  10036. var forIn = __webpack_require__(/*! for-in */ "./node_modules/for-in/index.js");
  10037. function mixinDeep(target, objects) {
  10038. var len = arguments.length,
  10039. i = 0;
  10040. while (++i < len) {
  10041. var obj = arguments[i];
  10042. if (isObject(obj)) {
  10043. forIn(obj, copy, target);
  10044. }
  10045. }
  10046. return target;
  10047. }
  10048. /**
  10049. * Copy properties from the source object to the
  10050. * target object.
  10051. *
  10052. * @param {*} `val`
  10053. * @param {String} `key`
  10054. */
  10055. function copy(val, key) {
  10056. if (!isValidKey(key)) {
  10057. return;
  10058. }
  10059. var obj = this[key];
  10060. if (isObject(val) && isObject(obj)) {
  10061. mixinDeep(obj, val);
  10062. } else {
  10063. this[key] = val;
  10064. }
  10065. }
  10066. /**
  10067. * Returns true if `val` is an object or function.
  10068. *
  10069. * @param {any} val
  10070. * @return {Boolean}
  10071. */
  10072. function isObject(val) {
  10073. return isExtendable(val) && !Array.isArray(val);
  10074. }
  10075. /**
  10076. * Returns true if `key` is a valid key to use when extending objects.
  10077. *
  10078. * @param {String} `key`
  10079. * @return {Boolean}
  10080. */
  10081. function isValidKey(key) {
  10082. return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
  10083. }
  10084. ;
  10085. /**
  10086. * Expose `mixinDeep`
  10087. */
  10088. module.exports = mixinDeep;
  10089. /***/ }),
  10090. /***/ "./node_modules/mixin-deep/node_modules/is-extendable/index.js":
  10091. /*!*********************************************************************!*\
  10092. !*** ./node_modules/mixin-deep/node_modules/is-extendable/index.js ***!
  10093. \*********************************************************************/
  10094. /*! no static exports found */
  10095. /***/ (function(module, exports, __webpack_require__) {
  10096. "use strict";
  10097. /*!
  10098. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  10099. *
  10100. * Copyright (c) 2015-2017, Jon Schlinkert.
  10101. * Released under the MIT License.
  10102. */
  10103. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  10104. module.exports = function isExtendable(val) {
  10105. return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
  10106. };
  10107. /***/ }),
  10108. /***/ "./node_modules/nanomatch/index.js":
  10109. /*!*****************************************!*\
  10110. !*** ./node_modules/nanomatch/index.js ***!
  10111. \*****************************************/
  10112. /*! no static exports found */
  10113. /***/ (function(module, exports, __webpack_require__) {
  10114. "use strict";
  10115. /**
  10116. * Module dependencies
  10117. */
  10118. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  10119. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  10120. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/nanomatch/node_modules/extend-shallow/index.js");
  10121. /**
  10122. * Local dependencies
  10123. */
  10124. var compilers = __webpack_require__(/*! ./lib/compilers */ "./node_modules/nanomatch/lib/compilers.js");
  10125. var parsers = __webpack_require__(/*! ./lib/parsers */ "./node_modules/nanomatch/lib/parsers.js");
  10126. var cache = __webpack_require__(/*! ./lib/cache */ "./node_modules/nanomatch/lib/cache.js");
  10127. var utils = __webpack_require__(/*! ./lib/utils */ "./node_modules/nanomatch/lib/utils.js");
  10128. var MAX_LENGTH = 1024 * 64;
  10129. /**
  10130. * The main function takes a list of strings and one or more
  10131. * glob patterns to use for matching.
  10132. *
  10133. * ```js
  10134. * var nm = require('nanomatch');
  10135. * nm(list, patterns[, options]);
  10136. *
  10137. * console.log(nm(['a.js', 'a.txt'], ['*.js']));
  10138. * //=> [ 'a.js' ]
  10139. * ```
  10140. * @param {Array} `list` A list of strings to match
  10141. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  10142. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10143. * @return {Array} Returns an array of matches
  10144. * @summary false
  10145. * @api public
  10146. */
  10147. function nanomatch(list, patterns, options) {
  10148. patterns = utils.arrayify(patterns);
  10149. list = utils.arrayify(list);
  10150. var len = patterns.length;
  10151. if (list.length === 0 || len === 0) {
  10152. return [];
  10153. }
  10154. if (len === 1) {
  10155. return nanomatch.match(list, patterns[0], options);
  10156. }
  10157. var negated = false;
  10158. var omit = [];
  10159. var keep = [];
  10160. var idx = -1;
  10161. while (++idx < len) {
  10162. var pattern = patterns[idx];
  10163. if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33
  10164. /* ! */
  10165. ) {
  10166. omit.push.apply(omit, nanomatch.match(list, pattern.slice(1), options));
  10167. negated = true;
  10168. } else {
  10169. keep.push.apply(keep, nanomatch.match(list, pattern, options));
  10170. }
  10171. } // minimatch.match parity
  10172. if (negated && keep.length === 0) {
  10173. if (options && options.unixify === false) {
  10174. keep = list.slice();
  10175. } else {
  10176. var unixify = utils.unixify(options);
  10177. for (var i = 0; i < list.length; i++) {
  10178. keep.push(unixify(list[i]));
  10179. }
  10180. }
  10181. }
  10182. var matches = utils.diff(keep, omit);
  10183. if (!options || options.nodupes !== false) {
  10184. return utils.unique(matches);
  10185. }
  10186. return matches;
  10187. }
  10188. /**
  10189. * Similar to the main function, but `pattern` must be a string.
  10190. *
  10191. * ```js
  10192. * var nm = require('nanomatch');
  10193. * nm.match(list, pattern[, options]);
  10194. *
  10195. * console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a'));
  10196. * //=> ['a.a', 'a.aa']
  10197. * ```
  10198. * @param {Array} `list` Array of strings to match
  10199. * @param {String} `pattern` Glob pattern to use for matching.
  10200. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10201. * @return {Array} Returns an array of matches
  10202. * @api public
  10203. */
  10204. nanomatch.match = function (list, pattern, options) {
  10205. if (Array.isArray(pattern)) {
  10206. throw new TypeError('expected pattern to be a string');
  10207. }
  10208. var unixify = utils.unixify(options);
  10209. var isMatch = memoize('match', pattern, options, nanomatch.matcher);
  10210. var matches = [];
  10211. list = utils.arrayify(list);
  10212. var len = list.length;
  10213. var idx = -1;
  10214. while (++idx < len) {
  10215. var ele = list[idx];
  10216. if (ele === pattern || isMatch(ele)) {
  10217. matches.push(utils.value(ele, unixify, options));
  10218. }
  10219. } // if no options were passed, uniquify results and return
  10220. if (typeof options === 'undefined') {
  10221. return utils.unique(matches);
  10222. }
  10223. if (matches.length === 0) {
  10224. if (options.failglob === true) {
  10225. throw new Error('no matches found for "' + pattern + '"');
  10226. }
  10227. if (options.nonull === true || options.nullglob === true) {
  10228. return [options.unescape ? utils.unescape(pattern) : pattern];
  10229. }
  10230. } // if `opts.ignore` was defined, diff ignored list
  10231. if (options.ignore) {
  10232. matches = nanomatch.not(matches, options.ignore, options);
  10233. }
  10234. return options.nodupes !== false ? utils.unique(matches) : matches;
  10235. };
  10236. /**
  10237. * Returns true if the specified `string` matches the given glob `pattern`.
  10238. *
  10239. * ```js
  10240. * var nm = require('nanomatch');
  10241. * nm.isMatch(string, pattern[, options]);
  10242. *
  10243. * console.log(nm.isMatch('a.a', '*.a'));
  10244. * //=> true
  10245. * console.log(nm.isMatch('a.b', '*.a'));
  10246. * //=> false
  10247. * ```
  10248. * @param {String} `string` String to match
  10249. * @param {String} `pattern` Glob pattern to use for matching.
  10250. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10251. * @return {Boolean} Returns true if the string matches the glob pattern.
  10252. * @api public
  10253. */
  10254. nanomatch.isMatch = function (str, pattern, options) {
  10255. if (typeof str !== 'string') {
  10256. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  10257. }
  10258. if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) {
  10259. return false;
  10260. }
  10261. var equals = utils.equalsPattern(options);
  10262. if (equals(str)) {
  10263. return true;
  10264. }
  10265. var isMatch = memoize('isMatch', pattern, options, nanomatch.matcher);
  10266. return isMatch(str);
  10267. };
  10268. /**
  10269. * Returns true if some of the elements in the given `list` match any of the
  10270. * given glob `patterns`.
  10271. *
  10272. * ```js
  10273. * var nm = require('nanomatch');
  10274. * nm.some(list, patterns[, options]);
  10275. *
  10276. * console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  10277. * // true
  10278. * console.log(nm.some(['foo.js'], ['*.js', '!foo.js']));
  10279. * // false
  10280. * ```
  10281. * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
  10282. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  10283. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10284. * @return {Boolean} Returns true if any patterns match `str`
  10285. * @api public
  10286. */
  10287. nanomatch.some = function (list, patterns, options) {
  10288. if (typeof list === 'string') {
  10289. list = [list];
  10290. }
  10291. for (var i = 0; i < list.length; i++) {
  10292. if (nanomatch(list[i], patterns, options).length === 1) {
  10293. return true;
  10294. }
  10295. }
  10296. return false;
  10297. };
  10298. /**
  10299. * Returns true if every element in the given `list` matches
  10300. * at least one of the given glob `patterns`.
  10301. *
  10302. * ```js
  10303. * var nm = require('nanomatch');
  10304. * nm.every(list, patterns[, options]);
  10305. *
  10306. * console.log(nm.every('foo.js', ['foo.js']));
  10307. * // true
  10308. * console.log(nm.every(['foo.js', 'bar.js'], ['*.js']));
  10309. * // true
  10310. * console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  10311. * // false
  10312. * console.log(nm.every(['foo.js'], ['*.js', '!foo.js']));
  10313. * // false
  10314. * ```
  10315. * @param {String|Array} `list` The string or array of strings to test.
  10316. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  10317. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10318. * @return {Boolean} Returns true if any patterns match `str`
  10319. * @api public
  10320. */
  10321. nanomatch.every = function (list, patterns, options) {
  10322. if (typeof list === 'string') {
  10323. list = [list];
  10324. }
  10325. for (var i = 0; i < list.length; i++) {
  10326. if (nanomatch(list[i], patterns, options).length !== 1) {
  10327. return false;
  10328. }
  10329. }
  10330. return true;
  10331. };
  10332. /**
  10333. * Returns true if **any** of the given glob `patterns`
  10334. * match the specified `string`.
  10335. *
  10336. * ```js
  10337. * var nm = require('nanomatch');
  10338. * nm.any(string, patterns[, options]);
  10339. *
  10340. * console.log(nm.any('a.a', ['b.*', '*.a']));
  10341. * //=> true
  10342. * console.log(nm.any('a.a', 'b.*'));
  10343. * //=> false
  10344. * ```
  10345. * @param {String|Array} `str` The string to test.
  10346. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  10347. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10348. * @return {Boolean} Returns true if any patterns match `str`
  10349. * @api public
  10350. */
  10351. nanomatch.any = function (str, patterns, options) {
  10352. if (typeof str !== 'string') {
  10353. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  10354. }
  10355. if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) {
  10356. return false;
  10357. }
  10358. if (typeof patterns === 'string') {
  10359. patterns = [patterns];
  10360. }
  10361. for (var i = 0; i < patterns.length; i++) {
  10362. if (nanomatch.isMatch(str, patterns[i], options)) {
  10363. return true;
  10364. }
  10365. }
  10366. return false;
  10367. };
  10368. /**
  10369. * Returns true if **all** of the given `patterns`
  10370. * match the specified string.
  10371. *
  10372. * ```js
  10373. * var nm = require('nanomatch');
  10374. * nm.all(string, patterns[, options]);
  10375. *
  10376. * console.log(nm.all('foo.js', ['foo.js']));
  10377. * // true
  10378. *
  10379. * console.log(nm.all('foo.js', ['*.js', '!foo.js']));
  10380. * // false
  10381. *
  10382. * console.log(nm.all('foo.js', ['*.js', 'foo.js']));
  10383. * // true
  10384. *
  10385. * console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
  10386. * // true
  10387. * ```
  10388. * @param {String|Array} `str` The string to test.
  10389. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  10390. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10391. * @return {Boolean} Returns true if any patterns match `str`
  10392. * @api public
  10393. */
  10394. nanomatch.all = function (str, patterns, options) {
  10395. if (typeof str !== 'string') {
  10396. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  10397. }
  10398. if (typeof patterns === 'string') {
  10399. patterns = [patterns];
  10400. }
  10401. for (var i = 0; i < patterns.length; i++) {
  10402. if (!nanomatch.isMatch(str, patterns[i], options)) {
  10403. return false;
  10404. }
  10405. }
  10406. return true;
  10407. };
  10408. /**
  10409. * Returns a list of strings that _**do not match any**_ of the given `patterns`.
  10410. *
  10411. * ```js
  10412. * var nm = require('nanomatch');
  10413. * nm.not(list, patterns[, options]);
  10414. *
  10415. * console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a'));
  10416. * //=> ['b.b', 'c.c']
  10417. * ```
  10418. * @param {Array} `list` Array of strings to match.
  10419. * @param {String|Array} `patterns` One or more glob pattern to use for matching.
  10420. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10421. * @return {Array} Returns an array of strings that **do not match** the given patterns.
  10422. * @api public
  10423. */
  10424. nanomatch.not = function (list, patterns, options) {
  10425. var opts = extend({}, options);
  10426. var ignore = opts.ignore;
  10427. delete opts.ignore;
  10428. list = utils.arrayify(list);
  10429. var matches = utils.diff(list, nanomatch(list, patterns, opts));
  10430. if (ignore) {
  10431. matches = utils.diff(matches, nanomatch(list, ignore));
  10432. }
  10433. return opts.nodupes !== false ? utils.unique(matches) : matches;
  10434. };
  10435. /**
  10436. * Returns true if the given `string` contains the given pattern. Similar
  10437. * to [.isMatch](#isMatch) but the pattern can match any part of the string.
  10438. *
  10439. * ```js
  10440. * var nm = require('nanomatch');
  10441. * nm.contains(string, pattern[, options]);
  10442. *
  10443. * console.log(nm.contains('aa/bb/cc', '*b'));
  10444. * //=> true
  10445. * console.log(nm.contains('aa/bb/cc', '*d'));
  10446. * //=> false
  10447. * ```
  10448. * @param {String} `str` The string to match.
  10449. * @param {String|Array} `patterns` Glob pattern to use for matching.
  10450. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10451. * @return {Boolean} Returns true if the patter matches any part of `str`.
  10452. * @api public
  10453. */
  10454. nanomatch.contains = function (str, patterns, options) {
  10455. if (typeof str !== 'string') {
  10456. throw new TypeError('expected a string: "' + util.inspect(str) + '"');
  10457. }
  10458. if (typeof patterns === 'string') {
  10459. if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) {
  10460. return false;
  10461. }
  10462. var equals = utils.equalsPattern(patterns, options);
  10463. if (equals(str)) {
  10464. return true;
  10465. }
  10466. var contains = utils.containsPattern(patterns, options);
  10467. if (contains(str)) {
  10468. return true;
  10469. }
  10470. }
  10471. var opts = extend({}, options, {
  10472. contains: true
  10473. });
  10474. return nanomatch.any(str, patterns, opts);
  10475. };
  10476. /**
  10477. * Returns true if the given pattern and options should enable
  10478. * the `matchBase` option.
  10479. * @return {Boolean}
  10480. * @api private
  10481. */
  10482. nanomatch.matchBase = function (pattern, options) {
  10483. if (pattern && pattern.indexOf('/') !== -1 || !options) return false;
  10484. return options.basename === true || options.matchBase === true;
  10485. };
  10486. /**
  10487. * Filter the keys of the given object with the given `glob` pattern
  10488. * and `options`. Does not attempt to match nested keys. If you need this feature,
  10489. * use [glob-object][] instead.
  10490. *
  10491. * ```js
  10492. * var nm = require('nanomatch');
  10493. * nm.matchKeys(object, patterns[, options]);
  10494. *
  10495. * var obj = { aa: 'a', ab: 'b', ac: 'c' };
  10496. * console.log(nm.matchKeys(obj, '*b'));
  10497. * //=> { ab: 'b' }
  10498. * ```
  10499. * @param {Object} `object` The object with keys to filter.
  10500. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  10501. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10502. * @return {Object} Returns an object with only keys that match the given patterns.
  10503. * @api public
  10504. */
  10505. nanomatch.matchKeys = function (obj, patterns, options) {
  10506. if (!utils.isObject(obj)) {
  10507. throw new TypeError('expected the first argument to be an object');
  10508. }
  10509. var keys = nanomatch(Object.keys(obj), patterns, options);
  10510. return utils.pick(obj, keys);
  10511. };
  10512. /**
  10513. * Returns a memoized matcher function from the given glob `pattern` and `options`.
  10514. * The returned function takes a string to match as its only argument and returns
  10515. * true if the string is a match.
  10516. *
  10517. * ```js
  10518. * var nm = require('nanomatch');
  10519. * nm.matcher(pattern[, options]);
  10520. *
  10521. * var isMatch = nm.matcher('*.!(*a)');
  10522. * console.log(isMatch('a.a'));
  10523. * //=> false
  10524. * console.log(isMatch('a.b'));
  10525. * //=> true
  10526. * ```
  10527. * @param {String} `pattern` Glob pattern
  10528. * @param {Object} `options` See available [options](#options) for changing how matches are performed.
  10529. * @return {Function} Returns a matcher function.
  10530. * @api public
  10531. */
  10532. nanomatch.matcher = function matcher(pattern, options) {
  10533. if (utils.isEmptyString(pattern)) {
  10534. return function () {
  10535. return false;
  10536. };
  10537. }
  10538. if (Array.isArray(pattern)) {
  10539. return compose(pattern, options, matcher);
  10540. } // if pattern is a regex
  10541. if (pattern instanceof RegExp) {
  10542. return test(pattern);
  10543. } // if pattern is invalid
  10544. if (!utils.isString(pattern)) {
  10545. throw new TypeError('expected pattern to be an array, string or regex');
  10546. } // if pattern is a non-glob string
  10547. if (!utils.hasSpecialChars(pattern)) {
  10548. if (options && options.nocase === true) {
  10549. pattern = pattern.toLowerCase();
  10550. }
  10551. return utils.matchPath(pattern, options);
  10552. } // if pattern is a glob string
  10553. var re = nanomatch.makeRe(pattern, options); // if `options.matchBase` or `options.basename` is defined
  10554. if (nanomatch.matchBase(pattern, options)) {
  10555. return utils.matchBasename(re, options);
  10556. }
  10557. function test(regex) {
  10558. var equals = utils.equalsPattern(options);
  10559. var unixify = utils.unixify(options);
  10560. return function (str) {
  10561. if (equals(str)) {
  10562. return true;
  10563. }
  10564. if (regex.test(unixify(str))) {
  10565. return true;
  10566. }
  10567. return false;
  10568. };
  10569. } // create matcher function
  10570. var matcherFn = test(re); // set result object from compiler on matcher function,
  10571. // as a non-enumerable property. useful for debugging
  10572. utils.define(matcherFn, 'result', re.result);
  10573. return matcherFn;
  10574. };
  10575. /**
  10576. * Returns an array of matches captured by `pattern` in `string, or
  10577. * `null` if the pattern did not match.
  10578. *
  10579. * ```js
  10580. * var nm = require('nanomatch');
  10581. * nm.capture(pattern, string[, options]);
  10582. *
  10583. * console.log(nm.capture('test/*.js', 'test/foo.js'));
  10584. * //=> ['foo']
  10585. * console.log(nm.capture('test/*.js', 'foo/bar.css'));
  10586. * //=> null
  10587. * ```
  10588. * @param {String} `pattern` Glob pattern to use for matching.
  10589. * @param {String} `string` String to match
  10590. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  10591. * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`.
  10592. * @api public
  10593. */
  10594. nanomatch.capture = function (pattern, str, options) {
  10595. var re = nanomatch.makeRe(pattern, extend({
  10596. capture: true
  10597. }, options));
  10598. var unixify = utils.unixify(options);
  10599. function match() {
  10600. return function (string) {
  10601. var match = re.exec(unixify(string));
  10602. if (!match) {
  10603. return null;
  10604. }
  10605. return match.slice(1);
  10606. };
  10607. }
  10608. var capture = memoize('capture', pattern, options, match);
  10609. return capture(str);
  10610. };
  10611. /**
  10612. * Create a regular expression from the given glob `pattern`.
  10613. *
  10614. * ```js
  10615. * var nm = require('nanomatch');
  10616. * nm.makeRe(pattern[, options]);
  10617. *
  10618. * console.log(nm.makeRe('*.js'));
  10619. * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
  10620. * ```
  10621. * @param {String} `pattern` A glob pattern to convert to regex.
  10622. * @param {Object} `options` See available [options](#options) for changing how matches are performed.
  10623. * @return {RegExp} Returns a regex created from the given pattern.
  10624. * @api public
  10625. */
  10626. nanomatch.makeRe = function (pattern, options) {
  10627. if (pattern instanceof RegExp) {
  10628. return pattern;
  10629. }
  10630. if (typeof pattern !== 'string') {
  10631. throw new TypeError('expected pattern to be a string');
  10632. }
  10633. if (pattern.length > MAX_LENGTH) {
  10634. throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
  10635. }
  10636. function makeRe() {
  10637. var opts = utils.extend({
  10638. wrap: false
  10639. }, options);
  10640. var result = nanomatch.create(pattern, opts);
  10641. var regex = toRegex(result.output, opts);
  10642. utils.define(regex, 'result', result);
  10643. return regex;
  10644. }
  10645. return memoize('makeRe', pattern, options, makeRe);
  10646. };
  10647. /**
  10648. * Parses the given glob `pattern` and returns an object with the compiled `output`
  10649. * and optional source `map`.
  10650. *
  10651. * ```js
  10652. * var nm = require('nanomatch');
  10653. * nm.create(pattern[, options]);
  10654. *
  10655. * console.log(nm.create('abc/*.js'));
  10656. * // { options: { source: 'string', sourcemap: true },
  10657. * // state: {},
  10658. * // compilers:
  10659. * // { ... },
  10660. * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js',
  10661. * // ast:
  10662. * // { type: 'root',
  10663. * // errors: [],
  10664. * // nodes:
  10665. * // [ ... ],
  10666. * // dot: false,
  10667. * // input: 'abc/*.js' },
  10668. * // parsingErrors: [],
  10669. * // map:
  10670. * // { version: 3,
  10671. * // sources: [ 'string' ],
  10672. * // names: [],
  10673. * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE',
  10674. * // sourcesContent: [ 'abc/*.js' ] },
  10675. * // position: { line: 1, column: 28 },
  10676. * // content: {},
  10677. * // files: {},
  10678. * // idx: 6 }
  10679. * ```
  10680. * @param {String} `pattern` Glob pattern to parse and compile.
  10681. * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed.
  10682. * @return {Object} Returns an object with the parsed AST, compiled string and optional source map.
  10683. * @api public
  10684. */
  10685. nanomatch.create = function (pattern, options) {
  10686. if (typeof pattern !== 'string') {
  10687. throw new TypeError('expected a string');
  10688. }
  10689. function create() {
  10690. return nanomatch.compile(nanomatch.parse(pattern, options), options);
  10691. }
  10692. return memoize('create', pattern, options, create);
  10693. };
  10694. /**
  10695. * Parse the given `str` with the given `options`.
  10696. *
  10697. * ```js
  10698. * var nm = require('nanomatch');
  10699. * nm.parse(pattern[, options]);
  10700. *
  10701. * var ast = nm.parse('a/{b,c}/d');
  10702. * console.log(ast);
  10703. * // { type: 'root',
  10704. * // errors: [],
  10705. * // input: 'a/{b,c}/d',
  10706. * // nodes:
  10707. * // [ { type: 'bos', val: '' },
  10708. * // { type: 'text', val: 'a/' },
  10709. * // { type: 'brace',
  10710. * // nodes:
  10711. * // [ { type: 'brace.open', val: '{' },
  10712. * // { type: 'text', val: 'b,c' },
  10713. * // { type: 'brace.close', val: '}' } ] },
  10714. * // { type: 'text', val: '/d' },
  10715. * // { type: 'eos', val: '' } ] }
  10716. * ```
  10717. * @param {String} `str`
  10718. * @param {Object} `options`
  10719. * @return {Object} Returns an AST
  10720. * @api public
  10721. */
  10722. nanomatch.parse = function (pattern, options) {
  10723. if (typeof pattern !== 'string') {
  10724. throw new TypeError('expected a string');
  10725. }
  10726. function parse() {
  10727. var snapdragon = utils.instantiate(null, options);
  10728. parsers(snapdragon, options);
  10729. var ast = snapdragon.parse(pattern, options);
  10730. utils.define(ast, 'snapdragon', snapdragon);
  10731. ast.input = pattern;
  10732. return ast;
  10733. }
  10734. return memoize('parse', pattern, options, parse);
  10735. };
  10736. /**
  10737. * Compile the given `ast` or string with the given `options`.
  10738. *
  10739. * ```js
  10740. * var nm = require('nanomatch');
  10741. * nm.compile(ast[, options]);
  10742. *
  10743. * var ast = nm.parse('a/{b,c}/d');
  10744. * console.log(nm.compile(ast));
  10745. * // { options: { source: 'string' },
  10746. * // state: {},
  10747. * // compilers:
  10748. * // { eos: [Function],
  10749. * // noop: [Function],
  10750. * // bos: [Function],
  10751. * // brace: [Function],
  10752. * // 'brace.open': [Function],
  10753. * // text: [Function],
  10754. * // 'brace.close': [Function] },
  10755. * // output: [ 'a/(b|c)/d' ],
  10756. * // ast:
  10757. * // { ... },
  10758. * // parsingErrors: [] }
  10759. * ```
  10760. * @param {Object|String} `ast`
  10761. * @param {Object} `options`
  10762. * @return {Object} Returns an object that has an `output` property with the compiled string.
  10763. * @api public
  10764. */
  10765. nanomatch.compile = function (ast, options) {
  10766. if (typeof ast === 'string') {
  10767. ast = nanomatch.parse(ast, options);
  10768. }
  10769. function compile() {
  10770. var snapdragon = utils.instantiate(ast, options);
  10771. compilers(snapdragon, options);
  10772. return snapdragon.compile(ast, options);
  10773. }
  10774. return memoize('compile', ast.input, options, compile);
  10775. };
  10776. /**
  10777. * Clear the regex cache.
  10778. *
  10779. * ```js
  10780. * nm.clearCache();
  10781. * ```
  10782. * @api public
  10783. */
  10784. nanomatch.clearCache = function () {
  10785. nanomatch.cache.__data__ = {};
  10786. };
  10787. /**
  10788. * Compose a matcher function with the given patterns.
  10789. * This allows matcher functions to be compiled once and
  10790. * called multiple times.
  10791. */
  10792. function compose(patterns, options, matcher) {
  10793. var matchers;
  10794. return memoize('compose', String(patterns), options, function () {
  10795. return function (file) {
  10796. // delay composition until it's invoked the first time,
  10797. // after that it won't be called again
  10798. if (!matchers) {
  10799. matchers = [];
  10800. for (var i = 0; i < patterns.length; i++) {
  10801. matchers.push(matcher(patterns[i], options));
  10802. }
  10803. }
  10804. var len = matchers.length;
  10805. while (len--) {
  10806. if (matchers[len](file) === true) {
  10807. return true;
  10808. }
  10809. }
  10810. return false;
  10811. };
  10812. });
  10813. }
  10814. /**
  10815. * Memoize a generated regex or function. A unique key is generated
  10816. * from the `type` (usually method name), the `pattern`, and
  10817. * user-defined options.
  10818. */
  10819. function memoize(type, pattern, options, fn) {
  10820. var key = utils.createKey(type + '=' + pattern, options);
  10821. if (options && options.cache === false) {
  10822. return fn(pattern, options);
  10823. }
  10824. if (cache.has(type, key)) {
  10825. return cache.get(type, key);
  10826. }
  10827. var val = fn(pattern, options);
  10828. cache.set(type, key, val);
  10829. return val;
  10830. }
  10831. /**
  10832. * Expose compiler, parser and cache on `nanomatch`
  10833. */
  10834. nanomatch.compilers = compilers;
  10835. nanomatch.parsers = parsers;
  10836. nanomatch.cache = cache;
  10837. /**
  10838. * Expose `nanomatch`
  10839. * @type {Function}
  10840. */
  10841. module.exports = nanomatch;
  10842. /***/ }),
  10843. /***/ "./node_modules/nanomatch/lib/cache.js":
  10844. /*!*********************************************!*\
  10845. !*** ./node_modules/nanomatch/lib/cache.js ***!
  10846. \*********************************************/
  10847. /*! no static exports found */
  10848. /***/ (function(module, exports, __webpack_require__) {
  10849. "use strict";
  10850. module.exports = new (__webpack_require__(/*! fragment-cache */ "./node_modules/fragment-cache/index.js"))();
  10851. /***/ }),
  10852. /***/ "./node_modules/nanomatch/lib/compilers.js":
  10853. /*!*************************************************!*\
  10854. !*** ./node_modules/nanomatch/lib/compilers.js ***!
  10855. \*************************************************/
  10856. /*! no static exports found */
  10857. /***/ (function(module, exports, __webpack_require__) {
  10858. "use strict";
  10859. /**
  10860. * Nanomatch compilers
  10861. */
  10862. module.exports = function (nanomatch, options) {
  10863. function slash() {
  10864. if (options && typeof options.slash === 'string') {
  10865. return options.slash;
  10866. }
  10867. if (options && typeof options.slash === 'function') {
  10868. return options.slash.call(nanomatch);
  10869. }
  10870. return '\\\\/';
  10871. }
  10872. function star() {
  10873. if (options && typeof options.star === 'string') {
  10874. return options.star;
  10875. }
  10876. if (options && typeof options.star === 'function') {
  10877. return options.star.call(nanomatch);
  10878. }
  10879. return '[^' + slash() + ']*?';
  10880. }
  10881. var ast = nanomatch.ast = nanomatch.parser.ast;
  10882. ast.state = nanomatch.parser.state;
  10883. nanomatch.compiler.state = ast.state;
  10884. nanomatch.compiler
  10885. /**
  10886. * Negation / escaping
  10887. */
  10888. .set('not', function (node) {
  10889. var prev = this.prev();
  10890. if (this.options.nonegate === true || prev.type !== 'bos') {
  10891. return this.emit('\\' + node.val, node);
  10892. }
  10893. return this.emit(node.val, node);
  10894. }).set('escape', function (node) {
  10895. if (this.options.unescape && /^[-\w_.]/.test(node.val)) {
  10896. return this.emit(node.val, node);
  10897. }
  10898. return this.emit('\\' + node.val, node);
  10899. }).set('quoted', function (node) {
  10900. return this.emit(node.val, node);
  10901. })
  10902. /**
  10903. * Regex
  10904. */
  10905. .set('dollar', function (node) {
  10906. if (node.parent.type === 'bracket') {
  10907. return this.emit(node.val, node);
  10908. }
  10909. return this.emit('\\' + node.val, node);
  10910. })
  10911. /**
  10912. * Dot: "."
  10913. */
  10914. .set('dot', function (node) {
  10915. if (node.dotfiles === true) this.dotfiles = true;
  10916. return this.emit('\\' + node.val, node);
  10917. })
  10918. /**
  10919. * Slashes: "/" and "\"
  10920. */
  10921. .set('backslash', function (node) {
  10922. return this.emit(node.val, node);
  10923. }).set('slash', function (node, nodes, i) {
  10924. var val = '[' + slash() + ']';
  10925. var parent = node.parent;
  10926. var prev = this.prev(); // set "node.hasSlash" to true on all ancestor parens nodes
  10927. while (parent.type === 'paren' && !parent.hasSlash) {
  10928. parent.hasSlash = true;
  10929. parent = parent.parent;
  10930. }
  10931. if (prev.addQmark) {
  10932. val += '?';
  10933. } // word boundary
  10934. if (node.rest.slice(0, 2) === '\\b') {
  10935. return this.emit(val, node);
  10936. } // globstars
  10937. if (node.parsed === '**' || node.parsed === './**') {
  10938. this.output = '(?:' + this.output;
  10939. return this.emit(val + ')?', node);
  10940. } // negation
  10941. if (node.parsed === '!**' && this.options.nonegate !== true) {
  10942. return this.emit(val + '?\\b', node);
  10943. }
  10944. return this.emit(val, node);
  10945. })
  10946. /**
  10947. * Square brackets
  10948. */
  10949. .set('bracket', function (node) {
  10950. var close = node.close;
  10951. var open = !node.escaped ? '[' : '\\[';
  10952. var negated = node.negated;
  10953. var inner = node.inner;
  10954. var val = node.val;
  10955. if (node.escaped === true) {
  10956. inner = inner.replace(/\\?(\W)/g, '\\$1');
  10957. negated = '';
  10958. }
  10959. if (inner === ']-') {
  10960. inner = '\\]\\-';
  10961. }
  10962. if (negated && inner.indexOf('.') === -1) {
  10963. inner += '.';
  10964. }
  10965. if (negated && inner.indexOf('/') === -1) {
  10966. inner += '/';
  10967. }
  10968. val = open + negated + inner + close;
  10969. return this.emit(val, node);
  10970. })
  10971. /**
  10972. * Square: "[.]" (only matches a single character in brackets)
  10973. */
  10974. .set('square', function (node) {
  10975. var val = (/^\W/.test(node.val) ? '\\' : '') + node.val;
  10976. return this.emit(val, node);
  10977. })
  10978. /**
  10979. * Question mark: "?"
  10980. */
  10981. .set('qmark', function (node) {
  10982. var prev = this.prev(); // don't use "slash" variable so that we always avoid
  10983. // matching backslashes and slashes with a qmark
  10984. var val = '[^.\\\\/]';
  10985. if (this.options.dot || prev.type !== 'bos' && prev.type !== 'slash') {
  10986. val = '[^\\\\/]';
  10987. }
  10988. if (node.parsed.slice(-1) === '(') {
  10989. var ch = node.rest.charAt(0);
  10990. if (ch === '!' || ch === '=' || ch === ':') {
  10991. return this.emit(node.val, node);
  10992. }
  10993. }
  10994. if (node.val.length > 1) {
  10995. val += '{' + node.val.length + '}';
  10996. }
  10997. return this.emit(val, node);
  10998. })
  10999. /**
  11000. * Plus
  11001. */
  11002. .set('plus', function (node) {
  11003. var prev = node.parsed.slice(-1);
  11004. if (prev === ']' || prev === ')') {
  11005. return this.emit(node.val, node);
  11006. }
  11007. if (!this.output || /[?*+]/.test(ch) && node.parent.type !== 'bracket') {
  11008. return this.emit('\\+', node);
  11009. }
  11010. var ch = this.output.slice(-1);
  11011. if (/\w/.test(ch) && !node.inside) {
  11012. return this.emit('+\\+?', node);
  11013. }
  11014. return this.emit('+', node);
  11015. })
  11016. /**
  11017. * globstar: '**'
  11018. */
  11019. .set('globstar', function (node, nodes, i) {
  11020. if (!this.output) {
  11021. this.state.leadingGlobstar = true;
  11022. }
  11023. var prev = this.prev();
  11024. var before = this.prev(2);
  11025. var next = this.next();
  11026. var after = this.next(2);
  11027. var type = prev.type;
  11028. var val = node.val;
  11029. if (prev.type === 'slash' && next.type === 'slash') {
  11030. if (before.type === 'text') {
  11031. this.output += '?';
  11032. if (after.type !== 'text') {
  11033. this.output += '\\b';
  11034. }
  11035. }
  11036. }
  11037. var parsed = node.parsed;
  11038. if (parsed.charAt(0) === '!') {
  11039. parsed = parsed.slice(1);
  11040. }
  11041. var isInside = node.isInside.paren || node.isInside.brace;
  11042. if (parsed && type !== 'slash' && type !== 'bos' && !isInside) {
  11043. val = star();
  11044. } else {
  11045. val = this.options.dot !== true ? '(?:(?!(?:[' + slash() + ']|^)\\.).)*?' : '(?:(?!(?:[' + slash() + ']|^)(?:\\.{1,2})($|[' + slash() + ']))(?!\\.{2}).)*?';
  11046. }
  11047. if ((type === 'slash' || type === 'bos') && this.options.dot !== true) {
  11048. val = '(?!\\.)' + val;
  11049. }
  11050. if (prev.type === 'slash' && next.type === 'slash' && before.type !== 'text') {
  11051. if (after.type === 'text' || after.type === 'star') {
  11052. node.addQmark = true;
  11053. }
  11054. }
  11055. if (this.options.capture) {
  11056. val = '(' + val + ')';
  11057. }
  11058. return this.emit(val, node);
  11059. })
  11060. /**
  11061. * Star: "*"
  11062. */
  11063. .set('star', function (node, nodes, i) {
  11064. var prior = nodes[i - 2] || {};
  11065. var prev = this.prev();
  11066. var next = this.next();
  11067. var type = prev.type;
  11068. function isStart(n) {
  11069. return n.type === 'bos' || n.type === 'slash';
  11070. }
  11071. if (this.output === '' && this.options.contains !== true) {
  11072. this.output = '(?![' + slash() + '])';
  11073. }
  11074. if (type === 'bracket' && this.options.bash === false) {
  11075. var str = next && next.type === 'bracket' ? star() : '*?';
  11076. if (!prev.nodes || prev.nodes[1].type !== 'posix') {
  11077. return this.emit(str, node);
  11078. }
  11079. }
  11080. var prefix = !this.dotfiles && type !== 'text' && type !== 'escape' ? this.options.dot ? '(?!(?:^|[' + slash() + '])\\.{1,2}(?:$|[' + slash() + ']))' : '(?!\\.)' : '';
  11081. if (isStart(prev) || isStart(prior) && type === 'not') {
  11082. if (prefix !== '(?!\\.)') {
  11083. prefix += '(?!(\\.{2}|\\.[' + slash() + ']))(?=.)';
  11084. } else {
  11085. prefix += '(?=.)';
  11086. }
  11087. } else if (prefix === '(?!\\.)') {
  11088. prefix = '';
  11089. }
  11090. if (prev.type === 'not' && prior.type === 'bos' && this.options.dot === true) {
  11091. this.output = '(?!\\.)' + this.output;
  11092. }
  11093. var output = prefix + star();
  11094. if (this.options.capture) {
  11095. output = '(' + output + ')';
  11096. }
  11097. return this.emit(output, node);
  11098. })
  11099. /**
  11100. * Text
  11101. */
  11102. .set('text', function (node) {
  11103. return this.emit(node.val, node);
  11104. })
  11105. /**
  11106. * End-of-string
  11107. */
  11108. .set('eos', function (node) {
  11109. var prev = this.prev();
  11110. var val = node.val;
  11111. this.output = '(?:\\.[' + slash() + '](?=.))?' + this.output;
  11112. if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') {
  11113. val += this.options.contains ? '[' + slash() + ']?' : '(?:[' + slash() + ']|$)';
  11114. }
  11115. return this.emit(val, node);
  11116. });
  11117. /**
  11118. * Allow custom compilers to be passed on options
  11119. */
  11120. if (options && typeof options.compilers === 'function') {
  11121. options.compilers(nanomatch.compiler);
  11122. }
  11123. };
  11124. /***/ }),
  11125. /***/ "./node_modules/nanomatch/lib/parsers.js":
  11126. /*!***********************************************!*\
  11127. !*** ./node_modules/nanomatch/lib/parsers.js ***!
  11128. \***********************************************/
  11129. /*! no static exports found */
  11130. /***/ (function(module, exports, __webpack_require__) {
  11131. "use strict";
  11132. var regexNot = __webpack_require__(/*! regex-not */ "./node_modules/regex-not/index.js");
  11133. var toRegex = __webpack_require__(/*! to-regex */ "./node_modules/to-regex/index.js");
  11134. /**
  11135. * Characters to use in negation regex (we want to "not" match
  11136. * characters that are matched by other parsers)
  11137. */
  11138. var cached;
  11139. var NOT_REGEX = '[\\[!*+?$^"\'.\\\\/]+';
  11140. var not = createTextRegex(NOT_REGEX);
  11141. /**
  11142. * Nanomatch parsers
  11143. */
  11144. module.exports = function (nanomatch, options) {
  11145. var parser = nanomatch.parser;
  11146. var opts = parser.options;
  11147. parser.state = {
  11148. slashes: 0,
  11149. paths: []
  11150. };
  11151. parser.ast.state = parser.state;
  11152. parser
  11153. /**
  11154. * Beginning-of-string
  11155. */
  11156. .capture('prefix', function () {
  11157. if (this.parsed) return;
  11158. var m = this.match(/^\.[\\/]/);
  11159. if (!m) return;
  11160. this.state.strictOpen = !!this.options.strictOpen;
  11161. this.state.addPrefix = true;
  11162. })
  11163. /**
  11164. * Escape: "\\."
  11165. */
  11166. .capture('escape', function () {
  11167. if (this.isInside('bracket')) return;
  11168. var pos = this.position();
  11169. var m = this.match(/^(?:\\(.)|([$^]))/);
  11170. if (!m) return;
  11171. return pos({
  11172. type: 'escape',
  11173. val: m[2] || m[1]
  11174. });
  11175. })
  11176. /**
  11177. * Quoted strings
  11178. */
  11179. .capture('quoted', function () {
  11180. var pos = this.position();
  11181. var m = this.match(/^["']/);
  11182. if (!m) return;
  11183. var quote = m[0];
  11184. if (this.input.indexOf(quote) === -1) {
  11185. return pos({
  11186. type: 'escape',
  11187. val: quote
  11188. });
  11189. }
  11190. var tok = advanceTo(this.input, quote);
  11191. this.consume(tok.len);
  11192. return pos({
  11193. type: 'quoted',
  11194. val: tok.esc
  11195. });
  11196. })
  11197. /**
  11198. * Negations: "!"
  11199. */
  11200. .capture('not', function () {
  11201. var parsed = this.parsed;
  11202. var pos = this.position();
  11203. var m = this.match(this.notRegex || /^!+/);
  11204. if (!m) return;
  11205. var val = m[0];
  11206. var isNegated = val.length % 2 === 1;
  11207. if (parsed === '' && !isNegated) {
  11208. val = '';
  11209. } // if nothing has been parsed, we know `!` is at the start,
  11210. // so we need to wrap the result in a negation regex
  11211. if (parsed === '' && isNegated && this.options.nonegate !== true) {
  11212. this.bos.val = '(?!^(?:';
  11213. this.append = ')$).*';
  11214. val = '';
  11215. }
  11216. return pos({
  11217. type: 'not',
  11218. val: val
  11219. });
  11220. })
  11221. /**
  11222. * Dot: "."
  11223. */
  11224. .capture('dot', function () {
  11225. var parsed = this.parsed;
  11226. var pos = this.position();
  11227. var m = this.match(/^\.+/);
  11228. if (!m) return;
  11229. var val = m[0];
  11230. this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/');
  11231. return pos({
  11232. type: 'dot',
  11233. dotfiles: this.state.dot,
  11234. val: val
  11235. });
  11236. })
  11237. /**
  11238. * Plus: "+"
  11239. */
  11240. .capture('plus', /^\+(?!\()/)
  11241. /**
  11242. * Question mark: "?"
  11243. */
  11244. .capture('qmark', function () {
  11245. var parsed = this.parsed;
  11246. var pos = this.position();
  11247. var m = this.match(/^\?+(?!\()/);
  11248. if (!m) return;
  11249. this.state.metachar = true;
  11250. this.state.qmark = true;
  11251. return pos({
  11252. type: 'qmark',
  11253. parsed: parsed,
  11254. val: m[0]
  11255. });
  11256. })
  11257. /**
  11258. * Globstar: "**"
  11259. */
  11260. .capture('globstar', function () {
  11261. var parsed = this.parsed;
  11262. var pos = this.position();
  11263. var m = this.match(/^\*{2}(?![*(])(?=[,)/]|$)/);
  11264. if (!m) return;
  11265. var type = opts.noglobstar !== true ? 'globstar' : 'star';
  11266. var node = pos({
  11267. type: type,
  11268. parsed: parsed
  11269. });
  11270. this.state.metachar = true;
  11271. while (this.input.slice(0, 4) === '/**/') {
  11272. this.input = this.input.slice(3);
  11273. }
  11274. node.isInside = {
  11275. brace: this.isInside('brace'),
  11276. paren: this.isInside('paren')
  11277. };
  11278. if (type === 'globstar') {
  11279. this.state.globstar = true;
  11280. node.val = '**';
  11281. } else {
  11282. this.state.star = true;
  11283. node.val = '*';
  11284. }
  11285. return node;
  11286. })
  11287. /**
  11288. * Star: "*"
  11289. */
  11290. .capture('star', function () {
  11291. var pos = this.position();
  11292. var starRe = /^(?:\*(?![*(])|[*]{3,}(?!\()|[*]{2}(?![(/]|$)|\*(?=\*\())/;
  11293. var m = this.match(starRe);
  11294. if (!m) return;
  11295. this.state.metachar = true;
  11296. this.state.star = true;
  11297. return pos({
  11298. type: 'star',
  11299. val: m[0]
  11300. });
  11301. })
  11302. /**
  11303. * Slash: "/"
  11304. */
  11305. .capture('slash', function () {
  11306. var pos = this.position();
  11307. var m = this.match(/^\//);
  11308. if (!m) return;
  11309. this.state.slashes++;
  11310. return pos({
  11311. type: 'slash',
  11312. val: m[0]
  11313. });
  11314. })
  11315. /**
  11316. * Backslash: "\\"
  11317. */
  11318. .capture('backslash', function () {
  11319. var pos = this.position();
  11320. var m = this.match(/^\\(?![*+?(){}[\]'"])/);
  11321. if (!m) return;
  11322. var val = m[0];
  11323. if (this.isInside('bracket')) {
  11324. val = '\\';
  11325. } else if (val.length > 1) {
  11326. val = '\\\\';
  11327. }
  11328. return pos({
  11329. type: 'backslash',
  11330. val: val
  11331. });
  11332. })
  11333. /**
  11334. * Square: "[.]"
  11335. */
  11336. .capture('square', function () {
  11337. if (this.isInside('bracket')) return;
  11338. var pos = this.position();
  11339. var m = this.match(/^\[([^!^\\])\]/);
  11340. if (!m) return;
  11341. return pos({
  11342. type: 'square',
  11343. val: m[1]
  11344. });
  11345. })
  11346. /**
  11347. * Brackets: "[...]" (basic, this can be overridden by other parsers)
  11348. */
  11349. .capture('bracket', function () {
  11350. var pos = this.position();
  11351. var m = this.match(/^(?:\[([!^]?)([^\]]+|\]-)(\]|[^*+?]+)|\[)/);
  11352. if (!m) return;
  11353. var val = m[0];
  11354. var negated = m[1] ? '^' : '';
  11355. var inner = (m[2] || '').replace(/\\\\+/, '\\\\');
  11356. var close = m[3] || '';
  11357. if (m[2] && inner.length < m[2].length) {
  11358. val = val.replace(/\\\\+/, '\\\\');
  11359. }
  11360. var esc = this.input.slice(0, 2);
  11361. if (inner === '' && esc === '\\]') {
  11362. inner += esc;
  11363. this.consume(2);
  11364. var str = this.input;
  11365. var idx = -1;
  11366. var ch;
  11367. while (ch = str[++idx]) {
  11368. this.consume(1);
  11369. if (ch === ']') {
  11370. close = ch;
  11371. break;
  11372. }
  11373. inner += ch;
  11374. }
  11375. }
  11376. return pos({
  11377. type: 'bracket',
  11378. val: val,
  11379. escaped: close !== ']',
  11380. negated: negated,
  11381. inner: inner,
  11382. close: close
  11383. });
  11384. })
  11385. /**
  11386. * Text
  11387. */
  11388. .capture('text', function () {
  11389. if (this.isInside('bracket')) return;
  11390. var pos = this.position();
  11391. var m = this.match(not);
  11392. if (!m || !m[0]) return;
  11393. return pos({
  11394. type: 'text',
  11395. val: m[0]
  11396. });
  11397. });
  11398. /**
  11399. * Allow custom parsers to be passed on options
  11400. */
  11401. if (options && typeof options.parsers === 'function') {
  11402. options.parsers(nanomatch.parser);
  11403. }
  11404. };
  11405. /**
  11406. * Advance to the next non-escaped character
  11407. */
  11408. function advanceTo(input, endChar) {
  11409. var ch = input.charAt(0);
  11410. var tok = {
  11411. len: 1,
  11412. val: '',
  11413. esc: ''
  11414. };
  11415. var idx = 0;
  11416. function advance() {
  11417. if (ch !== '\\') {
  11418. tok.esc += '\\' + ch;
  11419. tok.val += ch;
  11420. }
  11421. ch = input.charAt(++idx);
  11422. tok.len++;
  11423. if (ch === '\\') {
  11424. advance();
  11425. advance();
  11426. }
  11427. }
  11428. while (ch && ch !== endChar) {
  11429. advance();
  11430. }
  11431. return tok;
  11432. }
  11433. /**
  11434. * Create text regex
  11435. */
  11436. function createTextRegex(pattern) {
  11437. if (cached) return cached;
  11438. var opts = {
  11439. contains: true,
  11440. strictClose: false
  11441. };
  11442. var not = regexNot.create(pattern, opts);
  11443. var re = toRegex('^(?:[*]\\((?=.)|' + not + ')', opts);
  11444. return cached = re;
  11445. }
  11446. /**
  11447. * Expose negation string
  11448. */
  11449. module.exports.not = NOT_REGEX;
  11450. /***/ }),
  11451. /***/ "./node_modules/nanomatch/lib/utils.js":
  11452. /*!*********************************************!*\
  11453. !*** ./node_modules/nanomatch/lib/utils.js ***!
  11454. \*********************************************/
  11455. /*! no static exports found */
  11456. /***/ (function(module, exports, __webpack_require__) {
  11457. "use strict";
  11458. var utils = module.exports;
  11459. var path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js");
  11460. /**
  11461. * Module dependencies
  11462. */
  11463. var isWindows = __webpack_require__(/*! is-windows */ "./node_modules/is-windows/index.js")();
  11464. var Snapdragon = __webpack_require__(/*! snapdragon */ "./node_modules/snapdragon/index.js");
  11465. utils.define = __webpack_require__(/*! define-property */ "./node_modules/nanomatch/node_modules/define-property/index.js");
  11466. utils.diff = __webpack_require__(/*! arr-diff */ "./node_modules/arr-diff/index.js");
  11467. utils.extend = __webpack_require__(/*! extend-shallow */ "./node_modules/nanomatch/node_modules/extend-shallow/index.js");
  11468. utils.pick = __webpack_require__(/*! object.pick */ "./node_modules/object.pick/index.js");
  11469. utils.typeOf = __webpack_require__(/*! kind-of */ "./node_modules/nanomatch/node_modules/kind-of/index.js");
  11470. utils.unique = __webpack_require__(/*! array-unique */ "./node_modules/array-unique/index.js");
  11471. /**
  11472. * Returns true if the given value is effectively an empty string
  11473. */
  11474. utils.isEmptyString = function (val) {
  11475. return String(val) === '' || String(val) === './';
  11476. };
  11477. /**
  11478. * Returns true if the platform is windows, or `path.sep` is `\\`.
  11479. * This is defined as a function to allow `path.sep` to be set in unit tests,
  11480. * or by the user, if there is a reason to do so.
  11481. * @return {Boolean}
  11482. */
  11483. utils.isWindows = function () {
  11484. return path.sep === '\\' || isWindows === true;
  11485. };
  11486. /**
  11487. * Return the last element from an array
  11488. */
  11489. utils.last = function (arr, n) {
  11490. return arr[arr.length - (n || 1)];
  11491. };
  11492. /**
  11493. * Get the `Snapdragon` instance to use
  11494. */
  11495. utils.instantiate = function (ast, options) {
  11496. var snapdragon; // if an instance was created by `.parse`, use that instance
  11497. if (utils.typeOf(ast) === 'object' && ast.snapdragon) {
  11498. snapdragon = ast.snapdragon; // if the user supplies an instance on options, use that instance
  11499. } else if (utils.typeOf(options) === 'object' && options.snapdragon) {
  11500. snapdragon = options.snapdragon; // create a new instance
  11501. } else {
  11502. snapdragon = new Snapdragon(options);
  11503. }
  11504. utils.define(snapdragon, 'parse', function (str, options) {
  11505. var parsed = Snapdragon.prototype.parse.call(this, str, options);
  11506. parsed.input = str; // escape unmatched brace/bracket/parens
  11507. var last = this.parser.stack.pop();
  11508. if (last && this.options.strictErrors !== true) {
  11509. var open = last.nodes[0];
  11510. var inner = last.nodes[1];
  11511. if (last.type === 'bracket') {
  11512. if (inner.val.charAt(0) === '[') {
  11513. inner.val = '\\' + inner.val;
  11514. }
  11515. } else {
  11516. open.val = '\\' + open.val;
  11517. var sibling = open.parent.nodes[1];
  11518. if (sibling.type === 'star') {
  11519. sibling.loose = true;
  11520. }
  11521. }
  11522. } // add non-enumerable parser reference
  11523. utils.define(parsed, 'parser', this.parser);
  11524. return parsed;
  11525. });
  11526. return snapdragon;
  11527. };
  11528. /**
  11529. * Create the key to use for memoization. The key is generated
  11530. * by iterating over the options and concatenating key-value pairs
  11531. * to the pattern string.
  11532. */
  11533. utils.createKey = function (pattern, options) {
  11534. if (typeof options === 'undefined') {
  11535. return pattern;
  11536. }
  11537. var key = pattern;
  11538. for (var prop in options) {
  11539. if (options.hasOwnProperty(prop)) {
  11540. key += ';' + prop + '=' + String(options[prop]);
  11541. }
  11542. }
  11543. return key;
  11544. };
  11545. /**
  11546. * Cast `val` to an array
  11547. * @return {Array}
  11548. */
  11549. utils.arrayify = function (val) {
  11550. if (typeof val === 'string') return [val];
  11551. return val ? Array.isArray(val) ? val : [val] : [];
  11552. };
  11553. /**
  11554. * Return true if `val` is a non-empty string
  11555. */
  11556. utils.isString = function (val) {
  11557. return typeof val === 'string';
  11558. };
  11559. /**
  11560. * Return true if `val` is a non-empty string
  11561. */
  11562. utils.isRegex = function (val) {
  11563. return utils.typeOf(val) === 'regexp';
  11564. };
  11565. /**
  11566. * Return true if `val` is a non-empty string
  11567. */
  11568. utils.isObject = function (val) {
  11569. return utils.typeOf(val) === 'object';
  11570. };
  11571. /**
  11572. * Escape regex characters in the given string
  11573. */
  11574. utils.escapeRegex = function (str) {
  11575. return str.replace(/[-[\]{}()^$|*+?.\\/\s]/g, '\\$&');
  11576. };
  11577. /**
  11578. * Combines duplicate characters in the provided `input` string.
  11579. * @param {String} `input`
  11580. * @returns {String}
  11581. */
  11582. utils.combineDupes = function (input, patterns) {
  11583. patterns = utils.arrayify(patterns).join('|').split('|');
  11584. patterns = patterns.map(function (s) {
  11585. return s.replace(/\\?([+*\\/])/g, '\\$1');
  11586. });
  11587. var substr = patterns.join('|');
  11588. var regex = new RegExp('(' + substr + ')(?=\\1)', 'g');
  11589. return input.replace(regex, '');
  11590. };
  11591. /**
  11592. * Returns true if the given `str` has special characters
  11593. */
  11594. utils.hasSpecialChars = function (str) {
  11595. return /(?:(?:(^|\/)[!.])|[*?+()|[\]{}]|[+@]\()/.test(str);
  11596. };
  11597. /**
  11598. * Normalize slashes in the given filepath.
  11599. *
  11600. * @param {String} `filepath`
  11601. * @return {String}
  11602. */
  11603. utils.toPosixPath = function (str) {
  11604. return str.replace(/\\+/g, '/');
  11605. };
  11606. /**
  11607. * Strip backslashes before special characters in a string.
  11608. *
  11609. * @param {String} `str`
  11610. * @return {String}
  11611. */
  11612. utils.unescape = function (str) {
  11613. return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, ''));
  11614. };
  11615. /**
  11616. * Strip the drive letter from a windows filepath
  11617. * @param {String} `fp`
  11618. * @return {String}
  11619. */
  11620. utils.stripDrive = function (fp) {
  11621. return utils.isWindows() ? fp.replace(/^[a-z]:[\\/]+?/i, '/') : fp;
  11622. };
  11623. /**
  11624. * Strip the prefix from a filepath
  11625. * @param {String} `fp`
  11626. * @return {String}
  11627. */
  11628. utils.stripPrefix = function (str) {
  11629. if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) {
  11630. return str.slice(2);
  11631. }
  11632. return str;
  11633. };
  11634. /**
  11635. * Returns true if `str` is a common character that doesn't need
  11636. * to be processed to be used for matching.
  11637. * @param {String} `str`
  11638. * @return {Boolean}
  11639. */
  11640. utils.isSimpleChar = function (str) {
  11641. return str.trim() === '' || str === '.';
  11642. };
  11643. /**
  11644. * Returns true if the given str is an escaped or
  11645. * unescaped path character
  11646. */
  11647. utils.isSlash = function (str) {
  11648. return str === '/' || str === '\\/' || str === '\\' || str === '\\\\';
  11649. };
  11650. /**
  11651. * Returns a function that returns true if the given
  11652. * pattern matches or contains a `filepath`
  11653. *
  11654. * @param {String} `pattern`
  11655. * @return {Function}
  11656. */
  11657. utils.matchPath = function (pattern, options) {
  11658. return options && options.contains ? utils.containsPattern(pattern, options) : utils.equalsPattern(pattern, options);
  11659. };
  11660. /**
  11661. * Returns true if the given (original) filepath or unixified path are equal
  11662. * to the given pattern.
  11663. */
  11664. utils._equals = function (filepath, unixPath, pattern) {
  11665. return pattern === filepath || pattern === unixPath;
  11666. };
  11667. /**
  11668. * Returns true if the given (original) filepath or unixified path contain
  11669. * the given pattern.
  11670. */
  11671. utils._contains = function (filepath, unixPath, pattern) {
  11672. return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1;
  11673. };
  11674. /**
  11675. * Returns a function that returns true if the given
  11676. * pattern is the same as a given `filepath`
  11677. *
  11678. * @param {String} `pattern`
  11679. * @return {Function}
  11680. */
  11681. utils.equalsPattern = function (pattern, options) {
  11682. var unixify = utils.unixify(options);
  11683. options = options || {};
  11684. return function fn(filepath) {
  11685. var equal = utils._equals(filepath, unixify(filepath), pattern);
  11686. if (equal === true || options.nocase !== true) {
  11687. return equal;
  11688. }
  11689. var lower = filepath.toLowerCase();
  11690. return utils._equals(lower, unixify(lower), pattern);
  11691. };
  11692. };
  11693. /**
  11694. * Returns a function that returns true if the given
  11695. * pattern contains a `filepath`
  11696. *
  11697. * @param {String} `pattern`
  11698. * @return {Function}
  11699. */
  11700. utils.containsPattern = function (pattern, options) {
  11701. var unixify = utils.unixify(options);
  11702. options = options || {};
  11703. return function (filepath) {
  11704. var contains = utils._contains(filepath, unixify(filepath), pattern);
  11705. if (contains === true || options.nocase !== true) {
  11706. return contains;
  11707. }
  11708. var lower = filepath.toLowerCase();
  11709. return utils._contains(lower, unixify(lower), pattern);
  11710. };
  11711. };
  11712. /**
  11713. * Returns a function that returns true if the given
  11714. * regex matches the `filename` of a file path.
  11715. *
  11716. * @param {RegExp} `re` Matching regex
  11717. * @return {Function}
  11718. */
  11719. utils.matchBasename = function (re) {
  11720. return function (filepath) {
  11721. return re.test(filepath) || re.test(path.basename(filepath));
  11722. };
  11723. };
  11724. /**
  11725. * Returns the given value unchanced.
  11726. * @return {any}
  11727. */
  11728. utils.identity = function (val) {
  11729. return val;
  11730. };
  11731. /**
  11732. * Determines the filepath to return based on the provided options.
  11733. * @return {any}
  11734. */
  11735. utils.value = function (str, unixify, options) {
  11736. if (options && options.unixify === false) {
  11737. return str;
  11738. }
  11739. if (options && typeof options.unixify === 'function') {
  11740. return options.unixify(str);
  11741. }
  11742. return unixify(str);
  11743. };
  11744. /**
  11745. * Returns a function that normalizes slashes in a string to forward
  11746. * slashes, strips `./` from beginning of paths, and optionally unescapes
  11747. * special characters.
  11748. * @return {Function}
  11749. */
  11750. utils.unixify = function (options) {
  11751. var opts = options || {};
  11752. return function (filepath) {
  11753. if (opts.stripPrefix !== false) {
  11754. filepath = utils.stripPrefix(filepath);
  11755. }
  11756. if (opts.unescape === true) {
  11757. filepath = utils.unescape(filepath);
  11758. }
  11759. if (opts.unixify === true || utils.isWindows()) {
  11760. filepath = utils.toPosixPath(filepath);
  11761. }
  11762. return filepath;
  11763. };
  11764. };
  11765. /***/ }),
  11766. /***/ "./node_modules/nanomatch/node_modules/define-property/index.js":
  11767. /*!**********************************************************************!*\
  11768. !*** ./node_modules/nanomatch/node_modules/define-property/index.js ***!
  11769. \**********************************************************************/
  11770. /*! no static exports found */
  11771. /***/ (function(module, exports, __webpack_require__) {
  11772. "use strict";
  11773. /*!
  11774. * define-property <https://github.com/jonschlinkert/define-property>
  11775. *
  11776. * Copyright (c) 2015-2018, Jon Schlinkert.
  11777. * Released under the MIT License.
  11778. */
  11779. var isobject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  11780. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/is-descriptor/index.js");
  11781. var define = typeof Reflect !== 'undefined' && Reflect.defineProperty ? Reflect.defineProperty : Object.defineProperty;
  11782. module.exports = function defineProperty(obj, key, val) {
  11783. if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) {
  11784. throw new TypeError('expected an object, function, or array');
  11785. }
  11786. if (typeof key !== 'string') {
  11787. throw new TypeError('expected "key" to be a string');
  11788. }
  11789. if (isDescriptor(val)) {
  11790. define(obj, key, val);
  11791. return obj;
  11792. }
  11793. define(obj, key, {
  11794. configurable: true,
  11795. enumerable: false,
  11796. writable: true,
  11797. value: val
  11798. });
  11799. return obj;
  11800. };
  11801. /***/ }),
  11802. /***/ "./node_modules/nanomatch/node_modules/extend-shallow/index.js":
  11803. /*!*********************************************************************!*\
  11804. !*** ./node_modules/nanomatch/node_modules/extend-shallow/index.js ***!
  11805. \*********************************************************************/
  11806. /*! no static exports found */
  11807. /***/ (function(module, exports, __webpack_require__) {
  11808. "use strict";
  11809. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11810. var isExtendable = __webpack_require__(/*! is-extendable */ "./node_modules/nanomatch/node_modules/is-extendable/index.js");
  11811. var assignSymbols = __webpack_require__(/*! assign-symbols */ "./node_modules/assign-symbols/index.js");
  11812. module.exports = Object.assign || function (obj
  11813. /*, objects*/
  11814. ) {
  11815. if (obj === null || typeof obj === 'undefined') {
  11816. throw new TypeError('Cannot convert undefined or null to object');
  11817. }
  11818. if (!isObject(obj)) {
  11819. obj = {};
  11820. }
  11821. for (var i = 1; i < arguments.length; i++) {
  11822. var val = arguments[i];
  11823. if (isString(val)) {
  11824. val = toObject(val);
  11825. }
  11826. if (isObject(val)) {
  11827. assign(obj, val);
  11828. assignSymbols(obj, val);
  11829. }
  11830. }
  11831. return obj;
  11832. };
  11833. function assign(a, b) {
  11834. for (var key in b) {
  11835. if (hasOwn(b, key)) {
  11836. a[key] = b[key];
  11837. }
  11838. }
  11839. }
  11840. function isString(val) {
  11841. return val && typeof val === 'string';
  11842. }
  11843. function toObject(str) {
  11844. var obj = {};
  11845. for (var i in str) {
  11846. obj[i] = str[i];
  11847. }
  11848. return obj;
  11849. }
  11850. function isObject(val) {
  11851. return val && _typeof(val) === 'object' || isExtendable(val);
  11852. }
  11853. /**
  11854. * Returns true if the given `key` is an own property of `obj`.
  11855. */
  11856. function hasOwn(obj, key) {
  11857. return Object.prototype.hasOwnProperty.call(obj, key);
  11858. }
  11859. function isEnum(obj, key) {
  11860. return Object.prototype.propertyIsEnumerable.call(obj, key);
  11861. }
  11862. /***/ }),
  11863. /***/ "./node_modules/nanomatch/node_modules/is-extendable/index.js":
  11864. /*!********************************************************************!*\
  11865. !*** ./node_modules/nanomatch/node_modules/is-extendable/index.js ***!
  11866. \********************************************************************/
  11867. /*! no static exports found */
  11868. /***/ (function(module, exports, __webpack_require__) {
  11869. "use strict";
  11870. /*!
  11871. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  11872. *
  11873. * Copyright (c) 2015-2017, Jon Schlinkert.
  11874. * Released under the MIT License.
  11875. */
  11876. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  11877. module.exports = function isExtendable(val) {
  11878. return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
  11879. };
  11880. /***/ }),
  11881. /***/ "./node_modules/nanomatch/node_modules/kind-of/index.js":
  11882. /*!**************************************************************!*\
  11883. !*** ./node_modules/nanomatch/node_modules/kind-of/index.js ***!
  11884. \**************************************************************/
  11885. /*! no static exports found */
  11886. /***/ (function(module, exports, __webpack_require__) {
  11887. "use strict";
  11888. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11889. var toString = Object.prototype.toString;
  11890. module.exports = function kindOf(val) {
  11891. if (val === void 0) return 'undefined';
  11892. if (val === null) return 'null';
  11893. var type = _typeof(val);
  11894. if (type === 'boolean') return 'boolean';
  11895. if (type === 'string') return 'string';
  11896. if (type === 'number') return 'number';
  11897. if (type === 'symbol') return 'symbol';
  11898. if (type === 'function') {
  11899. return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  11900. }
  11901. if (isArray(val)) return 'array';
  11902. if (isBuffer(val)) return 'buffer';
  11903. if (isArguments(val)) return 'arguments';
  11904. if (isDate(val)) return 'date';
  11905. if (isError(val)) return 'error';
  11906. if (isRegexp(val)) return 'regexp';
  11907. switch (ctorName(val)) {
  11908. case 'Symbol':
  11909. return 'symbol';
  11910. case 'Promise':
  11911. return 'promise';
  11912. // Set, Map, WeakSet, WeakMap
  11913. case 'WeakMap':
  11914. return 'weakmap';
  11915. case 'WeakSet':
  11916. return 'weakset';
  11917. case 'Map':
  11918. return 'map';
  11919. case 'Set':
  11920. return 'set';
  11921. // 8-bit typed arrays
  11922. case 'Int8Array':
  11923. return 'int8array';
  11924. case 'Uint8Array':
  11925. return 'uint8array';
  11926. case 'Uint8ClampedArray':
  11927. return 'uint8clampedarray';
  11928. // 16-bit typed arrays
  11929. case 'Int16Array':
  11930. return 'int16array';
  11931. case 'Uint16Array':
  11932. return 'uint16array';
  11933. // 32-bit typed arrays
  11934. case 'Int32Array':
  11935. return 'int32array';
  11936. case 'Uint32Array':
  11937. return 'uint32array';
  11938. case 'Float32Array':
  11939. return 'float32array';
  11940. case 'Float64Array':
  11941. return 'float64array';
  11942. }
  11943. if (isGeneratorObj(val)) {
  11944. return 'generator';
  11945. } // Non-plain objects
  11946. type = toString.call(val);
  11947. switch (type) {
  11948. case '[object Object]':
  11949. return 'object';
  11950. // iterators
  11951. case '[object Map Iterator]':
  11952. return 'mapiterator';
  11953. case '[object Set Iterator]':
  11954. return 'setiterator';
  11955. case '[object String Iterator]':
  11956. return 'stringiterator';
  11957. case '[object Array Iterator]':
  11958. return 'arrayiterator';
  11959. } // other
  11960. return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
  11961. };
  11962. function ctorName(val) {
  11963. return val.constructor ? val.constructor.name : null;
  11964. }
  11965. function isArray(val) {
  11966. if (Array.isArray) return Array.isArray(val);
  11967. return val instanceof Array;
  11968. }
  11969. function isError(val) {
  11970. return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
  11971. }
  11972. function isDate(val) {
  11973. if (val instanceof Date) return true;
  11974. return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
  11975. }
  11976. function isRegexp(val) {
  11977. if (val instanceof RegExp) return true;
  11978. return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
  11979. }
  11980. function isGeneratorFn(name, val) {
  11981. return ctorName(name) === 'GeneratorFunction';
  11982. }
  11983. function isGeneratorObj(val) {
  11984. return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
  11985. }
  11986. function isArguments(val) {
  11987. try {
  11988. if (typeof val.length === 'number' && typeof val.callee === 'function') {
  11989. return true;
  11990. }
  11991. } catch (err) {
  11992. if (err.message.indexOf('callee') !== -1) {
  11993. return true;
  11994. }
  11995. }
  11996. return false;
  11997. }
  11998. /**
  11999. * If you need to support Safari 5-7 (8-10 yr-old browser),
  12000. * take a look at https://github.com/feross/is-buffer
  12001. */
  12002. function isBuffer(val) {
  12003. if (val.constructor && typeof val.constructor.isBuffer === 'function') {
  12004. return val.constructor.isBuffer(val);
  12005. }
  12006. return false;
  12007. }
  12008. /***/ }),
  12009. /***/ "./node_modules/node-libs-browser/mock/empty.js":
  12010. /*!******************************************************!*\
  12011. !*** ./node_modules/node-libs-browser/mock/empty.js ***!
  12012. \******************************************************/
  12013. /*! no static exports found */
  12014. /***/ (function(module, exports, __webpack_require__) {
  12015. "use strict";
  12016. /***/ }),
  12017. /***/ "./node_modules/object-copy/index.js":
  12018. /*!*******************************************!*\
  12019. !*** ./node_modules/object-copy/index.js ***!
  12020. \*******************************************/
  12021. /*! no static exports found */
  12022. /***/ (function(module, exports, __webpack_require__) {
  12023. "use strict";
  12024. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/kind-of/index.js");
  12025. var copyDescriptor = __webpack_require__(/*! copy-descriptor */ "./node_modules/copy-descriptor/index.js");
  12026. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  12027. /**
  12028. * Copy static properties, prototype properties, and descriptors from one object to another.
  12029. *
  12030. * ```js
  12031. * function App() {}
  12032. * var proto = App.prototype;
  12033. * App.prototype.set = function() {};
  12034. * App.prototype.get = function() {};
  12035. *
  12036. * var obj = {};
  12037. * copy(obj, proto);
  12038. * ```
  12039. * @param {Object} `receiver`
  12040. * @param {Object} `provider`
  12041. * @param {String|Array} `omit` One or more properties to omit
  12042. * @return {Object}
  12043. * @api public
  12044. */
  12045. function copy(receiver, provider, omit) {
  12046. if (!isObject(receiver)) {
  12047. throw new TypeError('expected receiving object to be an object.');
  12048. }
  12049. if (!isObject(provider)) {
  12050. throw new TypeError('expected providing object to be an object.');
  12051. }
  12052. var props = nativeKeys(provider);
  12053. var keys = Object.keys(provider);
  12054. var len = props.length;
  12055. omit = arrayify(omit);
  12056. while (len--) {
  12057. var key = props[len];
  12058. if (has(keys, key)) {
  12059. define(receiver, key, provider[key]);
  12060. } else if (!(key in receiver) && !has(omit, key)) {
  12061. copyDescriptor(receiver, provider, key);
  12062. }
  12063. }
  12064. }
  12065. ;
  12066. /**
  12067. * Return true if the given value is an object or function
  12068. */
  12069. function isObject(val) {
  12070. return typeOf(val) === 'object' || typeof val === 'function';
  12071. }
  12072. /**
  12073. * Returns true if an array has any of the given elements, or an
  12074. * object has any of the give keys.
  12075. *
  12076. * ```js
  12077. * has(['a', 'b', 'c'], 'c');
  12078. * //=> true
  12079. *
  12080. * has(['a', 'b', 'c'], ['c', 'z']);
  12081. * //=> true
  12082. *
  12083. * has({a: 'b', c: 'd'}, ['c', 'z']);
  12084. * //=> true
  12085. * ```
  12086. * @param {Object} `obj`
  12087. * @param {String|Array} `val`
  12088. * @return {Boolean}
  12089. */
  12090. function has(obj, val) {
  12091. val = arrayify(val);
  12092. var len = val.length;
  12093. if (isObject(obj)) {
  12094. for (var key in obj) {
  12095. if (val.indexOf(key) > -1) {
  12096. return true;
  12097. }
  12098. }
  12099. var keys = nativeKeys(obj);
  12100. return has(keys, val);
  12101. }
  12102. if (Array.isArray(obj)) {
  12103. var arr = obj;
  12104. while (len--) {
  12105. if (arr.indexOf(val[len]) > -1) {
  12106. return true;
  12107. }
  12108. }
  12109. return false;
  12110. }
  12111. throw new TypeError('expected an array or object.');
  12112. }
  12113. /**
  12114. * Cast the given value to an array.
  12115. *
  12116. * ```js
  12117. * arrayify('foo');
  12118. * //=> ['foo']
  12119. *
  12120. * arrayify(['foo']);
  12121. * //=> ['foo']
  12122. * ```
  12123. *
  12124. * @param {String|Array} `val`
  12125. * @return {Array}
  12126. */
  12127. function arrayify(val) {
  12128. return val ? Array.isArray(val) ? val : [val] : [];
  12129. }
  12130. /**
  12131. * Returns true if a value has a `contructor`
  12132. *
  12133. * ```js
  12134. * hasConstructor({});
  12135. * //=> true
  12136. *
  12137. * hasConstructor(Object.create(null));
  12138. * //=> false
  12139. * ```
  12140. * @param {Object} `value`
  12141. * @return {Boolean}
  12142. */
  12143. function hasConstructor(val) {
  12144. return isObject(val) && typeof val.constructor !== 'undefined';
  12145. }
  12146. /**
  12147. * Get the native `ownPropertyNames` from the constructor of the
  12148. * given `object`. An empty array is returned if the object does
  12149. * not have a constructor.
  12150. *
  12151. * ```js
  12152. * nativeKeys({a: 'b', b: 'c', c: 'd'})
  12153. * //=> ['a', 'b', 'c']
  12154. *
  12155. * nativeKeys(function(){})
  12156. * //=> ['length', 'caller']
  12157. * ```
  12158. *
  12159. * @param {Object} `obj` Object that has a `constructor`.
  12160. * @return {Array} Array of keys.
  12161. */
  12162. function nativeKeys(val) {
  12163. if (!hasConstructor(val)) return [];
  12164. return Object.getOwnPropertyNames(val);
  12165. }
  12166. /**
  12167. * Expose `copy`
  12168. */
  12169. module.exports = copy;
  12170. /**
  12171. * Expose `copy.has` for tests
  12172. */
  12173. module.exports.has = has;
  12174. /***/ }),
  12175. /***/ "./node_modules/object-visit/index.js":
  12176. /*!********************************************!*\
  12177. !*** ./node_modules/object-visit/index.js ***!
  12178. \********************************************/
  12179. /*! no static exports found */
  12180. /***/ (function(module, exports, __webpack_require__) {
  12181. "use strict";
  12182. /*!
  12183. * object-visit <https://github.com/jonschlinkert/object-visit>
  12184. *
  12185. * Copyright (c) 2015, 2017, Jon Schlinkert.
  12186. * Released under the MIT License.
  12187. */
  12188. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  12189. module.exports = function visit(thisArg, method, target, val) {
  12190. if (!isObject(thisArg) && typeof thisArg !== 'function') {
  12191. throw new Error('object-visit expects `thisArg` to be an object.');
  12192. }
  12193. if (typeof method !== 'string') {
  12194. throw new Error('object-visit expects `method` name to be a string');
  12195. }
  12196. if (typeof thisArg[method] !== 'function') {
  12197. return thisArg;
  12198. }
  12199. var args = [].slice.call(arguments, 3);
  12200. target = target || {};
  12201. for (var key in target) {
  12202. var arr = [key, target[key]].concat(args);
  12203. thisArg[method].apply(thisArg, arr);
  12204. }
  12205. return thisArg;
  12206. };
  12207. /***/ }),
  12208. /***/ "./node_modules/object.pick/index.js":
  12209. /*!*******************************************!*\
  12210. !*** ./node_modules/object.pick/index.js ***!
  12211. \*******************************************/
  12212. /*! no static exports found */
  12213. /***/ (function(module, exports, __webpack_require__) {
  12214. "use strict";
  12215. /*!
  12216. * object.pick <https://github.com/jonschlinkert/object.pick>
  12217. *
  12218. * Copyright (c) 2014-2015 Jon Schlinkert, contributors.
  12219. * Licensed under the MIT License
  12220. */
  12221. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  12222. module.exports = function pick(obj, keys) {
  12223. if (!isObject(obj) && typeof obj !== 'function') {
  12224. return {};
  12225. }
  12226. var res = {};
  12227. if (typeof keys === 'string') {
  12228. if (keys in obj) {
  12229. res[keys] = obj[keys];
  12230. }
  12231. return res;
  12232. }
  12233. var len = keys.length;
  12234. var idx = -1;
  12235. while (++idx < len) {
  12236. var key = keys[idx];
  12237. if (key in obj) {
  12238. res[key] = obj[key];
  12239. }
  12240. }
  12241. return res;
  12242. };
  12243. /***/ }),
  12244. /***/ "./node_modules/pascalcase/index.js":
  12245. /*!******************************************!*\
  12246. !*** ./node_modules/pascalcase/index.js ***!
  12247. \******************************************/
  12248. /*! no static exports found */
  12249. /***/ (function(module, exports, __webpack_require__) {
  12250. "use strict";
  12251. /*!
  12252. * pascalcase <https://github.com/jonschlinkert/pascalcase>
  12253. *
  12254. * Copyright (c) 2015, Jon Schlinkert.
  12255. * Licensed under the MIT License.
  12256. */
  12257. function pascalcase(str) {
  12258. if (typeof str !== 'string') {
  12259. throw new TypeError('expected a string.');
  12260. }
  12261. str = str.replace(/([A-Z])/g, ' $1');
  12262. if (str.length === 1) {
  12263. return str.toUpperCase();
  12264. }
  12265. str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
  12266. str = str.charAt(0).toUpperCase() + str.slice(1);
  12267. return str.replace(/[\W_]+(\w|$)/g, function (_, ch) {
  12268. return ch.toUpperCase();
  12269. });
  12270. }
  12271. module.exports = pascalcase;
  12272. /***/ }),
  12273. /***/ "./node_modules/path-browserify/index.js":
  12274. /*!***********************************************!*\
  12275. !*** ./node_modules/path-browserify/index.js ***!
  12276. \***********************************************/
  12277. /*! no static exports found */
  12278. /***/ (function(module, exports, __webpack_require__) {
  12279. "use strict";
  12280. /* WEBPACK VAR INJECTION */(function(process) {
  12281. // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  12282. // backported and transplited with Babel, with backwards-compat fixes
  12283. // Copyright Joyent, Inc. and other Node contributors.
  12284. //
  12285. // Permission is hereby granted, free of charge, to any person obtaining a
  12286. // copy of this software and associated documentation files (the
  12287. // "Software"), to deal in the Software without restriction, including
  12288. // without limitation the rights to use, copy, modify, merge, publish,
  12289. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12290. // persons to whom the Software is furnished to do so, subject to the
  12291. // following conditions:
  12292. //
  12293. // The above copyright notice and this permission notice shall be included
  12294. // in all copies or substantial portions of the Software.
  12295. //
  12296. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12297. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12298. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12299. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12300. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12301. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12302. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12303. // resolves . and .. elements in a path array with directory names there
  12304. // must be no slashes, empty elements, or device names (c:\) in the array
  12305. // (so also no leading and trailing slashes - it does not distinguish
  12306. // relative and absolute paths)
  12307. function normalizeArray(parts, allowAboveRoot) {
  12308. // if the path tries to go above the root, `up` ends up > 0
  12309. var up = 0;
  12310. for (var i = parts.length - 1; i >= 0; i--) {
  12311. var last = parts[i];
  12312. if (last === '.') {
  12313. parts.splice(i, 1);
  12314. } else if (last === '..') {
  12315. parts.splice(i, 1);
  12316. up++;
  12317. } else if (up) {
  12318. parts.splice(i, 1);
  12319. up--;
  12320. }
  12321. } // if the path is allowed to go above the root, restore leading ..s
  12322. if (allowAboveRoot) {
  12323. for (; up--; up) {
  12324. parts.unshift('..');
  12325. }
  12326. }
  12327. return parts;
  12328. } // path.resolve([from ...], to)
  12329. // posix version
  12330. exports.resolve = function () {
  12331. var resolvedPath = '',
  12332. resolvedAbsolute = false;
  12333. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  12334. var path = i >= 0 ? arguments[i] : process.cwd(); // Skip empty and invalid entries
  12335. if (typeof path !== 'string') {
  12336. throw new TypeError('Arguments to path.resolve must be strings');
  12337. } else if (!path) {
  12338. continue;
  12339. }
  12340. resolvedPath = path + '/' + resolvedPath;
  12341. resolvedAbsolute = path.charAt(0) === '/';
  12342. } // At this point the path should be resolved to a full absolute path, but
  12343. // handle relative paths to be safe (might happen when process.cwd() fails)
  12344. // Normalize the path
  12345. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) {
  12346. return !!p;
  12347. }), !resolvedAbsolute).join('/');
  12348. return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
  12349. }; // path.normalize(path)
  12350. // posix version
  12351. exports.normalize = function (path) {
  12352. var isAbsolute = exports.isAbsolute(path),
  12353. trailingSlash = substr(path, -1) === '/'; // Normalize the path
  12354. path = normalizeArray(filter(path.split('/'), function (p) {
  12355. return !!p;
  12356. }), !isAbsolute).join('/');
  12357. if (!path && !isAbsolute) {
  12358. path = '.';
  12359. }
  12360. if (path && trailingSlash) {
  12361. path += '/';
  12362. }
  12363. return (isAbsolute ? '/' : '') + path;
  12364. }; // posix version
  12365. exports.isAbsolute = function (path) {
  12366. return path.charAt(0) === '/';
  12367. }; // posix version
  12368. exports.join = function () {
  12369. var paths = Array.prototype.slice.call(arguments, 0);
  12370. return exports.normalize(filter(paths, function (p, index) {
  12371. if (typeof p !== 'string') {
  12372. throw new TypeError('Arguments to path.join must be strings');
  12373. }
  12374. return p;
  12375. }).join('/'));
  12376. }; // path.relative(from, to)
  12377. // posix version
  12378. exports.relative = function (from, to) {
  12379. from = exports.resolve(from).substr(1);
  12380. to = exports.resolve(to).substr(1);
  12381. function trim(arr) {
  12382. var start = 0;
  12383. for (; start < arr.length; start++) {
  12384. if (arr[start] !== '') break;
  12385. }
  12386. var end = arr.length - 1;
  12387. for (; end >= 0; end--) {
  12388. if (arr[end] !== '') break;
  12389. }
  12390. if (start > end) return [];
  12391. return arr.slice(start, end - start + 1);
  12392. }
  12393. var fromParts = trim(from.split('/'));
  12394. var toParts = trim(to.split('/'));
  12395. var length = Math.min(fromParts.length, toParts.length);
  12396. var samePartsLength = length;
  12397. for (var i = 0; i < length; i++) {
  12398. if (fromParts[i] !== toParts[i]) {
  12399. samePartsLength = i;
  12400. break;
  12401. }
  12402. }
  12403. var outputParts = [];
  12404. for (var i = samePartsLength; i < fromParts.length; i++) {
  12405. outputParts.push('..');
  12406. }
  12407. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  12408. return outputParts.join('/');
  12409. };
  12410. exports.sep = '/';
  12411. exports.delimiter = ':';
  12412. exports.dirname = function (path) {
  12413. if (typeof path !== 'string') path = path + '';
  12414. if (path.length === 0) return '.';
  12415. var code = path.charCodeAt(0);
  12416. var hasRoot = code === 47
  12417. /*/*/
  12418. ;
  12419. var end = -1;
  12420. var matchedSlash = true;
  12421. for (var i = path.length - 1; i >= 1; --i) {
  12422. code = path.charCodeAt(i);
  12423. if (code === 47
  12424. /*/*/
  12425. ) {
  12426. if (!matchedSlash) {
  12427. end = i;
  12428. break;
  12429. }
  12430. } else {
  12431. // We saw the first non-path separator
  12432. matchedSlash = false;
  12433. }
  12434. }
  12435. if (end === -1) return hasRoot ? '/' : '.';
  12436. if (hasRoot && end === 1) {
  12437. // return '//';
  12438. // Backwards-compat fix:
  12439. return '/';
  12440. }
  12441. return path.slice(0, end);
  12442. };
  12443. function basename(path) {
  12444. if (typeof path !== 'string') path = path + '';
  12445. var start = 0;
  12446. var end = -1;
  12447. var matchedSlash = true;
  12448. var i;
  12449. for (i = path.length - 1; i >= 0; --i) {
  12450. if (path.charCodeAt(i) === 47
  12451. /*/*/
  12452. ) {
  12453. // If we reached a path separator that was not part of a set of path
  12454. // separators at the end of the string, stop now
  12455. if (!matchedSlash) {
  12456. start = i + 1;
  12457. break;
  12458. }
  12459. } else if (end === -1) {
  12460. // We saw the first non-path separator, mark this as the end of our
  12461. // path component
  12462. matchedSlash = false;
  12463. end = i + 1;
  12464. }
  12465. }
  12466. if (end === -1) return '';
  12467. return path.slice(start, end);
  12468. } // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  12469. // in new Node.js versions, so only basename() above is backported here
  12470. exports.basename = function (path, ext) {
  12471. var f = basename(path);
  12472. if (ext && f.substr(-1 * ext.length) === ext) {
  12473. f = f.substr(0, f.length - ext.length);
  12474. }
  12475. return f;
  12476. };
  12477. exports.extname = function (path) {
  12478. if (typeof path !== 'string') path = path + '';
  12479. var startDot = -1;
  12480. var startPart = 0;
  12481. var end = -1;
  12482. var matchedSlash = true; // Track the state of characters (if any) we see before our first dot and
  12483. // after any path separator we find
  12484. var preDotState = 0;
  12485. for (var i = path.length - 1; i >= 0; --i) {
  12486. var code = path.charCodeAt(i);
  12487. if (code === 47
  12488. /*/*/
  12489. ) {
  12490. // If we reached a path separator that was not part of a set of path
  12491. // separators at the end of the string, stop now
  12492. if (!matchedSlash) {
  12493. startPart = i + 1;
  12494. break;
  12495. }
  12496. continue;
  12497. }
  12498. if (end === -1) {
  12499. // We saw the first non-path separator, mark this as the end of our
  12500. // extension
  12501. matchedSlash = false;
  12502. end = i + 1;
  12503. }
  12504. if (code === 46
  12505. /*.*/
  12506. ) {
  12507. // If this is our first dot, mark it as the start of our extension
  12508. if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
  12509. } else if (startDot !== -1) {
  12510. // We saw a non-dot and non-path separator before our dot, so we should
  12511. // have a good chance at having a non-empty extension
  12512. preDotState = -1;
  12513. }
  12514. }
  12515. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  12516. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  12517. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  12518. return '';
  12519. }
  12520. return path.slice(startDot, end);
  12521. };
  12522. function filter(xs, f) {
  12523. if (xs.filter) return xs.filter(f);
  12524. var res = [];
  12525. for (var i = 0; i < xs.length; i++) {
  12526. if (f(xs[i], i, xs)) res.push(xs[i]);
  12527. }
  12528. return res;
  12529. } // String.prototype.substr - negative index don't work in IE8
  12530. var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) {
  12531. return str.substr(start, len);
  12532. } : function (str, start, len) {
  12533. if (start < 0) start = str.length + start;
  12534. return str.substr(start, len);
  12535. };
  12536. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  12537. /***/ }),
  12538. /***/ "./node_modules/posix-character-classes/index.js":
  12539. /*!*******************************************************!*\
  12540. !*** ./node_modules/posix-character-classes/index.js ***!
  12541. \*******************************************************/
  12542. /*! no static exports found */
  12543. /***/ (function(module, exports, __webpack_require__) {
  12544. "use strict";
  12545. /**
  12546. * POSIX character classes
  12547. */
  12548. module.exports = {
  12549. alnum: 'a-zA-Z0-9',
  12550. alpha: 'a-zA-Z',
  12551. ascii: '\\x00-\\x7F',
  12552. blank: ' \\t',
  12553. cntrl: '\\x00-\\x1F\\x7F',
  12554. digit: '0-9',
  12555. graph: '\\x21-\\x7E',
  12556. lower: 'a-z',
  12557. print: '\\x20-\\x7E ',
  12558. punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
  12559. space: ' \\t\\r\\n\\v\\f',
  12560. upper: 'A-Z',
  12561. word: 'A-Za-z0-9_',
  12562. xdigit: 'A-Fa-f0-9'
  12563. };
  12564. /***/ }),
  12565. /***/ "./node_modules/process/browser.js":
  12566. /*!*****************************************!*\
  12567. !*** ./node_modules/process/browser.js ***!
  12568. \*****************************************/
  12569. /*! no static exports found */
  12570. /***/ (function(module, exports, __webpack_require__) {
  12571. "use strict";
  12572. // shim for using process in browser
  12573. var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
  12574. // don't break things. But we need to wrap it in a try catch in case it is
  12575. // wrapped in strict mode code which doesn't define any globals. It's inside a
  12576. // function because try/catches deoptimize in certain engines.
  12577. var cachedSetTimeout;
  12578. var cachedClearTimeout;
  12579. function defaultSetTimout() {
  12580. throw new Error('setTimeout has not been defined');
  12581. }
  12582. function defaultClearTimeout() {
  12583. throw new Error('clearTimeout has not been defined');
  12584. }
  12585. (function () {
  12586. try {
  12587. if (typeof setTimeout === 'function') {
  12588. cachedSetTimeout = setTimeout;
  12589. } else {
  12590. cachedSetTimeout = defaultSetTimout;
  12591. }
  12592. } catch (e) {
  12593. cachedSetTimeout = defaultSetTimout;
  12594. }
  12595. try {
  12596. if (typeof clearTimeout === 'function') {
  12597. cachedClearTimeout = clearTimeout;
  12598. } else {
  12599. cachedClearTimeout = defaultClearTimeout;
  12600. }
  12601. } catch (e) {
  12602. cachedClearTimeout = defaultClearTimeout;
  12603. }
  12604. })();
  12605. function runTimeout(fun) {
  12606. if (cachedSetTimeout === setTimeout) {
  12607. //normal enviroments in sane situations
  12608. return setTimeout(fun, 0);
  12609. } // if setTimeout wasn't available but was latter defined
  12610. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  12611. cachedSetTimeout = setTimeout;
  12612. return setTimeout(fun, 0);
  12613. }
  12614. try {
  12615. // when when somebody has screwed with setTimeout but no I.E. maddness
  12616. return cachedSetTimeout(fun, 0);
  12617. } catch (e) {
  12618. try {
  12619. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  12620. return cachedSetTimeout.call(null, fun, 0);
  12621. } catch (e) {
  12622. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  12623. return cachedSetTimeout.call(this, fun, 0);
  12624. }
  12625. }
  12626. }
  12627. function runClearTimeout(marker) {
  12628. if (cachedClearTimeout === clearTimeout) {
  12629. //normal enviroments in sane situations
  12630. return clearTimeout(marker);
  12631. } // if clearTimeout wasn't available but was latter defined
  12632. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  12633. cachedClearTimeout = clearTimeout;
  12634. return clearTimeout(marker);
  12635. }
  12636. try {
  12637. // when when somebody has screwed with setTimeout but no I.E. maddness
  12638. return cachedClearTimeout(marker);
  12639. } catch (e) {
  12640. try {
  12641. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  12642. return cachedClearTimeout.call(null, marker);
  12643. } catch (e) {
  12644. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  12645. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  12646. return cachedClearTimeout.call(this, marker);
  12647. }
  12648. }
  12649. }
  12650. var queue = [];
  12651. var draining = false;
  12652. var currentQueue;
  12653. var queueIndex = -1;
  12654. function cleanUpNextTick() {
  12655. if (!draining || !currentQueue) {
  12656. return;
  12657. }
  12658. draining = false;
  12659. if (currentQueue.length) {
  12660. queue = currentQueue.concat(queue);
  12661. } else {
  12662. queueIndex = -1;
  12663. }
  12664. if (queue.length) {
  12665. drainQueue();
  12666. }
  12667. }
  12668. function drainQueue() {
  12669. if (draining) {
  12670. return;
  12671. }
  12672. var timeout = runTimeout(cleanUpNextTick);
  12673. draining = true;
  12674. var len = queue.length;
  12675. while (len) {
  12676. currentQueue = queue;
  12677. queue = [];
  12678. while (++queueIndex < len) {
  12679. if (currentQueue) {
  12680. currentQueue[queueIndex].run();
  12681. }
  12682. }
  12683. queueIndex = -1;
  12684. len = queue.length;
  12685. }
  12686. currentQueue = null;
  12687. draining = false;
  12688. runClearTimeout(timeout);
  12689. }
  12690. process.nextTick = function (fun) {
  12691. var args = new Array(arguments.length - 1);
  12692. if (arguments.length > 1) {
  12693. for (var i = 1; i < arguments.length; i++) {
  12694. args[i - 1] = arguments[i];
  12695. }
  12696. }
  12697. queue.push(new Item(fun, args));
  12698. if (queue.length === 1 && !draining) {
  12699. runTimeout(drainQueue);
  12700. }
  12701. }; // v8 likes predictible objects
  12702. function Item(fun, array) {
  12703. this.fun = fun;
  12704. this.array = array;
  12705. }
  12706. Item.prototype.run = function () {
  12707. this.fun.apply(null, this.array);
  12708. };
  12709. process.title = 'browser';
  12710. process.browser = true;
  12711. process.env = {};
  12712. process.argv = [];
  12713. process.version = ''; // empty string to avoid regexp issues
  12714. process.versions = {};
  12715. function noop() {}
  12716. process.on = noop;
  12717. process.addListener = noop;
  12718. process.once = noop;
  12719. process.off = noop;
  12720. process.removeListener = noop;
  12721. process.removeAllListeners = noop;
  12722. process.emit = noop;
  12723. process.prependListener = noop;
  12724. process.prependOnceListener = noop;
  12725. process.listeners = function (name) {
  12726. return [];
  12727. };
  12728. process.binding = function (name) {
  12729. throw new Error('process.binding is not supported');
  12730. };
  12731. process.cwd = function () {
  12732. return '/';
  12733. };
  12734. process.chdir = function (dir) {
  12735. throw new Error('process.chdir is not supported');
  12736. };
  12737. process.umask = function () {
  12738. return 0;
  12739. };
  12740. /***/ }),
  12741. /***/ "./node_modules/react-is/cjs/react-is.development.js":
  12742. /*!***********************************************************!*\
  12743. !*** ./node_modules/react-is/cjs/react-is.development.js ***!
  12744. \***********************************************************/
  12745. /*! no static exports found */
  12746. /***/ (function(module, exports, __webpack_require__) {
  12747. "use strict";
  12748. /** @license React v16.8.6
  12749. * react-is.development.js
  12750. *
  12751. * Copyright (c) Facebook, Inc. and its affiliates.
  12752. *
  12753. * This source code is licensed under the MIT license found in the
  12754. * LICENSE file in the root directory of this source tree.
  12755. */
  12756. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  12757. if (true) {
  12758. (function () {
  12759. 'use strict';
  12760. Object.defineProperty(exports, '__esModule', {
  12761. value: true
  12762. }); // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  12763. // nor polyfill, then a plain number is used for performance.
  12764. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  12765. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  12766. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  12767. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  12768. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  12769. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  12770. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  12771. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
  12772. var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
  12773. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  12774. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  12775. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  12776. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  12777. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  12778. function isValidElementType(type) {
  12779. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  12780. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || _typeof(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
  12781. }
  12782. /**
  12783. * Forked from fbjs/warning:
  12784. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  12785. *
  12786. * Only change is we use console.warn instead of console.error,
  12787. * and do nothing when 'console' is not supported.
  12788. * This really simplifies the code.
  12789. * ---
  12790. * Similar to invariant but only logs a warning if the condition is not met.
  12791. * This can be used to log issues in development environments in critical
  12792. * paths. Removing the logging code for production environments will keep the
  12793. * same logic and follow the same code paths.
  12794. */
  12795. var lowPriorityWarning = function lowPriorityWarning() {};
  12796. {
  12797. var printWarning = function printWarning(format) {
  12798. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  12799. args[_key - 1] = arguments[_key];
  12800. }
  12801. var argIndex = 0;
  12802. var message = 'Warning: ' + format.replace(/%s/g, function () {
  12803. return args[argIndex++];
  12804. });
  12805. if (typeof console !== 'undefined') {
  12806. console.warn(message);
  12807. }
  12808. try {
  12809. // --- Welcome to debugging React ---
  12810. // This error was thrown as a convenience so that you can use this stack
  12811. // to find the callsite that caused this warning to fire.
  12812. throw new Error(message);
  12813. } catch (x) {}
  12814. };
  12815. lowPriorityWarning = function lowPriorityWarning(condition, format) {
  12816. if (format === undefined) {
  12817. throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
  12818. }
  12819. if (!condition) {
  12820. for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  12821. args[_key2 - 2] = arguments[_key2];
  12822. }
  12823. printWarning.apply(undefined, [format].concat(args));
  12824. }
  12825. };
  12826. }
  12827. var lowPriorityWarning$1 = lowPriorityWarning;
  12828. function typeOf(object) {
  12829. if (_typeof(object) === 'object' && object !== null) {
  12830. var $$typeof = object.$$typeof;
  12831. switch ($$typeof) {
  12832. case REACT_ELEMENT_TYPE:
  12833. var type = object.type;
  12834. switch (type) {
  12835. case REACT_ASYNC_MODE_TYPE:
  12836. case REACT_CONCURRENT_MODE_TYPE:
  12837. case REACT_FRAGMENT_TYPE:
  12838. case REACT_PROFILER_TYPE:
  12839. case REACT_STRICT_MODE_TYPE:
  12840. case REACT_SUSPENSE_TYPE:
  12841. return type;
  12842. default:
  12843. var $$typeofType = type && type.$$typeof;
  12844. switch ($$typeofType) {
  12845. case REACT_CONTEXT_TYPE:
  12846. case REACT_FORWARD_REF_TYPE:
  12847. case REACT_PROVIDER_TYPE:
  12848. return $$typeofType;
  12849. default:
  12850. return $$typeof;
  12851. }
  12852. }
  12853. case REACT_LAZY_TYPE:
  12854. case REACT_MEMO_TYPE:
  12855. case REACT_PORTAL_TYPE:
  12856. return $$typeof;
  12857. }
  12858. }
  12859. return undefined;
  12860. } // AsyncMode is deprecated along with isAsyncMode
  12861. var AsyncMode = REACT_ASYNC_MODE_TYPE;
  12862. var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  12863. var ContextConsumer = REACT_CONTEXT_TYPE;
  12864. var ContextProvider = REACT_PROVIDER_TYPE;
  12865. var Element = REACT_ELEMENT_TYPE;
  12866. var ForwardRef = REACT_FORWARD_REF_TYPE;
  12867. var Fragment = REACT_FRAGMENT_TYPE;
  12868. var Lazy = REACT_LAZY_TYPE;
  12869. var Memo = REACT_MEMO_TYPE;
  12870. var Portal = REACT_PORTAL_TYPE;
  12871. var Profiler = REACT_PROFILER_TYPE;
  12872. var StrictMode = REACT_STRICT_MODE_TYPE;
  12873. var Suspense = REACT_SUSPENSE_TYPE;
  12874. var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
  12875. function isAsyncMode(object) {
  12876. {
  12877. if (!hasWarnedAboutDeprecatedIsAsyncMode) {
  12878. hasWarnedAboutDeprecatedIsAsyncMode = true;
  12879. lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
  12880. }
  12881. }
  12882. return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  12883. }
  12884. function isConcurrentMode(object) {
  12885. return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
  12886. }
  12887. function isContextConsumer(object) {
  12888. return typeOf(object) === REACT_CONTEXT_TYPE;
  12889. }
  12890. function isContextProvider(object) {
  12891. return typeOf(object) === REACT_PROVIDER_TYPE;
  12892. }
  12893. function isElement(object) {
  12894. return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  12895. }
  12896. function isForwardRef(object) {
  12897. return typeOf(object) === REACT_FORWARD_REF_TYPE;
  12898. }
  12899. function isFragment(object) {
  12900. return typeOf(object) === REACT_FRAGMENT_TYPE;
  12901. }
  12902. function isLazy(object) {
  12903. return typeOf(object) === REACT_LAZY_TYPE;
  12904. }
  12905. function isMemo(object) {
  12906. return typeOf(object) === REACT_MEMO_TYPE;
  12907. }
  12908. function isPortal(object) {
  12909. return typeOf(object) === REACT_PORTAL_TYPE;
  12910. }
  12911. function isProfiler(object) {
  12912. return typeOf(object) === REACT_PROFILER_TYPE;
  12913. }
  12914. function isStrictMode(object) {
  12915. return typeOf(object) === REACT_STRICT_MODE_TYPE;
  12916. }
  12917. function isSuspense(object) {
  12918. return typeOf(object) === REACT_SUSPENSE_TYPE;
  12919. }
  12920. exports.typeOf = typeOf;
  12921. exports.AsyncMode = AsyncMode;
  12922. exports.ConcurrentMode = ConcurrentMode;
  12923. exports.ContextConsumer = ContextConsumer;
  12924. exports.ContextProvider = ContextProvider;
  12925. exports.Element = Element;
  12926. exports.ForwardRef = ForwardRef;
  12927. exports.Fragment = Fragment;
  12928. exports.Lazy = Lazy;
  12929. exports.Memo = Memo;
  12930. exports.Portal = Portal;
  12931. exports.Profiler = Profiler;
  12932. exports.StrictMode = StrictMode;
  12933. exports.Suspense = Suspense;
  12934. exports.isValidElementType = isValidElementType;
  12935. exports.isAsyncMode = isAsyncMode;
  12936. exports.isConcurrentMode = isConcurrentMode;
  12937. exports.isContextConsumer = isContextConsumer;
  12938. exports.isContextProvider = isContextProvider;
  12939. exports.isElement = isElement;
  12940. exports.isForwardRef = isForwardRef;
  12941. exports.isFragment = isFragment;
  12942. exports.isLazy = isLazy;
  12943. exports.isMemo = isMemo;
  12944. exports.isPortal = isPortal;
  12945. exports.isProfiler = isProfiler;
  12946. exports.isStrictMode = isStrictMode;
  12947. exports.isSuspense = isSuspense;
  12948. })();
  12949. }
  12950. /***/ }),
  12951. /***/ "./node_modules/react-is/index.js":
  12952. /*!****************************************!*\
  12953. !*** ./node_modules/react-is/index.js ***!
  12954. \****************************************/
  12955. /*! no static exports found */
  12956. /***/ (function(module, exports, __webpack_require__) {
  12957. "use strict";
  12958. if (false) {} else {
  12959. module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
  12960. }
  12961. /***/ }),
  12962. /***/ "./node_modules/regex-not/index.js":
  12963. /*!*****************************************!*\
  12964. !*** ./node_modules/regex-not/index.js ***!
  12965. \*****************************************/
  12966. /*! no static exports found */
  12967. /***/ (function(module, exports, __webpack_require__) {
  12968. "use strict";
  12969. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/regex-not/node_modules/extend-shallow/index.js");
  12970. var safe = __webpack_require__(/*! safe-regex */ "./node_modules/safe-regex/index.js");
  12971. /**
  12972. * The main export is a function that takes a `pattern` string and an `options` object.
  12973. *
  12974. * ```js
  12975. & var not = require('regex-not');
  12976. & console.log(not('foo'));
  12977. & //=> /^(?:(?!^(?:foo)$).)*$/
  12978. * ```
  12979. *
  12980. * @param {String} `pattern`
  12981. * @param {Object} `options`
  12982. * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`.
  12983. * @api public
  12984. */
  12985. function toRegex(pattern, options) {
  12986. return new RegExp(toRegex.create(pattern, options));
  12987. }
  12988. /**
  12989. * Create a regex-compatible string from the given `pattern` and `options`.
  12990. *
  12991. * ```js
  12992. & var not = require('regex-not');
  12993. & console.log(not.create('foo'));
  12994. & //=> '^(?:(?!^(?:foo)$).)*$'
  12995. * ```
  12996. * @param {String} `pattern`
  12997. * @param {Object} `options`
  12998. * @return {String}
  12999. * @api public
  13000. */
  13001. toRegex.create = function (pattern, options) {
  13002. if (typeof pattern !== 'string') {
  13003. throw new TypeError('expected a string');
  13004. }
  13005. var opts = extend({}, options);
  13006. if (opts.contains === true) {
  13007. opts.strictNegate = false;
  13008. }
  13009. var open = opts.strictOpen !== false ? '^' : '';
  13010. var close = opts.strictClose !== false ? '$' : '';
  13011. var endChar = opts.endChar ? opts.endChar : '+';
  13012. var str = pattern;
  13013. if (opts.strictNegate === false) {
  13014. str = '(?:(?!(?:' + pattern + ')).)' + endChar;
  13015. } else {
  13016. str = '(?:(?!^(?:' + pattern + ')$).)' + endChar;
  13017. }
  13018. var res = open + str + close;
  13019. if (opts.safe === true && safe(res) === false) {
  13020. throw new Error('potentially unsafe regular expression: ' + res);
  13021. }
  13022. return res;
  13023. };
  13024. /**
  13025. * Expose `toRegex`
  13026. */
  13027. module.exports = toRegex;
  13028. /***/ }),
  13029. /***/ "./node_modules/regex-not/node_modules/extend-shallow/index.js":
  13030. /*!*********************************************************************!*\
  13031. !*** ./node_modules/regex-not/node_modules/extend-shallow/index.js ***!
  13032. \*********************************************************************/
  13033. /*! no static exports found */
  13034. /***/ (function(module, exports, __webpack_require__) {
  13035. "use strict";
  13036. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  13037. var isExtendable = __webpack_require__(/*! is-extendable */ "./node_modules/regex-not/node_modules/is-extendable/index.js");
  13038. var assignSymbols = __webpack_require__(/*! assign-symbols */ "./node_modules/assign-symbols/index.js");
  13039. module.exports = Object.assign || function (obj
  13040. /*, objects*/
  13041. ) {
  13042. if (obj === null || typeof obj === 'undefined') {
  13043. throw new TypeError('Cannot convert undefined or null to object');
  13044. }
  13045. if (!isObject(obj)) {
  13046. obj = {};
  13047. }
  13048. for (var i = 1; i < arguments.length; i++) {
  13049. var val = arguments[i];
  13050. if (isString(val)) {
  13051. val = toObject(val);
  13052. }
  13053. if (isObject(val)) {
  13054. assign(obj, val);
  13055. assignSymbols(obj, val);
  13056. }
  13057. }
  13058. return obj;
  13059. };
  13060. function assign(a, b) {
  13061. for (var key in b) {
  13062. if (hasOwn(b, key)) {
  13063. a[key] = b[key];
  13064. }
  13065. }
  13066. }
  13067. function isString(val) {
  13068. return val && typeof val === 'string';
  13069. }
  13070. function toObject(str) {
  13071. var obj = {};
  13072. for (var i in str) {
  13073. obj[i] = str[i];
  13074. }
  13075. return obj;
  13076. }
  13077. function isObject(val) {
  13078. return val && _typeof(val) === 'object' || isExtendable(val);
  13079. }
  13080. /**
  13081. * Returns true if the given `key` is an own property of `obj`.
  13082. */
  13083. function hasOwn(obj, key) {
  13084. return Object.prototype.hasOwnProperty.call(obj, key);
  13085. }
  13086. function isEnum(obj, key) {
  13087. return Object.prototype.propertyIsEnumerable.call(obj, key);
  13088. }
  13089. /***/ }),
  13090. /***/ "./node_modules/regex-not/node_modules/is-extendable/index.js":
  13091. /*!********************************************************************!*\
  13092. !*** ./node_modules/regex-not/node_modules/is-extendable/index.js ***!
  13093. \********************************************************************/
  13094. /*! no static exports found */
  13095. /***/ (function(module, exports, __webpack_require__) {
  13096. "use strict";
  13097. /*!
  13098. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  13099. *
  13100. * Copyright (c) 2015-2017, Jon Schlinkert.
  13101. * Released under the MIT License.
  13102. */
  13103. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  13104. module.exports = function isExtendable(val) {
  13105. return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
  13106. };
  13107. /***/ }),
  13108. /***/ "./node_modules/repeat-element/index.js":
  13109. /*!**********************************************!*\
  13110. !*** ./node_modules/repeat-element/index.js ***!
  13111. \**********************************************/
  13112. /*! no static exports found */
  13113. /***/ (function(module, exports, __webpack_require__) {
  13114. "use strict";
  13115. /*!
  13116. * repeat-element <https://github.com/jonschlinkert/repeat-element>
  13117. *
  13118. * Copyright (c) 2015-present, Jon Schlinkert.
  13119. * Licensed under the MIT license.
  13120. */
  13121. module.exports = function repeat(ele, num) {
  13122. var arr = new Array(num);
  13123. for (var i = 0; i < num; i++) {
  13124. arr[i] = ele;
  13125. }
  13126. return arr;
  13127. };
  13128. /***/ }),
  13129. /***/ "./node_modules/repeat-string/index.js":
  13130. /*!*********************************************!*\
  13131. !*** ./node_modules/repeat-string/index.js ***!
  13132. \*********************************************/
  13133. /*! no static exports found */
  13134. /***/ (function(module, exports, __webpack_require__) {
  13135. "use strict";
  13136. /*!
  13137. * repeat-string <https://github.com/jonschlinkert/repeat-string>
  13138. *
  13139. * Copyright (c) 2014-2015, Jon Schlinkert.
  13140. * Licensed under the MIT License.
  13141. */
  13142. /**
  13143. * Results cache
  13144. */
  13145. var res = '';
  13146. var cache;
  13147. /**
  13148. * Expose `repeat`
  13149. */
  13150. module.exports = repeat;
  13151. /**
  13152. * Repeat the given `string` the specified `number`
  13153. * of times.
  13154. *
  13155. * **Example:**
  13156. *
  13157. * ```js
  13158. * var repeat = require('repeat-string');
  13159. * repeat('A', 5);
  13160. * //=> AAAAA
  13161. * ```
  13162. *
  13163. * @param {String} `string` The string to repeat
  13164. * @param {Number} `number` The number of times to repeat the string
  13165. * @return {String} Repeated string
  13166. * @api public
  13167. */
  13168. function repeat(str, num) {
  13169. if (typeof str !== 'string') {
  13170. throw new TypeError('expected a string');
  13171. } // cover common, quick use cases
  13172. if (num === 1) return str;
  13173. if (num === 2) return str + str;
  13174. var max = str.length * num;
  13175. if (cache !== str || typeof cache === 'undefined') {
  13176. cache = str;
  13177. res = '';
  13178. } else if (res.length >= max) {
  13179. return res.substr(0, max);
  13180. }
  13181. while (max > res.length && num > 1) {
  13182. if (num & 1) {
  13183. res += str;
  13184. }
  13185. num >>= 1;
  13186. str += str;
  13187. }
  13188. res += str;
  13189. res = res.substr(0, max);
  13190. return res;
  13191. }
  13192. /***/ }),
  13193. /***/ "./node_modules/resolve-url/resolve-url.js":
  13194. /*!*************************************************!*\
  13195. !*** ./node_modules/resolve-url/resolve-url.js ***!
  13196. \*************************************************/
  13197. /*! no static exports found */
  13198. /***/ (function(module, exports, __webpack_require__) {
  13199. "use strict";
  13200. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
  13201. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  13202. // Copyright 2014 Simon Lydell
  13203. // X11 (“MIT”) Licensed. (See LICENSE.)
  13204. void function (root, factory) {
  13205. if (true) {
  13206. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  13207. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  13208. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  13209. __WEBPACK_AMD_DEFINE_FACTORY__),
  13210. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  13211. } else {}
  13212. }(void 0, function () {
  13213. function resolveUrl()
  13214. /* ...urls */
  13215. {
  13216. var numUrls = arguments.length;
  13217. if (numUrls === 0) {
  13218. throw new Error("resolveUrl requires at least one argument; got none.");
  13219. }
  13220. var base = document.createElement("base");
  13221. base.href = arguments[0];
  13222. if (numUrls === 1) {
  13223. return base.href;
  13224. }
  13225. var head = document.getElementsByTagName("head")[0];
  13226. head.insertBefore(base, head.firstChild);
  13227. var a = document.createElement("a");
  13228. var resolved;
  13229. for (var index = 1; index < numUrls; index++) {
  13230. a.href = arguments[index];
  13231. resolved = a.href;
  13232. base.href = resolved;
  13233. }
  13234. head.removeChild(base);
  13235. return resolved;
  13236. }
  13237. return resolveUrl;
  13238. });
  13239. /***/ }),
  13240. /***/ "./node_modules/ret/lib/index.js":
  13241. /*!***************************************!*\
  13242. !*** ./node_modules/ret/lib/index.js ***!
  13243. \***************************************/
  13244. /*! no static exports found */
  13245. /***/ (function(module, exports, __webpack_require__) {
  13246. "use strict";
  13247. var util = __webpack_require__(/*! ./util */ "./node_modules/ret/lib/util.js");
  13248. var types = __webpack_require__(/*! ./types */ "./node_modules/ret/lib/types.js");
  13249. var sets = __webpack_require__(/*! ./sets */ "./node_modules/ret/lib/sets.js");
  13250. var positions = __webpack_require__(/*! ./positions */ "./node_modules/ret/lib/positions.js");
  13251. module.exports = function (regexpStr) {
  13252. var i = 0,
  13253. l,
  13254. c,
  13255. start = {
  13256. type: types.ROOT,
  13257. stack: []
  13258. },
  13259. // Keep track of last clause/group and stack.
  13260. lastGroup = start,
  13261. last = start.stack,
  13262. groupStack = [];
  13263. var repeatErr = function repeatErr(i) {
  13264. util.error(regexpStr, 'Nothing to repeat at column ' + (i - 1));
  13265. }; // Decode a few escaped characters.
  13266. var str = util.strToChars(regexpStr);
  13267. l = str.length; // Iterate through each character in string.
  13268. while (i < l) {
  13269. c = str[i++];
  13270. switch (c) {
  13271. // Handle escaped characters, inclues a few sets.
  13272. case '\\':
  13273. c = str[i++];
  13274. switch (c) {
  13275. case 'b':
  13276. last.push(positions.wordBoundary());
  13277. break;
  13278. case 'B':
  13279. last.push(positions.nonWordBoundary());
  13280. break;
  13281. case 'w':
  13282. last.push(sets.words());
  13283. break;
  13284. case 'W':
  13285. last.push(sets.notWords());
  13286. break;
  13287. case 'd':
  13288. last.push(sets.ints());
  13289. break;
  13290. case 'D':
  13291. last.push(sets.notInts());
  13292. break;
  13293. case 's':
  13294. last.push(sets.whitespace());
  13295. break;
  13296. case 'S':
  13297. last.push(sets.notWhitespace());
  13298. break;
  13299. default:
  13300. // Check if c is integer.
  13301. // In which case it's a reference.
  13302. if (/\d/.test(c)) {
  13303. last.push({
  13304. type: types.REFERENCE,
  13305. value: parseInt(c, 10)
  13306. }); // Escaped character.
  13307. } else {
  13308. last.push({
  13309. type: types.CHAR,
  13310. value: c.charCodeAt(0)
  13311. });
  13312. }
  13313. }
  13314. break;
  13315. // Positionals.
  13316. case '^':
  13317. last.push(positions.begin());
  13318. break;
  13319. case '$':
  13320. last.push(positions.end());
  13321. break;
  13322. // Handle custom sets.
  13323. case '[':
  13324. // Check if this class is 'anti' i.e. [^abc].
  13325. var not;
  13326. if (str[i] === '^') {
  13327. not = true;
  13328. i++;
  13329. } else {
  13330. not = false;
  13331. } // Get all the characters in class.
  13332. var classTokens = util.tokenizeClass(str.slice(i), regexpStr); // Increase index by length of class.
  13333. i += classTokens[1];
  13334. last.push({
  13335. type: types.SET,
  13336. set: classTokens[0],
  13337. not: not
  13338. });
  13339. break;
  13340. // Class of any character except \n.
  13341. case '.':
  13342. last.push(sets.anyChar());
  13343. break;
  13344. // Push group onto stack.
  13345. case '(':
  13346. // Create group.
  13347. var group = {
  13348. type: types.GROUP,
  13349. stack: [],
  13350. remember: true
  13351. };
  13352. c = str[i]; // If if this is a special kind of group.
  13353. if (c === '?') {
  13354. c = str[i + 1];
  13355. i += 2; // Match if followed by.
  13356. if (c === '=') {
  13357. group.followedBy = true; // Match if not followed by.
  13358. } else if (c === '!') {
  13359. group.notFollowedBy = true;
  13360. } else if (c !== ':') {
  13361. util.error(regexpStr, 'Invalid group, character \'' + c + '\' after \'?\' at column ' + (i - 1));
  13362. }
  13363. group.remember = false;
  13364. } // Insert subgroup into current group stack.
  13365. last.push(group); // Remember the current group for when the group closes.
  13366. groupStack.push(lastGroup); // Make this new group the current group.
  13367. lastGroup = group;
  13368. last = group.stack;
  13369. break;
  13370. // Pop group out of stack.
  13371. case ')':
  13372. if (groupStack.length === 0) {
  13373. util.error(regexpStr, 'Unmatched ) at column ' + (i - 1));
  13374. }
  13375. lastGroup = groupStack.pop(); // Check if this group has a PIPE.
  13376. // To get back the correct last stack.
  13377. last = lastGroup.options ? lastGroup.options[lastGroup.options.length - 1] : lastGroup.stack;
  13378. break;
  13379. // Use pipe character to give more choices.
  13380. case '|':
  13381. // Create array where options are if this is the first PIPE
  13382. // in this clause.
  13383. if (!lastGroup.options) {
  13384. lastGroup.options = [lastGroup.stack];
  13385. delete lastGroup.stack;
  13386. } // Create a new stack and add to options for rest of clause.
  13387. var stack = [];
  13388. lastGroup.options.push(stack);
  13389. last = stack;
  13390. break;
  13391. // Repetition.
  13392. // For every repetition, remove last element from last stack
  13393. // then insert back a RANGE object.
  13394. // This design is chosen because there could be more than
  13395. // one repetition symbols in a regex i.e. `a?+{2,3}`.
  13396. case '{':
  13397. var rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)),
  13398. min,
  13399. max;
  13400. if (rs !== null) {
  13401. if (last.length === 0) {
  13402. repeatErr(i);
  13403. }
  13404. min = parseInt(rs[1], 10);
  13405. max = rs[2] ? rs[3] ? parseInt(rs[3], 10) : Infinity : min;
  13406. i += rs[0].length;
  13407. last.push({
  13408. type: types.REPETITION,
  13409. min: min,
  13410. max: max,
  13411. value: last.pop()
  13412. });
  13413. } else {
  13414. last.push({
  13415. type: types.CHAR,
  13416. value: 123
  13417. });
  13418. }
  13419. break;
  13420. case '?':
  13421. if (last.length === 0) {
  13422. repeatErr(i);
  13423. }
  13424. last.push({
  13425. type: types.REPETITION,
  13426. min: 0,
  13427. max: 1,
  13428. value: last.pop()
  13429. });
  13430. break;
  13431. case '+':
  13432. if (last.length === 0) {
  13433. repeatErr(i);
  13434. }
  13435. last.push({
  13436. type: types.REPETITION,
  13437. min: 1,
  13438. max: Infinity,
  13439. value: last.pop()
  13440. });
  13441. break;
  13442. case '*':
  13443. if (last.length === 0) {
  13444. repeatErr(i);
  13445. }
  13446. last.push({
  13447. type: types.REPETITION,
  13448. min: 0,
  13449. max: Infinity,
  13450. value: last.pop()
  13451. });
  13452. break;
  13453. // Default is a character that is not `\[](){}?+*^$`.
  13454. default:
  13455. last.push({
  13456. type: types.CHAR,
  13457. value: c.charCodeAt(0)
  13458. });
  13459. }
  13460. } // Check if any groups have not been closed.
  13461. if (groupStack.length !== 0) {
  13462. util.error(regexpStr, 'Unterminated group');
  13463. }
  13464. return start;
  13465. };
  13466. module.exports.types = types;
  13467. /***/ }),
  13468. /***/ "./node_modules/ret/lib/positions.js":
  13469. /*!*******************************************!*\
  13470. !*** ./node_modules/ret/lib/positions.js ***!
  13471. \*******************************************/
  13472. /*! no static exports found */
  13473. /***/ (function(module, exports, __webpack_require__) {
  13474. "use strict";
  13475. var types = __webpack_require__(/*! ./types */ "./node_modules/ret/lib/types.js");
  13476. exports.wordBoundary = function () {
  13477. return {
  13478. type: types.POSITION,
  13479. value: 'b'
  13480. };
  13481. };
  13482. exports.nonWordBoundary = function () {
  13483. return {
  13484. type: types.POSITION,
  13485. value: 'B'
  13486. };
  13487. };
  13488. exports.begin = function () {
  13489. return {
  13490. type: types.POSITION,
  13491. value: '^'
  13492. };
  13493. };
  13494. exports.end = function () {
  13495. return {
  13496. type: types.POSITION,
  13497. value: '$'
  13498. };
  13499. };
  13500. /***/ }),
  13501. /***/ "./node_modules/ret/lib/sets.js":
  13502. /*!**************************************!*\
  13503. !*** ./node_modules/ret/lib/sets.js ***!
  13504. \**************************************/
  13505. /*! no static exports found */
  13506. /***/ (function(module, exports, __webpack_require__) {
  13507. "use strict";
  13508. var types = __webpack_require__(/*! ./types */ "./node_modules/ret/lib/types.js");
  13509. var INTS = function INTS() {
  13510. return [{
  13511. type: types.RANGE,
  13512. from: 48,
  13513. to: 57
  13514. }];
  13515. };
  13516. var WORDS = function WORDS() {
  13517. return [{
  13518. type: types.CHAR,
  13519. value: 95
  13520. }, {
  13521. type: types.RANGE,
  13522. from: 97,
  13523. to: 122
  13524. }, {
  13525. type: types.RANGE,
  13526. from: 65,
  13527. to: 90
  13528. }].concat(INTS());
  13529. };
  13530. var WHITESPACE = function WHITESPACE() {
  13531. return [{
  13532. type: types.CHAR,
  13533. value: 9
  13534. }, {
  13535. type: types.CHAR,
  13536. value: 10
  13537. }, {
  13538. type: types.CHAR,
  13539. value: 11
  13540. }, {
  13541. type: types.CHAR,
  13542. value: 12
  13543. }, {
  13544. type: types.CHAR,
  13545. value: 13
  13546. }, {
  13547. type: types.CHAR,
  13548. value: 32
  13549. }, {
  13550. type: types.CHAR,
  13551. value: 160
  13552. }, {
  13553. type: types.CHAR,
  13554. value: 5760
  13555. }, {
  13556. type: types.CHAR,
  13557. value: 6158
  13558. }, {
  13559. type: types.CHAR,
  13560. value: 8192
  13561. }, {
  13562. type: types.CHAR,
  13563. value: 8193
  13564. }, {
  13565. type: types.CHAR,
  13566. value: 8194
  13567. }, {
  13568. type: types.CHAR,
  13569. value: 8195
  13570. }, {
  13571. type: types.CHAR,
  13572. value: 8196
  13573. }, {
  13574. type: types.CHAR,
  13575. value: 8197
  13576. }, {
  13577. type: types.CHAR,
  13578. value: 8198
  13579. }, {
  13580. type: types.CHAR,
  13581. value: 8199
  13582. }, {
  13583. type: types.CHAR,
  13584. value: 8200
  13585. }, {
  13586. type: types.CHAR,
  13587. value: 8201
  13588. }, {
  13589. type: types.CHAR,
  13590. value: 8202
  13591. }, {
  13592. type: types.CHAR,
  13593. value: 8232
  13594. }, {
  13595. type: types.CHAR,
  13596. value: 8233
  13597. }, {
  13598. type: types.CHAR,
  13599. value: 8239
  13600. }, {
  13601. type: types.CHAR,
  13602. value: 8287
  13603. }, {
  13604. type: types.CHAR,
  13605. value: 12288
  13606. }, {
  13607. type: types.CHAR,
  13608. value: 65279
  13609. }];
  13610. };
  13611. var NOTANYCHAR = function NOTANYCHAR() {
  13612. return [{
  13613. type: types.CHAR,
  13614. value: 10
  13615. }, {
  13616. type: types.CHAR,
  13617. value: 13
  13618. }, {
  13619. type: types.CHAR,
  13620. value: 8232
  13621. }, {
  13622. type: types.CHAR,
  13623. value: 8233
  13624. }];
  13625. }; // Predefined class objects.
  13626. exports.words = function () {
  13627. return {
  13628. type: types.SET,
  13629. set: WORDS(),
  13630. not: false
  13631. };
  13632. };
  13633. exports.notWords = function () {
  13634. return {
  13635. type: types.SET,
  13636. set: WORDS(),
  13637. not: true
  13638. };
  13639. };
  13640. exports.ints = function () {
  13641. return {
  13642. type: types.SET,
  13643. set: INTS(),
  13644. not: false
  13645. };
  13646. };
  13647. exports.notInts = function () {
  13648. return {
  13649. type: types.SET,
  13650. set: INTS(),
  13651. not: true
  13652. };
  13653. };
  13654. exports.whitespace = function () {
  13655. return {
  13656. type: types.SET,
  13657. set: WHITESPACE(),
  13658. not: false
  13659. };
  13660. };
  13661. exports.notWhitespace = function () {
  13662. return {
  13663. type: types.SET,
  13664. set: WHITESPACE(),
  13665. not: true
  13666. };
  13667. };
  13668. exports.anyChar = function () {
  13669. return {
  13670. type: types.SET,
  13671. set: NOTANYCHAR(),
  13672. not: true
  13673. };
  13674. };
  13675. /***/ }),
  13676. /***/ "./node_modules/ret/lib/types.js":
  13677. /*!***************************************!*\
  13678. !*** ./node_modules/ret/lib/types.js ***!
  13679. \***************************************/
  13680. /*! no static exports found */
  13681. /***/ (function(module, exports, __webpack_require__) {
  13682. "use strict";
  13683. module.exports = {
  13684. ROOT: 0,
  13685. GROUP: 1,
  13686. POSITION: 2,
  13687. SET: 3,
  13688. RANGE: 4,
  13689. REPETITION: 5,
  13690. REFERENCE: 6,
  13691. CHAR: 7
  13692. };
  13693. /***/ }),
  13694. /***/ "./node_modules/ret/lib/util.js":
  13695. /*!**************************************!*\
  13696. !*** ./node_modules/ret/lib/util.js ***!
  13697. \**************************************/
  13698. /*! no static exports found */
  13699. /***/ (function(module, exports, __webpack_require__) {
  13700. "use strict";
  13701. var types = __webpack_require__(/*! ./types */ "./node_modules/ret/lib/types.js");
  13702. var sets = __webpack_require__(/*! ./sets */ "./node_modules/ret/lib/sets.js"); // All of these are private and only used by randexp.
  13703. // It's assumed that they will always be called with the correct input.
  13704. var CTRL = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?';
  13705. var SLSH = {
  13706. '0': 0,
  13707. 't': 9,
  13708. 'n': 10,
  13709. 'v': 11,
  13710. 'f': 12,
  13711. 'r': 13
  13712. };
  13713. /**
  13714. * Finds character representations in str and convert all to
  13715. * their respective characters
  13716. *
  13717. * @param {String} str
  13718. * @return {String}
  13719. */
  13720. exports.strToChars = function (str) {
  13721. /* jshint maxlen: false */
  13722. var chars_regex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z\[\\\]\^?])|([0tnvfr]))/g;
  13723. str = str.replace(chars_regex, function (s, b, lbs, a16, b16, c8, dctrl, eslsh) {
  13724. if (lbs) {
  13725. return s;
  13726. }
  13727. var code = b ? 8 : a16 ? parseInt(a16, 16) : b16 ? parseInt(b16, 16) : c8 ? parseInt(c8, 8) : dctrl ? CTRL.indexOf(dctrl) : SLSH[eslsh];
  13728. var c = String.fromCharCode(code); // Escape special regex characters.
  13729. if (/[\[\]{}\^$.|?*+()]/.test(c)) {
  13730. c = '\\' + c;
  13731. }
  13732. return c;
  13733. });
  13734. return str;
  13735. };
  13736. /**
  13737. * turns class into tokens
  13738. * reads str until it encounters a ] not preceeded by a \
  13739. *
  13740. * @param {String} str
  13741. * @param {String} regexpStr
  13742. * @return {Array.<Array.<Object>, Number>}
  13743. */
  13744. exports.tokenizeClass = function (str, regexpStr) {
  13745. /* jshint maxlen: false */
  13746. var tokens = [];
  13747. var regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?(.)/g;
  13748. var rs, c;
  13749. while ((rs = regexp.exec(str)) != null) {
  13750. if (rs[1]) {
  13751. tokens.push(sets.words());
  13752. } else if (rs[2]) {
  13753. tokens.push(sets.ints());
  13754. } else if (rs[3]) {
  13755. tokens.push(sets.whitespace());
  13756. } else if (rs[4]) {
  13757. tokens.push(sets.notWords());
  13758. } else if (rs[5]) {
  13759. tokens.push(sets.notInts());
  13760. } else if (rs[6]) {
  13761. tokens.push(sets.notWhitespace());
  13762. } else if (rs[7]) {
  13763. tokens.push({
  13764. type: types.RANGE,
  13765. from: (rs[8] || rs[9]).charCodeAt(0),
  13766. to: rs[10].charCodeAt(0)
  13767. });
  13768. } else if (c = rs[12]) {
  13769. tokens.push({
  13770. type: types.CHAR,
  13771. value: c.charCodeAt(0)
  13772. });
  13773. } else {
  13774. return [tokens, regexp.lastIndex];
  13775. }
  13776. }
  13777. exports.error(regexpStr, 'Unterminated character class');
  13778. };
  13779. /**
  13780. * Shortcut to throw errors.
  13781. *
  13782. * @param {String} regexp
  13783. * @param {String} msg
  13784. */
  13785. exports.error = function (regexp, msg) {
  13786. throw new SyntaxError('Invalid regular expression: /' + regexp + '/: ' + msg);
  13787. };
  13788. /***/ }),
  13789. /***/ "./node_modules/safe-regex/index.js":
  13790. /*!******************************************!*\
  13791. !*** ./node_modules/safe-regex/index.js ***!
  13792. \******************************************/
  13793. /*! no static exports found */
  13794. /***/ (function(module, exports, __webpack_require__) {
  13795. "use strict";
  13796. var parse = __webpack_require__(/*! ret */ "./node_modules/ret/lib/index.js");
  13797. var types = parse.types;
  13798. module.exports = function (re, opts) {
  13799. if (!opts) opts = {};
  13800. var replimit = opts.limit === undefined ? 25 : opts.limit;
  13801. if (isRegExp(re)) re = re.source;else if (typeof re !== 'string') re = String(re);
  13802. try {
  13803. re = parse(re);
  13804. } catch (err) {
  13805. return false;
  13806. }
  13807. var reps = 0;
  13808. return function walk(node, starHeight) {
  13809. if (node.type === types.REPETITION) {
  13810. starHeight++;
  13811. reps++;
  13812. if (starHeight > 1) return false;
  13813. if (reps > replimit) return false;
  13814. }
  13815. if (node.options) {
  13816. for (var i = 0, len = node.options.length; i < len; i++) {
  13817. var ok = walk({
  13818. stack: node.options[i]
  13819. }, starHeight);
  13820. if (!ok) return false;
  13821. }
  13822. }
  13823. var stack = node.stack || node.value && node.value.stack;
  13824. if (!stack) return true;
  13825. for (var i = 0; i < stack.length; i++) {
  13826. var ok = walk(stack[i], starHeight);
  13827. if (!ok) return false;
  13828. }
  13829. return true;
  13830. }(re, 0);
  13831. };
  13832. function isRegExp(x) {
  13833. return {}.toString.call(x) === '[object RegExp]';
  13834. }
  13835. /***/ }),
  13836. /***/ "./node_modules/set-value/index.js":
  13837. /*!*****************************************!*\
  13838. !*** ./node_modules/set-value/index.js ***!
  13839. \*****************************************/
  13840. /*! no static exports found */
  13841. /***/ (function(module, exports, __webpack_require__) {
  13842. "use strict";
  13843. /*!
  13844. * set-value <https://github.com/jonschlinkert/set-value>
  13845. *
  13846. * Copyright (c) 2014-2015, 2017, Jon Schlinkert.
  13847. * Released under the MIT License.
  13848. */
  13849. var split = __webpack_require__(/*! split-string */ "./node_modules/split-string/index.js");
  13850. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  13851. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  13852. var isObject = __webpack_require__(/*! is-extendable */ "./node_modules/is-extendable/index.js");
  13853. module.exports = function (obj, prop, val) {
  13854. if (!isObject(obj)) {
  13855. return obj;
  13856. }
  13857. if (Array.isArray(prop)) {
  13858. prop = [].concat.apply([], prop).join('.');
  13859. }
  13860. if (typeof prop !== 'string') {
  13861. return obj;
  13862. }
  13863. var keys = split(prop, {
  13864. sep: '.',
  13865. brackets: true
  13866. }).filter(isValidKey);
  13867. var len = keys.length;
  13868. var idx = -1;
  13869. var current = obj;
  13870. while (++idx < len) {
  13871. var key = keys[idx];
  13872. if (idx !== len - 1) {
  13873. if (!isObject(current[key])) {
  13874. current[key] = {};
  13875. }
  13876. current = current[key];
  13877. continue;
  13878. }
  13879. if (isPlainObject(current[key]) && isPlainObject(val)) {
  13880. current[key] = extend({}, current[key], val);
  13881. } else {
  13882. current[key] = val;
  13883. }
  13884. }
  13885. return obj;
  13886. };
  13887. function isValidKey(key) {
  13888. return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
  13889. }
  13890. /***/ }),
  13891. /***/ "./node_modules/setimmediate/setImmediate.js":
  13892. /*!***************************************************!*\
  13893. !*** ./node_modules/setimmediate/setImmediate.js ***!
  13894. \***************************************************/
  13895. /*! no static exports found */
  13896. /***/ (function(module, exports, __webpack_require__) {
  13897. "use strict";
  13898. /* WEBPACK VAR INJECTION */(function(global, process) {
  13899. (function (global, undefined) {
  13900. "use strict";
  13901. if (global.setImmediate) {
  13902. return;
  13903. }
  13904. var nextHandle = 1; // Spec says greater than zero
  13905. var tasksByHandle = {};
  13906. var currentlyRunningATask = false;
  13907. var doc = global.document;
  13908. var registerImmediate;
  13909. function setImmediate(callback) {
  13910. // Callback can either be a function or a string
  13911. if (typeof callback !== "function") {
  13912. callback = new Function("" + callback);
  13913. } // Copy function arguments
  13914. var args = new Array(arguments.length - 1);
  13915. for (var i = 0; i < args.length; i++) {
  13916. args[i] = arguments[i + 1];
  13917. } // Store and register the task
  13918. var task = {
  13919. callback: callback,
  13920. args: args
  13921. };
  13922. tasksByHandle[nextHandle] = task;
  13923. registerImmediate(nextHandle);
  13924. return nextHandle++;
  13925. }
  13926. function clearImmediate(handle) {
  13927. delete tasksByHandle[handle];
  13928. }
  13929. function run(task) {
  13930. var callback = task.callback;
  13931. var args = task.args;
  13932. switch (args.length) {
  13933. case 0:
  13934. callback();
  13935. break;
  13936. case 1:
  13937. callback(args[0]);
  13938. break;
  13939. case 2:
  13940. callback(args[0], args[1]);
  13941. break;
  13942. case 3:
  13943. callback(args[0], args[1], args[2]);
  13944. break;
  13945. default:
  13946. callback.apply(undefined, args);
  13947. break;
  13948. }
  13949. }
  13950. function runIfPresent(handle) {
  13951. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  13952. // So if we're currently running a task, we'll need to delay this invocation.
  13953. if (currentlyRunningATask) {
  13954. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  13955. // "too much recursion" error.
  13956. setTimeout(runIfPresent, 0, handle);
  13957. } else {
  13958. var task = tasksByHandle[handle];
  13959. if (task) {
  13960. currentlyRunningATask = true;
  13961. try {
  13962. run(task);
  13963. } finally {
  13964. clearImmediate(handle);
  13965. currentlyRunningATask = false;
  13966. }
  13967. }
  13968. }
  13969. }
  13970. function installNextTickImplementation() {
  13971. registerImmediate = function registerImmediate(handle) {
  13972. process.nextTick(function () {
  13973. runIfPresent(handle);
  13974. });
  13975. };
  13976. }
  13977. function canUsePostMessage() {
  13978. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  13979. // where `global.postMessage` means something completely different and can't be used for this purpose.
  13980. if (global.postMessage && !global.importScripts) {
  13981. var postMessageIsAsynchronous = true;
  13982. var oldOnMessage = global.onmessage;
  13983. global.onmessage = function () {
  13984. postMessageIsAsynchronous = false;
  13985. };
  13986. global.postMessage("", "*");
  13987. global.onmessage = oldOnMessage;
  13988. return postMessageIsAsynchronous;
  13989. }
  13990. }
  13991. function installPostMessageImplementation() {
  13992. // Installs an event handler on `global` for the `message` event: see
  13993. // * https://developer.mozilla.org/en/DOM/window.postMessage
  13994. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  13995. var messagePrefix = "setImmediate$" + Math.random() + "$";
  13996. var onGlobalMessage = function onGlobalMessage(event) {
  13997. if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
  13998. runIfPresent(+event.data.slice(messagePrefix.length));
  13999. }
  14000. };
  14001. if (global.addEventListener) {
  14002. global.addEventListener("message", onGlobalMessage, false);
  14003. } else {
  14004. global.attachEvent("onmessage", onGlobalMessage);
  14005. }
  14006. registerImmediate = function registerImmediate(handle) {
  14007. global.postMessage(messagePrefix + handle, "*");
  14008. };
  14009. }
  14010. function installMessageChannelImplementation() {
  14011. var channel = new MessageChannel();
  14012. channel.port1.onmessage = function (event) {
  14013. var handle = event.data;
  14014. runIfPresent(handle);
  14015. };
  14016. registerImmediate = function registerImmediate(handle) {
  14017. channel.port2.postMessage(handle);
  14018. };
  14019. }
  14020. function installReadyStateChangeImplementation() {
  14021. var html = doc.documentElement;
  14022. registerImmediate = function registerImmediate(handle) {
  14023. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  14024. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  14025. var script = doc.createElement("script");
  14026. script.onreadystatechange = function () {
  14027. runIfPresent(handle);
  14028. script.onreadystatechange = null;
  14029. html.removeChild(script);
  14030. script = null;
  14031. };
  14032. html.appendChild(script);
  14033. };
  14034. }
  14035. function installSetTimeoutImplementation() {
  14036. registerImmediate = function registerImmediate(handle) {
  14037. setTimeout(runIfPresent, 0, handle);
  14038. };
  14039. } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  14040. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  14041. attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments.
  14042. if ({}.toString.call(global.process) === "[object process]") {
  14043. // For Node.js before 0.9
  14044. installNextTickImplementation();
  14045. } else if (canUsePostMessage()) {
  14046. // For non-IE10 modern browsers
  14047. installPostMessageImplementation();
  14048. } else if (global.MessageChannel) {
  14049. // For web workers, where supported
  14050. installMessageChannelImplementation();
  14051. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  14052. // For IE 6–8
  14053. installReadyStateChangeImplementation();
  14054. } else {
  14055. // For older browsers
  14056. installSetTimeoutImplementation();
  14057. }
  14058. attachTo.setImmediate = setImmediate;
  14059. attachTo.clearImmediate = clearImmediate;
  14060. })(typeof self === "undefined" ? typeof global === "undefined" ? void 0 : global : self);
  14061. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  14062. /***/ }),
  14063. /***/ "./node_modules/slash/index.js":
  14064. /*!*************************************!*\
  14065. !*** ./node_modules/slash/index.js ***!
  14066. \*************************************/
  14067. /*! no static exports found */
  14068. /***/ (function(module, exports, __webpack_require__) {
  14069. "use strict";
  14070. module.exports = function (input) {
  14071. var isExtendedLengthPath = /^\\\\\?\\/.test(input);
  14072. var hasNonAscii = /[^\u0000-\u0080]+/.test(input); // eslint-disable-line no-control-regex
  14073. if (isExtendedLengthPath || hasNonAscii) {
  14074. return input;
  14075. }
  14076. return input.replace(/\\/g, '/');
  14077. };
  14078. /***/ }),
  14079. /***/ "./node_modules/snapdragon-node/index.js":
  14080. /*!***********************************************!*\
  14081. !*** ./node_modules/snapdragon-node/index.js ***!
  14082. \***********************************************/
  14083. /*! no static exports found */
  14084. /***/ (function(module, exports, __webpack_require__) {
  14085. "use strict";
  14086. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  14087. var define = __webpack_require__(/*! define-property */ "./node_modules/snapdragon-node/node_modules/define-property/index.js");
  14088. var utils = __webpack_require__(/*! snapdragon-util */ "./node_modules/snapdragon-util/index.js");
  14089. var ownNames;
  14090. /**
  14091. * Create a new AST `Node` with the given `val` and `type`.
  14092. *
  14093. * ```js
  14094. * var node = new Node('*', 'Star');
  14095. * var node = new Node({type: 'star', val: '*'});
  14096. * ```
  14097. * @name Node
  14098. * @param {String|Object} `val` Pass a matched substring, or an object to merge onto the node.
  14099. * @param {String} `type` The node type to use when `val` is a string.
  14100. * @return {Object} node instance
  14101. * @api public
  14102. */
  14103. function Node(val, type, parent) {
  14104. if (typeof type !== 'string') {
  14105. parent = type;
  14106. type = null;
  14107. }
  14108. define(this, 'parent', parent);
  14109. define(this, 'isNode', true);
  14110. define(this, 'expect', null);
  14111. if (typeof type !== 'string' && isObject(val)) {
  14112. lazyKeys();
  14113. var keys = Object.keys(val);
  14114. for (var i = 0; i < keys.length; i++) {
  14115. var key = keys[i];
  14116. if (ownNames.indexOf(key) === -1) {
  14117. this[key] = val[key];
  14118. }
  14119. }
  14120. } else {
  14121. this.type = type;
  14122. this.val = val;
  14123. }
  14124. }
  14125. /**
  14126. * Returns true if the given value is a node.
  14127. *
  14128. * ```js
  14129. * var Node = require('snapdragon-node');
  14130. * var node = new Node({type: 'foo'});
  14131. * console.log(Node.isNode(node)); //=> true
  14132. * console.log(Node.isNode({})); //=> false
  14133. * ```
  14134. * @param {Object} `node`
  14135. * @returns {Boolean}
  14136. * @api public
  14137. */
  14138. Node.isNode = function (node) {
  14139. return utils.isNode(node);
  14140. };
  14141. /**
  14142. * Define a non-enumberable property on the node instance.
  14143. * Useful for adding properties that shouldn't be extended
  14144. * or visible during debugging.
  14145. *
  14146. * ```js
  14147. * var node = new Node();
  14148. * node.define('foo', 'something non-enumerable');
  14149. * ```
  14150. * @param {String} `name`
  14151. * @param {any} `val`
  14152. * @return {Object} returns the node instance
  14153. * @api public
  14154. */
  14155. Node.prototype.define = function (name, val) {
  14156. define(this, name, val);
  14157. return this;
  14158. };
  14159. /**
  14160. * Returns true if `node.val` is an empty string, or `node.nodes` does
  14161. * not contain any non-empty text nodes.
  14162. *
  14163. * ```js
  14164. * var node = new Node({type: 'text'});
  14165. * node.isEmpty(); //=> true
  14166. * node.val = 'foo';
  14167. * node.isEmpty(); //=> false
  14168. * ```
  14169. * @param {Function} `fn` (optional) Filter function that is called on `node` and/or child nodes. `isEmpty` will return false immediately when the filter function returns false on any nodes.
  14170. * @return {Boolean}
  14171. * @api public
  14172. */
  14173. Node.prototype.isEmpty = function (fn) {
  14174. return utils.isEmpty(this, fn);
  14175. };
  14176. /**
  14177. * Given node `foo` and node `bar`, push node `bar` onto `foo.nodes`, and
  14178. * set `foo` as `bar.parent`.
  14179. *
  14180. * ```js
  14181. * var foo = new Node({type: 'foo'});
  14182. * var bar = new Node({type: 'bar'});
  14183. * foo.push(bar);
  14184. * ```
  14185. * @param {Object} `node`
  14186. * @return {Number} Returns the length of `node.nodes`
  14187. * @api public
  14188. */
  14189. Node.prototype.push = function (node) {
  14190. assert(Node.isNode(node), 'expected node to be an instance of Node');
  14191. define(node, 'parent', this);
  14192. this.nodes = this.nodes || [];
  14193. return this.nodes.push(node);
  14194. };
  14195. /**
  14196. * Given node `foo` and node `bar`, unshift node `bar` onto `foo.nodes`, and
  14197. * set `foo` as `bar.parent`.
  14198. *
  14199. * ```js
  14200. * var foo = new Node({type: 'foo'});
  14201. * var bar = new Node({type: 'bar'});
  14202. * foo.unshift(bar);
  14203. * ```
  14204. * @param {Object} `node`
  14205. * @return {Number} Returns the length of `node.nodes`
  14206. * @api public
  14207. */
  14208. Node.prototype.unshift = function (node) {
  14209. assert(Node.isNode(node), 'expected node to be an instance of Node');
  14210. define(node, 'parent', this);
  14211. this.nodes = this.nodes || [];
  14212. return this.nodes.unshift(node);
  14213. };
  14214. /**
  14215. * Pop a node from `node.nodes`.
  14216. *
  14217. * ```js
  14218. * var node = new Node({type: 'foo'});
  14219. * node.push(new Node({type: 'a'}));
  14220. * node.push(new Node({type: 'b'}));
  14221. * node.push(new Node({type: 'c'}));
  14222. * node.push(new Node({type: 'd'}));
  14223. * console.log(node.nodes.length);
  14224. * //=> 4
  14225. * node.pop();
  14226. * console.log(node.nodes.length);
  14227. * //=> 3
  14228. * ```
  14229. * @return {Number} Returns the popped `node`
  14230. * @api public
  14231. */
  14232. Node.prototype.pop = function () {
  14233. return this.nodes && this.nodes.pop();
  14234. };
  14235. /**
  14236. * Shift a node from `node.nodes`.
  14237. *
  14238. * ```js
  14239. * var node = new Node({type: 'foo'});
  14240. * node.push(new Node({type: 'a'}));
  14241. * node.push(new Node({type: 'b'}));
  14242. * node.push(new Node({type: 'c'}));
  14243. * node.push(new Node({type: 'd'}));
  14244. * console.log(node.nodes.length);
  14245. * //=> 4
  14246. * node.shift();
  14247. * console.log(node.nodes.length);
  14248. * //=> 3
  14249. * ```
  14250. * @return {Object} Returns the shifted `node`
  14251. * @api public
  14252. */
  14253. Node.prototype.shift = function () {
  14254. return this.nodes && this.nodes.shift();
  14255. };
  14256. /**
  14257. * Remove `node` from `node.nodes`.
  14258. *
  14259. * ```js
  14260. * node.remove(childNode);
  14261. * ```
  14262. * @param {Object} `node`
  14263. * @return {Object} Returns the removed node.
  14264. * @api public
  14265. */
  14266. Node.prototype.remove = function (node) {
  14267. assert(Node.isNode(node), 'expected node to be an instance of Node');
  14268. this.nodes = this.nodes || [];
  14269. var idx = node.index;
  14270. if (idx !== -1) {
  14271. node.index = -1;
  14272. return this.nodes.splice(idx, 1);
  14273. }
  14274. return null;
  14275. };
  14276. /**
  14277. * Get the first child node from `node.nodes` that matches the given `type`.
  14278. * If `type` is a number, the child node at that index is returned.
  14279. *
  14280. * ```js
  14281. * var child = node.find(1); //<= index of the node to get
  14282. * var child = node.find('foo'); //<= node.type of a child node
  14283. * var child = node.find(/^(foo|bar)$/); //<= regex to match node.type
  14284. * var child = node.find(['foo', 'bar']); //<= array of node.type(s)
  14285. * ```
  14286. * @param {String} `type`
  14287. * @return {Object} Returns a child node or undefined.
  14288. * @api public
  14289. */
  14290. Node.prototype.find = function (type) {
  14291. return utils.findNode(this.nodes, type);
  14292. };
  14293. /**
  14294. * Return true if the node is the given `type`.
  14295. *
  14296. * ```js
  14297. * var node = new Node({type: 'bar'});
  14298. * cosole.log(node.isType('foo')); // false
  14299. * cosole.log(node.isType(/^(foo|bar)$/)); // true
  14300. * cosole.log(node.isType(['foo', 'bar'])); // true
  14301. * ```
  14302. * @param {String} `type`
  14303. * @return {Boolean}
  14304. * @api public
  14305. */
  14306. Node.prototype.isType = function (type) {
  14307. return utils.isType(this, type);
  14308. };
  14309. /**
  14310. * Return true if the `node.nodes` has the given `type`.
  14311. *
  14312. * ```js
  14313. * var foo = new Node({type: 'foo'});
  14314. * var bar = new Node({type: 'bar'});
  14315. * foo.push(bar);
  14316. *
  14317. * cosole.log(foo.hasType('qux')); // false
  14318. * cosole.log(foo.hasType(/^(qux|bar)$/)); // true
  14319. * cosole.log(foo.hasType(['qux', 'bar'])); // true
  14320. * ```
  14321. * @param {String} `type`
  14322. * @return {Boolean}
  14323. * @api public
  14324. */
  14325. Node.prototype.hasType = function (type) {
  14326. return utils.hasType(this, type);
  14327. };
  14328. /**
  14329. * Get the siblings array, or `null` if it doesn't exist.
  14330. *
  14331. * ```js
  14332. * var foo = new Node({type: 'foo'});
  14333. * var bar = new Node({type: 'bar'});
  14334. * var baz = new Node({type: 'baz'});
  14335. * foo.push(bar);
  14336. * foo.push(baz);
  14337. *
  14338. * console.log(bar.siblings.length) // 2
  14339. * console.log(baz.siblings.length) // 2
  14340. * ```
  14341. * @return {Array}
  14342. * @api public
  14343. */
  14344. Object.defineProperty(Node.prototype, 'siblings', {
  14345. set: function set() {
  14346. throw new Error('node.siblings is a getter and cannot be defined');
  14347. },
  14348. get: function get() {
  14349. return this.parent ? this.parent.nodes : null;
  14350. }
  14351. });
  14352. /**
  14353. * Get the node's current index from `node.parent.nodes`.
  14354. * This should always be correct, even when the parent adds nodes.
  14355. *
  14356. * ```js
  14357. * var foo = new Node({type: 'foo'});
  14358. * var bar = new Node({type: 'bar'});
  14359. * var baz = new Node({type: 'baz'});
  14360. * var qux = new Node({type: 'qux'});
  14361. * foo.push(bar);
  14362. * foo.push(baz);
  14363. * foo.unshift(qux);
  14364. *
  14365. * console.log(bar.index) // 1
  14366. * console.log(baz.index) // 2
  14367. * console.log(qux.index) // 0
  14368. * ```
  14369. * @return {Number}
  14370. * @api public
  14371. */
  14372. Object.defineProperty(Node.prototype, 'index', {
  14373. set: function set(index) {
  14374. define(this, 'idx', index);
  14375. },
  14376. get: function get() {
  14377. if (!Array.isArray(this.siblings)) {
  14378. return -1;
  14379. }
  14380. var tok = this.idx !== -1 ? this.siblings[this.idx] : null;
  14381. if (tok !== this) {
  14382. this.idx = this.siblings.indexOf(this);
  14383. }
  14384. return this.idx;
  14385. }
  14386. });
  14387. /**
  14388. * Get the previous node from the siblings array or `null`.
  14389. *
  14390. * ```js
  14391. * var foo = new Node({type: 'foo'});
  14392. * var bar = new Node({type: 'bar'});
  14393. * var baz = new Node({type: 'baz'});
  14394. * foo.push(bar);
  14395. * foo.push(baz);
  14396. *
  14397. * console.log(baz.prev.type) // 'bar'
  14398. * ```
  14399. * @return {Object}
  14400. * @api public
  14401. */
  14402. Object.defineProperty(Node.prototype, 'prev', {
  14403. set: function set() {
  14404. throw new Error('node.prev is a getter and cannot be defined');
  14405. },
  14406. get: function get() {
  14407. if (Array.isArray(this.siblings)) {
  14408. return this.siblings[this.index - 1] || this.parent.prev;
  14409. }
  14410. return null;
  14411. }
  14412. });
  14413. /**
  14414. * Get the siblings array, or `null` if it doesn't exist.
  14415. *
  14416. * ```js
  14417. * var foo = new Node({type: 'foo'});
  14418. * var bar = new Node({type: 'bar'});
  14419. * var baz = new Node({type: 'baz'});
  14420. * foo.push(bar);
  14421. * foo.push(baz);
  14422. *
  14423. * console.log(bar.siblings.length) // 2
  14424. * console.log(baz.siblings.length) // 2
  14425. * ```
  14426. * @return {Object}
  14427. * @api public
  14428. */
  14429. Object.defineProperty(Node.prototype, 'next', {
  14430. set: function set() {
  14431. throw new Error('node.next is a getter and cannot be defined');
  14432. },
  14433. get: function get() {
  14434. if (Array.isArray(this.siblings)) {
  14435. return this.siblings[this.index + 1] || this.parent.next;
  14436. }
  14437. return null;
  14438. }
  14439. });
  14440. /**
  14441. * Get the first node from `node.nodes`.
  14442. *
  14443. * ```js
  14444. * var foo = new Node({type: 'foo'});
  14445. * var bar = new Node({type: 'bar'});
  14446. * var baz = new Node({type: 'baz'});
  14447. * var qux = new Node({type: 'qux'});
  14448. * foo.push(bar);
  14449. * foo.push(baz);
  14450. * foo.push(qux);
  14451. *
  14452. * console.log(foo.first.type) // 'bar'
  14453. * ```
  14454. * @return {Object} The first node, or undefiend
  14455. * @api public
  14456. */
  14457. Object.defineProperty(Node.prototype, 'first', {
  14458. get: function get() {
  14459. return this.nodes ? this.nodes[0] : null;
  14460. }
  14461. });
  14462. /**
  14463. * Get the last node from `node.nodes`.
  14464. *
  14465. * ```js
  14466. * var foo = new Node({type: 'foo'});
  14467. * var bar = new Node({type: 'bar'});
  14468. * var baz = new Node({type: 'baz'});
  14469. * var qux = new Node({type: 'qux'});
  14470. * foo.push(bar);
  14471. * foo.push(baz);
  14472. * foo.push(qux);
  14473. *
  14474. * console.log(foo.last.type) // 'qux'
  14475. * ```
  14476. * @return {Object} The last node, or undefiend
  14477. * @api public
  14478. */
  14479. Object.defineProperty(Node.prototype, 'last', {
  14480. get: function get() {
  14481. return this.nodes ? utils.last(this.nodes) : null;
  14482. }
  14483. });
  14484. /**
  14485. * Get the last node from `node.nodes`.
  14486. *
  14487. * ```js
  14488. * var foo = new Node({type: 'foo'});
  14489. * var bar = new Node({type: 'bar'});
  14490. * var baz = new Node({type: 'baz'});
  14491. * var qux = new Node({type: 'qux'});
  14492. * foo.push(bar);
  14493. * foo.push(baz);
  14494. * foo.push(qux);
  14495. *
  14496. * console.log(foo.last.type) // 'qux'
  14497. * ```
  14498. * @return {Object} The last node, or undefiend
  14499. * @api public
  14500. */
  14501. Object.defineProperty(Node.prototype, 'scope', {
  14502. get: function get() {
  14503. if (this.isScope !== true) {
  14504. return this.parent ? this.parent.scope : this;
  14505. }
  14506. return this;
  14507. }
  14508. });
  14509. /**
  14510. * Get own property names from Node prototype, but only the
  14511. * first time `Node` is instantiated
  14512. */
  14513. function lazyKeys() {
  14514. if (!ownNames) {
  14515. ownNames = Object.getOwnPropertyNames(Node.prototype);
  14516. }
  14517. }
  14518. /**
  14519. * Simplified assertion. Throws an error is `val` is falsey.
  14520. */
  14521. function assert(val, message) {
  14522. if (!val) throw new Error(message);
  14523. }
  14524. /**
  14525. * Expose `Node`
  14526. */
  14527. exports = module.exports = Node;
  14528. /***/ }),
  14529. /***/ "./node_modules/snapdragon-node/node_modules/define-property/index.js":
  14530. /*!****************************************************************************!*\
  14531. !*** ./node_modules/snapdragon-node/node_modules/define-property/index.js ***!
  14532. \****************************************************************************/
  14533. /*! no static exports found */
  14534. /***/ (function(module, exports, __webpack_require__) {
  14535. "use strict";
  14536. /*!
  14537. * define-property <https://github.com/jonschlinkert/define-property>
  14538. *
  14539. * Copyright (c) 2015, 2017, Jon Schlinkert.
  14540. * Released under the MIT License.
  14541. */
  14542. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  14543. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/is-descriptor/index.js");
  14544. module.exports = function defineProperty(obj, prop, val) {
  14545. if (_typeof(obj) !== 'object' && typeof obj !== 'function') {
  14546. throw new TypeError('expected an object or function.');
  14547. }
  14548. if (typeof prop !== 'string') {
  14549. throw new TypeError('expected `prop` to be a string.');
  14550. }
  14551. if (isDescriptor(val) && ('set' in val || 'get' in val)) {
  14552. return Object.defineProperty(obj, prop, val);
  14553. }
  14554. return Object.defineProperty(obj, prop, {
  14555. configurable: true,
  14556. enumerable: false,
  14557. writable: true,
  14558. value: val
  14559. });
  14560. };
  14561. /***/ }),
  14562. /***/ "./node_modules/snapdragon-util/index.js":
  14563. /*!***********************************************!*\
  14564. !*** ./node_modules/snapdragon-util/index.js ***!
  14565. \***********************************************/
  14566. /*! no static exports found */
  14567. /***/ (function(module, exports, __webpack_require__) {
  14568. "use strict";
  14569. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/kind-of/index.js");
  14570. var utils = module.exports;
  14571. /**
  14572. * Returns true if the given value is a node.
  14573. *
  14574. * ```js
  14575. * var Node = require('snapdragon-node');
  14576. * var node = new Node({type: 'foo'});
  14577. * console.log(utils.isNode(node)); //=> true
  14578. * console.log(utils.isNode({})); //=> false
  14579. * ```
  14580. * @param {Object} `node` Instance of [snapdragon-node][]
  14581. * @returns {Boolean}
  14582. * @api public
  14583. */
  14584. utils.isNode = function (node) {
  14585. return typeOf(node) === 'object' && node.isNode === true;
  14586. };
  14587. /**
  14588. * Emit an empty string for the given `node`.
  14589. *
  14590. * ```js
  14591. * // do nothing for beginning-of-string
  14592. * snapdragon.compiler.set('bos', utils.noop);
  14593. * ```
  14594. * @param {Object} `node` Instance of [snapdragon-node][]
  14595. * @returns {undefined}
  14596. * @api public
  14597. */
  14598. utils.noop = function (node) {
  14599. append(this, '', node);
  14600. };
  14601. /**
  14602. * Appdend `node.val` to `compiler.output`, exactly as it was created
  14603. * by the parser.
  14604. *
  14605. * ```js
  14606. * snapdragon.compiler.set('text', utils.identity);
  14607. * ```
  14608. * @param {Object} `node` Instance of [snapdragon-node][]
  14609. * @returns {undefined}
  14610. * @api public
  14611. */
  14612. utils.identity = function (node) {
  14613. append(this, node.val, node);
  14614. };
  14615. /**
  14616. * Previously named `.emit`, this method appends the given `val`
  14617. * to `compiler.output` for the given node. Useful when you know
  14618. * what value should be appended advance, regardless of the actual
  14619. * value of `node.val`.
  14620. *
  14621. * ```js
  14622. * snapdragon.compiler
  14623. * .set('i', function(node) {
  14624. * this.mapVisit(node);
  14625. * })
  14626. * .set('i.open', utils.append('<i>'))
  14627. * .set('i.close', utils.append('</i>'))
  14628. * ```
  14629. * @param {Object} `node` Instance of [snapdragon-node][]
  14630. * @returns {Function} Returns a compiler middleware function.
  14631. * @api public
  14632. */
  14633. utils.append = function (val) {
  14634. return function (node) {
  14635. append(this, val, node);
  14636. };
  14637. };
  14638. /**
  14639. * Used in compiler middleware, this onverts an AST node into
  14640. * an empty `text` node and deletes `node.nodes` if it exists.
  14641. * The advantage of this method is that, as opposed to completely
  14642. * removing the node, indices will not need to be re-calculated
  14643. * in sibling nodes, and nothing is appended to the output.
  14644. *
  14645. * ```js
  14646. * utils.toNoop(node);
  14647. * // convert `node.nodes` to the given value instead of deleting it
  14648. * utils.toNoop(node, []);
  14649. * ```
  14650. * @param {Object} `node` Instance of [snapdragon-node][]
  14651. * @param {Array} `nodes` Optionally pass a new `nodes` value, to replace the existing `node.nodes` array.
  14652. * @api public
  14653. */
  14654. utils.toNoop = function (node, nodes) {
  14655. if (nodes) {
  14656. node.nodes = nodes;
  14657. } else {
  14658. delete node.nodes;
  14659. node.type = 'text';
  14660. node.val = '';
  14661. }
  14662. };
  14663. /**
  14664. * Visit `node` with the given `fn`. The built-in `.visit` method in snapdragon
  14665. * automatically calls registered compilers, this allows you to pass a visitor
  14666. * function.
  14667. *
  14668. * ```js
  14669. * snapdragon.compiler.set('i', function(node) {
  14670. * utils.visit(node, function(childNode) {
  14671. * // do stuff with "childNode"
  14672. * return childNode;
  14673. * });
  14674. * });
  14675. * ```
  14676. * @param {Object} `node` Instance of [snapdragon-node][]
  14677. * @param {Function} `fn`
  14678. * @return {Object} returns the node after recursively visiting all child nodes.
  14679. * @api public
  14680. */
  14681. utils.visit = function (node, fn) {
  14682. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14683. assert(isFunction(fn), 'expected a visitor function');
  14684. fn(node);
  14685. return node.nodes ? utils.mapVisit(node, fn) : node;
  14686. };
  14687. /**
  14688. * Map [visit](#visit) the given `fn` over `node.nodes`. This is called by
  14689. * [visit](#visit), use this method if you do not want `fn` to be called on
  14690. * the first node.
  14691. *
  14692. * ```js
  14693. * snapdragon.compiler.set('i', function(node) {
  14694. * utils.mapVisit(node, function(childNode) {
  14695. * // do stuff with "childNode"
  14696. * return childNode;
  14697. * });
  14698. * });
  14699. * ```
  14700. * @param {Object} `node` Instance of [snapdragon-node][]
  14701. * @param {Object} `options`
  14702. * @param {Function} `fn`
  14703. * @return {Object} returns the node
  14704. * @api public
  14705. */
  14706. utils.mapVisit = function (node, fn) {
  14707. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14708. assert(isArray(node.nodes), 'expected node.nodes to be an array');
  14709. assert(isFunction(fn), 'expected a visitor function');
  14710. for (var i = 0; i < node.nodes.length; i++) {
  14711. utils.visit(node.nodes[i], fn);
  14712. }
  14713. return node;
  14714. };
  14715. /**
  14716. * Unshift an `*.open` node onto `node.nodes`.
  14717. *
  14718. * ```js
  14719. * var Node = require('snapdragon-node');
  14720. * snapdragon.parser.set('brace', function(node) {
  14721. * var match = this.match(/^{/);
  14722. * if (match) {
  14723. * var parent = new Node({type: 'brace'});
  14724. * utils.addOpen(parent, Node);
  14725. * console.log(parent.nodes[0]):
  14726. * // { type: 'brace.open', val: '' };
  14727. *
  14728. * // push the parent "brace" node onto the stack
  14729. * this.push(parent);
  14730. *
  14731. * // return the parent node, so it's also added to the AST
  14732. * return brace;
  14733. * }
  14734. * });
  14735. * ```
  14736. * @param {Object} `node` Instance of [snapdragon-node][]
  14737. * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][].
  14738. * @param {Function} `filter` Optionaly specify a filter function to exclude the node.
  14739. * @return {Object} Returns the created opening node.
  14740. * @api public
  14741. */
  14742. utils.addOpen = function (node, Node, val, filter) {
  14743. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14744. assert(isFunction(Node), 'expected Node to be a constructor function');
  14745. if (typeof val === 'function') {
  14746. filter = val;
  14747. val = '';
  14748. }
  14749. if (typeof filter === 'function' && !filter(node)) return;
  14750. var open = new Node({
  14751. type: node.type + '.open',
  14752. val: val
  14753. });
  14754. var unshift = node.unshift || node.unshiftNode;
  14755. if (typeof unshift === 'function') {
  14756. unshift.call(node, open);
  14757. } else {
  14758. utils.unshiftNode(node, open);
  14759. }
  14760. return open;
  14761. };
  14762. /**
  14763. * Push a `*.close` node onto `node.nodes`.
  14764. *
  14765. * ```js
  14766. * var Node = require('snapdragon-node');
  14767. * snapdragon.parser.set('brace', function(node) {
  14768. * var match = this.match(/^}/);
  14769. * if (match) {
  14770. * var parent = this.parent();
  14771. * if (parent.type !== 'brace') {
  14772. * throw new Error('missing opening: ' + '}');
  14773. * }
  14774. *
  14775. * utils.addClose(parent, Node);
  14776. * console.log(parent.nodes[parent.nodes.length - 1]):
  14777. * // { type: 'brace.close', val: '' };
  14778. *
  14779. * // no need to return a node, since the parent
  14780. * // was already added to the AST
  14781. * return;
  14782. * }
  14783. * });
  14784. * ```
  14785. * @param {Object} `node` Instance of [snapdragon-node][]
  14786. * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][].
  14787. * @param {Function} `filter` Optionaly specify a filter function to exclude the node.
  14788. * @return {Object} Returns the created closing node.
  14789. * @api public
  14790. */
  14791. utils.addClose = function (node, Node, val, filter) {
  14792. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14793. assert(isFunction(Node), 'expected Node to be a constructor function');
  14794. if (typeof val === 'function') {
  14795. filter = val;
  14796. val = '';
  14797. }
  14798. if (typeof filter === 'function' && !filter(node)) return;
  14799. var close = new Node({
  14800. type: node.type + '.close',
  14801. val: val
  14802. });
  14803. var push = node.push || node.pushNode;
  14804. if (typeof push === 'function') {
  14805. push.call(node, close);
  14806. } else {
  14807. utils.pushNode(node, close);
  14808. }
  14809. return close;
  14810. };
  14811. /**
  14812. * Wraps the given `node` with `*.open` and `*.close` nodes.
  14813. *
  14814. * @param {Object} `node` Instance of [snapdragon-node][]
  14815. * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][].
  14816. * @param {Function} `filter` Optionaly specify a filter function to exclude the node.
  14817. * @return {Object} Returns the node
  14818. * @api public
  14819. */
  14820. utils.wrapNodes = function (node, Node, filter) {
  14821. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14822. assert(isFunction(Node), 'expected Node to be a constructor function');
  14823. utils.addOpen(node, Node, filter);
  14824. utils.addClose(node, Node, filter);
  14825. return node;
  14826. };
  14827. /**
  14828. * Push the given `node` onto `parent.nodes`, and set `parent` as `node.parent.
  14829. *
  14830. * ```js
  14831. * var parent = new Node({type: 'foo'});
  14832. * var node = new Node({type: 'bar'});
  14833. * utils.pushNode(parent, node);
  14834. * console.log(parent.nodes[0].type) // 'bar'
  14835. * console.log(node.parent.type) // 'foo'
  14836. * ```
  14837. * @param {Object} `parent`
  14838. * @param {Object} `node` Instance of [snapdragon-node][]
  14839. * @return {Object} Returns the child node
  14840. * @api public
  14841. */
  14842. utils.pushNode = function (parent, node) {
  14843. assert(utils.isNode(parent), 'expected parent node to be an instance of Node');
  14844. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14845. node.define('parent', parent);
  14846. parent.nodes = parent.nodes || [];
  14847. parent.nodes.push(node);
  14848. return node;
  14849. };
  14850. /**
  14851. * Unshift `node` onto `parent.nodes`, and set `parent` as `node.parent.
  14852. *
  14853. * ```js
  14854. * var parent = new Node({type: 'foo'});
  14855. * var node = new Node({type: 'bar'});
  14856. * utils.unshiftNode(parent, node);
  14857. * console.log(parent.nodes[0].type) // 'bar'
  14858. * console.log(node.parent.type) // 'foo'
  14859. * ```
  14860. * @param {Object} `parent`
  14861. * @param {Object} `node` Instance of [snapdragon-node][]
  14862. * @return {undefined}
  14863. * @api public
  14864. */
  14865. utils.unshiftNode = function (parent, node) {
  14866. assert(utils.isNode(parent), 'expected parent node to be an instance of Node');
  14867. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14868. node.define('parent', parent);
  14869. parent.nodes = parent.nodes || [];
  14870. parent.nodes.unshift(node);
  14871. };
  14872. /**
  14873. * Pop the last `node` off of `parent.nodes`. The advantage of
  14874. * using this method is that it checks for `node.nodes` and works
  14875. * with any version of `snapdragon-node`.
  14876. *
  14877. * ```js
  14878. * var parent = new Node({type: 'foo'});
  14879. * utils.pushNode(parent, new Node({type: 'foo'}));
  14880. * utils.pushNode(parent, new Node({type: 'bar'}));
  14881. * utils.pushNode(parent, new Node({type: 'baz'}));
  14882. * console.log(parent.nodes.length); //=> 3
  14883. * utils.popNode(parent);
  14884. * console.log(parent.nodes.length); //=> 2
  14885. * ```
  14886. * @param {Object} `parent`
  14887. * @param {Object} `node` Instance of [snapdragon-node][]
  14888. * @return {Number|Undefined} Returns the length of `node.nodes` or undefined.
  14889. * @api public
  14890. */
  14891. utils.popNode = function (node) {
  14892. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14893. if (typeof node.pop === 'function') {
  14894. return node.pop();
  14895. }
  14896. return node.nodes && node.nodes.pop();
  14897. };
  14898. /**
  14899. * Shift the first `node` off of `parent.nodes`. The advantage of
  14900. * using this method is that it checks for `node.nodes` and works
  14901. * with any version of `snapdragon-node`.
  14902. *
  14903. * ```js
  14904. * var parent = new Node({type: 'foo'});
  14905. * utils.pushNode(parent, new Node({type: 'foo'}));
  14906. * utils.pushNode(parent, new Node({type: 'bar'}));
  14907. * utils.pushNode(parent, new Node({type: 'baz'}));
  14908. * console.log(parent.nodes.length); //=> 3
  14909. * utils.shiftNode(parent);
  14910. * console.log(parent.nodes.length); //=> 2
  14911. * ```
  14912. * @param {Object} `parent`
  14913. * @param {Object} `node` Instance of [snapdragon-node][]
  14914. * @return {Number|Undefined} Returns the length of `node.nodes` or undefined.
  14915. * @api public
  14916. */
  14917. utils.shiftNode = function (node) {
  14918. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14919. if (typeof node.shift === 'function') {
  14920. return node.shift();
  14921. }
  14922. return node.nodes && node.nodes.shift();
  14923. };
  14924. /**
  14925. * Remove the specified `node` from `parent.nodes`.
  14926. *
  14927. * ```js
  14928. * var parent = new Node({type: 'abc'});
  14929. * var foo = new Node({type: 'foo'});
  14930. * utils.pushNode(parent, foo);
  14931. * utils.pushNode(parent, new Node({type: 'bar'}));
  14932. * utils.pushNode(parent, new Node({type: 'baz'}));
  14933. * console.log(parent.nodes.length); //=> 3
  14934. * utils.removeNode(parent, foo);
  14935. * console.log(parent.nodes.length); //=> 2
  14936. * ```
  14937. * @param {Object} `parent`
  14938. * @param {Object} `node` Instance of [snapdragon-node][]
  14939. * @return {Object|undefined} Returns the removed node, if successful, or undefined if it does not exist on `parent.nodes`.
  14940. * @api public
  14941. */
  14942. utils.removeNode = function (parent, node) {
  14943. assert(utils.isNode(parent), 'expected parent.node to be an instance of Node');
  14944. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14945. if (!parent.nodes) {
  14946. return null;
  14947. }
  14948. if (typeof parent.remove === 'function') {
  14949. return parent.remove(node);
  14950. }
  14951. var idx = parent.nodes.indexOf(node);
  14952. if (idx !== -1) {
  14953. return parent.nodes.splice(idx, 1);
  14954. }
  14955. };
  14956. /**
  14957. * Returns true if `node.type` matches the given `type`. Throws a
  14958. * `TypeError` if `node` is not an instance of `Node`.
  14959. *
  14960. * ```js
  14961. * var Node = require('snapdragon-node');
  14962. * var node = new Node({type: 'foo'});
  14963. * console.log(utils.isType(node, 'foo')); // false
  14964. * console.log(utils.isType(node, 'bar')); // true
  14965. * ```
  14966. * @param {Object} `node` Instance of [snapdragon-node][]
  14967. * @param {String} `type`
  14968. * @return {Boolean}
  14969. * @api public
  14970. */
  14971. utils.isType = function (node, type) {
  14972. assert(utils.isNode(node), 'expected node to be an instance of Node');
  14973. switch (typeOf(type)) {
  14974. case 'array':
  14975. var types = type.slice();
  14976. for (var i = 0; i < types.length; i++) {
  14977. if (utils.isType(node, types[i])) {
  14978. return true;
  14979. }
  14980. }
  14981. return false;
  14982. case 'string':
  14983. return node.type === type;
  14984. case 'regexp':
  14985. return type.test(node.type);
  14986. default:
  14987. {
  14988. throw new TypeError('expected "type" to be an array, string or regexp');
  14989. }
  14990. }
  14991. };
  14992. /**
  14993. * Returns true if the given `node` has the given `type` in `node.nodes`.
  14994. * Throws a `TypeError` if `node` is not an instance of `Node`.
  14995. *
  14996. * ```js
  14997. * var Node = require('snapdragon-node');
  14998. * var node = new Node({
  14999. * type: 'foo',
  15000. * nodes: [
  15001. * new Node({type: 'bar'}),
  15002. * new Node({type: 'baz'})
  15003. * ]
  15004. * });
  15005. * console.log(utils.hasType(node, 'xyz')); // false
  15006. * console.log(utils.hasType(node, 'baz')); // true
  15007. * ```
  15008. * @param {Object} `node` Instance of [snapdragon-node][]
  15009. * @param {String} `type`
  15010. * @return {Boolean}
  15011. * @api public
  15012. */
  15013. utils.hasType = function (node, type) {
  15014. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15015. if (!Array.isArray(node.nodes)) return false;
  15016. for (var i = 0; i < node.nodes.length; i++) {
  15017. if (utils.isType(node.nodes[i], type)) {
  15018. return true;
  15019. }
  15020. }
  15021. return false;
  15022. };
  15023. /**
  15024. * Returns the first node from `node.nodes` of the given `type`
  15025. *
  15026. * ```js
  15027. * var node = new Node({
  15028. * type: 'foo',
  15029. * nodes: [
  15030. * new Node({type: 'text', val: 'abc'}),
  15031. * new Node({type: 'text', val: 'xyz'})
  15032. * ]
  15033. * });
  15034. *
  15035. * var textNode = utils.firstOfType(node.nodes, 'text');
  15036. * console.log(textNode.val);
  15037. * //=> 'abc'
  15038. * ```
  15039. * @param {Array} `nodes`
  15040. * @param {String} `type`
  15041. * @return {Object|undefined} Returns the first matching node or undefined.
  15042. * @api public
  15043. */
  15044. utils.firstOfType = function (nodes, type) {
  15045. for (var i = 0; i < nodes.length; i++) {
  15046. var node = nodes[i];
  15047. if (utils.isType(node, type)) {
  15048. return node;
  15049. }
  15050. }
  15051. };
  15052. /**
  15053. * Returns the node at the specified index, or the first node of the
  15054. * given `type` from `node.nodes`.
  15055. *
  15056. * ```js
  15057. * var node = new Node({
  15058. * type: 'foo',
  15059. * nodes: [
  15060. * new Node({type: 'text', val: 'abc'}),
  15061. * new Node({type: 'text', val: 'xyz'})
  15062. * ]
  15063. * });
  15064. *
  15065. * var nodeOne = utils.findNode(node.nodes, 'text');
  15066. * console.log(nodeOne.val);
  15067. * //=> 'abc'
  15068. *
  15069. * var nodeTwo = utils.findNode(node.nodes, 1);
  15070. * console.log(nodeTwo.val);
  15071. * //=> 'xyz'
  15072. * ```
  15073. *
  15074. * @param {Array} `nodes`
  15075. * @param {String|Number} `type` Node type or index.
  15076. * @return {Object} Returns a node or undefined.
  15077. * @api public
  15078. */
  15079. utils.findNode = function (nodes, type) {
  15080. if (!Array.isArray(nodes)) {
  15081. return null;
  15082. }
  15083. if (typeof type === 'number') {
  15084. return nodes[type];
  15085. }
  15086. return utils.firstOfType(nodes, type);
  15087. };
  15088. /**
  15089. * Returns true if the given node is an "*.open" node.
  15090. *
  15091. * ```js
  15092. * var Node = require('snapdragon-node');
  15093. * var brace = new Node({type: 'brace'});
  15094. * var open = new Node({type: 'brace.open'});
  15095. * var close = new Node({type: 'brace.close'});
  15096. *
  15097. * console.log(utils.isOpen(brace)); // false
  15098. * console.log(utils.isOpen(open)); // true
  15099. * console.log(utils.isOpen(close)); // false
  15100. * ```
  15101. * @param {Object} `node` Instance of [snapdragon-node][]
  15102. * @return {Boolean}
  15103. * @api public
  15104. */
  15105. utils.isOpen = function (node) {
  15106. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15107. return node.type.slice(-5) === '.open';
  15108. };
  15109. /**
  15110. * Returns true if the given node is a "*.close" node.
  15111. *
  15112. * ```js
  15113. * var Node = require('snapdragon-node');
  15114. * var brace = new Node({type: 'brace'});
  15115. * var open = new Node({type: 'brace.open'});
  15116. * var close = new Node({type: 'brace.close'});
  15117. *
  15118. * console.log(utils.isClose(brace)); // false
  15119. * console.log(utils.isClose(open)); // false
  15120. * console.log(utils.isClose(close)); // true
  15121. * ```
  15122. * @param {Object} `node` Instance of [snapdragon-node][]
  15123. * @return {Boolean}
  15124. * @api public
  15125. */
  15126. utils.isClose = function (node) {
  15127. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15128. return node.type.slice(-6) === '.close';
  15129. };
  15130. /**
  15131. * Returns true if `node.nodes` **has** an `.open` node
  15132. *
  15133. * ```js
  15134. * var Node = require('snapdragon-node');
  15135. * var brace = new Node({
  15136. * type: 'brace',
  15137. * nodes: []
  15138. * });
  15139. *
  15140. * var open = new Node({type: 'brace.open'});
  15141. * console.log(utils.hasOpen(brace)); // false
  15142. *
  15143. * brace.pushNode(open);
  15144. * console.log(utils.hasOpen(brace)); // true
  15145. * ```
  15146. * @param {Object} `node` Instance of [snapdragon-node][]
  15147. * @return {Boolean}
  15148. * @api public
  15149. */
  15150. utils.hasOpen = function (node) {
  15151. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15152. var first = node.first || node.nodes ? node.nodes[0] : null;
  15153. if (utils.isNode(first)) {
  15154. return first.type === node.type + '.open';
  15155. }
  15156. return false;
  15157. };
  15158. /**
  15159. * Returns true if `node.nodes` **has** a `.close` node
  15160. *
  15161. * ```js
  15162. * var Node = require('snapdragon-node');
  15163. * var brace = new Node({
  15164. * type: 'brace',
  15165. * nodes: []
  15166. * });
  15167. *
  15168. * var close = new Node({type: 'brace.close'});
  15169. * console.log(utils.hasClose(brace)); // false
  15170. *
  15171. * brace.pushNode(close);
  15172. * console.log(utils.hasClose(brace)); // true
  15173. * ```
  15174. * @param {Object} `node` Instance of [snapdragon-node][]
  15175. * @return {Boolean}
  15176. * @api public
  15177. */
  15178. utils.hasClose = function (node) {
  15179. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15180. var last = node.last || node.nodes ? node.nodes[node.nodes.length - 1] : null;
  15181. if (utils.isNode(last)) {
  15182. return last.type === node.type + '.close';
  15183. }
  15184. return false;
  15185. };
  15186. /**
  15187. * Returns true if `node.nodes` has both `.open` and `.close` nodes
  15188. *
  15189. * ```js
  15190. * var Node = require('snapdragon-node');
  15191. * var brace = new Node({
  15192. * type: 'brace',
  15193. * nodes: []
  15194. * });
  15195. *
  15196. * var open = new Node({type: 'brace.open'});
  15197. * var close = new Node({type: 'brace.close'});
  15198. * console.log(utils.hasOpen(brace)); // false
  15199. * console.log(utils.hasClose(brace)); // false
  15200. *
  15201. * brace.pushNode(open);
  15202. * brace.pushNode(close);
  15203. * console.log(utils.hasOpen(brace)); // true
  15204. * console.log(utils.hasClose(brace)); // true
  15205. * ```
  15206. * @param {Object} `node` Instance of [snapdragon-node][]
  15207. * @return {Boolean}
  15208. * @api public
  15209. */
  15210. utils.hasOpenAndClose = function (node) {
  15211. return utils.hasOpen(node) && utils.hasClose(node);
  15212. };
  15213. /**
  15214. * Push the given `node` onto the `state.inside` array for the
  15215. * given type. This array is used as a specialized "stack" for
  15216. * only the given `node.type`.
  15217. *
  15218. * ```js
  15219. * var state = { inside: {}};
  15220. * var node = new Node({type: 'brace'});
  15221. * utils.addType(state, node);
  15222. * console.log(state.inside);
  15223. * //=> { brace: [{type: 'brace'}] }
  15224. * ```
  15225. * @param {Object} `state` The `compiler.state` object or custom state object.
  15226. * @param {Object} `node` Instance of [snapdragon-node][]
  15227. * @return {Array} Returns the `state.inside` stack for the given type.
  15228. * @api public
  15229. */
  15230. utils.addType = function (state, node) {
  15231. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15232. assert(isObject(state), 'expected state to be an object');
  15233. var type = node.parent ? node.parent.type : node.type.replace(/\.open$/, '');
  15234. if (!state.hasOwnProperty('inside')) {
  15235. state.inside = {};
  15236. }
  15237. if (!state.inside.hasOwnProperty(type)) {
  15238. state.inside[type] = [];
  15239. }
  15240. var arr = state.inside[type];
  15241. arr.push(node);
  15242. return arr;
  15243. };
  15244. /**
  15245. * Remove the given `node` from the `state.inside` array for the
  15246. * given type. This array is used as a specialized "stack" for
  15247. * only the given `node.type`.
  15248. *
  15249. * ```js
  15250. * var state = { inside: {}};
  15251. * var node = new Node({type: 'brace'});
  15252. * utils.addType(state, node);
  15253. * console.log(state.inside);
  15254. * //=> { brace: [{type: 'brace'}] }
  15255. * utils.removeType(state, node);
  15256. * //=> { brace: [] }
  15257. * ```
  15258. * @param {Object} `state` The `compiler.state` object or custom state object.
  15259. * @param {Object} `node` Instance of [snapdragon-node][]
  15260. * @return {Array} Returns the `state.inside` stack for the given type.
  15261. * @api public
  15262. */
  15263. utils.removeType = function (state, node) {
  15264. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15265. assert(isObject(state), 'expected state to be an object');
  15266. var type = node.parent ? node.parent.type : node.type.replace(/\.close$/, '');
  15267. if (state.inside.hasOwnProperty(type)) {
  15268. return state.inside[type].pop();
  15269. }
  15270. };
  15271. /**
  15272. * Returns true if `node.val` is an empty string, or `node.nodes` does
  15273. * not contain any non-empty text nodes.
  15274. *
  15275. * ```js
  15276. * var node = new Node({type: 'text'});
  15277. * utils.isEmpty(node); //=> true
  15278. * node.val = 'foo';
  15279. * utils.isEmpty(node); //=> false
  15280. * ```
  15281. * @param {Object} `node` Instance of [snapdragon-node][]
  15282. * @param {Function} `fn`
  15283. * @return {Boolean}
  15284. * @api public
  15285. */
  15286. utils.isEmpty = function (node, fn) {
  15287. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15288. if (!Array.isArray(node.nodes)) {
  15289. if (node.type !== 'text') {
  15290. return true;
  15291. }
  15292. if (typeof fn === 'function') {
  15293. return fn(node, node.parent);
  15294. }
  15295. return !utils.trim(node.val);
  15296. }
  15297. for (var i = 0; i < node.nodes.length; i++) {
  15298. var child = node.nodes[i];
  15299. if (utils.isOpen(child) || utils.isClose(child)) {
  15300. continue;
  15301. }
  15302. if (!utils.isEmpty(child, fn)) {
  15303. return false;
  15304. }
  15305. }
  15306. return true;
  15307. };
  15308. /**
  15309. * Returns true if the `state.inside` stack for the given type exists
  15310. * and has one or more nodes on it.
  15311. *
  15312. * ```js
  15313. * var state = { inside: {}};
  15314. * var node = new Node({type: 'brace'});
  15315. * console.log(utils.isInsideType(state, 'brace')); //=> false
  15316. * utils.addType(state, node);
  15317. * console.log(utils.isInsideType(state, 'brace')); //=> true
  15318. * utils.removeType(state, node);
  15319. * console.log(utils.isInsideType(state, 'brace')); //=> false
  15320. * ```
  15321. * @param {Object} `state`
  15322. * @param {String} `type`
  15323. * @return {Boolean}
  15324. * @api public
  15325. */
  15326. utils.isInsideType = function (state, type) {
  15327. assert(isObject(state), 'expected state to be an object');
  15328. assert(isString(type), 'expected type to be a string');
  15329. if (!state.hasOwnProperty('inside')) {
  15330. return false;
  15331. }
  15332. if (!state.inside.hasOwnProperty(type)) {
  15333. return false;
  15334. }
  15335. return state.inside[type].length > 0;
  15336. };
  15337. /**
  15338. * Returns true if `node` is either a child or grand-child of the given `type`,
  15339. * or `state.inside[type]` is a non-empty array.
  15340. *
  15341. * ```js
  15342. * var state = { inside: {}};
  15343. * var node = new Node({type: 'brace'});
  15344. * var open = new Node({type: 'brace.open'});
  15345. * console.log(utils.isInside(state, open, 'brace')); //=> false
  15346. * utils.pushNode(node, open);
  15347. * console.log(utils.isInside(state, open, 'brace')); //=> true
  15348. * ```
  15349. * @param {Object} `state` Either the `compiler.state` object, if it exists, or a user-supplied state object.
  15350. * @param {Object} `node` Instance of [snapdragon-node][]
  15351. * @param {String} `type` The `node.type` to check for.
  15352. * @return {Boolean}
  15353. * @api public
  15354. */
  15355. utils.isInside = function (state, node, type) {
  15356. assert(utils.isNode(node), 'expected node to be an instance of Node');
  15357. assert(isObject(state), 'expected state to be an object');
  15358. if (Array.isArray(type)) {
  15359. for (var i = 0; i < type.length; i++) {
  15360. if (utils.isInside(state, node, type[i])) {
  15361. return true;
  15362. }
  15363. }
  15364. return false;
  15365. }
  15366. var parent = node.parent;
  15367. if (typeof type === 'string') {
  15368. return parent && parent.type === type || utils.isInsideType(state, type);
  15369. }
  15370. if (typeOf(type) === 'regexp') {
  15371. if (parent && parent.type && type.test(parent.type)) {
  15372. return true;
  15373. }
  15374. var keys = Object.keys(state.inside);
  15375. var len = keys.length;
  15376. var idx = -1;
  15377. while (++idx < len) {
  15378. var key = keys[idx];
  15379. var val = state.inside[key];
  15380. if (Array.isArray(val) && val.length !== 0 && type.test(key)) {
  15381. return true;
  15382. }
  15383. }
  15384. }
  15385. return false;
  15386. };
  15387. /**
  15388. * Get the last `n` element from the given `array`. Used for getting
  15389. * a node from `node.nodes.`
  15390. *
  15391. * @param {Array} `array`
  15392. * @param {Number} `n`
  15393. * @return {undefined}
  15394. * @api public
  15395. */
  15396. utils.last = function (arr, n) {
  15397. return arr[arr.length - (n || 1)];
  15398. };
  15399. /**
  15400. * Cast the given `val` to an array.
  15401. *
  15402. * ```js
  15403. * console.log(utils.arrayify(''));
  15404. * //=> []
  15405. * console.log(utils.arrayify('foo'));
  15406. * //=> ['foo']
  15407. * console.log(utils.arrayify(['foo']));
  15408. * //=> ['foo']
  15409. * ```
  15410. * @param {any} `val`
  15411. * @return {Array}
  15412. * @api public
  15413. */
  15414. utils.arrayify = function (val) {
  15415. if (typeof val === 'string' && val !== '') {
  15416. return [val];
  15417. }
  15418. if (!Array.isArray(val)) {
  15419. return [];
  15420. }
  15421. return val;
  15422. };
  15423. /**
  15424. * Convert the given `val` to a string by joining with `,`. Useful
  15425. * for creating a cheerio/CSS/DOM-style selector from a list of strings.
  15426. *
  15427. * @param {any} `val`
  15428. * @return {Array}
  15429. * @api public
  15430. */
  15431. utils.stringify = function (val) {
  15432. return utils.arrayify(val).join(',');
  15433. };
  15434. /**
  15435. * Ensure that the given value is a string and call `.trim()` on it,
  15436. * or return an empty string.
  15437. *
  15438. * @param {String} `str`
  15439. * @return {String}
  15440. * @api public
  15441. */
  15442. utils.trim = function (str) {
  15443. return typeof str === 'string' ? str.trim() : '';
  15444. };
  15445. /**
  15446. * Return true if val is an object
  15447. */
  15448. function isObject(val) {
  15449. return typeOf(val) === 'object';
  15450. }
  15451. /**
  15452. * Return true if val is a string
  15453. */
  15454. function isString(val) {
  15455. return typeof val === 'string';
  15456. }
  15457. /**
  15458. * Return true if val is a function
  15459. */
  15460. function isFunction(val) {
  15461. return typeof val === 'function';
  15462. }
  15463. /**
  15464. * Return true if val is an array
  15465. */
  15466. function isArray(val) {
  15467. return Array.isArray(val);
  15468. }
  15469. /**
  15470. * Shim to ensure the `.append` methods work with any version of snapdragon
  15471. */
  15472. function append(compiler, val, node) {
  15473. if (typeof compiler.append !== 'function') {
  15474. return compiler.emit(val, node);
  15475. }
  15476. return compiler.append(val, node);
  15477. }
  15478. /**
  15479. * Simplified assertion. Throws an error is `val` is falsey.
  15480. */
  15481. function assert(val, message) {
  15482. if (!val) throw new Error(message);
  15483. }
  15484. /***/ }),
  15485. /***/ "./node_modules/snapdragon/index.js":
  15486. /*!******************************************!*\
  15487. !*** ./node_modules/snapdragon/index.js ***!
  15488. \******************************************/
  15489. /*! no static exports found */
  15490. /***/ (function(module, exports, __webpack_require__) {
  15491. "use strict";
  15492. var Base = __webpack_require__(/*! base */ "./node_modules/base/index.js");
  15493. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  15494. var Compiler = __webpack_require__(/*! ./lib/compiler */ "./node_modules/snapdragon/lib/compiler.js");
  15495. var Parser = __webpack_require__(/*! ./lib/parser */ "./node_modules/snapdragon/lib/parser.js");
  15496. var utils = __webpack_require__(/*! ./lib/utils */ "./node_modules/snapdragon/lib/utils.js");
  15497. var regexCache = {};
  15498. var cache = {};
  15499. /**
  15500. * Create a new instance of `Snapdragon` with the given `options`.
  15501. *
  15502. * ```js
  15503. * var snapdragon = new Snapdragon();
  15504. * ```
  15505. *
  15506. * @param {Object} `options`
  15507. * @api public
  15508. */
  15509. function Snapdragon(options) {
  15510. Base.call(this, null, options);
  15511. this.options = utils.extend({
  15512. source: 'string'
  15513. }, this.options);
  15514. this.compiler = new Compiler(this.options);
  15515. this.parser = new Parser(this.options);
  15516. Object.defineProperty(this, 'compilers', {
  15517. get: function get() {
  15518. return this.compiler.compilers;
  15519. }
  15520. });
  15521. Object.defineProperty(this, 'parsers', {
  15522. get: function get() {
  15523. return this.parser.parsers;
  15524. }
  15525. });
  15526. Object.defineProperty(this, 'regex', {
  15527. get: function get() {
  15528. return this.parser.regex;
  15529. }
  15530. });
  15531. }
  15532. /**
  15533. * Inherit Base
  15534. */
  15535. Base.extend(Snapdragon);
  15536. /**
  15537. * Add a parser to `snapdragon.parsers` for capturing the given `type` using
  15538. * the specified regex or parser function. A function is useful if you need
  15539. * to customize how the token is created and/or have access to the parser
  15540. * instance to check options, etc.
  15541. *
  15542. * ```js
  15543. * snapdragon
  15544. * .capture('slash', /^\//)
  15545. * .capture('dot', function() {
  15546. * var pos = this.position();
  15547. * var m = this.match(/^\./);
  15548. * if (!m) return;
  15549. * return pos({
  15550. * type: 'dot',
  15551. * val: m[0]
  15552. * });
  15553. * });
  15554. * ```
  15555. * @param {String} `type`
  15556. * @param {RegExp|Function} `regex`
  15557. * @return {Object} Returns the parser instance for chaining
  15558. * @api public
  15559. */
  15560. Snapdragon.prototype.capture = function () {
  15561. return this.parser.capture.apply(this.parser, arguments);
  15562. };
  15563. /**
  15564. * Register a plugin `fn`.
  15565. *
  15566. * ```js
  15567. * var snapdragon = new Snapdgragon([options]);
  15568. * snapdragon.use(function() {
  15569. * console.log(this); //<= snapdragon instance
  15570. * console.log(this.parser); //<= parser instance
  15571. * console.log(this.compiler); //<= compiler instance
  15572. * });
  15573. * ```
  15574. * @param {Object} `fn`
  15575. * @api public
  15576. */
  15577. Snapdragon.prototype.use = function (fn) {
  15578. fn.call(this, this);
  15579. return this;
  15580. };
  15581. /**
  15582. * Parse the given `str`.
  15583. *
  15584. * ```js
  15585. * var snapdragon = new Snapdgragon([options]);
  15586. * // register parsers
  15587. * snapdragon.parser.use(function() {});
  15588. *
  15589. * // parse
  15590. * var ast = snapdragon.parse('foo/bar');
  15591. * console.log(ast);
  15592. * ```
  15593. * @param {String} `str`
  15594. * @param {Object} `options` Set `options.sourcemap` to true to enable source maps.
  15595. * @return {Object} Returns an AST.
  15596. * @api public
  15597. */
  15598. Snapdragon.prototype.parse = function (str, options) {
  15599. this.options = utils.extend({}, this.options, options);
  15600. var parsed = this.parser.parse(str, this.options); // add non-enumerable parser reference
  15601. define(parsed, 'parser', this.parser);
  15602. return parsed;
  15603. };
  15604. /**
  15605. * Compile the given `AST`.
  15606. *
  15607. * ```js
  15608. * var snapdragon = new Snapdgragon([options]);
  15609. * // register plugins
  15610. * snapdragon.use(function() {});
  15611. * // register parser plugins
  15612. * snapdragon.parser.use(function() {});
  15613. * // register compiler plugins
  15614. * snapdragon.compiler.use(function() {});
  15615. *
  15616. * // parse
  15617. * var ast = snapdragon.parse('foo/bar');
  15618. *
  15619. * // compile
  15620. * var res = snapdragon.compile(ast);
  15621. * console.log(res.output);
  15622. * ```
  15623. * @param {Object} `ast`
  15624. * @param {Object} `options`
  15625. * @return {Object} Returns an object with an `output` property with the rendered string.
  15626. * @api public
  15627. */
  15628. Snapdragon.prototype.compile = function (ast, options) {
  15629. this.options = utils.extend({}, this.options, options);
  15630. var compiled = this.compiler.compile(ast, this.options); // add non-enumerable compiler reference
  15631. define(compiled, 'compiler', this.compiler);
  15632. return compiled;
  15633. };
  15634. /**
  15635. * Expose `Snapdragon`
  15636. */
  15637. module.exports = Snapdragon;
  15638. /**
  15639. * Expose `Parser` and `Compiler`
  15640. */
  15641. module.exports.Compiler = Compiler;
  15642. module.exports.Parser = Parser;
  15643. /***/ }),
  15644. /***/ "./node_modules/snapdragon/lib/compiler.js":
  15645. /*!*************************************************!*\
  15646. !*** ./node_modules/snapdragon/lib/compiler.js ***!
  15647. \*************************************************/
  15648. /*! no static exports found */
  15649. /***/ (function(module, exports, __webpack_require__) {
  15650. "use strict";
  15651. /* WEBPACK VAR INJECTION */(function(__filename) {
  15652. var use = __webpack_require__(/*! use */ "./node_modules/use/index.js");
  15653. var _define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  15654. var debug = __webpack_require__(/*! debug */ "./node_modules/snapdragon/node_modules/debug/src/browser.js")('snapdragon:compiler');
  15655. var utils = __webpack_require__(/*! ./utils */ "./node_modules/snapdragon/lib/utils.js");
  15656. /**
  15657. * Create a new `Compiler` with the given `options`.
  15658. * @param {Object} `options`
  15659. */
  15660. function Compiler(options, state) {
  15661. debug('initializing', __filename);
  15662. this.options = utils.extend({
  15663. source: 'string'
  15664. }, options);
  15665. this.state = state || {};
  15666. this.compilers = {};
  15667. this.output = '';
  15668. this.set('eos', function (node) {
  15669. return this.emit(node.val, node);
  15670. });
  15671. this.set('noop', function (node) {
  15672. return this.emit(node.val, node);
  15673. });
  15674. this.set('bos', function (node) {
  15675. return this.emit(node.val, node);
  15676. });
  15677. use(this);
  15678. }
  15679. /**
  15680. * Prototype methods
  15681. */
  15682. Compiler.prototype = {
  15683. /**
  15684. * Throw an error message with details including the cursor position.
  15685. * @param {String} `msg` Message to use in the Error.
  15686. */
  15687. error: function error(msg, node) {
  15688. var pos = node.position || {
  15689. start: {
  15690. column: 0
  15691. }
  15692. };
  15693. var message = this.options.source + ' column:' + pos.start.column + ': ' + msg;
  15694. var err = new Error(message);
  15695. err.reason = msg;
  15696. err.column = pos.start.column;
  15697. err.source = this.pattern;
  15698. if (this.options.silent) {
  15699. this.errors.push(err);
  15700. } else {
  15701. throw err;
  15702. }
  15703. },
  15704. /**
  15705. * Define a non-enumberable property on the `Compiler` instance.
  15706. *
  15707. * ```js
  15708. * compiler.define('foo', 'bar');
  15709. * ```
  15710. * @name .define
  15711. * @param {String} `key` propery name
  15712. * @param {any} `val` property value
  15713. * @return {Object} Returns the Compiler instance for chaining.
  15714. * @api public
  15715. */
  15716. define: function define(key, val) {
  15717. _define(this, key, val);
  15718. return this;
  15719. },
  15720. /**
  15721. * Emit `node.val`
  15722. */
  15723. emit: function emit(str, node) {
  15724. this.output += str;
  15725. return str;
  15726. },
  15727. /**
  15728. * Add a compiler `fn` with the given `name`
  15729. */
  15730. set: function set(name, fn) {
  15731. this.compilers[name] = fn;
  15732. return this;
  15733. },
  15734. /**
  15735. * Get compiler `name`.
  15736. */
  15737. get: function get(name) {
  15738. return this.compilers[name];
  15739. },
  15740. /**
  15741. * Get the previous AST node.
  15742. */
  15743. prev: function prev(n) {
  15744. return this.ast.nodes[this.idx - (n || 1)] || {
  15745. type: 'bos',
  15746. val: ''
  15747. };
  15748. },
  15749. /**
  15750. * Get the next AST node.
  15751. */
  15752. next: function next(n) {
  15753. return this.ast.nodes[this.idx + (n || 1)] || {
  15754. type: 'eos',
  15755. val: ''
  15756. };
  15757. },
  15758. /**
  15759. * Visit `node`.
  15760. */
  15761. visit: function visit(node, nodes, i) {
  15762. var fn = this.compilers[node.type];
  15763. this.idx = i;
  15764. if (typeof fn !== 'function') {
  15765. throw this.error('compiler "' + node.type + '" is not registered', node);
  15766. }
  15767. return fn.call(this, node, nodes, i);
  15768. },
  15769. /**
  15770. * Map visit over array of `nodes`.
  15771. */
  15772. mapVisit: function mapVisit(nodes) {
  15773. if (!Array.isArray(nodes)) {
  15774. throw new TypeError('expected an array');
  15775. }
  15776. var len = nodes.length;
  15777. var idx = -1;
  15778. while (++idx < len) {
  15779. this.visit(nodes[idx], nodes, idx);
  15780. }
  15781. return this;
  15782. },
  15783. /**
  15784. * Compile `ast`.
  15785. */
  15786. compile: function compile(ast, options) {
  15787. var opts = utils.extend({}, this.options, options);
  15788. this.ast = ast;
  15789. this.parsingErrors = this.ast.errors;
  15790. this.output = ''; // source map support
  15791. if (opts.sourcemap) {
  15792. var sourcemaps = __webpack_require__(/*! ./source-maps */ "./node_modules/snapdragon/lib/source-maps.js");
  15793. sourcemaps(this);
  15794. this.mapVisit(this.ast.nodes);
  15795. this.applySourceMaps();
  15796. this.map = opts.sourcemap === 'generator' ? this.map : this.map.toJSON();
  15797. return this;
  15798. }
  15799. this.mapVisit(this.ast.nodes);
  15800. return this;
  15801. }
  15802. };
  15803. /**
  15804. * Expose `Compiler`
  15805. */
  15806. module.exports = Compiler;
  15807. /* WEBPACK VAR INJECTION */}.call(this, "/index.js"))
  15808. /***/ }),
  15809. /***/ "./node_modules/snapdragon/lib/parser.js":
  15810. /*!***********************************************!*\
  15811. !*** ./node_modules/snapdragon/lib/parser.js ***!
  15812. \***********************************************/
  15813. /*! no static exports found */
  15814. /***/ (function(module, exports, __webpack_require__) {
  15815. "use strict";
  15816. /* WEBPACK VAR INJECTION */(function(__filename) {
  15817. var use = __webpack_require__(/*! use */ "./node_modules/use/index.js");
  15818. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  15819. var Cache = __webpack_require__(/*! map-cache */ "./node_modules/map-cache/index.js");
  15820. var _define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  15821. var debug = __webpack_require__(/*! debug */ "./node_modules/snapdragon/node_modules/debug/src/browser.js")('snapdragon:parser');
  15822. var Position = __webpack_require__(/*! ./position */ "./node_modules/snapdragon/lib/position.js");
  15823. var utils = __webpack_require__(/*! ./utils */ "./node_modules/snapdragon/lib/utils.js");
  15824. /**
  15825. * Create a new `Parser` with the given `input` and `options`.
  15826. * @param {String} `input`
  15827. * @param {Object} `options`
  15828. * @api public
  15829. */
  15830. function Parser(options) {
  15831. debug('initializing', __filename);
  15832. this.options = utils.extend({
  15833. source: 'string'
  15834. }, options);
  15835. this.init(this.options);
  15836. use(this);
  15837. }
  15838. /**
  15839. * Prototype methods
  15840. */
  15841. Parser.prototype = {
  15842. constructor: Parser,
  15843. init: function init(options) {
  15844. this.orig = '';
  15845. this.input = '';
  15846. this.parsed = '';
  15847. this.column = 1;
  15848. this.line = 1;
  15849. this.regex = new Cache();
  15850. this.errors = this.errors || [];
  15851. this.parsers = this.parsers || {};
  15852. this.types = this.types || [];
  15853. this.sets = this.sets || {};
  15854. this.fns = this.fns || [];
  15855. this.currentType = 'root';
  15856. var pos = this.position();
  15857. this.bos = pos({
  15858. type: 'bos',
  15859. val: ''
  15860. });
  15861. this.ast = {
  15862. type: 'root',
  15863. errors: this.errors,
  15864. nodes: [this.bos]
  15865. };
  15866. _define(this.bos, 'parent', this.ast);
  15867. this.nodes = [this.ast];
  15868. this.count = 0;
  15869. this.setCount = 0;
  15870. this.stack = [];
  15871. },
  15872. /**
  15873. * Throw a formatted error with the cursor column and `msg`.
  15874. * @param {String} `msg` Message to use in the Error.
  15875. */
  15876. error: function error(msg, node) {
  15877. var pos = node.position || {
  15878. start: {
  15879. column: 0,
  15880. line: 0
  15881. }
  15882. };
  15883. var line = pos.start.line;
  15884. var column = pos.start.column;
  15885. var source = this.options.source;
  15886. var message = source + ' <line:' + line + ' column:' + column + '>: ' + msg;
  15887. var err = new Error(message);
  15888. err.source = source;
  15889. err.reason = msg;
  15890. err.pos = pos;
  15891. if (this.options.silent) {
  15892. this.errors.push(err);
  15893. } else {
  15894. throw err;
  15895. }
  15896. },
  15897. /**
  15898. * Define a non-enumberable property on the `Parser` instance.
  15899. *
  15900. * ```js
  15901. * parser.define('foo', 'bar');
  15902. * ```
  15903. * @name .define
  15904. * @param {String} `key` propery name
  15905. * @param {any} `val` property value
  15906. * @return {Object} Returns the Parser instance for chaining.
  15907. * @api public
  15908. */
  15909. define: function define(key, val) {
  15910. _define(this, key, val);
  15911. return this;
  15912. },
  15913. /**
  15914. * Mark position and patch `node.position`.
  15915. */
  15916. position: function position() {
  15917. var start = {
  15918. line: this.line,
  15919. column: this.column
  15920. };
  15921. var self = this;
  15922. return function (node) {
  15923. _define(node, 'position', new Position(start, self));
  15924. return node;
  15925. };
  15926. },
  15927. /**
  15928. * Set parser `name` with the given `fn`
  15929. * @param {String} `name`
  15930. * @param {Function} `fn`
  15931. * @api public
  15932. */
  15933. set: function set(type, fn) {
  15934. if (this.types.indexOf(type) === -1) {
  15935. this.types.push(type);
  15936. }
  15937. this.parsers[type] = fn.bind(this);
  15938. return this;
  15939. },
  15940. /**
  15941. * Get parser `name`
  15942. * @param {String} `name`
  15943. * @api public
  15944. */
  15945. get: function get(name) {
  15946. return this.parsers[name];
  15947. },
  15948. /**
  15949. * Push a `token` onto the `type` stack.
  15950. *
  15951. * @param {String} `type`
  15952. * @return {Object} `token`
  15953. * @api public
  15954. */
  15955. push: function push(type, token) {
  15956. this.sets[type] = this.sets[type] || [];
  15957. this.count++;
  15958. this.stack.push(token);
  15959. return this.sets[type].push(token);
  15960. },
  15961. /**
  15962. * Pop a token off of the `type` stack
  15963. * @param {String} `type`
  15964. * @returns {Object} Returns a token
  15965. * @api public
  15966. */
  15967. pop: function pop(type) {
  15968. this.sets[type] = this.sets[type] || [];
  15969. this.count--;
  15970. this.stack.pop();
  15971. return this.sets[type].pop();
  15972. },
  15973. /**
  15974. * Return true if inside a `stack` node. Types are `braces`, `parens` or `brackets`.
  15975. *
  15976. * @param {String} `type`
  15977. * @return {Boolean}
  15978. * @api public
  15979. */
  15980. isInside: function isInside(type) {
  15981. this.sets[type] = this.sets[type] || [];
  15982. return this.sets[type].length > 0;
  15983. },
  15984. /**
  15985. * Return true if `node` is the given `type`.
  15986. *
  15987. * ```js
  15988. * parser.isType(node, 'brace');
  15989. * ```
  15990. * @param {Object} `node`
  15991. * @param {String} `type`
  15992. * @return {Boolean}
  15993. * @api public
  15994. */
  15995. isType: function isType(node, type) {
  15996. return node && node.type === type;
  15997. },
  15998. /**
  15999. * Get the previous AST node
  16000. * @return {Object}
  16001. */
  16002. prev: function prev(n) {
  16003. return this.stack.length > 0 ? utils.last(this.stack, n) : utils.last(this.nodes, n);
  16004. },
  16005. /**
  16006. * Update line and column based on `str`.
  16007. */
  16008. consume: function consume(len) {
  16009. this.input = this.input.substr(len);
  16010. },
  16011. /**
  16012. * Update column based on `str`.
  16013. */
  16014. updatePosition: function updatePosition(str, len) {
  16015. var lines = str.match(/\n/g);
  16016. if (lines) this.line += lines.length;
  16017. var i = str.lastIndexOf('\n');
  16018. this.column = ~i ? len - i : this.column + len;
  16019. this.parsed += str;
  16020. this.consume(len);
  16021. },
  16022. /**
  16023. * Match `regex`, return captures, and update the cursor position by `match[0]` length.
  16024. * @param {RegExp} `regex`
  16025. * @return {Object}
  16026. */
  16027. match: function match(regex) {
  16028. var m = regex.exec(this.input);
  16029. if (m) {
  16030. this.updatePosition(m[0], m[0].length);
  16031. return m;
  16032. }
  16033. },
  16034. /**
  16035. * Capture `type` with the given regex.
  16036. * @param {String} `type`
  16037. * @param {RegExp} `regex`
  16038. * @return {Function}
  16039. */
  16040. capture: function capture(type, regex) {
  16041. if (typeof regex === 'function') {
  16042. return this.set.apply(this, arguments);
  16043. }
  16044. this.regex.set(type, regex);
  16045. this.set(type, function () {
  16046. var parsed = this.parsed;
  16047. var pos = this.position();
  16048. var m = this.match(regex);
  16049. if (!m || !m[0]) return;
  16050. var prev = this.prev();
  16051. var node = pos({
  16052. type: type,
  16053. val: m[0],
  16054. parsed: parsed,
  16055. rest: this.input
  16056. });
  16057. if (m[1]) {
  16058. node.inner = m[1];
  16059. }
  16060. _define(node, 'inside', this.stack.length > 0);
  16061. _define(node, 'parent', prev);
  16062. prev.nodes.push(node);
  16063. }.bind(this));
  16064. return this;
  16065. },
  16066. /**
  16067. * Create a parser with open and close for parens,
  16068. * brackets or braces
  16069. */
  16070. capturePair: function capturePair(type, openRegex, closeRegex, fn) {
  16071. this.sets[type] = this.sets[type] || [];
  16072. /**
  16073. * Open
  16074. */
  16075. this.set(type + '.open', function () {
  16076. var parsed = this.parsed;
  16077. var pos = this.position();
  16078. var m = this.match(openRegex);
  16079. if (!m || !m[0]) return;
  16080. var val = m[0];
  16081. this.setCount++;
  16082. this.specialChars = true;
  16083. var open = pos({
  16084. type: type + '.open',
  16085. val: val,
  16086. rest: this.input
  16087. });
  16088. if (typeof m[1] !== 'undefined') {
  16089. open.inner = m[1];
  16090. }
  16091. var prev = this.prev();
  16092. var node = pos({
  16093. type: type,
  16094. nodes: [open]
  16095. });
  16096. _define(node, 'rest', this.input);
  16097. _define(node, 'parsed', parsed);
  16098. _define(node, 'prefix', m[1]);
  16099. _define(node, 'parent', prev);
  16100. _define(open, 'parent', node);
  16101. if (typeof fn === 'function') {
  16102. fn.call(this, open, node);
  16103. }
  16104. this.push(type, node);
  16105. prev.nodes.push(node);
  16106. });
  16107. /**
  16108. * Close
  16109. */
  16110. this.set(type + '.close', function () {
  16111. var pos = this.position();
  16112. var m = this.match(closeRegex);
  16113. if (!m || !m[0]) return;
  16114. var parent = this.pop(type);
  16115. var node = pos({
  16116. type: type + '.close',
  16117. rest: this.input,
  16118. suffix: m[1],
  16119. val: m[0]
  16120. });
  16121. if (!this.isType(parent, type)) {
  16122. if (this.options.strict) {
  16123. throw new Error('missing opening "' + type + '"');
  16124. }
  16125. this.setCount--;
  16126. node.escaped = true;
  16127. return node;
  16128. }
  16129. if (node.suffix === '\\') {
  16130. parent.escaped = true;
  16131. node.escaped = true;
  16132. }
  16133. parent.nodes.push(node);
  16134. _define(node, 'parent', parent);
  16135. });
  16136. return this;
  16137. },
  16138. /**
  16139. * Capture end-of-string
  16140. */
  16141. eos: function eos() {
  16142. var pos = this.position();
  16143. if (this.input) return;
  16144. var prev = this.prev();
  16145. while (prev.type !== 'root' && !prev.visited) {
  16146. if (this.options.strict === true) {
  16147. throw new SyntaxError('invalid syntax:' + util.inspect(prev, null, 2));
  16148. }
  16149. if (!hasDelims(prev)) {
  16150. prev.parent.escaped = true;
  16151. prev.escaped = true;
  16152. }
  16153. visit(prev, function (node) {
  16154. if (!hasDelims(node.parent)) {
  16155. node.parent.escaped = true;
  16156. node.escaped = true;
  16157. }
  16158. });
  16159. prev = prev.parent;
  16160. }
  16161. var tok = pos({
  16162. type: 'eos',
  16163. val: this.append || ''
  16164. });
  16165. _define(tok, 'parent', this.ast);
  16166. return tok;
  16167. },
  16168. /**
  16169. * Run parsers to advance the cursor position
  16170. */
  16171. next: function next() {
  16172. var parsed = this.parsed;
  16173. var len = this.types.length;
  16174. var idx = -1;
  16175. var tok;
  16176. while (++idx < len) {
  16177. if (tok = this.parsers[this.types[idx]].call(this)) {
  16178. _define(tok, 'rest', this.input);
  16179. _define(tok, 'parsed', parsed);
  16180. this.last = tok;
  16181. return tok;
  16182. }
  16183. }
  16184. },
  16185. /**
  16186. * Parse the given string.
  16187. * @return {Array}
  16188. */
  16189. parse: function parse(input) {
  16190. if (typeof input !== 'string') {
  16191. throw new TypeError('expected a string');
  16192. }
  16193. this.init(this.options);
  16194. this.orig = input;
  16195. this.input = input;
  16196. var self = this;
  16197. function parse() {
  16198. // check input before calling `.next()`
  16199. input = self.input; // get the next AST ndoe
  16200. var node = self.next();
  16201. if (node) {
  16202. var prev = self.prev();
  16203. if (prev) {
  16204. _define(node, 'parent', prev);
  16205. if (prev.nodes) {
  16206. prev.nodes.push(node);
  16207. }
  16208. }
  16209. if (self.sets.hasOwnProperty(prev.type)) {
  16210. self.currentType = prev.type;
  16211. }
  16212. } // if we got here but input is not changed, throw an error
  16213. if (self.input && input === self.input) {
  16214. throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"');
  16215. }
  16216. }
  16217. while (this.input) {
  16218. parse();
  16219. }
  16220. if (this.stack.length && this.options.strict) {
  16221. var node = this.stack.pop();
  16222. throw this.error('missing opening ' + node.type + ': "' + this.orig + '"');
  16223. }
  16224. var eos = this.eos();
  16225. var tok = this.prev();
  16226. if (tok.type !== 'eos') {
  16227. this.ast.nodes.push(eos);
  16228. }
  16229. return this.ast;
  16230. }
  16231. };
  16232. /**
  16233. * Visit `node` with the given `fn`
  16234. */
  16235. function visit(node, fn) {
  16236. if (!node.visited) {
  16237. _define(node, 'visited', true);
  16238. return node.nodes ? mapVisit(node.nodes, fn) : fn(node);
  16239. }
  16240. return node;
  16241. }
  16242. /**
  16243. * Map visit over array of `nodes`.
  16244. */
  16245. function mapVisit(nodes, fn) {
  16246. var len = nodes.length;
  16247. var idx = -1;
  16248. while (++idx < len) {
  16249. visit(nodes[idx], fn);
  16250. }
  16251. }
  16252. function hasOpen(node) {
  16253. return node.nodes && node.nodes[0].type === node.type + '.open';
  16254. }
  16255. function hasClose(node) {
  16256. return node.nodes && utils.last(node.nodes).type === node.type + '.close';
  16257. }
  16258. function hasDelims(node) {
  16259. return hasOpen(node) && hasClose(node);
  16260. }
  16261. /**
  16262. * Expose `Parser`
  16263. */
  16264. module.exports = Parser;
  16265. /* WEBPACK VAR INJECTION */}.call(this, "/index.js"))
  16266. /***/ }),
  16267. /***/ "./node_modules/snapdragon/lib/position.js":
  16268. /*!*************************************************!*\
  16269. !*** ./node_modules/snapdragon/lib/position.js ***!
  16270. \*************************************************/
  16271. /*! no static exports found */
  16272. /***/ (function(module, exports, __webpack_require__) {
  16273. "use strict";
  16274. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  16275. /**
  16276. * Store position for a node
  16277. */
  16278. module.exports = function Position(start, parser) {
  16279. this.start = start;
  16280. this.end = {
  16281. line: parser.line,
  16282. column: parser.column
  16283. };
  16284. define(this, 'content', parser.orig);
  16285. define(this, 'source', parser.options.source);
  16286. };
  16287. /***/ }),
  16288. /***/ "./node_modules/snapdragon/lib/source-maps.js":
  16289. /*!****************************************************!*\
  16290. !*** ./node_modules/snapdragon/lib/source-maps.js ***!
  16291. \****************************************************/
  16292. /*! no static exports found */
  16293. /***/ (function(module, exports, __webpack_require__) {
  16294. "use strict";
  16295. var fs = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js");
  16296. var path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js");
  16297. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  16298. var utils = __webpack_require__(/*! ./utils */ "./node_modules/snapdragon/lib/utils.js");
  16299. /**
  16300. * Expose `mixin()`.
  16301. * This code is based on `source-maps-support.js` in reworkcss/css
  16302. * https://github.com/reworkcss/css/blob/master/lib/stringify/source-map-support.js
  16303. * Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
  16304. */
  16305. module.exports = mixin;
  16306. /**
  16307. * Mixin source map support into `compiler`.
  16308. *
  16309. * @param {Object} `compiler`
  16310. * @api public
  16311. */
  16312. function mixin(compiler) {
  16313. define(compiler, '_comment', compiler.comment);
  16314. compiler.map = new utils.SourceMap.SourceMapGenerator();
  16315. compiler.position = {
  16316. line: 1,
  16317. column: 1
  16318. };
  16319. compiler.content = {};
  16320. compiler.files = {};
  16321. for (var key in exports) {
  16322. define(compiler, key, exports[key]);
  16323. }
  16324. }
  16325. /**
  16326. * Update position.
  16327. *
  16328. * @param {String} str
  16329. */
  16330. exports.updatePosition = function (str) {
  16331. var lines = str.match(/\n/g);
  16332. if (lines) this.position.line += lines.length;
  16333. var i = str.lastIndexOf('\n');
  16334. this.position.column = ~i ? str.length - i : this.position.column + str.length;
  16335. };
  16336. /**
  16337. * Emit `str` with `position`.
  16338. *
  16339. * @param {String} str
  16340. * @param {Object} [pos]
  16341. * @return {String}
  16342. */
  16343. exports.emit = function (str, node) {
  16344. var position = node.position || {};
  16345. var source = position.source;
  16346. if (source) {
  16347. if (position.filepath) {
  16348. source = utils.unixify(position.filepath);
  16349. }
  16350. this.map.addMapping({
  16351. source: source,
  16352. generated: {
  16353. line: this.position.line,
  16354. column: Math.max(this.position.column - 1, 0)
  16355. },
  16356. original: {
  16357. line: position.start.line,
  16358. column: position.start.column - 1
  16359. }
  16360. });
  16361. if (position.content) {
  16362. this.addContent(source, position);
  16363. }
  16364. if (position.filepath) {
  16365. this.addFile(source, position);
  16366. }
  16367. this.updatePosition(str);
  16368. this.output += str;
  16369. }
  16370. return str;
  16371. };
  16372. /**
  16373. * Adds a file to the source map output if it has not already been added
  16374. * @param {String} `file`
  16375. * @param {Object} `pos`
  16376. */
  16377. exports.addFile = function (file, position) {
  16378. if (typeof position.content !== 'string') return;
  16379. if (Object.prototype.hasOwnProperty.call(this.files, file)) return;
  16380. this.files[file] = position.content;
  16381. };
  16382. /**
  16383. * Adds a content source to the source map output if it has not already been added
  16384. * @param {String} `source`
  16385. * @param {Object} `position`
  16386. */
  16387. exports.addContent = function (source, position) {
  16388. if (typeof position.content !== 'string') return;
  16389. if (Object.prototype.hasOwnProperty.call(this.content, source)) return;
  16390. this.map.setSourceContent(source, position.content);
  16391. };
  16392. /**
  16393. * Applies any original source maps to the output and embeds the source file
  16394. * contents in the source map.
  16395. */
  16396. exports.applySourceMaps = function () {
  16397. Object.keys(this.files).forEach(function (file) {
  16398. var content = this.files[file];
  16399. this.map.setSourceContent(file, content);
  16400. if (this.options.inputSourcemaps === true) {
  16401. var originalMap = utils.sourceMapResolve.resolveSync(content, file, fs.readFileSync);
  16402. if (originalMap) {
  16403. var map = new utils.SourceMap.SourceMapConsumer(originalMap.map);
  16404. var relativeTo = originalMap.sourcesRelativeTo;
  16405. this.map.applySourceMap(map, file, utils.unixify(path.dirname(relativeTo)));
  16406. }
  16407. }
  16408. }, this);
  16409. };
  16410. /**
  16411. * Process comments, drops sourceMap comments.
  16412. * @param {Object} node
  16413. */
  16414. exports.comment = function (node) {
  16415. if (/^# sourceMappingURL=/.test(node.comment)) {
  16416. return this.emit('', node.position);
  16417. }
  16418. return this._comment(node);
  16419. };
  16420. /***/ }),
  16421. /***/ "./node_modules/snapdragon/lib/utils.js":
  16422. /*!**********************************************!*\
  16423. !*** ./node_modules/snapdragon/lib/utils.js ***!
  16424. \**********************************************/
  16425. /*! no static exports found */
  16426. /***/ (function(module, exports, __webpack_require__) {
  16427. "use strict";
  16428. /**
  16429. * Module dependencies
  16430. */
  16431. exports.extend = __webpack_require__(/*! extend-shallow */ "./node_modules/extend-shallow/index.js");
  16432. exports.SourceMap = __webpack_require__(/*! source-map */ "./node_modules/snapdragon/node_modules/source-map/source-map.js");
  16433. exports.sourceMapResolve = __webpack_require__(/*! source-map-resolve */ "./node_modules/source-map-resolve/source-map-resolve.js");
  16434. /**
  16435. * Convert backslash in the given string to forward slashes
  16436. */
  16437. exports.unixify = function (fp) {
  16438. return fp.split(/\\+/).join('/');
  16439. };
  16440. /**
  16441. * Return true if `val` is a non-empty string
  16442. *
  16443. * @param {String} `str`
  16444. * @return {Boolean}
  16445. */
  16446. exports.isString = function (str) {
  16447. return str && typeof str === 'string';
  16448. };
  16449. /**
  16450. * Cast `val` to an array
  16451. * @return {Array}
  16452. */
  16453. exports.arrayify = function (val) {
  16454. if (typeof val === 'string') return [val];
  16455. return val ? Array.isArray(val) ? val : [val] : [];
  16456. };
  16457. /**
  16458. * Get the last `n` element from the given `array`
  16459. * @param {Array} `array`
  16460. * @return {*}
  16461. */
  16462. exports.last = function (arr, n) {
  16463. return arr[arr.length - (n || 1)];
  16464. };
  16465. /***/ }),
  16466. /***/ "./node_modules/snapdragon/node_modules/debug/src/browser.js":
  16467. /*!*******************************************************************!*\
  16468. !*** ./node_modules/snapdragon/node_modules/debug/src/browser.js ***!
  16469. \*******************************************************************/
  16470. /*! no static exports found */
  16471. /***/ (function(module, exports, __webpack_require__) {
  16472. "use strict";
  16473. /* WEBPACK VAR INJECTION */(function(process) {
  16474. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  16475. /**
  16476. * This is the web browser implementation of `debug()`.
  16477. *
  16478. * Expose `debug()` as the module.
  16479. */
  16480. exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/snapdragon/node_modules/debug/src/debug.js");
  16481. exports.log = log;
  16482. exports.formatArgs = formatArgs;
  16483. exports.save = save;
  16484. exports.load = load;
  16485. exports.useColors = useColors;
  16486. exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
  16487. /**
  16488. * Colors.
  16489. */
  16490. exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson'];
  16491. /**
  16492. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  16493. * and the Firebug extension (any Firefox version) are known
  16494. * to support "%c" CSS customizations.
  16495. *
  16496. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  16497. */
  16498. function useColors() {
  16499. // NB: In an Electron preload script, document will be defined but not fully
  16500. // initialized. Since we know we're in Chrome, we'll just detect this case
  16501. // explicitly
  16502. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  16503. return true;
  16504. } // is webkit? http://stackoverflow.com/a/16459606/376773
  16505. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  16506. return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
  16507. typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
  16508. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  16509. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
  16510. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  16511. }
  16512. /**
  16513. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  16514. */
  16515. exports.formatters.j = function (v) {
  16516. try {
  16517. return JSON.stringify(v);
  16518. } catch (err) {
  16519. return '[UnexpectedJSONParseError]: ' + err.message;
  16520. }
  16521. };
  16522. /**
  16523. * Colorize log arguments if enabled.
  16524. *
  16525. * @api public
  16526. */
  16527. function formatArgs(args) {
  16528. var useColors = this.useColors;
  16529. args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
  16530. if (!useColors) return;
  16531. var c = 'color: ' + this.color;
  16532. args.splice(1, 0, c, 'color: inherit'); // the final "%c" is somewhat tricky, because there could be other
  16533. // arguments passed either before or after the %c, so we need to
  16534. // figure out the correct index to insert the CSS into
  16535. var index = 0;
  16536. var lastC = 0;
  16537. args[0].replace(/%[a-zA-Z%]/g, function (match) {
  16538. if ('%%' === match) return;
  16539. index++;
  16540. if ('%c' === match) {
  16541. // we only are interested in the *last* %c
  16542. // (the user may have provided their own)
  16543. lastC = index;
  16544. }
  16545. });
  16546. args.splice(lastC, 0, c);
  16547. }
  16548. /**
  16549. * Invokes `console.log()` when available.
  16550. * No-op when `console.log` is not a "function".
  16551. *
  16552. * @api public
  16553. */
  16554. function log() {
  16555. // this hackery is required for IE8/9, where
  16556. // the `console.log` function doesn't have 'apply'
  16557. return 'object' === (typeof console === "undefined" ? "undefined" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);
  16558. }
  16559. /**
  16560. * Save `namespaces`.
  16561. *
  16562. * @param {String} namespaces
  16563. * @api private
  16564. */
  16565. function save(namespaces) {
  16566. try {
  16567. if (null == namespaces) {
  16568. exports.storage.removeItem('debug');
  16569. } else {
  16570. exports.storage.debug = namespaces;
  16571. }
  16572. } catch (e) {}
  16573. }
  16574. /**
  16575. * Load `namespaces`.
  16576. *
  16577. * @return {String} returns the previously persisted debug modes
  16578. * @api private
  16579. */
  16580. function load() {
  16581. var r;
  16582. try {
  16583. r = exports.storage.debug;
  16584. } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  16585. if (!r && typeof process !== 'undefined' && 'env' in process) {
  16586. r = process.env.DEBUG;
  16587. }
  16588. return r;
  16589. }
  16590. /**
  16591. * Enable namespaces listed in `localStorage.debug` initially.
  16592. */
  16593. exports.enable(load());
  16594. /**
  16595. * Localstorage attempts to return the localstorage.
  16596. *
  16597. * This is necessary because safari throws
  16598. * when a user disables cookies/localstorage
  16599. * and you attempt to access it.
  16600. *
  16601. * @return {LocalStorage}
  16602. * @api private
  16603. */
  16604. function localstorage() {
  16605. try {
  16606. return window.localStorage;
  16607. } catch (e) {}
  16608. }
  16609. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  16610. /***/ }),
  16611. /***/ "./node_modules/snapdragon/node_modules/debug/src/debug.js":
  16612. /*!*****************************************************************!*\
  16613. !*** ./node_modules/snapdragon/node_modules/debug/src/debug.js ***!
  16614. \*****************************************************************/
  16615. /*! no static exports found */
  16616. /***/ (function(module, exports, __webpack_require__) {
  16617. "use strict";
  16618. /**
  16619. * This is the common logic for both the Node.js and web browser
  16620. * implementations of `debug()`.
  16621. *
  16622. * Expose `debug()` as the module.
  16623. */
  16624. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  16625. exports.coerce = coerce;
  16626. exports.disable = disable;
  16627. exports.enable = enable;
  16628. exports.enabled = enabled;
  16629. exports.humanize = __webpack_require__(/*! ms */ "./node_modules/snapdragon/node_modules/ms/index.js");
  16630. /**
  16631. * The currently active debug mode names, and names to skip.
  16632. */
  16633. exports.names = [];
  16634. exports.skips = [];
  16635. /**
  16636. * Map of special "%n" handling functions, for the debug "format" argument.
  16637. *
  16638. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  16639. */
  16640. exports.formatters = {};
  16641. /**
  16642. * Previous log timestamp.
  16643. */
  16644. var prevTime;
  16645. /**
  16646. * Select a color.
  16647. * @param {String} namespace
  16648. * @return {Number}
  16649. * @api private
  16650. */
  16651. function selectColor(namespace) {
  16652. var hash = 0,
  16653. i;
  16654. for (i in namespace) {
  16655. hash = (hash << 5) - hash + namespace.charCodeAt(i);
  16656. hash |= 0; // Convert to 32bit integer
  16657. }
  16658. return exports.colors[Math.abs(hash) % exports.colors.length];
  16659. }
  16660. /**
  16661. * Create a debugger with the given `namespace`.
  16662. *
  16663. * @param {String} namespace
  16664. * @return {Function}
  16665. * @api public
  16666. */
  16667. function createDebug(namespace) {
  16668. function debug() {
  16669. // disabled?
  16670. if (!debug.enabled) return;
  16671. var self = debug; // set `diff` timestamp
  16672. var curr = +new Date();
  16673. var ms = curr - (prevTime || curr);
  16674. self.diff = ms;
  16675. self.prev = prevTime;
  16676. self.curr = curr;
  16677. prevTime = curr; // turn the `arguments` into a proper Array
  16678. var args = new Array(arguments.length);
  16679. for (var i = 0; i < args.length; i++) {
  16680. args[i] = arguments[i];
  16681. }
  16682. args[0] = exports.coerce(args[0]);
  16683. if ('string' !== typeof args[0]) {
  16684. // anything else let's inspect with %O
  16685. args.unshift('%O');
  16686. } // apply any `formatters` transformations
  16687. var index = 0;
  16688. args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
  16689. // if we encounter an escaped % then don't increase the array index
  16690. if (match === '%%') return match;
  16691. index++;
  16692. var formatter = exports.formatters[format];
  16693. if ('function' === typeof formatter) {
  16694. var val = args[index];
  16695. match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`
  16696. args.splice(index, 1);
  16697. index--;
  16698. }
  16699. return match;
  16700. }); // apply env-specific formatting (colors, etc.)
  16701. exports.formatArgs.call(self, args);
  16702. var logFn = debug.log || exports.log || console.log.bind(console);
  16703. logFn.apply(self, args);
  16704. }
  16705. debug.namespace = namespace;
  16706. debug.enabled = exports.enabled(namespace);
  16707. debug.useColors = exports.useColors();
  16708. debug.color = selectColor(namespace); // env-specific initialization logic for debug instances
  16709. if ('function' === typeof exports.init) {
  16710. exports.init(debug);
  16711. }
  16712. return debug;
  16713. }
  16714. /**
  16715. * Enables a debug mode by namespaces. This can include modes
  16716. * separated by a colon and wildcards.
  16717. *
  16718. * @param {String} namespaces
  16719. * @api public
  16720. */
  16721. function enable(namespaces) {
  16722. exports.save(namespaces);
  16723. exports.names = [];
  16724. exports.skips = [];
  16725. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  16726. var len = split.length;
  16727. for (var i = 0; i < len; i++) {
  16728. if (!split[i]) continue; // ignore empty strings
  16729. namespaces = split[i].replace(/\*/g, '.*?');
  16730. if (namespaces[0] === '-') {
  16731. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  16732. } else {
  16733. exports.names.push(new RegExp('^' + namespaces + '$'));
  16734. }
  16735. }
  16736. }
  16737. /**
  16738. * Disable debug output.
  16739. *
  16740. * @api public
  16741. */
  16742. function disable() {
  16743. exports.enable('');
  16744. }
  16745. /**
  16746. * Returns true if the given mode name is enabled, false otherwise.
  16747. *
  16748. * @param {String} name
  16749. * @return {Boolean}
  16750. * @api public
  16751. */
  16752. function enabled(name) {
  16753. var i, len;
  16754. for (i = 0, len = exports.skips.length; i < len; i++) {
  16755. if (exports.skips[i].test(name)) {
  16756. return false;
  16757. }
  16758. }
  16759. for (i = 0, len = exports.names.length; i < len; i++) {
  16760. if (exports.names[i].test(name)) {
  16761. return true;
  16762. }
  16763. }
  16764. return false;
  16765. }
  16766. /**
  16767. * Coerce `val`.
  16768. *
  16769. * @param {Mixed} val
  16770. * @return {Mixed}
  16771. * @api private
  16772. */
  16773. function coerce(val) {
  16774. if (val instanceof Error) return val.stack || val.message;
  16775. return val;
  16776. }
  16777. /***/ }),
  16778. /***/ "./node_modules/snapdragon/node_modules/ms/index.js":
  16779. /*!**********************************************************!*\
  16780. !*** ./node_modules/snapdragon/node_modules/ms/index.js ***!
  16781. \**********************************************************/
  16782. /*! no static exports found */
  16783. /***/ (function(module, exports, __webpack_require__) {
  16784. "use strict";
  16785. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  16786. /**
  16787. * Helpers.
  16788. */
  16789. var s = 1000;
  16790. var m = s * 60;
  16791. var h = m * 60;
  16792. var d = h * 24;
  16793. var y = d * 365.25;
  16794. /**
  16795. * Parse or format the given `val`.
  16796. *
  16797. * Options:
  16798. *
  16799. * - `long` verbose formatting [false]
  16800. *
  16801. * @param {String|Number} val
  16802. * @param {Object} [options]
  16803. * @throws {Error} throw an error if val is not a non-empty string or a number
  16804. * @return {String|Number}
  16805. * @api public
  16806. */
  16807. module.exports = function (val, options) {
  16808. options = options || {};
  16809. var type = _typeof(val);
  16810. if (type === 'string' && val.length > 0) {
  16811. return parse(val);
  16812. } else if (type === 'number' && isNaN(val) === false) {
  16813. return options.long ? fmtLong(val) : fmtShort(val);
  16814. }
  16815. throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
  16816. };
  16817. /**
  16818. * Parse the given `str` and return milliseconds.
  16819. *
  16820. * @param {String} str
  16821. * @return {Number}
  16822. * @api private
  16823. */
  16824. function parse(str) {
  16825. str = String(str);
  16826. if (str.length > 100) {
  16827. return;
  16828. }
  16829. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
  16830. if (!match) {
  16831. return;
  16832. }
  16833. var n = parseFloat(match[1]);
  16834. var type = (match[2] || 'ms').toLowerCase();
  16835. switch (type) {
  16836. case 'years':
  16837. case 'year':
  16838. case 'yrs':
  16839. case 'yr':
  16840. case 'y':
  16841. return n * y;
  16842. case 'days':
  16843. case 'day':
  16844. case 'd':
  16845. return n * d;
  16846. case 'hours':
  16847. case 'hour':
  16848. case 'hrs':
  16849. case 'hr':
  16850. case 'h':
  16851. return n * h;
  16852. case 'minutes':
  16853. case 'minute':
  16854. case 'mins':
  16855. case 'min':
  16856. case 'm':
  16857. return n * m;
  16858. case 'seconds':
  16859. case 'second':
  16860. case 'secs':
  16861. case 'sec':
  16862. case 's':
  16863. return n * s;
  16864. case 'milliseconds':
  16865. case 'millisecond':
  16866. case 'msecs':
  16867. case 'msec':
  16868. case 'ms':
  16869. return n;
  16870. default:
  16871. return undefined;
  16872. }
  16873. }
  16874. /**
  16875. * Short format for `ms`.
  16876. *
  16877. * @param {Number} ms
  16878. * @return {String}
  16879. * @api private
  16880. */
  16881. function fmtShort(ms) {
  16882. if (ms >= d) {
  16883. return Math.round(ms / d) + 'd';
  16884. }
  16885. if (ms >= h) {
  16886. return Math.round(ms / h) + 'h';
  16887. }
  16888. if (ms >= m) {
  16889. return Math.round(ms / m) + 'm';
  16890. }
  16891. if (ms >= s) {
  16892. return Math.round(ms / s) + 's';
  16893. }
  16894. return ms + 'ms';
  16895. }
  16896. /**
  16897. * Long format for `ms`.
  16898. *
  16899. * @param {Number} ms
  16900. * @return {String}
  16901. * @api private
  16902. */
  16903. function fmtLong(ms) {
  16904. return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
  16905. }
  16906. /**
  16907. * Pluralization helper.
  16908. */
  16909. function plural(ms, n, name) {
  16910. if (ms < n) {
  16911. return;
  16912. }
  16913. if (ms < n * 1.5) {
  16914. return Math.floor(ms / n) + ' ' + name;
  16915. }
  16916. return Math.ceil(ms / n) + ' ' + name + 's';
  16917. }
  16918. /***/ }),
  16919. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/array-set.js":
  16920. /*!**************************************************************************!*\
  16921. !*** ./node_modules/snapdragon/node_modules/source-map/lib/array-set.js ***!
  16922. \**************************************************************************/
  16923. /*! no static exports found */
  16924. /***/ (function(module, exports, __webpack_require__) {
  16925. "use strict";
  16926. /* -*- Mode: js; js-indent-level: 2; -*- */
  16927. /*
  16928. * Copyright 2011 Mozilla Foundation and contributors
  16929. * Licensed under the New BSD license. See LICENSE or:
  16930. * http://opensource.org/licenses/BSD-3-Clause
  16931. */
  16932. var util = __webpack_require__(/*! ./util */ "./node_modules/snapdragon/node_modules/source-map/lib/util.js");
  16933. var has = Object.prototype.hasOwnProperty;
  16934. var hasNativeMap = typeof Map !== "undefined";
  16935. /**
  16936. * A data structure which is a combination of an array and a set. Adding a new
  16937. * member is O(1), testing for membership is O(1), and finding the index of an
  16938. * element is O(1). Removing elements from the set is not supported. Only
  16939. * strings are supported for membership.
  16940. */
  16941. function ArraySet() {
  16942. this._array = [];
  16943. this._set = hasNativeMap ? new Map() : Object.create(null);
  16944. }
  16945. /**
  16946. * Static method for creating ArraySet instances from an existing array.
  16947. */
  16948. ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  16949. var set = new ArraySet();
  16950. for (var i = 0, len = aArray.length; i < len; i++) {
  16951. set.add(aArray[i], aAllowDuplicates);
  16952. }
  16953. return set;
  16954. };
  16955. /**
  16956. * Return how many unique items are in this ArraySet. If duplicates have been
  16957. * added, than those do not count towards the size.
  16958. *
  16959. * @returns Number
  16960. */
  16961. ArraySet.prototype.size = function ArraySet_size() {
  16962. return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
  16963. };
  16964. /**
  16965. * Add the given string to this set.
  16966. *
  16967. * @param String aStr
  16968. */
  16969. ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  16970. var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
  16971. var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
  16972. var idx = this._array.length;
  16973. if (!isDuplicate || aAllowDuplicates) {
  16974. this._array.push(aStr);
  16975. }
  16976. if (!isDuplicate) {
  16977. if (hasNativeMap) {
  16978. this._set.set(aStr, idx);
  16979. } else {
  16980. this._set[sStr] = idx;
  16981. }
  16982. }
  16983. };
  16984. /**
  16985. * Is the given string a member of this set?
  16986. *
  16987. * @param String aStr
  16988. */
  16989. ArraySet.prototype.has = function ArraySet_has(aStr) {
  16990. if (hasNativeMap) {
  16991. return this._set.has(aStr);
  16992. } else {
  16993. var sStr = util.toSetString(aStr);
  16994. return has.call(this._set, sStr);
  16995. }
  16996. };
  16997. /**
  16998. * What is the index of the given string in the array?
  16999. *
  17000. * @param String aStr
  17001. */
  17002. ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  17003. if (hasNativeMap) {
  17004. var idx = this._set.get(aStr);
  17005. if (idx >= 0) {
  17006. return idx;
  17007. }
  17008. } else {
  17009. var sStr = util.toSetString(aStr);
  17010. if (has.call(this._set, sStr)) {
  17011. return this._set[sStr];
  17012. }
  17013. }
  17014. throw new Error('"' + aStr + '" is not in the set.');
  17015. };
  17016. /**
  17017. * What is the element at the given index?
  17018. *
  17019. * @param Number aIdx
  17020. */
  17021. ArraySet.prototype.at = function ArraySet_at(aIdx) {
  17022. if (aIdx >= 0 && aIdx < this._array.length) {
  17023. return this._array[aIdx];
  17024. }
  17025. throw new Error('No element indexed by ' + aIdx);
  17026. };
  17027. /**
  17028. * Returns the array representation of this set (which has the proper indices
  17029. * indicated by indexOf). Note that this is a copy of the internal array used
  17030. * for storing the members so that no one can mess with internal state.
  17031. */
  17032. ArraySet.prototype.toArray = function ArraySet_toArray() {
  17033. return this._array.slice();
  17034. };
  17035. exports.ArraySet = ArraySet;
  17036. /***/ }),
  17037. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/base64-vlq.js":
  17038. /*!***************************************************************************!*\
  17039. !*** ./node_modules/snapdragon/node_modules/source-map/lib/base64-vlq.js ***!
  17040. \***************************************************************************/
  17041. /*! no static exports found */
  17042. /***/ (function(module, exports, __webpack_require__) {
  17043. "use strict";
  17044. /* -*- Mode: js; js-indent-level: 2; -*- */
  17045. /*
  17046. * Copyright 2011 Mozilla Foundation and contributors
  17047. * Licensed under the New BSD license. See LICENSE or:
  17048. * http://opensource.org/licenses/BSD-3-Clause
  17049. *
  17050. * Based on the Base 64 VLQ implementation in Closure Compiler:
  17051. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  17052. *
  17053. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  17054. * Redistribution and use in source and binary forms, with or without
  17055. * modification, are permitted provided that the following conditions are
  17056. * met:
  17057. *
  17058. * * Redistributions of source code must retain the above copyright
  17059. * notice, this list of conditions and the following disclaimer.
  17060. * * Redistributions in binary form must reproduce the above
  17061. * copyright notice, this list of conditions and the following
  17062. * disclaimer in the documentation and/or other materials provided
  17063. * with the distribution.
  17064. * * Neither the name of Google Inc. nor the names of its
  17065. * contributors may be used to endorse or promote products derived
  17066. * from this software without specific prior written permission.
  17067. *
  17068. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17069. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17070. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17071. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17072. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17073. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17074. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  17075. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  17076. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17077. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17078. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17079. */
  17080. var base64 = __webpack_require__(/*! ./base64 */ "./node_modules/snapdragon/node_modules/source-map/lib/base64.js"); // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  17081. // length quantities we use in the source map spec, the first bit is the sign,
  17082. // the next four bits are the actual value, and the 6th bit is the
  17083. // continuation bit. The continuation bit tells us whether there are more
  17084. // digits in this value following this digit.
  17085. //
  17086. // Continuation
  17087. // | Sign
  17088. // | |
  17089. // V V
  17090. // 101011
  17091. var VLQ_BASE_SHIFT = 5; // binary: 100000
  17092. var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111
  17093. var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000
  17094. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  17095. /**
  17096. * Converts from a two-complement value to a value where the sign bit is
  17097. * placed in the least significant bit. For example, as decimals:
  17098. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  17099. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  17100. */
  17101. function toVLQSigned(aValue) {
  17102. return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
  17103. }
  17104. /**
  17105. * Converts to a two-complement value from a value where the sign bit is
  17106. * placed in the least significant bit. For example, as decimals:
  17107. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  17108. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  17109. */
  17110. function fromVLQSigned(aValue) {
  17111. var isNegative = (aValue & 1) === 1;
  17112. var shifted = aValue >> 1;
  17113. return isNegative ? -shifted : shifted;
  17114. }
  17115. /**
  17116. * Returns the base 64 VLQ encoded value.
  17117. */
  17118. exports.encode = function base64VLQ_encode(aValue) {
  17119. var encoded = "";
  17120. var digit;
  17121. var vlq = toVLQSigned(aValue);
  17122. do {
  17123. digit = vlq & VLQ_BASE_MASK;
  17124. vlq >>>= VLQ_BASE_SHIFT;
  17125. if (vlq > 0) {
  17126. // There are still more digits in this value, so we must make sure the
  17127. // continuation bit is marked.
  17128. digit |= VLQ_CONTINUATION_BIT;
  17129. }
  17130. encoded += base64.encode(digit);
  17131. } while (vlq > 0);
  17132. return encoded;
  17133. };
  17134. /**
  17135. * Decodes the next base 64 VLQ value from the given string and returns the
  17136. * value and the rest of the string via the out parameter.
  17137. */
  17138. exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  17139. var strLen = aStr.length;
  17140. var result = 0;
  17141. var shift = 0;
  17142. var continuation, digit;
  17143. do {
  17144. if (aIndex >= strLen) {
  17145. throw new Error("Expected more digits in base 64 VLQ value.");
  17146. }
  17147. digit = base64.decode(aStr.charCodeAt(aIndex++));
  17148. if (digit === -1) {
  17149. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  17150. }
  17151. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  17152. digit &= VLQ_BASE_MASK;
  17153. result = result + (digit << shift);
  17154. shift += VLQ_BASE_SHIFT;
  17155. } while (continuation);
  17156. aOutParam.value = fromVLQSigned(result);
  17157. aOutParam.rest = aIndex;
  17158. };
  17159. /***/ }),
  17160. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/base64.js":
  17161. /*!***********************************************************************!*\
  17162. !*** ./node_modules/snapdragon/node_modules/source-map/lib/base64.js ***!
  17163. \***********************************************************************/
  17164. /*! no static exports found */
  17165. /***/ (function(module, exports, __webpack_require__) {
  17166. "use strict";
  17167. /* -*- Mode: js; js-indent-level: 2; -*- */
  17168. /*
  17169. * Copyright 2011 Mozilla Foundation and contributors
  17170. * Licensed under the New BSD license. See LICENSE or:
  17171. * http://opensource.org/licenses/BSD-3-Clause
  17172. */
  17173. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  17174. /**
  17175. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  17176. */
  17177. exports.encode = function (number) {
  17178. if (0 <= number && number < intToCharMap.length) {
  17179. return intToCharMap[number];
  17180. }
  17181. throw new TypeError("Must be between 0 and 63: " + number);
  17182. };
  17183. /**
  17184. * Decode a single base 64 character code digit to an integer. Returns -1 on
  17185. * failure.
  17186. */
  17187. exports.decode = function (charCode) {
  17188. var bigA = 65; // 'A'
  17189. var bigZ = 90; // 'Z'
  17190. var littleA = 97; // 'a'
  17191. var littleZ = 122; // 'z'
  17192. var zero = 48; // '0'
  17193. var nine = 57; // '9'
  17194. var plus = 43; // '+'
  17195. var slash = 47; // '/'
  17196. var littleOffset = 26;
  17197. var numberOffset = 52; // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  17198. if (bigA <= charCode && charCode <= bigZ) {
  17199. return charCode - bigA;
  17200. } // 26 - 51: abcdefghijklmnopqrstuvwxyz
  17201. if (littleA <= charCode && charCode <= littleZ) {
  17202. return charCode - littleA + littleOffset;
  17203. } // 52 - 61: 0123456789
  17204. if (zero <= charCode && charCode <= nine) {
  17205. return charCode - zero + numberOffset;
  17206. } // 62: +
  17207. if (charCode == plus) {
  17208. return 62;
  17209. } // 63: /
  17210. if (charCode == slash) {
  17211. return 63;
  17212. } // Invalid base64 digit.
  17213. return -1;
  17214. };
  17215. /***/ }),
  17216. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/binary-search.js":
  17217. /*!******************************************************************************!*\
  17218. !*** ./node_modules/snapdragon/node_modules/source-map/lib/binary-search.js ***!
  17219. \******************************************************************************/
  17220. /*! no static exports found */
  17221. /***/ (function(module, exports, __webpack_require__) {
  17222. "use strict";
  17223. /* -*- Mode: js; js-indent-level: 2; -*- */
  17224. /*
  17225. * Copyright 2011 Mozilla Foundation and contributors
  17226. * Licensed under the New BSD license. See LICENSE or:
  17227. * http://opensource.org/licenses/BSD-3-Clause
  17228. */
  17229. exports.GREATEST_LOWER_BOUND = 1;
  17230. exports.LEAST_UPPER_BOUND = 2;
  17231. /**
  17232. * Recursive implementation of binary search.
  17233. *
  17234. * @param aLow Indices here and lower do not contain the needle.
  17235. * @param aHigh Indices here and higher do not contain the needle.
  17236. * @param aNeedle The element being searched for.
  17237. * @param aHaystack The non-empty array being searched.
  17238. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  17239. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  17240. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  17241. * closest element that is smaller than or greater than the one we are
  17242. * searching for, respectively, if the exact element cannot be found.
  17243. */
  17244. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  17245. // This function terminates when one of the following is true:
  17246. //
  17247. // 1. We find the exact element we are looking for.
  17248. //
  17249. // 2. We did not find the exact element, but we can return the index of
  17250. // the next-closest element.
  17251. //
  17252. // 3. We did not find the exact element, and there is no next-closest
  17253. // element than the one we are searching for, so we return -1.
  17254. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  17255. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  17256. if (cmp === 0) {
  17257. // Found the element we are looking for.
  17258. return mid;
  17259. } else if (cmp > 0) {
  17260. // Our needle is greater than aHaystack[mid].
  17261. if (aHigh - mid > 1) {
  17262. // The element is in the upper half.
  17263. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  17264. } // The exact needle element was not found in this haystack. Determine if
  17265. // we are in termination case (3) or (2) and return the appropriate thing.
  17266. if (aBias == exports.LEAST_UPPER_BOUND) {
  17267. return aHigh < aHaystack.length ? aHigh : -1;
  17268. } else {
  17269. return mid;
  17270. }
  17271. } else {
  17272. // Our needle is less than aHaystack[mid].
  17273. if (mid - aLow > 1) {
  17274. // The element is in the lower half.
  17275. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  17276. } // we are in termination case (3) or (2) and return the appropriate thing.
  17277. if (aBias == exports.LEAST_UPPER_BOUND) {
  17278. return mid;
  17279. } else {
  17280. return aLow < 0 ? -1 : aLow;
  17281. }
  17282. }
  17283. }
  17284. /**
  17285. * This is an implementation of binary search which will always try and return
  17286. * the index of the closest element if there is no exact hit. This is because
  17287. * mappings between original and generated line/col pairs are single points,
  17288. * and there is an implicit region between each of them, so a miss just means
  17289. * that you aren't on the very start of a region.
  17290. *
  17291. * @param aNeedle The element you are looking for.
  17292. * @param aHaystack The array that is being searched.
  17293. * @param aCompare A function which takes the needle and an element in the
  17294. * array and returns -1, 0, or 1 depending on whether the needle is less
  17295. * than, equal to, or greater than the element, respectively.
  17296. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  17297. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  17298. * closest element that is smaller than or greater than the one we are
  17299. * searching for, respectively, if the exact element cannot be found.
  17300. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  17301. */
  17302. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  17303. if (aHaystack.length === 0) {
  17304. return -1;
  17305. }
  17306. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  17307. if (index < 0) {
  17308. return -1;
  17309. } // We have found either the exact element, or the next-closest element than
  17310. // the one we are searching for. However, there may be more than one such
  17311. // element. Make sure we always return the smallest of these.
  17312. while (index - 1 >= 0) {
  17313. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  17314. break;
  17315. }
  17316. --index;
  17317. }
  17318. return index;
  17319. };
  17320. /***/ }),
  17321. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/mapping-list.js":
  17322. /*!*****************************************************************************!*\
  17323. !*** ./node_modules/snapdragon/node_modules/source-map/lib/mapping-list.js ***!
  17324. \*****************************************************************************/
  17325. /*! no static exports found */
  17326. /***/ (function(module, exports, __webpack_require__) {
  17327. "use strict";
  17328. /* -*- Mode: js; js-indent-level: 2; -*- */
  17329. /*
  17330. * Copyright 2014 Mozilla Foundation and contributors
  17331. * Licensed under the New BSD license. See LICENSE or:
  17332. * http://opensource.org/licenses/BSD-3-Clause
  17333. */
  17334. var util = __webpack_require__(/*! ./util */ "./node_modules/snapdragon/node_modules/source-map/lib/util.js");
  17335. /**
  17336. * Determine whether mappingB is after mappingA with respect to generated
  17337. * position.
  17338. */
  17339. function generatedPositionAfter(mappingA, mappingB) {
  17340. // Optimized for most common case
  17341. var lineA = mappingA.generatedLine;
  17342. var lineB = mappingB.generatedLine;
  17343. var columnA = mappingA.generatedColumn;
  17344. var columnB = mappingB.generatedColumn;
  17345. return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  17346. }
  17347. /**
  17348. * A data structure to provide a sorted view of accumulated mappings in a
  17349. * performance conscious manner. It trades a neglibable overhead in general
  17350. * case for a large speedup in case of mappings being added in order.
  17351. */
  17352. function MappingList() {
  17353. this._array = [];
  17354. this._sorted = true; // Serves as infimum
  17355. this._last = {
  17356. generatedLine: -1,
  17357. generatedColumn: 0
  17358. };
  17359. }
  17360. /**
  17361. * Iterate through internal items. This method takes the same arguments that
  17362. * `Array.prototype.forEach` takes.
  17363. *
  17364. * NOTE: The order of the mappings is NOT guaranteed.
  17365. */
  17366. MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
  17367. this._array.forEach(aCallback, aThisArg);
  17368. };
  17369. /**
  17370. * Add the given source mapping.
  17371. *
  17372. * @param Object aMapping
  17373. */
  17374. MappingList.prototype.add = function MappingList_add(aMapping) {
  17375. if (generatedPositionAfter(this._last, aMapping)) {
  17376. this._last = aMapping;
  17377. this._array.push(aMapping);
  17378. } else {
  17379. this._sorted = false;
  17380. this._array.push(aMapping);
  17381. }
  17382. };
  17383. /**
  17384. * Returns the flat, sorted array of mappings. The mappings are sorted by
  17385. * generated position.
  17386. *
  17387. * WARNING: This method returns internal data without copying, for
  17388. * performance. The return value must NOT be mutated, and should be treated as
  17389. * an immutable borrow. If you want to take ownership, you must make your own
  17390. * copy.
  17391. */
  17392. MappingList.prototype.toArray = function MappingList_toArray() {
  17393. if (!this._sorted) {
  17394. this._array.sort(util.compareByGeneratedPositionsInflated);
  17395. this._sorted = true;
  17396. }
  17397. return this._array;
  17398. };
  17399. exports.MappingList = MappingList;
  17400. /***/ }),
  17401. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/quick-sort.js":
  17402. /*!***************************************************************************!*\
  17403. !*** ./node_modules/snapdragon/node_modules/source-map/lib/quick-sort.js ***!
  17404. \***************************************************************************/
  17405. /*! no static exports found */
  17406. /***/ (function(module, exports, __webpack_require__) {
  17407. "use strict";
  17408. /* -*- Mode: js; js-indent-level: 2; -*- */
  17409. /*
  17410. * Copyright 2011 Mozilla Foundation and contributors
  17411. * Licensed under the New BSD license. See LICENSE or:
  17412. * http://opensource.org/licenses/BSD-3-Clause
  17413. */
  17414. // It turns out that some (most?) JavaScript engines don't self-host
  17415. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  17416. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  17417. // custom comparator function, calling back and forth between the VM's C++ and
  17418. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  17419. // worse generated code for the comparator function than would be optimal. In
  17420. // fact, when sorting with a comparator, these costs outweigh the benefits of
  17421. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  17422. // a ~3500ms mean speed-up in `bench/bench.html`.
  17423. /**
  17424. * Swap the elements indexed by `x` and `y` in the array `ary`.
  17425. *
  17426. * @param {Array} ary
  17427. * The array.
  17428. * @param {Number} x
  17429. * The index of the first item.
  17430. * @param {Number} y
  17431. * The index of the second item.
  17432. */
  17433. function swap(ary, x, y) {
  17434. var temp = ary[x];
  17435. ary[x] = ary[y];
  17436. ary[y] = temp;
  17437. }
  17438. /**
  17439. * Returns a random integer within the range `low .. high` inclusive.
  17440. *
  17441. * @param {Number} low
  17442. * The lower bound on the range.
  17443. * @param {Number} high
  17444. * The upper bound on the range.
  17445. */
  17446. function randomIntInRange(low, high) {
  17447. return Math.round(low + Math.random() * (high - low));
  17448. }
  17449. /**
  17450. * The Quick Sort algorithm.
  17451. *
  17452. * @param {Array} ary
  17453. * An array to sort.
  17454. * @param {function} comparator
  17455. * Function to use to compare two items.
  17456. * @param {Number} p
  17457. * Start index of the array
  17458. * @param {Number} r
  17459. * End index of the array
  17460. */
  17461. function doQuickSort(ary, comparator, p, r) {
  17462. // If our lower bound is less than our upper bound, we (1) partition the
  17463. // array into two pieces and (2) recurse on each half. If it is not, this is
  17464. // the empty array and our base case.
  17465. if (p < r) {
  17466. // (1) Partitioning.
  17467. //
  17468. // The partitioning chooses a pivot between `p` and `r` and moves all
  17469. // elements that are less than or equal to the pivot to the before it, and
  17470. // all the elements that are greater than it after it. The effect is that
  17471. // once partition is done, the pivot is in the exact place it will be when
  17472. // the array is put in sorted order, and it will not need to be moved
  17473. // again. This runs in O(n) time.
  17474. // Always choose a random pivot so that an input array which is reverse
  17475. // sorted does not cause O(n^2) running time.
  17476. var pivotIndex = randomIntInRange(p, r);
  17477. var i = p - 1;
  17478. swap(ary, pivotIndex, r);
  17479. var pivot = ary[r]; // Immediately after `j` is incremented in this loop, the following hold
  17480. // true:
  17481. //
  17482. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  17483. //
  17484. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  17485. for (var j = p; j < r; j++) {
  17486. if (comparator(ary[j], pivot) <= 0) {
  17487. i += 1;
  17488. swap(ary, i, j);
  17489. }
  17490. }
  17491. swap(ary, i + 1, j);
  17492. var q = i + 1; // (2) Recurse on each half.
  17493. doQuickSort(ary, comparator, p, q - 1);
  17494. doQuickSort(ary, comparator, q + 1, r);
  17495. }
  17496. }
  17497. /**
  17498. * Sort the given array in-place with the given comparator function.
  17499. *
  17500. * @param {Array} ary
  17501. * An array to sort.
  17502. * @param {function} comparator
  17503. * Function to use to compare two items.
  17504. */
  17505. exports.quickSort = function (ary, comparator) {
  17506. doQuickSort(ary, comparator, 0, ary.length - 1);
  17507. };
  17508. /***/ }),
  17509. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/source-map-consumer.js":
  17510. /*!************************************************************************************!*\
  17511. !*** ./node_modules/snapdragon/node_modules/source-map/lib/source-map-consumer.js ***!
  17512. \************************************************************************************/
  17513. /*! no static exports found */
  17514. /***/ (function(module, exports, __webpack_require__) {
  17515. "use strict";
  17516. /* -*- Mode: js; js-indent-level: 2; -*- */
  17517. /*
  17518. * Copyright 2011 Mozilla Foundation and contributors
  17519. * Licensed under the New BSD license. See LICENSE or:
  17520. * http://opensource.org/licenses/BSD-3-Clause
  17521. */
  17522. var util = __webpack_require__(/*! ./util */ "./node_modules/snapdragon/node_modules/source-map/lib/util.js");
  17523. var binarySearch = __webpack_require__(/*! ./binary-search */ "./node_modules/snapdragon/node_modules/source-map/lib/binary-search.js");
  17524. var ArraySet = __webpack_require__(/*! ./array-set */ "./node_modules/snapdragon/node_modules/source-map/lib/array-set.js").ArraySet;
  17525. var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/snapdragon/node_modules/source-map/lib/base64-vlq.js");
  17526. var quickSort = __webpack_require__(/*! ./quick-sort */ "./node_modules/snapdragon/node_modules/source-map/lib/quick-sort.js").quickSort;
  17527. function SourceMapConsumer(aSourceMap) {
  17528. var sourceMap = aSourceMap;
  17529. if (typeof aSourceMap === 'string') {
  17530. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  17531. }
  17532. return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap) : new BasicSourceMapConsumer(sourceMap);
  17533. }
  17534. SourceMapConsumer.fromSourceMap = function (aSourceMap) {
  17535. return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
  17536. };
  17537. /**
  17538. * The version of the source mapping spec that we are consuming.
  17539. */
  17540. SourceMapConsumer.prototype._version = 3; // `__generatedMappings` and `__originalMappings` are arrays that hold the
  17541. // parsed mapping coordinates from the source map's "mappings" attribute. They
  17542. // are lazily instantiated, accessed via the `_generatedMappings` and
  17543. // `_originalMappings` getters respectively, and we only parse the mappings
  17544. // and create these arrays once queried for a source location. We jump through
  17545. // these hoops because there can be many thousands of mappings, and parsing
  17546. // them is expensive, so we only want to do it if we must.
  17547. //
  17548. // Each object in the arrays is of the form:
  17549. //
  17550. // {
  17551. // generatedLine: The line number in the generated code,
  17552. // generatedColumn: The column number in the generated code,
  17553. // source: The path to the original source file that generated this
  17554. // chunk of code,
  17555. // originalLine: The line number in the original source that
  17556. // corresponds to this chunk of generated code,
  17557. // originalColumn: The column number in the original source that
  17558. // corresponds to this chunk of generated code,
  17559. // name: The name of the original symbol which generated this chunk of
  17560. // code.
  17561. // }
  17562. //
  17563. // All properties except for `generatedLine` and `generatedColumn` can be
  17564. // `null`.
  17565. //
  17566. // `_generatedMappings` is ordered by the generated positions.
  17567. //
  17568. // `_originalMappings` is ordered by the original positions.
  17569. SourceMapConsumer.prototype.__generatedMappings = null;
  17570. Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  17571. get: function get() {
  17572. if (!this.__generatedMappings) {
  17573. this._parseMappings(this._mappings, this.sourceRoot);
  17574. }
  17575. return this.__generatedMappings;
  17576. }
  17577. });
  17578. SourceMapConsumer.prototype.__originalMappings = null;
  17579. Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  17580. get: function get() {
  17581. if (!this.__originalMappings) {
  17582. this._parseMappings(this._mappings, this.sourceRoot);
  17583. }
  17584. return this.__originalMappings;
  17585. }
  17586. });
  17587. SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  17588. var c = aStr.charAt(index);
  17589. return c === ";" || c === ",";
  17590. };
  17591. /**
  17592. * Parse the mappings in a string in to a data structure which we can easily
  17593. * query (the ordered arrays in the `this.__generatedMappings` and
  17594. * `this.__originalMappings` properties).
  17595. */
  17596. SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  17597. throw new Error("Subclasses must implement _parseMappings");
  17598. };
  17599. SourceMapConsumer.GENERATED_ORDER = 1;
  17600. SourceMapConsumer.ORIGINAL_ORDER = 2;
  17601. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  17602. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  17603. /**
  17604. * Iterate over each mapping between an original source/line/column and a
  17605. * generated line/column in this source map.
  17606. *
  17607. * @param Function aCallback
  17608. * The function that is called with each mapping.
  17609. * @param Object aContext
  17610. * Optional. If specified, this object will be the value of `this` every
  17611. * time that `aCallback` is called.
  17612. * @param aOrder
  17613. * Either `SourceMapConsumer.GENERATED_ORDER` or
  17614. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  17615. * iterate over the mappings sorted by the generated file's line/column
  17616. * order or the original's source/line/column order, respectively. Defaults to
  17617. * `SourceMapConsumer.GENERATED_ORDER`.
  17618. */
  17619. SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  17620. var context = aContext || null;
  17621. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  17622. var mappings;
  17623. switch (order) {
  17624. case SourceMapConsumer.GENERATED_ORDER:
  17625. mappings = this._generatedMappings;
  17626. break;
  17627. case SourceMapConsumer.ORIGINAL_ORDER:
  17628. mappings = this._originalMappings;
  17629. break;
  17630. default:
  17631. throw new Error("Unknown order of iteration.");
  17632. }
  17633. var sourceRoot = this.sourceRoot;
  17634. mappings.map(function (mapping) {
  17635. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  17636. if (source != null && sourceRoot != null) {
  17637. source = util.join(sourceRoot, source);
  17638. }
  17639. return {
  17640. source: source,
  17641. generatedLine: mapping.generatedLine,
  17642. generatedColumn: mapping.generatedColumn,
  17643. originalLine: mapping.originalLine,
  17644. originalColumn: mapping.originalColumn,
  17645. name: mapping.name === null ? null : this._names.at(mapping.name)
  17646. };
  17647. }, this).forEach(aCallback, context);
  17648. };
  17649. /**
  17650. * Returns all generated line and column information for the original source,
  17651. * line, and column provided. If no column is provided, returns all mappings
  17652. * corresponding to a either the line we are searching for or the next
  17653. * closest line that has any mappings. Otherwise, returns all mappings
  17654. * corresponding to the given line and either the column we are searching for
  17655. * or the next closest column that has any offsets.
  17656. *
  17657. * The only argument is an object with the following properties:
  17658. *
  17659. * - source: The filename of the original source.
  17660. * - line: The line number in the original source.
  17661. * - column: Optional. the column number in the original source.
  17662. *
  17663. * and an array of objects is returned, each with the following properties:
  17664. *
  17665. * - line: The line number in the generated source, or null.
  17666. * - column: The column number in the generated source, or null.
  17667. */
  17668. SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  17669. var line = util.getArg(aArgs, 'line'); // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  17670. // returns the index of the closest mapping less than the needle. By
  17671. // setting needle.originalColumn to 0, we thus find the last mapping for
  17672. // the given line, provided such a mapping exists.
  17673. var needle = {
  17674. source: util.getArg(aArgs, 'source'),
  17675. originalLine: line,
  17676. originalColumn: util.getArg(aArgs, 'column', 0)
  17677. };
  17678. if (this.sourceRoot != null) {
  17679. needle.source = util.relative(this.sourceRoot, needle.source);
  17680. }
  17681. if (!this._sources.has(needle.source)) {
  17682. return [];
  17683. }
  17684. needle.source = this._sources.indexOf(needle.source);
  17685. var mappings = [];
  17686. var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
  17687. if (index >= 0) {
  17688. var mapping = this._originalMappings[index];
  17689. if (aArgs.column === undefined) {
  17690. var originalLine = mapping.originalLine; // Iterate until either we run out of mappings, or we run into
  17691. // a mapping for a different line than the one we found. Since
  17692. // mappings are sorted, this is guaranteed to find all mappings for
  17693. // the line we found.
  17694. while (mapping && mapping.originalLine === originalLine) {
  17695. mappings.push({
  17696. line: util.getArg(mapping, 'generatedLine', null),
  17697. column: util.getArg(mapping, 'generatedColumn', null),
  17698. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  17699. });
  17700. mapping = this._originalMappings[++index];
  17701. }
  17702. } else {
  17703. var originalColumn = mapping.originalColumn; // Iterate until either we run out of mappings, or we run into
  17704. // a mapping for a different line than the one we were searching for.
  17705. // Since mappings are sorted, this is guaranteed to find all mappings for
  17706. // the line we are searching for.
  17707. while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
  17708. mappings.push({
  17709. line: util.getArg(mapping, 'generatedLine', null),
  17710. column: util.getArg(mapping, 'generatedColumn', null),
  17711. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  17712. });
  17713. mapping = this._originalMappings[++index];
  17714. }
  17715. }
  17716. }
  17717. return mappings;
  17718. };
  17719. exports.SourceMapConsumer = SourceMapConsumer;
  17720. /**
  17721. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  17722. * query for information about the original file positions by giving it a file
  17723. * position in the generated source.
  17724. *
  17725. * The only parameter is the raw source map (either as a JSON string, or
  17726. * already parsed to an object). According to the spec, source maps have the
  17727. * following attributes:
  17728. *
  17729. * - version: Which version of the source map spec this map is following.
  17730. * - sources: An array of URLs to the original source files.
  17731. * - names: An array of identifiers which can be referrenced by individual mappings.
  17732. * - sourceRoot: Optional. The URL root from which all sources are relative.
  17733. * - sourcesContent: Optional. An array of contents of the original source files.
  17734. * - mappings: A string of base64 VLQs which contain the actual mappings.
  17735. * - file: Optional. The generated file this source map is associated with.
  17736. *
  17737. * Here is an example source map, taken from the source map spec[0]:
  17738. *
  17739. * {
  17740. * version : 3,
  17741. * file: "out.js",
  17742. * sourceRoot : "",
  17743. * sources: ["foo.js", "bar.js"],
  17744. * names: ["src", "maps", "are", "fun"],
  17745. * mappings: "AA,AB;;ABCDE;"
  17746. * }
  17747. *
  17748. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  17749. */
  17750. function BasicSourceMapConsumer(aSourceMap) {
  17751. var sourceMap = aSourceMap;
  17752. if (typeof aSourceMap === 'string') {
  17753. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  17754. }
  17755. var version = util.getArg(sourceMap, 'version');
  17756. var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  17757. // requires the array) to play nice here.
  17758. var names = util.getArg(sourceMap, 'names', []);
  17759. var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  17760. var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  17761. var mappings = util.getArg(sourceMap, 'mappings');
  17762. var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a
  17763. // string rather than a number, so we use loose equality checking here.
  17764. if (version != this._version) {
  17765. throw new Error('Unsupported version: ' + version);
  17766. }
  17767. sources = sources.map(String) // Some source maps produce relative source paths like "./foo.js" instead of
  17768. // "foo.js". Normalize these first so that future comparisons will succeed.
  17769. // See bugzil.la/1090768.
  17770. .map(util.normalize) // Always ensure that absolute sources are internally stored relative to
  17771. // the source root, if the source root is absolute. Not doing this would
  17772. // be particularly problematic when the source root is a prefix of the
  17773. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  17774. .map(function (source) {
  17775. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
  17776. }); // Pass `true` below to allow duplicate names and sources. While source maps
  17777. // are intended to be compressed and deduplicated, the TypeScript compiler
  17778. // sometimes generates source maps with duplicates in them. See Github issue
  17779. // #72 and bugzil.la/889492.
  17780. this._names = ArraySet.fromArray(names.map(String), true);
  17781. this._sources = ArraySet.fromArray(sources, true);
  17782. this.sourceRoot = sourceRoot;
  17783. this.sourcesContent = sourcesContent;
  17784. this._mappings = mappings;
  17785. this.file = file;
  17786. }
  17787. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  17788. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  17789. /**
  17790. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  17791. *
  17792. * @param SourceMapGenerator aSourceMap
  17793. * The source map that will be consumed.
  17794. * @returns BasicSourceMapConsumer
  17795. */
  17796. BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) {
  17797. var smc = Object.create(BasicSourceMapConsumer.prototype);
  17798. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  17799. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  17800. smc.sourceRoot = aSourceMap._sourceRoot;
  17801. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
  17802. smc.file = aSourceMap._file; // Because we are modifying the entries (by converting string sources and
  17803. // names to indices into the sources and names ArraySets), we have to make
  17804. // a copy of the entry or else bad things happen. Shared mutable state
  17805. // strikes again! See github issue #191.
  17806. var generatedMappings = aSourceMap._mappings.toArray().slice();
  17807. var destGeneratedMappings = smc.__generatedMappings = [];
  17808. var destOriginalMappings = smc.__originalMappings = [];
  17809. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  17810. var srcMapping = generatedMappings[i];
  17811. var destMapping = new Mapping();
  17812. destMapping.generatedLine = srcMapping.generatedLine;
  17813. destMapping.generatedColumn = srcMapping.generatedColumn;
  17814. if (srcMapping.source) {
  17815. destMapping.source = sources.indexOf(srcMapping.source);
  17816. destMapping.originalLine = srcMapping.originalLine;
  17817. destMapping.originalColumn = srcMapping.originalColumn;
  17818. if (srcMapping.name) {
  17819. destMapping.name = names.indexOf(srcMapping.name);
  17820. }
  17821. destOriginalMappings.push(destMapping);
  17822. }
  17823. destGeneratedMappings.push(destMapping);
  17824. }
  17825. quickSort(smc.__originalMappings, util.compareByOriginalPositions);
  17826. return smc;
  17827. };
  17828. /**
  17829. * The version of the source mapping spec that we are consuming.
  17830. */
  17831. BasicSourceMapConsumer.prototype._version = 3;
  17832. /**
  17833. * The list of original sources.
  17834. */
  17835. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  17836. get: function get() {
  17837. return this._sources.toArray().map(function (s) {
  17838. return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
  17839. }, this);
  17840. }
  17841. });
  17842. /**
  17843. * Provide the JIT with a nice shape / hidden class.
  17844. */
  17845. function Mapping() {
  17846. this.generatedLine = 0;
  17847. this.generatedColumn = 0;
  17848. this.source = null;
  17849. this.originalLine = null;
  17850. this.originalColumn = null;
  17851. this.name = null;
  17852. }
  17853. /**
  17854. * Parse the mappings in a string in to a data structure which we can easily
  17855. * query (the ordered arrays in the `this.__generatedMappings` and
  17856. * `this.__originalMappings` properties).
  17857. */
  17858. BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  17859. var generatedLine = 1;
  17860. var previousGeneratedColumn = 0;
  17861. var previousOriginalLine = 0;
  17862. var previousOriginalColumn = 0;
  17863. var previousSource = 0;
  17864. var previousName = 0;
  17865. var length = aStr.length;
  17866. var index = 0;
  17867. var cachedSegments = {};
  17868. var temp = {};
  17869. var originalMappings = [];
  17870. var generatedMappings = [];
  17871. var mapping, str, segment, end, value;
  17872. while (index < length) {
  17873. if (aStr.charAt(index) === ';') {
  17874. generatedLine++;
  17875. index++;
  17876. previousGeneratedColumn = 0;
  17877. } else if (aStr.charAt(index) === ',') {
  17878. index++;
  17879. } else {
  17880. mapping = new Mapping();
  17881. mapping.generatedLine = generatedLine; // Because each offset is encoded relative to the previous one,
  17882. // many segments often have the same encoding. We can exploit this
  17883. // fact by caching the parsed variable length fields of each segment,
  17884. // allowing us to avoid a second parse if we encounter the same
  17885. // segment again.
  17886. for (end = index; end < length; end++) {
  17887. if (this._charIsMappingSeparator(aStr, end)) {
  17888. break;
  17889. }
  17890. }
  17891. str = aStr.slice(index, end);
  17892. segment = cachedSegments[str];
  17893. if (segment) {
  17894. index += str.length;
  17895. } else {
  17896. segment = [];
  17897. while (index < end) {
  17898. base64VLQ.decode(aStr, index, temp);
  17899. value = temp.value;
  17900. index = temp.rest;
  17901. segment.push(value);
  17902. }
  17903. if (segment.length === 2) {
  17904. throw new Error('Found a source, but no line and column');
  17905. }
  17906. if (segment.length === 3) {
  17907. throw new Error('Found a source and line, but no column');
  17908. }
  17909. cachedSegments[str] = segment;
  17910. } // Generated column.
  17911. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  17912. previousGeneratedColumn = mapping.generatedColumn;
  17913. if (segment.length > 1) {
  17914. // Original source.
  17915. mapping.source = previousSource + segment[1];
  17916. previousSource += segment[1]; // Original line.
  17917. mapping.originalLine = previousOriginalLine + segment[2];
  17918. previousOriginalLine = mapping.originalLine; // Lines are stored 0-based
  17919. mapping.originalLine += 1; // Original column.
  17920. mapping.originalColumn = previousOriginalColumn + segment[3];
  17921. previousOriginalColumn = mapping.originalColumn;
  17922. if (segment.length > 4) {
  17923. // Original name.
  17924. mapping.name = previousName + segment[4];
  17925. previousName += segment[4];
  17926. }
  17927. }
  17928. generatedMappings.push(mapping);
  17929. if (typeof mapping.originalLine === 'number') {
  17930. originalMappings.push(mapping);
  17931. }
  17932. }
  17933. }
  17934. quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
  17935. this.__generatedMappings = generatedMappings;
  17936. quickSort(originalMappings, util.compareByOriginalPositions);
  17937. this.__originalMappings = originalMappings;
  17938. };
  17939. /**
  17940. * Find the mapping that best matches the hypothetical "needle" mapping that
  17941. * we are searching for in the given "haystack" of mappings.
  17942. */
  17943. BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
  17944. // To return the position we are searching for, we must first find the
  17945. // mapping for the given position and then return the opposite position it
  17946. // points to. Because the mappings are sorted, we can use binary search to
  17947. // find the best mapping.
  17948. if (aNeedle[aLineName] <= 0) {
  17949. throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]);
  17950. }
  17951. if (aNeedle[aColumnName] < 0) {
  17952. throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]);
  17953. }
  17954. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  17955. };
  17956. /**
  17957. * Compute the last column for each generated mapping. The last column is
  17958. * inclusive.
  17959. */
  17960. BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
  17961. for (var index = 0; index < this._generatedMappings.length; ++index) {
  17962. var mapping = this._generatedMappings[index]; // Mappings do not contain a field for the last generated columnt. We
  17963. // can come up with an optimistic estimate, however, by assuming that
  17964. // mappings are contiguous (i.e. given two consecutive mappings, the
  17965. // first mapping ends where the second one starts).
  17966. if (index + 1 < this._generatedMappings.length) {
  17967. var nextMapping = this._generatedMappings[index + 1];
  17968. if (mapping.generatedLine === nextMapping.generatedLine) {
  17969. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  17970. continue;
  17971. }
  17972. } // The last mapping for each line spans the entire line.
  17973. mapping.lastGeneratedColumn = Infinity;
  17974. }
  17975. };
  17976. /**
  17977. * Returns the original source, line, and column information for the generated
  17978. * source's line and column positions provided. The only argument is an object
  17979. * with the following properties:
  17980. *
  17981. * - line: The line number in the generated source.
  17982. * - column: The column number in the generated source.
  17983. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  17984. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  17985. * closest element that is smaller than or greater than the one we are
  17986. * searching for, respectively, if the exact element cannot be found.
  17987. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  17988. *
  17989. * and an object is returned with the following properties:
  17990. *
  17991. * - source: The original source file, or null.
  17992. * - line: The line number in the original source, or null.
  17993. * - column: The column number in the original source, or null.
  17994. * - name: The original identifier, or null.
  17995. */
  17996. BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
  17997. var needle = {
  17998. generatedLine: util.getArg(aArgs, 'line'),
  17999. generatedColumn: util.getArg(aArgs, 'column')
  18000. };
  18001. var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
  18002. if (index >= 0) {
  18003. var mapping = this._generatedMappings[index];
  18004. if (mapping.generatedLine === needle.generatedLine) {
  18005. var source = util.getArg(mapping, 'source', null);
  18006. if (source !== null) {
  18007. source = this._sources.at(source);
  18008. if (this.sourceRoot != null) {
  18009. source = util.join(this.sourceRoot, source);
  18010. }
  18011. }
  18012. var name = util.getArg(mapping, 'name', null);
  18013. if (name !== null) {
  18014. name = this._names.at(name);
  18015. }
  18016. return {
  18017. source: source,
  18018. line: util.getArg(mapping, 'originalLine', null),
  18019. column: util.getArg(mapping, 'originalColumn', null),
  18020. name: name
  18021. };
  18022. }
  18023. }
  18024. return {
  18025. source: null,
  18026. line: null,
  18027. column: null,
  18028. name: null
  18029. };
  18030. };
  18031. /**
  18032. * Return true if we have the source content for every source in the source
  18033. * map, false otherwise.
  18034. */
  18035. BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
  18036. if (!this.sourcesContent) {
  18037. return false;
  18038. }
  18039. return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) {
  18040. return sc == null;
  18041. });
  18042. };
  18043. /**
  18044. * Returns the original source content. The only argument is the url of the
  18045. * original source file. Returns null if no original source content is
  18046. * available.
  18047. */
  18048. BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  18049. if (!this.sourcesContent) {
  18050. return null;
  18051. }
  18052. if (this.sourceRoot != null) {
  18053. aSource = util.relative(this.sourceRoot, aSource);
  18054. }
  18055. if (this._sources.has(aSource)) {
  18056. return this.sourcesContent[this._sources.indexOf(aSource)];
  18057. }
  18058. var url;
  18059. if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
  18060. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  18061. // many users. We can help them out when they expect file:// URIs to
  18062. // behave like it would if they were running a local HTTP server. See
  18063. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  18064. var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
  18065. if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
  18066. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
  18067. }
  18068. if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) {
  18069. return this.sourcesContent[this._sources.indexOf("/" + aSource)];
  18070. }
  18071. } // This function is used recursively from
  18072. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  18073. // don't want to throw if we can't find the source - we just want to
  18074. // return null, so we provide a flag to exit gracefully.
  18075. if (nullOnMissing) {
  18076. return null;
  18077. } else {
  18078. throw new Error('"' + aSource + '" is not in the SourceMap.');
  18079. }
  18080. };
  18081. /**
  18082. * Returns the generated line and column information for the original source,
  18083. * line, and column positions provided. The only argument is an object with
  18084. * the following properties:
  18085. *
  18086. * - source: The filename of the original source.
  18087. * - line: The line number in the original source.
  18088. * - column: The column number in the original source.
  18089. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  18090. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  18091. * closest element that is smaller than or greater than the one we are
  18092. * searching for, respectively, if the exact element cannot be found.
  18093. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  18094. *
  18095. * and an object is returned with the following properties:
  18096. *
  18097. * - line: The line number in the generated source, or null.
  18098. * - column: The column number in the generated source, or null.
  18099. */
  18100. BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
  18101. var source = util.getArg(aArgs, 'source');
  18102. if (this.sourceRoot != null) {
  18103. source = util.relative(this.sourceRoot, source);
  18104. }
  18105. if (!this._sources.has(source)) {
  18106. return {
  18107. line: null,
  18108. column: null,
  18109. lastColumn: null
  18110. };
  18111. }
  18112. source = this._sources.indexOf(source);
  18113. var needle = {
  18114. source: source,
  18115. originalLine: util.getArg(aArgs, 'line'),
  18116. originalColumn: util.getArg(aArgs, 'column')
  18117. };
  18118. var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
  18119. if (index >= 0) {
  18120. var mapping = this._originalMappings[index];
  18121. if (mapping.source === needle.source) {
  18122. return {
  18123. line: util.getArg(mapping, 'generatedLine', null),
  18124. column: util.getArg(mapping, 'generatedColumn', null),
  18125. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  18126. };
  18127. }
  18128. }
  18129. return {
  18130. line: null,
  18131. column: null,
  18132. lastColumn: null
  18133. };
  18134. };
  18135. exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
  18136. /**
  18137. * An IndexedSourceMapConsumer instance represents a parsed source map which
  18138. * we can query for information. It differs from BasicSourceMapConsumer in
  18139. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  18140. * input.
  18141. *
  18142. * The only parameter is a raw source map (either as a JSON string, or already
  18143. * parsed to an object). According to the spec for indexed source maps, they
  18144. * have the following attributes:
  18145. *
  18146. * - version: Which version of the source map spec this map is following.
  18147. * - file: Optional. The generated file this source map is associated with.
  18148. * - sections: A list of section definitions.
  18149. *
  18150. * Each value under the "sections" field has two fields:
  18151. * - offset: The offset into the original specified at which this section
  18152. * begins to apply, defined as an object with a "line" and "column"
  18153. * field.
  18154. * - map: A source map definition. This source map could also be indexed,
  18155. * but doesn't have to be.
  18156. *
  18157. * Instead of the "map" field, it's also possible to have a "url" field
  18158. * specifying a URL to retrieve a source map from, but that's currently
  18159. * unsupported.
  18160. *
  18161. * Here's an example source map, taken from the source map spec[0], but
  18162. * modified to omit a section which uses the "url" field.
  18163. *
  18164. * {
  18165. * version : 3,
  18166. * file: "app.js",
  18167. * sections: [{
  18168. * offset: {line:100, column:10},
  18169. * map: {
  18170. * version : 3,
  18171. * file: "section.js",
  18172. * sources: ["foo.js", "bar.js"],
  18173. * names: ["src", "maps", "are", "fun"],
  18174. * mappings: "AAAA,E;;ABCDE;"
  18175. * }
  18176. * }],
  18177. * }
  18178. *
  18179. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  18180. */
  18181. function IndexedSourceMapConsumer(aSourceMap) {
  18182. var sourceMap = aSourceMap;
  18183. if (typeof aSourceMap === 'string') {
  18184. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  18185. }
  18186. var version = util.getArg(sourceMap, 'version');
  18187. var sections = util.getArg(sourceMap, 'sections');
  18188. if (version != this._version) {
  18189. throw new Error('Unsupported version: ' + version);
  18190. }
  18191. this._sources = new ArraySet();
  18192. this._names = new ArraySet();
  18193. var lastOffset = {
  18194. line: -1,
  18195. column: 0
  18196. };
  18197. this._sections = sections.map(function (s) {
  18198. if (s.url) {
  18199. // The url field will require support for asynchronicity.
  18200. // See https://github.com/mozilla/source-map/issues/16
  18201. throw new Error('Support for url field in sections not implemented.');
  18202. }
  18203. var offset = util.getArg(s, 'offset');
  18204. var offsetLine = util.getArg(offset, 'line');
  18205. var offsetColumn = util.getArg(offset, 'column');
  18206. if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
  18207. throw new Error('Section offsets must be ordered and non-overlapping.');
  18208. }
  18209. lastOffset = offset;
  18210. return {
  18211. generatedOffset: {
  18212. // The offset fields are 0-based, but we use 1-based indices when
  18213. // encoding/decoding from VLQ.
  18214. generatedLine: offsetLine + 1,
  18215. generatedColumn: offsetColumn + 1
  18216. },
  18217. consumer: new SourceMapConsumer(util.getArg(s, 'map'))
  18218. };
  18219. });
  18220. }
  18221. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  18222. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
  18223. /**
  18224. * The version of the source mapping spec that we are consuming.
  18225. */
  18226. IndexedSourceMapConsumer.prototype._version = 3;
  18227. /**
  18228. * The list of original sources.
  18229. */
  18230. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  18231. get: function get() {
  18232. var sources = [];
  18233. for (var i = 0; i < this._sections.length; i++) {
  18234. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  18235. sources.push(this._sections[i].consumer.sources[j]);
  18236. }
  18237. }
  18238. return sources;
  18239. }
  18240. });
  18241. /**
  18242. * Returns the original source, line, and column information for the generated
  18243. * source's line and column positions provided. The only argument is an object
  18244. * with the following properties:
  18245. *
  18246. * - line: The line number in the generated source.
  18247. * - column: The column number in the generated source.
  18248. *
  18249. * and an object is returned with the following properties:
  18250. *
  18251. * - source: The original source file, or null.
  18252. * - line: The line number in the original source, or null.
  18253. * - column: The column number in the original source, or null.
  18254. * - name: The original identifier, or null.
  18255. */
  18256. IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  18257. var needle = {
  18258. generatedLine: util.getArg(aArgs, 'line'),
  18259. generatedColumn: util.getArg(aArgs, 'column')
  18260. }; // Find the section containing the generated position we're trying to map
  18261. // to an original position.
  18262. var sectionIndex = binarySearch.search(needle, this._sections, function (needle, section) {
  18263. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  18264. if (cmp) {
  18265. return cmp;
  18266. }
  18267. return needle.generatedColumn - section.generatedOffset.generatedColumn;
  18268. });
  18269. var section = this._sections[sectionIndex];
  18270. if (!section) {
  18271. return {
  18272. source: null,
  18273. line: null,
  18274. column: null,
  18275. name: null
  18276. };
  18277. }
  18278. return section.consumer.originalPositionFor({
  18279. line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
  18280. column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
  18281. bias: aArgs.bias
  18282. });
  18283. };
  18284. /**
  18285. * Return true if we have the source content for every source in the source
  18286. * map, false otherwise.
  18287. */
  18288. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  18289. return this._sections.every(function (s) {
  18290. return s.consumer.hasContentsOfAllSources();
  18291. });
  18292. };
  18293. /**
  18294. * Returns the original source content. The only argument is the url of the
  18295. * original source file. Returns null if no original source content is
  18296. * available.
  18297. */
  18298. IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  18299. for (var i = 0; i < this._sections.length; i++) {
  18300. var section = this._sections[i];
  18301. var content = section.consumer.sourceContentFor(aSource, true);
  18302. if (content) {
  18303. return content;
  18304. }
  18305. }
  18306. if (nullOnMissing) {
  18307. return null;
  18308. } else {
  18309. throw new Error('"' + aSource + '" is not in the SourceMap.');
  18310. }
  18311. };
  18312. /**
  18313. * Returns the generated line and column information for the original source,
  18314. * line, and column positions provided. The only argument is an object with
  18315. * the following properties:
  18316. *
  18317. * - source: The filename of the original source.
  18318. * - line: The line number in the original source.
  18319. * - column: The column number in the original source.
  18320. *
  18321. * and an object is returned with the following properties:
  18322. *
  18323. * - line: The line number in the generated source, or null.
  18324. * - column: The column number in the generated source, or null.
  18325. */
  18326. IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  18327. for (var i = 0; i < this._sections.length; i++) {
  18328. var section = this._sections[i]; // Only consider this section if the requested source is in the list of
  18329. // sources of the consumer.
  18330. if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
  18331. continue;
  18332. }
  18333. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  18334. if (generatedPosition) {
  18335. var ret = {
  18336. line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
  18337. column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
  18338. };
  18339. return ret;
  18340. }
  18341. }
  18342. return {
  18343. line: null,
  18344. column: null
  18345. };
  18346. };
  18347. /**
  18348. * Parse the mappings in a string in to a data structure which we can easily
  18349. * query (the ordered arrays in the `this.__generatedMappings` and
  18350. * `this.__originalMappings` properties).
  18351. */
  18352. IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  18353. this.__generatedMappings = [];
  18354. this.__originalMappings = [];
  18355. for (var i = 0; i < this._sections.length; i++) {
  18356. var section = this._sections[i];
  18357. var sectionMappings = section.consumer._generatedMappings;
  18358. for (var j = 0; j < sectionMappings.length; j++) {
  18359. var mapping = sectionMappings[j];
  18360. var source = section.consumer._sources.at(mapping.source);
  18361. if (section.consumer.sourceRoot !== null) {
  18362. source = util.join(section.consumer.sourceRoot, source);
  18363. }
  18364. this._sources.add(source);
  18365. source = this._sources.indexOf(source);
  18366. var name = section.consumer._names.at(mapping.name);
  18367. this._names.add(name);
  18368. name = this._names.indexOf(name); // The mappings coming from the consumer for the section have
  18369. // generated positions relative to the start of the section, so we
  18370. // need to offset them to be relative to the start of the concatenated
  18371. // generated file.
  18372. var adjustedMapping = {
  18373. source: source,
  18374. generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
  18375. generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
  18376. originalLine: mapping.originalLine,
  18377. originalColumn: mapping.originalColumn,
  18378. name: name
  18379. };
  18380. this.__generatedMappings.push(adjustedMapping);
  18381. if (typeof adjustedMapping.originalLine === 'number') {
  18382. this.__originalMappings.push(adjustedMapping);
  18383. }
  18384. }
  18385. }
  18386. quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
  18387. quickSort(this.__originalMappings, util.compareByOriginalPositions);
  18388. };
  18389. exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  18390. /***/ }),
  18391. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/source-map-generator.js":
  18392. /*!*************************************************************************************!*\
  18393. !*** ./node_modules/snapdragon/node_modules/source-map/lib/source-map-generator.js ***!
  18394. \*************************************************************************************/
  18395. /*! no static exports found */
  18396. /***/ (function(module, exports, __webpack_require__) {
  18397. "use strict";
  18398. /* -*- Mode: js; js-indent-level: 2; -*- */
  18399. /*
  18400. * Copyright 2011 Mozilla Foundation and contributors
  18401. * Licensed under the New BSD license. See LICENSE or:
  18402. * http://opensource.org/licenses/BSD-3-Clause
  18403. */
  18404. var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/snapdragon/node_modules/source-map/lib/base64-vlq.js");
  18405. var util = __webpack_require__(/*! ./util */ "./node_modules/snapdragon/node_modules/source-map/lib/util.js");
  18406. var ArraySet = __webpack_require__(/*! ./array-set */ "./node_modules/snapdragon/node_modules/source-map/lib/array-set.js").ArraySet;
  18407. var MappingList = __webpack_require__(/*! ./mapping-list */ "./node_modules/snapdragon/node_modules/source-map/lib/mapping-list.js").MappingList;
  18408. /**
  18409. * An instance of the SourceMapGenerator represents a source map which is
  18410. * being built incrementally. You may pass an object with the following
  18411. * properties:
  18412. *
  18413. * - file: The filename of the generated source.
  18414. * - sourceRoot: A root for all relative URLs in this source map.
  18415. */
  18416. function SourceMapGenerator(aArgs) {
  18417. if (!aArgs) {
  18418. aArgs = {};
  18419. }
  18420. this._file = util.getArg(aArgs, 'file', null);
  18421. this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  18422. this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  18423. this._sources = new ArraySet();
  18424. this._names = new ArraySet();
  18425. this._mappings = new MappingList();
  18426. this._sourcesContents = null;
  18427. }
  18428. SourceMapGenerator.prototype._version = 3;
  18429. /**
  18430. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  18431. *
  18432. * @param aSourceMapConsumer The SourceMap.
  18433. */
  18434. SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  18435. var sourceRoot = aSourceMapConsumer.sourceRoot;
  18436. var generator = new SourceMapGenerator({
  18437. file: aSourceMapConsumer.file,
  18438. sourceRoot: sourceRoot
  18439. });
  18440. aSourceMapConsumer.eachMapping(function (mapping) {
  18441. var newMapping = {
  18442. generated: {
  18443. line: mapping.generatedLine,
  18444. column: mapping.generatedColumn
  18445. }
  18446. };
  18447. if (mapping.source != null) {
  18448. newMapping.source = mapping.source;
  18449. if (sourceRoot != null) {
  18450. newMapping.source = util.relative(sourceRoot, newMapping.source);
  18451. }
  18452. newMapping.original = {
  18453. line: mapping.originalLine,
  18454. column: mapping.originalColumn
  18455. };
  18456. if (mapping.name != null) {
  18457. newMapping.name = mapping.name;
  18458. }
  18459. }
  18460. generator.addMapping(newMapping);
  18461. });
  18462. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  18463. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  18464. if (content != null) {
  18465. generator.setSourceContent(sourceFile, content);
  18466. }
  18467. });
  18468. return generator;
  18469. };
  18470. /**
  18471. * Add a single mapping from original source line and column to the generated
  18472. * source's line and column for this source map being created. The mapping
  18473. * object should have the following properties:
  18474. *
  18475. * - generated: An object with the generated line and column positions.
  18476. * - original: An object with the original line and column positions.
  18477. * - source: The original source file (relative to the sourceRoot).
  18478. * - name: An optional original token name for this mapping.
  18479. */
  18480. SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
  18481. var generated = util.getArg(aArgs, 'generated');
  18482. var original = util.getArg(aArgs, 'original', null);
  18483. var source = util.getArg(aArgs, 'source', null);
  18484. var name = util.getArg(aArgs, 'name', null);
  18485. if (!this._skipValidation) {
  18486. this._validateMapping(generated, original, source, name);
  18487. }
  18488. if (source != null) {
  18489. source = String(source);
  18490. if (!this._sources.has(source)) {
  18491. this._sources.add(source);
  18492. }
  18493. }
  18494. if (name != null) {
  18495. name = String(name);
  18496. if (!this._names.has(name)) {
  18497. this._names.add(name);
  18498. }
  18499. }
  18500. this._mappings.add({
  18501. generatedLine: generated.line,
  18502. generatedColumn: generated.column,
  18503. originalLine: original != null && original.line,
  18504. originalColumn: original != null && original.column,
  18505. source: source,
  18506. name: name
  18507. });
  18508. };
  18509. /**
  18510. * Set the source content for a source file.
  18511. */
  18512. SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  18513. var source = aSourceFile;
  18514. if (this._sourceRoot != null) {
  18515. source = util.relative(this._sourceRoot, source);
  18516. }
  18517. if (aSourceContent != null) {
  18518. // Add the source content to the _sourcesContents map.
  18519. // Create a new _sourcesContents map if the property is null.
  18520. if (!this._sourcesContents) {
  18521. this._sourcesContents = Object.create(null);
  18522. }
  18523. this._sourcesContents[util.toSetString(source)] = aSourceContent;
  18524. } else if (this._sourcesContents) {
  18525. // Remove the source file from the _sourcesContents map.
  18526. // If the _sourcesContents map is empty, set the property to null.
  18527. delete this._sourcesContents[util.toSetString(source)];
  18528. if (Object.keys(this._sourcesContents).length === 0) {
  18529. this._sourcesContents = null;
  18530. }
  18531. }
  18532. };
  18533. /**
  18534. * Applies the mappings of a sub-source-map for a specific source file to the
  18535. * source map being generated. Each mapping to the supplied source file is
  18536. * rewritten using the supplied source map. Note: The resolution for the
  18537. * resulting mappings is the minimium of this map and the supplied map.
  18538. *
  18539. * @param aSourceMapConsumer The source map to be applied.
  18540. * @param aSourceFile Optional. The filename of the source file.
  18541. * If omitted, SourceMapConsumer's file property will be used.
  18542. * @param aSourceMapPath Optional. The dirname of the path to the source map
  18543. * to be applied. If relative, it is relative to the SourceMapConsumer.
  18544. * This parameter is needed when the two source maps aren't in the same
  18545. * directory, and the source map to be applied contains relative source
  18546. * paths. If so, those relative source paths need to be rewritten
  18547. * relative to the SourceMapGenerator.
  18548. */
  18549. SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  18550. var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap
  18551. if (aSourceFile == null) {
  18552. if (aSourceMapConsumer.file == null) {
  18553. throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.');
  18554. }
  18555. sourceFile = aSourceMapConsumer.file;
  18556. }
  18557. var sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed.
  18558. if (sourceRoot != null) {
  18559. sourceFile = util.relative(sourceRoot, sourceFile);
  18560. } // Applying the SourceMap can add and remove items from the sources and
  18561. // the names array.
  18562. var newSources = new ArraySet();
  18563. var newNames = new ArraySet(); // Find mappings for the "sourceFile"
  18564. this._mappings.unsortedForEach(function (mapping) {
  18565. if (mapping.source === sourceFile && mapping.originalLine != null) {
  18566. // Check if it can be mapped by the source map, then update the mapping.
  18567. var original = aSourceMapConsumer.originalPositionFor({
  18568. line: mapping.originalLine,
  18569. column: mapping.originalColumn
  18570. });
  18571. if (original.source != null) {
  18572. // Copy mapping
  18573. mapping.source = original.source;
  18574. if (aSourceMapPath != null) {
  18575. mapping.source = util.join(aSourceMapPath, mapping.source);
  18576. }
  18577. if (sourceRoot != null) {
  18578. mapping.source = util.relative(sourceRoot, mapping.source);
  18579. }
  18580. mapping.originalLine = original.line;
  18581. mapping.originalColumn = original.column;
  18582. if (original.name != null) {
  18583. mapping.name = original.name;
  18584. }
  18585. }
  18586. }
  18587. var source = mapping.source;
  18588. if (source != null && !newSources.has(source)) {
  18589. newSources.add(source);
  18590. }
  18591. var name = mapping.name;
  18592. if (name != null && !newNames.has(name)) {
  18593. newNames.add(name);
  18594. }
  18595. }, this);
  18596. this._sources = newSources;
  18597. this._names = newNames; // Copy sourcesContents of applied map.
  18598. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  18599. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  18600. if (content != null) {
  18601. if (aSourceMapPath != null) {
  18602. sourceFile = util.join(aSourceMapPath, sourceFile);
  18603. }
  18604. if (sourceRoot != null) {
  18605. sourceFile = util.relative(sourceRoot, sourceFile);
  18606. }
  18607. this.setSourceContent(sourceFile, content);
  18608. }
  18609. }, this);
  18610. };
  18611. /**
  18612. * A mapping can have one of the three levels of data:
  18613. *
  18614. * 1. Just the generated position.
  18615. * 2. The Generated position, original position, and original source.
  18616. * 3. Generated and original position, original source, as well as a name
  18617. * token.
  18618. *
  18619. * To maintain consistency, we validate that any new mapping being added falls
  18620. * in to one of these categories.
  18621. */
  18622. SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
  18623. // When aOriginal is truthy but has empty values for .line and .column,
  18624. // it is most likely a programmer error. In this case we throw a very
  18625. // specific error message to try to guide them the right way.
  18626. // For example: https://github.com/Polymer/polymer-bundler/pull/519
  18627. if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
  18628. throw new Error('original.line and original.column are not numbers -- you probably meant to omit ' + 'the original mapping entirely and only map the generated position. If so, pass ' + 'null for the original mapping instead of an object with empty or null values.');
  18629. }
  18630. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
  18631. // Case 1.
  18632. return;
  18633. } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
  18634. // Cases 2 and 3.
  18635. return;
  18636. } else {
  18637. throw new Error('Invalid mapping: ' + JSON.stringify({
  18638. generated: aGenerated,
  18639. source: aSource,
  18640. original: aOriginal,
  18641. name: aName
  18642. }));
  18643. }
  18644. };
  18645. /**
  18646. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  18647. * specified by the source map format.
  18648. */
  18649. SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
  18650. var previousGeneratedColumn = 0;
  18651. var previousGeneratedLine = 1;
  18652. var previousOriginalColumn = 0;
  18653. var previousOriginalLine = 0;
  18654. var previousName = 0;
  18655. var previousSource = 0;
  18656. var result = '';
  18657. var next;
  18658. var mapping;
  18659. var nameIdx;
  18660. var sourceIdx;
  18661. var mappings = this._mappings.toArray();
  18662. for (var i = 0, len = mappings.length; i < len; i++) {
  18663. mapping = mappings[i];
  18664. next = '';
  18665. if (mapping.generatedLine !== previousGeneratedLine) {
  18666. previousGeneratedColumn = 0;
  18667. while (mapping.generatedLine !== previousGeneratedLine) {
  18668. next += ';';
  18669. previousGeneratedLine++;
  18670. }
  18671. } else {
  18672. if (i > 0) {
  18673. if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  18674. continue;
  18675. }
  18676. next += ',';
  18677. }
  18678. }
  18679. next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
  18680. previousGeneratedColumn = mapping.generatedColumn;
  18681. if (mapping.source != null) {
  18682. sourceIdx = this._sources.indexOf(mapping.source);
  18683. next += base64VLQ.encode(sourceIdx - previousSource);
  18684. previousSource = sourceIdx; // lines are stored 0-based in SourceMap spec version 3
  18685. next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
  18686. previousOriginalLine = mapping.originalLine - 1;
  18687. next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
  18688. previousOriginalColumn = mapping.originalColumn;
  18689. if (mapping.name != null) {
  18690. nameIdx = this._names.indexOf(mapping.name);
  18691. next += base64VLQ.encode(nameIdx - previousName);
  18692. previousName = nameIdx;
  18693. }
  18694. }
  18695. result += next;
  18696. }
  18697. return result;
  18698. };
  18699. SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  18700. return aSources.map(function (source) {
  18701. if (!this._sourcesContents) {
  18702. return null;
  18703. }
  18704. if (aSourceRoot != null) {
  18705. source = util.relative(aSourceRoot, source);
  18706. }
  18707. var key = util.toSetString(source);
  18708. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
  18709. }, this);
  18710. };
  18711. /**
  18712. * Externalize the source map.
  18713. */
  18714. SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
  18715. var map = {
  18716. version: this._version,
  18717. sources: this._sources.toArray(),
  18718. names: this._names.toArray(),
  18719. mappings: this._serializeMappings()
  18720. };
  18721. if (this._file != null) {
  18722. map.file = this._file;
  18723. }
  18724. if (this._sourceRoot != null) {
  18725. map.sourceRoot = this._sourceRoot;
  18726. }
  18727. if (this._sourcesContents) {
  18728. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  18729. }
  18730. return map;
  18731. };
  18732. /**
  18733. * Render the source map being generated to a string.
  18734. */
  18735. SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
  18736. return JSON.stringify(this.toJSON());
  18737. };
  18738. exports.SourceMapGenerator = SourceMapGenerator;
  18739. /***/ }),
  18740. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/source-node.js":
  18741. /*!****************************************************************************!*\
  18742. !*** ./node_modules/snapdragon/node_modules/source-map/lib/source-node.js ***!
  18743. \****************************************************************************/
  18744. /*! no static exports found */
  18745. /***/ (function(module, exports, __webpack_require__) {
  18746. "use strict";
  18747. /* -*- Mode: js; js-indent-level: 2; -*- */
  18748. /*
  18749. * Copyright 2011 Mozilla Foundation and contributors
  18750. * Licensed under the New BSD license. See LICENSE or:
  18751. * http://opensource.org/licenses/BSD-3-Clause
  18752. */
  18753. var SourceMapGenerator = __webpack_require__(/*! ./source-map-generator */ "./node_modules/snapdragon/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator;
  18754. var util = __webpack_require__(/*! ./util */ "./node_modules/snapdragon/node_modules/source-map/lib/util.js"); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  18755. // operating systems these days (capturing the result).
  18756. var REGEX_NEWLINE = /(\r?\n)/; // Newline character code for charCodeAt() comparisons
  18757. var NEWLINE_CODE = 10; // Private symbol for identifying `SourceNode`s when multiple versions of
  18758. // the source-map library are loaded. This MUST NOT CHANGE across
  18759. // versions!
  18760. var isSourceNode = "$$$isSourceNode$$$";
  18761. /**
  18762. * SourceNodes provide a way to abstract over interpolating/concatenating
  18763. * snippets of generated JavaScript source code while maintaining the line and
  18764. * column information associated with the original source code.
  18765. *
  18766. * @param aLine The original line number.
  18767. * @param aColumn The original column number.
  18768. * @param aSource The original source's filename.
  18769. * @param aChunks Optional. An array of strings which are snippets of
  18770. * generated JS, or other SourceNodes.
  18771. * @param aName The original identifier.
  18772. */
  18773. function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  18774. this.children = [];
  18775. this.sourceContents = {};
  18776. this.line = aLine == null ? null : aLine;
  18777. this.column = aColumn == null ? null : aColumn;
  18778. this.source = aSource == null ? null : aSource;
  18779. this.name = aName == null ? null : aName;
  18780. this[isSourceNode] = true;
  18781. if (aChunks != null) this.add(aChunks);
  18782. }
  18783. /**
  18784. * Creates a SourceNode from generated code and a SourceMapConsumer.
  18785. *
  18786. * @param aGeneratedCode The generated code
  18787. * @param aSourceMapConsumer The SourceMap for the generated code
  18788. * @param aRelativePath Optional. The path that relative sources in the
  18789. * SourceMapConsumer should be relative to.
  18790. */
  18791. SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  18792. // The SourceNode we want to fill with the generated code
  18793. // and the SourceMap
  18794. var node = new SourceNode(); // All even indices of this array are one line of the generated code,
  18795. // while all odd indices are the newlines between two adjacent lines
  18796. // (since `REGEX_NEWLINE` captures its match).
  18797. // Processed fragments are accessed by calling `shiftNextLine`.
  18798. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  18799. var remainingLinesIndex = 0;
  18800. var shiftNextLine = function shiftNextLine() {
  18801. var lineContents = getNextLine(); // The last line of a file might not have a newline.
  18802. var newLine = getNextLine() || "";
  18803. return lineContents + newLine;
  18804. function getNextLine() {
  18805. return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : undefined;
  18806. }
  18807. }; // We need to remember the position of "remainingLines"
  18808. var lastGeneratedLine = 1,
  18809. lastGeneratedColumn = 0; // The generate SourceNodes we need a code range.
  18810. // To extract it current and last mapping is used.
  18811. // Here we store the last mapping.
  18812. var lastMapping = null;
  18813. aSourceMapConsumer.eachMapping(function (mapping) {
  18814. if (lastMapping !== null) {
  18815. // We add the code from "lastMapping" to "mapping":
  18816. // First check if there is a new line in between.
  18817. if (lastGeneratedLine < mapping.generatedLine) {
  18818. // Associate first line with "lastMapping"
  18819. addMappingWithCode(lastMapping, shiftNextLine());
  18820. lastGeneratedLine++;
  18821. lastGeneratedColumn = 0; // The remaining code is added without mapping
  18822. } else {
  18823. // There is no new line in between.
  18824. // Associate the code between "lastGeneratedColumn" and
  18825. // "mapping.generatedColumn" with "lastMapping"
  18826. var nextLine = remainingLines[remainingLinesIndex];
  18827. var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
  18828. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
  18829. lastGeneratedColumn = mapping.generatedColumn;
  18830. addMappingWithCode(lastMapping, code); // No more remaining code, continue
  18831. lastMapping = mapping;
  18832. return;
  18833. }
  18834. } // We add the generated code until the first mapping
  18835. // to the SourceNode without any mapping.
  18836. // Each line is added as separate string.
  18837. while (lastGeneratedLine < mapping.generatedLine) {
  18838. node.add(shiftNextLine());
  18839. lastGeneratedLine++;
  18840. }
  18841. if (lastGeneratedColumn < mapping.generatedColumn) {
  18842. var nextLine = remainingLines[remainingLinesIndex];
  18843. node.add(nextLine.substr(0, mapping.generatedColumn));
  18844. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
  18845. lastGeneratedColumn = mapping.generatedColumn;
  18846. }
  18847. lastMapping = mapping;
  18848. }, this); // We have processed all mappings.
  18849. if (remainingLinesIndex < remainingLines.length) {
  18850. if (lastMapping) {
  18851. // Associate the remaining code in the current line with "lastMapping"
  18852. addMappingWithCode(lastMapping, shiftNextLine());
  18853. } // and add the remaining lines without any mapping
  18854. node.add(remainingLines.splice(remainingLinesIndex).join(""));
  18855. } // Copy sourcesContent into SourceNode
  18856. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  18857. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  18858. if (content != null) {
  18859. if (aRelativePath != null) {
  18860. sourceFile = util.join(aRelativePath, sourceFile);
  18861. }
  18862. node.setSourceContent(sourceFile, content);
  18863. }
  18864. });
  18865. return node;
  18866. function addMappingWithCode(mapping, code) {
  18867. if (mapping === null || mapping.source === undefined) {
  18868. node.add(code);
  18869. } else {
  18870. var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
  18871. node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
  18872. }
  18873. }
  18874. };
  18875. /**
  18876. * Add a chunk of generated JS to this source node.
  18877. *
  18878. * @param aChunk A string snippet of generated JS code, another instance of
  18879. * SourceNode, or an array where each member is one of those things.
  18880. */
  18881. SourceNode.prototype.add = function SourceNode_add(aChunk) {
  18882. if (Array.isArray(aChunk)) {
  18883. aChunk.forEach(function (chunk) {
  18884. this.add(chunk);
  18885. }, this);
  18886. } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  18887. if (aChunk) {
  18888. this.children.push(aChunk);
  18889. }
  18890. } else {
  18891. throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
  18892. }
  18893. return this;
  18894. };
  18895. /**
  18896. * Add a chunk of generated JS to the beginning of this source node.
  18897. *
  18898. * @param aChunk A string snippet of generated JS code, another instance of
  18899. * SourceNode, or an array where each member is one of those things.
  18900. */
  18901. SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  18902. if (Array.isArray(aChunk)) {
  18903. for (var i = aChunk.length - 1; i >= 0; i--) {
  18904. this.prepend(aChunk[i]);
  18905. }
  18906. } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  18907. this.children.unshift(aChunk);
  18908. } else {
  18909. throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
  18910. }
  18911. return this;
  18912. };
  18913. /**
  18914. * Walk over the tree of JS snippets in this node and its children. The
  18915. * walking function is called once for each snippet of JS and is passed that
  18916. * snippet and the its original associated source's line/column location.
  18917. *
  18918. * @param aFn The traversal function.
  18919. */
  18920. SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  18921. var chunk;
  18922. for (var i = 0, len = this.children.length; i < len; i++) {
  18923. chunk = this.children[i];
  18924. if (chunk[isSourceNode]) {
  18925. chunk.walk(aFn);
  18926. } else {
  18927. if (chunk !== '') {
  18928. aFn(chunk, {
  18929. source: this.source,
  18930. line: this.line,
  18931. column: this.column,
  18932. name: this.name
  18933. });
  18934. }
  18935. }
  18936. }
  18937. };
  18938. /**
  18939. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  18940. * each of `this.children`.
  18941. *
  18942. * @param aSep The separator.
  18943. */
  18944. SourceNode.prototype.join = function SourceNode_join(aSep) {
  18945. var newChildren;
  18946. var i;
  18947. var len = this.children.length;
  18948. if (len > 0) {
  18949. newChildren = [];
  18950. for (i = 0; i < len - 1; i++) {
  18951. newChildren.push(this.children[i]);
  18952. newChildren.push(aSep);
  18953. }
  18954. newChildren.push(this.children[i]);
  18955. this.children = newChildren;
  18956. }
  18957. return this;
  18958. };
  18959. /**
  18960. * Call String.prototype.replace on the very right-most source snippet. Useful
  18961. * for trimming whitespace from the end of a source node, etc.
  18962. *
  18963. * @param aPattern The pattern to replace.
  18964. * @param aReplacement The thing to replace the pattern with.
  18965. */
  18966. SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  18967. var lastChild = this.children[this.children.length - 1];
  18968. if (lastChild[isSourceNode]) {
  18969. lastChild.replaceRight(aPattern, aReplacement);
  18970. } else if (typeof lastChild === 'string') {
  18971. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  18972. } else {
  18973. this.children.push(''.replace(aPattern, aReplacement));
  18974. }
  18975. return this;
  18976. };
  18977. /**
  18978. * Set the source content for a source file. This will be added to the SourceMapGenerator
  18979. * in the sourcesContent field.
  18980. *
  18981. * @param aSourceFile The filename of the source file
  18982. * @param aSourceContent The content of the source file
  18983. */
  18984. SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  18985. this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  18986. };
  18987. /**
  18988. * Walk over the tree of SourceNodes. The walking function is called for each
  18989. * source file content and is passed the filename and source content.
  18990. *
  18991. * @param aFn The traversal function.
  18992. */
  18993. SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
  18994. for (var i = 0, len = this.children.length; i < len; i++) {
  18995. if (this.children[i][isSourceNode]) {
  18996. this.children[i].walkSourceContents(aFn);
  18997. }
  18998. }
  18999. var sources = Object.keys(this.sourceContents);
  19000. for (var i = 0, len = sources.length; i < len; i++) {
  19001. aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  19002. }
  19003. };
  19004. /**
  19005. * Return the string representation of this source node. Walks over the tree
  19006. * and concatenates all the various snippets together to one string.
  19007. */
  19008. SourceNode.prototype.toString = function SourceNode_toString() {
  19009. var str = "";
  19010. this.walk(function (chunk) {
  19011. str += chunk;
  19012. });
  19013. return str;
  19014. };
  19015. /**
  19016. * Returns the string representation of this source node along with a source
  19017. * map.
  19018. */
  19019. SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  19020. var generated = {
  19021. code: "",
  19022. line: 1,
  19023. column: 0
  19024. };
  19025. var map = new SourceMapGenerator(aArgs);
  19026. var sourceMappingActive = false;
  19027. var lastOriginalSource = null;
  19028. var lastOriginalLine = null;
  19029. var lastOriginalColumn = null;
  19030. var lastOriginalName = null;
  19031. this.walk(function (chunk, original) {
  19032. generated.code += chunk;
  19033. if (original.source !== null && original.line !== null && original.column !== null) {
  19034. if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
  19035. map.addMapping({
  19036. source: original.source,
  19037. original: {
  19038. line: original.line,
  19039. column: original.column
  19040. },
  19041. generated: {
  19042. line: generated.line,
  19043. column: generated.column
  19044. },
  19045. name: original.name
  19046. });
  19047. }
  19048. lastOriginalSource = original.source;
  19049. lastOriginalLine = original.line;
  19050. lastOriginalColumn = original.column;
  19051. lastOriginalName = original.name;
  19052. sourceMappingActive = true;
  19053. } else if (sourceMappingActive) {
  19054. map.addMapping({
  19055. generated: {
  19056. line: generated.line,
  19057. column: generated.column
  19058. }
  19059. });
  19060. lastOriginalSource = null;
  19061. sourceMappingActive = false;
  19062. }
  19063. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  19064. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  19065. generated.line++;
  19066. generated.column = 0; // Mappings end at eol
  19067. if (idx + 1 === length) {
  19068. lastOriginalSource = null;
  19069. sourceMappingActive = false;
  19070. } else if (sourceMappingActive) {
  19071. map.addMapping({
  19072. source: original.source,
  19073. original: {
  19074. line: original.line,
  19075. column: original.column
  19076. },
  19077. generated: {
  19078. line: generated.line,
  19079. column: generated.column
  19080. },
  19081. name: original.name
  19082. });
  19083. }
  19084. } else {
  19085. generated.column++;
  19086. }
  19087. }
  19088. });
  19089. this.walkSourceContents(function (sourceFile, sourceContent) {
  19090. map.setSourceContent(sourceFile, sourceContent);
  19091. });
  19092. return {
  19093. code: generated.code,
  19094. map: map
  19095. };
  19096. };
  19097. exports.SourceNode = SourceNode;
  19098. /***/ }),
  19099. /***/ "./node_modules/snapdragon/node_modules/source-map/lib/util.js":
  19100. /*!*********************************************************************!*\
  19101. !*** ./node_modules/snapdragon/node_modules/source-map/lib/util.js ***!
  19102. \*********************************************************************/
  19103. /*! no static exports found */
  19104. /***/ (function(module, exports, __webpack_require__) {
  19105. "use strict";
  19106. /* -*- Mode: js; js-indent-level: 2; -*- */
  19107. /*
  19108. * Copyright 2011 Mozilla Foundation and contributors
  19109. * Licensed under the New BSD license. See LICENSE or:
  19110. * http://opensource.org/licenses/BSD-3-Clause
  19111. */
  19112. /**
  19113. * This is a helper function for getting values from parameter/options
  19114. * objects.
  19115. *
  19116. * @param args The object we are extracting values from
  19117. * @param name The name of the property we are getting.
  19118. * @param defaultValue An optional value to return if the property is missing
  19119. * from the object. If this is not specified and the property is missing, an
  19120. * error will be thrown.
  19121. */
  19122. function getArg(aArgs, aName, aDefaultValue) {
  19123. if (aName in aArgs) {
  19124. return aArgs[aName];
  19125. } else if (arguments.length === 3) {
  19126. return aDefaultValue;
  19127. } else {
  19128. throw new Error('"' + aName + '" is a required argument.');
  19129. }
  19130. }
  19131. exports.getArg = getArg;
  19132. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
  19133. var dataUrlRegexp = /^data:.+\,.+$/;
  19134. function urlParse(aUrl) {
  19135. var match = aUrl.match(urlRegexp);
  19136. if (!match) {
  19137. return null;
  19138. }
  19139. return {
  19140. scheme: match[1],
  19141. auth: match[2],
  19142. host: match[3],
  19143. port: match[4],
  19144. path: match[5]
  19145. };
  19146. }
  19147. exports.urlParse = urlParse;
  19148. function urlGenerate(aParsedUrl) {
  19149. var url = '';
  19150. if (aParsedUrl.scheme) {
  19151. url += aParsedUrl.scheme + ':';
  19152. }
  19153. url += '//';
  19154. if (aParsedUrl.auth) {
  19155. url += aParsedUrl.auth + '@';
  19156. }
  19157. if (aParsedUrl.host) {
  19158. url += aParsedUrl.host;
  19159. }
  19160. if (aParsedUrl.port) {
  19161. url += ":" + aParsedUrl.port;
  19162. }
  19163. if (aParsedUrl.path) {
  19164. url += aParsedUrl.path;
  19165. }
  19166. return url;
  19167. }
  19168. exports.urlGenerate = urlGenerate;
  19169. /**
  19170. * Normalizes a path, or the path portion of a URL:
  19171. *
  19172. * - Replaces consecutive slashes with one slash.
  19173. * - Removes unnecessary '.' parts.
  19174. * - Removes unnecessary '<dir>/..' parts.
  19175. *
  19176. * Based on code in the Node.js 'path' core module.
  19177. *
  19178. * @param aPath The path or url to normalize.
  19179. */
  19180. function normalize(aPath) {
  19181. var path = aPath;
  19182. var url = urlParse(aPath);
  19183. if (url) {
  19184. if (!url.path) {
  19185. return aPath;
  19186. }
  19187. path = url.path;
  19188. }
  19189. var isAbsolute = exports.isAbsolute(path);
  19190. var parts = path.split(/\/+/);
  19191. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  19192. part = parts[i];
  19193. if (part === '.') {
  19194. parts.splice(i, 1);
  19195. } else if (part === '..') {
  19196. up++;
  19197. } else if (up > 0) {
  19198. if (part === '') {
  19199. // The first part is blank if the path is absolute. Trying to go
  19200. // above the root is a no-op. Therefore we can remove all '..' parts
  19201. // directly after the root.
  19202. parts.splice(i + 1, up);
  19203. up = 0;
  19204. } else {
  19205. parts.splice(i, 2);
  19206. up--;
  19207. }
  19208. }
  19209. }
  19210. path = parts.join('/');
  19211. if (path === '') {
  19212. path = isAbsolute ? '/' : '.';
  19213. }
  19214. if (url) {
  19215. url.path = path;
  19216. return urlGenerate(url);
  19217. }
  19218. return path;
  19219. }
  19220. exports.normalize = normalize;
  19221. /**
  19222. * Joins two paths/URLs.
  19223. *
  19224. * @param aRoot The root path or URL.
  19225. * @param aPath The path or URL to be joined with the root.
  19226. *
  19227. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  19228. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  19229. * first.
  19230. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  19231. * is updated with the result and aRoot is returned. Otherwise the result
  19232. * is returned.
  19233. * - If aPath is absolute, the result is aPath.
  19234. * - Otherwise the two paths are joined with a slash.
  19235. * - Joining for example 'http://' and 'www.example.com' is also supported.
  19236. */
  19237. function join(aRoot, aPath) {
  19238. if (aRoot === "") {
  19239. aRoot = ".";
  19240. }
  19241. if (aPath === "") {
  19242. aPath = ".";
  19243. }
  19244. var aPathUrl = urlParse(aPath);
  19245. var aRootUrl = urlParse(aRoot);
  19246. if (aRootUrl) {
  19247. aRoot = aRootUrl.path || '/';
  19248. } // `join(foo, '//www.example.org')`
  19249. if (aPathUrl && !aPathUrl.scheme) {
  19250. if (aRootUrl) {
  19251. aPathUrl.scheme = aRootUrl.scheme;
  19252. }
  19253. return urlGenerate(aPathUrl);
  19254. }
  19255. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  19256. return aPath;
  19257. } // `join('http://', 'www.example.com')`
  19258. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  19259. aRootUrl.host = aPath;
  19260. return urlGenerate(aRootUrl);
  19261. }
  19262. var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  19263. if (aRootUrl) {
  19264. aRootUrl.path = joined;
  19265. return urlGenerate(aRootUrl);
  19266. }
  19267. return joined;
  19268. }
  19269. exports.join = join;
  19270. exports.isAbsolute = function (aPath) {
  19271. return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
  19272. };
  19273. /**
  19274. * Make a path relative to a URL or another path.
  19275. *
  19276. * @param aRoot The root path or URL.
  19277. * @param aPath The path or URL to be made relative to aRoot.
  19278. */
  19279. function relative(aRoot, aPath) {
  19280. if (aRoot === "") {
  19281. aRoot = ".";
  19282. }
  19283. aRoot = aRoot.replace(/\/$/, ''); // It is possible for the path to be above the root. In this case, simply
  19284. // checking whether the root is a prefix of the path won't work. Instead, we
  19285. // need to remove components from the root one by one, until either we find
  19286. // a prefix that fits, or we run out of components to remove.
  19287. var level = 0;
  19288. while (aPath.indexOf(aRoot + '/') !== 0) {
  19289. var index = aRoot.lastIndexOf("/");
  19290. if (index < 0) {
  19291. return aPath;
  19292. } // If the only part of the root that is left is the scheme (i.e. http://,
  19293. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  19294. // have exhausted all components, so the path is not relative to the root.
  19295. aRoot = aRoot.slice(0, index);
  19296. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  19297. return aPath;
  19298. }
  19299. ++level;
  19300. } // Make sure we add a "../" for each component we removed from the root.
  19301. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  19302. }
  19303. exports.relative = relative;
  19304. var supportsNullProto = function () {
  19305. var obj = Object.create(null);
  19306. return !('__proto__' in obj);
  19307. }();
  19308. function identity(s) {
  19309. return s;
  19310. }
  19311. /**
  19312. * Because behavior goes wacky when you set `__proto__` on objects, we
  19313. * have to prefix all the strings in our set with an arbitrary character.
  19314. *
  19315. * See https://github.com/mozilla/source-map/pull/31 and
  19316. * https://github.com/mozilla/source-map/issues/30
  19317. *
  19318. * @param String aStr
  19319. */
  19320. function toSetString(aStr) {
  19321. if (isProtoString(aStr)) {
  19322. return '$' + aStr;
  19323. }
  19324. return aStr;
  19325. }
  19326. exports.toSetString = supportsNullProto ? identity : toSetString;
  19327. function fromSetString(aStr) {
  19328. if (isProtoString(aStr)) {
  19329. return aStr.slice(1);
  19330. }
  19331. return aStr;
  19332. }
  19333. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  19334. function isProtoString(s) {
  19335. if (!s) {
  19336. return false;
  19337. }
  19338. var length = s.length;
  19339. if (length < 9
  19340. /* "__proto__".length */
  19341. ) {
  19342. return false;
  19343. }
  19344. if (s.charCodeAt(length - 1) !== 95
  19345. /* '_' */
  19346. || s.charCodeAt(length - 2) !== 95
  19347. /* '_' */
  19348. || s.charCodeAt(length - 3) !== 111
  19349. /* 'o' */
  19350. || s.charCodeAt(length - 4) !== 116
  19351. /* 't' */
  19352. || s.charCodeAt(length - 5) !== 111
  19353. /* 'o' */
  19354. || s.charCodeAt(length - 6) !== 114
  19355. /* 'r' */
  19356. || s.charCodeAt(length - 7) !== 112
  19357. /* 'p' */
  19358. || s.charCodeAt(length - 8) !== 95
  19359. /* '_' */
  19360. || s.charCodeAt(length - 9) !== 95
  19361. /* '_' */
  19362. ) {
  19363. return false;
  19364. }
  19365. for (var i = length - 10; i >= 0; i--) {
  19366. if (s.charCodeAt(i) !== 36
  19367. /* '$' */
  19368. ) {
  19369. return false;
  19370. }
  19371. }
  19372. return true;
  19373. }
  19374. /**
  19375. * Comparator between two mappings where the original positions are compared.
  19376. *
  19377. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  19378. * mappings with the same original source/line/column, but different generated
  19379. * line and column the same. Useful when searching for a mapping with a
  19380. * stubbed out mapping.
  19381. */
  19382. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  19383. var cmp = mappingA.source - mappingB.source;
  19384. if (cmp !== 0) {
  19385. return cmp;
  19386. }
  19387. cmp = mappingA.originalLine - mappingB.originalLine;
  19388. if (cmp !== 0) {
  19389. return cmp;
  19390. }
  19391. cmp = mappingA.originalColumn - mappingB.originalColumn;
  19392. if (cmp !== 0 || onlyCompareOriginal) {
  19393. return cmp;
  19394. }
  19395. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  19396. if (cmp !== 0) {
  19397. return cmp;
  19398. }
  19399. cmp = mappingA.generatedLine - mappingB.generatedLine;
  19400. if (cmp !== 0) {
  19401. return cmp;
  19402. }
  19403. return mappingA.name - mappingB.name;
  19404. }
  19405. exports.compareByOriginalPositions = compareByOriginalPositions;
  19406. /**
  19407. * Comparator between two mappings with deflated source and name indices where
  19408. * the generated positions are compared.
  19409. *
  19410. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  19411. * mappings with the same generated line and column, but different
  19412. * source/name/original line and column the same. Useful when searching for a
  19413. * mapping with a stubbed out mapping.
  19414. */
  19415. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  19416. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  19417. if (cmp !== 0) {
  19418. return cmp;
  19419. }
  19420. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  19421. if (cmp !== 0 || onlyCompareGenerated) {
  19422. return cmp;
  19423. }
  19424. cmp = mappingA.source - mappingB.source;
  19425. if (cmp !== 0) {
  19426. return cmp;
  19427. }
  19428. cmp = mappingA.originalLine - mappingB.originalLine;
  19429. if (cmp !== 0) {
  19430. return cmp;
  19431. }
  19432. cmp = mappingA.originalColumn - mappingB.originalColumn;
  19433. if (cmp !== 0) {
  19434. return cmp;
  19435. }
  19436. return mappingA.name - mappingB.name;
  19437. }
  19438. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  19439. function strcmp(aStr1, aStr2) {
  19440. if (aStr1 === aStr2) {
  19441. return 0;
  19442. }
  19443. if (aStr1 > aStr2) {
  19444. return 1;
  19445. }
  19446. return -1;
  19447. }
  19448. /**
  19449. * Comparator between two mappings with inflated source and name strings where
  19450. * the generated positions are compared.
  19451. */
  19452. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  19453. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  19454. if (cmp !== 0) {
  19455. return cmp;
  19456. }
  19457. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  19458. if (cmp !== 0) {
  19459. return cmp;
  19460. }
  19461. cmp = strcmp(mappingA.source, mappingB.source);
  19462. if (cmp !== 0) {
  19463. return cmp;
  19464. }
  19465. cmp = mappingA.originalLine - mappingB.originalLine;
  19466. if (cmp !== 0) {
  19467. return cmp;
  19468. }
  19469. cmp = mappingA.originalColumn - mappingB.originalColumn;
  19470. if (cmp !== 0) {
  19471. return cmp;
  19472. }
  19473. return strcmp(mappingA.name, mappingB.name);
  19474. }
  19475. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  19476. /***/ }),
  19477. /***/ "./node_modules/snapdragon/node_modules/source-map/source-map.js":
  19478. /*!***********************************************************************!*\
  19479. !*** ./node_modules/snapdragon/node_modules/source-map/source-map.js ***!
  19480. \***********************************************************************/
  19481. /*! no static exports found */
  19482. /***/ (function(module, exports, __webpack_require__) {
  19483. "use strict";
  19484. /*
  19485. * Copyright 2009-2011 Mozilla Foundation and contributors
  19486. * Licensed under the New BSD license. See LICENSE.txt or:
  19487. * http://opensource.org/licenses/BSD-3-Clause
  19488. */
  19489. exports.SourceMapGenerator = __webpack_require__(/*! ./lib/source-map-generator */ "./node_modules/snapdragon/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator;
  19490. exports.SourceMapConsumer = __webpack_require__(/*! ./lib/source-map-consumer */ "./node_modules/snapdragon/node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer;
  19491. exports.SourceNode = __webpack_require__(/*! ./lib/source-node */ "./node_modules/snapdragon/node_modules/source-map/lib/source-node.js").SourceNode;
  19492. /***/ }),
  19493. /***/ "./node_modules/source-map-resolve/source-map-resolve.js":
  19494. /*!***************************************************************!*\
  19495. !*** ./node_modules/source-map-resolve/source-map-resolve.js ***!
  19496. \***************************************************************/
  19497. /*! no static exports found */
  19498. /***/ (function(module, exports, __webpack_require__) {
  19499. "use strict";
  19500. /* WEBPACK VAR INJECTION */(function(setImmediate) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  19501. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  19502. // Copyright 2014, 2015, 2016, 2017 Simon Lydell
  19503. // X11 (“MIT”) Licensed. (See LICENSE.)
  19504. // Note: source-map-resolve.js is generated from source-map-resolve-node.js and
  19505. // source-map-resolve-template.js. Only edit the two latter files, _not_
  19506. // source-map-resolve.js!
  19507. void function (root, factory) {
  19508. if (true) {
  19509. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! source-map-url */ "./node_modules/source-map-url/source-map-url.js"), __webpack_require__(/*! resolve-url */ "./node_modules/resolve-url/resolve-url.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  19510. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  19511. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  19512. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  19513. } else { var resolveUrl, sourceMappingURL; }
  19514. }(void 0, function (sourceMappingURL, resolveUrl) {
  19515. function callbackAsync(callback, error, result) {
  19516. setImmediate(function () {
  19517. callback(error, result);
  19518. });
  19519. }
  19520. function parseMapToJSON(string, data) {
  19521. try {
  19522. return JSON.parse(string.replace(/^\)\]\}'/, ""));
  19523. } catch (error) {
  19524. error.sourceMapData = data;
  19525. throw error;
  19526. }
  19527. }
  19528. function readSync(read, url, data) {
  19529. var readUrl = url;
  19530. try {
  19531. return String(read(readUrl));
  19532. } catch (error) {
  19533. error.sourceMapData = data;
  19534. throw error;
  19535. }
  19536. }
  19537. function resolveSourceMap(code, codeUrl, read, callback) {
  19538. var mapData;
  19539. try {
  19540. mapData = resolveSourceMapHelper(code, codeUrl);
  19541. } catch (error) {
  19542. return callbackAsync(callback, error);
  19543. }
  19544. if (!mapData || mapData.map) {
  19545. return callbackAsync(callback, null, mapData);
  19546. }
  19547. var readUrl = mapData.url;
  19548. read(readUrl, function (error, result) {
  19549. if (error) {
  19550. error.sourceMapData = mapData;
  19551. return callback(error);
  19552. }
  19553. mapData.map = String(result);
  19554. try {
  19555. mapData.map = parseMapToJSON(mapData.map, mapData);
  19556. } catch (error) {
  19557. return callback(error);
  19558. }
  19559. callback(null, mapData);
  19560. });
  19561. }
  19562. function resolveSourceMapSync(code, codeUrl, read) {
  19563. var mapData = resolveSourceMapHelper(code, codeUrl);
  19564. if (!mapData || mapData.map) {
  19565. return mapData;
  19566. }
  19567. mapData.map = readSync(read, mapData.url, mapData);
  19568. mapData.map = parseMapToJSON(mapData.map, mapData);
  19569. return mapData;
  19570. }
  19571. var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/;
  19572. var jsonMimeTypeRegex = /^(?:application|text)\/json$/;
  19573. function resolveSourceMapHelper(code, codeUrl) {
  19574. var url = sourceMappingURL.getFrom(code);
  19575. if (!url) {
  19576. return null;
  19577. }
  19578. var dataUri = url.match(dataUriRegex);
  19579. if (dataUri) {
  19580. var mimeType = dataUri[1];
  19581. var lastParameter = dataUri[2] || "";
  19582. var encoded = dataUri[3] || "";
  19583. var data = {
  19584. sourceMappingURL: url,
  19585. url: null,
  19586. sourcesRelativeTo: codeUrl,
  19587. map: encoded
  19588. };
  19589. if (!jsonMimeTypeRegex.test(mimeType)) {
  19590. var error = new Error("Unuseful data uri mime type: " + (mimeType || "text/plain"));
  19591. error.sourceMapData = data;
  19592. throw error;
  19593. }
  19594. data.map = parseMapToJSON(lastParameter === ";base64" ? atob(encoded) : decodeURIComponent(encoded), data);
  19595. return data;
  19596. }
  19597. var mapUrl = resolveUrl(codeUrl, url);
  19598. return {
  19599. sourceMappingURL: url,
  19600. url: mapUrl,
  19601. sourcesRelativeTo: mapUrl,
  19602. map: null
  19603. };
  19604. }
  19605. function resolveSources(map, mapUrl, read, options, callback) {
  19606. if (typeof options === "function") {
  19607. callback = options;
  19608. options = {};
  19609. }
  19610. var pending = map.sources ? map.sources.length : 0;
  19611. var result = {
  19612. sourcesResolved: [],
  19613. sourcesContent: []
  19614. };
  19615. if (pending === 0) {
  19616. callbackAsync(callback, null, result);
  19617. return;
  19618. }
  19619. var done = function done() {
  19620. pending--;
  19621. if (pending === 0) {
  19622. callback(null, result);
  19623. }
  19624. };
  19625. resolveSourcesHelper(map, mapUrl, options, function (fullUrl, sourceContent, index) {
  19626. result.sourcesResolved[index] = fullUrl;
  19627. if (typeof sourceContent === "string") {
  19628. result.sourcesContent[index] = sourceContent;
  19629. callbackAsync(done, null);
  19630. } else {
  19631. var readUrl = fullUrl;
  19632. read(readUrl, function (error, source) {
  19633. result.sourcesContent[index] = error ? error : String(source);
  19634. done();
  19635. });
  19636. }
  19637. });
  19638. }
  19639. function resolveSourcesSync(map, mapUrl, read, options) {
  19640. var result = {
  19641. sourcesResolved: [],
  19642. sourcesContent: []
  19643. };
  19644. if (!map.sources || map.sources.length === 0) {
  19645. return result;
  19646. }
  19647. resolveSourcesHelper(map, mapUrl, options, function (fullUrl, sourceContent, index) {
  19648. result.sourcesResolved[index] = fullUrl;
  19649. if (read !== null) {
  19650. if (typeof sourceContent === "string") {
  19651. result.sourcesContent[index] = sourceContent;
  19652. } else {
  19653. var readUrl = fullUrl;
  19654. try {
  19655. result.sourcesContent[index] = String(read(readUrl));
  19656. } catch (error) {
  19657. result.sourcesContent[index] = error;
  19658. }
  19659. }
  19660. }
  19661. });
  19662. return result;
  19663. }
  19664. var endingSlash = /\/?$/;
  19665. function resolveSourcesHelper(map, mapUrl, options, fn) {
  19666. options = options || {};
  19667. var fullUrl;
  19668. var sourceContent;
  19669. var sourceRoot;
  19670. for (var index = 0, len = map.sources.length; index < len; index++) {
  19671. sourceRoot = null;
  19672. if (typeof options.sourceRoot === "string") {
  19673. sourceRoot = options.sourceRoot;
  19674. } else if (typeof map.sourceRoot === "string" && options.sourceRoot !== false) {
  19675. sourceRoot = map.sourceRoot;
  19676. } // If the sourceRoot is the empty string, it is equivalent to not setting
  19677. // the property at all.
  19678. if (sourceRoot === null || sourceRoot === '') {
  19679. fullUrl = resolveUrl(mapUrl, map.sources[index]);
  19680. } else {
  19681. // Make sure that the sourceRoot ends with a slash, so that `/scripts/subdir` becomes
  19682. // `/scripts/subdir/<source>`, not `/scripts/<source>`. Pointing to a file as source root
  19683. // does not make sense.
  19684. fullUrl = resolveUrl(mapUrl, sourceRoot.replace(endingSlash, "/"), map.sources[index]);
  19685. }
  19686. sourceContent = (map.sourcesContent || [])[index];
  19687. fn(fullUrl, sourceContent, index);
  19688. }
  19689. }
  19690. function resolve(code, codeUrl, read, options, callback) {
  19691. if (typeof options === "function") {
  19692. callback = options;
  19693. options = {};
  19694. }
  19695. if (code === null) {
  19696. var mapUrl = codeUrl;
  19697. var data = {
  19698. sourceMappingURL: null,
  19699. url: mapUrl,
  19700. sourcesRelativeTo: mapUrl,
  19701. map: null
  19702. };
  19703. var readUrl = mapUrl;
  19704. read(readUrl, function (error, result) {
  19705. if (error) {
  19706. error.sourceMapData = data;
  19707. return callback(error);
  19708. }
  19709. data.map = String(result);
  19710. try {
  19711. data.map = parseMapToJSON(data.map, data);
  19712. } catch (error) {
  19713. return callback(error);
  19714. }
  19715. _resolveSources(data);
  19716. });
  19717. } else {
  19718. resolveSourceMap(code, codeUrl, read, function (error, mapData) {
  19719. if (error) {
  19720. return callback(error);
  19721. }
  19722. if (!mapData) {
  19723. return callback(null, null);
  19724. }
  19725. _resolveSources(mapData);
  19726. });
  19727. }
  19728. function _resolveSources(mapData) {
  19729. resolveSources(mapData.map, mapData.sourcesRelativeTo, read, options, function (error, result) {
  19730. if (error) {
  19731. return callback(error);
  19732. }
  19733. mapData.sourcesResolved = result.sourcesResolved;
  19734. mapData.sourcesContent = result.sourcesContent;
  19735. callback(null, mapData);
  19736. });
  19737. }
  19738. }
  19739. function resolveSync(code, codeUrl, read, options) {
  19740. var mapData;
  19741. if (code === null) {
  19742. var mapUrl = codeUrl;
  19743. mapData = {
  19744. sourceMappingURL: null,
  19745. url: mapUrl,
  19746. sourcesRelativeTo: mapUrl,
  19747. map: null
  19748. };
  19749. mapData.map = readSync(read, mapUrl, mapData);
  19750. mapData.map = parseMapToJSON(mapData.map, mapData);
  19751. } else {
  19752. mapData = resolveSourceMapSync(code, codeUrl, read);
  19753. if (!mapData) {
  19754. return null;
  19755. }
  19756. }
  19757. var result = resolveSourcesSync(mapData.map, mapData.sourcesRelativeTo, read, options);
  19758. mapData.sourcesResolved = result.sourcesResolved;
  19759. mapData.sourcesContent = result.sourcesContent;
  19760. return mapData;
  19761. }
  19762. return {
  19763. resolveSourceMap: resolveSourceMap,
  19764. resolveSourceMapSync: resolveSourceMapSync,
  19765. resolveSources: resolveSources,
  19766. resolveSourcesSync: resolveSourcesSync,
  19767. resolve: resolve,
  19768. resolveSync: resolveSync,
  19769. parseMapToJSON: parseMapToJSON
  19770. };
  19771. });
  19772. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate))
  19773. /***/ }),
  19774. /***/ "./node_modules/source-map-url/source-map-url.js":
  19775. /*!*******************************************************!*\
  19776. !*** ./node_modules/source-map-url/source-map-url.js ***!
  19777. \*******************************************************/
  19778. /*! no static exports found */
  19779. /***/ (function(module, exports, __webpack_require__) {
  19780. "use strict";
  19781. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
  19782. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  19783. // Copyright 2014 Simon Lydell
  19784. // X11 (“MIT”) Licensed. (See LICENSE.)
  19785. void function (root, factory) {
  19786. if (true) {
  19787. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  19788. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  19789. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  19790. __WEBPACK_AMD_DEFINE_FACTORY__),
  19791. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  19792. } else {}
  19793. }(void 0, function () {
  19794. var innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/;
  19795. var regex = RegExp("(?:" + "/\\*" + "(?:\\s*\r?\n(?://)?)?" + "(?:" + innerRegex.source + ")" + "\\s*" + "\\*/" + "|" + "//(?:" + innerRegex.source + ")" + ")" + "\\s*");
  19796. return {
  19797. regex: regex,
  19798. _innerRegex: innerRegex,
  19799. getFrom: function getFrom(code) {
  19800. var match = code.match(regex);
  19801. return match ? match[1] || match[2] || "" : null;
  19802. },
  19803. existsIn: function existsIn(code) {
  19804. return regex.test(code);
  19805. },
  19806. removeFrom: function removeFrom(code) {
  19807. return code.replace(regex, "");
  19808. },
  19809. insertBefore: function insertBefore(code, string) {
  19810. var match = code.match(regex);
  19811. if (match) {
  19812. return code.slice(0, match.index) + string + code.slice(match.index);
  19813. } else {
  19814. return code + string;
  19815. }
  19816. }
  19817. };
  19818. });
  19819. /***/ }),
  19820. /***/ "./node_modules/split-string/index.js":
  19821. /*!********************************************!*\
  19822. !*** ./node_modules/split-string/index.js ***!
  19823. \********************************************/
  19824. /*! no static exports found */
  19825. /***/ (function(module, exports, __webpack_require__) {
  19826. "use strict";
  19827. /*!
  19828. * split-string <https://github.com/jonschlinkert/split-string>
  19829. *
  19830. * Copyright (c) 2015-2017, Jon Schlinkert.
  19831. * Released under the MIT License.
  19832. */
  19833. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/split-string/node_modules/extend-shallow/index.js");
  19834. module.exports = function (str, options, fn) {
  19835. if (typeof str !== 'string') {
  19836. throw new TypeError('expected a string');
  19837. }
  19838. if (typeof options === 'function') {
  19839. fn = options;
  19840. options = null;
  19841. } // allow separator to be defined as a string
  19842. if (typeof options === 'string') {
  19843. options = {
  19844. sep: options
  19845. };
  19846. }
  19847. var opts = extend({
  19848. sep: '.'
  19849. }, options);
  19850. var quotes = opts.quotes || ['"', "'", '`'];
  19851. var brackets;
  19852. if (opts.brackets === true) {
  19853. brackets = {
  19854. '<': '>',
  19855. '(': ')',
  19856. '[': ']',
  19857. '{': '}'
  19858. };
  19859. } else if (opts.brackets) {
  19860. brackets = opts.brackets;
  19861. }
  19862. var tokens = [];
  19863. var stack = [];
  19864. var arr = [''];
  19865. var sep = opts.sep;
  19866. var len = str.length;
  19867. var idx = -1;
  19868. var closeIdx;
  19869. function expected() {
  19870. if (brackets && stack.length) {
  19871. return brackets[stack[stack.length - 1]];
  19872. }
  19873. }
  19874. while (++idx < len) {
  19875. var ch = str[idx];
  19876. var next = str[idx + 1];
  19877. var tok = {
  19878. val: ch,
  19879. idx: idx,
  19880. arr: arr,
  19881. str: str
  19882. };
  19883. tokens.push(tok);
  19884. if (ch === '\\') {
  19885. tok.val = keepEscaping(opts, str, idx) === true ? ch + next : next;
  19886. tok.escaped = true;
  19887. if (typeof fn === 'function') {
  19888. fn(tok);
  19889. }
  19890. arr[arr.length - 1] += tok.val;
  19891. idx++;
  19892. continue;
  19893. }
  19894. if (brackets && brackets[ch]) {
  19895. stack.push(ch);
  19896. var e = expected();
  19897. var i = idx + 1;
  19898. if (str.indexOf(e, i + 1) !== -1) {
  19899. while (stack.length && i < len) {
  19900. var s = str[++i];
  19901. if (s === '\\') {
  19902. s++;
  19903. continue;
  19904. }
  19905. if (quotes.indexOf(s) !== -1) {
  19906. i = getClosingQuote(str, s, i + 1);
  19907. continue;
  19908. }
  19909. e = expected();
  19910. if (stack.length && str.indexOf(e, i + 1) === -1) {
  19911. break;
  19912. }
  19913. if (brackets[s]) {
  19914. stack.push(s);
  19915. continue;
  19916. }
  19917. if (e === s) {
  19918. stack.pop();
  19919. }
  19920. }
  19921. }
  19922. closeIdx = i;
  19923. if (closeIdx === -1) {
  19924. arr[arr.length - 1] += ch;
  19925. continue;
  19926. }
  19927. ch = str.slice(idx, closeIdx + 1);
  19928. tok.val = ch;
  19929. tok.idx = idx = closeIdx;
  19930. }
  19931. if (quotes.indexOf(ch) !== -1) {
  19932. closeIdx = getClosingQuote(str, ch, idx + 1);
  19933. if (closeIdx === -1) {
  19934. arr[arr.length - 1] += ch;
  19935. continue;
  19936. }
  19937. if (keepQuotes(ch, opts) === true) {
  19938. ch = str.slice(idx, closeIdx + 1);
  19939. } else {
  19940. ch = str.slice(idx + 1, closeIdx);
  19941. }
  19942. tok.val = ch;
  19943. tok.idx = idx = closeIdx;
  19944. }
  19945. if (typeof fn === 'function') {
  19946. fn(tok, tokens);
  19947. ch = tok.val;
  19948. idx = tok.idx;
  19949. }
  19950. if (tok.val === sep && tok.split !== false) {
  19951. arr.push('');
  19952. continue;
  19953. }
  19954. arr[arr.length - 1] += tok.val;
  19955. }
  19956. return arr;
  19957. };
  19958. function getClosingQuote(str, ch, i, brackets) {
  19959. var idx = str.indexOf(ch, i);
  19960. if (str.charAt(idx - 1) === '\\') {
  19961. return getClosingQuote(str, ch, idx + 1);
  19962. }
  19963. return idx;
  19964. }
  19965. function keepQuotes(ch, opts) {
  19966. if (opts.keepDoubleQuotes === true && ch === '"') return true;
  19967. if (opts.keepSingleQuotes === true && ch === "'") return true;
  19968. return opts.keepQuotes;
  19969. }
  19970. function keepEscaping(opts, str, idx) {
  19971. if (typeof opts.keepEscaping === 'function') {
  19972. return opts.keepEscaping(str, idx);
  19973. }
  19974. return opts.keepEscaping === true || str[idx + 1] === '\\';
  19975. }
  19976. /***/ }),
  19977. /***/ "./node_modules/split-string/node_modules/extend-shallow/index.js":
  19978. /*!************************************************************************!*\
  19979. !*** ./node_modules/split-string/node_modules/extend-shallow/index.js ***!
  19980. \************************************************************************/
  19981. /*! no static exports found */
  19982. /***/ (function(module, exports, __webpack_require__) {
  19983. "use strict";
  19984. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  19985. var isExtendable = __webpack_require__(/*! is-extendable */ "./node_modules/split-string/node_modules/is-extendable/index.js");
  19986. var assignSymbols = __webpack_require__(/*! assign-symbols */ "./node_modules/assign-symbols/index.js");
  19987. module.exports = Object.assign || function (obj
  19988. /*, objects*/
  19989. ) {
  19990. if (obj === null || typeof obj === 'undefined') {
  19991. throw new TypeError('Cannot convert undefined or null to object');
  19992. }
  19993. if (!isObject(obj)) {
  19994. obj = {};
  19995. }
  19996. for (var i = 1; i < arguments.length; i++) {
  19997. var val = arguments[i];
  19998. if (isString(val)) {
  19999. val = toObject(val);
  20000. }
  20001. if (isObject(val)) {
  20002. assign(obj, val);
  20003. assignSymbols(obj, val);
  20004. }
  20005. }
  20006. return obj;
  20007. };
  20008. function assign(a, b) {
  20009. for (var key in b) {
  20010. if (hasOwn(b, key)) {
  20011. a[key] = b[key];
  20012. }
  20013. }
  20014. }
  20015. function isString(val) {
  20016. return val && typeof val === 'string';
  20017. }
  20018. function toObject(str) {
  20019. var obj = {};
  20020. for (var i in str) {
  20021. obj[i] = str[i];
  20022. }
  20023. return obj;
  20024. }
  20025. function isObject(val) {
  20026. return val && _typeof(val) === 'object' || isExtendable(val);
  20027. }
  20028. /**
  20029. * Returns true if the given `key` is an own property of `obj`.
  20030. */
  20031. function hasOwn(obj, key) {
  20032. return Object.prototype.hasOwnProperty.call(obj, key);
  20033. }
  20034. function isEnum(obj, key) {
  20035. return Object.prototype.propertyIsEnumerable.call(obj, key);
  20036. }
  20037. /***/ }),
  20038. /***/ "./node_modules/split-string/node_modules/is-extendable/index.js":
  20039. /*!***********************************************************************!*\
  20040. !*** ./node_modules/split-string/node_modules/is-extendable/index.js ***!
  20041. \***********************************************************************/
  20042. /*! no static exports found */
  20043. /***/ (function(module, exports, __webpack_require__) {
  20044. "use strict";
  20045. /*!
  20046. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  20047. *
  20048. * Copyright (c) 2015-2017, Jon Schlinkert.
  20049. * Released under the MIT License.
  20050. */
  20051. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  20052. module.exports = function isExtendable(val) {
  20053. return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
  20054. };
  20055. /***/ }),
  20056. /***/ "./node_modules/stack-utils/index.js":
  20057. /*!*******************************************!*\
  20058. !*** ./node_modules/stack-utils/index.js ***!
  20059. \*******************************************/
  20060. /*! no static exports found */
  20061. /***/ (function(module, exports, __webpack_require__) {
  20062. "use strict";
  20063. /* WEBPACK VAR INJECTION */(function(process) {
  20064. module.exports = StackUtils;
  20065. function StackUtils(opts) {
  20066. if (!(this instanceof StackUtils)) {
  20067. throw new Error('StackUtils constructor must be called with new');
  20068. }
  20069. opts = opts || {};
  20070. this._cwd = (opts.cwd || process.cwd()).replace(/\\/g, '/');
  20071. this._internals = opts.internals || [];
  20072. this._wrapCallSite = opts.wrapCallSite || false;
  20073. }
  20074. module.exports.nodeInternals = nodeInternals;
  20075. function nodeInternals() {
  20076. if (!module.exports.natives) {
  20077. module.exports.natives = Object.keys(process.binding('natives'));
  20078. module.exports.natives.push('bootstrap_node', 'node', 'internal/bootstrap/node');
  20079. }
  20080. return module.exports.natives.map(function (n) {
  20081. return new RegExp('\\(' + n + '\\.js:\\d+:\\d+\\)$');
  20082. }).concat([/\s*at (bootstrap_)?node\.js:\d+:\d+?$/, /\(internal\/[^:]+:\d+:\d+\)$/, /\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/]);
  20083. }
  20084. StackUtils.prototype.clean = function (stack) {
  20085. if (!Array.isArray(stack)) {
  20086. stack = stack.split('\n');
  20087. }
  20088. if (!/^\s*at /.test(stack[0]) && /^\s*at /.test(stack[1])) {
  20089. stack = stack.slice(1);
  20090. }
  20091. var outdent = false;
  20092. var lastNonAtLine = null;
  20093. var result = [];
  20094. stack.forEach(function (st) {
  20095. st = st.replace(/\\/g, '/');
  20096. var isInternal = this._internals.some(function (internal) {
  20097. return internal.test(st);
  20098. });
  20099. if (isInternal) {
  20100. return null;
  20101. }
  20102. var isAtLine = /^\s*at /.test(st);
  20103. if (outdent) {
  20104. st = st.replace(/\s+$/, '').replace(/^(\s+)at /, '$1');
  20105. } else {
  20106. st = st.trim();
  20107. if (isAtLine) {
  20108. st = st.substring(3);
  20109. }
  20110. }
  20111. st = st.replace(this._cwd + '/', '');
  20112. if (st) {
  20113. if (isAtLine) {
  20114. if (lastNonAtLine) {
  20115. result.push(lastNonAtLine);
  20116. lastNonAtLine = null;
  20117. }
  20118. result.push(st);
  20119. } else {
  20120. outdent = true;
  20121. lastNonAtLine = st;
  20122. }
  20123. }
  20124. }, this);
  20125. stack = result.join('\n').trim();
  20126. if (stack) {
  20127. return stack + '\n';
  20128. }
  20129. return '';
  20130. };
  20131. StackUtils.prototype.captureString = function (limit, fn) {
  20132. if (typeof limit === 'function') {
  20133. fn = limit;
  20134. limit = Infinity;
  20135. }
  20136. if (!fn) {
  20137. fn = this.captureString;
  20138. }
  20139. var limitBefore = Error.stackTraceLimit;
  20140. if (limit) {
  20141. Error.stackTraceLimit = limit;
  20142. }
  20143. var obj = {};
  20144. Error.captureStackTrace(obj, fn);
  20145. var stack = obj.stack;
  20146. Error.stackTraceLimit = limitBefore;
  20147. return this.clean(stack);
  20148. };
  20149. StackUtils.prototype.capture = function (limit, fn) {
  20150. if (typeof limit === 'function') {
  20151. fn = limit;
  20152. limit = Infinity;
  20153. }
  20154. if (!fn) {
  20155. fn = this.capture;
  20156. }
  20157. var prepBefore = Error.prepareStackTrace;
  20158. var limitBefore = Error.stackTraceLimit;
  20159. var wrapCallSite = this._wrapCallSite;
  20160. Error.prepareStackTrace = function (obj, site) {
  20161. if (wrapCallSite) {
  20162. return site.map(wrapCallSite);
  20163. }
  20164. return site;
  20165. };
  20166. if (limit) {
  20167. Error.stackTraceLimit = limit;
  20168. }
  20169. var obj = {};
  20170. Error.captureStackTrace(obj, fn);
  20171. var stack = obj.stack;
  20172. Error.prepareStackTrace = prepBefore;
  20173. Error.stackTraceLimit = limitBefore;
  20174. return stack;
  20175. };
  20176. StackUtils.prototype.at = function at(fn) {
  20177. if (!fn) {
  20178. fn = at;
  20179. }
  20180. var site = this.capture(1, fn)[0];
  20181. if (!site) {
  20182. return {};
  20183. }
  20184. var res = {
  20185. line: site.getLineNumber(),
  20186. column: site.getColumnNumber()
  20187. };
  20188. this._setFile(res, site.getFileName());
  20189. if (site.isConstructor()) {
  20190. res.constructor = true;
  20191. }
  20192. if (site.isEval()) {
  20193. res.evalOrigin = site.getEvalOrigin();
  20194. } // Node v10 stopped with the isNative() on callsites, apparently
  20195. /* istanbul ignore next */
  20196. if (site.isNative()) {
  20197. res.native = true;
  20198. }
  20199. var typename = null;
  20200. try {
  20201. typename = site.getTypeName();
  20202. } catch (er) {}
  20203. if (typename && typename !== 'Object' && typename !== '[object Object]') {
  20204. res.type = typename;
  20205. }
  20206. var fname = site.getFunctionName();
  20207. if (fname) {
  20208. res.function = fname;
  20209. }
  20210. var meth = site.getMethodName();
  20211. if (meth && fname !== meth) {
  20212. res.method = meth;
  20213. }
  20214. return res;
  20215. };
  20216. StackUtils.prototype._setFile = function (result, filename) {
  20217. if (filename) {
  20218. filename = filename.replace(/\\/g, '/');
  20219. if (filename.indexOf(this._cwd + '/') === 0) {
  20220. filename = filename.substr(this._cwd.length + 1);
  20221. }
  20222. result.file = filename;
  20223. }
  20224. };
  20225. var re = new RegExp('^' + // Sometimes we strip out the ' at' because it's noisy
  20226. '(?:\\s*at )?' + // $1 = ctor if 'new'
  20227. '(?:(new) )?' + // $2 = function name (can be literally anything)
  20228. // May contain method at the end as [as xyz]
  20229. '(?:(.*?) \\()?' + // (eval at <anonymous> (file.js:1:1),
  20230. // $3 = eval origin
  20231. // $4:$5:$6 are eval file/line/col, but not normally reported
  20232. '(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?' + // file:line:col
  20233. // $7:$8:$9
  20234. // $10 = 'native' if native
  20235. '(?:(.+?):(\\d+):(\\d+)|(native))' + // maybe close the paren, then end
  20236. // if $11 is ), then we only allow balanced parens in the filename
  20237. // any imbalance is placed on the fname. This is a heuristic, and
  20238. // bound to be incorrect in some edge cases. The bet is that
  20239. // having weird characters in method names is more common than
  20240. // having weird characters in filenames, which seems reasonable.
  20241. '(\\)?)$');
  20242. var methodRe = /^(.*?) \[as (.*?)\]$/;
  20243. StackUtils.prototype.parseLine = function parseLine(line) {
  20244. var match = line && line.match(re);
  20245. if (!match) {
  20246. return null;
  20247. }
  20248. var ctor = match[1] === 'new';
  20249. var fname = match[2];
  20250. var evalOrigin = match[3];
  20251. var evalFile = match[4];
  20252. var evalLine = Number(match[5]);
  20253. var evalCol = Number(match[6]);
  20254. var file = match[7];
  20255. var lnum = match[8];
  20256. var col = match[9];
  20257. var native = match[10] === 'native';
  20258. var closeParen = match[11] === ')';
  20259. var res = {};
  20260. if (lnum) {
  20261. res.line = Number(lnum);
  20262. }
  20263. if (col) {
  20264. res.column = Number(col);
  20265. }
  20266. if (closeParen && file) {
  20267. // make sure parens are balanced
  20268. // if we have a file like "asdf) [as foo] (xyz.js", then odds are
  20269. // that the fname should be += " (asdf) [as foo]" and the file
  20270. // should be just "xyz.js"
  20271. // walk backwards from the end to find the last unbalanced (
  20272. var closes = 0;
  20273. for (var i = file.length - 1; i > 0; i--) {
  20274. if (file.charAt(i) === ')') {
  20275. closes++;
  20276. } else if (file.charAt(i) === '(' && file.charAt(i - 1) === ' ') {
  20277. closes--;
  20278. if (closes === -1 && file.charAt(i - 1) === ' ') {
  20279. var before = file.substr(0, i - 1);
  20280. var after = file.substr(i + 1);
  20281. file = after;
  20282. fname += ' (' + before;
  20283. break;
  20284. }
  20285. }
  20286. }
  20287. }
  20288. if (fname) {
  20289. var methodMatch = fname.match(methodRe);
  20290. if (methodMatch) {
  20291. fname = methodMatch[1];
  20292. var meth = methodMatch[2];
  20293. }
  20294. }
  20295. this._setFile(res, file);
  20296. if (ctor) {
  20297. res.constructor = true;
  20298. }
  20299. if (evalOrigin) {
  20300. res.evalOrigin = evalOrigin;
  20301. res.evalLine = evalLine;
  20302. res.evalColumn = evalCol;
  20303. res.evalFile = evalFile && evalFile.replace(/\\/g, '/');
  20304. }
  20305. if (native) {
  20306. res.native = true;
  20307. }
  20308. if (fname) {
  20309. res.function = fname;
  20310. }
  20311. if (meth && fname !== meth) {
  20312. res.method = meth;
  20313. }
  20314. return res;
  20315. };
  20316. var bound = new StackUtils();
  20317. Object.keys(StackUtils.prototype).forEach(function (key) {
  20318. StackUtils[key] = bound[key].bind(bound);
  20319. });
  20320. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  20321. /***/ }),
  20322. /***/ "./node_modules/static-extend/index.js":
  20323. /*!*********************************************!*\
  20324. !*** ./node_modules/static-extend/index.js ***!
  20325. \*********************************************/
  20326. /*! no static exports found */
  20327. /***/ (function(module, exports, __webpack_require__) {
  20328. "use strict";
  20329. /*!
  20330. * static-extend <https://github.com/jonschlinkert/static-extend>
  20331. *
  20332. * Copyright (c) 2016, Jon Schlinkert.
  20333. * Licensed under the MIT License.
  20334. */
  20335. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  20336. var copy = __webpack_require__(/*! object-copy */ "./node_modules/object-copy/index.js");
  20337. var define = __webpack_require__(/*! define-property */ "./node_modules/define-property/index.js");
  20338. var util = __webpack_require__(/*! util */ "./node_modules/util/util.js");
  20339. /**
  20340. * Returns a function for extending the static properties,
  20341. * prototype properties, and descriptors from the `Parent`
  20342. * constructor onto `Child` constructors.
  20343. *
  20344. * ```js
  20345. * var extend = require('static-extend');
  20346. * Parent.extend = extend(Parent);
  20347. *
  20348. * // optionally pass a custom merge function as the second arg
  20349. * Parent.extend = extend(Parent, function(Child) {
  20350. * Child.prototype.mixin = function(key, val) {
  20351. * Child.prototype[key] = val;
  20352. * };
  20353. * });
  20354. *
  20355. * // extend "child" constructors
  20356. * Parent.extend(Child);
  20357. *
  20358. * // optionally define prototype methods as the second arg
  20359. * Parent.extend(Child, {
  20360. * foo: function() {},
  20361. * bar: function() {}
  20362. * });
  20363. * ```
  20364. * @param {Function} `Parent` Parent ctor
  20365. * @param {Function} `extendFn` Optional extend function for handling any necessary custom merging. Useful when updating methods that require a specific prototype.
  20366. * @param {Function} `Child` Child ctor
  20367. * @param {Object} `proto` Optionally pass additional prototype properties to inherit.
  20368. * @return {Object}
  20369. * @api public
  20370. */
  20371. function extend(Parent, extendFn) {
  20372. if (typeof Parent !== 'function') {
  20373. throw new TypeError('expected Parent to be a function.');
  20374. }
  20375. return function (Ctor, proto) {
  20376. if (typeof Ctor !== 'function') {
  20377. throw new TypeError('expected Ctor to be a function.');
  20378. }
  20379. util.inherits(Ctor, Parent);
  20380. copy(Ctor, Parent); // proto can be null or a plain object
  20381. if (_typeof(proto) === 'object') {
  20382. var obj = Object.create(proto);
  20383. for (var k in obj) {
  20384. Ctor.prototype[k] = obj[k];
  20385. }
  20386. } // keep a reference to the parent prototype
  20387. define(Ctor.prototype, '_parent_', {
  20388. configurable: true,
  20389. set: function set() {},
  20390. get: function get() {
  20391. return Parent.prototype;
  20392. }
  20393. });
  20394. if (typeof extendFn === 'function') {
  20395. extendFn(Ctor, Parent);
  20396. }
  20397. Ctor.extend = extend(Ctor, extendFn);
  20398. };
  20399. }
  20400. ;
  20401. /**
  20402. * Expose `extend`
  20403. */
  20404. module.exports = extend;
  20405. /***/ }),
  20406. /***/ "./node_modules/timers-browserify/main.js":
  20407. /*!************************************************!*\
  20408. !*** ./node_modules/timers-browserify/main.js ***!
  20409. \************************************************/
  20410. /*! no static exports found */
  20411. /***/ (function(module, exports, __webpack_require__) {
  20412. "use strict";
  20413. /* WEBPACK VAR INJECTION */(function(global) {
  20414. var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
  20415. var apply = Function.prototype.apply; // DOM APIs, for completeness
  20416. exports.setTimeout = function () {
  20417. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  20418. };
  20419. exports.setInterval = function () {
  20420. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  20421. };
  20422. exports.clearTimeout = exports.clearInterval = function (timeout) {
  20423. if (timeout) {
  20424. timeout.close();
  20425. }
  20426. };
  20427. function Timeout(id, clearFn) {
  20428. this._id = id;
  20429. this._clearFn = clearFn;
  20430. }
  20431. Timeout.prototype.unref = Timeout.prototype.ref = function () {};
  20432. Timeout.prototype.close = function () {
  20433. this._clearFn.call(scope, this._id);
  20434. }; // Does not start the time, just sets up the members needed.
  20435. exports.enroll = function (item, msecs) {
  20436. clearTimeout(item._idleTimeoutId);
  20437. item._idleTimeout = msecs;
  20438. };
  20439. exports.unenroll = function (item) {
  20440. clearTimeout(item._idleTimeoutId);
  20441. item._idleTimeout = -1;
  20442. };
  20443. exports._unrefActive = exports.active = function (item) {
  20444. clearTimeout(item._idleTimeoutId);
  20445. var msecs = item._idleTimeout;
  20446. if (msecs >= 0) {
  20447. item._idleTimeoutId = setTimeout(function onTimeout() {
  20448. if (item._onTimeout) item._onTimeout();
  20449. }, msecs);
  20450. }
  20451. }; // setimmediate attaches itself to the global object
  20452. __webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js"); // On some exotic environments, it's not clear which object `setimmediate` was
  20453. // able to install onto. Search each possibility in the same order as the
  20454. // `setimmediate` library.
  20455. exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || void 0 && (void 0).setImmediate;
  20456. exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || void 0 && (void 0).clearImmediate;
  20457. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  20458. /***/ }),
  20459. /***/ "./node_modules/to-object-path/index.js":
  20460. /*!**********************************************!*\
  20461. !*** ./node_modules/to-object-path/index.js ***!
  20462. \**********************************************/
  20463. /*! no static exports found */
  20464. /***/ (function(module, exports, __webpack_require__) {
  20465. "use strict";
  20466. /*!
  20467. * to-object-path <https://github.com/jonschlinkert/to-object-path>
  20468. *
  20469. * Copyright (c) 2015, Jon Schlinkert.
  20470. * Licensed under the MIT License.
  20471. */
  20472. var typeOf = __webpack_require__(/*! kind-of */ "./node_modules/kind-of/index.js");
  20473. module.exports = function toPath(args) {
  20474. if (typeOf(args) !== 'arguments') {
  20475. args = arguments;
  20476. }
  20477. return filter(args).join('.');
  20478. };
  20479. function filter(arr) {
  20480. var len = arr.length;
  20481. var idx = -1;
  20482. var res = [];
  20483. while (++idx < len) {
  20484. var ele = arr[idx];
  20485. if (typeOf(ele) === 'arguments' || Array.isArray(ele)) {
  20486. res.push.apply(res, filter(ele));
  20487. } else if (typeof ele === 'string') {
  20488. res.push(ele);
  20489. }
  20490. }
  20491. return res;
  20492. }
  20493. /***/ }),
  20494. /***/ "./node_modules/to-regex-range/index.js":
  20495. /*!**********************************************!*\
  20496. !*** ./node_modules/to-regex-range/index.js ***!
  20497. \**********************************************/
  20498. /*! no static exports found */
  20499. /***/ (function(module, exports, __webpack_require__) {
  20500. "use strict";
  20501. /*!
  20502. * to-regex-range <https://github.com/jonschlinkert/to-regex-range>
  20503. *
  20504. * Copyright (c) 2015, 2017, Jon Schlinkert.
  20505. * Released under the MIT License.
  20506. */
  20507. var repeat = __webpack_require__(/*! repeat-string */ "./node_modules/repeat-string/index.js");
  20508. var isNumber = __webpack_require__(/*! is-number */ "./node_modules/is-number/index.js");
  20509. var cache = {};
  20510. function toRegexRange(min, max, options) {
  20511. if (isNumber(min) === false) {
  20512. throw new RangeError('toRegexRange: first argument is invalid.');
  20513. }
  20514. if (typeof max === 'undefined' || min === max) {
  20515. return String(min);
  20516. }
  20517. if (isNumber(max) === false) {
  20518. throw new RangeError('toRegexRange: second argument is invalid.');
  20519. }
  20520. options = options || {};
  20521. var relax = String(options.relaxZeros);
  20522. var shorthand = String(options.shorthand);
  20523. var capture = String(options.capture);
  20524. var key = min + ':' + max + '=' + relax + shorthand + capture;
  20525. if (cache.hasOwnProperty(key)) {
  20526. return cache[key].result;
  20527. }
  20528. var a = Math.min(min, max);
  20529. var b = Math.max(min, max);
  20530. if (Math.abs(a - b) === 1) {
  20531. var result = min + '|' + max;
  20532. if (options.capture) {
  20533. return '(' + result + ')';
  20534. }
  20535. return result;
  20536. }
  20537. var isPadded = padding(min) || padding(max);
  20538. var positives = [];
  20539. var negatives = [];
  20540. var tok = {
  20541. min: min,
  20542. max: max,
  20543. a: a,
  20544. b: b
  20545. };
  20546. if (isPadded) {
  20547. tok.isPadded = isPadded;
  20548. tok.maxLen = String(tok.max).length;
  20549. }
  20550. if (a < 0) {
  20551. var newMin = b < 0 ? Math.abs(b) : 1;
  20552. var newMax = Math.abs(a);
  20553. negatives = splitToPatterns(newMin, newMax, tok, options);
  20554. a = tok.a = 0;
  20555. }
  20556. if (b >= 0) {
  20557. positives = splitToPatterns(a, b, tok, options);
  20558. }
  20559. tok.negatives = negatives;
  20560. tok.positives = positives;
  20561. tok.result = siftPatterns(negatives, positives, options);
  20562. if (options.capture && positives.length + negatives.length > 1) {
  20563. tok.result = '(' + tok.result + ')';
  20564. }
  20565. cache[key] = tok;
  20566. return tok.result;
  20567. }
  20568. function siftPatterns(neg, pos, options) {
  20569. var onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
  20570. var onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
  20571. var intersected = filterPatterns(neg, pos, '-?', true, options) || [];
  20572. var subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
  20573. return subpatterns.join('|');
  20574. }
  20575. function splitToRanges(min, max) {
  20576. min = Number(min);
  20577. max = Number(max);
  20578. var nines = 1;
  20579. var stops = [max];
  20580. var stop = +countNines(min, nines);
  20581. while (min <= stop && stop <= max) {
  20582. stops = push(stops, stop);
  20583. nines += 1;
  20584. stop = +countNines(min, nines);
  20585. }
  20586. var zeros = 1;
  20587. stop = countZeros(max + 1, zeros) - 1;
  20588. while (min < stop && stop <= max) {
  20589. stops = push(stops, stop);
  20590. zeros += 1;
  20591. stop = countZeros(max + 1, zeros) - 1;
  20592. }
  20593. stops.sort(compare);
  20594. return stops;
  20595. }
  20596. /**
  20597. * Convert a range to a regex pattern
  20598. * @param {Number} `start`
  20599. * @param {Number} `stop`
  20600. * @return {String}
  20601. */
  20602. function rangeToPattern(start, stop, options) {
  20603. if (start === stop) {
  20604. return {
  20605. pattern: String(start),
  20606. digits: []
  20607. };
  20608. }
  20609. var zipped = zip(String(start), String(stop));
  20610. var len = zipped.length,
  20611. i = -1;
  20612. var pattern = '';
  20613. var digits = 0;
  20614. while (++i < len) {
  20615. var numbers = zipped[i];
  20616. var startDigit = numbers[0];
  20617. var stopDigit = numbers[1];
  20618. if (startDigit === stopDigit) {
  20619. pattern += startDigit;
  20620. } else if (startDigit !== '0' || stopDigit !== '9') {
  20621. pattern += toCharacterClass(startDigit, stopDigit);
  20622. } else {
  20623. digits += 1;
  20624. }
  20625. }
  20626. if (digits) {
  20627. pattern += options.shorthand ? '\\d' : '[0-9]';
  20628. }
  20629. return {
  20630. pattern: pattern,
  20631. digits: [digits]
  20632. };
  20633. }
  20634. function splitToPatterns(min, max, tok, options) {
  20635. var ranges = splitToRanges(min, max);
  20636. var len = ranges.length;
  20637. var idx = -1;
  20638. var tokens = [];
  20639. var start = min;
  20640. var prev;
  20641. while (++idx < len) {
  20642. var range = ranges[idx];
  20643. var obj = rangeToPattern(start, range, options);
  20644. var zeros = '';
  20645. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  20646. if (prev.digits.length > 1) {
  20647. prev.digits.pop();
  20648. }
  20649. prev.digits.push(obj.digits[0]);
  20650. prev.string = prev.pattern + toQuantifier(prev.digits);
  20651. start = range + 1;
  20652. continue;
  20653. }
  20654. if (tok.isPadded) {
  20655. zeros = padZeros(range, tok);
  20656. }
  20657. obj.string = zeros + obj.pattern + toQuantifier(obj.digits);
  20658. tokens.push(obj);
  20659. start = range + 1;
  20660. prev = obj;
  20661. }
  20662. return tokens;
  20663. }
  20664. function filterPatterns(arr, comparison, prefix, intersection, options) {
  20665. var res = [];
  20666. for (var i = 0; i < arr.length; i++) {
  20667. var tok = arr[i];
  20668. var ele = tok.string;
  20669. if (options.relaxZeros !== false) {
  20670. if (prefix === '-' && ele.charAt(0) === '0') {
  20671. if (ele.charAt(1) === '{') {
  20672. ele = '0*' + ele.replace(/^0\{\d+\}/, '');
  20673. } else {
  20674. ele = '0*' + ele.slice(1);
  20675. }
  20676. }
  20677. }
  20678. if (!intersection && !contains(comparison, 'string', ele)) {
  20679. res.push(prefix + ele);
  20680. }
  20681. if (intersection && contains(comparison, 'string', ele)) {
  20682. res.push(prefix + ele);
  20683. }
  20684. }
  20685. return res;
  20686. }
  20687. /**
  20688. * Zip strings (`for in` can be used on string characters)
  20689. */
  20690. function zip(a, b) {
  20691. var arr = [];
  20692. for (var ch in a) {
  20693. arr.push([a[ch], b[ch]]);
  20694. }
  20695. return arr;
  20696. }
  20697. function compare(a, b) {
  20698. return a > b ? 1 : b > a ? -1 : 0;
  20699. }
  20700. function push(arr, ele) {
  20701. if (arr.indexOf(ele) === -1) arr.push(ele);
  20702. return arr;
  20703. }
  20704. function contains(arr, key, val) {
  20705. for (var i = 0; i < arr.length; i++) {
  20706. if (arr[i][key] === val) {
  20707. return true;
  20708. }
  20709. }
  20710. return false;
  20711. }
  20712. function countNines(min, len) {
  20713. return String(min).slice(0, -len) + repeat('9', len);
  20714. }
  20715. function countZeros(integer, zeros) {
  20716. return integer - integer % Math.pow(10, zeros);
  20717. }
  20718. function toQuantifier(digits) {
  20719. var start = digits[0];
  20720. var stop = digits[1] ? ',' + digits[1] : '';
  20721. if (!stop && (!start || start === 1)) {
  20722. return '';
  20723. }
  20724. return '{' + start + stop + '}';
  20725. }
  20726. function toCharacterClass(a, b) {
  20727. return '[' + a + (b - a === 1 ? '' : '-') + b + ']';
  20728. }
  20729. function padding(str) {
  20730. return /^-?(0+)\d/.exec(str);
  20731. }
  20732. function padZeros(val, tok) {
  20733. if (tok.isPadded) {
  20734. var diff = Math.abs(tok.maxLen - String(val).length);
  20735. switch (diff) {
  20736. case 0:
  20737. return '';
  20738. case 1:
  20739. return '0';
  20740. default:
  20741. {
  20742. return '0{' + diff + '}';
  20743. }
  20744. }
  20745. }
  20746. return val;
  20747. }
  20748. /**
  20749. * Expose `toRegexRange`
  20750. */
  20751. module.exports = toRegexRange;
  20752. /***/ }),
  20753. /***/ "./node_modules/to-regex/index.js":
  20754. /*!****************************************!*\
  20755. !*** ./node_modules/to-regex/index.js ***!
  20756. \****************************************/
  20757. /*! no static exports found */
  20758. /***/ (function(module, exports, __webpack_require__) {
  20759. "use strict";
  20760. var safe = __webpack_require__(/*! safe-regex */ "./node_modules/safe-regex/index.js");
  20761. var define = __webpack_require__(/*! define-property */ "./node_modules/to-regex/node_modules/define-property/index.js");
  20762. var extend = __webpack_require__(/*! extend-shallow */ "./node_modules/to-regex/node_modules/extend-shallow/index.js");
  20763. var not = __webpack_require__(/*! regex-not */ "./node_modules/regex-not/index.js");
  20764. var MAX_LENGTH = 1024 * 64;
  20765. /**
  20766. * Session cache
  20767. */
  20768. var cache = {};
  20769. /**
  20770. * Create a regular expression from the given `pattern` string.
  20771. *
  20772. * @param {String|RegExp} `pattern` Pattern can be a string or regular expression.
  20773. * @param {Object} `options`
  20774. * @return {RegExp}
  20775. * @api public
  20776. */
  20777. module.exports = function (patterns, options) {
  20778. if (!Array.isArray(patterns)) {
  20779. return makeRe(patterns, options);
  20780. }
  20781. return makeRe(patterns.join('|'), options);
  20782. };
  20783. /**
  20784. * Create a regular expression from the given `pattern` string.
  20785. *
  20786. * @param {String|RegExp} `pattern` Pattern can be a string or regular expression.
  20787. * @param {Object} `options`
  20788. * @return {RegExp}
  20789. * @api public
  20790. */
  20791. function makeRe(pattern, options) {
  20792. if (pattern instanceof RegExp) {
  20793. return pattern;
  20794. }
  20795. if (typeof pattern !== 'string') {
  20796. throw new TypeError('expected a string');
  20797. }
  20798. if (pattern.length > MAX_LENGTH) {
  20799. throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
  20800. }
  20801. var key = pattern; // do this before shallow cloning options, it's a lot faster
  20802. if (!options || options && options.cache !== false) {
  20803. key = createKey(pattern, options);
  20804. if (cache.hasOwnProperty(key)) {
  20805. return cache[key];
  20806. }
  20807. }
  20808. var opts = extend({}, options);
  20809. if (opts.contains === true) {
  20810. if (opts.negate === true) {
  20811. opts.strictNegate = false;
  20812. } else {
  20813. opts.strict = false;
  20814. }
  20815. }
  20816. if (opts.strict === false) {
  20817. opts.strictOpen = false;
  20818. opts.strictClose = false;
  20819. }
  20820. var open = opts.strictOpen !== false ? '^' : '';
  20821. var close = opts.strictClose !== false ? '$' : '';
  20822. var flags = opts.flags || '';
  20823. var regex;
  20824. if (opts.nocase === true && !/i/.test(flags)) {
  20825. flags += 'i';
  20826. }
  20827. try {
  20828. if (opts.negate || typeof opts.strictNegate === 'boolean') {
  20829. pattern = not.create(pattern, opts);
  20830. }
  20831. var str = open + '(?:' + pattern + ')' + close;
  20832. regex = new RegExp(str, flags);
  20833. if (opts.safe === true && safe(regex) === false) {
  20834. throw new Error('potentially unsafe regular expression: ' + regex.source);
  20835. }
  20836. } catch (err) {
  20837. if (opts.strictErrors === true || opts.safe === true) {
  20838. err.key = key;
  20839. err.pattern = pattern;
  20840. err.originalOptions = options;
  20841. err.createdOptions = opts;
  20842. throw err;
  20843. }
  20844. try {
  20845. regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$');
  20846. } catch (err) {
  20847. regex = /.^/; //<= match nothing
  20848. }
  20849. }
  20850. if (opts.cache !== false) {
  20851. memoize(regex, key, pattern, opts);
  20852. }
  20853. return regex;
  20854. }
  20855. /**
  20856. * Memoize generated regex. This can result in dramatic speed improvements
  20857. * and simplify debugging by adding options and pattern to the regex. It can be
  20858. * disabled by passing setting `options.cache` to false.
  20859. */
  20860. function memoize(regex, key, pattern, options) {
  20861. define(regex, 'cached', true);
  20862. define(regex, 'pattern', pattern);
  20863. define(regex, 'options', options);
  20864. define(regex, 'key', key);
  20865. cache[key] = regex;
  20866. }
  20867. /**
  20868. * Create the key to use for memoization. The key is generated
  20869. * by iterating over the options and concatenating key-value pairs
  20870. * to the pattern string.
  20871. */
  20872. function createKey(pattern, options) {
  20873. if (!options) return pattern;
  20874. var key = pattern;
  20875. for (var prop in options) {
  20876. if (options.hasOwnProperty(prop)) {
  20877. key += ';' + prop + '=' + String(options[prop]);
  20878. }
  20879. }
  20880. return key;
  20881. }
  20882. /**
  20883. * Expose `makeRe`
  20884. */
  20885. module.exports.makeRe = makeRe;
  20886. /***/ }),
  20887. /***/ "./node_modules/to-regex/node_modules/define-property/index.js":
  20888. /*!*********************************************************************!*\
  20889. !*** ./node_modules/to-regex/node_modules/define-property/index.js ***!
  20890. \*********************************************************************/
  20891. /*! no static exports found */
  20892. /***/ (function(module, exports, __webpack_require__) {
  20893. "use strict";
  20894. /*!
  20895. * define-property <https://github.com/jonschlinkert/define-property>
  20896. *
  20897. * Copyright (c) 2015-2018, Jon Schlinkert.
  20898. * Released under the MIT License.
  20899. */
  20900. var isobject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  20901. var isDescriptor = __webpack_require__(/*! is-descriptor */ "./node_modules/is-descriptor/index.js");
  20902. var define = typeof Reflect !== 'undefined' && Reflect.defineProperty ? Reflect.defineProperty : Object.defineProperty;
  20903. module.exports = function defineProperty(obj, key, val) {
  20904. if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) {
  20905. throw new TypeError('expected an object, function, or array');
  20906. }
  20907. if (typeof key !== 'string') {
  20908. throw new TypeError('expected "key" to be a string');
  20909. }
  20910. if (isDescriptor(val)) {
  20911. define(obj, key, val);
  20912. return obj;
  20913. }
  20914. define(obj, key, {
  20915. configurable: true,
  20916. enumerable: false,
  20917. writable: true,
  20918. value: val
  20919. });
  20920. return obj;
  20921. };
  20922. /***/ }),
  20923. /***/ "./node_modules/to-regex/node_modules/extend-shallow/index.js":
  20924. /*!********************************************************************!*\
  20925. !*** ./node_modules/to-regex/node_modules/extend-shallow/index.js ***!
  20926. \********************************************************************/
  20927. /*! no static exports found */
  20928. /***/ (function(module, exports, __webpack_require__) {
  20929. "use strict";
  20930. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  20931. var isExtendable = __webpack_require__(/*! is-extendable */ "./node_modules/to-regex/node_modules/is-extendable/index.js");
  20932. var assignSymbols = __webpack_require__(/*! assign-symbols */ "./node_modules/assign-symbols/index.js");
  20933. module.exports = Object.assign || function (obj
  20934. /*, objects*/
  20935. ) {
  20936. if (obj === null || typeof obj === 'undefined') {
  20937. throw new TypeError('Cannot convert undefined or null to object');
  20938. }
  20939. if (!isObject(obj)) {
  20940. obj = {};
  20941. }
  20942. for (var i = 1; i < arguments.length; i++) {
  20943. var val = arguments[i];
  20944. if (isString(val)) {
  20945. val = toObject(val);
  20946. }
  20947. if (isObject(val)) {
  20948. assign(obj, val);
  20949. assignSymbols(obj, val);
  20950. }
  20951. }
  20952. return obj;
  20953. };
  20954. function assign(a, b) {
  20955. for (var key in b) {
  20956. if (hasOwn(b, key)) {
  20957. a[key] = b[key];
  20958. }
  20959. }
  20960. }
  20961. function isString(val) {
  20962. return val && typeof val === 'string';
  20963. }
  20964. function toObject(str) {
  20965. var obj = {};
  20966. for (var i in str) {
  20967. obj[i] = str[i];
  20968. }
  20969. return obj;
  20970. }
  20971. function isObject(val) {
  20972. return val && _typeof(val) === 'object' || isExtendable(val);
  20973. }
  20974. /**
  20975. * Returns true if the given `key` is an own property of `obj`.
  20976. */
  20977. function hasOwn(obj, key) {
  20978. return Object.prototype.hasOwnProperty.call(obj, key);
  20979. }
  20980. function isEnum(obj, key) {
  20981. return Object.prototype.propertyIsEnumerable.call(obj, key);
  20982. }
  20983. /***/ }),
  20984. /***/ "./node_modules/to-regex/node_modules/is-extendable/index.js":
  20985. /*!*******************************************************************!*\
  20986. !*** ./node_modules/to-regex/node_modules/is-extendable/index.js ***!
  20987. \*******************************************************************/
  20988. /*! no static exports found */
  20989. /***/ (function(module, exports, __webpack_require__) {
  20990. "use strict";
  20991. /*!
  20992. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  20993. *
  20994. * Copyright (c) 2015-2017, Jon Schlinkert.
  20995. * Released under the MIT License.
  20996. */
  20997. var isPlainObject = __webpack_require__(/*! is-plain-object */ "./node_modules/is-plain-object/index.js");
  20998. module.exports = function isExtendable(val) {
  20999. return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
  21000. };
  21001. /***/ }),
  21002. /***/ "./node_modules/union-value/index.js":
  21003. /*!*******************************************!*\
  21004. !*** ./node_modules/union-value/index.js ***!
  21005. \*******************************************/
  21006. /*! no static exports found */
  21007. /***/ (function(module, exports, __webpack_require__) {
  21008. "use strict";
  21009. var isObject = __webpack_require__(/*! is-extendable */ "./node_modules/is-extendable/index.js");
  21010. var union = __webpack_require__(/*! arr-union */ "./node_modules/arr-union/index.js");
  21011. var get = __webpack_require__(/*! get-value */ "./node_modules/get-value/index.js");
  21012. var set = __webpack_require__(/*! set-value */ "./node_modules/set-value/index.js");
  21013. module.exports = function unionValue(obj, prop, value) {
  21014. if (!isObject(obj)) {
  21015. throw new TypeError('union-value expects the first argument to be an object.');
  21016. }
  21017. if (typeof prop !== 'string') {
  21018. throw new TypeError('union-value expects `prop` to be a string.');
  21019. }
  21020. var arr = arrayify(get(obj, prop));
  21021. set(obj, prop, union(arr, arrayify(value)));
  21022. return obj;
  21023. };
  21024. function arrayify(val) {
  21025. if (val === null || typeof val === 'undefined') {
  21026. return [];
  21027. }
  21028. if (Array.isArray(val)) {
  21029. return val;
  21030. }
  21031. return [val];
  21032. }
  21033. /***/ }),
  21034. /***/ "./node_modules/unset-value/index.js":
  21035. /*!*******************************************!*\
  21036. !*** ./node_modules/unset-value/index.js ***!
  21037. \*******************************************/
  21038. /*! no static exports found */
  21039. /***/ (function(module, exports, __webpack_require__) {
  21040. "use strict";
  21041. /*!
  21042. * unset-value <https://github.com/jonschlinkert/unset-value>
  21043. *
  21044. * Copyright (c) 2015, 2017, Jon Schlinkert.
  21045. * Released under the MIT License.
  21046. */
  21047. var isObject = __webpack_require__(/*! isobject */ "./node_modules/isobject/index.js");
  21048. var has = __webpack_require__(/*! has-value */ "./node_modules/unset-value/node_modules/has-value/index.js");
  21049. module.exports = function unset(obj, prop) {
  21050. if (!isObject(obj)) {
  21051. throw new TypeError('expected an object.');
  21052. }
  21053. if (obj.hasOwnProperty(prop)) {
  21054. delete obj[prop];
  21055. return true;
  21056. }
  21057. if (has(obj, prop)) {
  21058. var segs = prop.split('.');
  21059. var last = segs.pop();
  21060. while (segs.length && segs[segs.length - 1].slice(-1) === '\\') {
  21061. last = segs.pop().slice(0, -1) + '.' + last;
  21062. }
  21063. while (segs.length) {
  21064. obj = obj[prop = segs.shift()];
  21065. }
  21066. return delete obj[last];
  21067. }
  21068. return true;
  21069. };
  21070. /***/ }),
  21071. /***/ "./node_modules/unset-value/node_modules/has-value/index.js":
  21072. /*!******************************************************************!*\
  21073. !*** ./node_modules/unset-value/node_modules/has-value/index.js ***!
  21074. \******************************************************************/
  21075. /*! no static exports found */
  21076. /***/ (function(module, exports, __webpack_require__) {
  21077. "use strict";
  21078. /*!
  21079. * has-value <https://github.com/jonschlinkert/has-value>
  21080. *
  21081. * Copyright (c) 2014-2016, Jon Schlinkert.
  21082. * Licensed under the MIT License.
  21083. */
  21084. var isObject = __webpack_require__(/*! isobject */ "./node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js");
  21085. var hasValues = __webpack_require__(/*! has-values */ "./node_modules/unset-value/node_modules/has-values/index.js");
  21086. var get = __webpack_require__(/*! get-value */ "./node_modules/get-value/index.js");
  21087. module.exports = function (obj, prop, noZero) {
  21088. if (isObject(obj)) {
  21089. return hasValues(get(obj, prop), noZero);
  21090. }
  21091. return hasValues(obj, prop);
  21092. };
  21093. /***/ }),
  21094. /***/ "./node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js":
  21095. /*!****************************************************************************************!*\
  21096. !*** ./node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js ***!
  21097. \****************************************************************************************/
  21098. /*! no static exports found */
  21099. /***/ (function(module, exports, __webpack_require__) {
  21100. "use strict";
  21101. /*!
  21102. * isobject <https://github.com/jonschlinkert/isobject>
  21103. *
  21104. * Copyright (c) 2014-2015, Jon Schlinkert.
  21105. * Licensed under the MIT License.
  21106. */
  21107. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  21108. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js");
  21109. module.exports = function isObject(val) {
  21110. return val != null && _typeof(val) === 'object' && isArray(val) === false;
  21111. };
  21112. /***/ }),
  21113. /***/ "./node_modules/unset-value/node_modules/has-values/index.js":
  21114. /*!*******************************************************************!*\
  21115. !*** ./node_modules/unset-value/node_modules/has-values/index.js ***!
  21116. \*******************************************************************/
  21117. /*! no static exports found */
  21118. /***/ (function(module, exports, __webpack_require__) {
  21119. "use strict";
  21120. /*!
  21121. * has-values <https://github.com/jonschlinkert/has-values>
  21122. *
  21123. * Copyright (c) 2014-2015, Jon Schlinkert.
  21124. * Licensed under the MIT License.
  21125. */
  21126. module.exports = function hasValue(o, noZero) {
  21127. if (o === null || o === undefined) {
  21128. return false;
  21129. }
  21130. if (typeof o === 'boolean') {
  21131. return true;
  21132. }
  21133. if (typeof o === 'number') {
  21134. if (o === 0 && noZero === true) {
  21135. return false;
  21136. }
  21137. return true;
  21138. }
  21139. if (o.length !== undefined) {
  21140. return o.length !== 0;
  21141. }
  21142. for (var key in o) {
  21143. if (o.hasOwnProperty(key)) {
  21144. return true;
  21145. }
  21146. }
  21147. return false;
  21148. };
  21149. /***/ }),
  21150. /***/ "./node_modules/use/index.js":
  21151. /*!***********************************!*\
  21152. !*** ./node_modules/use/index.js ***!
  21153. \***********************************/
  21154. /*! no static exports found */
  21155. /***/ (function(module, exports, __webpack_require__) {
  21156. "use strict";
  21157. /*!
  21158. * use <https://github.com/jonschlinkert/use>
  21159. *
  21160. * Copyright (c) 2015-2017, Jon Schlinkert.
  21161. * Released under the MIT License.
  21162. */
  21163. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  21164. module.exports = function base(app, options) {
  21165. if (!isObject(app) && typeof app !== 'function') {
  21166. throw new TypeError('expected an object or function');
  21167. }
  21168. var opts = isObject(options) ? options : {};
  21169. var prop = typeof opts.prop === 'string' ? opts.prop : 'fns';
  21170. if (!Array.isArray(app[prop])) {
  21171. define(app, prop, []);
  21172. }
  21173. /**
  21174. * Define a plugin function to be passed to use. The only
  21175. * parameter exposed to the plugin is `app`, the object or function.
  21176. * passed to `use(app)`. `app` is also exposed as `this` in plugins.
  21177. *
  21178. * Additionally, **if a plugin returns a function, the function will
  21179. * be pushed onto the `fns` array**, allowing the plugin to be
  21180. * called at a later point by the `run` method.
  21181. *
  21182. * ```js
  21183. * var use = require('use');
  21184. *
  21185. * // define a plugin
  21186. * function foo(app) {
  21187. * // do stuff
  21188. * }
  21189. *
  21190. * var app = function(){};
  21191. * use(app);
  21192. *
  21193. * // register plugins
  21194. * app.use(foo);
  21195. * app.use(bar);
  21196. * app.use(baz);
  21197. * ```
  21198. * @name .use
  21199. * @param {Function} `fn` plugin function to call
  21200. * @api public
  21201. */
  21202. define(app, 'use', use);
  21203. /**
  21204. * Run all plugins on `fns`. Any plugin that returns a function
  21205. * when called by `use` is pushed onto the `fns` array.
  21206. *
  21207. * ```js
  21208. * var config = {};
  21209. * app.run(config);
  21210. * ```
  21211. * @name .run
  21212. * @param {Object} `value` Object to be modified by plugins.
  21213. * @return {Object} Returns the object passed to `run`
  21214. * @api public
  21215. */
  21216. define(app, 'run', function (val) {
  21217. if (!isObject(val)) return;
  21218. if (!val.use || !val.run) {
  21219. define(val, prop, val[prop] || []);
  21220. define(val, 'use', use);
  21221. }
  21222. if (!val[prop] || val[prop].indexOf(base) === -1) {
  21223. val.use(base);
  21224. }
  21225. var self = this || app;
  21226. var fns = self[prop];
  21227. var len = fns.length;
  21228. var idx = -1;
  21229. while (++idx < len) {
  21230. val.use(fns[idx]);
  21231. }
  21232. return val;
  21233. });
  21234. /**
  21235. * Call plugin `fn`. If a function is returned push it into the
  21236. * `fns` array to be called by the `run` method.
  21237. */
  21238. function use(type, fn, options) {
  21239. var offset = 1;
  21240. if (typeof type === 'string' || Array.isArray(type)) {
  21241. fn = wrap(type, fn);
  21242. offset++;
  21243. } else {
  21244. options = fn;
  21245. fn = type;
  21246. }
  21247. if (typeof fn !== 'function') {
  21248. throw new TypeError('expected a function');
  21249. }
  21250. var self = this || app;
  21251. var fns = self[prop];
  21252. var args = [].slice.call(arguments, offset);
  21253. args.unshift(self);
  21254. if (typeof opts.hook === 'function') {
  21255. opts.hook.apply(self, args);
  21256. }
  21257. var val = fn.apply(self, args);
  21258. if (typeof val === 'function' && fns.indexOf(val) === -1) {
  21259. fns.push(val);
  21260. }
  21261. return self;
  21262. }
  21263. /**
  21264. * Wrap a named plugin function so that it's only called on objects of the
  21265. * given `type`
  21266. *
  21267. * @param {String} `type`
  21268. * @param {Function} `fn` Plugin function
  21269. * @return {Function}
  21270. */
  21271. function wrap(type, fn) {
  21272. return function plugin() {
  21273. return this.type === type ? fn.apply(this, arguments) : plugin;
  21274. };
  21275. }
  21276. return app;
  21277. };
  21278. function isObject(val) {
  21279. return val && _typeof(val) === 'object' && !Array.isArray(val);
  21280. }
  21281. function define(obj, key, val) {
  21282. Object.defineProperty(obj, key, {
  21283. configurable: true,
  21284. writable: true,
  21285. value: val
  21286. });
  21287. }
  21288. /***/ }),
  21289. /***/ "./node_modules/util/node_modules/inherits/inherits_browser.js":
  21290. /*!*********************************************************************!*\
  21291. !*** ./node_modules/util/node_modules/inherits/inherits_browser.js ***!
  21292. \*********************************************************************/
  21293. /*! no static exports found */
  21294. /***/ (function(module, exports, __webpack_require__) {
  21295. "use strict";
  21296. if (typeof Object.create === 'function') {
  21297. // implementation from standard node.js 'util' module
  21298. module.exports = function inherits(ctor, superCtor) {
  21299. ctor.super_ = superCtor;
  21300. ctor.prototype = Object.create(superCtor.prototype, {
  21301. constructor: {
  21302. value: ctor,
  21303. enumerable: false,
  21304. writable: true,
  21305. configurable: true
  21306. }
  21307. });
  21308. };
  21309. } else {
  21310. // old school shim for old browsers
  21311. module.exports = function inherits(ctor, superCtor) {
  21312. ctor.super_ = superCtor;
  21313. var TempCtor = function TempCtor() {};
  21314. TempCtor.prototype = superCtor.prototype;
  21315. ctor.prototype = new TempCtor();
  21316. ctor.prototype.constructor = ctor;
  21317. };
  21318. }
  21319. /***/ }),
  21320. /***/ "./node_modules/util/support/isBufferBrowser.js":
  21321. /*!******************************************************!*\
  21322. !*** ./node_modules/util/support/isBufferBrowser.js ***!
  21323. \******************************************************/
  21324. /*! no static exports found */
  21325. /***/ (function(module, exports, __webpack_require__) {
  21326. "use strict";
  21327. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  21328. module.exports = function isBuffer(arg) {
  21329. return arg && _typeof(arg) === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function';
  21330. };
  21331. /***/ }),
  21332. /***/ "./node_modules/util/util.js":
  21333. /*!***********************************!*\
  21334. !*** ./node_modules/util/util.js ***!
  21335. \***********************************/
  21336. /*! no static exports found */
  21337. /***/ (function(module, exports, __webpack_require__) {
  21338. "use strict";
  21339. /* WEBPACK VAR INJECTION */(function(process) {
  21340. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  21341. // Copyright Joyent, Inc. and other Node contributors.
  21342. //
  21343. // Permission is hereby granted, free of charge, to any person obtaining a
  21344. // copy of this software and associated documentation files (the
  21345. // "Software"), to deal in the Software without restriction, including
  21346. // without limitation the rights to use, copy, modify, merge, publish,
  21347. // distribute, sublicense, and/or sell copies of the Software, and to permit
  21348. // persons to whom the Software is furnished to do so, subject to the
  21349. // following conditions:
  21350. //
  21351. // The above copyright notice and this permission notice shall be included
  21352. // in all copies or substantial portions of the Software.
  21353. //
  21354. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21355. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21356. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  21357. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  21358. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21359. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21360. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  21361. var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {
  21362. var keys = Object.keys(obj);
  21363. var descriptors = {};
  21364. for (var i = 0; i < keys.length; i++) {
  21365. descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
  21366. }
  21367. return descriptors;
  21368. };
  21369. var formatRegExp = /%[sdj%]/g;
  21370. exports.format = function (f) {
  21371. if (!isString(f)) {
  21372. var objects = [];
  21373. for (var i = 0; i < arguments.length; i++) {
  21374. objects.push(inspect(arguments[i]));
  21375. }
  21376. return objects.join(' ');
  21377. }
  21378. var i = 1;
  21379. var args = arguments;
  21380. var len = args.length;
  21381. var str = String(f).replace(formatRegExp, function (x) {
  21382. if (x === '%%') return '%';
  21383. if (i >= len) return x;
  21384. switch (x) {
  21385. case '%s':
  21386. return String(args[i++]);
  21387. case '%d':
  21388. return Number(args[i++]);
  21389. case '%j':
  21390. try {
  21391. return JSON.stringify(args[i++]);
  21392. } catch (_) {
  21393. return '[Circular]';
  21394. }
  21395. default:
  21396. return x;
  21397. }
  21398. });
  21399. for (var x = args[i]; i < len; x = args[++i]) {
  21400. if (isNull(x) || !isObject(x)) {
  21401. str += ' ' + x;
  21402. } else {
  21403. str += ' ' + inspect(x);
  21404. }
  21405. }
  21406. return str;
  21407. }; // Mark that a method should not be used.
  21408. // Returns a modified function which warns once by default.
  21409. // If --no-deprecation is set, then it is a no-op.
  21410. exports.deprecate = function (fn, msg) {
  21411. if (typeof process !== 'undefined' && process.noDeprecation === true) {
  21412. return fn;
  21413. } // Allow for deprecating things in the process of starting up.
  21414. if (typeof process === 'undefined') {
  21415. return function () {
  21416. return exports.deprecate(fn, msg).apply(this, arguments);
  21417. };
  21418. }
  21419. var warned = false;
  21420. function deprecated() {
  21421. if (!warned) {
  21422. if (process.throwDeprecation) {
  21423. throw new Error(msg);
  21424. } else if (process.traceDeprecation) {
  21425. console.trace(msg);
  21426. } else {
  21427. console.error(msg);
  21428. }
  21429. warned = true;
  21430. }
  21431. return fn.apply(this, arguments);
  21432. }
  21433. return deprecated;
  21434. };
  21435. var debugs = {};
  21436. var debugEnviron;
  21437. exports.debuglog = function (set) {
  21438. if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || '';
  21439. set = set.toUpperCase();
  21440. if (!debugs[set]) {
  21441. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  21442. var pid = process.pid;
  21443. debugs[set] = function () {
  21444. var msg = exports.format.apply(exports, arguments);
  21445. console.error('%s %d: %s', set, pid, msg);
  21446. };
  21447. } else {
  21448. debugs[set] = function () {};
  21449. }
  21450. }
  21451. return debugs[set];
  21452. };
  21453. /**
  21454. * Echos the value of a value. Trys to print the value out
  21455. * in the best way possible given the different types.
  21456. *
  21457. * @param {Object} obj The object to print out.
  21458. * @param {Object} opts Optional options object that alters the output.
  21459. */
  21460. /* legacy: obj, showHidden, depth, colors*/
  21461. function inspect(obj, opts) {
  21462. // default options
  21463. var ctx = {
  21464. seen: [],
  21465. stylize: stylizeNoColor
  21466. }; // legacy...
  21467. if (arguments.length >= 3) ctx.depth = arguments[2];
  21468. if (arguments.length >= 4) ctx.colors = arguments[3];
  21469. if (isBoolean(opts)) {
  21470. // legacy...
  21471. ctx.showHidden = opts;
  21472. } else if (opts) {
  21473. // got an "options" object
  21474. exports._extend(ctx, opts);
  21475. } // set default options
  21476. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  21477. if (isUndefined(ctx.depth)) ctx.depth = 2;
  21478. if (isUndefined(ctx.colors)) ctx.colors = false;
  21479. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  21480. if (ctx.colors) ctx.stylize = stylizeWithColor;
  21481. return formatValue(ctx, obj, ctx.depth);
  21482. }
  21483. exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  21484. inspect.colors = {
  21485. 'bold': [1, 22],
  21486. 'italic': [3, 23],
  21487. 'underline': [4, 24],
  21488. 'inverse': [7, 27],
  21489. 'white': [37, 39],
  21490. 'grey': [90, 39],
  21491. 'black': [30, 39],
  21492. 'blue': [34, 39],
  21493. 'cyan': [36, 39],
  21494. 'green': [32, 39],
  21495. 'magenta': [35, 39],
  21496. 'red': [31, 39],
  21497. 'yellow': [33, 39]
  21498. }; // Don't use 'blue' not visible on cmd.exe
  21499. inspect.styles = {
  21500. 'special': 'cyan',
  21501. 'number': 'yellow',
  21502. 'boolean': 'yellow',
  21503. 'undefined': 'grey',
  21504. 'null': 'bold',
  21505. 'string': 'green',
  21506. 'date': 'magenta',
  21507. // "name": intentionally not styling
  21508. 'regexp': 'red'
  21509. };
  21510. function stylizeWithColor(str, styleType) {
  21511. var style = inspect.styles[styleType];
  21512. if (style) {
  21513. return "\x1B[" + inspect.colors[style][0] + 'm' + str + "\x1B[" + inspect.colors[style][1] + 'm';
  21514. } else {
  21515. return str;
  21516. }
  21517. }
  21518. function stylizeNoColor(str, styleType) {
  21519. return str;
  21520. }
  21521. function arrayToHash(array) {
  21522. var hash = {};
  21523. array.forEach(function (val, idx) {
  21524. hash[val] = true;
  21525. });
  21526. return hash;
  21527. }
  21528. function formatValue(ctx, value, recurseTimes) {
  21529. // Provide a hook for user-specified inspect functions.
  21530. // Check that value is an object with an inspect function on it
  21531. if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
  21532. value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check.
  21533. !(value.constructor && value.constructor.prototype === value)) {
  21534. var ret = value.inspect(recurseTimes, ctx);
  21535. if (!isString(ret)) {
  21536. ret = formatValue(ctx, ret, recurseTimes);
  21537. }
  21538. return ret;
  21539. } // Primitive types cannot have properties
  21540. var primitive = formatPrimitive(ctx, value);
  21541. if (primitive) {
  21542. return primitive;
  21543. } // Look up the keys of the object.
  21544. var keys = Object.keys(value);
  21545. var visibleKeys = arrayToHash(keys);
  21546. if (ctx.showHidden) {
  21547. keys = Object.getOwnPropertyNames(value);
  21548. } // IE doesn't make error fields non-enumerable
  21549. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  21550. if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  21551. return formatError(value);
  21552. } // Some type of object without properties can be shortcutted.
  21553. if (keys.length === 0) {
  21554. if (isFunction(value)) {
  21555. var name = value.name ? ': ' + value.name : '';
  21556. return ctx.stylize('[Function' + name + ']', 'special');
  21557. }
  21558. if (isRegExp(value)) {
  21559. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  21560. }
  21561. if (isDate(value)) {
  21562. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  21563. }
  21564. if (isError(value)) {
  21565. return formatError(value);
  21566. }
  21567. }
  21568. var base = '',
  21569. array = false,
  21570. braces = ['{', '}']; // Make Array say that they are Array
  21571. if (isArray(value)) {
  21572. array = true;
  21573. braces = ['[', ']'];
  21574. } // Make functions say that they are functions
  21575. if (isFunction(value)) {
  21576. var n = value.name ? ': ' + value.name : '';
  21577. base = ' [Function' + n + ']';
  21578. } // Make RegExps say that they are RegExps
  21579. if (isRegExp(value)) {
  21580. base = ' ' + RegExp.prototype.toString.call(value);
  21581. } // Make dates with properties first say the date
  21582. if (isDate(value)) {
  21583. base = ' ' + Date.prototype.toUTCString.call(value);
  21584. } // Make error with message first say the error
  21585. if (isError(value)) {
  21586. base = ' ' + formatError(value);
  21587. }
  21588. if (keys.length === 0 && (!array || value.length == 0)) {
  21589. return braces[0] + base + braces[1];
  21590. }
  21591. if (recurseTimes < 0) {
  21592. if (isRegExp(value)) {
  21593. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  21594. } else {
  21595. return ctx.stylize('[Object]', 'special');
  21596. }
  21597. }
  21598. ctx.seen.push(value);
  21599. var output;
  21600. if (array) {
  21601. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  21602. } else {
  21603. output = keys.map(function (key) {
  21604. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  21605. });
  21606. }
  21607. ctx.seen.pop();
  21608. return reduceToSingleString(output, base, braces);
  21609. }
  21610. function formatPrimitive(ctx, value) {
  21611. if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');
  21612. if (isString(value)) {
  21613. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\'';
  21614. return ctx.stylize(simple, 'string');
  21615. }
  21616. if (isNumber(value)) return ctx.stylize('' + value, 'number');
  21617. if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here.
  21618. if (isNull(value)) return ctx.stylize('null', 'null');
  21619. }
  21620. function formatError(value) {
  21621. return '[' + Error.prototype.toString.call(value) + ']';
  21622. }
  21623. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  21624. var output = [];
  21625. for (var i = 0, l = value.length; i < l; ++i) {
  21626. if (hasOwnProperty(value, String(i))) {
  21627. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
  21628. } else {
  21629. output.push('');
  21630. }
  21631. }
  21632. keys.forEach(function (key) {
  21633. if (!key.match(/^\d+$/)) {
  21634. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
  21635. }
  21636. });
  21637. return output;
  21638. }
  21639. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  21640. var name, str, desc;
  21641. desc = Object.getOwnPropertyDescriptor(value, key) || {
  21642. value: value[key]
  21643. };
  21644. if (desc.get) {
  21645. if (desc.set) {
  21646. str = ctx.stylize('[Getter/Setter]', 'special');
  21647. } else {
  21648. str = ctx.stylize('[Getter]', 'special');
  21649. }
  21650. } else {
  21651. if (desc.set) {
  21652. str = ctx.stylize('[Setter]', 'special');
  21653. }
  21654. }
  21655. if (!hasOwnProperty(visibleKeys, key)) {
  21656. name = '[' + key + ']';
  21657. }
  21658. if (!str) {
  21659. if (ctx.seen.indexOf(desc.value) < 0) {
  21660. if (isNull(recurseTimes)) {
  21661. str = formatValue(ctx, desc.value, null);
  21662. } else {
  21663. str = formatValue(ctx, desc.value, recurseTimes - 1);
  21664. }
  21665. if (str.indexOf('\n') > -1) {
  21666. if (array) {
  21667. str = str.split('\n').map(function (line) {
  21668. return ' ' + line;
  21669. }).join('\n').substr(2);
  21670. } else {
  21671. str = '\n' + str.split('\n').map(function (line) {
  21672. return ' ' + line;
  21673. }).join('\n');
  21674. }
  21675. }
  21676. } else {
  21677. str = ctx.stylize('[Circular]', 'special');
  21678. }
  21679. }
  21680. if (isUndefined(name)) {
  21681. if (array && key.match(/^\d+$/)) {
  21682. return str;
  21683. }
  21684. name = JSON.stringify('' + key);
  21685. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  21686. name = name.substr(1, name.length - 2);
  21687. name = ctx.stylize(name, 'name');
  21688. } else {
  21689. name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
  21690. name = ctx.stylize(name, 'string');
  21691. }
  21692. }
  21693. return name + ': ' + str;
  21694. }
  21695. function reduceToSingleString(output, base, braces) {
  21696. var numLinesEst = 0;
  21697. var length = output.reduce(function (prev, cur) {
  21698. numLinesEst++;
  21699. if (cur.indexOf('\n') >= 0) numLinesEst++;
  21700. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  21701. }, 0);
  21702. if (length > 60) {
  21703. return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1];
  21704. }
  21705. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  21706. } // NOTE: These type checking functions intentionally don't use `instanceof`
  21707. // because it is fragile and can be easily faked with `Object.create()`.
  21708. function isArray(ar) {
  21709. return Array.isArray(ar);
  21710. }
  21711. exports.isArray = isArray;
  21712. function isBoolean(arg) {
  21713. return typeof arg === 'boolean';
  21714. }
  21715. exports.isBoolean = isBoolean;
  21716. function isNull(arg) {
  21717. return arg === null;
  21718. }
  21719. exports.isNull = isNull;
  21720. function isNullOrUndefined(arg) {
  21721. return arg == null;
  21722. }
  21723. exports.isNullOrUndefined = isNullOrUndefined;
  21724. function isNumber(arg) {
  21725. return typeof arg === 'number';
  21726. }
  21727. exports.isNumber = isNumber;
  21728. function isString(arg) {
  21729. return typeof arg === 'string';
  21730. }
  21731. exports.isString = isString;
  21732. function isSymbol(arg) {
  21733. return _typeof(arg) === 'symbol';
  21734. }
  21735. exports.isSymbol = isSymbol;
  21736. function isUndefined(arg) {
  21737. return arg === void 0;
  21738. }
  21739. exports.isUndefined = isUndefined;
  21740. function isRegExp(re) {
  21741. return isObject(re) && objectToString(re) === '[object RegExp]';
  21742. }
  21743. exports.isRegExp = isRegExp;
  21744. function isObject(arg) {
  21745. return _typeof(arg) === 'object' && arg !== null;
  21746. }
  21747. exports.isObject = isObject;
  21748. function isDate(d) {
  21749. return isObject(d) && objectToString(d) === '[object Date]';
  21750. }
  21751. exports.isDate = isDate;
  21752. function isError(e) {
  21753. return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);
  21754. }
  21755. exports.isError = isError;
  21756. function isFunction(arg) {
  21757. return typeof arg === 'function';
  21758. }
  21759. exports.isFunction = isFunction;
  21760. function isPrimitive(arg) {
  21761. return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || _typeof(arg) === 'symbol' || // ES6 symbol
  21762. typeof arg === 'undefined';
  21763. }
  21764. exports.isPrimitive = isPrimitive;
  21765. exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ "./node_modules/util/support/isBufferBrowser.js");
  21766. function objectToString(o) {
  21767. return Object.prototype.toString.call(o);
  21768. }
  21769. function pad(n) {
  21770. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  21771. }
  21772. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34
  21773. function timestamp() {
  21774. var d = new Date();
  21775. var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':');
  21776. return [d.getDate(), months[d.getMonth()], time].join(' ');
  21777. } // log is just a thin wrapper to console.log that prepends a timestamp
  21778. exports.log = function () {
  21779. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  21780. };
  21781. /**
  21782. * Inherit the prototype methods from one constructor into another.
  21783. *
  21784. * The Function.prototype.inherits from lang.js rewritten as a standalone
  21785. * function (not on Function.prototype). NOTE: If this file is to be loaded
  21786. * during bootstrapping this function needs to be rewritten using some native
  21787. * functions as prototype setup using normal JavaScript does not work as
  21788. * expected during bootstrapping (see mirror.js in r114903).
  21789. *
  21790. * @param {function} ctor Constructor function which needs to inherit the
  21791. * prototype.
  21792. * @param {function} superCtor Constructor function to inherit prototype from.
  21793. */
  21794. exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/util/node_modules/inherits/inherits_browser.js");
  21795. exports._extend = function (origin, add) {
  21796. // Don't do anything if add isn't an object
  21797. if (!add || !isObject(add)) return origin;
  21798. var keys = Object.keys(add);
  21799. var i = keys.length;
  21800. while (i--) {
  21801. origin[keys[i]] = add[keys[i]];
  21802. }
  21803. return origin;
  21804. };
  21805. function hasOwnProperty(obj, prop) {
  21806. return Object.prototype.hasOwnProperty.call(obj, prop);
  21807. }
  21808. var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;
  21809. exports.promisify = function promisify(original) {
  21810. if (typeof original !== 'function') throw new TypeError('The "original" argument must be of type Function');
  21811. if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
  21812. var fn = original[kCustomPromisifiedSymbol];
  21813. if (typeof fn !== 'function') {
  21814. throw new TypeError('The "util.promisify.custom" argument must be of type Function');
  21815. }
  21816. Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  21817. value: fn,
  21818. enumerable: false,
  21819. writable: false,
  21820. configurable: true
  21821. });
  21822. return fn;
  21823. }
  21824. function fn() {
  21825. var promiseResolve, promiseReject;
  21826. var promise = new Promise(function (resolve, reject) {
  21827. promiseResolve = resolve;
  21828. promiseReject = reject;
  21829. });
  21830. var args = [];
  21831. for (var i = 0; i < arguments.length; i++) {
  21832. args.push(arguments[i]);
  21833. }
  21834. args.push(function (err, value) {
  21835. if (err) {
  21836. promiseReject(err);
  21837. } else {
  21838. promiseResolve(value);
  21839. }
  21840. });
  21841. try {
  21842. original.apply(this, args);
  21843. } catch (err) {
  21844. promiseReject(err);
  21845. }
  21846. return promise;
  21847. }
  21848. Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
  21849. if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  21850. value: fn,
  21851. enumerable: false,
  21852. writable: false,
  21853. configurable: true
  21854. });
  21855. return Object.defineProperties(fn, getOwnPropertyDescriptors(original));
  21856. };
  21857. exports.promisify.custom = kCustomPromisifiedSymbol;
  21858. function callbackifyOnRejected(reason, cb) {
  21859. // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
  21860. // Because `null` is a special error value in callbacks which means "no error
  21861. // occurred", we error-wrap so the callback consumer can distinguish between
  21862. // "the promise rejected with null" or "the promise fulfilled with undefined".
  21863. if (!reason) {
  21864. var newReason = new Error('Promise was rejected with a falsy value');
  21865. newReason.reason = reason;
  21866. reason = newReason;
  21867. }
  21868. return cb(reason);
  21869. }
  21870. function callbackify(original) {
  21871. if (typeof original !== 'function') {
  21872. throw new TypeError('The "original" argument must be of type Function');
  21873. } // We DO NOT return the promise as it gives the user a false sense that
  21874. // the promise is actually somehow related to the callback's execution
  21875. // and that the callback throwing will reject the promise.
  21876. function callbackified() {
  21877. var args = [];
  21878. for (var i = 0; i < arguments.length; i++) {
  21879. args.push(arguments[i]);
  21880. }
  21881. var maybeCb = args.pop();
  21882. if (typeof maybeCb !== 'function') {
  21883. throw new TypeError('The last argument must be of type Function');
  21884. }
  21885. var self = this;
  21886. var cb = function cb() {
  21887. return maybeCb.apply(self, arguments);
  21888. }; // In true node style we process the callback on `nextTick` with all the
  21889. // implications (stack, `uncaughtException`, `async_hooks`)
  21890. original.apply(this, args).then(function (ret) {
  21891. process.nextTick(cb, null, ret);
  21892. }, function (rej) {
  21893. process.nextTick(callbackifyOnRejected, rej, cb);
  21894. });
  21895. }
  21896. Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
  21897. Object.defineProperties(callbackified, getOwnPropertyDescriptors(original));
  21898. return callbackified;
  21899. }
  21900. exports.callbackify = callbackify;
  21901. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  21902. /***/ }),
  21903. /***/ "./node_modules/webpack/buildin/global.js":
  21904. /*!***********************************!*\
  21905. !*** (webpack)/buildin/global.js ***!
  21906. \***********************************/
  21907. /*! no static exports found */
  21908. /***/ (function(module, exports, __webpack_require__) {
  21909. "use strict";
  21910. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  21911. var g; // This works in non-strict mode
  21912. g = function () {
  21913. return this;
  21914. }();
  21915. try {
  21916. // This works if eval is allowed (see CSP)
  21917. g = g || new Function("return this")();
  21918. } catch (e) {
  21919. // This works if the window reference is available
  21920. if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
  21921. } // g can still be undefined, but nothing to do about it...
  21922. // We return undefined, instead of nothing here, so it's
  21923. // easier to handle this case. if(!global) { ...}
  21924. module.exports = g;
  21925. /***/ }),
  21926. /***/ "./node_modules/webpack/buildin/module.js":
  21927. /*!***********************************!*\
  21928. !*** (webpack)/buildin/module.js ***!
  21929. \***********************************/
  21930. /*! no static exports found */
  21931. /***/ (function(module, exports, __webpack_require__) {
  21932. "use strict";
  21933. module.exports = function (module) {
  21934. if (!module.webpackPolyfill) {
  21935. module.deprecate = function () {};
  21936. module.paths = []; // module.parent = undefined by default
  21937. if (!module.children) module.children = [];
  21938. Object.defineProperty(module, "loaded", {
  21939. enumerable: true,
  21940. get: function get() {
  21941. return module.l;
  21942. }
  21943. });
  21944. Object.defineProperty(module, "id", {
  21945. enumerable: true,
  21946. get: function get() {
  21947. return module.i;
  21948. }
  21949. });
  21950. module.webpackPolyfill = 1;
  21951. }
  21952. return module;
  21953. };
  21954. /***/ }),
  21955. /***/ "./packages/diff-sequences/build/index.js":
  21956. /*!************************************************!*\
  21957. !*** ./packages/diff-sequences/build/index.js ***!
  21958. \************************************************/
  21959. /*! no static exports found */
  21960. /***/ (function(module, exports, __webpack_require__) {
  21961. "use strict";
  21962. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  21963. Object.defineProperty(exports, '__esModule', {
  21964. value: true
  21965. });
  21966. exports.default = void 0;
  21967. /**
  21968. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  21969. *
  21970. * This source code is licensed under the MIT license found in the
  21971. * LICENSE file in the root directory of this source tree.
  21972. *
  21973. */
  21974. // This diff-sequences package implements the linear space variation in
  21975. // An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers
  21976. // Relationship in notation between Myers paper and this package:
  21977. // A is a
  21978. // N is aLength, aEnd - aStart, and so on
  21979. // x is aIndex, aFirst, aLast, and so on
  21980. // B is b
  21981. // M is bLength, bEnd - bStart, and so on
  21982. // y is bIndex, bFirst, bLast, and so on
  21983. // Δ = N - M is negative of baDeltaLength = bLength - aLength
  21984. // D is d
  21985. // k is kF
  21986. // k + Δ is kF = kR - baDeltaLength
  21987. // V is aIndexesF or aIndexesR (see comment below about Indexes type)
  21988. // index intervals [1, N] and [1, M] are [0, aLength) and [0, bLength)
  21989. // starting point in forward direction (0, 0) is (-1, -1)
  21990. // starting point in reverse direction (N + 1, M + 1) is (aLength, bLength)
  21991. // The “edit graph” for sequences a and b corresponds to items:
  21992. // in a on the horizontal axis
  21993. // in b on the vertical axis
  21994. //
  21995. // Given a-coordinate of a point in a diagonal, you can compute b-coordinate.
  21996. //
  21997. // Forward diagonals kF:
  21998. // zero diagonal intersects top left corner
  21999. // positive diagonals intersect top edge
  22000. // negative diagonals insersect left edge
  22001. //
  22002. // Reverse diagonals kR:
  22003. // zero diagonal intersects bottom right corner
  22004. // positive diagonals intersect right edge
  22005. // negative diagonals intersect bottom edge
  22006. // The graph contains a directed acyclic graph of edges:
  22007. // horizontal: delete an item from a
  22008. // vertical: insert an item from b
  22009. // diagonal: common item in a and b
  22010. //
  22011. // The algorithm solves dual problems in the graph analogy:
  22012. // Find longest common subsequence: path with maximum number of diagonal edges
  22013. // Find shortest edit script: path with minimum number of non-diagonal edges
  22014. // Input callback function compares items at indexes in the sequences.
  22015. // Output callback function receives the number of adjacent items
  22016. // and starting indexes of each common subsequence.
  22017. // Either original functions or wrapped to swap indexes if graph is transposed.
  22018. // Indexes in sequence a of last point of forward or reverse paths in graph.
  22019. // Myers algorithm indexes by diagonal k which for negative is bad deopt in V8.
  22020. // This package indexes by iF and iR which are greater than or equal to zero.
  22021. // and also updates the index arrays in place to cut memory in half.
  22022. // kF = 2 * iF - d
  22023. // kR = d - 2 * iR
  22024. // Division of index intervals in sequences a and b at the middle change.
  22025. // Invariant: intervals do not have common items at the start or end.
  22026. var pkg = 'diff-sequences'; // for error messages
  22027. var NOT_YET_SET = 0; // small int instead of undefined to avoid deopt in V8
  22028. // Return the number of common items that follow in forward direction.
  22029. // The length of what Myers paper calls a “snake” in a forward path.
  22030. var countCommonItemsF = function countCommonItemsF(aIndex, aEnd, bIndex, bEnd, isCommon) {
  22031. var nCommon = 0;
  22032. while (aIndex < aEnd && bIndex < bEnd && isCommon(aIndex, bIndex)) {
  22033. aIndex += 1;
  22034. bIndex += 1;
  22035. nCommon += 1;
  22036. }
  22037. return nCommon;
  22038. }; // Return the number of common items that precede in reverse direction.
  22039. // The length of what Myers paper calls a “snake” in a reverse path.
  22040. var countCommonItemsR = function countCommonItemsR(aStart, aIndex, bStart, bIndex, isCommon) {
  22041. var nCommon = 0;
  22042. while (aStart <= aIndex && bStart <= bIndex && isCommon(aIndex, bIndex)) {
  22043. aIndex -= 1;
  22044. bIndex -= 1;
  22045. nCommon += 1;
  22046. }
  22047. return nCommon;
  22048. }; // A simple function to extend forward paths from (d - 1) to d changes
  22049. // when forward and reverse paths cannot yet overlap.
  22050. var extendPathsF = function extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF) {
  22051. // Unroll the first iteration.
  22052. var iF = 0;
  22053. var kF = -d; // kF = 2 * iF - d
  22054. var aFirst = aIndexesF[iF]; // in first iteration always insert
  22055. var aIndexPrev1 = aFirst; // prev value of [iF - 1] in next iteration
  22056. aIndexesF[iF] += countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon); // Optimization: skip diagonals in which paths cannot ever overlap.
  22057. var nF = d < iMaxF ? d : iMaxF; // The diagonals kF are odd when d is odd and even when d is even.
  22058. for (iF += 1, kF += 2; iF <= nF; iF += 1, kF += 2) {
  22059. // To get first point of path segment, move one change in forward direction
  22060. // from last point of previous path segment in an adjacent diagonal.
  22061. // In last possible iteration when iF === d and kF === d always delete.
  22062. if (iF !== d && aIndexPrev1 < aIndexesF[iF]) {
  22063. aFirst = aIndexesF[iF]; // vertical to insert from b
  22064. } else {
  22065. aFirst = aIndexPrev1 + 1; // horizontal to delete from a
  22066. if (aEnd <= aFirst) {
  22067. // Optimization: delete moved past right of graph.
  22068. return iF - 1;
  22069. }
  22070. } // To get last point of path segment, move along diagonal of common items.
  22071. aIndexPrev1 = aIndexesF[iF];
  22072. aIndexesF[iF] = aFirst + countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
  22073. }
  22074. return iMaxF;
  22075. }; // A simple function to extend reverse paths from (d - 1) to d changes
  22076. // when reverse and forward paths cannot yet overlap.
  22077. var extendPathsR = function extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR) {
  22078. // Unroll the first iteration.
  22079. var iR = 0;
  22080. var kR = d; // kR = d - 2 * iR
  22081. var aFirst = aIndexesR[iR]; // in first iteration always insert
  22082. var aIndexPrev1 = aFirst; // prev value of [iR - 1] in next iteration
  22083. aIndexesR[iR] -= countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon); // Optimization: skip diagonals in which paths cannot ever overlap.
  22084. var nR = d < iMaxR ? d : iMaxR; // The diagonals kR are odd when d is odd and even when d is even.
  22085. for (iR += 1, kR -= 2; iR <= nR; iR += 1, kR -= 2) {
  22086. // To get first point of path segment, move one change in reverse direction
  22087. // from last point of previous path segment in an adjacent diagonal.
  22088. // In last possible iteration when iR === d and kR === -d always delete.
  22089. if (iR !== d && aIndexesR[iR] < aIndexPrev1) {
  22090. aFirst = aIndexesR[iR]; // vertical to insert from b
  22091. } else {
  22092. aFirst = aIndexPrev1 - 1; // horizontal to delete from a
  22093. if (aFirst < aStart) {
  22094. // Optimization: delete moved past left of graph.
  22095. return iR - 1;
  22096. }
  22097. } // To get last point of path segment, move along diagonal of common items.
  22098. aIndexPrev1 = aIndexesR[iR];
  22099. aIndexesR[iR] = aFirst - countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
  22100. }
  22101. return iMaxR;
  22102. }; // A complete function to extend forward paths from (d - 1) to d changes.
  22103. // Return true if a path overlaps reverse path of (d - 1) changes in its diagonal.
  22104. var extendOverlappablePathsF = function extendOverlappablePathsF(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) {
  22105. var bF = bStart - aStart; // bIndex = bF + aIndex - kF
  22106. var aLength = aEnd - aStart;
  22107. var bLength = bEnd - bStart;
  22108. var baDeltaLength = bLength - aLength; // kF = kR - baDeltaLength
  22109. // Range of diagonals in which forward and reverse paths might overlap.
  22110. var kMinOverlapF = -baDeltaLength - (d - 1); // -(d - 1) <= kR
  22111. var kMaxOverlapF = -baDeltaLength + (d - 1); // kR <= (d - 1)
  22112. var aIndexPrev1 = NOT_YET_SET; // prev value of [iF - 1] in next iteration
  22113. // Optimization: skip diagonals in which paths cannot ever overlap.
  22114. var nF = d < iMaxF ? d : iMaxF; // The diagonals kF = 2 * iF - d are odd when d is odd and even when d is even.
  22115. for (var iF = 0, kF = -d; iF <= nF; iF += 1, kF += 2) {
  22116. // To get first point of path segment, move one change in forward direction
  22117. // from last point of previous path segment in an adjacent diagonal.
  22118. // In first iteration when iF === 0 and kF === -d always insert.
  22119. // In last possible iteration when iF === d and kF === d always delete.
  22120. var insert = iF === 0 || iF !== d && aIndexPrev1 < aIndexesF[iF];
  22121. var aLastPrev = insert ? aIndexesF[iF] : aIndexPrev1;
  22122. var aFirst = insert ? aLastPrev // vertical to insert from b
  22123. : aLastPrev + 1; // horizontal to delete from a
  22124. // To get last point of path segment, move along diagonal of common items.
  22125. var bFirst = bF + aFirst - kF;
  22126. var nCommonF = countCommonItemsF(aFirst + 1, aEnd, bFirst + 1, bEnd, isCommon);
  22127. var aLast = aFirst + nCommonF;
  22128. aIndexPrev1 = aIndexesF[iF];
  22129. aIndexesF[iF] = aLast;
  22130. if (kMinOverlapF <= kF && kF <= kMaxOverlapF) {
  22131. // Solve for iR of reverse path with (d - 1) changes in diagonal kF:
  22132. // kR = kF + baDeltaLength
  22133. // kR = (d - 1) - 2 * iR
  22134. var iR = (d - 1 - (kF + baDeltaLength)) / 2; // If this forward path overlaps the reverse path in this diagonal,
  22135. // then this is the middle change of the index intervals.
  22136. if (iR <= iMaxR && aIndexesR[iR] - 1 <= aLast) {
  22137. // Unlike the Myers algorithm which finds only the middle “snake”
  22138. // this package can find two common subsequences per division.
  22139. // Last point of previous path segment is on an adjacent diagonal.
  22140. var bLastPrev = bF + aLastPrev - (insert ? kF + 1 : kF - 1); // Because of invariant that intervals preceding the middle change
  22141. // cannot have common items at the end,
  22142. // move in reverse direction along a diagonal of common items.
  22143. var nCommonR = countCommonItemsR(aStart, aLastPrev, bStart, bLastPrev, isCommon);
  22144. var aIndexPrevFirst = aLastPrev - nCommonR;
  22145. var bIndexPrevFirst = bLastPrev - nCommonR;
  22146. var aEndPreceding = aIndexPrevFirst + 1;
  22147. var bEndPreceding = bIndexPrevFirst + 1;
  22148. division.nChangePreceding = d - 1;
  22149. if (d - 1 === aEndPreceding + bEndPreceding - aStart - bStart) {
  22150. // Optimization: number of preceding changes in forward direction
  22151. // is equal to number of items in preceding interval,
  22152. // therefore it cannot contain any common items.
  22153. division.aEndPreceding = aStart;
  22154. division.bEndPreceding = bStart;
  22155. } else {
  22156. division.aEndPreceding = aEndPreceding;
  22157. division.bEndPreceding = bEndPreceding;
  22158. }
  22159. division.nCommonPreceding = nCommonR;
  22160. if (nCommonR !== 0) {
  22161. division.aCommonPreceding = aEndPreceding;
  22162. division.bCommonPreceding = bEndPreceding;
  22163. }
  22164. division.nCommonFollowing = nCommonF;
  22165. if (nCommonF !== 0) {
  22166. division.aCommonFollowing = aFirst + 1;
  22167. division.bCommonFollowing = bFirst + 1;
  22168. }
  22169. var aStartFollowing = aLast + 1;
  22170. var bStartFollowing = bFirst + nCommonF + 1;
  22171. division.nChangeFollowing = d - 1;
  22172. if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
  22173. // Optimization: number of changes in reverse direction
  22174. // is equal to number of items in following interval,
  22175. // therefore it cannot contain any common items.
  22176. division.aStartFollowing = aEnd;
  22177. division.bStartFollowing = bEnd;
  22178. } else {
  22179. division.aStartFollowing = aStartFollowing;
  22180. division.bStartFollowing = bStartFollowing;
  22181. }
  22182. return true;
  22183. }
  22184. }
  22185. }
  22186. return false;
  22187. }; // A complete function to extend reverse paths from (d - 1) to d changes.
  22188. // Return true if a path overlaps forward path of d changes in its diagonal.
  22189. var extendOverlappablePathsR = function extendOverlappablePathsR(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) {
  22190. var bR = bEnd - aEnd; // bIndex = bR + aIndex - kR
  22191. var aLength = aEnd - aStart;
  22192. var bLength = bEnd - bStart;
  22193. var baDeltaLength = bLength - aLength; // kR = kF + baDeltaLength
  22194. // Range of diagonals in which forward and reverse paths might overlap.
  22195. var kMinOverlapR = baDeltaLength - d; // -d <= kF
  22196. var kMaxOverlapR = baDeltaLength + d; // kF <= d
  22197. var aIndexPrev1 = NOT_YET_SET; // prev value of [iR - 1] in next iteration
  22198. // Optimization: skip diagonals in which paths cannot ever overlap.
  22199. var nR = d < iMaxR ? d : iMaxR; // The diagonals kR = d - 2 * iR are odd when d is odd and even when d is even.
  22200. for (var iR = 0, kR = d; iR <= nR; iR += 1, kR -= 2) {
  22201. // To get first point of path segment, move one change in reverse direction
  22202. // from last point of previous path segment in an adjacent diagonal.
  22203. // In first iteration when iR === 0 and kR === d always insert.
  22204. // In last possible iteration when iR === d and kR === -d always delete.
  22205. var insert = iR === 0 || iR !== d && aIndexesR[iR] < aIndexPrev1;
  22206. var aLastPrev = insert ? aIndexesR[iR] : aIndexPrev1;
  22207. var aFirst = insert ? aLastPrev // vertical to insert from b
  22208. : aLastPrev - 1; // horizontal to delete from a
  22209. // To get last point of path segment, move along diagonal of common items.
  22210. var bFirst = bR + aFirst - kR;
  22211. var nCommonR = countCommonItemsR(aStart, aFirst - 1, bStart, bFirst - 1, isCommon);
  22212. var aLast = aFirst - nCommonR;
  22213. aIndexPrev1 = aIndexesR[iR];
  22214. aIndexesR[iR] = aLast;
  22215. if (kMinOverlapR <= kR && kR <= kMaxOverlapR) {
  22216. // Solve for iF of forward path with d changes in diagonal kR:
  22217. // kF = kR - baDeltaLength
  22218. // kF = 2 * iF - d
  22219. var iF = (d + (kR - baDeltaLength)) / 2; // If this reverse path overlaps the forward path in this diagonal,
  22220. // then this is a middle change of the index intervals.
  22221. if (iF <= iMaxF && aLast - 1 <= aIndexesF[iF]) {
  22222. var bLast = bFirst - nCommonR;
  22223. division.nChangePreceding = d;
  22224. if (d === aLast + bLast - aStart - bStart) {
  22225. // Optimization: number of changes in reverse direction
  22226. // is equal to number of items in preceding interval,
  22227. // therefore it cannot contain any common items.
  22228. division.aEndPreceding = aStart;
  22229. division.bEndPreceding = bStart;
  22230. } else {
  22231. division.aEndPreceding = aLast;
  22232. division.bEndPreceding = bLast;
  22233. }
  22234. division.nCommonPreceding = nCommonR;
  22235. if (nCommonR !== 0) {
  22236. // The last point of reverse path segment is start of common subsequence.
  22237. division.aCommonPreceding = aLast;
  22238. division.bCommonPreceding = bLast;
  22239. }
  22240. division.nChangeFollowing = d - 1;
  22241. if (d === 1) {
  22242. // There is no previous path segment.
  22243. division.nCommonFollowing = 0;
  22244. division.aStartFollowing = aEnd;
  22245. division.bStartFollowing = bEnd;
  22246. } else {
  22247. // Unlike the Myers algorithm which finds only the middle “snake”
  22248. // this package can find two common subsequences per division.
  22249. // Last point of previous path segment is on an adjacent diagonal.
  22250. var bLastPrev = bR + aLastPrev - (insert ? kR - 1 : kR + 1); // Because of invariant that intervals following the middle change
  22251. // cannot have common items at the start,
  22252. // move in forward direction along a diagonal of common items.
  22253. var nCommonF = countCommonItemsF(aLastPrev, aEnd, bLastPrev, bEnd, isCommon);
  22254. division.nCommonFollowing = nCommonF;
  22255. if (nCommonF !== 0) {
  22256. // The last point of reverse path segment is start of common subsequence.
  22257. division.aCommonFollowing = aLastPrev;
  22258. division.bCommonFollowing = bLastPrev;
  22259. }
  22260. var aStartFollowing = aLastPrev + nCommonF; // aFirstPrev
  22261. var bStartFollowing = bLastPrev + nCommonF; // bFirstPrev
  22262. if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
  22263. // Optimization: number of changes in forward direction
  22264. // is equal to number of items in following interval,
  22265. // therefore it cannot contain any common items.
  22266. division.aStartFollowing = aEnd;
  22267. division.bStartFollowing = bEnd;
  22268. } else {
  22269. division.aStartFollowing = aStartFollowing;
  22270. division.bStartFollowing = bStartFollowing;
  22271. }
  22272. }
  22273. return true;
  22274. }
  22275. }
  22276. }
  22277. return false;
  22278. }; // Given index intervals and input function to compare items at indexes,
  22279. // divide at the middle change.
  22280. //
  22281. // DO NOT CALL if start === end, because interval cannot contain common items
  22282. // and because this function will throw the “no overlap” error.
  22283. var divide = function divide(nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division // output
  22284. ) {
  22285. var bF = bStart - aStart; // bIndex = bF + aIndex - kF
  22286. var bR = bEnd - aEnd; // bIndex = bR + aIndex - kR
  22287. var aLength = aEnd - aStart;
  22288. var bLength = bEnd - bStart; // Because graph has square or portrait orientation,
  22289. // length difference is minimum number of items to insert from b.
  22290. // Corresponding forward and reverse diagonals in graph
  22291. // depend on length difference of the sequences:
  22292. // kF = kR - baDeltaLength
  22293. // kR = kF + baDeltaLength
  22294. var baDeltaLength = bLength - aLength; // Optimization: max diagonal in graph intersects corner of shorter side.
  22295. var iMaxF = aLength;
  22296. var iMaxR = aLength; // Initialize no changes yet in forward or reverse direction:
  22297. aIndexesF[0] = aStart - 1; // at open start of interval, outside closed start
  22298. aIndexesR[0] = aEnd; // at open end of interval
  22299. if (baDeltaLength % 2 === 0) {
  22300. // The number of changes in paths is 2 * d if length difference is even.
  22301. var dMin = (nChange || baDeltaLength) / 2;
  22302. var dMax = (aLength + bLength) / 2;
  22303. for (var d = 1; d <= dMax; d += 1) {
  22304. iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
  22305. if (d < dMin) {
  22306. iMaxR = extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
  22307. } else if ( // If a reverse path overlaps a forward path in the same diagonal,
  22308. // return a division of the index intervals at the middle change.
  22309. extendOverlappablePathsR(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)) {
  22310. return;
  22311. }
  22312. }
  22313. } else {
  22314. // The number of changes in paths is 2 * d - 1 if length difference is odd.
  22315. var _dMin = ((nChange || baDeltaLength) + 1) / 2;
  22316. var _dMax = (aLength + bLength + 1) / 2; // Unroll first half iteration so loop extends the relevant pairs of paths.
  22317. // Because of invariant that intervals have no common items at start or end,
  22318. // and limitation not to call divide with empty intervals,
  22319. // therefore it cannot be called if a forward path with one change
  22320. // would overlap a reverse path with no changes, even if dMin === 1.
  22321. var _d = 1;
  22322. iMaxF = extendPathsF(_d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
  22323. for (_d += 1; _d <= _dMax; _d += 1) {
  22324. iMaxR = extendPathsR(_d - 1, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
  22325. if (_d < _dMin) {
  22326. iMaxF = extendPathsF(_d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
  22327. } else if ( // If a forward path overlaps a reverse path in the same diagonal,
  22328. // return a division of the index intervals at the middle change.
  22329. extendOverlappablePathsF(_d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)) {
  22330. return;
  22331. }
  22332. }
  22333. }
  22334. /* istanbul ignore next */
  22335. throw new Error("".concat(pkg, ": no overlap aStart=").concat(aStart, " aEnd=").concat(aEnd, " bStart=").concat(bStart, " bEnd=").concat(bEnd));
  22336. }; // Given index intervals and input function to compare items at indexes,
  22337. // return by output function the number of adjacent items and starting indexes
  22338. // of each common subsequence. Divide and conquer with only linear space.
  22339. //
  22340. // The index intervals are half open [start, end) like array slice method.
  22341. // DO NOT CALL if start === end, because interval cannot contain common items
  22342. // and because divide function will throw the “no overlap” error.
  22343. var findSubsequences = function findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division // temporary memory, not input nor output
  22344. ) {
  22345. if (bEnd - bStart < aEnd - aStart) {
  22346. // Transpose graph so it has portrait instead of landscape orientation.
  22347. // Always compare shorter to longer sequence for consistency and optimization.
  22348. transposed = !transposed;
  22349. if (transposed && callbacks.length === 1) {
  22350. // Lazily wrap callback functions to swap args if graph is transposed.
  22351. var _callbacks$ = callbacks[0],
  22352. _foundSubsequence2 = _callbacks$.foundSubsequence,
  22353. _isCommon2 = _callbacks$.isCommon;
  22354. callbacks[1] = {
  22355. foundSubsequence: function (_foundSubsequence) {
  22356. function foundSubsequence(_x, _x2, _x3) {
  22357. return _foundSubsequence.apply(this, arguments);
  22358. }
  22359. foundSubsequence.toString = function () {
  22360. return _foundSubsequence.toString();
  22361. };
  22362. return foundSubsequence;
  22363. }(function (nCommon, bCommon, aCommon) {
  22364. _foundSubsequence2(nCommon, aCommon, bCommon);
  22365. }),
  22366. isCommon: function (_isCommon) {
  22367. function isCommon(_x4, _x5) {
  22368. return _isCommon.apply(this, arguments);
  22369. }
  22370. isCommon.toString = function () {
  22371. return _isCommon.toString();
  22372. };
  22373. return isCommon;
  22374. }(function (bIndex, aIndex) {
  22375. return _isCommon2(aIndex, bIndex);
  22376. })
  22377. };
  22378. }
  22379. var tStart = aStart;
  22380. var tEnd = aEnd;
  22381. aStart = bStart;
  22382. aEnd = bEnd;
  22383. bStart = tStart;
  22384. bEnd = tEnd;
  22385. }
  22386. var _callbacks = callbacks[transposed ? 1 : 0],
  22387. foundSubsequence = _callbacks.foundSubsequence,
  22388. isCommon = _callbacks.isCommon; // Divide the index intervals at the middle change.
  22389. divide(nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division);
  22390. var nChangePreceding = division.nChangePreceding,
  22391. aEndPreceding = division.aEndPreceding,
  22392. bEndPreceding = division.bEndPreceding,
  22393. nCommonPreceding = division.nCommonPreceding,
  22394. aCommonPreceding = division.aCommonPreceding,
  22395. bCommonPreceding = division.bCommonPreceding,
  22396. nCommonFollowing = division.nCommonFollowing,
  22397. aCommonFollowing = division.aCommonFollowing,
  22398. bCommonFollowing = division.bCommonFollowing,
  22399. nChangeFollowing = division.nChangeFollowing,
  22400. aStartFollowing = division.aStartFollowing,
  22401. bStartFollowing = division.bStartFollowing; // Unless either index interval is empty, they might contain common items.
  22402. if (aStart < aEndPreceding && bStart < bEndPreceding) {
  22403. // Recursely find and return common subsequences preceding the division.
  22404. findSubsequences(nChangePreceding, aStart, aEndPreceding, bStart, bEndPreceding, transposed, callbacks, aIndexesF, aIndexesR, division);
  22405. } // Return common subsequences that are adjacent to the middle change.
  22406. if (nCommonPreceding !== 0) {
  22407. foundSubsequence(nCommonPreceding, aCommonPreceding, bCommonPreceding);
  22408. }
  22409. if (nCommonFollowing !== 0) {
  22410. foundSubsequence(nCommonFollowing, aCommonFollowing, bCommonFollowing);
  22411. } // Unless either index interval is empty, they might contain common items.
  22412. if (aStartFollowing < aEnd && bStartFollowing < bEnd) {
  22413. // Recursely find and return common subsequences following the division.
  22414. findSubsequences(nChangeFollowing, aStartFollowing, aEnd, bStartFollowing, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
  22415. }
  22416. };
  22417. var validateLength = function validateLength(name, arg) {
  22418. var type = _typeof(arg);
  22419. if (type !== 'number') {
  22420. throw new TypeError("".concat(pkg, ": ").concat(name, " typeof ").concat(type, " is not a number"));
  22421. }
  22422. if (!Number.isSafeInteger(arg)) {
  22423. throw new RangeError("".concat(pkg, ": ").concat(name, " value ").concat(arg, " is not a safe integer"));
  22424. }
  22425. if (arg < 0) {
  22426. throw new RangeError("".concat(pkg, ": ").concat(name, " value ").concat(arg, " is a negative integer"));
  22427. }
  22428. };
  22429. var validateCallback = function validateCallback(name, arg) {
  22430. var type = _typeof(arg);
  22431. if (type !== 'function') {
  22432. throw new TypeError("".concat(pkg, ": ").concat(name, " typeof ").concat(type, " is not a function"));
  22433. }
  22434. }; // Compare items in two sequences to find a longest common subsequence.
  22435. // Given lengths of sequences and input function to compare items at indexes,
  22436. // return by output function the number of adjacent items and starting indexes
  22437. // of each common subsequence.
  22438. var _default = function _default(aLength, bLength, isCommon, foundSubsequence) {
  22439. validateLength('aLength', aLength);
  22440. validateLength('bLength', bLength);
  22441. validateCallback('isCommon', isCommon);
  22442. validateCallback('foundSubsequence', foundSubsequence); // Count common items from the start in the forward direction.
  22443. var nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon);
  22444. if (nCommonF !== 0) {
  22445. foundSubsequence(nCommonF, 0, 0);
  22446. } // Unless both sequences consist of common items only,
  22447. // find common items in the half-trimmed index intervals.
  22448. if (aLength !== nCommonF || bLength !== nCommonF) {
  22449. // Invariant: intervals do not have common items at the start.
  22450. // The start of an index interval is closed like array slice method.
  22451. var aStart = nCommonF;
  22452. var bStart = nCommonF; // Count common items from the end in the reverse direction.
  22453. var nCommonR = countCommonItemsR(aStart, aLength - 1, bStart, bLength - 1, isCommon); // Invariant: intervals do not have common items at the end.
  22454. // The end of an index interval is open like array slice method.
  22455. var aEnd = aLength - nCommonR;
  22456. var bEnd = bLength - nCommonR; // Unless one sequence consists of common items only,
  22457. // therefore the other trimmed index interval consists of changes only,
  22458. // find common items in the trimmed index intervals.
  22459. var nCommonFR = nCommonF + nCommonR;
  22460. if (aLength !== nCommonFR && bLength !== nCommonFR) {
  22461. var nChange = 0; // number of change items is not yet known
  22462. var transposed = false; // call the original unwrapped functions
  22463. var callbacks = [{
  22464. foundSubsequence: foundSubsequence,
  22465. isCommon: isCommon
  22466. }]; // Indexes in sequence a of last points in furthest reaching paths
  22467. // from outside the start at top left in the forward direction:
  22468. var aIndexesF = [NOT_YET_SET]; // from the end at bottom right in the reverse direction:
  22469. var aIndexesR = [NOT_YET_SET]; // Initialize one object as output of all calls to divide function.
  22470. var division = {
  22471. aCommonFollowing: NOT_YET_SET,
  22472. aCommonPreceding: NOT_YET_SET,
  22473. aEndPreceding: NOT_YET_SET,
  22474. aStartFollowing: NOT_YET_SET,
  22475. bCommonFollowing: NOT_YET_SET,
  22476. bCommonPreceding: NOT_YET_SET,
  22477. bEndPreceding: NOT_YET_SET,
  22478. bStartFollowing: NOT_YET_SET,
  22479. nChangeFollowing: NOT_YET_SET,
  22480. nChangePreceding: NOT_YET_SET,
  22481. nCommonFollowing: NOT_YET_SET,
  22482. nCommonPreceding: NOT_YET_SET
  22483. }; // Find and return common subsequences in the trimmed index intervals.
  22484. findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
  22485. }
  22486. if (nCommonR !== 0) {
  22487. foundSubsequence(nCommonR, aEnd, bEnd);
  22488. }
  22489. }
  22490. };
  22491. exports.default = _default;
  22492. /***/ }),
  22493. /***/ "./packages/expect/build/fakeChalk.js":
  22494. /*!********************************************!*\
  22495. !*** ./packages/expect/build/fakeChalk.js ***!
  22496. \********************************************/
  22497. /*! no static exports found */
  22498. /***/ (function(module, exports, __webpack_require__) {
  22499. "use strict";
  22500. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  22501. var _ansiStyles = _interopRequireDefault(__webpack_require__(/*! ansi-styles */ "./node_modules/ansi-styles/index.js"));
  22502. function _interopRequireDefault(obj) {
  22503. return obj && obj.__esModule ? obj : {
  22504. default: obj
  22505. };
  22506. }
  22507. /**
  22508. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  22509. *
  22510. * This source code is licensed under the MIT license found in the
  22511. * LICENSE file in the root directory of this source tree.
  22512. */
  22513. var returnInput = function returnInput(str) {
  22514. return str;
  22515. };
  22516. var allColorsAsFunc = Object.keys(_ansiStyles.default).map(function (style) {
  22517. return _defineProperty({}, style, returnInput);
  22518. }).reduce(function (acc, cur) {
  22519. return Object.assign(acc, cur);
  22520. });
  22521. Object.keys(allColorsAsFunc).map(function (color) {
  22522. return allColorsAsFunc[color];
  22523. }).forEach(function (style) {
  22524. Object.assign(style, allColorsAsFunc);
  22525. Object.assign(returnInput, style);
  22526. });
  22527. module.exports = allColorsAsFunc;
  22528. /***/ }),
  22529. /***/ "./packages/expect/src/asymmetricMatchers.ts":
  22530. /*!***************************************************!*\
  22531. !*** ./packages/expect/src/asymmetricMatchers.ts ***!
  22532. \***************************************************/
  22533. /*! no static exports found */
  22534. /***/ (function(module, exports, __webpack_require__) {
  22535. "use strict";
  22536. Object.defineProperty(exports, "__esModule", {
  22537. value: true
  22538. });
  22539. exports.stringNotMatching = exports.stringMatching = exports.stringNotContaining = exports.stringContaining = exports.objectNotContaining = exports.objectContaining = exports.arrayNotContaining = exports.arrayContaining = exports.anything = exports.any = exports.AsymmetricMatcher = void 0;
  22540. var _jasmineUtils = __webpack_require__(/*! ./jasmineUtils */ "./packages/expect/src/jasmineUtils.ts");
  22541. var _utils = __webpack_require__(/*! ./utils */ "./packages/expect/src/utils.ts");
  22542. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  22543. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22544. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  22545. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  22546. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22547. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  22548. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  22549. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  22550. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22551. var AsymmetricMatcher = function AsymmetricMatcher(sample) {
  22552. _classCallCheck(this, AsymmetricMatcher);
  22553. this.$$typeof = Symbol.for('jest.asymmetricMatcher');
  22554. this.sample = sample;
  22555. };
  22556. exports.AsymmetricMatcher = AsymmetricMatcher;
  22557. var Any =
  22558. /*#__PURE__*/
  22559. function (_AsymmetricMatcher) {
  22560. _inherits(Any, _AsymmetricMatcher);
  22561. function Any(sample) {
  22562. _classCallCheck(this, Any);
  22563. if (typeof sample === 'undefined') {
  22564. throw new TypeError('any() expects to be passed a constructor function. ' + 'Please pass one or use anything() to match any object.');
  22565. }
  22566. return _possibleConstructorReturn(this, _getPrototypeOf(Any).call(this, sample));
  22567. }
  22568. _createClass(Any, [{
  22569. key: "asymmetricMatch",
  22570. value: function asymmetricMatch(other) {
  22571. if (this.sample == String) {
  22572. return typeof other == 'string' || other instanceof String;
  22573. }
  22574. if (this.sample == Number) {
  22575. return typeof other == 'number' || other instanceof Number;
  22576. }
  22577. if (this.sample == Function) {
  22578. return typeof other == 'function' || other instanceof Function;
  22579. }
  22580. if (this.sample == Object) {
  22581. return _typeof(other) == 'object';
  22582. }
  22583. if (this.sample == Boolean) {
  22584. return typeof other == 'boolean';
  22585. }
  22586. return other instanceof this.sample;
  22587. }
  22588. }, {
  22589. key: "toString",
  22590. value: function toString() {
  22591. return 'Any';
  22592. }
  22593. }, {
  22594. key: "getExpectedType",
  22595. value: function getExpectedType() {
  22596. if (this.sample == String) {
  22597. return 'string';
  22598. }
  22599. if (this.sample == Number) {
  22600. return 'number';
  22601. }
  22602. if (this.sample == Function) {
  22603. return 'function';
  22604. }
  22605. if (this.sample == Object) {
  22606. return 'object';
  22607. }
  22608. if (this.sample == Boolean) {
  22609. return 'boolean';
  22610. }
  22611. return (0, _jasmineUtils.fnNameFor)(this.sample);
  22612. }
  22613. }, {
  22614. key: "toAsymmetricMatcher",
  22615. value: function toAsymmetricMatcher() {
  22616. return 'Any<' + (0, _jasmineUtils.fnNameFor)(this.sample) + '>';
  22617. }
  22618. }]);
  22619. return Any;
  22620. }(AsymmetricMatcher);
  22621. var Anything =
  22622. /*#__PURE__*/
  22623. function (_AsymmetricMatcher2) {
  22624. _inherits(Anything, _AsymmetricMatcher2);
  22625. function Anything() {
  22626. _classCallCheck(this, Anything);
  22627. return _possibleConstructorReturn(this, _getPrototypeOf(Anything).apply(this, arguments));
  22628. }
  22629. _createClass(Anything, [{
  22630. key: "asymmetricMatch",
  22631. value: function asymmetricMatch(other) {
  22632. return !(0, _jasmineUtils.isUndefined)(other) && other !== null;
  22633. }
  22634. }, {
  22635. key: "toString",
  22636. value: function toString() {
  22637. return 'Anything';
  22638. } // No getExpectedType method, because it matches either null or undefined.
  22639. }, {
  22640. key: "toAsymmetricMatcher",
  22641. value: function toAsymmetricMatcher() {
  22642. return 'Anything';
  22643. }
  22644. }]);
  22645. return Anything;
  22646. }(AsymmetricMatcher);
  22647. var ArrayContaining =
  22648. /*#__PURE__*/
  22649. function (_AsymmetricMatcher3) {
  22650. _inherits(ArrayContaining, _AsymmetricMatcher3);
  22651. function ArrayContaining(sample) {
  22652. var _this;
  22653. var inverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22654. _classCallCheck(this, ArrayContaining);
  22655. _this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayContaining).call(this, sample));
  22656. _this.inverse = inverse;
  22657. return _this;
  22658. }
  22659. _createClass(ArrayContaining, [{
  22660. key: "asymmetricMatch",
  22661. value: function asymmetricMatch(other) {
  22662. if (!Array.isArray(this.sample)) {
  22663. throw new Error("You must provide an array to ".concat(this.toString(), ", not '") + _typeof(this.sample) + "'.");
  22664. }
  22665. var result = this.sample.length === 0 || Array.isArray(other) && this.sample.every(function (item) {
  22666. return other.some(function (another) {
  22667. return (0, _jasmineUtils.equals)(item, another);
  22668. });
  22669. });
  22670. return this.inverse ? !result : result;
  22671. }
  22672. }, {
  22673. key: "toString",
  22674. value: function toString() {
  22675. return "Array".concat(this.inverse ? 'Not' : '', "Containing");
  22676. }
  22677. }, {
  22678. key: "getExpectedType",
  22679. value: function getExpectedType() {
  22680. return 'array';
  22681. }
  22682. }]);
  22683. return ArrayContaining;
  22684. }(AsymmetricMatcher);
  22685. var ObjectContaining =
  22686. /*#__PURE__*/
  22687. function (_AsymmetricMatcher4) {
  22688. _inherits(ObjectContaining, _AsymmetricMatcher4);
  22689. function ObjectContaining(sample) {
  22690. var _this2;
  22691. var inverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22692. _classCallCheck(this, ObjectContaining);
  22693. _this2 = _possibleConstructorReturn(this, _getPrototypeOf(ObjectContaining).call(this, sample));
  22694. _this2.inverse = inverse;
  22695. return _this2;
  22696. }
  22697. _createClass(ObjectContaining, [{
  22698. key: "asymmetricMatch",
  22699. value: function asymmetricMatch(other) {
  22700. if (_typeof(this.sample) !== 'object') {
  22701. throw new Error("You must provide an object to ".concat(this.toString(), ", not '") + _typeof(this.sample) + "'.");
  22702. }
  22703. if (this.inverse) {
  22704. for (var property in this.sample) {
  22705. if ((0, _jasmineUtils.hasProperty)(other, property) && (0, _jasmineUtils.equals)(this.sample[property], other[property]) && !(0, _utils.emptyObject)(this.sample[property]) && !(0, _utils.emptyObject)(other[property])) {
  22706. return false;
  22707. }
  22708. }
  22709. return true;
  22710. } else {
  22711. for (var _property in this.sample) {
  22712. if (!(0, _jasmineUtils.hasProperty)(other, _property) || !(0, _jasmineUtils.equals)(this.sample[_property], other[_property])) {
  22713. return false;
  22714. }
  22715. }
  22716. return true;
  22717. }
  22718. }
  22719. }, {
  22720. key: "toString",
  22721. value: function toString() {
  22722. return "Object".concat(this.inverse ? 'Not' : '', "Containing");
  22723. }
  22724. }, {
  22725. key: "getExpectedType",
  22726. value: function getExpectedType() {
  22727. return 'object';
  22728. }
  22729. }]);
  22730. return ObjectContaining;
  22731. }(AsymmetricMatcher);
  22732. var StringContaining =
  22733. /*#__PURE__*/
  22734. function (_AsymmetricMatcher5) {
  22735. _inherits(StringContaining, _AsymmetricMatcher5);
  22736. function StringContaining(sample) {
  22737. var _this3;
  22738. var inverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22739. _classCallCheck(this, StringContaining);
  22740. if (!(0, _jasmineUtils.isA)('String', sample)) {
  22741. throw new Error('Expected is not a string');
  22742. }
  22743. _this3 = _possibleConstructorReturn(this, _getPrototypeOf(StringContaining).call(this, sample));
  22744. _this3.inverse = inverse;
  22745. return _this3;
  22746. }
  22747. _createClass(StringContaining, [{
  22748. key: "asymmetricMatch",
  22749. value: function asymmetricMatch(other) {
  22750. var result = (0, _jasmineUtils.isA)('String', other) && other.includes(this.sample);
  22751. return this.inverse ? !result : result;
  22752. }
  22753. }, {
  22754. key: "toString",
  22755. value: function toString() {
  22756. return "String".concat(this.inverse ? 'Not' : '', "Containing");
  22757. }
  22758. }, {
  22759. key: "getExpectedType",
  22760. value: function getExpectedType() {
  22761. return 'string';
  22762. }
  22763. }]);
  22764. return StringContaining;
  22765. }(AsymmetricMatcher);
  22766. var StringMatching =
  22767. /*#__PURE__*/
  22768. function (_AsymmetricMatcher6) {
  22769. _inherits(StringMatching, _AsymmetricMatcher6);
  22770. function StringMatching(sample) {
  22771. var _this4;
  22772. var inverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22773. _classCallCheck(this, StringMatching);
  22774. if (!(0, _jasmineUtils.isA)('String', sample) && !(0, _jasmineUtils.isA)('RegExp', sample)) {
  22775. throw new Error('Expected is not a String or a RegExp');
  22776. }
  22777. _this4 = _possibleConstructorReturn(this, _getPrototypeOf(StringMatching).call(this, new RegExp(sample)));
  22778. _this4.inverse = inverse;
  22779. return _this4;
  22780. }
  22781. _createClass(StringMatching, [{
  22782. key: "asymmetricMatch",
  22783. value: function asymmetricMatch(other) {
  22784. var result = (0, _jasmineUtils.isA)('String', other) && this.sample.test(other);
  22785. return this.inverse ? !result : result;
  22786. }
  22787. }, {
  22788. key: "toString",
  22789. value: function toString() {
  22790. return "String".concat(this.inverse ? 'Not' : '', "Matching");
  22791. }
  22792. }, {
  22793. key: "getExpectedType",
  22794. value: function getExpectedType() {
  22795. return 'string';
  22796. }
  22797. }]);
  22798. return StringMatching;
  22799. }(AsymmetricMatcher);
  22800. var any = function any(expectedObject) {
  22801. return new Any(expectedObject);
  22802. };
  22803. exports.any = any;
  22804. var anything = function anything() {
  22805. return new Anything();
  22806. };
  22807. exports.anything = anything;
  22808. var arrayContaining = function arrayContaining(sample) {
  22809. return new ArrayContaining(sample);
  22810. };
  22811. exports.arrayContaining = arrayContaining;
  22812. var arrayNotContaining = function arrayNotContaining(sample) {
  22813. return new ArrayContaining(sample, true);
  22814. };
  22815. exports.arrayNotContaining = arrayNotContaining;
  22816. var objectContaining = function objectContaining(sample) {
  22817. return new ObjectContaining(sample);
  22818. };
  22819. exports.objectContaining = objectContaining;
  22820. var objectNotContaining = function objectNotContaining(sample) {
  22821. return new ObjectContaining(sample, true);
  22822. };
  22823. exports.objectNotContaining = objectNotContaining;
  22824. var stringContaining = function stringContaining(expected) {
  22825. return new StringContaining(expected);
  22826. };
  22827. exports.stringContaining = stringContaining;
  22828. var stringNotContaining = function stringNotContaining(expected) {
  22829. return new StringContaining(expected, true);
  22830. };
  22831. exports.stringNotContaining = stringNotContaining;
  22832. var stringMatching = function stringMatching(expected) {
  22833. return new StringMatching(expected);
  22834. };
  22835. exports.stringMatching = stringMatching;
  22836. var stringNotMatching = function stringNotMatching(expected) {
  22837. return new StringMatching(expected, true);
  22838. };
  22839. exports.stringNotMatching = stringNotMatching;
  22840. /***/ }),
  22841. /***/ "./packages/expect/src/extractExpectedAssertionsErrors.ts":
  22842. /*!****************************************************************!*\
  22843. !*** ./packages/expect/src/extractExpectedAssertionsErrors.ts ***!
  22844. \****************************************************************/
  22845. /*! no static exports found */
  22846. /***/ (function(module, exports, __webpack_require__) {
  22847. "use strict";
  22848. Object.defineProperty(exports, "__esModule", {
  22849. value: true
  22850. });
  22851. exports.default = void 0;
  22852. var _jestMatcherUtils = __webpack_require__(/*! jest-matcher-utils */ "./packages/jest-matcher-utils/build/index.js");
  22853. var _jestMatchersObject = __webpack_require__(/*! ./jestMatchersObject */ "./packages/expect/src/jestMatchersObject.ts");
  22854. /**
  22855. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  22856. *
  22857. * This source code is licensed under the MIT license found in the
  22858. * LICENSE file in the root directory of this source tree.
  22859. *
  22860. */
  22861. var resetAssertionsLocalState = function resetAssertionsLocalState() {
  22862. (0, _jestMatchersObject.setState)({
  22863. assertionCalls: 0,
  22864. expectedAssertionsNumber: null,
  22865. isExpectingAssertions: false
  22866. });
  22867. }; // Create and format all errors related to the mismatched number of `expect`
  22868. // calls and reset the matcher's state.
  22869. var extractExpectedAssertionsErrors = function extractExpectedAssertionsErrors() {
  22870. var result = [];
  22871. var _getState = (0, _jestMatchersObject.getState)(),
  22872. assertionCalls = _getState.assertionCalls,
  22873. expectedAssertionsNumber = _getState.expectedAssertionsNumber,
  22874. expectedAssertionsNumberError = _getState.expectedAssertionsNumberError,
  22875. isExpectingAssertions = _getState.isExpectingAssertions,
  22876. isExpectingAssertionsError = _getState.isExpectingAssertionsError;
  22877. resetAssertionsLocalState();
  22878. if (typeof expectedAssertionsNumber === 'number' && assertionCalls !== expectedAssertionsNumber) {
  22879. var numOfAssertionsExpected = (0, _jestMatcherUtils.EXPECTED_COLOR)((0, _jestMatcherUtils.pluralize)('assertion', expectedAssertionsNumber));
  22880. expectedAssertionsNumberError.message = (0, _jestMatcherUtils.matcherHint)('.assertions', '', String(expectedAssertionsNumber), {
  22881. isDirectExpectCall: true
  22882. }) + '\n\n' + "Expected ".concat(numOfAssertionsExpected, " to be called but received ") + (0, _jestMatcherUtils.RECEIVED_COLOR)((0, _jestMatcherUtils.pluralize)('assertion call', assertionCalls || 0)) + '.';
  22883. result.push({
  22884. actual: assertionCalls,
  22885. error: expectedAssertionsNumberError,
  22886. expected: expectedAssertionsNumber
  22887. });
  22888. }
  22889. if (isExpectingAssertions && assertionCalls === 0) {
  22890. var expected = (0, _jestMatcherUtils.EXPECTED_COLOR)('at least one assertion');
  22891. var received = (0, _jestMatcherUtils.RECEIVED_COLOR)('received none');
  22892. isExpectingAssertionsError.message = (0, _jestMatcherUtils.matcherHint)('.hasAssertions', '', '', {
  22893. isDirectExpectCall: true
  22894. }) + '\n\n' + "Expected ".concat(expected, " to be called but ").concat(received, ".");
  22895. result.push({
  22896. actual: 'none',
  22897. error: isExpectingAssertionsError,
  22898. expected: 'at least one'
  22899. });
  22900. }
  22901. return result;
  22902. };
  22903. var _default = extractExpectedAssertionsErrors;
  22904. exports.default = _default;
  22905. /***/ }),
  22906. /***/ "./packages/expect/src/index.ts":
  22907. /*!**************************************!*\
  22908. !*** ./packages/expect/src/index.ts ***!
  22909. \**************************************/
  22910. /*! no static exports found */
  22911. /***/ (function(module, exports, __webpack_require__) {
  22912. "use strict";
  22913. var matcherUtils = _interopRequireWildcard(__webpack_require__(/*! jest-matcher-utils */ "./packages/jest-matcher-utils/build/index.js"));
  22914. var _utils = __webpack_require__(/*! ./utils */ "./packages/expect/src/utils.ts");
  22915. var _matchers = _interopRequireDefault(__webpack_require__(/*! ./matchers */ "./packages/expect/src/matchers.ts"));
  22916. var _spyMatchers = _interopRequireDefault(__webpack_require__(/*! ./spyMatchers */ "./packages/expect/src/spyMatchers.ts"));
  22917. var _toThrowMatchers = _interopRequireWildcard(__webpack_require__(/*! ./toThrowMatchers */ "./packages/expect/src/toThrowMatchers.ts"));
  22918. var _jasmineUtils = __webpack_require__(/*! ./jasmineUtils */ "./packages/expect/src/jasmineUtils.ts");
  22919. var _asymmetricMatchers = __webpack_require__(/*! ./asymmetricMatchers */ "./packages/expect/src/asymmetricMatchers.ts");
  22920. var _jestMatchersObject = __webpack_require__(/*! ./jestMatchersObject */ "./packages/expect/src/jestMatchersObject.ts");
  22921. var _extractExpectedAssertionsErrors = _interopRequireDefault(__webpack_require__(/*! ./extractExpectedAssertionsErrors */ "./packages/expect/src/extractExpectedAssertionsErrors.ts"));
  22922. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  22923. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
  22924. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
  22925. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  22926. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  22927. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22928. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  22929. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22930. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  22931. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  22932. function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22933. function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  22934. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  22935. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  22936. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  22937. var JestAssertionError =
  22938. /*#__PURE__*/
  22939. function (_Error) {
  22940. _inherits(JestAssertionError, _Error);
  22941. function JestAssertionError() {
  22942. _classCallCheck(this, JestAssertionError);
  22943. return _possibleConstructorReturn(this, _getPrototypeOf(JestAssertionError).apply(this, arguments));
  22944. }
  22945. return JestAssertionError;
  22946. }(_wrapNativeSuper(Error));
  22947. var isPromise = function isPromise(obj) {
  22948. return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  22949. };
  22950. var createToThrowErrorMatchingSnapshotMatcher = function createToThrowErrorMatchingSnapshotMatcher(matcher) {
  22951. return function (received, testNameOrInlineSnapshot) {
  22952. return matcher.apply(this, [received, testNameOrInlineSnapshot, true]);
  22953. };
  22954. };
  22955. var getPromiseMatcher = function getPromiseMatcher(name, matcher) {
  22956. if (name === 'toThrow' || name === 'toThrowError') {
  22957. return (0, _toThrowMatchers.createMatcher)(name, true);
  22958. } else if (name === 'toThrowErrorMatchingSnapshot' || name === 'toThrowErrorMatchingInlineSnapshot') {
  22959. return createToThrowErrorMatchingSnapshotMatcher(matcher);
  22960. }
  22961. return null;
  22962. };
  22963. var expect = function expect(actual) {
  22964. if ((arguments.length <= 1 ? 0 : arguments.length - 1) !== 0) {
  22965. throw new Error('Expect takes at most one argument.');
  22966. }
  22967. var allMatchers = (0, _jestMatchersObject.getMatchers)();
  22968. var expectation = {
  22969. not: {},
  22970. rejects: {
  22971. not: {}
  22972. },
  22973. resolves: {
  22974. not: {}
  22975. }
  22976. };
  22977. var err = new JestAssertionError();
  22978. Object.keys(allMatchers).forEach(function (name) {
  22979. var matcher = allMatchers[name];
  22980. var promiseMatcher = getPromiseMatcher(name, matcher) || matcher;
  22981. expectation[name] = makeThrowingMatcher(matcher, false, '', actual);
  22982. expectation.not[name] = makeThrowingMatcher(matcher, true, '', actual);
  22983. expectation.resolves[name] = makeResolveMatcher(name, promiseMatcher, false, actual, err);
  22984. expectation.resolves.not[name] = makeResolveMatcher(name, promiseMatcher, true, actual, err);
  22985. expectation.rejects[name] = makeRejectMatcher(name, promiseMatcher, false, actual, err);
  22986. expectation.rejects.not[name] = makeRejectMatcher(name, promiseMatcher, true, actual, err);
  22987. });
  22988. return expectation;
  22989. };
  22990. var getMessage = function getMessage(message) {
  22991. return message && message() || matcherUtils.RECEIVED_COLOR('No message was specified for this matcher.');
  22992. };
  22993. var makeResolveMatcher = function makeResolveMatcher(matcherName, matcher, isNot, actual, outerErr) {
  22994. return function () {
  22995. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  22996. args[_key] = arguments[_key];
  22997. }
  22998. var options = {
  22999. isNot: isNot,
  23000. promise: 'resolves'
  23001. };
  23002. if (!isPromise(actual)) {
  23003. throw new JestAssertionError(matcherUtils.matcherErrorMessage(matcherUtils.matcherHint(matcherName, undefined, '', options), "".concat(matcherUtils.RECEIVED_COLOR('received'), " value must be a promise"), matcherUtils.printWithType('Received', actual, matcherUtils.printReceived)));
  23004. }
  23005. var innerErr = new JestAssertionError();
  23006. return actual.then(function (result) {
  23007. return makeThrowingMatcher(matcher, isNot, 'resolves', result, innerErr).apply(null, args);
  23008. }, function (reason) {
  23009. outerErr.message = matcherUtils.matcherHint(matcherName, undefined, '', options) + '\n\n' + "Received promise rejected instead of resolved\n" + "Rejected to value: ".concat(matcherUtils.printReceived(reason));
  23010. return Promise.reject(outerErr);
  23011. });
  23012. };
  23013. };
  23014. var makeRejectMatcher = function makeRejectMatcher(matcherName, matcher, isNot, actual, outerErr) {
  23015. return function () {
  23016. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  23017. args[_key2] = arguments[_key2];
  23018. }
  23019. var options = {
  23020. isNot: isNot,
  23021. promise: 'rejects'
  23022. };
  23023. if (!isPromise(actual)) {
  23024. throw new JestAssertionError(matcherUtils.matcherErrorMessage(matcherUtils.matcherHint(matcherName, undefined, '', options), "".concat(matcherUtils.RECEIVED_COLOR('received'), " value must be a promise"), matcherUtils.printWithType('Received', actual, matcherUtils.printReceived)));
  23025. }
  23026. var innerErr = new JestAssertionError();
  23027. return actual.then(function (result) {
  23028. outerErr.message = matcherUtils.matcherHint(matcherName, undefined, '', options) + '\n\n' + "Received promise resolved instead of rejected\n" + "Resolved to value: ".concat(matcherUtils.printReceived(result));
  23029. return Promise.reject(outerErr);
  23030. }, function (reason) {
  23031. return makeThrowingMatcher(matcher, isNot, 'rejects', reason, innerErr).apply(null, args);
  23032. });
  23033. };
  23034. };
  23035. var makeThrowingMatcher = function makeThrowingMatcher(matcher, isNot, promise, actual, err) {
  23036. return function throwingMatcher() {
  23037. var throws = true;
  23038. var utils = _objectSpread({}, matcherUtils, {
  23039. iterableEquality: _utils.iterableEquality,
  23040. subsetEquality: _utils.subsetEquality
  23041. });
  23042. var matcherContext = _objectSpread({
  23043. // When throws is disabled, the matcher will not throw errors during test
  23044. // execution but instead add them to the global matcher state. If a
  23045. // matcher throws, test execution is normally stopped immediately. The
  23046. // snapshot matcher uses it because we want to log all snapshot
  23047. // failures in a test.
  23048. dontThrow: function dontThrow() {
  23049. return throws = false;
  23050. }
  23051. }, (0, _jestMatchersObject.getState)(), {
  23052. equals: _jasmineUtils.equals,
  23053. error: err,
  23054. isNot: isNot,
  23055. promise: promise,
  23056. utils: utils
  23057. });
  23058. var processResult = function processResult(result, asyncError) {
  23059. _validateResult(result);
  23060. (0, _jestMatchersObject.getState)().assertionCalls++;
  23061. if (result.pass && isNot || !result.pass && !isNot) {
  23062. // XOR
  23063. var message = getMessage(result.message);
  23064. var error;
  23065. if (err) {
  23066. error = err;
  23067. error.message = message;
  23068. } else if (asyncError) {
  23069. error = asyncError;
  23070. error.message = message;
  23071. } else {
  23072. error = new JestAssertionError(message); // Try to remove this function from the stack trace frame.
  23073. // Guard for some environments (browsers) that do not support this feature.
  23074. if (Error.captureStackTrace) {
  23075. Error.captureStackTrace(error, throwingMatcher);
  23076. }
  23077. } // Passing the result of the matcher with the error so that a custom
  23078. // reporter could access the actual and expected objects of the result
  23079. // for example in order to display a custom visual diff
  23080. error.matcherResult = result;
  23081. if (throws) {
  23082. throw error;
  23083. } else {
  23084. (0, _jestMatchersObject.getState)().suppressedErrors.push(error);
  23085. }
  23086. }
  23087. };
  23088. var handlError = function handlError(error) {
  23089. if (matcher[_jestMatchersObject.INTERNAL_MATCHER_FLAG] === true && !(error instanceof JestAssertionError) && error.name !== 'PrettyFormatPluginError' && // Guard for some environments (browsers) that do not support this feature.
  23090. Error.captureStackTrace) {
  23091. // Try to remove this and deeper functions from the stack trace frame.
  23092. Error.captureStackTrace(error, throwingMatcher);
  23093. }
  23094. throw error;
  23095. };
  23096. var potentialResult;
  23097. try {
  23098. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  23099. args[_key3] = arguments[_key3];
  23100. }
  23101. potentialResult = matcher.call.apply(matcher, [matcherContext, actual].concat(args));
  23102. if (isPromise(potentialResult)) {
  23103. var asyncResult = potentialResult;
  23104. var asyncError = new JestAssertionError();
  23105. if (Error.captureStackTrace) {
  23106. Error.captureStackTrace(asyncError, throwingMatcher);
  23107. }
  23108. return asyncResult.then(function (aResult) {
  23109. return processResult(aResult, asyncError);
  23110. }).catch(function (error) {
  23111. return handlError(error);
  23112. });
  23113. } else {
  23114. var syncResult = potentialResult;
  23115. return processResult(syncResult);
  23116. }
  23117. } catch (error) {
  23118. return handlError(error);
  23119. }
  23120. };
  23121. };
  23122. expect.extend = function (matchers) {
  23123. return (0, _jestMatchersObject.setMatchers)(matchers, false, expect);
  23124. };
  23125. expect.anything = _asymmetricMatchers.anything;
  23126. expect.any = _asymmetricMatchers.any;
  23127. expect.not = {
  23128. arrayContaining: _asymmetricMatchers.arrayNotContaining,
  23129. objectContaining: _asymmetricMatchers.objectNotContaining,
  23130. stringContaining: _asymmetricMatchers.stringNotContaining,
  23131. stringMatching: _asymmetricMatchers.stringNotMatching
  23132. };
  23133. expect.objectContaining = _asymmetricMatchers.objectContaining;
  23134. expect.arrayContaining = _asymmetricMatchers.arrayContaining;
  23135. expect.stringContaining = _asymmetricMatchers.stringContaining;
  23136. expect.stringMatching = _asymmetricMatchers.stringMatching;
  23137. var _validateResult = function _validateResult(result) {
  23138. if (_typeof(result) !== 'object' || typeof result.pass !== 'boolean' || result.message && typeof result.message !== 'string' && typeof result.message !== 'function') {
  23139. throw new Error('Unexpected return from a matcher function.\n' + 'Matcher functions should ' + 'return an object in the following format:\n' + ' {message?: string | function, pass: boolean}\n' + "'".concat(matcherUtils.stringify(result), "' was returned"));
  23140. }
  23141. };
  23142. function assertions(expected) {
  23143. var error = new Error();
  23144. if (Error.captureStackTrace) {
  23145. Error.captureStackTrace(error, assertions);
  23146. }
  23147. (0, _jestMatchersObject.getState)().expectedAssertionsNumber = expected;
  23148. (0, _jestMatchersObject.getState)().expectedAssertionsNumberError = error;
  23149. }
  23150. function hasAssertions() {
  23151. var error = new Error();
  23152. if (Error.captureStackTrace) {
  23153. Error.captureStackTrace(error, hasAssertions);
  23154. }
  23155. matcherUtils.ensureNoExpected(arguments.length <= 0 ? undefined : arguments[0], '.hasAssertions');
  23156. (0, _jestMatchersObject.getState)().isExpectingAssertions = true;
  23157. (0, _jestMatchersObject.getState)().isExpectingAssertionsError = error;
  23158. } // add default jest matchers
  23159. (0, _jestMatchersObject.setMatchers)(_matchers.default, true, expect);
  23160. (0, _jestMatchersObject.setMatchers)(_spyMatchers.default, true, expect);
  23161. (0, _jestMatchersObject.setMatchers)(_toThrowMatchers.default, true, expect);
  23162. expect.addSnapshotSerializer = function () {
  23163. return void 0;
  23164. };
  23165. expect.assertions = assertions;
  23166. expect.hasAssertions = hasAssertions;
  23167. expect.getState = _jestMatchersObject.getState;
  23168. expect.setState = _jestMatchersObject.setState;
  23169. expect.extractExpectedAssertionsErrors = _extractExpectedAssertionsErrors.default;
  23170. var expectExport = expect; // eslint-disable-next-line no-redeclare
  23171. module.exports = expectExport;
  23172. /***/ }),
  23173. /***/ "./packages/expect/src/jasmineUtils.ts":
  23174. /*!*********************************************!*\
  23175. !*** ./packages/expect/src/jasmineUtils.ts ***!
  23176. \*********************************************/
  23177. /*! no static exports found */
  23178. /***/ (function(module, exports, __webpack_require__) {
  23179. "use strict";
  23180. Object.defineProperty(exports, "__esModule", {
  23181. value: true
  23182. });
  23183. exports.equals = equals;
  23184. exports.isA = isA;
  23185. exports.fnNameFor = fnNameFor;
  23186. exports.isUndefined = isUndefined;
  23187. exports.hasProperty = hasProperty;
  23188. exports.isImmutableUnorderedKeyed = isImmutableUnorderedKeyed;
  23189. exports.isImmutableUnorderedSet = isImmutableUnorderedSet;
  23190. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  23191. /*
  23192. Copyright (c) 2008-2016 Pivotal Labs
  23193. Permission is hereby granted, free of charge, to any person obtaining
  23194. a copy of this software and associated documentation files (the
  23195. "Software"), to deal in the Software without restriction, including
  23196. without limitation the rights to use, copy, modify, merge, publish,
  23197. distribute, sublicense, and/or sell copies of the Software, and to
  23198. permit persons to whom the Software is furnished to do so, subject to
  23199. the following conditions:
  23200. The above copyright notice and this permission notice shall be
  23201. included in all copies or substantial portions of the Software.
  23202. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23203. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23204. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23205. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  23206. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  23207. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  23208. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23209. */
  23210. /* eslint-disable */
  23211. // Extracted out of jasmine 2.5.2
  23212. function equals(a, b, customTesters, strictCheck) {
  23213. customTesters = customTesters || [];
  23214. return eq(a, b, [], [], customTesters, strictCheck ? hasKey : hasDefinedKey);
  23215. }
  23216. var functionToString = Function.prototype.toString;
  23217. function isAsymmetric(obj) {
  23218. return !!obj && isA('Function', obj.asymmetricMatch);
  23219. }
  23220. function asymmetricMatch(a, b) {
  23221. var asymmetricA = isAsymmetric(a),
  23222. asymmetricB = isAsymmetric(b);
  23223. if (asymmetricA && asymmetricB) {
  23224. return undefined;
  23225. }
  23226. if (asymmetricA) {
  23227. return a.asymmetricMatch(b);
  23228. }
  23229. if (asymmetricB) {
  23230. return b.asymmetricMatch(a);
  23231. }
  23232. } // Equality function lovingly adapted from isEqual in
  23233. // [Underscore](http://underscorejs.org)
  23234. function eq(a, b, aStack, bStack, customTesters, hasKey) {
  23235. var result = true;
  23236. var asymmetricResult = asymmetricMatch(a, b);
  23237. if (asymmetricResult !== undefined) {
  23238. return asymmetricResult;
  23239. }
  23240. for (var i = 0; i < customTesters.length; i++) {
  23241. var customTesterResult = customTesters[i](a, b);
  23242. if (customTesterResult !== undefined) {
  23243. return customTesterResult;
  23244. }
  23245. }
  23246. if (a instanceof Error && b instanceof Error) {
  23247. return a.message == b.message;
  23248. }
  23249. if (Object.is(a, b)) {
  23250. return true;
  23251. } // A strict comparison is necessary because `null == undefined`.
  23252. if (a === null || b === null) {
  23253. return a === b;
  23254. }
  23255. var className = Object.prototype.toString.call(a);
  23256. if (className != Object.prototype.toString.call(b)) {
  23257. return false;
  23258. }
  23259. switch (className) {
  23260. // Strings, numbers, dates, and booleans are compared by value.
  23261. case '[object String]':
  23262. // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
  23263. // equivalent to `new String("5")`.
  23264. return a == String(b);
  23265. case '[object Number]':
  23266. return Object.is(Number(a), Number(b));
  23267. case '[object Date]':
  23268. case '[object Boolean]':
  23269. // Coerce dates and booleans to numeric primitive values. Dates are compared by their
  23270. // millisecond representations. Note that invalid dates with millisecond representations
  23271. // of `NaN` are not equivalent.
  23272. return +a == +b;
  23273. // RegExps are compared by their source patterns and flags.
  23274. case '[object RegExp]':
  23275. return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase;
  23276. }
  23277. if (_typeof(a) != 'object' || _typeof(b) != 'object') {
  23278. return false;
  23279. } // Use DOM3 method isEqualNode (IE>=9)
  23280. if (isDomNode(a) && isDomNode(b)) {
  23281. return a.isEqualNode(b);
  23282. } // Used to detect circular references.
  23283. var length = aStack.length;
  23284. while (length--) {
  23285. // Linear search. Performance is inversely proportional to the number of
  23286. // unique nested structures.
  23287. // circular references at same depth are equal
  23288. // circular reference is not equal to non-circular one
  23289. if (aStack[length] === a) {
  23290. return bStack[length] === b;
  23291. } else if (bStack[length] === b) {
  23292. return false;
  23293. }
  23294. } // Add the first object to the stack of traversed objects.
  23295. aStack.push(a);
  23296. bStack.push(b);
  23297. var size = 0; // Recursively compare objects and arrays.
  23298. // Compare array lengths to determine if a deep comparison is necessary.
  23299. if (className == '[object Array]') {
  23300. size = a.length;
  23301. if (size !== b.length) {
  23302. return false;
  23303. }
  23304. while (size--) {
  23305. result = eq(a[size], b[size], aStack, bStack, customTesters, hasKey);
  23306. if (!result) {
  23307. return false;
  23308. }
  23309. }
  23310. } // Deep compare objects.
  23311. var aKeys = keys(a, className == '[object Array]', hasKey),
  23312. key;
  23313. size = aKeys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.
  23314. if (keys(b, className == '[object Array]', hasKey).length !== size) {
  23315. return false;
  23316. }
  23317. while (size--) {
  23318. key = aKeys[size]; // Deep compare each member
  23319. result = hasKey(b, key) && eq(a[key], b[key], aStack, bStack, customTesters, hasKey);
  23320. if (!result) {
  23321. return false;
  23322. }
  23323. } // Remove the first object from the stack of traversed objects.
  23324. aStack.pop();
  23325. bStack.pop();
  23326. return result;
  23327. }
  23328. function keys(obj, isArray, hasKey) {
  23329. var allKeys = function (o) {
  23330. var keys = [];
  23331. for (var key in o) {
  23332. if (hasKey(o, key)) {
  23333. keys.push(key);
  23334. }
  23335. }
  23336. return keys.concat(Object.getOwnPropertySymbols(o).filter(function (symbol) {
  23337. return Object.getOwnPropertyDescriptor(o, symbol).enumerable;
  23338. }));
  23339. }(obj);
  23340. if (!isArray) {
  23341. return allKeys;
  23342. }
  23343. var extraKeys = [];
  23344. if (allKeys.length === 0) {
  23345. return allKeys;
  23346. }
  23347. for (var x = 0; x < allKeys.length; x++) {
  23348. if (_typeof(allKeys[x]) === 'symbol' || !allKeys[x].match(/^[0-9]+$/)) {
  23349. extraKeys.push(allKeys[x]);
  23350. }
  23351. }
  23352. return extraKeys;
  23353. }
  23354. function hasDefinedKey(obj, key) {
  23355. return hasKey(obj, key) && obj[key] !== undefined;
  23356. }
  23357. function hasKey(obj, key) {
  23358. return Object.prototype.hasOwnProperty.call(obj, key);
  23359. }
  23360. function isA(typeName, value) {
  23361. return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
  23362. }
  23363. function isDomNode(obj) {
  23364. return obj !== null && _typeof(obj) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
  23365. }
  23366. function fnNameFor(func) {
  23367. if (func.name) {
  23368. return func.name;
  23369. }
  23370. var matches = functionToString.call(func).match(/^(?:async)?\s*function\s*\*?\s*([\w$]+)\s*\(/);
  23371. return matches ? matches[1] : '<anonymous>';
  23372. }
  23373. function isUndefined(obj) {
  23374. return obj === void 0;
  23375. }
  23376. function getPrototype(obj) {
  23377. if (Object.getPrototypeOf) {
  23378. return Object.getPrototypeOf(obj);
  23379. }
  23380. if (obj.constructor.prototype == obj) {
  23381. return null;
  23382. }
  23383. return obj.constructor.prototype;
  23384. }
  23385. function hasProperty(obj, property) {
  23386. if (!obj) {
  23387. return false;
  23388. }
  23389. if (Object.prototype.hasOwnProperty.call(obj, property)) {
  23390. return true;
  23391. }
  23392. return hasProperty(getPrototype(obj), property);
  23393. } // SENTINEL constants are from https://github.com/facebook/immutable-js
  23394. var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
  23395. var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
  23396. var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
  23397. function isImmutableUnorderedKeyed(maybeKeyed) {
  23398. return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL] && !maybeKeyed[IS_ORDERED_SENTINEL]);
  23399. }
  23400. function isImmutableUnorderedSet(maybeSet) {
  23401. return !!(maybeSet && maybeSet[IS_SET_SENTINEL] && !maybeSet[IS_ORDERED_SENTINEL]);
  23402. }
  23403. /***/ }),
  23404. /***/ "./packages/expect/src/jestMatchersObject.ts":
  23405. /*!***************************************************!*\
  23406. !*** ./packages/expect/src/jestMatchersObject.ts ***!
  23407. \***************************************************/
  23408. /*! no static exports found */
  23409. /***/ (function(module, exports, __webpack_require__) {
  23410. "use strict";
  23411. /* WEBPACK VAR INJECTION */(function(global) {
  23412. Object.defineProperty(exports, "__esModule", {
  23413. value: true
  23414. });
  23415. exports.setMatchers = exports.getMatchers = exports.setState = exports.getState = exports.INTERNAL_MATCHER_FLAG = void 0;
  23416. var _asymmetricMatchers = __webpack_require__(/*! ./asymmetricMatchers */ "./packages/expect/src/asymmetricMatchers.ts");
  23417. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  23418. function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23419. function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  23420. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  23421. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  23422. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  23423. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  23424. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23425. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23426. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  23427. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  23428. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23429. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  23430. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  23431. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  23432. // Global matchers object holds the list of available matchers and
  23433. // the state, that can hold matcher specific values that change over time.
  23434. var JEST_MATCHERS_OBJECT = Symbol.for('$$jest-matchers-object'); // Notes a built-in/internal Jest matcher.
  23435. // Jest may override the stack trace of Errors thrown by internal matchers.
  23436. var INTERNAL_MATCHER_FLAG = Symbol.for('$$jest-internal-matcher');
  23437. exports.INTERNAL_MATCHER_FLAG = INTERNAL_MATCHER_FLAG;
  23438. if (!global.hasOwnProperty(JEST_MATCHERS_OBJECT)) {
  23439. Object.defineProperty(global, JEST_MATCHERS_OBJECT, {
  23440. value: {
  23441. matchers: Object.create(null),
  23442. state: {
  23443. assertionCalls: 0,
  23444. expectedAssertionsNumber: null,
  23445. isExpectingAssertions: false,
  23446. suppressedErrors: [] // errors that are not thrown immediately.
  23447. }
  23448. }
  23449. });
  23450. }
  23451. var getState = function getState() {
  23452. return global[JEST_MATCHERS_OBJECT].state;
  23453. };
  23454. exports.getState = getState;
  23455. var setState = function setState(state) {
  23456. Object.assign(global[JEST_MATCHERS_OBJECT].state, state);
  23457. };
  23458. exports.setState = setState;
  23459. var getMatchers = function getMatchers() {
  23460. return global[JEST_MATCHERS_OBJECT].matchers;
  23461. };
  23462. exports.getMatchers = getMatchers;
  23463. var setMatchers = function setMatchers(matchers, isInternal, expect) {
  23464. Object.keys(matchers).forEach(function (key) {
  23465. var matcher = matchers[key];
  23466. Object.defineProperty(matcher, INTERNAL_MATCHER_FLAG, {
  23467. value: isInternal
  23468. });
  23469. if (!isInternal) {
  23470. // expect is defined
  23471. var CustomMatcher =
  23472. /*#__PURE__*/
  23473. function (_AsymmetricMatcher) {
  23474. _inherits(CustomMatcher, _AsymmetricMatcher);
  23475. function CustomMatcher() {
  23476. var _this;
  23477. var inverse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  23478. _classCallCheck(this, CustomMatcher);
  23479. for (var _len = arguments.length, sample = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  23480. sample[_key - 1] = arguments[_key];
  23481. }
  23482. _this = _possibleConstructorReturn(this, _getPrototypeOf(CustomMatcher).call(this, sample));
  23483. _this.inverse = inverse;
  23484. return _this;
  23485. }
  23486. _createClass(CustomMatcher, [{
  23487. key: "asymmetricMatch",
  23488. value: function asymmetricMatch(other) {
  23489. var _ref = matcher.apply(void 0, [other].concat(_toConsumableArray(this.sample))),
  23490. pass = _ref.pass;
  23491. return this.inverse ? !pass : pass;
  23492. }
  23493. }, {
  23494. key: "toString",
  23495. value: function toString() {
  23496. return "".concat(this.inverse ? 'not.' : '').concat(key);
  23497. }
  23498. }, {
  23499. key: "getExpectedType",
  23500. value: function getExpectedType() {
  23501. return 'any';
  23502. }
  23503. }, {
  23504. key: "toAsymmetricMatcher",
  23505. value: function toAsymmetricMatcher() {
  23506. return "".concat(this.toString(), "<").concat(this.sample.join(', '), ">");
  23507. }
  23508. }]);
  23509. return CustomMatcher;
  23510. }(_asymmetricMatchers.AsymmetricMatcher);
  23511. expect[key] = function () {
  23512. for (var _len2 = arguments.length, sample = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  23513. sample[_key2] = arguments[_key2];
  23514. }
  23515. return _construct(CustomMatcher, [false].concat(sample));
  23516. };
  23517. if (!expect.not) {
  23518. expect.not = {};
  23519. }
  23520. expect.not[key] = function () {
  23521. for (var _len3 = arguments.length, sample = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  23522. sample[_key3] = arguments[_key3];
  23523. }
  23524. return _construct(CustomMatcher, [true].concat(sample));
  23525. };
  23526. }
  23527. });
  23528. Object.assign(global[JEST_MATCHERS_OBJECT].matchers, matchers);
  23529. };
  23530. exports.setMatchers = setMatchers;
  23531. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  23532. /***/ }),
  23533. /***/ "./packages/expect/src/matchers.ts":
  23534. /*!*****************************************!*\
  23535. !*** ./packages/expect/src/matchers.ts ***!
  23536. \*****************************************/
  23537. /*! no static exports found */
  23538. /***/ (function(module, exports, __webpack_require__) {
  23539. "use strict";
  23540. Object.defineProperty(exports, "__esModule", {
  23541. value: true
  23542. });
  23543. exports.default = void 0;
  23544. var _jestGetType = _interopRequireWildcard(__webpack_require__(/*! jest-get-type */ "./packages/jest-get-type/build/index.js"));
  23545. var _jestMatcherUtils = __webpack_require__(/*! jest-matcher-utils */ "./packages/jest-matcher-utils/build/index.js");
  23546. var _print = __webpack_require__(/*! ./print */ "./packages/expect/src/print.ts");
  23547. var _utils = __webpack_require__(/*! ./utils */ "./packages/expect/src/utils.ts");
  23548. var _jasmineUtils = __webpack_require__(/*! ./jasmineUtils */ "./packages/expect/src/jasmineUtils.ts");
  23549. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
  23550. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  23551. // Omit colon and one or more spaces, so can call getLabelPrinter.
  23552. var EXPECTED_LABEL = 'Expected';
  23553. var RECEIVED_LABEL = 'Received';
  23554. var EXPECTED_VALUE_LABEL = 'Expected value';
  23555. var RECEIVED_VALUE_LABEL = 'Received value'; // The optional property of matcher context is true if undefined.
  23556. var isExpand = function isExpand(expand) {
  23557. return expand !== false;
  23558. };
  23559. var toStrictEqualTesters = [_utils.iterableEquality, _utils.typeEquality, _utils.sparseArrayEquality];
  23560. var matchers = {
  23561. toBe: function toBe(received, expected) {
  23562. var _this = this;
  23563. var matcherName = 'toBe';
  23564. var options = {
  23565. comment: 'Object.is equality',
  23566. isNot: this.isNot,
  23567. promise: this.promise
  23568. };
  23569. var pass = Object.is(received, expected);
  23570. var message = pass ? function () {
  23571. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected));
  23572. } : function () {
  23573. var expectedType = (0, _jestGetType.default)(expected);
  23574. var deepEqualityName = null;
  23575. if (expectedType !== 'map' && expectedType !== 'set') {
  23576. // If deep equality passes when referential identity fails,
  23577. // but exclude map and set until review of their equality logic.
  23578. if ((0, _jasmineUtils.equals)(received, expected, toStrictEqualTesters, true)) {
  23579. deepEqualityName = 'toStrictEqual';
  23580. } else if ((0, _jasmineUtils.equals)(received, expected, [_utils.iterableEquality])) {
  23581. deepEqualityName = 'toEqual';
  23582. }
  23583. }
  23584. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (deepEqualityName !== null ? (0, _jestMatcherUtils.DIM_COLOR)("If it should pass with deep equality, replace \"".concat(matcherName, "\" with \"").concat(deepEqualityName, "\"")) + '\n\n' : '') + (0, _jestMatcherUtils.printDiffOrStringify)(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, isExpand(_this.expand));
  23585. }; // Passing the actual and expected objects so that a custom reporter
  23586. // could access them, for example in order to display a custom visual diff,
  23587. // or create a different error message
  23588. return {
  23589. actual: received,
  23590. expected: expected,
  23591. message: message,
  23592. name: matcherName,
  23593. pass: pass
  23594. };
  23595. },
  23596. toBeCloseTo: function toBeCloseTo(received, expected) {
  23597. var precision = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
  23598. var matcherName = 'toBeCloseTo';
  23599. var secondArgument = arguments.length === 3 ? 'precision' : undefined;
  23600. var options = {
  23601. isNot: this.isNot,
  23602. promise: this.promise,
  23603. secondArgument: secondArgument,
  23604. secondArgumentColor: function secondArgumentColor(arg) {
  23605. return arg;
  23606. }
  23607. };
  23608. (0, _jestMatcherUtils.ensureNumbers)(received, expected, matcherName, options);
  23609. var pass = false;
  23610. var expectedDiff = 0;
  23611. var receivedDiff = 0;
  23612. if (received === Infinity && expected === Infinity) {
  23613. pass = true; // Infinity - Infinity is NaN
  23614. } else if (received === -Infinity && expected === -Infinity) {
  23615. pass = true; // -Infinity - -Infinity is NaN
  23616. } else {
  23617. expectedDiff = Math.pow(10, -precision) / 2;
  23618. receivedDiff = Math.abs(expected - received);
  23619. pass = receivedDiff < expectedDiff;
  23620. }
  23621. var message = pass ? function () {
  23622. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + (receivedDiff === 0 ? '' : "Received: ".concat((0, _jestMatcherUtils.printReceived)(received), "\n") + '\n' + "Expected precision: ".concat((0, _jestMatcherUtils.stringify)(precision), "\n") + "Expected difference: not < ".concat((0, _jestMatcherUtils.printExpected)(expectedDiff), "\n") + "Received difference: ".concat((0, _jestMatcherUtils.printReceived)(receivedDiff)));
  23623. } : function () {
  23624. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected: ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received), "\n") + '\n' + "Expected precision: ".concat((0, _jestMatcherUtils.stringify)(precision), "\n") + "Expected difference: < ".concat((0, _jestMatcherUtils.printExpected)(expectedDiff), "\n") + "Received difference: ".concat((0, _jestMatcherUtils.printReceived)(receivedDiff));
  23625. };
  23626. return {
  23627. message: message,
  23628. pass: pass
  23629. };
  23630. },
  23631. toBeDefined: function toBeDefined(received, expected) {
  23632. var matcherName = 'toBeDefined';
  23633. var options = {
  23634. isNot: this.isNot,
  23635. promise: this.promise
  23636. };
  23637. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  23638. var pass = received !== void 0;
  23639. var message = function message() {
  23640. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received));
  23641. };
  23642. return {
  23643. message: message,
  23644. pass: pass
  23645. };
  23646. },
  23647. toBeFalsy: function toBeFalsy(received, expected) {
  23648. var matcherName = 'toBeFalsy';
  23649. var options = {
  23650. isNot: this.isNot,
  23651. promise: this.promise
  23652. };
  23653. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  23654. var pass = !received;
  23655. var message = function message() {
  23656. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received));
  23657. };
  23658. return {
  23659. message: message,
  23660. pass: pass
  23661. };
  23662. },
  23663. toBeGreaterThan: function toBeGreaterThan(received, expected) {
  23664. var matcherName = 'toBeGreaterThan';
  23665. var isNot = this.isNot;
  23666. var options = {
  23667. isNot: isNot,
  23668. promise: this.promise
  23669. };
  23670. (0, _jestMatcherUtils.ensureNumbers)(received, expected, matcherName, options);
  23671. var pass = received > expected;
  23672. var message = function message() {
  23673. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected:".concat(isNot ? ' not' : '', " > ").concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received:".concat(isNot ? ' ' : '', " ").concat((0, _jestMatcherUtils.printReceived)(received));
  23674. };
  23675. return {
  23676. message: message,
  23677. pass: pass
  23678. };
  23679. },
  23680. toBeGreaterThanOrEqual: function toBeGreaterThanOrEqual(received, expected) {
  23681. var matcherName = 'toBeGreaterThanOrEqual';
  23682. var isNot = this.isNot;
  23683. var options = {
  23684. isNot: isNot,
  23685. promise: this.promise
  23686. };
  23687. (0, _jestMatcherUtils.ensureNumbers)(received, expected, matcherName, options);
  23688. var pass = received >= expected;
  23689. var message = function message() {
  23690. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected:".concat(isNot ? ' not' : '', " >= ").concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received:".concat(isNot ? ' ' : '', " ").concat((0, _jestMatcherUtils.printReceived)(received));
  23691. };
  23692. return {
  23693. message: message,
  23694. pass: pass
  23695. };
  23696. },
  23697. toBeInstanceOf: function toBeInstanceOf(received, expected) {
  23698. var matcherName = 'toBeInstanceOf';
  23699. var options = {
  23700. isNot: this.isNot,
  23701. promise: this.promise
  23702. };
  23703. if (typeof expected !== 'function') {
  23704. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.EXPECTED_COLOR)('expected'), " value must be a function"), (0, _jestMatcherUtils.printWithType)('Expected', expected, _jestMatcherUtils.printExpected)));
  23705. }
  23706. var pass = received instanceof expected;
  23707. var message = pass ? function () {
  23708. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _print.printExpectedConstructorNameNot)('Expected constructor', expected) + (typeof received.constructor === 'function' && received.constructor !== expected ? (0, _print.printReceivedConstructorNameNot)('Received constructor', received.constructor, expected) : '');
  23709. } : function () {
  23710. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _print.printExpectedConstructorName)('Expected constructor', expected) + ((0, _jestGetType.isPrimitive)(received) || Object.getPrototypeOf(received) === null ? "\nReceived value has no prototype\nReceived value: ".concat((0, _jestMatcherUtils.printReceived)(received)) : typeof received.constructor !== 'function' ? "\nReceived value: ".concat((0, _jestMatcherUtils.printReceived)(received)) : (0, _print.printReceivedConstructorName)('Received constructor', received.constructor));
  23711. };
  23712. return {
  23713. message: message,
  23714. pass: pass
  23715. };
  23716. },
  23717. toBeLessThan: function toBeLessThan(received, expected) {
  23718. var matcherName = 'toBeLessThan';
  23719. var isNot = this.isNot;
  23720. var options = {
  23721. isNot: isNot,
  23722. promise: this.promise
  23723. };
  23724. (0, _jestMatcherUtils.ensureNumbers)(received, expected, matcherName, options);
  23725. var pass = received < expected;
  23726. var message = function message() {
  23727. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected:".concat(isNot ? ' not' : '', " < ").concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received:".concat(isNot ? ' ' : '', " ").concat((0, _jestMatcherUtils.printReceived)(received));
  23728. };
  23729. return {
  23730. message: message,
  23731. pass: pass
  23732. };
  23733. },
  23734. toBeLessThanOrEqual: function toBeLessThanOrEqual(received, expected) {
  23735. var matcherName = 'toBeLessThanOrEqual';
  23736. var isNot = this.isNot;
  23737. var options = {
  23738. isNot: isNot,
  23739. promise: this.promise
  23740. };
  23741. (0, _jestMatcherUtils.ensureNumbers)(received, expected, matcherName, options);
  23742. var pass = received <= expected;
  23743. var message = function message() {
  23744. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected:".concat(isNot ? ' not' : '', " <= ").concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received:".concat(isNot ? ' ' : '', " ").concat((0, _jestMatcherUtils.printReceived)(received));
  23745. };
  23746. return {
  23747. message: message,
  23748. pass: pass
  23749. };
  23750. },
  23751. toBeNaN: function toBeNaN(received, expected) {
  23752. var matcherName = 'toBeNaN';
  23753. var options = {
  23754. isNot: this.isNot,
  23755. promise: this.promise
  23756. };
  23757. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  23758. var pass = Number.isNaN(received);
  23759. var message = function message() {
  23760. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received));
  23761. };
  23762. return {
  23763. message: message,
  23764. pass: pass
  23765. };
  23766. },
  23767. toBeNull: function toBeNull(received, expected) {
  23768. var matcherName = 'toBeNull';
  23769. var options = {
  23770. isNot: this.isNot,
  23771. promise: this.promise
  23772. };
  23773. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  23774. var pass = received === null;
  23775. var message = function message() {
  23776. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received));
  23777. };
  23778. return {
  23779. message: message,
  23780. pass: pass
  23781. };
  23782. },
  23783. toBeTruthy: function toBeTruthy(received, expected) {
  23784. var matcherName = 'toBeTruthy';
  23785. var options = {
  23786. isNot: this.isNot,
  23787. promise: this.promise
  23788. };
  23789. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  23790. var pass = !!received;
  23791. var message = function message() {
  23792. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received));
  23793. };
  23794. return {
  23795. message: message,
  23796. pass: pass
  23797. };
  23798. },
  23799. toBeUndefined: function toBeUndefined(received, expected) {
  23800. var matcherName = 'toBeUndefined';
  23801. var options = {
  23802. isNot: this.isNot,
  23803. promise: this.promise
  23804. };
  23805. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  23806. var pass = received === void 0;
  23807. var message = function message() {
  23808. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + "Received: ".concat((0, _jestMatcherUtils.printReceived)(received));
  23809. };
  23810. return {
  23811. message: message,
  23812. pass: pass
  23813. };
  23814. },
  23815. toContain: function toContain(received, expected) {
  23816. var matcherName = 'toContain';
  23817. var isNot = this.isNot;
  23818. var options = {
  23819. comment: 'indexOf',
  23820. isNot: isNot,
  23821. promise: this.promise
  23822. };
  23823. if (received == null) {
  23824. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must not be null nor undefined"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  23825. }
  23826. if (typeof received === 'string') {
  23827. var _index = received.indexOf(String(expected));
  23828. var _pass = _index !== -1;
  23829. var _message = function _message() {
  23830. var labelExpected = "Expected ".concat(typeof expected === 'string' ? 'substring' : 'value');
  23831. var labelReceived = 'Received string';
  23832. var printLabel = (0, _jestMatcherUtils.getLabelPrinter)(labelExpected, labelReceived);
  23833. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "".concat(printLabel(labelExpected)).concat(isNot ? 'not ' : '').concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "".concat(printLabel(labelReceived)).concat(isNot ? ' ' : '').concat(isNot ? (0, _print.printReceivedStringContainExpectedSubstring)(received, _index, String(expected).length) : (0, _jestMatcherUtils.printReceived)(received));
  23834. };
  23835. return {
  23836. message: _message,
  23837. pass: _pass
  23838. };
  23839. }
  23840. var indexable = Array.from(received);
  23841. var index = indexable.indexOf(expected);
  23842. var pass = index !== -1;
  23843. var message = function message() {
  23844. var labelExpected = 'Expected value';
  23845. var labelReceived = "Received ".concat((0, _jestGetType.default)(received));
  23846. var printLabel = (0, _jestMatcherUtils.getLabelPrinter)(labelExpected, labelReceived);
  23847. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "".concat(printLabel(labelExpected)).concat(isNot ? 'not ' : '').concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "".concat(printLabel(labelReceived)).concat(isNot ? ' ' : '').concat(isNot && Array.isArray(received) ? (0, _print.printReceivedArrayContainExpectedItem)(received, index) : (0, _jestMatcherUtils.printReceived)(received)) + (!isNot && indexable.findIndex(function (item) {
  23848. return (0, _jasmineUtils.equals)(item, expected, [_utils.iterableEquality]);
  23849. }) !== -1 ? "\n\n".concat(_jestMatcherUtils.SUGGEST_TO_CONTAIN_EQUAL) : '');
  23850. };
  23851. return {
  23852. message: message,
  23853. pass: pass
  23854. };
  23855. },
  23856. toContainEqual: function toContainEqual(received, expected) {
  23857. var matcherName = 'toContainEqual';
  23858. var isNot = this.isNot;
  23859. var options = {
  23860. comment: 'deep equality',
  23861. isNot: isNot,
  23862. promise: this.promise
  23863. };
  23864. if (received == null) {
  23865. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must not be null nor undefined"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  23866. }
  23867. var index = Array.from(received).findIndex(function (item) {
  23868. return (0, _jasmineUtils.equals)(item, expected, [_utils.iterableEquality]);
  23869. });
  23870. var pass = index !== -1;
  23871. var message = function message() {
  23872. var labelExpected = 'Expected value';
  23873. var labelReceived = "Received ".concat((0, _jestGetType.default)(received));
  23874. var printLabel = (0, _jestMatcherUtils.getLabelPrinter)(labelExpected, labelReceived);
  23875. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "".concat(printLabel(labelExpected)).concat(isNot ? 'not ' : '').concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "".concat(printLabel(labelReceived)).concat(isNot ? ' ' : '').concat(isNot && Array.isArray(received) ? (0, _print.printReceivedArrayContainExpectedItem)(received, index) : (0, _jestMatcherUtils.printReceived)(received));
  23876. };
  23877. return {
  23878. message: message,
  23879. pass: pass
  23880. };
  23881. },
  23882. toEqual: function toEqual(received, expected) {
  23883. var _this2 = this;
  23884. var matcherName = 'toEqual';
  23885. var options = {
  23886. comment: 'deep equality',
  23887. isNot: this.isNot,
  23888. promise: this.promise
  23889. };
  23890. var pass = (0, _jasmineUtils.equals)(received, expected, [_utils.iterableEquality]);
  23891. var message = pass ? function () {
  23892. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + ((0, _jestMatcherUtils.stringify)(expected) !== (0, _jestMatcherUtils.stringify)(received) ? "Received: ".concat((0, _jestMatcherUtils.printReceived)(received)) : '');
  23893. } : function () {
  23894. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _jestMatcherUtils.printDiffOrStringify)(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, isExpand(_this2.expand));
  23895. }; // Passing the actual and expected objects so that a custom reporter
  23896. // could access them, for example in order to display a custom visual diff,
  23897. // or create a different error message
  23898. return {
  23899. actual: received,
  23900. expected: expected,
  23901. message: message,
  23902. name: matcherName,
  23903. pass: pass
  23904. };
  23905. },
  23906. toHaveLength: function toHaveLength(received, expected) {
  23907. var matcherName = 'toHaveLength';
  23908. var isNot = this.isNot;
  23909. var options = {
  23910. isNot: isNot,
  23911. promise: this.promise
  23912. };
  23913. if (typeof received !== 'string' && (!received || typeof received.length !== 'number')) {
  23914. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must have a length property whose value must be a number"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  23915. }
  23916. (0, _jestMatcherUtils.ensureExpectedIsNonNegativeInteger)(expected, matcherName, options);
  23917. var pass = received.length === expected;
  23918. var message = function message() {
  23919. var labelExpected = 'Expected length';
  23920. var labelReceivedLength = 'Received length';
  23921. var labelReceivedValue = "Received ".concat((0, _jestGetType.default)(received));
  23922. var printLabel = (0, _jestMatcherUtils.getLabelPrinter)(labelExpected, labelReceivedLength, labelReceivedValue);
  23923. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "".concat(printLabel(labelExpected)).concat(isNot ? 'not ' : '').concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + (isNot ? '' : "".concat(printLabel(labelReceivedLength)).concat((0, _jestMatcherUtils.printReceived)(received.length), "\n")) + "".concat(printLabel(labelReceivedValue)).concat(isNot ? ' ' : '').concat((0, _jestMatcherUtils.printReceived)(received));
  23924. };
  23925. return {
  23926. message: message,
  23927. pass: pass
  23928. };
  23929. },
  23930. toHaveProperty: function toHaveProperty(received, expectedPath, expectedValue) {
  23931. var _this3 = this;
  23932. var matcherName = 'toHaveProperty';
  23933. var expectedArgument = 'path';
  23934. var hasValue = arguments.length === 3;
  23935. var options = {
  23936. isNot: this.isNot,
  23937. promise: this.promise,
  23938. secondArgument: hasValue ? 'value' : ''
  23939. };
  23940. if (received === null || received === undefined) {
  23941. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must not be null nor undefined"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  23942. }
  23943. var expectedPathType = (0, _jestGetType.default)(expectedPath);
  23944. if (expectedPathType !== 'string' && expectedPathType !== 'array') {
  23945. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat((0, _jestMatcherUtils.EXPECTED_COLOR)('expected'), " path must be a string or array"), (0, _jestMatcherUtils.printWithType)('Expected', expectedPath, _jestMatcherUtils.printExpected)));
  23946. }
  23947. var expectedPathLength = typeof expectedPath === 'string' ? expectedPath.split('.').length : expectedPath.length;
  23948. if (expectedPathType === 'array' && expectedPathLength === 0) {
  23949. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat((0, _jestMatcherUtils.EXPECTED_COLOR)('expected'), " path must not be an empty array"), (0, _jestMatcherUtils.printWithType)('Expected', expectedPath, _jestMatcherUtils.printExpected)));
  23950. }
  23951. var result = (0, _utils.getPath)(received, expectedPath);
  23952. var lastTraversedObject = result.lastTraversedObject,
  23953. hasEndProp = result.hasEndProp;
  23954. var receivedPath = result.traversedPath;
  23955. var hasCompletePath = receivedPath.length === expectedPathLength;
  23956. var receivedValue = hasCompletePath ? result.value : lastTraversedObject;
  23957. var pass = hasValue ? (0, _jasmineUtils.equals)(result.value, expectedValue, [_utils.iterableEquality]) : Boolean(hasEndProp); // theoretically undefined if empty path
  23958. // Remove type cast if we rewrite getPath as iterative algorithm.
  23959. // Delete this unique report if future breaking change
  23960. // removes the edge case that expected value undefined
  23961. // also matches absence of a property with the key path.
  23962. if (pass && !hasCompletePath) {
  23963. var _message2 = function _message2() {
  23964. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options) + '\n\n' + "Expected path: ".concat((0, _jestMatcherUtils.printExpected)(expectedPath), "\n") + "Received path: ".concat((0, _jestMatcherUtils.printReceived)(expectedPathType === 'array' || receivedPath.length === 0 ? receivedPath : receivedPath.join('.')), "\n\n") + "Expected value: not ".concat((0, _jestMatcherUtils.printExpected)(expectedValue), "\n") + "Received value: ".concat((0, _jestMatcherUtils.printReceived)(receivedValue), "\n\n") + (0, _jestMatcherUtils.DIM_COLOR)('Because a positive assertion passes for expected value undefined if the property does not exist, this negative assertion fails unless the property does exist and has a defined value');
  23965. };
  23966. return {
  23967. message: _message2,
  23968. pass: pass
  23969. };
  23970. }
  23971. var message = pass ? function () {
  23972. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options) + '\n\n' + (hasValue ? "Expected path: ".concat((0, _jestMatcherUtils.printExpected)(expectedPath), "\n\n") + "Expected value: not ".concat((0, _jestMatcherUtils.printExpected)(expectedValue)) + ((0, _jestMatcherUtils.stringify)(expectedValue) !== (0, _jestMatcherUtils.stringify)(receivedValue) ? "\nReceived value: ".concat((0, _jestMatcherUtils.printReceived)(receivedValue)) : '') : "Expected path: not ".concat((0, _jestMatcherUtils.printExpected)(expectedPath), "\n\n") + "Received value: ".concat((0, _jestMatcherUtils.printReceived)(receivedValue)));
  23973. } : function () {
  23974. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options) + '\n\n' + "Expected path: ".concat((0, _jestMatcherUtils.printExpected)(expectedPath), "\n") + (hasCompletePath ? '\n' + (0, _jestMatcherUtils.printDiffOrStringify)(expectedValue, receivedValue, EXPECTED_VALUE_LABEL, RECEIVED_VALUE_LABEL, isExpand(_this3.expand)) : "Received path: ".concat((0, _jestMatcherUtils.printReceived)(expectedPathType === 'array' || receivedPath.length === 0 ? receivedPath : receivedPath.join('.')), "\n\n") + (hasValue ? "Expected value: ".concat((0, _jestMatcherUtils.printExpected)(expectedValue), "\n") : '') + "Received value: ".concat((0, _jestMatcherUtils.printReceived)(receivedValue)));
  23975. };
  23976. return {
  23977. message: message,
  23978. pass: pass
  23979. };
  23980. },
  23981. toMatch: function toMatch(received, expected) {
  23982. var matcherName = 'toMatch';
  23983. var options = {
  23984. isNot: this.isNot,
  23985. promise: this.promise
  23986. };
  23987. if (typeof received !== 'string') {
  23988. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must be a string"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  23989. }
  23990. if (!(typeof expected === 'string') && !(expected && typeof expected.test === 'function')) {
  23991. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.EXPECTED_COLOR)('expected'), " value must be a string or regular expression"), (0, _jestMatcherUtils.printWithType)('Expected', expected, _jestMatcherUtils.printExpected)));
  23992. }
  23993. var pass = typeof expected === 'string' ? received.includes(expected) : expected.test(received);
  23994. var message = pass ? function () {
  23995. return typeof expected === 'string' ? (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected substring: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received string: ".concat((0, _print.printReceivedStringContainExpectedSubstring)(received, received.indexOf(expected), expected.length)) : (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected pattern: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received string: ".concat((0, _print.printReceivedStringContainExpectedResult)(received, typeof expected.exec === 'function' ? expected.exec(received) : null));
  23996. } : function () {
  23997. var labelExpected = "Expected ".concat(typeof expected === 'string' ? 'substring' : 'pattern');
  23998. var labelReceived = 'Received string';
  23999. var printLabel = (0, _jestMatcherUtils.getLabelPrinter)(labelExpected, labelReceived);
  24000. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "".concat(printLabel(labelExpected)).concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "".concat(printLabel(labelReceived)).concat((0, _jestMatcherUtils.printReceived)(received));
  24001. };
  24002. return {
  24003. message: message,
  24004. pass: pass
  24005. };
  24006. },
  24007. toMatchObject: function toMatchObject(received, expected) {
  24008. var _this4 = this;
  24009. var matcherName = 'toMatchObject';
  24010. var options = {
  24011. isNot: this.isNot,
  24012. promise: this.promise
  24013. };
  24014. if (_typeof(received) !== 'object' || received === null) {
  24015. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must be a non-null object"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  24016. }
  24017. if (_typeof(expected) !== 'object' || expected === null) {
  24018. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.EXPECTED_COLOR)('expected'), " value must be a non-null object"), (0, _jestMatcherUtils.printWithType)('Expected', expected, _jestMatcherUtils.printExpected)));
  24019. }
  24020. var pass = (0, _jasmineUtils.equals)(received, expected, [_utils.iterableEquality, _utils.subsetEquality]);
  24021. var message = pass ? function () {
  24022. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected)) + ((0, _jestMatcherUtils.stringify)(expected) !== (0, _jestMatcherUtils.stringify)(received) ? "\nReceived: ".concat((0, _jestMatcherUtils.printReceived)(received)) : '');
  24023. } : function () {
  24024. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _jestMatcherUtils.printDiffOrStringify)(expected, (0, _utils.getObjectSubset)(received, expected), EXPECTED_LABEL, RECEIVED_LABEL, isExpand(_this4.expand));
  24025. };
  24026. return {
  24027. message: message,
  24028. pass: pass
  24029. };
  24030. },
  24031. toStrictEqual: function toStrictEqual(received, expected) {
  24032. var _this5 = this;
  24033. var matcherName = 'toStrictEqual';
  24034. var options = {
  24035. comment: 'deep equality',
  24036. isNot: this.isNot,
  24037. promise: this.promise
  24038. };
  24039. var pass = (0, _jasmineUtils.equals)(received, expected, toStrictEqualTesters, true);
  24040. var message = pass ? function () {
  24041. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + ((0, _jestMatcherUtils.stringify)(expected) !== (0, _jestMatcherUtils.stringify)(received) ? "Received: ".concat((0, _jestMatcherUtils.printReceived)(received)) : '');
  24042. } : function () {
  24043. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _jestMatcherUtils.printDiffOrStringify)(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, isExpand(_this5.expand));
  24044. }; // Passing the actual and expected objects so that a custom reporter
  24045. // could access them, for example in order to display a custom visual diff,
  24046. // or create a different error message
  24047. return {
  24048. actual: received,
  24049. expected: expected,
  24050. message: message,
  24051. name: matcherName,
  24052. pass: pass
  24053. };
  24054. }
  24055. };
  24056. var _default = matchers;
  24057. exports.default = _default;
  24058. /***/ }),
  24059. /***/ "./packages/expect/src/print.ts":
  24060. /*!**************************************!*\
  24061. !*** ./packages/expect/src/print.ts ***!
  24062. \**************************************/
  24063. /*! no static exports found */
  24064. /***/ (function(module, exports, __webpack_require__) {
  24065. "use strict";
  24066. Object.defineProperty(exports, "__esModule", {
  24067. value: true
  24068. });
  24069. exports.printReceivedConstructorNameNot = exports.printReceivedConstructorName = exports.printExpectedConstructorNameNot = exports.printExpectedConstructorName = exports.printReceivedArrayContainExpectedItem = exports.printReceivedStringContainExpectedResult = exports.printReceivedStringContainExpectedSubstring = void 0;
  24070. var _jestMatcherUtils = __webpack_require__(/*! jest-matcher-utils */ "./packages/jest-matcher-utils/build/index.js");
  24071. /**
  24072. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  24073. *
  24074. * This source code is licensed under the MIT license found in the
  24075. * LICENSE file in the root directory of this source tree.
  24076. *
  24077. */
  24078. // Format substring but do not enclose in double quote marks.
  24079. // The replacement is compatible with pretty-format package.
  24080. var printSubstring = function printSubstring(val) {
  24081. return val.replace(/"|\\/g, '\\$&');
  24082. };
  24083. var printReceivedStringContainExpectedSubstring = function printReceivedStringContainExpectedSubstring(received, start, length) {
  24084. return (0, _jestMatcherUtils.RECEIVED_COLOR)('"' + printSubstring(received.slice(0, start)) + (0, _jestMatcherUtils.INVERTED_COLOR)(printSubstring(received.slice(start, start + length))) + printSubstring(received.slice(start + length)) + '"');
  24085. };
  24086. exports.printReceivedStringContainExpectedSubstring = printReceivedStringContainExpectedSubstring;
  24087. var printReceivedStringContainExpectedResult = function printReceivedStringContainExpectedResult(received, result) {
  24088. return result === null ? (0, _jestMatcherUtils.printReceived)(received) : printReceivedStringContainExpectedSubstring(received, result.index, result[0].length);
  24089. }; // The serialized array is compatible with pretty-format package min option.
  24090. // However, items have default stringify depth (instead of depth - 1)
  24091. // so expected item looks consistent by itself and enclosed in the array.
  24092. exports.printReceivedStringContainExpectedResult = printReceivedStringContainExpectedResult;
  24093. var printReceivedArrayContainExpectedItem = function printReceivedArrayContainExpectedItem(received, index) {
  24094. return (0, _jestMatcherUtils.RECEIVED_COLOR)('[' + received.map(function (item, i) {
  24095. var stringified = (0, _jestMatcherUtils.stringify)(item);
  24096. return i === index ? (0, _jestMatcherUtils.INVERTED_COLOR)(stringified) : stringified;
  24097. }).join(', ') + ']');
  24098. };
  24099. exports.printReceivedArrayContainExpectedItem = printReceivedArrayContainExpectedItem;
  24100. var printExpectedConstructorName = function printExpectedConstructorName(label, expected) {
  24101. return printConstructorName(label, expected, false, true) + '\n';
  24102. };
  24103. exports.printExpectedConstructorName = printExpectedConstructorName;
  24104. var printExpectedConstructorNameNot = function printExpectedConstructorNameNot(label, expected) {
  24105. return printConstructorName(label, expected, true, true) + '\n';
  24106. };
  24107. exports.printExpectedConstructorNameNot = printExpectedConstructorNameNot;
  24108. var printReceivedConstructorName = function printReceivedConstructorName(label, received) {
  24109. return printConstructorName(label, received, false, false) + '\n';
  24110. }; // Do not call function if received is equal to expected.
  24111. exports.printReceivedConstructorName = printReceivedConstructorName;
  24112. var printReceivedConstructorNameNot = function printReceivedConstructorNameNot(label, received, expected) {
  24113. return typeof expected.name === 'string' && expected.name.length !== 0 && typeof received.name === 'string' && received.name.length !== 0 ? printConstructorName(label, received, true, false) + " ".concat(Object.getPrototypeOf(received) === expected ? 'extends' : 'extends … extends', " ").concat((0, _jestMatcherUtils.EXPECTED_COLOR)(expected.name)) + '\n' : printConstructorName(label, received, false, false) + '\n';
  24114. };
  24115. exports.printReceivedConstructorNameNot = printReceivedConstructorNameNot;
  24116. var printConstructorName = function printConstructorName(label, constructor, isNot, isExpected) {
  24117. return typeof constructor.name !== 'string' ? "".concat(label, " name is not a string") : constructor.name.length === 0 ? "".concat(label, " name is an empty string") : "".concat(label, ": ").concat(!isNot ? '' : isExpected ? 'not ' : ' ').concat(isExpected ? (0, _jestMatcherUtils.EXPECTED_COLOR)(constructor.name) : (0, _jestMatcherUtils.RECEIVED_COLOR)(constructor.name));
  24118. };
  24119. /***/ }),
  24120. /***/ "./packages/expect/src/spyMatchers.ts":
  24121. /*!********************************************!*\
  24122. !*** ./packages/expect/src/spyMatchers.ts ***!
  24123. \********************************************/
  24124. /*! no static exports found */
  24125. /***/ (function(module, exports, __webpack_require__) {
  24126. "use strict";
  24127. Object.defineProperty(exports, "__esModule", {
  24128. value: true
  24129. });
  24130. exports.default = void 0;
  24131. var _jestGetType = _interopRequireWildcard(__webpack_require__(/*! jest-get-type */ "./packages/jest-get-type/build/index.js"));
  24132. var _jestMatcherUtils = __webpack_require__(/*! jest-matcher-utils */ "./packages/jest-matcher-utils/build/index.js");
  24133. var _jasmineUtils = __webpack_require__(/*! ./jasmineUtils */ "./packages/expect/src/jasmineUtils.ts");
  24134. var _utils = __webpack_require__(/*! ./utils */ "./packages/expect/src/utils.ts");
  24135. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
  24136. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
  24137. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
  24138. function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  24139. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  24140. // The optional property of matcher context is true if undefined.
  24141. var isExpand = function isExpand(expand) {
  24142. return expand !== false;
  24143. };
  24144. var PRINT_LIMIT = 3;
  24145. var NO_ARGUMENTS = 'called with 0 arguments';
  24146. var printExpectedArgs = function printExpectedArgs(expected) {
  24147. return expected.length === 0 ? NO_ARGUMENTS : expected.map(function (arg) {
  24148. return (0, _jestMatcherUtils.printExpected)(arg);
  24149. }).join(', ');
  24150. };
  24151. var printReceivedArgs = function printReceivedArgs(received, expected) {
  24152. return received.length === 0 ? NO_ARGUMENTS : received.map(function (arg, i) {
  24153. return Array.isArray(expected) && i < expected.length && isEqualValue(expected[i], arg) ? printCommon(arg) : (0, _jestMatcherUtils.printReceived)(arg);
  24154. }).join(', ');
  24155. };
  24156. var printCommon = function printCommon(val) {
  24157. return (0, _jestMatcherUtils.DIM_COLOR)((0, _jestMatcherUtils.stringify)(val));
  24158. };
  24159. var isEqualValue = function isEqualValue(expected, received) {
  24160. return (0, _jasmineUtils.equals)(expected, received, [_utils.iterableEquality]);
  24161. };
  24162. var isEqualCall = function isEqualCall(expected, received) {
  24163. return isEqualValue(expected, received);
  24164. };
  24165. var isEqualReturn = function isEqualReturn(expected, result) {
  24166. return result.type === 'return' && isEqualValue(expected, result.value);
  24167. };
  24168. var countReturns = function countReturns(results) {
  24169. return results.reduce(function (n, result) {
  24170. return result.type === 'return' ? n + 1 : n;
  24171. }, 0);
  24172. };
  24173. var printNumberOfReturns = function printNumberOfReturns(countReturns, countCalls) {
  24174. return "\nNumber of returns: ".concat((0, _jestMatcherUtils.printReceived)(countReturns)) + (countCalls !== countReturns ? "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(countCalls)) : '');
  24175. };
  24176. // Given a label, return a function which given a string,
  24177. // right-aligns it preceding the colon in the label.
  24178. var getRightAlignedPrinter = function getRightAlignedPrinter(label) {
  24179. // Assume that the label contains a colon.
  24180. var index = label.indexOf(':');
  24181. var suffix = label.slice(index);
  24182. return function (string, isExpectedCall) {
  24183. return (isExpectedCall ? '->' + ' '.repeat(Math.max(0, index - 2 - string.length)) : ' '.repeat(Math.max(index - string.length))) + string + suffix;
  24184. };
  24185. };
  24186. var printReceivedCallsNegative = function printReceivedCallsNegative(expected, indexedCalls, isOnlyCall, iExpectedCall) {
  24187. if (indexedCalls.length === 0) {
  24188. return '';
  24189. }
  24190. var label = 'Received: ';
  24191. if (isOnlyCall) {
  24192. return label + printReceivedArgs(indexedCalls[0], expected) + '\n';
  24193. }
  24194. var printAligned = getRightAlignedPrinter(label);
  24195. return 'Received\n' + indexedCalls.reduce(function (printed, _ref) {
  24196. var _ref2 = _slicedToArray(_ref, 2),
  24197. i = _ref2[0],
  24198. args = _ref2[1];
  24199. return printed + printAligned(String(i + 1), i === iExpectedCall) + printReceivedArgs(args, expected) + '\n';
  24200. }, '');
  24201. };
  24202. var printExpectedReceivedCallsPositive = function printExpectedReceivedCallsPositive(expected, indexedCalls, expand, isOnlyCall, iExpectedCall) {
  24203. var expectedLine = "Expected: ".concat(printExpectedArgs(expected), "\n");
  24204. if (indexedCalls.length === 0) {
  24205. return expectedLine;
  24206. }
  24207. var label = 'Received: ';
  24208. if (isOnlyCall && (iExpectedCall === 0 || iExpectedCall === undefined)) {
  24209. var received = indexedCalls[0][1];
  24210. if (isLineDiffableCall(expected, received)) {
  24211. // Display diff without indentation.
  24212. var lines = [(0, _jestMatcherUtils.EXPECTED_COLOR)('- Expected'), (0, _jestMatcherUtils.RECEIVED_COLOR)('+ Received'), ''];
  24213. var length = Math.max(expected.length, received.length);
  24214. for (var i = 0; i < length; i += 1) {
  24215. if (i < expected.length && i < received.length) {
  24216. if (isEqualValue(expected[i], received[i])) {
  24217. lines.push(" ".concat(printCommon(received[i]), ","));
  24218. continue;
  24219. }
  24220. if (isLineDiffableArg(expected[i], received[i])) {
  24221. var difference = (0, _jestMatcherUtils.diff)(expected[i], received[i], {
  24222. expand: expand
  24223. });
  24224. if (typeof difference === 'string' && difference.includes('- Expected') && difference.includes('+ Received')) {
  24225. // Omit annotation in case multiple args have diff.
  24226. lines.push(difference.split('\n').slice(3).join('\n') + ',');
  24227. continue;
  24228. }
  24229. }
  24230. }
  24231. if (i < expected.length) {
  24232. lines.push((0, _jestMatcherUtils.EXPECTED_COLOR)('- ' + (0, _jestMatcherUtils.stringify)(expected[i])) + ',');
  24233. }
  24234. if (i < received.length) {
  24235. lines.push((0, _jestMatcherUtils.RECEIVED_COLOR)('+ ' + (0, _jestMatcherUtils.stringify)(received[i])) + ',');
  24236. }
  24237. }
  24238. return lines.join('\n') + '\n';
  24239. }
  24240. return expectedLine + label + printReceivedArgs(received, expected) + '\n';
  24241. }
  24242. var printAligned = getRightAlignedPrinter(label);
  24243. return expectedLine + 'Received\n' + indexedCalls.reduce(function (printed, _ref3) {
  24244. var _ref4 = _slicedToArray(_ref3, 2),
  24245. i = _ref4[0],
  24246. received = _ref4[1];
  24247. var aligned = printAligned(String(i + 1), i === iExpectedCall);
  24248. return printed + ((i === iExpectedCall || iExpectedCall === undefined) && isLineDiffableCall(expected, received) ? aligned.replace(': ', '\n') + printDiffCall(expected, received, expand) : aligned + printReceivedArgs(received, expected)) + '\n';
  24249. }, '');
  24250. };
  24251. var indentation = 'Received'.replace(/\w/g, ' ');
  24252. var printDiffCall = function printDiffCall(expected, received, expand) {
  24253. return received.map(function (arg, i) {
  24254. if (i < expected.length) {
  24255. if (isEqualValue(expected[i], arg)) {
  24256. return indentation + ' ' + printCommon(arg) + ',';
  24257. }
  24258. if (isLineDiffableArg(expected[i], arg)) {
  24259. var difference = (0, _jestMatcherUtils.diff)(expected[i], arg, {
  24260. expand: expand
  24261. });
  24262. if (typeof difference === 'string' && difference.includes('- Expected') && difference.includes('+ Received')) {
  24263. // Display diff with indentation.
  24264. return difference.split('\n').slice(3).map(function (line) {
  24265. return indentation + line;
  24266. }).join('\n') + ',';
  24267. }
  24268. }
  24269. } // Display + only if received arg has no corresponding expected arg.
  24270. return indentation + (i < expected.length ? ' ' + (0, _jestMatcherUtils.printReceived)(arg) : (0, _jestMatcherUtils.RECEIVED_COLOR)('+ ' + (0, _jestMatcherUtils.stringify)(arg))) + ',';
  24271. }).join('\n');
  24272. };
  24273. var isLineDiffableCall = function isLineDiffableCall(expected, received) {
  24274. return expected.some(function (arg, i) {
  24275. return i < received.length && isLineDiffableArg(arg, received[i]);
  24276. });
  24277. }; // Almost redundant with function in jest-matcher-utils,
  24278. // except no line diff for any strings.
  24279. var isLineDiffableArg = function isLineDiffableArg(expected, received) {
  24280. var expectedType = (0, _jestGetType.default)(expected);
  24281. var receivedType = (0, _jestGetType.default)(received);
  24282. if (expectedType !== receivedType) {
  24283. return false;
  24284. }
  24285. if ((0, _jestGetType.isPrimitive)(expected)) {
  24286. return false;
  24287. }
  24288. if (expectedType === 'date' || expectedType === 'function' || expectedType === 'regexp') {
  24289. return false;
  24290. }
  24291. if (expected instanceof Error && received instanceof Error) {
  24292. return false;
  24293. }
  24294. if (expectedType === 'object' && typeof expected.asymmetricMatch === 'function') {
  24295. return false;
  24296. }
  24297. if (receivedType === 'object' && typeof received.asymmetricMatch === 'function') {
  24298. return false;
  24299. }
  24300. return true;
  24301. };
  24302. var printResult = function printResult(result, expected) {
  24303. return result.type === 'throw' ? 'function call threw an error' : result.type === 'incomplete' ? 'function call has not returned yet' : isEqualValue(expected, result.value) ? printCommon(result.value) : (0, _jestMatcherUtils.printReceived)(result.value);
  24304. };
  24305. // Return either empty string or one line per indexed result,
  24306. // so additional empty line can separate from `Number of returns` which follows.
  24307. var printReceivedResults = function printReceivedResults(label, expected, indexedResults, isOnlyCall, iExpectedCall) {
  24308. if (indexedResults.length === 0) {
  24309. return '';
  24310. }
  24311. if (isOnlyCall && (iExpectedCall === 0 || iExpectedCall === undefined)) {
  24312. return label + printResult(indexedResults[0][1], expected) + '\n';
  24313. }
  24314. var printAligned = getRightAlignedPrinter(label);
  24315. return label.replace(':', '').trim() + '\n' + indexedResults.reduce(function (printed, _ref5) {
  24316. var _ref6 = _slicedToArray(_ref5, 2),
  24317. i = _ref6[0],
  24318. result = _ref6[1];
  24319. return printed + printAligned(String(i + 1), i === iExpectedCall) + printResult(result, expected) + '\n';
  24320. }, '');
  24321. };
  24322. var createToBeCalledMatcher = function createToBeCalledMatcher(matcherName) {
  24323. return function (received, expected) {
  24324. var expectedArgument = '';
  24325. var options = {
  24326. isNot: this.isNot,
  24327. promise: this.promise
  24328. };
  24329. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  24330. ensureMockOrSpy(received, matcherName, expectedArgument, options);
  24331. var receivedIsSpy = isSpy(received);
  24332. var receivedName = receivedIsSpy ? 'spy' : received.getMockName();
  24333. var count = receivedIsSpy ? received.calls.count() : received.mock.calls.length;
  24334. var calls = receivedIsSpy ? received.calls.all().map(function (x) {
  24335. return x.args;
  24336. }) : received.mock.calls;
  24337. var pass = count > 0;
  24338. var message = pass ? function () {
  24339. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected number of calls: ".concat((0, _jestMatcherUtils.printExpected)(0), "\n") + "Received number of calls: ".concat((0, _jestMatcherUtils.printReceived)(count), "\n\n") + calls.reduce(function (lines, args, i) {
  24340. if (lines.length < PRINT_LIMIT) {
  24341. lines.push("".concat(i + 1, ": ").concat(printReceivedArgs(args)));
  24342. }
  24343. return lines;
  24344. }, []).join('\n');
  24345. } : function () {
  24346. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected number of calls: >= ".concat((0, _jestMatcherUtils.printExpected)(1), "\n") + "Received number of calls: ".concat((0, _jestMatcherUtils.printReceived)(count));
  24347. };
  24348. return {
  24349. message: message,
  24350. pass: pass
  24351. };
  24352. };
  24353. };
  24354. var createToReturnMatcher = function createToReturnMatcher(matcherName) {
  24355. return function (received, expected) {
  24356. var expectedArgument = '';
  24357. var options = {
  24358. isNot: this.isNot,
  24359. promise: this.promise
  24360. };
  24361. (0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName, options);
  24362. ensureMock(received, matcherName, expectedArgument, options);
  24363. var receivedName = received.getMockName(); // Count return values that correspond only to calls that returned
  24364. var count = received.mock.results.reduce(function (n, result) {
  24365. return result.type === 'return' ? n + 1 : n;
  24366. }, 0);
  24367. var pass = count > 0;
  24368. var message = pass ? function () {
  24369. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected number of returns: ".concat((0, _jestMatcherUtils.printExpected)(0), "\n") + "Received number of returns: ".concat((0, _jestMatcherUtils.printReceived)(count), "\n\n") + received.mock.results.reduce(function (lines, result, i) {
  24370. if (result.type === 'return' && lines.length < PRINT_LIMIT) {
  24371. lines.push("".concat(i + 1, ": ").concat((0, _jestMatcherUtils.printReceived)(result.value)));
  24372. }
  24373. return lines;
  24374. }, []).join('\n') + (received.mock.calls.length !== count ? "\n\nReceived number of calls: ".concat((0, _jestMatcherUtils.printReceived)(received.mock.calls.length)) : '');
  24375. } : function () {
  24376. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected number of returns: >= ".concat((0, _jestMatcherUtils.printExpected)(1), "\n") + "Received number of returns: ".concat((0, _jestMatcherUtils.printReceived)(count)) + (received.mock.calls.length !== count ? "\nReceived number of calls: ".concat((0, _jestMatcherUtils.printReceived)(received.mock.calls.length)) : '');
  24377. };
  24378. return {
  24379. message: message,
  24380. pass: pass
  24381. };
  24382. };
  24383. };
  24384. var createToBeCalledTimesMatcher = function createToBeCalledTimesMatcher(matcherName) {
  24385. return function (received, expected) {
  24386. var expectedArgument = 'expected';
  24387. var options = {
  24388. isNot: this.isNot,
  24389. promise: this.promise
  24390. };
  24391. (0, _jestMatcherUtils.ensureExpectedIsNumber)(expected, matcherName, options);
  24392. ensureMockOrSpy(received, matcherName, expectedArgument, options);
  24393. var receivedIsSpy = isSpy(received);
  24394. var receivedName = receivedIsSpy ? 'spy' : received.getMockName();
  24395. var count = receivedIsSpy ? received.calls.count() : received.mock.calls.length;
  24396. var pass = count === expected;
  24397. var message = pass ? function () {
  24398. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + "\n\n" + "Expected number of calls: not ".concat((0, _jestMatcherUtils.printExpected)(expected));
  24399. } : function () {
  24400. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected number of calls: ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received number of calls: ".concat((0, _jestMatcherUtils.printReceived)(count));
  24401. };
  24402. return {
  24403. message: message,
  24404. pass: pass
  24405. };
  24406. };
  24407. };
  24408. var createToReturnTimesMatcher = function createToReturnTimesMatcher(matcherName) {
  24409. return function (received, expected) {
  24410. var expectedArgument = 'expected';
  24411. var options = {
  24412. isNot: this.isNot,
  24413. promise: this.promise
  24414. };
  24415. (0, _jestMatcherUtils.ensureExpectedIsNumber)(expected, matcherName, options);
  24416. ensureMock(received, matcherName, expectedArgument, options);
  24417. var receivedName = received.getMockName(); // Count return values that correspond only to calls that returned
  24418. var count = received.mock.results.reduce(function (n, result) {
  24419. return result.type === 'return' ? n + 1 : n;
  24420. }, 0);
  24421. var pass = count === expected;
  24422. var message = pass ? function () {
  24423. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + "\n\n" + "Expected number of returns: not ".concat((0, _jestMatcherUtils.printExpected)(expected)) + (received.mock.calls.length !== count ? "\n\nReceived number of calls: ".concat((0, _jestMatcherUtils.printReceived)(received.mock.calls.length)) : '');
  24424. } : function () {
  24425. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected number of returns: ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + "Received number of returns: ".concat((0, _jestMatcherUtils.printReceived)(count)) + (received.mock.calls.length !== count ? "\nReceived number of calls: ".concat((0, _jestMatcherUtils.printReceived)(received.mock.calls.length)) : '');
  24426. };
  24427. return {
  24428. message: message,
  24429. pass: pass
  24430. };
  24431. };
  24432. };
  24433. var createToBeCalledWithMatcher = function createToBeCalledWithMatcher(matcherName) {
  24434. return function (received) {
  24435. var _this = this;
  24436. for (var _len = arguments.length, expected = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  24437. expected[_key - 1] = arguments[_key];
  24438. }
  24439. var expectedArgument = '...expected';
  24440. var options = {
  24441. isNot: this.isNot,
  24442. promise: this.promise
  24443. };
  24444. ensureMockOrSpy(received, matcherName, expectedArgument, options);
  24445. var receivedIsSpy = isSpy(received);
  24446. var receivedName = receivedIsSpy ? 'spy' : received.getMockName();
  24447. var calls = receivedIsSpy ? received.calls.all().map(function (x) {
  24448. return x.args;
  24449. }) : received.mock.calls;
  24450. var pass = calls.some(function (call) {
  24451. return isEqualCall(expected, call);
  24452. });
  24453. var message = pass ? function () {
  24454. // Some examples of calls that are equal to expected value.
  24455. var indexedCalls = [];
  24456. var i = 0;
  24457. while (i < calls.length && indexedCalls.length < PRINT_LIMIT) {
  24458. if (isEqualCall(expected, calls[i])) {
  24459. indexedCalls.push([i, calls[i]]);
  24460. }
  24461. i += 1;
  24462. }
  24463. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected: not ".concat(printExpectedArgs(expected), "\n") + (calls.length === 1 && (0, _jestMatcherUtils.stringify)(calls[0]) === (0, _jestMatcherUtils.stringify)(expected) ? '' : printReceivedCallsNegative(expected, indexedCalls, calls.length === 1)) + "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(calls.length));
  24464. } : function () {
  24465. // Some examples of calls that are not equal to expected value.
  24466. var indexedCalls = [];
  24467. var i = 0;
  24468. while (i < calls.length && indexedCalls.length < PRINT_LIMIT) {
  24469. indexedCalls.push([i, calls[i]]);
  24470. i += 1;
  24471. }
  24472. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + printExpectedReceivedCallsPositive(expected, indexedCalls, isExpand(_this.expand), calls.length === 1) + "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(calls.length));
  24473. };
  24474. return {
  24475. message: message,
  24476. pass: pass
  24477. };
  24478. };
  24479. };
  24480. var createToReturnWithMatcher = function createToReturnWithMatcher(matcherName) {
  24481. return function (received, expected) {
  24482. var expectedArgument = 'expected';
  24483. var options = {
  24484. isNot: this.isNot,
  24485. promise: this.promise
  24486. };
  24487. ensureMock(received, matcherName, expectedArgument, options);
  24488. var receivedName = received.getMockName();
  24489. var _received$mock = received.mock,
  24490. calls = _received$mock.calls,
  24491. results = _received$mock.results;
  24492. var pass = results.some(function (result) {
  24493. return isEqualReturn(expected, result);
  24494. });
  24495. var message = pass ? function () {
  24496. // Some examples of results that are equal to expected value.
  24497. var indexedResults = [];
  24498. var i = 0;
  24499. while (i < results.length && indexedResults.length < PRINT_LIMIT) {
  24500. if (isEqualReturn(expected, results[i])) {
  24501. indexedResults.push([i, results[i]]);
  24502. }
  24503. i += 1;
  24504. }
  24505. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + (results.length === 1 && results[0].type === 'return' && (0, _jestMatcherUtils.stringify)(results[0].value) === (0, _jestMatcherUtils.stringify)(expected) ? '' : printReceivedResults('Received: ', expected, indexedResults, results.length === 1)) + printNumberOfReturns(countReturns(results), calls.length);
  24506. } : function () {
  24507. // Some examples of results that are not equal to expected value.
  24508. var indexedResults = [];
  24509. var i = 0;
  24510. while (i < results.length && indexedResults.length < PRINT_LIMIT) {
  24511. indexedResults.push([i, results[i]]);
  24512. i += 1;
  24513. }
  24514. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected: ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + printReceivedResults('Received: ', expected, indexedResults, results.length === 1) + printNumberOfReturns(countReturns(results), calls.length);
  24515. };
  24516. return {
  24517. message: message,
  24518. pass: pass
  24519. };
  24520. };
  24521. };
  24522. var createLastCalledWithMatcher = function createLastCalledWithMatcher(matcherName) {
  24523. return function (received) {
  24524. var _this2 = this;
  24525. for (var _len2 = arguments.length, expected = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  24526. expected[_key2 - 1] = arguments[_key2];
  24527. }
  24528. var expectedArgument = '...expected';
  24529. var options = {
  24530. isNot: this.isNot,
  24531. promise: this.promise
  24532. };
  24533. ensureMockOrSpy(received, matcherName, expectedArgument, options);
  24534. var receivedIsSpy = isSpy(received);
  24535. var receivedName = receivedIsSpy ? 'spy' : received.getMockName();
  24536. var calls = receivedIsSpy ? received.calls.all().map(function (x) {
  24537. return x.args;
  24538. }) : received.mock.calls;
  24539. var iLast = calls.length - 1;
  24540. var pass = iLast >= 0 && isEqualCall(expected, calls[iLast]);
  24541. var message = pass ? function () {
  24542. var indexedCalls = [];
  24543. if (iLast > 0) {
  24544. // Display preceding call as context.
  24545. indexedCalls.push([iLast - 1, calls[iLast - 1]]);
  24546. }
  24547. indexedCalls.push([iLast, calls[iLast]]);
  24548. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected: not ".concat(printExpectedArgs(expected), "\n") + (calls.length === 1 && (0, _jestMatcherUtils.stringify)(calls[0]) === (0, _jestMatcherUtils.stringify)(expected) ? '' : printReceivedCallsNegative(expected, indexedCalls, calls.length === 1, iLast)) + "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(calls.length));
  24549. } : function () {
  24550. var indexedCalls = [];
  24551. if (iLast >= 0) {
  24552. if (iLast > 0) {
  24553. var i = iLast - 1; // Is there a preceding call that is equal to expected args?
  24554. while (i >= 0 && !isEqualCall(expected, calls[i])) {
  24555. i -= 1;
  24556. }
  24557. if (i < 0) {
  24558. i = iLast - 1; // otherwise, preceding call
  24559. }
  24560. indexedCalls.push([i, calls[i]]);
  24561. }
  24562. indexedCalls.push([iLast, calls[iLast]]);
  24563. }
  24564. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + printExpectedReceivedCallsPositive(expected, indexedCalls, isExpand(_this2.expand), calls.length === 1, iLast) + "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(calls.length));
  24565. };
  24566. return {
  24567. message: message,
  24568. pass: pass
  24569. };
  24570. };
  24571. };
  24572. var createLastReturnedMatcher = function createLastReturnedMatcher(matcherName) {
  24573. return function (received, expected) {
  24574. var expectedArgument = 'expected';
  24575. var options = {
  24576. isNot: this.isNot,
  24577. promise: this.promise
  24578. };
  24579. ensureMock(received, matcherName, expectedArgument, options);
  24580. var receivedName = received.getMockName();
  24581. var _received$mock2 = received.mock,
  24582. calls = _received$mock2.calls,
  24583. results = _received$mock2.results;
  24584. var iLast = results.length - 1;
  24585. var pass = iLast >= 0 && isEqualReturn(expected, results[iLast]);
  24586. var message = pass ? function () {
  24587. var indexedResults = [];
  24588. if (iLast > 0) {
  24589. // Display preceding result as context.
  24590. indexedResults.push([iLast - 1, results[iLast - 1]]);
  24591. }
  24592. indexedResults.push([iLast, results[iLast]]);
  24593. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + (results.length === 1 && results[0].type === 'return' && (0, _jestMatcherUtils.stringify)(results[0].value) === (0, _jestMatcherUtils.stringify)(expected) ? '' : printReceivedResults('Received: ', expected, indexedResults, results.length === 1, iLast)) + printNumberOfReturns(countReturns(results), calls.length);
  24594. } : function () {
  24595. var indexedResults = [];
  24596. if (iLast >= 0) {
  24597. if (iLast > 0) {
  24598. var i = iLast - 1; // Is there a preceding result that is equal to expected value?
  24599. while (i >= 0 && !isEqualReturn(expected, results[i])) {
  24600. i -= 1;
  24601. }
  24602. if (i < 0) {
  24603. i = iLast - 1; // otherwise, preceding result
  24604. }
  24605. indexedResults.push([i, results[i]]);
  24606. }
  24607. indexedResults.push([iLast, results[iLast]]);
  24608. }
  24609. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "Expected: ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + printReceivedResults('Received: ', expected, indexedResults, results.length === 1, iLast) + printNumberOfReturns(countReturns(results), calls.length);
  24610. };
  24611. return {
  24612. message: message,
  24613. pass: pass
  24614. };
  24615. };
  24616. };
  24617. var createNthCalledWithMatcher = function createNthCalledWithMatcher(matcherName) {
  24618. return function (received, nth) {
  24619. var _this3 = this;
  24620. for (var _len3 = arguments.length, expected = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
  24621. expected[_key3 - 2] = arguments[_key3];
  24622. }
  24623. var expectedArgument = 'n';
  24624. var options = {
  24625. expectedColor: function expectedColor(arg) {
  24626. return arg;
  24627. },
  24628. isNot: this.isNot,
  24629. promise: this.promise,
  24630. secondArgument: '...expected'
  24631. };
  24632. ensureMockOrSpy(received, matcherName, expectedArgument, options);
  24633. if (!Number.isSafeInteger(nth) || nth < 1) {
  24634. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat(expectedArgument, " must be a positive integer"), (0, _jestMatcherUtils.printWithType)(expectedArgument, nth, _jestMatcherUtils.stringify)));
  24635. }
  24636. var receivedIsSpy = isSpy(received);
  24637. var receivedName = receivedIsSpy ? 'spy' : received.getMockName();
  24638. var calls = receivedIsSpy ? received.calls.all().map(function (x) {
  24639. return x.args;
  24640. }) : received.mock.calls;
  24641. var length = calls.length;
  24642. var iNth = nth - 1;
  24643. var pass = iNth < length && isEqualCall(expected, calls[iNth]);
  24644. var message = pass ? function () {
  24645. // Display preceding and following calls,
  24646. var indexedCalls = [];
  24647. if (iNth - 1 >= 0) {
  24648. indexedCalls.push([iNth - 1, calls[iNth - 1]]);
  24649. }
  24650. indexedCalls.push([iNth, calls[iNth]]);
  24651. if (iNth + 1 < length) {
  24652. indexedCalls.push([iNth + 1, calls[iNth + 1]]);
  24653. }
  24654. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "n: ".concat(nth, "\n") + "Expected: not ".concat(printExpectedArgs(expected), "\n") + (calls.length === 1 && (0, _jestMatcherUtils.stringify)(calls[0]) === (0, _jestMatcherUtils.stringify)(expected) ? '' : printReceivedCallsNegative(expected, indexedCalls, calls.length === 1, iNth)) + "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(calls.length));
  24655. } : function () {
  24656. // Display preceding and following calls:
  24657. // * nearest call that is equal to expected args
  24658. // * otherwise, adjacent call
  24659. var indexedCalls = [];
  24660. if (iNth < length) {
  24661. if (iNth - 1 >= 0) {
  24662. var i = iNth - 1; // Is there a preceding call that is equal to expected args?
  24663. while (i >= 0 && !isEqualCall(expected, calls[i])) {
  24664. i -= 1;
  24665. }
  24666. if (i < 0) {
  24667. i = iNth - 1; // otherwise, adjacent call
  24668. }
  24669. indexedCalls.push([i, calls[i]]);
  24670. }
  24671. indexedCalls.push([iNth, calls[iNth]]);
  24672. if (iNth + 1 < length) {
  24673. var _i2 = iNth + 1; // Is there a following call that is equal to expected args?
  24674. while (_i2 < length && !isEqualCall(expected, calls[_i2])) {
  24675. _i2 += 1;
  24676. }
  24677. if (_i2 >= length) {
  24678. _i2 = iNth + 1; // otherwise, adjacent call
  24679. }
  24680. indexedCalls.push([_i2, calls[_i2]]);
  24681. }
  24682. } else if (length > 0) {
  24683. // The number of received calls is fewer than the expected number.
  24684. var _i3 = length - 1; // Is there a call that is equal to expected args?
  24685. while (_i3 >= 0 && !isEqualCall(expected, calls[_i3])) {
  24686. _i3 -= 1;
  24687. }
  24688. if (_i3 < 0) {
  24689. _i3 = length - 1; // otherwise, last call
  24690. }
  24691. indexedCalls.push([_i3, calls[_i3]]);
  24692. }
  24693. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "n: ".concat(nth, "\n") + printExpectedReceivedCallsPositive(expected, indexedCalls, isExpand(_this3.expand), calls.length === 1, iNth) + "\nNumber of calls: ".concat((0, _jestMatcherUtils.printReceived)(calls.length));
  24694. };
  24695. return {
  24696. message: message,
  24697. pass: pass
  24698. };
  24699. };
  24700. };
  24701. var createNthReturnedWithMatcher = function createNthReturnedWithMatcher(matcherName) {
  24702. return function (received, nth, expected) {
  24703. var expectedArgument = 'n';
  24704. var options = {
  24705. expectedColor: function expectedColor(arg) {
  24706. return arg;
  24707. },
  24708. isNot: this.isNot,
  24709. promise: this.promise,
  24710. secondArgument: 'expected'
  24711. };
  24712. ensureMock(received, matcherName, expectedArgument, options);
  24713. if (!Number.isSafeInteger(nth) || nth < 1) {
  24714. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat(expectedArgument, " must be a positive integer"), (0, _jestMatcherUtils.printWithType)(expectedArgument, nth, _jestMatcherUtils.stringify)));
  24715. }
  24716. var receivedName = received.getMockName();
  24717. var _received$mock3 = received.mock,
  24718. calls = _received$mock3.calls,
  24719. results = _received$mock3.results;
  24720. var length = results.length;
  24721. var iNth = nth - 1;
  24722. var pass = iNth < length && isEqualReturn(expected, results[iNth]);
  24723. var message = pass ? function () {
  24724. // Display preceding and following results,
  24725. var indexedResults = [];
  24726. if (iNth - 1 >= 0) {
  24727. indexedResults.push([iNth - 1, results[iNth - 1]]);
  24728. }
  24729. indexedResults.push([iNth, results[iNth]]);
  24730. if (iNth + 1 < length) {
  24731. indexedResults.push([iNth + 1, results[iNth + 1]]);
  24732. }
  24733. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "n: ".concat(nth, "\n") + "Expected: not ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + (results.length === 1 && results[0].type === 'return' && (0, _jestMatcherUtils.stringify)(results[0].value) === (0, _jestMatcherUtils.stringify)(expected) ? '' : printReceivedResults('Received: ', expected, indexedResults, results.length === 1, iNth)) + printNumberOfReturns(countReturns(results), calls.length);
  24734. } : function () {
  24735. // Display preceding and following results:
  24736. // * nearest result that is equal to expected value
  24737. // * otherwise, adjacent result
  24738. var indexedResults = [];
  24739. if (iNth < length) {
  24740. if (iNth - 1 >= 0) {
  24741. var i = iNth - 1; // Is there a preceding result that is equal to expected value?
  24742. while (i >= 0 && !isEqualReturn(expected, results[i])) {
  24743. i -= 1;
  24744. }
  24745. if (i < 0) {
  24746. i = iNth - 1; // otherwise, adjacent result
  24747. }
  24748. indexedResults.push([i, results[i]]);
  24749. }
  24750. indexedResults.push([iNth, results[iNth]]);
  24751. if (iNth + 1 < length) {
  24752. var _i4 = iNth + 1; // Is there a following result that is equal to expected value?
  24753. while (_i4 < length && !isEqualReturn(expected, results[_i4])) {
  24754. _i4 += 1;
  24755. }
  24756. if (_i4 >= length) {
  24757. _i4 = iNth + 1; // otherwise, adjacent result
  24758. }
  24759. indexedResults.push([_i4, results[_i4]]);
  24760. }
  24761. } else if (length > 0) {
  24762. // The number of received calls is fewer than the expected number.
  24763. var _i5 = length - 1; // Is there a result that is equal to expected value?
  24764. while (_i5 >= 0 && !isEqualReturn(expected, results[_i5])) {
  24765. _i5 -= 1;
  24766. }
  24767. if (_i5 < 0) {
  24768. _i5 = length - 1; // otherwise, last result
  24769. }
  24770. indexedResults.push([_i5, results[_i5]]);
  24771. }
  24772. return (0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, expectedArgument, options) + '\n\n' + "n: ".concat(nth, "\n") + "Expected: ".concat((0, _jestMatcherUtils.printExpected)(expected), "\n") + printReceivedResults('Received: ', expected, indexedResults, results.length === 1, iNth) + printNumberOfReturns(countReturns(results), calls.length);
  24773. };
  24774. return {
  24775. message: message,
  24776. pass: pass
  24777. };
  24778. };
  24779. };
  24780. var spyMatchers = {
  24781. lastCalledWith: createLastCalledWithMatcher('lastCalledWith'),
  24782. lastReturnedWith: createLastReturnedMatcher('lastReturnedWith'),
  24783. nthCalledWith: createNthCalledWithMatcher('nthCalledWith'),
  24784. nthReturnedWith: createNthReturnedWithMatcher('nthReturnedWith'),
  24785. toBeCalled: createToBeCalledMatcher('toBeCalled'),
  24786. toBeCalledTimes: createToBeCalledTimesMatcher('toBeCalledTimes'),
  24787. toBeCalledWith: createToBeCalledWithMatcher('toBeCalledWith'),
  24788. toHaveBeenCalled: createToBeCalledMatcher('toHaveBeenCalled'),
  24789. toHaveBeenCalledTimes: createToBeCalledTimesMatcher('toHaveBeenCalledTimes'),
  24790. toHaveBeenCalledWith: createToBeCalledWithMatcher('toHaveBeenCalledWith'),
  24791. toHaveBeenLastCalledWith: createLastCalledWithMatcher('toHaveBeenLastCalledWith'),
  24792. toHaveBeenNthCalledWith: createNthCalledWithMatcher('toHaveBeenNthCalledWith'),
  24793. toHaveLastReturnedWith: createLastReturnedMatcher('toHaveLastReturnedWith'),
  24794. toHaveNthReturnedWith: createNthReturnedWithMatcher('toHaveNthReturnedWith'),
  24795. toHaveReturned: createToReturnMatcher('toHaveReturned'),
  24796. toHaveReturnedTimes: createToReturnTimesMatcher('toHaveReturnedTimes'),
  24797. toHaveReturnedWith: createToReturnWithMatcher('toHaveReturnedWith'),
  24798. toReturn: createToReturnMatcher('toReturn'),
  24799. toReturnTimes: createToReturnTimesMatcher('toReturnTimes'),
  24800. toReturnWith: createToReturnWithMatcher('toReturnWith')
  24801. };
  24802. var isMock = function isMock(received) {
  24803. return received != null && received._isMockFunction === true;
  24804. };
  24805. var isSpy = function isSpy(received) {
  24806. return received != null && received.calls != null && typeof received.calls.all === 'function' && typeof received.calls.count === 'function';
  24807. };
  24808. var ensureMockOrSpy = function ensureMockOrSpy(received, matcherName, expectedArgument, options) {
  24809. if (!isMock(received) && !isSpy(received)) {
  24810. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must be a mock or spy function"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  24811. }
  24812. };
  24813. var ensureMock = function ensureMock(received, matcherName, expectedArgument, options) {
  24814. if (!isMock(received)) {
  24815. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, expectedArgument, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must be a mock function"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  24816. }
  24817. };
  24818. var _default = spyMatchers;
  24819. exports.default = _default;
  24820. /***/ }),
  24821. /***/ "./packages/expect/src/toThrowMatchers.ts":
  24822. /*!************************************************!*\
  24823. !*** ./packages/expect/src/toThrowMatchers.ts ***!
  24824. \************************************************/
  24825. /*! no static exports found */
  24826. /***/ (function(module, exports, __webpack_require__) {
  24827. "use strict";
  24828. /* WEBPACK VAR INJECTION */(function(process) {
  24829. Object.defineProperty(exports, "__esModule", {
  24830. value: true
  24831. });
  24832. exports.default = exports.createMatcher = void 0;
  24833. var _jestMessageUtil = __webpack_require__(/*! jest-message-util */ "./packages/jest-message-util/build/index.js");
  24834. var _jestMatcherUtils = __webpack_require__(/*! jest-matcher-utils */ "./packages/jest-matcher-utils/build/index.js");
  24835. var _print = __webpack_require__(/*! ./print */ "./packages/expect/src/print.ts");
  24836. var _utils = __webpack_require__(/*! ./utils */ "./packages/expect/src/utils.ts");
  24837. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  24838. var DID_NOT_THROW = 'Received function did not throw';
  24839. var getThrown = function getThrown(e) {
  24840. var hasMessage = e !== null && e !== undefined && typeof e.message === 'string';
  24841. if (hasMessage && typeof e.name === 'string' && typeof e.stack === 'string') {
  24842. return {
  24843. hasMessage: hasMessage,
  24844. isError: true,
  24845. message: e.message,
  24846. value: e
  24847. };
  24848. }
  24849. return {
  24850. hasMessage: hasMessage,
  24851. isError: false,
  24852. message: hasMessage ? e.message : String(e),
  24853. value: e
  24854. };
  24855. };
  24856. var createMatcher = function createMatcher(matcherName, fromPromise) {
  24857. return function (received, expected) {
  24858. var options = {
  24859. isNot: this.isNot,
  24860. promise: this.promise
  24861. };
  24862. var thrown = null;
  24863. if (fromPromise && (0, _utils.isError)(received)) {
  24864. thrown = getThrown(received);
  24865. } else {
  24866. if (typeof received !== 'function') {
  24867. if (!fromPromise) {
  24868. var placeholder = expected === undefined ? '' : 'expected';
  24869. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, placeholder, options), "".concat((0, _jestMatcherUtils.RECEIVED_COLOR)('received'), " value must be a function"), (0, _jestMatcherUtils.printWithType)('Received', received, _jestMatcherUtils.printReceived)));
  24870. }
  24871. } else {
  24872. try {
  24873. received();
  24874. } catch (e) {
  24875. thrown = getThrown(e);
  24876. }
  24877. }
  24878. }
  24879. if (expected === undefined) {
  24880. return toThrow(matcherName, options, thrown);
  24881. } else if (typeof expected === 'function') {
  24882. return toThrowExpectedClass(matcherName, options, thrown, expected);
  24883. } else if (typeof expected === 'string') {
  24884. return toThrowExpectedString(matcherName, options, thrown, expected);
  24885. } else if (expected !== null && typeof expected.test === 'function') {
  24886. return toThrowExpectedRegExp(matcherName, options, thrown, expected);
  24887. } else if (expected !== null && typeof expected.asymmetricMatch === 'function') {
  24888. return toThrowExpectedAsymmetric(matcherName, options, thrown, expected);
  24889. } else if (expected !== null && _typeof(expected) === 'object') {
  24890. return toThrowExpectedObject(matcherName, options, thrown, expected);
  24891. } else {
  24892. throw new Error((0, _jestMatcherUtils.matcherErrorMessage)((0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options), "".concat((0, _jestMatcherUtils.EXPECTED_COLOR)('expected'), " value must be a string or regular expression or class or error"), (0, _jestMatcherUtils.printWithType)('Expected', expected, _jestMatcherUtils.printExpected)));
  24893. }
  24894. };
  24895. };
  24896. exports.createMatcher = createMatcher;
  24897. var matchers = {
  24898. toThrow: createMatcher('toThrow'),
  24899. toThrowError: createMatcher('toThrowError')
  24900. };
  24901. var toThrowExpectedRegExp = function toThrowExpectedRegExp(matcherName, options, thrown, expected) {
  24902. var pass = thrown !== null && expected.test(thrown.message);
  24903. var message = pass ? function () {
  24904. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected pattern: not ', expected) + (thrown !== null && thrown.hasMessage ? formatReceived('Received message: ', thrown, 'message', expected) + formatStack(thrown) : formatReceived('Received value: ', thrown, 'value'));
  24905. } : function () {
  24906. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected pattern: ', expected) + (thrown === null ? '\n' + DID_NOT_THROW : thrown.hasMessage ? formatReceived('Received message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Received value: ', thrown, 'value'));
  24907. };
  24908. return {
  24909. message: message,
  24910. pass: pass
  24911. };
  24912. };
  24913. var toThrowExpectedAsymmetric = function toThrowExpectedAsymmetric(matcherName, options, thrown, expected) {
  24914. var pass = thrown !== null && expected.asymmetricMatch(thrown.value);
  24915. var message = pass ? function () {
  24916. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected asymmetric matcher: not ', expected) + '\n' + (thrown !== null && thrown.hasMessage ? formatReceived('Received name: ', thrown, 'name') + formatReceived('Received message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Thrown value: ', thrown, 'value'));
  24917. } : function () {
  24918. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected asymmetric matcher: ', expected) + '\n' + (thrown === null ? DID_NOT_THROW : thrown.hasMessage ? formatReceived('Received name: ', thrown, 'name') + formatReceived('Received message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Thrown value: ', thrown, 'value'));
  24919. };
  24920. return {
  24921. message: message,
  24922. pass: pass
  24923. };
  24924. };
  24925. var toThrowExpectedObject = function toThrowExpectedObject(matcherName, options, thrown, expected) {
  24926. var pass = thrown !== null && thrown.message === expected.message;
  24927. var message = pass ? function () {
  24928. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected message: not ', expected.message) + (thrown !== null && thrown.hasMessage ? formatStack(thrown) : formatReceived('Received value: ', thrown, 'value'));
  24929. } : function () {
  24930. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (thrown === null ? formatExpected('Expected message: ', expected.message) + '\n' + DID_NOT_THROW : thrown.hasMessage ? (0, _jestMatcherUtils.printDiffOrStringify)(expected.message, thrown.message, 'Expected message', 'Received message', true) + '\n' + formatStack(thrown) : formatExpected('Expected message: ', expected.message) + formatReceived('Received value: ', thrown, 'value'));
  24931. };
  24932. return {
  24933. message: message,
  24934. pass: pass
  24935. };
  24936. };
  24937. var toThrowExpectedClass = function toThrowExpectedClass(matcherName, options, thrown, expected) {
  24938. var pass = thrown !== null && thrown.value instanceof expected;
  24939. var message = pass ? function () {
  24940. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _print.printExpectedConstructorNameNot)('Expected constructor', expected) + (thrown !== null && thrown.value != null && typeof thrown.value.constructor === 'function' && thrown.value.constructor !== expected ? (0, _print.printReceivedConstructorNameNot)('Received constructor', thrown.value.constructor, expected) : '') + '\n' + (thrown !== null && thrown.hasMessage ? formatReceived('Received message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Received value: ', thrown, 'value'));
  24941. } : function () {
  24942. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + (0, _print.printExpectedConstructorName)('Expected constructor', expected) + (thrown === null ? '\n' + DID_NOT_THROW : (thrown.value != null && typeof thrown.value.constructor === 'function' ? (0, _print.printReceivedConstructorName)('Received constructor', thrown.value.constructor) : '') + '\n' + (thrown.hasMessage ? formatReceived('Received message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Received value: ', thrown, 'value')));
  24943. };
  24944. return {
  24945. message: message,
  24946. pass: pass
  24947. };
  24948. };
  24949. var toThrowExpectedString = function toThrowExpectedString(matcherName, options, thrown, expected) {
  24950. var pass = thrown !== null && thrown.message.includes(expected);
  24951. var message = pass ? function () {
  24952. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected substring: not ', expected) + (thrown !== null && thrown.hasMessage ? formatReceived('Received message: ', thrown, 'message', expected) + formatStack(thrown) : formatReceived('Received value: ', thrown, 'value'));
  24953. } : function () {
  24954. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, undefined, options) + '\n\n' + formatExpected('Expected substring: ', expected) + (thrown === null ? '\n' + DID_NOT_THROW : thrown.hasMessage ? formatReceived('Received message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Received value: ', thrown, 'value'));
  24955. };
  24956. return {
  24957. message: message,
  24958. pass: pass
  24959. };
  24960. };
  24961. var toThrow = function toThrow(matcherName, options, thrown) {
  24962. var pass = thrown !== null;
  24963. var message = pass ? function () {
  24964. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + (thrown !== null && thrown.hasMessage ? formatReceived('Error name: ', thrown, 'name') + formatReceived('Error message: ', thrown, 'message') + formatStack(thrown) : formatReceived('Thrown value: ', thrown, 'value'));
  24965. } : function () {
  24966. return (0, _jestMatcherUtils.matcherHint)(matcherName, undefined, '', options) + '\n\n' + DID_NOT_THROW;
  24967. };
  24968. return {
  24969. message: message,
  24970. pass: pass
  24971. };
  24972. };
  24973. var formatExpected = function formatExpected(label, expected) {
  24974. return label + (0, _jestMatcherUtils.printExpected)(expected) + '\n';
  24975. };
  24976. var formatReceived = function formatReceived(label, thrown, key, expected) {
  24977. if (thrown === null) {
  24978. return '';
  24979. }
  24980. if (key === 'message') {
  24981. var _message = thrown.message;
  24982. if (typeof expected === 'string') {
  24983. var index = _message.indexOf(expected);
  24984. if (index !== -1) {
  24985. return label + (0, _print.printReceivedStringContainExpectedSubstring)(_message, index, expected.length) + '\n';
  24986. }
  24987. } else if (expected instanceof RegExp) {
  24988. return label + (0, _print.printReceivedStringContainExpectedResult)(_message, typeof expected.exec === 'function' ? expected.exec(_message) : null) + '\n';
  24989. }
  24990. return label + (0, _jestMatcherUtils.printReceived)(_message) + '\n';
  24991. }
  24992. if (key === 'name') {
  24993. return thrown.isError ? label + (0, _jestMatcherUtils.printReceived)(thrown.value.name) + '\n' : '';
  24994. }
  24995. if (key === 'value') {
  24996. return thrown.isError ? '' : label + (0, _jestMatcherUtils.printReceived)(thrown.value) + '\n';
  24997. }
  24998. return '';
  24999. };
  25000. var formatStack = function formatStack(thrown) {
  25001. return thrown === null || !thrown.isError ? '' : (0, _jestMessageUtil.formatStackTrace)((0, _jestMessageUtil.separateMessageFromStack)(thrown.value.stack).stack, {
  25002. rootDir: process.cwd(),
  25003. testMatch: []
  25004. }, {
  25005. noStackTrace: false
  25006. });
  25007. };
  25008. var _default = matchers;
  25009. exports.default = _default;
  25010. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/process/browser.js */ "./node_modules/process/browser.js")))
  25011. /***/ }),
  25012. /***/ "./packages/expect/src/utils.ts":
  25013. /*!**************************************!*\
  25014. !*** ./packages/expect/src/utils.ts ***!
  25015. \**************************************/
  25016. /*! no static exports found */
  25017. /***/ (function(module, exports, __webpack_require__) {
  25018. "use strict";
  25019. Object.defineProperty(exports, "__esModule", {
  25020. value: true
  25021. });
  25022. exports.emptyObject = emptyObject;
  25023. exports.isOneline = exports.isError = exports.partition = exports.sparseArrayEquality = exports.typeEquality = exports.subsetEquality = exports.iterableEquality = exports.getObjectSubset = exports.getPath = exports.hasOwnProperty = void 0;
  25024. var _jestGetType = __webpack_require__(/*! jest-get-type */ "./packages/jest-get-type/build/index.js");
  25025. var _jasmineUtils = __webpack_require__(/*! ./jasmineUtils */ "./packages/expect/src/jasmineUtils.ts");
  25026. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  25027. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  25028. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  25029. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  25030. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  25031. // Return whether object instance inherits getter from its class.
  25032. var hasGetterFromConstructor = function hasGetterFromConstructor(object, key) {
  25033. var constructor = object.constructor;
  25034. if (constructor === Object) {
  25035. // A literal object has Object as constructor.
  25036. // Therefore, it cannot inherit application-specific getters.
  25037. // Furthermore, Object has __proto__ getter which is not relevant.
  25038. // Array, Boolean, Number, String constructors don’t have any getters.
  25039. return false;
  25040. }
  25041. if (typeof constructor !== 'function') {
  25042. // Object.create(null) constructs object with no constructor nor prototype.
  25043. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Custom_and_Null_objects
  25044. return false;
  25045. }
  25046. var descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, key);
  25047. return descriptor !== undefined && typeof descriptor.get === 'function';
  25048. };
  25049. var hasOwnProperty = function hasOwnProperty(object, key) {
  25050. return Object.prototype.hasOwnProperty.call(object, key) || hasGetterFromConstructor(object, key);
  25051. };
  25052. exports.hasOwnProperty = hasOwnProperty;
  25053. var getPath = function getPath(object, propertyPath) {
  25054. if (!Array.isArray(propertyPath)) {
  25055. propertyPath = propertyPath.split('.');
  25056. }
  25057. if (propertyPath.length) {
  25058. var lastProp = propertyPath.length === 1;
  25059. var prop = propertyPath[0];
  25060. var newObject = object[prop];
  25061. if (!lastProp && (newObject === null || newObject === undefined)) {
  25062. // This is not the last prop in the chain. If we keep recursing it will
  25063. // hit a `can't access property X of undefined | null`. At this point we
  25064. // know that the chain has broken and we can return right away.
  25065. return {
  25066. hasEndProp: false,
  25067. lastTraversedObject: object,
  25068. traversedPath: []
  25069. };
  25070. }
  25071. var result = getPath(newObject, propertyPath.slice(1));
  25072. if (result.lastTraversedObject === null) {
  25073. result.lastTraversedObject = object;
  25074. }
  25075. result.traversedPath.unshift(prop);
  25076. if (lastProp) {
  25077. // Does object have the property with an undefined value?
  25078. // Although primitive values support bracket notation (above)
  25079. // they would throw TypeError for in operator (below).
  25080. result.hasEndProp = newObject !== undefined || !(0, _jestGetType.isPrimitive)(object) && prop in object;
  25081. if (!result.hasEndProp) {
  25082. result.traversedPath.shift();
  25083. }
  25084. }
  25085. return result;
  25086. }
  25087. return {
  25088. lastTraversedObject: null,
  25089. traversedPath: [],
  25090. value: object
  25091. };
  25092. }; // Strip properties from object that are not present in the subset. Useful for
  25093. // printing the diff for toMatchObject() without adding unrelated noise.
  25094. exports.getPath = getPath;
  25095. var getObjectSubset = function getObjectSubset(object, subset) {
  25096. var seenReferences = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new WeakMap();
  25097. if (Array.isArray(object)) {
  25098. if (Array.isArray(subset) && subset.length === object.length) {
  25099. return subset.map(function (sub, i) {
  25100. return getObjectSubset(object[i], sub);
  25101. });
  25102. }
  25103. } else if (object instanceof Date) {
  25104. return object;
  25105. } else if (isObject(object) && isObject(subset)) {
  25106. var trimmed = {};
  25107. seenReferences.set(object, trimmed);
  25108. Object.keys(object).filter(function (key) {
  25109. return hasOwnProperty(subset, key);
  25110. }).forEach(function (key) {
  25111. trimmed[key] = seenReferences.has(object[key]) ? seenReferences.get(object[key]) : getObjectSubset(object[key], subset[key], seenReferences);
  25112. });
  25113. if (Object.keys(trimmed).length > 0) {
  25114. return trimmed;
  25115. }
  25116. }
  25117. return object;
  25118. };
  25119. exports.getObjectSubset = getObjectSubset;
  25120. var IteratorSymbol = Symbol.iterator;
  25121. var hasIterator = function hasIterator(object) {
  25122. return !!(object != null && object[IteratorSymbol]);
  25123. };
  25124. var iterableEquality = function iterableEquality(a, b) {
  25125. var aStack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  25126. var bStack = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  25127. if (_typeof(a) !== 'object' || _typeof(b) !== 'object' || Array.isArray(a) || Array.isArray(b) || !hasIterator(a) || !hasIterator(b)) {
  25128. return undefined;
  25129. }
  25130. if (a.constructor !== b.constructor) {
  25131. return false;
  25132. }
  25133. var length = aStack.length;
  25134. while (length--) {
  25135. // Linear search. Performance is inversely proportional to the number of
  25136. // unique nested structures.
  25137. // circular references at same depth are equal
  25138. // circular reference is not equal to non-circular one
  25139. if (aStack[length] === a) {
  25140. return bStack[length] === b;
  25141. }
  25142. }
  25143. aStack.push(a);
  25144. bStack.push(b);
  25145. var iterableEqualityWithStack = function iterableEqualityWithStack(a, b) {
  25146. return iterableEquality(a, b, _toConsumableArray(aStack), _toConsumableArray(bStack));
  25147. };
  25148. if (a.size !== undefined) {
  25149. if (a.size !== b.size) {
  25150. return false;
  25151. } else if ((0, _jasmineUtils.isA)('Set', a) || (0, _jasmineUtils.isImmutableUnorderedSet)(a)) {
  25152. var allFound = true;
  25153. var _iteratorNormalCompletion = true;
  25154. var _didIteratorError = false;
  25155. var _iteratorError = undefined;
  25156. try {
  25157. for (var _iterator = a[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  25158. var aValue = _step.value;
  25159. if (!b.has(aValue)) {
  25160. var has = false;
  25161. var _iteratorNormalCompletion2 = true;
  25162. var _didIteratorError2 = false;
  25163. var _iteratorError2 = undefined;
  25164. try {
  25165. for (var _iterator2 = b[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  25166. var bValue = _step2.value;
  25167. var isEqual = (0, _jasmineUtils.equals)(aValue, bValue, [iterableEqualityWithStack]);
  25168. if (isEqual === true) {
  25169. has = true;
  25170. }
  25171. }
  25172. } catch (err) {
  25173. _didIteratorError2 = true;
  25174. _iteratorError2 = err;
  25175. } finally {
  25176. try {
  25177. if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  25178. _iterator2.return();
  25179. }
  25180. } finally {
  25181. if (_didIteratorError2) {
  25182. throw _iteratorError2;
  25183. }
  25184. }
  25185. }
  25186. if (has === false) {
  25187. allFound = false;
  25188. break;
  25189. }
  25190. }
  25191. } // Remove the first value from the stack of traversed values.
  25192. } catch (err) {
  25193. _didIteratorError = true;
  25194. _iteratorError = err;
  25195. } finally {
  25196. try {
  25197. if (!_iteratorNormalCompletion && _iterator.return != null) {
  25198. _iterator.return();
  25199. }
  25200. } finally {
  25201. if (_didIteratorError) {
  25202. throw _iteratorError;
  25203. }
  25204. }
  25205. }
  25206. aStack.pop();
  25207. bStack.pop();
  25208. return allFound;
  25209. } else if ((0, _jasmineUtils.isA)('Map', a) || (0, _jasmineUtils.isImmutableUnorderedKeyed)(a)) {
  25210. var _allFound = true;
  25211. var _iteratorNormalCompletion3 = true;
  25212. var _didIteratorError3 = false;
  25213. var _iteratorError3 = undefined;
  25214. try {
  25215. for (var _iterator3 = a[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
  25216. var aEntry = _step3.value;
  25217. if (!b.has(aEntry[0]) || !(0, _jasmineUtils.equals)(aEntry[1], b.get(aEntry[0]), [iterableEqualityWithStack])) {
  25218. var _has = false;
  25219. var _iteratorNormalCompletion4 = true;
  25220. var _didIteratorError4 = false;
  25221. var _iteratorError4 = undefined;
  25222. try {
  25223. for (var _iterator4 = b[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
  25224. var bEntry = _step4.value;
  25225. var matchedKey = (0, _jasmineUtils.equals)(aEntry[0], bEntry[0], [iterableEqualityWithStack]);
  25226. var matchedValue = false;
  25227. if (matchedKey === true) {
  25228. matchedValue = (0, _jasmineUtils.equals)(aEntry[1], bEntry[1], [iterableEqualityWithStack]);
  25229. }
  25230. if (matchedValue === true) {
  25231. _has = true;
  25232. }
  25233. }
  25234. } catch (err) {
  25235. _didIteratorError4 = true;
  25236. _iteratorError4 = err;
  25237. } finally {
  25238. try {
  25239. if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
  25240. _iterator4.return();
  25241. }
  25242. } finally {
  25243. if (_didIteratorError4) {
  25244. throw _iteratorError4;
  25245. }
  25246. }
  25247. }
  25248. if (_has === false) {
  25249. _allFound = false;
  25250. break;
  25251. }
  25252. }
  25253. } // Remove the first value from the stack of traversed values.
  25254. } catch (err) {
  25255. _didIteratorError3 = true;
  25256. _iteratorError3 = err;
  25257. } finally {
  25258. try {
  25259. if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
  25260. _iterator3.return();
  25261. }
  25262. } finally {
  25263. if (_didIteratorError3) {
  25264. throw _iteratorError3;
  25265. }
  25266. }
  25267. }
  25268. aStack.pop();
  25269. bStack.pop();
  25270. return _allFound;
  25271. }
  25272. }
  25273. var bIterator = b[IteratorSymbol]();
  25274. var _iteratorNormalCompletion5 = true;
  25275. var _didIteratorError5 = false;
  25276. var _iteratorError5 = undefined;
  25277. try {
  25278. for (var _iterator5 = a[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
  25279. var _aValue = _step5.value;
  25280. var nextB = bIterator.next();
  25281. if (nextB.done || !(0, _jasmineUtils.equals)(_aValue, nextB.value, [iterableEqualityWithStack])) {
  25282. return false;
  25283. }
  25284. }
  25285. } catch (err) {
  25286. _didIteratorError5 = true;
  25287. _iteratorError5 = err;
  25288. } finally {
  25289. try {
  25290. if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
  25291. _iterator5.return();
  25292. }
  25293. } finally {
  25294. if (_didIteratorError5) {
  25295. throw _iteratorError5;
  25296. }
  25297. }
  25298. }
  25299. if (!bIterator.next().done) {
  25300. return false;
  25301. } // Remove the first value from the stack of traversed values.
  25302. aStack.pop();
  25303. bStack.pop();
  25304. return true;
  25305. };
  25306. exports.iterableEquality = iterableEquality;
  25307. var isObject = function isObject(a) {
  25308. return a !== null && _typeof(a) === 'object';
  25309. };
  25310. var isObjectWithKeys = function isObjectWithKeys(a) {
  25311. return isObject(a) && !(a instanceof Error) && !(a instanceof Array) && !(a instanceof Date);
  25312. };
  25313. var subsetEquality = function subsetEquality(object, subset) {
  25314. // subsetEquality needs to keep track of the references
  25315. // it has already visited to avoid infinite loops in case
  25316. // there are circular references in the subset passed to it.
  25317. var subsetEqualityWithContext = function subsetEqualityWithContext() {
  25318. var seenReferences = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new WeakMap();
  25319. return function (object, subset) {
  25320. if (!isObjectWithKeys(subset)) {
  25321. return undefined;
  25322. }
  25323. return Object.keys(subset).every(function (key) {
  25324. if (isObjectWithKeys(subset[key])) {
  25325. if (seenReferences.get(subset[key])) {
  25326. return (0, _jasmineUtils.equals)(object[key], subset[key], [iterableEquality]);
  25327. }
  25328. seenReferences.set(subset[key], true);
  25329. }
  25330. return object != null && hasOwnProperty(object, key) && (0, _jasmineUtils.equals)(object[key], subset[key], [iterableEquality, subsetEqualityWithContext(seenReferences)]);
  25331. });
  25332. };
  25333. };
  25334. return subsetEqualityWithContext()(object, subset);
  25335. };
  25336. exports.subsetEquality = subsetEquality;
  25337. var typeEquality = function typeEquality(a, b) {
  25338. if (a == null || b == null || a.constructor === b.constructor) {
  25339. return undefined;
  25340. }
  25341. return false;
  25342. };
  25343. exports.typeEquality = typeEquality;
  25344. var sparseArrayEquality = function sparseArrayEquality(a, b) {
  25345. if (!Array.isArray(a) || !Array.isArray(b)) {
  25346. return undefined;
  25347. } // A sparse array [, , 1] will have keys ["2"] whereas [undefined, undefined, 1] will have keys ["0", "1", "2"]
  25348. var aKeys = Object.keys(a);
  25349. var bKeys = Object.keys(b);
  25350. return (0, _jasmineUtils.equals)(a, b, [iterableEquality, typeEquality], true) && (0, _jasmineUtils.equals)(aKeys, bKeys);
  25351. };
  25352. exports.sparseArrayEquality = sparseArrayEquality;
  25353. var partition = function partition(items, predicate) {
  25354. var result = [[], []];
  25355. items.forEach(function (item) {
  25356. return result[predicate(item) ? 0 : 1].push(item);
  25357. });
  25358. return result;
  25359. }; // Copied from https://github.com/graingert/angular.js/blob/a43574052e9775cbc1d7dd8a086752c979b0f020/src/Angular.js#L685-L693
  25360. exports.partition = partition;
  25361. var isError = function isError(value) {
  25362. switch (Object.prototype.toString.call(value)) {
  25363. case '[object Error]':
  25364. return true;
  25365. case '[object Exception]':
  25366. return true;
  25367. case '[object DOMException]':
  25368. return true;
  25369. default:
  25370. return value instanceof Error;
  25371. }
  25372. };
  25373. exports.isError = isError;
  25374. function emptyObject(obj) {
  25375. return obj && _typeof(obj) === 'object' ? !Object.keys(obj).length : false;
  25376. }
  25377. var MULTILINE_REGEXP = /[\r\n]/;
  25378. var isOneline = function isOneline(expected, received) {
  25379. return typeof expected === 'string' && typeof received === 'string' && (!MULTILINE_REGEXP.test(expected) || !MULTILINE_REGEXP.test(received));
  25380. };
  25381. exports.isOneline = isOneline;
  25382. /***/ }),
  25383. /***/ "./packages/jest-diff/build/cleanupSemantic.js":
  25384. /*!*****************************************************!*\
  25385. !*** ./packages/jest-diff/build/cleanupSemantic.js ***!
  25386. \*****************************************************/
  25387. /*! no static exports found */
  25388. /***/ (function(module, exports, __webpack_require__) {
  25389. "use strict";
  25390. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25391. Object.defineProperty(exports, '__esModule', {
  25392. value: true
  25393. });
  25394. exports.cleanupSemantic = exports.DIFF_INSERT = exports.DIFF_DELETE = exports.DIFF_EQUAL = exports.Diff = void 0;
  25395. function _defineProperty(obj, key, value) {
  25396. if (key in obj) {
  25397. Object.defineProperty(obj, key, {
  25398. value: value,
  25399. enumerable: true,
  25400. configurable: true,
  25401. writable: true
  25402. });
  25403. } else {
  25404. obj[key] = value;
  25405. }
  25406. return obj;
  25407. }
  25408. /**
  25409. * Diff Match and Patch
  25410. * Copyright 2018 The diff-match-patch Authors.
  25411. * https://github.com/google/diff-match-patch
  25412. *
  25413. * Licensed under the Apache License, Version 2.0 (the "License");
  25414. * you may not use this file except in compliance with the License.
  25415. * You may obtain a copy of the License at
  25416. *
  25417. * http://www.apache.org/licenses/LICENSE-2.0
  25418. *
  25419. * Unless required by applicable law or agreed to in writing, software
  25420. * distributed under the License is distributed on an "AS IS" BASIS,
  25421. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  25422. * See the License for the specific language governing permissions and
  25423. * limitations under the License.
  25424. */
  25425. /**
  25426. * @fileoverview Computes the difference between two texts to create a patch.
  25427. * Applies the patch onto another text, allowing for errors.
  25428. * @author fraser@google.com (Neil Fraser)
  25429. */
  25430. /**
  25431. * CHANGES by pedrottimark to diff_match_patch_uncompressed.ts file:
  25432. *
  25433. * 1. Delete anything not needed to use diff_cleanupSemantic method
  25434. * 2. Convert from prototype properties to var declarations
  25435. * 3. Convert Diff to class from constructor and prototype
  25436. * 4. Add type annotations for arguments and return values
  25437. * 5. Add exports
  25438. */
  25439. /**
  25440. * The data structure representing a diff is an array of tuples:
  25441. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  25442. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  25443. */
  25444. var DIFF_DELETE = -1;
  25445. exports.DIFF_DELETE = DIFF_DELETE;
  25446. var DIFF_INSERT = 1;
  25447. exports.DIFF_INSERT = DIFF_INSERT;
  25448. var DIFF_EQUAL = 0;
  25449. /**
  25450. * Class representing one diff tuple.
  25451. * Attempts to look like a two-element array (which is what this used to be).
  25452. * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL.
  25453. * @param {string} text Text to be deleted, inserted, or retained.
  25454. * @constructor
  25455. */
  25456. exports.DIFF_EQUAL = DIFF_EQUAL;
  25457. var Diff = function Diff(op, text) {
  25458. _classCallCheck(this, Diff);
  25459. _defineProperty(this, 0, void 0);
  25460. _defineProperty(this, 1, void 0);
  25461. this[0] = op;
  25462. this[1] = text;
  25463. };
  25464. /**
  25465. * Determine the common prefix of two strings.
  25466. * @param {string} text1 First string.
  25467. * @param {string} text2 Second string.
  25468. * @return {number} The number of characters common to the start of each
  25469. * string.
  25470. */
  25471. exports.Diff = Diff;
  25472. var diff_commonPrefix = function diff_commonPrefix(text1, text2) {
  25473. // Quick check for common null cases.
  25474. if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
  25475. return 0;
  25476. } // Binary search.
  25477. // Performance analysis: https://neil.fraser.name/news/2007/10/09/
  25478. var pointermin = 0;
  25479. var pointermax = Math.min(text1.length, text2.length);
  25480. var pointermid = pointermax;
  25481. var pointerstart = 0;
  25482. while (pointermin < pointermid) {
  25483. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  25484. pointermin = pointermid;
  25485. pointerstart = pointermin;
  25486. } else {
  25487. pointermax = pointermid;
  25488. }
  25489. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  25490. }
  25491. return pointermid;
  25492. };
  25493. /**
  25494. * Determine the common suffix of two strings.
  25495. * @param {string} text1 First string.
  25496. * @param {string} text2 Second string.
  25497. * @return {number} The number of characters common to the end of each string.
  25498. */
  25499. var diff_commonSuffix = function diff_commonSuffix(text1, text2) {
  25500. // Quick check for common null cases.
  25501. if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
  25502. return 0;
  25503. } // Binary search.
  25504. // Performance analysis: https://neil.fraser.name/news/2007/10/09/
  25505. var pointermin = 0;
  25506. var pointermax = Math.min(text1.length, text2.length);
  25507. var pointermid = pointermax;
  25508. var pointerend = 0;
  25509. while (pointermin < pointermid) {
  25510. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  25511. pointermin = pointermid;
  25512. pointerend = pointermin;
  25513. } else {
  25514. pointermax = pointermid;
  25515. }
  25516. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  25517. }
  25518. return pointermid;
  25519. };
  25520. /**
  25521. * Determine if the suffix of one string is the prefix of another.
  25522. * @param {string} text1 First string.
  25523. * @param {string} text2 Second string.
  25524. * @return {number} The number of characters common to the end of the first
  25525. * string and the start of the second string.
  25526. * @private
  25527. */
  25528. var diff_commonOverlap_ = function diff_commonOverlap_(text1, text2) {
  25529. // Cache the text lengths to prevent multiple calls.
  25530. var text1_length = text1.length;
  25531. var text2_length = text2.length; // Eliminate the null case.
  25532. if (text1_length == 0 || text2_length == 0) {
  25533. return 0;
  25534. } // Truncate the longer string.
  25535. if (text1_length > text2_length) {
  25536. text1 = text1.substring(text1_length - text2_length);
  25537. } else if (text1_length < text2_length) {
  25538. text2 = text2.substring(0, text1_length);
  25539. }
  25540. var text_length = Math.min(text1_length, text2_length); // Quick check for the worst case.
  25541. if (text1 == text2) {
  25542. return text_length;
  25543. } // Start by looking for a single character match
  25544. // and increase length until no match is found.
  25545. // Performance analysis: https://neil.fraser.name/news/2010/11/04/
  25546. var best = 0;
  25547. var length = 1;
  25548. while (true) {
  25549. var pattern = text1.substring(text_length - length);
  25550. var found = text2.indexOf(pattern);
  25551. if (found == -1) {
  25552. return best;
  25553. }
  25554. length += found;
  25555. if (found == 0 || text1.substring(text_length - length) == text2.substring(0, length)) {
  25556. best = length;
  25557. length++;
  25558. }
  25559. }
  25560. };
  25561. /**
  25562. * Reduce the number of edits by eliminating semantically trivial equalities.
  25563. * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
  25564. */
  25565. var diff_cleanupSemantic = function diff_cleanupSemantic(diffs) {
  25566. var changes = false;
  25567. var equalities = []; // Stack of indices where equalities are found.
  25568. var equalitiesLength = 0; // Keeping our own length var is faster in JS.
  25569. /** @type {?string} */
  25570. var lastEquality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1]
  25571. var pointer = 0; // Index of current position.
  25572. // Number of characters that changed prior to the equality.
  25573. var length_insertions1 = 0;
  25574. var length_deletions1 = 0; // Number of characters that changed after the equality.
  25575. var length_insertions2 = 0;
  25576. var length_deletions2 = 0;
  25577. while (pointer < diffs.length) {
  25578. if (diffs[pointer][0] == DIFF_EQUAL) {
  25579. // Equality found.
  25580. equalities[equalitiesLength++] = pointer;
  25581. length_insertions1 = length_insertions2;
  25582. length_deletions1 = length_deletions2;
  25583. length_insertions2 = 0;
  25584. length_deletions2 = 0;
  25585. lastEquality = diffs[pointer][1];
  25586. } else {
  25587. // An insertion or deletion.
  25588. if (diffs[pointer][0] == DIFF_INSERT) {
  25589. length_insertions2 += diffs[pointer][1].length;
  25590. } else {
  25591. length_deletions2 += diffs[pointer][1].length;
  25592. } // Eliminate an equality that is smaller or equal to the edits on both
  25593. // sides of it.
  25594. if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(length_insertions2, length_deletions2)) {
  25595. // Duplicate record.
  25596. diffs.splice(equalities[equalitiesLength - 1], 0, new Diff(DIFF_DELETE, lastEquality)); // Change second copy to insert.
  25597. diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; // Throw away the equality we just deleted.
  25598. equalitiesLength--; // Throw away the previous equality (it needs to be reevaluated).
  25599. equalitiesLength--;
  25600. pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
  25601. length_insertions1 = 0; // Reset the counters.
  25602. length_deletions1 = 0;
  25603. length_insertions2 = 0;
  25604. length_deletions2 = 0;
  25605. lastEquality = null;
  25606. changes = true;
  25607. }
  25608. }
  25609. pointer++;
  25610. } // Normalize the diff.
  25611. if (changes) {
  25612. diff_cleanupMerge(diffs);
  25613. }
  25614. diff_cleanupSemanticLossless(diffs); // Find any overlaps between deletions and insertions.
  25615. // e.g: <del>abcxxx</del><ins>xxxdef</ins>
  25616. // -> <del>abc</del>xxx<ins>def</ins>
  25617. // e.g: <del>xxxabc</del><ins>defxxx</ins>
  25618. // -> <ins>def</ins>xxx<del>abc</del>
  25619. // Only extract an overlap if it is as big as the edit ahead or behind it.
  25620. pointer = 1;
  25621. while (pointer < diffs.length) {
  25622. if (diffs[pointer - 1][0] == DIFF_DELETE && diffs[pointer][0] == DIFF_INSERT) {
  25623. var deletion = diffs[pointer - 1][1];
  25624. var insertion = diffs[pointer][1];
  25625. var overlap_length1 = diff_commonOverlap_(deletion, insertion);
  25626. var overlap_length2 = diff_commonOverlap_(insertion, deletion);
  25627. if (overlap_length1 >= overlap_length2) {
  25628. if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
  25629. // Overlap found. Insert an equality and trim the surrounding edits.
  25630. diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, insertion.substring(0, overlap_length1)));
  25631. diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
  25632. diffs[pointer + 1][1] = insertion.substring(overlap_length1);
  25633. pointer++;
  25634. }
  25635. } else {
  25636. if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
  25637. // Reverse overlap found.
  25638. // Insert an equality and swap and trim the surrounding edits.
  25639. diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, deletion.substring(0, overlap_length2)));
  25640. diffs[pointer - 1][0] = DIFF_INSERT;
  25641. diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
  25642. diffs[pointer + 1][0] = DIFF_DELETE;
  25643. diffs[pointer + 1][1] = deletion.substring(overlap_length2);
  25644. pointer++;
  25645. }
  25646. }
  25647. pointer++;
  25648. }
  25649. pointer++;
  25650. }
  25651. };
  25652. /**
  25653. * Look for single edits surrounded on both sides by equalities
  25654. * which can be shifted sideways to align the edit to a word boundary.
  25655. * e.g: The c<ins>at c</ins>ame. -> The <ins>cat </ins>came.
  25656. * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
  25657. */
  25658. exports.cleanupSemantic = diff_cleanupSemantic;
  25659. var diff_cleanupSemanticLossless = function diff_cleanupSemanticLossless(diffs) {
  25660. /**
  25661. * Given two strings, compute a score representing whether the internal
  25662. * boundary falls on logical boundaries.
  25663. * Scores range from 6 (best) to 0 (worst).
  25664. * Closure, but does not reference any external variables.
  25665. * @param {string} one First string.
  25666. * @param {string} two Second string.
  25667. * @return {number} The score.
  25668. * @private
  25669. */
  25670. function diff_cleanupSemanticScore_(one, two) {
  25671. if (!one || !two) {
  25672. // Edges are the best.
  25673. return 6;
  25674. } // Each port of this function behaves slightly differently due to
  25675. // subtle differences in each language's definition of things like
  25676. // 'whitespace'. Since this function's purpose is largely cosmetic,
  25677. // the choice has been made to use each language's native features
  25678. // rather than force total conformity.
  25679. var char1 = one.charAt(one.length - 1);
  25680. var char2 = two.charAt(0);
  25681. var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);
  25682. var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);
  25683. var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);
  25684. var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);
  25685. var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);
  25686. var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);
  25687. var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);
  25688. var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);
  25689. if (blankLine1 || blankLine2) {
  25690. // Five points for blank lines.
  25691. return 5;
  25692. } else if (lineBreak1 || lineBreak2) {
  25693. // Four points for line breaks.
  25694. return 4;
  25695. } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
  25696. // Three points for end of sentences.
  25697. return 3;
  25698. } else if (whitespace1 || whitespace2) {
  25699. // Two points for whitespace.
  25700. return 2;
  25701. } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
  25702. // One point for non-alphanumeric.
  25703. return 1;
  25704. }
  25705. return 0;
  25706. }
  25707. var pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  25708. while (pointer < diffs.length - 1) {
  25709. if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
  25710. // This is a single edit surrounded by equalities.
  25711. var equality1 = diffs[pointer - 1][1];
  25712. var edit = diffs[pointer][1];
  25713. var equality2 = diffs[pointer + 1][1]; // First, shift the edit as far left as possible.
  25714. var commonOffset = diff_commonSuffix(equality1, edit);
  25715. if (commonOffset) {
  25716. var commonString = edit.substring(edit.length - commonOffset);
  25717. equality1 = equality1.substring(0, equality1.length - commonOffset);
  25718. edit = commonString + edit.substring(0, edit.length - commonOffset);
  25719. equality2 = commonString + equality2;
  25720. } // Second, step character by character right, looking for the best fit.
  25721. var bestEquality1 = equality1;
  25722. var bestEdit = edit;
  25723. var bestEquality2 = equality2;
  25724. var bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
  25725. while (edit.charAt(0) === equality2.charAt(0)) {
  25726. equality1 += edit.charAt(0);
  25727. edit = edit.substring(1) + equality2.charAt(0);
  25728. equality2 = equality2.substring(1);
  25729. var score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2); // The >= encourages trailing rather than leading whitespace on edits.
  25730. if (score >= bestScore) {
  25731. bestScore = score;
  25732. bestEquality1 = equality1;
  25733. bestEdit = edit;
  25734. bestEquality2 = equality2;
  25735. }
  25736. }
  25737. if (diffs[pointer - 1][1] != bestEquality1) {
  25738. // We have an improvement, save it back to the diff.
  25739. if (bestEquality1) {
  25740. diffs[pointer - 1][1] = bestEquality1;
  25741. } else {
  25742. diffs.splice(pointer - 1, 1);
  25743. pointer--;
  25744. }
  25745. diffs[pointer][1] = bestEdit;
  25746. if (bestEquality2) {
  25747. diffs[pointer + 1][1] = bestEquality2;
  25748. } else {
  25749. diffs.splice(pointer + 1, 1);
  25750. pointer--;
  25751. }
  25752. }
  25753. }
  25754. pointer++;
  25755. }
  25756. }; // Define some regex patterns for matching boundaries.
  25757. var nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;
  25758. var whitespaceRegex_ = /\s/;
  25759. var linebreakRegex_ = /[\r\n]/;
  25760. var blanklineEndRegex_ = /\n\r?\n$/;
  25761. var blanklineStartRegex_ = /^\r?\n\r?\n/;
  25762. /**
  25763. * Reorder and merge like edit sections. Merge equalities.
  25764. * Any edit section can move as long as it doesn't cross an equality.
  25765. * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
  25766. */
  25767. var diff_cleanupMerge = function diff_cleanupMerge(diffs) {
  25768. // Add a dummy entry at the end.
  25769. diffs.push(new Diff(DIFF_EQUAL, ''));
  25770. var pointer = 0;
  25771. var count_delete = 0;
  25772. var count_insert = 0;
  25773. var text_delete = '';
  25774. var text_insert = '';
  25775. var commonlength;
  25776. while (pointer < diffs.length) {
  25777. switch (diffs[pointer][0]) {
  25778. case DIFF_INSERT:
  25779. count_insert++;
  25780. text_insert += diffs[pointer][1];
  25781. pointer++;
  25782. break;
  25783. case DIFF_DELETE:
  25784. count_delete++;
  25785. text_delete += diffs[pointer][1];
  25786. pointer++;
  25787. break;
  25788. case DIFF_EQUAL:
  25789. // Upon reaching an equality, check for prior redundancies.
  25790. if (count_delete + count_insert > 1) {
  25791. if (count_delete !== 0 && count_insert !== 0) {
  25792. // Factor out any common prefixies.
  25793. commonlength = diff_commonPrefix(text_insert, text_delete);
  25794. if (commonlength !== 0) {
  25795. if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
  25796. diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
  25797. } else {
  25798. diffs.splice(0, 0, new Diff(DIFF_EQUAL, text_insert.substring(0, commonlength)));
  25799. pointer++;
  25800. }
  25801. text_insert = text_insert.substring(commonlength);
  25802. text_delete = text_delete.substring(commonlength);
  25803. } // Factor out any common suffixies.
  25804. commonlength = diff_commonSuffix(text_insert, text_delete);
  25805. if (commonlength !== 0) {
  25806. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  25807. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  25808. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  25809. }
  25810. } // Delete the offending records and add the merged ones.
  25811. pointer -= count_delete + count_insert;
  25812. diffs.splice(pointer, count_delete + count_insert);
  25813. if (text_delete.length) {
  25814. diffs.splice(pointer, 0, new Diff(DIFF_DELETE, text_delete));
  25815. pointer++;
  25816. }
  25817. if (text_insert.length) {
  25818. diffs.splice(pointer, 0, new Diff(DIFF_INSERT, text_insert));
  25819. pointer++;
  25820. }
  25821. pointer++;
  25822. } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
  25823. // Merge this equality with the previous one.
  25824. diffs[pointer - 1][1] += diffs[pointer][1];
  25825. diffs.splice(pointer, 1);
  25826. } else {
  25827. pointer++;
  25828. }
  25829. count_insert = 0;
  25830. count_delete = 0;
  25831. text_delete = '';
  25832. text_insert = '';
  25833. break;
  25834. }
  25835. }
  25836. if (diffs[diffs.length - 1][1] === '') {
  25837. diffs.pop(); // Remove the dummy entry at the end.
  25838. } // Second pass: look for single edits surrounded on both sides by equalities
  25839. // which can be shifted sideways to eliminate an equality.
  25840. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  25841. var changes = false;
  25842. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  25843. while (pointer < diffs.length - 1) {
  25844. if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
  25845. // This is a single edit surrounded by equalities.
  25846. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
  25847. // Shift the edit over the previous equality.
  25848. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  25849. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  25850. diffs.splice(pointer - 1, 1);
  25851. changes = true;
  25852. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  25853. // Shift the edit over the next equality.
  25854. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  25855. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  25856. diffs.splice(pointer + 1, 1);
  25857. changes = true;
  25858. }
  25859. }
  25860. pointer++;
  25861. } // If shifts were made, the diff needs reordering and another shift sweep.
  25862. if (changes) {
  25863. diff_cleanupMerge(diffs);
  25864. }
  25865. };
  25866. /***/ }),
  25867. /***/ "./packages/jest-diff/build/constants.js":
  25868. /*!***********************************************!*\
  25869. !*** ./packages/jest-diff/build/constants.js ***!
  25870. \***********************************************/
  25871. /*! no static exports found */
  25872. /***/ (function(module, exports, __webpack_require__) {
  25873. "use strict";
  25874. Object.defineProperty(exports, '__esModule', {
  25875. value: true
  25876. });
  25877. exports.SIMILAR_MESSAGE = exports.NO_DIFF_MESSAGE = void 0;
  25878. var _chalk = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  25879. function _interopRequireDefault(obj) {
  25880. return obj && obj.__esModule ? obj : {
  25881. default: obj
  25882. };
  25883. }
  25884. /**
  25885. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  25886. *
  25887. * This source code is licensed under the MIT license found in the
  25888. * LICENSE file in the root directory of this source tree.
  25889. */
  25890. var NO_DIFF_MESSAGE = _chalk.default.dim('Compared values have no visual difference.');
  25891. exports.NO_DIFF_MESSAGE = NO_DIFF_MESSAGE;
  25892. var SIMILAR_MESSAGE = _chalk.default.dim('Compared values serialize to the same structure.\n' + 'Printing internal object structure without calling `toJSON` instead.');
  25893. exports.SIMILAR_MESSAGE = SIMILAR_MESSAGE;
  25894. /***/ }),
  25895. /***/ "./packages/jest-diff/build/diffLines.js":
  25896. /*!***********************************************!*\
  25897. !*** ./packages/jest-diff/build/diffLines.js ***!
  25898. \***********************************************/
  25899. /*! no static exports found */
  25900. /***/ (function(module, exports, __webpack_require__) {
  25901. "use strict";
  25902. Object.defineProperty(exports, '__esModule', {
  25903. value: true
  25904. });
  25905. exports.default = void 0;
  25906. var _chalk = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  25907. var _diffSequences = _interopRequireDefault(__webpack_require__(/*! diff-sequences */ "./packages/diff-sequences/build/index.js"));
  25908. var _constants = __webpack_require__(/*! ./constants */ "./packages/jest-diff/build/constants.js");
  25909. var _printDiffs = __webpack_require__(/*! ./printDiffs */ "./packages/jest-diff/build/printDiffs.js");
  25910. function _interopRequireDefault(obj) {
  25911. return obj && obj.__esModule ? obj : {
  25912. default: obj
  25913. };
  25914. }
  25915. /**
  25916. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  25917. *
  25918. * This source code is licensed under the MIT license found in the
  25919. * LICENSE file in the root directory of this source tree.
  25920. */
  25921. var DIFF_CONTEXT_DEFAULT = 5;
  25922. var fgDelete = _chalk.default.green;
  25923. var fgInsert = _chalk.default.red;
  25924. var fgCommon = _chalk.default.dim; // common lines (even indentation same)
  25925. var fgIndent = _chalk.default.cyan; // common lines (only indentation different)
  25926. var bgCommon = _chalk.default.bgYellow; // edge spaces in common line (even indentation same)
  25927. var bgInverse = _chalk.default.inverse; // edge spaces in any other lines
  25928. // ONLY trailing if expected value is snapshot or multiline string.
  25929. var highlightTrailingSpaces = function highlightTrailingSpaces(line, bgColor) {
  25930. return line.replace(/\s+$/, bgColor('$&'));
  25931. }; // BOTH leading AND trailing if expected value is data structure.
  25932. var highlightLeadingTrailingSpaces = function highlightLeadingTrailingSpaces(line, bgColor // If line consists of ALL spaces: highlight all of them.
  25933. ) {
  25934. return highlightTrailingSpaces(line, bgColor).replace( // If line has an ODD length of leading spaces: highlight only the LAST.
  25935. /^(\s\s)*(\s)(?=[^\s])/, '$1' + bgColor('$2'));
  25936. };
  25937. var getHighlightSpaces = function getHighlightSpaces(bothEdges) {
  25938. return bothEdges ? highlightLeadingTrailingSpaces : highlightTrailingSpaces;
  25939. }; // Given index interval in expected lines, put formatted delete lines.
  25940. var formatDelete = function formatDelete(aStart, aEnd, aLinesUn, aLinesIn, put) {
  25941. var highlightSpaces = getHighlightSpaces(aLinesUn !== aLinesIn);
  25942. for (var aIndex = aStart; aIndex !== aEnd; aIndex += 1) {
  25943. var aLineUn = aLinesUn[aIndex];
  25944. var aLineIn = aLinesIn[aIndex];
  25945. var indentation = aLineIn.slice(0, aLineIn.length - aLineUn.length);
  25946. put(fgDelete('- ' + indentation + highlightSpaces(aLineUn, bgInverse)));
  25947. }
  25948. }; // Given index interval in received lines, put formatted insert lines.
  25949. var formatInsert = function formatInsert(bStart, bEnd, bLinesUn, bLinesIn, put) {
  25950. var highlightSpaces = getHighlightSpaces(bLinesUn !== bLinesIn);
  25951. for (var bIndex = bStart; bIndex !== bEnd; bIndex += 1) {
  25952. var bLineUn = bLinesUn[bIndex];
  25953. var bLineIn = bLinesIn[bIndex];
  25954. var indentation = bLineIn.slice(0, bLineIn.length - bLineUn.length);
  25955. put(fgInsert('+ ' + indentation + highlightSpaces(bLineUn, bgInverse)));
  25956. }
  25957. }; // Given the number of items and starting indexes of a common subsequence,
  25958. // put formatted common lines.
  25959. var formatCommon = function formatCommon(nCommon, aCommon, bCommon, aLinesIn, bLinesUn, bLinesIn, put) {
  25960. var highlightSpaces = getHighlightSpaces(bLinesUn !== bLinesIn);
  25961. for (; nCommon !== 0; nCommon -= 1, aCommon += 1, bCommon += 1) {
  25962. var bLineUn = bLinesUn[bCommon];
  25963. var bLineIn = bLinesIn[bCommon];
  25964. var bLineInLength = bLineIn.length; // For common lines, received indentation seems more intuitive.
  25965. var indentation = bLineIn.slice(0, bLineInLength - bLineUn.length); // Color shows whether expected and received line has same indentation.
  25966. var hasSameIndentation = aLinesIn[aCommon].length === bLineInLength;
  25967. var fg = hasSameIndentation ? fgCommon : fgIndent;
  25968. var bg = hasSameIndentation ? bgCommon : bgInverse;
  25969. put(fg(' ' + indentation + highlightSpaces(bLineUn, bg)));
  25970. }
  25971. }; // jest --expand
  25972. // Return formatted diff as joined string of all lines.
  25973. var diffExpand = function diffExpand(aLinesUn, bLinesUn, aLinesIn, bLinesIn) {
  25974. var isCommon = function isCommon(aIndex, bIndex) {
  25975. return aLinesUn[aIndex] === bLinesUn[bIndex];
  25976. };
  25977. var array = [];
  25978. var put = function put(line) {
  25979. array.push(line);
  25980. };
  25981. var aStart = 0;
  25982. var bStart = 0;
  25983. var foundSubsequence = function foundSubsequence(nCommon, aCommon, bCommon) {
  25984. formatDelete(aStart, aCommon, aLinesUn, aLinesIn, put);
  25985. formatInsert(bStart, bCommon, bLinesUn, bLinesIn, put);
  25986. formatCommon(nCommon, aCommon, bCommon, aLinesIn, bLinesUn, bLinesIn, put);
  25987. aStart = aCommon + nCommon;
  25988. bStart = bCommon + nCommon;
  25989. };
  25990. var aLength = aLinesUn.length;
  25991. var bLength = bLinesUn.length;
  25992. (0, _diffSequences.default)(aLength, bLength, isCommon, foundSubsequence); // After the last common subsequence, format remaining change lines.
  25993. formatDelete(aStart, aLength, aLinesUn, aLinesIn, put);
  25994. formatInsert(bStart, bLength, bLinesUn, bLinesIn, put);
  25995. return array.join('\n');
  25996. };
  25997. var getContextLines = function getContextLines(options) {
  25998. return options && typeof options.contextLines === 'number' && options.contextLines >= 0 ? options.contextLines : DIFF_CONTEXT_DEFAULT;
  25999. }; // jest --no-expand
  26000. // Return joined string of formatted diff for all change lines,
  26001. // but if some common lines are omitted because there are more than the context,
  26002. // then a “patch mark” precedes each set of adjacent changed and common lines.
  26003. var diffNoExpand = function diffNoExpand(aLinesUn, bLinesUn, aLinesIn, bLinesIn, nContextLines) {
  26004. var isCommon = function isCommon(aIndex, bIndex) {
  26005. return aLinesUn[aIndex] === bLinesUn[bIndex];
  26006. };
  26007. var iPatchMark = 0; // index of placeholder line for patch mark
  26008. var array = [''];
  26009. var put = function put(line) {
  26010. array.push(line);
  26011. };
  26012. var isAtEnd = false;
  26013. var aLength = aLinesUn.length;
  26014. var bLength = bLinesUn.length;
  26015. var nContextLines2 = nContextLines + nContextLines; // Initialize the first patch for changes at the start,
  26016. // especially for edge case in which there is no common subsequence.
  26017. var aStart = 0;
  26018. var aEnd = 0;
  26019. var bStart = 0;
  26020. var bEnd = 0; // Given the number of items and starting indexes of each common subsequence,
  26021. // format any preceding change lines, and then common context lines.
  26022. var foundSubsequence = function foundSubsequence(nCommon, aStartCommon, bStartCommon) {
  26023. var aEndCommon = aStartCommon + nCommon;
  26024. var bEndCommon = bStartCommon + nCommon;
  26025. isAtEnd = aEndCommon === aLength && bEndCommon === bLength; // If common subsequence is at start, re-initialize the first patch.
  26026. if (aStartCommon === 0 && bStartCommon === 0) {
  26027. var nLines = nContextLines < nCommon ? nContextLines : nCommon;
  26028. aStart = aEndCommon - nLines;
  26029. bStart = bEndCommon - nLines;
  26030. formatCommon(nLines, aStart, bStart, aLinesIn, bLinesUn, bLinesIn, put);
  26031. aEnd = aEndCommon;
  26032. bEnd = bEndCommon;
  26033. return;
  26034. } // Format preceding change lines.
  26035. formatDelete(aEnd, aStartCommon, aLinesUn, aLinesIn, put);
  26036. formatInsert(bEnd, bStartCommon, bLinesUn, bLinesIn, put);
  26037. aEnd = aStartCommon;
  26038. bEnd = bStartCommon; // If common subsequence is at end, then context follows preceding changes;
  26039. // else context follows preceding changes AND precedes following changes.
  26040. var maxContextLines = isAtEnd ? nContextLines : nContextLines2;
  26041. if (nCommon <= maxContextLines) {
  26042. // The patch includes all lines in the common subsequence.
  26043. formatCommon(nCommon, aEnd, bEnd, aLinesIn, bLinesUn, bLinesIn, put);
  26044. aEnd += nCommon;
  26045. bEnd += nCommon;
  26046. return;
  26047. } // The patch ends because context is less than number of common lines.
  26048. formatCommon(nContextLines, aEnd, bEnd, aLinesIn, bLinesUn, bLinesIn, put);
  26049. aEnd += nContextLines;
  26050. bEnd += nContextLines;
  26051. array[iPatchMark] = (0, _printDiffs.createPatchMark)(aStart, aEnd, bStart, bEnd); // If common subsequence is not at end, another patch follows it.
  26052. if (!isAtEnd) {
  26053. iPatchMark = array.length; // index of placeholder line
  26054. array[iPatchMark] = '';
  26055. var _nLines = nContextLines < nCommon ? nContextLines : nCommon;
  26056. aStart = aEndCommon - _nLines;
  26057. bStart = bEndCommon - _nLines;
  26058. formatCommon(_nLines, aStart, bStart, aLinesIn, bLinesUn, bLinesIn, put);
  26059. aEnd = aEndCommon;
  26060. bEnd = bEndCommon;
  26061. }
  26062. };
  26063. (0, _diffSequences.default)(aLength, bLength, isCommon, foundSubsequence); // If no common subsequence or last was not at end, format remaining change lines.
  26064. if (!isAtEnd) {
  26065. formatDelete(aEnd, aLength, aLinesUn, aLinesIn, put);
  26066. formatInsert(bEnd, bLength, bLinesUn, bLinesIn, put);
  26067. aEnd = aLength;
  26068. bEnd = bLength;
  26069. }
  26070. if (aStart === 0 && aEnd === aLength && bStart === 0 && bEnd === bLength) {
  26071. array.splice(0, 1); // delete placeholder line for patch mark
  26072. } else {
  26073. array[iPatchMark] = (0, _printDiffs.createPatchMark)(aStart, aEnd, bStart, bEnd);
  26074. }
  26075. return array.join('\n');
  26076. };
  26077. var _default = function _default(a, b, options, original) {
  26078. if (a === b) {
  26079. return _constants.NO_DIFF_MESSAGE;
  26080. }
  26081. var aLinesUn = a.split('\n');
  26082. var bLinesUn = b.split('\n'); // Indentation is unknown if expected value is snapshot or multiline string.
  26083. var aLinesIn = aLinesUn;
  26084. var bLinesIn = bLinesUn;
  26085. if (original) {
  26086. // Indentation is known if expected value is data structure:
  26087. // Compare lines without indentation and format lines with indentation.
  26088. aLinesIn = original.a.split('\n');
  26089. bLinesIn = original.b.split('\n');
  26090. if (aLinesUn.length !== aLinesIn.length || bLinesUn.length !== bLinesIn.length) {
  26091. // Fall back if unindented and indented lines are inconsistent.
  26092. aLinesUn = aLinesIn;
  26093. bLinesUn = bLinesIn;
  26094. }
  26095. }
  26096. return (0, _printDiffs.printAnnotation)(options) + (options && options.expand === false ? diffNoExpand(aLinesUn, bLinesUn, aLinesIn, bLinesIn, getContextLines(options)) : diffExpand(aLinesUn, bLinesUn, aLinesIn, bLinesIn));
  26097. };
  26098. exports.default = _default;
  26099. /***/ }),
  26100. /***/ "./packages/jest-diff/build/diffStrings.js":
  26101. /*!*************************************************!*\
  26102. !*** ./packages/jest-diff/build/diffStrings.js ***!
  26103. \*************************************************/
  26104. /*! no static exports found */
  26105. /***/ (function(module, exports, __webpack_require__) {
  26106. "use strict";
  26107. Object.defineProperty(exports, '__esModule', {
  26108. value: true
  26109. });
  26110. exports.default = void 0;
  26111. var _diffSequences = _interopRequireDefault(__webpack_require__(/*! diff-sequences */ "./packages/diff-sequences/build/index.js"));
  26112. var _cleanupSemantic = __webpack_require__(/*! ./cleanupSemantic */ "./packages/jest-diff/build/cleanupSemantic.js");
  26113. function _interopRequireDefault(obj) {
  26114. return obj && obj.__esModule ? obj : {
  26115. default: obj
  26116. };
  26117. }
  26118. /**
  26119. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  26120. *
  26121. * This source code is licensed under the MIT license found in the
  26122. * LICENSE file in the root directory of this source tree.
  26123. */
  26124. var diffStrings = function diffStrings(a, b) {
  26125. var isCommon = function isCommon(aIndex, bIndex) {
  26126. return a[aIndex] === b[bIndex];
  26127. };
  26128. var aIndex = 0;
  26129. var bIndex = 0;
  26130. var diffs = [];
  26131. var foundSubsequence = function foundSubsequence(nCommon, aCommon, bCommon) {
  26132. if (aIndex !== aCommon) {
  26133. diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, a.slice(aIndex, aCommon)));
  26134. }
  26135. if (bIndex !== bCommon) {
  26136. diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, b.slice(bIndex, bCommon)));
  26137. }
  26138. aIndex = aCommon + nCommon; // number of characters compared in a
  26139. bIndex = bCommon + nCommon; // number of characters compared in b
  26140. diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_EQUAL, b.slice(bCommon, bIndex)));
  26141. };
  26142. (0, _diffSequences.default)(a.length, b.length, isCommon, foundSubsequence); // After the last common subsequence, push remaining change items.
  26143. if (aIndex !== a.length) {
  26144. diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, a.slice(aIndex)));
  26145. }
  26146. if (bIndex !== b.length) {
  26147. diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, b.slice(bIndex)));
  26148. }
  26149. return diffs;
  26150. };
  26151. var _default = diffStrings;
  26152. exports.default = _default;
  26153. /***/ }),
  26154. /***/ "./packages/jest-diff/build/getAlignedDiffs.js":
  26155. /*!*****************************************************!*\
  26156. !*** ./packages/jest-diff/build/getAlignedDiffs.js ***!
  26157. \*****************************************************/
  26158. /*! no static exports found */
  26159. /***/ (function(module, exports, __webpack_require__) {
  26160. "use strict";
  26161. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  26162. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  26163. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  26164. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  26165. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26166. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26167. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  26168. Object.defineProperty(exports, '__esModule', {
  26169. value: true
  26170. });
  26171. exports.default = void 0;
  26172. var _cleanupSemantic = __webpack_require__(/*! ./cleanupSemantic */ "./packages/jest-diff/build/cleanupSemantic.js");
  26173. var _printDiffs = __webpack_require__(/*! ./printDiffs */ "./packages/jest-diff/build/printDiffs.js");
  26174. function _defineProperty(obj, key, value) {
  26175. if (key in obj) {
  26176. Object.defineProperty(obj, key, {
  26177. value: value,
  26178. enumerable: true,
  26179. configurable: true,
  26180. writable: true
  26181. });
  26182. } else {
  26183. obj[key] = value;
  26184. }
  26185. return obj;
  26186. } // Encapsulate change lines until either a common newline or the end.
  26187. var ChangeBuffer =
  26188. /*#__PURE__*/
  26189. function () {
  26190. // incomplete line
  26191. // complete lines
  26192. function ChangeBuffer(op) {
  26193. _classCallCheck(this, ChangeBuffer);
  26194. _defineProperty(this, 'op', void 0);
  26195. _defineProperty(this, 'line', void 0);
  26196. _defineProperty(this, 'lines', void 0);
  26197. this.op = op;
  26198. this.line = [];
  26199. this.lines = [];
  26200. }
  26201. _createClass(ChangeBuffer, [{
  26202. key: "pushSubstring",
  26203. value: function pushSubstring(substring) {
  26204. this.pushDiff(new _cleanupSemantic.Diff(this.op, substring));
  26205. }
  26206. }, {
  26207. key: "pushLine",
  26208. value: function pushLine() {
  26209. // Assume call only if line has at least one diff,
  26210. // therefore an empty line must have a diff which has an empty string.
  26211. this.lines.push(new _cleanupSemantic.Diff(this.op, (0, _printDiffs.getHighlightedString)(this.op, this.line)));
  26212. this.line.length = 0;
  26213. }
  26214. }, {
  26215. key: "isLineEmpty",
  26216. value: function isLineEmpty() {
  26217. return this.line.length === 0;
  26218. } // Minor input to buffer.
  26219. }, {
  26220. key: "pushDiff",
  26221. value: function pushDiff(diff) {
  26222. this.line.push(diff);
  26223. } // Main input to buffer.
  26224. }, {
  26225. key: "align",
  26226. value: function align(diff) {
  26227. var _this = this;
  26228. var string = diff[1];
  26229. if (_printDiffs.MULTILINE_REGEXP.test(string)) {
  26230. var substrings = string.split('\n');
  26231. var iLast = substrings.length - 1;
  26232. substrings.forEach(function (substring, i) {
  26233. if (i < iLast) {
  26234. // The first substring completes the current change line.
  26235. // A middle substring is a change line.
  26236. _this.pushSubstring(substring);
  26237. _this.pushLine();
  26238. } else if (substring.length !== 0) {
  26239. // The last substring starts a change line, if it is not empty.
  26240. // Important: This non-empty condition also automatically omits
  26241. // the newline appended to the end of expected and received strings.
  26242. _this.pushSubstring(substring);
  26243. }
  26244. });
  26245. } else {
  26246. // Append non-multiline string to current change line.
  26247. this.pushDiff(diff);
  26248. }
  26249. } // Output from buffer.
  26250. }, {
  26251. key: "moveLinesTo",
  26252. value: function moveLinesTo(lines) {
  26253. if (!this.isLineEmpty()) {
  26254. this.pushLine();
  26255. }
  26256. lines.push.apply(lines, _toConsumableArray(this.lines));
  26257. this.lines.length = 0;
  26258. }
  26259. }]);
  26260. return ChangeBuffer;
  26261. }(); // Encapsulate common and change lines.
  26262. var CommonBuffer =
  26263. /*#__PURE__*/
  26264. function () {
  26265. function CommonBuffer(deleteBuffer, insertBuffer) {
  26266. _classCallCheck(this, CommonBuffer);
  26267. _defineProperty(this, 'deleteBuffer', void 0);
  26268. _defineProperty(this, 'insertBuffer', void 0);
  26269. _defineProperty(this, 'lines', void 0);
  26270. this.deleteBuffer = deleteBuffer;
  26271. this.insertBuffer = insertBuffer;
  26272. this.lines = [];
  26273. }
  26274. _createClass(CommonBuffer, [{
  26275. key: "pushDiffCommonLine",
  26276. value: function pushDiffCommonLine(diff) {
  26277. this.lines.push(diff);
  26278. }
  26279. }, {
  26280. key: "pushDiffChangeLines",
  26281. value: function pushDiffChangeLines(diff) {
  26282. var isDiffEmpty = diff[1].length === 0; // An empty diff string is redundant, unless a change line is empty.
  26283. if (!isDiffEmpty || this.deleteBuffer.isLineEmpty()) {
  26284. this.deleteBuffer.pushDiff(diff);
  26285. }
  26286. if (!isDiffEmpty || this.insertBuffer.isLineEmpty()) {
  26287. this.insertBuffer.pushDiff(diff);
  26288. }
  26289. }
  26290. }, {
  26291. key: "flushChangeLines",
  26292. value: function flushChangeLines() {
  26293. this.deleteBuffer.moveLinesTo(this.lines);
  26294. this.insertBuffer.moveLinesTo(this.lines);
  26295. } // Input to buffer.
  26296. }, {
  26297. key: "align",
  26298. value: function align(diff) {
  26299. var _this2 = this;
  26300. var op = diff[0];
  26301. var string = diff[1];
  26302. if (_printDiffs.MULTILINE_REGEXP.test(string)) {
  26303. var substrings = string.split('\n');
  26304. var iLast = substrings.length - 1;
  26305. substrings.forEach(function (substring, i) {
  26306. if (i === 0) {
  26307. var subdiff = new _cleanupSemantic.Diff(op, substring);
  26308. if (_this2.deleteBuffer.isLineEmpty() && _this2.insertBuffer.isLineEmpty()) {
  26309. // If both current change lines are empty,
  26310. // then the first substring is a common line.
  26311. _this2.flushChangeLines();
  26312. _this2.pushDiffCommonLine(subdiff);
  26313. } else {
  26314. // If either current change line is non-empty,
  26315. // then the first substring completes the change lines.
  26316. _this2.pushDiffChangeLines(subdiff);
  26317. _this2.flushChangeLines();
  26318. }
  26319. } else if (i < iLast) {
  26320. // A middle substring is a common line.
  26321. _this2.pushDiffCommonLine(new _cleanupSemantic.Diff(op, substring));
  26322. } else if (substring.length !== 0) {
  26323. // The last substring starts a change line, if it is not empty.
  26324. // Important: This non-empty condition also automatically omits
  26325. // the newline appended to the end of expected and received strings.
  26326. _this2.pushDiffChangeLines(new _cleanupSemantic.Diff(op, substring));
  26327. }
  26328. });
  26329. } else {
  26330. // Append non-multiline string to current change lines.
  26331. // Important: It cannot be at the end following empty change lines,
  26332. // because newline appended to the end of expected and received strings.
  26333. this.pushDiffChangeLines(diff);
  26334. }
  26335. } // Output from buffer.
  26336. }, {
  26337. key: "getLines",
  26338. value: function getLines() {
  26339. this.flushChangeLines();
  26340. return this.lines;
  26341. }
  26342. }]);
  26343. return CommonBuffer;
  26344. }(); // Given diffs from expected and received strings,
  26345. // return new array of diffs split or joined into lines.
  26346. //
  26347. // To correctly align a change line at the end, the algorithm:
  26348. // * assumes that a newline was appended to the strings
  26349. // * omits the last newline from the output array
  26350. //
  26351. // Assume the function is not called:
  26352. // * if either expected or received is empty string
  26353. // * if neither expected nor received is multiline string
  26354. var getAlignedDiffs = function getAlignedDiffs(diffs) {
  26355. var deleteBuffer = new ChangeBuffer(_cleanupSemantic.DIFF_DELETE);
  26356. var insertBuffer = new ChangeBuffer(_cleanupSemantic.DIFF_INSERT);
  26357. var commonBuffer = new CommonBuffer(deleteBuffer, insertBuffer);
  26358. diffs.forEach(function (diff) {
  26359. switch (diff[0]) {
  26360. case _cleanupSemantic.DIFF_DELETE:
  26361. deleteBuffer.align(diff);
  26362. break;
  26363. case _cleanupSemantic.DIFF_INSERT:
  26364. insertBuffer.align(diff);
  26365. break;
  26366. default:
  26367. commonBuffer.align(diff);
  26368. }
  26369. });
  26370. return commonBuffer.getLines();
  26371. };
  26372. var _default = getAlignedDiffs;
  26373. exports.default = _default;
  26374. /***/ }),
  26375. /***/ "./packages/jest-diff/build/index.js":
  26376. /*!*******************************************!*\
  26377. !*** ./packages/jest-diff/build/index.js ***!
  26378. \*******************************************/
  26379. /*! no static exports found */
  26380. /***/ (function(module, exports, __webpack_require__) {
  26381. "use strict";
  26382. /* WEBPACK VAR INJECTION */(function(global) {
  26383. var _prettyFormat = _interopRequireDefault(__webpack_require__(/*! pretty-format */ "./packages/pretty-format/build/index.js"));
  26384. var _chalk = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  26385. var _jestGetType = _interopRequireDefault(__webpack_require__(/*! jest-get-type */ "./packages/jest-get-type/build/index.js"));
  26386. var _diffLines = _interopRequireDefault(__webpack_require__(/*! ./diffLines */ "./packages/jest-diff/build/diffLines.js"));
  26387. var _printDiffs = __webpack_require__(/*! ./printDiffs */ "./packages/jest-diff/build/printDiffs.js");
  26388. var _constants = __webpack_require__(/*! ./constants */ "./packages/jest-diff/build/constants.js");
  26389. function _interopRequireDefault(obj) {
  26390. return obj && obj.__esModule ? obj : {
  26391. default: obj
  26392. };
  26393. }
  26394. var _Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
  26395. function _objectSpread(target) {
  26396. for (var i = 1; i < arguments.length; i++) {
  26397. var source = arguments[i] != null ? arguments[i] : {};
  26398. var ownKeys = Object.keys(source);
  26399. if (typeof Object.getOwnPropertySymbols === 'function') {
  26400. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  26401. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  26402. }));
  26403. }
  26404. ownKeys.forEach(function (key) {
  26405. _defineProperty(target, key, source[key]);
  26406. });
  26407. }
  26408. return target;
  26409. }
  26410. function _defineProperty(obj, key, value) {
  26411. if (key in obj) {
  26412. Object.defineProperty(obj, key, {
  26413. value: value,
  26414. enumerable: true,
  26415. configurable: true,
  26416. writable: true
  26417. });
  26418. } else {
  26419. obj[key] = value;
  26420. }
  26421. return obj;
  26422. }
  26423. var _prettyFormat$plugins = _prettyFormat.default.plugins,
  26424. AsymmetricMatcher = _prettyFormat$plugins.AsymmetricMatcher,
  26425. DOMCollection = _prettyFormat$plugins.DOMCollection,
  26426. DOMElement = _prettyFormat$plugins.DOMElement,
  26427. Immutable = _prettyFormat$plugins.Immutable,
  26428. ReactElement = _prettyFormat$plugins.ReactElement,
  26429. ReactTestComponent = _prettyFormat$plugins.ReactTestComponent;
  26430. var PLUGINS = [ReactTestComponent, ReactElement, DOMElement, DOMCollection, Immutable, AsymmetricMatcher];
  26431. var FORMAT_OPTIONS = {
  26432. plugins: PLUGINS
  26433. };
  26434. var FORMAT_OPTIONS_0 = _objectSpread({}, FORMAT_OPTIONS, {
  26435. indent: 0
  26436. });
  26437. var FALLBACK_FORMAT_OPTIONS = {
  26438. callToJSON: false,
  26439. maxDepth: 10,
  26440. plugins: PLUGINS
  26441. };
  26442. var FALLBACK_FORMAT_OPTIONS_0 = _objectSpread({}, FALLBACK_FORMAT_OPTIONS, {
  26443. indent: 0
  26444. }); // Generate a string that will highlight the difference between two values
  26445. // with green and red. (similar to how github does code diffing)
  26446. function diff(a, b, options) {
  26447. if (Object.is(a, b)) {
  26448. return _constants.NO_DIFF_MESSAGE;
  26449. }
  26450. var aType = (0, _jestGetType.default)(a);
  26451. var expectedType = aType;
  26452. var omitDifference = false;
  26453. if (aType === 'object' && typeof a.asymmetricMatch === 'function') {
  26454. if (a.$$typeof !== _Symbol.for('jest.asymmetricMatcher')) {
  26455. // Do not know expected type of user-defined asymmetric matcher.
  26456. return null;
  26457. }
  26458. if (typeof a.getExpectedType !== 'function') {
  26459. // For example, expect.anything() matches either null or undefined
  26460. return null;
  26461. }
  26462. expectedType = a.getExpectedType(); // Primitive types boolean and number omit difference below.
  26463. // For example, omit difference for expect.stringMatching(regexp)
  26464. omitDifference = expectedType === 'string';
  26465. }
  26466. if (expectedType !== (0, _jestGetType.default)(b)) {
  26467. return ' Comparing two different types of values.' + " Expected ".concat(_chalk.default.green(expectedType), " but ") + "received ".concat(_chalk.default.red((0, _jestGetType.default)(b)), ".");
  26468. }
  26469. if (omitDifference) {
  26470. return null;
  26471. }
  26472. switch (aType) {
  26473. case 'string':
  26474. return (0, _diffLines.default)(a, b, options);
  26475. case 'boolean':
  26476. case 'number':
  26477. return comparePrimitive(a, b, options);
  26478. case 'map':
  26479. return compareObjects(sortMap(a), sortMap(b), options);
  26480. case 'set':
  26481. return compareObjects(sortSet(a), sortSet(b), options);
  26482. default:
  26483. return compareObjects(a, b, options);
  26484. }
  26485. }
  26486. function comparePrimitive(a, b, options) {
  26487. return (0, _diffLines.default)((0, _prettyFormat.default)(a, FORMAT_OPTIONS), (0, _prettyFormat.default)(b, FORMAT_OPTIONS), options);
  26488. }
  26489. function sortMap(map) {
  26490. return new Map(Array.from(map.entries()).sort());
  26491. }
  26492. function sortSet(set) {
  26493. return new Set(Array.from(set.values()).sort());
  26494. }
  26495. function compareObjects(a, b, options) {
  26496. var diffMessage;
  26497. var hasThrown = false;
  26498. try {
  26499. diffMessage = (0, _diffLines.default)((0, _prettyFormat.default)(a, FORMAT_OPTIONS_0), (0, _prettyFormat.default)(b, FORMAT_OPTIONS_0), options, {
  26500. a: (0, _prettyFormat.default)(a, FORMAT_OPTIONS),
  26501. b: (0, _prettyFormat.default)(b, FORMAT_OPTIONS)
  26502. });
  26503. } catch (e) {
  26504. hasThrown = true;
  26505. } // If the comparison yields no results, compare again but this time
  26506. // without calling `toJSON`. It's also possible that toJSON might throw.
  26507. if (!diffMessage || diffMessage === _constants.NO_DIFF_MESSAGE) {
  26508. diffMessage = (0, _diffLines.default)((0, _prettyFormat.default)(a, FALLBACK_FORMAT_OPTIONS_0), (0, _prettyFormat.default)(b, FALLBACK_FORMAT_OPTIONS_0), options, {
  26509. a: (0, _prettyFormat.default)(a, FALLBACK_FORMAT_OPTIONS),
  26510. b: (0, _prettyFormat.default)(b, FALLBACK_FORMAT_OPTIONS)
  26511. });
  26512. if (diffMessage !== _constants.NO_DIFF_MESSAGE && !hasThrown) {
  26513. diffMessage = _constants.SIMILAR_MESSAGE + '\n\n' + diffMessage;
  26514. }
  26515. }
  26516. return diffMessage;
  26517. } // eslint-disable-next-line no-redeclare
  26518. diff.getStringDiff = _printDiffs.getStringDiff;
  26519. module.exports = diff;
  26520. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  26521. /***/ }),
  26522. /***/ "./packages/jest-diff/build/joinAlignedDiffs.js":
  26523. /*!******************************************************!*\
  26524. !*** ./packages/jest-diff/build/joinAlignedDiffs.js ***!
  26525. \******************************************************/
  26526. /*! no static exports found */
  26527. /***/ (function(module, exports, __webpack_require__) {
  26528. "use strict";
  26529. Object.defineProperty(exports, '__esModule', {
  26530. value: true
  26531. });
  26532. exports.joinAlignedDiffsExpand = exports.joinAlignedDiffsNoExpand = void 0;
  26533. var _cleanupSemantic = __webpack_require__(/*! ./cleanupSemantic */ "./packages/jest-diff/build/cleanupSemantic.js");
  26534. var _printDiffs = __webpack_require__(/*! ./printDiffs */ "./packages/jest-diff/build/printDiffs.js");
  26535. /**
  26536. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  26537. *
  26538. * This source code is licensed under the MIT license found in the
  26539. * LICENSE file in the root directory of this source tree.
  26540. */
  26541. var DIFF_CONTEXT_DEFAULT = 5; // same as diffLines
  26542. // jest --no-expand
  26543. //
  26544. // Given array of aligned strings with inverse highlight formatting,
  26545. // return joined lines with diff formatting (and patch marks, if needed).
  26546. var joinAlignedDiffsNoExpand = function joinAlignedDiffsNoExpand(diffs) {
  26547. var nContextLines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIFF_CONTEXT_DEFAULT;
  26548. var iLength = diffs.length;
  26549. var nContextLines2 = nContextLines + nContextLines; // First pass: count output lines and see if it has patches.
  26550. var jLength = iLength;
  26551. var hasExcessAtStartOrEnd = false;
  26552. var nExcessesBetweenChanges = 0;
  26553. var i = 0;
  26554. while (i !== iLength) {
  26555. var iStart = i;
  26556. while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) {
  26557. i += 1;
  26558. }
  26559. if (iStart !== i) {
  26560. if (iStart === 0) {
  26561. // at start
  26562. if (i > nContextLines) {
  26563. jLength -= i - nContextLines; // subtract excess common lines
  26564. hasExcessAtStartOrEnd = true;
  26565. }
  26566. } else if (i === iLength) {
  26567. // at end
  26568. var n = i - iStart;
  26569. if (n > nContextLines) {
  26570. jLength -= n - nContextLines; // subtract excess common lines
  26571. hasExcessAtStartOrEnd = true;
  26572. }
  26573. } else {
  26574. // between changes
  26575. var _n = i - iStart;
  26576. if (_n > nContextLines2) {
  26577. jLength -= _n - nContextLines2; // subtract excess common lines
  26578. nExcessesBetweenChanges += 1;
  26579. }
  26580. }
  26581. }
  26582. while (i !== iLength && diffs[i][0] !== _cleanupSemantic.DIFF_EQUAL) {
  26583. i += 1;
  26584. }
  26585. }
  26586. var hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd;
  26587. if (nExcessesBetweenChanges !== 0) {
  26588. jLength += nExcessesBetweenChanges + 1; // add patch lines
  26589. } else if (hasExcessAtStartOrEnd) {
  26590. jLength += 1; // add patch line
  26591. }
  26592. var jLast = jLength - 1;
  26593. var lines = [];
  26594. var jPatchMark = 0; // index of placeholder line for current patch mark
  26595. if (hasPatch) {
  26596. lines.push(''); // placeholder line for first patch mark
  26597. } // Indexes of expected or received lines in current patch:
  26598. var aStart = 0;
  26599. var bStart = 0;
  26600. var aEnd = 0;
  26601. var bEnd = 0;
  26602. var pushCommonLine = function pushCommonLine(line) {
  26603. var j = lines.length;
  26604. lines.push((0, _printDiffs.printCommonLine)(line, j === 0 || j === jLast));
  26605. aEnd += 1;
  26606. bEnd += 1;
  26607. };
  26608. var pushDeleteLine = function pushDeleteLine(line) {
  26609. lines.push((0, _printDiffs.printDeleteLine)(line));
  26610. aEnd += 1;
  26611. };
  26612. var pushInsertLine = function pushInsertLine(line) {
  26613. lines.push((0, _printDiffs.printInsertLine)(line));
  26614. bEnd += 1;
  26615. }; // Second pass: push lines with diff formatting (and patch marks, if needed).
  26616. i = 0;
  26617. while (i !== iLength) {
  26618. var _iStart = i;
  26619. while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) {
  26620. i += 1;
  26621. }
  26622. if (_iStart !== i) {
  26623. if (_iStart === 0) {
  26624. // at beginning
  26625. if (i > nContextLines) {
  26626. _iStart = i - nContextLines;
  26627. aStart = _iStart;
  26628. bStart = _iStart;
  26629. aEnd = aStart;
  26630. bEnd = bStart;
  26631. }
  26632. for (var iCommon = _iStart; iCommon !== i; iCommon += 1) {
  26633. pushCommonLine(diffs[iCommon][1]);
  26634. }
  26635. } else if (i === iLength) {
  26636. // at end
  26637. var iEnd = i - _iStart > nContextLines ? _iStart + nContextLines : i;
  26638. for (var _iCommon = _iStart; _iCommon !== iEnd; _iCommon += 1) {
  26639. pushCommonLine(diffs[_iCommon][1]);
  26640. }
  26641. } else {
  26642. // between changes
  26643. var nCommon = i - _iStart;
  26644. if (nCommon > nContextLines2) {
  26645. var _iEnd = _iStart + nContextLines;
  26646. for (var _iCommon2 = _iStart; _iCommon2 !== _iEnd; _iCommon2 += 1) {
  26647. pushCommonLine(diffs[_iCommon2][1]);
  26648. }
  26649. lines[jPatchMark] = (0, _printDiffs.createPatchMark)(aStart, aEnd, bStart, bEnd);
  26650. jPatchMark = lines.length;
  26651. lines.push(''); // placeholder line for next patch mark
  26652. var nOmit = nCommon - nContextLines2;
  26653. aStart = aEnd + nOmit;
  26654. bStart = bEnd + nOmit;
  26655. aEnd = aStart;
  26656. bEnd = bStart;
  26657. for (var _iCommon3 = i - nContextLines; _iCommon3 !== i; _iCommon3 += 1) {
  26658. pushCommonLine(diffs[_iCommon3][1]);
  26659. }
  26660. } else {
  26661. for (var _iCommon4 = _iStart; _iCommon4 !== i; _iCommon4 += 1) {
  26662. pushCommonLine(diffs[_iCommon4][1]);
  26663. }
  26664. }
  26665. }
  26666. }
  26667. while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_DELETE) {
  26668. pushDeleteLine(diffs[i][1]);
  26669. i += 1;
  26670. }
  26671. while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_INSERT) {
  26672. pushInsertLine(diffs[i][1]);
  26673. i += 1;
  26674. }
  26675. }
  26676. if (hasPatch) {
  26677. lines[jPatchMark] = (0, _printDiffs.createPatchMark)(aStart, aEnd, bStart, bEnd);
  26678. }
  26679. return lines.join('\n');
  26680. }; // jest --expand
  26681. //
  26682. // Given array of aligned strings with inverse highlight formatting,
  26683. // return joined lines with diff formatting.
  26684. exports.joinAlignedDiffsNoExpand = joinAlignedDiffsNoExpand;
  26685. var joinAlignedDiffsExpand = function joinAlignedDiffsExpand(diffs) {
  26686. return diffs.map(function (diff, i, diffs) {
  26687. var line = diff[1];
  26688. switch (diff[0]) {
  26689. case _cleanupSemantic.DIFF_DELETE:
  26690. return (0, _printDiffs.printDeleteLine)(line);
  26691. case _cleanupSemantic.DIFF_INSERT:
  26692. return (0, _printDiffs.printInsertLine)(line);
  26693. default:
  26694. return (0, _printDiffs.printCommonLine)(line, i === 0 || i === diffs.length - 1);
  26695. }
  26696. }).join('\n');
  26697. };
  26698. exports.joinAlignedDiffsExpand = joinAlignedDiffsExpand;
  26699. /***/ }),
  26700. /***/ "./packages/jest-diff/build/printDiffs.js":
  26701. /*!************************************************!*\
  26702. !*** ./packages/jest-diff/build/printDiffs.js ***!
  26703. \************************************************/
  26704. /*! no static exports found */
  26705. /***/ (function(module, exports, __webpack_require__) {
  26706. "use strict";
  26707. Object.defineProperty(exports, '__esModule', {
  26708. value: true
  26709. });
  26710. exports.getStringDiff = exports.printMultilineStringDiffs = exports.createPatchMark = exports.printAnnotation = exports.hasCommonDiff = exports.computeStringDiffs = exports.printCommonLine = exports.printInsertLine = exports.printDeleteLine = exports.MULTILINE_REGEXP = exports.getReceivedString = exports.getExpectedString = exports.getHighlightedString = exports.RECEIVED_COLOR = exports.INVERTED_COLOR = exports.EXPECTED_COLOR = exports.DIM_COLOR = void 0;
  26711. var _chalk = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  26712. var _cleanupSemantic = __webpack_require__(/*! ./cleanupSemantic */ "./packages/jest-diff/build/cleanupSemantic.js");
  26713. var _diffStrings = _interopRequireDefault(__webpack_require__(/*! ./diffStrings */ "./packages/jest-diff/build/diffStrings.js"));
  26714. var _getAlignedDiffs = _interopRequireDefault(__webpack_require__(/*! ./getAlignedDiffs */ "./packages/jest-diff/build/getAlignedDiffs.js"));
  26715. var _joinAlignedDiffs = __webpack_require__(/*! ./joinAlignedDiffs */ "./packages/jest-diff/build/joinAlignedDiffs.js");
  26716. function _interopRequireDefault(obj) {
  26717. return obj && obj.__esModule ? obj : {
  26718. default: obj
  26719. };
  26720. }
  26721. /**
  26722. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  26723. *
  26724. * This source code is licensed under the MIT license found in the
  26725. * LICENSE file in the root directory of this source tree.
  26726. */
  26727. var DIM_COLOR = _chalk.default.dim;
  26728. exports.DIM_COLOR = DIM_COLOR;
  26729. var EXPECTED_COLOR = _chalk.default.green;
  26730. exports.EXPECTED_COLOR = EXPECTED_COLOR;
  26731. var INVERTED_COLOR = _chalk.default.inverse;
  26732. exports.INVERTED_COLOR = INVERTED_COLOR;
  26733. var RECEIVED_COLOR = _chalk.default.red;
  26734. exports.RECEIVED_COLOR = RECEIVED_COLOR;
  26735. var PATCH_COLOR = _chalk.default.yellow; // Given change op and array of diffs, return concatenated string:
  26736. // * include common strings
  26737. // * include change strings which have argument op (inverse highlight)
  26738. // * exclude change strings which have opposite op
  26739. var getHighlightedString = function getHighlightedString(op, diffs) {
  26740. return diffs.reduce(function (reduced, diff) {
  26741. return reduced + (diff[0] === _cleanupSemantic.DIFF_EQUAL ? diff[1] : diff[0] === op ? INVERTED_COLOR(diff[1]) : '');
  26742. }, '');
  26743. };
  26744. exports.getHighlightedString = getHighlightedString;
  26745. var getExpectedString = function getExpectedString(diffs) {
  26746. return getHighlightedString(_cleanupSemantic.DIFF_DELETE, diffs);
  26747. };
  26748. exports.getExpectedString = getExpectedString;
  26749. var getReceivedString = function getReceivedString(diffs) {
  26750. return getHighlightedString(_cleanupSemantic.DIFF_INSERT, diffs);
  26751. };
  26752. exports.getReceivedString = getReceivedString;
  26753. var MULTILINE_REGEXP = /\n/;
  26754. exports.MULTILINE_REGEXP = MULTILINE_REGEXP;
  26755. var NEWLINE_SYMBOL = "\u21B5"; // downwards arrow with corner leftwards
  26756. var SPACE_SYMBOL = "\xB7"; // middle dot
  26757. // Instead of inverse highlight which now implies a change,
  26758. // replace common spaces with middle dot at the end of the line.
  26759. var replaceSpacesAtEnd = function replaceSpacesAtEnd(line) {
  26760. return line.replace(/\s+$/, function (spaces) {
  26761. return SPACE_SYMBOL.repeat(spaces.length);
  26762. });
  26763. };
  26764. var printDeleteLine = function printDeleteLine(line) {
  26765. return EXPECTED_COLOR(line.length !== 0 ? '- ' + replaceSpacesAtEnd(line) : '-');
  26766. };
  26767. exports.printDeleteLine = printDeleteLine;
  26768. var printInsertLine = function printInsertLine(line) {
  26769. return RECEIVED_COLOR(line.length !== 0 ? '+ ' + replaceSpacesAtEnd(line) : '+');
  26770. }; // Prevent visually ambiguous empty line as the first or the last.
  26771. exports.printInsertLine = printInsertLine;
  26772. var printCommonLine = function printCommonLine(line) {
  26773. var isFirstOrLast = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  26774. return line.length !== 0 ? DIM_COLOR(' ' + replaceSpacesAtEnd(line)) : isFirstOrLast ? DIM_COLOR(' ' + NEWLINE_SYMBOL) : '';
  26775. };
  26776. exports.printCommonLine = printCommonLine;
  26777. var computeStringDiffs = function computeStringDiffs(expected, received) {
  26778. var isMultiline = MULTILINE_REGEXP.test(expected) || MULTILINE_REGEXP.test(received); // getAlignedDiffs assumes that a newline was appended to the strings.
  26779. if (isMultiline) {
  26780. expected += '\n';
  26781. received += '\n';
  26782. }
  26783. var diffs = (0, _diffStrings.default)(expected, received);
  26784. (0, _cleanupSemantic.cleanupSemantic)(diffs); // impure function
  26785. return {
  26786. diffs: diffs,
  26787. isMultiline: isMultiline
  26788. };
  26789. };
  26790. exports.computeStringDiffs = computeStringDiffs;
  26791. var hasCommonDiff = function hasCommonDiff(diffs, isMultiline) {
  26792. if (isMultiline) {
  26793. // Important: Ignore common newline that was appended to multiline strings!
  26794. var iLast = diffs.length - 1;
  26795. return diffs.some(function (diff, i) {
  26796. return diff[0] === _cleanupSemantic.DIFF_EQUAL && (i !== iLast || diff[1] !== '\n');
  26797. });
  26798. }
  26799. return diffs.some(function (diff) {
  26800. return diff[0] === _cleanupSemantic.DIFF_EQUAL;
  26801. });
  26802. };
  26803. exports.hasCommonDiff = hasCommonDiff;
  26804. var printAnnotation = function printAnnotation(options) {
  26805. return EXPECTED_COLOR('- ' + (options && options.aAnnotation || 'Expected')) + '\n' + RECEIVED_COLOR('+ ' + (options && options.bAnnotation || 'Received')) + '\n\n';
  26806. }; // In GNU diff format, indexes are one-based instead of zero-based.
  26807. exports.printAnnotation = printAnnotation;
  26808. var createPatchMark = function createPatchMark(aStart, aEnd, bStart, bEnd) {
  26809. return PATCH_COLOR("@@ -".concat(aStart + 1, ",").concat(aEnd - aStart, " +").concat(bStart + 1, ",").concat(bEnd - bStart, " @@"));
  26810. }; // Return formatted diff lines without labels.
  26811. exports.createPatchMark = createPatchMark;
  26812. var printMultilineStringDiffs = function printMultilineStringDiffs(diffs, expand) {
  26813. var lines = (0, _getAlignedDiffs.default)(diffs);
  26814. return expand ? (0, _joinAlignedDiffs.joinAlignedDiffsExpand)(lines) : (0, _joinAlignedDiffs.joinAlignedDiffsNoExpand)(lines);
  26815. };
  26816. exports.printMultilineStringDiffs = printMultilineStringDiffs;
  26817. var MAX_DIFF_STRING_LENGTH = 20000; // Print specific substring diff for strings only:
  26818. // * if strings are not equal
  26819. // * if neither string is empty
  26820. // * if neither string is too long
  26821. // * if there is a common string after semantic cleanup
  26822. var getStringDiff = function getStringDiff(expected, received, options) {
  26823. if (expected === received || expected.length === 0 || received.length === 0 || expected.length > MAX_DIFF_STRING_LENGTH || received.length > MAX_DIFF_STRING_LENGTH) {
  26824. return null;
  26825. }
  26826. var _computeStringDiffs = computeStringDiffs(expected, received),
  26827. diffs = _computeStringDiffs.diffs,
  26828. isMultiline = _computeStringDiffs.isMultiline;
  26829. if (!hasCommonDiff(diffs, isMultiline)) {
  26830. return null;
  26831. }
  26832. return isMultiline ? {
  26833. annotatedDiff: printAnnotation(options) + printMultilineStringDiffs(diffs, options === undefined || options.expand !== false),
  26834. isMultiline: isMultiline
  26835. } : {
  26836. a: getExpectedString(diffs),
  26837. b: getReceivedString(diffs),
  26838. isMultiline: isMultiline
  26839. };
  26840. };
  26841. exports.getStringDiff = getStringDiff;
  26842. /***/ }),
  26843. /***/ "./packages/jest-get-type/build/index.js":
  26844. /*!***********************************************!*\
  26845. !*** ./packages/jest-get-type/build/index.js ***!
  26846. \***********************************************/
  26847. /*! no static exports found */
  26848. /***/ (function(module, exports, __webpack_require__) {
  26849. "use strict";
  26850. /**
  26851. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  26852. *
  26853. * This source code is licensed under the MIT license found in the
  26854. * LICENSE file in the root directory of this source tree.
  26855. */
  26856. // get the type of a value with handling the edge cases like `typeof []`
  26857. // and `typeof null`
  26858. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  26859. function getType(value) {
  26860. if (value === undefined) {
  26861. return 'undefined';
  26862. } else if (value === null) {
  26863. return 'null';
  26864. } else if (Array.isArray(value)) {
  26865. return 'array';
  26866. } else if (typeof value === 'boolean') {
  26867. return 'boolean';
  26868. } else if (typeof value === 'function') {
  26869. return 'function';
  26870. } else if (typeof value === 'number') {
  26871. return 'number';
  26872. } else if (typeof value === 'string') {
  26873. return 'string';
  26874. } else if (_typeof(value) === 'object') {
  26875. if (value != null) {
  26876. if (value.constructor === RegExp) {
  26877. return 'regexp';
  26878. } else if (value.constructor === Map) {
  26879. return 'map';
  26880. } else if (value.constructor === Set) {
  26881. return 'set';
  26882. } else if (value.constructor === Date) {
  26883. return 'date';
  26884. }
  26885. }
  26886. return 'object';
  26887. } else if (_typeof(value) === 'symbol') {
  26888. return 'symbol';
  26889. }
  26890. throw new Error("value of unknown type: ".concat(value));
  26891. }
  26892. getType.isPrimitive = function (value) {
  26893. return Object(value) !== value;
  26894. };
  26895. module.exports = getType;
  26896. /***/ }),
  26897. /***/ "./packages/jest-matcher-utils/build/index.js":
  26898. /*!****************************************************!*\
  26899. !*** ./packages/jest-matcher-utils/build/index.js ***!
  26900. \****************************************************/
  26901. /*! no static exports found */
  26902. /***/ (function(module, exports, __webpack_require__) {
  26903. "use strict";
  26904. Object.defineProperty(exports, '__esModule', {
  26905. value: true
  26906. });
  26907. Object.defineProperty(exports, 'DiffOptions', {
  26908. enumerable: true,
  26909. get: function get() {
  26910. return _jestDiff.DiffOptions;
  26911. }
  26912. });
  26913. exports.matcherHint = exports.matcherErrorMessage = exports.getLabelPrinter = exports.pluralize = exports.diff = exports.printDiffOrStringify = exports.ensureExpectedIsNonNegativeInteger = exports.ensureNumbers = exports.ensureExpectedIsNumber = exports.ensureActualIsNumber = exports.ensureNoExpected = exports.printWithType = exports.printExpected = exports.printReceived = exports.highlightTrailingWhitespace = exports.stringify = exports.SUGGEST_TO_CONTAIN_EQUAL = exports.DIM_COLOR = exports.BOLD_WEIGHT = exports.INVERTED_COLOR = exports.RECEIVED_COLOR = exports.EXPECTED_COLOR = void 0;
  26914. var _chalk = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  26915. var _jestDiff = _interopRequireWildcard(__webpack_require__(/*! jest-diff */ "./packages/jest-diff/build/index.js"));
  26916. var _jestGetType = _interopRequireWildcard(__webpack_require__(/*! jest-get-type */ "./packages/jest-get-type/build/index.js"));
  26917. var _prettyFormat = _interopRequireDefault(__webpack_require__(/*! pretty-format */ "./packages/pretty-format/build/index.js"));
  26918. function _interopRequireWildcard(obj) {
  26919. if (obj && obj.__esModule) {
  26920. return obj;
  26921. } else {
  26922. var newObj = {};
  26923. if (obj != null) {
  26924. for (var key in obj) {
  26925. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  26926. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  26927. if (desc.get || desc.set) {
  26928. Object.defineProperty(newObj, key, desc);
  26929. } else {
  26930. newObj[key] = obj[key];
  26931. }
  26932. }
  26933. }
  26934. }
  26935. newObj.default = obj;
  26936. return newObj;
  26937. }
  26938. }
  26939. function _interopRequireDefault(obj) {
  26940. return obj && obj.__esModule ? obj : {
  26941. default: obj
  26942. };
  26943. }
  26944. /**
  26945. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  26946. *
  26947. * This source code is licensed under the MIT license found in the
  26948. * LICENSE file in the root directory of this source tree.
  26949. */
  26950. var _prettyFormat$plugins = _prettyFormat.default.plugins,
  26951. AsymmetricMatcher = _prettyFormat$plugins.AsymmetricMatcher,
  26952. DOMCollection = _prettyFormat$plugins.DOMCollection,
  26953. DOMElement = _prettyFormat$plugins.DOMElement,
  26954. Immutable = _prettyFormat$plugins.Immutable,
  26955. ReactElement = _prettyFormat$plugins.ReactElement,
  26956. ReactTestComponent = _prettyFormat$plugins.ReactTestComponent;
  26957. var PLUGINS = [ReactTestComponent, ReactElement, DOMElement, DOMCollection, Immutable, AsymmetricMatcher];
  26958. var EXPECTED_COLOR = _chalk.default.green;
  26959. exports.EXPECTED_COLOR = EXPECTED_COLOR;
  26960. var RECEIVED_COLOR = _chalk.default.red;
  26961. exports.RECEIVED_COLOR = RECEIVED_COLOR;
  26962. var INVERTED_COLOR = _chalk.default.inverse;
  26963. exports.INVERTED_COLOR = INVERTED_COLOR;
  26964. var BOLD_WEIGHT = _chalk.default.bold;
  26965. exports.BOLD_WEIGHT = BOLD_WEIGHT;
  26966. var DIM_COLOR = _chalk.default.dim;
  26967. exports.DIM_COLOR = DIM_COLOR;
  26968. var MULTILINE_REGEXP = /\n/;
  26969. var SPACE_SYMBOL = "\xB7"; // middle dot
  26970. var NUMBERS = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen'];
  26971. var SUGGEST_TO_CONTAIN_EQUAL = _chalk.default.dim('Looks like you wanted to test for object/array equality with the stricter `toContain` matcher. You probably need to use `toContainEqual` instead.');
  26972. exports.SUGGEST_TO_CONTAIN_EQUAL = SUGGEST_TO_CONTAIN_EQUAL;
  26973. var stringify = function stringify(object) {
  26974. var maxDepth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
  26975. var MAX_LENGTH = 10000;
  26976. var result;
  26977. try {
  26978. result = (0, _prettyFormat.default)(object, {
  26979. maxDepth: maxDepth,
  26980. min: true,
  26981. plugins: PLUGINS
  26982. });
  26983. } catch (e) {
  26984. result = (0, _prettyFormat.default)(object, {
  26985. callToJSON: false,
  26986. maxDepth: maxDepth,
  26987. min: true,
  26988. plugins: PLUGINS
  26989. });
  26990. }
  26991. return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(maxDepth / 2)) : result;
  26992. };
  26993. exports.stringify = stringify;
  26994. var highlightTrailingWhitespace = function highlightTrailingWhitespace(text) {
  26995. return text.replace(/\s+$/gm, _chalk.default.inverse('$&'));
  26996. }; // Instead of inverse highlight which now implies a change,
  26997. // replace common spaces with middle dot at the end of any line.
  26998. exports.highlightTrailingWhitespace = highlightTrailingWhitespace;
  26999. var replaceTrailingSpaces = function replaceTrailingSpaces(text) {
  27000. return text.replace(/\s+$/gm, function (spaces) {
  27001. return SPACE_SYMBOL.repeat(spaces.length);
  27002. });
  27003. };
  27004. var printReceived = function printReceived(object) {
  27005. return RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));
  27006. };
  27007. exports.printReceived = printReceived;
  27008. var printExpected = function printExpected(value) {
  27009. return EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));
  27010. };
  27011. exports.printExpected = printExpected;
  27012. var printWithType = function printWithType(name, value, print // printExpected or printReceived
  27013. ) {
  27014. var type = (0, _jestGetType.default)(value);
  27015. var hasType = type !== 'null' && type !== 'undefined' ? "".concat(name, " has type: ").concat(type, "\n") : '';
  27016. var hasValue = "".concat(name, " has value: ").concat(print(value));
  27017. return hasType + hasValue;
  27018. };
  27019. exports.printWithType = printWithType;
  27020. var ensureNoExpected = function ensureNoExpected(expected, matcherName, options) {
  27021. if (typeof expected !== 'undefined') {
  27022. // Prepend maybe not only for backward compatibility.
  27023. var matcherString = (options ? '' : '[.not]') + matcherName;
  27024. throw new Error(matcherErrorMessage(matcherHint(matcherString, undefined, '', options), // Because expected is omitted in hint above,
  27025. 'this matcher must not have an expected argument', printWithType('Expected', expected, printExpected)));
  27026. }
  27027. };
  27028. exports.ensureNoExpected = ensureNoExpected;
  27029. var ensureActualIsNumber = function ensureActualIsNumber(actual, matcherName, options) {
  27030. if (typeof actual !== 'number') {
  27031. // Prepend maybe not only for backward compatibility.
  27032. var matcherString = (options ? '' : '[.not]') + matcherName;
  27033. throw new Error(matcherErrorMessage(matcherHint(matcherString, undefined, undefined, options), "".concat(RECEIVED_COLOR('received'), " value must be a number"), printWithType('Received', actual, printReceived)));
  27034. }
  27035. };
  27036. exports.ensureActualIsNumber = ensureActualIsNumber;
  27037. var ensureExpectedIsNumber = function ensureExpectedIsNumber(expected, matcherName, options) {
  27038. if (typeof expected !== 'number') {
  27039. // Prepend maybe not only for backward compatibility.
  27040. var matcherString = (options ? '' : '[.not]') + matcherName;
  27041. throw new Error(matcherErrorMessage(matcherHint(matcherString, undefined, undefined, options), "".concat(EXPECTED_COLOR('expected'), " value must be a number"), printWithType('Expected', expected, printExpected)));
  27042. }
  27043. };
  27044. exports.ensureExpectedIsNumber = ensureExpectedIsNumber;
  27045. var ensureNumbers = function ensureNumbers(actual, expected, matcherName, options) {
  27046. ensureActualIsNumber(actual, matcherName, options);
  27047. ensureExpectedIsNumber(expected, matcherName, options);
  27048. };
  27049. exports.ensureNumbers = ensureNumbers;
  27050. var ensureExpectedIsNonNegativeInteger = function ensureExpectedIsNonNegativeInteger(expected, matcherName, options) {
  27051. if (typeof expected !== 'number' || !Number.isSafeInteger(expected) || expected < 0) {
  27052. // Prepend maybe not only for backward compatibility.
  27053. var matcherString = (options ? '' : '[.not]') + matcherName;
  27054. throw new Error(matcherErrorMessage(matcherHint(matcherString, undefined, undefined, options), "".concat(EXPECTED_COLOR('expected'), " value must be a non-negative integer"), printWithType('Expected', expected, printExpected)));
  27055. }
  27056. };
  27057. exports.ensureExpectedIsNonNegativeInteger = ensureExpectedIsNonNegativeInteger;
  27058. var isLineDiffable = function isLineDiffable(expected, received) {
  27059. var expectedType = (0, _jestGetType.default)(expected);
  27060. var receivedType = (0, _jestGetType.default)(received);
  27061. if (expectedType !== receivedType) {
  27062. return false;
  27063. }
  27064. if ((0, _jestGetType.isPrimitive)(expected)) {
  27065. // Print generic line diff for strings only:
  27066. // * if neither string is empty
  27067. return typeof expected === 'string' && typeof received === 'string' && expected.length !== 0 && received.length !== 0 && (MULTILINE_REGEXP.test(expected) || MULTILINE_REGEXP.test(received));
  27068. }
  27069. if (expectedType === 'date' || expectedType === 'function' || expectedType === 'regexp') {
  27070. return false;
  27071. }
  27072. if (expected instanceof Error && received instanceof Error) {
  27073. return false;
  27074. }
  27075. if (expectedType === 'object' && typeof expected.asymmetricMatch === 'function') {
  27076. return false;
  27077. }
  27078. if (receivedType === 'object' && typeof received.asymmetricMatch === 'function') {
  27079. return false;
  27080. }
  27081. return true;
  27082. };
  27083. var printDiffOrStringify = function printDiffOrStringify(expected, received, expectedLabel, receivedLabel, expand) {
  27084. if (typeof expected === 'string' && typeof received === 'string') {
  27085. var result = (0, _jestDiff.getStringDiff)(expected, received, {
  27086. aAnnotation: expectedLabel,
  27087. bAnnotation: receivedLabel,
  27088. expand: expand
  27089. });
  27090. if (result !== null) {
  27091. if (result.isMultiline) {
  27092. return result.annotatedDiff;
  27093. }
  27094. var _printLabel = getLabelPrinter(expectedLabel, receivedLabel);
  27095. var _expectedLine = _printLabel(expectedLabel) + printExpected(result.a);
  27096. var _receivedLine = _printLabel(receivedLabel) + printReceived(result.b);
  27097. return _expectedLine + '\n' + _receivedLine;
  27098. }
  27099. }
  27100. if (isLineDiffable(expected, received)) {
  27101. var difference = (0, _jestDiff.default)(expected, received, {
  27102. aAnnotation: expectedLabel,
  27103. bAnnotation: receivedLabel,
  27104. expand: expand
  27105. });
  27106. if (typeof difference === 'string' && difference.includes('- ' + expectedLabel) && difference.includes('+ ' + receivedLabel)) {
  27107. return difference;
  27108. }
  27109. }
  27110. var printLabel = getLabelPrinter(expectedLabel, receivedLabel);
  27111. var expectedLine = printLabel(expectedLabel) + printExpected(expected);
  27112. var receivedLine = printLabel(receivedLabel) + (stringify(expected) === stringify(received) ? 'serializes to the same string' : printReceived(received));
  27113. return expectedLine + '\n' + receivedLine;
  27114. }; // Sometimes, e.g. when comparing two numbers, the output from jest-diff
  27115. // does not contain more information than the `Expected:` / `Received:` already gives.
  27116. // In those cases, we do not print a diff to make the output shorter and not redundant.
  27117. exports.printDiffOrStringify = printDiffOrStringify;
  27118. var shouldPrintDiff = function shouldPrintDiff(actual, expected) {
  27119. if (typeof actual === 'number' && typeof expected === 'number') {
  27120. return false;
  27121. }
  27122. if (typeof actual === 'boolean' && typeof expected === 'boolean') {
  27123. return false;
  27124. }
  27125. return true;
  27126. };
  27127. var diff = function diff(a, b, options) {
  27128. return shouldPrintDiff(a, b) ? (0, _jestDiff.default)(a, b, options) : null;
  27129. };
  27130. exports.diff = diff;
  27131. var pluralize = function pluralize(word, count) {
  27132. return (NUMBERS[count] || count) + ' ' + word + (count === 1 ? '' : 's');
  27133. }; // To display lines of labeled values as two columns with monospace alignment:
  27134. // given the strings which will describe the values,
  27135. // return function which given each string, returns the label:
  27136. // string, colon, space, and enough padding spaces to align the value.
  27137. exports.pluralize = pluralize;
  27138. var getLabelPrinter = function getLabelPrinter() {
  27139. for (var _len = arguments.length, strings = new Array(_len), _key = 0; _key < _len; _key++) {
  27140. strings[_key] = arguments[_key];
  27141. }
  27142. var maxLength = strings.reduce(function (max, string) {
  27143. return string.length > max ? string.length : max;
  27144. }, 0);
  27145. return function (string) {
  27146. return "".concat(string, ": ").concat(' '.repeat(maxLength - string.length));
  27147. };
  27148. };
  27149. exports.getLabelPrinter = getLabelPrinter;
  27150. var matcherErrorMessage = function matcherErrorMessage(hint, generic, specific // incorrect value returned from call to printWithType
  27151. ) {
  27152. return "".concat(hint, "\n\n").concat(_chalk.default.bold('Matcher error'), ": ").concat(generic, "\n\n").concat(specific);
  27153. }; // Display assertion for the report when a test fails.
  27154. // New format: rejects/resolves, not, and matcher name have black color
  27155. // Old format: matcher name has dim color
  27156. exports.matcherErrorMessage = matcherErrorMessage;
  27157. var matcherHint = function matcherHint(matcherName) {
  27158. var received = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'received';
  27159. var expected = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'expected';
  27160. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  27161. var _options$comment = options.comment,
  27162. comment = _options$comment === void 0 ? '' : _options$comment,
  27163. _options$expectedColo = options.expectedColor,
  27164. expectedColor = _options$expectedColo === void 0 ? EXPECTED_COLOR : _options$expectedColo,
  27165. _options$isDirectExpe = options.isDirectExpectCall,
  27166. isDirectExpectCall = _options$isDirectExpe === void 0 ? false : _options$isDirectExpe,
  27167. _options$isNot = options.isNot,
  27168. isNot = _options$isNot === void 0 ? false : _options$isNot,
  27169. _options$promise = options.promise,
  27170. promise = _options$promise === void 0 ? '' : _options$promise,
  27171. _options$receivedColo = options.receivedColor,
  27172. receivedColor = _options$receivedColo === void 0 ? RECEIVED_COLOR : _options$receivedColo,
  27173. _options$secondArgume = options.secondArgument,
  27174. secondArgument = _options$secondArgume === void 0 ? '' : _options$secondArgume,
  27175. _options$secondArgume2 = options.secondArgumentColor,
  27176. secondArgumentColor = _options$secondArgume2 === void 0 ? EXPECTED_COLOR : _options$secondArgume2;
  27177. var hint = '';
  27178. var dimString = 'expect'; // concatenate adjacent dim substrings
  27179. if (!isDirectExpectCall && received !== '') {
  27180. hint += DIM_COLOR(dimString + '(') + receivedColor(received);
  27181. dimString = ')';
  27182. }
  27183. if (promise !== '') {
  27184. hint += DIM_COLOR(dimString + '.') + promise;
  27185. dimString = '';
  27186. }
  27187. if (isNot) {
  27188. hint += DIM_COLOR(dimString + '.') + 'not';
  27189. dimString = '';
  27190. }
  27191. if (matcherName.includes('.')) {
  27192. // Old format: for backward compatibility,
  27193. // especially without promise or isNot options
  27194. dimString += matcherName;
  27195. } else {
  27196. // New format: omit period from matcherName arg
  27197. hint += DIM_COLOR(dimString + '.') + matcherName;
  27198. dimString = '';
  27199. }
  27200. if (expected === '') {
  27201. dimString += '()';
  27202. } else {
  27203. hint += DIM_COLOR(dimString + '(') + expectedColor(expected);
  27204. if (secondArgument) {
  27205. hint += DIM_COLOR(', ') + secondArgumentColor(secondArgument);
  27206. }
  27207. dimString = ')';
  27208. }
  27209. if (comment !== '') {
  27210. dimString += ' // ' + comment;
  27211. }
  27212. if (dimString !== '') {
  27213. hint += DIM_COLOR(dimString);
  27214. }
  27215. return hint;
  27216. };
  27217. exports.matcherHint = matcherHint;
  27218. /***/ }),
  27219. /***/ "./packages/jest-message-util/build/index.js":
  27220. /*!***************************************************!*\
  27221. !*** ./packages/jest-message-util/build/index.js ***!
  27222. \***************************************************/
  27223. /*! no static exports found */
  27224. /***/ (function(module, exports, __webpack_require__) {
  27225. "use strict";
  27226. /* WEBPACK VAR INJECTION */(function(global) {
  27227. Object.defineProperty(exports, '__esModule', {
  27228. value: true
  27229. });
  27230. Object.defineProperty(exports, 'Frame', {
  27231. enumerable: true,
  27232. get: function get() {
  27233. return _types.Frame;
  27234. }
  27235. });
  27236. exports.separateMessageFromStack = exports.formatResultsErrors = exports.formatStackTrace = exports.getTopFrame = exports.getStackTraceLines = exports.formatExecError = void 0;
  27237. var _fs = _interopRequireDefault(__webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js"));
  27238. var _path = _interopRequireDefault(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"));
  27239. var _chalk = _interopRequireDefault(__webpack_require__(/*! chalk */ "./packages/expect/build/fakeChalk.js"));
  27240. var _micromatch = _interopRequireDefault(__webpack_require__(/*! micromatch */ "./node_modules/micromatch/index.js"));
  27241. var _slash = _interopRequireDefault(__webpack_require__(/*! slash */ "./node_modules/slash/index.js"));
  27242. var _codeFrame = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js");
  27243. var _stackUtils = _interopRequireDefault(__webpack_require__(/*! stack-utils */ "./node_modules/stack-utils/index.js"));
  27244. var _types = __webpack_require__(/*! ./types */ "./packages/jest-message-util/build/types.js");
  27245. function _interopRequireDefault(obj) {
  27246. return obj && obj.__esModule ? obj : {
  27247. default: obj
  27248. };
  27249. }
  27250. var _Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
  27251. var jestReadFile = global[_Symbol.for('jest-native-read-file')] || _fs.default.readFileSync;
  27252. var _Symbol = global['jest-symbol-do-not-touch'] || global.Symbol; // stack utils tries to create pretty stack by making paths relative.
  27253. var stackUtils = new _stackUtils.default({
  27254. cwd: 'something which does not exist'
  27255. });
  27256. var nodeInternals = [];
  27257. try {
  27258. nodeInternals = _stackUtils.default.nodeInternals();
  27259. } catch (e) {// `StackUtils.nodeInternals()` fails in browsers. We don't need to remove
  27260. // node internals in the browser though, so no issue.
  27261. }
  27262. var PATH_NODE_MODULES = "".concat(_path.default.sep, "node_modules").concat(_path.default.sep);
  27263. var PATH_JEST_PACKAGES = "".concat(_path.default.sep, "jest").concat(_path.default.sep, "packages").concat(_path.default.sep); // filter for noisy stack trace lines
  27264. var JASMINE_IGNORE = /^\s+at(?:(?:.jasmine\-)|\s+jasmine\.buildExpectationResult)/;
  27265. var JEST_INTERNALS_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/;
  27266. var ANONYMOUS_FN_IGNORE = /^\s+at <anonymous>.*$/;
  27267. var ANONYMOUS_PROMISE_IGNORE = /^\s+at (new )?Promise \(<anonymous>\).*$/;
  27268. var ANONYMOUS_GENERATOR_IGNORE = /^\s+at Generator.next \(<anonymous>\).*$/;
  27269. var NATIVE_NEXT_IGNORE = /^\s+at next \(native\).*$/;
  27270. var TITLE_INDENT = ' ';
  27271. var MESSAGE_INDENT = ' ';
  27272. var STACK_INDENT = ' ';
  27273. var ANCESTRY_SEPARATOR = " \u203A ";
  27274. var TITLE_BULLET = _chalk.default.bold("\u25CF ");
  27275. var STACK_TRACE_COLOR = _chalk.default.dim;
  27276. var STACK_PATH_REGEXP = /\s*at.*\(?(\:\d*\:\d*|native)\)?/;
  27277. var EXEC_ERROR_MESSAGE = 'Test suite failed to run';
  27278. var NOT_EMPTY_LINE_REGEXP = /^(?!$)/gm;
  27279. var indentAllLines = function indentAllLines(lines, indent) {
  27280. return lines.replace(NOT_EMPTY_LINE_REGEXP, indent);
  27281. };
  27282. var trim = function trim(string) {
  27283. return (string || '').trim();
  27284. }; // Some errors contain not only line numbers in stack traces
  27285. // e.g. SyntaxErrors can contain snippets of code, and we don't
  27286. // want to trim those, because they may have pointers to the column/character
  27287. // which will get misaligned.
  27288. var trimPaths = function trimPaths(string) {
  27289. return string.match(STACK_PATH_REGEXP) ? trim(string) : string;
  27290. };
  27291. var getRenderedCallsite = function getRenderedCallsite(fileContent, line, column) {
  27292. var renderedCallsite = (0, _codeFrame.codeFrameColumns)(fileContent, {
  27293. start: {
  27294. column: column,
  27295. line: line
  27296. }
  27297. }, {
  27298. highlightCode: true
  27299. });
  27300. renderedCallsite = indentAllLines(renderedCallsite, MESSAGE_INDENT);
  27301. renderedCallsite = "\n".concat(renderedCallsite, "\n");
  27302. return renderedCallsite;
  27303. };
  27304. var blankStringRegexp = /^\s*$/; // ExecError is an error thrown outside of the test suite (not inside an `it` or
  27305. // `before/after each` hooks). If it's thrown, none of the tests in the file
  27306. // are executed.
  27307. var formatExecError = function formatExecError(error, config, options, testPath, reuseMessage) {
  27308. if (!error || typeof error === 'number') {
  27309. error = new Error("Expected an Error, but \"".concat(String(error), "\" was thrown"));
  27310. error.stack = '';
  27311. }
  27312. var message, stack;
  27313. if (typeof error === 'string' || !error) {
  27314. error || (error = 'EMPTY ERROR');
  27315. message = '';
  27316. stack = error;
  27317. } else {
  27318. message = error.message;
  27319. stack = error.stack;
  27320. }
  27321. var separated = separateMessageFromStack(stack || '');
  27322. stack = separated.stack;
  27323. if (separated.message.includes(trim(message))) {
  27324. // Often stack trace already contains the duplicate of the message
  27325. message = separated.message;
  27326. }
  27327. message = indentAllLines(message, MESSAGE_INDENT);
  27328. stack = stack && !options.noStackTrace ? '\n' + formatStackTrace(stack, config, options, testPath) : '';
  27329. if (blankStringRegexp.test(message) && blankStringRegexp.test(stack)) {
  27330. // this can happen if an empty object is thrown.
  27331. message = MESSAGE_INDENT + 'Error: No message was provided';
  27332. }
  27333. var messageToUse;
  27334. if (reuseMessage) {
  27335. messageToUse = " ".concat(message.trim());
  27336. } else {
  27337. messageToUse = "".concat(EXEC_ERROR_MESSAGE, "\n\n").concat(message);
  27338. }
  27339. return TITLE_INDENT + TITLE_BULLET + messageToUse + stack + '\n';
  27340. };
  27341. exports.formatExecError = formatExecError;
  27342. var removeInternalStackEntries = function removeInternalStackEntries(lines, options) {
  27343. var pathCounter = 0;
  27344. return lines.filter(function (line) {
  27345. if (ANONYMOUS_FN_IGNORE.test(line)) {
  27346. return false;
  27347. }
  27348. if (ANONYMOUS_PROMISE_IGNORE.test(line)) {
  27349. return false;
  27350. }
  27351. if (ANONYMOUS_GENERATOR_IGNORE.test(line)) {
  27352. return false;
  27353. }
  27354. if (NATIVE_NEXT_IGNORE.test(line)) {
  27355. return false;
  27356. }
  27357. if (nodeInternals.some(function (internal) {
  27358. return internal.test(line);
  27359. })) {
  27360. return false;
  27361. }
  27362. if (!STACK_PATH_REGEXP.test(line)) {
  27363. return true;
  27364. }
  27365. if (JASMINE_IGNORE.test(line)) {
  27366. return false;
  27367. }
  27368. if (++pathCounter === 1) {
  27369. return true; // always keep the first line even if it's from Jest
  27370. }
  27371. if (options.noStackTrace) {
  27372. return false;
  27373. }
  27374. if (JEST_INTERNALS_IGNORE.test(line)) {
  27375. return false;
  27376. }
  27377. return true;
  27378. });
  27379. };
  27380. var formatPaths = function formatPaths(config, relativeTestPath, line) {
  27381. // Extract the file path from the trace line.
  27382. var match = line.match(/(^\s*at .*?\(?)([^()]+)(:[0-9]+:[0-9]+\)?.*$)/);
  27383. if (!match) {
  27384. return line;
  27385. }
  27386. var filePath = (0, _slash.default)(_path.default.relative(config.rootDir, match[2])); // highlight paths from the current test file
  27387. if (config.testMatch && config.testMatch.length && _micromatch.default.some(filePath, config.testMatch) || filePath === relativeTestPath) {
  27388. filePath = _chalk.default.reset.cyan(filePath);
  27389. }
  27390. return STACK_TRACE_COLOR(match[1]) + filePath + STACK_TRACE_COLOR(match[3]);
  27391. };
  27392. var getStackTraceLines = function getStackTraceLines(stack) {
  27393. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  27394. noStackTrace: false
  27395. };
  27396. return removeInternalStackEntries(stack.split(/\n/), options);
  27397. };
  27398. exports.getStackTraceLines = getStackTraceLines;
  27399. var getTopFrame = function getTopFrame(lines) {
  27400. var _iteratorNormalCompletion = true;
  27401. var _didIteratorError = false;
  27402. var _iteratorError = undefined;
  27403. try {
  27404. for (var _iterator = lines[_Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  27405. var line = _step.value;
  27406. if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_JEST_PACKAGES)) {
  27407. continue;
  27408. }
  27409. var parsedFrame = stackUtils.parseLine(line.trim());
  27410. if (parsedFrame && parsedFrame.file) {
  27411. return parsedFrame;
  27412. }
  27413. }
  27414. } catch (err) {
  27415. _didIteratorError = true;
  27416. _iteratorError = err;
  27417. } finally {
  27418. try {
  27419. if (!_iteratorNormalCompletion && _iterator.return != null) {
  27420. _iterator.return();
  27421. }
  27422. } finally {
  27423. if (_didIteratorError) {
  27424. throw _iteratorError;
  27425. }
  27426. }
  27427. }
  27428. return null;
  27429. };
  27430. exports.getTopFrame = getTopFrame;
  27431. var formatStackTrace = function formatStackTrace(stack, config, options, testPath) {
  27432. var lines = getStackTraceLines(stack, options);
  27433. var topFrame = getTopFrame(lines);
  27434. var renderedCallsite = '';
  27435. var relativeTestPath = testPath ? (0, _slash.default)(_path.default.relative(config.rootDir, testPath)) : null;
  27436. if (topFrame) {
  27437. var column = topFrame.column,
  27438. filename = topFrame.file,
  27439. line = topFrame.line;
  27440. if (line && filename && _path.default.isAbsolute(filename)) {
  27441. var fileContent;
  27442. try {
  27443. // TODO: check & read HasteFS instead of reading the filesystem:
  27444. // see: https://github.com/facebook/jest/pull/5405#discussion_r164281696
  27445. fileContent = jestReadFile(filename, 'utf8');
  27446. renderedCallsite = getRenderedCallsite(fileContent, line, column);
  27447. } catch (e) {// the file does not exist or is inaccessible, we ignore
  27448. }
  27449. }
  27450. }
  27451. var stacktrace = lines.filter(Boolean).map(function (line) {
  27452. return STACK_INDENT + formatPaths(config, relativeTestPath, trimPaths(line));
  27453. }).join('\n');
  27454. return "".concat(renderedCallsite, "\n").concat(stacktrace);
  27455. };
  27456. exports.formatStackTrace = formatStackTrace;
  27457. var formatResultsErrors = function formatResultsErrors(testResults, config, options, testPath) {
  27458. var failedResults = testResults.reduce(function (errors, result) {
  27459. result.failureMessages.forEach(function (content) {
  27460. return errors.push({
  27461. content: content,
  27462. result: result
  27463. });
  27464. });
  27465. return errors;
  27466. }, []);
  27467. if (!failedResults.length) {
  27468. return null;
  27469. }
  27470. return failedResults.map(function (_ref) {
  27471. var result = _ref.result,
  27472. content = _ref.content;
  27473. var _separateMessageFromS = separateMessageFromStack(content),
  27474. message = _separateMessageFromS.message,
  27475. stack = _separateMessageFromS.stack;
  27476. stack = options.noStackTrace ? '' : STACK_TRACE_COLOR(formatStackTrace(stack, config, options, testPath)) + '\n';
  27477. message = indentAllLines(message, MESSAGE_INDENT);
  27478. var title = _chalk.default.bold.red(TITLE_INDENT + TITLE_BULLET + result.ancestorTitles.join(ANCESTRY_SEPARATOR) + (result.ancestorTitles.length ? ANCESTRY_SEPARATOR : '') + result.title) + '\n';
  27479. return title + '\n' + message + '\n' + stack;
  27480. }).join('\n');
  27481. };
  27482. exports.formatResultsErrors = formatResultsErrors;
  27483. var errorRegexp = /^Error:?\s*$/;
  27484. var removeBlankErrorLine = function removeBlankErrorLine(str) {
  27485. return str.split('\n') // Lines saying just `Error:` are useless
  27486. .filter(function (line) {
  27487. return !errorRegexp.test(line);
  27488. }).join('\n').trimRight();
  27489. }; // jasmine and worker farm sometimes don't give us access to the actual
  27490. // Error object, so we have to regexp out the message from the stack string
  27491. // to format it.
  27492. var separateMessageFromStack = function separateMessageFromStack(content) {
  27493. if (!content) {
  27494. return {
  27495. message: '',
  27496. stack: ''
  27497. };
  27498. } // All lines up to what looks like a stack -- or if nothing looks like a stack
  27499. // (maybe it's a code frame instead), just the first non-empty line.
  27500. // If the error is a plain "Error:" instead of a SyntaxError or TypeError we
  27501. // remove the prefix from the message because it is generally not useful.
  27502. var messageMatch = content.match(/^(?:Error: )?([\s\S]*?(?=\n\s*at\s.*:\d*:\d*)|\s*.*)([\s\S]*)$/);
  27503. if (!messageMatch) {
  27504. // For typescript
  27505. throw new Error('If you hit this error, the regex above is buggy.');
  27506. }
  27507. var message = removeBlankErrorLine(messageMatch[1]);
  27508. var stack = removeBlankErrorLine(messageMatch[2]);
  27509. return {
  27510. message: message,
  27511. stack: stack
  27512. };
  27513. };
  27514. exports.separateMessageFromStack = separateMessageFromStack;
  27515. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  27516. /***/ }),
  27517. /***/ "./packages/jest-message-util/build/types.js":
  27518. /*!***************************************************!*\
  27519. !*** ./packages/jest-message-util/build/types.js ***!
  27520. \***************************************************/
  27521. /*! no static exports found */
  27522. /***/ (function(module, exports, __webpack_require__) {
  27523. "use strict";
  27524. /***/ }),
  27525. /***/ "./packages/pretty-format/build/collections.js":
  27526. /*!*****************************************************!*\
  27527. !*** ./packages/pretty-format/build/collections.js ***!
  27528. \*****************************************************/
  27529. /*! no static exports found */
  27530. /***/ (function(module, exports, __webpack_require__) {
  27531. "use strict";
  27532. Object.defineProperty(exports, '__esModule', {
  27533. value: true
  27534. });
  27535. exports.printIteratorEntries = printIteratorEntries;
  27536. exports.printIteratorValues = printIteratorValues;
  27537. exports.printListItems = printListItems;
  27538. exports.printObjectProperties = printObjectProperties;
  27539. /**
  27540. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  27541. *
  27542. * This source code is licensed under the MIT license found in the
  27543. * LICENSE file in the root directory of this source tree.
  27544. *
  27545. */
  27546. var getKeysOfEnumerableProperties = function getKeysOfEnumerableProperties(object) {
  27547. var keys = Object.keys(object).sort();
  27548. if (Object.getOwnPropertySymbols) {
  27549. Object.getOwnPropertySymbols(object).forEach(function (symbol) {
  27550. if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
  27551. keys.push(symbol);
  27552. }
  27553. });
  27554. }
  27555. return keys;
  27556. };
  27557. /**
  27558. * Return entries (for example, of a map)
  27559. * with spacing, indentation, and comma
  27560. * without surrounding punctuation (for example, braces)
  27561. */
  27562. function printIteratorEntries( // Flow 0.51.0: property `@@iterator` of $Iterator not found in Object
  27563. // To allow simplistic getRecordIterator in immutable.js
  27564. iterator, config, indentation, depth, refs, printer) {
  27565. var separator = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ': ';
  27566. var result = '';
  27567. var current = iterator.next();
  27568. if (!current.done) {
  27569. result += config.spacingOuter;
  27570. var indentationNext = indentation + config.indent;
  27571. while (!current.done) {
  27572. var name = printer(current.value[0], config, indentationNext, depth, refs);
  27573. var value = printer(current.value[1], config, indentationNext, depth, refs);
  27574. result += indentationNext + name + separator + value;
  27575. current = iterator.next();
  27576. if (!current.done) {
  27577. result += ',' + config.spacingInner;
  27578. } else if (!config.min) {
  27579. result += ',';
  27580. }
  27581. }
  27582. result += config.spacingOuter + indentation;
  27583. }
  27584. return result;
  27585. }
  27586. /**
  27587. * Return values (for example, of a set)
  27588. * with spacing, indentation, and comma
  27589. * without surrounding punctuation (braces or brackets)
  27590. */
  27591. function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
  27592. var result = '';
  27593. var current = iterator.next();
  27594. if (!current.done) {
  27595. result += config.spacingOuter;
  27596. var indentationNext = indentation + config.indent;
  27597. while (!current.done) {
  27598. result += indentationNext + printer(current.value, config, indentationNext, depth, refs);
  27599. current = iterator.next();
  27600. if (!current.done) {
  27601. result += ',' + config.spacingInner;
  27602. } else if (!config.min) {
  27603. result += ',';
  27604. }
  27605. }
  27606. result += config.spacingOuter + indentation;
  27607. }
  27608. return result;
  27609. }
  27610. /**
  27611. * Return items (for example, of an array)
  27612. * with spacing, indentation, and comma
  27613. * without surrounding punctuation (for example, brackets)
  27614. **/
  27615. function printListItems(list, config, indentation, depth, refs, printer) {
  27616. var result = '';
  27617. if (list.length) {
  27618. result += config.spacingOuter;
  27619. var indentationNext = indentation + config.indent;
  27620. for (var i = 0; i < list.length; i++) {
  27621. result += indentationNext + printer(list[i], config, indentationNext, depth, refs);
  27622. if (i < list.length - 1) {
  27623. result += ',' + config.spacingInner;
  27624. } else if (!config.min) {
  27625. result += ',';
  27626. }
  27627. }
  27628. result += config.spacingOuter + indentation;
  27629. }
  27630. return result;
  27631. }
  27632. /**
  27633. * Return properties of an object
  27634. * with spacing, indentation, and comma
  27635. * without surrounding punctuation (for example, braces)
  27636. */
  27637. function printObjectProperties(val, config, indentation, depth, refs, printer) {
  27638. var result = '';
  27639. var keys = getKeysOfEnumerableProperties(val);
  27640. if (keys.length) {
  27641. result += config.spacingOuter;
  27642. var indentationNext = indentation + config.indent;
  27643. for (var i = 0; i < keys.length; i++) {
  27644. var key = keys[i];
  27645. var name = printer(key, config, indentationNext, depth, refs);
  27646. var value = printer(val[key], config, indentationNext, depth, refs);
  27647. result += indentationNext + name + ': ' + value;
  27648. if (i < keys.length - 1) {
  27649. result += ',' + config.spacingInner;
  27650. } else if (!config.min) {
  27651. result += ',';
  27652. }
  27653. }
  27654. result += config.spacingOuter + indentation;
  27655. }
  27656. return result;
  27657. }
  27658. /***/ }),
  27659. /***/ "./packages/pretty-format/build/index.js":
  27660. /*!***********************************************!*\
  27661. !*** ./packages/pretty-format/build/index.js ***!
  27662. \***********************************************/
  27663. /*! no static exports found */
  27664. /***/ (function(module, exports, __webpack_require__) {
  27665. "use strict";
  27666. /* WEBPACK VAR INJECTION */(function(global) {
  27667. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  27668. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27669. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  27670. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27671. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  27672. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  27673. function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  27674. function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  27675. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  27676. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  27677. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  27678. var _ansiStyles = _interopRequireDefault(__webpack_require__(/*! ansi-styles */ "./node_modules/ansi-styles/index.js"));
  27679. var _collections = __webpack_require__(/*! ./collections */ "./packages/pretty-format/build/collections.js");
  27680. var _AsymmetricMatcher = _interopRequireDefault(__webpack_require__(/*! ./plugins/AsymmetricMatcher */ "./packages/pretty-format/build/plugins/AsymmetricMatcher.js"));
  27681. var _ConvertAnsi = _interopRequireDefault(__webpack_require__(/*! ./plugins/ConvertAnsi */ "./packages/pretty-format/build/plugins/ConvertAnsi.js"));
  27682. var _DOMCollection = _interopRequireDefault(__webpack_require__(/*! ./plugins/DOMCollection */ "./packages/pretty-format/build/plugins/DOMCollection.js"));
  27683. var _DOMElement = _interopRequireDefault(__webpack_require__(/*! ./plugins/DOMElement */ "./packages/pretty-format/build/plugins/DOMElement.js"));
  27684. var _Immutable = _interopRequireDefault(__webpack_require__(/*! ./plugins/Immutable */ "./packages/pretty-format/build/plugins/Immutable.js"));
  27685. var _ReactElement = _interopRequireDefault(__webpack_require__(/*! ./plugins/ReactElement */ "./packages/pretty-format/build/plugins/ReactElement.js"));
  27686. var _ReactTestComponent = _interopRequireDefault(__webpack_require__(/*! ./plugins/ReactTestComponent */ "./packages/pretty-format/build/plugins/ReactTestComponent.js"));
  27687. function _interopRequireDefault(obj) {
  27688. return obj && obj.__esModule ? obj : {
  27689. default: obj
  27690. };
  27691. }
  27692. var _Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
  27693. var toString = Object.prototype.toString;
  27694. var toISOString = Date.prototype.toISOString;
  27695. var errorToString = Error.prototype.toString;
  27696. var regExpToString = RegExp.prototype.toString;
  27697. var symbolToString = _Symbol.prototype.toString;
  27698. /**
  27699. * Explicitly comparing typeof constructor to function avoids undefined as name
  27700. * when mock identity-obj-proxy returns the key as the value for any key.
  27701. */
  27702. var getConstructorName = function getConstructorName(val) {
  27703. return typeof val.constructor === 'function' && val.constructor.name || 'Object';
  27704. };
  27705. /* global window */
  27706. /** Is val is equal to global window object? Works even if it does not exist :) */
  27707. var isWindow = function isWindow(val) {
  27708. return typeof window !== 'undefined' && val === window;
  27709. };
  27710. var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
  27711. var NEWLINE_REGEXP = /\n/gi;
  27712. var PrettyFormatPluginError =
  27713. /*#__PURE__*/
  27714. function (_Error) {
  27715. _inherits(PrettyFormatPluginError, _Error);
  27716. function PrettyFormatPluginError(message, stack) {
  27717. var _this;
  27718. _classCallCheck(this, PrettyFormatPluginError);
  27719. _this = _possibleConstructorReturn(this, _getPrototypeOf(PrettyFormatPluginError).call(this, message));
  27720. _this.stack = stack;
  27721. _this.name = _this.constructor.name;
  27722. return _this;
  27723. }
  27724. return PrettyFormatPluginError;
  27725. }(_wrapNativeSuper(Error));
  27726. function isToStringedArrayType(toStringed) {
  27727. return toStringed === '[object Array]' || toStringed === '[object ArrayBuffer]' || toStringed === '[object DataView]' || toStringed === '[object Float32Array]' || toStringed === '[object Float64Array]' || toStringed === '[object Int8Array]' || toStringed === '[object Int16Array]' || toStringed === '[object Int32Array]' || toStringed === '[object Uint8Array]' || toStringed === '[object Uint8ClampedArray]' || toStringed === '[object Uint16Array]' || toStringed === '[object Uint32Array]';
  27728. }
  27729. function printNumber(val) {
  27730. return Object.is(val, -0) ? '-0' : String(val);
  27731. }
  27732. function printBigInt(val) {
  27733. return String("".concat(val, "n"));
  27734. }
  27735. function printFunction(val, printFunctionName) {
  27736. if (!printFunctionName) {
  27737. return '[Function]';
  27738. }
  27739. return '[Function ' + (val.name || 'anonymous') + ']';
  27740. }
  27741. function printSymbol(val) {
  27742. return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
  27743. }
  27744. function printError(val) {
  27745. return '[' + errorToString.call(val) + ']';
  27746. }
  27747. /**
  27748. * The first port of call for printing an object, handles most of the
  27749. * data-types in JS.
  27750. */
  27751. function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
  27752. if (val === true || val === false) {
  27753. return '' + val;
  27754. }
  27755. if (val === undefined) {
  27756. return 'undefined';
  27757. }
  27758. if (val === null) {
  27759. return 'null';
  27760. }
  27761. var typeOf = _typeof(val);
  27762. if (typeOf === 'number') {
  27763. return printNumber(val);
  27764. }
  27765. if (typeOf === 'bigint') {
  27766. return printBigInt(val);
  27767. }
  27768. if (typeOf === 'string') {
  27769. if (escapeString) {
  27770. return '"' + val.replace(/"|\\/g, '\\$&') + '"';
  27771. }
  27772. return '"' + val + '"';
  27773. }
  27774. if (typeOf === 'function') {
  27775. return printFunction(val, printFunctionName);
  27776. }
  27777. if (typeOf === 'symbol') {
  27778. return printSymbol(val);
  27779. }
  27780. var toStringed = toString.call(val);
  27781. if (toStringed === '[object WeakMap]') {
  27782. return 'WeakMap {}';
  27783. }
  27784. if (toStringed === '[object WeakSet]') {
  27785. return 'WeakSet {}';
  27786. }
  27787. if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') {
  27788. return printFunction(val, printFunctionName);
  27789. }
  27790. if (toStringed === '[object Symbol]') {
  27791. return printSymbol(val);
  27792. }
  27793. if (toStringed === '[object Date]') {
  27794. return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);
  27795. }
  27796. if (toStringed === '[object Error]') {
  27797. return printError(val);
  27798. }
  27799. if (toStringed === '[object RegExp]') {
  27800. if (escapeRegex) {
  27801. // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js
  27802. return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
  27803. }
  27804. return regExpToString.call(val);
  27805. }
  27806. if (val instanceof Error) {
  27807. return printError(val);
  27808. }
  27809. return null;
  27810. }
  27811. /**
  27812. * Handles more complex objects ( such as objects with circular references.
  27813. * maps and sets etc )
  27814. */
  27815. function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
  27816. if (refs.indexOf(val) !== -1) {
  27817. return '[Circular]';
  27818. }
  27819. refs = refs.slice();
  27820. refs.push(val);
  27821. var hitMaxDepth = ++depth > config.maxDepth;
  27822. var min = config.min;
  27823. if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) {
  27824. return printer(val.toJSON(), config, indentation, depth, refs, true);
  27825. }
  27826. var toStringed = toString.call(val);
  27827. if (toStringed === '[object Arguments]') {
  27828. return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + ']';
  27829. }
  27830. if (isToStringedArrayType(toStringed)) {
  27831. return hitMaxDepth ? '[' + val.constructor.name + ']' : (min ? '' : val.constructor.name + ' ') + '[' + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + ']';
  27832. }
  27833. if (toStringed === '[object Map]') {
  27834. return hitMaxDepth ? '[Map]' : 'Map {' + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}';
  27835. }
  27836. if (toStringed === '[object Set]') {
  27837. return hitMaxDepth ? '[Set]' : 'Set {' + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + '}';
  27838. } // Avoid failure to serialize global window object in jsdom test environment.
  27839. // For example, not even relevant if window is prop of React element.
  27840. return hitMaxDepth || isWindow(val) ? '[' + getConstructorName(val) + ']' : (min ? '' : getConstructorName(val) + ' ') + '{' + (0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer) + '}';
  27841. }
  27842. function isNewPlugin(plugin) {
  27843. return plugin.serialize != null;
  27844. }
  27845. function printPlugin(plugin, val, config, indentation, depth, refs) {
  27846. var printed;
  27847. try {
  27848. printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, function (valChild) {
  27849. return printer(valChild, config, indentation, depth, refs);
  27850. }, function (str) {
  27851. var indentationNext = indentation + config.indent;
  27852. return indentationNext + str.replace(NEWLINE_REGEXP, '\n' + indentationNext);
  27853. }, {
  27854. edgeSpacing: config.spacingOuter,
  27855. min: config.min,
  27856. spacing: config.spacingInner
  27857. }, config.colors);
  27858. } catch (error) {
  27859. throw new PrettyFormatPluginError(error.message, error.stack);
  27860. }
  27861. if (typeof printed !== 'string') {
  27862. throw new Error("pretty-format: Plugin must return type \"string\" but instead returned \"".concat(_typeof(printed), "\"."));
  27863. }
  27864. return printed;
  27865. }
  27866. function findPlugin(plugins, val) {
  27867. for (var p = 0; p < plugins.length; p++) {
  27868. try {
  27869. if (plugins[p].test(val)) {
  27870. return plugins[p];
  27871. }
  27872. } catch (error) {
  27873. throw new PrettyFormatPluginError(error.message, error.stack);
  27874. }
  27875. }
  27876. return null;
  27877. }
  27878. function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
  27879. var plugin = findPlugin(config.plugins, val);
  27880. if (plugin !== null) {
  27881. return printPlugin(plugin, val, config, indentation, depth, refs);
  27882. }
  27883. var basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
  27884. if (basicResult !== null) {
  27885. return basicResult;
  27886. }
  27887. return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
  27888. }
  27889. var DEFAULT_THEME = {
  27890. comment: 'gray',
  27891. content: 'reset',
  27892. prop: 'yellow',
  27893. tag: 'cyan',
  27894. value: 'green'
  27895. };
  27896. var DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
  27897. var DEFAULT_OPTIONS = {
  27898. callToJSON: true,
  27899. escapeRegex: false,
  27900. escapeString: true,
  27901. highlight: false,
  27902. indent: 2,
  27903. maxDepth: Infinity,
  27904. min: false,
  27905. plugins: [],
  27906. printFunctionName: true,
  27907. theme: DEFAULT_THEME
  27908. };
  27909. function validateOptions(options) {
  27910. Object.keys(options).forEach(function (key) {
  27911. if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
  27912. throw new Error("pretty-format: Unknown option \"".concat(key, "\"."));
  27913. }
  27914. });
  27915. if (options.min && options.indent !== undefined && options.indent !== 0) {
  27916. throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
  27917. }
  27918. if (options.theme !== undefined) {
  27919. if (options.theme === null) {
  27920. throw new Error("pretty-format: Option \"theme\" must not be null.");
  27921. }
  27922. if (_typeof(options.theme) !== 'object') {
  27923. throw new Error("pretty-format: Option \"theme\" must be of type \"object\" but instead received \"".concat(_typeof(options.theme), "\"."));
  27924. }
  27925. }
  27926. }
  27927. var getColorsHighlight = function getColorsHighlight(options) {
  27928. return DEFAULT_THEME_KEYS.reduce(function (colors, key) {
  27929. var value = options.theme && options.theme[key] !== undefined ? options.theme[key] : DEFAULT_THEME[key];
  27930. var color = value && _ansiStyles.default[value];
  27931. if (color && typeof color.close === 'string' && typeof color.open === 'string') {
  27932. colors[key] = color;
  27933. } else {
  27934. throw new Error("pretty-format: Option \"theme\" has a key \"".concat(key, "\" whose value \"").concat(value, "\" is undefined in ansi-styles."));
  27935. }
  27936. return colors;
  27937. }, Object.create(null));
  27938. };
  27939. var getColorsEmpty = function getColorsEmpty() {
  27940. return DEFAULT_THEME_KEYS.reduce(function (colors, key) {
  27941. colors[key] = {
  27942. close: '',
  27943. open: ''
  27944. };
  27945. return colors;
  27946. }, Object.create(null));
  27947. };
  27948. var getPrintFunctionName = function getPrintFunctionName(options) {
  27949. return options && options.printFunctionName !== undefined ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;
  27950. };
  27951. var getEscapeRegex = function getEscapeRegex(options) {
  27952. return options && options.escapeRegex !== undefined ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex;
  27953. };
  27954. var getEscapeString = function getEscapeString(options) {
  27955. return options && options.escapeString !== undefined ? options.escapeString : DEFAULT_OPTIONS.escapeString;
  27956. };
  27957. var getConfig = function getConfig(options) {
  27958. return {
  27959. callToJSON: options && options.callToJSON !== undefined ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,
  27960. colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),
  27961. escapeRegex: getEscapeRegex(options),
  27962. escapeString: getEscapeString(options),
  27963. indent: options && options.min ? '' : createIndent(options && options.indent !== undefined ? options.indent : DEFAULT_OPTIONS.indent),
  27964. maxDepth: options && options.maxDepth !== undefined ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,
  27965. min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,
  27966. plugins: options && options.plugins !== undefined ? options.plugins : DEFAULT_OPTIONS.plugins,
  27967. printFunctionName: getPrintFunctionName(options),
  27968. spacingInner: options && options.min ? ' ' : '\n',
  27969. spacingOuter: options && options.min ? '' : '\n'
  27970. };
  27971. };
  27972. function createIndent(indent) {
  27973. return new Array(indent + 1).join(' ');
  27974. }
  27975. /**
  27976. * Returns a presentation string of your `val` object
  27977. * @param val any potential JavaScript object
  27978. * @param options Custom settings
  27979. */
  27980. function prettyFormat(val, options) {
  27981. if (options) {
  27982. validateOptions(options);
  27983. if (options.plugins) {
  27984. var plugin = findPlugin(options.plugins, val);
  27985. if (plugin !== null) {
  27986. return printPlugin(plugin, val, getConfig(options), '', 0, []);
  27987. }
  27988. }
  27989. }
  27990. var basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
  27991. if (basicResult !== null) {
  27992. return basicResult;
  27993. }
  27994. return printComplexValue(val, getConfig(options), '', 0, []);
  27995. }
  27996. prettyFormat.plugins = {
  27997. AsymmetricMatcher: _AsymmetricMatcher.default,
  27998. ConvertAnsi: _ConvertAnsi.default,
  27999. DOMCollection: _DOMCollection.default,
  28000. DOMElement: _DOMElement.default,
  28001. Immutable: _Immutable.default,
  28002. ReactElement: _ReactElement.default,
  28003. ReactTestComponent: _ReactTestComponent.default
  28004. };
  28005. /* eslint-disable-next-line no-redeclare */
  28006. module.exports = prettyFormat;
  28007. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  28008. /***/ }),
  28009. /***/ "./packages/pretty-format/build/plugins/AsymmetricMatcher.js":
  28010. /*!*******************************************************************!*\
  28011. !*** ./packages/pretty-format/build/plugins/AsymmetricMatcher.js ***!
  28012. \*******************************************************************/
  28013. /*! no static exports found */
  28014. /***/ (function(module, exports, __webpack_require__) {
  28015. "use strict";
  28016. /* WEBPACK VAR INJECTION */(function(global) {
  28017. Object.defineProperty(exports, '__esModule', {
  28018. value: true
  28019. });
  28020. exports.default = exports.test = exports.serialize = void 0;
  28021. var _collections = __webpack_require__(/*! ../collections */ "./packages/pretty-format/build/collections.js");
  28022. var _Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
  28023. var asymmetricMatcher = _Symbol.for('jest.asymmetricMatcher');
  28024. var SPACE = ' ';
  28025. var serialize = function serialize(val, config, indentation, depth, refs, printer) {
  28026. var stringedValue = val.toString();
  28027. if (stringedValue === 'ArrayContaining' || stringedValue === 'ArrayNotContaining') {
  28028. if (++depth > config.maxDepth) {
  28029. return '[' + stringedValue + ']';
  28030. }
  28031. return stringedValue + SPACE + '[' + (0, _collections.printListItems)(val.sample, config, indentation, depth, refs, printer) + ']';
  28032. }
  28033. if (stringedValue === 'ObjectContaining' || stringedValue === 'ObjectNotContaining') {
  28034. if (++depth > config.maxDepth) {
  28035. return '[' + stringedValue + ']';
  28036. }
  28037. return stringedValue + SPACE + '{' + (0, _collections.printObjectProperties)(val.sample, config, indentation, depth, refs, printer) + '}';
  28038. }
  28039. if (stringedValue === 'StringMatching' || stringedValue === 'StringNotMatching') {
  28040. return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
  28041. }
  28042. if (stringedValue === 'StringContaining' || stringedValue === 'StringNotContaining') {
  28043. return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
  28044. }
  28045. return val.toAsymmetricMatcher();
  28046. };
  28047. exports.serialize = serialize;
  28048. var test = function test(val) {
  28049. return val && val.$$typeof === asymmetricMatcher;
  28050. };
  28051. exports.test = test;
  28052. var plugin = {
  28053. serialize: serialize,
  28054. test: test
  28055. };
  28056. var _default = plugin;
  28057. exports.default = _default;
  28058. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  28059. /***/ }),
  28060. /***/ "./packages/pretty-format/build/plugins/ConvertAnsi.js":
  28061. /*!*************************************************************!*\
  28062. !*** ./packages/pretty-format/build/plugins/ConvertAnsi.js ***!
  28063. \*************************************************************/
  28064. /*! no static exports found */
  28065. /***/ (function(module, exports, __webpack_require__) {
  28066. "use strict";
  28067. Object.defineProperty(exports, '__esModule', {
  28068. value: true
  28069. });
  28070. exports.default = exports.serialize = exports.test = void 0;
  28071. var _ansiRegex = _interopRequireDefault(__webpack_require__(/*! ansi-regex */ "./node_modules/ansi-regex/index.js"));
  28072. var _ansiStyles = _interopRequireDefault(__webpack_require__(/*! ansi-styles */ "./node_modules/ansi-styles/index.js"));
  28073. function _interopRequireDefault(obj) {
  28074. return obj && obj.__esModule ? obj : {
  28075. default: obj
  28076. };
  28077. }
  28078. /**
  28079. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  28080. *
  28081. * This source code is licensed under the MIT license found in the
  28082. * LICENSE file in the root directory of this source tree.
  28083. */
  28084. var toHumanReadableAnsi = function toHumanReadableAnsi(text) {
  28085. return text.replace((0, _ansiRegex.default)(), function (match) {
  28086. switch (match) {
  28087. case _ansiStyles.default.red.close:
  28088. case _ansiStyles.default.green.close:
  28089. case _ansiStyles.default.cyan.close:
  28090. case _ansiStyles.default.gray.close:
  28091. case _ansiStyles.default.white.close:
  28092. case _ansiStyles.default.yellow.close:
  28093. case _ansiStyles.default.bgRed.close:
  28094. case _ansiStyles.default.bgGreen.close:
  28095. case _ansiStyles.default.bgYellow.close:
  28096. case _ansiStyles.default.inverse.close:
  28097. case _ansiStyles.default.dim.close:
  28098. case _ansiStyles.default.bold.close:
  28099. case _ansiStyles.default.reset.open:
  28100. case _ansiStyles.default.reset.close:
  28101. return '</>';
  28102. case _ansiStyles.default.red.open:
  28103. return '<red>';
  28104. case _ansiStyles.default.green.open:
  28105. return '<green>';
  28106. case _ansiStyles.default.cyan.open:
  28107. return '<cyan>';
  28108. case _ansiStyles.default.gray.open:
  28109. return '<gray>';
  28110. case _ansiStyles.default.white.open:
  28111. return '<white>';
  28112. case _ansiStyles.default.yellow.open:
  28113. return '<yellow>';
  28114. case _ansiStyles.default.bgRed.open:
  28115. return '<bgRed>';
  28116. case _ansiStyles.default.bgGreen.open:
  28117. return '<bgGreen>';
  28118. case _ansiStyles.default.bgYellow.open:
  28119. return '<bgYellow>';
  28120. case _ansiStyles.default.inverse.open:
  28121. return '<inverse>';
  28122. case _ansiStyles.default.dim.open:
  28123. return '<dim>';
  28124. case _ansiStyles.default.bold.open:
  28125. return '<bold>';
  28126. default:
  28127. return '';
  28128. }
  28129. });
  28130. };
  28131. var test = function test(val) {
  28132. return typeof val === 'string' && !!val.match((0, _ansiRegex.default)());
  28133. };
  28134. exports.test = test;
  28135. var serialize = function serialize(val, config, indentation, depth, refs, printer) {
  28136. return printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
  28137. };
  28138. exports.serialize = serialize;
  28139. var plugin = {
  28140. serialize: serialize,
  28141. test: test
  28142. };
  28143. var _default = plugin;
  28144. exports.default = _default;
  28145. /***/ }),
  28146. /***/ "./packages/pretty-format/build/plugins/DOMCollection.js":
  28147. /*!***************************************************************!*\
  28148. !*** ./packages/pretty-format/build/plugins/DOMCollection.js ***!
  28149. \***************************************************************/
  28150. /*! no static exports found */
  28151. /***/ (function(module, exports, __webpack_require__) {
  28152. "use strict";
  28153. Object.defineProperty(exports, '__esModule', {
  28154. value: true
  28155. });
  28156. exports.default = exports.serialize = exports.test = void 0;
  28157. var _collections = __webpack_require__(/*! ../collections */ "./packages/pretty-format/build/collections.js");
  28158. function _objectSpread(target) {
  28159. for (var i = 1; i < arguments.length; i++) {
  28160. var source = arguments[i] != null ? arguments[i] : {};
  28161. var ownKeys = Object.keys(source);
  28162. if (typeof Object.getOwnPropertySymbols === 'function') {
  28163. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  28164. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  28165. }));
  28166. }
  28167. ownKeys.forEach(function (key) {
  28168. _defineProperty(target, key, source[key]);
  28169. });
  28170. }
  28171. return target;
  28172. }
  28173. function _defineProperty(obj, key, value) {
  28174. if (key in obj) {
  28175. Object.defineProperty(obj, key, {
  28176. value: value,
  28177. enumerable: true,
  28178. configurable: true,
  28179. writable: true
  28180. });
  28181. } else {
  28182. obj[key] = value;
  28183. }
  28184. return obj;
  28185. }
  28186. var SPACE = ' ';
  28187. var OBJECT_NAMES = ['DOMStringMap', 'NamedNodeMap'];
  28188. var ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
  28189. var testName = function testName(name) {
  28190. return OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);
  28191. };
  28192. var test = function test(val) {
  28193. return val && val.constructor && val.constructor.name && testName(val.constructor.name);
  28194. }; // Convert array of attribute objects to props object.
  28195. exports.test = test;
  28196. var propsReducer = function propsReducer(props, attribute) {
  28197. props[attribute.name] = attribute.value;
  28198. return props;
  28199. };
  28200. var serialize = function serialize(collection, config, indentation, depth, refs, printer) {
  28201. var name = collection.constructor.name;
  28202. if (++depth > config.maxDepth) {
  28203. return '[' + name + ']';
  28204. }
  28205. return (config.min ? '' : name + SPACE) + (OBJECT_NAMES.indexOf(name) !== -1 ? '{' + (0, _collections.printObjectProperties)(name === 'NamedNodeMap' ? Array.prototype.reduce.call(collection, propsReducer, {}) : _objectSpread({}, collection), config, indentation, depth, refs, printer) + '}' : '[' + (0, _collections.printListItems)(Array.from(collection), config, indentation, depth, refs, printer) + ']');
  28206. };
  28207. exports.serialize = serialize;
  28208. var plugin = {
  28209. serialize: serialize,
  28210. test: test
  28211. };
  28212. var _default = plugin;
  28213. exports.default = _default;
  28214. /***/ }),
  28215. /***/ "./packages/pretty-format/build/plugins/DOMElement.js":
  28216. /*!************************************************************!*\
  28217. !*** ./packages/pretty-format/build/plugins/DOMElement.js ***!
  28218. \************************************************************/
  28219. /*! no static exports found */
  28220. /***/ (function(module, exports, __webpack_require__) {
  28221. "use strict";
  28222. Object.defineProperty(exports, '__esModule', {
  28223. value: true
  28224. });
  28225. exports.default = exports.serialize = exports.test = void 0;
  28226. var _markup = __webpack_require__(/*! ./lib/markup */ "./packages/pretty-format/build/plugins/lib/markup.js");
  28227. /**
  28228. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  28229. *
  28230. * This source code is licensed under the MIT license found in the
  28231. * LICENSE file in the root directory of this source tree.
  28232. */
  28233. var ELEMENT_NODE = 1;
  28234. var TEXT_NODE = 3;
  28235. var COMMENT_NODE = 8;
  28236. var FRAGMENT_NODE = 11;
  28237. var ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
  28238. var testNode = function testNode(nodeType, name) {
  28239. return nodeType === ELEMENT_NODE && ELEMENT_REGEXP.test(name) || nodeType === TEXT_NODE && name === 'Text' || nodeType === COMMENT_NODE && name === 'Comment' || nodeType === FRAGMENT_NODE && name === 'DocumentFragment';
  28240. };
  28241. var test = function test(val) {
  28242. return val && val.constructor && val.constructor.name && testNode(val.nodeType, val.constructor.name);
  28243. };
  28244. exports.test = test;
  28245. function nodeIsText(node) {
  28246. return node.nodeType === TEXT_NODE;
  28247. }
  28248. function nodeIsComment(node) {
  28249. return node.nodeType === COMMENT_NODE;
  28250. }
  28251. function nodeIsFragment(node) {
  28252. return node.nodeType === FRAGMENT_NODE;
  28253. }
  28254. var serialize = function serialize(node, config, indentation, depth, refs, printer) {
  28255. if (nodeIsText(node)) {
  28256. return (0, _markup.printText)(node.data, config);
  28257. }
  28258. if (nodeIsComment(node)) {
  28259. return (0, _markup.printComment)(node.data, config);
  28260. }
  28261. var type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
  28262. if (++depth > config.maxDepth) {
  28263. return (0, _markup.printElementAsLeaf)(type, config);
  28264. }
  28265. return (0, _markup.printElement)(type, (0, _markup.printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes).map(function (attr) {
  28266. return attr.name;
  28267. }).sort(), nodeIsFragment(node) ? [] : Array.from(node.attributes).reduce(function (props, attribute) {
  28268. props[attribute.name] = attribute.value;
  28269. return props;
  28270. }, {}), config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
  28271. };
  28272. exports.serialize = serialize;
  28273. var plugin = {
  28274. serialize: serialize,
  28275. test: test
  28276. };
  28277. var _default = plugin;
  28278. exports.default = _default;
  28279. /***/ }),
  28280. /***/ "./packages/pretty-format/build/plugins/Immutable.js":
  28281. /*!***********************************************************!*\
  28282. !*** ./packages/pretty-format/build/plugins/Immutable.js ***!
  28283. \***********************************************************/
  28284. /*! no static exports found */
  28285. /***/ (function(module, exports, __webpack_require__) {
  28286. "use strict";
  28287. Object.defineProperty(exports, '__esModule', {
  28288. value: true
  28289. });
  28290. exports.default = exports.test = exports.serialize = void 0;
  28291. var _collections = __webpack_require__(/*! ../collections */ "./packages/pretty-format/build/collections.js");
  28292. /**
  28293. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  28294. *
  28295. * This source code is licensed under the MIT license found in the
  28296. * LICENSE file in the root directory of this source tree.
  28297. */
  28298. // SENTINEL constants are from https://github.com/facebook/immutable-js
  28299. var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
  28300. var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
  28301. var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
  28302. var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
  28303. var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
  28304. var IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
  28305. var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
  28306. var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
  28307. var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
  28308. var getImmutableName = function getImmutableName(name) {
  28309. return 'Immutable.' + name;
  28310. };
  28311. var printAsLeaf = function printAsLeaf(name) {
  28312. return '[' + name + ']';
  28313. };
  28314. var SPACE = ' ';
  28315. var LAZY = '…'; // Seq is lazy if it calls a method like filter
  28316. var printImmutableEntries = function printImmutableEntries(val, config, indentation, depth, refs, printer, type) {
  28317. return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '{' + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) + '}';
  28318. }; // Record has an entries method because it is a collection in immutable v3.
  28319. // Return an iterator for Immutable Record from version v3 or v4.
  28320. var getRecordEntries = function getRecordEntries(val) {
  28321. var i = 0;
  28322. return {
  28323. next: function next() {
  28324. if (i < val._keys.length) {
  28325. var key = val._keys[i++];
  28326. return {
  28327. done: false,
  28328. value: [key, val.get(key)]
  28329. };
  28330. }
  28331. return {
  28332. done: true
  28333. };
  28334. }
  28335. };
  28336. };
  28337. var printImmutableRecord = function printImmutableRecord(val, config, indentation, depth, refs, printer) {
  28338. // _name property is defined only for an Immutable Record instance
  28339. // which was constructed with a second optional descriptive name arg
  28340. var name = getImmutableName(val._name || 'Record');
  28341. return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE + '{' + (0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer) + '}';
  28342. };
  28343. var printImmutableSeq = function printImmutableSeq(val, config, indentation, depth, refs, printer) {
  28344. var name = getImmutableName('Seq');
  28345. if (++depth > config.maxDepth) {
  28346. return printAsLeaf(name);
  28347. }
  28348. if (val[IS_KEYED_SENTINEL]) {
  28349. return name + SPACE + '{' + ( // from Immutable collection of entries or from ECMAScript object
  28350. val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY) + '}';
  28351. }
  28352. return name + SPACE + '[' + (val._iter || // from Immutable collection of values
  28353. val._array || // from ECMAScript array
  28354. val._collection || // from ECMAScript collection in immutable v4
  28355. val._iterable // from ECMAScript collection in immutable v3
  28356. ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY) + ']';
  28357. };
  28358. var printImmutableValues = function printImmutableValues(val, config, indentation, depth, refs, printer, type) {
  28359. return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '[' + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + ']';
  28360. };
  28361. var serialize = function serialize(val, config, indentation, depth, refs, printer) {
  28362. if (val[IS_MAP_SENTINEL]) {
  28363. return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map');
  28364. }
  28365. if (val[IS_LIST_SENTINEL]) {
  28366. return printImmutableValues(val, config, indentation, depth, refs, printer, 'List');
  28367. }
  28368. if (val[IS_SET_SENTINEL]) {
  28369. return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set');
  28370. }
  28371. if (val[IS_STACK_SENTINEL]) {
  28372. return printImmutableValues(val, config, indentation, depth, refs, printer, 'Stack');
  28373. }
  28374. if (val[IS_SEQ_SENTINEL]) {
  28375. return printImmutableSeq(val, config, indentation, depth, refs, printer);
  28376. } // For compatibility with immutable v3 and v4, let record be the default.
  28377. return printImmutableRecord(val, config, indentation, depth, refs, printer);
  28378. }; // Explicitly comparing sentinel properties to true avoids false positive
  28379. // when mock identity-obj-proxy returns the key as the value for any key.
  28380. exports.serialize = serialize;
  28381. var test = function test(val) {
  28382. return val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
  28383. };
  28384. exports.test = test;
  28385. var plugin = {
  28386. serialize: serialize,
  28387. test: test
  28388. };
  28389. var _default = plugin;
  28390. exports.default = _default;
  28391. /***/ }),
  28392. /***/ "./packages/pretty-format/build/plugins/ReactElement.js":
  28393. /*!**************************************************************!*\
  28394. !*** ./packages/pretty-format/build/plugins/ReactElement.js ***!
  28395. \**************************************************************/
  28396. /*! no static exports found */
  28397. /***/ (function(module, exports, __webpack_require__) {
  28398. "use strict";
  28399. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  28400. Object.defineProperty(exports, '__esModule', {
  28401. value: true
  28402. });
  28403. exports.default = exports.test = exports.serialize = void 0;
  28404. var ReactIs = _interopRequireWildcard(__webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"));
  28405. var _markup = __webpack_require__(/*! ./lib/markup */ "./packages/pretty-format/build/plugins/lib/markup.js");
  28406. function _interopRequireWildcard(obj) {
  28407. if (obj && obj.__esModule) {
  28408. return obj;
  28409. } else {
  28410. var newObj = {};
  28411. if (obj != null) {
  28412. for (var key in obj) {
  28413. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  28414. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  28415. if (desc.get || desc.set) {
  28416. Object.defineProperty(newObj, key, desc);
  28417. } else {
  28418. newObj[key] = obj[key];
  28419. }
  28420. }
  28421. }
  28422. }
  28423. newObj.default = obj;
  28424. return newObj;
  28425. }
  28426. }
  28427. /**
  28428. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  28429. *
  28430. * This source code is licensed under the MIT license found in the
  28431. * LICENSE file in the root directory of this source tree.
  28432. */
  28433. // Given element.props.children, or subtree during recursive traversal,
  28434. // return flattened array of children.
  28435. var getChildren = function getChildren(arg) {
  28436. var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  28437. if (Array.isArray(arg)) {
  28438. arg.forEach(function (item) {
  28439. getChildren(item, children);
  28440. });
  28441. } else if (arg != null && arg !== false) {
  28442. children.push(arg);
  28443. }
  28444. return children;
  28445. };
  28446. var getType = function getType(element) {
  28447. var type = element.type;
  28448. if (typeof type === 'string') {
  28449. return type;
  28450. }
  28451. if (typeof type === 'function') {
  28452. return type.displayName || type.name || 'Unknown';
  28453. }
  28454. if (ReactIs.isFragment(element)) {
  28455. return 'React.Fragment';
  28456. }
  28457. if (ReactIs.isSuspense(element)) {
  28458. return 'React.Suspense';
  28459. }
  28460. if (_typeof(type) === 'object' && type !== null) {
  28461. if (ReactIs.isContextProvider(element)) {
  28462. return 'Context.Provider';
  28463. }
  28464. if (ReactIs.isContextConsumer(element)) {
  28465. return 'Context.Consumer';
  28466. }
  28467. if (ReactIs.isForwardRef(element)) {
  28468. var functionName = type.render.displayName || type.render.name || '';
  28469. return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
  28470. }
  28471. if (ReactIs.isMemo(type)) {
  28472. var _functionName = type.displayName || type.type.displayName || type.type.name || '';
  28473. return _functionName !== '' ? 'Memo(' + _functionName + ')' : 'Memo';
  28474. }
  28475. }
  28476. return 'UNDEFINED';
  28477. };
  28478. var getPropKeys = function getPropKeys(element) {
  28479. var props = element.props;
  28480. return Object.keys(props).filter(function (key) {
  28481. return key !== 'children' && props[key] !== undefined;
  28482. }).sort();
  28483. };
  28484. var serialize = function serialize(element, config, indentation, depth, refs, printer) {
  28485. return ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(getType(element), config) : (0, _markup.printElement)(getType(element), (0, _markup.printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
  28486. };
  28487. exports.serialize = serialize;
  28488. var test = function test(val) {
  28489. return val && ReactIs.isElement(val);
  28490. };
  28491. exports.test = test;
  28492. var plugin = {
  28493. serialize: serialize,
  28494. test: test
  28495. };
  28496. var _default = plugin;
  28497. exports.default = _default;
  28498. /***/ }),
  28499. /***/ "./packages/pretty-format/build/plugins/ReactTestComponent.js":
  28500. /*!********************************************************************!*\
  28501. !*** ./packages/pretty-format/build/plugins/ReactTestComponent.js ***!
  28502. \********************************************************************/
  28503. /*! no static exports found */
  28504. /***/ (function(module, exports, __webpack_require__) {
  28505. "use strict";
  28506. /* WEBPACK VAR INJECTION */(function(global) {
  28507. Object.defineProperty(exports, '__esModule', {
  28508. value: true
  28509. });
  28510. exports.default = exports.test = exports.serialize = void 0;
  28511. var _markup = __webpack_require__(/*! ./lib/markup */ "./packages/pretty-format/build/plugins/lib/markup.js");
  28512. var _Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
  28513. var testSymbol = _Symbol.for('react.test.json');
  28514. var getPropKeys = function getPropKeys(object) {
  28515. var props = object.props;
  28516. return props ? Object.keys(props).filter(function (key) {
  28517. return props[key] !== undefined;
  28518. }).sort() : [];
  28519. };
  28520. var serialize = function serialize(object, config, indentation, depth, refs, printer) {
  28521. return ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(object.type, config) : (0, _markup.printElement)(object.type, object.props ? (0, _markup.printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : '', object.children ? (0, _markup.printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : '', config, indentation);
  28522. };
  28523. exports.serialize = serialize;
  28524. var test = function test(val) {
  28525. return val && val.$$typeof === testSymbol;
  28526. };
  28527. exports.test = test;
  28528. var plugin = {
  28529. serialize: serialize,
  28530. test: test
  28531. };
  28532. var _default = plugin;
  28533. exports.default = _default;
  28534. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  28535. /***/ }),
  28536. /***/ "./packages/pretty-format/build/plugins/lib/escapeHTML.js":
  28537. /*!****************************************************************!*\
  28538. !*** ./packages/pretty-format/build/plugins/lib/escapeHTML.js ***!
  28539. \****************************************************************/
  28540. /*! no static exports found */
  28541. /***/ (function(module, exports, __webpack_require__) {
  28542. "use strict";
  28543. Object.defineProperty(exports, '__esModule', {
  28544. value: true
  28545. });
  28546. exports.default = escapeHTML;
  28547. /**
  28548. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  28549. *
  28550. * This source code is licensed under the MIT license found in the
  28551. * LICENSE file in the root directory of this source tree.
  28552. */
  28553. function escapeHTML(str) {
  28554. return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');
  28555. }
  28556. /***/ }),
  28557. /***/ "./packages/pretty-format/build/plugins/lib/markup.js":
  28558. /*!************************************************************!*\
  28559. !*** ./packages/pretty-format/build/plugins/lib/markup.js ***!
  28560. \************************************************************/
  28561. /*! no static exports found */
  28562. /***/ (function(module, exports, __webpack_require__) {
  28563. "use strict";
  28564. Object.defineProperty(exports, '__esModule', {
  28565. value: true
  28566. });
  28567. exports.printElementAsLeaf = exports.printElement = exports.printComment = exports.printText = exports.printChildren = exports.printProps = void 0;
  28568. var _escapeHTML = _interopRequireDefault(__webpack_require__(/*! ./escapeHTML */ "./packages/pretty-format/build/plugins/lib/escapeHTML.js"));
  28569. function _interopRequireDefault(obj) {
  28570. return obj && obj.__esModule ? obj : {
  28571. default: obj
  28572. };
  28573. }
  28574. /**
  28575. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  28576. *
  28577. * This source code is licensed under the MIT license found in the
  28578. * LICENSE file in the root directory of this source tree.
  28579. */
  28580. // Return empty string if keys is empty.
  28581. var printProps = function printProps(keys, props, config, indentation, depth, refs, printer) {
  28582. var indentationNext = indentation + config.indent;
  28583. var colors = config.colors;
  28584. return keys.map(function (key) {
  28585. var value = props[key];
  28586. var printed = printer(value, config, indentationNext, depth, refs);
  28587. if (typeof value !== 'string') {
  28588. if (printed.indexOf('\n') !== -1) {
  28589. printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
  28590. }
  28591. printed = '{' + printed + '}';
  28592. }
  28593. return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + '=' + colors.value.open + printed + colors.value.close;
  28594. }).join('');
  28595. }; // Return empty string if children is empty.
  28596. exports.printProps = printProps;
  28597. var printChildren = function printChildren(children, config, indentation, depth, refs, printer) {
  28598. return children.map(function (child) {
  28599. return config.spacingOuter + indentation + (typeof child === 'string' ? printText(child, config) : printer(child, config, indentation, depth, refs));
  28600. }).join('');
  28601. };
  28602. exports.printChildren = printChildren;
  28603. var printText = function printText(text, config) {
  28604. var contentColor = config.colors.content;
  28605. return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close;
  28606. };
  28607. exports.printText = printText;
  28608. var printComment = function printComment(comment, config) {
  28609. var commentColor = config.colors.comment;
  28610. return commentColor.open + '<!--' + (0, _escapeHTML.default)(comment) + '-->' + commentColor.close;
  28611. }; // Separate the functions to format props, children, and element,
  28612. // so a plugin could override a particular function, if needed.
  28613. // Too bad, so sad: the traditional (but unnecessary) space
  28614. // in a self-closing tagColor requires a second test of printedProps.
  28615. exports.printComment = printComment;
  28616. var printElement = function printElement(type, printedProps, printedChildren, config, indentation) {
  28617. var tagColor = config.colors.tag;
  28618. return tagColor.open + '<' + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? '>' + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + '</' + type : (printedProps && !config.min ? '' : ' ') + '/') + '>' + tagColor.close;
  28619. };
  28620. exports.printElement = printElement;
  28621. var printElementAsLeaf = function printElementAsLeaf(type, config) {
  28622. var tagColor = config.colors.tag;
  28623. return tagColor.open + '<' + type + tagColor.close + ' …' + tagColor.open + ' />' + tagColor.close;
  28624. };
  28625. exports.printElementAsLeaf = printElementAsLeaf;
  28626. /***/ })
  28627. /******/ });
  28628. });
  28629. //# sourceMappingURL=index.js.map