parser-postcss.js 1.9 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612
  1. module.exports = /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // identity function for calling harmony imports with the correct context
  37. /******/ __webpack_require__.i = function(value) { return value; };
  38. /******/
  39. /******/ // define getter function for harmony exports
  40. /******/ __webpack_require__.d = function(exports, name, getter) {
  41. /******/ if(!__webpack_require__.o(exports, name)) {
  42. /******/ Object.defineProperty(exports, name, {
  43. /******/ configurable: false,
  44. /******/ enumerable: true,
  45. /******/ get: getter
  46. /******/ });
  47. /******/ }
  48. /******/ };
  49. /******/
  50. /******/ // getDefaultExport function for compatibility with non-harmony modules
  51. /******/ __webpack_require__.n = function(module) {
  52. /******/ var getter = module && module.__esModule ?
  53. /******/ function getDefault() { return module['default']; } :
  54. /******/ function getModuleExports() { return module; };
  55. /******/ __webpack_require__.d(getter, 'a', getter);
  56. /******/ return getter;
  57. /******/ };
  58. /******/
  59. /******/ // Object.prototype.hasOwnProperty.call
  60. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  61. /******/
  62. /******/ // __webpack_public_path__
  63. /******/ __webpack_require__.p = "";
  64. /******/
  65. /******/ // Load entry module and return exports
  66. /******/ return __webpack_require__(__webpack_require__.s = 215);
  67. /******/ })
  68. /************************************************************************/
  69. /******/ ([
  70. /* 0 */
  71. /***/ (function(module, exports, __webpack_require__) {
  72. "use strict";
  73. var YAMLException = __webpack_require__(11);
  74. var TYPE_CONSTRUCTOR_OPTIONS = [
  75. 'kind',
  76. 'resolve',
  77. 'construct',
  78. 'instanceOf',
  79. 'predicate',
  80. 'represent',
  81. 'defaultStyle',
  82. 'styleAliases'
  83. ];
  84. var YAML_NODE_KINDS = [
  85. 'scalar',
  86. 'sequence',
  87. 'mapping'
  88. ];
  89. function compileStyleAliases(map) {
  90. var result = {};
  91. if (map !== null) {
  92. Object.keys(map).forEach(function (style) {
  93. map[style].forEach(function (alias) {
  94. result[String(alias)] = style;
  95. });
  96. });
  97. }
  98. return result;
  99. }
  100. function Type(tag, options) {
  101. options = options || {};
  102. Object.keys(options).forEach(function (name) {
  103. if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
  104. throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
  105. }
  106. });
  107. // TODO: Add tag format check.
  108. this.tag = tag;
  109. this.kind = options['kind'] || null;
  110. this.resolve = options['resolve'] || function () { return true; };
  111. this.construct = options['construct'] || function (data) { return data; };
  112. this.instanceOf = options['instanceOf'] || null;
  113. this.predicate = options['predicate'] || null;
  114. this.represent = options['represent'] || null;
  115. this.defaultStyle = options['defaultStyle'] || null;
  116. this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
  117. if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
  118. throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
  119. }
  120. }
  121. module.exports = Type;
  122. /***/ }),
  123. /* 1 */
  124. /***/ (function(module, exports, __webpack_require__) {
  125. "use strict";
  126. exports.__esModule = true;
  127. var TAG = exports.TAG = 'tag';
  128. var STRING = exports.STRING = 'string';
  129. var SELECTOR = exports.SELECTOR = 'selector';
  130. var ROOT = exports.ROOT = 'root';
  131. var PSEUDO = exports.PSEUDO = 'pseudo';
  132. var NESTING = exports.NESTING = 'nesting';
  133. var ID = exports.ID = 'id';
  134. var COMMENT = exports.COMMENT = 'comment';
  135. var COMBINATOR = exports.COMBINATOR = 'combinator';
  136. var CLASS = exports.CLASS = 'class';
  137. var ATTRIBUTE = exports.ATTRIBUTE = 'attribute';
  138. var UNIVERSAL = exports.UNIVERSAL = 'universal';
  139. /***/ }),
  140. /* 2 */
  141. /***/ (function(module, exports, __webpack_require__) {
  142. "use strict";
  143. const Node = __webpack_require__(4);
  144. class Container extends Node {
  145. constructor (opts) {
  146. super(opts);
  147. if (!this.nodes) {
  148. this.nodes = [];
  149. }
  150. }
  151. push (child) {
  152. child.parent = this;
  153. this.nodes.push(child);
  154. return this;
  155. }
  156. each (callback) {
  157. if (!this.lastEach) this.lastEach = 0;
  158. if (!this.indexes) this.indexes = { };
  159. this.lastEach += 1;
  160. let id = this.lastEach,
  161. index,
  162. result;
  163. this.indexes[id] = 0;
  164. if (!this.nodes) return undefined;
  165. while (this.indexes[id] < this.nodes.length) {
  166. index = this.indexes[id];
  167. result = callback(this.nodes[index], index);
  168. if (result === false) break;
  169. this.indexes[id] += 1;
  170. }
  171. delete this.indexes[id];
  172. return result;
  173. }
  174. walk (callback) {
  175. return this.each((child, i) => {
  176. let result = callback(child, i);
  177. if (result !== false && child.walk) {
  178. result = child.walk(callback);
  179. }
  180. return result;
  181. });
  182. }
  183. walkType (type, callback) {
  184. if (!type || !callback) {
  185. throw new Error('Parameters {type} and {callback} are required.');
  186. }
  187. // allow users to pass a constructor, or node type string; eg. Word.
  188. type = type.name && type.prototype ? type.name : type;
  189. return this.walk((node, index) => {
  190. if (node.type === type) {
  191. return callback.call(this, node, index);
  192. }
  193. });
  194. }
  195. append (node) {
  196. node.parent = this;
  197. this.nodes.push(node);
  198. return this;
  199. }
  200. prepend (node) {
  201. node.parent = this;
  202. this.nodes.unshift(node);
  203. return this;
  204. }
  205. cleanRaws (keepBetween) {
  206. super.cleanRaws(keepBetween);
  207. if (this.nodes) {
  208. for (let node of this.nodes) node.cleanRaws(keepBetween);
  209. }
  210. }
  211. insertAfter (oldNode, newNode) {
  212. let oldIndex = this.index(oldNode),
  213. index;
  214. this.nodes.splice(oldIndex + 1, 0, newNode);
  215. for (let id in this.indexes) {
  216. index = this.indexes[id];
  217. if (oldIndex <= index) {
  218. this.indexes[id] = index + this.nodes.length;
  219. }
  220. }
  221. return this;
  222. }
  223. insertBefore (oldNode, newNode) {
  224. let oldIndex = this.index(oldNode),
  225. index;
  226. this.nodes.splice(oldIndex, 0, newNode);
  227. for (let id in this.indexes) {
  228. index = this.indexes[id];
  229. if (oldIndex <= index) {
  230. this.indexes[id] = index + this.nodes.length;
  231. }
  232. }
  233. return this;
  234. }
  235. removeChild (child) {
  236. child = this.index(child);
  237. this.nodes[child].parent = undefined;
  238. this.nodes.splice(child, 1);
  239. let index;
  240. for (let id in this.indexes) {
  241. index = this.indexes[id];
  242. if (index >= child) {
  243. this.indexes[id] = index - 1;
  244. }
  245. }
  246. return this;
  247. }
  248. removeAll () {
  249. for (let node of this.nodes) node.parent = undefined;
  250. this.nodes = [];
  251. return this;
  252. }
  253. every (condition) {
  254. return this.nodes.every(condition);
  255. }
  256. some (condition) {
  257. return this.nodes.some(condition);
  258. }
  259. index (child) {
  260. if (typeof child === 'number') {
  261. return child;
  262. }
  263. else {
  264. return this.nodes.indexOf(child);
  265. }
  266. }
  267. get first () {
  268. if (!this.nodes) return undefined;
  269. return this.nodes[0];
  270. }
  271. get last () {
  272. if (!this.nodes) return undefined;
  273. return this.nodes[this.nodes.length - 1];
  274. }
  275. toString () {
  276. let result = this.nodes.map(String).join('');
  277. if (this.value) {
  278. result = this.value + result;
  279. }
  280. if (this.raws.before) {
  281. result = this.raws.before + result;
  282. }
  283. if (this.raws.after) {
  284. result += this.raws.after;
  285. }
  286. return result;
  287. }
  288. }
  289. Container.registerWalker = (constructor) => {
  290. let walkerName = 'walk' + constructor.name;
  291. // plural sugar
  292. if (walkerName.lastIndexOf('s') !== walkerName.length - 1) {
  293. walkerName += 's';
  294. }
  295. if (Container.prototype[walkerName]) {
  296. return;
  297. }
  298. // we need access to `this` so we can't use an arrow function
  299. Container.prototype[walkerName] = function (callback) {
  300. return this.walkType(constructor, callback);
  301. };
  302. };
  303. module.exports = Container;
  304. /***/ }),
  305. /* 3 */
  306. /***/ (function(module, exports, __webpack_require__) {
  307. "use strict";
  308. Object.defineProperty(exports, "__esModule", {
  309. value: true
  310. });
  311. var singleQuote = exports.singleQuote = '\''.charCodeAt(0);
  312. var doubleQuote = exports.doubleQuote = '"'.charCodeAt(0);
  313. var backslash = exports.backslash = '\\'.charCodeAt(0);
  314. var backTick = exports.backTick = '`'.charCodeAt(0);
  315. var slash = exports.slash = '/'.charCodeAt(0);
  316. var newline = exports.newline = '\n'.charCodeAt(0);
  317. var space = exports.space = ' '.charCodeAt(0);
  318. var feed = exports.feed = '\f'.charCodeAt(0);
  319. var tab = exports.tab = '\t'.charCodeAt(0);
  320. var carriageReturn = exports.carriageReturn = '\r'.charCodeAt(0);
  321. var openedParenthesis = exports.openedParenthesis = '('.charCodeAt(0);
  322. var closedParenthesis = exports.closedParenthesis = ')'.charCodeAt(0);
  323. var openedCurlyBracket = exports.openedCurlyBracket = '{'.charCodeAt(0);
  324. var closedCurlyBracket = exports.closedCurlyBracket = '}'.charCodeAt(0);
  325. var openSquareBracket = exports.openSquareBracket = '['.charCodeAt(0);
  326. var closeSquareBracket = exports.closeSquareBracket = ']'.charCodeAt(0);
  327. var semicolon = exports.semicolon = ';'.charCodeAt(0);
  328. var asterisk = exports.asterisk = '*'.charCodeAt(0);
  329. var colon = exports.colon = ':'.charCodeAt(0);
  330. var comma = exports.comma = ','.charCodeAt(0);
  331. var dot = exports.dot = '.'.charCodeAt(0);
  332. var atRule = exports.atRule = '@'.charCodeAt(0);
  333. var tilde = exports.tilde = '~'.charCodeAt(0);
  334. var hash = exports.hash = '#'.charCodeAt(0);
  335. var atEndPattern = exports.atEndPattern = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  336. var wordEndPattern = exports.wordEndPattern = /[ \n\t\r\f\(\)\{\}:,;@!'"\\\]\[#]|\/(?=\*)/g;
  337. var badBracketPattern = exports.badBracketPattern = /.[\\\/\("'\n]/;
  338. var variablePattern = exports.variablePattern = /^@[^:\(\{]+:/;
  339. var hashColorPattern = exports.hashColorPattern = /^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/;
  340. /***/ }),
  341. /* 4 */
  342. /***/ (function(module, exports, __webpack_require__) {
  343. "use strict";
  344. let cloneNode = function (obj, parent) {
  345. let cloned = new obj.constructor();
  346. for (let i in obj) {
  347. if (!obj.hasOwnProperty(i)) continue;
  348. let value = obj[i],
  349. type = typeof value;
  350. if (i === 'parent' && type === 'object') {
  351. if (parent) cloned[i] = parent;
  352. }
  353. else if (i === 'source') {
  354. cloned[i] = value;
  355. }
  356. else if (value instanceof Array) {
  357. cloned[i] = value.map(j => cloneNode(j, cloned));
  358. }
  359. else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
  360. if (type === 'object' && value !== null) value = cloneNode(value);
  361. cloned[i] = value;
  362. }
  363. }
  364. return cloned;
  365. };
  366. module.exports = class Node {
  367. constructor (defaults) {
  368. defaults = defaults || {};
  369. this.raws = { before: '', after: '' };
  370. for (let name in defaults) {
  371. this[name] = defaults[name];
  372. }
  373. }
  374. remove () {
  375. if (this.parent) {
  376. this.parent.removeChild(this);
  377. }
  378. this.parent = undefined;
  379. return this;
  380. }
  381. toString () {
  382. return [
  383. this.raws.before,
  384. String(this.value),
  385. this.raws.after
  386. ].join('');
  387. }
  388. clone (overrides) {
  389. overrides = overrides || {};
  390. let cloned = cloneNode(this);
  391. for (let name in overrides) {
  392. cloned[name] = overrides[name];
  393. }
  394. return cloned;
  395. }
  396. cloneBefore (overrides) {
  397. overrides = overrides || {};
  398. let cloned = this.clone(overrides);
  399. this.parent.insertBefore(this, cloned);
  400. return cloned;
  401. }
  402. cloneAfter (overrides) {
  403. overrides = overrides || {};
  404. let cloned = this.clone(overrides);
  405. this.parent.insertAfter(this, cloned);
  406. return cloned;
  407. }
  408. replaceWith () {
  409. let nodes = Array.prototype.slice.call(arguments);
  410. if (this.parent) {
  411. for (let node of nodes) {
  412. this.parent.insertBefore(this, node);
  413. }
  414. this.remove();
  415. }
  416. return this;
  417. }
  418. moveTo (container) {
  419. this.cleanRaws(this.root() === container.root());
  420. this.remove();
  421. container.append(this);
  422. return this;
  423. }
  424. moveBefore (node) {
  425. this.cleanRaws(this.root() === node.root());
  426. this.remove();
  427. node.parent.insertBefore(node, this);
  428. return this;
  429. }
  430. moveAfter (node) {
  431. this.cleanRaws(this.root() === node.root());
  432. this.remove();
  433. node.parent.insertAfter(node, this);
  434. return this;
  435. }
  436. next () {
  437. let index = this.parent.index(this);
  438. return this.parent.nodes[index + 1];
  439. }
  440. prev () {
  441. let index = this.parent.index(this);
  442. return this.parent.nodes[index - 1];
  443. }
  444. toJSON () {
  445. let fixed = { };
  446. for (let name in this) {
  447. if (!this.hasOwnProperty(name)) continue;
  448. if (name === 'parent') continue;
  449. let value = this[name];
  450. if (value instanceof Array) {
  451. fixed[name] = value.map(i => {
  452. if (typeof i === 'object' && i.toJSON) {
  453. return i.toJSON();
  454. }
  455. else {
  456. return i;
  457. }
  458. });
  459. }
  460. else if (typeof value === 'object' && value.toJSON) {
  461. fixed[name] = value.toJSON();
  462. }
  463. else {
  464. fixed[name] = value;
  465. }
  466. }
  467. return fixed;
  468. }
  469. root () {
  470. let result = this;
  471. while (result.parent) result = result.parent;
  472. return result;
  473. }
  474. cleanRaws (keepBetween) {
  475. delete this.raws.before;
  476. delete this.raws.after;
  477. if (!keepBetween) delete this.raws.between;
  478. }
  479. positionInside (index) {
  480. let string = this.toString(),
  481. column = this.source.start.column,
  482. line = this.source.start.line;
  483. for (let i = 0; i < index; i++) {
  484. if (string[i] === '\n') {
  485. column = 1;
  486. line += 1;
  487. }
  488. else {
  489. column += 1;
  490. }
  491. }
  492. return { line, column };
  493. }
  494. positionBy (opts) {
  495. let pos = this.source.start;
  496. if (opts.index) {
  497. pos = this.positionInside(opts.index);
  498. }
  499. else if (opts.word) {
  500. let index = this.toString().indexOf(opts.word);
  501. if (index !== -1) pos = this.positionInside(index);
  502. }
  503. return pos;
  504. }
  505. };
  506. /***/ }),
  507. /* 5 */
  508. /***/ (function(module, exports, __webpack_require__) {
  509. "use strict";
  510. exports.__esModule = true;
  511. exports.default = warnOnce;
  512. var printed = {};
  513. function warnOnce(message) {
  514. if (printed[message]) return;
  515. printed[message] = true;
  516. if (typeof console !== 'undefined' && console.warn) console.warn(message);
  517. }
  518. module.exports = exports['default'];
  519. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm4tb25jZS5lczYiXSwibmFtZXMiOlsid2Fybk9uY2UiLCJwcmludGVkIiwibWVzc2FnZSIsImNvbnNvbGUiLCJ3YXJuIl0sIm1hcHBpbmdzIjoiOzs7a0JBRXdCQSxRO0FBRnhCLElBQUlDLFVBQVUsRUFBZDs7QUFFZSxTQUFTRCxRQUFULENBQWtCRSxPQUFsQixFQUEyQjtBQUN0QyxRQUFLRCxRQUFRQyxPQUFSLENBQUwsRUFBd0I7QUFDeEJELFlBQVFDLE9BQVIsSUFBbUIsSUFBbkI7O0FBRUEsUUFBSyxPQUFPQyxPQUFQLEtBQW1CLFdBQW5CLElBQWtDQSxRQUFRQyxJQUEvQyxFQUFzREQsUUFBUUMsSUFBUixDQUFhRixPQUFiO0FBQ3pEIiwiZmlsZSI6Indhcm4tb25jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBwcmludGVkID0geyB9O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB3YXJuT25jZShtZXNzYWdlKSB7XG4gICAgaWYgKCBwcmludGVkW21lc3NhZ2VdICkgcmV0dXJuO1xuICAgIHByaW50ZWRbbWVzc2FnZV0gPSB0cnVlO1xuXG4gICAgaWYgKCB0eXBlb2YgY29uc29sZSAhPT0gJ3VuZGVmaW5lZCcgJiYgY29uc29sZS53YXJuICkgY29uc29sZS53YXJuKG1lc3NhZ2UpO1xufVxuIl19
  520. /***/ }),
  521. /* 6 */
  522. /***/ (function(module, exports, __webpack_require__) {
  523. "use strict";
  524. function isNothing(subject) {
  525. return (typeof subject === 'undefined') || (subject === null);
  526. }
  527. function isObject(subject) {
  528. return (typeof subject === 'object') && (subject !== null);
  529. }
  530. function toArray(sequence) {
  531. if (Array.isArray(sequence)) return sequence;
  532. else if (isNothing(sequence)) return [];
  533. return [ sequence ];
  534. }
  535. function extend(target, source) {
  536. var index, length, key, sourceKeys;
  537. if (source) {
  538. sourceKeys = Object.keys(source);
  539. for (index = 0, length = sourceKeys.length; index < length; index += 1) {
  540. key = sourceKeys[index];
  541. target[key] = source[key];
  542. }
  543. }
  544. return target;
  545. }
  546. function repeat(string, count) {
  547. var result = '', cycle;
  548. for (cycle = 0; cycle < count; cycle += 1) {
  549. result += string;
  550. }
  551. return result;
  552. }
  553. function isNegativeZero(number) {
  554. return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
  555. }
  556. module.exports.isNothing = isNothing;
  557. module.exports.isObject = isObject;
  558. module.exports.toArray = toArray;
  559. module.exports.repeat = repeat;
  560. module.exports.isNegativeZero = isNegativeZero;
  561. module.exports.extend = extend;
  562. /***/ }),
  563. /* 7 */
  564. /***/ (function(module, exports, __webpack_require__) {
  565. "use strict";
  566. /*eslint-disable max-len*/
  567. var common = __webpack_require__(6);
  568. var YAMLException = __webpack_require__(11);
  569. var Type = __webpack_require__(0);
  570. function compileList(schema, name, result) {
  571. var exclude = [];
  572. schema.include.forEach(function (includedSchema) {
  573. result = compileList(includedSchema, name, result);
  574. });
  575. schema[name].forEach(function (currentType) {
  576. result.forEach(function (previousType, previousIndex) {
  577. if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
  578. exclude.push(previousIndex);
  579. }
  580. });
  581. result.push(currentType);
  582. });
  583. return result.filter(function (type, index) {
  584. return exclude.indexOf(index) === -1;
  585. });
  586. }
  587. function compileMap(/* lists... */) {
  588. var result = {
  589. scalar: {},
  590. sequence: {},
  591. mapping: {},
  592. fallback: {}
  593. }, index, length;
  594. function collectType(type) {
  595. result[type.kind][type.tag] = result['fallback'][type.tag] = type;
  596. }
  597. for (index = 0, length = arguments.length; index < length; index += 1) {
  598. arguments[index].forEach(collectType);
  599. }
  600. return result;
  601. }
  602. function Schema(definition) {
  603. this.include = definition.include || [];
  604. this.implicit = definition.implicit || [];
  605. this.explicit = definition.explicit || [];
  606. this.implicit.forEach(function (type) {
  607. if (type.loadKind && type.loadKind !== 'scalar') {
  608. throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
  609. }
  610. });
  611. this.compiledImplicit = compileList(this, 'implicit', []);
  612. this.compiledExplicit = compileList(this, 'explicit', []);
  613. this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
  614. }
  615. Schema.DEFAULT = null;
  616. Schema.create = function createSchema() {
  617. var schemas, types;
  618. switch (arguments.length) {
  619. case 1:
  620. schemas = Schema.DEFAULT;
  621. types = arguments[0];
  622. break;
  623. case 2:
  624. schemas = arguments[0];
  625. types = arguments[1];
  626. break;
  627. default:
  628. throw new YAMLException('Wrong number of arguments for Schema.create function');
  629. }
  630. schemas = common.toArray(schemas);
  631. types = common.toArray(types);
  632. if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
  633. throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
  634. }
  635. if (!types.every(function (type) { return type instanceof Type; })) {
  636. throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
  637. }
  638. return new Schema({
  639. include: schemas,
  640. explicit: types
  641. });
  642. };
  643. module.exports = Schema;
  644. /***/ }),
  645. /* 8 */
  646. /***/ (function(module, exports, __webpack_require__) {
  647. /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
  648. //
  649. // Permission is hereby granted, free of charge, to any person obtaining a
  650. // copy of this software and associated documentation files (the
  651. // "Software"), to deal in the Software without restriction, including
  652. // without limitation the rights to use, copy, modify, merge, publish,
  653. // distribute, sublicense, and/or sell copies of the Software, and to permit
  654. // persons to whom the Software is furnished to do so, subject to the
  655. // following conditions:
  656. //
  657. // The above copyright notice and this permission notice shall be included
  658. // in all copies or substantial portions of the Software.
  659. //
  660. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  661. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  662. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  663. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  664. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  665. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  666. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  667. // resolves . and .. elements in a path array with directory names there
  668. // must be no slashes, empty elements, or device names (c:\) in the array
  669. // (so also no leading and trailing slashes - it does not distinguish
  670. // relative and absolute paths)
  671. function normalizeArray(parts, allowAboveRoot) {
  672. // if the path tries to go above the root, `up` ends up > 0
  673. var up = 0;
  674. for (var i = parts.length - 1; i >= 0; i--) {
  675. var last = parts[i];
  676. if (last === '.') {
  677. parts.splice(i, 1);
  678. } else if (last === '..') {
  679. parts.splice(i, 1);
  680. up++;
  681. } else if (up) {
  682. parts.splice(i, 1);
  683. up--;
  684. }
  685. }
  686. // if the path is allowed to go above the root, restore leading ..s
  687. if (allowAboveRoot) {
  688. for (; up--; up) {
  689. parts.unshift('..');
  690. }
  691. }
  692. return parts;
  693. }
  694. // Split a filename into [root, dir, basename, ext], unix version
  695. // 'root' is just a slash, or nothing.
  696. var splitPathRe =
  697. /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  698. var splitPath = function(filename) {
  699. return splitPathRe.exec(filename).slice(1);
  700. };
  701. // path.resolve([from ...], to)
  702. // posix version
  703. exports.resolve = function() {
  704. var resolvedPath = '',
  705. resolvedAbsolute = false;
  706. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  707. var path = (i >= 0) ? arguments[i] : process.cwd();
  708. // Skip empty and invalid entries
  709. if (typeof path !== 'string') {
  710. throw new TypeError('Arguments to path.resolve must be strings');
  711. } else if (!path) {
  712. continue;
  713. }
  714. resolvedPath = path + '/' + resolvedPath;
  715. resolvedAbsolute = path.charAt(0) === '/';
  716. }
  717. // At this point the path should be resolved to a full absolute path, but
  718. // handle relative paths to be safe (might happen when process.cwd() fails)
  719. // Normalize the path
  720. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  721. return !!p;
  722. }), !resolvedAbsolute).join('/');
  723. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  724. };
  725. // path.normalize(path)
  726. // posix version
  727. exports.normalize = function(path) {
  728. var isAbsolute = exports.isAbsolute(path),
  729. trailingSlash = substr(path, -1) === '/';
  730. // Normalize the path
  731. path = normalizeArray(filter(path.split('/'), function(p) {
  732. return !!p;
  733. }), !isAbsolute).join('/');
  734. if (!path && !isAbsolute) {
  735. path = '.';
  736. }
  737. if (path && trailingSlash) {
  738. path += '/';
  739. }
  740. return (isAbsolute ? '/' : '') + path;
  741. };
  742. // posix version
  743. exports.isAbsolute = function(path) {
  744. return path.charAt(0) === '/';
  745. };
  746. // posix version
  747. exports.join = function() {
  748. var paths = Array.prototype.slice.call(arguments, 0);
  749. return exports.normalize(filter(paths, function(p, index) {
  750. if (typeof p !== 'string') {
  751. throw new TypeError('Arguments to path.join must be strings');
  752. }
  753. return p;
  754. }).join('/'));
  755. };
  756. // path.relative(from, to)
  757. // posix version
  758. exports.relative = function(from, to) {
  759. from = exports.resolve(from).substr(1);
  760. to = exports.resolve(to).substr(1);
  761. function trim(arr) {
  762. var start = 0;
  763. for (; start < arr.length; start++) {
  764. if (arr[start] !== '') break;
  765. }
  766. var end = arr.length - 1;
  767. for (; end >= 0; end--) {
  768. if (arr[end] !== '') break;
  769. }
  770. if (start > end) return [];
  771. return arr.slice(start, end - start + 1);
  772. }
  773. var fromParts = trim(from.split('/'));
  774. var toParts = trim(to.split('/'));
  775. var length = Math.min(fromParts.length, toParts.length);
  776. var samePartsLength = length;
  777. for (var i = 0; i < length; i++) {
  778. if (fromParts[i] !== toParts[i]) {
  779. samePartsLength = i;
  780. break;
  781. }
  782. }
  783. var outputParts = [];
  784. for (var i = samePartsLength; i < fromParts.length; i++) {
  785. outputParts.push('..');
  786. }
  787. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  788. return outputParts.join('/');
  789. };
  790. exports.sep = '/';
  791. exports.delimiter = ':';
  792. exports.dirname = function(path) {
  793. var result = splitPath(path),
  794. root = result[0],
  795. dir = result[1];
  796. if (!root && !dir) {
  797. // No dirname whatsoever
  798. return '.';
  799. }
  800. if (dir) {
  801. // It has a dirname, strip trailing slash
  802. dir = dir.substr(0, dir.length - 1);
  803. }
  804. return root + dir;
  805. };
  806. exports.basename = function(path, ext) {
  807. var f = splitPath(path)[2];
  808. // TODO: make this comparison case-insensitive on windows?
  809. if (ext && f.substr(-1 * ext.length) === ext) {
  810. f = f.substr(0, f.length - ext.length);
  811. }
  812. return f;
  813. };
  814. exports.extname = function(path) {
  815. return splitPath(path)[3];
  816. };
  817. function filter (xs, f) {
  818. if (xs.filter) return xs.filter(f);
  819. var res = [];
  820. for (var i = 0; i < xs.length; i++) {
  821. if (f(xs[i], i, xs)) res.push(xs[i]);
  822. }
  823. return res;
  824. }
  825. // String.prototype.substr - negative index don't work in IE8
  826. var substr = 'ab'.substr(-1) === 'b'
  827. ? function (str, start, len) { return str.substr(start, len) }
  828. : function (str, start, len) {
  829. if (start < 0) start = str.length + start;
  830. return str.substr(start, len);
  831. }
  832. ;
  833. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(23)))
  834. /***/ }),
  835. /* 9 */
  836. /***/ (function(module, exports, __webpack_require__) {
  837. "use strict";
  838. exports.__esModule = true;
  839. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  840. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  841. var cloneNode = function cloneNode(obj, parent) {
  842. if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') {
  843. return obj;
  844. }
  845. var cloned = new obj.constructor();
  846. for (var i in obj) {
  847. if (!obj.hasOwnProperty(i)) {
  848. continue;
  849. }
  850. var value = obj[i];
  851. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  852. if (i === 'parent' && type === 'object') {
  853. if (parent) {
  854. cloned[i] = parent;
  855. }
  856. } else if (value instanceof Array) {
  857. cloned[i] = value.map(function (j) {
  858. return cloneNode(j, cloned);
  859. });
  860. } else {
  861. cloned[i] = cloneNode(value, cloned);
  862. }
  863. }
  864. return cloned;
  865. };
  866. var _class = function () {
  867. function _class() {
  868. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  869. _classCallCheck(this, _class);
  870. for (var key in opts) {
  871. this[key] = opts[key];
  872. }
  873. var _opts$spaces = opts.spaces;
  874. _opts$spaces = _opts$spaces === undefined ? {} : _opts$spaces;
  875. var _opts$spaces$before = _opts$spaces.before,
  876. before = _opts$spaces$before === undefined ? '' : _opts$spaces$before,
  877. _opts$spaces$after = _opts$spaces.after,
  878. after = _opts$spaces$after === undefined ? '' : _opts$spaces$after;
  879. this.spaces = { before: before, after: after };
  880. }
  881. _class.prototype.remove = function remove() {
  882. if (this.parent) {
  883. this.parent.removeChild(this);
  884. }
  885. this.parent = undefined;
  886. return this;
  887. };
  888. _class.prototype.replaceWith = function replaceWith() {
  889. if (this.parent) {
  890. for (var index in arguments) {
  891. this.parent.insertBefore(this, arguments[index]);
  892. }
  893. this.remove();
  894. }
  895. return this;
  896. };
  897. _class.prototype.next = function next() {
  898. return this.parent.at(this.parent.index(this) + 1);
  899. };
  900. _class.prototype.prev = function prev() {
  901. return this.parent.at(this.parent.index(this) - 1);
  902. };
  903. _class.prototype.clone = function clone() {
  904. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  905. var cloned = cloneNode(this);
  906. for (var name in overrides) {
  907. cloned[name] = overrides[name];
  908. }
  909. return cloned;
  910. };
  911. _class.prototype.toString = function toString() {
  912. return [this.spaces.before, String(this.value), this.spaces.after].join('');
  913. };
  914. return _class;
  915. }();
  916. exports.default = _class;
  917. module.exports = exports['default'];
  918. /***/ }),
  919. /* 10 */
  920. /***/ (function(module, exports, __webpack_require__) {
  921. "use strict";
  922. /* WEBPACK VAR INJECTION */(function(global) {/*!
  923. * The buffer module from node.js, for the browser.
  924. *
  925. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  926. * @license MIT
  927. */
  928. /* eslint-disable no-proto */
  929. var base64 = __webpack_require__(112)
  930. var ieee754 = __webpack_require__(119)
  931. var isArray = __webpack_require__(121)
  932. exports.Buffer = Buffer
  933. exports.SlowBuffer = SlowBuffer
  934. exports.INSPECT_MAX_BYTES = 50
  935. /**
  936. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  937. * === true Use Uint8Array implementation (fastest)
  938. * === false Use Object implementation (most compatible, even IE6)
  939. *
  940. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  941. * Opera 11.6+, iOS 4.2+.
  942. *
  943. * Due to various browser bugs, sometimes the Object implementation will be used even
  944. * when the browser supports typed arrays.
  945. *
  946. * Note:
  947. *
  948. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  949. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  950. *
  951. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  952. *
  953. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  954. * incorrect length in some situations.
  955. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  956. * get the Object implementation, which is slower but behaves correctly.
  957. */
  958. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  959. ? global.TYPED_ARRAY_SUPPORT
  960. : typedArraySupport()
  961. /*
  962. * Export kMaxLength after typed array support is determined.
  963. */
  964. exports.kMaxLength = kMaxLength()
  965. function typedArraySupport () {
  966. try {
  967. var arr = new Uint8Array(1)
  968. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  969. return arr.foo() === 42 && // typed array instances can be augmented
  970. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  971. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  972. } catch (e) {
  973. return false
  974. }
  975. }
  976. function kMaxLength () {
  977. return Buffer.TYPED_ARRAY_SUPPORT
  978. ? 0x7fffffff
  979. : 0x3fffffff
  980. }
  981. function createBuffer (that, length) {
  982. if (kMaxLength() < length) {
  983. throw new RangeError('Invalid typed array length')
  984. }
  985. if (Buffer.TYPED_ARRAY_SUPPORT) {
  986. // Return an augmented `Uint8Array` instance, for best performance
  987. that = new Uint8Array(length)
  988. that.__proto__ = Buffer.prototype
  989. } else {
  990. // Fallback: Return an object instance of the Buffer class
  991. if (that === null) {
  992. that = new Buffer(length)
  993. }
  994. that.length = length
  995. }
  996. return that
  997. }
  998. /**
  999. * The Buffer constructor returns instances of `Uint8Array` that have their
  1000. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  1001. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  1002. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  1003. * returns a single octet.
  1004. *
  1005. * The `Uint8Array` prototype remains unmodified.
  1006. */
  1007. function Buffer (arg, encodingOrOffset, length) {
  1008. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  1009. return new Buffer(arg, encodingOrOffset, length)
  1010. }
  1011. // Common case.
  1012. if (typeof arg === 'number') {
  1013. if (typeof encodingOrOffset === 'string') {
  1014. throw new Error(
  1015. 'If encoding is specified then the first argument must be a string'
  1016. )
  1017. }
  1018. return allocUnsafe(this, arg)
  1019. }
  1020. return from(this, arg, encodingOrOffset, length)
  1021. }
  1022. Buffer.poolSize = 8192 // not used by this implementation
  1023. // TODO: Legacy, not needed anymore. Remove in next major version.
  1024. Buffer._augment = function (arr) {
  1025. arr.__proto__ = Buffer.prototype
  1026. return arr
  1027. }
  1028. function from (that, value, encodingOrOffset, length) {
  1029. if (typeof value === 'number') {
  1030. throw new TypeError('"value" argument must not be a number')
  1031. }
  1032. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  1033. return fromArrayBuffer(that, value, encodingOrOffset, length)
  1034. }
  1035. if (typeof value === 'string') {
  1036. return fromString(that, value, encodingOrOffset)
  1037. }
  1038. return fromObject(that, value)
  1039. }
  1040. /**
  1041. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  1042. * if value is a number.
  1043. * Buffer.from(str[, encoding])
  1044. * Buffer.from(array)
  1045. * Buffer.from(buffer)
  1046. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  1047. **/
  1048. Buffer.from = function (value, encodingOrOffset, length) {
  1049. return from(null, value, encodingOrOffset, length)
  1050. }
  1051. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1052. Buffer.prototype.__proto__ = Uint8Array.prototype
  1053. Buffer.__proto__ = Uint8Array
  1054. if (typeof Symbol !== 'undefined' && Symbol.species &&
  1055. Buffer[Symbol.species] === Buffer) {
  1056. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  1057. Object.defineProperty(Buffer, Symbol.species, {
  1058. value: null,
  1059. configurable: true
  1060. })
  1061. }
  1062. }
  1063. function assertSize (size) {
  1064. if (typeof size !== 'number') {
  1065. throw new TypeError('"size" argument must be a number')
  1066. } else if (size < 0) {
  1067. throw new RangeError('"size" argument must not be negative')
  1068. }
  1069. }
  1070. function alloc (that, size, fill, encoding) {
  1071. assertSize(size)
  1072. if (size <= 0) {
  1073. return createBuffer(that, size)
  1074. }
  1075. if (fill !== undefined) {
  1076. // Only pay attention to encoding if it's a string. This
  1077. // prevents accidentally sending in a number that would
  1078. // be interpretted as a start offset.
  1079. return typeof encoding === 'string'
  1080. ? createBuffer(that, size).fill(fill, encoding)
  1081. : createBuffer(that, size).fill(fill)
  1082. }
  1083. return createBuffer(that, size)
  1084. }
  1085. /**
  1086. * Creates a new filled Buffer instance.
  1087. * alloc(size[, fill[, encoding]])
  1088. **/
  1089. Buffer.alloc = function (size, fill, encoding) {
  1090. return alloc(null, size, fill, encoding)
  1091. }
  1092. function allocUnsafe (that, size) {
  1093. assertSize(size)
  1094. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  1095. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  1096. for (var i = 0; i < size; ++i) {
  1097. that[i] = 0
  1098. }
  1099. }
  1100. return that
  1101. }
  1102. /**
  1103. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  1104. * */
  1105. Buffer.allocUnsafe = function (size) {
  1106. return allocUnsafe(null, size)
  1107. }
  1108. /**
  1109. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  1110. */
  1111. Buffer.allocUnsafeSlow = function (size) {
  1112. return allocUnsafe(null, size)
  1113. }
  1114. function fromString (that, string, encoding) {
  1115. if (typeof encoding !== 'string' || encoding === '') {
  1116. encoding = 'utf8'
  1117. }
  1118. if (!Buffer.isEncoding(encoding)) {
  1119. throw new TypeError('"encoding" must be a valid string encoding')
  1120. }
  1121. var length = byteLength(string, encoding) | 0
  1122. that = createBuffer(that, length)
  1123. var actual = that.write(string, encoding)
  1124. if (actual !== length) {
  1125. // Writing a hex string, for example, that contains invalid characters will
  1126. // cause everything after the first invalid character to be ignored. (e.g.
  1127. // 'abxxcd' will be treated as 'ab')
  1128. that = that.slice(0, actual)
  1129. }
  1130. return that
  1131. }
  1132. function fromArrayLike (that, array) {
  1133. var length = array.length < 0 ? 0 : checked(array.length) | 0
  1134. that = createBuffer(that, length)
  1135. for (var i = 0; i < length; i += 1) {
  1136. that[i] = array[i] & 255
  1137. }
  1138. return that
  1139. }
  1140. function fromArrayBuffer (that, array, byteOffset, length) {
  1141. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  1142. if (byteOffset < 0 || array.byteLength < byteOffset) {
  1143. throw new RangeError('\'offset\' is out of bounds')
  1144. }
  1145. if (array.byteLength < byteOffset + (length || 0)) {
  1146. throw new RangeError('\'length\' is out of bounds')
  1147. }
  1148. if (byteOffset === undefined && length === undefined) {
  1149. array = new Uint8Array(array)
  1150. } else if (length === undefined) {
  1151. array = new Uint8Array(array, byteOffset)
  1152. } else {
  1153. array = new Uint8Array(array, byteOffset, length)
  1154. }
  1155. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1156. // Return an augmented `Uint8Array` instance, for best performance
  1157. that = array
  1158. that.__proto__ = Buffer.prototype
  1159. } else {
  1160. // Fallback: Return an object instance of the Buffer class
  1161. that = fromArrayLike(that, array)
  1162. }
  1163. return that
  1164. }
  1165. function fromObject (that, obj) {
  1166. if (Buffer.isBuffer(obj)) {
  1167. var len = checked(obj.length) | 0
  1168. that = createBuffer(that, len)
  1169. if (that.length === 0) {
  1170. return that
  1171. }
  1172. obj.copy(that, 0, 0, len)
  1173. return that
  1174. }
  1175. if (obj) {
  1176. if ((typeof ArrayBuffer !== 'undefined' &&
  1177. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  1178. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  1179. return createBuffer(that, 0)
  1180. }
  1181. return fromArrayLike(that, obj)
  1182. }
  1183. if (obj.type === 'Buffer' && isArray(obj.data)) {
  1184. return fromArrayLike(that, obj.data)
  1185. }
  1186. }
  1187. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  1188. }
  1189. function checked (length) {
  1190. // Note: cannot use `length < kMaxLength()` here because that fails when
  1191. // length is NaN (which is otherwise coerced to zero.)
  1192. if (length >= kMaxLength()) {
  1193. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  1194. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  1195. }
  1196. return length | 0
  1197. }
  1198. function SlowBuffer (length) {
  1199. if (+length != length) { // eslint-disable-line eqeqeq
  1200. length = 0
  1201. }
  1202. return Buffer.alloc(+length)
  1203. }
  1204. Buffer.isBuffer = function isBuffer (b) {
  1205. return !!(b != null && b._isBuffer)
  1206. }
  1207. Buffer.compare = function compare (a, b) {
  1208. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  1209. throw new TypeError('Arguments must be Buffers')
  1210. }
  1211. if (a === b) return 0
  1212. var x = a.length
  1213. var y = b.length
  1214. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  1215. if (a[i] !== b[i]) {
  1216. x = a[i]
  1217. y = b[i]
  1218. break
  1219. }
  1220. }
  1221. if (x < y) return -1
  1222. if (y < x) return 1
  1223. return 0
  1224. }
  1225. Buffer.isEncoding = function isEncoding (encoding) {
  1226. switch (String(encoding).toLowerCase()) {
  1227. case 'hex':
  1228. case 'utf8':
  1229. case 'utf-8':
  1230. case 'ascii':
  1231. case 'latin1':
  1232. case 'binary':
  1233. case 'base64':
  1234. case 'ucs2':
  1235. case 'ucs-2':
  1236. case 'utf16le':
  1237. case 'utf-16le':
  1238. return true
  1239. default:
  1240. return false
  1241. }
  1242. }
  1243. Buffer.concat = function concat (list, length) {
  1244. if (!isArray(list)) {
  1245. throw new TypeError('"list" argument must be an Array of Buffers')
  1246. }
  1247. if (list.length === 0) {
  1248. return Buffer.alloc(0)
  1249. }
  1250. var i
  1251. if (length === undefined) {
  1252. length = 0
  1253. for (i = 0; i < list.length; ++i) {
  1254. length += list[i].length
  1255. }
  1256. }
  1257. var buffer = Buffer.allocUnsafe(length)
  1258. var pos = 0
  1259. for (i = 0; i < list.length; ++i) {
  1260. var buf = list[i]
  1261. if (!Buffer.isBuffer(buf)) {
  1262. throw new TypeError('"list" argument must be an Array of Buffers')
  1263. }
  1264. buf.copy(buffer, pos)
  1265. pos += buf.length
  1266. }
  1267. return buffer
  1268. }
  1269. function byteLength (string, encoding) {
  1270. if (Buffer.isBuffer(string)) {
  1271. return string.length
  1272. }
  1273. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  1274. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  1275. return string.byteLength
  1276. }
  1277. if (typeof string !== 'string') {
  1278. string = '' + string
  1279. }
  1280. var len = string.length
  1281. if (len === 0) return 0
  1282. // Use a for loop to avoid recursion
  1283. var loweredCase = false
  1284. for (;;) {
  1285. switch (encoding) {
  1286. case 'ascii':
  1287. case 'latin1':
  1288. case 'binary':
  1289. return len
  1290. case 'utf8':
  1291. case 'utf-8':
  1292. case undefined:
  1293. return utf8ToBytes(string).length
  1294. case 'ucs2':
  1295. case 'ucs-2':
  1296. case 'utf16le':
  1297. case 'utf-16le':
  1298. return len * 2
  1299. case 'hex':
  1300. return len >>> 1
  1301. case 'base64':
  1302. return base64ToBytes(string).length
  1303. default:
  1304. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  1305. encoding = ('' + encoding).toLowerCase()
  1306. loweredCase = true
  1307. }
  1308. }
  1309. }
  1310. Buffer.byteLength = byteLength
  1311. function slowToString (encoding, start, end) {
  1312. var loweredCase = false
  1313. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  1314. // property of a typed array.
  1315. // This behaves neither like String nor Uint8Array in that we set start/end
  1316. // to their upper/lower bounds if the value passed is out of range.
  1317. // undefined is handled specially as per ECMA-262 6th Edition,
  1318. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  1319. if (start === undefined || start < 0) {
  1320. start = 0
  1321. }
  1322. // Return early if start > this.length. Done here to prevent potential uint32
  1323. // coercion fail below.
  1324. if (start > this.length) {
  1325. return ''
  1326. }
  1327. if (end === undefined || end > this.length) {
  1328. end = this.length
  1329. }
  1330. if (end <= 0) {
  1331. return ''
  1332. }
  1333. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  1334. end >>>= 0
  1335. start >>>= 0
  1336. if (end <= start) {
  1337. return ''
  1338. }
  1339. if (!encoding) encoding = 'utf8'
  1340. while (true) {
  1341. switch (encoding) {
  1342. case 'hex':
  1343. return hexSlice(this, start, end)
  1344. case 'utf8':
  1345. case 'utf-8':
  1346. return utf8Slice(this, start, end)
  1347. case 'ascii':
  1348. return asciiSlice(this, start, end)
  1349. case 'latin1':
  1350. case 'binary':
  1351. return latin1Slice(this, start, end)
  1352. case 'base64':
  1353. return base64Slice(this, start, end)
  1354. case 'ucs2':
  1355. case 'ucs-2':
  1356. case 'utf16le':
  1357. case 'utf-16le':
  1358. return utf16leSlice(this, start, end)
  1359. default:
  1360. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  1361. encoding = (encoding + '').toLowerCase()
  1362. loweredCase = true
  1363. }
  1364. }
  1365. }
  1366. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  1367. // Buffer instances.
  1368. Buffer.prototype._isBuffer = true
  1369. function swap (b, n, m) {
  1370. var i = b[n]
  1371. b[n] = b[m]
  1372. b[m] = i
  1373. }
  1374. Buffer.prototype.swap16 = function swap16 () {
  1375. var len = this.length
  1376. if (len % 2 !== 0) {
  1377. throw new RangeError('Buffer size must be a multiple of 16-bits')
  1378. }
  1379. for (var i = 0; i < len; i += 2) {
  1380. swap(this, i, i + 1)
  1381. }
  1382. return this
  1383. }
  1384. Buffer.prototype.swap32 = function swap32 () {
  1385. var len = this.length
  1386. if (len % 4 !== 0) {
  1387. throw new RangeError('Buffer size must be a multiple of 32-bits')
  1388. }
  1389. for (var i = 0; i < len; i += 4) {
  1390. swap(this, i, i + 3)
  1391. swap(this, i + 1, i + 2)
  1392. }
  1393. return this
  1394. }
  1395. Buffer.prototype.swap64 = function swap64 () {
  1396. var len = this.length
  1397. if (len % 8 !== 0) {
  1398. throw new RangeError('Buffer size must be a multiple of 64-bits')
  1399. }
  1400. for (var i = 0; i < len; i += 8) {
  1401. swap(this, i, i + 7)
  1402. swap(this, i + 1, i + 6)
  1403. swap(this, i + 2, i + 5)
  1404. swap(this, i + 3, i + 4)
  1405. }
  1406. return this
  1407. }
  1408. Buffer.prototype.toString = function toString () {
  1409. var length = this.length | 0
  1410. if (length === 0) return ''
  1411. if (arguments.length === 0) return utf8Slice(this, 0, length)
  1412. return slowToString.apply(this, arguments)
  1413. }
  1414. Buffer.prototype.equals = function equals (b) {
  1415. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  1416. if (this === b) return true
  1417. return Buffer.compare(this, b) === 0
  1418. }
  1419. Buffer.prototype.inspect = function inspect () {
  1420. var str = ''
  1421. var max = exports.INSPECT_MAX_BYTES
  1422. if (this.length > 0) {
  1423. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  1424. if (this.length > max) str += ' ... '
  1425. }
  1426. return '<Buffer ' + str + '>'
  1427. }
  1428. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  1429. if (!Buffer.isBuffer(target)) {
  1430. throw new TypeError('Argument must be a Buffer')
  1431. }
  1432. if (start === undefined) {
  1433. start = 0
  1434. }
  1435. if (end === undefined) {
  1436. end = target ? target.length : 0
  1437. }
  1438. if (thisStart === undefined) {
  1439. thisStart = 0
  1440. }
  1441. if (thisEnd === undefined) {
  1442. thisEnd = this.length
  1443. }
  1444. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  1445. throw new RangeError('out of range index')
  1446. }
  1447. if (thisStart >= thisEnd && start >= end) {
  1448. return 0
  1449. }
  1450. if (thisStart >= thisEnd) {
  1451. return -1
  1452. }
  1453. if (start >= end) {
  1454. return 1
  1455. }
  1456. start >>>= 0
  1457. end >>>= 0
  1458. thisStart >>>= 0
  1459. thisEnd >>>= 0
  1460. if (this === target) return 0
  1461. var x = thisEnd - thisStart
  1462. var y = end - start
  1463. var len = Math.min(x, y)
  1464. var thisCopy = this.slice(thisStart, thisEnd)
  1465. var targetCopy = target.slice(start, end)
  1466. for (var i = 0; i < len; ++i) {
  1467. if (thisCopy[i] !== targetCopy[i]) {
  1468. x = thisCopy[i]
  1469. y = targetCopy[i]
  1470. break
  1471. }
  1472. }
  1473. if (x < y) return -1
  1474. if (y < x) return 1
  1475. return 0
  1476. }
  1477. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  1478. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  1479. //
  1480. // Arguments:
  1481. // - buffer - a Buffer to search
  1482. // - val - a string, Buffer, or number
  1483. // - byteOffset - an index into `buffer`; will be clamped to an int32
  1484. // - encoding - an optional encoding, relevant is val is a string
  1485. // - dir - true for indexOf, false for lastIndexOf
  1486. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  1487. // Empty buffer means no match
  1488. if (buffer.length === 0) return -1
  1489. // Normalize byteOffset
  1490. if (typeof byteOffset === 'string') {
  1491. encoding = byteOffset
  1492. byteOffset = 0
  1493. } else if (byteOffset > 0x7fffffff) {
  1494. byteOffset = 0x7fffffff
  1495. } else if (byteOffset < -0x80000000) {
  1496. byteOffset = -0x80000000
  1497. }
  1498. byteOffset = +byteOffset // Coerce to Number.
  1499. if (isNaN(byteOffset)) {
  1500. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  1501. byteOffset = dir ? 0 : (buffer.length - 1)
  1502. }
  1503. // Normalize byteOffset: negative offsets start from the end of the buffer
  1504. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  1505. if (byteOffset >= buffer.length) {
  1506. if (dir) return -1
  1507. else byteOffset = buffer.length - 1
  1508. } else if (byteOffset < 0) {
  1509. if (dir) byteOffset = 0
  1510. else return -1
  1511. }
  1512. // Normalize val
  1513. if (typeof val === 'string') {
  1514. val = Buffer.from(val, encoding)
  1515. }
  1516. // Finally, search either indexOf (if dir is true) or lastIndexOf
  1517. if (Buffer.isBuffer(val)) {
  1518. // Special case: looking for empty string/buffer always fails
  1519. if (val.length === 0) {
  1520. return -1
  1521. }
  1522. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  1523. } else if (typeof val === 'number') {
  1524. val = val & 0xFF // Search for a byte value [0-255]
  1525. if (Buffer.TYPED_ARRAY_SUPPORT &&
  1526. typeof Uint8Array.prototype.indexOf === 'function') {
  1527. if (dir) {
  1528. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  1529. } else {
  1530. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  1531. }
  1532. }
  1533. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  1534. }
  1535. throw new TypeError('val must be string, number or Buffer')
  1536. }
  1537. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  1538. var indexSize = 1
  1539. var arrLength = arr.length
  1540. var valLength = val.length
  1541. if (encoding !== undefined) {
  1542. encoding = String(encoding).toLowerCase()
  1543. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  1544. encoding === 'utf16le' || encoding === 'utf-16le') {
  1545. if (arr.length < 2 || val.length < 2) {
  1546. return -1
  1547. }
  1548. indexSize = 2
  1549. arrLength /= 2
  1550. valLength /= 2
  1551. byteOffset /= 2
  1552. }
  1553. }
  1554. function read (buf, i) {
  1555. if (indexSize === 1) {
  1556. return buf[i]
  1557. } else {
  1558. return buf.readUInt16BE(i * indexSize)
  1559. }
  1560. }
  1561. var i
  1562. if (dir) {
  1563. var foundIndex = -1
  1564. for (i = byteOffset; i < arrLength; i++) {
  1565. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  1566. if (foundIndex === -1) foundIndex = i
  1567. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  1568. } else {
  1569. if (foundIndex !== -1) i -= i - foundIndex
  1570. foundIndex = -1
  1571. }
  1572. }
  1573. } else {
  1574. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  1575. for (i = byteOffset; i >= 0; i--) {
  1576. var found = true
  1577. for (var j = 0; j < valLength; j++) {
  1578. if (read(arr, i + j) !== read(val, j)) {
  1579. found = false
  1580. break
  1581. }
  1582. }
  1583. if (found) return i
  1584. }
  1585. }
  1586. return -1
  1587. }
  1588. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  1589. return this.indexOf(val, byteOffset, encoding) !== -1
  1590. }
  1591. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  1592. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  1593. }
  1594. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  1595. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  1596. }
  1597. function hexWrite (buf, string, offset, length) {
  1598. offset = Number(offset) || 0
  1599. var remaining = buf.length - offset
  1600. if (!length) {
  1601. length = remaining
  1602. } else {
  1603. length = Number(length)
  1604. if (length > remaining) {
  1605. length = remaining
  1606. }
  1607. }
  1608. // must be an even number of digits
  1609. var strLen = string.length
  1610. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  1611. if (length > strLen / 2) {
  1612. length = strLen / 2
  1613. }
  1614. for (var i = 0; i < length; ++i) {
  1615. var parsed = parseInt(string.substr(i * 2, 2), 16)
  1616. if (isNaN(parsed)) return i
  1617. buf[offset + i] = parsed
  1618. }
  1619. return i
  1620. }
  1621. function utf8Write (buf, string, offset, length) {
  1622. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  1623. }
  1624. function asciiWrite (buf, string, offset, length) {
  1625. return blitBuffer(asciiToBytes(string), buf, offset, length)
  1626. }
  1627. function latin1Write (buf, string, offset, length) {
  1628. return asciiWrite(buf, string, offset, length)
  1629. }
  1630. function base64Write (buf, string, offset, length) {
  1631. return blitBuffer(base64ToBytes(string), buf, offset, length)
  1632. }
  1633. function ucs2Write (buf, string, offset, length) {
  1634. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  1635. }
  1636. Buffer.prototype.write = function write (string, offset, length, encoding) {
  1637. // Buffer#write(string)
  1638. if (offset === undefined) {
  1639. encoding = 'utf8'
  1640. length = this.length
  1641. offset = 0
  1642. // Buffer#write(string, encoding)
  1643. } else if (length === undefined && typeof offset === 'string') {
  1644. encoding = offset
  1645. length = this.length
  1646. offset = 0
  1647. // Buffer#write(string, offset[, length][, encoding])
  1648. } else if (isFinite(offset)) {
  1649. offset = offset | 0
  1650. if (isFinite(length)) {
  1651. length = length | 0
  1652. if (encoding === undefined) encoding = 'utf8'
  1653. } else {
  1654. encoding = length
  1655. length = undefined
  1656. }
  1657. // legacy write(string, encoding, offset, length) - remove in v0.13
  1658. } else {
  1659. throw new Error(
  1660. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  1661. )
  1662. }
  1663. var remaining = this.length - offset
  1664. if (length === undefined || length > remaining) length = remaining
  1665. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  1666. throw new RangeError('Attempt to write outside buffer bounds')
  1667. }
  1668. if (!encoding) encoding = 'utf8'
  1669. var loweredCase = false
  1670. for (;;) {
  1671. switch (encoding) {
  1672. case 'hex':
  1673. return hexWrite(this, string, offset, length)
  1674. case 'utf8':
  1675. case 'utf-8':
  1676. return utf8Write(this, string, offset, length)
  1677. case 'ascii':
  1678. return asciiWrite(this, string, offset, length)
  1679. case 'latin1':
  1680. case 'binary':
  1681. return latin1Write(this, string, offset, length)
  1682. case 'base64':
  1683. // Warning: maxLength not taken into account in base64Write
  1684. return base64Write(this, string, offset, length)
  1685. case 'ucs2':
  1686. case 'ucs-2':
  1687. case 'utf16le':
  1688. case 'utf-16le':
  1689. return ucs2Write(this, string, offset, length)
  1690. default:
  1691. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  1692. encoding = ('' + encoding).toLowerCase()
  1693. loweredCase = true
  1694. }
  1695. }
  1696. }
  1697. Buffer.prototype.toJSON = function toJSON () {
  1698. return {
  1699. type: 'Buffer',
  1700. data: Array.prototype.slice.call(this._arr || this, 0)
  1701. }
  1702. }
  1703. function base64Slice (buf, start, end) {
  1704. if (start === 0 && end === buf.length) {
  1705. return base64.fromByteArray(buf)
  1706. } else {
  1707. return base64.fromByteArray(buf.slice(start, end))
  1708. }
  1709. }
  1710. function utf8Slice (buf, start, end) {
  1711. end = Math.min(buf.length, end)
  1712. var res = []
  1713. var i = start
  1714. while (i < end) {
  1715. var firstByte = buf[i]
  1716. var codePoint = null
  1717. var bytesPerSequence = (firstByte > 0xEF) ? 4
  1718. : (firstByte > 0xDF) ? 3
  1719. : (firstByte > 0xBF) ? 2
  1720. : 1
  1721. if (i + bytesPerSequence <= end) {
  1722. var secondByte, thirdByte, fourthByte, tempCodePoint
  1723. switch (bytesPerSequence) {
  1724. case 1:
  1725. if (firstByte < 0x80) {
  1726. codePoint = firstByte
  1727. }
  1728. break
  1729. case 2:
  1730. secondByte = buf[i + 1]
  1731. if ((secondByte & 0xC0) === 0x80) {
  1732. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  1733. if (tempCodePoint > 0x7F) {
  1734. codePoint = tempCodePoint
  1735. }
  1736. }
  1737. break
  1738. case 3:
  1739. secondByte = buf[i + 1]
  1740. thirdByte = buf[i + 2]
  1741. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  1742. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  1743. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  1744. codePoint = tempCodePoint
  1745. }
  1746. }
  1747. break
  1748. case 4:
  1749. secondByte = buf[i + 1]
  1750. thirdByte = buf[i + 2]
  1751. fourthByte = buf[i + 3]
  1752. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  1753. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  1754. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  1755. codePoint = tempCodePoint
  1756. }
  1757. }
  1758. }
  1759. }
  1760. if (codePoint === null) {
  1761. // we did not generate a valid codePoint so insert a
  1762. // replacement char (U+FFFD) and advance only 1 byte
  1763. codePoint = 0xFFFD
  1764. bytesPerSequence = 1
  1765. } else if (codePoint > 0xFFFF) {
  1766. // encode to utf16 (surrogate pair dance)
  1767. codePoint -= 0x10000
  1768. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  1769. codePoint = 0xDC00 | codePoint & 0x3FF
  1770. }
  1771. res.push(codePoint)
  1772. i += bytesPerSequence
  1773. }
  1774. return decodeCodePointsArray(res)
  1775. }
  1776. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  1777. // the lowest limit is Chrome, with 0x10000 args.
  1778. // We go 1 magnitude less, for safety
  1779. var MAX_ARGUMENTS_LENGTH = 0x1000
  1780. function decodeCodePointsArray (codePoints) {
  1781. var len = codePoints.length
  1782. if (len <= MAX_ARGUMENTS_LENGTH) {
  1783. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  1784. }
  1785. // Decode in chunks to avoid "call stack size exceeded".
  1786. var res = ''
  1787. var i = 0
  1788. while (i < len) {
  1789. res += String.fromCharCode.apply(
  1790. String,
  1791. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  1792. )
  1793. }
  1794. return res
  1795. }
  1796. function asciiSlice (buf, start, end) {
  1797. var ret = ''
  1798. end = Math.min(buf.length, end)
  1799. for (var i = start; i < end; ++i) {
  1800. ret += String.fromCharCode(buf[i] & 0x7F)
  1801. }
  1802. return ret
  1803. }
  1804. function latin1Slice (buf, start, end) {
  1805. var ret = ''
  1806. end = Math.min(buf.length, end)
  1807. for (var i = start; i < end; ++i) {
  1808. ret += String.fromCharCode(buf[i])
  1809. }
  1810. return ret
  1811. }
  1812. function hexSlice (buf, start, end) {
  1813. var len = buf.length
  1814. if (!start || start < 0) start = 0
  1815. if (!end || end < 0 || end > len) end = len
  1816. var out = ''
  1817. for (var i = start; i < end; ++i) {
  1818. out += toHex(buf[i])
  1819. }
  1820. return out
  1821. }
  1822. function utf16leSlice (buf, start, end) {
  1823. var bytes = buf.slice(start, end)
  1824. var res = ''
  1825. for (var i = 0; i < bytes.length; i += 2) {
  1826. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  1827. }
  1828. return res
  1829. }
  1830. Buffer.prototype.slice = function slice (start, end) {
  1831. var len = this.length
  1832. start = ~~start
  1833. end = end === undefined ? len : ~~end
  1834. if (start < 0) {
  1835. start += len
  1836. if (start < 0) start = 0
  1837. } else if (start > len) {
  1838. start = len
  1839. }
  1840. if (end < 0) {
  1841. end += len
  1842. if (end < 0) end = 0
  1843. } else if (end > len) {
  1844. end = len
  1845. }
  1846. if (end < start) end = start
  1847. var newBuf
  1848. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1849. newBuf = this.subarray(start, end)
  1850. newBuf.__proto__ = Buffer.prototype
  1851. } else {
  1852. var sliceLen = end - start
  1853. newBuf = new Buffer(sliceLen, undefined)
  1854. for (var i = 0; i < sliceLen; ++i) {
  1855. newBuf[i] = this[i + start]
  1856. }
  1857. }
  1858. return newBuf
  1859. }
  1860. /*
  1861. * Need to make sure that buffer isn't trying to write out of bounds.
  1862. */
  1863. function checkOffset (offset, ext, length) {
  1864. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  1865. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  1866. }
  1867. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  1868. offset = offset | 0
  1869. byteLength = byteLength | 0
  1870. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1871. var val = this[offset]
  1872. var mul = 1
  1873. var i = 0
  1874. while (++i < byteLength && (mul *= 0x100)) {
  1875. val += this[offset + i] * mul
  1876. }
  1877. return val
  1878. }
  1879. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  1880. offset = offset | 0
  1881. byteLength = byteLength | 0
  1882. if (!noAssert) {
  1883. checkOffset(offset, byteLength, this.length)
  1884. }
  1885. var val = this[offset + --byteLength]
  1886. var mul = 1
  1887. while (byteLength > 0 && (mul *= 0x100)) {
  1888. val += this[offset + --byteLength] * mul
  1889. }
  1890. return val
  1891. }
  1892. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  1893. if (!noAssert) checkOffset(offset, 1, this.length)
  1894. return this[offset]
  1895. }
  1896. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  1897. if (!noAssert) checkOffset(offset, 2, this.length)
  1898. return this[offset] | (this[offset + 1] << 8)
  1899. }
  1900. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  1901. if (!noAssert) checkOffset(offset, 2, this.length)
  1902. return (this[offset] << 8) | this[offset + 1]
  1903. }
  1904. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  1905. if (!noAssert) checkOffset(offset, 4, this.length)
  1906. return ((this[offset]) |
  1907. (this[offset + 1] << 8) |
  1908. (this[offset + 2] << 16)) +
  1909. (this[offset + 3] * 0x1000000)
  1910. }
  1911. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  1912. if (!noAssert) checkOffset(offset, 4, this.length)
  1913. return (this[offset] * 0x1000000) +
  1914. ((this[offset + 1] << 16) |
  1915. (this[offset + 2] << 8) |
  1916. this[offset + 3])
  1917. }
  1918. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  1919. offset = offset | 0
  1920. byteLength = byteLength | 0
  1921. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1922. var val = this[offset]
  1923. var mul = 1
  1924. var i = 0
  1925. while (++i < byteLength && (mul *= 0x100)) {
  1926. val += this[offset + i] * mul
  1927. }
  1928. mul *= 0x80
  1929. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1930. return val
  1931. }
  1932. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  1933. offset = offset | 0
  1934. byteLength = byteLength | 0
  1935. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1936. var i = byteLength
  1937. var mul = 1
  1938. var val = this[offset + --i]
  1939. while (i > 0 && (mul *= 0x100)) {
  1940. val += this[offset + --i] * mul
  1941. }
  1942. mul *= 0x80
  1943. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1944. return val
  1945. }
  1946. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  1947. if (!noAssert) checkOffset(offset, 1, this.length)
  1948. if (!(this[offset] & 0x80)) return (this[offset])
  1949. return ((0xff - this[offset] + 1) * -1)
  1950. }
  1951. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  1952. if (!noAssert) checkOffset(offset, 2, this.length)
  1953. var val = this[offset] | (this[offset + 1] << 8)
  1954. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1955. }
  1956. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  1957. if (!noAssert) checkOffset(offset, 2, this.length)
  1958. var val = this[offset + 1] | (this[offset] << 8)
  1959. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1960. }
  1961. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  1962. if (!noAssert) checkOffset(offset, 4, this.length)
  1963. return (this[offset]) |
  1964. (this[offset + 1] << 8) |
  1965. (this[offset + 2] << 16) |
  1966. (this[offset + 3] << 24)
  1967. }
  1968. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  1969. if (!noAssert) checkOffset(offset, 4, this.length)
  1970. return (this[offset] << 24) |
  1971. (this[offset + 1] << 16) |
  1972. (this[offset + 2] << 8) |
  1973. (this[offset + 3])
  1974. }
  1975. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  1976. if (!noAssert) checkOffset(offset, 4, this.length)
  1977. return ieee754.read(this, offset, true, 23, 4)
  1978. }
  1979. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  1980. if (!noAssert) checkOffset(offset, 4, this.length)
  1981. return ieee754.read(this, offset, false, 23, 4)
  1982. }
  1983. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  1984. if (!noAssert) checkOffset(offset, 8, this.length)
  1985. return ieee754.read(this, offset, true, 52, 8)
  1986. }
  1987. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  1988. if (!noAssert) checkOffset(offset, 8, this.length)
  1989. return ieee754.read(this, offset, false, 52, 8)
  1990. }
  1991. function checkInt (buf, value, offset, ext, max, min) {
  1992. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  1993. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  1994. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  1995. }
  1996. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  1997. value = +value
  1998. offset = offset | 0
  1999. byteLength = byteLength | 0
  2000. if (!noAssert) {
  2001. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  2002. checkInt(this, value, offset, byteLength, maxBytes, 0)
  2003. }
  2004. var mul = 1
  2005. var i = 0
  2006. this[offset] = value & 0xFF
  2007. while (++i < byteLength && (mul *= 0x100)) {
  2008. this[offset + i] = (value / mul) & 0xFF
  2009. }
  2010. return offset + byteLength
  2011. }
  2012. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  2013. value = +value
  2014. offset = offset | 0
  2015. byteLength = byteLength | 0
  2016. if (!noAssert) {
  2017. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  2018. checkInt(this, value, offset, byteLength, maxBytes, 0)
  2019. }
  2020. var i = byteLength - 1
  2021. var mul = 1
  2022. this[offset + i] = value & 0xFF
  2023. while (--i >= 0 && (mul *= 0x100)) {
  2024. this[offset + i] = (value / mul) & 0xFF
  2025. }
  2026. return offset + byteLength
  2027. }
  2028. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  2029. value = +value
  2030. offset = offset | 0
  2031. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  2032. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  2033. this[offset] = (value & 0xff)
  2034. return offset + 1
  2035. }
  2036. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  2037. if (value < 0) value = 0xffff + value + 1
  2038. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  2039. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  2040. (littleEndian ? i : 1 - i) * 8
  2041. }
  2042. }
  2043. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  2044. value = +value
  2045. offset = offset | 0
  2046. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  2047. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2048. this[offset] = (value & 0xff)
  2049. this[offset + 1] = (value >>> 8)
  2050. } else {
  2051. objectWriteUInt16(this, value, offset, true)
  2052. }
  2053. return offset + 2
  2054. }
  2055. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  2056. value = +value
  2057. offset = offset | 0
  2058. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  2059. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2060. this[offset] = (value >>> 8)
  2061. this[offset + 1] = (value & 0xff)
  2062. } else {
  2063. objectWriteUInt16(this, value, offset, false)
  2064. }
  2065. return offset + 2
  2066. }
  2067. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  2068. if (value < 0) value = 0xffffffff + value + 1
  2069. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  2070. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  2071. }
  2072. }
  2073. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  2074. value = +value
  2075. offset = offset | 0
  2076. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  2077. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2078. this[offset + 3] = (value >>> 24)
  2079. this[offset + 2] = (value >>> 16)
  2080. this[offset + 1] = (value >>> 8)
  2081. this[offset] = (value & 0xff)
  2082. } else {
  2083. objectWriteUInt32(this, value, offset, true)
  2084. }
  2085. return offset + 4
  2086. }
  2087. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  2088. value = +value
  2089. offset = offset | 0
  2090. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  2091. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2092. this[offset] = (value >>> 24)
  2093. this[offset + 1] = (value >>> 16)
  2094. this[offset + 2] = (value >>> 8)
  2095. this[offset + 3] = (value & 0xff)
  2096. } else {
  2097. objectWriteUInt32(this, value, offset, false)
  2098. }
  2099. return offset + 4
  2100. }
  2101. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  2102. value = +value
  2103. offset = offset | 0
  2104. if (!noAssert) {
  2105. var limit = Math.pow(2, 8 * byteLength - 1)
  2106. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  2107. }
  2108. var i = 0
  2109. var mul = 1
  2110. var sub = 0
  2111. this[offset] = value & 0xFF
  2112. while (++i < byteLength && (mul *= 0x100)) {
  2113. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  2114. sub = 1
  2115. }
  2116. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  2117. }
  2118. return offset + byteLength
  2119. }
  2120. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  2121. value = +value
  2122. offset = offset | 0
  2123. if (!noAssert) {
  2124. var limit = Math.pow(2, 8 * byteLength - 1)
  2125. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  2126. }
  2127. var i = byteLength - 1
  2128. var mul = 1
  2129. var sub = 0
  2130. this[offset + i] = value & 0xFF
  2131. while (--i >= 0 && (mul *= 0x100)) {
  2132. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  2133. sub = 1
  2134. }
  2135. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  2136. }
  2137. return offset + byteLength
  2138. }
  2139. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  2140. value = +value
  2141. offset = offset | 0
  2142. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  2143. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  2144. if (value < 0) value = 0xff + value + 1
  2145. this[offset] = (value & 0xff)
  2146. return offset + 1
  2147. }
  2148. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  2149. value = +value
  2150. offset = offset | 0
  2151. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  2152. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2153. this[offset] = (value & 0xff)
  2154. this[offset + 1] = (value >>> 8)
  2155. } else {
  2156. objectWriteUInt16(this, value, offset, true)
  2157. }
  2158. return offset + 2
  2159. }
  2160. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  2161. value = +value
  2162. offset = offset | 0
  2163. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  2164. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2165. this[offset] = (value >>> 8)
  2166. this[offset + 1] = (value & 0xff)
  2167. } else {
  2168. objectWriteUInt16(this, value, offset, false)
  2169. }
  2170. return offset + 2
  2171. }
  2172. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  2173. value = +value
  2174. offset = offset | 0
  2175. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  2176. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2177. this[offset] = (value & 0xff)
  2178. this[offset + 1] = (value >>> 8)
  2179. this[offset + 2] = (value >>> 16)
  2180. this[offset + 3] = (value >>> 24)
  2181. } else {
  2182. objectWriteUInt32(this, value, offset, true)
  2183. }
  2184. return offset + 4
  2185. }
  2186. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  2187. value = +value
  2188. offset = offset | 0
  2189. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  2190. if (value < 0) value = 0xffffffff + value + 1
  2191. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2192. this[offset] = (value >>> 24)
  2193. this[offset + 1] = (value >>> 16)
  2194. this[offset + 2] = (value >>> 8)
  2195. this[offset + 3] = (value & 0xff)
  2196. } else {
  2197. objectWriteUInt32(this, value, offset, false)
  2198. }
  2199. return offset + 4
  2200. }
  2201. function checkIEEE754 (buf, value, offset, ext, max, min) {
  2202. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  2203. if (offset < 0) throw new RangeError('Index out of range')
  2204. }
  2205. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  2206. if (!noAssert) {
  2207. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  2208. }
  2209. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  2210. return offset + 4
  2211. }
  2212. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  2213. return writeFloat(this, value, offset, true, noAssert)
  2214. }
  2215. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  2216. return writeFloat(this, value, offset, false, noAssert)
  2217. }
  2218. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  2219. if (!noAssert) {
  2220. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  2221. }
  2222. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  2223. return offset + 8
  2224. }
  2225. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  2226. return writeDouble(this, value, offset, true, noAssert)
  2227. }
  2228. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  2229. return writeDouble(this, value, offset, false, noAssert)
  2230. }
  2231. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  2232. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  2233. if (!start) start = 0
  2234. if (!end && end !== 0) end = this.length
  2235. if (targetStart >= target.length) targetStart = target.length
  2236. if (!targetStart) targetStart = 0
  2237. if (end > 0 && end < start) end = start
  2238. // Copy 0 bytes; we're done
  2239. if (end === start) return 0
  2240. if (target.length === 0 || this.length === 0) return 0
  2241. // Fatal error conditions
  2242. if (targetStart < 0) {
  2243. throw new RangeError('targetStart out of bounds')
  2244. }
  2245. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  2246. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  2247. // Are we oob?
  2248. if (end > this.length) end = this.length
  2249. if (target.length - targetStart < end - start) {
  2250. end = target.length - targetStart + start
  2251. }
  2252. var len = end - start
  2253. var i
  2254. if (this === target && start < targetStart && targetStart < end) {
  2255. // descending copy from end
  2256. for (i = len - 1; i >= 0; --i) {
  2257. target[i + targetStart] = this[i + start]
  2258. }
  2259. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  2260. // ascending copy from start
  2261. for (i = 0; i < len; ++i) {
  2262. target[i + targetStart] = this[i + start]
  2263. }
  2264. } else {
  2265. Uint8Array.prototype.set.call(
  2266. target,
  2267. this.subarray(start, start + len),
  2268. targetStart
  2269. )
  2270. }
  2271. return len
  2272. }
  2273. // Usage:
  2274. // buffer.fill(number[, offset[, end]])
  2275. // buffer.fill(buffer[, offset[, end]])
  2276. // buffer.fill(string[, offset[, end]][, encoding])
  2277. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  2278. // Handle string cases:
  2279. if (typeof val === 'string') {
  2280. if (typeof start === 'string') {
  2281. encoding = start
  2282. start = 0
  2283. end = this.length
  2284. } else if (typeof end === 'string') {
  2285. encoding = end
  2286. end = this.length
  2287. }
  2288. if (val.length === 1) {
  2289. var code = val.charCodeAt(0)
  2290. if (code < 256) {
  2291. val = code
  2292. }
  2293. }
  2294. if (encoding !== undefined && typeof encoding !== 'string') {
  2295. throw new TypeError('encoding must be a string')
  2296. }
  2297. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  2298. throw new TypeError('Unknown encoding: ' + encoding)
  2299. }
  2300. } else if (typeof val === 'number') {
  2301. val = val & 255
  2302. }
  2303. // Invalid ranges are not set to a default, so can range check early.
  2304. if (start < 0 || this.length < start || this.length < end) {
  2305. throw new RangeError('Out of range index')
  2306. }
  2307. if (end <= start) {
  2308. return this
  2309. }
  2310. start = start >>> 0
  2311. end = end === undefined ? this.length : end >>> 0
  2312. if (!val) val = 0
  2313. var i
  2314. if (typeof val === 'number') {
  2315. for (i = start; i < end; ++i) {
  2316. this[i] = val
  2317. }
  2318. } else {
  2319. var bytes = Buffer.isBuffer(val)
  2320. ? val
  2321. : utf8ToBytes(new Buffer(val, encoding).toString())
  2322. var len = bytes.length
  2323. for (i = 0; i < end - start; ++i) {
  2324. this[i + start] = bytes[i % len]
  2325. }
  2326. }
  2327. return this
  2328. }
  2329. // HELPER FUNCTIONS
  2330. // ================
  2331. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  2332. function base64clean (str) {
  2333. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  2334. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  2335. // Node converts strings with length < 2 to ''
  2336. if (str.length < 2) return ''
  2337. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  2338. while (str.length % 4 !== 0) {
  2339. str = str + '='
  2340. }
  2341. return str
  2342. }
  2343. function stringtrim (str) {
  2344. if (str.trim) return str.trim()
  2345. return str.replace(/^\s+|\s+$/g, '')
  2346. }
  2347. function toHex (n) {
  2348. if (n < 16) return '0' + n.toString(16)
  2349. return n.toString(16)
  2350. }
  2351. function utf8ToBytes (string, units) {
  2352. units = units || Infinity
  2353. var codePoint
  2354. var length = string.length
  2355. var leadSurrogate = null
  2356. var bytes = []
  2357. for (var i = 0; i < length; ++i) {
  2358. codePoint = string.charCodeAt(i)
  2359. // is surrogate component
  2360. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  2361. // last char was a lead
  2362. if (!leadSurrogate) {
  2363. // no lead yet
  2364. if (codePoint > 0xDBFF) {
  2365. // unexpected trail
  2366. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2367. continue
  2368. } else if (i + 1 === length) {
  2369. // unpaired lead
  2370. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2371. continue
  2372. }
  2373. // valid lead
  2374. leadSurrogate = codePoint
  2375. continue
  2376. }
  2377. // 2 leads in a row
  2378. if (codePoint < 0xDC00) {
  2379. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2380. leadSurrogate = codePoint
  2381. continue
  2382. }
  2383. // valid surrogate pair
  2384. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  2385. } else if (leadSurrogate) {
  2386. // valid bmp char, but last char was a lead
  2387. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2388. }
  2389. leadSurrogate = null
  2390. // encode utf8
  2391. if (codePoint < 0x80) {
  2392. if ((units -= 1) < 0) break
  2393. bytes.push(codePoint)
  2394. } else if (codePoint < 0x800) {
  2395. if ((units -= 2) < 0) break
  2396. bytes.push(
  2397. codePoint >> 0x6 | 0xC0,
  2398. codePoint & 0x3F | 0x80
  2399. )
  2400. } else if (codePoint < 0x10000) {
  2401. if ((units -= 3) < 0) break
  2402. bytes.push(
  2403. codePoint >> 0xC | 0xE0,
  2404. codePoint >> 0x6 & 0x3F | 0x80,
  2405. codePoint & 0x3F | 0x80
  2406. )
  2407. } else if (codePoint < 0x110000) {
  2408. if ((units -= 4) < 0) break
  2409. bytes.push(
  2410. codePoint >> 0x12 | 0xF0,
  2411. codePoint >> 0xC & 0x3F | 0x80,
  2412. codePoint >> 0x6 & 0x3F | 0x80,
  2413. codePoint & 0x3F | 0x80
  2414. )
  2415. } else {
  2416. throw new Error('Invalid code point')
  2417. }
  2418. }
  2419. return bytes
  2420. }
  2421. function asciiToBytes (str) {
  2422. var byteArray = []
  2423. for (var i = 0; i < str.length; ++i) {
  2424. // Node's code seems to be doing this and not & 0x7F..
  2425. byteArray.push(str.charCodeAt(i) & 0xFF)
  2426. }
  2427. return byteArray
  2428. }
  2429. function utf16leToBytes (str, units) {
  2430. var c, hi, lo
  2431. var byteArray = []
  2432. for (var i = 0; i < str.length; ++i) {
  2433. if ((units -= 2) < 0) break
  2434. c = str.charCodeAt(i)
  2435. hi = c >> 8
  2436. lo = c % 256
  2437. byteArray.push(lo)
  2438. byteArray.push(hi)
  2439. }
  2440. return byteArray
  2441. }
  2442. function base64ToBytes (str) {
  2443. return base64.toByteArray(base64clean(str))
  2444. }
  2445. function blitBuffer (src, dst, offset, length) {
  2446. for (var i = 0; i < length; ++i) {
  2447. if ((i + offset >= dst.length) || (i >= src.length)) break
  2448. dst[i + offset] = src[i]
  2449. }
  2450. return i
  2451. }
  2452. function isnan (val) {
  2453. return val !== val // eslint-disable-line no-self-compare
  2454. }
  2455. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(41)))
  2456. /***/ }),
  2457. /* 11 */
  2458. /***/ (function(module, exports, __webpack_require__) {
  2459. "use strict";
  2460. // YAML error class. http://stackoverflow.com/questions/8458984
  2461. //
  2462. function YAMLException(reason, mark) {
  2463. // Super constructor
  2464. Error.call(this);
  2465. this.name = 'YAMLException';
  2466. this.reason = reason;
  2467. this.mark = mark;
  2468. this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
  2469. // Include stack trace in error object
  2470. if (Error.captureStackTrace) {
  2471. // Chrome and NodeJS
  2472. Error.captureStackTrace(this, this.constructor);
  2473. } else {
  2474. // FF, IE 10+ and Safari 6+. Fallback for others
  2475. this.stack = (new Error()).stack || '';
  2476. }
  2477. }
  2478. // Inherit from Error
  2479. YAMLException.prototype = Object.create(Error.prototype);
  2480. YAMLException.prototype.constructor = YAMLException;
  2481. YAMLException.prototype.toString = function toString(compact) {
  2482. var result = this.name + ': ';
  2483. result += this.reason || '(unknown reason)';
  2484. if (!compact && this.mark) {
  2485. result += ' ' + this.mark.toString();
  2486. }
  2487. return result;
  2488. };
  2489. module.exports = YAMLException;
  2490. /***/ }),
  2491. /* 12 */
  2492. /***/ (function(module, exports, __webpack_require__) {
  2493. "use strict";
  2494. // JS-YAML's default schema for `safeLoad` function.
  2495. // It is not described in the YAML specification.
  2496. //
  2497. // This schema is based on standard YAML's Core schema and includes most of
  2498. // extra types described at YAML tag repository. (http://yaml.org/type/)
  2499. var Schema = __webpack_require__(7);
  2500. module.exports = new Schema({
  2501. include: [
  2502. __webpack_require__(50)
  2503. ],
  2504. implicit: [
  2505. __webpack_require__(142),
  2506. __webpack_require__(135)
  2507. ],
  2508. explicit: [
  2509. __webpack_require__(127),
  2510. __webpack_require__(137),
  2511. __webpack_require__(138),
  2512. __webpack_require__(140)
  2513. ]
  2514. });
  2515. /***/ }),
  2516. /* 13 */
  2517. /***/ (function(module, exports, __webpack_require__) {
  2518. "use strict";
  2519. Object.defineProperty(exports, "__esModule", {
  2520. value: true
  2521. });
  2522. exports.default = unclosed;
  2523. function unclosed(state, what) {
  2524. throw state.input.error("Unclosed " + what, state.line, state.pos - state.offset);
  2525. }
  2526. module.exports = exports["default"];
  2527. /***/ }),
  2528. /* 14 */
  2529. /***/ (function(module, exports) {
  2530. /* -*- Mode: js; js-indent-level: 2; -*- */
  2531. /*
  2532. * Copyright 2011 Mozilla Foundation and contributors
  2533. * Licensed under the New BSD license. See LICENSE or:
  2534. * http://opensource.org/licenses/BSD-3-Clause
  2535. */
  2536. /**
  2537. * This is a helper function for getting values from parameter/options
  2538. * objects.
  2539. *
  2540. * @param args The object we are extracting values from
  2541. * @param name The name of the property we are getting.
  2542. * @param defaultValue An optional value to return if the property is missing
  2543. * from the object. If this is not specified and the property is missing, an
  2544. * error will be thrown.
  2545. */
  2546. function getArg(aArgs, aName, aDefaultValue) {
  2547. if (aName in aArgs) {
  2548. return aArgs[aName];
  2549. } else if (arguments.length === 3) {
  2550. return aDefaultValue;
  2551. } else {
  2552. throw new Error('"' + aName + '" is a required argument.');
  2553. }
  2554. }
  2555. exports.getArg = getArg;
  2556. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
  2557. var dataUrlRegexp = /^data:.+\,.+$/;
  2558. function urlParse(aUrl) {
  2559. var match = aUrl.match(urlRegexp);
  2560. if (!match) {
  2561. return null;
  2562. }
  2563. return {
  2564. scheme: match[1],
  2565. auth: match[2],
  2566. host: match[3],
  2567. port: match[4],
  2568. path: match[5]
  2569. };
  2570. }
  2571. exports.urlParse = urlParse;
  2572. function urlGenerate(aParsedUrl) {
  2573. var url = '';
  2574. if (aParsedUrl.scheme) {
  2575. url += aParsedUrl.scheme + ':';
  2576. }
  2577. url += '//';
  2578. if (aParsedUrl.auth) {
  2579. url += aParsedUrl.auth + '@';
  2580. }
  2581. if (aParsedUrl.host) {
  2582. url += aParsedUrl.host;
  2583. }
  2584. if (aParsedUrl.port) {
  2585. url += ":" + aParsedUrl.port
  2586. }
  2587. if (aParsedUrl.path) {
  2588. url += aParsedUrl.path;
  2589. }
  2590. return url;
  2591. }
  2592. exports.urlGenerate = urlGenerate;
  2593. /**
  2594. * Normalizes a path, or the path portion of a URL:
  2595. *
  2596. * - Replaces consecutive slashes with one slash.
  2597. * - Removes unnecessary '.' parts.
  2598. * - Removes unnecessary '<dir>/..' parts.
  2599. *
  2600. * Based on code in the Node.js 'path' core module.
  2601. *
  2602. * @param aPath The path or url to normalize.
  2603. */
  2604. function normalize(aPath) {
  2605. var path = aPath;
  2606. var url = urlParse(aPath);
  2607. if (url) {
  2608. if (!url.path) {
  2609. return aPath;
  2610. }
  2611. path = url.path;
  2612. }
  2613. var isAbsolute = exports.isAbsolute(path);
  2614. var parts = path.split(/\/+/);
  2615. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  2616. part = parts[i];
  2617. if (part === '.') {
  2618. parts.splice(i, 1);
  2619. } else if (part === '..') {
  2620. up++;
  2621. } else if (up > 0) {
  2622. if (part === '') {
  2623. // The first part is blank if the path is absolute. Trying to go
  2624. // above the root is a no-op. Therefore we can remove all '..' parts
  2625. // directly after the root.
  2626. parts.splice(i + 1, up);
  2627. up = 0;
  2628. } else {
  2629. parts.splice(i, 2);
  2630. up--;
  2631. }
  2632. }
  2633. }
  2634. path = parts.join('/');
  2635. if (path === '') {
  2636. path = isAbsolute ? '/' : '.';
  2637. }
  2638. if (url) {
  2639. url.path = path;
  2640. return urlGenerate(url);
  2641. }
  2642. return path;
  2643. }
  2644. exports.normalize = normalize;
  2645. /**
  2646. * Joins two paths/URLs.
  2647. *
  2648. * @param aRoot The root path or URL.
  2649. * @param aPath The path or URL to be joined with the root.
  2650. *
  2651. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  2652. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  2653. * first.
  2654. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  2655. * is updated with the result and aRoot is returned. Otherwise the result
  2656. * is returned.
  2657. * - If aPath is absolute, the result is aPath.
  2658. * - Otherwise the two paths are joined with a slash.
  2659. * - Joining for example 'http://' and 'www.example.com' is also supported.
  2660. */
  2661. function join(aRoot, aPath) {
  2662. if (aRoot === "") {
  2663. aRoot = ".";
  2664. }
  2665. if (aPath === "") {
  2666. aPath = ".";
  2667. }
  2668. var aPathUrl = urlParse(aPath);
  2669. var aRootUrl = urlParse(aRoot);
  2670. if (aRootUrl) {
  2671. aRoot = aRootUrl.path || '/';
  2672. }
  2673. // `join(foo, '//www.example.org')`
  2674. if (aPathUrl && !aPathUrl.scheme) {
  2675. if (aRootUrl) {
  2676. aPathUrl.scheme = aRootUrl.scheme;
  2677. }
  2678. return urlGenerate(aPathUrl);
  2679. }
  2680. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  2681. return aPath;
  2682. }
  2683. // `join('http://', 'www.example.com')`
  2684. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  2685. aRootUrl.host = aPath;
  2686. return urlGenerate(aRootUrl);
  2687. }
  2688. var joined = aPath.charAt(0) === '/'
  2689. ? aPath
  2690. : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  2691. if (aRootUrl) {
  2692. aRootUrl.path = joined;
  2693. return urlGenerate(aRootUrl);
  2694. }
  2695. return joined;
  2696. }
  2697. exports.join = join;
  2698. exports.isAbsolute = function (aPath) {
  2699. return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
  2700. };
  2701. /**
  2702. * Make a path relative to a URL or another path.
  2703. *
  2704. * @param aRoot The root path or URL.
  2705. * @param aPath The path or URL to be made relative to aRoot.
  2706. */
  2707. function relative(aRoot, aPath) {
  2708. if (aRoot === "") {
  2709. aRoot = ".";
  2710. }
  2711. aRoot = aRoot.replace(/\/$/, '');
  2712. // It is possible for the path to be above the root. In this case, simply
  2713. // checking whether the root is a prefix of the path won't work. Instead, we
  2714. // need to remove components from the root one by one, until either we find
  2715. // a prefix that fits, or we run out of components to remove.
  2716. var level = 0;
  2717. while (aPath.indexOf(aRoot + '/') !== 0) {
  2718. var index = aRoot.lastIndexOf("/");
  2719. if (index < 0) {
  2720. return aPath;
  2721. }
  2722. // If the only part of the root that is left is the scheme (i.e. http://,
  2723. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  2724. // have exhausted all components, so the path is not relative to the root.
  2725. aRoot = aRoot.slice(0, index);
  2726. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  2727. return aPath;
  2728. }
  2729. ++level;
  2730. }
  2731. // Make sure we add a "../" for each component we removed from the root.
  2732. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  2733. }
  2734. exports.relative = relative;
  2735. var supportsNullProto = (function () {
  2736. var obj = Object.create(null);
  2737. return !('__proto__' in obj);
  2738. }());
  2739. function identity (s) {
  2740. return s;
  2741. }
  2742. /**
  2743. * Because behavior goes wacky when you set `__proto__` on objects, we
  2744. * have to prefix all the strings in our set with an arbitrary character.
  2745. *
  2746. * See https://github.com/mozilla/source-map/pull/31 and
  2747. * https://github.com/mozilla/source-map/issues/30
  2748. *
  2749. * @param String aStr
  2750. */
  2751. function toSetString(aStr) {
  2752. if (isProtoString(aStr)) {
  2753. return '$' + aStr;
  2754. }
  2755. return aStr;
  2756. }
  2757. exports.toSetString = supportsNullProto ? identity : toSetString;
  2758. function fromSetString(aStr) {
  2759. if (isProtoString(aStr)) {
  2760. return aStr.slice(1);
  2761. }
  2762. return aStr;
  2763. }
  2764. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  2765. function isProtoString(s) {
  2766. if (!s) {
  2767. return false;
  2768. }
  2769. var length = s.length;
  2770. if (length < 9 /* "__proto__".length */) {
  2771. return false;
  2772. }
  2773. if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
  2774. s.charCodeAt(length - 2) !== 95 /* '_' */ ||
  2775. s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
  2776. s.charCodeAt(length - 4) !== 116 /* 't' */ ||
  2777. s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
  2778. s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
  2779. s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
  2780. s.charCodeAt(length - 8) !== 95 /* '_' */ ||
  2781. s.charCodeAt(length - 9) !== 95 /* '_' */) {
  2782. return false;
  2783. }
  2784. for (var i = length - 10; i >= 0; i--) {
  2785. if (s.charCodeAt(i) !== 36 /* '$' */) {
  2786. return false;
  2787. }
  2788. }
  2789. return true;
  2790. }
  2791. /**
  2792. * Comparator between two mappings where the original positions are compared.
  2793. *
  2794. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  2795. * mappings with the same original source/line/column, but different generated
  2796. * line and column the same. Useful when searching for a mapping with a
  2797. * stubbed out mapping.
  2798. */
  2799. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  2800. var cmp = strcmp(mappingA.source, mappingB.source);
  2801. if (cmp !== 0) {
  2802. return cmp;
  2803. }
  2804. cmp = mappingA.originalLine - mappingB.originalLine;
  2805. if (cmp !== 0) {
  2806. return cmp;
  2807. }
  2808. cmp = mappingA.originalColumn - mappingB.originalColumn;
  2809. if (cmp !== 0 || onlyCompareOriginal) {
  2810. return cmp;
  2811. }
  2812. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  2813. if (cmp !== 0) {
  2814. return cmp;
  2815. }
  2816. cmp = mappingA.generatedLine - mappingB.generatedLine;
  2817. if (cmp !== 0) {
  2818. return cmp;
  2819. }
  2820. return strcmp(mappingA.name, mappingB.name);
  2821. }
  2822. exports.compareByOriginalPositions = compareByOriginalPositions;
  2823. /**
  2824. * Comparator between two mappings with deflated source and name indices where
  2825. * the generated positions are compared.
  2826. *
  2827. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  2828. * mappings with the same generated line and column, but different
  2829. * source/name/original line and column the same. Useful when searching for a
  2830. * mapping with a stubbed out mapping.
  2831. */
  2832. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  2833. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  2834. if (cmp !== 0) {
  2835. return cmp;
  2836. }
  2837. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  2838. if (cmp !== 0 || onlyCompareGenerated) {
  2839. return cmp;
  2840. }
  2841. cmp = strcmp(mappingA.source, mappingB.source);
  2842. if (cmp !== 0) {
  2843. return cmp;
  2844. }
  2845. cmp = mappingA.originalLine - mappingB.originalLine;
  2846. if (cmp !== 0) {
  2847. return cmp;
  2848. }
  2849. cmp = mappingA.originalColumn - mappingB.originalColumn;
  2850. if (cmp !== 0) {
  2851. return cmp;
  2852. }
  2853. return strcmp(mappingA.name, mappingB.name);
  2854. }
  2855. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  2856. function strcmp(aStr1, aStr2) {
  2857. if (aStr1 === aStr2) {
  2858. return 0;
  2859. }
  2860. if (aStr1 === null) {
  2861. return 1; // aStr2 !== null
  2862. }
  2863. if (aStr2 === null) {
  2864. return -1; // aStr1 !== null
  2865. }
  2866. if (aStr1 > aStr2) {
  2867. return 1;
  2868. }
  2869. return -1;
  2870. }
  2871. /**
  2872. * Comparator between two mappings with inflated source and name strings where
  2873. * the generated positions are compared.
  2874. */
  2875. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  2876. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  2877. if (cmp !== 0) {
  2878. return cmp;
  2879. }
  2880. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  2881. if (cmp !== 0) {
  2882. return cmp;
  2883. }
  2884. cmp = strcmp(mappingA.source, mappingB.source);
  2885. if (cmp !== 0) {
  2886. return cmp;
  2887. }
  2888. cmp = mappingA.originalLine - mappingB.originalLine;
  2889. if (cmp !== 0) {
  2890. return cmp;
  2891. }
  2892. cmp = mappingA.originalColumn - mappingB.originalColumn;
  2893. if (cmp !== 0) {
  2894. return cmp;
  2895. }
  2896. return strcmp(mappingA.name, mappingB.name);
  2897. }
  2898. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  2899. /**
  2900. * Strip any JSON XSSI avoidance prefix from the string (as documented
  2901. * in the source maps specification), and then parse the string as
  2902. * JSON.
  2903. */
  2904. function parseSourceMapInput(str) {
  2905. return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
  2906. }
  2907. exports.parseSourceMapInput = parseSourceMapInput;
  2908. /**
  2909. * Compute the URL of a source given the the source root, the source's
  2910. * URL, and the source map's URL.
  2911. */
  2912. function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
  2913. sourceURL = sourceURL || '';
  2914. if (sourceRoot) {
  2915. // This follows what Chrome does.
  2916. if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
  2917. sourceRoot += '/';
  2918. }
  2919. // The spec says:
  2920. // Line 4: An optional source root, useful for relocating source
  2921. // files on a server or removing repeated values in the
  2922. // “sources” entry. This value is prepended to the individual
  2923. // entries in the “source” field.
  2924. sourceURL = sourceRoot + sourceURL;
  2925. }
  2926. // Historically, SourceMapConsumer did not take the sourceMapURL as
  2927. // a parameter. This mode is still somewhat supported, which is why
  2928. // this code block is conditional. However, it's preferable to pass
  2929. // the source map URL to SourceMapConsumer, so that this function
  2930. // can implement the source URL resolution algorithm as outlined in
  2931. // the spec. This block is basically the equivalent of:
  2932. // new URL(sourceURL, sourceMapURL).toString()
  2933. // ... except it avoids using URL, which wasn't available in the
  2934. // older releases of node still supported by this library.
  2935. //
  2936. // The spec says:
  2937. // If the sources are not absolute URLs after prepending of the
  2938. // “sourceRoot”, the sources are resolved relative to the
  2939. // SourceMap (like resolving script src in a html document).
  2940. if (sourceMapURL) {
  2941. var parsed = urlParse(sourceMapURL);
  2942. if (!parsed) {
  2943. throw new Error("sourceMapURL could not be parsed");
  2944. }
  2945. if (parsed.path) {
  2946. // Strip the last path component, but keep the "/".
  2947. var index = parsed.path.lastIndexOf('/');
  2948. if (index >= 0) {
  2949. parsed.path = parsed.path.substring(0, index + 1);
  2950. }
  2951. }
  2952. sourceURL = join(urlGenerate(parsed), sourceURL);
  2953. }
  2954. return normalize(sourceURL);
  2955. }
  2956. exports.computeSourceURL = computeSourceURL;
  2957. /***/ }),
  2958. /* 15 */
  2959. /***/ (function(module, exports, __webpack_require__) {
  2960. "use strict";
  2961. exports.__esModule = true;
  2962. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2963. var _node = __webpack_require__(9);
  2964. var _node2 = _interopRequireDefault(_node);
  2965. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2966. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2967. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2968. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2969. var Namespace = function (_Node) {
  2970. _inherits(Namespace, _Node);
  2971. function Namespace() {
  2972. _classCallCheck(this, Namespace);
  2973. return _possibleConstructorReturn(this, _Node.apply(this, arguments));
  2974. }
  2975. Namespace.prototype.toString = function toString() {
  2976. return [this.spaces.before, this.ns, String(this.value), this.spaces.after].join('');
  2977. };
  2978. _createClass(Namespace, [{
  2979. key: 'ns',
  2980. get: function get() {
  2981. var n = this.namespace;
  2982. return n ? (typeof n === 'string' ? n : '') + '|' : '';
  2983. }
  2984. }]);
  2985. return Namespace;
  2986. }(_node2.default);
  2987. exports.default = Namespace;
  2988. ;
  2989. module.exports = exports['default'];
  2990. /***/ }),
  2991. /* 16 */
  2992. /***/ (function(module, exports, __webpack_require__) {
  2993. "use strict";
  2994. exports.__esModule = true;
  2995. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2996. var _container = __webpack_require__(36);
  2997. var _container2 = _interopRequireDefault(_container);
  2998. var _warnOnce = __webpack_require__(5);
  2999. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  3000. var _list = __webpack_require__(193);
  3001. var _list2 = _interopRequireDefault(_list);
  3002. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3003. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3004. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3005. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3006. /**
  3007. * Represents a CSS rule: a selector followed by a declaration block.
  3008. *
  3009. * @extends Container
  3010. *
  3011. * @example
  3012. * const root = postcss.parse('a{}');
  3013. * const rule = root.first;
  3014. * rule.type //=> 'rule'
  3015. * rule.toString() //=> 'a{}'
  3016. */
  3017. var Rule = function (_Container) {
  3018. _inherits(Rule, _Container);
  3019. function Rule(defaults) {
  3020. _classCallCheck(this, Rule);
  3021. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  3022. _this.type = 'rule';
  3023. if (!_this.nodes) _this.nodes = [];
  3024. return _this;
  3025. }
  3026. /**
  3027. * An array containing the rule’s individual selectors.
  3028. * Groups of selectors are split at commas.
  3029. *
  3030. * @type {string[]}
  3031. *
  3032. * @example
  3033. * const root = postcss.parse('a, b { }');
  3034. * const rule = root.first;
  3035. *
  3036. * rule.selector //=> 'a, b'
  3037. * rule.selectors //=> ['a', 'b']
  3038. *
  3039. * rule.selectors = ['a', 'strong'];
  3040. * rule.selector //=> 'a, strong'
  3041. */
  3042. _createClass(Rule, [{
  3043. key: 'selectors',
  3044. get: function get() {
  3045. return _list2.default.comma(this.selector);
  3046. },
  3047. set: function set(values) {
  3048. var match = this.selector ? this.selector.match(/,\s*/) : null;
  3049. var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
  3050. this.selector = values.join(sep);
  3051. }
  3052. }, {
  3053. key: '_selector',
  3054. get: function get() {
  3055. (0, _warnOnce2.default)('Rule#_selector is deprecated. Use Rule#raws.selector');
  3056. return this.raws.selector;
  3057. },
  3058. set: function set(val) {
  3059. (0, _warnOnce2.default)('Rule#_selector is deprecated. Use Rule#raws.selector');
  3060. this.raws.selector = val;
  3061. }
  3062. /**
  3063. * @memberof Rule#
  3064. * @member {string} selector - the rule’s full selector represented
  3065. * as a string
  3066. *
  3067. * @example
  3068. * const root = postcss.parse('a, b { }');
  3069. * const rule = root.first;
  3070. * rule.selector //=> 'a, b'
  3071. */
  3072. /**
  3073. * @memberof Rule#
  3074. * @member {object} raws - Information to generate byte-to-byte equal
  3075. * node string as it was in the origin input.
  3076. *
  3077. * Every parser saves its own properties,
  3078. * but the default CSS parser uses:
  3079. *
  3080. * * `before`: the space symbols before the node. It also stores `*`
  3081. * and `_` symbols before the declaration (IE hack).
  3082. * * `after`: the space symbols after the last child of the node
  3083. * to the end of the node.
  3084. * * `between`: the symbols between the property and value
  3085. * for declarations, selector and `{` for rules, or last parameter
  3086. * and `{` for at-rules.
  3087. * * `semicolon`: contains true if the last child has
  3088. * an (optional) semicolon.
  3089. *
  3090. * PostCSS cleans selectors from comments and extra spaces,
  3091. * but it stores origin content in raws properties.
  3092. * As such, if you don’t change a declaration’s value,
  3093. * PostCSS will use the raw value with comments.
  3094. *
  3095. * @example
  3096. * const root = postcss.parse('a {\n color:black\n}')
  3097. * root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
  3098. */
  3099. }]);
  3100. return Rule;
  3101. }(_container2.default);
  3102. exports.default = Rule;
  3103. module.exports = exports['default'];
  3104. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGUuZXM2Il0sIm5hbWVzIjpbIlJ1bGUiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsImNvbW1hIiwic2VsZWN0b3IiLCJ2YWx1ZXMiLCJtYXRjaCIsInNlcCIsInJhdyIsImpvaW4iLCJyYXdzIiwidmFsIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Q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XJ0eSBhbmQgdmFsdWVcbiAgICAgKiAgIGZvciBkZWNsYXJhdGlvbnMsIHNlbGVjdG9yIGFuZCBge2AgZm9yIHJ1bGVzLCBvciBsYXN0IHBhcmFtZXRlclxuICAgICAqICAgYW5kIGB7YCBmb3IgYXQtcnVsZXMuXG4gICAgICogKiBgc2VtaWNvbG9uYDogY29udGFpbnMgdHJ1ZSBpZiB0aGUgbGFzdCBjaGlsZCBoYXNcbiAgICAgKiAgIGFuIChvcHRpb25hbCkgc2VtaWNvbG9uLlxuICAgICAqXG4gICAgICogUG9zdENTUyBjbGVhbnMgc2VsZWN0b3JzIGZyb20gY29tbWVudHMgYW5kIGV4dHJhIHNwYWNlcyxcbiAgICAgKiBidXQgaXQgc3RvcmVzIG9yaWdpbiBjb250ZW50IGluIHJhd3MgcHJvcGVydGllcy5cbiAgICAgKiBBcyBzdWNoLCBpZiB5b3UgZG9u4oCZdCBjaGFuZ2UgYSBkZWNsYXJhdGlvbuKAmXMgdmFsdWUsXG4gICAgICogUG9zdENTUyB3aWxsIHVzZSB0aGUgcmF3IHZhbHVlIHdpdGggY29tbWVudHMuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IHJvb3QgPSBwb3N0Y3NzLnBhcnNlKCdhIHtcXG4gIGNvbG9yOmJsYWNrXFxufScpXG4gICAgICogcm9vdC5maXJzdC5maXJzdC5yYXdzIC8vPT4geyBiZWZvcmU6ICcnLCBiZXR3ZWVuOiAnICcsIGFmdGVyOiAnXFxuJyB9XG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUnVsZTtcbiJdfQ==
  3105. /***/ }),
  3106. /* 17 */
  3107. /***/ (function(module, exports) {
  3108. /* -*- Mode: js; js-indent-level: 2; -*- */
  3109. /*
  3110. * Copyright 2011 Mozilla Foundation and contributors
  3111. * Licensed under the New BSD license. See LICENSE or:
  3112. * http://opensource.org/licenses/BSD-3-Clause
  3113. */
  3114. /**
  3115. * This is a helper function for getting values from parameter/options
  3116. * objects.
  3117. *
  3118. * @param args The object we are extracting values from
  3119. * @param name The name of the property we are getting.
  3120. * @param defaultValue An optional value to return if the property is missing
  3121. * from the object. If this is not specified and the property is missing, an
  3122. * error will be thrown.
  3123. */
  3124. function getArg(aArgs, aName, aDefaultValue) {
  3125. if (aName in aArgs) {
  3126. return aArgs[aName];
  3127. } else if (arguments.length === 3) {
  3128. return aDefaultValue;
  3129. } else {
  3130. throw new Error('"' + aName + '" is a required argument.');
  3131. }
  3132. }
  3133. exports.getArg = getArg;
  3134. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
  3135. var dataUrlRegexp = /^data:.+\,.+$/;
  3136. function urlParse(aUrl) {
  3137. var match = aUrl.match(urlRegexp);
  3138. if (!match) {
  3139. return null;
  3140. }
  3141. return {
  3142. scheme: match[1],
  3143. auth: match[2],
  3144. host: match[3],
  3145. port: match[4],
  3146. path: match[5]
  3147. };
  3148. }
  3149. exports.urlParse = urlParse;
  3150. function urlGenerate(aParsedUrl) {
  3151. var url = '';
  3152. if (aParsedUrl.scheme) {
  3153. url += aParsedUrl.scheme + ':';
  3154. }
  3155. url += '//';
  3156. if (aParsedUrl.auth) {
  3157. url += aParsedUrl.auth + '@';
  3158. }
  3159. if (aParsedUrl.host) {
  3160. url += aParsedUrl.host;
  3161. }
  3162. if (aParsedUrl.port) {
  3163. url += ":" + aParsedUrl.port
  3164. }
  3165. if (aParsedUrl.path) {
  3166. url += aParsedUrl.path;
  3167. }
  3168. return url;
  3169. }
  3170. exports.urlGenerate = urlGenerate;
  3171. /**
  3172. * Normalizes a path, or the path portion of a URL:
  3173. *
  3174. * - Replaces consecutive slashes with one slash.
  3175. * - Removes unnecessary '.' parts.
  3176. * - Removes unnecessary '<dir>/..' parts.
  3177. *
  3178. * Based on code in the Node.js 'path' core module.
  3179. *
  3180. * @param aPath The path or url to normalize.
  3181. */
  3182. function normalize(aPath) {
  3183. var path = aPath;
  3184. var url = urlParse(aPath);
  3185. if (url) {
  3186. if (!url.path) {
  3187. return aPath;
  3188. }
  3189. path = url.path;
  3190. }
  3191. var isAbsolute = exports.isAbsolute(path);
  3192. var parts = path.split(/\/+/);
  3193. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  3194. part = parts[i];
  3195. if (part === '.') {
  3196. parts.splice(i, 1);
  3197. } else if (part === '..') {
  3198. up++;
  3199. } else if (up > 0) {
  3200. if (part === '') {
  3201. // The first part is blank if the path is absolute. Trying to go
  3202. // above the root is a no-op. Therefore we can remove all '..' parts
  3203. // directly after the root.
  3204. parts.splice(i + 1, up);
  3205. up = 0;
  3206. } else {
  3207. parts.splice(i, 2);
  3208. up--;
  3209. }
  3210. }
  3211. }
  3212. path = parts.join('/');
  3213. if (path === '') {
  3214. path = isAbsolute ? '/' : '.';
  3215. }
  3216. if (url) {
  3217. url.path = path;
  3218. return urlGenerate(url);
  3219. }
  3220. return path;
  3221. }
  3222. exports.normalize = normalize;
  3223. /**
  3224. * Joins two paths/URLs.
  3225. *
  3226. * @param aRoot The root path or URL.
  3227. * @param aPath The path or URL to be joined with the root.
  3228. *
  3229. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  3230. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  3231. * first.
  3232. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  3233. * is updated with the result and aRoot is returned. Otherwise the result
  3234. * is returned.
  3235. * - If aPath is absolute, the result is aPath.
  3236. * - Otherwise the two paths are joined with a slash.
  3237. * - Joining for example 'http://' and 'www.example.com' is also supported.
  3238. */
  3239. function join(aRoot, aPath) {
  3240. if (aRoot === "") {
  3241. aRoot = ".";
  3242. }
  3243. if (aPath === "") {
  3244. aPath = ".";
  3245. }
  3246. var aPathUrl = urlParse(aPath);
  3247. var aRootUrl = urlParse(aRoot);
  3248. if (aRootUrl) {
  3249. aRoot = aRootUrl.path || '/';
  3250. }
  3251. // `join(foo, '//www.example.org')`
  3252. if (aPathUrl && !aPathUrl.scheme) {
  3253. if (aRootUrl) {
  3254. aPathUrl.scheme = aRootUrl.scheme;
  3255. }
  3256. return urlGenerate(aPathUrl);
  3257. }
  3258. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  3259. return aPath;
  3260. }
  3261. // `join('http://', 'www.example.com')`
  3262. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  3263. aRootUrl.host = aPath;
  3264. return urlGenerate(aRootUrl);
  3265. }
  3266. var joined = aPath.charAt(0) === '/'
  3267. ? aPath
  3268. : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  3269. if (aRootUrl) {
  3270. aRootUrl.path = joined;
  3271. return urlGenerate(aRootUrl);
  3272. }
  3273. return joined;
  3274. }
  3275. exports.join = join;
  3276. exports.isAbsolute = function (aPath) {
  3277. return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
  3278. };
  3279. /**
  3280. * Make a path relative to a URL or another path.
  3281. *
  3282. * @param aRoot The root path or URL.
  3283. * @param aPath The path or URL to be made relative to aRoot.
  3284. */
  3285. function relative(aRoot, aPath) {
  3286. if (aRoot === "") {
  3287. aRoot = ".";
  3288. }
  3289. aRoot = aRoot.replace(/\/$/, '');
  3290. // It is possible for the path to be above the root. In this case, simply
  3291. // checking whether the root is a prefix of the path won't work. Instead, we
  3292. // need to remove components from the root one by one, until either we find
  3293. // a prefix that fits, or we run out of components to remove.
  3294. var level = 0;
  3295. while (aPath.indexOf(aRoot + '/') !== 0) {
  3296. var index = aRoot.lastIndexOf("/");
  3297. if (index < 0) {
  3298. return aPath;
  3299. }
  3300. // If the only part of the root that is left is the scheme (i.e. http://,
  3301. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  3302. // have exhausted all components, so the path is not relative to the root.
  3303. aRoot = aRoot.slice(0, index);
  3304. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  3305. return aPath;
  3306. }
  3307. ++level;
  3308. }
  3309. // Make sure we add a "../" for each component we removed from the root.
  3310. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  3311. }
  3312. exports.relative = relative;
  3313. var supportsNullProto = (function () {
  3314. var obj = Object.create(null);
  3315. return !('__proto__' in obj);
  3316. }());
  3317. function identity (s) {
  3318. return s;
  3319. }
  3320. /**
  3321. * Because behavior goes wacky when you set `__proto__` on objects, we
  3322. * have to prefix all the strings in our set with an arbitrary character.
  3323. *
  3324. * See https://github.com/mozilla/source-map/pull/31 and
  3325. * https://github.com/mozilla/source-map/issues/30
  3326. *
  3327. * @param String aStr
  3328. */
  3329. function toSetString(aStr) {
  3330. if (isProtoString(aStr)) {
  3331. return '$' + aStr;
  3332. }
  3333. return aStr;
  3334. }
  3335. exports.toSetString = supportsNullProto ? identity : toSetString;
  3336. function fromSetString(aStr) {
  3337. if (isProtoString(aStr)) {
  3338. return aStr.slice(1);
  3339. }
  3340. return aStr;
  3341. }
  3342. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  3343. function isProtoString(s) {
  3344. if (!s) {
  3345. return false;
  3346. }
  3347. var length = s.length;
  3348. if (length < 9 /* "__proto__".length */) {
  3349. return false;
  3350. }
  3351. if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
  3352. s.charCodeAt(length - 2) !== 95 /* '_' */ ||
  3353. s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
  3354. s.charCodeAt(length - 4) !== 116 /* 't' */ ||
  3355. s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
  3356. s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
  3357. s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
  3358. s.charCodeAt(length - 8) !== 95 /* '_' */ ||
  3359. s.charCodeAt(length - 9) !== 95 /* '_' */) {
  3360. return false;
  3361. }
  3362. for (var i = length - 10; i >= 0; i--) {
  3363. if (s.charCodeAt(i) !== 36 /* '$' */) {
  3364. return false;
  3365. }
  3366. }
  3367. return true;
  3368. }
  3369. /**
  3370. * Comparator between two mappings where the original positions are compared.
  3371. *
  3372. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  3373. * mappings with the same original source/line/column, but different generated
  3374. * line and column the same. Useful when searching for a mapping with a
  3375. * stubbed out mapping.
  3376. */
  3377. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  3378. var cmp = mappingA.source - mappingB.source;
  3379. if (cmp !== 0) {
  3380. return cmp;
  3381. }
  3382. cmp = mappingA.originalLine - mappingB.originalLine;
  3383. if (cmp !== 0) {
  3384. return cmp;
  3385. }
  3386. cmp = mappingA.originalColumn - mappingB.originalColumn;
  3387. if (cmp !== 0 || onlyCompareOriginal) {
  3388. return cmp;
  3389. }
  3390. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  3391. if (cmp !== 0) {
  3392. return cmp;
  3393. }
  3394. cmp = mappingA.generatedLine - mappingB.generatedLine;
  3395. if (cmp !== 0) {
  3396. return cmp;
  3397. }
  3398. return mappingA.name - mappingB.name;
  3399. }
  3400. exports.compareByOriginalPositions = compareByOriginalPositions;
  3401. /**
  3402. * Comparator between two mappings with deflated source and name indices where
  3403. * the generated positions are compared.
  3404. *
  3405. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  3406. * mappings with the same generated line and column, but different
  3407. * source/name/original line and column the same. Useful when searching for a
  3408. * mapping with a stubbed out mapping.
  3409. */
  3410. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  3411. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  3412. if (cmp !== 0) {
  3413. return cmp;
  3414. }
  3415. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  3416. if (cmp !== 0 || onlyCompareGenerated) {
  3417. return cmp;
  3418. }
  3419. cmp = mappingA.source - mappingB.source;
  3420. if (cmp !== 0) {
  3421. return cmp;
  3422. }
  3423. cmp = mappingA.originalLine - mappingB.originalLine;
  3424. if (cmp !== 0) {
  3425. return cmp;
  3426. }
  3427. cmp = mappingA.originalColumn - mappingB.originalColumn;
  3428. if (cmp !== 0) {
  3429. return cmp;
  3430. }
  3431. return mappingA.name - mappingB.name;
  3432. }
  3433. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  3434. function strcmp(aStr1, aStr2) {
  3435. if (aStr1 === aStr2) {
  3436. return 0;
  3437. }
  3438. if (aStr1 > aStr2) {
  3439. return 1;
  3440. }
  3441. return -1;
  3442. }
  3443. /**
  3444. * Comparator between two mappings with inflated source and name strings where
  3445. * the generated positions are compared.
  3446. */
  3447. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  3448. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  3449. if (cmp !== 0) {
  3450. return cmp;
  3451. }
  3452. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  3453. if (cmp !== 0) {
  3454. return cmp;
  3455. }
  3456. cmp = strcmp(mappingA.source, mappingB.source);
  3457. if (cmp !== 0) {
  3458. return cmp;
  3459. }
  3460. cmp = mappingA.originalLine - mappingB.originalLine;
  3461. if (cmp !== 0) {
  3462. return cmp;
  3463. }
  3464. cmp = mappingA.originalColumn - mappingB.originalColumn;
  3465. if (cmp !== 0) {
  3466. return cmp;
  3467. }
  3468. return strcmp(mappingA.name, mappingB.name);
  3469. }
  3470. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  3471. /***/ }),
  3472. /* 18 */
  3473. /***/ (function(module, exports, __webpack_require__) {
  3474. "use strict";
  3475. var isObject = __webpack_require__(120);
  3476. module.exports = function extend(o/*, objects*/) {
  3477. if (!isObject(o)) { o = {}; }
  3478. var len = arguments.length;
  3479. for (var i = 1; i < len; i++) {
  3480. var obj = arguments[i];
  3481. if (isObject(obj)) {
  3482. assign(o, obj);
  3483. }
  3484. }
  3485. return o;
  3486. };
  3487. function assign(a, b) {
  3488. for (var key in b) {
  3489. if (hasOwn(b, key)) {
  3490. a[key] = b[key];
  3491. }
  3492. }
  3493. }
  3494. /**
  3495. * Returns true if the given `key` is an own property of `obj`.
  3496. */
  3497. function hasOwn(obj, key) {
  3498. return Object.prototype.hasOwnProperty.call(obj, key);
  3499. }
  3500. /***/ }),
  3501. /* 19 */
  3502. /***/ (function(module, exports, __webpack_require__) {
  3503. "use strict";
  3504. var extend = __webpack_require__(18);
  3505. var engines = __webpack_require__(46);
  3506. var utils = __webpack_require__(24);
  3507. module.exports = function(options) {
  3508. var opts = extend({}, options);
  3509. // ensure that delimiters are an array
  3510. opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || '---');
  3511. if (opts.delimiters.length === 1) {
  3512. opts.delimiters.push(opts.delimiters[0]);
  3513. }
  3514. opts.language = (opts.language || opts.lang || 'yaml').toLowerCase();
  3515. opts.engines = extend({}, engines, opts.parsers, opts.engines);
  3516. return opts;
  3517. };
  3518. /***/ }),
  3519. /* 20 */
  3520. /***/ (function(module, exports, __webpack_require__) {
  3521. "use strict";
  3522. // JS-YAML's default schema for `load` function.
  3523. // It is not described in the YAML specification.
  3524. //
  3525. // This schema is based on JS-YAML's default safe schema and includes
  3526. // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
  3527. //
  3528. // Also this schema is used as default base schema at `Schema.create` function.
  3529. var Schema = __webpack_require__(7);
  3530. module.exports = Schema.DEFAULT = new Schema({
  3531. include: [
  3532. __webpack_require__(12)
  3533. ],
  3534. explicit: [
  3535. __webpack_require__(133),
  3536. __webpack_require__(132),
  3537. __webpack_require__(131)
  3538. ]
  3539. });
  3540. /***/ }),
  3541. /* 21 */
  3542. /***/ (function(module, exports, __webpack_require__) {
  3543. "use strict";
  3544. Object.defineProperty(exports, "__esModule", {
  3545. value: true
  3546. });
  3547. exports.default = lessStringify;
  3548. var _lessStringifier = __webpack_require__(147);
  3549. var _lessStringifier2 = _interopRequireDefault(_lessStringifier);
  3550. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3551. function lessStringify(node, builder) {
  3552. var str = new _lessStringifier2.default(builder);
  3553. str.stringify(node);
  3554. }
  3555. module.exports = exports['default'];
  3556. /***/ }),
  3557. /* 22 */
  3558. /***/ (function(module, exports, __webpack_require__) {
  3559. "use strict";
  3560. exports.__esModule = true;
  3561. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3562. var _declaration = __webpack_require__(55);
  3563. var _declaration2 = _interopRequireDefault(_declaration);
  3564. var _comment = __webpack_require__(28);
  3565. var _comment2 = _interopRequireDefault(_comment);
  3566. var _node = __webpack_require__(30);
  3567. var _node2 = _interopRequireDefault(_node);
  3568. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3569. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3570. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3571. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3572. function cleanSource(nodes) {
  3573. return nodes.map(function (i) {
  3574. if (i.nodes) i.nodes = cleanSource(i.nodes);
  3575. delete i.source;
  3576. return i;
  3577. });
  3578. }
  3579. /**
  3580. * The {@link Root}, {@link AtRule}, and {@link Rule} container nodes
  3581. * inherit some common methods to help work with their children.
  3582. *
  3583. * Note that all containers can store any content. If you write a rule inside
  3584. * a rule, PostCSS will parse it.
  3585. *
  3586. * @extends Node
  3587. * @abstract
  3588. */
  3589. var Container = function (_Node) {
  3590. _inherits(Container, _Node);
  3591. function Container() {
  3592. _classCallCheck(this, Container);
  3593. return _possibleConstructorReturn(this, _Node.apply(this, arguments));
  3594. }
  3595. Container.prototype.push = function push(child) {
  3596. child.parent = this;
  3597. this.nodes.push(child);
  3598. return this;
  3599. };
  3600. /**
  3601. * Iterates through the container’s immediate children,
  3602. * calling `callback` for each child.
  3603. *
  3604. * Returning `false` in the callback will break iteration.
  3605. *
  3606. * This method only iterates through the container’s immediate children.
  3607. * If you need to recursively iterate through all the container’s descendant
  3608. * nodes, use {@link Container#walk}.
  3609. *
  3610. * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
  3611. * if you are mutating the array of child nodes during iteration.
  3612. * PostCSS will adjust the current index to match the mutations.
  3613. *
  3614. * @param {childIterator} callback - iterator receives each node and index
  3615. *
  3616. * @return {false|undefined} returns `false` if iteration was broke
  3617. *
  3618. * @example
  3619. * const root = postcss.parse('a { color: black; z-index: 1 }');
  3620. * const rule = root.first;
  3621. *
  3622. * for ( let decl of rule.nodes ) {
  3623. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  3624. * // Cycle will be infinite, because cloneBefore moves the current node
  3625. * // to the next index
  3626. * }
  3627. *
  3628. * rule.each(decl => {
  3629. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  3630. * // Will be executed only for color and z-index
  3631. * });
  3632. */
  3633. Container.prototype.each = function each(callback) {
  3634. if (!this.lastEach) this.lastEach = 0;
  3635. if (!this.indexes) this.indexes = {};
  3636. this.lastEach += 1;
  3637. var id = this.lastEach;
  3638. this.indexes[id] = 0;
  3639. if (!this.nodes) return undefined;
  3640. var index = void 0,
  3641. result = void 0;
  3642. while (this.indexes[id] < this.nodes.length) {
  3643. index = this.indexes[id];
  3644. result = callback(this.nodes[index], index);
  3645. if (result === false) break;
  3646. this.indexes[id] += 1;
  3647. }
  3648. delete this.indexes[id];
  3649. return result;
  3650. };
  3651. /**
  3652. * Traverses the container’s descendant nodes, calling callback
  3653. * for each node.
  3654. *
  3655. * Like container.each(), this method is safe to use
  3656. * if you are mutating arrays during iteration.
  3657. *
  3658. * If you only need to iterate through the container’s immediate children,
  3659. * use {@link Container#each}.
  3660. *
  3661. * @param {childIterator} callback - iterator receives each node and index
  3662. *
  3663. * @return {false|undefined} returns `false` if iteration was broke
  3664. *
  3665. * @example
  3666. * root.walk(node => {
  3667. * // Traverses all descendant nodes.
  3668. * });
  3669. */
  3670. Container.prototype.walk = function walk(callback) {
  3671. return this.each(function (child, i) {
  3672. var result = callback(child, i);
  3673. if (result !== false && child.walk) {
  3674. result = child.walk(callback);
  3675. }
  3676. return result;
  3677. });
  3678. };
  3679. /**
  3680. * Traverses the container’s descendant nodes, calling callback
  3681. * for each declaration node.
  3682. *
  3683. * If you pass a filter, iteration will only happen over declarations
  3684. * with matching properties.
  3685. *
  3686. * Like {@link Container#each}, this method is safe
  3687. * to use if you are mutating arrays during iteration.
  3688. *
  3689. * @param {string|RegExp} [prop] - string or regular expression
  3690. * to filter declarations by property name
  3691. * @param {childIterator} callback - iterator receives each node and index
  3692. *
  3693. * @return {false|undefined} returns `false` if iteration was broke
  3694. *
  3695. * @example
  3696. * root.walkDecls(decl => {
  3697. * checkPropertySupport(decl.prop);
  3698. * });
  3699. *
  3700. * root.walkDecls('border-radius', decl => {
  3701. * decl.remove();
  3702. * });
  3703. *
  3704. * root.walkDecls(/^background/, decl => {
  3705. * decl.value = takeFirstColorFromGradient(decl.value);
  3706. * });
  3707. */
  3708. Container.prototype.walkDecls = function walkDecls(prop, callback) {
  3709. if (!callback) {
  3710. callback = prop;
  3711. return this.walk(function (child, i) {
  3712. if (child.type === 'decl') {
  3713. return callback(child, i);
  3714. }
  3715. });
  3716. } else if (prop instanceof RegExp) {
  3717. return this.walk(function (child, i) {
  3718. if (child.type === 'decl' && prop.test(child.prop)) {
  3719. return callback(child, i);
  3720. }
  3721. });
  3722. } else {
  3723. return this.walk(function (child, i) {
  3724. if (child.type === 'decl' && child.prop === prop) {
  3725. return callback(child, i);
  3726. }
  3727. });
  3728. }
  3729. };
  3730. /**
  3731. * Traverses the container’s descendant nodes, calling callback
  3732. * for each rule node.
  3733. *
  3734. * If you pass a filter, iteration will only happen over rules
  3735. * with matching selectors.
  3736. *
  3737. * Like {@link Container#each}, this method is safe
  3738. * to use if you are mutating arrays during iteration.
  3739. *
  3740. * @param {string|RegExp} [selector] - string or regular expression
  3741. * to filter rules by selector
  3742. * @param {childIterator} callback - iterator receives each node and index
  3743. *
  3744. * @return {false|undefined} returns `false` if iteration was broke
  3745. *
  3746. * @example
  3747. * const selectors = [];
  3748. * root.walkRules(rule => {
  3749. * selectors.push(rule.selector);
  3750. * });
  3751. * console.log(`Your CSS uses ${selectors.length} selectors`);
  3752. */
  3753. Container.prototype.walkRules = function walkRules(selector, callback) {
  3754. if (!callback) {
  3755. callback = selector;
  3756. return this.walk(function (child, i) {
  3757. if (child.type === 'rule') {
  3758. return callback(child, i);
  3759. }
  3760. });
  3761. } else if (selector instanceof RegExp) {
  3762. return this.walk(function (child, i) {
  3763. if (child.type === 'rule' && selector.test(child.selector)) {
  3764. return callback(child, i);
  3765. }
  3766. });
  3767. } else {
  3768. return this.walk(function (child, i) {
  3769. if (child.type === 'rule' && child.selector === selector) {
  3770. return callback(child, i);
  3771. }
  3772. });
  3773. }
  3774. };
  3775. /**
  3776. * Traverses the container’s descendant nodes, calling callback
  3777. * for each at-rule node.
  3778. *
  3779. * If you pass a filter, iteration will only happen over at-rules
  3780. * that have matching names.
  3781. *
  3782. * Like {@link Container#each}, this method is safe
  3783. * to use if you are mutating arrays during iteration.
  3784. *
  3785. * @param {string|RegExp} [name] - string or regular expression
  3786. * to filter at-rules by name
  3787. * @param {childIterator} callback - iterator receives each node and index
  3788. *
  3789. * @return {false|undefined} returns `false` if iteration was broke
  3790. *
  3791. * @example
  3792. * root.walkAtRules(rule => {
  3793. * if ( isOld(rule.name) ) rule.remove();
  3794. * });
  3795. *
  3796. * let first = false;
  3797. * root.walkAtRules('charset', rule => {
  3798. * if ( !first ) {
  3799. * first = true;
  3800. * } else {
  3801. * rule.remove();
  3802. * }
  3803. * });
  3804. */
  3805. Container.prototype.walkAtRules = function walkAtRules(name, callback) {
  3806. if (!callback) {
  3807. callback = name;
  3808. return this.walk(function (child, i) {
  3809. if (child.type === 'atrule') {
  3810. return callback(child, i);
  3811. }
  3812. });
  3813. } else if (name instanceof RegExp) {
  3814. return this.walk(function (child, i) {
  3815. if (child.type === 'atrule' && name.test(child.name)) {
  3816. return callback(child, i);
  3817. }
  3818. });
  3819. } else {
  3820. return this.walk(function (child, i) {
  3821. if (child.type === 'atrule' && child.name === name) {
  3822. return callback(child, i);
  3823. }
  3824. });
  3825. }
  3826. };
  3827. /**
  3828. * Traverses the container’s descendant nodes, calling callback
  3829. * for each comment node.
  3830. *
  3831. * Like {@link Container#each}, this method is safe
  3832. * to use if you are mutating arrays during iteration.
  3833. *
  3834. * @param {childIterator} callback - iterator receives each node and index
  3835. *
  3836. * @return {false|undefined} returns `false` if iteration was broke
  3837. *
  3838. * @example
  3839. * root.walkComments(comment => {
  3840. * comment.remove();
  3841. * });
  3842. */
  3843. Container.prototype.walkComments = function walkComments(callback) {
  3844. return this.walk(function (child, i) {
  3845. if (child.type === 'comment') {
  3846. return callback(child, i);
  3847. }
  3848. });
  3849. };
  3850. /**
  3851. * Inserts new nodes to the end of the container.
  3852. *
  3853. * @param {...(Node|object|string|Node[])} children - new nodes
  3854. *
  3855. * @return {Node} this node for methods chain
  3856. *
  3857. * @example
  3858. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  3859. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  3860. * rule.append(decl1, decl2);
  3861. *
  3862. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  3863. * root.append({ selector: 'a' }); // rule
  3864. * rule.append({ prop: 'color', value: 'black' }); // declaration
  3865. * rule.append({ text: 'Comment' }) // comment
  3866. *
  3867. * root.append('a {}');
  3868. * root.first.append('color: black; z-index: 1');
  3869. */
  3870. Container.prototype.append = function append() {
  3871. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  3872. children[_key] = arguments[_key];
  3873. }
  3874. for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  3875. var _ref;
  3876. if (_isArray) {
  3877. if (_i >= _iterator.length) break;
  3878. _ref = _iterator[_i++];
  3879. } else {
  3880. _i = _iterator.next();
  3881. if (_i.done) break;
  3882. _ref = _i.value;
  3883. }
  3884. var child = _ref;
  3885. var nodes = this.normalize(child, this.last);
  3886. for (var _iterator2 = nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  3887. var _ref2;
  3888. if (_isArray2) {
  3889. if (_i2 >= _iterator2.length) break;
  3890. _ref2 = _iterator2[_i2++];
  3891. } else {
  3892. _i2 = _iterator2.next();
  3893. if (_i2.done) break;
  3894. _ref2 = _i2.value;
  3895. }
  3896. var node = _ref2;
  3897. this.nodes.push(node);
  3898. }
  3899. }
  3900. return this;
  3901. };
  3902. /**
  3903. * Inserts new nodes to the start of the container.
  3904. *
  3905. * @param {...(Node|object|string|Node[])} children - new nodes
  3906. *
  3907. * @return {Node} this node for methods chain
  3908. *
  3909. * @example
  3910. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  3911. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  3912. * rule.prepend(decl1, decl2);
  3913. *
  3914. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  3915. * root.append({ selector: 'a' }); // rule
  3916. * rule.append({ prop: 'color', value: 'black' }); // declaration
  3917. * rule.append({ text: 'Comment' }) // comment
  3918. *
  3919. * root.append('a {}');
  3920. * root.first.append('color: black; z-index: 1');
  3921. */
  3922. Container.prototype.prepend = function prepend() {
  3923. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  3924. children[_key2] = arguments[_key2];
  3925. }
  3926. children = children.reverse();
  3927. for (var _iterator3 = children, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  3928. var _ref3;
  3929. if (_isArray3) {
  3930. if (_i3 >= _iterator3.length) break;
  3931. _ref3 = _iterator3[_i3++];
  3932. } else {
  3933. _i3 = _iterator3.next();
  3934. if (_i3.done) break;
  3935. _ref3 = _i3.value;
  3936. }
  3937. var child = _ref3;
  3938. var nodes = this.normalize(child, this.first, 'prepend').reverse();
  3939. for (var _iterator4 = nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  3940. var _ref4;
  3941. if (_isArray4) {
  3942. if (_i4 >= _iterator4.length) break;
  3943. _ref4 = _iterator4[_i4++];
  3944. } else {
  3945. _i4 = _iterator4.next();
  3946. if (_i4.done) break;
  3947. _ref4 = _i4.value;
  3948. }
  3949. var node = _ref4;
  3950. this.nodes.unshift(node);
  3951. }for (var id in this.indexes) {
  3952. this.indexes[id] = this.indexes[id] + nodes.length;
  3953. }
  3954. }
  3955. return this;
  3956. };
  3957. Container.prototype.cleanRaws = function cleanRaws(keepBetween) {
  3958. _Node.prototype.cleanRaws.call(this, keepBetween);
  3959. if (this.nodes) {
  3960. for (var _iterator5 = this.nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  3961. var _ref5;
  3962. if (_isArray5) {
  3963. if (_i5 >= _iterator5.length) break;
  3964. _ref5 = _iterator5[_i5++];
  3965. } else {
  3966. _i5 = _iterator5.next();
  3967. if (_i5.done) break;
  3968. _ref5 = _i5.value;
  3969. }
  3970. var node = _ref5;
  3971. node.cleanRaws(keepBetween);
  3972. }
  3973. }
  3974. };
  3975. /**
  3976. * Insert new node before old node within the container.
  3977. *
  3978. * @param {Node|number} exist - child or child’s index.
  3979. * @param {Node|object|string|Node[]} add - new node
  3980. *
  3981. * @return {Node} this node for methods chain
  3982. *
  3983. * @example
  3984. * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
  3985. */
  3986. Container.prototype.insertBefore = function insertBefore(exist, add) {
  3987. exist = this.index(exist);
  3988. var type = exist === 0 ? 'prepend' : false;
  3989. var nodes = this.normalize(add, this.nodes[exist], type).reverse();
  3990. for (var _iterator6 = nodes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
  3991. var _ref6;
  3992. if (_isArray6) {
  3993. if (_i6 >= _iterator6.length) break;
  3994. _ref6 = _iterator6[_i6++];
  3995. } else {
  3996. _i6 = _iterator6.next();
  3997. if (_i6.done) break;
  3998. _ref6 = _i6.value;
  3999. }
  4000. var node = _ref6;
  4001. this.nodes.splice(exist, 0, node);
  4002. }var index = void 0;
  4003. for (var id in this.indexes) {
  4004. index = this.indexes[id];
  4005. if (exist <= index) {
  4006. this.indexes[id] = index + nodes.length;
  4007. }
  4008. }
  4009. return this;
  4010. };
  4011. /**
  4012. * Insert new node after old node within the container.
  4013. *
  4014. * @param {Node|number} exist - child or child’s index
  4015. * @param {Node|object|string|Node[]} add - new node
  4016. *
  4017. * @return {Node} this node for methods chain
  4018. */
  4019. Container.prototype.insertAfter = function insertAfter(exist, add) {
  4020. exist = this.index(exist);
  4021. var nodes = this.normalize(add, this.nodes[exist]).reverse();
  4022. for (var _iterator7 = nodes, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
  4023. var _ref7;
  4024. if (_isArray7) {
  4025. if (_i7 >= _iterator7.length) break;
  4026. _ref7 = _iterator7[_i7++];
  4027. } else {
  4028. _i7 = _iterator7.next();
  4029. if (_i7.done) break;
  4030. _ref7 = _i7.value;
  4031. }
  4032. var node = _ref7;
  4033. this.nodes.splice(exist + 1, 0, node);
  4034. }var index = void 0;
  4035. for (var id in this.indexes) {
  4036. index = this.indexes[id];
  4037. if (exist < index) {
  4038. this.indexes[id] = index + nodes.length;
  4039. }
  4040. }
  4041. return this;
  4042. };
  4043. /**
  4044. * Removes node from the container and cleans the parent properties
  4045. * from the node and its children.
  4046. *
  4047. * @param {Node|number} child - child or child’s index
  4048. *
  4049. * @return {Node} this node for methods chain
  4050. *
  4051. * @example
  4052. * rule.nodes.length //=> 5
  4053. * rule.removeChild(decl);
  4054. * rule.nodes.length //=> 4
  4055. * decl.parent //=> undefined
  4056. */
  4057. Container.prototype.removeChild = function removeChild(child) {
  4058. child = this.index(child);
  4059. this.nodes[child].parent = undefined;
  4060. this.nodes.splice(child, 1);
  4061. var index = void 0;
  4062. for (var id in this.indexes) {
  4063. index = this.indexes[id];
  4064. if (index >= child) {
  4065. this.indexes[id] = index - 1;
  4066. }
  4067. }
  4068. return this;
  4069. };
  4070. /**
  4071. * Removes all children from the container
  4072. * and cleans their parent properties.
  4073. *
  4074. * @return {Node} this node for methods chain
  4075. *
  4076. * @example
  4077. * rule.removeAll();
  4078. * rule.nodes.length //=> 0
  4079. */
  4080. Container.prototype.removeAll = function removeAll() {
  4081. for (var _iterator8 = this.nodes, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
  4082. var _ref8;
  4083. if (_isArray8) {
  4084. if (_i8 >= _iterator8.length) break;
  4085. _ref8 = _iterator8[_i8++];
  4086. } else {
  4087. _i8 = _iterator8.next();
  4088. if (_i8.done) break;
  4089. _ref8 = _i8.value;
  4090. }
  4091. var node = _ref8;
  4092. node.parent = undefined;
  4093. }this.nodes = [];
  4094. return this;
  4095. };
  4096. /**
  4097. * Passes all declaration values within the container that match pattern
  4098. * through callback, replacing those values with the returned result
  4099. * of callback.
  4100. *
  4101. * This method is useful if you are using a custom unit or function
  4102. * and need to iterate through all values.
  4103. *
  4104. * @param {string|RegExp} pattern - replace pattern
  4105. * @param {object} opts - options to speed up the search
  4106. * @param {string|string[]} opts.props - an array of property names
  4107. * @param {string} opts.fast - string that’s used
  4108. * to narrow down values and speed up
  4109. the regexp search
  4110. * @param {function|string} callback - string to replace pattern
  4111. * or callback that returns a new
  4112. * value.
  4113. * The callback will receive
  4114. * the same arguments as those
  4115. * passed to a function parameter
  4116. * of `String#replace`.
  4117. *
  4118. * @return {Node} this node for methods chain
  4119. *
  4120. * @example
  4121. * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
  4122. * return 15 * parseInt(string) + 'px';
  4123. * });
  4124. */
  4125. Container.prototype.replaceValues = function replaceValues(pattern, opts, callback) {
  4126. if (!callback) {
  4127. callback = opts;
  4128. opts = {};
  4129. }
  4130. this.walkDecls(function (decl) {
  4131. if (opts.props && opts.props.indexOf(decl.prop) === -1) return;
  4132. if (opts.fast && decl.value.indexOf(opts.fast) === -1) return;
  4133. decl.value = decl.value.replace(pattern, callback);
  4134. });
  4135. return this;
  4136. };
  4137. /**
  4138. * Returns `true` if callback returns `true`
  4139. * for all of the container’s children.
  4140. *
  4141. * @param {childCondition} condition - iterator returns true or false.
  4142. *
  4143. * @return {boolean} is every child pass condition
  4144. *
  4145. * @example
  4146. * const noPrefixes = rule.every(i => i.prop[0] !== '-');
  4147. */
  4148. Container.prototype.every = function every(condition) {
  4149. return this.nodes.every(condition);
  4150. };
  4151. /**
  4152. * Returns `true` if callback returns `true` for (at least) one
  4153. * of the container’s children.
  4154. *
  4155. * @param {childCondition} condition - iterator returns true or false.
  4156. *
  4157. * @return {boolean} is some child pass condition
  4158. *
  4159. * @example
  4160. * const hasPrefix = rule.some(i => i.prop[0] === '-');
  4161. */
  4162. Container.prototype.some = function some(condition) {
  4163. return this.nodes.some(condition);
  4164. };
  4165. /**
  4166. * Returns a `child`’s index within the {@link Container#nodes} array.
  4167. *
  4168. * @param {Node} child - child of the current container.
  4169. *
  4170. * @return {number} child index
  4171. *
  4172. * @example
  4173. * rule.index( rule.nodes[2] ) //=> 2
  4174. */
  4175. Container.prototype.index = function index(child) {
  4176. if (typeof child === 'number') {
  4177. return child;
  4178. } else {
  4179. return this.nodes.indexOf(child);
  4180. }
  4181. };
  4182. /**
  4183. * The container’s first child.
  4184. *
  4185. * @type {Node}
  4186. *
  4187. * @example
  4188. * rule.first == rules.nodes[0];
  4189. */
  4190. Container.prototype.normalize = function normalize(nodes, sample) {
  4191. var _this2 = this;
  4192. if (typeof nodes === 'string') {
  4193. var parse = __webpack_require__(57);
  4194. nodes = cleanSource(parse(nodes).nodes);
  4195. } else if (Array.isArray(nodes)) {
  4196. nodes = nodes.slice(0);
  4197. for (var _iterator9 = nodes, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
  4198. var _ref9;
  4199. if (_isArray9) {
  4200. if (_i9 >= _iterator9.length) break;
  4201. _ref9 = _iterator9[_i9++];
  4202. } else {
  4203. _i9 = _iterator9.next();
  4204. if (_i9.done) break;
  4205. _ref9 = _i9.value;
  4206. }
  4207. var i = _ref9;
  4208. if (i.parent) i.parent.removeChild(i, 'ignore');
  4209. }
  4210. } else if (nodes.type === 'root') {
  4211. nodes = nodes.nodes.slice(0);
  4212. for (var _iterator10 = nodes, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
  4213. var _ref10;
  4214. if (_isArray10) {
  4215. if (_i11 >= _iterator10.length) break;
  4216. _ref10 = _iterator10[_i11++];
  4217. } else {
  4218. _i11 = _iterator10.next();
  4219. if (_i11.done) break;
  4220. _ref10 = _i11.value;
  4221. }
  4222. var _i10 = _ref10;
  4223. if (_i10.parent) _i10.parent.removeChild(_i10, 'ignore');
  4224. }
  4225. } else if (nodes.type) {
  4226. nodes = [nodes];
  4227. } else if (nodes.prop) {
  4228. if (typeof nodes.value === 'undefined') {
  4229. throw new Error('Value field is missed in node creation');
  4230. } else if (typeof nodes.value !== 'string') {
  4231. nodes.value = String(nodes.value);
  4232. }
  4233. nodes = [new _declaration2.default(nodes)];
  4234. } else if (nodes.selector) {
  4235. var Rule = __webpack_require__(31);
  4236. nodes = [new Rule(nodes)];
  4237. } else if (nodes.name) {
  4238. var AtRule = __webpack_require__(27);
  4239. nodes = [new AtRule(nodes)];
  4240. } else if (nodes.text) {
  4241. nodes = [new _comment2.default(nodes)];
  4242. } else {
  4243. throw new Error('Unknown node type in node creation');
  4244. }
  4245. var processed = nodes.map(function (i) {
  4246. if (typeof i.before !== 'function') i = _this2.rebuild(i);
  4247. if (i.parent) i.parent.removeChild(i);
  4248. if (typeof i.raws.before === 'undefined') {
  4249. if (sample && typeof sample.raws.before !== 'undefined') {
  4250. i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
  4251. }
  4252. }
  4253. i.parent = _this2;
  4254. return i;
  4255. });
  4256. return processed;
  4257. };
  4258. Container.prototype.rebuild = function rebuild(node, parent) {
  4259. var _this3 = this;
  4260. var fix = void 0;
  4261. if (node.type === 'root') {
  4262. var Root = __webpack_require__(59);
  4263. fix = new Root();
  4264. } else if (node.type === 'atrule') {
  4265. var AtRule = __webpack_require__(27);
  4266. fix = new AtRule();
  4267. } else if (node.type === 'rule') {
  4268. var Rule = __webpack_require__(31);
  4269. fix = new Rule();
  4270. } else if (node.type === 'decl') {
  4271. fix = new _declaration2.default();
  4272. } else if (node.type === 'comment') {
  4273. fix = new _comment2.default();
  4274. }
  4275. for (var i in node) {
  4276. if (i === 'nodes') {
  4277. fix.nodes = node.nodes.map(function (j) {
  4278. return _this3.rebuild(j, fix);
  4279. });
  4280. } else if (i === 'parent' && parent) {
  4281. fix.parent = parent;
  4282. } else if (node.hasOwnProperty(i)) {
  4283. fix[i] = node[i];
  4284. }
  4285. }
  4286. return fix;
  4287. };
  4288. /**
  4289. * @memberof Container#
  4290. * @member {Node[]} nodes - an array containing the container’s children
  4291. *
  4292. * @example
  4293. * const root = postcss.parse('a { color: black }');
  4294. * root.nodes.length //=> 1
  4295. * root.nodes[0].selector //=> 'a'
  4296. * root.nodes[0].nodes[0].prop //=> 'color'
  4297. */
  4298. _createClass(Container, [{
  4299. key: 'first',
  4300. get: function get() {
  4301. if (!this.nodes) return undefined;
  4302. return this.nodes[0];
  4303. }
  4304. /**
  4305. * The container’s last child.
  4306. *
  4307. * @type {Node}
  4308. *
  4309. * @example
  4310. * rule.last == rule.nodes[rule.nodes.length - 1];
  4311. */
  4312. }, {
  4313. key: 'last',
  4314. get: function get() {
  4315. if (!this.nodes) return undefined;
  4316. return this.nodes[this.nodes.length - 1];
  4317. }
  4318. }]);
  4319. return Container;
  4320. }(_node2.default);
  4321. exports.default = Container;
  4322. /**
  4323. * @callback childCondition
  4324. * @param {Node} node - container child
  4325. * @param {number} index - child index
  4326. * @param {Node[]} nodes - all container children
  4327. * @return {boolean}
  4328. */
  4329. /**
  4330. * @callback childIterator
  4331. * @param {Node} node - container child
  4332. * @param {number} index - child index
  4333. * @return {false|undefined} returning `false` will break iteration
  4334. */
  4335. module.exports = exports['default'];
  4336. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRhaW5lci5lczYiXSwibmFtZXMiOlsiY2xlYW5Tb3VyY2UiLCJub2RlcyIsIm1hcCIsImkiLCJzb3VyY2UiLCJDb250YWluZXIiLCJwdXNoIiwiY2hpbGQiLCJwYXJlbnQiLCJlYWNoIiwiY2FsbGJhY2siLCJsYXN0RWFjaCIsImluZGV4ZXMiLCJpZCIsInVuZGVmaW5lZCIsImluZGV4IiwicmVzdWx0IiwibGVuZ3RoIiwid2FsayIsIndhbGtEZWNscyIsInByb3AiLCJ0eXBlIiwiUmVnRXhwIiwidGVzdCIsIndhbGtSdWxlcyIsInNlbGVjdG9yIiwid2Fsa0F0UnVsZXMiLCJuYW1lIiwid2Fsa0NvbW1lbnRzIiwi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bmQvLCBkZWNsID0+IHtcbiAgICAgKiAgIGRlY2wudmFsdWUgPSB0YWtlRmlyc3RDb2xvckZyb21HcmFkaWVudChkZWNsLnZhbHVlKTtcbiAgICAgKiB9KTtcbiAgICAgKi9cbiAgICB3YWxrRGVjbHMocHJvcCwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IHByb3A7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmICggcHJvcCBpbnN0YW5jZW9mIFJlZ0V4cCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2RlY2wnICYmIHByb3AudGVzdChjaGlsZC5wcm9wKSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2RlY2wnICYmIGNoaWxkLnByb3AgPT09IHByb3AgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAg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HVzZXMgJHtzZWxlY3RvcnMubGVuZ3RofSBzZWxlY3RvcnNgKTtcbiAgICAgKi9cbiAgICB3YWxrUnVsZXMoc2VsZWN0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgIGlmICggIWNhbGxiYWNrICkge1xuICAgICAgICAgICAgY2FsbGJhY2sgPSBzZWxlY3RvcjtcblxuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAncnVsZScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoIHNlbGVjdG9yIGluc3RhbmNlb2YgUmVnRXhwICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAncnVsZScgJiYgc2VsZWN0b3IudGVzdChjaGlsZC5zZWxlY3RvcikgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdydWxlJyAmJiBjaGlsZC5zZWxlY3RvciA9PT0gc2VsZWN0b3IgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUcmF2ZXJzZXMgd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bGUgPT4ge1xuICAgICAqICAgaWYgKCAhZmlyc3QgKSB7XG4gICAgICogICAgIGZpcnN0ID0gdHJ1ZTtcbiAgICAgKiAgIH0gZWxzZSB7XG4gICAgICogICAgIHJ1bGUucmVtb3ZlKCk7XG4gICAgICogICB9XG4gICAgICogfSk7XG4gICAgICovXG4gICAgd2Fsa0F0UnVsZXMobmFtZSwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IG5hbWU7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdhdHJ1bGUnICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soY2hpbGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKCBuYW1lIGluc3RhbmNlb2YgUmVnRXhwICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAnYXRydWxlJyAmJiBuYW1lLnRlc3QoY2hpbGQubmFtZSkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdhdHJ1bGUnICYmIGNoaWxkLm5hbWUgPT09IG5hbWUgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUcmF2ZXJzZXMgdGhlIGNvbnRhaW5lcuKAmXMgZGVzY2VuZGFudCBub2RlcywgY2FsbGluZyBjYWxsYmFja1xuICAgICAqIGZvciBlYWNoIGNvbW1lbnQgbm9kZS5cbiAgICAgKlxuICAgICAqIExpa2Uge0BsaW5rIENvbnRhaW5lciNlYWNofSwgdGhpcyBtZXRob2QgaXMgc2FmZVxuICAgICAqIHRvIHVzZSBpZiB5b3UgYXJlIG11dGF0aW5nIGFycmF5cyBkdXJpbmcgaXRlcmF0aW9uLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtjaGlsZEl0ZXJhdG9yfSBjYWxsYmFjayAtIGl0ZXJhdG9yIHJlY2VpdmVzIGVhY2ggbm9kZSBhbmQgaW5kZXhcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge2ZhbHNlfHVuZGVmaW5lZH0gcmV0dXJucyBgZmFsc2VgIGlmIGl0ZXJhdGlvbiB3YXMgYnJva2VcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcm9vdC53YWxrQ29tbWVudHMoY29tbWVudCA9PiB7XG4gICAgICogICBjb21tZW50LnJlbW92ZSgpO1xuICAgICAqIH0pO1xuICAgICAqL1xuICAgIHdhbGtDb21tZW50cyhjYWxsYmFjaykge1xuICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluc2VydHMgbmV3IG5vZGVzIHRvIHRoZSBlbmQgb2YgdGhlIGNvbnRhaW5lci5cbiAgICAgKlxuICAgICAqIEB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AgICAgLSBzdHJpbmcgdGhhdOKAmXMgdXNlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gbmFycm93IGRvd24gdmFsdWVzIGFuZCBzcGVlZCB1cFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHJlZ2V4cCBzZWFyY2hcbiAgICAgKiBAcGFyYW0ge2Z1bmN0aW9ufHN0cmluZ30gY2FsbGJhY2sgICAtIHN0cmluZyB0byByZXBsYWNlIHBhdHRlcm5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yIGNhbGxiYWNrIHRoYXQgcmV0dXJucyBhIG5ld1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgY2FsbGJhY2sgd2lsbCByZWNlaXZlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgc2FtZSBhcmd1bWVudHMgYXMgdGhvc2VcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhc3NlZCB0byBhIGZ1bmN0aW9uIHBhcmFtZXRlclxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2YgYFN0cmluZyNyZXBsYWNlYC5cbiAgICAgKlxuICAgICAqIEByZXR1cm4ge05vZGV9IHRoaXMgbm9kZSBmb3IgbWV0aG9kcyBjaGFpblxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiByb290LnJlcGxhY2VWYWx1ZXMoL1xcZCtyZW0vLCB7IGZhc3Q6ICdyZW0nIH0sIHN0cmluZyA9PiB7XG4gICAgICogICByZXR1cm4gMTUgKiBwYXJzZUludChzdHJpbmcpICsgJ3B4JztcbiAgICAgKiB9KTtcbiAgICAgKi9cbi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FycmF5KG5vZGVzKSApIHtcbiAgICAgICAgICAgIG5vZGVzID0gbm9kZXMuc2xpY2UoMCk7XG4gICAgICAgICAgICBmb3IgKCBsZXQgaSBvZiBub2RlcyApIHtcbiAgICAgICAgICAgICAgICBpZiAoIGkucGFyZW50ICkgaS5wYXJlbnQucmVtb3ZlQ2hpbGQoaSwgJ2lnbm9yZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy50eXBlID09PSAncm9vdCcgKSB7XG4gICAgICAgICAgICBub2RlcyA9IG5vZGVzLm5vZGVzLnNsaWNlKDApO1xuICAgICAgICAgICAgZm9yICggbGV0IGkgb2Ygbm9kZXMgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBpLnBhcmVudCApIGkucGFyZW50LnJlbW92ZUNoaWxkKGksICdpZ25vcmUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICggbm9kZXMudHlwZSApIHtcbiAgICAgICAgICAgIG5vZGVzID0gW25vZGVzXTtcbiAgICAgICAgfSBlbHNlIGlmICggbm9kZXMucHJvcCApIHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIG5vZGVzLnZhbHVlID09PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1ZhbHVlIGZpZWxkIGlzIG1pc3NlZCBpbiBub2RlIGNyZWF0aW9uJyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2Ygbm9kZXMudmFsdWUgIT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgICAgIG5vZGVzLnZhbHVlID0gU3RyaW5nKG5vZGVzLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5vZGVzID0gW25ldyBEZWNsYXJhdGlvbihub2RlcyldO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy5zZWxlY3RvciApIHtcbiAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICBub2RlcyA9IFtuZXcgUnVsZShub2RlcyldO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy5uYW1lICkge1xuICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgbm9kZXMgPSBbbmV3IEF0UnVsZShub2RlcyldO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy50ZXh0ICkge1xuICAgICAgICAgICAgbm9kZXMgPSBbbmV3IENvbW1lbnQobm9kZXMpXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5rbm93biBub2RlIHR5cGUgaW4gbm9kZSBjcmVhdGlvbicpO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHByb2Nlc3NlZCA9IG5vZGVzLm1hcCggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpLmJlZm9yZSAhPT0gJ2Z1bmN0aW9uJyApIGkgPSB0aGlzLnJlYnVpbGQoaSk7XG5cbiAgICAgICAgICAgIGlmICggaS5wYXJlbnQgKSBpLnBhcmVudC5yZW1vdmVDaGlsZChpKTtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIGlmICggc2FtcGxlICYmIHR5cGVvZiBzYW1wbGUucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICBpLnJhd3MuYmVmb3JlID0gc2FtcGxlLnJhd3MuYmVmb3JlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaS5wYXJlbnQgPSB0aGlzO1xuICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcm9jZXNzZWQ7XG4gICAgfVxuXG4gICAgcmVidWlsZChub2RlLCBwYXJlbnQpIHtcbiAgICAgICAgbGV0IGZpeDtcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgPT09ICdyb290JyApIHtcbiAgICAgICAgICAgIGxldCBSb290ID0gcmVxdWlyZSgnLi9yb290Jyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUm9vdCgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdhdHJ1bGUnICkge1xuICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgZml4ID0gbmV3IEF0UnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBEZWNsYXJhdGlvbigpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBDb21tZW50KCk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKCBsZXQgaSBpbiBub2RlICkge1xuICAgICAgICAgICAgaWYgKCBpID09PSAnbm9kZXMnICkge1xuICAgICAgICAgICAgICAgIGZpeC5ub2RlcyA9IG5vZGUubm9kZXMubWFwKCBqID0+IHRoaXMucmVidWlsZChqLCBmaXgpICk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBpID09PSAncGFyZW50JyAmJiBwYXJlbnQgKSB7XG4gICAgICAgICAgICAgICAgZml4LnBhcmVudCA9IHBhcmVudDtcbiAgIC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BpbmRleFxuICogQHJldHVybiB7ZmFsc2V8dW5kZWZpbmVkfSByZXR1cm5pbmcgYGZhbHNlYCB3aWxsIGJyZWFrIGl0ZXJhdGlvblxuICovXG4iXX0=
  4337. /***/ }),
  4338. /* 23 */
  4339. /***/ (function(module, exports) {
  4340. // shim for using process in browser
  4341. var process = module.exports = {};
  4342. // cached from whatever global is present so that test runners that stub it
  4343. // don't break things. But we need to wrap it in a try catch in case it is
  4344. // wrapped in strict mode code which doesn't define any globals. It's inside a
  4345. // function because try/catches deoptimize in certain engines.
  4346. var cachedSetTimeout;
  4347. var cachedClearTimeout;
  4348. function defaultSetTimout() {
  4349. throw new Error('setTimeout has not been defined');
  4350. }
  4351. function defaultClearTimeout () {
  4352. throw new Error('clearTimeout has not been defined');
  4353. }
  4354. (function () {
  4355. try {
  4356. if (typeof setTimeout === 'function') {
  4357. cachedSetTimeout = setTimeout;
  4358. } else {
  4359. cachedSetTimeout = defaultSetTimout;
  4360. }
  4361. } catch (e) {
  4362. cachedSetTimeout = defaultSetTimout;
  4363. }
  4364. try {
  4365. if (typeof clearTimeout === 'function') {
  4366. cachedClearTimeout = clearTimeout;
  4367. } else {
  4368. cachedClearTimeout = defaultClearTimeout;
  4369. }
  4370. } catch (e) {
  4371. cachedClearTimeout = defaultClearTimeout;
  4372. }
  4373. } ())
  4374. function runTimeout(fun) {
  4375. if (cachedSetTimeout === setTimeout) {
  4376. //normal enviroments in sane situations
  4377. return setTimeout(fun, 0);
  4378. }
  4379. // if setTimeout wasn't available but was latter defined
  4380. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  4381. cachedSetTimeout = setTimeout;
  4382. return setTimeout(fun, 0);
  4383. }
  4384. try {
  4385. // when when somebody has screwed with setTimeout but no I.E. maddness
  4386. return cachedSetTimeout(fun, 0);
  4387. } catch(e){
  4388. try {
  4389. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  4390. return cachedSetTimeout.call(null, fun, 0);
  4391. } catch(e){
  4392. // 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
  4393. return cachedSetTimeout.call(this, fun, 0);
  4394. }
  4395. }
  4396. }
  4397. function runClearTimeout(marker) {
  4398. if (cachedClearTimeout === clearTimeout) {
  4399. //normal enviroments in sane situations
  4400. return clearTimeout(marker);
  4401. }
  4402. // if clearTimeout wasn't available but was latter defined
  4403. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  4404. cachedClearTimeout = clearTimeout;
  4405. return clearTimeout(marker);
  4406. }
  4407. try {
  4408. // when when somebody has screwed with setTimeout but no I.E. maddness
  4409. return cachedClearTimeout(marker);
  4410. } catch (e){
  4411. try {
  4412. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  4413. return cachedClearTimeout.call(null, marker);
  4414. } catch (e){
  4415. // 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.
  4416. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  4417. return cachedClearTimeout.call(this, marker);
  4418. }
  4419. }
  4420. }
  4421. var queue = [];
  4422. var draining = false;
  4423. var currentQueue;
  4424. var queueIndex = -1;
  4425. function cleanUpNextTick() {
  4426. if (!draining || !currentQueue) {
  4427. return;
  4428. }
  4429. draining = false;
  4430. if (currentQueue.length) {
  4431. queue = currentQueue.concat(queue);
  4432. } else {
  4433. queueIndex = -1;
  4434. }
  4435. if (queue.length) {
  4436. drainQueue();
  4437. }
  4438. }
  4439. function drainQueue() {
  4440. if (draining) {
  4441. return;
  4442. }
  4443. var timeout = runTimeout(cleanUpNextTick);
  4444. draining = true;
  4445. var len = queue.length;
  4446. while(len) {
  4447. currentQueue = queue;
  4448. queue = [];
  4449. while (++queueIndex < len) {
  4450. if (currentQueue) {
  4451. currentQueue[queueIndex].run();
  4452. }
  4453. }
  4454. queueIndex = -1;
  4455. len = queue.length;
  4456. }
  4457. currentQueue = null;
  4458. draining = false;
  4459. runClearTimeout(timeout);
  4460. }
  4461. process.nextTick = function (fun) {
  4462. var args = new Array(arguments.length - 1);
  4463. if (arguments.length > 1) {
  4464. for (var i = 1; i < arguments.length; i++) {
  4465. args[i - 1] = arguments[i];
  4466. }
  4467. }
  4468. queue.push(new Item(fun, args));
  4469. if (queue.length === 1 && !draining) {
  4470. runTimeout(drainQueue);
  4471. }
  4472. };
  4473. // v8 likes predictible objects
  4474. function Item(fun, array) {
  4475. this.fun = fun;
  4476. this.array = array;
  4477. }
  4478. Item.prototype.run = function () {
  4479. this.fun.apply(null, this.array);
  4480. };
  4481. process.title = 'browser';
  4482. process.browser = true;
  4483. process.env = {};
  4484. process.argv = [];
  4485. process.version = ''; // empty string to avoid regexp issues
  4486. process.versions = {};
  4487. function noop() {}
  4488. process.on = noop;
  4489. process.addListener = noop;
  4490. process.once = noop;
  4491. process.off = noop;
  4492. process.removeListener = noop;
  4493. process.removeAllListeners = noop;
  4494. process.emit = noop;
  4495. process.prependListener = noop;
  4496. process.prependOnceListener = noop;
  4497. process.listeners = function (name) { return [] }
  4498. process.binding = function (name) {
  4499. throw new Error('process.binding is not supported');
  4500. };
  4501. process.cwd = function () { return '/' };
  4502. process.chdir = function (dir) {
  4503. throw new Error('process.chdir is not supported');
  4504. };
  4505. process.umask = function() { return 0; };
  4506. /***/ }),
  4507. /* 24 */
  4508. /***/ (function(module, exports, __webpack_require__) {
  4509. "use strict";
  4510. /* WEBPACK VAR INJECTION */(function(Buffer) {
  4511. var stripBom = __webpack_require__(209);
  4512. exports.typeOf = __webpack_require__(25);
  4513. /**
  4514. * Returns true if `val` is a buffer
  4515. */
  4516. exports.isBuffer = function(val) {
  4517. return exports.typeOf(val) === 'buffer';
  4518. };
  4519. /**
  4520. * Returns true if `val` is an object
  4521. */
  4522. exports.isObject = function(val) {
  4523. return exports.typeOf(val) === 'object';
  4524. };
  4525. /**
  4526. * Cast `input` to a buffer
  4527. */
  4528. exports.toBuffer = function(input) {
  4529. if (typeof input === 'string') {
  4530. return new Buffer(input);
  4531. }
  4532. return input;
  4533. };
  4534. /**
  4535. * Cast `val` to a string.
  4536. */
  4537. exports.toString = function(input) {
  4538. if (exports.isBuffer(input)) {
  4539. return stripBom(String(input));
  4540. }
  4541. if (typeof input !== 'string') {
  4542. throw new TypeError('expected input to be a string or buffer');
  4543. }
  4544. return stripBom(input);
  4545. };
  4546. /**
  4547. * Cast `val` to an array.
  4548. */
  4549. exports.arrayify = function(val) {
  4550. return val ? (Array.isArray(val) ? val : [val]) : [];
  4551. };
  4552. /**
  4553. * Returns true if `str` starts with `substr`.
  4554. */
  4555. exports.startsWith = function(str, substr, len) {
  4556. if (typeof len !== 'number') len = substr.length;
  4557. return str.slice(0, len) === substr;
  4558. };
  4559. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10).Buffer))
  4560. /***/ }),
  4561. /* 25 */
  4562. /***/ (function(module, exports) {
  4563. var toString = Object.prototype.toString;
  4564. /**
  4565. * Get the native `typeof` a value.
  4566. *
  4567. * @param {*} `val`
  4568. * @return {*} Native javascript type
  4569. */
  4570. module.exports = function kindOf(val) {
  4571. var type = typeof val;
  4572. // primitivies
  4573. if (type === 'undefined') {
  4574. return 'undefined';
  4575. }
  4576. if (val === null) {
  4577. return 'null';
  4578. }
  4579. if (val === true || val === false || val instanceof Boolean) {
  4580. return 'boolean';
  4581. }
  4582. if (type === 'string' || val instanceof String) {
  4583. return 'string';
  4584. }
  4585. if (type === 'number' || val instanceof Number) {
  4586. return 'number';
  4587. }
  4588. // functions
  4589. if (type === 'function' || val instanceof Function) {
  4590. if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') {
  4591. return 'generatorfunction';
  4592. }
  4593. return 'function';
  4594. }
  4595. // array
  4596. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  4597. return 'array';
  4598. }
  4599. // check for instances of RegExp and Date before calling `toString`
  4600. if (val instanceof RegExp) {
  4601. return 'regexp';
  4602. }
  4603. if (val instanceof Date) {
  4604. return 'date';
  4605. }
  4606. // other objects
  4607. type = toString.call(val);
  4608. if (type === '[object RegExp]') {
  4609. return 'regexp';
  4610. }
  4611. if (type === '[object Date]') {
  4612. return 'date';
  4613. }
  4614. if (type === '[object Arguments]') {
  4615. return 'arguments';
  4616. }
  4617. if (type === '[object Error]') {
  4618. return 'error';
  4619. }
  4620. if (type === '[object Promise]') {
  4621. return 'promise';
  4622. }
  4623. // buffer
  4624. if (isBuffer(val)) {
  4625. return 'buffer';
  4626. }
  4627. // es6: Map, WeakMap, Set, WeakSet
  4628. if (type === '[object Set]') {
  4629. return 'set';
  4630. }
  4631. if (type === '[object WeakSet]') {
  4632. return 'weakset';
  4633. }
  4634. if (type === '[object Map]') {
  4635. return 'map';
  4636. }
  4637. if (type === '[object WeakMap]') {
  4638. return 'weakmap';
  4639. }
  4640. if (type === '[object Symbol]') {
  4641. return 'symbol';
  4642. }
  4643. if (type === '[object Map Iterator]') {
  4644. return 'mapiterator';
  4645. }
  4646. if (type === '[object Set Iterator]') {
  4647. return 'setiterator';
  4648. }
  4649. if (type === '[object String Iterator]') {
  4650. return 'stringiterator';
  4651. }
  4652. if (type === '[object Array Iterator]') {
  4653. return 'arrayiterator';
  4654. }
  4655. // typed arrays
  4656. if (type === '[object Int8Array]') {
  4657. return 'int8array';
  4658. }
  4659. if (type === '[object Uint8Array]') {
  4660. return 'uint8array';
  4661. }
  4662. if (type === '[object Uint8ClampedArray]') {
  4663. return 'uint8clampedarray';
  4664. }
  4665. if (type === '[object Int16Array]') {
  4666. return 'int16array';
  4667. }
  4668. if (type === '[object Uint16Array]') {
  4669. return 'uint16array';
  4670. }
  4671. if (type === '[object Int32Array]') {
  4672. return 'int32array';
  4673. }
  4674. if (type === '[object Uint32Array]') {
  4675. return 'uint32array';
  4676. }
  4677. if (type === '[object Float32Array]') {
  4678. return 'float32array';
  4679. }
  4680. if (type === '[object Float64Array]') {
  4681. return 'float64array';
  4682. }
  4683. // must be a plain object
  4684. return 'object';
  4685. };
  4686. /**
  4687. * If you need to support Safari 5-7 (8-10 yr-old browser),
  4688. * take a look at https://github.com/feross/is-buffer
  4689. */
  4690. function isBuffer(val) {
  4691. return val.constructor
  4692. && typeof val.constructor.isBuffer === 'function'
  4693. && val.constructor.isBuffer(val);
  4694. }
  4695. /***/ }),
  4696. /* 26 */
  4697. /***/ (function(module, exports, __webpack_require__) {
  4698. "use strict";
  4699. // Standard YAML's Failsafe schema.
  4700. // http://www.yaml.org/spec/1.2/spec.html#id2802346
  4701. var Schema = __webpack_require__(7);
  4702. module.exports = new Schema({
  4703. explicit: [
  4704. __webpack_require__(141),
  4705. __webpack_require__(139),
  4706. __webpack_require__(134)
  4707. ]
  4708. });
  4709. /***/ }),
  4710. /* 27 */
  4711. /***/ (function(module, exports, __webpack_require__) {
  4712. "use strict";
  4713. exports.__esModule = true;
  4714. var _container = __webpack_require__(22);
  4715. var _container2 = _interopRequireDefault(_container);
  4716. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4717. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4718. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4719. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4720. /**
  4721. * Represents an at-rule.
  4722. *
  4723. * If it’s followed in the CSS by a {} block, this node will have
  4724. * a nodes property representing its children.
  4725. *
  4726. * @extends Container
  4727. *
  4728. * @example
  4729. * const root = postcss.parse('@charset "UTF-8"; @media print {}');
  4730. *
  4731. * const charset = root.first;
  4732. * charset.type //=> 'atrule'
  4733. * charset.nodes //=> undefined
  4734. *
  4735. * const media = root.last;
  4736. * media.nodes //=> []
  4737. */
  4738. var AtRule = function (_Container) {
  4739. _inherits(AtRule, _Container);
  4740. function AtRule(defaults) {
  4741. _classCallCheck(this, AtRule);
  4742. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  4743. _this.type = 'atrule';
  4744. return _this;
  4745. }
  4746. AtRule.prototype.append = function append() {
  4747. var _Container$prototype$;
  4748. if (!this.nodes) this.nodes = [];
  4749. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  4750. children[_key] = arguments[_key];
  4751. }
  4752. return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
  4753. };
  4754. AtRule.prototype.prepend = function prepend() {
  4755. var _Container$prototype$2;
  4756. if (!this.nodes) this.nodes = [];
  4757. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  4758. children[_key2] = arguments[_key2];
  4759. }
  4760. return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
  4761. };
  4762. /**
  4763. * @memberof AtRule#
  4764. * @member {string} name - the at-rule’s name immediately follows the `@`
  4765. *
  4766. * @example
  4767. * const root = postcss.parse('@media print {}');
  4768. * media.name //=> 'media'
  4769. * const media = root.first;
  4770. */
  4771. /**
  4772. * @memberof AtRule#
  4773. * @member {string} params - the at-rule’s parameters, the values
  4774. * that follow the at-rule’s name but precede
  4775. * any {} block
  4776. *
  4777. * @example
  4778. * const root = postcss.parse('@media print, screen {}');
  4779. * const media = root.first;
  4780. * media.params //=> 'print, screen'
  4781. */
  4782. /**
  4783. * @memberof AtRule#
  4784. * @member {object} raws - Information to generate byte-to-byte equal
  4785. * node string as it was in the origin input.
  4786. *
  4787. * Every parser saves its own properties,
  4788. * but the default CSS parser uses:
  4789. *
  4790. * * `before`: the space symbols before the node. It also stores `*`
  4791. * and `_` symbols before the declaration (IE hack).
  4792. * * `after`: the space symbols after the last child of the node
  4793. * to the end of the node.
  4794. * * `between`: the symbols between the property and value
  4795. * for declarations, selector and `{` for rules, or last parameter
  4796. * and `{` for at-rules.
  4797. * * `semicolon`: contains true if the last child has
  4798. * an (optional) semicolon.
  4799. * * `afterName`: the space between the at-rule name and its parameters.
  4800. *
  4801. * PostCSS cleans at-rule parameters from comments and extra spaces,
  4802. * but it stores origin content in raws properties.
  4803. * As such, if you don’t change a declaration’s value,
  4804. * PostCSS will use the raw value with comments.
  4805. *
  4806. * @example
  4807. * const root = postcss.parse(' @media\nprint {\n}')
  4808. * root.first.first.raws //=> { before: ' ',
  4809. * // between: ' ',
  4810. * // afterName: '\n',
  4811. * // after: '\n' }
  4812. */
  4813. return AtRule;
  4814. }(_container2.default);
  4815. exports.default = AtRule;
  4816. module.exports = exports['default'];
  4817. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFrQk1BLE07OztBQUVGLGtCQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLHNCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksUUFBWjtBQUZrQjtBQUdyQjs7bUJBRURDLE0scUJBQW9CO0FBQUE7O0FBQ2hCLFFBQUssQ0FBQyxLQUFLQyxLQUFYLEVBQW1CLEtBQUtBLEtBQUwsR0FBYSxFQUFiOztBQURILHNDQUFWQyxRQUFVO0FBQVZBLGNBQVU7QUFBQTs7QUFFaEIsV0FBTyw4Q0FBTUYsTUFBTixrREFBZ0JFLFFBQWh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59XG5cbmV4cG9ydCBkZWZhdWx0IEF0UnVsZTtcbiJdfQ==
  4818. /***/ }),
  4819. /* 28 */
  4820. /***/ (function(module, exports, __webpack_require__) {
  4821. "use strict";
  4822. exports.__esModule = true;
  4823. var _node = __webpack_require__(30);
  4824. var _node2 = _interopRequireDefault(_node);
  4825. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4826. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4827. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4828. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4829. /**
  4830. * Represents a comment between declarations or statements (rule and at-rules).
  4831. *
  4832. * Comments inside selectors, at-rule parameters, or declaration values
  4833. * will be stored in the `raws` properties explained above.
  4834. *
  4835. * @extends Node
  4836. */
  4837. var Comment = function (_Node) {
  4838. _inherits(Comment, _Node);
  4839. function Comment(defaults) {
  4840. _classCallCheck(this, Comment);
  4841. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  4842. _this.type = 'comment';
  4843. return _this;
  4844. }
  4845. /**
  4846. * @memberof Comment#
  4847. * @member {string} text - the comment’s text
  4848. */
  4849. /**
  4850. * @memberof Comment#
  4851. * @member {object} raws - Information to generate byte-to-byte equal
  4852. * node string as it was in the origin input.
  4853. *
  4854. * Every parser saves its own properties,
  4855. * but the default CSS parser uses:
  4856. *
  4857. * * `before`: the space symbols before the node.
  4858. * * `left`: the space symbols between `/*` and the comment’s text.
  4859. * * `right`: the space symbols between the comment’s text.
  4860. */
  4861. return Comment;
  4862. }(_node2.default);
  4863. exports.default = Comment;
  4864. module.exports = exports['default'];
  4865. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7O0lBUU1BLE87OztBQUVGLG1CQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLGlCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksU0FBWjtBQUZrQjtBQUdyQjs7QUFFRDs7Ozs7QUFLQTs7Ozs7Ozs7Ozs7Ozs7Ozs7a0JBY1dGLE8iLCJmaWxlIjoiY29tbWVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBOb2RlIGZyb20gJy4vbm9kZSc7XG5cbi8qKlxuICogUmVwcmVzZW50cyBhIGNvbW1lbnQgYmV0d2VlbiBkZWNsYXJhdGlvbnMgb3Igc3RhdGVtZW50cyAocnVsZSBhbmQgYXQtcnVsZXMpLlxuICpcbiAqIENvbW1lbnRzIGluc2lkZSBzZWxlY3RvcnMsIGF0LXJ1bGUgcGFyYW1ldGVycywgb3IgZGVjbGFyYXRpb24gdmFsdWVzXG4gKiB3aWxsIGJlIHN0b3JlZCBpbiB0aGUgYHJhd3NgIHByb3BlcnRpZXMgZXhwbGFpbmVkIGFib3ZlLlxuICpcbiAqIEBleHRlbmRzIE5vZGVcbiAqL1xuY2xhc3MgQ29tbWVudCBleHRlbmRzIE5vZGUge1xuXG4gICAgY29uc3RydWN0b3IoZGVmYXVsdHMpIHtcbiAgICAgICAgc3VwZXIoZGVmYXVsdHMpO1xuICAgICAgICB0aGlzLnR5cGUgPSAnY29tbWVudCc7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIENvbW1lbnQjXG4gICAgICogQG1lbWJlciB7c3RyaW5nfSB0ZXh0IC0gdGhlIGNvbW1lbnTigJlzIHRleHRcbiAgICAgKi9cblxuICAgIC8qKlxuICAgICAqIEBtZW1iZXJvZiBDb21tZW50I1xuICAgICAqIEBtZW1iZXIge29iamVjdH0gcmF3cyAtIEluZm9ybWF0aW9uIHRvIGdlbmVyYXRlIGJ5dGUtdG8tYnl0ZSBlcXVhbFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUgc3RyaW5nIGFzIGl0IHdhcyBpbiB0aGUgb3JpZ2luIGlucHV0LlxuICAgICAqXG4gICAgICogRXZlcnkgcGFyc2VyIHNhdmVzIGl0cyBvd24gcHJvcGVydGllcyxcbiAgICAgKiBidXQgdGhlIGRlZmF1bHQgQ1NTIHBhcnNlciB1c2VzOlxuICAgICAqXG4gICAgICogKiBgYmVmb3JlYDogdGhlIHNwYWNlIHN5bWJvbHMgYmVmb3JlIHRoZSBub2RlLlxuICAgICAqICogYGxlZnRgOiB0aGUgc3BhY2Ugc3ltYm9scyBiZXR3ZWVuIGAvKmAgYW5kIHRoZSBjb21tZW504oCZcyB0ZXh0LlxuICAgICAqICogYHJpZ2h0YDogdGhlIHNwYWNlIHN5bWJvbHMgYmV0d2VlbiB0aGUgY29tbWVudOKAmXMgdGV4dC5cbiAgICAgKi9cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ29tbWVudDtcbiJdfQ==
  4866. /***/ }),
  4867. /* 29 */
  4868. /***/ (function(module, exports, __webpack_require__) {
  4869. "use strict";
  4870. exports.__esModule = true;
  4871. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4872. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4873. var _cssSyntaxError = __webpack_require__(54);
  4874. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  4875. var _previousMap = __webpack_require__(173);
  4876. var _previousMap2 = _interopRequireDefault(_previousMap);
  4877. var _path = __webpack_require__(8);
  4878. var _path2 = _interopRequireDefault(_path);
  4879. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4880. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4881. var sequence = 0;
  4882. /**
  4883. * Represents the source CSS.
  4884. *
  4885. * @example
  4886. * const root = postcss.parse(css, { from: file });
  4887. * const input = root.source.input;
  4888. */
  4889. var Input = function () {
  4890. /**
  4891. * @param {string} css - input CSS source
  4892. * @param {object} [opts] - {@link Processor#process} options
  4893. */
  4894. function Input(css) {
  4895. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4896. _classCallCheck(this, Input);
  4897. if (css === null || (typeof css === 'undefined' ? 'undefined' : _typeof(css)) === 'object' && !css.toString) {
  4898. throw new Error('PostCSS received ' + css + ' instead of CSS string');
  4899. }
  4900. /**
  4901. * @member {string} - input CSS source
  4902. *
  4903. * @example
  4904. * const input = postcss.parse('a{}', { from: file }).input;
  4905. * input.css //=> "a{}";
  4906. */
  4907. this.css = css.toString();
  4908. if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
  4909. this.css = this.css.slice(1);
  4910. }
  4911. if (opts.from) {
  4912. if (/^\w+:\/\//.test(opts.from)) {
  4913. /**
  4914. * @member {string} - The absolute path to the CSS source file
  4915. * defined with the `from` option.
  4916. *
  4917. * @example
  4918. * const root = postcss.parse(css, { from: 'a.css' });
  4919. * root.source.input.file //=> '/home/ai/a.css'
  4920. */
  4921. this.file = opts.from;
  4922. } else {
  4923. this.file = _path2.default.resolve(opts.from);
  4924. }
  4925. }
  4926. var map = new _previousMap2.default(this.css, opts);
  4927. if (map.text) {
  4928. /**
  4929. * @member {PreviousMap} - The input source map passed from
  4930. * a compilation step before PostCSS
  4931. * (for example, from Sass compiler).
  4932. *
  4933. * @example
  4934. * root.source.input.map.consumer().sources //=> ['a.sass']
  4935. */
  4936. this.map = map;
  4937. var file = map.consumer().file;
  4938. if (!this.file && file) this.file = this.mapResolve(file);
  4939. }
  4940. if (!this.file) {
  4941. sequence += 1;
  4942. /**
  4943. * @member {string} - The unique ID of the CSS source. It will be
  4944. * created if `from` option is not provided
  4945. * (because PostCSS does not know the file path).
  4946. *
  4947. * @example
  4948. * const root = postcss.parse(css);
  4949. * root.source.input.file //=> undefined
  4950. * root.source.input.id //=> "<input css 1>"
  4951. */
  4952. this.id = '<input css ' + sequence + '>';
  4953. }
  4954. if (this.map) this.map.file = this.from;
  4955. }
  4956. Input.prototype.error = function error(message, line, column) {
  4957. var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  4958. var result = void 0;
  4959. var origin = this.origin(line, column);
  4960. if (origin) {
  4961. result = new _cssSyntaxError2.default(message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
  4962. } else {
  4963. result = new _cssSyntaxError2.default(message, line, column, this.css, this.file, opts.plugin);
  4964. }
  4965. result.input = { line: line, column: column, source: this.css };
  4966. if (this.file) result.input.file = this.file;
  4967. return result;
  4968. };
  4969. /**
  4970. * Reads the input source map and returns a symbol position
  4971. * in the input source (e.g., in a Sass file that was compiled
  4972. * to CSS before being passed to PostCSS).
  4973. *
  4974. * @param {number} line - line in input CSS
  4975. * @param {number} column - column in input CSS
  4976. *
  4977. * @return {filePosition} position in input source
  4978. *
  4979. * @example
  4980. * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
  4981. */
  4982. Input.prototype.origin = function origin(line, column) {
  4983. if (!this.map) return false;
  4984. var consumer = this.map.consumer();
  4985. var from = consumer.originalPositionFor({ line: line, column: column });
  4986. if (!from.source) return false;
  4987. var result = {
  4988. file: this.mapResolve(from.source),
  4989. line: from.line,
  4990. column: from.column
  4991. };
  4992. var source = consumer.sourceContentFor(from.source);
  4993. if (source) result.source = source;
  4994. return result;
  4995. };
  4996. Input.prototype.mapResolve = function mapResolve(file) {
  4997. if (/^\w+:\/\//.test(file)) {
  4998. return file;
  4999. } else {
  5000. return _path2.default.resolve(this.map.consumer().sourceRoot || '.', file);
  5001. }
  5002. };
  5003. /**
  5004. * The CSS source identifier. Contains {@link Input#file} if the user
  5005. * set the `from` option, or {@link Input#id} if they did not.
  5006. * @type {string}
  5007. *
  5008. * @example
  5009. * const root = postcss.parse(css, { from: 'a.css' });
  5010. * root.source.input.from //=> "/home/ai/a.css"
  5011. *
  5012. * const root = postcss.parse(css);
  5013. * root.source.input.from //=> "<input css 1>"
  5014. */
  5015. _createClass(Input, [{
  5016. key: 'from',
  5017. get: function get() {
  5018. return this.file || this.id;
  5019. }
  5020. }]);
  5021. return Input;
  5022. }();
  5023. exports.default = Input;
  5024. /**
  5025. * @typedef {object} filePosition
  5026. * @property {string} file - path to file
  5027. * @property {number} line - source line in file
  5028. * @property {number} column - source column in file
  5029. */
  5030. module.exports = exports['default'];
  5031. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmVzNiJdLCJuYW1lcyI6WyJzZXF1ZW5jZSIsIklucHV0IiwiY3NzIiwib3B0cyIsInRvU3RyaW5nIiwiRXJyb3IiLCJzbGljZSIsImZyb20iLCJ0ZXN0IiwiZmlsZSIsInJlc29sdmUiLCJtYXAiLCJ0ZXh0IiwiY29uc3VtZXIiLCJtYXBSZXNvbHZlIiwiaWQiLCJlcnJvciIsIm1lc3NhZ2UiLCJsaW5lIiwiY29sdW1uIiwicmVzdWx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xuICAgICAgICBpZiAoIGNzcyA9PT0gbnVsbCB8fCB0eXBlb2YgY3NzID09PSAnb2JqZWN0JyAmJiAhY3NzLnRvU3RyaW5nICkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBQb3N0Q1NTIHJlY2VpdmVkICR7IGNzcyB9IGluc3RlYWQgb2YgQ1NTIHN0cmluZ2ApO1xuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBpbnB1dCBDU1Mgc291cmNlXG4gICAgICAgICAqXG4gICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAqIGNvbnN0IGlucHV0ID0gcG9zdGNzcy5wYXJzZSgnYXt9JywgeyBmcm9tOiBmaWxlIH0pLmlucHV0O1xuICAgICAgICAgKiBpbnB1dC5jc3MgLy89PiBcImF7fVwiO1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5jc3MgPSBjc3MudG9TdHJpbmcoKTtcblxuICAgICAgICBpZiAoIHRoaXMuY3NzWzBdID09PSAnXFx1RkVGRicgfHwgdGhpcy5jc3NbMF0gPT09ICdcXHVGRkZFJyApIHtcbiAgICAgICAgICAgIHRoaXMuY3NzID0gdGhpcy5jc3Muc2xpY2UoMSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG9wdHMuZnJvbSApIHtcbiAgICAgICAgICAgIGlmICggL15cXHcrOlxcL1xcLy8udGVzdChvcHRzLmZyb20pICkge1xuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgYWJzb2x1dGUgcGF0aCB0byB0aGUgQ1NTIHNvdXJjZSBmaWxlXG4gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIGRlZmluZWQgd2l0aCB0aGUgYGZyb21gIG9wdGlvbi5cbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzLCB7IGZyb206ICdhLmNzcycgfSk7XG4gICAgICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQuZmlsZSAvLz0+ICcvaG9tZS9haS9hLmNzcydcbiAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICB0aGlzLmZpbGUgPSBvcHRzLmZyb207XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuZmlsZSA9IHBhdGgucmVzb2x2ZShvcHRzLmZyb20pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGV0IG1hcCA9IG5ldyBQcmV2aW91c01hcCh0aGlzLmNzcywgb3B0cyk7XG4gICAgICAgIGlmICggbWFwLnRleHQgKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge1ByZXZpb3VzTWFwfSAtIFRoZSBpbnB1dCBzb3VyY2UgbWFwIHBhc3NlZCBmcm9tXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBhIGNvbXBpbGF0aW9uIHN0ZXAgYmVmb3JlIFBvc3RDU1NcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgZXhhbXBsZSwgZnJvbSBTYXNzIGNvbXBpbGVyKS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQubWFwLmNvbnN1bWVyKCkuc291cmNlcyAvLz0+IFsnYS5zYXNzJ11cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5tYXAgPSBtYXA7XG4gICAgICAgICAgICBsZXQgZmlsZSA9IG1hcC5jb25zdW1lcigpLmZpbGU7XG4gICAgICAgICAgICBpZiAoICF0aGlzLmZpbGUgJiYgZmlsZSApIHRoaXMuZmlsZSA9IHRoaXMubWFwUmVzb2x2ZShmaWxlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggIXRoaXMuZmlsZSApIHtcbiAgICAgICAgICAgIHNlcXVlbmNlICs9IDE7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgdW5pcXVlIElEIG9mIHRoZSBDU1Mgc291cmNlLiBJdCB3aWxsIGJlXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgY3JlYXRlZCBpZiBgZnJvbWAgb3B0aW9uIGlzIG5vdCBwcm92aWRlZFxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIChiZWNhdXNlIFBvc3RDU1MgZG9lcyBub3Qga25vdyB0aGUgZmlsZSBwYXRoKS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzKTtcbiAgICAgICAgICAgICAqIHJvb3Quc291cmNlLmlucHV0LmZpbGUgLy89PiB1bmRlZmluZWRcbiAgICAgICAgICAgICAqIHJvb3Quc291cmNlLmlucHV0LmlkICAgLy89PiBcIjxpbnB1dCBjc3MgMT5cIlxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmlkICAgPSAnPGlucHV0IGNzcyAnICsgc2VxdWVuY2UgKyAnPic7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB0aGlzLm1hcCApIHRoaXMubWFwLmZpbGUgPSB0aGlzLmZyb207XG4gICAgfVxuXG4gICAgZXJyb3IobWVzc2FnZSwgbGluZSwgY29sdW1uLCBvcHRzID0geyB9KSB7XG4gICAgICAgIGxldCByZXN1bHQ7XG4gICAgICAgIGxldCBvcmlnaW4gPSB0aGlzLm9yaWdpbihsaW5lLCBjb2x1bW4pO1xuICAgICAgICBpZiAoIG9yaWdpbiApIHtcbiAgICAgICAgICAgIHJl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HV0Lm9yaWdpbigxLCAxKSAvLz0+IHsgZmlsZTogJ2EuY3NzJywgbGluZTogMywgY29sdW1uOiAxIH1cbiAgICAgKi9cbiAgICBvcmlnaW4obGluZSwgY29sdW1uKSB7XG4gICAgICAgIGlmICggIXRoaXMubWFwICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICBsZXQgY29uc3VtZXIgPSB0aGlzLm1hcC5jb25zdW1lcigpO1xuXG4gICAgICAgIGxldCBmcm9tID0gY29uc3VtZXIub3JpZ2luYWxQb3NpdGlvbkZvcih7IGxpbmUsIGNvbHVtbiB9KTtcbiAgICAgICAgaWYgKCAhZnJvbS5zb3VyY2UgKSByZXR1cm4gZmFsc2U7XG5cbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgIGZpbGU6ICAgdGhpcy5tYXBSZXNvbHZlKGZyb20uc291cmNlKSxcbiAgICAgICAgICAgIGxpbmU6ICAgZnJvbS5saW5lLFxuICAgICAgICAgICAgY29sdW1uOiBmcm9tLmNvbHVtblxuICAgICAgICB9O1xuXG4gICAgICAgIGxldCBzb3VyY2UgPSBjb25zdW1lci5zb3VyY2VDb250ZW50Rm9yKGZyb20uc291cmNlKTtcbiAgICAgICAgaWYgKCBzb3VyY2UgKSByZXN1bHQuc291cmNlID0gc291cmNlO1xuXG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgbWFwUmVzb2x2ZShmaWxlKSB7XG4gICAgICAgIGlmICggL15cXHcrOlxcL1xcLy8udGVzdChmaWxlKSApIHtcbiAgICAgICAgICAgIHJldHVybiBmaWxlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHBhdGgucmVzb2x2ZSh0aGlzLm1hcC5jb25zdW1lcigpLnNvdXJjZVJvb3QgfHwgJy4nLCBmaWxlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBDU1Mgc291cmNlIGlkZW50aWZpZXIuIENvbnRhaW5zIHtAbGluayBJbnB1dCNmaWxlfSBpZiB0aGUgdXNlclxuICAgICAqIHNldCB0aGUgYGZyb21gIG9wdGlvbiwgb3Ige0BsaW5rIElucHV0I2lkfSBpZiB0aGV5IGRpZCBub3QuXG4gICAgICogQHR5cGUge3N0cmluZ31cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzLCB7IGZyb206ICdhLmNzcycgfSk7XG4gICAgICogcm9vdC5zb3VyY2UuaW5wdXQuZnJvbSAvLz0+IFwiL2hvbWUvYWkvYS5jc3NcIlxuICAgICAqXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzKTtcbiAgICAgKiByb290LnNvdXJjZS5pbnB1dC5mcm9tIC8vPT4gXCI8aW5wdXQgY3NzIDE+XCJcbiAgICAgKi9cbiAgICBnZXQgZnJvbSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmlsZSB8fCB0aGlzLmlkO1xuICAgIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBJbnB1dDtcblxuLyoqXG4gKiBAdHlwZWRlZiAge29iamVjdH0gZmlsZVBvc2l0aW9uXG4gKiBAcHJvcGVydHkge3N0cmluZ30gZmlsZSAgIC0gcGF0aCB0byBmaWxlXG4gKiBAcHJvcGVydHkge251bWJlcn0gbGluZSAgIC0gc291cmNlIGxpbmUgaW4gZmlsZVxuICogQHByb3BlcnR5IHtudW1iZXJ9IGNvbHVtbiAtIHNvdXJjZSBjb2x1bW4gaW4gZmlsZVxuICovXG4iXX0=
  5032. /***/ }),
  5033. /* 30 */
  5034. /***/ (function(module, exports, __webpack_require__) {
  5035. "use strict";
  5036. exports.__esModule = true;
  5037. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  5038. var _cssSyntaxError = __webpack_require__(54);
  5039. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  5040. var _stringifier = __webpack_require__(32);
  5041. var _stringifier2 = _interopRequireDefault(_stringifier);
  5042. var _stringify = __webpack_require__(60);
  5043. var _stringify2 = _interopRequireDefault(_stringify);
  5044. var _warnOnce = __webpack_require__(62);
  5045. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  5046. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5047. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5048. var cloneNode = function cloneNode(obj, parent) {
  5049. var cloned = new obj.constructor();
  5050. for (var i in obj) {
  5051. if (!obj.hasOwnProperty(i)) continue;
  5052. var value = obj[i];
  5053. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  5054. if (i === 'parent' && type === 'object') {
  5055. if (parent) cloned[i] = parent;
  5056. } else if (i === 'source') {
  5057. cloned[i] = value;
  5058. } else if (value instanceof Array) {
  5059. cloned[i] = value.map(function (j) {
  5060. return cloneNode(j, cloned);
  5061. });
  5062. } else {
  5063. if (type === 'object' && value !== null) value = cloneNode(value);
  5064. cloned[i] = value;
  5065. }
  5066. }
  5067. return cloned;
  5068. };
  5069. /**
  5070. * All node classes inherit the following common methods.
  5071. *
  5072. * @abstract
  5073. */
  5074. var Node = function () {
  5075. /**
  5076. * @param {object} [defaults] - value for node properties
  5077. */
  5078. function Node() {
  5079. var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5080. _classCallCheck(this, Node);
  5081. this.raws = {};
  5082. if ((typeof defaults === 'undefined' ? 'undefined' : _typeof(defaults)) !== 'object' && typeof defaults !== 'undefined') {
  5083. throw new Error('PostCSS nodes constructor accepts object, not ' + JSON.stringify(defaults));
  5084. }
  5085. for (var name in defaults) {
  5086. this[name] = defaults[name];
  5087. }
  5088. }
  5089. /**
  5090. * Returns a CssSyntaxError instance containing the original position
  5091. * of the node in the source, showing line and column numbers and also
  5092. * a small excerpt to facilitate debugging.
  5093. *
  5094. * If present, an input source map will be used to get the original position
  5095. * of the source, even from a previous compilation step
  5096. * (e.g., from Sass compilation).
  5097. *
  5098. * This method produces very useful error messages.
  5099. *
  5100. * @param {string} message - error description
  5101. * @param {object} [opts] - options
  5102. * @param {string} opts.plugin - plugin name that created this error.
  5103. * PostCSS will set it automatically.
  5104. * @param {string} opts.word - a word inside a node’s string that should
  5105. * be highlighted as the source of the error
  5106. * @param {number} opts.index - an index inside a node’s string that should
  5107. * be highlighted as the source of the error
  5108. *
  5109. * @return {CssSyntaxError} error object to throw it
  5110. *
  5111. * @example
  5112. * if ( !variables[name] ) {
  5113. * throw decl.error('Unknown variable ' + name, { word: name });
  5114. * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
  5115. * // color: $black
  5116. * // a
  5117. * // ^
  5118. * // background: white
  5119. * }
  5120. */
  5121. Node.prototype.error = function error(message) {
  5122. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5123. if (this.source) {
  5124. var pos = this.positionBy(opts);
  5125. return this.source.input.error(message, pos.line, pos.column, opts);
  5126. } else {
  5127. return new _cssSyntaxError2.default(message);
  5128. }
  5129. };
  5130. /**
  5131. * This method is provided as a convenience wrapper for {@link Result#warn}.
  5132. *
  5133. * @param {Result} result - the {@link Result} instance
  5134. * that will receive the warning
  5135. * @param {string} text - warning message
  5136. * @param {object} [opts] - options
  5137. * @param {string} opts.plugin - plugin name that created this warning.
  5138. * PostCSS will set it automatically.
  5139. * @param {string} opts.word - a word inside a node’s string that should
  5140. * be highlighted as the source of the warning
  5141. * @param {number} opts.index - an index inside a node’s string that should
  5142. * be highlighted as the source of the warning
  5143. *
  5144. * @return {Warning} created warning object
  5145. *
  5146. * @example
  5147. * const plugin = postcss.plugin('postcss-deprecated', () => {
  5148. * return (root, result) => {
  5149. * root.walkDecls('bad', decl => {
  5150. * decl.warn(result, 'Deprecated property bad');
  5151. * });
  5152. * };
  5153. * });
  5154. */
  5155. Node.prototype.warn = function warn(result, text, opts) {
  5156. var data = { node: this };
  5157. for (var i in opts) {
  5158. data[i] = opts[i];
  5159. }return result.warn(text, data);
  5160. };
  5161. /**
  5162. * Removes the node from its parent and cleans the parent properties
  5163. * from the node and its children.
  5164. *
  5165. * @example
  5166. * if ( decl.prop.match(/^-webkit-/) ) {
  5167. * decl.remove();
  5168. * }
  5169. *
  5170. * @return {Node} node to make calls chain
  5171. */
  5172. Node.prototype.remove = function remove() {
  5173. if (this.parent) {
  5174. this.parent.removeChild(this);
  5175. }
  5176. this.parent = undefined;
  5177. return this;
  5178. };
  5179. /**
  5180. * Returns a CSS string representing the node.
  5181. *
  5182. * @param {stringifier|syntax} [stringifier] - a syntax to use
  5183. * in string generation
  5184. *
  5185. * @return {string} CSS string of this node
  5186. *
  5187. * @example
  5188. * postcss.rule({ selector: 'a' }).toString() //=> "a {}"
  5189. */
  5190. Node.prototype.toString = function toString() {
  5191. var stringifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _stringify2.default;
  5192. if (stringifier.stringify) stringifier = stringifier.stringify;
  5193. var result = '';
  5194. stringifier(this, function (i) {
  5195. result += i;
  5196. });
  5197. return result;
  5198. };
  5199. /**
  5200. * Returns a clone of the node.
  5201. *
  5202. * The resulting cloned node and its (cloned) children will have
  5203. * a clean parent and code style properties.
  5204. *
  5205. * @param {object} [overrides] - new properties to override in the clone.
  5206. *
  5207. * @example
  5208. * const cloned = decl.clone({ prop: '-moz-' + decl.prop });
  5209. * cloned.raws.before //=> undefined
  5210. * cloned.parent //=> undefined
  5211. * cloned.toString() //=> -moz-transform: scale(0)
  5212. *
  5213. * @return {Node} clone of the node
  5214. */
  5215. Node.prototype.clone = function clone() {
  5216. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5217. var cloned = cloneNode(this);
  5218. for (var name in overrides) {
  5219. cloned[name] = overrides[name];
  5220. }
  5221. return cloned;
  5222. };
  5223. /**
  5224. * Shortcut to clone the node and insert the resulting cloned node
  5225. * before the current node.
  5226. *
  5227. * @param {object} [overrides] - new properties to override in the clone.
  5228. *
  5229. * @example
  5230. * decl.cloneBefore({ prop: '-moz-' + decl.prop });
  5231. *
  5232. * @return {Node} - new node
  5233. */
  5234. Node.prototype.cloneBefore = function cloneBefore() {
  5235. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5236. var cloned = this.clone(overrides);
  5237. this.parent.insertBefore(this, cloned);
  5238. return cloned;
  5239. };
  5240. /**
  5241. * Shortcut to clone the node and insert the resulting cloned node
  5242. * after the current node.
  5243. *
  5244. * @param {object} [overrides] - new properties to override in the clone.
  5245. *
  5246. * @return {Node} - new node
  5247. */
  5248. Node.prototype.cloneAfter = function cloneAfter() {
  5249. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5250. var cloned = this.clone(overrides);
  5251. this.parent.insertAfter(this, cloned);
  5252. return cloned;
  5253. };
  5254. /**
  5255. * Inserts node(s) before the current node and removes the current node.
  5256. *
  5257. * @param {...Node} nodes - node(s) to replace current one
  5258. *
  5259. * @example
  5260. * if ( atrule.name == 'mixin' ) {
  5261. * atrule.replaceWith(mixinRules[atrule.params]);
  5262. * }
  5263. *
  5264. * @return {Node} current node to methods chain
  5265. */
  5266. Node.prototype.replaceWith = function replaceWith() {
  5267. if (this.parent) {
  5268. for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
  5269. nodes[_key] = arguments[_key];
  5270. }
  5271. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  5272. var _ref;
  5273. if (_isArray) {
  5274. if (_i >= _iterator.length) break;
  5275. _ref = _iterator[_i++];
  5276. } else {
  5277. _i = _iterator.next();
  5278. if (_i.done) break;
  5279. _ref = _i.value;
  5280. }
  5281. var node = _ref;
  5282. this.parent.insertBefore(this, node);
  5283. }
  5284. this.remove();
  5285. }
  5286. return this;
  5287. };
  5288. Node.prototype.moveTo = function moveTo(newParent) {
  5289. (0, _warnOnce2.default)('Node#moveTo was deprecated. Use Container#append.');
  5290. this.cleanRaws(this.root() === newParent.root());
  5291. this.remove();
  5292. newParent.append(this);
  5293. return this;
  5294. };
  5295. Node.prototype.moveBefore = function moveBefore(otherNode) {
  5296. (0, _warnOnce2.default)('Node#moveBefore was deprecated. Use Node#before.');
  5297. this.cleanRaws(this.root() === otherNode.root());
  5298. this.remove();
  5299. otherNode.parent.insertBefore(otherNode, this);
  5300. return this;
  5301. };
  5302. Node.prototype.moveAfter = function moveAfter(otherNode) {
  5303. (0, _warnOnce2.default)('Node#moveAfter was deprecated. Use Node#after.');
  5304. this.cleanRaws(this.root() === otherNode.root());
  5305. this.remove();
  5306. otherNode.parent.insertAfter(otherNode, this);
  5307. return this;
  5308. };
  5309. /**
  5310. * Returns the next child of the node’s parent.
  5311. * Returns `undefined` if the current node is the last child.
  5312. *
  5313. * @return {Node|undefined} next node
  5314. *
  5315. * @example
  5316. * if ( comment.text === 'delete next' ) {
  5317. * const next = comment.next();
  5318. * if ( next ) {
  5319. * next.remove();
  5320. * }
  5321. * }
  5322. */
  5323. Node.prototype.next = function next() {
  5324. var index = this.parent.index(this);
  5325. return this.parent.nodes[index + 1];
  5326. };
  5327. /**
  5328. * Returns the previous child of the node’s parent.
  5329. * Returns `undefined` if the current node is the first child.
  5330. *
  5331. * @return {Node|undefined} previous node
  5332. *
  5333. * @example
  5334. * const annotation = decl.prev();
  5335. * if ( annotation.type == 'comment' ) {
  5336. * readAnnotation(annotation.text);
  5337. * }
  5338. */
  5339. Node.prototype.prev = function prev() {
  5340. var index = this.parent.index(this);
  5341. return this.parent.nodes[index - 1];
  5342. };
  5343. /**
  5344. * Insert new node before current node to current node’s parent.
  5345. *
  5346. * Just alias for `node.parent.insertBefore(node, add)`.
  5347. *
  5348. * @param {Node|object|string|Node[]} add - new node
  5349. *
  5350. * @return {Node} this node for methods chain.
  5351. *
  5352. * @example
  5353. * decl.before('content: ""');
  5354. */
  5355. Node.prototype.before = function before(add) {
  5356. this.parent.insertBefore(this, add);
  5357. return this;
  5358. };
  5359. /**
  5360. * Insert new node after current node to current node’s parent.
  5361. *
  5362. * Just alias for `node.parent.insertAfter(node, add)`.
  5363. *
  5364. * @param {Node|object|string|Node[]} add - new node
  5365. *
  5366. * @return {Node} this node for methods chain.
  5367. *
  5368. * @example
  5369. * decl.after('color: black');
  5370. */
  5371. Node.prototype.after = function after(add) {
  5372. this.parent.insertAfter(this, add);
  5373. return this;
  5374. };
  5375. Node.prototype.toJSON = function toJSON() {
  5376. var fixed = {};
  5377. for (var name in this) {
  5378. if (!this.hasOwnProperty(name)) continue;
  5379. if (name === 'parent') continue;
  5380. var value = this[name];
  5381. if (value instanceof Array) {
  5382. fixed[name] = value.map(function (i) {
  5383. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && i.toJSON) {
  5384. return i.toJSON();
  5385. } else {
  5386. return i;
  5387. }
  5388. });
  5389. } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.toJSON) {
  5390. fixed[name] = value.toJSON();
  5391. } else {
  5392. fixed[name] = value;
  5393. }
  5394. }
  5395. return fixed;
  5396. };
  5397. /**
  5398. * Returns a {@link Node#raws} value. If the node is missing
  5399. * the code style property (because the node was manually built or cloned),
  5400. * PostCSS will try to autodetect the code style property by looking
  5401. * at other nodes in the tree.
  5402. *
  5403. * @param {string} prop - name of code style property
  5404. * @param {string} [defaultType] - name of default value, it can be missed
  5405. * if the value is the same as prop
  5406. *
  5407. * @example
  5408. * const root = postcss.parse('a { background: white }');
  5409. * root.nodes[0].append({ prop: 'color', value: 'black' });
  5410. * root.nodes[0].nodes[1].raws.before //=> undefined
  5411. * root.nodes[0].nodes[1].raw('before') //=> ' '
  5412. *
  5413. * @return {string} code style value
  5414. */
  5415. Node.prototype.raw = function raw(prop, defaultType) {
  5416. var str = new _stringifier2.default();
  5417. return str.raw(this, prop, defaultType);
  5418. };
  5419. /**
  5420. * Finds the Root instance of the node’s tree.
  5421. *
  5422. * @example
  5423. * root.nodes[0].nodes[0].root() === root
  5424. *
  5425. * @return {Root} root parent
  5426. */
  5427. Node.prototype.root = function root() {
  5428. var result = this;
  5429. while (result.parent) {
  5430. result = result.parent;
  5431. }return result;
  5432. };
  5433. Node.prototype.cleanRaws = function cleanRaws(keepBetween) {
  5434. delete this.raws.before;
  5435. delete this.raws.after;
  5436. if (!keepBetween) delete this.raws.between;
  5437. };
  5438. Node.prototype.positionInside = function positionInside(index) {
  5439. var string = this.toString();
  5440. var column = this.source.start.column;
  5441. var line = this.source.start.line;
  5442. for (var i = 0; i < index; i++) {
  5443. if (string[i] === '\n') {
  5444. column = 1;
  5445. line += 1;
  5446. } else {
  5447. column += 1;
  5448. }
  5449. }
  5450. return { line: line, column: column };
  5451. };
  5452. Node.prototype.positionBy = function positionBy(opts) {
  5453. var pos = this.source.start;
  5454. if (opts.index) {
  5455. pos = this.positionInside(opts.index);
  5456. } else if (opts.word) {
  5457. var index = this.toString().indexOf(opts.word);
  5458. if (index !== -1) pos = this.positionInside(index);
  5459. }
  5460. return pos;
  5461. };
  5462. /**
  5463. * @memberof Node#
  5464. * @member {string} type - String representing the node’s type.
  5465. * Possible values are `root`, `atrule`, `rule`,
  5466. * `decl`, or `comment`.
  5467. *
  5468. * @example
  5469. * postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
  5470. */
  5471. /**
  5472. * @memberof Node#
  5473. * @member {Container} parent - the node’s parent node.
  5474. *
  5475. * @example
  5476. * root.nodes[0].parent == root;
  5477. */
  5478. /**
  5479. * @memberof Node#
  5480. * @member {source} source - the input source of the node
  5481. *
  5482. * The property is used in source map generation.
  5483. *
  5484. * If you create a node manually (e.g., with `postcss.decl()`),
  5485. * that node will not have a `source` property and will be absent
  5486. * from the source map. For this reason, the plugin developer should
  5487. * consider cloning nodes to create new ones (in which case the new node’s
  5488. * source will reference the original, cloned node) or setting
  5489. * the `source` property manually.
  5490. *
  5491. * ```js
  5492. * // Bad
  5493. * const prefixed = postcss.decl({
  5494. * prop: '-moz-' + decl.prop,
  5495. * value: decl.value
  5496. * });
  5497. *
  5498. * // Good
  5499. * const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
  5500. * ```
  5501. *
  5502. * ```js
  5503. * if ( atrule.name == 'add-link' ) {
  5504. * const rule = postcss.rule({ selector: 'a', source: atrule.source });
  5505. * atrule.parent.insertBefore(atrule, rule);
  5506. * }
  5507. * ```
  5508. *
  5509. * @example
  5510. * decl.source.input.from //=> '/home/ai/a.sass'
  5511. * decl.source.start //=> { line: 10, column: 2 }
  5512. * decl.source.end //=> { line: 10, column: 12 }
  5513. */
  5514. /**
  5515. * @memberof Node#
  5516. * @member {object} raws - Information to generate byte-to-byte equal
  5517. * node string as it was in the origin input.
  5518. *
  5519. * Every parser saves its own properties,
  5520. * but the default CSS parser uses:
  5521. *
  5522. * * `before`: the space symbols before the node. It also stores `*`
  5523. * and `_` symbols before the declaration (IE hack).
  5524. * * `after`: the space symbols after the last child of the node
  5525. * to the end of the node.
  5526. * * `between`: the symbols between the property and value
  5527. * for declarations, selector and `{` for rules, or last parameter
  5528. * and `{` for at-rules.
  5529. * * `semicolon`: contains true if the last child has
  5530. * an (optional) semicolon.
  5531. * * `afterName`: the space between the at-rule name and its parameters.
  5532. * * `left`: the space symbols between `/*` and the comment’s text.
  5533. * * `right`: the space symbols between the comment’s text
  5534. * and <code>*&#47;</code>.
  5535. * * `important`: the content of the important statement,
  5536. * if it is not just `!important`.
  5537. *
  5538. * PostCSS cleans selectors, declaration values and at-rule parameters
  5539. * from comments and extra spaces, but it stores origin content in raws
  5540. * properties. As such, if you don’t change a declaration’s value,
  5541. * PostCSS will use the raw value with comments.
  5542. *
  5543. * @example
  5544. * const root = postcss.parse('a {\n color:black\n}')
  5545. * root.first.first.raws //=> { before: '\n ', between: ':' }
  5546. */
  5547. return Node;
  5548. }();
  5549. exports.default = Node;
  5550. /**
  5551. * @typedef {object} position
  5552. * @property {number} line - source line in file
  5553. * @property {number} column - source column in file
  5554. */
  5555. /**
  5556. * @typedef {object} source
  5557. * @property {Input} input - {@link Input} with input file
  5558. * @property {position} start - The starting position of the node’s source
  5559. * @property {position} end - The ending position of the node’s source
  5560. */
  5561. module.exports = exports['default'];
  5562. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGUuZXM2Il0sIm5hbWVzIjpbImNsb25lTm9kZSIsIm9iaiIsInBhcmVudCIsImNsb25lZCIsImNvbnN0cnVjdG9yIiwiaSIsImhhc093blByb3BlcnR5IiwidmFsdWUiLCJ0eXBlIiwiQXJyYXkiLCJtYXAiLCJqIiwiTm9kZSIsImRlZmF1bHRzIiwicmF3cyIsIkVycm9yIiwiSlNPTiIsInN0cmluZ2lmeSIsIm5hbWUiLCJlcnJvciIsIm1lc3NhZ2UiLCJvcHRzIiwic291cmNlIiwicG9zIiwicG9zaXRpb25CeSIsImlucHV0IiwibGluZSIsImNvbHVtbiIsIndhcm4iLCJyZXN1bHQiLCJ0ZXh0IiwiZGF0YSIsIm5vZGUiLCJyZW1vdmUiLCJyZW1vdmVDaGlsZCIsInVuZGVmaW5lZCIsInRvU3RyaW5nIiwic3RyaW5naWZpZXIiLCJjbG9uZSIsIm92ZXJyaWRlcyIsImNsb25lQmVmb3JlIiwiaW5zZXJ0QmVmb3JlIiwiY2xvbmVBZnRlciIsImluc2VydEFmdGVyIiwicmVwbGFjZVdpdGgiLCJub2RlcyIsIm1vdmVUbyIsIm5ld1BhcmVudCIsImNsZWFuUmF3cyIsInJvb3QiLCJhcHBlbmQiLCJtb3ZlQmVmb3JlIiwib3RoZXJOb2RlIiwibW92ZUFmdGVyIiwibmV4dCIsImluZGV4IiwicHJldiIsImJlZm9yZSIsImFkZCIsImFmdGVyIiwidG9KU09OIiwiZml4ZWQiLCJyYX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1cnJlbnQgbm9kZSB0byBjdXJyZW50IG5vZGXigJlzIHBhcmVudC5cbiAgICAgKlxuICAgICAqIEp1c3QgYWxpYXMgZm9yIGBub2RlLnBhcmVudC5pbnNlcnRBZnRlcihub2RlLCBhZGQpYC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7Tm9kZXxvYmplY3R8c3RyaW5nfE5vZGVbXX0gYWRkIC0gbmV3IG5vZGVcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge05vZGV9IHRoaXMgbm9kZSBmb3IgbWV0aG9kcyBjaGFpbi5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogZGVjbC5hZnRlcignY29sb3I6IGJsYWNrJyk7XG4gICAgICovXG4gICAgYWZ0ZXIoYWRkKSB7XG4gICAgICAgIHRoaXMucGFyZW50Lmluc2VydEFmdGVyKHRoaXMsIGFkZCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIHRvSlNPTigpIHtcbiAgICAgICAgbGV0IGZpeGVkID0geyB9O1xuXG4gICAgICAgIGZvciAoIGxldCBuYW1lIGluIHRoaXMgKSB7XG4gICAgICAgICAgICBpZiAoICF0aGlzLmhhc093blByb3BlcnR5KG5hbWUpICkgY29udGludWU7XG4gICAgICAgICAgICBpZiAoIG5hbWUgPT09ICdwYXJlbnQnICkgY29udGludWU7XG4gICAgICAgICAgICBsZXQgdmFsdWUgPSB0aGlzW25hbWVdO1xuXG4gICAgICAgICAgICBpZiAoIHZhbHVlIGluc3RhbmNlb2YgQXJyYXkgKSB7XG4gICAgICAgICAgICAgICAgZml4ZWRbbmFtZV0gPSB2YWx1ZS5tYXAoIGkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiBpID09PSAnb2JqZWN0JyAmJiBpLnRvSlNPTiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpLnRvSlNPTigpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuIC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y5hZnRlcjtcbiAgICAgICAgaWYgKCAha2VlcEJldHdlZW4gKSBkZWxldGUgdGhpcy5yYXdzLmJldHdlZW47XG4gICAgfVxuXG4gICAgcG9zaXRpb25JbnNpZGUoaW5kZXgpIHtcbiAgICAgICAgbGV0IHN0cmluZyA9IHRoaXMudG9TdHJpbmcoKTtcbiAgICAgICAgbGV0IGNvbHVtbiA9IHRoaXMuc291cmNlLnN0YXJ0LmNvbHVtbjtcbiAgICAgICAgbGV0IGxpbmUgICA9IHRoaXMuc291cmNlLnN0YXJ0LmxpbmU7XG5cbiAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgaW5kZXg7IGkrKyApIHtcbiAgICAgICAgICAgIGlmICggc3RyaW5nW2ldID09PSAnXFxuJyApIHtcbiAgICAgICAgICAgICAgICBjb2x1bW4gPSAxO1xuICAgICAgICAgICAgICAgIGxpbmUgICs9IDE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbHVtbiArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHsgbGluZSwgY29sdW1uIH07XG4gICAgfVxuXG4gICAgcG9zaXRpb25CeShvcHRzKSB7XG4gICAgICAgIGxldCBwb3MgPSB0aGlzLnNvdXJjZS5zdGFydDtcbiAgICAgICAgaWYgKCBvcHRzLmluZGV4ICkge1xuICAgICAgICAgICAgcG9zID0gdGhpcy5wb3NpdGlvbkluc2lkZShvcHRzLmluZGV4KTtcbiAgICAgICAgfSBlbHNlIGlmICggb3B0cy53b3JkICkge1xuICAgICAgICAgICAgbGV0IGluZGV4ID0gdGhpcy50b1N0cmluZygpLmluZGV4T2Yob3B0cy53b3JkKTtcbiAgICAgICAgICAgIGlmICggaW5kZXggIT09IC0xICkgcG9zID0gdGhpcy5wb3NpdGlvbkluc2lkZShpbmRleCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHBvcztcbiAgICB9XG5cbiAgICAvKipcb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gICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnXFxuICAnLCBiZXR3ZWVuOiAnOicgfVxuICAgICAqL1xuXG59XG5cbmV4cG9ydCBkZWZhdWx0IE5vZGU7XG5cbi8qKlxuICogQHR5cGVkZWYge29iamVjdH0gcG9zaXRpb25cbiAqIEBwcm9wZXJ0eSB7bnVtYmVyfSBsaW5lICAgLSBzb3VyY2UgbGluZSBpbiBmaWxlXG4gKiBAcHJvcGVydHkge251bWJlcn0gY29sdW1uIC0gc291cmNlIGNvbHVtbiBpbiBmaWxlXG4gKi9cblxuLyoqXG4gKiBAdHlwZWRlZiB7b2JqZWN0fSBzb3VyY2VcbiAqIEBwcm9wZXJ0eSB7SW5wdXR9IGlucHV0ICAgIC0ge0BsaW5rIElucHV0fSB3aXRoIGlucHV0IGZpbGVcbiAqIEBwcm9wZXJ0eSB7cG9zaXRpb259IHN0YXJ0IC0gVGhlIHN0YXJ0aW5nIHBvc2l0aW9uIG9mIHRoZSBub2Rl4oCZcyBzb3VyY2VcbiAqIEBwcm9wZXJ0eSB7cG9zaXRpb259IGVuZCAgIC0gVGhlIGVuZGluZyBwb3NpdGlvbiBvZiB0aGUgbm9kZeKAmXMgc291cmNlXG4gKi9cbiJdfQ==
  5563. /***/ }),
  5564. /* 31 */
  5565. /***/ (function(module, exports, __webpack_require__) {
  5566. "use strict";
  5567. exports.__esModule = true;
  5568. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5569. var _container = __webpack_require__(22);
  5570. var _container2 = _interopRequireDefault(_container);
  5571. var _list = __webpack_require__(171);
  5572. var _list2 = _interopRequireDefault(_list);
  5573. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5574. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5575. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5576. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5577. /**
  5578. * Represents a CSS rule: a selector followed by a declaration block.
  5579. *
  5580. * @extends Container
  5581. *
  5582. * @example
  5583. * const root = postcss.parse('a{}');
  5584. * const rule = root.first;
  5585. * rule.type //=> 'rule'
  5586. * rule.toString() //=> 'a{}'
  5587. */
  5588. var Rule = function (_Container) {
  5589. _inherits(Rule, _Container);
  5590. function Rule(defaults) {
  5591. _classCallCheck(this, Rule);
  5592. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  5593. _this.type = 'rule';
  5594. if (!_this.nodes) _this.nodes = [];
  5595. return _this;
  5596. }
  5597. /**
  5598. * An array containing the rule’s individual selectors.
  5599. * Groups of selectors are split at commas.
  5600. *
  5601. * @type {string[]}
  5602. *
  5603. * @example
  5604. * const root = postcss.parse('a, b { }');
  5605. * const rule = root.first;
  5606. *
  5607. * rule.selector //=> 'a, b'
  5608. * rule.selectors //=> ['a', 'b']
  5609. *
  5610. * rule.selectors = ['a', 'strong'];
  5611. * rule.selector //=> 'a, strong'
  5612. */
  5613. _createClass(Rule, [{
  5614. key: 'selectors',
  5615. get: function get() {
  5616. return _list2.default.comma(this.selector);
  5617. },
  5618. set: function set(values) {
  5619. var match = this.selector ? this.selector.match(/,\s*/) : null;
  5620. var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
  5621. this.selector = values.join(sep);
  5622. }
  5623. /**
  5624. * @memberof Rule#
  5625. * @member {string} selector - the rule’s full selector represented
  5626. * as a string
  5627. *
  5628. * @example
  5629. * const root = postcss.parse('a, b { }');
  5630. * const rule = root.first;
  5631. * rule.selector //=> 'a, b'
  5632. */
  5633. /**
  5634. * @memberof Rule#
  5635. * @member {object} raws - Information to generate byte-to-byte equal
  5636. * node string as it was in the origin input.
  5637. *
  5638. * Every parser saves its own properties,
  5639. * but the default CSS parser uses:
  5640. *
  5641. * * `before`: the space symbols before the node. It also stores `*`
  5642. * and `_` symbols before the declaration (IE hack).
  5643. * * `after`: the space symbols after the last child of the node
  5644. * to the end of the node.
  5645. * * `between`: the symbols between the property and value
  5646. * for declarations, selector and `{` for rules, or last parameter
  5647. * and `{` for at-rules.
  5648. * * `semicolon`: contains `true` if the last child has
  5649. * an (optional) semicolon.
  5650. * * `ownSemicolon`: contains `true` if there is semicolon after rule.
  5651. *
  5652. * PostCSS cleans selectors from comments and extra spaces,
  5653. * but it stores origin content in raws properties.
  5654. * As such, if you don’t change a declaration’s value,
  5655. * PostCSS will use the raw value with comments.
  5656. *
  5657. * @example
  5658. * const root = postcss.parse('a {\n color:black\n}')
  5659. * root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
  5660. */
  5661. }]);
  5662. return Rule;
  5663. }(_container2.default);
  5664. exports.default = Rule;
  5665. module.exports = exports['default'];
  5666. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGUuZXM2Il0sIm5hbWVzIjpbIlJ1bGUiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsImNvbW1hIiwic2VsZWN0b3IiLCJ2YWx1ZXMiLCJtYXRjaCIsInNlcCIsInJhdyIsImpvaW4iXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOzs7O0FBQ0E7Ozs7Ozs7Oz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gKiBQb3N0Q1NTIHdpbGwgdXNlIHRoZSByYXcgdmFsdWUgd2l0aCBjb21tZW50cy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoJ2Ege1xcbiAgY29sb3I6YmxhY2tcXG59JylcbiAgICAgKiByb290LmZpcnN0LmZpcnN0LnJhd3MgLy89PiB7IGJlZm9yZTogJycsIGJldHdlZW46ICcgJywgYWZ0ZXI6ICdcXG4nIH1cbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBSdWxlO1xuIl19
  5667. /***/ }),
  5668. /* 32 */
  5669. /***/ (function(module, exports, __webpack_require__) {
  5670. "use strict";
  5671. exports.__esModule = true;
  5672. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5673. var defaultRaw = {
  5674. colon: ': ',
  5675. indent: ' ',
  5676. beforeDecl: '\n',
  5677. beforeRule: '\n',
  5678. beforeOpen: ' ',
  5679. beforeClose: '\n',
  5680. beforeComment: '\n',
  5681. after: '\n',
  5682. emptyBody: '',
  5683. commentLeft: ' ',
  5684. commentRight: ' '
  5685. };
  5686. function capitalize(str) {
  5687. return str[0].toUpperCase() + str.slice(1);
  5688. }
  5689. var Stringifier = function () {
  5690. function Stringifier(builder) {
  5691. _classCallCheck(this, Stringifier);
  5692. this.builder = builder;
  5693. }
  5694. Stringifier.prototype.stringify = function stringify(node, semicolon) {
  5695. this[node.type](node, semicolon);
  5696. };
  5697. Stringifier.prototype.root = function root(node) {
  5698. this.body(node);
  5699. if (node.raws.after) this.builder(node.raws.after);
  5700. };
  5701. Stringifier.prototype.comment = function comment(node) {
  5702. var left = this.raw(node, 'left', 'commentLeft');
  5703. var right = this.raw(node, 'right', 'commentRight');
  5704. this.builder('/*' + left + node.text + right + '*/', node);
  5705. };
  5706. Stringifier.prototype.decl = function decl(node, semicolon) {
  5707. var between = this.raw(node, 'between', 'colon');
  5708. var string = node.prop + between + this.rawValue(node, 'value');
  5709. if (node.important) {
  5710. string += node.raws.important || ' !important';
  5711. }
  5712. if (semicolon) string += ';';
  5713. this.builder(string, node);
  5714. };
  5715. Stringifier.prototype.rule = function rule(node) {
  5716. this.block(node, this.rawValue(node, 'selector'));
  5717. if (node.raws.ownSemicolon) {
  5718. this.builder(node.raws.ownSemicolon, node, 'end');
  5719. }
  5720. };
  5721. Stringifier.prototype.atrule = function atrule(node, semicolon) {
  5722. var name = '@' + node.name;
  5723. var params = node.params ? this.rawValue(node, 'params') : '';
  5724. if (typeof node.raws.afterName !== 'undefined') {
  5725. name += node.raws.afterName;
  5726. } else if (params) {
  5727. name += ' ';
  5728. }
  5729. if (node.nodes) {
  5730. this.block(node, name + params);
  5731. } else {
  5732. var end = (node.raws.between || '') + (semicolon ? ';' : '');
  5733. this.builder(name + params + end, node);
  5734. }
  5735. };
  5736. Stringifier.prototype.body = function body(node) {
  5737. var last = node.nodes.length - 1;
  5738. while (last > 0) {
  5739. if (node.nodes[last].type !== 'comment') break;
  5740. last -= 1;
  5741. }
  5742. var semicolon = this.raw(node, 'semicolon');
  5743. for (var i = 0; i < node.nodes.length; i++) {
  5744. var child = node.nodes[i];
  5745. var before = this.raw(child, 'before');
  5746. if (before) this.builder(before);
  5747. this.stringify(child, last !== i || semicolon);
  5748. }
  5749. };
  5750. Stringifier.prototype.block = function block(node, start) {
  5751. var between = this.raw(node, 'between', 'beforeOpen');
  5752. this.builder(start + between + '{', node, 'start');
  5753. var after = void 0;
  5754. if (node.nodes && node.nodes.length) {
  5755. this.body(node);
  5756. after = this.raw(node, 'after');
  5757. } else {
  5758. after = this.raw(node, 'after', 'emptyBody');
  5759. }
  5760. if (after) this.builder(after);
  5761. this.builder('}', node, 'end');
  5762. };
  5763. Stringifier.prototype.raw = function raw(node, own, detect) {
  5764. var value = void 0;
  5765. if (!detect) detect = own;
  5766. // Already had
  5767. if (own) {
  5768. value = node.raws[own];
  5769. if (typeof value !== 'undefined') return value;
  5770. }
  5771. var parent = node.parent;
  5772. // Hack for first rule in CSS
  5773. if (detect === 'before') {
  5774. if (!parent || parent.type === 'root' && parent.first === node) {
  5775. return '';
  5776. }
  5777. }
  5778. // Floating child without parent
  5779. if (!parent) return defaultRaw[detect];
  5780. // Detect style by other nodes
  5781. var root = node.root();
  5782. if (!root.rawCache) root.rawCache = {};
  5783. if (typeof root.rawCache[detect] !== 'undefined') {
  5784. return root.rawCache[detect];
  5785. }
  5786. if (detect === 'before' || detect === 'after') {
  5787. return this.beforeAfter(node, detect);
  5788. } else {
  5789. var method = 'raw' + capitalize(detect);
  5790. if (this[method]) {
  5791. value = this[method](root, node);
  5792. } else {
  5793. root.walk(function (i) {
  5794. value = i.raws[own];
  5795. if (typeof value !== 'undefined') return false;
  5796. });
  5797. }
  5798. }
  5799. if (typeof value === 'undefined') value = defaultRaw[detect];
  5800. root.rawCache[detect] = value;
  5801. return value;
  5802. };
  5803. Stringifier.prototype.rawSemicolon = function rawSemicolon(root) {
  5804. var value = void 0;
  5805. root.walk(function (i) {
  5806. if (i.nodes && i.nodes.length && i.last.type === 'decl') {
  5807. value = i.raws.semicolon;
  5808. if (typeof value !== 'undefined') return false;
  5809. }
  5810. });
  5811. return value;
  5812. };
  5813. Stringifier.prototype.rawEmptyBody = function rawEmptyBody(root) {
  5814. var value = void 0;
  5815. root.walk(function (i) {
  5816. if (i.nodes && i.nodes.length === 0) {
  5817. value = i.raws.after;
  5818. if (typeof value !== 'undefined') return false;
  5819. }
  5820. });
  5821. return value;
  5822. };
  5823. Stringifier.prototype.rawIndent = function rawIndent(root) {
  5824. if (root.raws.indent) return root.raws.indent;
  5825. var value = void 0;
  5826. root.walk(function (i) {
  5827. var p = i.parent;
  5828. if (p && p !== root && p.parent && p.parent === root) {
  5829. if (typeof i.raws.before !== 'undefined') {
  5830. var parts = i.raws.before.split('\n');
  5831. value = parts[parts.length - 1];
  5832. value = value.replace(/[^\s]/g, '');
  5833. return false;
  5834. }
  5835. }
  5836. });
  5837. return value;
  5838. };
  5839. Stringifier.prototype.rawBeforeComment = function rawBeforeComment(root, node) {
  5840. var value = void 0;
  5841. root.walkComments(function (i) {
  5842. if (typeof i.raws.before !== 'undefined') {
  5843. value = i.raws.before;
  5844. if (value.indexOf('\n') !== -1) {
  5845. value = value.replace(/[^\n]+$/, '');
  5846. }
  5847. return false;
  5848. }
  5849. });
  5850. if (typeof value === 'undefined') {
  5851. value = this.raw(node, null, 'beforeDecl');
  5852. } else if (value) {
  5853. value = value.replace(/[^\s]/g, '');
  5854. }
  5855. return value;
  5856. };
  5857. Stringifier.prototype.rawBeforeDecl = function rawBeforeDecl(root, node) {
  5858. var value = void 0;
  5859. root.walkDecls(function (i) {
  5860. if (typeof i.raws.before !== 'undefined') {
  5861. value = i.raws.before;
  5862. if (value.indexOf('\n') !== -1) {
  5863. value = value.replace(/[^\n]+$/, '');
  5864. }
  5865. return false;
  5866. }
  5867. });
  5868. if (typeof value === 'undefined') {
  5869. value = this.raw(node, null, 'beforeRule');
  5870. } else if (value) {
  5871. value = value.replace(/[^\s]/g, '');
  5872. }
  5873. return value;
  5874. };
  5875. Stringifier.prototype.rawBeforeRule = function rawBeforeRule(root) {
  5876. var value = void 0;
  5877. root.walk(function (i) {
  5878. if (i.nodes && (i.parent !== root || root.first !== i)) {
  5879. if (typeof i.raws.before !== 'undefined') {
  5880. value = i.raws.before;
  5881. if (value.indexOf('\n') !== -1) {
  5882. value = value.replace(/[^\n]+$/, '');
  5883. }
  5884. return false;
  5885. }
  5886. }
  5887. });
  5888. if (value) value = value.replace(/[^\s]/g, '');
  5889. return value;
  5890. };
  5891. Stringifier.prototype.rawBeforeClose = function rawBeforeClose(root) {
  5892. var value = void 0;
  5893. root.walk(function (i) {
  5894. if (i.nodes && i.nodes.length > 0) {
  5895. if (typeof i.raws.after !== 'undefined') {
  5896. value = i.raws.after;
  5897. if (value.indexOf('\n') !== -1) {
  5898. value = value.replace(/[^\n]+$/, '');
  5899. }
  5900. return false;
  5901. }
  5902. }
  5903. });
  5904. if (value) value = value.replace(/[^\s]/g, '');
  5905. return value;
  5906. };
  5907. Stringifier.prototype.rawBeforeOpen = function rawBeforeOpen(root) {
  5908. var value = void 0;
  5909. root.walk(function (i) {
  5910. if (i.type !== 'decl') {
  5911. value = i.raws.between;
  5912. if (typeof value !== 'undefined') return false;
  5913. }
  5914. });
  5915. return value;
  5916. };
  5917. Stringifier.prototype.rawColon = function rawColon(root) {
  5918. var value = void 0;
  5919. root.walkDecls(function (i) {
  5920. if (typeof i.raws.between !== 'undefined') {
  5921. value = i.raws.between.replace(/[^\s:]/g, '');
  5922. return false;
  5923. }
  5924. });
  5925. return value;
  5926. };
  5927. Stringifier.prototype.beforeAfter = function beforeAfter(node, detect) {
  5928. var value = void 0;
  5929. if (node.type === 'decl') {
  5930. value = this.raw(node, null, 'beforeDecl');
  5931. } else if (node.type === 'comment') {
  5932. value = this.raw(node, null, 'beforeComment');
  5933. } else if (detect === 'before') {
  5934. value = this.raw(node, null, 'beforeRule');
  5935. } else {
  5936. value = this.raw(node, null, 'beforeClose');
  5937. }
  5938. var buf = node.parent;
  5939. var depth = 0;
  5940. while (buf && buf.type !== 'root') {
  5941. depth += 1;
  5942. buf = buf.parent;
  5943. }
  5944. if (value.indexOf('\n') !== -1) {
  5945. var indent = this.raw(node, null, 'indent');
  5946. if (indent.length) {
  5947. for (var step = 0; step < depth; step++) {
  5948. value += indent;
  5949. }
  5950. }
  5951. }
  5952. return value;
  5953. };
  5954. Stringifier.prototype.rawValue = function rawValue(node, prop) {
  5955. var value = node[prop];
  5956. var raw = node.raws[prop];
  5957. if (raw && raw.value === value) {
  5958. return raw.raw;
  5959. } else {
  5960. return value;
  5961. }
  5962. };
  5963. return Stringifier;
  5964. }();
  5965. exports.default = Stringifier;
  5966. module.exports = exports['default'];
  5967. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmaWVyLmVz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AgICAgIGlmICggbm9kZS5pbXBvcnRhbnQgKSB7XG4gICAgICAgICAgICBzdHJpbmcgKz0gbm9kZS5yYXdzLmltcG9ydGFudCB8fCAnICFpbXBvcnRhbnQnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBzZW1pY29sb24gKSBzdHJpbmcgKz0gJzsnO1xuICAgICAgICB0aGlzLmJ1aWxkZXIoc3RyaW5nLCBub2RlKTtcbiAgICB9XG5cbiAgICBydWxlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5ibG9jayhub2RlLCB0aGlzLnJhd1ZhbHVlKG5vZGUsICdzZWxlY3RvcicpKTtcbiAgICAgICAgaWYgKCBub2RlLnJhd3Mub3duU2VtaWNvbG9uICkge1xuICAgICAgICAgICAgdGhpcy5idWlsZGVyKG5vZGUucmF3cy5vd25TZW1pY29sb24sIG5vZGUsICdlbmQnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGF0cnVsZShub2RlLCBzZW1pY29sb24pIHtcbiAgICAgICAgbGV0IG5hbWUgICA9ICdAJyArIG5vZGUubmFtZTtcbiAgICAgICAgbGV0IHBhcmFtcyA9IG5vZGUucGFyYW1zID8gdGhpcy5yYXdWYWx1ZShub2RlLCAncGFyYW1zJykgOiAnJztcblxuICAgICAgICBpZiAoIHR5cGVvZiBub2RlLnJhd3MuYWZ0ZXJOYW1lICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIG5hbWUgKz0gbm9kZS5yYXdzLmFmdGVyTmFtZTtcbiAgICAgICAgfSBlbHNlIGlmICggcGFyYW1zICkge1xuICAgICAgICAgICAgbmFtZSArPSAnICc7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG5vZGUubm9kZXMgKSB7XG4gICAgICAgICAgICB0aGlzLmJsb2NrKG5vZGUsIG5hbWUgKyBwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGVuZCA9IChub2RlLnJhd3MuYmV0d2VlbiB8f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m5vZGVzLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMuYm9keShub2RlKTtcbiAgICAgICAgICAgIGFmdGVyID0gdGhpcy5yYXcobm9kZSwgJ2FmdGVyJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhZnRlciA9IHRoaXMucmF3KG5vZGUsICdhZnRlcicsICdlbXB0eUJvZHknKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggYWZ0ZXIgKSB0aGlzLmJ1aWxkZXIoYWZ0ZXIpO1xuICAgICAgICB0aGlzLmJ1aWxkZXIoJ30nLCBub2RlLCAnZW5kJyk7XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIG93biwgZGV0ZWN0KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgaWYgKCAhZGV0ZWN0ICkgZGV0ZWN0ID0gb3duO1xuXG4gICAgICAgIC8vIEFscmVhZHkgaGFkXG4gICAgICAgIGlmICggb3duICkge1xuICAgICAgICAgICAgdmFsdWUgPSBub2RlLnJhd3Nbb3duXTtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBwYXJlbnQgPSBub2RlLnBhcmVudDtcblxuICAgICAgICAvLyBIYWNrIGZvciBmaXJzdCBydWxlIGluIENTU1xuICAgICAgICBpZiAoIGRldGVjdCA9PT0gJ2JlZm9yZScgKSB7XG4gICAgICAgICAgICBpZiAoICFwYXJlbnQgfHwgcGFyZW50LnR5cGUgPT09ICdyb290JyAmJiBwYXJlbnQuZmlyc3QgPT09IG5vZGUgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gRmxvYXRpbmcgY2hpbGQgd2l0aG91dCBwYXJlbnRcbiAgICAgICAgaWYgKCAhcGFyZW50ICkgcmV0dX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gcm9vdC5yYXdDYWNoZVtkZXRlY3RdID0gdmFsdWU7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdTZW1pY29sb24ocm9vdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2FsayggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIGkubm9kZXMgJiYgaS5ub2Rlcy5sZW5ndGggJiYgaS5sYXN0LnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5zZW1pY29sb247XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgIT09ICd1bmRlZmluZWQnICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd0VtcHR5Qm9keShyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiBpLm5vZGVzLmxlbmd0aCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5hZnRlcjtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3SW5kZW50KHJvb3QpIHtcbiAgICAgICAgaWYgKCByb290LnJhd3MuaW5kZW50ICkgcmV0dXJuIHJvb3QucmF3cy5pbmRlbnQ7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGxldCBwID0gaS5wYXJlbnQ7XG4gICAgICAgICAgICBpZiAoIHAgJiYgcCAhPT0gcm9vdCAmJiBwLnBhcmVudCAmJiBwLnBhcmVudCA9PT0gcm9vdCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiBpLnJhd3MuYmVmb3JlICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gaS5yYXdzLmJlZm9yZS5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcGFydHNbcGFydHMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXHNdL2csICcnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVDb21tZW50KHJvb3QsIG5vZGUpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGtDb21tZW50cyggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpLnJhd3MuYmVmb3JlICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmICggdHlwZW9mIHZhbHVlID09PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHZhbHVlID0gdGhpcy5yYXcobm9kZSwgbnVsbCwgJ2JlZm9yZURlY2wnKTtcbiAgICAgICAgfSBlbHNlIGlmICggdmFsdWUgKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd0JlZm9yZURlY2wocm9vdCwgbm9kZSkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2Fsa0RlY2xzKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcbl0rJC8sICcnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlUnVsZScpO1xuICAgICAgICB9IGVsc2UgaWYgKCB2YWx1ZSApIHtcbiAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXHNdL2csICcnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlUnVsZShyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiAoaS5wYXJlbnQgIT09IHJvb3QgfHwgcm9vdC5maXJzdCAhPT0gaSkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJlZm9yZSAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxuXSskLywgJycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoIHZhbHVlICkgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcc10vZywgJycpO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlQ2xvc2Uocm9vdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2FsayggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIGkubm9kZXMgJiYgaS5ub2Rlcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5hZnRlciAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmFmdGVyO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmICggdmFsdWUgKSB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVPcGVuKHJvb3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCBpLnR5cGUgIT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZXR3ZWVuO1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdDb2xvbihyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrRGVjbHMoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJldHdlZW4gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJldHdlZW4ucmVwbGFjZSgvW15cXHM6XS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIGJlZm9yZUFmdGVyKG5vZGUsIGRldGVjdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIGlmICggbm9kZS50eXBlID09PSAnZGVjbCcgKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHRoaXMucmF3KG5vZGUs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xldCByYXcgICA9IG5vZGUucmF3c1twcm9wXTtcbiAgICAgICAgaWYgKCByYXcgJiYgcmF3LnZhbHVlID09PSB2YWx1ZSApIHtcbiAgICAgICAgICAgIHJldHVybiByYXcucmF3O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG4gICAgfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IFN0cmluZ2lmaWVyO1xuIl19
  5968. /***/ }),
  5969. /* 33 */
  5970. /***/ (function(module, exports, __webpack_require__) {
  5971. "use strict";
  5972. exports.__esModule = true;
  5973. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5974. var _node = __webpack_require__(9);
  5975. var _node2 = _interopRequireDefault(_node);
  5976. var _types = __webpack_require__(1);
  5977. var types = _interopRequireWildcard(_types);
  5978. 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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  5979. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5980. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5981. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5982. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5983. var Container = function (_Node) {
  5984. _inherits(Container, _Node);
  5985. function Container(opts) {
  5986. _classCallCheck(this, Container);
  5987. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  5988. if (!_this.nodes) {
  5989. _this.nodes = [];
  5990. }
  5991. return _this;
  5992. }
  5993. Container.prototype.append = function append(selector) {
  5994. selector.parent = this;
  5995. this.nodes.push(selector);
  5996. return this;
  5997. };
  5998. Container.prototype.prepend = function prepend(selector) {
  5999. selector.parent = this;
  6000. this.nodes.unshift(selector);
  6001. return this;
  6002. };
  6003. Container.prototype.at = function at(index) {
  6004. return this.nodes[index];
  6005. };
  6006. Container.prototype.index = function index(child) {
  6007. if (typeof child === 'number') {
  6008. return child;
  6009. }
  6010. return this.nodes.indexOf(child);
  6011. };
  6012. Container.prototype.removeChild = function removeChild(child) {
  6013. child = this.index(child);
  6014. this.at(child).parent = undefined;
  6015. this.nodes.splice(child, 1);
  6016. var index = void 0;
  6017. for (var id in this.indexes) {
  6018. index = this.indexes[id];
  6019. if (index >= child) {
  6020. this.indexes[id] = index - 1;
  6021. }
  6022. }
  6023. return this;
  6024. };
  6025. Container.prototype.removeAll = function removeAll() {
  6026. for (var _iterator = this.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  6027. var _ref;
  6028. if (_isArray) {
  6029. if (_i >= _iterator.length) break;
  6030. _ref = _iterator[_i++];
  6031. } else {
  6032. _i = _iterator.next();
  6033. if (_i.done) break;
  6034. _ref = _i.value;
  6035. }
  6036. var node = _ref;
  6037. node.parent = undefined;
  6038. }
  6039. this.nodes = [];
  6040. return this;
  6041. };
  6042. Container.prototype.empty = function empty() {
  6043. return this.removeAll();
  6044. };
  6045. Container.prototype.insertAfter = function insertAfter(oldNode, newNode) {
  6046. var oldIndex = this.index(oldNode);
  6047. this.nodes.splice(oldIndex + 1, 0, newNode);
  6048. var index = void 0;
  6049. for (var id in this.indexes) {
  6050. index = this.indexes[id];
  6051. if (oldIndex <= index) {
  6052. this.indexes[id] = index + this.nodes.length;
  6053. }
  6054. }
  6055. return this;
  6056. };
  6057. Container.prototype.insertBefore = function insertBefore(oldNode, newNode) {
  6058. var oldIndex = this.index(oldNode);
  6059. this.nodes.splice(oldIndex, 0, newNode);
  6060. var index = void 0;
  6061. for (var id in this.indexes) {
  6062. index = this.indexes[id];
  6063. if (oldIndex <= index) {
  6064. this.indexes[id] = index + this.nodes.length;
  6065. }
  6066. }
  6067. return this;
  6068. };
  6069. Container.prototype.each = function each(callback) {
  6070. if (!this.lastEach) {
  6071. this.lastEach = 0;
  6072. }
  6073. if (!this.indexes) {
  6074. this.indexes = {};
  6075. }
  6076. this.lastEach++;
  6077. var id = this.lastEach;
  6078. this.indexes[id] = 0;
  6079. if (!this.length) {
  6080. return undefined;
  6081. }
  6082. var index = void 0,
  6083. result = void 0;
  6084. while (this.indexes[id] < this.length) {
  6085. index = this.indexes[id];
  6086. result = callback(this.at(index), index);
  6087. if (result === false) {
  6088. break;
  6089. }
  6090. this.indexes[id] += 1;
  6091. }
  6092. delete this.indexes[id];
  6093. if (result === false) {
  6094. return false;
  6095. }
  6096. };
  6097. Container.prototype.walk = function walk(callback) {
  6098. return this.each(function (node, i) {
  6099. var result = callback(node, i);
  6100. if (result !== false && node.length) {
  6101. result = node.walk(callback);
  6102. }
  6103. if (result === false) {
  6104. return false;
  6105. }
  6106. });
  6107. };
  6108. Container.prototype.walkAttributes = function walkAttributes(callback) {
  6109. var _this2 = this;
  6110. return this.walk(function (selector) {
  6111. if (selector.type === types.ATTRIBUTE) {
  6112. return callback.call(_this2, selector);
  6113. }
  6114. });
  6115. };
  6116. Container.prototype.walkClasses = function walkClasses(callback) {
  6117. var _this3 = this;
  6118. return this.walk(function (selector) {
  6119. if (selector.type === types.CLASS) {
  6120. return callback.call(_this3, selector);
  6121. }
  6122. });
  6123. };
  6124. Container.prototype.walkCombinators = function walkCombinators(callback) {
  6125. var _this4 = this;
  6126. return this.walk(function (selector) {
  6127. if (selector.type === types.COMBINATOR) {
  6128. return callback.call(_this4, selector);
  6129. }
  6130. });
  6131. };
  6132. Container.prototype.walkComments = function walkComments(callback) {
  6133. var _this5 = this;
  6134. return this.walk(function (selector) {
  6135. if (selector.type === types.COMMENT) {
  6136. return callback.call(_this5, selector);
  6137. }
  6138. });
  6139. };
  6140. Container.prototype.walkIds = function walkIds(callback) {
  6141. var _this6 = this;
  6142. return this.walk(function (selector) {
  6143. if (selector.type === types.ID) {
  6144. return callback.call(_this6, selector);
  6145. }
  6146. });
  6147. };
  6148. Container.prototype.walkNesting = function walkNesting(callback) {
  6149. var _this7 = this;
  6150. return this.walk(function (selector) {
  6151. if (selector.type === types.NESTING) {
  6152. return callback.call(_this7, selector);
  6153. }
  6154. });
  6155. };
  6156. Container.prototype.walkPseudos = function walkPseudos(callback) {
  6157. var _this8 = this;
  6158. return this.walk(function (selector) {
  6159. if (selector.type === types.PSEUDO) {
  6160. return callback.call(_this8, selector);
  6161. }
  6162. });
  6163. };
  6164. Container.prototype.walkTags = function walkTags(callback) {
  6165. var _this9 = this;
  6166. return this.walk(function (selector) {
  6167. if (selector.type === types.TAG) {
  6168. return callback.call(_this9, selector);
  6169. }
  6170. });
  6171. };
  6172. Container.prototype.walkUniversals = function walkUniversals(callback) {
  6173. var _this10 = this;
  6174. return this.walk(function (selector) {
  6175. if (selector.type === types.UNIVERSAL) {
  6176. return callback.call(_this10, selector);
  6177. }
  6178. });
  6179. };
  6180. Container.prototype.split = function split(callback) {
  6181. var _this11 = this;
  6182. var current = [];
  6183. return this.reduce(function (memo, node, index) {
  6184. var split = callback.call(_this11, node);
  6185. current.push(node);
  6186. if (split) {
  6187. memo.push(current);
  6188. current = [];
  6189. } else if (index === _this11.length - 1) {
  6190. memo.push(current);
  6191. }
  6192. return memo;
  6193. }, []);
  6194. };
  6195. Container.prototype.map = function map(callback) {
  6196. return this.nodes.map(callback);
  6197. };
  6198. Container.prototype.reduce = function reduce(callback, memo) {
  6199. return this.nodes.reduce(callback, memo);
  6200. };
  6201. Container.prototype.every = function every(callback) {
  6202. return this.nodes.every(callback);
  6203. };
  6204. Container.prototype.some = function some(callback) {
  6205. return this.nodes.some(callback);
  6206. };
  6207. Container.prototype.filter = function filter(callback) {
  6208. return this.nodes.filter(callback);
  6209. };
  6210. Container.prototype.sort = function sort(callback) {
  6211. return this.nodes.sort(callback);
  6212. };
  6213. Container.prototype.toString = function toString() {
  6214. return this.map(String).join('');
  6215. };
  6216. _createClass(Container, [{
  6217. key: 'first',
  6218. get: function get() {
  6219. return this.at(0);
  6220. }
  6221. }, {
  6222. key: 'last',
  6223. get: function get() {
  6224. return this.at(this.length - 1);
  6225. }
  6226. }, {
  6227. key: 'length',
  6228. get: function get() {
  6229. return this.nodes.length;
  6230. }
  6231. }]);
  6232. return Container;
  6233. }(_node2.default);
  6234. exports.default = Container;
  6235. module.exports = exports['default'];
  6236. /***/ }),
  6237. /* 34 */
  6238. /***/ (function(module, exports, __webpack_require__) {
  6239. "use strict";
  6240. exports.__esModule = true;
  6241. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6242. var _container = __webpack_require__(36);
  6243. var _container2 = _interopRequireDefault(_container);
  6244. var _warnOnce = __webpack_require__(5);
  6245. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  6246. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6247. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6248. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6249. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6250. /**
  6251. * Represents an at-rule.
  6252. *
  6253. * If it’s followed in the CSS by a {} block, this node will have
  6254. * a nodes property representing its children.
  6255. *
  6256. * @extends Container
  6257. *
  6258. * @example
  6259. * const root = postcss.parse('@charset "UTF-8"; @media print {}');
  6260. *
  6261. * const charset = root.first;
  6262. * charset.type //=> 'atrule'
  6263. * charset.nodes //=> undefined
  6264. *
  6265. * const media = root.last;
  6266. * media.nodes //=> []
  6267. */
  6268. var AtRule = function (_Container) {
  6269. _inherits(AtRule, _Container);
  6270. function AtRule(defaults) {
  6271. _classCallCheck(this, AtRule);
  6272. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  6273. _this.type = 'atrule';
  6274. return _this;
  6275. }
  6276. AtRule.prototype.append = function append() {
  6277. var _Container$prototype$;
  6278. if (!this.nodes) this.nodes = [];
  6279. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  6280. children[_key] = arguments[_key];
  6281. }
  6282. return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
  6283. };
  6284. AtRule.prototype.prepend = function prepend() {
  6285. var _Container$prototype$2;
  6286. if (!this.nodes) this.nodes = [];
  6287. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  6288. children[_key2] = arguments[_key2];
  6289. }
  6290. return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
  6291. };
  6292. _createClass(AtRule, [{
  6293. key: 'afterName',
  6294. get: function get() {
  6295. (0, _warnOnce2.default)('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
  6296. return this.raws.afterName;
  6297. },
  6298. set: function set(val) {
  6299. (0, _warnOnce2.default)('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
  6300. this.raws.afterName = val;
  6301. }
  6302. }, {
  6303. key: '_params',
  6304. get: function get() {
  6305. (0, _warnOnce2.default)('AtRule#_params was deprecated. Use AtRule#raws.params');
  6306. return this.raws.params;
  6307. },
  6308. set: function set(val) {
  6309. (0, _warnOnce2.default)('AtRule#_params was deprecated. Use AtRule#raws.params');
  6310. this.raws.params = val;
  6311. }
  6312. /**
  6313. * @memberof AtRule#
  6314. * @member {string} name - the at-rule’s name immediately follows the `@`
  6315. *
  6316. * @example
  6317. * const root = postcss.parse('@media print {}');
  6318. * media.name //=> 'media'
  6319. * const media = root.first;
  6320. */
  6321. /**
  6322. * @memberof AtRule#
  6323. * @member {string} params - the at-rule’s parameters, the values
  6324. * that follow the at-rule’s name but precede
  6325. * any {} block
  6326. *
  6327. * @example
  6328. * const root = postcss.parse('@media print, screen {}');
  6329. * const media = root.first;
  6330. * media.params //=> 'print, screen'
  6331. */
  6332. /**
  6333. * @memberof AtRule#
  6334. * @member {object} raws - Information to generate byte-to-byte equal
  6335. * node string as it was in the origin input.
  6336. *
  6337. * Every parser saves its own properties,
  6338. * but the default CSS parser uses:
  6339. *
  6340. * * `before`: the space symbols before the node. It also stores `*`
  6341. * and `_` symbols before the declaration (IE hack).
  6342. * * `after`: the space symbols after the last child of the node
  6343. * to the end of the node.
  6344. * * `between`: the symbols between the property and value
  6345. * for declarations, selector and `{` for rules, or last parameter
  6346. * and `{` for at-rules.
  6347. * * `semicolon`: contains true if the last child has
  6348. * an (optional) semicolon.
  6349. * * `afterName`: the space between the at-rule name and its parameters.
  6350. *
  6351. * PostCSS cleans at-rule parameters from comments and extra spaces,
  6352. * but it stores origin content in raws properties.
  6353. * As such, if you don’t change a declaration’s value,
  6354. * PostCSS will use the raw value with comments.
  6355. *
  6356. * @example
  6357. * const root = postcss.parse(' @media\nprint {\n}')
  6358. * root.first.first.raws //=> { before: ' ',
  6359. * // between: ' ',
  6360. * // afterName: '\n',
  6361. * // after: '\n' }
  6362. */
  6363. }]);
  6364. return AtRule;
  6365. }(_container2.default);
  6366. exports.default = AtRule;
  6367. module.exports = exports['default'];
  6368. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIiwicmF3cyIsImFmdGVyTmFtZSIsInZhbCIsInBhcmFtcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7QUFDQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQWtCTUEsTTs7O0FBRUYsb0JBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsc0JBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQUwsR0FBWSxRQUFaO0FBRmtCO0FBR3JCOztxQkFFREMsTSxxQkFBb0I7QUFBQTs7QUFDaEIsWUFBSyxDQUFDLEtBQUtDLEtBQVgsRUFBbUIsS0FBS0EsS0FBTCxHQUFhLEVBQWI7O0FBREgsMENBQVZDLFFBQVU7QUFBVkEsb0JBQVU7QUFBQTs7QUFFaEIsZUFBTyw4Q0FBTUYsTUFBTixrREFBZ0JFLFFBQWhCLEVBQVA7QUFDSCxLOztxQkFFREMsTyxzQkFBcUI7QUFBQTs7QUFDakIsWUFBSyxDQUFDLEtBQUtGLEtBQVgsRUFBbUIsS0FBS0EsS0FBTCxHQUFhLEVBQWI7O0FBREYsMkNBQVZ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gKi9cbn1cblxuZXhwb3J0IGRlZmF1bHQgQXRSdWxlO1xuIl19
  6369. /***/ }),
  6370. /* 35 */
  6371. /***/ (function(module, exports, __webpack_require__) {
  6372. "use strict";
  6373. exports.__esModule = true;
  6374. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6375. var _warnOnce = __webpack_require__(5);
  6376. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  6377. var _node = __webpack_require__(38);
  6378. var _node2 = _interopRequireDefault(_node);
  6379. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6380. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6381. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6382. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6383. /**
  6384. * Represents a comment between declarations or statements (rule and at-rules).
  6385. *
  6386. * Comments inside selectors, at-rule parameters, or declaration values
  6387. * will be stored in the `raws` properties explained above.
  6388. *
  6389. * @extends Node
  6390. */
  6391. var Comment = function (_Node) {
  6392. _inherits(Comment, _Node);
  6393. function Comment(defaults) {
  6394. _classCallCheck(this, Comment);
  6395. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  6396. _this.type = 'comment';
  6397. return _this;
  6398. }
  6399. _createClass(Comment, [{
  6400. key: 'left',
  6401. get: function get() {
  6402. (0, _warnOnce2.default)('Comment#left was deprecated. Use Comment#raws.left');
  6403. return this.raws.left;
  6404. },
  6405. set: function set(val) {
  6406. (0, _warnOnce2.default)('Comment#left was deprecated. Use Comment#raws.left');
  6407. this.raws.left = val;
  6408. }
  6409. }, {
  6410. key: 'right',
  6411. get: function get() {
  6412. (0, _warnOnce2.default)('Comment#right was deprecated. Use Comment#raws.right');
  6413. return this.raws.right;
  6414. },
  6415. set: function set(val) {
  6416. (0, _warnOnce2.default)('Comment#right was deprecated. Use Comment#raws.right');
  6417. this.raws.right = val;
  6418. }
  6419. /**
  6420. * @memberof Comment#
  6421. * @member {string} text - the comment’s text
  6422. */
  6423. /**
  6424. * @memberof Comment#
  6425. * @member {object} raws - Information to generate byte-to-byte equal
  6426. * node string as it was in the origin input.
  6427. *
  6428. * Every parser saves its own properties,
  6429. * but the default CSS parser uses:
  6430. *
  6431. * * `before`: the space symbols before the node.
  6432. * * `left`: the space symbols between `/*` and the comment’s text.
  6433. * * `right`: the space symbols between the comment’s text.
  6434. */
  6435. }]);
  6436. return Comment;
  6437. }(_node2.default);
  6438. exports.default = Comment;
  6439. module.exports = exports['default'];
  6440. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiLCJyYXdzIiwibGVmdCIsInZhbCIsInJpZ2h0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7SUFRTUEsTzs7O0FBRUYscUJBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsaUJBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQ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AgICAgICAgICAgICAgICAgICBub2RlIHN0cmluZyBhcyBpdCB3YXMgaW4gdGhlIG9yaWdpbiBpbnB1dC5cbiAgICAgKlxuICAgICAqIEV2ZXJ5IHBhcnNlciBzYXZlcyBpdHMgb3duIHByb3BlcnRpZXMsXG4gICAgICogYnV0IHRoZSBkZWZhdWx0IENTUyBwYXJzZXIgdXNlczpcbiAgICAgKlxuICAgICAqICogYGJlZm9yZWA6IHRoZSBzcGFjZSBzeW1ib2xzIGJlZm9yZSB0aGUgbm9kZS5cbiAgICAgKiAqIGBsZWZ0YDogdGhlIHNwYWNlIHN5bWJvbHMgYmV0d2VlbiBgLypgIGFuZCB0aGUgY29tbWVudOKAmXMgdGV4dC5cbiAgICAgKiAqIGByaWdodGA6IHRoZSBzcGFjZSBzeW1ib2xzIGJldHdlZW4gdGhlIGNvbW1lbnTigJlzIHRleHQuXG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IENvbW1lbnQ7XG4iXX0=
  6441. /***/ }),
  6442. /* 36 */
  6443. /***/ (function(module, exports, __webpack_require__) {
  6444. "use strict";
  6445. exports.__esModule = true;
  6446. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6447. var _declaration = __webpack_require__(92);
  6448. var _declaration2 = _interopRequireDefault(_declaration);
  6449. var _warnOnce = __webpack_require__(5);
  6450. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  6451. var _comment = __webpack_require__(35);
  6452. var _comment2 = _interopRequireDefault(_comment);
  6453. var _node = __webpack_require__(38);
  6454. var _node2 = _interopRequireDefault(_node);
  6455. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6456. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6457. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6458. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6459. function cleanSource(nodes) {
  6460. return nodes.map(function (i) {
  6461. if (i.nodes) i.nodes = cleanSource(i.nodes);
  6462. delete i.source;
  6463. return i;
  6464. });
  6465. }
  6466. /**
  6467. * The {@link Root}, {@link AtRule}, and {@link Rule} container nodes
  6468. * inherit some common methods to help work with their children.
  6469. *
  6470. * Note that all containers can store any content. If you write a rule inside
  6471. * a rule, PostCSS will parse it.
  6472. *
  6473. * @extends Node
  6474. * @abstract
  6475. */
  6476. var Container = function (_Node) {
  6477. _inherits(Container, _Node);
  6478. function Container() {
  6479. _classCallCheck(this, Container);
  6480. return _possibleConstructorReturn(this, _Node.apply(this, arguments));
  6481. }
  6482. Container.prototype.push = function push(child) {
  6483. child.parent = this;
  6484. this.nodes.push(child);
  6485. return this;
  6486. };
  6487. /**
  6488. * Iterates through the container’s immediate children,
  6489. * calling `callback` for each child.
  6490. *
  6491. * Returning `false` in the callback will break iteration.
  6492. *
  6493. * This method only iterates through the container’s immediate children.
  6494. * If you need to recursively iterate through all the container’s descendant
  6495. * nodes, use {@link Container#walk}.
  6496. *
  6497. * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
  6498. * if you are mutating the array of child nodes during iteration.
  6499. * PostCSS will adjust the current index to match the mutations.
  6500. *
  6501. * @param {childIterator} callback - iterator receives each node and index
  6502. *
  6503. * @return {false|undefined} returns `false` if iteration was broke
  6504. *
  6505. * @example
  6506. * const root = postcss.parse('a { color: black; z-index: 1 }');
  6507. * const rule = root.first;
  6508. *
  6509. * for ( let decl of rule.nodes ) {
  6510. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  6511. * // Cycle will be infinite, because cloneBefore moves the current node
  6512. * // to the next index
  6513. * }
  6514. *
  6515. * rule.each(decl => {
  6516. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  6517. * // Will be executed only for color and z-index
  6518. * });
  6519. */
  6520. Container.prototype.each = function each(callback) {
  6521. if (!this.lastEach) this.lastEach = 0;
  6522. if (!this.indexes) this.indexes = {};
  6523. this.lastEach += 1;
  6524. var id = this.lastEach;
  6525. this.indexes[id] = 0;
  6526. if (!this.nodes) return undefined;
  6527. var index = void 0,
  6528. result = void 0;
  6529. while (this.indexes[id] < this.nodes.length) {
  6530. index = this.indexes[id];
  6531. result = callback(this.nodes[index], index);
  6532. if (result === false) break;
  6533. this.indexes[id] += 1;
  6534. }
  6535. delete this.indexes[id];
  6536. return result;
  6537. };
  6538. /**
  6539. * Traverses the container’s descendant nodes, calling callback
  6540. * for each node.
  6541. *
  6542. * Like container.each(), this method is safe to use
  6543. * if you are mutating arrays during iteration.
  6544. *
  6545. * If you only need to iterate through the container’s immediate children,
  6546. * use {@link Container#each}.
  6547. *
  6548. * @param {childIterator} callback - iterator receives each node and index
  6549. *
  6550. * @return {false|undefined} returns `false` if iteration was broke
  6551. *
  6552. * @example
  6553. * root.walk(node => {
  6554. * // Traverses all descendant nodes.
  6555. * });
  6556. */
  6557. Container.prototype.walk = function walk(callback) {
  6558. return this.each(function (child, i) {
  6559. var result = callback(child, i);
  6560. if (result !== false && child.walk) {
  6561. result = child.walk(callback);
  6562. }
  6563. return result;
  6564. });
  6565. };
  6566. /**
  6567. * Traverses the container’s descendant nodes, calling callback
  6568. * for each declaration node.
  6569. *
  6570. * If you pass a filter, iteration will only happen over declarations
  6571. * with matching properties.
  6572. *
  6573. * Like {@link Container#each}, this method is safe
  6574. * to use if you are mutating arrays during iteration.
  6575. *
  6576. * @param {string|RegExp} [prop] - string or regular expression
  6577. * to filter declarations by property name
  6578. * @param {childIterator} callback - iterator receives each node and index
  6579. *
  6580. * @return {false|undefined} returns `false` if iteration was broke
  6581. *
  6582. * @example
  6583. * root.walkDecls(decl => {
  6584. * checkPropertySupport(decl.prop);
  6585. * });
  6586. *
  6587. * root.walkDecls('border-radius', decl => {
  6588. * decl.remove();
  6589. * });
  6590. *
  6591. * root.walkDecls(/^background/, decl => {
  6592. * decl.value = takeFirstColorFromGradient(decl.value);
  6593. * });
  6594. */
  6595. Container.prototype.walkDecls = function walkDecls(prop, callback) {
  6596. if (!callback) {
  6597. callback = prop;
  6598. return this.walk(function (child, i) {
  6599. if (child.type === 'decl') {
  6600. return callback(child, i);
  6601. }
  6602. });
  6603. } else if (prop instanceof RegExp) {
  6604. return this.walk(function (child, i) {
  6605. if (child.type === 'decl' && prop.test(child.prop)) {
  6606. return callback(child, i);
  6607. }
  6608. });
  6609. } else {
  6610. return this.walk(function (child, i) {
  6611. if (child.type === 'decl' && child.prop === prop) {
  6612. return callback(child, i);
  6613. }
  6614. });
  6615. }
  6616. };
  6617. /**
  6618. * Traverses the container’s descendant nodes, calling callback
  6619. * for each rule node.
  6620. *
  6621. * If you pass a filter, iteration will only happen over rules
  6622. * with matching selectors.
  6623. *
  6624. * Like {@link Container#each}, this method is safe
  6625. * to use if you are mutating arrays during iteration.
  6626. *
  6627. * @param {string|RegExp} [selector] - string or regular expression
  6628. * to filter rules by selector
  6629. * @param {childIterator} callback - iterator receives each node and index
  6630. *
  6631. * @return {false|undefined} returns `false` if iteration was broke
  6632. *
  6633. * @example
  6634. * const selectors = [];
  6635. * root.walkRules(rule => {
  6636. * selectors.push(rule.selector);
  6637. * });
  6638. * console.log(`Your CSS uses ${selectors.length} selectors`);
  6639. */
  6640. Container.prototype.walkRules = function walkRules(selector, callback) {
  6641. if (!callback) {
  6642. callback = selector;
  6643. return this.walk(function (child, i) {
  6644. if (child.type === 'rule') {
  6645. return callback(child, i);
  6646. }
  6647. });
  6648. } else if (selector instanceof RegExp) {
  6649. return this.walk(function (child, i) {
  6650. if (child.type === 'rule' && selector.test(child.selector)) {
  6651. return callback(child, i);
  6652. }
  6653. });
  6654. } else {
  6655. return this.walk(function (child, i) {
  6656. if (child.type === 'rule' && child.selector === selector) {
  6657. return callback(child, i);
  6658. }
  6659. });
  6660. }
  6661. };
  6662. /**
  6663. * Traverses the container’s descendant nodes, calling callback
  6664. * for each at-rule node.
  6665. *
  6666. * If you pass a filter, iteration will only happen over at-rules
  6667. * that have matching names.
  6668. *
  6669. * Like {@link Container#each}, this method is safe
  6670. * to use if you are mutating arrays during iteration.
  6671. *
  6672. * @param {string|RegExp} [name] - string or regular expression
  6673. * to filter at-rules by name
  6674. * @param {childIterator} callback - iterator receives each node and index
  6675. *
  6676. * @return {false|undefined} returns `false` if iteration was broke
  6677. *
  6678. * @example
  6679. * root.walkAtRules(rule => {
  6680. * if ( isOld(rule.name) ) rule.remove();
  6681. * });
  6682. *
  6683. * let first = false;
  6684. * root.walkAtRules('charset', rule => {
  6685. * if ( !first ) {
  6686. * first = true;
  6687. * } else {
  6688. * rule.remove();
  6689. * }
  6690. * });
  6691. */
  6692. Container.prototype.walkAtRules = function walkAtRules(name, callback) {
  6693. if (!callback) {
  6694. callback = name;
  6695. return this.walk(function (child, i) {
  6696. if (child.type === 'atrule') {
  6697. return callback(child, i);
  6698. }
  6699. });
  6700. } else if (name instanceof RegExp) {
  6701. return this.walk(function (child, i) {
  6702. if (child.type === 'atrule' && name.test(child.name)) {
  6703. return callback(child, i);
  6704. }
  6705. });
  6706. } else {
  6707. return this.walk(function (child, i) {
  6708. if (child.type === 'atrule' && child.name === name) {
  6709. return callback(child, i);
  6710. }
  6711. });
  6712. }
  6713. };
  6714. /**
  6715. * Traverses the container’s descendant nodes, calling callback
  6716. * for each comment node.
  6717. *
  6718. * Like {@link Container#each}, this method is safe
  6719. * to use if you are mutating arrays during iteration.
  6720. *
  6721. * @param {childIterator} callback - iterator receives each node and index
  6722. *
  6723. * @return {false|undefined} returns `false` if iteration was broke
  6724. *
  6725. * @example
  6726. * root.walkComments(comment => {
  6727. * comment.remove();
  6728. * });
  6729. */
  6730. Container.prototype.walkComments = function walkComments(callback) {
  6731. return this.walk(function (child, i) {
  6732. if (child.type === 'comment') {
  6733. return callback(child, i);
  6734. }
  6735. });
  6736. };
  6737. /**
  6738. * Inserts new nodes to the end of the container.
  6739. *
  6740. * @param {...(Node|object|string|Node[])} children - new nodes
  6741. *
  6742. * @return {Node} this node for methods chain
  6743. *
  6744. * @example
  6745. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  6746. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  6747. * rule.append(decl1, decl2);
  6748. *
  6749. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  6750. * root.append({ selector: 'a' }); // rule
  6751. * rule.append({ prop: 'color', value: 'black' }); // declaration
  6752. * rule.append({ text: 'Comment' }) // comment
  6753. *
  6754. * root.append('a {}');
  6755. * root.first.append('color: black; z-index: 1');
  6756. */
  6757. Container.prototype.append = function append() {
  6758. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  6759. children[_key] = arguments[_key];
  6760. }
  6761. for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  6762. var _ref;
  6763. if (_isArray) {
  6764. if (_i >= _iterator.length) break;
  6765. _ref = _iterator[_i++];
  6766. } else {
  6767. _i = _iterator.next();
  6768. if (_i.done) break;
  6769. _ref = _i.value;
  6770. }
  6771. var child = _ref;
  6772. var nodes = this.normalize(child, this.last);
  6773. for (var _iterator2 = nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  6774. var _ref2;
  6775. if (_isArray2) {
  6776. if (_i2 >= _iterator2.length) break;
  6777. _ref2 = _iterator2[_i2++];
  6778. } else {
  6779. _i2 = _iterator2.next();
  6780. if (_i2.done) break;
  6781. _ref2 = _i2.value;
  6782. }
  6783. var node = _ref2;
  6784. this.nodes.push(node);
  6785. }
  6786. }
  6787. return this;
  6788. };
  6789. /**
  6790. * Inserts new nodes to the start of the container.
  6791. *
  6792. * @param {...(Node|object|string|Node[])} children - new nodes
  6793. *
  6794. * @return {Node} this node for methods chain
  6795. *
  6796. * @example
  6797. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  6798. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  6799. * rule.prepend(decl1, decl2);
  6800. *
  6801. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  6802. * root.append({ selector: 'a' }); // rule
  6803. * rule.append({ prop: 'color', value: 'black' }); // declaration
  6804. * rule.append({ text: 'Comment' }) // comment
  6805. *
  6806. * root.append('a {}');
  6807. * root.first.append('color: black; z-index: 1');
  6808. */
  6809. Container.prototype.prepend = function prepend() {
  6810. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  6811. children[_key2] = arguments[_key2];
  6812. }
  6813. children = children.reverse();
  6814. for (var _iterator3 = children, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  6815. var _ref3;
  6816. if (_isArray3) {
  6817. if (_i3 >= _iterator3.length) break;
  6818. _ref3 = _iterator3[_i3++];
  6819. } else {
  6820. _i3 = _iterator3.next();
  6821. if (_i3.done) break;
  6822. _ref3 = _i3.value;
  6823. }
  6824. var child = _ref3;
  6825. var nodes = this.normalize(child, this.first, 'prepend').reverse();
  6826. for (var _iterator4 = nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  6827. var _ref4;
  6828. if (_isArray4) {
  6829. if (_i4 >= _iterator4.length) break;
  6830. _ref4 = _iterator4[_i4++];
  6831. } else {
  6832. _i4 = _iterator4.next();
  6833. if (_i4.done) break;
  6834. _ref4 = _i4.value;
  6835. }
  6836. var node = _ref4;
  6837. this.nodes.unshift(node);
  6838. }for (var id in this.indexes) {
  6839. this.indexes[id] = this.indexes[id] + nodes.length;
  6840. }
  6841. }
  6842. return this;
  6843. };
  6844. Container.prototype.cleanRaws = function cleanRaws(keepBetween) {
  6845. _Node.prototype.cleanRaws.call(this, keepBetween);
  6846. if (this.nodes) {
  6847. for (var _iterator5 = this.nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  6848. var _ref5;
  6849. if (_isArray5) {
  6850. if (_i5 >= _iterator5.length) break;
  6851. _ref5 = _iterator5[_i5++];
  6852. } else {
  6853. _i5 = _iterator5.next();
  6854. if (_i5.done) break;
  6855. _ref5 = _i5.value;
  6856. }
  6857. var node = _ref5;
  6858. node.cleanRaws(keepBetween);
  6859. }
  6860. }
  6861. };
  6862. /**
  6863. * Insert new node before old node within the container.
  6864. *
  6865. * @param {Node|number} exist - child or child’s index.
  6866. * @param {Node|object|string|Node[]} add - new node
  6867. *
  6868. * @return {Node} this node for methods chain
  6869. *
  6870. * @example
  6871. * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
  6872. */
  6873. Container.prototype.insertBefore = function insertBefore(exist, add) {
  6874. exist = this.index(exist);
  6875. var type = exist === 0 ? 'prepend' : false;
  6876. var nodes = this.normalize(add, this.nodes[exist], type).reverse();
  6877. for (var _iterator6 = nodes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
  6878. var _ref6;
  6879. if (_isArray6) {
  6880. if (_i6 >= _iterator6.length) break;
  6881. _ref6 = _iterator6[_i6++];
  6882. } else {
  6883. _i6 = _iterator6.next();
  6884. if (_i6.done) break;
  6885. _ref6 = _i6.value;
  6886. }
  6887. var node = _ref6;
  6888. this.nodes.splice(exist, 0, node);
  6889. }var index = void 0;
  6890. for (var id in this.indexes) {
  6891. index = this.indexes[id];
  6892. if (exist <= index) {
  6893. this.indexes[id] = index + nodes.length;
  6894. }
  6895. }
  6896. return this;
  6897. };
  6898. /**
  6899. * Insert new node after old node within the container.
  6900. *
  6901. * @param {Node|number} exist - child or child’s index
  6902. * @param {Node|object|string|Node[]} add - new node
  6903. *
  6904. * @return {Node} this node for methods chain
  6905. */
  6906. Container.prototype.insertAfter = function insertAfter(exist, add) {
  6907. exist = this.index(exist);
  6908. var nodes = this.normalize(add, this.nodes[exist]).reverse();
  6909. for (var _iterator7 = nodes, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
  6910. var _ref7;
  6911. if (_isArray7) {
  6912. if (_i7 >= _iterator7.length) break;
  6913. _ref7 = _iterator7[_i7++];
  6914. } else {
  6915. _i7 = _iterator7.next();
  6916. if (_i7.done) break;
  6917. _ref7 = _i7.value;
  6918. }
  6919. var node = _ref7;
  6920. this.nodes.splice(exist + 1, 0, node);
  6921. }var index = void 0;
  6922. for (var id in this.indexes) {
  6923. index = this.indexes[id];
  6924. if (exist < index) {
  6925. this.indexes[id] = index + nodes.length;
  6926. }
  6927. }
  6928. return this;
  6929. };
  6930. Container.prototype.remove = function remove(child) {
  6931. if (typeof child !== 'undefined') {
  6932. (0, _warnOnce2.default)('Container#remove is deprecated. ' + 'Use Container#removeChild');
  6933. this.removeChild(child);
  6934. } else {
  6935. _Node.prototype.remove.call(this);
  6936. }
  6937. return this;
  6938. };
  6939. /**
  6940. * Removes node from the container and cleans the parent properties
  6941. * from the node and its children.
  6942. *
  6943. * @param {Node|number} child - child or child’s index
  6944. *
  6945. * @return {Node} this node for methods chain
  6946. *
  6947. * @example
  6948. * rule.nodes.length //=> 5
  6949. * rule.removeChild(decl);
  6950. * rule.nodes.length //=> 4
  6951. * decl.parent //=> undefined
  6952. */
  6953. Container.prototype.removeChild = function removeChild(child) {
  6954. child = this.index(child);
  6955. this.nodes[child].parent = undefined;
  6956. this.nodes.splice(child, 1);
  6957. var index = void 0;
  6958. for (var id in this.indexes) {
  6959. index = this.indexes[id];
  6960. if (index >= child) {
  6961. this.indexes[id] = index - 1;
  6962. }
  6963. }
  6964. return this;
  6965. };
  6966. /**
  6967. * Removes all children from the container
  6968. * and cleans their parent properties.
  6969. *
  6970. * @return {Node} this node for methods chain
  6971. *
  6972. * @example
  6973. * rule.removeAll();
  6974. * rule.nodes.length //=> 0
  6975. */
  6976. Container.prototype.removeAll = function removeAll() {
  6977. for (var _iterator8 = this.nodes, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
  6978. var _ref8;
  6979. if (_isArray8) {
  6980. if (_i8 >= _iterator8.length) break;
  6981. _ref8 = _iterator8[_i8++];
  6982. } else {
  6983. _i8 = _iterator8.next();
  6984. if (_i8.done) break;
  6985. _ref8 = _i8.value;
  6986. }
  6987. var node = _ref8;
  6988. node.parent = undefined;
  6989. }this.nodes = [];
  6990. return this;
  6991. };
  6992. /**
  6993. * Passes all declaration values within the container that match pattern
  6994. * through callback, replacing those values with the returned result
  6995. * of callback.
  6996. *
  6997. * This method is useful if you are using a custom unit or function
  6998. * and need to iterate through all values.
  6999. *
  7000. * @param {string|RegExp} pattern - replace pattern
  7001. * @param {object} opts - options to speed up the search
  7002. * @param {string|string[]} opts.props - an array of property names
  7003. * @param {string} opts.fast - string that’s used
  7004. * to narrow down values and speed up
  7005. the regexp search
  7006. * @param {function|string} callback - string to replace pattern
  7007. * or callback that returns a new
  7008. * value.
  7009. * The callback will receive
  7010. * the same arguments as those
  7011. * passed to a function parameter
  7012. * of `String#replace`.
  7013. *
  7014. * @return {Node} this node for methods chain
  7015. *
  7016. * @example
  7017. * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
  7018. * return 15 * parseInt(string) + 'px';
  7019. * });
  7020. */
  7021. Container.prototype.replaceValues = function replaceValues(pattern, opts, callback) {
  7022. if (!callback) {
  7023. callback = opts;
  7024. opts = {};
  7025. }
  7026. this.walkDecls(function (decl) {
  7027. if (opts.props && opts.props.indexOf(decl.prop) === -1) return;
  7028. if (opts.fast && decl.value.indexOf(opts.fast) === -1) return;
  7029. decl.value = decl.value.replace(pattern, callback);
  7030. });
  7031. return this;
  7032. };
  7033. /**
  7034. * Returns `true` if callback returns `true`
  7035. * for all of the container’s children.
  7036. *
  7037. * @param {childCondition} condition - iterator returns true or false.
  7038. *
  7039. * @return {boolean} is every child pass condition
  7040. *
  7041. * @example
  7042. * const noPrefixes = rule.every(i => i.prop[0] !== '-');
  7043. */
  7044. Container.prototype.every = function every(condition) {
  7045. return this.nodes.every(condition);
  7046. };
  7047. /**
  7048. * Returns `true` if callback returns `true` for (at least) one
  7049. * of the container’s children.
  7050. *
  7051. * @param {childCondition} condition - iterator returns true or false.
  7052. *
  7053. * @return {boolean} is some child pass condition
  7054. *
  7055. * @example
  7056. * const hasPrefix = rule.some(i => i.prop[0] === '-');
  7057. */
  7058. Container.prototype.some = function some(condition) {
  7059. return this.nodes.some(condition);
  7060. };
  7061. /**
  7062. * Returns a `child`’s index within the {@link Container#nodes} array.
  7063. *
  7064. * @param {Node} child - child of the current container.
  7065. *
  7066. * @return {number} child index
  7067. *
  7068. * @example
  7069. * rule.index( rule.nodes[2] ) //=> 2
  7070. */
  7071. Container.prototype.index = function index(child) {
  7072. if (typeof child === 'number') {
  7073. return child;
  7074. } else {
  7075. return this.nodes.indexOf(child);
  7076. }
  7077. };
  7078. /**
  7079. * The container’s first child.
  7080. *
  7081. * @type {Node}
  7082. *
  7083. * @example
  7084. * rule.first == rules.nodes[0];
  7085. */
  7086. Container.prototype.normalize = function normalize(nodes, sample) {
  7087. var _this2 = this;
  7088. if (typeof nodes === 'string') {
  7089. var parse = __webpack_require__(94);
  7090. nodes = cleanSource(parse(nodes).nodes);
  7091. } else if (!Array.isArray(nodes)) {
  7092. if (nodes.type === 'root') {
  7093. nodes = nodes.nodes;
  7094. } else if (nodes.type) {
  7095. nodes = [nodes];
  7096. } else if (nodes.prop) {
  7097. if (typeof nodes.value === 'undefined') {
  7098. throw new Error('Value field is missed in node creation');
  7099. } else if (typeof nodes.value !== 'string') {
  7100. nodes.value = String(nodes.value);
  7101. }
  7102. nodes = [new _declaration2.default(nodes)];
  7103. } else if (nodes.selector) {
  7104. var Rule = __webpack_require__(16);
  7105. nodes = [new Rule(nodes)];
  7106. } else if (nodes.name) {
  7107. var AtRule = __webpack_require__(34);
  7108. nodes = [new AtRule(nodes)];
  7109. } else if (nodes.text) {
  7110. nodes = [new _comment2.default(nodes)];
  7111. } else {
  7112. throw new Error('Unknown node type in node creation');
  7113. }
  7114. }
  7115. var processed = nodes.map(function (i) {
  7116. if (typeof i.raws === 'undefined') i = _this2.rebuild(i);
  7117. if (i.parent) i = i.clone();
  7118. if (typeof i.raws.before === 'undefined') {
  7119. if (sample && typeof sample.raws.before !== 'undefined') {
  7120. i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
  7121. }
  7122. }
  7123. i.parent = _this2;
  7124. return i;
  7125. });
  7126. return processed;
  7127. };
  7128. Container.prototype.rebuild = function rebuild(node, parent) {
  7129. var _this3 = this;
  7130. var fix = void 0;
  7131. if (node.type === 'root') {
  7132. var Root = __webpack_require__(39);
  7133. fix = new Root();
  7134. } else if (node.type === 'atrule') {
  7135. var AtRule = __webpack_require__(34);
  7136. fix = new AtRule();
  7137. } else if (node.type === 'rule') {
  7138. var Rule = __webpack_require__(16);
  7139. fix = new Rule();
  7140. } else if (node.type === 'decl') {
  7141. fix = new _declaration2.default();
  7142. } else if (node.type === 'comment') {
  7143. fix = new _comment2.default();
  7144. }
  7145. for (var i in node) {
  7146. if (i === 'nodes') {
  7147. fix.nodes = node.nodes.map(function (j) {
  7148. return _this3.rebuild(j, fix);
  7149. });
  7150. } else if (i === 'parent' && parent) {
  7151. fix.parent = parent;
  7152. } else if (node.hasOwnProperty(i)) {
  7153. fix[i] = node[i];
  7154. }
  7155. }
  7156. return fix;
  7157. };
  7158. Container.prototype.eachInside = function eachInside(callback) {
  7159. (0, _warnOnce2.default)('Container#eachInside is deprecated. ' + 'Use Container#walk instead.');
  7160. return this.walk(callback);
  7161. };
  7162. Container.prototype.eachDecl = function eachDecl(prop, callback) {
  7163. (0, _warnOnce2.default)('Container#eachDecl is deprecated. ' + 'Use Container#walkDecls instead.');
  7164. return this.walkDecls(prop, callback);
  7165. };
  7166. Container.prototype.eachRule = function eachRule(selector, callback) {
  7167. (0, _warnOnce2.default)('Container#eachRule is deprecated. ' + 'Use Container#walkRules instead.');
  7168. return this.walkRules(selector, callback);
  7169. };
  7170. Container.prototype.eachAtRule = function eachAtRule(name, callback) {
  7171. (0, _warnOnce2.default)('Container#eachAtRule is deprecated. ' + 'Use Container#walkAtRules instead.');
  7172. return this.walkAtRules(name, callback);
  7173. };
  7174. Container.prototype.eachComment = function eachComment(callback) {
  7175. (0, _warnOnce2.default)('Container#eachComment is deprecated. ' + 'Use Container#walkComments instead.');
  7176. return this.walkComments(callback);
  7177. };
  7178. _createClass(Container, [{
  7179. key: 'first',
  7180. get: function get() {
  7181. if (!this.nodes) return undefined;
  7182. return this.nodes[0];
  7183. }
  7184. /**
  7185. * The container’s last child.
  7186. *
  7187. * @type {Node}
  7188. *
  7189. * @example
  7190. * rule.last == rule.nodes[rule.nodes.length - 1];
  7191. */
  7192. }, {
  7193. key: 'last',
  7194. get: function get() {
  7195. if (!this.nodes) return undefined;
  7196. return this.nodes[this.nodes.length - 1];
  7197. }
  7198. }, {
  7199. key: 'semicolon',
  7200. get: function get() {
  7201. (0, _warnOnce2.default)('Node#semicolon is deprecated. Use Node#raws.semicolon');
  7202. return this.raws.semicolon;
  7203. },
  7204. set: function set(val) {
  7205. (0, _warnOnce2.default)('Node#semicolon is deprecated. Use Node#raws.semicolon');
  7206. this.raws.semicolon = val;
  7207. }
  7208. }, {
  7209. key: 'after',
  7210. get: function get() {
  7211. (0, _warnOnce2.default)('Node#after is deprecated. Use Node#raws.after');
  7212. return this.raws.after;
  7213. },
  7214. set: function set(val) {
  7215. (0, _warnOnce2.default)('Node#after is deprecated. Use Node#raws.after');
  7216. this.raws.after = val;
  7217. }
  7218. /**
  7219. * @memberof Container#
  7220. * @member {Node[]} nodes - an array containing the container’s children
  7221. *
  7222. * @example
  7223. * const root = postcss.parse('a { color: black }');
  7224. * root.nodes.length //=> 1
  7225. * root.nodes[0].selector //=> 'a'
  7226. * root.nodes[0].nodes[0].prop //=> 'color'
  7227. */
  7228. }]);
  7229. return Container;
  7230. }(_node2.default);
  7231. exports.default = Container;
  7232. /**
  7233. * @callback childCondition
  7234. * @param {Node} node - container child
  7235. * @param {number} index - child index
  7236. * @param {Node[]} nodes - all container children
  7237. * @return {boolean}
  7238. */
  7239. /**
  7240. * @callback childIterator
  7241. * @param {Node} node - container child
  7242. * @param {number} index - child index
  7243. * @return {false|undefined} returning `false` will break iteration
  7244. */
  7245. module.exports = exports['default'];
  7246. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRhaW5lci5lczYiXSwibmFtZXMiOlsiY2xlYW5Tb3VyY2UiLCJub2RlcyIsIm1hcCIsImkiLCJzb3VyY2UiLCJDb250YWluZXIiLCJwdXNoIiwiY2hpbGQiLCJwYXJlbnQiLCJlYWNoIiwiY2FsbGJhY2siLCJsYXN0RWFjaCIsImluZGV4ZXMiLCJpZCIsInVuZGVmaW5lZCIsImluZGV4IiwicmVzdWx0IiwibGVuZ3RoIiwid2FsayIsIndhbGtEZWNscyIsInByb3AiLCJ0eXBlIiwiUmVnRXhwIiwidGVzdCIsIndhbGtSdWxlcyIsInNlbGVjdG9yIiwid2Fsa0F0UnVsZXMiLCJuYW1lIiwid2Fsa0NvbW1lbnRzIiwiYXBwZW5kIiwiY2h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1ZSA9IHRha2VGaXJzdENvbG9yRnJvbUdyYWRpZW50KGRlY2wudmFsdWUpO1xuICAgICAqIH0pO1xuICAgICAqL1xuICAgIHdhbGtEZWNscyhwcm9wLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAoICFjYWxsYmFjayApIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gcHJvcDtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2RlY2wnICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soY2hpbGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKCBwcm9wIGluc3RhbmNlb2YgUmVnRXhwICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAnZGVjbCcgJiYgcHJvcC50ZXN0KGNoaWxkLnByb3ApICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soY2hpbGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAnZGVjbCcgJiYgY2hpbGQucHJvcCA9PT0gcHJvcCApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRyYXZlcnNlcyB0aGUgY29udGFpbmVy4oCZcy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ICAqL1xuICAgIHdhbGtSdWxlcyhzZWxlY3RvciwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IHNlbGVjdG9yO1xuXG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmICggc2VsZWN0b3IgaW5zdGFuY2VvZiBSZWdFeHAgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdydWxlJyAmJiBzZWxlY3Rvci50ZXN0KGNoaWxkLnNlbGVjdG9yKSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ3J1bGUnICYmIGNoaWxkLnNlbGVjdG9yID09PSBzZWxlY3RvciApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRyYXZlcnNlcyB0aGUgY29udGFpbmVy4oCZcyBkZXNjZW5kYW50IG5vZGVzL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gKiAgICAgZmlyc3QgPSB0cnVlO1xuICAgICAqICAgfSBlbHNlIHtcbiAgICAgKiAgICAgcnVsZS5yZW1vdmUoKTtcbiAgICAgKiAgIH1cbiAgICAgKiB9KTtcbiAgICAgKi9cbiAgICB3YWxrQXRSdWxlcyhuYW1lLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAoICFjYWxsYmFjayApIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gbmFtZTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2F0cnVsZScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoIG5hbWUgaW5zdGFuY2VvZiBSZWdFeHAgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdhdHJ1bGUnICYmIG5hbWUudGVzdChjaGlsZC5uYW1lKSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2F0cnVsZScgJiYgY2hpbGQubmFtZSA9PT0gbmFtZSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVx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vblxuICAgICAqIGFuZCBuZWVkIHRvIGl0ZXJhdGUgdGhyb3VnaCBhbGwgdmFsdWVzLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd8UmVnRXhwfSBwYXR0ZXJuICAgICAgLSByZXBsYWNlIHBhdHRlcm5cbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0cyAgICAgICAgICAgICAgICAtIG9wdGlvbnMgdG8gc3BlZWQgdXAgdGhlIHNlYXJjaFxuICAgICAqIEBwYXJhbSB7c3RyaW5nfHN0cmluZ1tdfSBvcHRzLnByb3BzIC0gYW4gYXJyYXkgb2YgcHJvcGVydHkgbmFtZXNcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gb3B0cy5mYXN0ICAgICAgICAgICAtIHN0cmluZyB0aGF04oCZcyB1c2VkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBuYXJyb3cgZG93biB2YWx1ZXMgYW5kIHNwZWVkIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgcmVnZXhwIHNlYXJjaFxuICAgICAqIEBwYXJhbSB7ZnVuY3Rpb258c3RyaW5nfSBjYWxsYmFjayAgIC0gc3RyaW5nIHRvIHJlcGxhY2UgcGF0dGVyblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3IgY2FsbGJhY2sgdGhhdCByZXR1cm5zIGEgbmV3XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBjYWxsYmFjayB3aWxsIHJlY2VpdmVcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzYW1lIGFyZ3VtZW50cyBhcyB0aG9zZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFzc2VkIHRvIGEgZnVuY3Rpb24gcGFyYW1ldGVyXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiBgU3RyaW5nI3JlcGxhY2VgLlxuICAgICAqXG4gICAgICogQHJldHVybiB7Tm9kZX0gdGhpcyBub2RlIGZvciBtZXRob2RzIGNoYWluXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHJvb3QucmVwbGFjZVZhbHVlcygvXFxkK3JlbS8sIHsgZmFzdDogJ3JlbScgfSwgc3RyaW5nID0+IHtcbiAgICAgKiAgIHJldHVybiAxNSAqIHBhcnNlSW50KHN0cmluZykgKyAncHgnO1xuICAgICAqIH0pO1xuICAgICAqL1xuICAgIHJlcGxhY2VWYWx1ZXMocGF0dGVybiwgb3B0cywgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IG9wdHM7XG4gICAgICAgICAgICBvcHRzID0geyB9O1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy53YWxrRGVjbHMoIGRlY2wgPT4ge1xuICAgICAgICAgICAgaWYgKCBvcHRzLnByb3BzICYmIG9wdHMucHJvcHMuaW5kZXhPZihkZWNsLnByb3ApID09PSAtMSApIHJldHVybjtcbiAgICAgICAgICAgIGlmICggb3B0cy5mYXN0ICAmJiBkZWNsLnZhbHVlLmluZGV4T2Yob3B0cy5mYXN0KSA9PT0gLTEgKSByZXR1cm47XG5cbiAgICAgICAgICAgIGRlY2wudmFsdWUgPSBkZWNsLnZhbHVlLnJlcGxhY2UocGF0dGVybiwgY2FsbGJhY2spO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGB0cnVlYCBpZiBjYWxsYmFjayByZXR1cm5zIGB0cnVlYFxuICAgICAqIGZvciBhbGwgb2YgdGhlIGNvb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ICAgICAgICBpZiAoICF0aGlzLm5vZGVzICkgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgcmV0dXJuIHRoaXMubm9kZXNbdGhpcy5ub2Rlcy5sZW5ndGggLSAxXTtcbiAgICB9XG5cbiAgICBub3JtYWxpemUobm9kZXMsIHNhbXBsZSkge1xuICAgICAgICBpZiAoIHR5cGVvZiBub2RlcyA9PT0gJ3N0cmluZycgKSB7XG4gICAgICAgICAgICBsZXQgcGFyc2UgPSByZXF1aXJlKCcuL3BhcnNlJyk7XG4gICAgICAgICAgICBub2RlcyA9IGNsZWFuU291cmNlKHBhcnNlKG5vZGVzKS5ub2Rlcyk7XG4gICAgICAgIH0gZWxzZSBpZiAoICFBcnJheS5pc0FycmF5KG5vZGVzKSApIHtcbiAgICAgICAgICAgIGlmICggbm9kZXMudHlwZSA9PT0gJ3Jvb3QnICkge1xuICAgICAgICAgICAgICAgIG5vZGVzID0gbm9kZXMubm9kZXM7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy50eXBlICkge1xuICAgICAgICAgICAgICAgIG5vZGVzID0gW25vZGVzXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLnByb3AgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2Ygbm9kZXMudmFsdWUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1ZhbHVlIGZpZWxkIGlzIG1pc3NlZCBpbiBub2RlIGNyZWF0aW9uJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZW9mIG5vZGVzLnZhbHVlICE9PSAnc3RyaW5nJyApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZXMudmFsdWUgPSBTdHJpbmcobm9kZXMudmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlcyA9IFtuZXcgRGVjbGFyYXRpb24obm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLnNlbGVjdG9yICkge1xuICAgICAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICAgICAgbm9kZXMgPSBbbmV3IFJ1bGUobm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLm5hbWUgKSB7XG4gICAgICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgICAgIG5vZGVzID0gW25ldyBBdFJ1bGUobm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLnRleHQgKSB7XG4gICAgICAgICAgICAgICAgbm9kZXMgPSBbbmV3IENvbW1lbnQobm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmtub3duIG5vZGUgdHlwZSBpbiBub2RlIGNyZWF0aW9uJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgcHJvY2Vzc2VkID0gbm9kZXMubWFwKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cyA9PT0gJ3VuZGVmaW5lZCcgKSBpID0gdGhpcy5yZWJ1aWxkKGkpO1xuXG4gICAgICAgICAgICBpZiAoIGkucGFyZW50ICkgaSA9IGkuY2xvbmUoKTtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIGlmICggc2FtcGxlICYmIHR5cGVvZiBzYW1wbGUucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICBpLnJhd3MuYmVmb3JlID0gc2FtcGxlLnJhd3MuYmVmb3JlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaS5wYXJlbnQgPSB0aGlzO1xuICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcm9jZXNzZWQ7XG4gICAgfVxuXG4gICAgcmVidWlsZChub2RlLCBwYXJlbnQpIHtcbiAgICAgICAgbGV0IGZpeDtcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgPT09ICdyb290JyApIHtcbiAgICAgICAgICAgIGxldCBSb290ID0gcmVxdWlyZSgnLi9yb290Jyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUm9vdCgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdhdHJ1bGUnICkge1xuICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgZml4ID0gbmV3IEF0UnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBEZWNsYXJhdGlvbigpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBDb21tZW50KCk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKCBsZXQgaSBpbiBub2RlICkge1xuICAgICAgICAgICAgaWYgKCBpID09PSAnbm9kZXMnICkge1xuICAgICAgICAgICAgICAgIGZpeC5ub2RlcyA9IG5vZGUubm9kZXMubWFwKCBqID0+IHRoaXMucmVidWlsZChqLCBmaXgpICk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBpID09PSAncGFyZW50JyAmJiBwYXJlbnQgKSB7XG4gICAgICAgICAgICAgICAgZml4LnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGUuaGFzT3duUHJvcGVydHkoaSkgKSB7XG4gICAgICAgICAgICAgICAgZml4W2ldID0gbm9kZVtpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBmaXg7XG4gICAgfVxuXG4gICAgZWFjaEluc2lkZShjYWxsYmFjaykge1xuICAgICAgICB3YXJuT25jZSgnQ29udGFpbmVyI2VhY2hJbnNpZGUgaXMgZGVwcmVjYXRlZC4gJyArXG4gICAgICAgICAgICAgICAgICdVc2UgQ29udGFpbmVyI3dhbGsgaW5zdGVhZC4nKTtcbiAgICAgICAgcmV0dXJuIHRoaXMud2FsayhjYWxsYmFjayk7XG4gICAgfVxuXG4gICAgZWFjaERlY2wocHJvcCwgY2FsbGJhY2spIHtcbiAgICAgICAgd2Fybk9uY2UoJ0NvbnRhaW5lciNlYWNoRGVjbCBpcyBkZXByZWNhdGVkLiAnICtcbiAgICAgICAgICAgICAgICAgJ1VzZSBDb250YWluZXIjd2Fsa0RlY2xzIGluc3RlYWQuJyk7XG4gICAgICAgIHJldHVybiB0aGlzLndhbGtEZWNscyhwcm9wLCBjYWxsYmFjayk7XG4gICAgfVxuXG4gICAgZWFjaFJ1bGUoc2VsZWN0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgIHdhcm5PbmNlKCdDb250YWluZXIjZWFjaFJ1bGUgaXMgZGVwcmVjYXRlZC4gJyArXG4gICAgICAgICAgICAgICAgICdVc2UgQ29udGFpbmVyI3dhbGtSdWxlcyBpbnN0ZWFkLicpO1xuICAgICAgICByZXR1cm4gdGhpcy53YWxrUnVsZXMoc2VsZWN0b3IsIGNhbGxiYWNrKTtcbiAgICB9XG5cbiAg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hpbGQgaW5kZXhcbiAqIEByZXR1cm4ge2ZhbHNlfHVuZGVmaW5lZH0gcmV0dXJuaW5nIGBmYWxzZWAgd2lsbCBicmVhayBpdGVyYXRpb25cbiAqL1xuIl19
  7247. /***/ }),
  7248. /* 37 */
  7249. /***/ (function(module, exports, __webpack_require__) {
  7250. "use strict";
  7251. exports.__esModule = true;
  7252. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7253. var _cssSyntaxError = __webpack_require__(91);
  7254. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  7255. var _previousMap = __webpack_require__(195);
  7256. var _previousMap2 = _interopRequireDefault(_previousMap);
  7257. var _path = __webpack_require__(8);
  7258. var _path2 = _interopRequireDefault(_path);
  7259. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7260. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7261. var sequence = 0;
  7262. /**
  7263. * Represents the source CSS.
  7264. *
  7265. * @example
  7266. * const root = postcss.parse(css, { from: file });
  7267. * const input = root.source.input;
  7268. */
  7269. var Input = function () {
  7270. /**
  7271. * @param {string} css - input CSS source
  7272. * @param {object} [opts] - {@link Processor#process} options
  7273. */
  7274. function Input(css) {
  7275. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7276. _classCallCheck(this, Input);
  7277. /**
  7278. * @member {string} - input CSS source
  7279. *
  7280. * @example
  7281. * const input = postcss.parse('a{}', { from: file }).input;
  7282. * input.css //=> "a{}";
  7283. */
  7284. this.css = css.toString();
  7285. if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
  7286. this.css = this.css.slice(1);
  7287. }
  7288. if (opts.from) {
  7289. if (/^\w+:\/\//.test(opts.from)) {
  7290. /**
  7291. * @member {string} - The absolute path to the CSS source file
  7292. * defined with the `from` option.
  7293. *
  7294. * @example
  7295. * const root = postcss.parse(css, { from: 'a.css' });
  7296. * root.source.input.file //=> '/home/ai/a.css'
  7297. */
  7298. this.file = opts.from;
  7299. } else {
  7300. this.file = _path2.default.resolve(opts.from);
  7301. }
  7302. }
  7303. var map = new _previousMap2.default(this.css, opts);
  7304. if (map.text) {
  7305. /**
  7306. * @member {PreviousMap} - The input source map passed from
  7307. * a compilation step before PostCSS
  7308. * (for example, from Sass compiler).
  7309. *
  7310. * @example
  7311. * root.source.input.map.consumer().sources //=> ['a.sass']
  7312. */
  7313. this.map = map;
  7314. var file = map.consumer().file;
  7315. if (!this.file && file) this.file = this.mapResolve(file);
  7316. }
  7317. if (!this.file) {
  7318. sequence += 1;
  7319. /**
  7320. * @member {string} - The unique ID of the CSS source. It will be
  7321. * created if `from` option is not provided
  7322. * (because PostCSS does not know the file path).
  7323. *
  7324. * @example
  7325. * const root = postcss.parse(css);
  7326. * root.source.input.file //=> undefined
  7327. * root.source.input.id //=> "<input css 1>"
  7328. */
  7329. this.id = '<input css ' + sequence + '>';
  7330. }
  7331. if (this.map) this.map.file = this.from;
  7332. }
  7333. Input.prototype.error = function error(message, line, column) {
  7334. var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  7335. var result = void 0;
  7336. var origin = this.origin(line, column);
  7337. if (origin) {
  7338. result = new _cssSyntaxError2.default(message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
  7339. } else {
  7340. result = new _cssSyntaxError2.default(message, line, column, this.css, this.file, opts.plugin);
  7341. }
  7342. result.input = { line: line, column: column, source: this.css };
  7343. if (this.file) result.input.file = this.file;
  7344. return result;
  7345. };
  7346. /**
  7347. * Reads the input source map and returns a symbol position
  7348. * in the input source (e.g., in a Sass file that was compiled
  7349. * to CSS before being passed to PostCSS).
  7350. *
  7351. * @param {number} line - line in input CSS
  7352. * @param {number} column - column in input CSS
  7353. *
  7354. * @return {filePosition} position in input source
  7355. *
  7356. * @example
  7357. * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
  7358. */
  7359. Input.prototype.origin = function origin(line, column) {
  7360. if (!this.map) return false;
  7361. var consumer = this.map.consumer();
  7362. var from = consumer.originalPositionFor({ line: line, column: column });
  7363. if (!from.source) return false;
  7364. var result = {
  7365. file: this.mapResolve(from.source),
  7366. line: from.line,
  7367. column: from.column
  7368. };
  7369. var source = consumer.sourceContentFor(from.source);
  7370. if (source) result.source = source;
  7371. return result;
  7372. };
  7373. Input.prototype.mapResolve = function mapResolve(file) {
  7374. if (/^\w+:\/\//.test(file)) {
  7375. return file;
  7376. } else {
  7377. return _path2.default.resolve(this.map.consumer().sourceRoot || '.', file);
  7378. }
  7379. };
  7380. /**
  7381. * The CSS source identifier. Contains {@link Input#file} if the user
  7382. * set the `from` option, or {@link Input#id} if they did not.
  7383. * @type {string}
  7384. *
  7385. * @example
  7386. * const root = postcss.parse(css, { from: 'a.css' });
  7387. * root.source.input.from //=> "/home/ai/a.css"
  7388. *
  7389. * const root = postcss.parse(css);
  7390. * root.source.input.from //=> "<input css 1>"
  7391. */
  7392. _createClass(Input, [{
  7393. key: 'from',
  7394. get: function get() {
  7395. return this.file || this.id;
  7396. }
  7397. }]);
  7398. return Input;
  7399. }();
  7400. exports.default = Input;
  7401. /**
  7402. * @typedef {object} filePosition
  7403. * @property {string} file - path to file
  7404. * @property {number} line - source line in file
  7405. * @property {number} column - source column in file
  7406. */
  7407. module.exports = exports['default'];
  7408. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmVzNiJdLCJuYW1lcyI6WyJzZXF1ZW5jZSIsIklucHV0IiwiY3NzIiwib3B0cyIsInRvU3RyaW5nIiwic2xpY2U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0IENTUyBzb3VyY2VcbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogY29uc3QgaW5wdXQgPSBwb3N0Y3NzLnBhcnNlKCdhe30nLCB7IGZyb206IGZpbGUgfSkuaW5wdXQ7XG4gICAgICAgICAqIGlucHV0LmNzcyAvLz0+IFwiYXt9XCI7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmNzcyA9IGNzcy50b1N0cmluZygpO1xuXG4gICAgICAgIGlmICggdGhpcy5jc3NbMF0gPT09ICdcXHVGRUZGJyB8fCB0aGlzLmNzc1swXSA9PT0gJ1xcdUZGRkUnICkge1xuICAgICAgICAgICAgdGhpcy5jc3MgPSB0aGlzLmNzcy5zbGljZSgxKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggb3B0cy5mcm9tICkge1xuICAgICAgICAgICAgaWYgKCAvXlxcdys6XFwvXFwvLy50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIFRoZSBhYnNvbHV0ZSBwYXRoIHRvIHRoZSBDU1Mgc291cmNlIGZpbGVcbiAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgZGVmaW5lZCB3aXRoIHRoZSBgZnJvbWAgb3B0aW9uLlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZShjc3MsIHsgZnJvbTogJ2EuY3NzJyB9KTtcbiAgICAgICAgICAgICAgICAgKiByb290LnNvdXJjZS5pbnB1dC5maWxlIC8vPT4gJy9ob21lL2FpL2EuY3NzJ1xuICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgIHRoaXMuZmlsZSA9IG9wdHMuZnJvbTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5maWxlID0gcGF0aC5yZXNvbHZlKG9wdHMuZnJvbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgbWFwID0gbmV3IFByZXZpb3VzTWFwKHRoaXMuY3NzLCBvcHRzKTtcbiAgICAgICAgaWYgKCBtYXAudGV4dCApIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7UHJldmlvdXNNYXB9IC0gVGhlIGlucHV0IHNvdXJjZSBtYXAgcGFzc2VkIGZyb21cbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIGEgY29tcGlsYXRpb24gc3RlcCBiZWZvcmUgUG9zdENTU1xuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgKGZvciBleGFtcGxlLCBmcm9tIFNhc3MgY29tcGlsZXIpLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiByb290LnNvdXJjZS5pbnB1dC5tYXAuY29uc3VtZXIoKS5zb3VyY2VzIC8vPT4gWydhLnNhc3MnXVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLm1hcCA9IG1hcDtcbiAgICAgICAgICAgIGxldCBmaWxlID0gbWFwLmNvbnN1bWVyKCkuZmlsZTtcbiAgICAgICAgICAgIGlmICggIXRoaXMuZmlsZSAmJiBmaWxlICkgdGhpcy5maWxlID0gdGhpcy5tYXBSZXNvbHZlKGZpbGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCAhdGhpcy5maWxlICkge1xuICAgICAgICAgICAgc2VxdWVuY2UgKz0gMTtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIFRoZSB1bmlxdWUgSUQgb2YgdGhlIENTUyBzb3VyY2UuIEl0IHdpbGwgYmVcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICBjcmVhdGVkIGlmIGBmcm9tYCBvcHRpb24gaXMgbm90IHByb3ZpZGVkXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgKGJlY2F1c2UgUG9zdENTUyBkb2VzIG5vdCBrbm93IHRoZSBmaWxlIHBhdGgpLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZShjc3MpO1xuICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQuZmlsZSAvLz0+IHVuZGVmaW5lZFxuICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQuaWQgICAvLz0+IFwiPGlucHV0IGNzcyAxPlwiXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuaWQgICA9ICc8aW5wdXQgY3NzICcgKyBzZXF1ZW5jZSArICc+JztcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHRoaXMubWFwICkgdGhpcy5tYXAuZmlsZSA9IHRoaXMuZnJvbTtcbiAgICB9XG5cbiAgICBlcnJvcihtZXNzYWdlLCBsaW5lLCBjb2x1bW4sIG9wdHMgPSB7IH0pIHtcbiAgICAgICAgbGV0IHJlc3VsdDtcbiAgICAgICAgbGV0IG9yaWdpbiA9IHRoaXMub3JpZ2luKGxpbmUsIGNvbHVtbik7XG4gICAgICAgIGlmICggb3JpZ2luICkge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IENzc1N5bnRheEVycm9yKG1lc3NhZ2UsIG9yaWdpbi5saW5lLCBvcmlnaW4uY29sdW1uLFxuICAgICAgICAgICAgICAgIG9yaWdpbi5zb3VyY2UsIG9yaWdpbi5maWxlLCBvcHRzLnBsdWdpbik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgQ3NzU3ludGF4RXJyb3IobWVzc2FnZSwgbGluZSwgY29sdW1uLFxuICAgICAgICAgICAgICA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uY3NzJyB9KTtcbiAgICAgKiByb290LnNvdXJjZS5pbnB1dC5mcm9tIC8vPT4gXCIvaG9tZS9haS9hLmNzc1wiXG4gICAgICpcbiAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZShjc3MpO1xuICAgICAqIHJvb3Quc291cmNlLmlucHV0LmZyb20gLy89PiBcIjxpbnB1dCBjc3MgMT5cIlxuICAgICAqL1xuICAgIGdldCBmcm9tKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5maWxlIHx8IHRoaXMuaWQ7XG4gICAgfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IElucHV0O1xuXG4vKipcbiAqIEB0eXBlZGVmICB7b2JqZWN0fSBmaWxlUG9zaXRpb25cbiAqIEBwcm9wZXJ0eSB7c3RyaW5nfSBmaWxlICAgLSBwYXRoIHRvIGZpbGVcbiAqIEBwcm9wZXJ0eSB7bnVtYmVyfSBsaW5lICAgLSBzb3VyY2UgbGluZSBpbiBmaWxlXG4gKiBAcHJvcGVydHkge251bWJlcn0gY29sdW1uIC0gc291cmNlIGNvbHVtbiBpbiBmaWxlXG4gKi9cbiJdfQ==
  7409. /***/ }),
  7410. /* 38 */
  7411. /***/ (function(module, exports, __webpack_require__) {
  7412. "use strict";
  7413. exports.__esModule = true;
  7414. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7415. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  7416. var _cssSyntaxError = __webpack_require__(91);
  7417. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  7418. var _stringifier = __webpack_require__(40);
  7419. var _stringifier2 = _interopRequireDefault(_stringifier);
  7420. var _stringify = __webpack_require__(96);
  7421. var _stringify2 = _interopRequireDefault(_stringify);
  7422. var _warnOnce = __webpack_require__(5);
  7423. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  7424. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7425. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7426. var cloneNode = function cloneNode(obj, parent) {
  7427. var cloned = new obj.constructor();
  7428. for (var i in obj) {
  7429. if (!obj.hasOwnProperty(i)) continue;
  7430. var value = obj[i];
  7431. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  7432. if (i === 'parent' && type === 'object') {
  7433. if (parent) cloned[i] = parent;
  7434. } else if (i === 'source') {
  7435. cloned[i] = value;
  7436. } else if (value instanceof Array) {
  7437. cloned[i] = value.map(function (j) {
  7438. return cloneNode(j, cloned);
  7439. });
  7440. } else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
  7441. if (type === 'object' && value !== null) value = cloneNode(value);
  7442. cloned[i] = value;
  7443. }
  7444. }
  7445. return cloned;
  7446. };
  7447. /**
  7448. * All node classes inherit the following common methods.
  7449. *
  7450. * @abstract
  7451. */
  7452. var Node = function () {
  7453. /**
  7454. * @param {object} [defaults] - value for node properties
  7455. */
  7456. function Node() {
  7457. var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7458. _classCallCheck(this, Node);
  7459. this.raws = {};
  7460. if ((typeof defaults === 'undefined' ? 'undefined' : _typeof(defaults)) !== 'object' && typeof defaults !== 'undefined') {
  7461. throw new Error('PostCSS nodes constructor accepts object, not ' + JSON.stringify(defaults));
  7462. }
  7463. for (var name in defaults) {
  7464. this[name] = defaults[name];
  7465. }
  7466. }
  7467. /**
  7468. * Returns a CssSyntaxError instance containing the original position
  7469. * of the node in the source, showing line and column numbers and also
  7470. * a small excerpt to facilitate debugging.
  7471. *
  7472. * If present, an input source map will be used to get the original position
  7473. * of the source, even from a previous compilation step
  7474. * (e.g., from Sass compilation).
  7475. *
  7476. * This method produces very useful error messages.
  7477. *
  7478. * @param {string} message - error description
  7479. * @param {object} [opts] - options
  7480. * @param {string} opts.plugin - plugin name that created this error.
  7481. * PostCSS will set it automatically.
  7482. * @param {string} opts.word - a word inside a node’s string that should
  7483. * be highlighted as the source of the error
  7484. * @param {number} opts.index - an index inside a node’s string that should
  7485. * be highlighted as the source of the error
  7486. *
  7487. * @return {CssSyntaxError} error object to throw it
  7488. *
  7489. * @example
  7490. * if ( !variables[name] ) {
  7491. * throw decl.error('Unknown variable ' + name, { word: name });
  7492. * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
  7493. * // color: $black
  7494. * // a
  7495. * // ^
  7496. * // background: white
  7497. * }
  7498. */
  7499. Node.prototype.error = function error(message) {
  7500. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7501. if (this.source) {
  7502. var pos = this.positionBy(opts);
  7503. return this.source.input.error(message, pos.line, pos.column, opts);
  7504. } else {
  7505. return new _cssSyntaxError2.default(message);
  7506. }
  7507. };
  7508. /**
  7509. * This method is provided as a convenience wrapper for {@link Result#warn}.
  7510. *
  7511. * @param {Result} result - the {@link Result} instance
  7512. * that will receive the warning
  7513. * @param {string} text - warning message
  7514. * @param {object} [opts] - options
  7515. * @param {string} opts.plugin - plugin name that created this warning.
  7516. * PostCSS will set it automatically.
  7517. * @param {string} opts.word - a word inside a node’s string that should
  7518. * be highlighted as the source of the warning
  7519. * @param {number} opts.index - an index inside a node’s string that should
  7520. * be highlighted as the source of the warning
  7521. *
  7522. * @return {Warning} created warning object
  7523. *
  7524. * @example
  7525. * const plugin = postcss.plugin('postcss-deprecated', () => {
  7526. * return (root, result) => {
  7527. * root.walkDecls('bad', decl => {
  7528. * decl.warn(result, 'Deprecated property bad');
  7529. * });
  7530. * };
  7531. * });
  7532. */
  7533. Node.prototype.warn = function warn(result, text, opts) {
  7534. var data = { node: this };
  7535. for (var i in opts) {
  7536. data[i] = opts[i];
  7537. }return result.warn(text, data);
  7538. };
  7539. /**
  7540. * Removes the node from its parent and cleans the parent properties
  7541. * from the node and its children.
  7542. *
  7543. * @example
  7544. * if ( decl.prop.match(/^-webkit-/) ) {
  7545. * decl.remove();
  7546. * }
  7547. *
  7548. * @return {Node} node to make calls chain
  7549. */
  7550. Node.prototype.remove = function remove() {
  7551. if (this.parent) {
  7552. this.parent.removeChild(this);
  7553. }
  7554. this.parent = undefined;
  7555. return this;
  7556. };
  7557. /**
  7558. * Returns a CSS string representing the node.
  7559. *
  7560. * @param {stringifier|syntax} [stringifier] - a syntax to use
  7561. * in string generation
  7562. *
  7563. * @return {string} CSS string of this node
  7564. *
  7565. * @example
  7566. * postcss.rule({ selector: 'a' }).toString() //=> "a {}"
  7567. */
  7568. Node.prototype.toString = function toString() {
  7569. var stringifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _stringify2.default;
  7570. if (stringifier.stringify) stringifier = stringifier.stringify;
  7571. var result = '';
  7572. stringifier(this, function (i) {
  7573. result += i;
  7574. });
  7575. return result;
  7576. };
  7577. /**
  7578. * Returns a clone of the node.
  7579. *
  7580. * The resulting cloned node and its (cloned) children will have
  7581. * a clean parent and code style properties.
  7582. *
  7583. * @param {object} [overrides] - new properties to override in the clone.
  7584. *
  7585. * @example
  7586. * const cloned = decl.clone({ prop: '-moz-' + decl.prop });
  7587. * cloned.raws.before //=> undefined
  7588. * cloned.parent //=> undefined
  7589. * cloned.toString() //=> -moz-transform: scale(0)
  7590. *
  7591. * @return {Node} clone of the node
  7592. */
  7593. Node.prototype.clone = function clone() {
  7594. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7595. var cloned = cloneNode(this);
  7596. for (var name in overrides) {
  7597. cloned[name] = overrides[name];
  7598. }
  7599. return cloned;
  7600. };
  7601. /**
  7602. * Shortcut to clone the node and insert the resulting cloned node
  7603. * before the current node.
  7604. *
  7605. * @param {object} [overrides] - new properties to override in the clone.
  7606. *
  7607. * @example
  7608. * decl.cloneBefore({ prop: '-moz-' + decl.prop });
  7609. *
  7610. * @return {Node} - new node
  7611. */
  7612. Node.prototype.cloneBefore = function cloneBefore() {
  7613. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7614. var cloned = this.clone(overrides);
  7615. this.parent.insertBefore(this, cloned);
  7616. return cloned;
  7617. };
  7618. /**
  7619. * Shortcut to clone the node and insert the resulting cloned node
  7620. * after the current node.
  7621. *
  7622. * @param {object} [overrides] - new properties to override in the clone.
  7623. *
  7624. * @return {Node} - new node
  7625. */
  7626. Node.prototype.cloneAfter = function cloneAfter() {
  7627. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7628. var cloned = this.clone(overrides);
  7629. this.parent.insertAfter(this, cloned);
  7630. return cloned;
  7631. };
  7632. /**
  7633. * Inserts node(s) before the current node and removes the current node.
  7634. *
  7635. * @param {...Node} nodes - node(s) to replace current one
  7636. *
  7637. * @example
  7638. * if ( atrule.name == 'mixin' ) {
  7639. * atrule.replaceWith(mixinRules[atrule.params]);
  7640. * }
  7641. *
  7642. * @return {Node} current node to methods chain
  7643. */
  7644. Node.prototype.replaceWith = function replaceWith() {
  7645. if (this.parent) {
  7646. for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
  7647. nodes[_key] = arguments[_key];
  7648. }
  7649. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  7650. var _ref;
  7651. if (_isArray) {
  7652. if (_i >= _iterator.length) break;
  7653. _ref = _iterator[_i++];
  7654. } else {
  7655. _i = _iterator.next();
  7656. if (_i.done) break;
  7657. _ref = _i.value;
  7658. }
  7659. var node = _ref;
  7660. this.parent.insertBefore(this, node);
  7661. }
  7662. this.remove();
  7663. }
  7664. return this;
  7665. };
  7666. /**
  7667. * Removes the node from its current parent and inserts it
  7668. * at the end of `newParent`.
  7669. *
  7670. * This will clean the `before` and `after` code {@link Node#raws} data
  7671. * from the node and replace them with the indentation style of `newParent`.
  7672. * It will also clean the `between` property
  7673. * if `newParent` is in another {@link Root}.
  7674. *
  7675. * @param {Container} newParent - container node where the current node
  7676. * will be moved
  7677. *
  7678. * @example
  7679. * atrule.moveTo(atrule.root());
  7680. *
  7681. * @return {Node} current node to methods chain
  7682. */
  7683. Node.prototype.moveTo = function moveTo(newParent) {
  7684. this.cleanRaws(this.root() === newParent.root());
  7685. this.remove();
  7686. newParent.append(this);
  7687. return this;
  7688. };
  7689. /**
  7690. * Removes the node from its current parent and inserts it into
  7691. * a new parent before `otherNode`.
  7692. *
  7693. * This will also clean the node’s code style properties just as it would
  7694. * in {@link Node#moveTo}.
  7695. *
  7696. * @param {Node} otherNode - node that will be before current node
  7697. *
  7698. * @return {Node} current node to methods chain
  7699. */
  7700. Node.prototype.moveBefore = function moveBefore(otherNode) {
  7701. this.cleanRaws(this.root() === otherNode.root());
  7702. this.remove();
  7703. otherNode.parent.insertBefore(otherNode, this);
  7704. return this;
  7705. };
  7706. /**
  7707. * Removes the node from its current parent and inserts it into
  7708. * a new parent after `otherNode`.
  7709. *
  7710. * This will also clean the node’s code style properties just as it would
  7711. * in {@link Node#moveTo}.
  7712. *
  7713. * @param {Node} otherNode - node that will be after current node
  7714. *
  7715. * @return {Node} current node to methods chain
  7716. */
  7717. Node.prototype.moveAfter = function moveAfter(otherNode) {
  7718. this.cleanRaws(this.root() === otherNode.root());
  7719. this.remove();
  7720. otherNode.parent.insertAfter(otherNode, this);
  7721. return this;
  7722. };
  7723. /**
  7724. * Returns the next child of the node’s parent.
  7725. * Returns `undefined` if the current node is the last child.
  7726. *
  7727. * @return {Node|undefined} next node
  7728. *
  7729. * @example
  7730. * if ( comment.text === 'delete next' ) {
  7731. * const next = comment.next();
  7732. * if ( next ) {
  7733. * next.remove();
  7734. * }
  7735. * }
  7736. */
  7737. Node.prototype.next = function next() {
  7738. var index = this.parent.index(this);
  7739. return this.parent.nodes[index + 1];
  7740. };
  7741. /**
  7742. * Returns the previous child of the node’s parent.
  7743. * Returns `undefined` if the current node is the first child.
  7744. *
  7745. * @return {Node|undefined} previous node
  7746. *
  7747. * @example
  7748. * const annotation = decl.prev();
  7749. * if ( annotation.type == 'comment' ) {
  7750. * readAnnotation(annotation.text);
  7751. * }
  7752. */
  7753. Node.prototype.prev = function prev() {
  7754. var index = this.parent.index(this);
  7755. return this.parent.nodes[index - 1];
  7756. };
  7757. Node.prototype.toJSON = function toJSON() {
  7758. var fixed = {};
  7759. for (var name in this) {
  7760. if (!this.hasOwnProperty(name)) continue;
  7761. if (name === 'parent') continue;
  7762. var value = this[name];
  7763. if (value instanceof Array) {
  7764. fixed[name] = value.map(function (i) {
  7765. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && i.toJSON) {
  7766. return i.toJSON();
  7767. } else {
  7768. return i;
  7769. }
  7770. });
  7771. } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.toJSON) {
  7772. fixed[name] = value.toJSON();
  7773. } else {
  7774. fixed[name] = value;
  7775. }
  7776. }
  7777. return fixed;
  7778. };
  7779. /**
  7780. * Returns a {@link Node#raws} value. If the node is missing
  7781. * the code style property (because the node was manually built or cloned),
  7782. * PostCSS will try to autodetect the code style property by looking
  7783. * at other nodes in the tree.
  7784. *
  7785. * @param {string} prop - name of code style property
  7786. * @param {string} [defaultType] - name of default value, it can be missed
  7787. * if the value is the same as prop
  7788. *
  7789. * @example
  7790. * const root = postcss.parse('a { background: white }');
  7791. * root.nodes[0].append({ prop: 'color', value: 'black' });
  7792. * root.nodes[0].nodes[1].raws.before //=> undefined
  7793. * root.nodes[0].nodes[1].raw('before') //=> ' '
  7794. *
  7795. * @return {string} code style value
  7796. */
  7797. Node.prototype.raw = function raw(prop, defaultType) {
  7798. var str = new _stringifier2.default();
  7799. return str.raw(this, prop, defaultType);
  7800. };
  7801. /**
  7802. * Finds the Root instance of the node’s tree.
  7803. *
  7804. * @example
  7805. * root.nodes[0].nodes[0].root() === root
  7806. *
  7807. * @return {Root} root parent
  7808. */
  7809. Node.prototype.root = function root() {
  7810. var result = this;
  7811. while (result.parent) {
  7812. result = result.parent;
  7813. }return result;
  7814. };
  7815. Node.prototype.cleanRaws = function cleanRaws(keepBetween) {
  7816. delete this.raws.before;
  7817. delete this.raws.after;
  7818. if (!keepBetween) delete this.raws.between;
  7819. };
  7820. Node.prototype.positionInside = function positionInside(index) {
  7821. var string = this.toString();
  7822. var column = this.source.start.column;
  7823. var line = this.source.start.line;
  7824. for (var i = 0; i < index; i++) {
  7825. if (string[i] === '\n') {
  7826. column = 1;
  7827. line += 1;
  7828. } else {
  7829. column += 1;
  7830. }
  7831. }
  7832. return { line: line, column: column };
  7833. };
  7834. Node.prototype.positionBy = function positionBy(opts) {
  7835. var pos = this.source.start;
  7836. if (opts.index) {
  7837. pos = this.positionInside(opts.index);
  7838. } else if (opts.word) {
  7839. var index = this.toString().indexOf(opts.word);
  7840. if (index !== -1) pos = this.positionInside(index);
  7841. }
  7842. return pos;
  7843. };
  7844. Node.prototype.removeSelf = function removeSelf() {
  7845. (0, _warnOnce2.default)('Node#removeSelf is deprecated. Use Node#remove.');
  7846. return this.remove();
  7847. };
  7848. Node.prototype.replace = function replace(nodes) {
  7849. (0, _warnOnce2.default)('Node#replace is deprecated. Use Node#replaceWith');
  7850. return this.replaceWith(nodes);
  7851. };
  7852. Node.prototype.style = function style(own, detect) {
  7853. (0, _warnOnce2.default)('Node#style() is deprecated. Use Node#raw()');
  7854. return this.raw(own, detect);
  7855. };
  7856. Node.prototype.cleanStyles = function cleanStyles(keepBetween) {
  7857. (0, _warnOnce2.default)('Node#cleanStyles() is deprecated. Use Node#cleanRaws()');
  7858. return this.cleanRaws(keepBetween);
  7859. };
  7860. _createClass(Node, [{
  7861. key: 'before',
  7862. get: function get() {
  7863. (0, _warnOnce2.default)('Node#before is deprecated. Use Node#raws.before');
  7864. return this.raws.before;
  7865. },
  7866. set: function set(val) {
  7867. (0, _warnOnce2.default)('Node#before is deprecated. Use Node#raws.before');
  7868. this.raws.before = val;
  7869. }
  7870. }, {
  7871. key: 'between',
  7872. get: function get() {
  7873. (0, _warnOnce2.default)('Node#between is deprecated. Use Node#raws.between');
  7874. return this.raws.between;
  7875. },
  7876. set: function set(val) {
  7877. (0, _warnOnce2.default)('Node#between is deprecated. Use Node#raws.between');
  7878. this.raws.between = val;
  7879. }
  7880. /**
  7881. * @memberof Node#
  7882. * @member {string} type - String representing the node’s type.
  7883. * Possible values are `root`, `atrule`, `rule`,
  7884. * `decl`, or `comment`.
  7885. *
  7886. * @example
  7887. * postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
  7888. */
  7889. /**
  7890. * @memberof Node#
  7891. * @member {Container} parent - the node’s parent node.
  7892. *
  7893. * @example
  7894. * root.nodes[0].parent == root;
  7895. */
  7896. /**
  7897. * @memberof Node#
  7898. * @member {source} source - the input source of the node
  7899. *
  7900. * The property is used in source map generation.
  7901. *
  7902. * If you create a node manually (e.g., with `postcss.decl()`),
  7903. * that node will not have a `source` property and will be absent
  7904. * from the source map. For this reason, the plugin developer should
  7905. * consider cloning nodes to create new ones (in which case the new node’s
  7906. * source will reference the original, cloned node) or setting
  7907. * the `source` property manually.
  7908. *
  7909. * ```js
  7910. * // Bad
  7911. * const prefixed = postcss.decl({
  7912. * prop: '-moz-' + decl.prop,
  7913. * value: decl.value
  7914. * });
  7915. *
  7916. * // Good
  7917. * const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
  7918. * ```
  7919. *
  7920. * ```js
  7921. * if ( atrule.name == 'add-link' ) {
  7922. * const rule = postcss.rule({ selector: 'a', source: atrule.source });
  7923. * atrule.parent.insertBefore(atrule, rule);
  7924. * }
  7925. * ```
  7926. *
  7927. * @example
  7928. * decl.source.input.from //=> '/home/ai/a.sass'
  7929. * decl.source.start //=> { line: 10, column: 2 }
  7930. * decl.source.end //=> { line: 10, column: 12 }
  7931. */
  7932. /**
  7933. * @memberof Node#
  7934. * @member {object} raws - Information to generate byte-to-byte equal
  7935. * node string as it was in the origin input.
  7936. *
  7937. * Every parser saves its own properties,
  7938. * but the default CSS parser uses:
  7939. *
  7940. * * `before`: the space symbols before the node. It also stores `*`
  7941. * and `_` symbols before the declaration (IE hack).
  7942. * * `after`: the space symbols after the last child of the node
  7943. * to the end of the node.
  7944. * * `between`: the symbols between the property and value
  7945. * for declarations, selector and `{` for rules, or last parameter
  7946. * and `{` for at-rules.
  7947. * * `semicolon`: contains true if the last child has
  7948. * an (optional) semicolon.
  7949. * * `afterName`: the space between the at-rule name and its parameters.
  7950. * * `left`: the space symbols between `/*` and the comment’s text.
  7951. * * `right`: the space symbols between the comment’s text
  7952. * and <code>*&#47;</code>.
  7953. * * `important`: the content of the important statement,
  7954. * if it is not just `!important`.
  7955. *
  7956. * PostCSS cleans selectors, declaration values and at-rule parameters
  7957. * from comments and extra spaces, but it stores origin content in raws
  7958. * properties. As such, if you don’t change a declaration’s value,
  7959. * PostCSS will use the raw value with comments.
  7960. *
  7961. * @example
  7962. * const root = postcss.parse('a {\n color:black\n}')
  7963. * root.first.first.raws //=> { before: '\n ', between: ':' }
  7964. */
  7965. }]);
  7966. return Node;
  7967. }();
  7968. exports.default = Node;
  7969. /**
  7970. * @typedef {object} position
  7971. * @property {number} line - source line in file
  7972. * @property {number} column - source column in file
  7973. */
  7974. /**
  7975. * @typedef {object} source
  7976. * @property {Input} input - {@link Input} with input file
  7977. * @property {position} start - The starting position of the node’s source
  7978. * @property {position} end - The ending position of the node’s source
  7979. */
  7980. module.exports = exports['default'];
  7981. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGUuZXM2Il0sIm5hbWVzIjpbImNsb25lTm9kZSIsIm9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AgICAgICAgICBQb3N0Q1NTIHdpbGwgc2V0IGl0IGF1dG9tYXRpY2FsbHkuXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMud29yZCAgIC0gYSB3b3JkIGluc2lkZSBhIG5vZGXigJlzIHN0cmluZyB0aGF0IHNob3VsZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIGhpZ2hsaWdodGVkIGFzIHRoZSBzb3VyY2Ugb2YgdGhlIGVycm9yXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IG9wdHMuaW5kZXggIC0gYW4gaW5kZXggaW5zaWRlIGEgbm9kZeKAmXMgc3RyaW5nIHRoYXQgc2hvdWxkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgaGlnaGxpZ2h0ZWQgYXMgdGhlIHNvdXJjZSBvZiB0aGUgZXJyb3JcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge0Nzc1N5bnRheEVycm9yfSBlcnJvciBvYmplY3QgdG8gdGhyb3cgaXRcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogaWYgKCAhdmFyaWFibGVzW25hbWVdICkge1xuICAgICAqICAgdGhyb3cgZGVjbC5lcnJvcignVW5rbm93biB2YXJpYWJsZSAnICsgbmFtZSwgeyB3b3JkOiBuYW1lIH0pO1xuICAgICAqICAgLy8gQ3NzU3ludGF4RXJyb3I6IHBvc3Rjc3MtdmFyczphLnNhc3M6NDozOiBVbmtub3duIHZhcmlhYmxlICRibGFja1xuICAgICAqICAgLy8gICBjb2xvcjogJGJsYWNrXG4gICAgICogICAvLyBhXG4gICAgICogICAvLyAgICAgICAgICBeXG4gICAgICogICAvLyAgIGJhY2tncm91bmQ6IHdoaXRlXG4gICAgICogfVxuICAgICAqL1xuICAgIGVycm9yKG1lc3NhZ2UsIG9wdHMgPSB7IH0pIHtcbiAgICAgICAgaWYgKCB0aGlzLnNvdXJjZSApIHtcbiAgICAgICAgICAgIGxldCBwb3M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wcm9wLm1hdGNoKC9eLXdlYmtpdC0vKSApIHtcbiAgICAgKiAgIGRlY2wucmVtb3ZlKCk7XG4gICAgICogfVxuICAgICAqXG4gICAgICogQHJldHVybiB7Tm9kZX0gbm9kZSB0byBtYWtlIGNhbGxzIGNoYWluXG4gICAgICovXG4gICAgcmVtb3ZlKCkge1xuICAgICAgICBpZiAoIHRoaXMucGFyZW50ICkge1xuICAgICAgICAgICAgdGhpcy5wYXJlbnQucmVtb3ZlQ2hpbGQodGhpcyk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5wYXJlbnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyB0aGUgbm9kZS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5naWZpZXJ8c3ludGF4fSBbc3RyaW5naWZpZXJdIC0gYSBzeW50YXggdG8gdXNlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiBzdHJpbmcgZ2VuZXJhdGlvblxuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBDU1Mgc3RyaW5nIG9mIHRoaXMgbm9kZVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBwb3N0Y3NzLnJ1bGUoeyBzZWxlY3RvcjogJ2EnIH0pLnRvU3RyaW5nKCkgLy89PiBcImEge31cIlxuICAgICAqL1xuICAgIHRvU3RyaW5nKHN0cmluZ2lmaWVyID0gc3RyaW5naWZ5KSB7XG4gICAgICAgIGlmICggc3RyaW5naWZpZXIuc3RyaW5naWZ5ICkgc3RyaW5naWZpZXIgPSBzdHJpbmdpZmllci5zdHJpbmdpZnk7XG4gICAgICAgIGxldCByZXN1bHQgID0gJyc7XG4gICAgICAgIHN0cmluZ2lmaWVyKHRoaXMsIGkgPT4ge1xuICAgICAgICA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2RlXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IGFubm90YXRpb24gPSBkZWNsLnByZXYoKTtcbiAgICAgKiBpZiAoIGFubm90YXRpb24udHlwZSA9PSAnY29tbWVudCcgKSB7XG4gICAgICogIHJlYWRBbm5vdGF0aW9uKGFubm90YXRpb24udGV4dCk7XG4gICAgICogfVxuICAgICAqL1xuICAgIHByZXYoKSB7XG4gICAgICAgIGxldCBpbmRleCA9IHRoaXMucGFyZW50LmluZGV4KHRoaXMpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJlbnQubm9kZXNbaW5kZXggLSAxXTtcbiAgICB9XG5cbiAgICB0b0pTT04oKSB7XG4gICAgICAgIGxldCBmaXhlZCA9IHsgfTtcblxuICAgICAgICBmb3IgKCBsZXQgbmFtZSBpbiB0aGlzICkge1xuICAgICAgICAgICAgaWYgKCAhdGhpcy5oYXNPd25Qcm9wZXJ0eShuYW1lKSApIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKCBuYW1lID09PSAncGFyZW50JyApIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IHZhbHVlID0gdGhpc1tuYW1lXTtcblxuICAgICAgICAgICAgaWYgKCB2YWx1ZSBpbnN0YW5jZW9mIEFycmF5ICkge1xuICAgICAgICAgICAgICAgIGZpeGVkW25hbWVdID0gdmFsdWUubWFwKCBpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaSA9PT0gJ29iamVjdCcgJiYgaS50b0pTT04gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS50b0pTT04oKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgdmFsdWUgPT09ICdvYmplY3Q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cgPSB0aGlzLnRvU3RyaW5nKCk7XG4gICAgICAgIGxldCBjb2x1bW4gPSB0aGlzLnNvdXJjZS5zdGFydC5jb2x1bW47XG4gICAgICAgIGxldCBsaW5lICAgPSB0aGlzLnNvdXJjZS5zdGFydC5saW5lO1xuXG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IGluZGV4OyBpKysgKSB7XG4gICAgICAgICAgICBpZiAoIHN0cmluZ1tpXSA9PT0gJ1xcbicgKSB7XG4gICAgICAgICAgICAgICAgY29sdW1uID0gMTtcbiAgICAgICAgICAgICAgICBsaW5lICArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb2x1bW4gKz0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7IGxpbmUsIGNvbHVtbiB9O1xuICAgIH1cblxuICAgIHBvc2l0aW9uQnkob3B0cykge1xuICAgICAgICBsZXQgcG9zID0gdGhpcy5zb3VyY2Uuc3RhcnQ7XG4gICAgICAgIGlmICggb3B0cy5pbmRleCApIHtcbiAgICAgICAgICAgIHBvcyA9IHRoaXMucG9zaXRpb25JbnNpZGUob3B0cy5pbmRleCk7XG4gICAgICAgIH0gZWxzZSBpZiAoIG9wdHMud29yZCApIHtcbiAgICAgICAgICAgIGxldCBpbmRleCA9IHRoaXMudG9TdHJpbmcoKS5pbmRleE9mKG9wdHMud29yZCk7XG4gICAgICAgICAgICBpZiAoIGluZGV4ICE9PSAtMSApIHBvcyA9IHRoaXMucG9zaXRpb25JbnNpZGUoaW5kZXgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwb3M7XG4gICAgfVxuXG4gICAgcmVtb3ZlU2VsZigpIHtcbiAgICAgICAgd2Fybk9uY2UoJ05vZGUjcmVtb3ZlU2VsZiBpcyBkZXByZWNhdGVkLiBVc2UgTm9kZSNyZW1vdmUuJyk7XG4gICAgICAgIHJldHVybiB0aGlzLnJlbW92ZSgpO1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XMuIEFzIHN1Y2gsIGlmIHlvdSBkb27igJl0IGNoYW5nZSBhIGRlY2xhcmF0aW9u4oCZcyB2YWx1ZSxcbiAgICAgKiBQb3N0Q1NTIHdpbGwgdXNlIHRoZSByYXcgdmFsdWUgd2l0aCBjb21tZW50cy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoJ2Ege1xcbiAgY29sb3I6YmxhY2tcXG59JylcbiAgICAgKiByb290LmZpcnN0LmZpcnN0LnJhd3MgLy89PiB7IGJlZm9yZTogJ1xcbiAgJywgYmV0d2VlbjogJzonIH1cbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBOb2RlO1xuXG4vKipcbiAqIEB0eXBlZGVmIHtvYmplY3R9IHBvc2l0aW9uXG4gKiBAcHJvcGVydHkge251bWJlcn0gbGluZSAgIC0gc291cmNlIGxpbmUgaW4gZmlsZVxuICogQHByb3BlcnR5IHtudW1iZXJ9IGNvbHVtbiAtIHNvdXJjZSBjb2x1bW4gaW4gZmlsZVxuICovXG5cbi8qKlxuICogQHR5cGVkZWYge29iamVjdH0gc291cmNlXG4gKiBAcHJvcGVydHkge0lucHV0fSBpbnB1dCAgICAtIHtAbGluayBJbnB1dH0gd2l0aCBpbnB1dCBmaWxlXG4gKiBAcHJvcGVydHkge3Bvc2l0aW9ufSBzdGFydCAtIFRoZSBzdGFydGluZyBwb3NpdGlvbiBvZiB0aGUgbm9kZeKAmXMgc291cmNlXG4gKiBAcHJvcGVydHkge3Bvc2l0aW9ufSBlbmQgICAtIFRoZSBlbmRpbmcgcG9zaXRpb24gb2YgdGhlIG5vZGXigJlzIHNvdXJjZVxuICovXG4iXX0=
  7982. /***/ }),
  7983. /* 39 */
  7984. /***/ (function(module, exports, __webpack_require__) {
  7985. "use strict";
  7986. exports.__esModule = true;
  7987. var _container = __webpack_require__(36);
  7988. var _container2 = _interopRequireDefault(_container);
  7989. var _warnOnce = __webpack_require__(5);
  7990. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  7991. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7992. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7993. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7994. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7995. /**
  7996. * Represents a CSS file and contains all its parsed nodes.
  7997. *
  7998. * @extends Container
  7999. *
  8000. * @example
  8001. * const root = postcss.parse('a{color:black} b{z-index:2}');
  8002. * root.type //=> 'root'
  8003. * root.nodes.length //=> 2
  8004. */
  8005. var Root = function (_Container) {
  8006. _inherits(Root, _Container);
  8007. function Root(defaults) {
  8008. _classCallCheck(this, Root);
  8009. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  8010. _this.type = 'root';
  8011. if (!_this.nodes) _this.nodes = [];
  8012. return _this;
  8013. }
  8014. Root.prototype.removeChild = function removeChild(child) {
  8015. child = this.index(child);
  8016. if (child === 0 && this.nodes.length > 1) {
  8017. this.nodes[1].raws.before = this.nodes[child].raws.before;
  8018. }
  8019. return _Container.prototype.removeChild.call(this, child);
  8020. };
  8021. Root.prototype.normalize = function normalize(child, sample, type) {
  8022. var nodes = _Container.prototype.normalize.call(this, child);
  8023. if (sample) {
  8024. if (type === 'prepend') {
  8025. if (this.nodes.length > 1) {
  8026. sample.raws.before = this.nodes[1].raws.before;
  8027. } else {
  8028. delete sample.raws.before;
  8029. }
  8030. } else if (this.first !== sample) {
  8031. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  8032. var _ref;
  8033. if (_isArray) {
  8034. if (_i >= _iterator.length) break;
  8035. _ref = _iterator[_i++];
  8036. } else {
  8037. _i = _iterator.next();
  8038. if (_i.done) break;
  8039. _ref = _i.value;
  8040. }
  8041. var node = _ref;
  8042. node.raws.before = sample.raws.before;
  8043. }
  8044. }
  8045. }
  8046. return nodes;
  8047. };
  8048. /**
  8049. * Returns a {@link Result} instance representing the root’s CSS.
  8050. *
  8051. * @param {processOptions} [opts] - options with only `to` and `map` keys
  8052. *
  8053. * @return {Result} result with current root’s CSS
  8054. *
  8055. * @example
  8056. * const root1 = postcss.parse(css1, { from: 'a.css' });
  8057. * const root2 = postcss.parse(css2, { from: 'b.css' });
  8058. * root1.append(root2);
  8059. * const result = root1.toResult({ to: 'all.css', map: true });
  8060. */
  8061. Root.prototype.toResult = function toResult() {
  8062. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8063. var LazyResult = __webpack_require__(93);
  8064. var Processor = __webpack_require__(196);
  8065. var lazy = new LazyResult(new Processor(), this, opts);
  8066. return lazy.stringify();
  8067. };
  8068. Root.prototype.remove = function remove(child) {
  8069. (0, _warnOnce2.default)('Root#remove is deprecated. Use Root#removeChild');
  8070. this.removeChild(child);
  8071. };
  8072. Root.prototype.prevMap = function prevMap() {
  8073. (0, _warnOnce2.default)('Root#prevMap is deprecated. Use Root#source.input.map');
  8074. return this.source.input.map;
  8075. };
  8076. /**
  8077. * @memberof Root#
  8078. * @member {object} raws - Information to generate byte-to-byte equal
  8079. * node string as it was in the origin input.
  8080. *
  8081. * Every parser saves its own properties,
  8082. * but the default CSS parser uses:
  8083. *
  8084. * * `after`: the space symbols after the last child to the end of file.
  8085. * * `semicolon`: is the last child has an (optional) semicolon.
  8086. *
  8087. * @example
  8088. * postcss.parse('a {}\n').raws //=> { after: '\n' }
  8089. * postcss.parse('a {}').raws //=> { after: '' }
  8090. */
  8091. return Root;
  8092. }(_container2.default);
  8093. exports.default = Root;
  8094. module.exports = exports['default'];
  8095. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvb3QuZXM2Il0sIm5hbWVzIjpbIlJvb3QiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsInJlbW92ZUNoaWxkIiwiY2hpbGQiLCJpbmRleCIsImxlbmd0aCIsInJhd3MiLCJiZWZvcmUiLCJub3JtYWxpemUiLCJzYW1wbGUiLCJmaXJzdCIsIm5vZGUiLCJ0b1Jlc3VsdCIsIm9wdHMiLCJMYXp5UmVzdWx0IiwicmVxdWlyZSIsIlByb2Nlc3NvciIsImxhenkiLCJzdHJpbmdpZnkiLCJyZW1vdmUiLCJwcmV2TWFwIiwic291cmNlIiwiaW5wdXQiLCJtYXAiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7OztJQVVNQSxJOzs7QUFFRixrQkFBWUMsUUFBWixFQUFzQjtBQUFBOztBQUFBLHFEQUNsQixzQkFBTUEsUUFBTixDQURrQjs7QUFFbEIsY0FBS0MsSUFBTCxHQUFZLE1BQVo7QUFDQSxZQUFLLENBQUMsTUFBS0MsS0FBWCxFQUFtQixNQUFLQSxLQUFMLEdBQWEsRUFBYjtBQUhEO0FBSXJCOzttQkFFREMsVyx3QkFBWUMsSyxFQUFPO0FBQ2ZBLGdCQUFRLEtBQUtDLEtBQUwsQ0FBV0QsS0FBWCxDQUFSOztBQUVBLFlBQUtBLFVBQVUsQ0FBVixJQUFlLEtBQUtGLEtBQUwsQ0FBV0ksTUFBWCxHQUFvQixDQUF4QyxFQUE0QztBQUN4QyxpQkFBS0osS0FBTCxDQUFXLENBQVgsRUFBY0ssSUFBZCxDQUFtQkMsTUFBbkIsR0FBNEIsS0FBS04sS0FBTCxDQUFXRSxLQUF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GlzLm5vZGVzID0gW107XG4gICAgfVxuXG4gICAgcmVtb3ZlQ2hpbGQoY2hpbGQpIHtcbiAgICAgICAgY2hpbGQgPSB0aGlzLmluZGV4KGNoaWxkKTtcblxuICAgICAgICBpZiAoIGNoaWxkID09PSAwICYmIHRoaXMubm9kZXMubGVuZ3RoID4gMSApIHtcbiAgICAgICAgICAgIHRoaXMubm9kZXNbMV0ucmF3cy5iZWZvcmUgPSB0aGlzLm5vZGVzW2NoaWxkXS5yYXdzLmJlZm9yZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzdXBlci5yZW1vdmVDaGlsZChjaGlsZCk7XG4gICAgfVxuXG4gICAgbm9ybWFsaXplKGNoaWxkLCBzYW1wbGUsIHR5cGUpIHtcbiAgICAgICAgbGV0IG5vZGVzID0gc3VwZXIubm9ybWFsaXplKGNoaWxkKTtcblxuICAgICAgICBpZiAoIHNhbXBsZSApIHtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJ3ByZXBlbmQnICkge1xuICAgICAgICAgICAgICAgIGlmICggdGhpcy5ub2Rlcy5sZW5ndGggPiAxICkge1xuICAgICAgICAgICAgICAgICAgICBzYW1wbGUucmF3cy5iZWZvcmUgPSB0aGlzLm5vZGVzWzFdLnJhd3MuYmVmb3JlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBzYW1wbGUucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggdGhpcy5maXJzdCAhPT0gc2FtcGxlICkge1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBub2RlIG9mIG5vZGVzICkge1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlID0gc2FtcGxlLnJhd3MuYmVmb3JlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB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dfQ==
  8096. /***/ }),
  8097. /* 40 */
  8098. /***/ (function(module, exports, __webpack_require__) {
  8099. "use strict";
  8100. exports.__esModule = true;
  8101. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8102. var defaultRaw = {
  8103. colon: ': ',
  8104. indent: ' ',
  8105. beforeDecl: '\n',
  8106. beforeRule: '\n',
  8107. beforeOpen: ' ',
  8108. beforeClose: '\n',
  8109. beforeComment: '\n',
  8110. after: '\n',
  8111. emptyBody: '',
  8112. commentLeft: ' ',
  8113. commentRight: ' '
  8114. };
  8115. function capitalize(str) {
  8116. return str[0].toUpperCase() + str.slice(1);
  8117. }
  8118. var Stringifier = function () {
  8119. function Stringifier(builder) {
  8120. _classCallCheck(this, Stringifier);
  8121. this.builder = builder;
  8122. }
  8123. Stringifier.prototype.stringify = function stringify(node, semicolon) {
  8124. this[node.type](node, semicolon);
  8125. };
  8126. Stringifier.prototype.root = function root(node) {
  8127. this.body(node);
  8128. if (node.raws.after) this.builder(node.raws.after);
  8129. };
  8130. Stringifier.prototype.comment = function comment(node) {
  8131. var left = this.raw(node, 'left', 'commentLeft');
  8132. var right = this.raw(node, 'right', 'commentRight');
  8133. this.builder('/*' + left + node.text + right + '*/', node);
  8134. };
  8135. Stringifier.prototype.decl = function decl(node, semicolon) {
  8136. var between = this.raw(node, 'between', 'colon');
  8137. var string = node.prop + between + this.rawValue(node, 'value');
  8138. if (node.important) {
  8139. string += node.raws.important || ' !important';
  8140. }
  8141. if (semicolon) string += ';';
  8142. this.builder(string, node);
  8143. };
  8144. Stringifier.prototype.rule = function rule(node) {
  8145. this.block(node, this.rawValue(node, 'selector'));
  8146. };
  8147. Stringifier.prototype.atrule = function atrule(node, semicolon) {
  8148. var name = '@' + node.name;
  8149. var params = node.params ? this.rawValue(node, 'params') : '';
  8150. if (typeof node.raws.afterName !== 'undefined') {
  8151. name += node.raws.afterName;
  8152. } else if (params) {
  8153. name += ' ';
  8154. }
  8155. if (node.nodes) {
  8156. this.block(node, name + params);
  8157. } else {
  8158. var end = (node.raws.between || '') + (semicolon ? ';' : '');
  8159. this.builder(name + params + end, node);
  8160. }
  8161. };
  8162. Stringifier.prototype.body = function body(node) {
  8163. var last = node.nodes.length - 1;
  8164. while (last > 0) {
  8165. if (node.nodes[last].type !== 'comment') break;
  8166. last -= 1;
  8167. }
  8168. var semicolon = this.raw(node, 'semicolon');
  8169. for (var i = 0; i < node.nodes.length; i++) {
  8170. var child = node.nodes[i];
  8171. var before = this.raw(child, 'before');
  8172. if (before) this.builder(before);
  8173. this.stringify(child, last !== i || semicolon);
  8174. }
  8175. };
  8176. Stringifier.prototype.block = function block(node, start) {
  8177. var between = this.raw(node, 'between', 'beforeOpen');
  8178. this.builder(start + between + '{', node, 'start');
  8179. var after = void 0;
  8180. if (node.nodes && node.nodes.length) {
  8181. this.body(node);
  8182. after = this.raw(node, 'after');
  8183. } else {
  8184. after = this.raw(node, 'after', 'emptyBody');
  8185. }
  8186. if (after) this.builder(after);
  8187. this.builder('}', node, 'end');
  8188. };
  8189. Stringifier.prototype.raw = function raw(node, own, detect) {
  8190. var value = void 0;
  8191. if (!detect) detect = own;
  8192. // Already had
  8193. if (own) {
  8194. value = node.raws[own];
  8195. if (typeof value !== 'undefined') return value;
  8196. }
  8197. var parent = node.parent;
  8198. // Hack for first rule in CSS
  8199. if (detect === 'before') {
  8200. if (!parent || parent.type === 'root' && parent.first === node) {
  8201. return '';
  8202. }
  8203. }
  8204. // Floating child without parent
  8205. if (!parent) return defaultRaw[detect];
  8206. // Detect style by other nodes
  8207. var root = node.root();
  8208. if (!root.rawCache) root.rawCache = {};
  8209. if (typeof root.rawCache[detect] !== 'undefined') {
  8210. return root.rawCache[detect];
  8211. }
  8212. if (detect === 'before' || detect === 'after') {
  8213. return this.beforeAfter(node, detect);
  8214. } else {
  8215. var method = 'raw' + capitalize(detect);
  8216. if (this[method]) {
  8217. value = this[method](root, node);
  8218. } else {
  8219. root.walk(function (i) {
  8220. value = i.raws[own];
  8221. if (typeof value !== 'undefined') return false;
  8222. });
  8223. }
  8224. }
  8225. if (typeof value === 'undefined') value = defaultRaw[detect];
  8226. root.rawCache[detect] = value;
  8227. return value;
  8228. };
  8229. Stringifier.prototype.rawSemicolon = function rawSemicolon(root) {
  8230. var value = void 0;
  8231. root.walk(function (i) {
  8232. if (i.nodes && i.nodes.length && i.last.type === 'decl') {
  8233. value = i.raws.semicolon;
  8234. if (typeof value !== 'undefined') return false;
  8235. }
  8236. });
  8237. return value;
  8238. };
  8239. Stringifier.prototype.rawEmptyBody = function rawEmptyBody(root) {
  8240. var value = void 0;
  8241. root.walk(function (i) {
  8242. if (i.nodes && i.nodes.length === 0) {
  8243. value = i.raws.after;
  8244. if (typeof value !== 'undefined') return false;
  8245. }
  8246. });
  8247. return value;
  8248. };
  8249. Stringifier.prototype.rawIndent = function rawIndent(root) {
  8250. if (root.raws.indent) return root.raws.indent;
  8251. var value = void 0;
  8252. root.walk(function (i) {
  8253. var p = i.parent;
  8254. if (p && p !== root && p.parent && p.parent === root) {
  8255. if (typeof i.raws.before !== 'undefined') {
  8256. var parts = i.raws.before.split('\n');
  8257. value = parts[parts.length - 1];
  8258. value = value.replace(/[^\s]/g, '');
  8259. return false;
  8260. }
  8261. }
  8262. });
  8263. return value;
  8264. };
  8265. Stringifier.prototype.rawBeforeComment = function rawBeforeComment(root, node) {
  8266. var value = void 0;
  8267. root.walkComments(function (i) {
  8268. if (typeof i.raws.before !== 'undefined') {
  8269. value = i.raws.before;
  8270. if (value.indexOf('\n') !== -1) {
  8271. value = value.replace(/[^\n]+$/, '');
  8272. }
  8273. return false;
  8274. }
  8275. });
  8276. if (typeof value === 'undefined') {
  8277. value = this.raw(node, null, 'beforeDecl');
  8278. }
  8279. return value;
  8280. };
  8281. Stringifier.prototype.rawBeforeDecl = function rawBeforeDecl(root, node) {
  8282. var value = void 0;
  8283. root.walkDecls(function (i) {
  8284. if (typeof i.raws.before !== 'undefined') {
  8285. value = i.raws.before;
  8286. if (value.indexOf('\n') !== -1) {
  8287. value = value.replace(/[^\n]+$/, '');
  8288. }
  8289. return false;
  8290. }
  8291. });
  8292. if (typeof value === 'undefined') {
  8293. value = this.raw(node, null, 'beforeRule');
  8294. }
  8295. return value;
  8296. };
  8297. Stringifier.prototype.rawBeforeRule = function rawBeforeRule(root) {
  8298. var value = void 0;
  8299. root.walk(function (i) {
  8300. if (i.nodes && (i.parent !== root || root.first !== i)) {
  8301. if (typeof i.raws.before !== 'undefined') {
  8302. value = i.raws.before;
  8303. if (value.indexOf('\n') !== -1) {
  8304. value = value.replace(/[^\n]+$/, '');
  8305. }
  8306. return false;
  8307. }
  8308. }
  8309. });
  8310. return value;
  8311. };
  8312. Stringifier.prototype.rawBeforeClose = function rawBeforeClose(root) {
  8313. var value = void 0;
  8314. root.walk(function (i) {
  8315. if (i.nodes && i.nodes.length > 0) {
  8316. if (typeof i.raws.after !== 'undefined') {
  8317. value = i.raws.after;
  8318. if (value.indexOf('\n') !== -1) {
  8319. value = value.replace(/[^\n]+$/, '');
  8320. }
  8321. return false;
  8322. }
  8323. }
  8324. });
  8325. return value;
  8326. };
  8327. Stringifier.prototype.rawBeforeOpen = function rawBeforeOpen(root) {
  8328. var value = void 0;
  8329. root.walk(function (i) {
  8330. if (i.type !== 'decl') {
  8331. value = i.raws.between;
  8332. if (typeof value !== 'undefined') return false;
  8333. }
  8334. });
  8335. return value;
  8336. };
  8337. Stringifier.prototype.rawColon = function rawColon(root) {
  8338. var value = void 0;
  8339. root.walkDecls(function (i) {
  8340. if (typeof i.raws.between !== 'undefined') {
  8341. value = i.raws.between.replace(/[^\s:]/g, '');
  8342. return false;
  8343. }
  8344. });
  8345. return value;
  8346. };
  8347. Stringifier.prototype.beforeAfter = function beforeAfter(node, detect) {
  8348. var value = void 0;
  8349. if (node.type === 'decl') {
  8350. value = this.raw(node, null, 'beforeDecl');
  8351. } else if (node.type === 'comment') {
  8352. value = this.raw(node, null, 'beforeComment');
  8353. } else if (detect === 'before') {
  8354. value = this.raw(node, null, 'beforeRule');
  8355. } else {
  8356. value = this.raw(node, null, 'beforeClose');
  8357. }
  8358. var buf = node.parent;
  8359. var depth = 0;
  8360. while (buf && buf.type !== 'root') {
  8361. depth += 1;
  8362. buf = buf.parent;
  8363. }
  8364. if (value.indexOf('\n') !== -1) {
  8365. var indent = this.raw(node, null, 'indent');
  8366. if (indent.length) {
  8367. for (var step = 0; step < depth; step++) {
  8368. value += indent;
  8369. }
  8370. }
  8371. }
  8372. return value;
  8373. };
  8374. Stringifier.prototype.rawValue = function rawValue(node, prop) {
  8375. var value = node[prop];
  8376. var raw = node.raws[prop];
  8377. if (raw && raw.value === value) {
  8378. return raw.raw;
  8379. } else {
  8380. return value;
  8381. }
  8382. };
  8383. return Stringifier;
  8384. }();
  8385. exports.default = Stringifier;
  8386. module.exports = exports['default'];
  8387. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmaWVyLmVzNiJdLCJuYW1lcyI6WyJkZWZhdWx0UmF3IiwiY29sb24iLCJpbmRlbnQiLCJiZWZvcmVEZWNsIiwiYmVmb3JlUnVsZSIsImJlZm9yZU9wZW4iLCJiZWZvcmVDbG9zZSIsImJlZm9yZUNvbW1lbnQiLCJhZnRlciIsImVtcHR5Qm9keSIsImNvbW1lbnRMZWZ0IiwiY29tbWVudFJpZ2h0IiwiY2FwaXRhbGl6ZSIsInN0ciIsInRvVXBwZXJDYXNlIiwic2xpY2UiLCJTdHJpbmdpZmllciIsImJ1aWxkZXIiLCJzdHJpbmdpZnkiLCJub2RlIiwic2VtaWNvbG9uIiwidHlwZSIsInJvb3QiLCJib2R5IiwicmF3cyIsImNvbW1lbnQiLCJsZWZ0IiwicmF3IiwicmlnaHQiLCJ0ZXh0IiwiZGVjbCIsImJldHdlZW4iLCJzdHJpbmciLCJwcm9wIiwicmF3VmFsdWUiLCJpbXBvcnRhbnQiLCJydWxlIi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ScpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBhZnRlciApIHRoaXMuYnVpbGRlcihhZnRlcik7XG4gICAgICAgIHRoaXMuYnVpbGRlcignfScsIG5vZGUsICdlbmQnKTtcbiAgICB9XG5cbiAgICByYXcobm9kZSwgb3duLCBkZXRlY3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICBpZiAoICFkZXRlY3QgKSBkZXRlY3QgPSBvd247XG5cbiAgICAgICAgLy8gQWxyZWFkeSBoYWRcbiAgICAgICAgaWYgKCBvd24gKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IG5vZGUucmF3c1tvd25dO1xuICAgICAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgIT09ICd1bmRlZmluZWQnICkgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHBhcmVudCA9IG5vZGUucGFyZW50O1xuXG4gICAgICAgIC8vIEhhY2sgZm9yIGZpcnN0IHJ1bGUgaW4gQ1NTXG4gICAgICAgIGlmICggZGV0ZWN0ID09PSAnYmVmb3JlJyApIHtcbiAgICAgICAgICAgIGlmICggIXBhcmVudCB8fCBwYXJlbnQudHlwZSA9PT0gJ3Jvb3QnICYmIHBhcmVudC5maXJzdCA9PT0gbm9kZSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGbG9hdGluZyBjaGlsZCB3aXRob3V0IHBhcmVudFxuICAgICAgICBpZiAoICFwYXJlbnQgKSByZXR1cm4gZGVmYXVsdFJhd1tkZXRlY3RdO1xuXG4gICAgICAgIC8vIERldGVjdCBzdHlsZSBieSBvdGhlciBub2Rlc1xuICAgICAgICBsZXQgcm9vdCA9IG5vZGUucm9vdCgpO1xuICAgICAgICBpZiAoICFyb290LnJhd0NhY2hlICkgcm9vdC5yYXdDYWNoZSA9IHsgfTtcbiAgICAgICAgaWYgKCB0eXBlb2Ygcm9vdC5yYXdDYWNoZVtkZXRlY3RdICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHJldHVybiByb290LnJhd0NhY2hlW2RldGVjdF07XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIGRldGVjdCA9PT0gJ2JlZm9yZScgfHwgZGV0ZWN0ID09PSAnYWZ0ZXInICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmVmb3JlQWZ0ZXIobm9kZSwgZGV0ZWN0KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtZXRob2QgPSAncmF3JyArIGNhcGl0YWxpemUoZGV0ZWN0KTtcbiAgICAgICAgICAgIGlmICggdGhpc1ttZXRob2RdICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdGhpc1ttZXRob2RdKHJvb3QsIG5vZGUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3c1tvd25dO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSA9PT0gJ3VuZGVmaW5lZCcgKSB2YWx1ZSA9IGRlZmF1bHRSYXdbZGV0ZWN0XTtcblxuICAgICAgICByb290LnJhd0NhY2hlW2RldGVjdF0gPSB2YWx1ZTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd1NlbWljb2xvbihyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiBpLm5vZGVzLmxlbmd0aCAmJiBpLmxhc3QudHlwZSA9PT0gJ2RlY2wnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLnNlbWljb2xvbjtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3RW1wdHlCb2R5KHJvb3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCBpLm5vZGVzICYmIGkubm9kZXMubGVuZ3RoID09PSAwICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmFmdGVyO1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdJbmRlbnQocm9vdCkge1xuICAgICAgICBpZiAoIHJvb3QucmF3cy5pbmRlbnQgKSByZXR1cm4gcm9vdC5yYXdzLmluZGVudDtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgbGV0IHAgPSBpLnBhcmVudDtcbiAgICAgICAgICAgIGlmICggcCAmJiBwICE9PSByb290ICYmIHAucGFyZW50ICYmIHAucGFyZW50ID09PSByb290ICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcGFydHMgPSBpLnJhd3MuYmVmb3JlLnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBwYXJ0c1twYXJ0cy5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcc10vZywgJycpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd0JlZm9yZUNvbW1lbnQocm9vdCwgbm9kZSkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2Fsa0NvbW1lbnRzKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcbl0rJC8sICcnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlRGVjbCcpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVEZWNsKHJvb3QsIG5vZGUpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGtEZWNscyggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpLnJhd3MuYmVmb3JlICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmICggdHlwZW9mIHZhbHVlID09PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHZhbHVlID0gdGhpcy5yYXcobm9kZSwgbnVsbCwgJ2JlZm9yZVJ1bGUnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlUnVsZShyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiAoaS5wYXJlbnQgIT09IHJvb3QgfHwgcm9vdC5maXJzdCAhPT0gaSkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJlZm9yZSAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxuXSskLywgJycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlQ2xvc2Uocm9vdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2FsayggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIGkubm9kZXMgJiYgaS5ub2Rlcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5hZnRlciAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmFmdGVyO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVPcGVuKHJvb3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCBpLnR5cGUgIT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZXR3ZWVuO1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdDb2xvbihyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrRGVjbHMoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJldHdlZW4gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJldHdlZW4ucmVwbGFjZSgvW15cXHM6XS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIGJlZm9yZUFmdGVyKG5vZGUsIGRldGVjdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIGlmICggbm9kZS50eXBlID09PSAnZGVjbCcgKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHRoaXMucmF3KG5vZGUsIG51bGwsICdiZWZvcmVEZWNsJyk7XG4gICAgICAgIH0gZWxzZSBpZiAoIG5vZGUudHlwZSA9PT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlQ29tbWVudCcpO1xuICAgICAgICB9IGVsc2UgaWYgKCBkZXRlY3QgPT09ICdiZWZvcmUnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlUnVsZScpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlQ2xvc2UnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBidWYgICA9IG5vZGUucGFyZW50O1xuICAgICAgICBsZXQgZGVwdGggPSAwO1xuICAgICAgICB3aGlsZSAoIGJ1ZiAmJiBidWYudHlwZSAhPT0gJ3Jvb3QnICkge1xuICAgICAgICAgICAgZGVwdGggKz0gMTtcbiAgICAgICAgICAgIGJ1ZiA9IGJ1Zi5wYXJlbnQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgIGxldCBpbmRlbnQgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnaW5kZW50Jyk7XG4gICAgICAgICAgICBpZiAoIGluZGVudC5sZW5ndGggKSB7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IHN0ZXAgPSAwOyBzdGVwIDwgZGVwdGg7IHN0ZXArKyApIHZhbHVlICs9IGluZGVudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdWYWx1ZShub2RlLCBwcm9wKSB7XG4gICAgICAgIGxldCB2YWx1ZSA9IG5vZGVbcHJvcF07XG4gICAgICAgIGxldCByYXcgICA9IG5vZGUucmF3c1twcm9wXTtcbiAgICAgICAgaWYgKCByYXcgJiYgcmF3LnZhbHVlID09PSB2YWx1ZSApIHtcbiAgICAgICAgICAgIHJldHVybiByYXcucmF3O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG4gICAgfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IFN0cmluZ2lmaWVyO1xuIl19
  8388. /***/ }),
  8389. /* 41 */
  8390. /***/ (function(module, exports) {
  8391. var g;
  8392. // This works in non-strict mode
  8393. g = (function() {
  8394. return this;
  8395. })();
  8396. try {
  8397. // This works if eval is allowed (see CSP)
  8398. g = g || Function("return this")() || (1,eval)("this");
  8399. } catch(e) {
  8400. // This works if the window reference is available
  8401. if(typeof window === "object")
  8402. g = window;
  8403. }
  8404. // g can still be undefined, but nothing to do about it...
  8405. // We return undefined, instead of nothing here, so it's
  8406. // easier to handle this case. if(!global) { ...}
  8407. module.exports = g;
  8408. /***/ }),
  8409. /* 42 */
  8410. /***/ (function(module, exports, __webpack_require__) {
  8411. "use strict";
  8412. Object.defineProperty(exports, "__esModule", {
  8413. value: true
  8414. });
  8415. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8416. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  8417. var _comment = __webpack_require__(35);
  8418. var _comment2 = _interopRequireDefault(_comment);
  8419. var _import2 = __webpack_require__(144);
  8420. var _import3 = _interopRequireDefault(_import2);
  8421. var _parser = __webpack_require__(95);
  8422. var _parser2 = _interopRequireDefault(_parser);
  8423. var _rule = __webpack_require__(150);
  8424. var _rule2 = _interopRequireDefault(_rule);
  8425. var _root = __webpack_require__(149);
  8426. var _root2 = _interopRequireDefault(_root);
  8427. var _findExtendRule = __webpack_require__(143);
  8428. var _findExtendRule2 = _interopRequireDefault(_findExtendRule);
  8429. var _isMixinToken = __webpack_require__(145);
  8430. var _isMixinToken2 = _interopRequireDefault(_isMixinToken);
  8431. var _lessTokenize = __webpack_require__(148);
  8432. var _lessTokenize2 = _interopRequireDefault(_lessTokenize);
  8433. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8434. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8435. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8436. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8437. var blockCommentEndPattern = /\*\/$/;
  8438. var LessParser = function (_Parser) {
  8439. _inherits(LessParser, _Parser);
  8440. function LessParser(input) {
  8441. _classCallCheck(this, LessParser);
  8442. var _this = _possibleConstructorReturn(this, (LessParser.__proto__ || Object.getPrototypeOf(LessParser)).call(this, input));
  8443. _this.root = new _root2.default();
  8444. _this.current = _this.root;
  8445. _this.root.source = { input: input, start: { line: 1, column: 1 } };
  8446. return _this;
  8447. }
  8448. _createClass(LessParser, [{
  8449. key: 'atrule',
  8450. value: function atrule(token) {
  8451. if (token[1] === '@import') {
  8452. this.import(token);
  8453. } else {
  8454. _get(LessParser.prototype.__proto__ || Object.getPrototypeOf(LessParser.prototype), 'atrule', this).call(this, token);
  8455. }
  8456. }
  8457. }, {
  8458. key: 'comment',
  8459. value: function comment(token) {
  8460. var node = new _comment2.default();
  8461. var content = token[1];
  8462. var text = content.slice(2).replace(blockCommentEndPattern, '');
  8463. this.init(node, token[2], token[3]);
  8464. node.source.end = {
  8465. line: token[4],
  8466. column: token[5]
  8467. };
  8468. node.raws.content = content;
  8469. node.raws.begin = content[0] + content[1];
  8470. node.inline = token[6] === 'inline';
  8471. node.block = !node.inline;
  8472. if (/^\s*$/.test(text)) {
  8473. node.text = '';
  8474. node.raws.left = text;
  8475. node.raws.right = '';
  8476. } else {
  8477. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  8478. node.text = match[2];
  8479. // Add extra spaces to generate a comment in a common style /*[space][text][space]*/
  8480. node.raws.left = match[1] || ' ';
  8481. node.raws.right = match[3] || ' ';
  8482. }
  8483. }
  8484. /**
  8485. * @description Create a Declaration
  8486. * @param options {{start: number}}
  8487. */
  8488. }, {
  8489. key: 'createDeclaration',
  8490. value: function createDeclaration(options) {
  8491. this.decl(this.tokens.slice(options.start, this.pos + 1));
  8492. }
  8493. /**
  8494. * @description Create a Rule node
  8495. * @param options {{start: number, params: Array}}
  8496. */
  8497. }, {
  8498. key: 'createRule',
  8499. value: function createRule(options) {
  8500. var semi = this.tokens[this.pos][0] === ';';
  8501. var end = this.pos + (options.empty && semi ? 2 : 1);
  8502. var tokens = this.tokens.slice(options.start, end);
  8503. var node = this.rule(tokens);
  8504. /**
  8505. * By default in PostCSS `Rule.params` is `undefined`.
  8506. * To preserve compability with PostCSS:
  8507. * - Don't set empty params for a Rule.
  8508. * - Set params for a Rule only if it can be a mixin or &:extend rule.
  8509. */
  8510. if (options.params[0] && (options.mixin || options.extend)) {
  8511. this.raw(node, 'params', options.params);
  8512. }
  8513. if (options.empty) {
  8514. // if it's an empty mixin or extend, it must have a semicolon
  8515. // (that's the only way we get to this point)
  8516. if (semi) {
  8517. node.raws.semicolon = this.semicolon = true;
  8518. node.selector = node.selector.replace(/;$/, '');
  8519. }
  8520. if (options.extend) {
  8521. node.extend = true;
  8522. }
  8523. if (options.mixin) {
  8524. node.mixin = true;
  8525. }
  8526. /**
  8527. * @description Mark mixin without declarations.
  8528. * @type {boolean}
  8529. */
  8530. node.empty = true;
  8531. // eslint-disable-next-line
  8532. delete this.current.nodes;
  8533. if (/!\s*important/i.test(node.selector)) {
  8534. node.important = true;
  8535. if (/\s*!\s*important/i.test(node.selector)) {
  8536. node.raws.important = node.selector.match(/(\s*!\s*important)/i)[1];
  8537. }
  8538. node.selector = node.selector.replace(/\s*!\s*important/i, '');
  8539. }
  8540. // rules don't have trailing semicolons in vanilla css, so they get
  8541. // added to this.spaces by the parser loop, so don't step back.
  8542. if (!semi) {
  8543. this.pos--;
  8544. }
  8545. this.end(this.tokens[this.pos]);
  8546. }
  8547. }
  8548. }, {
  8549. key: 'end',
  8550. value: function end(token) {
  8551. var node = this.current;
  8552. // if a Rule contains other Rules (mixins, extends) and those have
  8553. // semicolons, assert that the parent Rule has a semicolon
  8554. if (node.nodes && node.nodes.length && node.last.raws.semicolon && !node.last.nodes) {
  8555. this.semicolon = true;
  8556. }
  8557. _get(LessParser.prototype.__proto__ || Object.getPrototypeOf(LessParser.prototype), 'end', this).call(this, token);
  8558. }
  8559. }, {
  8560. key: 'import',
  8561. value: function _import(token) {
  8562. /* eslint complexity: 0 */
  8563. var last = false,
  8564. open = false,
  8565. end = { line: 0, column: 0 };
  8566. var directives = [];
  8567. var node = new _import3.default();
  8568. node.name = token[1].slice(1);
  8569. this.init(node, token[2], token[3]);
  8570. this.pos += 1;
  8571. while (this.pos < this.tokens.length) {
  8572. var tokn = this.tokens[this.pos];
  8573. if (tokn[0] === ';') {
  8574. end = { line: tokn[2], column: tokn[3] };
  8575. node.raws.semicolon = true;
  8576. break;
  8577. } else if (tokn[0] === '{') {
  8578. open = true;
  8579. break;
  8580. } else if (tokn[0] === '}') {
  8581. this.end(tokn);
  8582. break;
  8583. } else if (tokn[0] === 'brackets') {
  8584. if (node.urlFunc) {
  8585. node.importPath = tokn[1].replace(/[()]/g, '');
  8586. } else {
  8587. directives.push(tokn);
  8588. }
  8589. } else if (tokn[0] === 'space') {
  8590. if (directives.length) {
  8591. node.raws.between = tokn[1];
  8592. } else if (node.urlFunc) {
  8593. node.raws.beforeUrl = tokn[1];
  8594. } else if (node.importPath) {
  8595. if (node.urlFunc) {
  8596. node.raws.afterUrl = tokn[1];
  8597. } else {
  8598. node.raws.after = tokn[1];
  8599. }
  8600. } else {
  8601. node.raws.afterName = tokn[1];
  8602. }
  8603. } else if (tokn[0] === 'word' && tokn[1] === 'url') {
  8604. node.urlFunc = true;
  8605. } else {
  8606. if (tokn[0] !== '(' && tokn[0] !== ')') {
  8607. node.importPath = tokn[1];
  8608. }
  8609. }
  8610. if (this.pos === this.tokens.length) {
  8611. last = true;
  8612. break;
  8613. }
  8614. this.pos += 1;
  8615. }
  8616. if (node.raws.between && !node.raws.afterName) {
  8617. node.raws.afterName = node.raws.between;
  8618. node.raws.between = '';
  8619. }
  8620. node.source.end = end;
  8621. if (directives.length) {
  8622. this.raw(node, 'directives', directives);
  8623. if (last) {
  8624. token = directives[directives.length - 1];
  8625. node.source.end = { line: token[4], column: token[5] };
  8626. this.spaces = node.raws.between;
  8627. node.raws.between = '';
  8628. }
  8629. } else {
  8630. node.directives = '';
  8631. }
  8632. if (open) {
  8633. node.nodes = [];
  8634. this.current = node;
  8635. }
  8636. }
  8637. /* eslint-disable max-statements, complexity */
  8638. }, {
  8639. key: 'other',
  8640. value: function other() {
  8641. var brackets = [];
  8642. var params = [];
  8643. var start = this.pos;
  8644. var end = false,
  8645. colon = false,
  8646. bracket = null;
  8647. // we need pass "()" as spaces
  8648. // However we can override method Parser.loop, but it seems less maintainable
  8649. if (this.tokens[start][0] === 'brackets') {
  8650. this.spaces += this.tokens[start][1];
  8651. return;
  8652. }
  8653. var mixin = (0, _isMixinToken2.default)(this.tokens[start]);
  8654. var extend = Boolean((0, _findExtendRule2.default)(this.tokens, start));
  8655. while (this.pos < this.tokens.length) {
  8656. var token = this.tokens[this.pos];
  8657. var type = token[0];
  8658. if (type === '(' || type === '[') {
  8659. if (!bracket) {
  8660. bracket = token;
  8661. }
  8662. brackets.push(type === '(' ? ')' : ']');
  8663. } else if (brackets.length === 0) {
  8664. if (type === ';') {
  8665. var foundEndOfRule = this.ruleEnd({
  8666. start: start,
  8667. params: params,
  8668. colon: colon,
  8669. mixin: mixin,
  8670. extend: extend
  8671. });
  8672. if (foundEndOfRule) {
  8673. return;
  8674. }
  8675. break;
  8676. } else if (type === '{') {
  8677. this.createRule({ start: start, params: params, mixin: mixin });
  8678. return;
  8679. } else if (type === '}') {
  8680. this.pos -= 1;
  8681. end = true;
  8682. break;
  8683. } else if (type === ':') {
  8684. colon = true;
  8685. }
  8686. } else if (type === brackets[brackets.length - 1]) {
  8687. brackets.pop();
  8688. if (brackets.length === 0) {
  8689. bracket = null;
  8690. }
  8691. }
  8692. // we don't want to add params for pseudo-selectors that utilize parens (#56)
  8693. // if ((extend || !colon) && (brackets.length > 0 || type === 'brackets' || params[0])) {
  8694. // params.push(token);
  8695. // }
  8696. // we don't want to add params for pseudo-selectors that utilize parens (#56) or bracket selectors (#96)
  8697. if ((extend || !colon) && (brackets.length > 0 || type === 'brackets' || params[0]) && brackets[0] !== ']') {
  8698. params.push(token);
  8699. }
  8700. this.pos += 1;
  8701. }
  8702. if (this.pos === this.tokens.length) {
  8703. this.pos -= 1;
  8704. end = true;
  8705. }
  8706. if (brackets.length > 0) {
  8707. this.unclosedBracket(bracket);
  8708. }
  8709. // dont process an end of rule if there's only one token and it's unknown (#64)
  8710. if (end && this.tokens.length > 1) {
  8711. // Handle the case where the there is only a single token in the end rule.
  8712. if (start === this.pos) {
  8713. this.pos += 1;
  8714. }
  8715. var _foundEndOfRule = this.ruleEnd({
  8716. start: start,
  8717. params: params,
  8718. colon: colon,
  8719. mixin: mixin,
  8720. extend: extend,
  8721. isEndOfBlock: true
  8722. });
  8723. if (_foundEndOfRule) {
  8724. return;
  8725. }
  8726. }
  8727. this.unknownWord(start);
  8728. }
  8729. }, {
  8730. key: 'rule',
  8731. value: function rule(tokens) {
  8732. tokens.pop();
  8733. var node = new _rule2.default();
  8734. this.init(node, tokens[0][2], tokens[0][3]);
  8735. //node.raws.between = this.spacesFromEnd(tokens);
  8736. node.raws.between = this.spacesAndCommentsFromEnd(tokens);
  8737. this.raw(node, 'selector', tokens);
  8738. this.current = node;
  8739. return node;
  8740. }
  8741. }, {
  8742. key: 'ruleEnd',
  8743. value: function ruleEnd(options) {
  8744. var start = options.start;
  8745. if (options.extend || options.mixin) {
  8746. this.createRule(Object.assign(options, { empty: true }));
  8747. return true;
  8748. }
  8749. if (options.colon) {
  8750. if (options.isEndOfBlock) {
  8751. while (this.pos > start) {
  8752. var token = this.tokens[this.pos][0];
  8753. if (token !== 'space' && token !== 'comment') {
  8754. break;
  8755. }
  8756. this.pos -= 1;
  8757. }
  8758. }
  8759. this.createDeclaration({ start: start });
  8760. return true;
  8761. }
  8762. return false;
  8763. }
  8764. }, {
  8765. key: 'tokenize',
  8766. value: function tokenize() {
  8767. this.tokens = (0, _lessTokenize2.default)(this.input);
  8768. }
  8769. /* eslint-enable max-statements, complexity */
  8770. }]);
  8771. return LessParser;
  8772. }(_parser2.default);
  8773. exports.default = LessParser;
  8774. module.exports = exports['default'];
  8775. /***/ }),
  8776. /* 43 */
  8777. /***/ (function(module, exports, __webpack_require__) {
  8778. "use strict";
  8779. module.exports = function () {
  8780. return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
  8781. };
  8782. /***/ }),
  8783. /* 44 */
  8784. /***/ (function(module, exports) {
  8785. module.exports = function flatten(list, depth) {
  8786. depth = (typeof depth == 'number') ? depth : Infinity;
  8787. if (!depth) {
  8788. if (Array.isArray(list)) {
  8789. return list.map(function(i) { return i; });
  8790. }
  8791. return list;
  8792. }
  8793. return _flatten(list, 1);
  8794. function _flatten(list, d) {
  8795. return list.reduce(function (acc, item) {
  8796. if (Array.isArray(item) && d < depth) {
  8797. return acc.concat(_flatten(item, d + 1));
  8798. }
  8799. else {
  8800. return acc.concat(item);
  8801. }
  8802. }, []);
  8803. }
  8804. };
  8805. /***/ }),
  8806. /* 45 */
  8807. /***/ (function(module, exports, __webpack_require__) {
  8808. "use strict";
  8809. module.exports = function(name, options) {
  8810. var engine = options.engines[name] || options.engines[aliase(name)];
  8811. if (typeof engine === 'undefined') {
  8812. throw new Error('gray-matter engine "' + name + '" is not registered');
  8813. }
  8814. if (typeof engine === 'function') {
  8815. engine = { parse: engine };
  8816. }
  8817. return engine;
  8818. };
  8819. function aliase(name) {
  8820. switch (name.toLowerCase()) {
  8821. case 'js':
  8822. case 'javascript':
  8823. return 'javascript';
  8824. case 'coffee':
  8825. case 'coffeescript':
  8826. case 'cson':
  8827. return 'coffee';
  8828. case 'yaml':
  8829. case 'yml':
  8830. return 'yaml';
  8831. default: {
  8832. return name;
  8833. }
  8834. }
  8835. }
  8836. /***/ }),
  8837. /* 46 */
  8838. /***/ (function(module, exports, __webpack_require__) {
  8839. "use strict";
  8840. var extend = __webpack_require__(18);
  8841. var yaml = __webpack_require__(122);
  8842. /**
  8843. * Default engines
  8844. */
  8845. var engines = exports = module.exports;
  8846. /**
  8847. * YAML
  8848. */
  8849. engines.yaml = {
  8850. parse: yaml.safeLoad.bind(yaml),
  8851. stringify: yaml.safeDump.bind(yaml)
  8852. };
  8853. /**
  8854. * JSON
  8855. */
  8856. engines.json = {
  8857. parse: JSON.parse.bind(JSON),
  8858. stringify: function(obj, options) {
  8859. var opts = extend({replacer: null, space: 2}, options);
  8860. return JSON.stringify(obj, opts.replacer, opts.space);
  8861. }
  8862. };
  8863. /**
  8864. * JavaScript
  8865. */
  8866. engines.javascript = {
  8867. parse: function parse(str, options, wrap) {
  8868. /* eslint no-eval: 0 */
  8869. try {
  8870. if (wrap !== false) {
  8871. str = '(function() {\nreturn ' + str.trim() + ';\n}());';
  8872. }
  8873. return eval(str) || {};
  8874. } catch (err) {
  8875. if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) {
  8876. return parse(str, options, false);
  8877. }
  8878. throw new SyntaxError(err);
  8879. }
  8880. },
  8881. stringify: function() {
  8882. throw new Error('stringifying JavaScript is not supported');
  8883. }
  8884. };
  8885. /***/ }),
  8886. /* 47 */
  8887. /***/ (function(module, exports, __webpack_require__) {
  8888. "use strict";
  8889. var extend = __webpack_require__(18);
  8890. var typeOf = __webpack_require__(25);
  8891. var getEngine = __webpack_require__(45);
  8892. var defaults = __webpack_require__(19);
  8893. module.exports = function(file, data, options) {
  8894. if (data == null && options == null) {
  8895. switch (typeOf(file)) {
  8896. case 'object':
  8897. data = file.data;
  8898. options = {};
  8899. break;
  8900. case 'string':
  8901. return file;
  8902. default: {
  8903. throw new TypeError('expected file to be a string or object');
  8904. }
  8905. }
  8906. }
  8907. var str = file.content;
  8908. var opts = defaults(options);
  8909. if (data == null) {
  8910. if (!opts.data) {
  8911. return file;
  8912. }
  8913. data = opts.data;
  8914. }
  8915. var language = file.language || opts.language;
  8916. var engine = getEngine(language, opts);
  8917. if (typeof engine.stringify !== 'function') {
  8918. throw new TypeError('expected "' + language + '.stringify" to be a function');
  8919. }
  8920. data = extend({}, file.data, data);
  8921. var open = opts.delimiters[0];
  8922. var close = opts.delimiters[1];
  8923. var matter = engine.stringify(data, options).trim();
  8924. var buf = '';
  8925. if (matter !== '{}') {
  8926. buf = newline(open) + newline(matter) + newline(close);
  8927. }
  8928. if (typeof file.excerpt === 'string' && file.excerpt !== '') {
  8929. if (str.indexOf(file.excerpt.trim()) === -1) {
  8930. buf += newline(file.excerpt) + newline(close);
  8931. }
  8932. }
  8933. return buf + newline(str);
  8934. };
  8935. function newline(str) {
  8936. return str.slice(-1) !== '\n' ? str + '\n' : str;
  8937. }
  8938. /***/ }),
  8939. /* 48 */
  8940. /***/ (function(module, exports) {
  8941. module.exports = function (ary, item) {
  8942. var i = -1, indexes = []
  8943. while((i = ary.indexOf(item, i + 1)) !== -1)
  8944. indexes.push(i)
  8945. return indexes
  8946. }
  8947. /***/ }),
  8948. /* 49 */
  8949. /***/ (function(module, exports, __webpack_require__) {
  8950. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
  8951. * $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
  8952. *
  8953. * Licensed under the BSD 3-Clause License.
  8954. * http://opensource.org/licenses/BSD-3-Clause
  8955. *
  8956. * References:
  8957. * http://en.wikipedia.org/wiki/Base64
  8958. */
  8959. (function(global) {
  8960. 'use strict';
  8961. // existing version for noConflict()
  8962. var _Base64 = global.Base64;
  8963. var version = "2.3.2";
  8964. // if node.js, we use Buffer
  8965. var buffer;
  8966. if (typeof module !== 'undefined' && module.exports) {
  8967. try {
  8968. buffer = __webpack_require__(10).Buffer;
  8969. } catch (err) {}
  8970. }
  8971. // constants
  8972. var b64chars
  8973. = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  8974. var b64tab = function(bin) {
  8975. var t = {};
  8976. for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
  8977. return t;
  8978. }(b64chars);
  8979. var fromCharCode = String.fromCharCode;
  8980. // encoder stuff
  8981. var cb_utob = function(c) {
  8982. if (c.length < 2) {
  8983. var cc = c.charCodeAt(0);
  8984. return cc < 0x80 ? c
  8985. : cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
  8986. + fromCharCode(0x80 | (cc & 0x3f)))
  8987. : (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
  8988. + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
  8989. + fromCharCode(0x80 | ( cc & 0x3f)));
  8990. } else {
  8991. var cc = 0x10000
  8992. + (c.charCodeAt(0) - 0xD800) * 0x400
  8993. + (c.charCodeAt(1) - 0xDC00);
  8994. return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
  8995. + fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
  8996. + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
  8997. + fromCharCode(0x80 | ( cc & 0x3f)));
  8998. }
  8999. };
  9000. var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
  9001. var utob = function(u) {
  9002. return u.replace(re_utob, cb_utob);
  9003. };
  9004. var cb_encode = function(ccc) {
  9005. var padlen = [0, 2, 1][ccc.length % 3],
  9006. ord = ccc.charCodeAt(0) << 16
  9007. | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
  9008. | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
  9009. chars = [
  9010. b64chars.charAt( ord >>> 18),
  9011. b64chars.charAt((ord >>> 12) & 63),
  9012. padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
  9013. padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
  9014. ];
  9015. return chars.join('');
  9016. };
  9017. var btoa = global.btoa ? function(b) {
  9018. return global.btoa(b);
  9019. } : function(b) {
  9020. return b.replace(/[\s\S]{1,3}/g, cb_encode);
  9021. };
  9022. var _encode = buffer ?
  9023. buffer.from && buffer.from !== Uint8Array.from ? function (u) {
  9024. return (u.constructor === buffer.constructor ? u : buffer.from(u))
  9025. .toString('base64')
  9026. }
  9027. : function (u) {
  9028. return (u.constructor === buffer.constructor ? u : new buffer(u))
  9029. .toString('base64')
  9030. }
  9031. : function (u) { return btoa(utob(u)) }
  9032. ;
  9033. var encode = function(u, urisafe) {
  9034. return !urisafe
  9035. ? _encode(String(u))
  9036. : _encode(String(u)).replace(/[+\/]/g, function(m0) {
  9037. return m0 == '+' ? '-' : '_';
  9038. }).replace(/=/g, '');
  9039. };
  9040. var encodeURI = function(u) { return encode(u, true) };
  9041. // decoder stuff
  9042. var re_btou = new RegExp([
  9043. '[\xC0-\xDF][\x80-\xBF]',
  9044. '[\xE0-\xEF][\x80-\xBF]{2}',
  9045. '[\xF0-\xF7][\x80-\xBF]{3}'
  9046. ].join('|'), 'g');
  9047. var cb_btou = function(cccc) {
  9048. switch(cccc.length) {
  9049. case 4:
  9050. var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
  9051. | ((0x3f & cccc.charCodeAt(1)) << 12)
  9052. | ((0x3f & cccc.charCodeAt(2)) << 6)
  9053. | (0x3f & cccc.charCodeAt(3)),
  9054. offset = cp - 0x10000;
  9055. return (fromCharCode((offset >>> 10) + 0xD800)
  9056. + fromCharCode((offset & 0x3FF) + 0xDC00));
  9057. case 3:
  9058. return fromCharCode(
  9059. ((0x0f & cccc.charCodeAt(0)) << 12)
  9060. | ((0x3f & cccc.charCodeAt(1)) << 6)
  9061. | (0x3f & cccc.charCodeAt(2))
  9062. );
  9063. default:
  9064. return fromCharCode(
  9065. ((0x1f & cccc.charCodeAt(0)) << 6)
  9066. | (0x3f & cccc.charCodeAt(1))
  9067. );
  9068. }
  9069. };
  9070. var btou = function(b) {
  9071. return b.replace(re_btou, cb_btou);
  9072. };
  9073. var cb_decode = function(cccc) {
  9074. var len = cccc.length,
  9075. padlen = len % 4,
  9076. n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
  9077. | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
  9078. | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
  9079. | (len > 3 ? b64tab[cccc.charAt(3)] : 0),
  9080. chars = [
  9081. fromCharCode( n >>> 16),
  9082. fromCharCode((n >>> 8) & 0xff),
  9083. fromCharCode( n & 0xff)
  9084. ];
  9085. chars.length -= [0, 0, 2, 1][padlen];
  9086. return chars.join('');
  9087. };
  9088. var atob = global.atob ? function(a) {
  9089. return global.atob(a);
  9090. } : function(a){
  9091. return a.replace(/[\s\S]{1,4}/g, cb_decode);
  9092. };
  9093. var _decode = buffer ?
  9094. buffer.from && buffer.from !== Uint8Array.from ? function(a) {
  9095. return (a.constructor === buffer.constructor
  9096. ? a : buffer.from(a, 'base64')).toString();
  9097. }
  9098. : function(a) {
  9099. return (a.constructor === buffer.constructor
  9100. ? a : new buffer(a, 'base64')).toString();
  9101. }
  9102. : function(a) { return btou(atob(a)) };
  9103. var decode = function(a){
  9104. return _decode(
  9105. String(a).replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' })
  9106. .replace(/[^A-Za-z0-9\+\/]/g, '')
  9107. );
  9108. };
  9109. var noConflict = function() {
  9110. var Base64 = global.Base64;
  9111. global.Base64 = _Base64;
  9112. return Base64;
  9113. };
  9114. // export Base64
  9115. global.Base64 = {
  9116. VERSION: version,
  9117. atob: atob,
  9118. btoa: btoa,
  9119. fromBase64: decode,
  9120. toBase64: encode,
  9121. utob: utob,
  9122. encode: encode,
  9123. encodeURI: encodeURI,
  9124. btou: btou,
  9125. decode: decode,
  9126. noConflict: noConflict
  9127. };
  9128. // if ES5 is available, make Base64.extendString() available
  9129. if (typeof Object.defineProperty === 'function') {
  9130. var noEnum = function(v){
  9131. return {value:v,enumerable:false,writable:true,configurable:true};
  9132. };
  9133. global.Base64.extendString = function () {
  9134. Object.defineProperty(
  9135. String.prototype, 'fromBase64', noEnum(function () {
  9136. return decode(this)
  9137. }));
  9138. Object.defineProperty(
  9139. String.prototype, 'toBase64', noEnum(function (urisafe) {
  9140. return encode(this, urisafe)
  9141. }));
  9142. Object.defineProperty(
  9143. String.prototype, 'toBase64URI', noEnum(function () {
  9144. return encode(this, true)
  9145. }));
  9146. };
  9147. }
  9148. //
  9149. // export Base64 to the namespace
  9150. //
  9151. if (global['Meteor']) { // Meteor.js
  9152. Base64 = global.Base64;
  9153. }
  9154. // module.exports and AMD are mutually exclusive.
  9155. // module.exports has precedence.
  9156. if (typeof module !== 'undefined' && module.exports) {
  9157. module.exports.Base64 = global.Base64;
  9158. }
  9159. else if (true) {
  9160. // AMD. Register as an anonymous module.
  9161. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function(){ return global.Base64 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  9162. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  9163. }
  9164. // that's it!
  9165. })( typeof self !== 'undefined' ? self
  9166. : typeof window !== 'undefined' ? window
  9167. : typeof global !== 'undefined' ? global
  9168. : this
  9169. );
  9170. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(41)))
  9171. /***/ }),
  9172. /* 50 */
  9173. /***/ (function(module, exports, __webpack_require__) {
  9174. "use strict";
  9175. // Standard YAML's Core schema.
  9176. // http://www.yaml.org/spec/1.2/spec.html#id2804923
  9177. //
  9178. // NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
  9179. // So, Core schema has no distinctions from JSON schema is JS-YAML.
  9180. var Schema = __webpack_require__(7);
  9181. module.exports = new Schema({
  9182. include: [
  9183. __webpack_require__(51)
  9184. ]
  9185. });
  9186. /***/ }),
  9187. /* 51 */
  9188. /***/ (function(module, exports, __webpack_require__) {
  9189. "use strict";
  9190. // Standard YAML's JSON schema.
  9191. // http://www.yaml.org/spec/1.2/spec.html#id2803231
  9192. //
  9193. // NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
  9194. // So, this schema is not such strict as defined in the YAML specification.
  9195. // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
  9196. var Schema = __webpack_require__(7);
  9197. module.exports = new Schema({
  9198. include: [
  9199. __webpack_require__(26)
  9200. ],
  9201. implicit: [
  9202. __webpack_require__(136),
  9203. __webpack_require__(128),
  9204. __webpack_require__(130),
  9205. __webpack_require__(129)
  9206. ]
  9207. });
  9208. /***/ }),
  9209. /* 52 */
  9210. /***/ (function(module, exports, __webpack_require__) {
  9211. "use strict";
  9212. Object.defineProperty(exports, "__esModule", {
  9213. value: true
  9214. });
  9215. var _Node = __webpack_require__(53);
  9216. var _Node2 = _interopRequireDefault(_Node);
  9217. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9218. function Container(opts) {
  9219. var _this = this;
  9220. this.constructor(opts);
  9221. this.nodes = opts.nodes;
  9222. if (this.after === undefined) {
  9223. this.after = this.nodes.length > 0 ? this.nodes[this.nodes.length - 1].after : '';
  9224. }
  9225. if (this.before === undefined) {
  9226. this.before = this.nodes.length > 0 ? this.nodes[0].before : '';
  9227. }
  9228. if (this.sourceIndex === undefined) {
  9229. this.sourceIndex = this.before.length;
  9230. }
  9231. this.nodes.forEach(function (node) {
  9232. node.parent = _this; // eslint-disable-line no-param-reassign
  9233. });
  9234. } /**
  9235. * A node that contains other nodes and support traversing over them
  9236. */
  9237. Container.prototype = Object.create(_Node2.default.prototype);
  9238. Container.constructor = _Node2.default;
  9239. /**
  9240. * Iterate over descendant nodes of the node
  9241. *
  9242. * @param {RegExp|string} filter - Optional. Only nodes with node.type that
  9243. * satisfies the filter will be traversed over
  9244. * @param {function} cb - callback to call on each node. Takes theese params:
  9245. * node - the node being processed, i - it's index, nodes - the array
  9246. * of all nodes
  9247. * If false is returned, the iteration breaks
  9248. *
  9249. * @return (boolean) false, if the iteration was broken
  9250. */
  9251. Container.prototype.walk = function walk(filter, cb) {
  9252. var hasFilter = typeof filter === 'string' || filter instanceof RegExp;
  9253. var callback = hasFilter ? cb : filter;
  9254. var filterReg = typeof filter === 'string' ? new RegExp(filter) : filter;
  9255. for (var i = 0; i < this.nodes.length; i++) {
  9256. var node = this.nodes[i];
  9257. var filtered = hasFilter ? filterReg.test(node.type) : true;
  9258. if (filtered && callback && callback(node, i, this.nodes) === false) {
  9259. return false;
  9260. }
  9261. if (node.nodes && node.walk(filter, cb) === false) {
  9262. return false;
  9263. }
  9264. }
  9265. return true;
  9266. };
  9267. /**
  9268. * Iterate over immediate children of the node
  9269. *
  9270. * @param {function} cb - callback to call on each node. Takes theese params:
  9271. * node - the node being processed, i - it's index, nodes - the array
  9272. * of all nodes
  9273. * If false is returned, the iteration breaks
  9274. *
  9275. * @return (boolean) false, if the iteration was broken
  9276. */
  9277. Container.prototype.each = function each() {
  9278. var cb = arguments.length <= 0 || arguments[0] === undefined ? function () {} : arguments[0];
  9279. for (var i = 0; i < this.nodes.length; i++) {
  9280. var node = this.nodes[i];
  9281. if (cb(node, i, this.nodes) === false) {
  9282. return false;
  9283. }
  9284. }
  9285. return true;
  9286. };
  9287. exports.default = Container;
  9288. /***/ }),
  9289. /* 53 */
  9290. /***/ (function(module, exports, __webpack_require__) {
  9291. "use strict";
  9292. Object.defineProperty(exports, "__esModule", {
  9293. value: true
  9294. });
  9295. /**
  9296. * A very generic node. Pretty much any element of a media query
  9297. */
  9298. function Node(opts) {
  9299. this.after = opts.after;
  9300. this.before = opts.before;
  9301. this.type = opts.type;
  9302. this.value = opts.value;
  9303. this.sourceIndex = opts.sourceIndex;
  9304. }
  9305. exports.default = Node;
  9306. /***/ }),
  9307. /* 54 */
  9308. /***/ (function(module, exports, __webpack_require__) {
  9309. "use strict";
  9310. exports.__esModule = true;
  9311. var _supportsColor = __webpack_require__(218);
  9312. var _supportsColor2 = _interopRequireDefault(_supportsColor);
  9313. var _chalk = __webpack_require__(104);
  9314. var _chalk2 = _interopRequireDefault(_chalk);
  9315. var _terminalHighlight = __webpack_require__(176);
  9316. var _terminalHighlight2 = _interopRequireDefault(_terminalHighlight);
  9317. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9318. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9319. /**
  9320. * The CSS parser throws this error for broken CSS.
  9321. *
  9322. * Custom parsers can throw this error for broken custom syntax using
  9323. * the {@link Node#error} method.
  9324. *
  9325. * PostCSS will use the input source map to detect the original error location.
  9326. * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
  9327. * PostCSS will show the original position in the Sass file.
  9328. *
  9329. * If you need the position in the PostCSS input
  9330. * (e.g., to debug the previous compiler), use `error.input.file`.
  9331. *
  9332. * @example
  9333. * // Catching and checking syntax error
  9334. * try {
  9335. * postcss.parse('a{')
  9336. * } catch (error) {
  9337. * if ( error.name === 'CssSyntaxError' ) {
  9338. * error //=> CssSyntaxError
  9339. * }
  9340. * }
  9341. *
  9342. * @example
  9343. * // Raising error from plugin
  9344. * throw node.error('Unknown variable', { plugin: 'postcss-vars' });
  9345. */
  9346. var CssSyntaxError = function () {
  9347. /**
  9348. * @param {string} message - error message
  9349. * @param {number} [line] - source line of the error
  9350. * @param {number} [column] - source column of the error
  9351. * @param {string} [source] - source code of the broken file
  9352. * @param {string} [file] - absolute path to the broken file
  9353. * @param {string} [plugin] - PostCSS plugin name, if error came from plugin
  9354. */
  9355. function CssSyntaxError(message, line, column, source, file, plugin) {
  9356. _classCallCheck(this, CssSyntaxError);
  9357. /**
  9358. * @member {string} - Always equal to `'CssSyntaxError'`. You should
  9359. * always check error type
  9360. * by `error.name === 'CssSyntaxError'` instead of
  9361. * `error instanceof CssSyntaxError`, because
  9362. * npm could have several PostCSS versions.
  9363. *
  9364. * @example
  9365. * if ( error.name === 'CssSyntaxError' ) {
  9366. * error //=> CssSyntaxError
  9367. * }
  9368. */
  9369. this.name = 'CssSyntaxError';
  9370. /**
  9371. * @member {string} - Error message.
  9372. *
  9373. * @example
  9374. * error.message //=> 'Unclosed block'
  9375. */
  9376. this.reason = message;
  9377. if (file) {
  9378. /**
  9379. * @member {string} - Absolute path to the broken file.
  9380. *
  9381. * @example
  9382. * error.file //=> 'a.sass'
  9383. * error.input.file //=> 'a.css'
  9384. */
  9385. this.file = file;
  9386. }
  9387. if (source) {
  9388. /**
  9389. * @member {string} - Source code of the broken file.
  9390. *
  9391. * @example
  9392. * error.source //=> 'a { b {} }'
  9393. * error.input.column //=> 'a b { }'
  9394. */
  9395. this.source = source;
  9396. }
  9397. if (plugin) {
  9398. /**
  9399. * @member {string} - Plugin name, if error came from plugin.
  9400. *
  9401. * @example
  9402. * error.plugin //=> 'postcss-vars'
  9403. */
  9404. this.plugin = plugin;
  9405. }
  9406. if (typeof line !== 'undefined' && typeof column !== 'undefined') {
  9407. /**
  9408. * @member {number} - Source line of the error.
  9409. *
  9410. * @example
  9411. * error.line //=> 2
  9412. * error.input.line //=> 4
  9413. */
  9414. this.line = line;
  9415. /**
  9416. * @member {number} - Source column of the error.
  9417. *
  9418. * @example
  9419. * error.column //=> 1
  9420. * error.input.column //=> 4
  9421. */
  9422. this.column = column;
  9423. }
  9424. this.setMessage();
  9425. if (Error.captureStackTrace) {
  9426. Error.captureStackTrace(this, CssSyntaxError);
  9427. }
  9428. }
  9429. CssSyntaxError.prototype.setMessage = function setMessage() {
  9430. /**
  9431. * @member {string} - Full error text in the GNU error format
  9432. * with plugin, file, line and column.
  9433. *
  9434. * @example
  9435. * error.message //=> 'a.css:1:1: Unclosed block'
  9436. */
  9437. this.message = this.plugin ? this.plugin + ': ' : '';
  9438. this.message += this.file ? this.file : '<css input>';
  9439. if (typeof this.line !== 'undefined') {
  9440. this.message += ':' + this.line + ':' + this.column;
  9441. }
  9442. this.message += ': ' + this.reason;
  9443. };
  9444. /**
  9445. * Returns a few lines of CSS source that caused the error.
  9446. *
  9447. * If the CSS has an input source map without `sourceContent`,
  9448. * this method will return an empty string.
  9449. *
  9450. * @param {boolean} [color] whether arrow will be colored red by terminal
  9451. * color codes. By default, PostCSS will detect
  9452. * color support by `process.stdout.isTTY`
  9453. * and `process.env.NODE_DISABLE_COLORS`.
  9454. *
  9455. * @example
  9456. * error.showSourceCode() //=> " 4 | }
  9457. * // 5 | a {
  9458. * // > 6 | bad
  9459. * // | ^
  9460. * // 7 | }
  9461. * // 8 | b {"
  9462. *
  9463. * @return {string} few lines of CSS source that caused the error
  9464. */
  9465. CssSyntaxError.prototype.showSourceCode = function showSourceCode(color) {
  9466. var _this = this;
  9467. if (!this.source) return '';
  9468. var css = this.source;
  9469. if (typeof color === 'undefined') color = _supportsColor2.default.stdout;
  9470. if (color) css = (0, _terminalHighlight2.default)(css);
  9471. var lines = css.split(/\r?\n/);
  9472. var start = Math.max(this.line - 3, 0);
  9473. var end = Math.min(this.line + 2, lines.length);
  9474. var maxWidth = String(end).length;
  9475. function mark(text) {
  9476. if (color && _chalk2.default.red) {
  9477. return _chalk2.default.red.bold(text);
  9478. } else {
  9479. return text;
  9480. }
  9481. }
  9482. function aside(text) {
  9483. if (color && _chalk2.default.gray) {
  9484. return _chalk2.default.gray(text);
  9485. } else {
  9486. return text;
  9487. }
  9488. }
  9489. return lines.slice(start, end).map(function (line, index) {
  9490. var number = start + 1 + index;
  9491. var gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ';
  9492. if (number === _this.line) {
  9493. var spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, _this.column - 1).replace(/[^\t]/g, ' ');
  9494. return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^');
  9495. } else {
  9496. return ' ' + aside(gutter) + line;
  9497. }
  9498. }).join('\n');
  9499. };
  9500. /**
  9501. * Returns error position, message and source code of the broken part.
  9502. *
  9503. * @example
  9504. * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
  9505. * // > 1 | a {
  9506. * // | ^"
  9507. *
  9508. * @return {string} error position, message and source code
  9509. */
  9510. CssSyntaxError.prototype.toString = function toString() {
  9511. var code = this.showSourceCode();
  9512. if (code) {
  9513. code = '\n\n' + code + '\n';
  9514. }
  9515. return this.name + ': ' + this.message + code;
  9516. };
  9517. /**
  9518. * @memberof CssSyntaxError#
  9519. * @member {Input} input - Input object with PostCSS internal information
  9520. * about input file. If input has source map
  9521. * from previous tool, PostCSS will use origin
  9522. * (for example, Sass) source. You can use this
  9523. * object to get PostCSS input source.
  9524. *
  9525. * @example
  9526. * error.input.file //=> 'a.css'
  9527. * error.file //=> 'a.sass'
  9528. */
  9529. return CssSyntaxError;
  9530. }();
  9531. exports.default = CssSyntaxError;
  9532. module.exports = exports['default'];
  9533. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1zeW50YXgtZXJyb3IuZXM2Il0sIm5hbWVzIjpbIkNzc1N5bnRheEVycm9yIiwibWVzc2FnZSIsImxpbmUiLCJjb2x1bW4iLCJzb3VyY2UiLCJmaWxlIiwicGx1Z2luIiwibmFtZSIsInJlYXNvbiIsInNldE1lc3NhZ2UiLCJFcnJvciIsImNhcHR1cmVTdGFja1RyYWNlIiwic2hvd1NvdXJjZUNvZGUiLCJjb2xvciIsImNzcyIsInN0ZG91dCIsImxpbmVzIiwic3BsaXQiLCJzdGFydCIsIk1hdGgiLCJtYXgiLCJlbmQiLCJtaW4iLCJsZW5ndGgiLCJtYXhXaWR0aCIsIlN0cmluZyIsIm1hcmsiLCJ0ZXh0IiwicmVkIiwiYm9sZCIsImFzaWRlIiwiZ3JheSIsInNsaWNlIiwibWFwIiwiaW5kZXgiLCJudW1iZXIiLCJndXR0ZXIiLCJzc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kge1xuICAgICAgICAgKiAgIGVycm9yIC8vPT4gQ3NzU3ludGF4RXJyb3JcbiAgICAgICAgICogfVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5uYW1lID0gJ0Nzc1N5bnRheEVycm9yJztcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBFcnJvciBtZXNzYWdlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiBlcnJvci5tZXNzYWdlIC8vPT4gJ1VuY2xvc2VkIGJsb2NrJ1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yZWFzb24gPSBtZXNzYWdlO1xuXG4gICAgICAgIGlmICggZmlsZSApIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIEFic29sdXRlIHBhdGggdG8gdGhlIGJyb2tlbiBmaWxlLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiBlcnJvci5maWxlICAgICAgIC8vPT4gJ2Euc2FzcydcbiAgICAgICAgICAgICAqIGVycm9yLmlucHV0LmZpbGUgLy89PiAnYS5jc3MnXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuZmlsZSA9IGZpbGU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCBzb3VyY2UgKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBTb3VyY2UgY29kZSBvZiB0aGUgYnJva2VuIGZpbGUuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLnNvdXJjZSAgICAgICAvLz0+ICdhIHsgYiB7fSB9J1xuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQuY29sdW1uIC8vPT4gJ2EgYiB7IH0nXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuc291cmNlID0gc291cmNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICggcGx1Z2luICkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gUGx1Z2luIG5hbWUsIGlmIGVycm9yIGNhbWUgZnJvbSBwbHVnaW4uXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLnBsdWdpbiAvLz0+ICdwb3N0Y3NzLXZhcnMnXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMucGx1Z2luID0gcGx1Z2luO1xuICAgICAgICB9XG4gICAgICAgIGlmICggdHlwZW9mIGxpbmUgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBjb2x1bW4gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gU291cmNlIGxpbmUgb2YgdGhlIGVycm9yLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiBlcnJvci5saW5lICAgICAgIC8vPT4gMlxuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQubGluZSAvLz0+IDRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5saW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gU291cmNlIGNvbHVtbiBvZiB0aGUgZXJyb3IuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLmNvbHVtbiAgICAgICAvLz0+IDFcbiAgICAgICAgICAgICAqIGVycm9yLmlucHV0LmNvbHVtbiAvLz0+IDRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5jb2x1bW4gPSBjb2x1bW47XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNldE1lc3NhZ2UoKTtcblxuICAgICAgICBpZiAoIEVycm9yLmNhcHR1cmVTdGFja1RyYWNlICkge1xuICAgICAgICAgICAgRXJyb3IuY2FwdHVyZVN0YWNrVHJhY2UodGhpcywgQ3NzU3ludGF4RXJyb3IpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2V0TWVzc2FnZSgpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBGdWxsIGVycm9yIHRleHQgaW4gdGhlIEdOVSBlcnJvciBmb3JtYXRcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgIHdpdGggcGx1Z2luLCBmaWxlLCBsaW5lIGFuZCBjb2x1bW4uXG4gICAgICAgICAqXG4gICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAqIGVycm9yLm1lc3NhZ2UgLy89PiAnYS5jc3M6MToxOiBVbmNsb3NlZCBibG9jaydcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubWVzc2FnZSAgPSB0aGlzLnBsdWdpbiA/IHRoaXMucGx1Z2luICsgJzogJyA6ICcnO1xuICAgICAgICB0aGlzLm1lc3NhZ2UgKz0gdGhpcy5maWxlID8gdGhpcy5maWxlIDogJzxjc3MgaW5wdXQ+JztcbiAgICAgICAgaWYgKCB0eXBlb2YgdGhpcy5saW5lICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHRoaXMubWVzc2FnZSArPSAnOicgKyB0aGlzLmxpbmUgKyAnOicgKyB0aGlzLmNvbHVtbjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm1lc3NhZ2UgKz0gJzogJyArIHRoaXMucmVhc29uO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSBmZXcgbGluZXMgb2YgQ1NTIHNvdXJjZSB0aGF0IGNhdXNlZCB0aGUgZXJyb3IuXG4gICAgICpcbiAgICAgKiBJZiB0aGUgQ1NTIGhhcyBhbiBpbnB1dCBzb3VyY2UgbWFwIHdpdGhvdXQgYHNvdXJjZUNvbnRlbnRgLFxuICAgICAqIHRoaXMgbWV0aG9kIHdpbGwgcmV0dXJuIGFuIGVtcHR5IHN0cmluZy5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gW2NvbG9yXSB3aGV0aGVyIGFycm93IHdpbGwgYmUgY29sb3JlZCByZWQgYnkgdGVybWluYWxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgY29kZXMuIEJ5IGRlZmF1bHQsIFBvc3RDU1Mgd2lsbCBkZXRlY3RcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3Igc3VwcG9ydCBieSBgcHJvY2Vzcy5zdGRvdXQuaXNUVFlgXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCBgcHJvY2Vzcy5lbnYuTk9ERV9ESVNBQkxFX0NPTE9SU2AuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGVycm9yLnNob3dTb3VyY2VDb2RlKCkgLy89PiBcIiAgNCB8IH1cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgNSB8IGEge1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgPiA2IHwgICBiYWRcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICB8ICAgXlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICA3IHwgfVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICA4IHwgYiB7XCJcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gZmV3IGxpbmVzIG9mIENTUyBzb3VyY2UgdGhhdCBjYXVzZWQgdGhlIGVycm9yXG4gICAgICovXG4gICAgc2hvd1NvdXJjZUNvZGUoY29sb3IpIH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bmUsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICBsZXQgbnVtYmVyID0gc3RhcnQgKyAxICsgaW5kZXg7XG4gICAgICAgICAgICBsZXQgZ3V0dGVyID0gJyAnICsgKCcgJyArIG51bWJlcikuc2xpY2UoLW1heFdpZHRoKSArICcgfCAnO1xuICAgICAgICAgICAgaWYgKCBudW1iZXIgPT09IHRoaXMubGluZSApIHtcbiAgICAgICAgICAgICAgICBsZXQgc3BhY2luZyA9XG4gICAgICAgICAgICAgICAgICAgIGFzaWRlKGd1dHRlci5yZXBsYWNlKC9cXGQvZywgJyAnKSkgK1xuICAgICAgICAgICAgICAgICAgICBsaW5lLnNsaWNlKDAsIHRoaXMuY29sdW1uIC0gMSkucmVwbGFjZSgvW15cXHRdL2csICcgJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hcmsoJz4nKSArIGFzaWRlKGd1dHRlcikgKyBsaW5lICsgJ1xcbiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgc3BhY2luZyArIG1hcmsoJ14nKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcgJyArIGFzaWRlKGd1dHRlcikgKyBsaW5lO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KS5qb2luKCdcXG4nKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGVycm9yIHBvc2l0aW9uLCBtZXNzYWdlIGFuZCBzb3VyY2UgY29kZSBvZiB0aGUgYnJva2VuIHBhcnQuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGVycm9yLnRvU3RyaW5nKCkgLy89PiBcIkNzc1N5bnRheEVycm9yOiBhcHAuY3NzOjE6MTogVW5jbG9zZWQgYmxvY2tcbiAgICAgKiAgICAgICAgICAgICAgICAgIC8vICAgID4gMSB8IGEge1xuICAgICAqICAgICAgICAgICAgICAgICAgLy8gICAgICAgIHwgXlwiXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IGVycm9yIHBvc2l0aW9uLCBtZXNzYWdlIGFuZCBzb3VyY2UgY29kZVxuICAgICAqL1xuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2hvd1NvdXJjZUNvZGUoKTtcbiAgICAgICAgaWYgKCBjb2RlICkge1xuICAgICAgICAgICAgY29kZSA9ICdcXG5cXG4nICsgY29kZSArICdcXG4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLm5hbWUgKyAnOiAnICsgdGhpcy5tZXNzYWdlICsgY29kZTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgQ3NzU3ludGF4RXJyb3IjXG4gICAgICogQG1lbWJlciB7SW5wdXR9IGlucHV0IC0gSW5wdXQgb2JqZWN0IHdpdGggUG9zdENTUyBpbnRlcm5hbCBpbmZvcm1hdGlvblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIGFib3V0IGlucHV0IGZpbGUuIElmIGlucHV0IGhhcyBzb3VyY2UgbWFwXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSBwcmV2aW91cyB0b29sLCBQb3N0Q1NTIHdpbGwgdXNlIG9yaWdpblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgZXhhbXBsZSwgU2Fzcykgc291cmNlLiBZb3UgY2FuIHVzZSB0aGlzXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0IHRvIGdldCBQb3N0Q1NTIGlucHV0IHNvdXJjZS5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogZXJyb3IuaW5wdXQuZmlsZSAvLz0+ICdhLmNzcydcbiAgICAgKiBlcnJvci5maWxlICAgICAgIC8vPT4gJ2Euc2FzcydcbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBDc3NTeW50YXhFcnJvcjtcbiJdfQ==
  9534. /***/ }),
  9535. /* 55 */
  9536. /***/ (function(module, exports, __webpack_require__) {
  9537. "use strict";
  9538. exports.__esModule = true;
  9539. var _node = __webpack_require__(30);
  9540. var _node2 = _interopRequireDefault(_node);
  9541. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9542. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9543. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9544. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9545. /**
  9546. * Represents a CSS declaration.
  9547. *
  9548. * @extends Node
  9549. *
  9550. * @example
  9551. * const root = postcss.parse('a { color: black }');
  9552. * const decl = root.first.first;
  9553. * decl.type //=> 'decl'
  9554. * decl.toString() //=> ' color: black'
  9555. */
  9556. var Declaration = function (_Node) {
  9557. _inherits(Declaration, _Node);
  9558. function Declaration(defaults) {
  9559. _classCallCheck(this, Declaration);
  9560. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  9561. _this.type = 'decl';
  9562. return _this;
  9563. }
  9564. /**
  9565. * @memberof Declaration#
  9566. * @member {string} prop - the declaration’s property name
  9567. *
  9568. * @example
  9569. * const root = postcss.parse('a { color: black }');
  9570. * const decl = root.first.first;
  9571. * decl.prop //=> 'color'
  9572. */
  9573. /**
  9574. * @memberof Declaration#
  9575. * @member {string} value - the declaration’s value
  9576. *
  9577. * @example
  9578. * const root = postcss.parse('a { color: black }');
  9579. * const decl = root.first.first;
  9580. * decl.value //=> 'black'
  9581. */
  9582. /**
  9583. * @memberof Declaration#
  9584. * @member {boolean} important - `true` if the declaration
  9585. * has an !important annotation.
  9586. *
  9587. * @example
  9588. * const root = postcss.parse('a { color: black !important; color: red }');
  9589. * root.first.first.important //=> true
  9590. * root.first.last.important //=> undefined
  9591. */
  9592. /**
  9593. * @memberof Declaration#
  9594. * @member {object} raws - Information to generate byte-to-byte equal
  9595. * node string as it was in the origin input.
  9596. *
  9597. * Every parser saves its own properties,
  9598. * but the default CSS parser uses:
  9599. *
  9600. * * `before`: the space symbols before the node. It also stores `*`
  9601. * and `_` symbols before the declaration (IE hack).
  9602. * * `between`: the symbols between the property and value
  9603. * for declarations.
  9604. * * `important`: the content of the important statement,
  9605. * if it is not just `!important`.
  9606. *
  9607. * PostCSS cleans declaration from comments and extra spaces,
  9608. * but it stores origin content in raws properties.
  9609. * As such, if you don’t change a declaration’s value,
  9610. * PostCSS will use the raw value with comments.
  9611. *
  9612. * @example
  9613. * const root = postcss.parse('a {\n color:black\n}')
  9614. * root.first.first.raws //=> { before: '\n ', between: ':' }
  9615. */
  9616. return Declaration;
  9617. }(_node2.default);
  9618. exports.default = Declaration;
  9619. module.exports = exports['default'];
  9620. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlY2xhcmF0aW9uLmVzNiJdLCJuYW1lcyI6WyJEZWNsYXJhdGlvbiIsImRlZmF1bHRzIiwidHlwZSJdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7Ozs7SUFXTUEsVzs7O0FBRUYsdUJBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxpREFDbEIsaUJBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLFVBQUtDLElBQUwsR0FBWSxNQUFaO0FBRmtCO0FBR3JCOztBQUVEOzs7Ozs7Ozs7O0FBVUE7Ozs7Ozs7Ozs7QUFVQTs7Ozs7Ozs7Ozs7QUFXQTs7Ozs7Ozs7Ozs7Ozs7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9622. /* 56 */
  9623. /***/ (function(module, exports, __webpack_require__) {
  9624. "use strict";
  9625. exports.__esModule = true;
  9626. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9627. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  9628. var _mapGenerator = __webpack_require__(172);
  9629. var _mapGenerator2 = _interopRequireDefault(_mapGenerator);
  9630. var _stringify2 = __webpack_require__(60);
  9631. var _stringify3 = _interopRequireDefault(_stringify2);
  9632. var _warnOnce = __webpack_require__(62);
  9633. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  9634. var _result = __webpack_require__(175);
  9635. var _result2 = _interopRequireDefault(_result);
  9636. var _parse = __webpack_require__(57);
  9637. var _parse2 = _interopRequireDefault(_parse);
  9638. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9639. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9640. function isPromise(obj) {
  9641. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.then === 'function';
  9642. }
  9643. /**
  9644. * A Promise proxy for the result of PostCSS transformations.
  9645. *
  9646. * A `LazyResult` instance is returned by {@link Processor#process}.
  9647. *
  9648. * @example
  9649. * const lazy = postcss([cssnext]).process(css);
  9650. */
  9651. var LazyResult = function () {
  9652. function LazyResult(processor, css, opts) {
  9653. _classCallCheck(this, LazyResult);
  9654. this.stringified = false;
  9655. this.processed = false;
  9656. var root = void 0;
  9657. if ((typeof css === 'undefined' ? 'undefined' : _typeof(css)) === 'object' && css !== null && css.type === 'root') {
  9658. root = css;
  9659. } else if (css instanceof LazyResult || css instanceof _result2.default) {
  9660. root = css.root;
  9661. if (css.map) {
  9662. if (typeof opts.map === 'undefined') opts.map = {};
  9663. if (!opts.map.inline) opts.map.inline = false;
  9664. opts.map.prev = css.map;
  9665. }
  9666. } else {
  9667. var parser = _parse2.default;
  9668. if (opts.syntax) parser = opts.syntax.parse;
  9669. if (opts.parser) parser = opts.parser;
  9670. if (parser.parse) parser = parser.parse;
  9671. try {
  9672. root = parser(css, opts);
  9673. } catch (error) {
  9674. this.error = error;
  9675. }
  9676. }
  9677. this.result = new _result2.default(processor, root, opts);
  9678. }
  9679. /**
  9680. * Returns a {@link Processor} instance, which will be used
  9681. * for CSS transformations.
  9682. * @type {Processor}
  9683. */
  9684. /**
  9685. * Processes input CSS through synchronous plugins
  9686. * and calls {@link Result#warnings()}.
  9687. *
  9688. * @return {Warning[]} warnings from plugins
  9689. */
  9690. LazyResult.prototype.warnings = function warnings() {
  9691. return this.sync().warnings();
  9692. };
  9693. /**
  9694. * Alias for the {@link LazyResult#css} property.
  9695. *
  9696. * @example
  9697. * lazy + '' === lazy.css;
  9698. *
  9699. * @return {string} output CSS
  9700. */
  9701. LazyResult.prototype.toString = function toString() {
  9702. return this.css;
  9703. };
  9704. /**
  9705. * Processes input CSS through synchronous and asynchronous plugins
  9706. * and calls `onFulfilled` with a Result instance. If a plugin throws
  9707. * an error, the `onRejected` callback will be executed.
  9708. *
  9709. * It implements standard Promise API.
  9710. *
  9711. * @param {onFulfilled} onFulfilled - callback will be executed
  9712. * when all plugins will finish work
  9713. * @param {onRejected} onRejected - callback will be executed on any error
  9714. *
  9715. * @return {Promise} Promise API to make queue
  9716. *
  9717. * @example
  9718. * postcss([cssnext]).process(css, { from: cssPath }).then(result => {
  9719. * console.log(result.css);
  9720. * });
  9721. */
  9722. LazyResult.prototype.then = function then(onFulfilled, onRejected) {
  9723. if (!('from' in this.opts)) {
  9724. (0, _warnOnce2.default)('Without `from` option PostCSS could generate wrong ' + 'source map and will not find Browserslist config. ' + 'Set it to CSS file path or to `undefined` to prevent ' + 'this warning.');
  9725. }
  9726. return this.async().then(onFulfilled, onRejected);
  9727. };
  9728. /**
  9729. * Processes input CSS through synchronous and asynchronous plugins
  9730. * and calls onRejected for each error thrown in any plugin.
  9731. *
  9732. * It implements standard Promise API.
  9733. *
  9734. * @param {onRejected} onRejected - callback will be executed on any error
  9735. *
  9736. * @return {Promise} Promise API to make queue
  9737. *
  9738. * @example
  9739. * postcss([cssnext]).process(css).then(result => {
  9740. * console.log(result.css);
  9741. * }).catch(error => {
  9742. * console.error(error);
  9743. * });
  9744. */
  9745. LazyResult.prototype.catch = function _catch(onRejected) {
  9746. return this.async().catch(onRejected);
  9747. };
  9748. LazyResult.prototype.handleError = function handleError(error, plugin) {
  9749. try {
  9750. this.error = error;
  9751. if (error.name === 'CssSyntaxError' && !error.plugin) {
  9752. error.plugin = plugin.postcssPlugin;
  9753. error.setMessage();
  9754. } else if (plugin.postcssVersion) {
  9755. var pluginName = plugin.postcssPlugin;
  9756. var pluginVer = plugin.postcssVersion;
  9757. var runtimeVer = this.result.processor.version;
  9758. var a = pluginVer.split('.');
  9759. var b = runtimeVer.split('.');
  9760. if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
  9761. console.error('Unknown error from PostCSS plugin. ' + 'Your current PostCSS version ' + 'is ' + runtimeVer + ', but ' + pluginName + ' ' + 'uses ' + pluginVer + '. Perhaps this is ' + 'the source of the error below.');
  9762. }
  9763. }
  9764. } catch (err) {
  9765. if (console && console.error) console.error(err);
  9766. }
  9767. };
  9768. LazyResult.prototype.asyncTick = function asyncTick(resolve, reject) {
  9769. var _this = this;
  9770. if (this.plugin >= this.processor.plugins.length) {
  9771. this.processed = true;
  9772. return resolve();
  9773. }
  9774. try {
  9775. var plugin = this.processor.plugins[this.plugin];
  9776. var promise = this.run(plugin);
  9777. this.plugin += 1;
  9778. if (isPromise(promise)) {
  9779. promise.then(function () {
  9780. _this.asyncTick(resolve, reject);
  9781. }).catch(function (error) {
  9782. _this.handleError(error, plugin);
  9783. _this.processed = true;
  9784. reject(error);
  9785. });
  9786. } else {
  9787. this.asyncTick(resolve, reject);
  9788. }
  9789. } catch (error) {
  9790. this.processed = true;
  9791. reject(error);
  9792. }
  9793. };
  9794. LazyResult.prototype.async = function async() {
  9795. var _this2 = this;
  9796. if (this.processed) {
  9797. return new Promise(function (resolve, reject) {
  9798. if (_this2.error) {
  9799. reject(_this2.error);
  9800. } else {
  9801. resolve(_this2.stringify());
  9802. }
  9803. });
  9804. }
  9805. if (this.processing) {
  9806. return this.processing;
  9807. }
  9808. this.processing = new Promise(function (resolve, reject) {
  9809. if (_this2.error) return reject(_this2.error);
  9810. _this2.plugin = 0;
  9811. _this2.asyncTick(resolve, reject);
  9812. }).then(function () {
  9813. _this2.processed = true;
  9814. return _this2.stringify();
  9815. });
  9816. return this.processing;
  9817. };
  9818. LazyResult.prototype.sync = function sync() {
  9819. if (this.processed) return this.result;
  9820. this.processed = true;
  9821. if (this.processing) {
  9822. throw new Error('Use process(css).then(cb) to work with async plugins');
  9823. }
  9824. if (this.error) throw this.error;
  9825. for (var _iterator = this.result.processor.plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9826. var _ref;
  9827. if (_isArray) {
  9828. if (_i >= _iterator.length) break;
  9829. _ref = _iterator[_i++];
  9830. } else {
  9831. _i = _iterator.next();
  9832. if (_i.done) break;
  9833. _ref = _i.value;
  9834. }
  9835. var plugin = _ref;
  9836. var promise = this.run(plugin);
  9837. if (isPromise(promise)) {
  9838. throw new Error('Use process(css).then(cb) to work with async plugins');
  9839. }
  9840. }
  9841. return this.result;
  9842. };
  9843. LazyResult.prototype.run = function run(plugin) {
  9844. this.result.lastPlugin = plugin;
  9845. try {
  9846. return plugin(this.result.root, this.result);
  9847. } catch (error) {
  9848. this.handleError(error, plugin);
  9849. throw error;
  9850. }
  9851. };
  9852. LazyResult.prototype.stringify = function stringify() {
  9853. if (this.stringified) return this.result;
  9854. this.stringified = true;
  9855. this.sync();
  9856. var opts = this.result.opts;
  9857. var str = _stringify3.default;
  9858. if (opts.syntax) str = opts.syntax.stringify;
  9859. if (opts.stringifier) str = opts.stringifier;
  9860. if (str.stringify) str = str.stringify;
  9861. var map = new _mapGenerator2.default(str, this.result.root, this.result.opts);
  9862. var data = map.generate();
  9863. this.result.css = data[0];
  9864. this.result.map = data[1];
  9865. return this.result;
  9866. };
  9867. _createClass(LazyResult, [{
  9868. key: 'processor',
  9869. get: function get() {
  9870. return this.result.processor;
  9871. }
  9872. /**
  9873. * Options from the {@link Processor#process} call.
  9874. * @type {processOptions}
  9875. */
  9876. }, {
  9877. key: 'opts',
  9878. get: function get() {
  9879. return this.result.opts;
  9880. }
  9881. /**
  9882. * Processes input CSS through synchronous plugins, converts `Root`
  9883. * to a CSS string and returns {@link Result#css}.
  9884. *
  9885. * This property will only work with synchronous plugins.
  9886. * If the processor contains any asynchronous plugins
  9887. * it will throw an error. This is why this method is only
  9888. * for debug purpose, you should always use {@link LazyResult#then}.
  9889. *
  9890. * @type {string}
  9891. * @see Result#css
  9892. */
  9893. }, {
  9894. key: 'css',
  9895. get: function get() {
  9896. return this.stringify().css;
  9897. }
  9898. /**
  9899. * An alias for the `css` property. Use it with syntaxes
  9900. * that generate non-CSS output.
  9901. *
  9902. * This property will only work with synchronous plugins.
  9903. * If the processor contains any asynchronous plugins
  9904. * it will throw an error. This is why this method is only
  9905. * for debug purpose, you should always use {@link LazyResult#then}.
  9906. *
  9907. * @type {string}
  9908. * @see Result#content
  9909. */
  9910. }, {
  9911. key: 'content',
  9912. get: function get() {
  9913. return this.stringify().content;
  9914. }
  9915. /**
  9916. * Processes input CSS through synchronous plugins
  9917. * and returns {@link Result#map}.
  9918. *
  9919. * This property will only work with synchronous plugins.
  9920. * If the processor contains any asynchronous plugins
  9921. * it will throw an error. This is why this method is only
  9922. * for debug purpose, you should always use {@link LazyResult#then}.
  9923. *
  9924. * @type {SourceMapGenerator}
  9925. * @see Result#map
  9926. */
  9927. }, {
  9928. key: 'map',
  9929. get: function get() {
  9930. return this.stringify().map;
  9931. }
  9932. /**
  9933. * Processes input CSS through synchronous plugins
  9934. * and returns {@link Result#root}.
  9935. *
  9936. * This property will only work with synchronous plugins. If the processor
  9937. * contains any asynchronous plugins it will throw an error.
  9938. *
  9939. * This is why this method is only for debug purpose,
  9940. * you should always use {@link LazyResult#then}.
  9941. *
  9942. * @type {Root}
  9943. * @see Result#root
  9944. */
  9945. }, {
  9946. key: 'root',
  9947. get: function get() {
  9948. return this.sync().root;
  9949. }
  9950. /**
  9951. * Processes input CSS through synchronous plugins
  9952. * and returns {@link Result#messages}.
  9953. *
  9954. * This property will only work with synchronous plugins. If the processor
  9955. * contains any asynchronous plugins it will throw an error.
  9956. *
  9957. * This is why this method is only for debug purpose,
  9958. * you should always use {@link LazyResult#then}.
  9959. *
  9960. * @type {Message[]}
  9961. * @see Result#messages
  9962. */
  9963. }, {
  9964. key: 'messages',
  9965. get: function get() {
  9966. return this.sync().messages;
  9967. }
  9968. }]);
  9969. return LazyResult;
  9970. }();
  9971. exports.default = LazyResult;
  9972. /**
  9973. * @callback onFulfilled
  9974. * @param {Result} result
  9975. */
  9976. /**
  9977. * @callback onRejected
  9978. * @param {Error} error
  9979. */
  9980. module.exports = exports['default'];
  9981. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhenktcmVzdWx0LmVzNiJdLCJuYW1lcyI6WyJpc1Byb21pc2UiLCJvYmoiLCJ0aGVuIiwiTGF6eVJlc3VsdCIsInByb2Nlc3NvciIsImNzcyIsIm9wdHMiLCJzdHJpbmdpZmllZCIsInByb2Nlc3NlZCIsInJvb3QiLCJ0eXBlIiwibWFwIiwiaW5saW5lIiwicHJld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1xuICAgICAgICAgICAgdGhpcy5lcnJvciA9IGVycm9yO1xuICAgICAgICAgICAgaWYgKCBlcnJvci5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InICYmICFlcnJvci5wbHVnaW4gKSB7XG4gICAgICAgICAgICAgICAgZXJyb3IucGx1Z2luID0gcGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICAgICAgZXJyb3Iuc2V0TWVzc2FnZSgpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggcGx1Z2luLnBvc3Rjc3NWZXJzaW9uICkge1xuICAgICAgICAgICAgICAgIGxldCBwbHVnaW5OYW1lID0gcGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICAgICAgbGV0IHBsdWdpblZlciAgPSBwbHVnaW4ucG9zdGNzc1ZlcnNpb247XG4gICAgICAgICAgICAgICAgbGV0IHJ1bnRpbWVWZXIgPSB0aGlzLnJlc3VsdC5wcm9jZXNzb3IudmVyc2lvbjtcbiAgICAgICAgICAgICAgICBsZXQgYSA9IHBsdWdpblZlci5zcGxpdCgnLicpO1xuICAgICAgICAgICAgICAgIGxldCBiID0gcnVudGltZVZlci5zcGxpdCgnLicpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBhWzBdICE9PSBiWzBdIHx8IHBhcnNlSW50KGFbMV0pID4gcGFyc2VJbnQoYlsxXSkgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAnVW5rbm93biBlcnJvciBmcm9tIFBvc3RDU1MgcGx1Z2luLiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdZb3VyIGN1cnJlbnQgUG9zdENTUyB2ZXJzaW9uICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2lzICcgKyBydW50aW1lVmVyICsgJywgYnV0ICcgKyBwbHVnaW5OYW1lICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VzICcgKyBwbHVnaW5WZXIgKyAnLiBQZXJoYXBzIHRoaXMgaXMgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAndGhlIHNvdXJjZSBvZiB0aGUgZXJyb3IgYmVsb3cuJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgIGlmICggY29uc29sZSAmJiBjb25zb2xlLmVycm9yICkgY29uc29sZS5lcnJvcihlcnIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmNUaWNrKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICBpZiAoIHRoaXMucGx1Z2luID49IHRoaXMucHJvY2Vzc29yLnBsdWdpbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBsZXQgcGx1Z2luICA9IHRoaXMucHJvY2Vzc29yLnBsdWdpbnNbdGhpcy5wbHVnaW5dO1xuICAgICAgICAgICAgbGV0IHByb21pc2UgPSB0aGlzLnJ1bihwbHVnaW4pO1xuICAgICAgICAgICAgdGhpcy5wbHVnaW4gKz0gMTtcblxuICAgICAgICAgICAgaWYgKCBpc1Byb21pc2UocHJvbWlzZSkgKSB7XG4gICAgICAgICAgICAgICAgcHJvbWlzZS50aGVuKCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXN5bmNUaWNrKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goIGVycm9yID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oYW5kbGVFcnJvcihlcnJvciwgcGx1Z2luKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmFzeW5jVGljayhyZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLnByb2Nlc3NlZCA9IHRydWU7XG4gICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMoKSB7XG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzZWQgKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoIChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuZXJyb3IgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHRoaXMuc3RyaW5naWZ5KCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzaW5nICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJvY2Vzc2luZztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucHJvY2Vzc2luZyA9IG5ldyBQcm9taXNlKCAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICBpZiAoIHRoaXMuZXJyb3IgKSByZXR1cm4gcmVqZWN0KHRoaXMuZXJyb3IpO1xuICAgICAgICAgICAgdGhpcy5wbHVnaW4gPSAwO1xuICAgICAgICAgICAgdGhpcy5hc3luY1RpY2socmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgfSkudGhlbiggKCkgPT4ge1xuICAgICAgICAgICAgdGhpcy5wcm9jZXN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bHR9IHJlc3VsdFxuICovXG5cbi8qKlxuICogQGNhbGxiYWNrIG9uUmVqZWN0ZWRcbiAqIEBwYXJhbSB7RXJyb3J9IGVycm9yXG4gKi9cbiJdfQ==
  9982. /***/ }),
  9983. /* 57 */
  9984. /***/ (function(module, exports, __webpack_require__) {
  9985. "use strict";
  9986. exports.__esModule = true;
  9987. exports.default = parse;
  9988. var _parser = __webpack_require__(58);
  9989. var _parser2 = _interopRequireDefault(_parser);
  9990. var _input = __webpack_require__(29);
  9991. var _input2 = _interopRequireDefault(_input);
  9992. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9993. function parse(css, opts) {
  9994. if (opts && opts.safe) {
  9995. throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
  9996. }
  9997. var input = new _input2.default(css, opts);
  9998. var parser = new _parser2.default(input);
  9999. try {
  10000. parser.parse();
  10001. } catch (e) {
  10002. if (e.name === 'CssSyntaxError' && opts && opts.from) {
  10003. if (/\.scss$/i.test(opts.from)) {
  10004. e.message += '\nYou tried to parse SCSS with ' + 'the standard CSS parser; ' + 'try again with the postcss-scss parser';
  10005. } else if (/\.sass/i.test(opts.from)) {
  10006. e.message += '\nYou tried to parse Sass with ' + 'the standard CSS parser; ' + 'try again with the postcss-sass parser';
  10007. } else if (/\.less$/i.test(opts.from)) {
  10008. e.message += '\nYou tried to parse Less with ' + 'the standard CSS parser; ' + 'try again with the postcss-less parser';
  10009. }
  10010. }
  10011. throw e;
  10012. }
  10013. return parser.root;
  10014. }
  10015. module.exports = exports['default'];
  10016. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlLmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsImNzcyIsIm9wdHMiLCJzYWZlIiwiRXJyb3IiLCJpbnB1dCIsInBhcnNlciIsImUiLCJuYW1lIiwiZnJvbSIsInRlc3QiLCJtZXNzYWdlIiwicm9vdCJdL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NlIFNhc3Mgd2l0aCAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RoZSBzdGFuZGFyZCBDU1MgcGFyc2VyOyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RyeSBhZ2FpbiB3aXRoIHRoZSBwb3N0Y3NzLXNhc3MgcGFyc2VyJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIC9cXC5sZXNzJC9pLnRlc3Qob3B0cy5mcm9tKSApIHtcbiAgICAgICAgICAgICAgICBlLm1lc3NhZ2UgKz0gJ1xcbllvdSB0cmllZCB0byBwYXJzZSBMZXNzIHdpdGggJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICd0aGUgc3RhbmRhcmQgQ1NTIHBhcnNlcjsgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICd0cnkgYWdhaW4gd2l0aCB0aGUgcG9zdGNzcy1sZXNzIHBhcnNlcic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgZTtcbiAgICB9XG5cbiAgICByZXR1cm4gcGFyc2VyLnJvb3Q7XG59XG4iXX0=
  10017. /***/ }),
  10018. /* 58 */
  10019. /***/ (function(module, exports, __webpack_require__) {
  10020. "use strict";
  10021. exports.__esModule = true;
  10022. var _declaration = __webpack_require__(55);
  10023. var _declaration2 = _interopRequireDefault(_declaration);
  10024. var _tokenize = __webpack_require__(61);
  10025. var _tokenize2 = _interopRequireDefault(_tokenize);
  10026. var _comment = __webpack_require__(28);
  10027. var _comment2 = _interopRequireDefault(_comment);
  10028. var _atRule = __webpack_require__(27);
  10029. var _atRule2 = _interopRequireDefault(_atRule);
  10030. var _root = __webpack_require__(59);
  10031. var _root2 = _interopRequireDefault(_root);
  10032. var _rule = __webpack_require__(31);
  10033. var _rule2 = _interopRequireDefault(_rule);
  10034. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10035. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10036. var Parser = function () {
  10037. function Parser(input) {
  10038. _classCallCheck(this, Parser);
  10039. this.input = input;
  10040. this.root = new _root2.default();
  10041. this.current = this.root;
  10042. this.spaces = '';
  10043. this.semicolon = false;
  10044. this.createTokenizer();
  10045. this.root.source = { input: input, start: { line: 1, column: 1 } };
  10046. }
  10047. Parser.prototype.createTokenizer = function createTokenizer() {
  10048. this.tokenizer = (0, _tokenize2.default)(this.input);
  10049. };
  10050. Parser.prototype.parse = function parse() {
  10051. var token = void 0;
  10052. while (!this.tokenizer.endOfFile()) {
  10053. token = this.tokenizer.nextToken();
  10054. switch (token[0]) {
  10055. case 'space':
  10056. this.spaces += token[1];
  10057. break;
  10058. case ';':
  10059. this.freeSemicolon(token);
  10060. break;
  10061. case '}':
  10062. this.end(token);
  10063. break;
  10064. case 'comment':
  10065. this.comment(token);
  10066. break;
  10067. case 'at-word':
  10068. this.atrule(token);
  10069. break;
  10070. case '{':
  10071. this.emptyRule(token);
  10072. break;
  10073. default:
  10074. this.other(token);
  10075. break;
  10076. }
  10077. }
  10078. this.endFile();
  10079. };
  10080. Parser.prototype.comment = function comment(token) {
  10081. var node = new _comment2.default();
  10082. this.init(node, token[2], token[3]);
  10083. node.source.end = { line: token[4], column: token[5] };
  10084. var text = token[1].slice(2, -2);
  10085. if (/^\s*$/.test(text)) {
  10086. node.text = '';
  10087. node.raws.left = text;
  10088. node.raws.right = '';
  10089. } else {
  10090. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  10091. node.text = match[2];
  10092. node.raws.left = match[1];
  10093. node.raws.right = match[3];
  10094. }
  10095. };
  10096. Parser.prototype.emptyRule = function emptyRule(token) {
  10097. var node = new _rule2.default();
  10098. this.init(node, token[2], token[3]);
  10099. node.selector = '';
  10100. node.raws.between = '';
  10101. this.current = node;
  10102. };
  10103. Parser.prototype.other = function other(start) {
  10104. var end = false;
  10105. var type = null;
  10106. var colon = false;
  10107. var bracket = null;
  10108. var brackets = [];
  10109. var tokens = [];
  10110. var token = start;
  10111. while (token) {
  10112. type = token[0];
  10113. tokens.push(token);
  10114. if (type === '(' || type === '[') {
  10115. if (!bracket) bracket = token;
  10116. brackets.push(type === '(' ? ')' : ']');
  10117. } else if (brackets.length === 0) {
  10118. if (type === ';') {
  10119. if (colon) {
  10120. this.decl(tokens);
  10121. return;
  10122. } else {
  10123. break;
  10124. }
  10125. } else if (type === '{') {
  10126. this.rule(tokens);
  10127. return;
  10128. } else if (type === '}') {
  10129. this.tokenizer.back(tokens.pop());
  10130. end = true;
  10131. break;
  10132. } else if (type === ':') {
  10133. colon = true;
  10134. }
  10135. } else if (type === brackets[brackets.length - 1]) {
  10136. brackets.pop();
  10137. if (brackets.length === 0) bracket = null;
  10138. }
  10139. token = this.tokenizer.nextToken();
  10140. }
  10141. if (this.tokenizer.endOfFile()) end = true;
  10142. if (brackets.length > 0) this.unclosedBracket(bracket);
  10143. if (end && colon) {
  10144. while (tokens.length) {
  10145. token = tokens[tokens.length - 1][0];
  10146. if (token !== 'space' && token !== 'comment') break;
  10147. this.tokenizer.back(tokens.pop());
  10148. }
  10149. this.decl(tokens);
  10150. return;
  10151. } else {
  10152. this.unknownWord(tokens);
  10153. }
  10154. };
  10155. Parser.prototype.rule = function rule(tokens) {
  10156. tokens.pop();
  10157. var node = new _rule2.default();
  10158. this.init(node, tokens[0][2], tokens[0][3]);
  10159. node.raws.between = this.spacesAndCommentsFromEnd(tokens);
  10160. this.raw(node, 'selector', tokens);
  10161. this.current = node;
  10162. };
  10163. Parser.prototype.decl = function decl(tokens) {
  10164. var node = new _declaration2.default();
  10165. this.init(node);
  10166. var last = tokens[tokens.length - 1];
  10167. if (last[0] === ';') {
  10168. this.semicolon = true;
  10169. tokens.pop();
  10170. }
  10171. if (last[4]) {
  10172. node.source.end = { line: last[4], column: last[5] };
  10173. } else {
  10174. node.source.end = { line: last[2], column: last[3] };
  10175. }
  10176. while (tokens[0][0] !== 'word') {
  10177. if (tokens.length === 1) this.unknownWord(tokens);
  10178. node.raws.before += tokens.shift()[1];
  10179. }
  10180. node.source.start = { line: tokens[0][2], column: tokens[0][3] };
  10181. node.prop = '';
  10182. while (tokens.length) {
  10183. var type = tokens[0][0];
  10184. if (type === ':' || type === 'space' || type === 'comment') {
  10185. break;
  10186. }
  10187. node.prop += tokens.shift()[1];
  10188. }
  10189. node.raws.between = '';
  10190. var token = void 0;
  10191. while (tokens.length) {
  10192. token = tokens.shift();
  10193. if (token[0] === ':') {
  10194. node.raws.between += token[1];
  10195. break;
  10196. } else {
  10197. node.raws.between += token[1];
  10198. }
  10199. }
  10200. if (node.prop[0] === '_' || node.prop[0] === '*') {
  10201. node.raws.before += node.prop[0];
  10202. node.prop = node.prop.slice(1);
  10203. }
  10204. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  10205. this.precheckMissedSemicolon(tokens);
  10206. for (var i = tokens.length - 1; i > 0; i--) {
  10207. token = tokens[i];
  10208. if (token[1].toLowerCase() === '!important') {
  10209. node.important = true;
  10210. var string = this.stringFrom(tokens, i);
  10211. string = this.spacesFromEnd(tokens) + string;
  10212. if (string !== ' !important') node.raws.important = string;
  10213. break;
  10214. } else if (token[1].toLowerCase() === 'important') {
  10215. var cache = tokens.slice(0);
  10216. var str = '';
  10217. for (var j = i; j > 0; j--) {
  10218. var _type = cache[j][0];
  10219. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  10220. break;
  10221. }
  10222. str = cache.pop()[1] + str;
  10223. }
  10224. if (str.trim().indexOf('!') === 0) {
  10225. node.important = true;
  10226. node.raws.important = str;
  10227. tokens = cache;
  10228. }
  10229. }
  10230. if (token[0] !== 'space' && token[0] !== 'comment') {
  10231. break;
  10232. }
  10233. }
  10234. this.raw(node, 'value', tokens);
  10235. if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens);
  10236. };
  10237. Parser.prototype.atrule = function atrule(token) {
  10238. var node = new _atRule2.default();
  10239. node.name = token[1].slice(1);
  10240. if (node.name === '') {
  10241. this.unnamedAtrule(node, token);
  10242. }
  10243. this.init(node, token[2], token[3]);
  10244. var prev = void 0;
  10245. var shift = void 0;
  10246. var last = false;
  10247. var open = false;
  10248. var params = [];
  10249. while (!this.tokenizer.endOfFile()) {
  10250. token = this.tokenizer.nextToken();
  10251. if (token[0] === ';') {
  10252. node.source.end = { line: token[2], column: token[3] };
  10253. this.semicolon = true;
  10254. break;
  10255. } else if (token[0] === '{') {
  10256. open = true;
  10257. break;
  10258. } else if (token[0] === '}') {
  10259. if (params.length > 0) {
  10260. shift = params.length - 1;
  10261. prev = params[shift];
  10262. while (prev && prev[0] === 'space') {
  10263. prev = params[--shift];
  10264. }
  10265. if (prev) {
  10266. node.source.end = { line: prev[4], column: prev[5] };
  10267. }
  10268. }
  10269. this.end(token);
  10270. break;
  10271. } else {
  10272. params.push(token);
  10273. }
  10274. if (this.tokenizer.endOfFile()) {
  10275. last = true;
  10276. break;
  10277. }
  10278. }
  10279. node.raws.between = this.spacesAndCommentsFromEnd(params);
  10280. if (params.length) {
  10281. node.raws.afterName = this.spacesAndCommentsFromStart(params);
  10282. this.raw(node, 'params', params);
  10283. if (last) {
  10284. token = params[params.length - 1];
  10285. node.source.end = { line: token[4], column: token[5] };
  10286. this.spaces = node.raws.between;
  10287. node.raws.between = '';
  10288. }
  10289. } else {
  10290. node.raws.afterName = '';
  10291. node.params = '';
  10292. }
  10293. if (open) {
  10294. node.nodes = [];
  10295. this.current = node;
  10296. }
  10297. };
  10298. Parser.prototype.end = function end(token) {
  10299. if (this.current.nodes && this.current.nodes.length) {
  10300. this.current.raws.semicolon = this.semicolon;
  10301. }
  10302. this.semicolon = false;
  10303. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  10304. this.spaces = '';
  10305. if (this.current.parent) {
  10306. this.current.source.end = { line: token[2], column: token[3] };
  10307. this.current = this.current.parent;
  10308. } else {
  10309. this.unexpectedClose(token);
  10310. }
  10311. };
  10312. Parser.prototype.endFile = function endFile() {
  10313. if (this.current.parent) this.unclosedBlock();
  10314. if (this.current.nodes && this.current.nodes.length) {
  10315. this.current.raws.semicolon = this.semicolon;
  10316. }
  10317. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  10318. };
  10319. Parser.prototype.freeSemicolon = function freeSemicolon(token) {
  10320. this.spaces += token[1];
  10321. if (this.current.nodes) {
  10322. var prev = this.current.nodes[this.current.nodes.length - 1];
  10323. if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
  10324. prev.raws.ownSemicolon = this.spaces;
  10325. this.spaces = '';
  10326. }
  10327. }
  10328. };
  10329. // Helpers
  10330. Parser.prototype.init = function init(node, line, column) {
  10331. this.current.push(node);
  10332. node.source = { start: { line: line, column: column }, input: this.input };
  10333. node.raws.before = this.spaces;
  10334. this.spaces = '';
  10335. if (node.type !== 'comment') this.semicolon = false;
  10336. };
  10337. Parser.prototype.raw = function raw(node, prop, tokens) {
  10338. var token = void 0,
  10339. type = void 0;
  10340. var length = tokens.length;
  10341. var value = '';
  10342. var clean = true;
  10343. var next = void 0,
  10344. prev = void 0;
  10345. var pattern = /^([.|#])?([\w])+/i;
  10346. for (var i = 0; i < length; i += 1) {
  10347. token = tokens[i];
  10348. type = token[0];
  10349. if (type === 'comment' && node.type === 'rule') {
  10350. prev = tokens[i - 1];
  10351. next = tokens[i + 1];
  10352. if (prev[0] !== 'space' && next[0] !== 'space' && pattern.test(prev[1]) && pattern.test(next[1])) {
  10353. value += token[1];
  10354. } else {
  10355. clean = false;
  10356. }
  10357. continue;
  10358. }
  10359. if (type === 'comment' || type === 'space' && i === length - 1) {
  10360. clean = false;
  10361. } else {
  10362. value += token[1];
  10363. }
  10364. }
  10365. if (!clean) {
  10366. var raw = tokens.reduce(function (all, i) {
  10367. return all + i[1];
  10368. }, '');
  10369. node.raws[prop] = { value: value, raw: raw };
  10370. }
  10371. node[prop] = value;
  10372. };
  10373. Parser.prototype.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) {
  10374. var lastTokenType = void 0;
  10375. var spaces = '';
  10376. while (tokens.length) {
  10377. lastTokenType = tokens[tokens.length - 1][0];
  10378. if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
  10379. spaces = tokens.pop()[1] + spaces;
  10380. }
  10381. return spaces;
  10382. };
  10383. Parser.prototype.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) {
  10384. var next = void 0;
  10385. var spaces = '';
  10386. while (tokens.length) {
  10387. next = tokens[0][0];
  10388. if (next !== 'space' && next !== 'comment') break;
  10389. spaces += tokens.shift()[1];
  10390. }
  10391. return spaces;
  10392. };
  10393. Parser.prototype.spacesFromEnd = function spacesFromEnd(tokens) {
  10394. var lastTokenType = void 0;
  10395. var spaces = '';
  10396. while (tokens.length) {
  10397. lastTokenType = tokens[tokens.length - 1][0];
  10398. if (lastTokenType !== 'space') break;
  10399. spaces = tokens.pop()[1] + spaces;
  10400. }
  10401. return spaces;
  10402. };
  10403. Parser.prototype.stringFrom = function stringFrom(tokens, from) {
  10404. var result = '';
  10405. for (var i = from; i < tokens.length; i++) {
  10406. result += tokens[i][1];
  10407. }
  10408. tokens.splice(from, tokens.length - from);
  10409. return result;
  10410. };
  10411. Parser.prototype.colon = function colon(tokens) {
  10412. var brackets = 0;
  10413. var token = void 0,
  10414. type = void 0,
  10415. prev = void 0;
  10416. for (var i = 0; i < tokens.length; i++) {
  10417. token = tokens[i];
  10418. type = token[0];
  10419. if (type === '(') {
  10420. brackets += 1;
  10421. } else if (type === ')') {
  10422. brackets -= 1;
  10423. } else if (brackets === 0 && type === ':') {
  10424. if (!prev) {
  10425. this.doubleColon(token);
  10426. } else if (prev[0] === 'word' && prev[1] === 'progid') {
  10427. continue;
  10428. } else {
  10429. return i;
  10430. }
  10431. }
  10432. prev = token;
  10433. }
  10434. return false;
  10435. };
  10436. // Errors
  10437. Parser.prototype.unclosedBracket = function unclosedBracket(bracket) {
  10438. throw this.input.error('Unclosed bracket', bracket[2], bracket[3]);
  10439. };
  10440. Parser.prototype.unknownWord = function unknownWord(tokens) {
  10441. throw this.input.error('Unknown word', tokens[0][2], tokens[0][3]);
  10442. };
  10443. Parser.prototype.unexpectedClose = function unexpectedClose(token) {
  10444. throw this.input.error('Unexpected }', token[2], token[3]);
  10445. };
  10446. Parser.prototype.unclosedBlock = function unclosedBlock() {
  10447. var pos = this.current.source.start;
  10448. throw this.input.error('Unclosed block', pos.line, pos.column);
  10449. };
  10450. Parser.prototype.doubleColon = function doubleColon(token) {
  10451. throw this.input.error('Double colon', token[2], token[3]);
  10452. };
  10453. Parser.prototype.unnamedAtrule = function unnamedAtrule(node, token) {
  10454. throw this.input.error('At-rule without name', token[2], token[3]);
  10455. };
  10456. Parser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
  10457. // Hook for Safe Parser
  10458. tokens;
  10459. };
  10460. Parser.prototype.checkMissedSemicolon = function checkMissedSemicolon(tokens) {
  10461. var colon = this.colon(tokens);
  10462. if (colon === false) return;
  10463. var founded = 0;
  10464. var token = void 0;
  10465. for (var j = colon - 1; j >= 0; j--) {
  10466. token = tokens[j];
  10467. if (token[0] !== 'space') {
  10468. founded += 1;
  10469. if (founded === 2) break;
  10470. }
  10471. }
  10472. throw this.input.error('Missed semicolon', token[2], token[3]);
  10473. };
  10474. return Parser;
  10475. }();
  10476. exports.default = Parser;
  10477. module.exports = exports['default'];
  10478. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOlsiUGFyc2VyIiwiaW5wdXQiLCJyb290IiwiY3VycmVudCIsInNwYWNlcyIsInNlbWljb2xvbiIsImNyZWF0ZVRva2VuaXplciIsInNvdXJjZSIsInN0YXJ0IiwibGluZSIsImNvbHVtbiIsInRva2VuaXplciIsInBhcnNlIiwidG9rZW4iLCJlbmRPZkZpbGUiLCJuZXh0VG9rZW4iLCJmcmVlU2VtaWNvbG9uIiwiZW5kIiwiY29tbWVudCIsImF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iA9IHRoaXMudG9rZW5pemVyLm5leHRUb2tlbigpO1xuXG4gICAgICAgICAgICBzd2l0Y2ggKCB0b2tlblswXSApIHtcblxuICAgICAgICAgICAgY2FzZSAnc3BhY2UnOlxuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICc7JzpcbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVTZW1pY29sb24odG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICd9JzpcbiAgICAgICAgICAgICAgICB0aGlzLmVuZCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2NvbW1lbnQnOlxuICAgICAgICAgICAgICAgIHRoaXMuY29tbWVudCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F0LXdvcmQnOlxuICAgICAgICAgICAgICAgIHRoaXMuYXRydWxlKHRva2VuKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICAgICAgdGhpcy5lbXB0eVJ1bGUodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRoaXMub3RoZXIodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuZW5kRmlsZSgpO1xuICAgIH1cblxuICAgIGNvbW1lbnQodG9rZW4pIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgQ29tbWVudCgpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlbls0XSwgY29sdW1uOiB0b2tlbls1XSB9O1xuXG4gICAgICAgIGxldCB0ZXh0ID0gdG9rZW5bMV0uc2xpY2UoMiwgLTIpO1xuICAgICAgICBpZiAoIC9eXFxzKiQvLnRlc3QodGV4dCkgKSB7XG4gICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSAnJztcbiAgICAgICAgICAgIG5vZGUucmF3cy5sZWZ0ICA9IHRleHQ7XG4gICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSAnJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtYXRjaCA9IHRleHQubWF0Y2goL14oXFxzKikoW15dKlteXFxzXSkoXFxzKikkLyk7XG4gICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSBtYXRjaFsyXTtcbiAgICAgICAgICAgIG5vZGUucmF3cy5sZWZ0ICA9IG1hdGNoWzFdO1xuICAgICAgICAgICAgbm9kZS5yYXdzLnJpZ2h0ID0gbWF0Y2hbM107XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBlbXB0eVJ1bGUodG9rZW4pIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgUnVsZSgpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICAgICAgbm9kZS5zZWxlY3RvciA9ICcnO1xuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgIH1cblxuICAgIG90aGVyKHN0YXJ0KSB7XG4gICAgICAgIGxldCBlbmQgICAgICA9IGZhbHNlO1xuICAgICAgICBsZXQgdHlwZSAgICAgPSBudWxsO1xuICAgICAgICBsZXQgY29sb24gICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IGJyYWNrZXQgID0gbnVsbDtcbiAgICAgICAgbGV0IGJyYWNrZXRzID0gW107XG5cbiAgICAgICAgbGV0IHRva2VucyA9IFtdO1xuICAgICAgICBsZXQgdG9rZW4gPSBzdGFydDtcbiAgICAgICAgd2hpbGUgKCB0b2tlbiApIHtcbiAgICAgICAgICAgIHR5cGUgPSB0b2tlblswXTtcbiAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcblxuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnKCcgfHwgdHlwZSA9PT0gJ1snICkge1xuICAgICAgICAgICAgICAgIGlmICggIWJyYWNrZXQgKSBicmFja2V0ID0gdG9rZW47XG4gICAgICAgICAgICAgICAgYnJhY2tldHMucHVzaCh0eXBlID09PSAnKCcgPyAnKScgOiAnXScpO1xuXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cy5sZW5ndGggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnOycgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggY29sb24gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2wodG9rZW5zKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAneycgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucnVsZSh0b2tlbnMpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnfScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudG9rZW5pemVyLmJhY2sodG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgICAgICAgICAgZW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGUgPT09IGJyYWNrZXRzW2JyYWNrZXRzLmxlbmd0aCAtIDFdICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzLnBvcCgpO1xuICAgICAgICAgICAgICAgIGlmICggYnJhY2tldHMubGVuZ3RoID09PSAwICkgYnJhY2tldCA9IG51bGw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHRoaXMudG9rZW5pemVyLmVuZE9mRmlsZSgpICkgZW5kID0gdHJ1ZTtcbiAgICAgICAgaWYgKCBicmFja2V0cy5sZW5ndGggPiAwICkgdGhpcy51bmNsb3NlZEJyYWNrZXQoYnJhY2tldCk7XG5cbiAgICAgICAgaWYgKCBlbmQgJiYgY29sb24gKSB7XG4gICAgICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgICAgIGlmICggdG9rZW4gIT09ICdzcGFjZScgJiYgdG9rZW4gIT09ICdjb21tZW50JyApIGJyZWFrO1xuICAgICAgICAgICAgICAgIHRoaXMudG9rZW5pemVyLmJhY2sodG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZGVjbCh0b2tlbnMpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy51bmtub3duV29yZCh0b2tlbnMpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcnVsZSh0b2tlbnMpIHtcbiAgICAgICAgdG9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VsxXTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnNvdXJjZS5zdGFydCA9IHsgbGluZTogdG9rZW5zWzBdWzJdLCBjb2x1bW46IHRva2Vuc1swXVszXSB9O1xuXG4gICAgICAgIG5vZGUucHJvcCA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBsZXQgdHlwZSA9IHRva2Vuc1swXVswXTtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJzonIHx8IHR5cGUgPT09ICdzcGFjZScgfHwgdHlwZSA9PT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbm9kZS5wcm9wICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gPSAnJztcblxuICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zLnNoaWZ0KCk7XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gPT09ICc6JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdG9rZW5bMV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG5vZGUucHJvcFswXSA9PT0gJ18nIHx8IG5vZGUucHJvcFswXSA9PT0gJyonICkge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSBub2RlLnByb3BbMF07XG4gICAgICAgICAgICBub2RlLnByb3AgPSBub2RlLnByb3Auc2xpY2UoMSk7XG4gICAgICAgIH1cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdGhpcy5zcGFjZXNBbmRDb21tZW50c0Zyb21TdGFydCh0b2tlbnMpO1xuICAgICAgICB0aGlzLnByZWNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG5cbiAgICAgICAgZm9yICggbGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgaWYgKCB0b2tlblsxXS50b0xvd2VyQ2FzZSgpID09PSAnIWltcG9ydGFudCcgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnN0cmluZ0Zyb20odG9rZW5zLCBpKTtcbiAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAoIHN0cmluZyAhPT0gJyAhaW1wb3J0YW50JyApIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0udG9Mb3dlckNhc2UoKSA9PT0gJ2ltcG9ydGFudCcpIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FjaGUgPSB0b2tlbnMuc2xpY2UoMCk7XG4gICAgICAgICAgICAgICAgbGV0IHN0ciAgID0gJyc7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IGogPSBpOyBqID4gMDsgai0tICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGNhY2hlW2pdWzBdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmIHR5cGUgIT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBjYWNoZS5wb3AoKVsxXSArIHN0cjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCBzdHIudHJpbSgpLmluZGV4T2YoJyEnKSA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuaW1wb3J0YW50ID0gc3RyO1xuICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBjYWNoZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gIT09ICdzcGFjZScgJiYgdG9rZW5bMF0gIT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmF3KG5vZGUsICd2YWx1ZScsIHRva2Vucyk7XG5cbiAgICAgICAgaWYgKCBub2RlLnZhbHVlLmluZGV4T2YoJzonKSAhPT0gLTEgKSB0aGlzLmNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG4gICAgfVxuXG4gICAgYXRydWxlKHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlICA9IG5ldyBBdFJ1bGUoKTtcbiAgICAgICAgbm9kZS5uYW1lID0gdG9rZW5bMV0uc2xpY2UoMSk7XG4gICAgICAgIGlmICggbm9kZS5uYW1lID09PSAnJyApIHtcbiAgICAgICAgICAgIHRoaXMudW5uYW1lZEF0cnVsZShub2RlLCB0b2tlbik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG5cbiAgICAgICAgbGV0IHByZXY7XG4gICAgICAgIGxldCBzaGlmdDtcbiAgICAgICAgbGV0IGxhc3QgICA9IGZhbHNlO1xuICAgICAgICBsZXQgb3BlbiAgID0gZmFsc2U7XG4gICAgICAgIGxldCBwYXJhbXMgPSBbXTtcblxuICAgICAgICB3aGlsZSAoICF0aGlzLnRva2VuaXplci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKCk7XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gPT09ICc7JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLnNvdXJjZS5lbmQgPSB7IGxpbmU6IHRva2VuWzJdLCBjb2x1bW46IHRva2VuWzNdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zZW1pY29sb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdG9rZW5bMF0gPT09ICd7JyApIHtcbiAgICAgICAgICAgICAgICBvcGVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHRva2VuWzBdID09PSAnfScpIHtcbiAgICAgICAgICAgICAgICBpZiAoIHBhcmFtcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgICAgICBzaGlmdCA9IHBhcmFtcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgICAgICBwcmV2ID0gcGFyYW1zW3NoaWZ0XTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCBwcmV2ICYmIHByZXZbMF0gPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV2ID0gcGFyYW1zWy0tc2hpZnRdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICggcHJldiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogcHJldls0XSwgY29sdW1uOiBwcmV2WzVdIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5lbmQodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggdGhpcy50b2tlbml6ZXIuZW5kT2ZGaWxlKCkgKSB7XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHBhcmFtcyk7XG4gICAgICAgIGlmICggcGFyYW1zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIG5vZGUucmF3cy5hZnRlck5hbWUgPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHBhcmFtcyk7XG4gICAgICAgICAgICB0aGlzLnJhdyhub2RlLCAncGFyYW1zJywgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmICggbGFzdCApIHtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IHBhcmFtc1twYXJhbXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kICAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zcGFjZXMgICAgICAgPSBub2RlLnJhd3MuYmV0d2VlbjtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmFmdGVyTmFtZSA9ICcnO1xuICAgICAgICAgICAgbm9kZS5wYXJhbXMgICAgICAgICA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBvcGVuICkge1xuICAgICAgICAgICAgbm9kZS5ub2RlcyAgID0gW107XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW5kKHRva2VuKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50Lm5vZGVzICYmIHRoaXMuY3VycmVudC5ub2Rlcy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5zZW1pY29sb24gPSB0aGlzLnNlbWljb2xvbjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuY3VycmVudC5yYXdzLmFmdGVyID0gKHRoaXMuY3VycmVudC5yYXdzLmFmdGVyIHx8ICcnKSArIHRoaXMuc3BhY2VzO1xuICAgICAgICB0aGlzLnNwYWNlcyA9ICcnO1xuXG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9O1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5jdXJyZW50LnBhcmVudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudW5leHBlY3RlZENsb3NlKHRva2VuKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGVuZEZpbGUoKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHRoaXMudW5jbG9zZWRCbG9jaygpO1xuICAgICAgICBpZiAoIHRoaXMuY3VycmVudC5ub2RlcyAmJiB0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50LnJhd3Muc2VtaWNvbG9uID0gdGhpcy5zZW1pY29sb247XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgPSAodGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgfHwgJycpICsgdGhpcy5zcGFjZXM7XG4gICAgfVxuXG4gICAgZnJlZVNlbWljb2xvbih0b2tlbikge1xuICAgICAgICB0aGlzLnNwYWNlcyArPSB0b2tlblsxXTtcbiAgICAgICAgaWYgKCB0aGlzLmN1cnJlbnQubm9kZXMgKSB7XG4gICAgICAgICAgICBsZXQgcHJldiA9IHRoaXMuY3VycmVudC5ub2Rlc1t0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBpZiAoIHByZXYgJiYgcHJldi50eXBlID09PSAncnVsZScgJiYgIXByZXYucmF3cy5vd25TZW1pY29sb24gKSB7XG4gICAgICAgICAgICAgICAgcHJldi5yYXdzLm93blNlbWljb2xvbiA9IHRoaXMuc3BhY2VzO1xuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBIZWxwZXJzXG5cbiAgICBpbml0KG5vZGUsIGxpbmUsIGNvbHVtbikge1xuICAgICAgICB0aGlzLmN1cnJlbnQucHVzaChub2RlKTtcblxuICAgICAgICBub2RlLnNvdXJjZSA9IHsgc3RhcnQ6IHsgbGluZSwgY29sdW1uIH0sIGlucHV0OiB0aGlzLmlucHV0IH07XG4gICAgICAgIG5vZGUucmF3cy5iZWZvcmUgPSB0aGlzLnNwYWNlcztcbiAgICAgICAgdGhpcy5zcGFjZXMgPSAnJztcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgIT09ICdjb21tZW50JyApIHRoaXMuc2VtaWNvbG9uID0gZmFsc2U7XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIHByb3AsIHRva2Vucykge1xuICAgICAgICBsZXQgdG9rZW4sIHR5cGU7XG4gICAgICAgIGxldCBsZW5ndGggPSB0b2tlbnMubGVuZ3RoO1xuICAgICAgICBsZXQgdmFsdWUgID0gJyc7XG4gICAgICAgIGxldCBjbGVhbiAgPSB0cnVlO1xuICAgICAgICBsZXQgbmV4dCwgcHJldjtcbiAgICAgICAgY29uc3QgcGF0dGVybiA9IC9eKFsufCNdKT8oW1xcd10pKy9pO1xuXG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICdjb21tZW50JyAmJiBub2RlLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgICAgICBwcmV2ID0gdG9rZW5zW2kgLSAxXTtcbiAgICAgICAgICAgICAgICBuZXh0ID0gdG9rZW5zW2kgKyAxXTtcblxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgcHJldlswXSAhPT0gJ3NwYWNlJyAmJlxuICAgICAgICAgICAgICAgICAgICBuZXh0WzBdICE9PSAnc3BhY2UnICYmXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4udGVzdChwcmV2WzFdKSAmJlxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLnRlc3QobmV4dFsxXSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgKz0gdG9rZW5bMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnY29tbWVudCcgfHwgdHlwZSA9PT0gJ3NwYWNlJyAmJiBpID09PSBsZW5ndGggLSAxICkge1xuICAgICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhbHVlICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICggIWNsZWFuICkge1xuICAgICAgICAgICAgbGV0IHJhdyA9IHRva2Vucy5yZWR1Y2UoIChhbGwsIGkpID0+IGFsbCArIGlbMV0sICcnKTtcbiAgICAgICAgICAgIG5vZGUucmF3c1twcm9wXSA9IHsgdmFsdWUsIHJhdyB9O1xuICAgICAgICB9XG4gICAgICAgIG5vZGVbcHJvcF0gPSB2YWx1ZTtcbiAgICB9XG5cbiAgICBzcGFjZXNBbmRDb21tZW50c0Zyb21FbmQodG9rZW5zKSB7XG4gICAgICAgIGxldCBsYXN0VG9rZW5UeXBlO1xuICAgICAgICBsZXQgc3BhY2VzID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIGxhc3RUb2tlblR5cGUgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgaWYgKCBsYXN0VG9rZW5UeXBlICE9PSAnc3BhY2UnICYmXG4gICAgICAgICAgICAgICAgbGFzdFRva2VuVHlwZSAhPT0gJ2NvbW1lbnQnICkgYnJlYWs7XG4gICAgICAgICAgICBzcGFjZXMgPSB0b2tlbnMucG9wKClbMV0gKyBzcGFjZXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNwYWNlcztcbiAgICB9XG5cbiAgICBzcGFjZXNBbmRDb21tZW50c0Zyb21TdGFydCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IG5leHQ7XG4gICAgICAgIGxldCBzcGFjZXMgPSAnJztcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbmV4dCA9IHRva2Vuc1swXVswXTtcbiAgICAgICAgICAgIGlmICggbmV4dCAhPT0gJ3NwYWNlJyAmJiBuZXh0ICE9PSAnY29tbWVudCcgKSBicmVhaztcbiAgICAgICAgICAgIHNwYWNlcyArPSB0b2tlbnMuc2hpZnQoKVsxXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BhY2VzO1xuICAgIH1cblxuICAgIHNwYWNlc0Zyb21FbmQodG9rZW5zKSB7XG4gICAgICAgIGxldCBsYXN0VG9rZW5UeXBlO1xuICAgICAgICBsZXQgc3BhY2VzID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIGxhc3RUb2tlblR5cGUgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgaWYgKCBsYXN0VG9rZW5UeXBlICE9PSAnc3BhY2UnICkgYnJlYWs7XG4gICAgICAgICAgICBzcGFjZXMgPSB0b2tlbnMucG9wKClbMV0gKyBzcGFjZXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNwYWNlcztcbiAgICB9XG5cbiAgICBzdHJpbmdGcm9tKHRva2VucywgZnJvbSkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gJyc7XG4gICAgICAgIGZvciAoIGxldCBpID0gZnJvbTsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgIHJlc3VsdCArPSB0b2tlbnNbaV1bMV07XG4gICAgICAgIH1cbiAgICAgICAgdG9rZW5zLnNwbGljZShmcm9tLCB0b2tlbnMubGVuZ3RoIC0gZnJvbSk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29sb24odG9rZW5zKSB7XG4gICAgICAgIGxldCBicmFja2V0cyA9IDA7XG4gICAgICAgIGxldCB0b2tlbiwgdHlwZSwgcHJldjtcbiAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICcoJyApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJyknICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzIC09IDE7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cyA9PT0gMCAmJiB0eXBlID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCAhcHJldiApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kb3VibGVDb2xvbih0b2tlbik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggcHJldlswXSA9PT0gJ3dvcmQnICYmIHByZXZbMV0gPT09ICdwcm9naWQnICkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHByZXYgPSB0b2tlbjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gRXJyb3JzXG5cbiAgICB1bmNsb3NlZEJyYWNrZXQoYnJhY2tldCkge1xuICAgICAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdVbmNsb3NlZCBicmFja2V0JywgYnJhY2tldFsyXSwgYnJhY2tldFszXSk7XG4gICAgfVxuXG4gICAgdW5rbm93bldvcmQodG9rZW5zKSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ1Vua25vd24gd29yZCcsIHRva2Vuc1swXVsyXSwgdG9rZW5zWzBdWzNdKTtcbiAg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ICAgICAgICAgIGlmICggdG9rZW5bMF0gIT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgZm91bmRlZCArPSAxO1xuICAgICAgICAgICAgICAgIGlmICggZm91bmRlZCA9PT0gMiApIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ01pc3NlZCBzZW1pY29sb24nLCB0b2tlblsyXSwgdG9rZW5bM10pO1xuICAgIH1cblxufVxuIl19
  10479. /***/ }),
  10480. /* 59 */
  10481. /***/ (function(module, exports, __webpack_require__) {
  10482. "use strict";
  10483. exports.__esModule = true;
  10484. var _container = __webpack_require__(22);
  10485. var _container2 = _interopRequireDefault(_container);
  10486. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10487. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10488. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10489. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10490. /**
  10491. * Represents a CSS file and contains all its parsed nodes.
  10492. *
  10493. * @extends Container
  10494. *
  10495. * @example
  10496. * const root = postcss.parse('a{color:black} b{z-index:2}');
  10497. * root.type //=> 'root'
  10498. * root.nodes.length //=> 2
  10499. */
  10500. var Root = function (_Container) {
  10501. _inherits(Root, _Container);
  10502. function Root(defaults) {
  10503. _classCallCheck(this, Root);
  10504. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  10505. _this.type = 'root';
  10506. if (!_this.nodes) _this.nodes = [];
  10507. return _this;
  10508. }
  10509. Root.prototype.removeChild = function removeChild(child, ignore) {
  10510. var index = this.index(child);
  10511. if (!ignore && index === 0 && this.nodes.length > 1) {
  10512. this.nodes[1].raws.before = this.nodes[index].raws.before;
  10513. }
  10514. return _Container.prototype.removeChild.call(this, child);
  10515. };
  10516. Root.prototype.normalize = function normalize(child, sample, type) {
  10517. var nodes = _Container.prototype.normalize.call(this, child);
  10518. if (sample) {
  10519. if (type === 'prepend') {
  10520. if (this.nodes.length > 1) {
  10521. sample.raws.before = this.nodes[1].raws.before;
  10522. } else {
  10523. delete sample.raws.before;
  10524. }
  10525. } else if (this.first !== sample) {
  10526. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  10527. var _ref;
  10528. if (_isArray) {
  10529. if (_i >= _iterator.length) break;
  10530. _ref = _iterator[_i++];
  10531. } else {
  10532. _i = _iterator.next();
  10533. if (_i.done) break;
  10534. _ref = _i.value;
  10535. }
  10536. var node = _ref;
  10537. node.raws.before = sample.raws.before;
  10538. }
  10539. }
  10540. }
  10541. return nodes;
  10542. };
  10543. /**
  10544. * Returns a {@link Result} instance representing the root’s CSS.
  10545. *
  10546. * @param {processOptions} [opts] - options with only `to` and `map` keys
  10547. *
  10548. * @return {Result} result with current root’s CSS
  10549. *
  10550. * @example
  10551. * const root1 = postcss.parse(css1, { from: 'a.css' });
  10552. * const root2 = postcss.parse(css2, { from: 'b.css' });
  10553. * root1.append(root2);
  10554. * const result = root1.toResult({ to: 'all.css', map: true });
  10555. */
  10556. Root.prototype.toResult = function toResult() {
  10557. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10558. var LazyResult = __webpack_require__(56);
  10559. var Processor = __webpack_require__(174);
  10560. var lazy = new LazyResult(new Processor(), this, opts);
  10561. return lazy.stringify();
  10562. };
  10563. /**
  10564. * @memberof Root#
  10565. * @member {object} raws - Information to generate byte-to-byte equal
  10566. * node string as it was in the origin input.
  10567. *
  10568. * Every parser saves its own properties,
  10569. * but the default CSS parser uses:
  10570. *
  10571. * * `after`: the space symbols after the last child to the end of file.
  10572. * * `semicolon`: is the last child has an (optional) semicolon.
  10573. *
  10574. * @example
  10575. * postcss.parse('a {}\n').raws //=> { after: '\n' }
  10576. * postcss.parse('a {}').raws //=> { after: '' }
  10577. */
  10578. return Root;
  10579. }(_container2.default);
  10580. exports.default = Root;
  10581. module.exports = exports['default'];
  10582. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvb3QuZXM2Il0sIm5hbWVzIjpbIlJvb3QiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsInJlbW92ZUNoaWxkIiwiY2hpbGQiLCJpZ25vcmUiLCJpbmRleCIsImxlbmd0aCIsInJhd3MiLCJiZWZvcmUiLCJub3JtYWxpemUiLCJzYW1wbGUiLCJmaXJzdCIsIm5vZGUiLCJ0b1Jlc3VsdCIsIm9wdHMiLCJMYXp5UmVzdWx0IiwicmVxdWlyZSIsIlByb2Nlc3NvciIsImxhenkiLCJzdHJpbmdpZnkiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7SUFVTUEsSTs7O0FBRUYsa0JBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsc0JBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQUwsR0FBWSxNQUFaO0FBQ0EsWUFBSyxDQUFDLE1BQUtDLEtBQVgsRUFBbUIsTUFBS0EsS0FBTCxHQUFhLEVBQWI7QUFIRDtBQUlyQjs7bUJBRURDLFcsd0JBQVlDLEssRUFBT0MsTSxFQUFRO0FBQ3ZCLFlBQU1DLFFBQVEsS0FBS0EsS0FBTCxDQUFXRixLQUFYLENBQWQ7O0FBRUEsWUFBSyxDQUFDQyxNQUFELElBQVdDL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ICAgICAgY29uc3QgaW5kZXggPSB0aGlzLmluZGV4KGNoaWxkKTtcblxuICAgICAgICBpZiAoICFpZ25vcmUgJiYgaW5kZXggPT09IDAgJiYgdGhpcy5ub2Rlcy5sZW5ndGggPiAxICkge1xuICAgICAgICAgICAgdGhpcy5ub2Rlc1sxXS5yYXdzLmJlZm9yZSA9IHRoaXMubm9kZXNbaW5kZXhdLnJhd3MuYmVmb3JlO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHN1cGVyLnJlbW92ZUNoaWxkKGNoaWxkKTtcbiAgICB9XG5cbiAgICBub3JtYWxpemUoY2hpbGQsIHNhbXBsZSwgdHlwZSkge1xuICAgICAgICBsZXQgbm9kZXMgPSBzdXBlci5ub3JtYWxpemUoY2hpbGQpO1xuXG4gICAgICAgIGlmICggc2FtcGxlICkge1xuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAncHJlcGVuZCcgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLm5vZGVzLmxlbmd0aCA+IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbXBsZS5yYXdzLmJlZm9yZSA9IHRoaXMubm9kZXNbMV0ucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNhbXBsZS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0aGlzLmZpcnN0ICE9PSBzYW1wbGUgKSB7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IG5vZGUgb2Ygbm9kZXMgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUucmF3cy5iZWZvcmUgPSBzYW1wbGUucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG5vZGVzO1xuICAgIH1cblxuICAgIC8qKlxuIC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sXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSBzdHJpbmcgYXMgaXQgd2FzIGluIHRoZSBvcmlnaW4gaW5wdXQuXG4gICAgICpcbiAgICAgKiBFdmVyeSBwYXJzZXIgc2F2ZXMgaXRzIG93biBwcm9wZXJ0aWVzLFxuICAgICAqIGJ1dCB0aGUgZGVmYXVsdCBDU1MgcGFyc2VyIHVzZXM6XG4gICAgICpcbiAgICAgKiAqIGBhZnRlcmA6IHRoZSBzcGFjZSBzeW1ib2xzIGFmdGVyIHRoZSBsYXN0IGNoaWxkIHRvIHRoZSBlbmQgb2YgZmlsZS5cbiAgICAgKiAqIGBzZW1pY29sb25gOiBpcyB0aGUgbGFzdCBjaGlsZCBoYXMgYW4gKG9wdGlvbmFsKSBzZW1pY29sb24uXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MucGFyc2UoJ2Ege31cXG4nKS5yYXdzIC8vPT4geyBhZnRlcjogJ1xcbicgfVxuICAgICAqIHBvc3Rjc3MucGFyc2UoJ2Ege30nKS5yYXdzICAgLy89PiB7IGFmdGVyOiAnJyB9XG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUm9vdDtcbiJdfQ==
  10583. /***/ }),
  10584. /* 60 */
  10585. /***/ (function(module, exports, __webpack_require__) {
  10586. "use strict";
  10587. exports.__esModule = true;
  10588. exports.default = stringify;
  10589. var _stringifier = __webpack_require__(32);
  10590. var _stringifier2 = _interopRequireDefault(_stringifier);
  10591. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10592. function stringify(node, builder) {
  10593. var str = new _stringifier2.default(builder);
  10594. str.stringify(node);
  10595. }
  10596. module.exports = exports['default'];
  10597. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmeS5lczYiXSwibmFtZXMiOlsic3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLFM7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxJQUFuQixFQUF5QkMsT0FBekIsRUFBa0M7QUFDN0MsUUFBSUMsTUFBTSwwQkFBZ0JELE9BQWhCLENBQVY7QUFDQUMsUUFBSUgsU0FBSixDQUFjQyxJQUFkO0FBQ0giLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFN0cmluZ2lmaWVyIGZyb20gJy4vc3RyaW5naWZpZXInO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU3RyaW5naWZpZXIoYnVpbGRlcik7XG4gICAgc3RyLnN0cmluZ2lmeShub2RlKTtcbn1cbiJdfQ==
  10598. /***/ }),
  10599. /* 61 */
  10600. /***/ (function(module, exports, __webpack_require__) {
  10601. "use strict";
  10602. exports.__esModule = true;
  10603. exports.default = tokenizer;
  10604. var SINGLE_QUOTE = 39;
  10605. var DOUBLE_QUOTE = 34;
  10606. var BACKSLASH = 92;
  10607. var SLASH = 47;
  10608. var NEWLINE = 10;
  10609. var SPACE = 32;
  10610. var FEED = 12;
  10611. var TAB = 9;
  10612. var CR = 13;
  10613. var OPEN_SQUARE = 91;
  10614. var CLOSE_SQUARE = 93;
  10615. var OPEN_PARENTHESES = 40;
  10616. var CLOSE_PARENTHESES = 41;
  10617. var OPEN_CURLY = 123;
  10618. var CLOSE_CURLY = 125;
  10619. var SEMICOLON = 59;
  10620. var ASTERISK = 42;
  10621. var COLON = 58;
  10622. var AT = 64;
  10623. var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  10624. var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
  10625. var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
  10626. var RE_HEX_ESCAPE = /[a-f0-9]/i;
  10627. function tokenizer(input) {
  10628. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10629. var css = input.css.valueOf();
  10630. var ignore = options.ignoreErrors;
  10631. var code = void 0,
  10632. next = void 0,
  10633. quote = void 0,
  10634. lines = void 0,
  10635. last = void 0,
  10636. content = void 0,
  10637. escape = void 0,
  10638. nextLine = void 0,
  10639. nextOffset = void 0,
  10640. escaped = void 0,
  10641. escapePos = void 0,
  10642. prev = void 0,
  10643. n = void 0,
  10644. currentToken = void 0;
  10645. var length = css.length;
  10646. var offset = -1;
  10647. var line = 1;
  10648. var pos = 0;
  10649. var buffer = [];
  10650. var returned = [];
  10651. function unclosed(what) {
  10652. throw input.error('Unclosed ' + what, line, pos - offset);
  10653. }
  10654. function endOfFile() {
  10655. return returned.length === 0 && pos >= length;
  10656. }
  10657. function nextToken() {
  10658. if (returned.length) return returned.pop();
  10659. if (pos >= length) return;
  10660. code = css.charCodeAt(pos);
  10661. if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
  10662. offset = pos;
  10663. line += 1;
  10664. }
  10665. switch (code) {
  10666. case NEWLINE:
  10667. case SPACE:
  10668. case TAB:
  10669. case CR:
  10670. case FEED:
  10671. next = pos;
  10672. do {
  10673. next += 1;
  10674. code = css.charCodeAt(next);
  10675. if (code === NEWLINE) {
  10676. offset = next;
  10677. line += 1;
  10678. }
  10679. } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
  10680. currentToken = ['space', css.slice(pos, next)];
  10681. pos = next - 1;
  10682. break;
  10683. case OPEN_SQUARE:
  10684. currentToken = ['[', '[', line, pos - offset];
  10685. break;
  10686. case CLOSE_SQUARE:
  10687. currentToken = [']', ']', line, pos - offset];
  10688. break;
  10689. case OPEN_CURLY:
  10690. currentToken = ['{', '{', line, pos - offset];
  10691. break;
  10692. case CLOSE_CURLY:
  10693. currentToken = ['}', '}', line, pos - offset];
  10694. break;
  10695. case COLON:
  10696. currentToken = [':', ':', line, pos - offset];
  10697. break;
  10698. case SEMICOLON:
  10699. currentToken = [';', ';', line, pos - offset];
  10700. break;
  10701. case OPEN_PARENTHESES:
  10702. prev = buffer.length ? buffer.pop()[1] : '';
  10703. n = css.charCodeAt(pos + 1);
  10704. if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
  10705. next = pos;
  10706. do {
  10707. escaped = false;
  10708. next = css.indexOf(')', next + 1);
  10709. if (next === -1) {
  10710. if (ignore) {
  10711. next = pos;
  10712. break;
  10713. } else {
  10714. unclosed('bracket');
  10715. }
  10716. }
  10717. escapePos = next;
  10718. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  10719. escapePos -= 1;
  10720. escaped = !escaped;
  10721. }
  10722. } while (escaped);
  10723. currentToken = ['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10724. pos = next;
  10725. } else {
  10726. next = css.indexOf(')', pos + 1);
  10727. content = css.slice(pos, next + 1);
  10728. if (next === -1 || RE_BAD_BRACKET.test(content)) {
  10729. currentToken = ['(', '(', line, pos - offset];
  10730. } else {
  10731. currentToken = ['brackets', content, line, pos - offset, line, next - offset];
  10732. pos = next;
  10733. }
  10734. }
  10735. break;
  10736. case CLOSE_PARENTHESES:
  10737. currentToken = [')', ')', line, pos - offset];
  10738. break;
  10739. case SINGLE_QUOTE:
  10740. case DOUBLE_QUOTE:
  10741. quote = code === SINGLE_QUOTE ? '\'' : '"';
  10742. next = pos;
  10743. do {
  10744. escaped = false;
  10745. next = css.indexOf(quote, next + 1);
  10746. if (next === -1) {
  10747. if (ignore) {
  10748. next = pos + 1;
  10749. break;
  10750. } else {
  10751. unclosed('string');
  10752. }
  10753. }
  10754. escapePos = next;
  10755. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  10756. escapePos -= 1;
  10757. escaped = !escaped;
  10758. }
  10759. } while (escaped);
  10760. content = css.slice(pos, next + 1);
  10761. lines = content.split('\n');
  10762. last = lines.length - 1;
  10763. if (last > 0) {
  10764. nextLine = line + last;
  10765. nextOffset = next - lines[last].length;
  10766. } else {
  10767. nextLine = line;
  10768. nextOffset = offset;
  10769. }
  10770. currentToken = ['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset];
  10771. offset = nextOffset;
  10772. line = nextLine;
  10773. pos = next;
  10774. break;
  10775. case AT:
  10776. RE_AT_END.lastIndex = pos + 1;
  10777. RE_AT_END.test(css);
  10778. if (RE_AT_END.lastIndex === 0) {
  10779. next = css.length - 1;
  10780. } else {
  10781. next = RE_AT_END.lastIndex - 2;
  10782. }
  10783. currentToken = ['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10784. pos = next;
  10785. break;
  10786. case BACKSLASH:
  10787. next = pos;
  10788. escape = true;
  10789. while (css.charCodeAt(next + 1) === BACKSLASH) {
  10790. next += 1;
  10791. escape = !escape;
  10792. }
  10793. code = css.charCodeAt(next + 1);
  10794. if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
  10795. next += 1;
  10796. if (RE_HEX_ESCAPE.test(css.charAt(next))) {
  10797. while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
  10798. next += 1;
  10799. }
  10800. if (css.charCodeAt(next + 1) === SPACE) {
  10801. next += 1;
  10802. }
  10803. }
  10804. }
  10805. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10806. pos = next;
  10807. break;
  10808. default:
  10809. if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
  10810. next = css.indexOf('*/', pos + 2) + 1;
  10811. if (next === 0) {
  10812. if (ignore) {
  10813. next = css.length;
  10814. } else {
  10815. unclosed('comment');
  10816. }
  10817. }
  10818. content = css.slice(pos, next + 1);
  10819. lines = content.split('\n');
  10820. last = lines.length - 1;
  10821. if (last > 0) {
  10822. nextLine = line + last;
  10823. nextOffset = next - lines[last].length;
  10824. } else {
  10825. nextLine = line;
  10826. nextOffset = offset;
  10827. }
  10828. currentToken = ['comment', content, line, pos - offset, nextLine, next - nextOffset];
  10829. offset = nextOffset;
  10830. line = nextLine;
  10831. pos = next;
  10832. } else {
  10833. RE_WORD_END.lastIndex = pos + 1;
  10834. RE_WORD_END.test(css);
  10835. if (RE_WORD_END.lastIndex === 0) {
  10836. next = css.length - 1;
  10837. } else {
  10838. next = RE_WORD_END.lastIndex - 2;
  10839. }
  10840. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10841. buffer.push(currentToken);
  10842. pos = next;
  10843. }
  10844. break;
  10845. }
  10846. pos++;
  10847. return currentToken;
  10848. }
  10849. function back(token) {
  10850. returned.push(token);
  10851. }
  10852. return {
  10853. back: back,
  10854. nextToken: nextToken,
  10855. endOfFile: endOfFile
  10856. };
  10857. }
  10858. module.exports = exports['default'];
  10859. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRva2VuaXplLmVzNiJdLCJuYW1lcyI6WyJ0b2tlbml6ZXIiLCJTSU5HTEVfUVVPVEUiLCJET1VCTEVfUVVPVEUiLCJCQUNLU0xBU0giLCJTTEFTSCIsIk5FV0xJTkUiLCJTUEFDRSIsIkZFRUQiLCJUQUIiLCJDUiIsIk9QRU5fU1FVQVJFIiwiQ0xPU0VfU1FVQVJFIiwiT1BFTl9QQVJFTlRIRVNFUyIsIkNMT1NFX1BBUkVOVEhFU0VTIiwiT1BFTl9DVVJMWSIsIkNMT1NFX0NVUkxZIiwiU0VNSUNPTE9OIiwiQVNURVJJU0siLCJDT0xPTiIsIkFUIiwiUkVfQVRfRU5EIiwiUkVfV09SRF9FTkQiLCJSRV9CQURfQlJBQ0tFVCIsIlJFX0hFWF9FU0NBUEUiLCJpbnB1dCIsIm9wdGlvbnMiLCJjc3MiLCJ2YWx1ZU9mIi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ICggcG9zID49IGxlbmd0aCApIHJldHVybjtcblxuICAgICAgICBjb2RlID0gY3NzLmNoYXJDb2RlQXQocG9zKTtcbiAgICAgICAgaWYgKCBjb2RlID09PSBORVdMSU5FIHx8IGNvZGUgPT09IEZFRUQgfHxcbiAgICAgICAgICAgICBjb2RlID09PSBDUiAmJiBjc3MuY2hhckNvZGVBdChwb3MgKyAxKSAhPT0gTkVXTElORSApIHtcbiAgICAgICAgICAgIG9mZnNldCA9IHBvcztcbiAgICAgICAgICAgIGxpbmUgKz0gMTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAoIGNvZGUgKSB7XG4gICAgICAgIGNhc2UgTkVXTElORTpcbiAgICAgICAgY2FzZSBTUEFDRTpcbiAgICAgICAgY2FzZSBUQUI6XG4gICAgICAgIGNhc2UgQ1I6XG4gICAgICAgIGNhc2UgRkVFRDpcbiAgICAgICAgICAgIG5leHQgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgKSB7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxpbmUgKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICggY29kZSA9PT0gU1BBQ0UgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IE5FV0xJTkUgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBUQUIgICAgIHx8XG4gICAgICAgICAgICAgICAgICAgICAgY29kZSA9PT0gQ1IgICAgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IEZFRUQgKTtcblxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydzcGFjZScsIGNzcy5zbGljZShwb3MsIG5leHQpXTtcbiAgICAgICAgICAgIHBvcyA9IG5leHQgLSAxO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1NRVUFSRTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnWycsICdbJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfU1FVQVJFOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyddJywgJ10nLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX0NVUkxZOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyd7JywgJ3snLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTE9TRV9DVVJMWTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnfScsICd9JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ09MT046XG4gICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJzonLCAnOicsIGxpbmUsIHBvcyAtIG9mZnNldF07XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIFNFTUlDT0xPTjpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnOycsICc7JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgT1BFTl9QQVJFTlRIRVNFUzpcbiAgICAgICAgICAgIHByZXYgPSBidWZmZXIubGVuZ3RoID8gYnVmZmVyLnBvcCgpWzFdIDogJyc7XG4gICAgICAgICAgICBuICAgID0gY3NzLmNoYXJDb2RlQXQocG9zICsgMSk7XG4gICAgICAgICAgICBpZiAoIHByZXYgPT09ICd1cmwnICYmXG4gICAgICAgICAgICAgICAgIG4gIT09IFNJTkdMRV9RVU9URSAmJiBuICE9PSBET1VCTEVfUVVPVEUgJiZcbiAgICAgICAgICAgICAgICAgbiAhPT0gU1BBQ0UgJiYgbiAhPT0gTkVXTElORSAmJiBuICE9PSBUQUIgJiZcbiAgICAgICAgICAgICAgICAgbiAhPT0gRkVFRCAmJiBuICE9PSBDUiApIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBuZXh0ICAgID0gY3NzLmluZGV4T2YoJyknLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmNsb3NlZCgnYnJhY2tldCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQoZXNjYXBlUG9zIC0gMSkgPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyAtPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoIGVzY2FwZWQgKTtcblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnYnJhY2tldHMnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0ICAgID0gY3NzLmluZGV4T2YoJyknLCBwb3MgKyAxKTtcbiAgICAgICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAtMSB8fCBSRV9CQURfQlJBQ0tFVC50ZXN0KGNvbnRlbnQpICkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJygnLCAnKCcsIGxpbmUsIHBvcyAtIG9mZnNldF07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydicmFja2V0cycsIGNvbnRlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTE9TRV9QQVJFTlRIRVNFUzpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnKScsICcpJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgU0lOR0xFX1FVT1RFOlxuICAgICAgICBjYXNlIERPVUJMRV9RVU9URTpcbiAgICAgICAgICAgIHF1b3RlID0gY29kZSA9PT0gU0lOR0xFX1FVT1RFID8gJ1xcJycgOiAnXCInO1xuICAgICAgICAgICAgbmV4dCAgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgZXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIG5leHQgICAgPSBjc3MuaW5kZXhPZihxdW90ZSwgbmV4dCArIDEpO1xuICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggaWdub3JlICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IHBvcyArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuY2xvc2VkKCdzdHJpbmcnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlc2NhcGVQb3MgPSBuZXh0O1xuICAgICAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQoZXNjYXBlUG9zIC0gMSkgPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlUG9zIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZWQgPSAhZXNjYXBlZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICggZXNjYXBlZCApO1xuXG4gICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgbGFzdCAgICA9IGxpbmVzLmxlbmd0aCAtIDE7XG5cbiAgICAgICAgICAgIGlmICggbGFzdCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBuZXh0IC0gbGluZXNbbGFzdF0ubGVuZ3RoO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gb2Zmc2V0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ3N0cmluZycsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIG5leHRMaW5lLCBuZXh0IC0gbmV4dE9mZnNldFxuICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgb2Zmc2V0ID0gbmV4dE9mZnNldDtcbiAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQVQ6XG4gICAgICAgICAgICBSRV9BVF9FTkQubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgIFJFX0FUX0VORC50ZXN0KGNzcyk7XG4gICAgICAgICAgICBpZiAoIFJFX0FUX0VORC5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gUkVfQVRfRU5ELmxhc3RJbmRleCAtIDI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnYXQtd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIEJBQ0tTTEFTSDpcbiAgICAgICAgICAgIG5leHQgICA9IHBvcztcbiAgICAgICAgICAgIGVzY2FwZSA9IHRydWU7XG4gICAgICAgICAgICB3aGlsZSAoIGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgIG5leHQgICs9IDE7XG4gICAgICAgICAgICAgICAgZXNjYXBlID0gIWVzY2FwZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0ICsgMSk7XG4gICAgICAgICAgICBpZiAoIGVzY2FwZSAmJiAoY29kZSAhPT0gU0xBU0ggICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IFNQQUNFICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBORVdMSU5FICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gVEFCICAgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IENSICAgICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBGRUVEICkgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGlmICggUkVfSEVYX0VTQ0FQRS50ZXN0KGNzcy5jaGFyQXQobmV4dCkpICkge1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoIFJFX0hFWF9FU0NBUEUudGVzdChjc3MuY2hhckF0KG5leHQgKyAxKSkgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCBjc3MuY2hhckNvZGVBdChuZXh0ICsgMSkgPT09IFNQQUNFICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ3dvcmQnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICBsaW5lLCBuZXh0IC0gb2Zmc2V0XG4gICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGlmICggY29kZSA9PT0gU0xBU0ggJiYgY3NzLmNoYXJDb2RlQXQocG9zICsgMSkgPT09IEFTVEVSSVNLICkge1xuICAgICAgICAgICAgICAgIG5leHQgPSBjc3MuaW5kZXhPZignKi8nLCBwb3MgKyAyKSArIDE7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAwICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ2NvbW1lbnQnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgICAgIGxhc3QgICAgPSBsaW5lcy5sZW5ndGggLSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbmV4dCAtIGxpbmVzW2xhc3RdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ2NvbW1lbnQnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHRPZmZzZXQ7XG4gICAgICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBSRV9XT1JEX0VORC5sYXN0SW5kZXggPSBwb3MgKyAxO1xuICAgICAgICAgICAgICAgIFJFX1dPUkRfRU5ELnRlc3QoY3NzKTtcbiAgICAgICAgICAgICAgICBpZiAoIFJFX1dPUkRfRU5ELmxhc3RJbmRleCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBSRV9XT1JEX0VORC5sYXN0SW5kZXggLSAyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICBidWZmZXIucHVzaChjdXJyZW50VG9rZW4pO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBwb3MrKztcbiAgICAgICAgcmV0dXJuIGN1cnJlbnRUb2tlbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBiYWNrKHRva2VuKSB7XG4gICAgICAgIHJldHVybmVkLnB1c2godG9rZW4pO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAgIGJhY2ssXG4gICAgICAgIG5leHRUb2tlbixcbiAgICAgICAgZW5kT2ZGaWxlXG4gICAgfTtcbn1cbiJdfQ==
  10860. /***/ }),
  10861. /* 62 */
  10862. /***/ (function(module, exports, __webpack_require__) {
  10863. "use strict";
  10864. exports.__esModule = true;
  10865. exports.default = warnOnce;
  10866. var printed = {};
  10867. function warnOnce(message) {
  10868. if (printed[message]) return;
  10869. printed[message] = true;
  10870. if (typeof console !== 'undefined' && console.warn) console.warn(message);
  10871. }
  10872. module.exports = exports['default'];
  10873. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm4tb25jZS5lczYiXSwibmFtZXMiOlsid2Fybk9uY2UiLCJwcmludGVkIiwibWVzc2FnZSIsImNvbnNvbGUiLCJ3YXJuIl0sIm1hcHBpbmdzIjoiOzs7a0JBRXdCQSxRO0FBRnhCLElBQUlDLFVBQVUsRUFBZDs7QUFFZSxTQUFTRCxRQUFULENBQWtCRSxPQUFsQixFQUEyQjtBQUN0QyxRQUFLRCxRQUFRQyxPQUFSLENBQUwsRUFBd0I7QUFDeEJELFlBQVFDLE9BQVIsSUFBbUIsSUFBbkI7O0FBRUEsUUFBSyxPQUFPQyxPQUFQLEtBQW1CLFdBQW5CLElBQWtDQSxRQUFRQyxJQUEvQyxFQUFzREQsUUFBUUMsSUFBUixDQUFhRixPQUFiO0FBQ3pEIiwiZmlsZSI6Indhcm4tb25jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBwcmludGVkID0geyB9O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB3YXJuT25jZShtZXNzYWdlKSB7XG4gICAgaWYgKCBwcmludGVkW21lc3NhZ2VdICkgcmV0dXJuO1xuICAgIHByaW50ZWRbbWVzc2FnZV0gPSB0cnVlO1xuXG4gICAgaWYgKCB0eXBlb2YgY29uc29sZSAhPT0gJ3VuZGVmaW5lZCcgJiYgY29uc29sZS53YXJuICkgY29uc29sZS53YXJuKG1lc3NhZ2UpO1xufVxuIl19
  10874. /***/ }),
  10875. /* 63 */
  10876. /***/ (function(module, exports, __webpack_require__) {
  10877. /* -*- Mode: js; js-indent-level: 2; -*- */
  10878. /*
  10879. * Copyright 2011 Mozilla Foundation and contributors
  10880. * Licensed under the New BSD license. See LICENSE or:
  10881. * http://opensource.org/licenses/BSD-3-Clause
  10882. */
  10883. var util = __webpack_require__(14);
  10884. var has = Object.prototype.hasOwnProperty;
  10885. var hasNativeMap = typeof Map !== "undefined";
  10886. /**
  10887. * A data structure which is a combination of an array and a set. Adding a new
  10888. * member is O(1), testing for membership is O(1), and finding the index of an
  10889. * element is O(1). Removing elements from the set is not supported. Only
  10890. * strings are supported for membership.
  10891. */
  10892. function ArraySet() {
  10893. this._array = [];
  10894. this._set = hasNativeMap ? new Map() : Object.create(null);
  10895. }
  10896. /**
  10897. * Static method for creating ArraySet instances from an existing array.
  10898. */
  10899. ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  10900. var set = new ArraySet();
  10901. for (var i = 0, len = aArray.length; i < len; i++) {
  10902. set.add(aArray[i], aAllowDuplicates);
  10903. }
  10904. return set;
  10905. };
  10906. /**
  10907. * Return how many unique items are in this ArraySet. If duplicates have been
  10908. * added, than those do not count towards the size.
  10909. *
  10910. * @returns Number
  10911. */
  10912. ArraySet.prototype.size = function ArraySet_size() {
  10913. return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
  10914. };
  10915. /**
  10916. * Add the given string to this set.
  10917. *
  10918. * @param String aStr
  10919. */
  10920. ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  10921. var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
  10922. var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
  10923. var idx = this._array.length;
  10924. if (!isDuplicate || aAllowDuplicates) {
  10925. this._array.push(aStr);
  10926. }
  10927. if (!isDuplicate) {
  10928. if (hasNativeMap) {
  10929. this._set.set(aStr, idx);
  10930. } else {
  10931. this._set[sStr] = idx;
  10932. }
  10933. }
  10934. };
  10935. /**
  10936. * Is the given string a member of this set?
  10937. *
  10938. * @param String aStr
  10939. */
  10940. ArraySet.prototype.has = function ArraySet_has(aStr) {
  10941. if (hasNativeMap) {
  10942. return this._set.has(aStr);
  10943. } else {
  10944. var sStr = util.toSetString(aStr);
  10945. return has.call(this._set, sStr);
  10946. }
  10947. };
  10948. /**
  10949. * What is the index of the given string in the array?
  10950. *
  10951. * @param String aStr
  10952. */
  10953. ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  10954. if (hasNativeMap) {
  10955. var idx = this._set.get(aStr);
  10956. if (idx >= 0) {
  10957. return idx;
  10958. }
  10959. } else {
  10960. var sStr = util.toSetString(aStr);
  10961. if (has.call(this._set, sStr)) {
  10962. return this._set[sStr];
  10963. }
  10964. }
  10965. throw new Error('"' + aStr + '" is not in the set.');
  10966. };
  10967. /**
  10968. * What is the element at the given index?
  10969. *
  10970. * @param Number aIdx
  10971. */
  10972. ArraySet.prototype.at = function ArraySet_at(aIdx) {
  10973. if (aIdx >= 0 && aIdx < this._array.length) {
  10974. return this._array[aIdx];
  10975. }
  10976. throw new Error('No element indexed by ' + aIdx);
  10977. };
  10978. /**
  10979. * Returns the array representation of this set (which has the proper indices
  10980. * indicated by indexOf). Note that this is a copy of the internal array used
  10981. * for storing the members so that no one can mess with internal state.
  10982. */
  10983. ArraySet.prototype.toArray = function ArraySet_toArray() {
  10984. return this._array.slice();
  10985. };
  10986. exports.ArraySet = ArraySet;
  10987. /***/ }),
  10988. /* 64 */
  10989. /***/ (function(module, exports, __webpack_require__) {
  10990. /* -*- Mode: js; js-indent-level: 2; -*- */
  10991. /*
  10992. * Copyright 2011 Mozilla Foundation and contributors
  10993. * Licensed under the New BSD license. See LICENSE or:
  10994. * http://opensource.org/licenses/BSD-3-Clause
  10995. *
  10996. * Based on the Base 64 VLQ implementation in Closure Compiler:
  10997. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  10998. *
  10999. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  11000. * Redistribution and use in source and binary forms, with or without
  11001. * modification, are permitted provided that the following conditions are
  11002. * met:
  11003. *
  11004. * * Redistributions of source code must retain the above copyright
  11005. * notice, this list of conditions and the following disclaimer.
  11006. * * Redistributions in binary form must reproduce the above
  11007. * copyright notice, this list of conditions and the following
  11008. * disclaimer in the documentation and/or other materials provided
  11009. * with the distribution.
  11010. * * Neither the name of Google Inc. nor the names of its
  11011. * contributors may be used to endorse or promote products derived
  11012. * from this software without specific prior written permission.
  11013. *
  11014. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  11015. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  11016. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  11017. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  11018. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  11019. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11020. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  11021. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11022. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  11023. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  11024. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  11025. */
  11026. var base64 = __webpack_require__(178);
  11027. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  11028. // length quantities we use in the source map spec, the first bit is the sign,
  11029. // the next four bits are the actual value, and the 6th bit is the
  11030. // continuation bit. The continuation bit tells us whether there are more
  11031. // digits in this value following this digit.
  11032. //
  11033. // Continuation
  11034. // | Sign
  11035. // | |
  11036. // V V
  11037. // 101011
  11038. var VLQ_BASE_SHIFT = 5;
  11039. // binary: 100000
  11040. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  11041. // binary: 011111
  11042. var VLQ_BASE_MASK = VLQ_BASE - 1;
  11043. // binary: 100000
  11044. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  11045. /**
  11046. * Converts from a two-complement value to a value where the sign bit is
  11047. * placed in the least significant bit. For example, as decimals:
  11048. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  11049. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  11050. */
  11051. function toVLQSigned(aValue) {
  11052. return aValue < 0
  11053. ? ((-aValue) << 1) + 1
  11054. : (aValue << 1) + 0;
  11055. }
  11056. /**
  11057. * Converts to a two-complement value from a value where the sign bit is
  11058. * placed in the least significant bit. For example, as decimals:
  11059. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  11060. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  11061. */
  11062. function fromVLQSigned(aValue) {
  11063. var isNegative = (aValue & 1) === 1;
  11064. var shifted = aValue >> 1;
  11065. return isNegative
  11066. ? -shifted
  11067. : shifted;
  11068. }
  11069. /**
  11070. * Returns the base 64 VLQ encoded value.
  11071. */
  11072. exports.encode = function base64VLQ_encode(aValue) {
  11073. var encoded = "";
  11074. var digit;
  11075. var vlq = toVLQSigned(aValue);
  11076. do {
  11077. digit = vlq & VLQ_BASE_MASK;
  11078. vlq >>>= VLQ_BASE_SHIFT;
  11079. if (vlq > 0) {
  11080. // There are still more digits in this value, so we must make sure the
  11081. // continuation bit is marked.
  11082. digit |= VLQ_CONTINUATION_BIT;
  11083. }
  11084. encoded += base64.encode(digit);
  11085. } while (vlq > 0);
  11086. return encoded;
  11087. };
  11088. /**
  11089. * Decodes the next base 64 VLQ value from the given string and returns the
  11090. * value and the rest of the string via the out parameter.
  11091. */
  11092. exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  11093. var strLen = aStr.length;
  11094. var result = 0;
  11095. var shift = 0;
  11096. var continuation, digit;
  11097. do {
  11098. if (aIndex >= strLen) {
  11099. throw new Error("Expected more digits in base 64 VLQ value.");
  11100. }
  11101. digit = base64.decode(aStr.charCodeAt(aIndex++));
  11102. if (digit === -1) {
  11103. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  11104. }
  11105. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  11106. digit &= VLQ_BASE_MASK;
  11107. result = result + (digit << shift);
  11108. shift += VLQ_BASE_SHIFT;
  11109. } while (continuation);
  11110. aOutParam.value = fromVLQSigned(result);
  11111. aOutParam.rest = aIndex;
  11112. };
  11113. /***/ }),
  11114. /* 65 */
  11115. /***/ (function(module, exports, __webpack_require__) {
  11116. /* -*- Mode: js; js-indent-level: 2; -*- */
  11117. /*
  11118. * Copyright 2011 Mozilla Foundation and contributors
  11119. * Licensed under the New BSD license. See LICENSE or:
  11120. * http://opensource.org/licenses/BSD-3-Clause
  11121. */
  11122. var base64VLQ = __webpack_require__(64);
  11123. var util = __webpack_require__(14);
  11124. var ArraySet = __webpack_require__(63).ArraySet;
  11125. var MappingList = __webpack_require__(180).MappingList;
  11126. /**
  11127. * An instance of the SourceMapGenerator represents a source map which is
  11128. * being built incrementally. You may pass an object with the following
  11129. * properties:
  11130. *
  11131. * - file: The filename of the generated source.
  11132. * - sourceRoot: A root for all relative URLs in this source map.
  11133. */
  11134. function SourceMapGenerator(aArgs) {
  11135. if (!aArgs) {
  11136. aArgs = {};
  11137. }
  11138. this._file = util.getArg(aArgs, 'file', null);
  11139. this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  11140. this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  11141. this._sources = new ArraySet();
  11142. this._names = new ArraySet();
  11143. this._mappings = new MappingList();
  11144. this._sourcesContents = null;
  11145. }
  11146. SourceMapGenerator.prototype._version = 3;
  11147. /**
  11148. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  11149. *
  11150. * @param aSourceMapConsumer The SourceMap.
  11151. */
  11152. SourceMapGenerator.fromSourceMap =
  11153. function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  11154. var sourceRoot = aSourceMapConsumer.sourceRoot;
  11155. var generator = new SourceMapGenerator({
  11156. file: aSourceMapConsumer.file,
  11157. sourceRoot: sourceRoot
  11158. });
  11159. aSourceMapConsumer.eachMapping(function (mapping) {
  11160. var newMapping = {
  11161. generated: {
  11162. line: mapping.generatedLine,
  11163. column: mapping.generatedColumn
  11164. }
  11165. };
  11166. if (mapping.source != null) {
  11167. newMapping.source = mapping.source;
  11168. if (sourceRoot != null) {
  11169. newMapping.source = util.relative(sourceRoot, newMapping.source);
  11170. }
  11171. newMapping.original = {
  11172. line: mapping.originalLine,
  11173. column: mapping.originalColumn
  11174. };
  11175. if (mapping.name != null) {
  11176. newMapping.name = mapping.name;
  11177. }
  11178. }
  11179. generator.addMapping(newMapping);
  11180. });
  11181. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  11182. var sourceRelative = sourceFile;
  11183. if (sourceRoot !== null) {
  11184. sourceRelative = util.relative(sourceRoot, sourceFile);
  11185. }
  11186. if (!generator._sources.has(sourceRelative)) {
  11187. generator._sources.add(sourceRelative);
  11188. }
  11189. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  11190. if (content != null) {
  11191. generator.setSourceContent(sourceFile, content);
  11192. }
  11193. });
  11194. return generator;
  11195. };
  11196. /**
  11197. * Add a single mapping from original source line and column to the generated
  11198. * source's line and column for this source map being created. The mapping
  11199. * object should have the following properties:
  11200. *
  11201. * - generated: An object with the generated line and column positions.
  11202. * - original: An object with the original line and column positions.
  11203. * - source: The original source file (relative to the sourceRoot).
  11204. * - name: An optional original token name for this mapping.
  11205. */
  11206. SourceMapGenerator.prototype.addMapping =
  11207. function SourceMapGenerator_addMapping(aArgs) {
  11208. var generated = util.getArg(aArgs, 'generated');
  11209. var original = util.getArg(aArgs, 'original', null);
  11210. var source = util.getArg(aArgs, 'source', null);
  11211. var name = util.getArg(aArgs, 'name', null);
  11212. if (!this._skipValidation) {
  11213. this._validateMapping(generated, original, source, name);
  11214. }
  11215. if (source != null) {
  11216. source = String(source);
  11217. if (!this._sources.has(source)) {
  11218. this._sources.add(source);
  11219. }
  11220. }
  11221. if (name != null) {
  11222. name = String(name);
  11223. if (!this._names.has(name)) {
  11224. this._names.add(name);
  11225. }
  11226. }
  11227. this._mappings.add({
  11228. generatedLine: generated.line,
  11229. generatedColumn: generated.column,
  11230. originalLine: original != null && original.line,
  11231. originalColumn: original != null && original.column,
  11232. source: source,
  11233. name: name
  11234. });
  11235. };
  11236. /**
  11237. * Set the source content for a source file.
  11238. */
  11239. SourceMapGenerator.prototype.setSourceContent =
  11240. function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  11241. var source = aSourceFile;
  11242. if (this._sourceRoot != null) {
  11243. source = util.relative(this._sourceRoot, source);
  11244. }
  11245. if (aSourceContent != null) {
  11246. // Add the source content to the _sourcesContents map.
  11247. // Create a new _sourcesContents map if the property is null.
  11248. if (!this._sourcesContents) {
  11249. this._sourcesContents = Object.create(null);
  11250. }
  11251. this._sourcesContents[util.toSetString(source)] = aSourceContent;
  11252. } else if (this._sourcesContents) {
  11253. // Remove the source file from the _sourcesContents map.
  11254. // If the _sourcesContents map is empty, set the property to null.
  11255. delete this._sourcesContents[util.toSetString(source)];
  11256. if (Object.keys(this._sourcesContents).length === 0) {
  11257. this._sourcesContents = null;
  11258. }
  11259. }
  11260. };
  11261. /**
  11262. * Applies the mappings of a sub-source-map for a specific source file to the
  11263. * source map being generated. Each mapping to the supplied source file is
  11264. * rewritten using the supplied source map. Note: The resolution for the
  11265. * resulting mappings is the minimium of this map and the supplied map.
  11266. *
  11267. * @param aSourceMapConsumer The source map to be applied.
  11268. * @param aSourceFile Optional. The filename of the source file.
  11269. * If omitted, SourceMapConsumer's file property will be used.
  11270. * @param aSourceMapPath Optional. The dirname of the path to the source map
  11271. * to be applied. If relative, it is relative to the SourceMapConsumer.
  11272. * This parameter is needed when the two source maps aren't in the same
  11273. * directory, and the source map to be applied contains relative source
  11274. * paths. If so, those relative source paths need to be rewritten
  11275. * relative to the SourceMapGenerator.
  11276. */
  11277. SourceMapGenerator.prototype.applySourceMap =
  11278. function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  11279. var sourceFile = aSourceFile;
  11280. // If aSourceFile is omitted, we will use the file property of the SourceMap
  11281. if (aSourceFile == null) {
  11282. if (aSourceMapConsumer.file == null) {
  11283. throw new Error(
  11284. 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
  11285. 'or the source map\'s "file" property. Both were omitted.'
  11286. );
  11287. }
  11288. sourceFile = aSourceMapConsumer.file;
  11289. }
  11290. var sourceRoot = this._sourceRoot;
  11291. // Make "sourceFile" relative if an absolute Url is passed.
  11292. if (sourceRoot != null) {
  11293. sourceFile = util.relative(sourceRoot, sourceFile);
  11294. }
  11295. // Applying the SourceMap can add and remove items from the sources and
  11296. // the names array.
  11297. var newSources = new ArraySet();
  11298. var newNames = new ArraySet();
  11299. // Find mappings for the "sourceFile"
  11300. this._mappings.unsortedForEach(function (mapping) {
  11301. if (mapping.source === sourceFile && mapping.originalLine != null) {
  11302. // Check if it can be mapped by the source map, then update the mapping.
  11303. var original = aSourceMapConsumer.originalPositionFor({
  11304. line: mapping.originalLine,
  11305. column: mapping.originalColumn
  11306. });
  11307. if (original.source != null) {
  11308. // Copy mapping
  11309. mapping.source = original.source;
  11310. if (aSourceMapPath != null) {
  11311. mapping.source = util.join(aSourceMapPath, mapping.source)
  11312. }
  11313. if (sourceRoot != null) {
  11314. mapping.source = util.relative(sourceRoot, mapping.source);
  11315. }
  11316. mapping.originalLine = original.line;
  11317. mapping.originalColumn = original.column;
  11318. if (original.name != null) {
  11319. mapping.name = original.name;
  11320. }
  11321. }
  11322. }
  11323. var source = mapping.source;
  11324. if (source != null && !newSources.has(source)) {
  11325. newSources.add(source);
  11326. }
  11327. var name = mapping.name;
  11328. if (name != null && !newNames.has(name)) {
  11329. newNames.add(name);
  11330. }
  11331. }, this);
  11332. this._sources = newSources;
  11333. this._names = newNames;
  11334. // Copy sourcesContents of applied map.
  11335. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  11336. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  11337. if (content != null) {
  11338. if (aSourceMapPath != null) {
  11339. sourceFile = util.join(aSourceMapPath, sourceFile);
  11340. }
  11341. if (sourceRoot != null) {
  11342. sourceFile = util.relative(sourceRoot, sourceFile);
  11343. }
  11344. this.setSourceContent(sourceFile, content);
  11345. }
  11346. }, this);
  11347. };
  11348. /**
  11349. * A mapping can have one of the three levels of data:
  11350. *
  11351. * 1. Just the generated position.
  11352. * 2. The Generated position, original position, and original source.
  11353. * 3. Generated and original position, original source, as well as a name
  11354. * token.
  11355. *
  11356. * To maintain consistency, we validate that any new mapping being added falls
  11357. * in to one of these categories.
  11358. */
  11359. SourceMapGenerator.prototype._validateMapping =
  11360. function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
  11361. aName) {
  11362. // When aOriginal is truthy but has empty values for .line and .column,
  11363. // it is most likely a programmer error. In this case we throw a very
  11364. // specific error message to try to guide them the right way.
  11365. // For example: https://github.com/Polymer/polymer-bundler/pull/519
  11366. if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
  11367. throw new Error(
  11368. 'original.line and original.column are not numbers -- you probably meant to omit ' +
  11369. 'the original mapping entirely and only map the generated position. If so, pass ' +
  11370. 'null for the original mapping instead of an object with empty or null values.'
  11371. );
  11372. }
  11373. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  11374. && aGenerated.line > 0 && aGenerated.column >= 0
  11375. && !aOriginal && !aSource && !aName) {
  11376. // Case 1.
  11377. return;
  11378. }
  11379. else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  11380. && aOriginal && 'line' in aOriginal && 'column' in aOriginal
  11381. && aGenerated.line > 0 && aGenerated.column >= 0
  11382. && aOriginal.line > 0 && aOriginal.column >= 0
  11383. && aSource) {
  11384. // Cases 2 and 3.
  11385. return;
  11386. }
  11387. else {
  11388. throw new Error('Invalid mapping: ' + JSON.stringify({
  11389. generated: aGenerated,
  11390. source: aSource,
  11391. original: aOriginal,
  11392. name: aName
  11393. }));
  11394. }
  11395. };
  11396. /**
  11397. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  11398. * specified by the source map format.
  11399. */
  11400. SourceMapGenerator.prototype._serializeMappings =
  11401. function SourceMapGenerator_serializeMappings() {
  11402. var previousGeneratedColumn = 0;
  11403. var previousGeneratedLine = 1;
  11404. var previousOriginalColumn = 0;
  11405. var previousOriginalLine = 0;
  11406. var previousName = 0;
  11407. var previousSource = 0;
  11408. var result = '';
  11409. var next;
  11410. var mapping;
  11411. var nameIdx;
  11412. var sourceIdx;
  11413. var mappings = this._mappings.toArray();
  11414. for (var i = 0, len = mappings.length; i < len; i++) {
  11415. mapping = mappings[i];
  11416. next = ''
  11417. if (mapping.generatedLine !== previousGeneratedLine) {
  11418. previousGeneratedColumn = 0;
  11419. while (mapping.generatedLine !== previousGeneratedLine) {
  11420. next += ';';
  11421. previousGeneratedLine++;
  11422. }
  11423. }
  11424. else {
  11425. if (i > 0) {
  11426. if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  11427. continue;
  11428. }
  11429. next += ',';
  11430. }
  11431. }
  11432. next += base64VLQ.encode(mapping.generatedColumn
  11433. - previousGeneratedColumn);
  11434. previousGeneratedColumn = mapping.generatedColumn;
  11435. if (mapping.source != null) {
  11436. sourceIdx = this._sources.indexOf(mapping.source);
  11437. next += base64VLQ.encode(sourceIdx - previousSource);
  11438. previousSource = sourceIdx;
  11439. // lines are stored 0-based in SourceMap spec version 3
  11440. next += base64VLQ.encode(mapping.originalLine - 1
  11441. - previousOriginalLine);
  11442. previousOriginalLine = mapping.originalLine - 1;
  11443. next += base64VLQ.encode(mapping.originalColumn
  11444. - previousOriginalColumn);
  11445. previousOriginalColumn = mapping.originalColumn;
  11446. if (mapping.name != null) {
  11447. nameIdx = this._names.indexOf(mapping.name);
  11448. next += base64VLQ.encode(nameIdx - previousName);
  11449. previousName = nameIdx;
  11450. }
  11451. }
  11452. result += next;
  11453. }
  11454. return result;
  11455. };
  11456. SourceMapGenerator.prototype._generateSourcesContent =
  11457. function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  11458. return aSources.map(function (source) {
  11459. if (!this._sourcesContents) {
  11460. return null;
  11461. }
  11462. if (aSourceRoot != null) {
  11463. source = util.relative(aSourceRoot, source);
  11464. }
  11465. var key = util.toSetString(source);
  11466. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
  11467. ? this._sourcesContents[key]
  11468. : null;
  11469. }, this);
  11470. };
  11471. /**
  11472. * Externalize the source map.
  11473. */
  11474. SourceMapGenerator.prototype.toJSON =
  11475. function SourceMapGenerator_toJSON() {
  11476. var map = {
  11477. version: this._version,
  11478. sources: this._sources.toArray(),
  11479. names: this._names.toArray(),
  11480. mappings: this._serializeMappings()
  11481. };
  11482. if (this._file != null) {
  11483. map.file = this._file;
  11484. }
  11485. if (this._sourceRoot != null) {
  11486. map.sourceRoot = this._sourceRoot;
  11487. }
  11488. if (this._sourcesContents) {
  11489. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  11490. }
  11491. return map;
  11492. };
  11493. /**
  11494. * Render the source map being generated to a string.
  11495. */
  11496. SourceMapGenerator.prototype.toString =
  11497. function SourceMapGenerator_toString() {
  11498. return JSON.stringify(this.toJSON());
  11499. };
  11500. exports.SourceMapGenerator = SourceMapGenerator;
  11501. /***/ }),
  11502. /* 66 */
  11503. /***/ (function(module, exports, __webpack_require__) {
  11504. /*
  11505. * Copyright 2009-2011 Mozilla Foundation and contributors
  11506. * Licensed under the New BSD license. See LICENSE.txt or:
  11507. * http://opensource.org/licenses/BSD-3-Clause
  11508. */
  11509. exports.SourceMapGenerator = __webpack_require__(65).SourceMapGenerator;
  11510. exports.SourceMapConsumer = __webpack_require__(182).SourceMapConsumer;
  11511. exports.SourceNode = __webpack_require__(183).SourceNode;
  11512. /***/ }),
  11513. /* 67 */
  11514. /***/ (function(module, exports, __webpack_require__) {
  11515. "use strict";
  11516. exports.__esModule = true;
  11517. var _namespace = __webpack_require__(15);
  11518. var _namespace2 = _interopRequireDefault(_namespace);
  11519. var _types = __webpack_require__(1);
  11520. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11521. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11522. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11523. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11524. var Attribute = function (_Namespace) {
  11525. _inherits(Attribute, _Namespace);
  11526. function Attribute(opts) {
  11527. _classCallCheck(this, Attribute);
  11528. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11529. _this.type = _types.ATTRIBUTE;
  11530. _this.raws = {};
  11531. return _this;
  11532. }
  11533. Attribute.prototype.toString = function toString() {
  11534. var selector = [this.spaces.before, '[', this.ns, this.attribute];
  11535. if (this.operator) {
  11536. selector.push(this.operator);
  11537. }
  11538. if (this.value) {
  11539. selector.push(this.value);
  11540. }
  11541. if (this.raws.insensitive) {
  11542. selector.push(this.raws.insensitive);
  11543. } else if (this.insensitive) {
  11544. selector.push(' i');
  11545. }
  11546. selector.push(']');
  11547. return selector.concat(this.spaces.after).join('');
  11548. };
  11549. return Attribute;
  11550. }(_namespace2.default);
  11551. exports.default = Attribute;
  11552. module.exports = exports['default'];
  11553. /***/ }),
  11554. /* 68 */
  11555. /***/ (function(module, exports, __webpack_require__) {
  11556. "use strict";
  11557. exports.__esModule = true;
  11558. var _namespace = __webpack_require__(15);
  11559. var _namespace2 = _interopRequireDefault(_namespace);
  11560. var _types = __webpack_require__(1);
  11561. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11562. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11563. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11564. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11565. var ClassName = function (_Namespace) {
  11566. _inherits(ClassName, _Namespace);
  11567. function ClassName(opts) {
  11568. _classCallCheck(this, ClassName);
  11569. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11570. _this.type = _types.CLASS;
  11571. return _this;
  11572. }
  11573. ClassName.prototype.toString = function toString() {
  11574. return [this.spaces.before, this.ns, String('.' + this.value), this.spaces.after].join('');
  11575. };
  11576. return ClassName;
  11577. }(_namespace2.default);
  11578. exports.default = ClassName;
  11579. module.exports = exports['default'];
  11580. /***/ }),
  11581. /* 69 */
  11582. /***/ (function(module, exports, __webpack_require__) {
  11583. "use strict";
  11584. exports.__esModule = true;
  11585. var _node = __webpack_require__(9);
  11586. var _node2 = _interopRequireDefault(_node);
  11587. var _types = __webpack_require__(1);
  11588. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11589. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11590. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11591. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11592. var Combinator = function (_Node) {
  11593. _inherits(Combinator, _Node);
  11594. function Combinator(opts) {
  11595. _classCallCheck(this, Combinator);
  11596. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  11597. _this.type = _types.COMBINATOR;
  11598. return _this;
  11599. }
  11600. return Combinator;
  11601. }(_node2.default);
  11602. exports.default = Combinator;
  11603. module.exports = exports['default'];
  11604. /***/ }),
  11605. /* 70 */
  11606. /***/ (function(module, exports, __webpack_require__) {
  11607. "use strict";
  11608. exports.__esModule = true;
  11609. var _node = __webpack_require__(9);
  11610. var _node2 = _interopRequireDefault(_node);
  11611. var _types = __webpack_require__(1);
  11612. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11613. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11614. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11615. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11616. var Comment = function (_Node) {
  11617. _inherits(Comment, _Node);
  11618. function Comment(opts) {
  11619. _classCallCheck(this, Comment);
  11620. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  11621. _this.type = _types.COMMENT;
  11622. return _this;
  11623. }
  11624. return Comment;
  11625. }(_node2.default);
  11626. exports.default = Comment;
  11627. module.exports = exports['default'];
  11628. /***/ }),
  11629. /* 71 */
  11630. /***/ (function(module, exports, __webpack_require__) {
  11631. "use strict";
  11632. exports.__esModule = true;
  11633. var _namespace = __webpack_require__(15);
  11634. var _namespace2 = _interopRequireDefault(_namespace);
  11635. var _types = __webpack_require__(1);
  11636. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11637. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11638. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11639. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11640. var ID = function (_Namespace) {
  11641. _inherits(ID, _Namespace);
  11642. function ID(opts) {
  11643. _classCallCheck(this, ID);
  11644. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11645. _this.type = _types.ID;
  11646. return _this;
  11647. }
  11648. ID.prototype.toString = function toString() {
  11649. return [this.spaces.before, this.ns, String('#' + this.value), this.spaces.after].join('');
  11650. };
  11651. return ID;
  11652. }(_namespace2.default);
  11653. exports.default = ID;
  11654. module.exports = exports['default'];
  11655. /***/ }),
  11656. /* 72 */
  11657. /***/ (function(module, exports, __webpack_require__) {
  11658. "use strict";
  11659. exports.__esModule = true;
  11660. var _node = __webpack_require__(9);
  11661. var _node2 = _interopRequireDefault(_node);
  11662. var _types = __webpack_require__(1);
  11663. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11664. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11665. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11666. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11667. var Nesting = function (_Node) {
  11668. _inherits(Nesting, _Node);
  11669. function Nesting(opts) {
  11670. _classCallCheck(this, Nesting);
  11671. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  11672. _this.type = _types.NESTING;
  11673. _this.value = '&';
  11674. return _this;
  11675. }
  11676. return Nesting;
  11677. }(_node2.default);
  11678. exports.default = Nesting;
  11679. module.exports = exports['default'];
  11680. /***/ }),
  11681. /* 73 */
  11682. /***/ (function(module, exports, __webpack_require__) {
  11683. "use strict";
  11684. exports.__esModule = true;
  11685. var _container = __webpack_require__(33);
  11686. var _container2 = _interopRequireDefault(_container);
  11687. var _types = __webpack_require__(1);
  11688. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11689. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11690. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11691. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11692. var Pseudo = function (_Container) {
  11693. _inherits(Pseudo, _Container);
  11694. function Pseudo(opts) {
  11695. _classCallCheck(this, Pseudo);
  11696. var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
  11697. _this.type = _types.PSEUDO;
  11698. return _this;
  11699. }
  11700. Pseudo.prototype.toString = function toString() {
  11701. var params = this.length ? '(' + this.map(String).join(',') + ')' : '';
  11702. return [this.spaces.before, String(this.value), params, this.spaces.after].join('');
  11703. };
  11704. return Pseudo;
  11705. }(_container2.default);
  11706. exports.default = Pseudo;
  11707. module.exports = exports['default'];
  11708. /***/ }),
  11709. /* 74 */
  11710. /***/ (function(module, exports, __webpack_require__) {
  11711. "use strict";
  11712. exports.__esModule = true;
  11713. var _container = __webpack_require__(33);
  11714. var _container2 = _interopRequireDefault(_container);
  11715. var _types = __webpack_require__(1);
  11716. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11717. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11718. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11719. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11720. var Root = function (_Container) {
  11721. _inherits(Root, _Container);
  11722. function Root(opts) {
  11723. _classCallCheck(this, Root);
  11724. var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
  11725. _this.type = _types.ROOT;
  11726. return _this;
  11727. }
  11728. Root.prototype.toString = function toString() {
  11729. var str = this.reduce(function (memo, selector) {
  11730. var sel = String(selector);
  11731. return sel ? memo + sel + ',' : '';
  11732. }, '').slice(0, -1);
  11733. return this.trailingComma ? str + ',' : str;
  11734. };
  11735. return Root;
  11736. }(_container2.default);
  11737. exports.default = Root;
  11738. module.exports = exports['default'];
  11739. /***/ }),
  11740. /* 75 */
  11741. /***/ (function(module, exports, __webpack_require__) {
  11742. "use strict";
  11743. exports.__esModule = true;
  11744. var _container = __webpack_require__(33);
  11745. var _container2 = _interopRequireDefault(_container);
  11746. var _types = __webpack_require__(1);
  11747. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11748. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11749. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11750. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11751. var Selector = function (_Container) {
  11752. _inherits(Selector, _Container);
  11753. function Selector(opts) {
  11754. _classCallCheck(this, Selector);
  11755. var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
  11756. _this.type = _types.SELECTOR;
  11757. return _this;
  11758. }
  11759. return Selector;
  11760. }(_container2.default);
  11761. exports.default = Selector;
  11762. module.exports = exports['default'];
  11763. /***/ }),
  11764. /* 76 */
  11765. /***/ (function(module, exports, __webpack_require__) {
  11766. "use strict";
  11767. exports.__esModule = true;
  11768. var _node = __webpack_require__(9);
  11769. var _node2 = _interopRequireDefault(_node);
  11770. var _types = __webpack_require__(1);
  11771. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11772. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11773. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11774. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11775. var String = function (_Node) {
  11776. _inherits(String, _Node);
  11777. function String(opts) {
  11778. _classCallCheck(this, String);
  11779. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  11780. _this.type = _types.STRING;
  11781. return _this;
  11782. }
  11783. return String;
  11784. }(_node2.default);
  11785. exports.default = String;
  11786. module.exports = exports['default'];
  11787. /***/ }),
  11788. /* 77 */
  11789. /***/ (function(module, exports, __webpack_require__) {
  11790. "use strict";
  11791. exports.__esModule = true;
  11792. var _namespace = __webpack_require__(15);
  11793. var _namespace2 = _interopRequireDefault(_namespace);
  11794. var _types = __webpack_require__(1);
  11795. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11796. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11797. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11798. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11799. var Tag = function (_Namespace) {
  11800. _inherits(Tag, _Namespace);
  11801. function Tag(opts) {
  11802. _classCallCheck(this, Tag);
  11803. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11804. _this.type = _types.TAG;
  11805. return _this;
  11806. }
  11807. return Tag;
  11808. }(_namespace2.default);
  11809. exports.default = Tag;
  11810. module.exports = exports['default'];
  11811. /***/ }),
  11812. /* 78 */
  11813. /***/ (function(module, exports, __webpack_require__) {
  11814. "use strict";
  11815. exports.__esModule = true;
  11816. var _namespace = __webpack_require__(15);
  11817. var _namespace2 = _interopRequireDefault(_namespace);
  11818. var _types = __webpack_require__(1);
  11819. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11820. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11821. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11822. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11823. var Universal = function (_Namespace) {
  11824. _inherits(Universal, _Namespace);
  11825. function Universal(opts) {
  11826. _classCallCheck(this, Universal);
  11827. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11828. _this.type = _types.UNIVERSAL;
  11829. _this.value = '*';
  11830. return _this;
  11831. }
  11832. return Universal;
  11833. }(_namespace2.default);
  11834. exports.default = Universal;
  11835. module.exports = exports['default'];
  11836. /***/ }),
  11837. /* 79 */
  11838. /***/ (function(module, exports, __webpack_require__) {
  11839. "use strict";
  11840. const Container = __webpack_require__(2);
  11841. class AtWord extends Container {
  11842. constructor (opts) {
  11843. super(opts);
  11844. this.type = 'atword';
  11845. }
  11846. toString () {
  11847. let quote = this.quoted ? this.raws.quote : '';
  11848. return [
  11849. this.raws.before,
  11850. '@',
  11851. // we can't use String() here because it'll try using itself
  11852. // as the constructor
  11853. String.prototype.toString.call(this.value),
  11854. this.raws.after
  11855. ].join('');
  11856. }
  11857. }
  11858. Container.registerWalker(AtWord);
  11859. module.exports = AtWord;
  11860. /***/ }),
  11861. /* 80 */
  11862. /***/ (function(module, exports, __webpack_require__) {
  11863. "use strict";
  11864. const Container = __webpack_require__(2);
  11865. const Node = __webpack_require__(4);
  11866. class Colon extends Node {
  11867. constructor (opts) {
  11868. super(opts);
  11869. this.type = 'colon';
  11870. }
  11871. }
  11872. Container.registerWalker(Colon);
  11873. module.exports = Colon;
  11874. /***/ }),
  11875. /* 81 */
  11876. /***/ (function(module, exports, __webpack_require__) {
  11877. "use strict";
  11878. const Container = __webpack_require__(2);
  11879. const Node = __webpack_require__(4);
  11880. class Comma extends Node {
  11881. constructor (opts) {
  11882. super(opts);
  11883. this.type = 'comma';
  11884. }
  11885. }
  11886. Container.registerWalker(Comma);
  11887. module.exports = Comma;
  11888. /***/ }),
  11889. /* 82 */
  11890. /***/ (function(module, exports, __webpack_require__) {
  11891. "use strict";
  11892. const Container = __webpack_require__(2);
  11893. const Node = __webpack_require__(4);
  11894. class Comment extends Node {
  11895. constructor (opts) {
  11896. super(opts);
  11897. this.type = 'comment';
  11898. this.inline = opts.inline || false;
  11899. }
  11900. toString () {
  11901. return [
  11902. this.raws.before,
  11903. this.inline ? '//' : '/*',
  11904. String(this.value),
  11905. this.inline ? '' : '*/',
  11906. this.raws.after
  11907. ].join('');
  11908. }
  11909. };
  11910. Container.registerWalker(Comment);
  11911. module.exports = Comment;
  11912. /***/ }),
  11913. /* 83 */
  11914. /***/ (function(module, exports, __webpack_require__) {
  11915. "use strict";
  11916. const Container = __webpack_require__(2);
  11917. class FunctionNode extends Container {
  11918. constructor (opts) {
  11919. super(opts);
  11920. this.type = 'func';
  11921. // start off at -1 so we know there haven't been any parens added
  11922. this.unbalanced = -1;
  11923. }
  11924. };
  11925. Container.registerWalker(FunctionNode);
  11926. module.exports = FunctionNode;
  11927. /***/ }),
  11928. /* 84 */
  11929. /***/ (function(module, exports, __webpack_require__) {
  11930. "use strict";
  11931. const Container = __webpack_require__(2);
  11932. const Node = __webpack_require__(4);
  11933. class NumberNode extends Node {
  11934. constructor (opts) {
  11935. super(opts);
  11936. this.type = 'number';
  11937. this.unit = opts.unit || '';
  11938. }
  11939. toString () {
  11940. return [
  11941. this.raws.before,
  11942. String(this.value),
  11943. this.unit,
  11944. this.raws.after
  11945. ].join('');
  11946. }
  11947. };
  11948. Container.registerWalker(NumberNode);
  11949. module.exports = NumberNode;
  11950. /***/ }),
  11951. /* 85 */
  11952. /***/ (function(module, exports, __webpack_require__) {
  11953. "use strict";
  11954. const Container = __webpack_require__(2);
  11955. const Node = __webpack_require__(4);
  11956. class Operator extends Node {
  11957. constructor (opts) {
  11958. super(opts);
  11959. this.type = 'operator';
  11960. }
  11961. }
  11962. Container.registerWalker(Operator);
  11963. module.exports = Operator;
  11964. /***/ }),
  11965. /* 86 */
  11966. /***/ (function(module, exports, __webpack_require__) {
  11967. "use strict";
  11968. const Container = __webpack_require__(2);
  11969. const Node = __webpack_require__(4);
  11970. class Parenthesis extends Node {
  11971. constructor (opts) {
  11972. super(opts);
  11973. this.type = 'paren';
  11974. this.parenType = '';
  11975. }
  11976. }
  11977. Container.registerWalker(Parenthesis);
  11978. module.exports = Parenthesis;
  11979. /***/ }),
  11980. /* 87 */
  11981. /***/ (function(module, exports, __webpack_require__) {
  11982. "use strict";
  11983. const Container = __webpack_require__(2);
  11984. const Node = __webpack_require__(4);
  11985. class StringNode extends Node {
  11986. constructor (opts) {
  11987. super(opts);
  11988. this.type = 'string';
  11989. }
  11990. toString () {
  11991. let quote = this.quoted ? this.raws.quote : '';
  11992. return [
  11993. this.raws.before,
  11994. quote,
  11995. // we can't use String() here because it'll try using itself
  11996. // as the constructor
  11997. this.value + '',
  11998. quote,
  11999. this.raws.after
  12000. ].join('');
  12001. }
  12002. }
  12003. Container.registerWalker(StringNode);
  12004. module.exports = StringNode;
  12005. /***/ }),
  12006. /* 88 */
  12007. /***/ (function(module, exports, __webpack_require__) {
  12008. "use strict";
  12009. const Container = __webpack_require__(2);
  12010. const Node = __webpack_require__(4);
  12011. class UnicodeRange extends Node {
  12012. constructor (opts) {
  12013. super(opts);
  12014. this.type = 'unicode-range';
  12015. }
  12016. }
  12017. Container.registerWalker(UnicodeRange);
  12018. module.exports = UnicodeRange;
  12019. /***/ }),
  12020. /* 89 */
  12021. /***/ (function(module, exports, __webpack_require__) {
  12022. "use strict";
  12023. const Container = __webpack_require__(2);
  12024. module.exports = class Value extends Container {
  12025. constructor (opts) {
  12026. super(opts);
  12027. this.type = 'value';
  12028. this.unbalanced = 0;
  12029. }
  12030. };
  12031. /***/ }),
  12032. /* 90 */
  12033. /***/ (function(module, exports, __webpack_require__) {
  12034. "use strict";
  12035. const Container = __webpack_require__(2);
  12036. const Node = __webpack_require__(4);
  12037. class Word extends Node {
  12038. constructor (opts) {
  12039. super(opts);
  12040. this.type = 'word';
  12041. }
  12042. }
  12043. Container.registerWalker(Word);
  12044. module.exports = Word;
  12045. /***/ }),
  12046. /* 91 */
  12047. /***/ (function(module, exports, __webpack_require__) {
  12048. "use strict";
  12049. exports.__esModule = true;
  12050. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12051. var _supportsColor = __webpack_require__(210);
  12052. var _supportsColor2 = _interopRequireDefault(_supportsColor);
  12053. var _chalk = __webpack_require__(98);
  12054. var _chalk2 = _interopRequireDefault(_chalk);
  12055. var _terminalHighlight = __webpack_require__(198);
  12056. var _terminalHighlight2 = _interopRequireDefault(_terminalHighlight);
  12057. var _warnOnce = __webpack_require__(5);
  12058. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  12059. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12060. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12061. /**
  12062. * The CSS parser throws this error for broken CSS.
  12063. *
  12064. * Custom parsers can throw this error for broken custom syntax using
  12065. * the {@link Node#error} method.
  12066. *
  12067. * PostCSS will use the input source map to detect the original error location.
  12068. * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
  12069. * PostCSS will show the original position in the Sass file.
  12070. *
  12071. * If you need the position in the PostCSS input
  12072. * (e.g., to debug the previous compiler), use `error.input.file`.
  12073. *
  12074. * @example
  12075. * // Catching and checking syntax error
  12076. * try {
  12077. * postcss.parse('a{')
  12078. * } catch (error) {
  12079. * if ( error.name === 'CssSyntaxError' ) {
  12080. * error //=> CssSyntaxError
  12081. * }
  12082. * }
  12083. *
  12084. * @example
  12085. * // Raising error from plugin
  12086. * throw node.error('Unknown variable', { plugin: 'postcss-vars' });
  12087. */
  12088. var CssSyntaxError = function () {
  12089. /**
  12090. * @param {string} message - error message
  12091. * @param {number} [line] - source line of the error
  12092. * @param {number} [column] - source column of the error
  12093. * @param {string} [source] - source code of the broken file
  12094. * @param {string} [file] - absolute path to the broken file
  12095. * @param {string} [plugin] - PostCSS plugin name, if error came from plugin
  12096. */
  12097. function CssSyntaxError(message, line, column, source, file, plugin) {
  12098. _classCallCheck(this, CssSyntaxError);
  12099. /**
  12100. * @member {string} - Always equal to `'CssSyntaxError'`. You should
  12101. * always check error type
  12102. * by `error.name === 'CssSyntaxError'` instead of
  12103. * `error instanceof CssSyntaxError`, because
  12104. * npm could have several PostCSS versions.
  12105. *
  12106. * @example
  12107. * if ( error.name === 'CssSyntaxError' ) {
  12108. * error //=> CssSyntaxError
  12109. * }
  12110. */
  12111. this.name = 'CssSyntaxError';
  12112. /**
  12113. * @member {string} - Error message.
  12114. *
  12115. * @example
  12116. * error.message //=> 'Unclosed block'
  12117. */
  12118. this.reason = message;
  12119. if (file) {
  12120. /**
  12121. * @member {string} - Absolute path to the broken file.
  12122. *
  12123. * @example
  12124. * error.file //=> 'a.sass'
  12125. * error.input.file //=> 'a.css'
  12126. */
  12127. this.file = file;
  12128. }
  12129. if (source) {
  12130. /**
  12131. * @member {string} - Source code of the broken file.
  12132. *
  12133. * @example
  12134. * error.source //=> 'a { b {} }'
  12135. * error.input.column //=> 'a b { }'
  12136. */
  12137. this.source = source;
  12138. }
  12139. if (plugin) {
  12140. /**
  12141. * @member {string} - Plugin name, if error came from plugin.
  12142. *
  12143. * @example
  12144. * error.plugin //=> 'postcss-vars'
  12145. */
  12146. this.plugin = plugin;
  12147. }
  12148. if (typeof line !== 'undefined' && typeof column !== 'undefined') {
  12149. /**
  12150. * @member {number} - Source line of the error.
  12151. *
  12152. * @example
  12153. * error.line //=> 2
  12154. * error.input.line //=> 4
  12155. */
  12156. this.line = line;
  12157. /**
  12158. * @member {number} - Source column of the error.
  12159. *
  12160. * @example
  12161. * error.column //=> 1
  12162. * error.input.column //=> 4
  12163. */
  12164. this.column = column;
  12165. }
  12166. this.setMessage();
  12167. if (Error.captureStackTrace) {
  12168. Error.captureStackTrace(this, CssSyntaxError);
  12169. }
  12170. }
  12171. CssSyntaxError.prototype.setMessage = function setMessage() {
  12172. /**
  12173. * @member {string} - Full error text in the GNU error format
  12174. * with plugin, file, line and column.
  12175. *
  12176. * @example
  12177. * error.message //=> 'a.css:1:1: Unclosed block'
  12178. */
  12179. this.message = this.plugin ? this.plugin + ': ' : '';
  12180. this.message += this.file ? this.file : '<css input>';
  12181. if (typeof this.line !== 'undefined') {
  12182. this.message += ':' + this.line + ':' + this.column;
  12183. }
  12184. this.message += ': ' + this.reason;
  12185. };
  12186. /**
  12187. * Returns a few lines of CSS source that caused the error.
  12188. *
  12189. * If the CSS has an input source map without `sourceContent`,
  12190. * this method will return an empty string.
  12191. *
  12192. * @param {boolean} [color] whether arrow will be colored red by terminal
  12193. * color codes. By default, PostCSS will detect
  12194. * color support by `process.stdout.isTTY`
  12195. * and `process.env.NODE_DISABLE_COLORS`.
  12196. *
  12197. * @example
  12198. * error.showSourceCode() //=> " 4 | }
  12199. * // 5 | a {
  12200. * // > 6 | bad
  12201. * // | ^
  12202. * // 7 | }
  12203. * // 8 | b {"
  12204. *
  12205. * @return {string} few lines of CSS source that caused the error
  12206. */
  12207. CssSyntaxError.prototype.showSourceCode = function showSourceCode(color) {
  12208. var _this = this;
  12209. if (!this.source) return '';
  12210. var css = this.source;
  12211. if (typeof color === 'undefined') color = _supportsColor2.default;
  12212. if (color) css = (0, _terminalHighlight2.default)(css);
  12213. var lines = css.split(/\r?\n/);
  12214. var start = Math.max(this.line - 3, 0);
  12215. var end = Math.min(this.line + 2, lines.length);
  12216. var maxWidth = String(end).length;
  12217. var colors = new _chalk2.default.constructor({ enabled: true });
  12218. function mark(text) {
  12219. if (color) {
  12220. return colors.red.bold(text);
  12221. } else {
  12222. return text;
  12223. }
  12224. }
  12225. function aside(text) {
  12226. if (color) {
  12227. return colors.gray(text);
  12228. } else {
  12229. return text;
  12230. }
  12231. }
  12232. return lines.slice(start, end).map(function (line, index) {
  12233. var number = start + 1 + index;
  12234. var gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ';
  12235. if (number === _this.line) {
  12236. var spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, _this.column - 1).replace(/[^\t]/g, ' ');
  12237. return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^');
  12238. } else {
  12239. return ' ' + aside(gutter) + line;
  12240. }
  12241. }).join('\n');
  12242. };
  12243. /**
  12244. * Returns error position, message and source code of the broken part.
  12245. *
  12246. * @example
  12247. * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
  12248. * // > 1 | a {
  12249. * // | ^"
  12250. *
  12251. * @return {string} error position, message and source code
  12252. */
  12253. CssSyntaxError.prototype.toString = function toString() {
  12254. var code = this.showSourceCode();
  12255. if (code) {
  12256. code = '\n\n' + code + '\n';
  12257. }
  12258. return this.name + ': ' + this.message + code;
  12259. };
  12260. _createClass(CssSyntaxError, [{
  12261. key: 'generated',
  12262. get: function get() {
  12263. (0, _warnOnce2.default)('CssSyntaxError#generated is deprecated. Use input instead.');
  12264. return this.input;
  12265. }
  12266. /**
  12267. * @memberof CssSyntaxError#
  12268. * @member {Input} input - Input object with PostCSS internal information
  12269. * about input file. If input has source map
  12270. * from previous tool, PostCSS will use origin
  12271. * (for example, Sass) source. You can use this
  12272. * object to get PostCSS input source.
  12273. *
  12274. * @example
  12275. * error.input.file //=> 'a.css'
  12276. * error.file //=> 'a.sass'
  12277. */
  12278. }]);
  12279. return CssSyntaxError;
  12280. }();
  12281. exports.default = CssSyntaxError;
  12282. module.exports = exports['default'];
  12283. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1zeW50YXgtZXJyb3IuZXM2Il0sIm5hbWVzIjpbIkNzc1N5bnRheEVycm9yIiwibWVzc2FnZSIsImxpbmUiLCJjb2x1bW4iLCJzb3VyY2UiLCJmaWxlIiwicGx1Z2luIiwibmFtZSIsInJlYXNvbiIsInNldE1lc3NhZ2UiLCJFcnJvciIsImNhcHR1cmVTdGFja1RyYWNlIiwic2hvd1NvdXJjZUNvZGUiLCJjb2xvciIsImNzcyIsImxpbmVzIiwic3BsaXQiLCJzdGFydCIsIk1hdGgiLCJtYXgiLCJlbmQiLCJtaW4iLCJsZW5ndGgiLCJtYXhXaWR0aCIsIlN0cmluZyIsImNvbG9ycyIsImNvbnN0cnVjdG9yIiwiZW5hYmxlZCIsIm1hcmsiLCJ0ZXh0IiwicmVkIiwiYm9sZCIsImFzaWRlIiwiZ3JheSIsInNsaWNlIiwibWFwIiwiaW5kZXgiLCJudW1iZXIiLCJndXR0ZXIiLCJzcGFjaW5nIiwicmVwbGFjZSIsImpvaW4iLCJ0b1N0cmluZyIsImNvZGUiLCJpbnB1dCJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7QUFDQTs7OztBQUVBOzs7O0FBQ0E7Ozs7Ozs7O0FBRUE7Ozs7Ozs7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3NzU3ludGF4RXJyb3InICkge1xuICAgICAgICAgKiAgIGVycm9yIC8vPT4gQ3NzU3ludGF4RXJyb3JcbiAgICAgICAgICogfVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5uYW1lICAgPSAnQ3NzU3ludGF4RXJyb3InO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIEVycm9yIG1lc3NhZ2UuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAqIGVycm9yLm1lc3NhZ2UgLy89PiAnVW5jbG9zZWQgYmxvY2snXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnJlYXNvbiA9IG1lc3NhZ2U7XG5cbiAgICAgICAgaWYgKCBmaWxlICkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQWJzb2x1dGUgcGF0aCB0byB0aGUgYnJva2VuIGZpbGUuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLmZpbGUgICAgICAgLy89PiAnYS5zYXNzJ1xuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQuZmlsZSAvLz0+ICdhLmNzcydcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5maWxlID0gZmlsZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHNvdXJjZSApIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIFNvdXJjZSBjb2RlIG9mIHRoZSBicm9rZW4gZmlsZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogZXJyb3Iuc291cmNlICAgICAgIC8vPT4gJ2EgeyBiIHt9IH0nXG4gICAgICAgICAgICAgKiBlcnJvci5pbnB1dC5jb2x1bW4gLy89PiAnYSBiIHsgfSdcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5zb3VyY2UgPSBzb3VyY2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCBwbHVnaW4gKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBQbHVnaW4gbmFtZSwgaWYgZXJyb3IgY2FtZSBmcm9tIHBsdWdpbi5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogZXJyb3IucGx1Z2luIC8vPT4gJ3Bvc3Rjc3MtdmFycydcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5wbHVnaW4gPSBwbHVnaW47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB0eXBlb2YgbGluZSAhPT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIGNvbHVtbiAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge251bWJlcn0gLSBTb3VyY2UgbGluZSBvZiB0aGUgZXJyb3IuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLmxpbmUgICAgICAgLy89PiAyXG4gICAgICAgICAgICAgKiBlcnJvci5pbnB1dC5saW5lIC8vPT4gNFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmxpbmUgICA9IGxpbmU7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge251bWJlcn0gLSBTb3VyY2UgY29sdW1uIG9mIHRoZSBlcnJvci5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogZXJyb3IuY29sdW1uICAgICAgIC8vPT4gMVxuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQuY29sdW1uIC8vPT4gNFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2V0TWVzc2FnZSgpO1xuXG4gICAgICAgIGlmICggRXJyb3IuY2FwdHVyZVN0YWNrVHJhY2UgKSB7XG4gICAgICAgICAgICBFcnJvci5jYXB0dXJlU3RhY2tUcmFjZSh0aGlzLCBDc3NTeW50YXhFcnJvcik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzZXRNZXNzYWdlKCkge1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIEZ1bGwgZXJyb3IgdGV4dCBpbiB0aGUgR05VIGVycm9yIGZvcm1hdFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgd2l0aCBwbHVnaW4sIGZpbGUsIGxpbmUgYW5kIGNvbHVtbi5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogZXJyb3IubWVzc2FnZSAvLz0+ICdhLmNzczoxOjE6IFVuY2xvc2VkIGJsb2NrJ1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5tZXNzYWdlICA9IHRoaXMucGx1Z2luID8gdGhpcy5wbHVnaW4gKyAnOiAnIDogJyc7XG4gICAgICAgIHRoaXMubWVzc2FnZSArPSB0aGlzLmZpbGUgPyB0aGlzLmZpbGUgOiAnPGNzcyBpbnB1dD4nO1xuICAgICAgICBpZiAoIHR5cGVvZiB0aGlzLmxpbmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgdGhpcy5tZXNzYWdlICs9ICc6JyArIHRoaXMubGluZSArICc6JyArIHRoaXMuY29sdW1uO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMubWVzc2FnZSArPSAnOiAnICsgdGhpcy5yZWFzb247XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBhIGZldyBsaW5lcyBvZiBDU1Mgc291cmNlIHRoYXQgY2F1c2VkIHRoZSBlcnJvci5cbiAgICAgKlxuICAgICAqIElmIHRoZSBDU1MgaGFzIGFuIGlucHV0IHNvdXJjZSBtYXAgd2l0aG91dCBgc291cmNlQ29udGVudGAsXG4gICAgICogdGhpcyBtZXRob2Qgd2lsbCByZXR1cm4gYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtib29sZWFufSBbY29sb3JdIHdoZXRoZXIgYXJyb3cgd2lsbCBiZSBjb2xvcmVkIHJlZCBieSB0ZXJtaW5hbFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvciBjb2Rlcy4gQnkgZGVmYXVsdCwgUG9zdENTUyB3aWxsIGRldGVjdFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvciBzdXBwb3J0IGJ5IGBwcm9jZXNzLnN0ZG91dC5pc1RUWWBcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIGBwcm9jZXNzLmVudi5OT0RFX0RJU0FCTEVfQ09MT1JTYC5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogZXJyb3Iuc2hvd1NvdXJjZUNvZGUoKSAvLz0+IFwiICA0IHwgfVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICA1IHwgYSB7XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAvLyAgICA+IDYgfCAgIGJhZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgIHwgICBeXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgIDcgfCB9XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgIDggfCBiIHtcIlxuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBmZXcgbGluZXMgb2YgQ1NTIHNvdXJjZSB0aGF0IGNhdXNlZCB0aGUgZXJyb3JcbiAgICAgKi9cbiAgICBzaG93U291cmNlQ29kZShjb2xvcikge1xuICAgICAgICBpZiAoICF0aGlzLnNvdXJjZSApIHJldHVybiAnJztcblxuICAgICAgICBsZXQgY3NzID0gdGhpcy5zb3VyY2U7XG4gICAgICAgIGlmICggdHlwZW9mIGNvbG9yID09PSAndW5kZWZpbmVkJyApIGNvbG9yID0gc3VwcG9ydHNDb2xvcjtcbiAgICAgICAgaWYgKCBjb2xvciApIGNzcyA9IHRlcm1pbmFsSGlnaGxpZ2h0KGNzcyk7XG5cbiAgICAgICAgbGV0IGxpbmVzID0gY3NzLnNwbGl0KC9cXHI/XFxuLyk7XG4gICAgICAgIGxldCBzdGFydCA9IE1hdGgubWF4KHRoaXMubGluZSAtIDMsIDApO1xuICAgICAgICBsZXQgZW5kICAgPSBNYXRoLm1pbih0aGlzLmxpbmUgKyAyLCBsaW5lcy5sZW5ndGgpO1xuXG4gICAgICAgIGxldCBtYXhXaWR0aCA9IFN0cmluZyhlbmQpLmxlbmd0aDtcbiAgICAgICAgbGV0IGNvbG9ycyA9IG5ldyBjaGFsay5jb25zdHJ1Y3Rvcih7IGVuYWJsZWQ6IHRydWUgfSk7XG5cbiAgICAgICAgZnVuY3Rpb24gbWFyayh0ZXh0KSB7XG4gICAgICAgICAgICBpZiAoIGNvbG9yICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb2xvcnMucmVkLmJvbGQodGV4dCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGFzaWRlKHRleHQpIHtcbiAgICAgICAgICAgIGlmICggY29sb3IgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9ycy5ncmF5KHRleHQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGV4dDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBsaW5lcy5zbGljZShzdGFydCwgZW5kKS5tYXAoIChsaW5lLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgbGV0IG51bWJlciA9IHN0YXJ0ICsgMSArIGluZGV4O1xuICAgICAgICAgICAgbGV0IGd1dHRlciA9ICcgJyArICgnICcgKyBudW1iZXIpLnNsaWNlKC1tYXhXaWR0aCkgKyAnIHwgJztcbiAgICAgICAgICAgIGlmICggbnVtYmVyID09PSB0aGlzLmxpbmUgKSB7XG4gICAgICAgICAgICAgICAgbGV0IHNwYWNpbmcgPVxuICAgICAgICAgICAgICAgICAgICBhc2lkZShndXR0ZXIucmVwbGFjZSgvXFxkL2csICcgJykpICtcbiAgICAgICAgICAgICAgICAgICAgbGluZS5zbGljZSgwLCB0aGlzLmNvbHVtbiAtIDEpLnJlcGxhY2UoL1teXFx0XS9nLCAnICcpO1xuICAgICAgICAgICAgICAgIHJldHVybiBtYXJrKCc+JykgKyBhc2lkZShndXR0ZXIpICsgbGluZSArICdcXG4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmcgKyBtYXJrKCdeJyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnICcgKyBhc2lkZShndXR0ZXIpICsgbGluZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkuam9pbignXFxuJyk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBlcnJvciBwb3NpdGlvbiwgbWVzc2FnZSBhbmQgc291cmNlIGNvZGUgb2YgdGhlIGJyb2tlbiBwYXJ0LlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBlcnJvci50b1N0cmluZygpIC8vPT4gXCJDc3NTeW50YXhFcnJvcjogYXBwLmNzczoxOjE6IFVuY2xvc2VkIGJsb2NrXG4gICAgICogICAgICAgICAgICAgICAgICAvLyAgICA+IDEgfCBhIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgIC8vICAgICAgICB8IF5cIlxuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBlcnJvciBwb3NpdGlvbiwgbWVzc2FnZSBhbmQgc291cmNlIGNvZGVcbiAgICAgKi9cbiAgICB0b1N0cmluZygpIHtcbiAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNob3dTb3VyY2VDb2RlKCk7XG4gICAgICAgIGlmICggY29kZSApIHtcbiAgICAgICAgICAgIGNvZGUgPSAnXFxuXFxuJyArIGNvZGUgKyAnXFxuJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5uYW1lICsgJzogJyArIHRoaXMubWVzc2FnZSArIGNvZGU7XG4gICAgfVxuXG4gICAgZ2V0IGdlbmVyYXRlZCgpIHtcbiAgICAgICAgd2Fybk9uY2UoJ0Nzc1N5bnRheEVycm9yI2dlbmVyYXRlZCBpcyBkZXByZWNhdGVkLiBVc2UgaW5wdXQgaW5zdGVhZC4nKTtcbiAgICAgICAgcmV0dXJuIHRoaXMuaW5wdXQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIENzc1N5bnRheEVycm9yI1xuICAgICAqIEBtZW1iZXIge0lucHV0fSBpbnB1dCAtIElucHV0IG9iamVjdCB3aXRoIFBvc3RDU1MgaW50ZXJuYWwgaW5mb3JtYXRpb25cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBhYm91dCBpbnB1dCBmaWxlLiBJZiBpbnB1dCBoYXMgc291cmNlIG1hcFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gcHJldmlvdXMgdG9vbCwgUG9zdENTUyB3aWxsIHVzZSBvcmlnaW5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yIGV4YW1wbGUsIFNhc3MpIHNvdXJjZS4gWW91IGNhbiB1c2UgdGhpc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdCB0byBnZXQgUG9zdENTUyBpbnB1dCBzb3VyY2UuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGVycm9yLmlucHV0LmZpbGUgLy89PiAnYS5jc3MnXG4gICAgICogZXJyb3IuZmlsZSAgICAgICAvLz0+ICdhLnNhc3MnXG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ3NzU3ludGF4RXJyb3I7XG4iXX0=
  12284. /***/ }),
  12285. /* 92 */
  12286. /***/ (function(module, exports, __webpack_require__) {
  12287. "use strict";
  12288. exports.__esModule = true;
  12289. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12290. var _warnOnce = __webpack_require__(5);
  12291. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  12292. var _node = __webpack_require__(38);
  12293. var _node2 = _interopRequireDefault(_node);
  12294. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12295. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12296. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12297. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12298. /**
  12299. * Represents a CSS declaration.
  12300. *
  12301. * @extends Node
  12302. *
  12303. * @example
  12304. * const root = postcss.parse('a { color: black }');
  12305. * const decl = root.first.first;
  12306. * decl.type //=> 'decl'
  12307. * decl.toString() //=> ' color: black'
  12308. */
  12309. var Declaration = function (_Node) {
  12310. _inherits(Declaration, _Node);
  12311. function Declaration(defaults) {
  12312. _classCallCheck(this, Declaration);
  12313. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  12314. _this.type = 'decl';
  12315. return _this;
  12316. }
  12317. _createClass(Declaration, [{
  12318. key: '_value',
  12319. get: function get() {
  12320. (0, _warnOnce2.default)('Node#_value was deprecated. Use Node#raws.value');
  12321. return this.raws.value;
  12322. },
  12323. set: function set(val) {
  12324. (0, _warnOnce2.default)('Node#_value was deprecated. Use Node#raws.value');
  12325. this.raws.value = val;
  12326. }
  12327. }, {
  12328. key: '_important',
  12329. get: function get() {
  12330. (0, _warnOnce2.default)('Node#_important was deprecated. Use Node#raws.important');
  12331. return this.raws.important;
  12332. },
  12333. set: function set(val) {
  12334. (0, _warnOnce2.default)('Node#_important was deprecated. Use Node#raws.important');
  12335. this.raws.important = val;
  12336. }
  12337. /**
  12338. * @memberof Declaration#
  12339. * @member {string} prop - the declaration’s property name
  12340. *
  12341. * @example
  12342. * const root = postcss.parse('a { color: black }');
  12343. * const decl = root.first.first;
  12344. * decl.prop //=> 'color'
  12345. */
  12346. /**
  12347. * @memberof Declaration#
  12348. * @member {string} value - the declaration’s value
  12349. *
  12350. * @example
  12351. * const root = postcss.parse('a { color: black }');
  12352. * const decl = root.first.first;
  12353. * decl.value //=> 'black'
  12354. */
  12355. /**
  12356. * @memberof Declaration#
  12357. * @member {boolean} important - `true` if the declaration
  12358. * has an !important annotation.
  12359. *
  12360. * @example
  12361. * const root = postcss.parse('a { color: black !important; color: red }');
  12362. * root.first.first.important //=> true
  12363. * root.first.last.important //=> undefined
  12364. */
  12365. /**
  12366. * @memberof Declaration#
  12367. * @member {object} raws - Information to generate byte-to-byte equal
  12368. * node string as it was in the origin input.
  12369. *
  12370. * Every parser saves its own properties,
  12371. * but the default CSS parser uses:
  12372. *
  12373. * * `before`: the space symbols before the node. It also stores `*`
  12374. * and `_` symbols before the declaration (IE hack).
  12375. * * `between`: the symbols between the property and value
  12376. * for declarations.
  12377. * * `important`: the content of the important statement,
  12378. * if it is not just `!important`.
  12379. *
  12380. * PostCSS cleans declaration from comments and extra spaces,
  12381. * but it stores origin content in raws properties.
  12382. * As such, if you don’t change a declaration’s value,
  12383. * PostCSS will use the raw value with comments.
  12384. *
  12385. * @example
  12386. * const root = postcss.parse('a {\n color:black\n}')
  12387. * root.first.first.raws //=> { before: '\n ', between: ':' }
  12388. */
  12389. }]);
  12390. return Declaration;
  12391. }(_node2.default);
  12392. exports.default = Declaration;
  12393. module.exports = exports['default'];
  12394. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlY2xhcmF0aW9uLmVzNiJdLCJuYW1lcyI6WyJEZWNsYXJhdGlvbiIsImRlZmF1bHRzIiwidHlwZSIsInJhd3MiLCJ2YWx1ZSIsInZhbCIsImltcG9ydGFudCJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7QUFDQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7O0lBV01BLFc7OztBQUVGLHlCQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEscURBQ2xCLGlCQUFNQSxRQUFOLENBRGtCOztBQUVsQixjQUFLQyxJQUFMLEdBQVksTUFBWjtBQUZrQjtBQUdyQjs7Ozs0QkFFWTtBQUNULG9DQUFTLGlEQUFUO0FBQ0EsbUJBQU8sS0FBS0MsSUFBTCxDQUFVQyxLQUFqQjtBQUNILFM7MEJBRVVDLEcsRUFBSztBQUNaLG9DQUFTLGlEQUFUO0FBQ0EsaUJBQUtGLElBQUwsQ0FBVUMsS0FBVixHQUFrQkMsR0FBbEI7QUFDSDs7OzRCQUVnQjtBQUNiLG9DQUFTLHlEQUFUO0FBQ0EsbUJBQU8sS0FBS0YsS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KiAqIGBiZWZvcmVgOiB0aGUgc3BhY2Ugc3ltYm9scyBiZWZvcmUgdGhlIG5vZGUuIEl0IGFsc28gc3RvcmVzIGAqYFxuICAgICAqICAgYW5kIGBfYCBzeW1ib2xzIGJlZm9yZSB0aGUgZGVjbGFyYXRpb24gKElFIGhhY2spLlxuICAgICAqICogYGJldHdlZW5gOiB0aGUgc3ltYm9scyBiZXR3ZWVuIHRoZSBwcm9wZXJ0eSBhbmQgdmFsdWVcbiAgICAgKiAgIGZvciBkZWNsYXJhdGlvbnMuXG4gICAgICogKiBgaW1wb3J0YW50YDogdGhlIGNvbnRlbnQgb2YgdGhlIGltcG9ydGFudCBzdGF0ZW1lbnQsXG4gICAgICogICBpZiBpdCBpcyBub3QganVzdCBgIWltcG9ydGFudGAuXG4gICAgICpcbiAgICAgKiBQb3N0Q1NTIGNsZWFucyBkZWNsYXJhdGlvbiBmcm9tIGNvbW1lbnRzIGFuZCBleHRyYSBzcGFjZXMsXG4gICAgICogYnV0IGl0IHN0b3JlcyBvcmlnaW4gY29udGVudCBpbiByYXdzIHByb3BlcnRpZXMuXG4gICAgICogQXMgc3VjaCwgaWYgeW91IGRvbuKAmXQgY2hhbmdlIGEgZGVjbGFyYXRpb27igJlzIHZhbHVlLFxuICAgICAqIFBvc3RDU1Mgd2lsbCB1c2UgdGhlIHJhdyB2YWx1ZSB3aXRoIGNvbW1lbnRzLlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZSgnYSB7XFxuICBjb2xvcjpibGFja1xcbn0nKVxuICAgICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnXFxuICAnLCBiZXR3ZWVuOiAnOicgfVxuICAgICAqL1xuXG59XG5cbmV4cG9ydCBkZWZhdWx0IERlY2xhcmF0aW9uO1xuIl19
  12395. /***/ }),
  12396. /* 93 */
  12397. /***/ (function(module, exports, __webpack_require__) {
  12398. "use strict";
  12399. exports.__esModule = true;
  12400. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12401. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  12402. var _mapGenerator = __webpack_require__(194);
  12403. var _mapGenerator2 = _interopRequireDefault(_mapGenerator);
  12404. var _stringify2 = __webpack_require__(96);
  12405. var _stringify3 = _interopRequireDefault(_stringify2);
  12406. var _warnOnce = __webpack_require__(5);
  12407. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  12408. var _result = __webpack_require__(197);
  12409. var _result2 = _interopRequireDefault(_result);
  12410. var _parse = __webpack_require__(94);
  12411. var _parse2 = _interopRequireDefault(_parse);
  12412. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12413. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12414. function isPromise(obj) {
  12415. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.then === 'function';
  12416. }
  12417. /**
  12418. * A Promise proxy for the result of PostCSS transformations.
  12419. *
  12420. * A `LazyResult` instance is returned by {@link Processor#process}.
  12421. *
  12422. * @example
  12423. * const lazy = postcss([cssnext]).process(css);
  12424. */
  12425. var LazyResult = function () {
  12426. function LazyResult(processor, css, opts) {
  12427. _classCallCheck(this, LazyResult);
  12428. this.stringified = false;
  12429. this.processed = false;
  12430. var root = void 0;
  12431. if ((typeof css === 'undefined' ? 'undefined' : _typeof(css)) === 'object' && css.type === 'root') {
  12432. root = css;
  12433. } else if (css instanceof LazyResult || css instanceof _result2.default) {
  12434. root = css.root;
  12435. if (css.map) {
  12436. if (typeof opts.map === 'undefined') opts.map = {};
  12437. if (!opts.map.inline) opts.map.inline = false;
  12438. opts.map.prev = css.map;
  12439. }
  12440. } else {
  12441. var parser = _parse2.default;
  12442. if (opts.syntax) parser = opts.syntax.parse;
  12443. if (opts.parser) parser = opts.parser;
  12444. if (parser.parse) parser = parser.parse;
  12445. try {
  12446. root = parser(css, opts);
  12447. } catch (error) {
  12448. this.error = error;
  12449. }
  12450. }
  12451. this.result = new _result2.default(processor, root, opts);
  12452. }
  12453. /**
  12454. * Returns a {@link Processor} instance, which will be used
  12455. * for CSS transformations.
  12456. * @type {Processor}
  12457. */
  12458. /**
  12459. * Processes input CSS through synchronous plugins
  12460. * and calls {@link Result#warnings()}.
  12461. *
  12462. * @return {Warning[]} warnings from plugins
  12463. */
  12464. LazyResult.prototype.warnings = function warnings() {
  12465. return this.sync().warnings();
  12466. };
  12467. /**
  12468. * Alias for the {@link LazyResult#css} property.
  12469. *
  12470. * @example
  12471. * lazy + '' === lazy.css;
  12472. *
  12473. * @return {string} output CSS
  12474. */
  12475. LazyResult.prototype.toString = function toString() {
  12476. return this.css;
  12477. };
  12478. /**
  12479. * Processes input CSS through synchronous and asynchronous plugins
  12480. * and calls `onFulfilled` with a Result instance. If a plugin throws
  12481. * an error, the `onRejected` callback will be executed.
  12482. *
  12483. * It implements standard Promise API.
  12484. *
  12485. * @param {onFulfilled} onFulfilled - callback will be executed
  12486. * when all plugins will finish work
  12487. * @param {onRejected} onRejected - callback will be executed on any error
  12488. *
  12489. * @return {Promise} Promise API to make queue
  12490. *
  12491. * @example
  12492. * postcss([cssnext]).process(css).then(result => {
  12493. * console.log(result.css);
  12494. * });
  12495. */
  12496. LazyResult.prototype.then = function then(onFulfilled, onRejected) {
  12497. return this.async().then(onFulfilled, onRejected);
  12498. };
  12499. /**
  12500. * Processes input CSS through synchronous and asynchronous plugins
  12501. * and calls onRejected for each error thrown in any plugin.
  12502. *
  12503. * It implements standard Promise API.
  12504. *
  12505. * @param {onRejected} onRejected - callback will be executed on any error
  12506. *
  12507. * @return {Promise} Promise API to make queue
  12508. *
  12509. * @example
  12510. * postcss([cssnext]).process(css).then(result => {
  12511. * console.log(result.css);
  12512. * }).catch(error => {
  12513. * console.error(error);
  12514. * });
  12515. */
  12516. LazyResult.prototype.catch = function _catch(onRejected) {
  12517. return this.async().catch(onRejected);
  12518. };
  12519. LazyResult.prototype.handleError = function handleError(error, plugin) {
  12520. try {
  12521. this.error = error;
  12522. if (error.name === 'CssSyntaxError' && !error.plugin) {
  12523. error.plugin = plugin.postcssPlugin;
  12524. error.setMessage();
  12525. } else if (plugin.postcssVersion) {
  12526. var pluginName = plugin.postcssPlugin;
  12527. var pluginVer = plugin.postcssVersion;
  12528. var runtimeVer = this.result.processor.version;
  12529. var a = pluginVer.split('.');
  12530. var b = runtimeVer.split('.');
  12531. if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
  12532. (0, _warnOnce2.default)('Your current PostCSS version ' + 'is ' + runtimeVer + ', but ' + pluginName + ' ' + 'uses ' + pluginVer + '. Perhaps this is ' + 'the source of the error below.');
  12533. }
  12534. }
  12535. } catch (err) {
  12536. if (console && console.error) console.error(err);
  12537. }
  12538. };
  12539. LazyResult.prototype.asyncTick = function asyncTick(resolve, reject) {
  12540. var _this = this;
  12541. if (this.plugin >= this.processor.plugins.length) {
  12542. this.processed = true;
  12543. return resolve();
  12544. }
  12545. try {
  12546. var plugin = this.processor.plugins[this.plugin];
  12547. var promise = this.run(plugin);
  12548. this.plugin += 1;
  12549. if (isPromise(promise)) {
  12550. promise.then(function () {
  12551. _this.asyncTick(resolve, reject);
  12552. }).catch(function (error) {
  12553. _this.handleError(error, plugin);
  12554. _this.processed = true;
  12555. reject(error);
  12556. });
  12557. } else {
  12558. this.asyncTick(resolve, reject);
  12559. }
  12560. } catch (error) {
  12561. this.processed = true;
  12562. reject(error);
  12563. }
  12564. };
  12565. LazyResult.prototype.async = function async() {
  12566. var _this2 = this;
  12567. if (this.processed) {
  12568. return new Promise(function (resolve, reject) {
  12569. if (_this2.error) {
  12570. reject(_this2.error);
  12571. } else {
  12572. resolve(_this2.stringify());
  12573. }
  12574. });
  12575. }
  12576. if (this.processing) {
  12577. return this.processing;
  12578. }
  12579. this.processing = new Promise(function (resolve, reject) {
  12580. if (_this2.error) return reject(_this2.error);
  12581. _this2.plugin = 0;
  12582. _this2.asyncTick(resolve, reject);
  12583. }).then(function () {
  12584. _this2.processed = true;
  12585. return _this2.stringify();
  12586. });
  12587. return this.processing;
  12588. };
  12589. LazyResult.prototype.sync = function sync() {
  12590. if (this.processed) return this.result;
  12591. this.processed = true;
  12592. if (this.processing) {
  12593. throw new Error('Use process(css).then(cb) to work with async plugins');
  12594. }
  12595. if (this.error) throw this.error;
  12596. for (var _iterator = this.result.processor.plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  12597. var _ref;
  12598. if (_isArray) {
  12599. if (_i >= _iterator.length) break;
  12600. _ref = _iterator[_i++];
  12601. } else {
  12602. _i = _iterator.next();
  12603. if (_i.done) break;
  12604. _ref = _i.value;
  12605. }
  12606. var plugin = _ref;
  12607. var promise = this.run(plugin);
  12608. if (isPromise(promise)) {
  12609. throw new Error('Use process(css).then(cb) to work with async plugins');
  12610. }
  12611. }
  12612. return this.result;
  12613. };
  12614. LazyResult.prototype.run = function run(plugin) {
  12615. this.result.lastPlugin = plugin;
  12616. try {
  12617. return plugin(this.result.root, this.result);
  12618. } catch (error) {
  12619. this.handleError(error, plugin);
  12620. throw error;
  12621. }
  12622. };
  12623. LazyResult.prototype.stringify = function stringify() {
  12624. if (this.stringified) return this.result;
  12625. this.stringified = true;
  12626. this.sync();
  12627. var opts = this.result.opts;
  12628. var str = _stringify3.default;
  12629. if (opts.syntax) str = opts.syntax.stringify;
  12630. if (opts.stringifier) str = opts.stringifier;
  12631. if (str.stringify) str = str.stringify;
  12632. var map = new _mapGenerator2.default(str, this.result.root, this.result.opts);
  12633. var data = map.generate();
  12634. this.result.css = data[0];
  12635. this.result.map = data[1];
  12636. return this.result;
  12637. };
  12638. _createClass(LazyResult, [{
  12639. key: 'processor',
  12640. get: function get() {
  12641. return this.result.processor;
  12642. }
  12643. /**
  12644. * Options from the {@link Processor#process} call.
  12645. * @type {processOptions}
  12646. */
  12647. }, {
  12648. key: 'opts',
  12649. get: function get() {
  12650. return this.result.opts;
  12651. }
  12652. /**
  12653. * Processes input CSS through synchronous plugins, converts `Root`
  12654. * to a CSS string and returns {@link Result#css}.
  12655. *
  12656. * This property will only work with synchronous plugins.
  12657. * If the processor contains any asynchronous plugins
  12658. * it will throw an error. This is why this method is only
  12659. * for debug purpose, you should always use {@link LazyResult#then}.
  12660. *
  12661. * @type {string}
  12662. * @see Result#css
  12663. */
  12664. }, {
  12665. key: 'css',
  12666. get: function get() {
  12667. return this.stringify().css;
  12668. }
  12669. /**
  12670. * An alias for the `css` property. Use it with syntaxes
  12671. * that generate non-CSS output.
  12672. *
  12673. * This property will only work with synchronous plugins.
  12674. * If the processor contains any asynchronous plugins
  12675. * it will throw an error. This is why this method is only
  12676. * for debug purpose, you should always use {@link LazyResult#then}.
  12677. *
  12678. * @type {string}
  12679. * @see Result#content
  12680. */
  12681. }, {
  12682. key: 'content',
  12683. get: function get() {
  12684. return this.stringify().content;
  12685. }
  12686. /**
  12687. * Processes input CSS through synchronous plugins
  12688. * and returns {@link Result#map}.
  12689. *
  12690. * This property will only work with synchronous plugins.
  12691. * If the processor contains any asynchronous plugins
  12692. * it will throw an error. This is why this method is only
  12693. * for debug purpose, you should always use {@link LazyResult#then}.
  12694. *
  12695. * @type {SourceMapGenerator}
  12696. * @see Result#map
  12697. */
  12698. }, {
  12699. key: 'map',
  12700. get: function get() {
  12701. return this.stringify().map;
  12702. }
  12703. /**
  12704. * Processes input CSS through synchronous plugins
  12705. * and returns {@link Result#root}.
  12706. *
  12707. * This property will only work with synchronous plugins. If the processor
  12708. * contains any asynchronous plugins it will throw an error.
  12709. *
  12710. * This is why this method is only for debug purpose,
  12711. * you should always use {@link LazyResult#then}.
  12712. *
  12713. * @type {Root}
  12714. * @see Result#root
  12715. */
  12716. }, {
  12717. key: 'root',
  12718. get: function get() {
  12719. return this.sync().root;
  12720. }
  12721. /**
  12722. * Processes input CSS through synchronous plugins
  12723. * and returns {@link Result#messages}.
  12724. *
  12725. * This property will only work with synchronous plugins. If the processor
  12726. * contains any asynchronous plugins it will throw an error.
  12727. *
  12728. * This is why this method is only for debug purpose,
  12729. * you should always use {@link LazyResult#then}.
  12730. *
  12731. * @type {Message[]}
  12732. * @see Result#messages
  12733. */
  12734. }, {
  12735. key: 'messages',
  12736. get: function get() {
  12737. return this.sync().messages;
  12738. }
  12739. }]);
  12740. return LazyResult;
  12741. }();
  12742. exports.default = LazyResult;
  12743. /**
  12744. * @callback onFulfilled
  12745. * @param {Result} result
  12746. */
  12747. /**
  12748. * @callback onRejected
  12749. * @param {Error} error
  12750. */
  12751. module.exports = exports['default'];
  12752. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhenktcmVzdWx0LmVzNiJdLCJuYW1lcyI6WyJpc1Byb21pc2UiLCJvYmoiLCJ0aGVuIiwiTGF6eVJlc3VsdCIsInByb2Nlc3NvciIsImNzcyIsIm9wdHMiLCJzdHJpbmdpZmllZCIsInByb2Nlc3NlZCIsInJvb3QiLCJ0eXBlIiwibWFwIiwiaW5saW5lIiwicHJldiIsInBhcnNlciIsInN5bnRheCIsInBhcnNlIiwiZXJyb3IiLCJyZXN1bHQiLCJ3YXJuaW5ncyIsInN5bmMiLCJ0b1N0cmluZyIsIm9uRnVsZmlsbGVkIiwib25SZWplY3RlZCIsImFzeW5jIiwiY2F0Y2giLCJoYW5kbGVFcnJvciIsInBsdWdpbiIsI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iBAZXhhbXBsZVxuICogY29uc3QgbGF6eSA9IHBvc3Rjc3MoW2Nzc25leHRdKS5wcm9jZXNzKGNzcyk7XG4gKi9cbmNsYXNzIExhenlSZXN1bHQge1xuXG4gICAgY29uc3RydWN0b3IocHJvY2Vzc29yLCBjc3MsIG9wdHMpIHtcbiAgICAgICAgdGhpcy5zdHJpbmdpZmllZCA9IGZhbHNlO1xuICAgICAgICB0aGlzLnByb2Nlc3NlZCAgID0gZmFsc2U7XG5cbiAgICAgICAgbGV0IHJvb3Q7XG4gICAgICAgIGlmICggdHlwZW9mIGNzcyA9PT0gJ29iamVjdCcgJiYgY3NzLnR5cGUgPT09ICdyb290JyApIHtcbiAgICAgICAgICAgIHJvb3QgPSBjc3M7XG4gICAgICAgIH0gZWxzZSBpZiAoIGNzcyBpbnN0YW5jZW9mIExhenlSZXN1bHQgfHwgY3NzIGluc3RhbmNlb2YgUmVzdWx0ICkge1xuICAgICAgICAgICAgcm9vdCA9IGNzcy5yb290O1xuICAgICAgICAgICAgaWYgKCBjc3MubWFwICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIG9wdHMubWFwID09PSAndW5kZWZpbmVkJyApIG9wdHMubWFwID0geyB9O1xuICAgICAgICAgICAgICAgIGlmICggIW9wdHMubWFwLmlubGluZSApIG9wdHMubWFwLmlubGluZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIG9wdHMubWFwLnByZXYgPSBjc3MubWFwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IHBhcnNlciA9IHBhcnNlO1xuICAgICAgICAgICAgaWYgKCBvcHRzLnN5bnRheCApICBwYXJzZXIgPSBvcHRzLnN5bnRheC5wYXJzZTtcbiAgICAgICAgICAgIGlmICggb3B0cy5wYXJzZXIgKSAgcGFyc2VyID0gb3B0cy5wYXJzZXI7XG4gICAgICAgICAgICBpZiAoIHBhcnNlci5wYXJzZSApIHBhcnNlciA9IHBhcnNlci5wY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XJyb3IgPT4ge1xuICAgICAqICAgY29uc29sZS5lcnJvcihlcnJvcik7XG4gICAgICogfSk7XG4gICAgICovXG4gICAgY2F0Y2gob25SZWplY3RlZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5hc3luYygpLmNhdGNoKG9uUmVqZWN0ZWQpO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9yKGVycm9yLCBwbHVnaW4pIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRoaXMuZXJyb3IgPSBlcnJvcjtcbiAgICAgICAgICAgIGlmICggZXJyb3IubmFtZSA9PT0gJ0Nzc1N5bnRheEVycm9yJyAmJiAhZXJyb3IucGx1Z2luICkge1xuICAgICAgICAgICAgICAgIGVycm9yLnBsdWdpbiA9IHBsdWdpbi5wb3N0Y3NzUGx1Z2luO1xuICAgICAgICAgICAgICAgIGVycm9yLnNldE1lc3NhZ2UoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHBsdWdpbi5wb3N0Y3NzVmVyc2lvbiApIHtcbiAgICAgICAgICAgICAgICBsZXQgcGx1Z2luTmFtZSA9IHBsdWdpbi5wb3N0Y3NzUGx1Z2luO1xuICAgICAgICAgICAgICAgIGxldCBwbHVnaW5WZXIgID0gcGx1Z2luLnBvc3Rjc3NWZXJzaW9uO1xuICAgICAgICAgICAgICAgIGxldCBydW50aW1lVmVyID0gdGhpcy5yZXN1bHQucHJvY2Vzc29yLnZlcnNpb247XG4gICAgICAgICAgICAgICAgbGV0IGEgPSBwbHVnaW5WZXIuc3BsaXQoJy4nKTtcbiAgICAgICAgICAgICAgICBsZXQgYiA9IHJ1bnRpbWVWZXIuc3BsaXQoJy4nKTtcblxuICAgICAgICAgICAgICAgIGlmICggYVswXSAhPT0gYlswXSB8fCBwYXJzZUludChhWzFdKSA+IHBhcnNlSW50KGJbMV0pICkge1xuICAgICAgICAgICAgICAgICAgICB3YXJuT25jZSgnWW91ciBjdXJyZW50IFBvc3RDU1MgdmVyc2lvbiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2lzICcgKyBydW50aW1lVmVyICsgJywgYnV0ICcgKyBwbHVnaW5OYW1lICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXMgJyArIHBsdWdpblZlciArICcuIFBlcmhhcHMgdGhpcyBpcyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RoZSBzb3VyY2Ugb2YgdGhlIGVycm9yIGJlbG93LicpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICBpZiAoIGNvbnNvbGUgJiYgY29uc29sZS5lcnJvciApIGNvbnNvbGUuZXJyb3IoZXJyKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jVGljayhyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgaWYgKCB0aGlzLnBsdWdpbiA+PSB0aGlzLnByb2Nlc3Nvci5wbHVnaW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIHJldHVybiByZXNvbHZlKCk7XG4gICAgICAgIH1cblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgbGV0IHBsdWdpbiAgPSB0aGlzLnByb2Nlc3Nvci5wbHVnaW5zW3RoaXMucGx1Z2luXTtcbiAgICAgICAgICAgIGxldCBwcm9taXNlID0gdGhpcy5ydW4ocGx1Z2luKTtcbiAgICAgICAgICAgIHRoaXMucGx1Z2luICs9IDE7XG5cbiAgICAgICAgICAgIGlmICggaXNQcm9taXNlKHByb21pc2UpICkge1xuICAgICAgICAgICAgICAgIHByb21pc2UudGhlbiggKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFzeW5jVGljayhyZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKCBlcnJvciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaGFuZGxlRXJyb3IoZXJyb3IsIHBsdWdpbik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hc3luY1RpY2socmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jKCkge1xuICAgICAgICBpZiAoIHRoaXMucHJvY2Vzc2VkICkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKCAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLmVycm9yICkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnN0cmluZ2lmeSgpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHRoaXMucHJvY2Vzc2luZyApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByb2Nlc3Npbmc7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnByb2Nlc3NpbmcgPSBuZXcgUHJvbWlzZSggKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgaWYgKCB0aGlzLmVycm9yICkgcmV0dXJuIHJlamVjdCh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgIHRoaXMucGx1Z2luID0gMDtcbiAgICAgICAgICAgIHRoaXMuYXN5bmNUaWNrKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICAgIH0pLnRoZW4oICgpID0+IHtcbiAgICAgICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnN0cmluZ2lmeSgpO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5wcm9jZXNzaW5nO1xuICAgIH1cblxuICAgIHN5bmMoKSB7XG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzZWQgKSByZXR1cm4gdGhpcy5yZXN1bHQ7XG4gICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcblxuICAgICAgICBpZiAoIHRoaXMucHJvY2Vzc2luZyApIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAnVXNlIHByb2Nlc3MoY3NzKS50aGVuKGNiKSB0byB3b3JrIHdpdGggYXN5bmMgcGx1Z2lucycpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCB0aGlzLmVycm9yICkgdGhyb3cgdGhpcy5lcnJvcjtcblxuICAgICAgICBmb3IgKCBsZXQgcGx1Z2luIG9mIHRoaXMucmVzdWx0LnByb2Nlc3Nvci5wbHVnaW5zICkge1xuICAgICAgICAgICAgbGV0IHByb21pc2UgPSB0aGlzLnJ1bihwbHVnaW4pO1xuICAgICAgICAgICAgaWYgKCBpc1Byb21pc2UocHJvbWlzZSkgKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAnVXNlIHByb2Nlc3MoY3NzKS50aGVuKGNiKSB0byB3b3JrIHdpdGggYXN5bmMgcGx1Z2lucycpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMucmVzdWx0O1xuICAgIH1cbl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ldHVybiB0aGlzLnJlc3VsdDtcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgTGF6eVJlc3VsdDtcblxuLyoqXG4gKiBAY2FsbGJhY2sgb25GdWxmaWxsZWRcbiAqIEBwYXJhbSB7UmVzdWx0fSByZXN1bHRcbiAqL1xuXG4vKipcbiAqIEBjYWxsYmFjayBvblJlamVjdGVkXG4gKiBAcGFyYW0ge0Vycm9yfSBlcnJvclxuICovXG4iXX0=
  12753. /***/ }),
  12754. /* 94 */
  12755. /***/ (function(module, exports, __webpack_require__) {
  12756. "use strict";
  12757. exports.__esModule = true;
  12758. exports.default = parse;
  12759. var _parser = __webpack_require__(95);
  12760. var _parser2 = _interopRequireDefault(_parser);
  12761. var _input = __webpack_require__(37);
  12762. var _input2 = _interopRequireDefault(_input);
  12763. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12764. function parse(css, opts) {
  12765. if (opts && opts.safe) {
  12766. throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
  12767. }
  12768. var input = new _input2.default(css, opts);
  12769. var parser = new _parser2.default(input);
  12770. try {
  12771. parser.tokenize();
  12772. parser.loop();
  12773. } catch (e) {
  12774. if (e.name === 'CssSyntaxError' && opts && opts.from) {
  12775. if (/\.scss$/i.test(opts.from)) {
  12776. e.message += '\nYou tried to parse SCSS with ' + 'the standard CSS parser; ' + 'try again with the postcss-scss parser';
  12777. } else if (/\.sass/i.test(opts.from)) {
  12778. e.message += '\nYou tried to parse Sass with ' + 'the standard CSS parser; ' + 'try again with the postcss-sass parser';
  12779. } else if (/\.less$/i.test(opts.from)) {
  12780. e.message += '\nYou tried to parse Less with ' + 'the standard CSS parser; ' + 'try again with the postcss-less parser';
  12781. }
  12782. }
  12783. throw e;
  12784. }
  12785. return parser.root;
  12786. }
  12787. module.exports = exports['default'];
  12788. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInB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ZXI7ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndHJ5IGFnYWluIHdpdGggdGhlIHBvc3Rjc3Mtc2NzcyBwYXJzZXInO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggL1xcLnNhc3MvaS50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgZS5tZXNzYWdlICs9ICdcXG5Zb3UgdHJpZWQgdG8gcGFyc2UgU2FzcyB3aXRoICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGhlIHN0YW5kYXJkIENTUyBwYXJzZXI7ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndHJ5IGFnYWluIHdpdGggdGhlIHBvc3Rjc3Mtc2FzcyBwYXJzZXInO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggL1xcLmxlc3MkL2kudGVzdChvcHRzLmZyb20pICkge1xuICAgICAgICAgICAgICAgIGUubWVzc2FnZSArPSAnXFxuWW91IHRyaWVkIHRvIHBhcnNlIExlc3Mgd2l0aCAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RoZSBzdGFuZGFyZCBDU1MgcGFyc2VyOyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RyeSBhZ2FpbiB3aXRoIHRoZSBwb3N0Y3NzLWxlc3MgcGFyc2VyJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBlO1xuICAgIH1cblxuICAgIHJldHVybiBwYXJzZXIucm9vdDtcbn1cbiJdfQ==
  12789. /***/ }),
  12790. /* 95 */
  12791. /***/ (function(module, exports, __webpack_require__) {
  12792. "use strict";
  12793. exports.__esModule = true;
  12794. var _declaration = __webpack_require__(92);
  12795. var _declaration2 = _interopRequireDefault(_declaration);
  12796. var _tokenize = __webpack_require__(97);
  12797. var _tokenize2 = _interopRequireDefault(_tokenize);
  12798. var _comment = __webpack_require__(35);
  12799. var _comment2 = _interopRequireDefault(_comment);
  12800. var _atRule = __webpack_require__(34);
  12801. var _atRule2 = _interopRequireDefault(_atRule);
  12802. var _root = __webpack_require__(39);
  12803. var _root2 = _interopRequireDefault(_root);
  12804. var _rule = __webpack_require__(16);
  12805. var _rule2 = _interopRequireDefault(_rule);
  12806. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12807. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12808. var Parser = function () {
  12809. function Parser(input) {
  12810. _classCallCheck(this, Parser);
  12811. this.input = input;
  12812. this.pos = 0;
  12813. this.root = new _root2.default();
  12814. this.current = this.root;
  12815. this.spaces = '';
  12816. this.semicolon = false;
  12817. this.root.source = { input: input, start: { line: 1, column: 1 } };
  12818. }
  12819. Parser.prototype.tokenize = function tokenize() {
  12820. this.tokens = (0, _tokenize2.default)(this.input);
  12821. };
  12822. Parser.prototype.loop = function loop() {
  12823. var token = void 0;
  12824. while (this.pos < this.tokens.length) {
  12825. token = this.tokens[this.pos];
  12826. switch (token[0]) {
  12827. case 'space':
  12828. case ';':
  12829. this.spaces += token[1];
  12830. break;
  12831. case '}':
  12832. this.end(token);
  12833. break;
  12834. case 'comment':
  12835. this.comment(token);
  12836. break;
  12837. case 'at-word':
  12838. this.atrule(token);
  12839. break;
  12840. case '{':
  12841. this.emptyRule(token);
  12842. break;
  12843. default:
  12844. this.other();
  12845. break;
  12846. }
  12847. this.pos += 1;
  12848. }
  12849. this.endFile();
  12850. };
  12851. Parser.prototype.comment = function comment(token) {
  12852. var node = new _comment2.default();
  12853. this.init(node, token[2], token[3]);
  12854. node.source.end = { line: token[4], column: token[5] };
  12855. var text = token[1].slice(2, -2);
  12856. if (/^\s*$/.test(text)) {
  12857. node.text = '';
  12858. node.raws.left = text;
  12859. node.raws.right = '';
  12860. } else {
  12861. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  12862. node.text = match[2];
  12863. node.raws.left = match[1];
  12864. node.raws.right = match[3];
  12865. }
  12866. };
  12867. Parser.prototype.emptyRule = function emptyRule(token) {
  12868. var node = new _rule2.default();
  12869. this.init(node, token[2], token[3]);
  12870. node.selector = '';
  12871. node.raws.between = '';
  12872. this.current = node;
  12873. };
  12874. Parser.prototype.other = function other() {
  12875. var token = void 0;
  12876. var end = false;
  12877. var type = null;
  12878. var colon = false;
  12879. var bracket = null;
  12880. var brackets = [];
  12881. var start = this.pos;
  12882. while (this.pos < this.tokens.length) {
  12883. token = this.tokens[this.pos];
  12884. type = token[0];
  12885. if (type === '(' || type === '[') {
  12886. if (!bracket) bracket = token;
  12887. brackets.push(type === '(' ? ')' : ']');
  12888. } else if (brackets.length === 0) {
  12889. if (type === ';') {
  12890. if (colon) {
  12891. this.decl(this.tokens.slice(start, this.pos + 1));
  12892. return;
  12893. } else {
  12894. break;
  12895. }
  12896. } else if (type === '{') {
  12897. this.rule(this.tokens.slice(start, this.pos + 1));
  12898. return;
  12899. } else if (type === '}') {
  12900. this.pos -= 1;
  12901. end = true;
  12902. break;
  12903. } else if (type === ':') {
  12904. colon = true;
  12905. }
  12906. } else if (type === brackets[brackets.length - 1]) {
  12907. brackets.pop();
  12908. if (brackets.length === 0) bracket = null;
  12909. }
  12910. this.pos += 1;
  12911. }
  12912. if (this.pos === this.tokens.length) {
  12913. this.pos -= 1;
  12914. end = true;
  12915. }
  12916. if (brackets.length > 0) this.unclosedBracket(bracket);
  12917. if (end && colon) {
  12918. while (this.pos > start) {
  12919. token = this.tokens[this.pos][0];
  12920. if (token !== 'space' && token !== 'comment') break;
  12921. this.pos -= 1;
  12922. }
  12923. this.decl(this.tokens.slice(start, this.pos + 1));
  12924. return;
  12925. }
  12926. this.unknownWord(start);
  12927. };
  12928. Parser.prototype.rule = function rule(tokens) {
  12929. tokens.pop();
  12930. var node = new _rule2.default();
  12931. this.init(node, tokens[0][2], tokens[0][3]);
  12932. node.raws.between = this.spacesAndCommentsFromEnd(tokens);
  12933. this.raw(node, 'selector', tokens);
  12934. this.current = node;
  12935. };
  12936. Parser.prototype.decl = function decl(tokens) {
  12937. var node = new _declaration2.default();
  12938. this.init(node);
  12939. var last = tokens[tokens.length - 1];
  12940. if (last[0] === ';') {
  12941. this.semicolon = true;
  12942. tokens.pop();
  12943. }
  12944. if (last[4]) {
  12945. node.source.end = { line: last[4], column: last[5] };
  12946. } else {
  12947. node.source.end = { line: last[2], column: last[3] };
  12948. }
  12949. while (tokens[0][0] !== 'word') {
  12950. node.raws.before += tokens.shift()[1];
  12951. }
  12952. node.source.start = { line: tokens[0][2], column: tokens[0][3] };
  12953. node.prop = '';
  12954. while (tokens.length) {
  12955. var type = tokens[0][0];
  12956. if (type === ':' || type === 'space' || type === 'comment') {
  12957. break;
  12958. }
  12959. node.prop += tokens.shift()[1];
  12960. }
  12961. node.raws.between = '';
  12962. var token = void 0;
  12963. while (tokens.length) {
  12964. token = tokens.shift();
  12965. if (token[0] === ':') {
  12966. node.raws.between += token[1];
  12967. break;
  12968. } else {
  12969. node.raws.between += token[1];
  12970. }
  12971. }
  12972. if (node.prop[0] === '_' || node.prop[0] === '*') {
  12973. node.raws.before += node.prop[0];
  12974. node.prop = node.prop.slice(1);
  12975. }
  12976. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  12977. this.precheckMissedSemicolon(tokens);
  12978. for (var i = tokens.length - 1; i > 0; i--) {
  12979. token = tokens[i];
  12980. if (token[1] === '!important') {
  12981. node.important = true;
  12982. var string = this.stringFrom(tokens, i);
  12983. string = this.spacesFromEnd(tokens) + string;
  12984. if (string !== ' !important') node.raws.important = string;
  12985. break;
  12986. } else if (token[1] === 'important') {
  12987. var cache = tokens.slice(0);
  12988. var str = '';
  12989. for (var j = i; j > 0; j--) {
  12990. var _type = cache[j][0];
  12991. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  12992. break;
  12993. }
  12994. str = cache.pop()[1] + str;
  12995. }
  12996. if (str.trim().indexOf('!') === 0) {
  12997. node.important = true;
  12998. node.raws.important = str;
  12999. tokens = cache;
  13000. }
  13001. }
  13002. if (token[0] !== 'space' && token[0] !== 'comment') {
  13003. break;
  13004. }
  13005. }
  13006. this.raw(node, 'value', tokens);
  13007. if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens);
  13008. };
  13009. Parser.prototype.atrule = function atrule(token) {
  13010. var node = new _atRule2.default();
  13011. node.name = token[1].slice(1);
  13012. if (node.name === '') {
  13013. this.unnamedAtrule(node, token);
  13014. }
  13015. this.init(node, token[2], token[3]);
  13016. var last = false;
  13017. var open = false;
  13018. var params = [];
  13019. this.pos += 1;
  13020. while (this.pos < this.tokens.length) {
  13021. token = this.tokens[this.pos];
  13022. if (token[0] === ';') {
  13023. node.source.end = { line: token[2], column: token[3] };
  13024. this.semicolon = true;
  13025. break;
  13026. } else if (token[0] === '{') {
  13027. open = true;
  13028. break;
  13029. } else if (token[0] === '}') {
  13030. this.end(token);
  13031. break;
  13032. } else {
  13033. params.push(token);
  13034. }
  13035. this.pos += 1;
  13036. }
  13037. if (this.pos === this.tokens.length) {
  13038. last = true;
  13039. }
  13040. node.raws.between = this.spacesAndCommentsFromEnd(params);
  13041. if (params.length) {
  13042. node.raws.afterName = this.spacesAndCommentsFromStart(params);
  13043. this.raw(node, 'params', params);
  13044. if (last) {
  13045. token = params[params.length - 1];
  13046. node.source.end = { line: token[4], column: token[5] };
  13047. this.spaces = node.raws.between;
  13048. node.raws.between = '';
  13049. }
  13050. } else {
  13051. node.raws.afterName = '';
  13052. node.params = '';
  13053. }
  13054. if (open) {
  13055. node.nodes = [];
  13056. this.current = node;
  13057. }
  13058. };
  13059. Parser.prototype.end = function end(token) {
  13060. if (this.current.nodes && this.current.nodes.length) {
  13061. this.current.raws.semicolon = this.semicolon;
  13062. }
  13063. this.semicolon = false;
  13064. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  13065. this.spaces = '';
  13066. if (this.current.parent) {
  13067. this.current.source.end = { line: token[2], column: token[3] };
  13068. this.current = this.current.parent;
  13069. } else {
  13070. this.unexpectedClose(token);
  13071. }
  13072. };
  13073. Parser.prototype.endFile = function endFile() {
  13074. if (this.current.parent) this.unclosedBlock();
  13075. if (this.current.nodes && this.current.nodes.length) {
  13076. this.current.raws.semicolon = this.semicolon;
  13077. }
  13078. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  13079. };
  13080. // Helpers
  13081. Parser.prototype.init = function init(node, line, column) {
  13082. this.current.push(node);
  13083. node.source = { start: { line: line, column: column }, input: this.input };
  13084. node.raws.before = this.spaces;
  13085. this.spaces = '';
  13086. if (node.type !== 'comment') this.semicolon = false;
  13087. };
  13088. Parser.prototype.raw = function raw(node, prop, tokens) {
  13089. var token = void 0,
  13090. type = void 0;
  13091. var length = tokens.length;
  13092. var value = '';
  13093. var clean = true;
  13094. for (var i = 0; i < length; i += 1) {
  13095. token = tokens[i];
  13096. type = token[0];
  13097. if (type === 'comment' || type === 'space' && i === length - 1) {
  13098. clean = false;
  13099. } else {
  13100. value += token[1];
  13101. }
  13102. }
  13103. if (!clean) {
  13104. var raw = tokens.reduce(function (all, i) {
  13105. return all + i[1];
  13106. }, '');
  13107. node.raws[prop] = { value: value, raw: raw };
  13108. }
  13109. node[prop] = value;
  13110. };
  13111. Parser.prototype.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) {
  13112. var lastTokenType = void 0;
  13113. var spaces = '';
  13114. while (tokens.length) {
  13115. lastTokenType = tokens[tokens.length - 1][0];
  13116. if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
  13117. spaces = tokens.pop()[1] + spaces;
  13118. }
  13119. return spaces;
  13120. };
  13121. Parser.prototype.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) {
  13122. var next = void 0;
  13123. var spaces = '';
  13124. while (tokens.length) {
  13125. next = tokens[0][0];
  13126. if (next !== 'space' && next !== 'comment') break;
  13127. spaces += tokens.shift()[1];
  13128. }
  13129. return spaces;
  13130. };
  13131. Parser.prototype.spacesFromEnd = function spacesFromEnd(tokens) {
  13132. var lastTokenType = void 0;
  13133. var spaces = '';
  13134. while (tokens.length) {
  13135. lastTokenType = tokens[tokens.length - 1][0];
  13136. if (lastTokenType !== 'space') break;
  13137. spaces = tokens.pop()[1] + spaces;
  13138. }
  13139. return spaces;
  13140. };
  13141. Parser.prototype.stringFrom = function stringFrom(tokens, from) {
  13142. var result = '';
  13143. for (var i = from; i < tokens.length; i++) {
  13144. result += tokens[i][1];
  13145. }
  13146. tokens.splice(from, tokens.length - from);
  13147. return result;
  13148. };
  13149. Parser.prototype.colon = function colon(tokens) {
  13150. var brackets = 0;
  13151. var token = void 0,
  13152. type = void 0,
  13153. prev = void 0;
  13154. for (var i = 0; i < tokens.length; i++) {
  13155. token = tokens[i];
  13156. type = token[0];
  13157. if (type === '(') {
  13158. brackets += 1;
  13159. } else if (type === ')') {
  13160. brackets -= 1;
  13161. } else if (brackets === 0 && type === ':') {
  13162. if (!prev) {
  13163. this.doubleColon(token);
  13164. } else if (prev[0] === 'word' && prev[1] === 'progid') {
  13165. continue;
  13166. } else {
  13167. return i;
  13168. }
  13169. }
  13170. prev = token;
  13171. }
  13172. return false;
  13173. };
  13174. // Errors
  13175. Parser.prototype.unclosedBracket = function unclosedBracket(bracket) {
  13176. throw this.input.error('Unclosed bracket', bracket[2], bracket[3]);
  13177. };
  13178. Parser.prototype.unknownWord = function unknownWord(start) {
  13179. var token = this.tokens[start];
  13180. throw this.input.error('Unknown word', token[2], token[3]);
  13181. };
  13182. Parser.prototype.unexpectedClose = function unexpectedClose(token) {
  13183. throw this.input.error('Unexpected }', token[2], token[3]);
  13184. };
  13185. Parser.prototype.unclosedBlock = function unclosedBlock() {
  13186. var pos = this.current.source.start;
  13187. throw this.input.error('Unclosed block', pos.line, pos.column);
  13188. };
  13189. Parser.prototype.doubleColon = function doubleColon(token) {
  13190. throw this.input.error('Double colon', token[2], token[3]);
  13191. };
  13192. Parser.prototype.unnamedAtrule = function unnamedAtrule(node, token) {
  13193. throw this.input.error('At-rule without name', token[2], token[3]);
  13194. };
  13195. Parser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
  13196. // Hook for Safe Parser
  13197. tokens;
  13198. };
  13199. Parser.prototype.checkMissedSemicolon = function checkMissedSemicolon(tokens) {
  13200. var colon = this.colon(tokens);
  13201. if (colon === false) return;
  13202. var founded = 0;
  13203. var token = void 0;
  13204. for (var j = colon - 1; j >= 0; j--) {
  13205. token = tokens[j];
  13206. if (token[0] !== 'space') {
  13207. founded += 1;
  13208. if (founded === 2) break;
  13209. }
  13210. }
  13211. throw this.input.error('Missed semicolon', token[2], token[3]);
  13212. };
  13213. return Parser;
  13214. }();
  13215. exports.default = Parser;
  13216. module.exports = exports['default'];
  13217. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOlsiUGFyc2VyIiwiaW5wdXQiLCJwb3MiLCJyb290IiwiY3VycmVudCIsInNwYWNlcyIsInNlbWljb2xvbiIsInNvdXJjZSIsInN0YXJ0IiwibGluZSIsImNvbHVtbiIsInRva2VuaXplIiwidG9rZW5zIiwibG9vcCIsInRva2VuIiwibGVuZ3RoIiwiZW5kIiwiY29tbWVudCIsImF0cnVsZSIsImVtcHR5UnVsZSIsIm90aGVyIiwiZW5kRmlsZSIsIm5vZGUiLCJpbml0IiwidGV4dCIsInNsaWNlIiwidGVzdCIsInJhd3MiLCJsZWZ0IiwicmlnaHQiLCJtYXRjaCIsInNlbGVjdG9yIiwiYmV0d2VlbiIsInR5cGUiLCJjb2xvbiIsImJyYWNrZXQiLCJicmFja2V0cyIsInB1c2giLCJkZWNsIiwicnVsZSIsInBvcCIsInVuY2xvc2VkQnJhY2tldCIsInVua25vd25Xb3JkIiwic3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kIiwicmF3IiwibGFzdCIsImJlZm9yZSIsInNoaWZ0IiwicHJvcCIsInNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0Iiw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XMucm9vdC5zb3VyY2UgPSB7IGlucHV0LCBzdGFydDogeyBsaW5lOiAxLCBjb2x1bW46IDEgfSB9O1xuICAgIH1cblxuICAgIHRva2VuaXplKCkge1xuICAgICAgICB0aGlzLnRva2VucyA9IHRva2VuaXplcih0aGlzLmlucHV0KTtcbiAgICB9XG5cbiAgICBsb29wKCkge1xuICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgIHdoaWxlICggdGhpcy5wb3MgPCB0aGlzLnRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRoaXMudG9rZW5zW3RoaXMucG9zXTtcblxuICAgICAgICAgICAgc3dpdGNoICggdG9rZW5bMF0gKSB7XG5cbiAgICAgICAgICAgIGNhc2UgJ3NwYWNlJzpcbiAgICAgICAgICAgIGNhc2UgJzsnOlxuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICd9JzpcbiAgICAgICAgICAgICAgICB0aGlzLmVuZCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2NvbW1lbnQnOlxuICAgICAgICAgICAgICAgIHRoaXMuY29tbWVudCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F0LXdvcmQnOlxuICAgICAgICAgICAgICAgIHRoaXMuYXRydWxlKHRva2VuKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICAgICAgdGhpcy5lbXB0eVJ1bGUodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRoaXMub3RoZXIoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5wb3MgKz0gMTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmVuZEZpbGUoKTtcbiAgICB9XG5cbiAgICBjb21tZW50KHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlID0gbmV3IENvbW1lbnQoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogdG9rZW5bNF0sIGNvbHVtbjogdG9rZW5bNV0gfTtcblxuICAgICAgICBsZXQgdGV4dCA9IHRva2VuWzFdLnNsaWNlKDIsIC0yKTtcbiAgICAgICAgaWYgKCAvXlxccyokLy50ZXN0KHRleHQpICkge1xuICAgICAgICAgICAgbm9kZS50ZXh0ICAgICAgID0gJyc7XG4gICAgICAgICAgICBub2RlLnJhd3MubGVmdCAgPSB0ZXh0O1xuICAgICAgICAgICAgbm9kZS5yYXdzLnJpZ2h0ID0gJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgbWF0Y2ggPSB0ZXh0Lm1hdGNoKC9eKFxccyopKFteXSpbXlxcc10pKFxccyopJC8pO1xuICAgICAgICAgICAgbm9kZS50ZXh0ICAgICAgID0gbWF0Y2hbMl07XG4gICAgICAgICAgICBub2RlLnJhd3MubGVmdCAgPSBtYXRjaFsxXTtcbiAgICAgICAgICAgIG5vZGUucmF3cy5yaWdodCA9IG1hdGNoWzNdO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW1wdHlSdWxlKHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlID0gbmV3IFJ1bGUoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgICAgIG5vZGUuc2VsZWN0b3IgPSAnJztcbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gPSAnJztcbiAgICAgICAgdGhpcy5jdXJyZW50ID0gbm9kZTtcbiAgICB9XG5cbiAgICBvdGhlcigpIHtcbiAgICAgICAgbGV0IHRva2VuO1xuICAgICAgICBsZXQgZW5kICAgICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IHR5cGUgICAgID0gbnVsbDtcbiAgICAgICAgbGV0IGNvbG9uICAgID0gZmFsc2U7XG4gICAgICAgIGxldCBicmFja2V0ICA9IG51bGw7XG4gICAgICAgIGxldCBicmFja2V0cyA9IFtdO1xuXG4gICAgICAgIGxldCBzdGFydCA9IHRoaXMucG9zO1xuICAgICAgICB3aGlsZSAoIHRoaXMucG9zIDwgdGhpcy50b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0aGlzLnRva2Vuc1t0aGlzLnBvc107XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICcoJyB8fCB0eXBlID09PSAnWycgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCAhYnJhY2tldCApIGJyYWNrZXQgPSB0b2tlbjtcbiAgICAgICAgICAgICAgICBicmFja2V0cy5wdXNoKHR5cGUgPT09ICcoJyA/ICcpJyA6ICddJyk7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGJyYWNrZXRzLmxlbmd0aCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGUgPT09ICc7JyApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBjb2xvbiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjbCh0aGlzLnRva2Vucy5zbGljZShzdGFydCwgdGhpcy5wb3MgKyAxKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJ3snICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJ1bGUodGhpcy50b2tlbnMuc2xpY2Uoc3RhcnQsIHRoaXMucG9zICsgMSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnfScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucG9zIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIGVuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJzonICkge1xuICAgICAgICAgICAgICAgICAgICBjb2xvbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSBicmFja2V0c1ticmFja2V0cy5sZW5ndGggLSAxXSApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cy5wb3AoKTtcbiAgICAgICAgICAgICAgICBpZiAoIGJyYWNrZXRzLmxlbmd0aCA9PT0gMCApIGJyYWNrZXQgPSBudWxsO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnBvcyArPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICggdGhpcy5wb3MgPT09IHRoaXMudG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMucG9zIC09IDE7XG4gICAgICAgICAgICBlbmQgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBicmFja2V0cy5sZW5ndGggPiAwICkgdGhpcy51bmNsb3NlZEJyYWNrZXQoYnJhY2tldCk7XG5cbiAgICAgICAgaWYgKCBlbmQgJiYgY29sb24gKSB7XG4gICAgICAgICAgICB3aGlsZSAoIHRoaXMucG9zID4gc3RhcnQgKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0aGlzLnRva2Vuc1t0aGlzLnBvc11bMF07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gPSB7IGxpbmU6IGxhc3RbNF0sIGNvbHVtbjogbGFzdFs1XSB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiBsYXN0WzJdLCBjb2x1bW46IGxhc3RbM10gfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlICggdG9rZW5zWzBdWzBdICE9PSAnd29yZCcgKSB7XG4gICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICB9XG4gICAgICAgIG5vZGUuc291cmNlLnN0YXJ0ID0geyBsaW5lOiB0b2tlbnNbMF1bMl0sIGNvbHVtbjogdG9rZW5zWzBdWzNdIH07XG5cbiAgICAgICAgbm9kZS5wcm9wID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIGxldCB0eXBlID0gdG9rZW5zWzBdWzBdO1xuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnOicgfHwgdHlwZSA9PT0gJ3NwYWNlJyB8fCB0eXBlID09PSAnY29tbWVudCcgKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnByb3AgKz0gdG9rZW5zLnNoaWZ0KClbMV07XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuXG4gICAgICAgIGxldCB0b2tlbjtcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnMuc2hpZnQoKTtcblxuICAgICAgICAgICAgaWYgKCB0b2tlblswXSA9PT0gJzonICkge1xuICAgICAgICAgICAgICAgIG5vZGUucmF3cy5iZXR3ZWVuICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggbm9kZS5wcm9wWzBdID09PSAnXycgfHwgbm9kZS5wcm9wWzBdID09PSAnKicgKSB7XG4gICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlICs9IG5vZGUucHJvcFswXTtcbiAgICAgICAgICAgIG5vZGUucHJvcCA9IG5vZGUucHJvcC5zbGljZSgxKTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2Vucyk7XG4gICAgICAgIHRoaXMucHJlY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKTtcblxuICAgICAgICBmb3IgKCBsZXQgaSA9IHRva2Vucy5sZW5ndGggLSAxOyBpID4gMDsgaS0tICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICBpZiAoIHRva2VuWzFdID09PSAnIWltcG9ydGFudCcgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnN0cmluZ0Zyb20odG9rZW5zLCBpKTtcbiAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAoIHN0cmluZyAhPT0gJyAhaW1wb3J0YW50JyApIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0gPT09ICdpbXBvcnRhbnQnKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhY2hlID0gdG9rZW5zLnNsaWNlKDApO1xuICAgICAgICAgICAgICAgIGxldCBzdHIgICA9ICcnO1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBqID0gaTsgaiA+IDA7IGotLSApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBjYWNoZVtqXVswXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBzdHIudHJpbSgpLmluZGV4T2YoJyEnKSA9PT0gMCAmJiB0eXBlICE9PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RyID0gY2FjaGUucG9wKClbMV0gKyBzdHI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICggc3RyLnRyaW0oKS5pbmRleE9mKCchJykgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHN0cjtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5zID0gY2FjaGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdICE9PSAnc3BhY2UnICYmIHRva2VuWzBdICE9PSAnY29tbWVudCcgKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnJhdyhub2RlLCAndmFsdWUnLCB0b2tlbnMpO1xuXG4gICAgICAgIGlmICggbm9kZS52YWx1ZS5pbmRleE9mKCc6JykgIT09IC0xICkgdGhpcy5jaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpO1xuICAgIH1cblxuICAgIGF0cnVsZSh0b2tlbikge1xuICAgICAgICBsZXQgbm9kZSAgPSBuZXcgQXRSdWxlKCk7XG4gICAgICAgIG5vZGUubmFtZSA9IHRva2VuWzFdLnNsaWNlKDEpO1xuICAgICAgICBpZiAoIG5vZGUubmFtZSA9PT0gJycgKSB7XG4gICAgICAgICAgICB0aGlzLnVubmFtZWRBdHJ1bGUobm9kZSwgdG9rZW4pO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuaW5pdChub2RlLCB0b2tlblsyXSwgdG9rZW5bM10pO1xuXG4gICAgICAgIGxldCBsYXN0ICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IG9wZW4gICA9IGZhbHNlO1xuICAgICAgICBsZXQgcGFyYW1zID0gW107XG5cbiAgICAgICAgdGhpcy5wb3MgKz0gMTtcbiAgICAgICAgd2hpbGUgKCB0aGlzLnBvcyA8IHRoaXMudG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbnNbdGhpcy5wb3NdO1xuXG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdID09PSAnOycgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9O1xuICAgICAgICAgICAgICAgIHRoaXMuc2VtaWNvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHRva2VuWzBdID09PSAneycgKSB7XG4gICAgICAgICAgICAgICAgb3BlbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0b2tlblswXSA9PT0gJ30nKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5lbmQodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMucG9zICs9IDE7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB0aGlzLnBvcyA9PT0gdGhpcy50b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbGFzdCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHBhcmFtcyk7XG4gICAgICAgIGlmICggcGFyYW1zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIG5vZGUucmF3cy5hZnRlck5hbWUgPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHBhcmFtcyk7XG4gICAgICAgICAgICB0aGlzLnJhdyhub2RlLCAncGFyYW1zJywgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmICggbGFzdCApIHtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IHBhcmFtc1twYXJhbXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kICAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zcGFjZXMgICAgICAgPSBub2RlLnJhd3MuYmV0d2VlbjtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmFmdGVyTmFtZSA9ICcnO1xuICAgICAgICAgICAgbm9kZS5wYXJhbXMgICAgICAgICA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBvcGVuICkge1xuICAgICAgICAgICAgbm9kZS5ub2RlcyAgID0gW107XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW5kKHRva2VuKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50Lm5vZGVzICYmIHRoaXMuY3VycmVudC5ub2Rlcy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5zZW1pY29sb24gPSB0aGlzLnNlbWljb2xvbjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuY3VycmVudC5yYXdzLmFmdGVyID0gKHRoaXMuY3VycmVudC5yYXdzLmFmdGVyIHx8ICcnKSArIHRoaXMuc3BhY2VzO1xuICAgICAgICB0aGlzLnNwYWNlcyA9ICcnO1xuXG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9O1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5jdXJyZW50LnBhcmVudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudW5leHBlY3RlZENsb3NlKHRva2VuKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGVuZEZpbGUoKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHRoaXMudW5jbG9zZWRCbG9jaygpO1xuICAgICAgICBpZiAoIHRoaXMuY3VycmVudC5ub2RlcyAmJiB0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50LnJhd3Muc2VtaWNvbG9uID0gdGhpcy5zZW1pY29sb247XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgPSAodGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgfHwgJycpICsgdGhpcy5zcGFjZXM7XG4gICAgfVxuXG4gICAgLy8gSGVscGVyc1xuXG4gICAgaW5pdChub2RlLCBsaW5lLCBjb2x1bW4pIHtcbiAgICAgICAgdGhpcy5jdX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gICAgICAgbm9kZVtwcm9wXSA9IHZhbHVlO1xuICAgIH1cblxuICAgIHNwYWNlc0FuZENvbW1lbnRzRnJvbUVuZCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IGxhc3RUb2tlblR5cGU7XG4gICAgICAgIGxldCBzcGFjZXMgPSAnJztcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbGFzdFRva2VuVHlwZSA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV1bMF07XG4gICAgICAgICAgICBpZiAoIGxhc3RUb2tlblR5cGUgIT09ICdzcGFjZScgJiZcbiAgICAgICAgICAgICAgICBsYXN0VG9rZW5UeXBlICE9PSAnY29tbWVudCcgKSBicmVhaztcbiAgICAgICAgICAgIHNwYWNlcyA9IHRva2Vucy5wb3AoKVsxXSArIHNwYWNlcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BhY2VzO1xuICAgIH1cblxuICAgIHNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2Vucykge1xuICAgICAgICBsZXQgbmV4dDtcbiAgICAgICAgbGV0IHNwYWNlcyA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBuZXh0ID0gdG9rZW5zWzBdWzBdO1xuICAgICAgICAgICAgaWYgKCBuZXh0ICE9PSAnc3BhY2UnICYmIG5leHQgIT09ICdjb21tZW50JyApIGJyZWFrO1xuICAgICAgICAgICAgc3BhY2VzICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzcGFjZXM7XG4gICAgfVxuXG4gICAgc3BhY2VzRnJvbUVuZCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IGxhc3RUb2tlblR5cGU7XG4gICAgICAgIGxldCBzcGFjZXMgPSAnJztcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbGFzdFRva2VuVHlwZSA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV1bMF07XG4gICAgICAgICAgICBpZiAoIGxhc3RUb2tlblR5cGUgIT09ICdzcGFjZScgKSBicmVhaztcbiAgICAgICAgICAgIHNwYWNlcyA9IHRva2Vucy5wb3AoKVsxXSArIHNwYWNlcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BhY2VzO1xuICAgIH1cblxuICAgIHN0cmluZ0Zyb20odG9rZW5zLCBmcm9tKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSAnJztcbiAgICAgICAgZm9yICggbGV0IGkgPSBmcm9tOyBpIDwgdG9rZW5zLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgcmVzdWx0ICs9IHRva2Vuc1tpXVsxXTtcbiAgICAgICAgfVxuICAgICAgICB0b2tlbnMuc3BsaWNlKGZyb20sIHRva2Vucy5sZW5ndGggLSBmcm9tKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb2xvbih0b2tlbnMpIHtcbiAgICAgICAgbGV0IGJyYWNrZXRzID0gMDtcbiAgICAgICAgbGV0IHRva2VuLCB0eXBlLCBwcmV2O1xuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCB0b2tlbnMubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRva2Vuc1tpXTtcbiAgICAgICAgICAgIHR5cGUgID0gdG9rZW5bMF07XG5cbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJygnICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzICs9IDE7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnKScgKSB7XG4gICAgICAgICAgICAgICAgYnJhY2tldHMgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGJyYWNrZXRzID09PSAwICYmIHR5cGUgPT09ICc6JyApIHtcbiAgICAgICAgICAgICAgICBpZiAoICFwcmV2ICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvdWJsZUNvbG9uKHRva2VuKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBwcmV2WzBdID09PSAnd29yZCcgJiYgcHJldlsxXSA9PT0gJ3Byb2dpZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcHJldiA9IHRva2VuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICAvLyBFcnJvcnNcblxuICAgIHVuY2xvc2VkQnJhY2tldChicmFja2V0KSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ1VuY2xvc2VkIGJyYWNrZXQnLCBicmFja2V0WzJdLCBicmFja2V0WzNdKTtcbiAgICB9XG5cbiAgICB1bmtub3duV29yZChzdGFydCkge1xuICAgICAgICBsZXQgdG9rZW4gPSB0aGlzLnRva2Vuc1tzdGFydF07XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ1Vua25vd24gd29yZCcsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgfVxuXG4gICAgdW5leHBlY3RlZENsb3NlKHRva2VuKSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ1VuZXhwZWN0ZWQgfScsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgfVxuXG4gICAgdW5jbG9zZWRCbG9jaygpIHtcbiAgICAgICAgbGV0IHBvcyA9IHRoaXMuY3VycmVudC5zb3VyY2Uuc3RhcnQ7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ1VuY2xvc2VkIGJsb2NrJywgcG9zLmxpbmUsIHBvcy5jb2x1bW4pO1xuICAgIH1cblxuICAgIGRvdWJsZUNvbG9uKHRva2VuKSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ0RvdWJsZSBjb2xvbicsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgfVxuXG4gICAgdW5uYW1lZEF0cnVsZShub2RlLCB0b2tlbikge1xuICAgICAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdBdC1ydWxlIHdpdGhvdXQgbmFtZScsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgfVxuXG4gICAgcHJlY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKSB7XG4gICAgICAgIC8vIEhvb2sgZm9yIFNhZmUgUGFyc2VyXG4gICAgICAgIHRva2VucztcbiAgICB9XG5cbiAgICBjaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpIHtcbiAgICAgICAgbGV0IGNvbG9uID0gdGhpcy5jb2xvbih0b2tlbnMpO1xuICAgICAgICBpZiAoIGNvbG9uID09PSBmYWxzZSApIHJldHVybjtcblxuICAgICAgICBsZXQgZm91bmRlZCA9IDA7XG4gICAgICAgIGxldCB0b2tlbjtcbiAgICAgICAgZm9yICggbGV0IGogPSBjb2xvbiAtIDE7IGogPj0gMDsgai0tICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbal07XG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdICE9PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgIGZvdW5kZWQgKz0gMTtcbiAgICAgICAgICAgICAgICBpZiAoIGZvdW5kZWQgPT09IDIgKSBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdNaXNzZWQgc2VtaWNvbG9uJywgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICB9XG5cbn1cbiJdfQ==
  13218. /***/ }),
  13219. /* 96 */
  13220. /***/ (function(module, exports, __webpack_require__) {
  13221. "use strict";
  13222. exports.__esModule = true;
  13223. exports.default = stringify;
  13224. var _stringifier = __webpack_require__(40);
  13225. var _stringifier2 = _interopRequireDefault(_stringifier);
  13226. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13227. function stringify(node, builder) {
  13228. var str = new _stringifier2.default(builder);
  13229. str.stringify(node);
  13230. }
  13231. module.exports = exports['default'];
  13232. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmeS5lczYiXSwibmFtZXMiOlsic3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLFM7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxJQUFuQixFQUF5QkMsT0FBekIsRUFBa0M7QUFDN0MsUUFBSUMsTUFBTSwwQkFBZ0JELE9BQWhCLENBQVY7QUFDQUMsUUFBSUgsU0FBSixDQUFjQyxJQUFkO0FBQ0giLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFN0cmluZ2lmaWVyIGZyb20gJy4vc3RyaW5naWZpZXInO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU3RyaW5naWZpZXIoYnVpbGRlcik7XG4gICAgc3RyLnN0cmluZ2lmeShub2RlKTtcbn1cbiJdfQ==
  13233. /***/ }),
  13234. /* 97 */
  13235. /***/ (function(module, exports, __webpack_require__) {
  13236. "use strict";
  13237. exports.__esModule = true;
  13238. exports.default = tokenize;
  13239. var SINGLE_QUOTE = 39;
  13240. var DOUBLE_QUOTE = 34;
  13241. var BACKSLASH = 92;
  13242. var SLASH = 47;
  13243. var NEWLINE = 10;
  13244. var SPACE = 32;
  13245. var FEED = 12;
  13246. var TAB = 9;
  13247. var CR = 13;
  13248. var OPEN_SQUARE = 91;
  13249. var CLOSE_SQUARE = 93;
  13250. var OPEN_PARENTHESES = 40;
  13251. var CLOSE_PARENTHESES = 41;
  13252. var OPEN_CURLY = 123;
  13253. var CLOSE_CURLY = 125;
  13254. var SEMICOLON = 59;
  13255. var ASTERISK = 42;
  13256. var COLON = 58;
  13257. var AT = 64;
  13258. var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  13259. var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
  13260. var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
  13261. function tokenize(input) {
  13262. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13263. var tokens = [];
  13264. var css = input.css.valueOf();
  13265. var ignore = options.ignoreErrors;
  13266. var code = void 0,
  13267. next = void 0,
  13268. quote = void 0,
  13269. lines = void 0,
  13270. last = void 0,
  13271. content = void 0,
  13272. escape = void 0,
  13273. nextLine = void 0,
  13274. nextOffset = void 0,
  13275. escaped = void 0,
  13276. escapePos = void 0,
  13277. prev = void 0,
  13278. n = void 0;
  13279. var length = css.length;
  13280. var offset = -1;
  13281. var line = 1;
  13282. var pos = 0;
  13283. function unclosed(what) {
  13284. throw input.error('Unclosed ' + what, line, pos - offset);
  13285. }
  13286. while (pos < length) {
  13287. code = css.charCodeAt(pos);
  13288. if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
  13289. offset = pos;
  13290. line += 1;
  13291. }
  13292. switch (code) {
  13293. case NEWLINE:
  13294. case SPACE:
  13295. case TAB:
  13296. case CR:
  13297. case FEED:
  13298. next = pos;
  13299. do {
  13300. next += 1;
  13301. code = css.charCodeAt(next);
  13302. if (code === NEWLINE) {
  13303. offset = next;
  13304. line += 1;
  13305. }
  13306. } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
  13307. tokens.push(['space', css.slice(pos, next)]);
  13308. pos = next - 1;
  13309. break;
  13310. case OPEN_SQUARE:
  13311. tokens.push(['[', '[', line, pos - offset]);
  13312. break;
  13313. case CLOSE_SQUARE:
  13314. tokens.push([']', ']', line, pos - offset]);
  13315. break;
  13316. case OPEN_CURLY:
  13317. tokens.push(['{', '{', line, pos - offset]);
  13318. break;
  13319. case CLOSE_CURLY:
  13320. tokens.push(['}', '}', line, pos - offset]);
  13321. break;
  13322. case COLON:
  13323. tokens.push([':', ':', line, pos - offset]);
  13324. break;
  13325. case SEMICOLON:
  13326. tokens.push([';', ';', line, pos - offset]);
  13327. break;
  13328. case OPEN_PARENTHESES:
  13329. prev = tokens.length ? tokens[tokens.length - 1][1] : '';
  13330. n = css.charCodeAt(pos + 1);
  13331. if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
  13332. next = pos;
  13333. do {
  13334. escaped = false;
  13335. next = css.indexOf(')', next + 1);
  13336. if (next === -1) {
  13337. if (ignore) {
  13338. next = pos;
  13339. break;
  13340. } else {
  13341. unclosed('bracket');
  13342. }
  13343. }
  13344. escapePos = next;
  13345. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  13346. escapePos -= 1;
  13347. escaped = !escaped;
  13348. }
  13349. } while (escaped);
  13350. tokens.push(['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  13351. pos = next;
  13352. } else {
  13353. next = css.indexOf(')', pos + 1);
  13354. content = css.slice(pos, next + 1);
  13355. if (next === -1 || RE_BAD_BRACKET.test(content)) {
  13356. tokens.push(['(', '(', line, pos - offset]);
  13357. } else {
  13358. tokens.push(['brackets', content, line, pos - offset, line, next - offset]);
  13359. pos = next;
  13360. }
  13361. }
  13362. break;
  13363. case CLOSE_PARENTHESES:
  13364. tokens.push([')', ')', line, pos - offset]);
  13365. break;
  13366. case SINGLE_QUOTE:
  13367. case DOUBLE_QUOTE:
  13368. quote = code === SINGLE_QUOTE ? '\'' : '"';
  13369. next = pos;
  13370. do {
  13371. escaped = false;
  13372. next = css.indexOf(quote, next + 1);
  13373. if (next === -1) {
  13374. if (ignore) {
  13375. next = pos + 1;
  13376. break;
  13377. } else {
  13378. unclosed('string');
  13379. }
  13380. }
  13381. escapePos = next;
  13382. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  13383. escapePos -= 1;
  13384. escaped = !escaped;
  13385. }
  13386. } while (escaped);
  13387. content = css.slice(pos, next + 1);
  13388. lines = content.split('\n');
  13389. last = lines.length - 1;
  13390. if (last > 0) {
  13391. nextLine = line + last;
  13392. nextOffset = next - lines[last].length;
  13393. } else {
  13394. nextLine = line;
  13395. nextOffset = offset;
  13396. }
  13397. tokens.push(['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset]);
  13398. offset = nextOffset;
  13399. line = nextLine;
  13400. pos = next;
  13401. break;
  13402. case AT:
  13403. RE_AT_END.lastIndex = pos + 1;
  13404. RE_AT_END.test(css);
  13405. if (RE_AT_END.lastIndex === 0) {
  13406. next = css.length - 1;
  13407. } else {
  13408. next = RE_AT_END.lastIndex - 2;
  13409. }
  13410. tokens.push(['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  13411. pos = next;
  13412. break;
  13413. case BACKSLASH:
  13414. next = pos;
  13415. escape = true;
  13416. while (css.charCodeAt(next + 1) === BACKSLASH) {
  13417. next += 1;
  13418. escape = !escape;
  13419. }
  13420. code = css.charCodeAt(next + 1);
  13421. if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
  13422. next += 1;
  13423. }
  13424. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  13425. pos = next;
  13426. break;
  13427. default:
  13428. if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
  13429. next = css.indexOf('*/', pos + 2) + 1;
  13430. if (next === 0) {
  13431. if (ignore) {
  13432. next = css.length;
  13433. } else {
  13434. unclosed('comment');
  13435. }
  13436. }
  13437. content = css.slice(pos, next + 1);
  13438. lines = content.split('\n');
  13439. last = lines.length - 1;
  13440. if (last > 0) {
  13441. nextLine = line + last;
  13442. nextOffset = next - lines[last].length;
  13443. } else {
  13444. nextLine = line;
  13445. nextOffset = offset;
  13446. }
  13447. tokens.push(['comment', content, line, pos - offset, nextLine, next - nextOffset]);
  13448. offset = nextOffset;
  13449. line = nextLine;
  13450. pos = next;
  13451. } else {
  13452. RE_WORD_END.lastIndex = pos + 1;
  13453. RE_WORD_END.test(css);
  13454. if (RE_WORD_END.lastIndex === 0) {
  13455. next = css.length - 1;
  13456. } else {
  13457. next = RE_WORD_END.lastIndex - 2;
  13458. }
  13459. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  13460. pos = next;
  13461. }
  13462. break;
  13463. }
  13464. pos++;
  13465. }
  13466. return tokens;
  13467. }
  13468. module.exports = exports['default'];
  13469. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRva2VuaXplLmVzNiJdLCJuYW1lcyI6WyJ0b2tlbml6ZSIsIlNJTkdMRV9RVU9URSIsIkRPVUJMRV9RVU9URSIsIkJBQ0tTTEFTSCIsIlNMQVNIIiwiTkVXTElORSIsIlNQQUNFIiwiRkVFRCIsIlRBQiIsIkNSIiwiT1BFTl9TUVVBUkUiLCJDTE9TRV9TUVVBUkUiLCJPUEVOX1BBUkVOVEhFU0VTIiwiQ0xPU0VfUEFSRU5USEVTRVMiLCJPUEVOX0NVUkxZIiwiQ0xPU0VfQ1VSTFkiLCJTRU1JQ09MT04iLCJBU1RFUklTSyIsIkNPTE9OIiwiQVQiLCJSRV9BVF9FTkQiLCJSRV9XT1JEX0VORCIsIlJFX0JBRF9CUkFDS0VUIiwiaW5wdXQiLCJvcHRpb25zIiwidG9rZW5zIiwiY3NzIiwidmFsdWVPZiIsImlnbm9yZSIsImlnbm9yZU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cblxuICAgIHdoaWxlICggcG9zIDwgbGVuZ3RoICkge1xuICAgICAgICBjb2RlID0gY3NzLmNoYXJDb2RlQXQocG9zKTtcblxuICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgfHwgY29kZSA9PT0gRkVFRCB8fFxuICAgICAgICAgICAgIGNvZGUgPT09IENSICYmIGNzcy5jaGFyQ29kZUF0KHBvcyArIDEpICE9PSBORVdMSU5FICkge1xuICAgICAgICAgICAgb2Zmc2V0ID0gcG9zO1xuICAgICAgICAgICAgbGluZSAgKz0gMTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAoIGNvZGUgKSB7XG4gICAgICAgIGNhc2UgTkVXTElORTpcbiAgICAgICAgY2FzZSBTUEFDRTpcbiAgICAgICAgY2FzZSBUQUI6XG4gICAgICAgIGNhc2UgQ1I6XG4gICAgICAgIGNhc2UgRkVFRDpcbiAgICAgICAgICAgIG5leHQgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgKSB7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxpbmUgICs9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3aGlsZSAoIGNvZGUgPT09IFNQQUNFICAgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBORVdMSU5FIHx8XG4gICAgICAgICAgICAgICAgICAgICAgY29kZSA9PT0gVEFCICAgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IENSICAgICAgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBGRUVEICk7XG5cbiAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnc3BhY2UnLCBjc3Muc2xpY2UocG9zLCBuZXh0KV0pO1xuICAgICAgICAgICAgcG9zID0gbmV4dCAtIDE7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIE9QRU5fU1FVQVJFOlxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWydbJywgJ1snLCBsaW5lLCBwb3MgLSBvZmZzZXRdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfU1FVQVJFOlxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWyddJywgJ10nLCBsaW5lLCBwb3MgLSBvZmZzZXRdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgT1BFTl9DVVJMWTpcbiAgICAgICAgICAgIHRva2Vucy5wdXNoKFsneycsICd7JywgbGluZSwgcG9zIC0gb2Zmc2V0XSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENMT1NFX0NVUkxZOlxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWyd9JywgJ30nLCBsaW5lLCBwb3MgLSBvZmZzZXRdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ09MT046XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJzonLCAnOicsIGxpbmUsIHBvcyAtIG9mZnNldF0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBTRU1JQ09MT046XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJzsnLCAnOycsIGxpbmUsIHBvcyAtIG9mZnNldF0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1BBUkVOVEhFU0VTOlxuICAgICAgICAgICAgcHJldiA9IHRva2Vucy5sZW5ndGggPyB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzFdIDogJyc7XG4gICAgICAgICAgICBuICAgID0gY3NzLmNoYXJDb2RlQXQocG9zICsgMSk7XG4gICAgICAgICAgICBpZiAoIHByZXYgPT09ICd1cmwnICYmIG4gIT09IFNJTkdMRV9RVU9URSAmJiBuICE9PSBET1VCTEVfUVVPVEUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiAhPT0gU1BBQ0UgJiYgbiAhPT0gTkVXTElORSAmJiBuICE9PSBUQUIgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiAhPT0gRkVFRCAmJiBuICE9PSBDUiApIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBuZXh0ICAgID0gY3NzLmluZGV4T2YoJyknLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmNsb3NlZCgnYnJhY2tldCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQoZXNjYXBlUG9zIC0gMSkgPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyAtPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoIGVzY2FwZWQgKTtcblxuICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnYnJhY2tldHMnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBuZXh0O1xuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHQgICAgPSBjc3MuaW5kZXhPZignKScsIHBvcyArIDEpO1xuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIG5leHQgPT09IC0xIHx8IFJFX0JBRF9CUkFDS0VULnRlc3QoY29udGVudCkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnKCcsICcoJywgbGluZSwgcG9zIC0gb2Zmc2V0XSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5zLnB1c2goWydicmFja2V0cycsIGNvbnRlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfUEFSRU5USEVTRVM6XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJyknLCAnKScsIGxpbmUsIHBvcyAtIG9mZnNldF0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBTSU5HTEVfUVVPVEU6XG4gICAgICAgIGNhc2UgRE9VQkxFX1FVT1RFOlxuICAgICAgICAgICAgcXVvdGUgPSBjb2RlID09PSBTSU5HTEVfUVVPVEUgPyAnXFwnJyA6ICdcIic7XG4gICAgICAgICAgICBuZXh0ICA9IHBvcztcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBlc2NhcGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbmV4dCAgICA9IGNzcy5pbmRleE9mKHF1b3RlLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBpZ25vcmUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ3N0cmluZycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgd2hpbGUgKCBjc3MuY2hhckNvZGVBdChlc2NhcGVQb3MgLSAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGVQb3MgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gd2hpbGUgKCBlc2NhcGVkICk7XG5cbiAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICBsaW5lcyAgID0gY29udGVudC5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICBsYXN0ICAgID0gbGluZXMubGVuZ3RoIC0gMTtcblxuICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZSArIGxhc3Q7XG4gICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG5leHQgLSBsaW5lc1tsYXN0XS5sZW5ndGg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBvZmZzZXQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnc3RyaW5nJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICBdKTtcblxuICAgICAgICAgICAgb2Zmc2V0ID0gbmV4dE9mZnNldDtcbiAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQVQ6XG4gICAgICAgICAgICBSRV9BVF9FTkQubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgIFJFX0FUX0VORC50ZXN0KGNzcyk7XG4gICAgICAgICAgICBpZiAoIFJFX0FUX0VORC5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gUkVfQVRfRU5ELmxhc3RJbmRleCAtIDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJ2F0LXdvcmQnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICBsaW5lLCBuZXh0IC0gb2Zmc2V0XG4gICAgICAgICAgICBdKTtcbiAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIEJBQ0tTTEFTSDpcbiAgICAgICAgICAgIG5leHQgICA9IHBvcztcbiAgICAgICAgICAgIGVzY2FwZSA9IHRydWU7XG4gICAgICAgICAgICB3aGlsZSAoIGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgIG5leHQgICs9IDE7XG4gICAgICAgICAgICAgICAgZXNjYXBlID0gIWVzY2FwZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0ICsgMSk7XG4gICAgICAgICAgICBpZiAoIGVzY2FwZSAmJiAoY29kZSAhPT0gU0xBU0ggICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IFNQQUNFICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBORVdMSU5FICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gVEFCICAgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IENSICAgICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBGRUVEICkgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWyd3b3JkJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGlmICggY29kZSA9PT0gU0xBU0ggJiYgY3NzLmNoYXJDb2RlQXQocG9zICsgMSkgPT09IEFTVEVSSVNLICkge1xuICAgICAgICAgICAgICAgIG5leHQgPSBjc3MuaW5kZXhPZignKi8nLCBwb3MgKyAyKSArIDE7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAwICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ2NvbW1lbnQnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgICAgIGxhc3QgICAgPSBsaW5lcy5sZW5ndGggLSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbmV4dCAtIGxpbmVzW2xhc3RdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0b2tlbnMucHVzaChbJ2NvbW1lbnQnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXSk7XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBuZXh0T2Zmc2V0O1xuICAgICAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgICAgIHBvcyAgICA9IG5leHQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgUkVfV09SRF9FTkQubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICBSRV9XT1JEX0VORC50ZXN0KGNzcyk7XG4gICAgICAgICAgICAgICAgaWYgKCBSRV9XT1JEX0VORC5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0ID0gUkVfV09SRF9FTkQubGFzdEluZGV4IC0gMjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0b2tlbnMucHVzaChbJ3dvcmQnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHBvcysrO1xuICAgIH1cblxuICAgIHJldHVybiB0b2tlbnM7XG59XG4iXX0=
  13470. /***/ }),
  13471. /* 98 */
  13472. /***/ (function(module, exports, __webpack_require__) {
  13473. "use strict";
  13474. /* WEBPACK VAR INJECTION */(function(process) {
  13475. var escapeStringRegexp = __webpack_require__(113);
  13476. var ansiStyles = __webpack_require__(200);
  13477. var stripAnsi = __webpack_require__(202);
  13478. var hasAnsi = __webpack_require__(118);
  13479. var supportsColor = __webpack_require__(201);
  13480. var defineProps = Object.defineProperties;
  13481. var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
  13482. function Chalk(options) {
  13483. // detect mode if not set manually
  13484. this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
  13485. }
  13486. // use bright blue on Windows as the normal blue color is illegible
  13487. if (isSimpleWindowsTerm) {
  13488. ansiStyles.blue.open = '\u001b[94m';
  13489. }
  13490. var styles = (function () {
  13491. var ret = {};
  13492. Object.keys(ansiStyles).forEach(function (key) {
  13493. ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
  13494. ret[key] = {
  13495. get: function () {
  13496. return build.call(this, this._styles.concat(key));
  13497. }
  13498. };
  13499. });
  13500. return ret;
  13501. })();
  13502. var proto = defineProps(function chalk() {}, styles);
  13503. function build(_styles) {
  13504. var builder = function () {
  13505. return applyStyle.apply(builder, arguments);
  13506. };
  13507. builder._styles = _styles;
  13508. builder.enabled = this.enabled;
  13509. // __proto__ is used because we must return a function, but there is
  13510. // no way to create a function with a different prototype.
  13511. /* eslint-disable no-proto */
  13512. builder.__proto__ = proto;
  13513. return builder;
  13514. }
  13515. function applyStyle() {
  13516. // support varags, but simply cast to string in case there's only one arg
  13517. var args = arguments;
  13518. var argsLen = args.length;
  13519. var str = argsLen !== 0 && String(arguments[0]);
  13520. if (argsLen > 1) {
  13521. // don't slice `arguments`, it prevents v8 optimizations
  13522. for (var a = 1; a < argsLen; a++) {
  13523. str += ' ' + args[a];
  13524. }
  13525. }
  13526. if (!this.enabled || !str) {
  13527. return str;
  13528. }
  13529. var nestedStyles = this._styles;
  13530. var i = nestedStyles.length;
  13531. // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
  13532. // see https://github.com/chalk/chalk/issues/58
  13533. // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
  13534. var originalDim = ansiStyles.dim.open;
  13535. if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
  13536. ansiStyles.dim.open = '';
  13537. }
  13538. while (i--) {
  13539. var code = ansiStyles[nestedStyles[i]];
  13540. // Replace any instances already present with a re-opening code
  13541. // otherwise only the part of the string until said closing code
  13542. // will be colored, and the rest will simply be 'plain'.
  13543. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  13544. }
  13545. // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
  13546. ansiStyles.dim.open = originalDim;
  13547. return str;
  13548. }
  13549. function init() {
  13550. var ret = {};
  13551. Object.keys(styles).forEach(function (name) {
  13552. ret[name] = {
  13553. get: function () {
  13554. return build.call(this, [name]);
  13555. }
  13556. };
  13557. });
  13558. return ret;
  13559. }
  13560. defineProps(Chalk.prototype, init());
  13561. module.exports = new Chalk();
  13562. module.exports.styles = ansiStyles;
  13563. module.exports.hasColor = hasAnsi;
  13564. module.exports.stripColor = stripAnsi;
  13565. module.exports.supportsColor = supportsColor;
  13566. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(23)))
  13567. /***/ }),
  13568. /* 99 */
  13569. /***/ (function(module, exports, __webpack_require__) {
  13570. /* -*- Mode: js; js-indent-level: 2; -*- */
  13571. /*
  13572. * Copyright 2011 Mozilla Foundation and contributors
  13573. * Licensed under the New BSD license. See LICENSE or:
  13574. * http://opensource.org/licenses/BSD-3-Clause
  13575. */
  13576. var util = __webpack_require__(17);
  13577. var has = Object.prototype.hasOwnProperty;
  13578. /**
  13579. * A data structure which is a combination of an array and a set. Adding a new
  13580. * member is O(1), testing for membership is O(1), and finding the index of an
  13581. * element is O(1). Removing elements from the set is not supported. Only
  13582. * strings are supported for membership.
  13583. */
  13584. function ArraySet() {
  13585. this._array = [];
  13586. this._set = Object.create(null);
  13587. }
  13588. /**
  13589. * Static method for creating ArraySet instances from an existing array.
  13590. */
  13591. ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  13592. var set = new ArraySet();
  13593. for (var i = 0, len = aArray.length; i < len; i++) {
  13594. set.add(aArray[i], aAllowDuplicates);
  13595. }
  13596. return set;
  13597. };
  13598. /**
  13599. * Return how many unique items are in this ArraySet. If duplicates have been
  13600. * added, than those do not count towards the size.
  13601. *
  13602. * @returns Number
  13603. */
  13604. ArraySet.prototype.size = function ArraySet_size() {
  13605. return Object.getOwnPropertyNames(this._set).length;
  13606. };
  13607. /**
  13608. * Add the given string to this set.
  13609. *
  13610. * @param String aStr
  13611. */
  13612. ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  13613. var sStr = util.toSetString(aStr);
  13614. var isDuplicate = has.call(this._set, sStr);
  13615. var idx = this._array.length;
  13616. if (!isDuplicate || aAllowDuplicates) {
  13617. this._array.push(aStr);
  13618. }
  13619. if (!isDuplicate) {
  13620. this._set[sStr] = idx;
  13621. }
  13622. };
  13623. /**
  13624. * Is the given string a member of this set?
  13625. *
  13626. * @param String aStr
  13627. */
  13628. ArraySet.prototype.has = function ArraySet_has(aStr) {
  13629. var sStr = util.toSetString(aStr);
  13630. return has.call(this._set, sStr);
  13631. };
  13632. /**
  13633. * What is the index of the given string in the array?
  13634. *
  13635. * @param String aStr
  13636. */
  13637. ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  13638. var sStr = util.toSetString(aStr);
  13639. if (has.call(this._set, sStr)) {
  13640. return this._set[sStr];
  13641. }
  13642. throw new Error('"' + aStr + '" is not in the set.');
  13643. };
  13644. /**
  13645. * What is the element at the given index?
  13646. *
  13647. * @param Number aIdx
  13648. */
  13649. ArraySet.prototype.at = function ArraySet_at(aIdx) {
  13650. if (aIdx >= 0 && aIdx < this._array.length) {
  13651. return this._array[aIdx];
  13652. }
  13653. throw new Error('No element indexed by ' + aIdx);
  13654. };
  13655. /**
  13656. * Returns the array representation of this set (which has the proper indices
  13657. * indicated by indexOf). Note that this is a copy of the internal array used
  13658. * for storing the members so that no one can mess with internal state.
  13659. */
  13660. ArraySet.prototype.toArray = function ArraySet_toArray() {
  13661. return this._array.slice();
  13662. };
  13663. exports.ArraySet = ArraySet;
  13664. /***/ }),
  13665. /* 100 */
  13666. /***/ (function(module, exports, __webpack_require__) {
  13667. /* -*- Mode: js; js-indent-level: 2; -*- */
  13668. /*
  13669. * Copyright 2011 Mozilla Foundation and contributors
  13670. * Licensed under the New BSD license. See LICENSE or:
  13671. * http://opensource.org/licenses/BSD-3-Clause
  13672. *
  13673. * Based on the Base 64 VLQ implementation in Closure Compiler:
  13674. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  13675. *
  13676. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  13677. * Redistribution and use in source and binary forms, with or without
  13678. * modification, are permitted provided that the following conditions are
  13679. * met:
  13680. *
  13681. * * Redistributions of source code must retain the above copyright
  13682. * notice, this list of conditions and the following disclaimer.
  13683. * * Redistributions in binary form must reproduce the above
  13684. * copyright notice, this list of conditions and the following
  13685. * disclaimer in the documentation and/or other materials provided
  13686. * with the distribution.
  13687. * * Neither the name of Google Inc. nor the names of its
  13688. * contributors may be used to endorse or promote products derived
  13689. * from this software without specific prior written permission.
  13690. *
  13691. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  13692. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  13693. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  13694. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  13695. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  13696. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  13697. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  13698. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13699. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  13700. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13701. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  13702. */
  13703. var base64 = __webpack_require__(203);
  13704. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  13705. // length quantities we use in the source map spec, the first bit is the sign,
  13706. // the next four bits are the actual value, and the 6th bit is the
  13707. // continuation bit. The continuation bit tells us whether there are more
  13708. // digits in this value following this digit.
  13709. //
  13710. // Continuation
  13711. // | Sign
  13712. // | |
  13713. // V V
  13714. // 101011
  13715. var VLQ_BASE_SHIFT = 5;
  13716. // binary: 100000
  13717. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  13718. // binary: 011111
  13719. var VLQ_BASE_MASK = VLQ_BASE - 1;
  13720. // binary: 100000
  13721. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  13722. /**
  13723. * Converts from a two-complement value to a value where the sign bit is
  13724. * placed in the least significant bit. For example, as decimals:
  13725. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  13726. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  13727. */
  13728. function toVLQSigned(aValue) {
  13729. return aValue < 0
  13730. ? ((-aValue) << 1) + 1
  13731. : (aValue << 1) + 0;
  13732. }
  13733. /**
  13734. * Converts to a two-complement value from a value where the sign bit is
  13735. * placed in the least significant bit. For example, as decimals:
  13736. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  13737. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  13738. */
  13739. function fromVLQSigned(aValue) {
  13740. var isNegative = (aValue & 1) === 1;
  13741. var shifted = aValue >> 1;
  13742. return isNegative
  13743. ? -shifted
  13744. : shifted;
  13745. }
  13746. /**
  13747. * Returns the base 64 VLQ encoded value.
  13748. */
  13749. exports.encode = function base64VLQ_encode(aValue) {
  13750. var encoded = "";
  13751. var digit;
  13752. var vlq = toVLQSigned(aValue);
  13753. do {
  13754. digit = vlq & VLQ_BASE_MASK;
  13755. vlq >>>= VLQ_BASE_SHIFT;
  13756. if (vlq > 0) {
  13757. // There are still more digits in this value, so we must make sure the
  13758. // continuation bit is marked.
  13759. digit |= VLQ_CONTINUATION_BIT;
  13760. }
  13761. encoded += base64.encode(digit);
  13762. } while (vlq > 0);
  13763. return encoded;
  13764. };
  13765. /**
  13766. * Decodes the next base 64 VLQ value from the given string and returns the
  13767. * value and the rest of the string via the out parameter.
  13768. */
  13769. exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  13770. var strLen = aStr.length;
  13771. var result = 0;
  13772. var shift = 0;
  13773. var continuation, digit;
  13774. do {
  13775. if (aIndex >= strLen) {
  13776. throw new Error("Expected more digits in base 64 VLQ value.");
  13777. }
  13778. digit = base64.decode(aStr.charCodeAt(aIndex++));
  13779. if (digit === -1) {
  13780. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  13781. }
  13782. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  13783. digit &= VLQ_BASE_MASK;
  13784. result = result + (digit << shift);
  13785. shift += VLQ_BASE_SHIFT;
  13786. } while (continuation);
  13787. aOutParam.value = fromVLQSigned(result);
  13788. aOutParam.rest = aIndex;
  13789. };
  13790. /***/ }),
  13791. /* 101 */
  13792. /***/ (function(module, exports, __webpack_require__) {
  13793. /* -*- Mode: js; js-indent-level: 2; -*- */
  13794. /*
  13795. * Copyright 2011 Mozilla Foundation and contributors
  13796. * Licensed under the New BSD license. See LICENSE or:
  13797. * http://opensource.org/licenses/BSD-3-Clause
  13798. */
  13799. var base64VLQ = __webpack_require__(100);
  13800. var util = __webpack_require__(17);
  13801. var ArraySet = __webpack_require__(99).ArraySet;
  13802. var MappingList = __webpack_require__(205).MappingList;
  13803. /**
  13804. * An instance of the SourceMapGenerator represents a source map which is
  13805. * being built incrementally. You may pass an object with the following
  13806. * properties:
  13807. *
  13808. * - file: The filename of the generated source.
  13809. * - sourceRoot: A root for all relative URLs in this source map.
  13810. */
  13811. function SourceMapGenerator(aArgs) {
  13812. if (!aArgs) {
  13813. aArgs = {};
  13814. }
  13815. this._file = util.getArg(aArgs, 'file', null);
  13816. this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  13817. this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  13818. this._sources = new ArraySet();
  13819. this._names = new ArraySet();
  13820. this._mappings = new MappingList();
  13821. this._sourcesContents = null;
  13822. }
  13823. SourceMapGenerator.prototype._version = 3;
  13824. /**
  13825. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  13826. *
  13827. * @param aSourceMapConsumer The SourceMap.
  13828. */
  13829. SourceMapGenerator.fromSourceMap =
  13830. function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  13831. var sourceRoot = aSourceMapConsumer.sourceRoot;
  13832. var generator = new SourceMapGenerator({
  13833. file: aSourceMapConsumer.file,
  13834. sourceRoot: sourceRoot
  13835. });
  13836. aSourceMapConsumer.eachMapping(function (mapping) {
  13837. var newMapping = {
  13838. generated: {
  13839. line: mapping.generatedLine,
  13840. column: mapping.generatedColumn
  13841. }
  13842. };
  13843. if (mapping.source != null) {
  13844. newMapping.source = mapping.source;
  13845. if (sourceRoot != null) {
  13846. newMapping.source = util.relative(sourceRoot, newMapping.source);
  13847. }
  13848. newMapping.original = {
  13849. line: mapping.originalLine,
  13850. column: mapping.originalColumn
  13851. };
  13852. if (mapping.name != null) {
  13853. newMapping.name = mapping.name;
  13854. }
  13855. }
  13856. generator.addMapping(newMapping);
  13857. });
  13858. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  13859. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  13860. if (content != null) {
  13861. generator.setSourceContent(sourceFile, content);
  13862. }
  13863. });
  13864. return generator;
  13865. };
  13866. /**
  13867. * Add a single mapping from original source line and column to the generated
  13868. * source's line and column for this source map being created. The mapping
  13869. * object should have the following properties:
  13870. *
  13871. * - generated: An object with the generated line and column positions.
  13872. * - original: An object with the original line and column positions.
  13873. * - source: The original source file (relative to the sourceRoot).
  13874. * - name: An optional original token name for this mapping.
  13875. */
  13876. SourceMapGenerator.prototype.addMapping =
  13877. function SourceMapGenerator_addMapping(aArgs) {
  13878. var generated = util.getArg(aArgs, 'generated');
  13879. var original = util.getArg(aArgs, 'original', null);
  13880. var source = util.getArg(aArgs, 'source', null);
  13881. var name = util.getArg(aArgs, 'name', null);
  13882. if (!this._skipValidation) {
  13883. this._validateMapping(generated, original, source, name);
  13884. }
  13885. if (source != null) {
  13886. source = String(source);
  13887. if (!this._sources.has(source)) {
  13888. this._sources.add(source);
  13889. }
  13890. }
  13891. if (name != null) {
  13892. name = String(name);
  13893. if (!this._names.has(name)) {
  13894. this._names.add(name);
  13895. }
  13896. }
  13897. this._mappings.add({
  13898. generatedLine: generated.line,
  13899. generatedColumn: generated.column,
  13900. originalLine: original != null && original.line,
  13901. originalColumn: original != null && original.column,
  13902. source: source,
  13903. name: name
  13904. });
  13905. };
  13906. /**
  13907. * Set the source content for a source file.
  13908. */
  13909. SourceMapGenerator.prototype.setSourceContent =
  13910. function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  13911. var source = aSourceFile;
  13912. if (this._sourceRoot != null) {
  13913. source = util.relative(this._sourceRoot, source);
  13914. }
  13915. if (aSourceContent != null) {
  13916. // Add the source content to the _sourcesContents map.
  13917. // Create a new _sourcesContents map if the property is null.
  13918. if (!this._sourcesContents) {
  13919. this._sourcesContents = Object.create(null);
  13920. }
  13921. this._sourcesContents[util.toSetString(source)] = aSourceContent;
  13922. } else if (this._sourcesContents) {
  13923. // Remove the source file from the _sourcesContents map.
  13924. // If the _sourcesContents map is empty, set the property to null.
  13925. delete this._sourcesContents[util.toSetString(source)];
  13926. if (Object.keys(this._sourcesContents).length === 0) {
  13927. this._sourcesContents = null;
  13928. }
  13929. }
  13930. };
  13931. /**
  13932. * Applies the mappings of a sub-source-map for a specific source file to the
  13933. * source map being generated. Each mapping to the supplied source file is
  13934. * rewritten using the supplied source map. Note: The resolution for the
  13935. * resulting mappings is the minimium of this map and the supplied map.
  13936. *
  13937. * @param aSourceMapConsumer The source map to be applied.
  13938. * @param aSourceFile Optional. The filename of the source file.
  13939. * If omitted, SourceMapConsumer's file property will be used.
  13940. * @param aSourceMapPath Optional. The dirname of the path to the source map
  13941. * to be applied. If relative, it is relative to the SourceMapConsumer.
  13942. * This parameter is needed when the two source maps aren't in the same
  13943. * directory, and the source map to be applied contains relative source
  13944. * paths. If so, those relative source paths need to be rewritten
  13945. * relative to the SourceMapGenerator.
  13946. */
  13947. SourceMapGenerator.prototype.applySourceMap =
  13948. function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  13949. var sourceFile = aSourceFile;
  13950. // If aSourceFile is omitted, we will use the file property of the SourceMap
  13951. if (aSourceFile == null) {
  13952. if (aSourceMapConsumer.file == null) {
  13953. throw new Error(
  13954. 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
  13955. 'or the source map\'s "file" property. Both were omitted.'
  13956. );
  13957. }
  13958. sourceFile = aSourceMapConsumer.file;
  13959. }
  13960. var sourceRoot = this._sourceRoot;
  13961. // Make "sourceFile" relative if an absolute Url is passed.
  13962. if (sourceRoot != null) {
  13963. sourceFile = util.relative(sourceRoot, sourceFile);
  13964. }
  13965. // Applying the SourceMap can add and remove items from the sources and
  13966. // the names array.
  13967. var newSources = new ArraySet();
  13968. var newNames = new ArraySet();
  13969. // Find mappings for the "sourceFile"
  13970. this._mappings.unsortedForEach(function (mapping) {
  13971. if (mapping.source === sourceFile && mapping.originalLine != null) {
  13972. // Check if it can be mapped by the source map, then update the mapping.
  13973. var original = aSourceMapConsumer.originalPositionFor({
  13974. line: mapping.originalLine,
  13975. column: mapping.originalColumn
  13976. });
  13977. if (original.source != null) {
  13978. // Copy mapping
  13979. mapping.source = original.source;
  13980. if (aSourceMapPath != null) {
  13981. mapping.source = util.join(aSourceMapPath, mapping.source)
  13982. }
  13983. if (sourceRoot != null) {
  13984. mapping.source = util.relative(sourceRoot, mapping.source);
  13985. }
  13986. mapping.originalLine = original.line;
  13987. mapping.originalColumn = original.column;
  13988. if (original.name != null) {
  13989. mapping.name = original.name;
  13990. }
  13991. }
  13992. }
  13993. var source = mapping.source;
  13994. if (source != null && !newSources.has(source)) {
  13995. newSources.add(source);
  13996. }
  13997. var name = mapping.name;
  13998. if (name != null && !newNames.has(name)) {
  13999. newNames.add(name);
  14000. }
  14001. }, this);
  14002. this._sources = newSources;
  14003. this._names = newNames;
  14004. // Copy sourcesContents of applied map.
  14005. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  14006. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  14007. if (content != null) {
  14008. if (aSourceMapPath != null) {
  14009. sourceFile = util.join(aSourceMapPath, sourceFile);
  14010. }
  14011. if (sourceRoot != null) {
  14012. sourceFile = util.relative(sourceRoot, sourceFile);
  14013. }
  14014. this.setSourceContent(sourceFile, content);
  14015. }
  14016. }, this);
  14017. };
  14018. /**
  14019. * A mapping can have one of the three levels of data:
  14020. *
  14021. * 1. Just the generated position.
  14022. * 2. The Generated position, original position, and original source.
  14023. * 3. Generated and original position, original source, as well as a name
  14024. * token.
  14025. *
  14026. * To maintain consistency, we validate that any new mapping being added falls
  14027. * in to one of these categories.
  14028. */
  14029. SourceMapGenerator.prototype._validateMapping =
  14030. function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
  14031. aName) {
  14032. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  14033. && aGenerated.line > 0 && aGenerated.column >= 0
  14034. && !aOriginal && !aSource && !aName) {
  14035. // Case 1.
  14036. return;
  14037. }
  14038. else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  14039. && aOriginal && 'line' in aOriginal && 'column' in aOriginal
  14040. && aGenerated.line > 0 && aGenerated.column >= 0
  14041. && aOriginal.line > 0 && aOriginal.column >= 0
  14042. && aSource) {
  14043. // Cases 2 and 3.
  14044. return;
  14045. }
  14046. else {
  14047. throw new Error('Invalid mapping: ' + JSON.stringify({
  14048. generated: aGenerated,
  14049. source: aSource,
  14050. original: aOriginal,
  14051. name: aName
  14052. }));
  14053. }
  14054. };
  14055. /**
  14056. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  14057. * specified by the source map format.
  14058. */
  14059. SourceMapGenerator.prototype._serializeMappings =
  14060. function SourceMapGenerator_serializeMappings() {
  14061. var previousGeneratedColumn = 0;
  14062. var previousGeneratedLine = 1;
  14063. var previousOriginalColumn = 0;
  14064. var previousOriginalLine = 0;
  14065. var previousName = 0;
  14066. var previousSource = 0;
  14067. var result = '';
  14068. var next;
  14069. var mapping;
  14070. var nameIdx;
  14071. var sourceIdx;
  14072. var mappings = this._mappings.toArray();
  14073. for (var i = 0, len = mappings.length; i < len; i++) {
  14074. mapping = mappings[i];
  14075. next = ''
  14076. if (mapping.generatedLine !== previousGeneratedLine) {
  14077. previousGeneratedColumn = 0;
  14078. while (mapping.generatedLine !== previousGeneratedLine) {
  14079. next += ';';
  14080. previousGeneratedLine++;
  14081. }
  14082. }
  14083. else {
  14084. if (i > 0) {
  14085. if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  14086. continue;
  14087. }
  14088. next += ',';
  14089. }
  14090. }
  14091. next += base64VLQ.encode(mapping.generatedColumn
  14092. - previousGeneratedColumn);
  14093. previousGeneratedColumn = mapping.generatedColumn;
  14094. if (mapping.source != null) {
  14095. sourceIdx = this._sources.indexOf(mapping.source);
  14096. next += base64VLQ.encode(sourceIdx - previousSource);
  14097. previousSource = sourceIdx;
  14098. // lines are stored 0-based in SourceMap spec version 3
  14099. next += base64VLQ.encode(mapping.originalLine - 1
  14100. - previousOriginalLine);
  14101. previousOriginalLine = mapping.originalLine - 1;
  14102. next += base64VLQ.encode(mapping.originalColumn
  14103. - previousOriginalColumn);
  14104. previousOriginalColumn = mapping.originalColumn;
  14105. if (mapping.name != null) {
  14106. nameIdx = this._names.indexOf(mapping.name);
  14107. next += base64VLQ.encode(nameIdx - previousName);
  14108. previousName = nameIdx;
  14109. }
  14110. }
  14111. result += next;
  14112. }
  14113. return result;
  14114. };
  14115. SourceMapGenerator.prototype._generateSourcesContent =
  14116. function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  14117. return aSources.map(function (source) {
  14118. if (!this._sourcesContents) {
  14119. return null;
  14120. }
  14121. if (aSourceRoot != null) {
  14122. source = util.relative(aSourceRoot, source);
  14123. }
  14124. var key = util.toSetString(source);
  14125. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
  14126. ? this._sourcesContents[key]
  14127. : null;
  14128. }, this);
  14129. };
  14130. /**
  14131. * Externalize the source map.
  14132. */
  14133. SourceMapGenerator.prototype.toJSON =
  14134. function SourceMapGenerator_toJSON() {
  14135. var map = {
  14136. version: this._version,
  14137. sources: this._sources.toArray(),
  14138. names: this._names.toArray(),
  14139. mappings: this._serializeMappings()
  14140. };
  14141. if (this._file != null) {
  14142. map.file = this._file;
  14143. }
  14144. if (this._sourceRoot != null) {
  14145. map.sourceRoot = this._sourceRoot;
  14146. }
  14147. if (this._sourcesContents) {
  14148. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  14149. }
  14150. return map;
  14151. };
  14152. /**
  14153. * Render the source map being generated to a string.
  14154. */
  14155. SourceMapGenerator.prototype.toString =
  14156. function SourceMapGenerator_toString() {
  14157. return JSON.stringify(this.toJSON());
  14158. };
  14159. exports.SourceMapGenerator = SourceMapGenerator;
  14160. /***/ }),
  14161. /* 102 */
  14162. /***/ (function(module, exports, __webpack_require__) {
  14163. /*
  14164. * Copyright 2009-2011 Mozilla Foundation and contributors
  14165. * Licensed under the New BSD license. See LICENSE.txt or:
  14166. * http://opensource.org/licenses/BSD-3-Clause
  14167. */
  14168. exports.SourceMapGenerator = __webpack_require__(101).SourceMapGenerator;
  14169. exports.SourceMapConsumer = __webpack_require__(207).SourceMapConsumer;
  14170. exports.SourceNode = __webpack_require__(208).SourceNode;
  14171. /***/ }),
  14172. /* 103 */
  14173. /***/ (function(module, exports, __webpack_require__) {
  14174. "use strict";
  14175. function unique_pred(list, compare) {
  14176. var ptr = 1
  14177. , len = list.length
  14178. , a=list[0], b=list[0]
  14179. for(var i=1; i<len; ++i) {
  14180. b = a
  14181. a = list[i]
  14182. if(compare(a, b)) {
  14183. if(i === ptr) {
  14184. ptr++
  14185. continue
  14186. }
  14187. list[ptr++] = a
  14188. }
  14189. }
  14190. list.length = ptr
  14191. return list
  14192. }
  14193. function unique_eq(list) {
  14194. var ptr = 1
  14195. , len = list.length
  14196. , a=list[0], b = list[0]
  14197. for(var i=1; i<len; ++i, b=a) {
  14198. b = a
  14199. a = list[i]
  14200. if(a !== b) {
  14201. if(i === ptr) {
  14202. ptr++
  14203. continue
  14204. }
  14205. list[ptr++] = a
  14206. }
  14207. }
  14208. list.length = ptr
  14209. return list
  14210. }
  14211. function unique(list, compare, sorted) {
  14212. if(list.length === 0) {
  14213. return list
  14214. }
  14215. if(compare) {
  14216. if(!sorted) {
  14217. list.sort(compare)
  14218. }
  14219. return unique_pred(list, compare)
  14220. }
  14221. if(!sorted) {
  14222. list.sort()
  14223. }
  14224. return unique_eq(list)
  14225. }
  14226. module.exports = unique
  14227. /***/ }),
  14228. /* 104 */
  14229. /***/ (function(module, exports) {
  14230. /* (ignored) */
  14231. /***/ }),
  14232. /* 105 */
  14233. /***/ (function(module, exports, __webpack_require__) {
  14234. "use strict";
  14235. var fs = __webpack_require__(216);
  14236. var extend = __webpack_require__(18);
  14237. var parse = __webpack_require__(116);
  14238. var defaults = __webpack_require__(19);
  14239. var stringify = __webpack_require__(47);
  14240. var excerpt = __webpack_require__(115);
  14241. var engines = __webpack_require__(46);
  14242. var toFile = __webpack_require__(117);
  14243. var utils = __webpack_require__(24);
  14244. var cache = {};
  14245. /**
  14246. * Takes a string or object with `content` property, extracts
  14247. * and parses front-matter from the string, then returns an object
  14248. * with `data`, `content` and other [useful properties](#returned-object).
  14249. *
  14250. * ```js
  14251. * var matter = require('gray-matter');
  14252. * console.log(matter('---\ntitle: Home\n---\nOther stuff'));
  14253. * //=> { data: { title: 'Home'}, content: 'Other stuff' }
  14254. * ```
  14255. * @param {Object|String} `input` String, or object with `content` string
  14256. * @param {Object} `options`
  14257. * @return {Object}
  14258. * @api public
  14259. */
  14260. function matter(input, options) {
  14261. var file = {data: {}, content: input, excerpt: '', orig: input};
  14262. if (input === '') return file;
  14263. file = toFile(input);
  14264. var cached = cache[file.content];
  14265. if (!options) {
  14266. if (cached) {
  14267. file = extend({}, cached);
  14268. file.orig = cached.orig;
  14269. return file;
  14270. }
  14271. cache[file.content] = file;
  14272. }
  14273. return parseMatter(file, options);
  14274. }
  14275. function parseMatter(file, options) {
  14276. var opts = defaults(options);
  14277. var open = opts.delimiters[0];
  14278. var close = '\n' + opts.delimiters[1];
  14279. var str = file.content;
  14280. if (opts.language) {
  14281. file.language = opts.language;
  14282. }
  14283. // get the length of the opening delimiter
  14284. var openLen = open.length;
  14285. if (!utils.startsWith(str, open, openLen)) {
  14286. excerpt(file, opts);
  14287. return file;
  14288. }
  14289. // if the next character after the opening delimiter is
  14290. // a character from the delimiter, then it's not a front-
  14291. // matter delimiter
  14292. if (str.charAt(openLen) === open.slice(-1)) {
  14293. return file;
  14294. }
  14295. // strip the opening delimiter
  14296. str = str.slice(openLen);
  14297. var len = str.length;
  14298. // use the language defined after first delimiter, if it exists
  14299. var language = matter.language(str, opts);
  14300. if (language.name) {
  14301. file.language = language.name;
  14302. str = str.slice(language.raw.length);
  14303. }
  14304. // get the index of the closing delimiter
  14305. var closeIndex = str.indexOf(close);
  14306. if (closeIndex === -1) {
  14307. closeIndex = len;
  14308. }
  14309. // get the raw front-matter block
  14310. file.matter = str.slice(0, closeIndex);
  14311. // create file.data by parsing the raw file.matter block
  14312. file.data = parse(file.language, file.matter, opts);
  14313. // update file.content
  14314. if (closeIndex === len) {
  14315. file.content = '';
  14316. } else {
  14317. file.content = str.slice(closeIndex + close.length);
  14318. if (file.content[0] === '\r') {
  14319. file.content = file.content.slice(1);
  14320. }
  14321. if (file.content[0] === '\n') {
  14322. file.content = file.content.slice(1);
  14323. }
  14324. }
  14325. excerpt(file, opts);
  14326. return file;
  14327. }
  14328. /**
  14329. * Expose engines
  14330. */
  14331. matter.engines = engines;
  14332. /**
  14333. * Stringify an object to YAML or the specified language, and
  14334. * append it to the given string. By default, only YAML and JSON
  14335. * can be stringified. See the [engines](#engines) section to learn
  14336. * how to stringify other languages.
  14337. *
  14338. * ```js
  14339. * console.log(matter.stringify('foo bar baz', {title: 'Home'}));
  14340. * // results in:
  14341. * // ---
  14342. * // title: Home
  14343. * // ---
  14344. * // foo bar baz
  14345. * ```
  14346. * @param {String|Object} `file` The content string to append to stringified front-matter, or a file object with `file.content` string.
  14347. * @param {Object} `data` Front matter to stringify.
  14348. * @param {Object} `options` [Options](#options) to pass to gray-matter and [js-yaml].
  14349. * @return {String} Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string.
  14350. * @api public
  14351. */
  14352. matter.stringify = function(file, data, options) {
  14353. if (typeof file === 'string') {
  14354. file = matter(file, options);
  14355. }
  14356. return stringify(file, data, options);
  14357. };
  14358. /**
  14359. * Synchronously read a file from the file system and parse
  14360. * front matter. Returns the same object as the [main function](#matter).
  14361. *
  14362. * ```js
  14363. * var file = matter.read('./content/blog-post.md');
  14364. * ```
  14365. * @param {String} `filepath` file path of the file to read.
  14366. * @param {Object} `options` [Options](#options) to pass to gray-matter.
  14367. * @return {Object} Returns [an object](#returned-object) with `data` and `content`
  14368. * @api public
  14369. */
  14370. matter.read = function(filepath, options) {
  14371. var str = fs.readFileSync(filepath, 'utf8');
  14372. var file = matter(str, options);
  14373. file.path = filepath;
  14374. return file;
  14375. };
  14376. /**
  14377. * Returns true if the given `string` has front matter.
  14378. * @param {String} `string`
  14379. * @param {Object} `options`
  14380. * @return {Boolean} True if front matter exists.
  14381. * @api public
  14382. */
  14383. matter.test = function(str, options) {
  14384. var opts = defaults(options);
  14385. return utils.startsWith(str, opts.delimiters[0]);
  14386. };
  14387. /**
  14388. * Detect the language to use, if one is defined after the
  14389. * first front-matter delimiter.
  14390. * @param {String} `string`
  14391. * @param {Object} `options`
  14392. * @return {Object} Object with `raw` (actual language string), and `name`, the language with whitespace trimmed
  14393. */
  14394. matter.language = function(str, options) {
  14395. var opts = defaults(options);
  14396. var open = opts.delimiters[0];
  14397. if (matter.test(str)) {
  14398. str = str.slice(open.length);
  14399. }
  14400. var language = str.slice(0, str.search(/\r?\n/));
  14401. return {
  14402. raw: language,
  14403. name: language ? language.trim() : ''
  14404. };
  14405. };
  14406. /**
  14407. * Expose `matter`
  14408. */
  14409. module.exports = matter;
  14410. /***/ }),
  14411. /* 106 */
  14412. /***/ (function(module, exports, __webpack_require__) {
  14413. "use strict";
  14414. Object.defineProperty(exports, "__esModule", {
  14415. value: true
  14416. });
  14417. var _lessParse = __webpack_require__(146);
  14418. var _lessParse2 = _interopRequireDefault(_lessParse);
  14419. var _lessStringify = __webpack_require__(21);
  14420. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  14421. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14422. exports.default = { parse: _lessParse2.default, stringify: _lessStringify2.default };
  14423. module.exports = exports['default'];
  14424. /***/ }),
  14425. /* 107 */
  14426. /***/ (function(module, exports, __webpack_require__) {
  14427. "use strict";
  14428. Object.defineProperty(exports, "__esModule", {
  14429. value: true
  14430. });
  14431. exports.default = parseMedia;
  14432. var _Container = __webpack_require__(52);
  14433. var _Container2 = _interopRequireDefault(_Container);
  14434. var _parsers = __webpack_require__(164);
  14435. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14436. /**
  14437. * Parses a media query list into an array of nodes. A typical node signature:
  14438. * {string} node.type -- one of: 'media-query', 'media-type', 'keyword',
  14439. * 'media-feature-expression', 'media-feature', 'colon', 'value'
  14440. * {string} node.value -- the contents of a particular element, trimmed
  14441. * e.g.: `screen`, `max-width`, `1024px`
  14442. * {string} node.after -- whitespaces that follow the element
  14443. * {string} node.before -- whitespaces that precede the element
  14444. * {string} node.sourceIndex -- the index of the element in a source media
  14445. * query list, 0-based
  14446. * {object} node.parent -- a link to the parent node (a container)
  14447. *
  14448. * Some nodes (media queries, media feature expressions) contain other nodes.
  14449. * They additionally have:
  14450. * {array} node.nodes -- an array of nodes of the type described here
  14451. * {funciton} node.each -- traverses direct children of the node, calling
  14452. * a callback for each one
  14453. * {funciton} node.walk -- traverses ALL descendants of the node, calling
  14454. * a callback for each one
  14455. */
  14456. function parseMedia(value) {
  14457. return new _Container2.default({
  14458. nodes: (0, _parsers.parseMediaList)(value),
  14459. type: 'media-query-list',
  14460. value: value.trim()
  14461. });
  14462. }
  14463. /***/ }),
  14464. /* 108 */
  14465. /***/ (function(module, exports, __webpack_require__) {
  14466. "use strict";
  14467. exports.__esModule = true;
  14468. var _scssStringify = __webpack_require__(169);
  14469. var _scssStringify2 = _interopRequireDefault(_scssStringify);
  14470. var _scssParse = __webpack_require__(166);
  14471. var _scssParse2 = _interopRequireDefault(_scssParse);
  14472. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14473. exports.default = { parse: _scssParse2.default, stringify: _scssStringify2.default };
  14474. module.exports = exports['default'];
  14475. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3ludGF4LmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsInN0cmluZ2lmeSJdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7O0FBQ0E7Ozs7OztrQkFFZSxFQUFFQSwwQkFBRixFQUFTQyxrQ0FBVCxFIiwiZmlsZSI6InNjc3Mtc3ludGF4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0cmluZ2lmeSBmcm9tICcuL3Njc3Mtc3RyaW5naWZ5JztcbmltcG9ydCBwYXJzZSAgICAgZnJvbSAnLi9zY3NzLXBhcnNlJztcblxuZXhwb3J0IGRlZmF1bHQgeyBwYXJzZSwgc3RyaW5naWZ5IH07XG4iXX0=
  14476. /***/ }),
  14477. /* 109 */
  14478. /***/ (function(module, exports, __webpack_require__) {
  14479. "use strict";
  14480. exports.__esModule = true;
  14481. var _processor = __webpack_require__(185);
  14482. var _processor2 = _interopRequireDefault(_processor);
  14483. var _attribute = __webpack_require__(67);
  14484. var _attribute2 = _interopRequireDefault(_attribute);
  14485. var _className = __webpack_require__(68);
  14486. var _className2 = _interopRequireDefault(_className);
  14487. var _combinator = __webpack_require__(69);
  14488. var _combinator2 = _interopRequireDefault(_combinator);
  14489. var _comment = __webpack_require__(70);
  14490. var _comment2 = _interopRequireDefault(_comment);
  14491. var _id = __webpack_require__(71);
  14492. var _id2 = _interopRequireDefault(_id);
  14493. var _nesting = __webpack_require__(72);
  14494. var _nesting2 = _interopRequireDefault(_nesting);
  14495. var _pseudo = __webpack_require__(73);
  14496. var _pseudo2 = _interopRequireDefault(_pseudo);
  14497. var _root = __webpack_require__(74);
  14498. var _root2 = _interopRequireDefault(_root);
  14499. var _selector = __webpack_require__(75);
  14500. var _selector2 = _interopRequireDefault(_selector);
  14501. var _string = __webpack_require__(76);
  14502. var _string2 = _interopRequireDefault(_string);
  14503. var _tag = __webpack_require__(77);
  14504. var _tag2 = _interopRequireDefault(_tag);
  14505. var _universal = __webpack_require__(78);
  14506. var _universal2 = _interopRequireDefault(_universal);
  14507. var _types = __webpack_require__(1);
  14508. var types = _interopRequireWildcard(_types);
  14509. 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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  14510. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14511. var parser = function parser(processor) {
  14512. return new _processor2.default(processor);
  14513. };
  14514. parser.attribute = function (opts) {
  14515. return new _attribute2.default(opts);
  14516. };
  14517. parser.className = function (opts) {
  14518. return new _className2.default(opts);
  14519. };
  14520. parser.combinator = function (opts) {
  14521. return new _combinator2.default(opts);
  14522. };
  14523. parser.comment = function (opts) {
  14524. return new _comment2.default(opts);
  14525. };
  14526. parser.id = function (opts) {
  14527. return new _id2.default(opts);
  14528. };
  14529. parser.nesting = function (opts) {
  14530. return new _nesting2.default(opts);
  14531. };
  14532. parser.pseudo = function (opts) {
  14533. return new _pseudo2.default(opts);
  14534. };
  14535. parser.root = function (opts) {
  14536. return new _root2.default(opts);
  14537. };
  14538. parser.selector = function (opts) {
  14539. return new _selector2.default(opts);
  14540. };
  14541. parser.string = function (opts) {
  14542. return new _string2.default(opts);
  14543. };
  14544. parser.tag = function (opts) {
  14545. return new _tag2.default(opts);
  14546. };
  14547. parser.universal = function (opts) {
  14548. return new _universal2.default(opts);
  14549. };
  14550. Object.keys(types).forEach(function (type) {
  14551. if (type === '__esModule') {
  14552. return;
  14553. }
  14554. parser[type] = types[type]; // eslint-disable-line
  14555. });
  14556. exports.default = parser;
  14557. module.exports = exports['default'];
  14558. /***/ }),
  14559. /* 110 */
  14560. /***/ (function(module, exports, __webpack_require__) {
  14561. "use strict";
  14562. const Parser = __webpack_require__(190);
  14563. const AtWord = __webpack_require__(79);
  14564. const Colon = __webpack_require__(80);
  14565. const Comma = __webpack_require__(81);
  14566. const Comment = __webpack_require__(82);
  14567. const Func = __webpack_require__(83);
  14568. const Num = __webpack_require__(84);
  14569. const Operator = __webpack_require__(85);
  14570. const Paren = __webpack_require__(86);
  14571. const Str = __webpack_require__(87);
  14572. const UnicodeRange = __webpack_require__(88);
  14573. const Value = __webpack_require__(89);
  14574. const Word = __webpack_require__(90);
  14575. let parser = function (source, options) {
  14576. return new Parser(source, options);
  14577. };
  14578. parser.atword = function (opts) {
  14579. return new AtWord(opts);
  14580. };
  14581. parser.colon = function (opts) {
  14582. opts.value = opts.value || ':';
  14583. return new Colon(opts);
  14584. };
  14585. parser.comma = function (opts) {
  14586. opts.value = opts.value || ',';
  14587. return new Comma(opts);
  14588. };
  14589. parser.comment = function (opts) {
  14590. return new Comment(opts);
  14591. };
  14592. parser.func = function (opts) {
  14593. return new Func(opts);
  14594. };
  14595. parser.number = function (opts) {
  14596. return new Num(opts);
  14597. };
  14598. parser.operator = function (opts) {
  14599. return new Operator(opts);
  14600. };
  14601. parser.paren = function (opts) {
  14602. opts.value = opts.value || '(';
  14603. return new Paren(opts);
  14604. };
  14605. parser.string = function (opts) {
  14606. opts.quote = opts.quote || '\'';
  14607. return new Str(opts);
  14608. };
  14609. parser.value = function (opts) {
  14610. return new Value(opts);
  14611. };
  14612. parser.word = function (opts) {
  14613. return new Word(opts);
  14614. };
  14615. parser.unicodeRange = function (opts) {
  14616. return new UnicodeRange(opts);
  14617. };
  14618. module.exports = parser;
  14619. /***/ }),
  14620. /* 111 */
  14621. /***/ (function(module, exports, __webpack_require__) {
  14622. "use strict";
  14623. function createError(message, loc) {
  14624. // Construct an error similar to the ones thrown by Babylon.
  14625. const error = new SyntaxError(
  14626. message + " (" + loc.start.line + ":" + loc.start.column + ")"
  14627. );
  14628. error.loc = loc;
  14629. return error;
  14630. }
  14631. module.exports = createError;
  14632. /***/ }),
  14633. /* 112 */
  14634. /***/ (function(module, exports, __webpack_require__) {
  14635. "use strict";
  14636. exports.byteLength = byteLength
  14637. exports.toByteArray = toByteArray
  14638. exports.fromByteArray = fromByteArray
  14639. var lookup = []
  14640. var revLookup = []
  14641. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  14642. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  14643. for (var i = 0, len = code.length; i < len; ++i) {
  14644. lookup[i] = code[i]
  14645. revLookup[code.charCodeAt(i)] = i
  14646. }
  14647. revLookup['-'.charCodeAt(0)] = 62
  14648. revLookup['_'.charCodeAt(0)] = 63
  14649. function placeHoldersCount (b64) {
  14650. var len = b64.length
  14651. if (len % 4 > 0) {
  14652. throw new Error('Invalid string. Length must be a multiple of 4')
  14653. }
  14654. // the number of equal signs (place holders)
  14655. // if there are two placeholders, than the two characters before it
  14656. // represent one byte
  14657. // if there is only one, then the three characters before it represent 2 bytes
  14658. // this is just a cheap hack to not do indexOf twice
  14659. return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
  14660. }
  14661. function byteLength (b64) {
  14662. // base64 is 4/3 + up to two characters of the original data
  14663. return b64.length * 3 / 4 - placeHoldersCount(b64)
  14664. }
  14665. function toByteArray (b64) {
  14666. var i, j, l, tmp, placeHolders, arr
  14667. var len = b64.length
  14668. placeHolders = placeHoldersCount(b64)
  14669. arr = new Arr(len * 3 / 4 - placeHolders)
  14670. // if there are placeholders, only get up to the last complete 4 chars
  14671. l = placeHolders > 0 ? len - 4 : len
  14672. var L = 0
  14673. for (i = 0, j = 0; i < l; i += 4, j += 3) {
  14674. tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
  14675. arr[L++] = (tmp >> 16) & 0xFF
  14676. arr[L++] = (tmp >> 8) & 0xFF
  14677. arr[L++] = tmp & 0xFF
  14678. }
  14679. if (placeHolders === 2) {
  14680. tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
  14681. arr[L++] = tmp & 0xFF
  14682. } else if (placeHolders === 1) {
  14683. tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
  14684. arr[L++] = (tmp >> 8) & 0xFF
  14685. arr[L++] = tmp & 0xFF
  14686. }
  14687. return arr
  14688. }
  14689. function tripletToBase64 (num) {
  14690. return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
  14691. }
  14692. function encodeChunk (uint8, start, end) {
  14693. var tmp
  14694. var output = []
  14695. for (var i = start; i < end; i += 3) {
  14696. tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
  14697. output.push(tripletToBase64(tmp))
  14698. }
  14699. return output.join('')
  14700. }
  14701. function fromByteArray (uint8) {
  14702. var tmp
  14703. var len = uint8.length
  14704. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  14705. var output = ''
  14706. var parts = []
  14707. var maxChunkLength = 16383 // must be multiple of 3
  14708. // go through the array every three bytes, we'll deal with trailing stuff later
  14709. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  14710. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  14711. }
  14712. // pad the end with zeros, but make sure to not forget the extra bytes
  14713. if (extraBytes === 1) {
  14714. tmp = uint8[len - 1]
  14715. output += lookup[tmp >> 2]
  14716. output += lookup[(tmp << 4) & 0x3F]
  14717. output += '=='
  14718. } else if (extraBytes === 2) {
  14719. tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
  14720. output += lookup[tmp >> 10]
  14721. output += lookup[(tmp >> 4) & 0x3F]
  14722. output += lookup[(tmp << 2) & 0x3F]
  14723. output += '='
  14724. }
  14725. parts.push(output)
  14726. return parts.join('')
  14727. }
  14728. /***/ }),
  14729. /* 113 */
  14730. /***/ (function(module, exports, __webpack_require__) {
  14731. "use strict";
  14732. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  14733. module.exports = function (str) {
  14734. if (typeof str !== 'string') {
  14735. throw new TypeError('Expected a string');
  14736. }
  14737. return str.replace(matchOperatorsRe, '\\$&');
  14738. };
  14739. /***/ }),
  14740. /* 114 */
  14741. /***/ (function(module, exports, __webpack_require__) {
  14742. (function webpackUniversalModuleDefinition(root, factory) {
  14743. /* istanbul ignore next */
  14744. if(true)
  14745. module.exports = factory();
  14746. else if(typeof define === 'function' && define.amd)
  14747. define([], factory);
  14748. /* istanbul ignore next */
  14749. else if(typeof exports === 'object')
  14750. exports["esprima"] = factory();
  14751. else
  14752. root["esprima"] = factory();
  14753. })(this, function() {
  14754. return /******/ (function(modules) { // webpackBootstrap
  14755. /******/ // The module cache
  14756. /******/ var installedModules = {};
  14757. /******/ // The require function
  14758. /******/ function __webpack_require__(moduleId) {
  14759. /******/ // Check if module is in cache
  14760. /* istanbul ignore if */
  14761. /******/ if(installedModules[moduleId])
  14762. /******/ return installedModules[moduleId].exports;
  14763. /******/ // Create a new module (and put it into the cache)
  14764. /******/ var module = installedModules[moduleId] = {
  14765. /******/ exports: {},
  14766. /******/ id: moduleId,
  14767. /******/ loaded: false
  14768. /******/ };
  14769. /******/ // Execute the module function
  14770. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  14771. /******/ // Flag the module as loaded
  14772. /******/ module.loaded = true;
  14773. /******/ // Return the exports of the module
  14774. /******/ return module.exports;
  14775. /******/ }
  14776. /******/ // expose the modules object (__webpack_modules__)
  14777. /******/ __webpack_require__.m = modules;
  14778. /******/ // expose the module cache
  14779. /******/ __webpack_require__.c = installedModules;
  14780. /******/ // __webpack_public_path__
  14781. /******/ __webpack_require__.p = "";
  14782. /******/ // Load entry module and return exports
  14783. /******/ return __webpack_require__(0);
  14784. /******/ })
  14785. /************************************************************************/
  14786. /******/ ([
  14787. /* 0 */
  14788. /***/ function(module, exports, __webpack_require__) {
  14789. "use strict";
  14790. /*
  14791. Copyright JS Foundation and other contributors, https://js.foundation/
  14792. Redistribution and use in source and binary forms, with or without
  14793. modification, are permitted provided that the following conditions are met:
  14794. * Redistributions of source code must retain the above copyright
  14795. notice, this list of conditions and the following disclaimer.
  14796. * Redistributions in binary form must reproduce the above copyright
  14797. notice, this list of conditions and the following disclaimer in the
  14798. documentation and/or other materials provided with the distribution.
  14799. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  14800. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  14801. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  14802. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  14803. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  14804. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  14805. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  14806. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14807. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  14808. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14809. */
  14810. Object.defineProperty(exports, "__esModule", { value: true });
  14811. var comment_handler_1 = __webpack_require__(1);
  14812. var jsx_parser_1 = __webpack_require__(3);
  14813. var parser_1 = __webpack_require__(8);
  14814. var tokenizer_1 = __webpack_require__(15);
  14815. function parse(code, options, delegate) {
  14816. var commentHandler = null;
  14817. var proxyDelegate = function (node, metadata) {
  14818. if (delegate) {
  14819. delegate(node, metadata);
  14820. }
  14821. if (commentHandler) {
  14822. commentHandler.visit(node, metadata);
  14823. }
  14824. };
  14825. var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
  14826. var collectComment = false;
  14827. if (options) {
  14828. collectComment = (typeof options.comment === 'boolean' && options.comment);
  14829. var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
  14830. if (collectComment || attachComment) {
  14831. commentHandler = new comment_handler_1.CommentHandler();
  14832. commentHandler.attach = attachComment;
  14833. options.comment = true;
  14834. parserDelegate = proxyDelegate;
  14835. }
  14836. }
  14837. var isModule = false;
  14838. if (options && typeof options.sourceType === 'string') {
  14839. isModule = (options.sourceType === 'module');
  14840. }
  14841. var parser;
  14842. if (options && typeof options.jsx === 'boolean' && options.jsx) {
  14843. parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
  14844. }
  14845. else {
  14846. parser = new parser_1.Parser(code, options, parserDelegate);
  14847. }
  14848. var program = isModule ? parser.parseModule() : parser.parseScript();
  14849. var ast = program;
  14850. if (collectComment && commentHandler) {
  14851. ast.comments = commentHandler.comments;
  14852. }
  14853. if (parser.config.tokens) {
  14854. ast.tokens = parser.tokens;
  14855. }
  14856. if (parser.config.tolerant) {
  14857. ast.errors = parser.errorHandler.errors;
  14858. }
  14859. return ast;
  14860. }
  14861. exports.parse = parse;
  14862. function parseModule(code, options, delegate) {
  14863. var parsingOptions = options || {};
  14864. parsingOptions.sourceType = 'module';
  14865. return parse(code, parsingOptions, delegate);
  14866. }
  14867. exports.parseModule = parseModule;
  14868. function parseScript(code, options, delegate) {
  14869. var parsingOptions = options || {};
  14870. parsingOptions.sourceType = 'script';
  14871. return parse(code, parsingOptions, delegate);
  14872. }
  14873. exports.parseScript = parseScript;
  14874. function tokenize(code, options, delegate) {
  14875. var tokenizer = new tokenizer_1.Tokenizer(code, options);
  14876. var tokens;
  14877. tokens = [];
  14878. try {
  14879. while (true) {
  14880. var token = tokenizer.getNextToken();
  14881. if (!token) {
  14882. break;
  14883. }
  14884. if (delegate) {
  14885. token = delegate(token);
  14886. }
  14887. tokens.push(token);
  14888. }
  14889. }
  14890. catch (e) {
  14891. tokenizer.errorHandler.tolerate(e);
  14892. }
  14893. if (tokenizer.errorHandler.tolerant) {
  14894. tokens.errors = tokenizer.errors();
  14895. }
  14896. return tokens;
  14897. }
  14898. exports.tokenize = tokenize;
  14899. var syntax_1 = __webpack_require__(2);
  14900. exports.Syntax = syntax_1.Syntax;
  14901. // Sync with *.json manifests.
  14902. exports.version = '4.0.0';
  14903. /***/ },
  14904. /* 1 */
  14905. /***/ function(module, exports, __webpack_require__) {
  14906. "use strict";
  14907. Object.defineProperty(exports, "__esModule", { value: true });
  14908. var syntax_1 = __webpack_require__(2);
  14909. var CommentHandler = (function () {
  14910. function CommentHandler() {
  14911. this.attach = false;
  14912. this.comments = [];
  14913. this.stack = [];
  14914. this.leading = [];
  14915. this.trailing = [];
  14916. }
  14917. CommentHandler.prototype.insertInnerComments = function (node, metadata) {
  14918. // innnerComments for properties empty block
  14919. // `function a() {/** comments **\/}`
  14920. if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
  14921. var innerComments = [];
  14922. for (var i = this.leading.length - 1; i >= 0; --i) {
  14923. var entry = this.leading[i];
  14924. if (metadata.end.offset >= entry.start) {
  14925. innerComments.unshift(entry.comment);
  14926. this.leading.splice(i, 1);
  14927. this.trailing.splice(i, 1);
  14928. }
  14929. }
  14930. if (innerComments.length) {
  14931. node.innerComments = innerComments;
  14932. }
  14933. }
  14934. };
  14935. CommentHandler.prototype.findTrailingComments = function (metadata) {
  14936. var trailingComments = [];
  14937. if (this.trailing.length > 0) {
  14938. for (var i = this.trailing.length - 1; i >= 0; --i) {
  14939. var entry_1 = this.trailing[i];
  14940. if (entry_1.start >= metadata.end.offset) {
  14941. trailingComments.unshift(entry_1.comment);
  14942. }
  14943. }
  14944. this.trailing.length = 0;
  14945. return trailingComments;
  14946. }
  14947. var entry = this.stack[this.stack.length - 1];
  14948. if (entry && entry.node.trailingComments) {
  14949. var firstComment = entry.node.trailingComments[0];
  14950. if (firstComment && firstComment.range[0] >= metadata.end.offset) {
  14951. trailingComments = entry.node.trailingComments;
  14952. delete entry.node.trailingComments;
  14953. }
  14954. }
  14955. return trailingComments;
  14956. };
  14957. CommentHandler.prototype.findLeadingComments = function (metadata) {
  14958. var leadingComments = [];
  14959. var target;
  14960. while (this.stack.length > 0) {
  14961. var entry = this.stack[this.stack.length - 1];
  14962. if (entry && entry.start >= metadata.start.offset) {
  14963. target = entry.node;
  14964. this.stack.pop();
  14965. }
  14966. else {
  14967. break;
  14968. }
  14969. }
  14970. if (target) {
  14971. var count = target.leadingComments ? target.leadingComments.length : 0;
  14972. for (var i = count - 1; i >= 0; --i) {
  14973. var comment = target.leadingComments[i];
  14974. if (comment.range[1] <= metadata.start.offset) {
  14975. leadingComments.unshift(comment);
  14976. target.leadingComments.splice(i, 1);
  14977. }
  14978. }
  14979. if (target.leadingComments && target.leadingComments.length === 0) {
  14980. delete target.leadingComments;
  14981. }
  14982. return leadingComments;
  14983. }
  14984. for (var i = this.leading.length - 1; i >= 0; --i) {
  14985. var entry = this.leading[i];
  14986. if (entry.start <= metadata.start.offset) {
  14987. leadingComments.unshift(entry.comment);
  14988. this.leading.splice(i, 1);
  14989. }
  14990. }
  14991. return leadingComments;
  14992. };
  14993. CommentHandler.prototype.visitNode = function (node, metadata) {
  14994. if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
  14995. return;
  14996. }
  14997. this.insertInnerComments(node, metadata);
  14998. var trailingComments = this.findTrailingComments(metadata);
  14999. var leadingComments = this.findLeadingComments(metadata);
  15000. if (leadingComments.length > 0) {
  15001. node.leadingComments = leadingComments;
  15002. }
  15003. if (trailingComments.length > 0) {
  15004. node.trailingComments = trailingComments;
  15005. }
  15006. this.stack.push({
  15007. node: node,
  15008. start: metadata.start.offset
  15009. });
  15010. };
  15011. CommentHandler.prototype.visitComment = function (node, metadata) {
  15012. var type = (node.type[0] === 'L') ? 'Line' : 'Block';
  15013. var comment = {
  15014. type: type,
  15015. value: node.value
  15016. };
  15017. if (node.range) {
  15018. comment.range = node.range;
  15019. }
  15020. if (node.loc) {
  15021. comment.loc = node.loc;
  15022. }
  15023. this.comments.push(comment);
  15024. if (this.attach) {
  15025. var entry = {
  15026. comment: {
  15027. type: type,
  15028. value: node.value,
  15029. range: [metadata.start.offset, metadata.end.offset]
  15030. },
  15031. start: metadata.start.offset
  15032. };
  15033. if (node.loc) {
  15034. entry.comment.loc = node.loc;
  15035. }
  15036. node.type = type;
  15037. this.leading.push(entry);
  15038. this.trailing.push(entry);
  15039. }
  15040. };
  15041. CommentHandler.prototype.visit = function (node, metadata) {
  15042. if (node.type === 'LineComment') {
  15043. this.visitComment(node, metadata);
  15044. }
  15045. else if (node.type === 'BlockComment') {
  15046. this.visitComment(node, metadata);
  15047. }
  15048. else if (this.attach) {
  15049. this.visitNode(node, metadata);
  15050. }
  15051. };
  15052. return CommentHandler;
  15053. }());
  15054. exports.CommentHandler = CommentHandler;
  15055. /***/ },
  15056. /* 2 */
  15057. /***/ function(module, exports) {
  15058. "use strict";
  15059. Object.defineProperty(exports, "__esModule", { value: true });
  15060. exports.Syntax = {
  15061. AssignmentExpression: 'AssignmentExpression',
  15062. AssignmentPattern: 'AssignmentPattern',
  15063. ArrayExpression: 'ArrayExpression',
  15064. ArrayPattern: 'ArrayPattern',
  15065. ArrowFunctionExpression: 'ArrowFunctionExpression',
  15066. AwaitExpression: 'AwaitExpression',
  15067. BlockStatement: 'BlockStatement',
  15068. BinaryExpression: 'BinaryExpression',
  15069. BreakStatement: 'BreakStatement',
  15070. CallExpression: 'CallExpression',
  15071. CatchClause: 'CatchClause',
  15072. ClassBody: 'ClassBody',
  15073. ClassDeclaration: 'ClassDeclaration',
  15074. ClassExpression: 'ClassExpression',
  15075. ConditionalExpression: 'ConditionalExpression',
  15076. ContinueStatement: 'ContinueStatement',
  15077. DoWhileStatement: 'DoWhileStatement',
  15078. DebuggerStatement: 'DebuggerStatement',
  15079. EmptyStatement: 'EmptyStatement',
  15080. ExportAllDeclaration: 'ExportAllDeclaration',
  15081. ExportDefaultDeclaration: 'ExportDefaultDeclaration',
  15082. ExportNamedDeclaration: 'ExportNamedDeclaration',
  15083. ExportSpecifier: 'ExportSpecifier',
  15084. ExpressionStatement: 'ExpressionStatement',
  15085. ForStatement: 'ForStatement',
  15086. ForOfStatement: 'ForOfStatement',
  15087. ForInStatement: 'ForInStatement',
  15088. FunctionDeclaration: 'FunctionDeclaration',
  15089. FunctionExpression: 'FunctionExpression',
  15090. Identifier: 'Identifier',
  15091. IfStatement: 'IfStatement',
  15092. ImportDeclaration: 'ImportDeclaration',
  15093. ImportDefaultSpecifier: 'ImportDefaultSpecifier',
  15094. ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
  15095. ImportSpecifier: 'ImportSpecifier',
  15096. Literal: 'Literal',
  15097. LabeledStatement: 'LabeledStatement',
  15098. LogicalExpression: 'LogicalExpression',
  15099. MemberExpression: 'MemberExpression',
  15100. MetaProperty: 'MetaProperty',
  15101. MethodDefinition: 'MethodDefinition',
  15102. NewExpression: 'NewExpression',
  15103. ObjectExpression: 'ObjectExpression',
  15104. ObjectPattern: 'ObjectPattern',
  15105. Program: 'Program',
  15106. Property: 'Property',
  15107. RestElement: 'RestElement',
  15108. ReturnStatement: 'ReturnStatement',
  15109. SequenceExpression: 'SequenceExpression',
  15110. SpreadElement: 'SpreadElement',
  15111. Super: 'Super',
  15112. SwitchCase: 'SwitchCase',
  15113. SwitchStatement: 'SwitchStatement',
  15114. TaggedTemplateExpression: 'TaggedTemplateExpression',
  15115. TemplateElement: 'TemplateElement',
  15116. TemplateLiteral: 'TemplateLiteral',
  15117. ThisExpression: 'ThisExpression',
  15118. ThrowStatement: 'ThrowStatement',
  15119. TryStatement: 'TryStatement',
  15120. UnaryExpression: 'UnaryExpression',
  15121. UpdateExpression: 'UpdateExpression',
  15122. VariableDeclaration: 'VariableDeclaration',
  15123. VariableDeclarator: 'VariableDeclarator',
  15124. WhileStatement: 'WhileStatement',
  15125. WithStatement: 'WithStatement',
  15126. YieldExpression: 'YieldExpression'
  15127. };
  15128. /***/ },
  15129. /* 3 */
  15130. /***/ function(module, exports, __webpack_require__) {
  15131. "use strict";
  15132. /* istanbul ignore next */
  15133. var __extends = (this && this.__extends) || (function () {
  15134. var extendStatics = Object.setPrototypeOf ||
  15135. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15136. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15137. return function (d, b) {
  15138. extendStatics(d, b);
  15139. function __() { this.constructor = d; }
  15140. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15141. };
  15142. })();
  15143. Object.defineProperty(exports, "__esModule", { value: true });
  15144. var character_1 = __webpack_require__(4);
  15145. var JSXNode = __webpack_require__(5);
  15146. var jsx_syntax_1 = __webpack_require__(6);
  15147. var Node = __webpack_require__(7);
  15148. var parser_1 = __webpack_require__(8);
  15149. var token_1 = __webpack_require__(13);
  15150. var xhtml_entities_1 = __webpack_require__(14);
  15151. token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
  15152. token_1.TokenName[101 /* Text */] = 'JSXText';
  15153. // Fully qualified element name, e.g. <svg:path> returns "svg:path"
  15154. function getQualifiedElementName(elementName) {
  15155. var qualifiedName;
  15156. switch (elementName.type) {
  15157. case jsx_syntax_1.JSXSyntax.JSXIdentifier:
  15158. var id = elementName;
  15159. qualifiedName = id.name;
  15160. break;
  15161. case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
  15162. var ns = elementName;
  15163. qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
  15164. getQualifiedElementName(ns.name);
  15165. break;
  15166. case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
  15167. var expr = elementName;
  15168. qualifiedName = getQualifiedElementName(expr.object) + '.' +
  15169. getQualifiedElementName(expr.property);
  15170. break;
  15171. /* istanbul ignore next */
  15172. default:
  15173. break;
  15174. }
  15175. return qualifiedName;
  15176. }
  15177. var JSXParser = (function (_super) {
  15178. __extends(JSXParser, _super);
  15179. function JSXParser(code, options, delegate) {
  15180. return _super.call(this, code, options, delegate) || this;
  15181. }
  15182. JSXParser.prototype.parsePrimaryExpression = function () {
  15183. return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
  15184. };
  15185. JSXParser.prototype.startJSX = function () {
  15186. // Unwind the scanner before the lookahead token.
  15187. this.scanner.index = this.startMarker.index;
  15188. this.scanner.lineNumber = this.startMarker.line;
  15189. this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
  15190. };
  15191. JSXParser.prototype.finishJSX = function () {
  15192. // Prime the next lookahead.
  15193. this.nextToken();
  15194. };
  15195. JSXParser.prototype.reenterJSX = function () {
  15196. this.startJSX();
  15197. this.expectJSX('}');
  15198. // Pop the closing '}' added from the lookahead.
  15199. if (this.config.tokens) {
  15200. this.tokens.pop();
  15201. }
  15202. };
  15203. JSXParser.prototype.createJSXNode = function () {
  15204. this.collectComments();
  15205. return {
  15206. index: this.scanner.index,
  15207. line: this.scanner.lineNumber,
  15208. column: this.scanner.index - this.scanner.lineStart
  15209. };
  15210. };
  15211. JSXParser.prototype.createJSXChildNode = function () {
  15212. return {
  15213. index: this.scanner.index,
  15214. line: this.scanner.lineNumber,
  15215. column: this.scanner.index - this.scanner.lineStart
  15216. };
  15217. };
  15218. JSXParser.prototype.scanXHTMLEntity = function (quote) {
  15219. var result = '&';
  15220. var valid = true;
  15221. var terminated = false;
  15222. var numeric = false;
  15223. var hex = false;
  15224. while (!this.scanner.eof() && valid && !terminated) {
  15225. var ch = this.scanner.source[this.scanner.index];
  15226. if (ch === quote) {
  15227. break;
  15228. }
  15229. terminated = (ch === ';');
  15230. result += ch;
  15231. ++this.scanner.index;
  15232. if (!terminated) {
  15233. switch (result.length) {
  15234. case 2:
  15235. // e.g. '&#123;'
  15236. numeric = (ch === '#');
  15237. break;
  15238. case 3:
  15239. if (numeric) {
  15240. // e.g. '&#x41;'
  15241. hex = (ch === 'x');
  15242. valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
  15243. numeric = numeric && !hex;
  15244. }
  15245. break;
  15246. default:
  15247. valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
  15248. valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
  15249. break;
  15250. }
  15251. }
  15252. }
  15253. if (valid && terminated && result.length > 2) {
  15254. // e.g. '&#x41;' becomes just '#x41'
  15255. var str = result.substr(1, result.length - 2);
  15256. if (numeric && str.length > 1) {
  15257. result = String.fromCharCode(parseInt(str.substr(1), 10));
  15258. }
  15259. else if (hex && str.length > 2) {
  15260. result = String.fromCharCode(parseInt('0' + str.substr(1), 16));
  15261. }
  15262. else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
  15263. result = xhtml_entities_1.XHTMLEntities[str];
  15264. }
  15265. }
  15266. return result;
  15267. };
  15268. // Scan the next JSX token. This replaces Scanner#lex when in JSX mode.
  15269. JSXParser.prototype.lexJSX = function () {
  15270. var cp = this.scanner.source.charCodeAt(this.scanner.index);
  15271. // < > / : = { }
  15272. if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
  15273. var value = this.scanner.source[this.scanner.index++];
  15274. return {
  15275. type: 7 /* Punctuator */,
  15276. value: value,
  15277. lineNumber: this.scanner.lineNumber,
  15278. lineStart: this.scanner.lineStart,
  15279. start: this.scanner.index - 1,
  15280. end: this.scanner.index
  15281. };
  15282. }
  15283. // " '
  15284. if (cp === 34 || cp === 39) {
  15285. var start = this.scanner.index;
  15286. var quote = this.scanner.source[this.scanner.index++];
  15287. var str = '';
  15288. while (!this.scanner.eof()) {
  15289. var ch = this.scanner.source[this.scanner.index++];
  15290. if (ch === quote) {
  15291. break;
  15292. }
  15293. else if (ch === '&') {
  15294. str += this.scanXHTMLEntity(quote);
  15295. }
  15296. else {
  15297. str += ch;
  15298. }
  15299. }
  15300. return {
  15301. type: 8 /* StringLiteral */,
  15302. value: str,
  15303. lineNumber: this.scanner.lineNumber,
  15304. lineStart: this.scanner.lineStart,
  15305. start: start,
  15306. end: this.scanner.index
  15307. };
  15308. }
  15309. // ... or .
  15310. if (cp === 46) {
  15311. var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
  15312. var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
  15313. var value = (n1 === 46 && n2 === 46) ? '...' : '.';
  15314. var start = this.scanner.index;
  15315. this.scanner.index += value.length;
  15316. return {
  15317. type: 7 /* Punctuator */,
  15318. value: value,
  15319. lineNumber: this.scanner.lineNumber,
  15320. lineStart: this.scanner.lineStart,
  15321. start: start,
  15322. end: this.scanner.index
  15323. };
  15324. }
  15325. // `
  15326. if (cp === 96) {
  15327. // Only placeholder, since it will be rescanned as a real assignment expression.
  15328. return {
  15329. type: 10 /* Template */,
  15330. value: '',
  15331. lineNumber: this.scanner.lineNumber,
  15332. lineStart: this.scanner.lineStart,
  15333. start: this.scanner.index,
  15334. end: this.scanner.index
  15335. };
  15336. }
  15337. // Identifer can not contain backslash (char code 92).
  15338. if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) {
  15339. var start = this.scanner.index;
  15340. ++this.scanner.index;
  15341. while (!this.scanner.eof()) {
  15342. var ch = this.scanner.source.charCodeAt(this.scanner.index);
  15343. if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) {
  15344. ++this.scanner.index;
  15345. }
  15346. else if (ch === 45) {
  15347. // Hyphen (char code 45) can be part of an identifier.
  15348. ++this.scanner.index;
  15349. }
  15350. else {
  15351. break;
  15352. }
  15353. }
  15354. var id = this.scanner.source.slice(start, this.scanner.index);
  15355. return {
  15356. type: 100 /* Identifier */,
  15357. value: id,
  15358. lineNumber: this.scanner.lineNumber,
  15359. lineStart: this.scanner.lineStart,
  15360. start: start,
  15361. end: this.scanner.index
  15362. };
  15363. }
  15364. return this.scanner.lex();
  15365. };
  15366. JSXParser.prototype.nextJSXToken = function () {
  15367. this.collectComments();
  15368. this.startMarker.index = this.scanner.index;
  15369. this.startMarker.line = this.scanner.lineNumber;
  15370. this.startMarker.column = this.scanner.index - this.scanner.lineStart;
  15371. var token = this.lexJSX();
  15372. this.lastMarker.index = this.scanner.index;
  15373. this.lastMarker.line = this.scanner.lineNumber;
  15374. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  15375. if (this.config.tokens) {
  15376. this.tokens.push(this.convertToken(token));
  15377. }
  15378. return token;
  15379. };
  15380. JSXParser.prototype.nextJSXText = function () {
  15381. this.startMarker.index = this.scanner.index;
  15382. this.startMarker.line = this.scanner.lineNumber;
  15383. this.startMarker.column = this.scanner.index - this.scanner.lineStart;
  15384. var start = this.scanner.index;
  15385. var text = '';
  15386. while (!this.scanner.eof()) {
  15387. var ch = this.scanner.source[this.scanner.index];
  15388. if (ch === '{' || ch === '<') {
  15389. break;
  15390. }
  15391. ++this.scanner.index;
  15392. text += ch;
  15393. if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  15394. ++this.scanner.lineNumber;
  15395. if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') {
  15396. ++this.scanner.index;
  15397. }
  15398. this.scanner.lineStart = this.scanner.index;
  15399. }
  15400. }
  15401. this.lastMarker.index = this.scanner.index;
  15402. this.lastMarker.line = this.scanner.lineNumber;
  15403. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  15404. var token = {
  15405. type: 101 /* Text */,
  15406. value: text,
  15407. lineNumber: this.scanner.lineNumber,
  15408. lineStart: this.scanner.lineStart,
  15409. start: start,
  15410. end: this.scanner.index
  15411. };
  15412. if ((text.length > 0) && this.config.tokens) {
  15413. this.tokens.push(this.convertToken(token));
  15414. }
  15415. return token;
  15416. };
  15417. JSXParser.prototype.peekJSXToken = function () {
  15418. var state = this.scanner.saveState();
  15419. this.scanner.scanComments();
  15420. var next = this.lexJSX();
  15421. this.scanner.restoreState(state);
  15422. return next;
  15423. };
  15424. // Expect the next JSX token to match the specified punctuator.
  15425. // If not, an exception will be thrown.
  15426. JSXParser.prototype.expectJSX = function (value) {
  15427. var token = this.nextJSXToken();
  15428. if (token.type !== 7 /* Punctuator */ || token.value !== value) {
  15429. this.throwUnexpectedToken(token);
  15430. }
  15431. };
  15432. // Return true if the next JSX token matches the specified punctuator.
  15433. JSXParser.prototype.matchJSX = function (value) {
  15434. var next = this.peekJSXToken();
  15435. return next.type === 7 /* Punctuator */ && next.value === value;
  15436. };
  15437. JSXParser.prototype.parseJSXIdentifier = function () {
  15438. var node = this.createJSXNode();
  15439. var token = this.nextJSXToken();
  15440. if (token.type !== 100 /* Identifier */) {
  15441. this.throwUnexpectedToken(token);
  15442. }
  15443. return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
  15444. };
  15445. JSXParser.prototype.parseJSXElementName = function () {
  15446. var node = this.createJSXNode();
  15447. var elementName = this.parseJSXIdentifier();
  15448. if (this.matchJSX(':')) {
  15449. var namespace = elementName;
  15450. this.expectJSX(':');
  15451. var name_1 = this.parseJSXIdentifier();
  15452. elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
  15453. }
  15454. else if (this.matchJSX('.')) {
  15455. while (this.matchJSX('.')) {
  15456. var object = elementName;
  15457. this.expectJSX('.');
  15458. var property = this.parseJSXIdentifier();
  15459. elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
  15460. }
  15461. }
  15462. return elementName;
  15463. };
  15464. JSXParser.prototype.parseJSXAttributeName = function () {
  15465. var node = this.createJSXNode();
  15466. var attributeName;
  15467. var identifier = this.parseJSXIdentifier();
  15468. if (this.matchJSX(':')) {
  15469. var namespace = identifier;
  15470. this.expectJSX(':');
  15471. var name_2 = this.parseJSXIdentifier();
  15472. attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
  15473. }
  15474. else {
  15475. attributeName = identifier;
  15476. }
  15477. return attributeName;
  15478. };
  15479. JSXParser.prototype.parseJSXStringLiteralAttribute = function () {
  15480. var node = this.createJSXNode();
  15481. var token = this.nextJSXToken();
  15482. if (token.type !== 8 /* StringLiteral */) {
  15483. this.throwUnexpectedToken(token);
  15484. }
  15485. var raw = this.getTokenRaw(token);
  15486. return this.finalize(node, new Node.Literal(token.value, raw));
  15487. };
  15488. JSXParser.prototype.parseJSXExpressionAttribute = function () {
  15489. var node = this.createJSXNode();
  15490. this.expectJSX('{');
  15491. this.finishJSX();
  15492. if (this.match('}')) {
  15493. this.tolerateError('JSX attributes must only be assigned a non-empty expression');
  15494. }
  15495. var expression = this.parseAssignmentExpression();
  15496. this.reenterJSX();
  15497. return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
  15498. };
  15499. JSXParser.prototype.parseJSXAttributeValue = function () {
  15500. return this.matchJSX('{') ? this.parseJSXExpressionAttribute() :
  15501. this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
  15502. };
  15503. JSXParser.prototype.parseJSXNameValueAttribute = function () {
  15504. var node = this.createJSXNode();
  15505. var name = this.parseJSXAttributeName();
  15506. var value = null;
  15507. if (this.matchJSX('=')) {
  15508. this.expectJSX('=');
  15509. value = this.parseJSXAttributeValue();
  15510. }
  15511. return this.finalize(node, new JSXNode.JSXAttribute(name, value));
  15512. };
  15513. JSXParser.prototype.parseJSXSpreadAttribute = function () {
  15514. var node = this.createJSXNode();
  15515. this.expectJSX('{');
  15516. this.expectJSX('...');
  15517. this.finishJSX();
  15518. var argument = this.parseAssignmentExpression();
  15519. this.reenterJSX();
  15520. return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
  15521. };
  15522. JSXParser.prototype.parseJSXAttributes = function () {
  15523. var attributes = [];
  15524. while (!this.matchJSX('/') && !this.matchJSX('>')) {
  15525. var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() :
  15526. this.parseJSXNameValueAttribute();
  15527. attributes.push(attribute);
  15528. }
  15529. return attributes;
  15530. };
  15531. JSXParser.prototype.parseJSXOpeningElement = function () {
  15532. var node = this.createJSXNode();
  15533. this.expectJSX('<');
  15534. var name = this.parseJSXElementName();
  15535. var attributes = this.parseJSXAttributes();
  15536. var selfClosing = this.matchJSX('/');
  15537. if (selfClosing) {
  15538. this.expectJSX('/');
  15539. }
  15540. this.expectJSX('>');
  15541. return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
  15542. };
  15543. JSXParser.prototype.parseJSXBoundaryElement = function () {
  15544. var node = this.createJSXNode();
  15545. this.expectJSX('<');
  15546. if (this.matchJSX('/')) {
  15547. this.expectJSX('/');
  15548. var name_3 = this.parseJSXElementName();
  15549. this.expectJSX('>');
  15550. return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
  15551. }
  15552. var name = this.parseJSXElementName();
  15553. var attributes = this.parseJSXAttributes();
  15554. var selfClosing = this.matchJSX('/');
  15555. if (selfClosing) {
  15556. this.expectJSX('/');
  15557. }
  15558. this.expectJSX('>');
  15559. return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
  15560. };
  15561. JSXParser.prototype.parseJSXEmptyExpression = function () {
  15562. var node = this.createJSXChildNode();
  15563. this.collectComments();
  15564. this.lastMarker.index = this.scanner.index;
  15565. this.lastMarker.line = this.scanner.lineNumber;
  15566. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  15567. return this.finalize(node, new JSXNode.JSXEmptyExpression());
  15568. };
  15569. JSXParser.prototype.parseJSXExpressionContainer = function () {
  15570. var node = this.createJSXNode();
  15571. this.expectJSX('{');
  15572. var expression;
  15573. if (this.matchJSX('}')) {
  15574. expression = this.parseJSXEmptyExpression();
  15575. this.expectJSX('}');
  15576. }
  15577. else {
  15578. this.finishJSX();
  15579. expression = this.parseAssignmentExpression();
  15580. this.reenterJSX();
  15581. }
  15582. return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
  15583. };
  15584. JSXParser.prototype.parseJSXChildren = function () {
  15585. var children = [];
  15586. while (!this.scanner.eof()) {
  15587. var node = this.createJSXChildNode();
  15588. var token = this.nextJSXText();
  15589. if (token.start < token.end) {
  15590. var raw = this.getTokenRaw(token);
  15591. var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
  15592. children.push(child);
  15593. }
  15594. if (this.scanner.source[this.scanner.index] === '{') {
  15595. var container = this.parseJSXExpressionContainer();
  15596. children.push(container);
  15597. }
  15598. else {
  15599. break;
  15600. }
  15601. }
  15602. return children;
  15603. };
  15604. JSXParser.prototype.parseComplexJSXElement = function (el) {
  15605. var stack = [];
  15606. while (!this.scanner.eof()) {
  15607. el.children = el.children.concat(this.parseJSXChildren());
  15608. var node = this.createJSXChildNode();
  15609. var element = this.parseJSXBoundaryElement();
  15610. if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
  15611. var opening = element;
  15612. if (opening.selfClosing) {
  15613. var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
  15614. el.children.push(child);
  15615. }
  15616. else {
  15617. stack.push(el);
  15618. el = { node: node, opening: opening, closing: null, children: [] };
  15619. }
  15620. }
  15621. if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
  15622. el.closing = element;
  15623. var open_1 = getQualifiedElementName(el.opening.name);
  15624. var close_1 = getQualifiedElementName(el.closing.name);
  15625. if (open_1 !== close_1) {
  15626. this.tolerateError('Expected corresponding JSX closing tag for %0', open_1);
  15627. }
  15628. if (stack.length > 0) {
  15629. var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
  15630. el = stack[stack.length - 1];
  15631. el.children.push(child);
  15632. stack.pop();
  15633. }
  15634. else {
  15635. break;
  15636. }
  15637. }
  15638. }
  15639. return el;
  15640. };
  15641. JSXParser.prototype.parseJSXElement = function () {
  15642. var node = this.createJSXNode();
  15643. var opening = this.parseJSXOpeningElement();
  15644. var children = [];
  15645. var closing = null;
  15646. if (!opening.selfClosing) {
  15647. var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children });
  15648. children = el.children;
  15649. closing = el.closing;
  15650. }
  15651. return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
  15652. };
  15653. JSXParser.prototype.parseJSXRoot = function () {
  15654. // Pop the opening '<' added from the lookahead.
  15655. if (this.config.tokens) {
  15656. this.tokens.pop();
  15657. }
  15658. this.startJSX();
  15659. var element = this.parseJSXElement();
  15660. this.finishJSX();
  15661. return element;
  15662. };
  15663. JSXParser.prototype.isStartOfExpression = function () {
  15664. return _super.prototype.isStartOfExpression.call(this) || this.match('<');
  15665. };
  15666. return JSXParser;
  15667. }(parser_1.Parser));
  15668. exports.JSXParser = JSXParser;
  15669. /***/ },
  15670. /* 4 */
  15671. /***/ function(module, exports) {
  15672. "use strict";
  15673. Object.defineProperty(exports, "__esModule", { value: true });
  15674. // See also tools/generate-unicode-regex.js.
  15675. var Regex = {
  15676. // Unicode v8.0.0 NonAsciiIdentifierStart:
  15677. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\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\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
  15678. // Unicode v8.0.0 NonAsciiIdentifierPart:
  15679. NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0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-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\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-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uAB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-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\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DDEF]/
  15680. };
  15681. exports.Character = {
  15682. /* tslint:disable:no-bitwise */
  15683. fromCodePoint: function (cp) {
  15684. return (cp < 0x10000) ? String.fromCharCode(cp) :
  15685. String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
  15686. String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
  15687. },
  15688. // https://tc39.github.io/ecma262/#sec-white-space
  15689. isWhiteSpace: function (cp) {
  15690. return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) ||
  15691. (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0);
  15692. },
  15693. // https://tc39.github.io/ecma262/#sec-line-terminators
  15694. isLineTerminator: function (cp) {
  15695. return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029);
  15696. },
  15697. // https://tc39.github.io/ecma262/#sec-names-and-keywords
  15698. isIdentifierStart: function (cp) {
  15699. return (cp === 0x24) || (cp === 0x5F) ||
  15700. (cp >= 0x41 && cp <= 0x5A) ||
  15701. (cp >= 0x61 && cp <= 0x7A) ||
  15702. (cp === 0x5C) ||
  15703. ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp)));
  15704. },
  15705. isIdentifierPart: function (cp) {
  15706. return (cp === 0x24) || (cp === 0x5F) ||
  15707. (cp >= 0x41 && cp <= 0x5A) ||
  15708. (cp >= 0x61 && cp <= 0x7A) ||
  15709. (cp >= 0x30 && cp <= 0x39) ||
  15710. (cp === 0x5C) ||
  15711. ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp)));
  15712. },
  15713. // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
  15714. isDecimalDigit: function (cp) {
  15715. return (cp >= 0x30 && cp <= 0x39); // 0..9
  15716. },
  15717. isHexDigit: function (cp) {
  15718. return (cp >= 0x30 && cp <= 0x39) ||
  15719. (cp >= 0x41 && cp <= 0x46) ||
  15720. (cp >= 0x61 && cp <= 0x66); // a..f
  15721. },
  15722. isOctalDigit: function (cp) {
  15723. return (cp >= 0x30 && cp <= 0x37); // 0..7
  15724. }
  15725. };
  15726. /***/ },
  15727. /* 5 */
  15728. /***/ function(module, exports, __webpack_require__) {
  15729. "use strict";
  15730. Object.defineProperty(exports, "__esModule", { value: true });
  15731. var jsx_syntax_1 = __webpack_require__(6);
  15732. /* tslint:disable:max-classes-per-file */
  15733. var JSXClosingElement = (function () {
  15734. function JSXClosingElement(name) {
  15735. this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
  15736. this.name = name;
  15737. }
  15738. return JSXClosingElement;
  15739. }());
  15740. exports.JSXClosingElement = JSXClosingElement;
  15741. var JSXElement = (function () {
  15742. function JSXElement(openingElement, children, closingElement) {
  15743. this.type = jsx_syntax_1.JSXSyntax.JSXElement;
  15744. this.openingElement = openingElement;
  15745. this.children = children;
  15746. this.closingElement = closingElement;
  15747. }
  15748. return JSXElement;
  15749. }());
  15750. exports.JSXElement = JSXElement;
  15751. var JSXEmptyExpression = (function () {
  15752. function JSXEmptyExpression() {
  15753. this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
  15754. }
  15755. return JSXEmptyExpression;
  15756. }());
  15757. exports.JSXEmptyExpression = JSXEmptyExpression;
  15758. var JSXExpressionContainer = (function () {
  15759. function JSXExpressionContainer(expression) {
  15760. this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
  15761. this.expression = expression;
  15762. }
  15763. return JSXExpressionContainer;
  15764. }());
  15765. exports.JSXExpressionContainer = JSXExpressionContainer;
  15766. var JSXIdentifier = (function () {
  15767. function JSXIdentifier(name) {
  15768. this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
  15769. this.name = name;
  15770. }
  15771. return JSXIdentifier;
  15772. }());
  15773. exports.JSXIdentifier = JSXIdentifier;
  15774. var JSXMemberExpression = (function () {
  15775. function JSXMemberExpression(object, property) {
  15776. this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
  15777. this.object = object;
  15778. this.property = property;
  15779. }
  15780. return JSXMemberExpression;
  15781. }());
  15782. exports.JSXMemberExpression = JSXMemberExpression;
  15783. var JSXAttribute = (function () {
  15784. function JSXAttribute(name, value) {
  15785. this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
  15786. this.name = name;
  15787. this.value = value;
  15788. }
  15789. return JSXAttribute;
  15790. }());
  15791. exports.JSXAttribute = JSXAttribute;
  15792. var JSXNamespacedName = (function () {
  15793. function JSXNamespacedName(namespace, name) {
  15794. this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
  15795. this.namespace = namespace;
  15796. this.name = name;
  15797. }
  15798. return JSXNamespacedName;
  15799. }());
  15800. exports.JSXNamespacedName = JSXNamespacedName;
  15801. var JSXOpeningElement = (function () {
  15802. function JSXOpeningElement(name, selfClosing, attributes) {
  15803. this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
  15804. this.name = name;
  15805. this.selfClosing = selfClosing;
  15806. this.attributes = attributes;
  15807. }
  15808. return JSXOpeningElement;
  15809. }());
  15810. exports.JSXOpeningElement = JSXOpeningElement;
  15811. var JSXSpreadAttribute = (function () {
  15812. function JSXSpreadAttribute(argument) {
  15813. this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
  15814. this.argument = argument;
  15815. }
  15816. return JSXSpreadAttribute;
  15817. }());
  15818. exports.JSXSpreadAttribute = JSXSpreadAttribute;
  15819. var JSXText = (function () {
  15820. function JSXText(value, raw) {
  15821. this.type = jsx_syntax_1.JSXSyntax.JSXText;
  15822. this.value = value;
  15823. this.raw = raw;
  15824. }
  15825. return JSXText;
  15826. }());
  15827. exports.JSXText = JSXText;
  15828. /***/ },
  15829. /* 6 */
  15830. /***/ function(module, exports) {
  15831. "use strict";
  15832. Object.defineProperty(exports, "__esModule", { value: true });
  15833. exports.JSXSyntax = {
  15834. JSXAttribute: 'JSXAttribute',
  15835. JSXClosingElement: 'JSXClosingElement',
  15836. JSXElement: 'JSXElement',
  15837. JSXEmptyExpression: 'JSXEmptyExpression',
  15838. JSXExpressionContainer: 'JSXExpressionContainer',
  15839. JSXIdentifier: 'JSXIdentifier',
  15840. JSXMemberExpression: 'JSXMemberExpression',
  15841. JSXNamespacedName: 'JSXNamespacedName',
  15842. JSXOpeningElement: 'JSXOpeningElement',
  15843. JSXSpreadAttribute: 'JSXSpreadAttribute',
  15844. JSXText: 'JSXText'
  15845. };
  15846. /***/ },
  15847. /* 7 */
  15848. /***/ function(module, exports, __webpack_require__) {
  15849. "use strict";
  15850. Object.defineProperty(exports, "__esModule", { value: true });
  15851. var syntax_1 = __webpack_require__(2);
  15852. /* tslint:disable:max-classes-per-file */
  15853. var ArrayExpression = (function () {
  15854. function ArrayExpression(elements) {
  15855. this.type = syntax_1.Syntax.ArrayExpression;
  15856. this.elements = elements;
  15857. }
  15858. return ArrayExpression;
  15859. }());
  15860. exports.ArrayExpression = ArrayExpression;
  15861. var ArrayPattern = (function () {
  15862. function ArrayPattern(elements) {
  15863. this.type = syntax_1.Syntax.ArrayPattern;
  15864. this.elements = elements;
  15865. }
  15866. return ArrayPattern;
  15867. }());
  15868. exports.ArrayPattern = ArrayPattern;
  15869. var ArrowFunctionExpression = (function () {
  15870. function ArrowFunctionExpression(params, body, expression) {
  15871. this.type = syntax_1.Syntax.ArrowFunctionExpression;
  15872. this.id = null;
  15873. this.params = params;
  15874. this.body = body;
  15875. this.generator = false;
  15876. this.expression = expression;
  15877. this.async = false;
  15878. }
  15879. return ArrowFunctionExpression;
  15880. }());
  15881. exports.ArrowFunctionExpression = ArrowFunctionExpression;
  15882. var AssignmentExpression = (function () {
  15883. function AssignmentExpression(operator, left, right) {
  15884. this.type = syntax_1.Syntax.AssignmentExpression;
  15885. this.operator = operator;
  15886. this.left = left;
  15887. this.right = right;
  15888. }
  15889. return AssignmentExpression;
  15890. }());
  15891. exports.AssignmentExpression = AssignmentExpression;
  15892. var AssignmentPattern = (function () {
  15893. function AssignmentPattern(left, right) {
  15894. this.type = syntax_1.Syntax.AssignmentPattern;
  15895. this.left = left;
  15896. this.right = right;
  15897. }
  15898. return AssignmentPattern;
  15899. }());
  15900. exports.AssignmentPattern = AssignmentPattern;
  15901. var AsyncArrowFunctionExpression = (function () {
  15902. function AsyncArrowFunctionExpression(params, body, expression) {
  15903. this.type = syntax_1.Syntax.ArrowFunctionExpression;
  15904. this.id = null;
  15905. this.params = params;
  15906. this.body = body;
  15907. this.generator = false;
  15908. this.expression = expression;
  15909. this.async = true;
  15910. }
  15911. return AsyncArrowFunctionExpression;
  15912. }());
  15913. exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
  15914. var AsyncFunctionDeclaration = (function () {
  15915. function AsyncFunctionDeclaration(id, params, body) {
  15916. this.type = syntax_1.Syntax.FunctionDeclaration;
  15917. this.id = id;
  15918. this.params = params;
  15919. this.body = body;
  15920. this.generator = false;
  15921. this.expression = false;
  15922. this.async = true;
  15923. }
  15924. return AsyncFunctionDeclaration;
  15925. }());
  15926. exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
  15927. var AsyncFunctionExpression = (function () {
  15928. function AsyncFunctionExpression(id, params, body) {
  15929. this.type = syntax_1.Syntax.FunctionExpression;
  15930. this.id = id;
  15931. this.params = params;
  15932. this.body = body;
  15933. this.generator = false;
  15934. this.expression = false;
  15935. this.async = true;
  15936. }
  15937. return AsyncFunctionExpression;
  15938. }());
  15939. exports.AsyncFunctionExpression = AsyncFunctionExpression;
  15940. var AwaitExpression = (function () {
  15941. function AwaitExpression(argument) {
  15942. this.type = syntax_1.Syntax.AwaitExpression;
  15943. this.argument = argument;
  15944. }
  15945. return AwaitExpression;
  15946. }());
  15947. exports.AwaitExpression = AwaitExpression;
  15948. var BinaryExpression = (function () {
  15949. function BinaryExpression(operator, left, right) {
  15950. var logical = (operator === '||' || operator === '&&');
  15951. this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
  15952. this.operator = operator;
  15953. this.left = left;
  15954. this.right = right;
  15955. }
  15956. return BinaryExpression;
  15957. }());
  15958. exports.BinaryExpression = BinaryExpression;
  15959. var BlockStatement = (function () {
  15960. function BlockStatement(body) {
  15961. this.type = syntax_1.Syntax.BlockStatement;
  15962. this.body = body;
  15963. }
  15964. return BlockStatement;
  15965. }());
  15966. exports.BlockStatement = BlockStatement;
  15967. var BreakStatement = (function () {
  15968. function BreakStatement(label) {
  15969. this.type = syntax_1.Syntax.BreakStatement;
  15970. this.label = label;
  15971. }
  15972. return BreakStatement;
  15973. }());
  15974. exports.BreakStatement = BreakStatement;
  15975. var CallExpression = (function () {
  15976. function CallExpression(callee, args) {
  15977. this.type = syntax_1.Syntax.CallExpression;
  15978. this.callee = callee;
  15979. this.arguments = args;
  15980. }
  15981. return CallExpression;
  15982. }());
  15983. exports.CallExpression = CallExpression;
  15984. var CatchClause = (function () {
  15985. function CatchClause(param, body) {
  15986. this.type = syntax_1.Syntax.CatchClause;
  15987. this.param = param;
  15988. this.body = body;
  15989. }
  15990. return CatchClause;
  15991. }());
  15992. exports.CatchClause = CatchClause;
  15993. var ClassBody = (function () {
  15994. function ClassBody(body) {
  15995. this.type = syntax_1.Syntax.ClassBody;
  15996. this.body = body;
  15997. }
  15998. return ClassBody;
  15999. }());
  16000. exports.ClassBody = ClassBody;
  16001. var ClassDeclaration = (function () {
  16002. function ClassDeclaration(id, superClass, body) {
  16003. this.type = syntax_1.Syntax.ClassDeclaration;
  16004. this.id = id;
  16005. this.superClass = superClass;
  16006. this.body = body;
  16007. }
  16008. return ClassDeclaration;
  16009. }());
  16010. exports.ClassDeclaration = ClassDeclaration;
  16011. var ClassExpression = (function () {
  16012. function ClassExpression(id, superClass, body) {
  16013. this.type = syntax_1.Syntax.ClassExpression;
  16014. this.id = id;
  16015. this.superClass = superClass;
  16016. this.body = body;
  16017. }
  16018. return ClassExpression;
  16019. }());
  16020. exports.ClassExpression = ClassExpression;
  16021. var ComputedMemberExpression = (function () {
  16022. function ComputedMemberExpression(object, property) {
  16023. this.type = syntax_1.Syntax.MemberExpression;
  16024. this.computed = true;
  16025. this.object = object;
  16026. this.property = property;
  16027. }
  16028. return ComputedMemberExpression;
  16029. }());
  16030. exports.ComputedMemberExpression = ComputedMemberExpression;
  16031. var ConditionalExpression = (function () {
  16032. function ConditionalExpression(test, consequent, alternate) {
  16033. this.type = syntax_1.Syntax.ConditionalExpression;
  16034. this.test = test;
  16035. this.consequent = consequent;
  16036. this.alternate = alternate;
  16037. }
  16038. return ConditionalExpression;
  16039. }());
  16040. exports.ConditionalExpression = ConditionalExpression;
  16041. var ContinueStatement = (function () {
  16042. function ContinueStatement(label) {
  16043. this.type = syntax_1.Syntax.ContinueStatement;
  16044. this.label = label;
  16045. }
  16046. return ContinueStatement;
  16047. }());
  16048. exports.ContinueStatement = ContinueStatement;
  16049. var DebuggerStatement = (function () {
  16050. function DebuggerStatement() {
  16051. this.type = syntax_1.Syntax.DebuggerStatement;
  16052. }
  16053. return DebuggerStatement;
  16054. }());
  16055. exports.DebuggerStatement = DebuggerStatement;
  16056. var Directive = (function () {
  16057. function Directive(expression, directive) {
  16058. this.type = syntax_1.Syntax.ExpressionStatement;
  16059. this.expression = expression;
  16060. this.directive = directive;
  16061. }
  16062. return Directive;
  16063. }());
  16064. exports.Directive = Directive;
  16065. var DoWhileStatement = (function () {
  16066. function DoWhileStatement(body, test) {
  16067. this.type = syntax_1.Syntax.DoWhileStatement;
  16068. this.body = body;
  16069. this.test = test;
  16070. }
  16071. return DoWhileStatement;
  16072. }());
  16073. exports.DoWhileStatement = DoWhileStatement;
  16074. var EmptyStatement = (function () {
  16075. function EmptyStatement() {
  16076. this.type = syntax_1.Syntax.EmptyStatement;
  16077. }
  16078. return EmptyStatement;
  16079. }());
  16080. exports.EmptyStatement = EmptyStatement;
  16081. var ExportAllDeclaration = (function () {
  16082. function ExportAllDeclaration(source) {
  16083. this.type = syntax_1.Syntax.ExportAllDeclaration;
  16084. this.source = source;
  16085. }
  16086. return ExportAllDeclaration;
  16087. }());
  16088. exports.ExportAllDeclaration = ExportAllDeclaration;
  16089. var ExportDefaultDeclaration = (function () {
  16090. function ExportDefaultDeclaration(declaration) {
  16091. this.type = syntax_1.Syntax.ExportDefaultDeclaration;
  16092. this.declaration = declaration;
  16093. }
  16094. return ExportDefaultDeclaration;
  16095. }());
  16096. exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
  16097. var ExportNamedDeclaration = (function () {
  16098. function ExportNamedDeclaration(declaration, specifiers, source) {
  16099. this.type = syntax_1.Syntax.ExportNamedDeclaration;
  16100. this.declaration = declaration;
  16101. this.specifiers = specifiers;
  16102. this.source = source;
  16103. }
  16104. return ExportNamedDeclaration;
  16105. }());
  16106. exports.ExportNamedDeclaration = ExportNamedDeclaration;
  16107. var ExportSpecifier = (function () {
  16108. function ExportSpecifier(local, exported) {
  16109. this.type = syntax_1.Syntax.ExportSpecifier;
  16110. this.exported = exported;
  16111. this.local = local;
  16112. }
  16113. return ExportSpecifier;
  16114. }());
  16115. exports.ExportSpecifier = ExportSpecifier;
  16116. var ExpressionStatement = (function () {
  16117. function ExpressionStatement(expression) {
  16118. this.type = syntax_1.Syntax.ExpressionStatement;
  16119. this.expression = expression;
  16120. }
  16121. return ExpressionStatement;
  16122. }());
  16123. exports.ExpressionStatement = ExpressionStatement;
  16124. var ForInStatement = (function () {
  16125. function ForInStatement(left, right, body) {
  16126. this.type = syntax_1.Syntax.ForInStatement;
  16127. this.left = left;
  16128. this.right = right;
  16129. this.body = body;
  16130. this.each = false;
  16131. }
  16132. return ForInStatement;
  16133. }());
  16134. exports.ForInStatement = ForInStatement;
  16135. var ForOfStatement = (function () {
  16136. function ForOfStatement(left, right, body) {
  16137. this.type = syntax_1.Syntax.ForOfStatement;
  16138. this.left = left;
  16139. this.right = right;
  16140. this.body = body;
  16141. }
  16142. return ForOfStatement;
  16143. }());
  16144. exports.ForOfStatement = ForOfStatement;
  16145. var ForStatement = (function () {
  16146. function ForStatement(init, test, update, body) {
  16147. this.type = syntax_1.Syntax.ForStatement;
  16148. this.init = init;
  16149. this.test = test;
  16150. this.update = update;
  16151. this.body = body;
  16152. }
  16153. return ForStatement;
  16154. }());
  16155. exports.ForStatement = ForStatement;
  16156. var FunctionDeclaration = (function () {
  16157. function FunctionDeclaration(id, params, body, generator) {
  16158. this.type = syntax_1.Syntax.FunctionDeclaration;
  16159. this.id = id;
  16160. this.params = params;
  16161. this.body = body;
  16162. this.generator = generator;
  16163. this.expression = false;
  16164. this.async = false;
  16165. }
  16166. return FunctionDeclaration;
  16167. }());
  16168. exports.FunctionDeclaration = FunctionDeclaration;
  16169. var FunctionExpression = (function () {
  16170. function FunctionExpression(id, params, body, generator) {
  16171. this.type = syntax_1.Syntax.FunctionExpression;
  16172. this.id = id;
  16173. this.params = params;
  16174. this.body = body;
  16175. this.generator = generator;
  16176. this.expression = false;
  16177. this.async = false;
  16178. }
  16179. return FunctionExpression;
  16180. }());
  16181. exports.FunctionExpression = FunctionExpression;
  16182. var Identifier = (function () {
  16183. function Identifier(name) {
  16184. this.type = syntax_1.Syntax.Identifier;
  16185. this.name = name;
  16186. }
  16187. return Identifier;
  16188. }());
  16189. exports.Identifier = Identifier;
  16190. var IfStatement = (function () {
  16191. function IfStatement(test, consequent, alternate) {
  16192. this.type = syntax_1.Syntax.IfStatement;
  16193. this.test = test;
  16194. this.consequent = consequent;
  16195. this.alternate = alternate;
  16196. }
  16197. return IfStatement;
  16198. }());
  16199. exports.IfStatement = IfStatement;
  16200. var ImportDeclaration = (function () {
  16201. function ImportDeclaration(specifiers, source) {
  16202. this.type = syntax_1.Syntax.ImportDeclaration;
  16203. this.specifiers = specifiers;
  16204. this.source = source;
  16205. }
  16206. return ImportDeclaration;
  16207. }());
  16208. exports.ImportDeclaration = ImportDeclaration;
  16209. var ImportDefaultSpecifier = (function () {
  16210. function ImportDefaultSpecifier(local) {
  16211. this.type = syntax_1.Syntax.ImportDefaultSpecifier;
  16212. this.local = local;
  16213. }
  16214. return ImportDefaultSpecifier;
  16215. }());
  16216. exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
  16217. var ImportNamespaceSpecifier = (function () {
  16218. function ImportNamespaceSpecifier(local) {
  16219. this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
  16220. this.local = local;
  16221. }
  16222. return ImportNamespaceSpecifier;
  16223. }());
  16224. exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
  16225. var ImportSpecifier = (function () {
  16226. function ImportSpecifier(local, imported) {
  16227. this.type = syntax_1.Syntax.ImportSpecifier;
  16228. this.local = local;
  16229. this.imported = imported;
  16230. }
  16231. return ImportSpecifier;
  16232. }());
  16233. exports.ImportSpecifier = ImportSpecifier;
  16234. var LabeledStatement = (function () {
  16235. function LabeledStatement(label, body) {
  16236. this.type = syntax_1.Syntax.LabeledStatement;
  16237. this.label = label;
  16238. this.body = body;
  16239. }
  16240. return LabeledStatement;
  16241. }());
  16242. exports.LabeledStatement = LabeledStatement;
  16243. var Literal = (function () {
  16244. function Literal(value, raw) {
  16245. this.type = syntax_1.Syntax.Literal;
  16246. this.value = value;
  16247. this.raw = raw;
  16248. }
  16249. return Literal;
  16250. }());
  16251. exports.Literal = Literal;
  16252. var MetaProperty = (function () {
  16253. function MetaProperty(meta, property) {
  16254. this.type = syntax_1.Syntax.MetaProperty;
  16255. this.meta = meta;
  16256. this.property = property;
  16257. }
  16258. return MetaProperty;
  16259. }());
  16260. exports.MetaProperty = MetaProperty;
  16261. var MethodDefinition = (function () {
  16262. function MethodDefinition(key, computed, value, kind, isStatic) {
  16263. this.type = syntax_1.Syntax.MethodDefinition;
  16264. this.key = key;
  16265. this.computed = computed;
  16266. this.value = value;
  16267. this.kind = kind;
  16268. this.static = isStatic;
  16269. }
  16270. return MethodDefinition;
  16271. }());
  16272. exports.MethodDefinition = MethodDefinition;
  16273. var Module = (function () {
  16274. function Module(body) {
  16275. this.type = syntax_1.Syntax.Program;
  16276. this.body = body;
  16277. this.sourceType = 'module';
  16278. }
  16279. return Module;
  16280. }());
  16281. exports.Module = Module;
  16282. var NewExpression = (function () {
  16283. function NewExpression(callee, args) {
  16284. this.type = syntax_1.Syntax.NewExpression;
  16285. this.callee = callee;
  16286. this.arguments = args;
  16287. }
  16288. return NewExpression;
  16289. }());
  16290. exports.NewExpression = NewExpression;
  16291. var ObjectExpression = (function () {
  16292. function ObjectExpression(properties) {
  16293. this.type = syntax_1.Syntax.ObjectExpression;
  16294. this.properties = properties;
  16295. }
  16296. return ObjectExpression;
  16297. }());
  16298. exports.ObjectExpression = ObjectExpression;
  16299. var ObjectPattern = (function () {
  16300. function ObjectPattern(properties) {
  16301. this.type = syntax_1.Syntax.ObjectPattern;
  16302. this.properties = properties;
  16303. }
  16304. return ObjectPattern;
  16305. }());
  16306. exports.ObjectPattern = ObjectPattern;
  16307. var Property = (function () {
  16308. function Property(kind, key, computed, value, method, shorthand) {
  16309. this.type = syntax_1.Syntax.Property;
  16310. this.key = key;
  16311. this.computed = computed;
  16312. this.value = value;
  16313. this.kind = kind;
  16314. this.method = method;
  16315. this.shorthand = shorthand;
  16316. }
  16317. return Property;
  16318. }());
  16319. exports.Property = Property;
  16320. var RegexLiteral = (function () {
  16321. function RegexLiteral(value, raw, pattern, flags) {
  16322. this.type = syntax_1.Syntax.Literal;
  16323. this.value = value;
  16324. this.raw = raw;
  16325. this.regex = { pattern: pattern, flags: flags };
  16326. }
  16327. return RegexLiteral;
  16328. }());
  16329. exports.RegexLiteral = RegexLiteral;
  16330. var RestElement = (function () {
  16331. function RestElement(argument) {
  16332. this.type = syntax_1.Syntax.RestElement;
  16333. this.argument = argument;
  16334. }
  16335. return RestElement;
  16336. }());
  16337. exports.RestElement = RestElement;
  16338. var ReturnStatement = (function () {
  16339. function ReturnStatement(argument) {
  16340. this.type = syntax_1.Syntax.ReturnStatement;
  16341. this.argument = argument;
  16342. }
  16343. return ReturnStatement;
  16344. }());
  16345. exports.ReturnStatement = ReturnStatement;
  16346. var Script = (function () {
  16347. function Script(body) {
  16348. this.type = syntax_1.Syntax.Program;
  16349. this.body = body;
  16350. this.sourceType = 'script';
  16351. }
  16352. return Script;
  16353. }());
  16354. exports.Script = Script;
  16355. var SequenceExpression = (function () {
  16356. function SequenceExpression(expressions) {
  16357. this.type = syntax_1.Syntax.SequenceExpression;
  16358. this.expressions = expressions;
  16359. }
  16360. return SequenceExpression;
  16361. }());
  16362. exports.SequenceExpression = SequenceExpression;
  16363. var SpreadElement = (function () {
  16364. function SpreadElement(argument) {
  16365. this.type = syntax_1.Syntax.SpreadElement;
  16366. this.argument = argument;
  16367. }
  16368. return SpreadElement;
  16369. }());
  16370. exports.SpreadElement = SpreadElement;
  16371. var StaticMemberExpression = (function () {
  16372. function StaticMemberExpression(object, property) {
  16373. this.type = syntax_1.Syntax.MemberExpression;
  16374. this.computed = false;
  16375. this.object = object;
  16376. this.property = property;
  16377. }
  16378. return StaticMemberExpression;
  16379. }());
  16380. exports.StaticMemberExpression = StaticMemberExpression;
  16381. var Super = (function () {
  16382. function Super() {
  16383. this.type = syntax_1.Syntax.Super;
  16384. }
  16385. return Super;
  16386. }());
  16387. exports.Super = Super;
  16388. var SwitchCase = (function () {
  16389. function SwitchCase(test, consequent) {
  16390. this.type = syntax_1.Syntax.SwitchCase;
  16391. this.test = test;
  16392. this.consequent = consequent;
  16393. }
  16394. return SwitchCase;
  16395. }());
  16396. exports.SwitchCase = SwitchCase;
  16397. var SwitchStatement = (function () {
  16398. function SwitchStatement(discriminant, cases) {
  16399. this.type = syntax_1.Syntax.SwitchStatement;
  16400. this.discriminant = discriminant;
  16401. this.cases = cases;
  16402. }
  16403. return SwitchStatement;
  16404. }());
  16405. exports.SwitchStatement = SwitchStatement;
  16406. var TaggedTemplateExpression = (function () {
  16407. function TaggedTemplateExpression(tag, quasi) {
  16408. this.type = syntax_1.Syntax.TaggedTemplateExpression;
  16409. this.tag = tag;
  16410. this.quasi = quasi;
  16411. }
  16412. return TaggedTemplateExpression;
  16413. }());
  16414. exports.TaggedTemplateExpression = TaggedTemplateExpression;
  16415. var TemplateElement = (function () {
  16416. function TemplateElement(value, tail) {
  16417. this.type = syntax_1.Syntax.TemplateElement;
  16418. this.value = value;
  16419. this.tail = tail;
  16420. }
  16421. return TemplateElement;
  16422. }());
  16423. exports.TemplateElement = TemplateElement;
  16424. var TemplateLiteral = (function () {
  16425. function TemplateLiteral(quasis, expressions) {
  16426. this.type = syntax_1.Syntax.TemplateLiteral;
  16427. this.quasis = quasis;
  16428. this.expressions = expressions;
  16429. }
  16430. return TemplateLiteral;
  16431. }());
  16432. exports.TemplateLiteral = TemplateLiteral;
  16433. var ThisExpression = (function () {
  16434. function ThisExpression() {
  16435. this.type = syntax_1.Syntax.ThisExpression;
  16436. }
  16437. return ThisExpression;
  16438. }());
  16439. exports.ThisExpression = ThisExpression;
  16440. var ThrowStatement = (function () {
  16441. function ThrowStatement(argument) {
  16442. this.type = syntax_1.Syntax.ThrowStatement;
  16443. this.argument = argument;
  16444. }
  16445. return ThrowStatement;
  16446. }());
  16447. exports.ThrowStatement = ThrowStatement;
  16448. var TryStatement = (function () {
  16449. function TryStatement(block, handler, finalizer) {
  16450. this.type = syntax_1.Syntax.TryStatement;
  16451. this.block = block;
  16452. this.handler = handler;
  16453. this.finalizer = finalizer;
  16454. }
  16455. return TryStatement;
  16456. }());
  16457. exports.TryStatement = TryStatement;
  16458. var UnaryExpression = (function () {
  16459. function UnaryExpression(operator, argument) {
  16460. this.type = syntax_1.Syntax.UnaryExpression;
  16461. this.operator = operator;
  16462. this.argument = argument;
  16463. this.prefix = true;
  16464. }
  16465. return UnaryExpression;
  16466. }());
  16467. exports.UnaryExpression = UnaryExpression;
  16468. var UpdateExpression = (function () {
  16469. function UpdateExpression(operator, argument, prefix) {
  16470. this.type = syntax_1.Syntax.UpdateExpression;
  16471. this.operator = operator;
  16472. this.argument = argument;
  16473. this.prefix = prefix;
  16474. }
  16475. return UpdateExpression;
  16476. }());
  16477. exports.UpdateExpression = UpdateExpression;
  16478. var VariableDeclaration = (function () {
  16479. function VariableDeclaration(declarations, kind) {
  16480. this.type = syntax_1.Syntax.VariableDeclaration;
  16481. this.declarations = declarations;
  16482. this.kind = kind;
  16483. }
  16484. return VariableDeclaration;
  16485. }());
  16486. exports.VariableDeclaration = VariableDeclaration;
  16487. var VariableDeclarator = (function () {
  16488. function VariableDeclarator(id, init) {
  16489. this.type = syntax_1.Syntax.VariableDeclarator;
  16490. this.id = id;
  16491. this.init = init;
  16492. }
  16493. return VariableDeclarator;
  16494. }());
  16495. exports.VariableDeclarator = VariableDeclarator;
  16496. var WhileStatement = (function () {
  16497. function WhileStatement(test, body) {
  16498. this.type = syntax_1.Syntax.WhileStatement;
  16499. this.test = test;
  16500. this.body = body;
  16501. }
  16502. return WhileStatement;
  16503. }());
  16504. exports.WhileStatement = WhileStatement;
  16505. var WithStatement = (function () {
  16506. function WithStatement(object, body) {
  16507. this.type = syntax_1.Syntax.WithStatement;
  16508. this.object = object;
  16509. this.body = body;
  16510. }
  16511. return WithStatement;
  16512. }());
  16513. exports.WithStatement = WithStatement;
  16514. var YieldExpression = (function () {
  16515. function YieldExpression(argument, delegate) {
  16516. this.type = syntax_1.Syntax.YieldExpression;
  16517. this.argument = argument;
  16518. this.delegate = delegate;
  16519. }
  16520. return YieldExpression;
  16521. }());
  16522. exports.YieldExpression = YieldExpression;
  16523. /***/ },
  16524. /* 8 */
  16525. /***/ function(module, exports, __webpack_require__) {
  16526. "use strict";
  16527. Object.defineProperty(exports, "__esModule", { value: true });
  16528. var assert_1 = __webpack_require__(9);
  16529. var error_handler_1 = __webpack_require__(10);
  16530. var messages_1 = __webpack_require__(11);
  16531. var Node = __webpack_require__(7);
  16532. var scanner_1 = __webpack_require__(12);
  16533. var syntax_1 = __webpack_require__(2);
  16534. var token_1 = __webpack_require__(13);
  16535. var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
  16536. var Parser = (function () {
  16537. function Parser(code, options, delegate) {
  16538. if (options === void 0) { options = {}; }
  16539. this.config = {
  16540. range: (typeof options.range === 'boolean') && options.range,
  16541. loc: (typeof options.loc === 'boolean') && options.loc,
  16542. source: null,
  16543. tokens: (typeof options.tokens === 'boolean') && options.tokens,
  16544. comment: (typeof options.comment === 'boolean') && options.comment,
  16545. tolerant: (typeof options.tolerant === 'boolean') && options.tolerant
  16546. };
  16547. if (this.config.loc && options.source && options.source !== null) {
  16548. this.config.source = String(options.source);
  16549. }
  16550. this.delegate = delegate;
  16551. this.errorHandler = new error_handler_1.ErrorHandler();
  16552. this.errorHandler.tolerant = this.config.tolerant;
  16553. this.scanner = new scanner_1.Scanner(code, this.errorHandler);
  16554. this.scanner.trackComment = this.config.comment;
  16555. this.operatorPrecedence = {
  16556. ')': 0,
  16557. ';': 0,
  16558. ',': 0,
  16559. '=': 0,
  16560. ']': 0,
  16561. '||': 1,
  16562. '&&': 2,
  16563. '|': 3,
  16564. '^': 4,
  16565. '&': 5,
  16566. '==': 6,
  16567. '!=': 6,
  16568. '===': 6,
  16569. '!==': 6,
  16570. '<': 7,
  16571. '>': 7,
  16572. '<=': 7,
  16573. '>=': 7,
  16574. '<<': 8,
  16575. '>>': 8,
  16576. '>>>': 8,
  16577. '+': 9,
  16578. '-': 9,
  16579. '*': 11,
  16580. '/': 11,
  16581. '%': 11
  16582. };
  16583. this.lookahead = {
  16584. type: 2 /* EOF */,
  16585. value: '',
  16586. lineNumber: this.scanner.lineNumber,
  16587. lineStart: 0,
  16588. start: 0,
  16589. end: 0
  16590. };
  16591. this.hasLineTerminator = false;
  16592. this.context = {
  16593. isModule: false,
  16594. await: false,
  16595. allowIn: true,
  16596. allowStrictDirective: true,
  16597. allowYield: true,
  16598. firstCoverInitializedNameError: null,
  16599. isAssignmentTarget: false,
  16600. isBindingElement: false,
  16601. inFunctionBody: false,
  16602. inIteration: false,
  16603. inSwitch: false,
  16604. labelSet: {},
  16605. strict: false
  16606. };
  16607. this.tokens = [];
  16608. this.startMarker = {
  16609. index: 0,
  16610. line: this.scanner.lineNumber,
  16611. column: 0
  16612. };
  16613. this.lastMarker = {
  16614. index: 0,
  16615. line: this.scanner.lineNumber,
  16616. column: 0
  16617. };
  16618. this.nextToken();
  16619. this.lastMarker = {
  16620. index: this.scanner.index,
  16621. line: this.scanner.lineNumber,
  16622. column: this.scanner.index - this.scanner.lineStart
  16623. };
  16624. }
  16625. Parser.prototype.throwError = function (messageFormat) {
  16626. var values = [];
  16627. for (var _i = 1; _i < arguments.length; _i++) {
  16628. values[_i - 1] = arguments[_i];
  16629. }
  16630. var args = Array.prototype.slice.call(arguments, 1);
  16631. var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
  16632. assert_1.assert(idx < args.length, 'Message reference must be in range');
  16633. return args[idx];
  16634. });
  16635. var index = this.lastMarker.index;
  16636. var line = this.lastMarker.line;
  16637. var column = this.lastMarker.column + 1;
  16638. throw this.errorHandler.createError(index, line, column, msg);
  16639. };
  16640. Parser.prototype.tolerateError = function (messageFormat) {
  16641. var values = [];
  16642. for (var _i = 1; _i < arguments.length; _i++) {
  16643. values[_i - 1] = arguments[_i];
  16644. }
  16645. var args = Array.prototype.slice.call(arguments, 1);
  16646. var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
  16647. assert_1.assert(idx < args.length, 'Message reference must be in range');
  16648. return args[idx];
  16649. });
  16650. var index = this.lastMarker.index;
  16651. var line = this.scanner.lineNumber;
  16652. var column = this.lastMarker.column + 1;
  16653. this.errorHandler.tolerateError(index, line, column, msg);
  16654. };
  16655. // Throw an exception because of the token.
  16656. Parser.prototype.unexpectedTokenError = function (token, message) {
  16657. var msg = message || messages_1.Messages.UnexpectedToken;
  16658. var value;
  16659. if (token) {
  16660. if (!message) {
  16661. msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS :
  16662. (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier :
  16663. (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber :
  16664. (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString :
  16665. (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate :
  16666. messages_1.Messages.UnexpectedToken;
  16667. if (token.type === 4 /* Keyword */) {
  16668. if (this.scanner.isFutureReservedWord(token.value)) {
  16669. msg = messages_1.Messages.UnexpectedReserved;
  16670. }
  16671. else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
  16672. msg = messages_1.Messages.StrictReservedWord;
  16673. }
  16674. }
  16675. }
  16676. value = token.value;
  16677. }
  16678. else {
  16679. value = 'ILLEGAL';
  16680. }
  16681. msg = msg.replace('%0', value);
  16682. if (token && typeof token.lineNumber === 'number') {
  16683. var index = token.start;
  16684. var line = token.lineNumber;
  16685. var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
  16686. var column = token.start - lastMarkerLineStart + 1;
  16687. return this.errorHandler.createError(index, line, column, msg);
  16688. }
  16689. else {
  16690. var index = this.lastMarker.index;
  16691. var line = this.lastMarker.line;
  16692. var column = this.lastMarker.column + 1;
  16693. return this.errorHandler.createError(index, line, column, msg);
  16694. }
  16695. };
  16696. Parser.prototype.throwUnexpectedToken = function (token, message) {
  16697. throw this.unexpectedTokenError(token, message);
  16698. };
  16699. Parser.prototype.tolerateUnexpectedToken = function (token, message) {
  16700. this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
  16701. };
  16702. Parser.prototype.collectComments = function () {
  16703. if (!this.config.comment) {
  16704. this.scanner.scanComments();
  16705. }
  16706. else {
  16707. var comments = this.scanner.scanComments();
  16708. if (comments.length > 0 && this.delegate) {
  16709. for (var i = 0; i < comments.length; ++i) {
  16710. var e = comments[i];
  16711. var node = void 0;
  16712. node = {
  16713. type: e.multiLine ? 'BlockComment' : 'LineComment',
  16714. value: this.scanner.source.slice(e.slice[0], e.slice[1])
  16715. };
  16716. if (this.config.range) {
  16717. node.range = e.range;
  16718. }
  16719. if (this.config.loc) {
  16720. node.loc = e.loc;
  16721. }
  16722. var metadata = {
  16723. start: {
  16724. line: e.loc.start.line,
  16725. column: e.loc.start.column,
  16726. offset: e.range[0]
  16727. },
  16728. end: {
  16729. line: e.loc.end.line,
  16730. column: e.loc.end.column,
  16731. offset: e.range[1]
  16732. }
  16733. };
  16734. this.delegate(node, metadata);
  16735. }
  16736. }
  16737. }
  16738. };
  16739. // From internal representation to an external structure
  16740. Parser.prototype.getTokenRaw = function (token) {
  16741. return this.scanner.source.slice(token.start, token.end);
  16742. };
  16743. Parser.prototype.convertToken = function (token) {
  16744. var t = {
  16745. type: token_1.TokenName[token.type],
  16746. value: this.getTokenRaw(token)
  16747. };
  16748. if (this.config.range) {
  16749. t.range = [token.start, token.end];
  16750. }
  16751. if (this.config.loc) {
  16752. t.loc = {
  16753. start: {
  16754. line: this.startMarker.line,
  16755. column: this.startMarker.column
  16756. },
  16757. end: {
  16758. line: this.scanner.lineNumber,
  16759. column: this.scanner.index - this.scanner.lineStart
  16760. }
  16761. };
  16762. }
  16763. if (token.type === 9 /* RegularExpression */) {
  16764. var pattern = token.pattern;
  16765. var flags = token.flags;
  16766. t.regex = { pattern: pattern, flags: flags };
  16767. }
  16768. return t;
  16769. };
  16770. Parser.prototype.nextToken = function () {
  16771. var token = this.lookahead;
  16772. this.lastMarker.index = this.scanner.index;
  16773. this.lastMarker.line = this.scanner.lineNumber;
  16774. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  16775. this.collectComments();
  16776. if (this.scanner.index !== this.startMarker.index) {
  16777. this.startMarker.index = this.scanner.index;
  16778. this.startMarker.line = this.scanner.lineNumber;
  16779. this.startMarker.column = this.scanner.index - this.scanner.lineStart;
  16780. }
  16781. var next = this.scanner.lex();
  16782. this.hasLineTerminator = (token.lineNumber !== next.lineNumber);
  16783. if (next && this.context.strict && next.type === 3 /* Identifier */) {
  16784. if (this.scanner.isStrictModeReservedWord(next.value)) {
  16785. next.type = 4 /* Keyword */;
  16786. }
  16787. }
  16788. this.lookahead = next;
  16789. if (this.config.tokens && next.type !== 2 /* EOF */) {
  16790. this.tokens.push(this.convertToken(next));
  16791. }
  16792. return token;
  16793. };
  16794. Parser.prototype.nextRegexToken = function () {
  16795. this.collectComments();
  16796. var token = this.scanner.scanRegExp();
  16797. if (this.config.tokens) {
  16798. // Pop the previous token, '/' or '/='
  16799. // This is added from the lookahead token.
  16800. this.tokens.pop();
  16801. this.tokens.push(this.convertToken(token));
  16802. }
  16803. // Prime the next lookahead.
  16804. this.lookahead = token;
  16805. this.nextToken();
  16806. return token;
  16807. };
  16808. Parser.prototype.createNode = function () {
  16809. return {
  16810. index: this.startMarker.index,
  16811. line: this.startMarker.line,
  16812. column: this.startMarker.column
  16813. };
  16814. };
  16815. Parser.prototype.startNode = function (token) {
  16816. return {
  16817. index: token.start,
  16818. line: token.lineNumber,
  16819. column: token.start - token.lineStart
  16820. };
  16821. };
  16822. Parser.prototype.finalize = function (marker, node) {
  16823. if (this.config.range) {
  16824. node.range = [marker.index, this.lastMarker.index];
  16825. }
  16826. if (this.config.loc) {
  16827. node.loc = {
  16828. start: {
  16829. line: marker.line,
  16830. column: marker.column,
  16831. },
  16832. end: {
  16833. line: this.lastMarker.line,
  16834. column: this.lastMarker.column
  16835. }
  16836. };
  16837. if (this.config.source) {
  16838. node.loc.source = this.config.source;
  16839. }
  16840. }
  16841. if (this.delegate) {
  16842. var metadata = {
  16843. start: {
  16844. line: marker.line,
  16845. column: marker.column,
  16846. offset: marker.index
  16847. },
  16848. end: {
  16849. line: this.lastMarker.line,
  16850. column: this.lastMarker.column,
  16851. offset: this.lastMarker.index
  16852. }
  16853. };
  16854. this.delegate(node, metadata);
  16855. }
  16856. return node;
  16857. };
  16858. // Expect the next token to match the specified punctuator.
  16859. // If not, an exception will be thrown.
  16860. Parser.prototype.expect = function (value) {
  16861. var token = this.nextToken();
  16862. if (token.type !== 7 /* Punctuator */ || token.value !== value) {
  16863. this.throwUnexpectedToken(token);
  16864. }
  16865. };
  16866. // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
  16867. Parser.prototype.expectCommaSeparator = function () {
  16868. if (this.config.tolerant) {
  16869. var token = this.lookahead;
  16870. if (token.type === 7 /* Punctuator */ && token.value === ',') {
  16871. this.nextToken();
  16872. }
  16873. else if (token.type === 7 /* Punctuator */ && token.value === ';') {
  16874. this.nextToken();
  16875. this.tolerateUnexpectedToken(token);
  16876. }
  16877. else {
  16878. this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
  16879. }
  16880. }
  16881. else {
  16882. this.expect(',');
  16883. }
  16884. };
  16885. // Expect the next token to match the specified keyword.
  16886. // If not, an exception will be thrown.
  16887. Parser.prototype.expectKeyword = function (keyword) {
  16888. var token = this.nextToken();
  16889. if (token.type !== 4 /* Keyword */ || token.value !== keyword) {
  16890. this.throwUnexpectedToken(token);
  16891. }
  16892. };
  16893. // Return true if the next token matches the specified punctuator.
  16894. Parser.prototype.match = function (value) {
  16895. return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value;
  16896. };
  16897. // Return true if the next token matches the specified keyword
  16898. Parser.prototype.matchKeyword = function (keyword) {
  16899. return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword;
  16900. };
  16901. // Return true if the next token matches the specified contextual keyword
  16902. // (where an identifier is sometimes a keyword depending on the context)
  16903. Parser.prototype.matchContextualKeyword = function (keyword) {
  16904. return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword;
  16905. };
  16906. // Return true if the next token is an assignment operator
  16907. Parser.prototype.matchAssign = function () {
  16908. if (this.lookahead.type !== 7 /* Punctuator */) {
  16909. return false;
  16910. }
  16911. var op = this.lookahead.value;
  16912. return op === '=' ||
  16913. op === '*=' ||
  16914. op === '**=' ||
  16915. op === '/=' ||
  16916. op === '%=' ||
  16917. op === '+=' ||
  16918. op === '-=' ||
  16919. op === '<<=' ||
  16920. op === '>>=' ||
  16921. op === '>>>=' ||
  16922. op === '&=' ||
  16923. op === '^=' ||
  16924. op === '|=';
  16925. };
  16926. // Cover grammar support.
  16927. //
  16928. // When an assignment expression position starts with an left parenthesis, the determination of the type
  16929. // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
  16930. // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
  16931. //
  16932. // There are three productions that can be parsed in a parentheses pair that needs to be determined
  16933. // after the outermost pair is closed. They are:
  16934. //
  16935. // 1. AssignmentExpression
  16936. // 2. BindingElements
  16937. // 3. AssignmentTargets
  16938. //
  16939. // In order to avoid exponential backtracking, we use two flags to denote if the production can be
  16940. // binding element or assignment target.
  16941. //
  16942. // The three productions have the relationship:
  16943. //
  16944. // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
  16945. //
  16946. // with a single exception that CoverInitializedName when used directly in an Expression, generates
  16947. // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
  16948. // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
  16949. //
  16950. // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
  16951. // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
  16952. // the CoverInitializedName check is conducted.
  16953. //
  16954. // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
  16955. // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
  16956. // pattern. The CoverInitializedName check is deferred.
  16957. Parser.prototype.isolateCoverGrammar = function (parseFunction) {
  16958. var previousIsBindingElement = this.context.isBindingElement;
  16959. var previousIsAssignmentTarget = this.context.isAssignmentTarget;
  16960. var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
  16961. this.context.isBindingElement = true;
  16962. this.context.isAssignmentTarget = true;
  16963. this.context.firstCoverInitializedNameError = null;
  16964. var result = parseFunction.call(this);
  16965. if (this.context.firstCoverInitializedNameError !== null) {
  16966. this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
  16967. }
  16968. this.context.isBindingElement = previousIsBindingElement;
  16969. this.context.isAssignmentTarget = previousIsAssignmentTarget;
  16970. this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
  16971. return result;
  16972. };
  16973. Parser.prototype.inheritCoverGrammar = function (parseFunction) {
  16974. var previousIsBindingElement = this.context.isBindingElement;
  16975. var previousIsAssignmentTarget = this.context.isAssignmentTarget;
  16976. var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
  16977. this.context.isBindingElement = true;
  16978. this.context.isAssignmentTarget = true;
  16979. this.context.firstCoverInitializedNameError = null;
  16980. var result = parseFunction.call(this);
  16981. this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
  16982. this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
  16983. this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
  16984. return result;
  16985. };
  16986. Parser.prototype.consumeSemicolon = function () {
  16987. if (this.match(';')) {
  16988. this.nextToken();
  16989. }
  16990. else if (!this.hasLineTerminator) {
  16991. if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) {
  16992. this.throwUnexpectedToken(this.lookahead);
  16993. }
  16994. this.lastMarker.index = this.startMarker.index;
  16995. this.lastMarker.line = this.startMarker.line;
  16996. this.lastMarker.column = this.startMarker.column;
  16997. }
  16998. };
  16999. // https://tc39.github.io/ecma262/#sec-primary-expression
  17000. Parser.prototype.parsePrimaryExpression = function () {
  17001. var node = this.createNode();
  17002. var expr;
  17003. var token, raw;
  17004. switch (this.lookahead.type) {
  17005. case 3 /* Identifier */:
  17006. if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') {
  17007. this.tolerateUnexpectedToken(this.lookahead);
  17008. }
  17009. expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
  17010. break;
  17011. case 6 /* NumericLiteral */:
  17012. case 8 /* StringLiteral */:
  17013. if (this.context.strict && this.lookahead.octal) {
  17014. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
  17015. }
  17016. this.context.isAssignmentTarget = false;
  17017. this.context.isBindingElement = false;
  17018. token = this.nextToken();
  17019. raw = this.getTokenRaw(token);
  17020. expr = this.finalize(node, new Node.Literal(token.value, raw));
  17021. break;
  17022. case 1 /* BooleanLiteral */:
  17023. this.context.isAssignmentTarget = false;
  17024. this.context.isBindingElement = false;
  17025. token = this.nextToken();
  17026. raw = this.getTokenRaw(token);
  17027. expr = this.finalize(node, new Node.Literal(token.value === 'true', raw));
  17028. break;
  17029. case 5 /* NullLiteral */:
  17030. this.context.isAssignmentTarget = false;
  17031. this.context.isBindingElement = false;
  17032. token = this.nextToken();
  17033. raw = this.getTokenRaw(token);
  17034. expr = this.finalize(node, new Node.Literal(null, raw));
  17035. break;
  17036. case 10 /* Template */:
  17037. expr = this.parseTemplateLiteral();
  17038. break;
  17039. case 7 /* Punctuator */:
  17040. switch (this.lookahead.value) {
  17041. case '(':
  17042. this.context.isBindingElement = false;
  17043. expr = this.inheritCoverGrammar(this.parseGroupExpression);
  17044. break;
  17045. case '[':
  17046. expr = this.inheritCoverGrammar(this.parseArrayInitializer);
  17047. break;
  17048. case '{':
  17049. expr = this.inheritCoverGrammar(this.parseObjectInitializer);
  17050. break;
  17051. case '/':
  17052. case '/=':
  17053. this.context.isAssignmentTarget = false;
  17054. this.context.isBindingElement = false;
  17055. this.scanner.index = this.startMarker.index;
  17056. token = this.nextRegexToken();
  17057. raw = this.getTokenRaw(token);
  17058. expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
  17059. break;
  17060. default:
  17061. expr = this.throwUnexpectedToken(this.nextToken());
  17062. }
  17063. break;
  17064. case 4 /* Keyword */:
  17065. if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) {
  17066. expr = this.parseIdentifierName();
  17067. }
  17068. else if (!this.context.strict && this.matchKeyword('let')) {
  17069. expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
  17070. }
  17071. else {
  17072. this.context.isAssignmentTarget = false;
  17073. this.context.isBindingElement = false;
  17074. if (this.matchKeyword('function')) {
  17075. expr = this.parseFunctionExpression();
  17076. }
  17077. else if (this.matchKeyword('this')) {
  17078. this.nextToken();
  17079. expr = this.finalize(node, new Node.ThisExpression());
  17080. }
  17081. else if (this.matchKeyword('class')) {
  17082. expr = this.parseClassExpression();
  17083. }
  17084. else {
  17085. expr = this.throwUnexpectedToken(this.nextToken());
  17086. }
  17087. }
  17088. break;
  17089. default:
  17090. expr = this.throwUnexpectedToken(this.nextToken());
  17091. }
  17092. return expr;
  17093. };
  17094. // https://tc39.github.io/ecma262/#sec-array-initializer
  17095. Parser.prototype.parseSpreadElement = function () {
  17096. var node = this.createNode();
  17097. this.expect('...');
  17098. var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
  17099. return this.finalize(node, new Node.SpreadElement(arg));
  17100. };
  17101. Parser.prototype.parseArrayInitializer = function () {
  17102. var node = this.createNode();
  17103. var elements = [];
  17104. this.expect('[');
  17105. while (!this.match(']')) {
  17106. if (this.match(',')) {
  17107. this.nextToken();
  17108. elements.push(null);
  17109. }
  17110. else if (this.match('...')) {
  17111. var element = this.parseSpreadElement();
  17112. if (!this.match(']')) {
  17113. this.context.isAssignmentTarget = false;
  17114. this.context.isBindingElement = false;
  17115. this.expect(',');
  17116. }
  17117. elements.push(element);
  17118. }
  17119. else {
  17120. elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
  17121. if (!this.match(']')) {
  17122. this.expect(',');
  17123. }
  17124. }
  17125. }
  17126. this.expect(']');
  17127. return this.finalize(node, new Node.ArrayExpression(elements));
  17128. };
  17129. // https://tc39.github.io/ecma262/#sec-object-initializer
  17130. Parser.prototype.parsePropertyMethod = function (params) {
  17131. this.context.isAssignmentTarget = false;
  17132. this.context.isBindingElement = false;
  17133. var previousStrict = this.context.strict;
  17134. var previousAllowStrictDirective = this.context.allowStrictDirective;
  17135. this.context.allowStrictDirective = params.simple;
  17136. var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
  17137. if (this.context.strict && params.firstRestricted) {
  17138. this.tolerateUnexpectedToken(params.firstRestricted, params.message);
  17139. }
  17140. if (this.context.strict && params.stricted) {
  17141. this.tolerateUnexpectedToken(params.stricted, params.message);
  17142. }
  17143. this.context.strict = previousStrict;
  17144. this.context.allowStrictDirective = previousAllowStrictDirective;
  17145. return body;
  17146. };
  17147. Parser.prototype.parsePropertyMethodFunction = function () {
  17148. var isGenerator = false;
  17149. var node = this.createNode();
  17150. var previousAllowYield = this.context.allowYield;
  17151. this.context.allowYield = false;
  17152. var params = this.parseFormalParameters();
  17153. var method = this.parsePropertyMethod(params);
  17154. this.context.allowYield = previousAllowYield;
  17155. return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
  17156. };
  17157. Parser.prototype.parsePropertyMethodAsyncFunction = function () {
  17158. var node = this.createNode();
  17159. var previousAllowYield = this.context.allowYield;
  17160. var previousAwait = this.context.await;
  17161. this.context.allowYield = false;
  17162. this.context.await = true;
  17163. var params = this.parseFormalParameters();
  17164. var method = this.parsePropertyMethod(params);
  17165. this.context.allowYield = previousAllowYield;
  17166. this.context.await = previousAwait;
  17167. return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
  17168. };
  17169. Parser.prototype.parseObjectPropertyKey = function () {
  17170. var node = this.createNode();
  17171. var token = this.nextToken();
  17172. var key;
  17173. switch (token.type) {
  17174. case 8 /* StringLiteral */:
  17175. case 6 /* NumericLiteral */:
  17176. if (this.context.strict && token.octal) {
  17177. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
  17178. }
  17179. var raw = this.getTokenRaw(token);
  17180. key = this.finalize(node, new Node.Literal(token.value, raw));
  17181. break;
  17182. case 3 /* Identifier */:
  17183. case 1 /* BooleanLiteral */:
  17184. case 5 /* NullLiteral */:
  17185. case 4 /* Keyword */:
  17186. key = this.finalize(node, new Node.Identifier(token.value));
  17187. break;
  17188. case 7 /* Punctuator */:
  17189. if (token.value === '[') {
  17190. key = this.isolateCoverGrammar(this.parseAssignmentExpression);
  17191. this.expect(']');
  17192. }
  17193. else {
  17194. key = this.throwUnexpectedToken(token);
  17195. }
  17196. break;
  17197. default:
  17198. key = this.throwUnexpectedToken(token);
  17199. }
  17200. return key;
  17201. };
  17202. Parser.prototype.isPropertyKey = function (key, value) {
  17203. return (key.type === syntax_1.Syntax.Identifier && key.name === value) ||
  17204. (key.type === syntax_1.Syntax.Literal && key.value === value);
  17205. };
  17206. Parser.prototype.parseObjectProperty = function (hasProto) {
  17207. var node = this.createNode();
  17208. var token = this.lookahead;
  17209. var kind;
  17210. var key = null;
  17211. var value = null;
  17212. var computed = false;
  17213. var method = false;
  17214. var shorthand = false;
  17215. var isAsync = false;
  17216. if (token.type === 3 /* Identifier */) {
  17217. var id = token.value;
  17218. this.nextToken();
  17219. computed = this.match('[');
  17220. isAsync = !this.hasLineTerminator && (id === 'async') &&
  17221. !this.match(':') && !this.match('(') && !this.match('*');
  17222. key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id));
  17223. }
  17224. else if (this.match('*')) {
  17225. this.nextToken();
  17226. }
  17227. else {
  17228. computed = this.match('[');
  17229. key = this.parseObjectPropertyKey();
  17230. }
  17231. var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
  17232. if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) {
  17233. kind = 'get';
  17234. computed = this.match('[');
  17235. key = this.parseObjectPropertyKey();
  17236. this.context.allowYield = false;
  17237. value = this.parseGetterMethod();
  17238. }
  17239. else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) {
  17240. kind = 'set';
  17241. computed = this.match('[');
  17242. key = this.parseObjectPropertyKey();
  17243. value = this.parseSetterMethod();
  17244. }
  17245. else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
  17246. kind = 'init';
  17247. computed = this.match('[');
  17248. key = this.parseObjectPropertyKey();
  17249. value = this.parseGeneratorMethod();
  17250. method = true;
  17251. }
  17252. else {
  17253. if (!key) {
  17254. this.throwUnexpectedToken(this.lookahead);
  17255. }
  17256. kind = 'init';
  17257. if (this.match(':') && !isAsync) {
  17258. if (!computed && this.isPropertyKey(key, '__proto__')) {
  17259. if (hasProto.value) {
  17260. this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
  17261. }
  17262. hasProto.value = true;
  17263. }
  17264. this.nextToken();
  17265. value = this.inheritCoverGrammar(this.parseAssignmentExpression);
  17266. }
  17267. else if (this.match('(')) {
  17268. value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
  17269. method = true;
  17270. }
  17271. else if (token.type === 3 /* Identifier */) {
  17272. var id = this.finalize(node, new Node.Identifier(token.value));
  17273. if (this.match('=')) {
  17274. this.context.firstCoverInitializedNameError = this.lookahead;
  17275. this.nextToken();
  17276. shorthand = true;
  17277. var init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  17278. value = this.finalize(node, new Node.AssignmentPattern(id, init));
  17279. }
  17280. else {
  17281. shorthand = true;
  17282. value = id;
  17283. }
  17284. }
  17285. else {
  17286. this.throwUnexpectedToken(this.nextToken());
  17287. }
  17288. }
  17289. return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
  17290. };
  17291. Parser.prototype.parseObjectInitializer = function () {
  17292. var node = this.createNode();
  17293. this.expect('{');
  17294. var properties = [];
  17295. var hasProto = { value: false };
  17296. while (!this.match('}')) {
  17297. properties.push(this.parseObjectProperty(hasProto));
  17298. if (!this.match('}')) {
  17299. this.expectCommaSeparator();
  17300. }
  17301. }
  17302. this.expect('}');
  17303. return this.finalize(node, new Node.ObjectExpression(properties));
  17304. };
  17305. // https://tc39.github.io/ecma262/#sec-template-literals
  17306. Parser.prototype.parseTemplateHead = function () {
  17307. assert_1.assert(this.lookahead.head, 'Template literal must start with a template head');
  17308. var node = this.createNode();
  17309. var token = this.nextToken();
  17310. var raw = token.value;
  17311. var cooked = token.cooked;
  17312. return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
  17313. };
  17314. Parser.prototype.parseTemplateElement = function () {
  17315. if (this.lookahead.type !== 10 /* Template */) {
  17316. this.throwUnexpectedToken();
  17317. }
  17318. var node = this.createNode();
  17319. var token = this.nextToken();
  17320. var raw = token.value;
  17321. var cooked = token.cooked;
  17322. return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
  17323. };
  17324. Parser.prototype.parseTemplateLiteral = function () {
  17325. var node = this.createNode();
  17326. var expressions = [];
  17327. var quasis = [];
  17328. var quasi = this.parseTemplateHead();
  17329. quasis.push(quasi);
  17330. while (!quasi.tail) {
  17331. expressions.push(this.parseExpression());
  17332. quasi = this.parseTemplateElement();
  17333. quasis.push(quasi);
  17334. }
  17335. return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
  17336. };
  17337. // https://tc39.github.io/ecma262/#sec-grouping-operator
  17338. Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
  17339. switch (expr.type) {
  17340. case syntax_1.Syntax.Identifier:
  17341. case syntax_1.Syntax.MemberExpression:
  17342. case syntax_1.Syntax.RestElement:
  17343. case syntax_1.Syntax.AssignmentPattern:
  17344. break;
  17345. case syntax_1.Syntax.SpreadElement:
  17346. expr.type = syntax_1.Syntax.RestElement;
  17347. this.reinterpretExpressionAsPattern(expr.argument);
  17348. break;
  17349. case syntax_1.Syntax.ArrayExpression:
  17350. expr.type = syntax_1.Syntax.ArrayPattern;
  17351. for (var i = 0; i < expr.elements.length; i++) {
  17352. if (expr.elements[i] !== null) {
  17353. this.reinterpretExpressionAsPattern(expr.elements[i]);
  17354. }
  17355. }
  17356. break;
  17357. case syntax_1.Syntax.ObjectExpression:
  17358. expr.type = syntax_1.Syntax.ObjectPattern;
  17359. for (var i = 0; i < expr.properties.length; i++) {
  17360. this.reinterpretExpressionAsPattern(expr.properties[i].value);
  17361. }
  17362. break;
  17363. case syntax_1.Syntax.AssignmentExpression:
  17364. expr.type = syntax_1.Syntax.AssignmentPattern;
  17365. delete expr.operator;
  17366. this.reinterpretExpressionAsPattern(expr.left);
  17367. break;
  17368. default:
  17369. // Allow other node type for tolerant parsing.
  17370. break;
  17371. }
  17372. };
  17373. Parser.prototype.parseGroupExpression = function () {
  17374. var expr;
  17375. this.expect('(');
  17376. if (this.match(')')) {
  17377. this.nextToken();
  17378. if (!this.match('=>')) {
  17379. this.expect('=>');
  17380. }
  17381. expr = {
  17382. type: ArrowParameterPlaceHolder,
  17383. params: [],
  17384. async: false
  17385. };
  17386. }
  17387. else {
  17388. var startToken = this.lookahead;
  17389. var params = [];
  17390. if (this.match('...')) {
  17391. expr = this.parseRestElement(params);
  17392. this.expect(')');
  17393. if (!this.match('=>')) {
  17394. this.expect('=>');
  17395. }
  17396. expr = {
  17397. type: ArrowParameterPlaceHolder,
  17398. params: [expr],
  17399. async: false
  17400. };
  17401. }
  17402. else {
  17403. var arrow = false;
  17404. this.context.isBindingElement = true;
  17405. expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
  17406. if (this.match(',')) {
  17407. var expressions = [];
  17408. this.context.isAssignmentTarget = false;
  17409. expressions.push(expr);
  17410. while (this.lookahead.type !== 2 /* EOF */) {
  17411. if (!this.match(',')) {
  17412. break;
  17413. }
  17414. this.nextToken();
  17415. if (this.match(')')) {
  17416. this.nextToken();
  17417. for (var i = 0; i < expressions.length; i++) {
  17418. this.reinterpretExpressionAsPattern(expressions[i]);
  17419. }
  17420. arrow = true;
  17421. expr = {
  17422. type: ArrowParameterPlaceHolder,
  17423. params: expressions,
  17424. async: false
  17425. };
  17426. }
  17427. else if (this.match('...')) {
  17428. if (!this.context.isBindingElement) {
  17429. this.throwUnexpectedToken(this.lookahead);
  17430. }
  17431. expressions.push(this.parseRestElement(params));
  17432. this.expect(')');
  17433. if (!this.match('=>')) {
  17434. this.expect('=>');
  17435. }
  17436. this.context.isBindingElement = false;
  17437. for (var i = 0; i < expressions.length; i++) {
  17438. this.reinterpretExpressionAsPattern(expressions[i]);
  17439. }
  17440. arrow = true;
  17441. expr = {
  17442. type: ArrowParameterPlaceHolder,
  17443. params: expressions,
  17444. async: false
  17445. };
  17446. }
  17447. else {
  17448. expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
  17449. }
  17450. if (arrow) {
  17451. break;
  17452. }
  17453. }
  17454. if (!arrow) {
  17455. expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
  17456. }
  17457. }
  17458. if (!arrow) {
  17459. this.expect(')');
  17460. if (this.match('=>')) {
  17461. if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') {
  17462. arrow = true;
  17463. expr = {
  17464. type: ArrowParameterPlaceHolder,
  17465. params: [expr],
  17466. async: false
  17467. };
  17468. }
  17469. if (!arrow) {
  17470. if (!this.context.isBindingElement) {
  17471. this.throwUnexpectedToken(this.lookahead);
  17472. }
  17473. if (expr.type === syntax_1.Syntax.SequenceExpression) {
  17474. for (var i = 0; i < expr.expressions.length; i++) {
  17475. this.reinterpretExpressionAsPattern(expr.expressions[i]);
  17476. }
  17477. }
  17478. else {
  17479. this.reinterpretExpressionAsPattern(expr);
  17480. }
  17481. var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]);
  17482. expr = {
  17483. type: ArrowParameterPlaceHolder,
  17484. params: parameters,
  17485. async: false
  17486. };
  17487. }
  17488. }
  17489. this.context.isBindingElement = false;
  17490. }
  17491. }
  17492. }
  17493. return expr;
  17494. };
  17495. // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions
  17496. Parser.prototype.parseArguments = function () {
  17497. this.expect('(');
  17498. var args = [];
  17499. if (!this.match(')')) {
  17500. while (true) {
  17501. var expr = this.match('...') ? this.parseSpreadElement() :
  17502. this.isolateCoverGrammar(this.parseAssignmentExpression);
  17503. args.push(expr);
  17504. if (this.match(')')) {
  17505. break;
  17506. }
  17507. this.expectCommaSeparator();
  17508. if (this.match(')')) {
  17509. break;
  17510. }
  17511. }
  17512. }
  17513. this.expect(')');
  17514. return args;
  17515. };
  17516. Parser.prototype.isIdentifierName = function (token) {
  17517. return token.type === 3 /* Identifier */ ||
  17518. token.type === 4 /* Keyword */ ||
  17519. token.type === 1 /* BooleanLiteral */ ||
  17520. token.type === 5 /* NullLiteral */;
  17521. };
  17522. Parser.prototype.parseIdentifierName = function () {
  17523. var node = this.createNode();
  17524. var token = this.nextToken();
  17525. if (!this.isIdentifierName(token)) {
  17526. this.throwUnexpectedToken(token);
  17527. }
  17528. return this.finalize(node, new Node.Identifier(token.value));
  17529. };
  17530. Parser.prototype.parseNewExpression = function () {
  17531. var node = this.createNode();
  17532. var id = this.parseIdentifierName();
  17533. assert_1.assert(id.name === 'new', 'New expression must start with `new`');
  17534. var expr;
  17535. if (this.match('.')) {
  17536. this.nextToken();
  17537. if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') {
  17538. var property = this.parseIdentifierName();
  17539. expr = new Node.MetaProperty(id, property);
  17540. }
  17541. else {
  17542. this.throwUnexpectedToken(this.lookahead);
  17543. }
  17544. }
  17545. else {
  17546. var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
  17547. var args = this.match('(') ? this.parseArguments() : [];
  17548. expr = new Node.NewExpression(callee, args);
  17549. this.context.isAssignmentTarget = false;
  17550. this.context.isBindingElement = false;
  17551. }
  17552. return this.finalize(node, expr);
  17553. };
  17554. Parser.prototype.parseAsyncArgument = function () {
  17555. var arg = this.parseAssignmentExpression();
  17556. this.context.firstCoverInitializedNameError = null;
  17557. return arg;
  17558. };
  17559. Parser.prototype.parseAsyncArguments = function () {
  17560. this.expect('(');
  17561. var args = [];
  17562. if (!this.match(')')) {
  17563. while (true) {
  17564. var expr = this.match('...') ? this.parseSpreadElement() :
  17565. this.isolateCoverGrammar(this.parseAsyncArgument);
  17566. args.push(expr);
  17567. if (this.match(')')) {
  17568. break;
  17569. }
  17570. this.expectCommaSeparator();
  17571. if (this.match(')')) {
  17572. break;
  17573. }
  17574. }
  17575. }
  17576. this.expect(')');
  17577. return args;
  17578. };
  17579. Parser.prototype.parseLeftHandSideExpressionAllowCall = function () {
  17580. var startToken = this.lookahead;
  17581. var maybeAsync = this.matchContextualKeyword('async');
  17582. var previousAllowIn = this.context.allowIn;
  17583. this.context.allowIn = true;
  17584. var expr;
  17585. if (this.matchKeyword('super') && this.context.inFunctionBody) {
  17586. expr = this.createNode();
  17587. this.nextToken();
  17588. expr = this.finalize(expr, new Node.Super());
  17589. if (!this.match('(') && !this.match('.') && !this.match('[')) {
  17590. this.throwUnexpectedToken(this.lookahead);
  17591. }
  17592. }
  17593. else {
  17594. expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
  17595. }
  17596. while (true) {
  17597. if (this.match('.')) {
  17598. this.context.isBindingElement = false;
  17599. this.context.isAssignmentTarget = true;
  17600. this.expect('.');
  17601. var property = this.parseIdentifierName();
  17602. expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property));
  17603. }
  17604. else if (this.match('(')) {
  17605. var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber);
  17606. this.context.isBindingElement = false;
  17607. this.context.isAssignmentTarget = false;
  17608. var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
  17609. expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args));
  17610. if (asyncArrow && this.match('=>')) {
  17611. for (var i = 0; i < args.length; ++i) {
  17612. this.reinterpretExpressionAsPattern(args[i]);
  17613. }
  17614. expr = {
  17615. type: ArrowParameterPlaceHolder,
  17616. params: args,
  17617. async: true
  17618. };
  17619. }
  17620. }
  17621. else if (this.match('[')) {
  17622. this.context.isBindingElement = false;
  17623. this.context.isAssignmentTarget = true;
  17624. this.expect('[');
  17625. var property = this.isolateCoverGrammar(this.parseExpression);
  17626. this.expect(']');
  17627. expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property));
  17628. }
  17629. else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
  17630. var quasi = this.parseTemplateLiteral();
  17631. expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi));
  17632. }
  17633. else {
  17634. break;
  17635. }
  17636. }
  17637. this.context.allowIn = previousAllowIn;
  17638. return expr;
  17639. };
  17640. Parser.prototype.parseSuper = function () {
  17641. var node = this.createNode();
  17642. this.expectKeyword('super');
  17643. if (!this.match('[') && !this.match('.')) {
  17644. this.throwUnexpectedToken(this.lookahead);
  17645. }
  17646. return this.finalize(node, new Node.Super());
  17647. };
  17648. Parser.prototype.parseLeftHandSideExpression = function () {
  17649. assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.');
  17650. var node = this.startNode(this.lookahead);
  17651. var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() :
  17652. this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
  17653. while (true) {
  17654. if (this.match('[')) {
  17655. this.context.isBindingElement = false;
  17656. this.context.isAssignmentTarget = true;
  17657. this.expect('[');
  17658. var property = this.isolateCoverGrammar(this.parseExpression);
  17659. this.expect(']');
  17660. expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property));
  17661. }
  17662. else if (this.match('.')) {
  17663. this.context.isBindingElement = false;
  17664. this.context.isAssignmentTarget = true;
  17665. this.expect('.');
  17666. var property = this.parseIdentifierName();
  17667. expr = this.finalize(node, new Node.StaticMemberExpression(expr, property));
  17668. }
  17669. else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
  17670. var quasi = this.parseTemplateLiteral();
  17671. expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi));
  17672. }
  17673. else {
  17674. break;
  17675. }
  17676. }
  17677. return expr;
  17678. };
  17679. // https://tc39.github.io/ecma262/#sec-update-expressions
  17680. Parser.prototype.parseUpdateExpression = function () {
  17681. var expr;
  17682. var startToken = this.lookahead;
  17683. if (this.match('++') || this.match('--')) {
  17684. var node = this.startNode(startToken);
  17685. var token = this.nextToken();
  17686. expr = this.inheritCoverGrammar(this.parseUnaryExpression);
  17687. if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
  17688. this.tolerateError(messages_1.Messages.StrictLHSPrefix);
  17689. }
  17690. if (!this.context.isAssignmentTarget) {
  17691. this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
  17692. }
  17693. var prefix = true;
  17694. expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix));
  17695. this.context.isAssignmentTarget = false;
  17696. this.context.isBindingElement = false;
  17697. }
  17698. else {
  17699. expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
  17700. if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) {
  17701. if (this.match('++') || this.match('--')) {
  17702. if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
  17703. this.tolerateError(messages_1.Messages.StrictLHSPostfix);
  17704. }
  17705. if (!this.context.isAssignmentTarget) {
  17706. this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
  17707. }
  17708. this.context.isAssignmentTarget = false;
  17709. this.context.isBindingElement = false;
  17710. var operator = this.nextToken().value;
  17711. var prefix = false;
  17712. expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix));
  17713. }
  17714. }
  17715. }
  17716. return expr;
  17717. };
  17718. // https://tc39.github.io/ecma262/#sec-unary-operators
  17719. Parser.prototype.parseAwaitExpression = function () {
  17720. var node = this.createNode();
  17721. this.nextToken();
  17722. var argument = this.parseUnaryExpression();
  17723. return this.finalize(node, new Node.AwaitExpression(argument));
  17724. };
  17725. Parser.prototype.parseUnaryExpression = function () {
  17726. var expr;
  17727. if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
  17728. this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
  17729. var node = this.startNode(this.lookahead);
  17730. var token = this.nextToken();
  17731. expr = this.inheritCoverGrammar(this.parseUnaryExpression);
  17732. expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
  17733. if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) {
  17734. this.tolerateError(messages_1.Messages.StrictDelete);
  17735. }
  17736. this.context.isAssignmentTarget = false;
  17737. this.context.isBindingElement = false;
  17738. }
  17739. else if (this.context.await && this.matchContextualKeyword('await')) {
  17740. expr = this.parseAwaitExpression();
  17741. }
  17742. else {
  17743. expr = this.parseUpdateExpression();
  17744. }
  17745. return expr;
  17746. };
  17747. Parser.prototype.parseExponentiationExpression = function () {
  17748. var startToken = this.lookahead;
  17749. var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
  17750. if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) {
  17751. this.nextToken();
  17752. this.context.isAssignmentTarget = false;
  17753. this.context.isBindingElement = false;
  17754. var left = expr;
  17755. var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
  17756. expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right));
  17757. }
  17758. return expr;
  17759. };
  17760. // https://tc39.github.io/ecma262/#sec-exp-operator
  17761. // https://tc39.github.io/ecma262/#sec-multiplicative-operators
  17762. // https://tc39.github.io/ecma262/#sec-additive-operators
  17763. // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators
  17764. // https://tc39.github.io/ecma262/#sec-relational-operators
  17765. // https://tc39.github.io/ecma262/#sec-equality-operators
  17766. // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators
  17767. // https://tc39.github.io/ecma262/#sec-binary-logical-operators
  17768. Parser.prototype.binaryPrecedence = function (token) {
  17769. var op = token.value;
  17770. var precedence;
  17771. if (token.type === 7 /* Punctuator */) {
  17772. precedence = this.operatorPrecedence[op] || 0;
  17773. }
  17774. else if (token.type === 4 /* Keyword */) {
  17775. precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0;
  17776. }
  17777. else {
  17778. precedence = 0;
  17779. }
  17780. return precedence;
  17781. };
  17782. Parser.prototype.parseBinaryExpression = function () {
  17783. var startToken = this.lookahead;
  17784. var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
  17785. var token = this.lookahead;
  17786. var prec = this.binaryPrecedence(token);
  17787. if (prec > 0) {
  17788. this.nextToken();
  17789. this.context.isAssignmentTarget = false;
  17790. this.context.isBindingElement = false;
  17791. var markers = [startToken, this.lookahead];
  17792. var left = expr;
  17793. var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
  17794. var stack = [left, token.value, right];
  17795. var precedences = [prec];
  17796. while (true) {
  17797. prec = this.binaryPrecedence(this.lookahead);
  17798. if (prec <= 0) {
  17799. break;
  17800. }
  17801. // Reduce: make a binary expression from the three topmost entries.
  17802. while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) {
  17803. right = stack.pop();
  17804. var operator = stack.pop();
  17805. precedences.pop();
  17806. left = stack.pop();
  17807. markers.pop();
  17808. var node = this.startNode(markers[markers.length - 1]);
  17809. stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right)));
  17810. }
  17811. // Shift.
  17812. stack.push(this.nextToken().value);
  17813. precedences.push(prec);
  17814. markers.push(this.lookahead);
  17815. stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
  17816. }
  17817. // Final reduce to clean-up the stack.
  17818. var i = stack.length - 1;
  17819. expr = stack[i];
  17820. markers.pop();
  17821. while (i > 1) {
  17822. var node = this.startNode(markers.pop());
  17823. var operator = stack[i - 1];
  17824. expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr));
  17825. i -= 2;
  17826. }
  17827. }
  17828. return expr;
  17829. };
  17830. // https://tc39.github.io/ecma262/#sec-conditional-operator
  17831. Parser.prototype.parseConditionalExpression = function () {
  17832. var startToken = this.lookahead;
  17833. var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
  17834. if (this.match('?')) {
  17835. this.nextToken();
  17836. var previousAllowIn = this.context.allowIn;
  17837. this.context.allowIn = true;
  17838. var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
  17839. this.context.allowIn = previousAllowIn;
  17840. this.expect(':');
  17841. var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
  17842. expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate));
  17843. this.context.isAssignmentTarget = false;
  17844. this.context.isBindingElement = false;
  17845. }
  17846. return expr;
  17847. };
  17848. // https://tc39.github.io/ecma262/#sec-assignment-operators
  17849. Parser.prototype.checkPatternParam = function (options, param) {
  17850. switch (param.type) {
  17851. case syntax_1.Syntax.Identifier:
  17852. this.validateParam(options, param, param.name);
  17853. break;
  17854. case syntax_1.Syntax.RestElement:
  17855. this.checkPatternParam(options, param.argument);
  17856. break;
  17857. case syntax_1.Syntax.AssignmentPattern:
  17858. this.checkPatternParam(options, param.left);
  17859. break;
  17860. case syntax_1.Syntax.ArrayPattern:
  17861. for (var i = 0; i < param.elements.length; i++) {
  17862. if (param.elements[i] !== null) {
  17863. this.checkPatternParam(options, param.elements[i]);
  17864. }
  17865. }
  17866. break;
  17867. case syntax_1.Syntax.ObjectPattern:
  17868. for (var i = 0; i < param.properties.length; i++) {
  17869. this.checkPatternParam(options, param.properties[i].value);
  17870. }
  17871. break;
  17872. default:
  17873. break;
  17874. }
  17875. options.simple = options.simple && (param instanceof Node.Identifier);
  17876. };
  17877. Parser.prototype.reinterpretAsCoverFormalsList = function (expr) {
  17878. var params = [expr];
  17879. var options;
  17880. var asyncArrow = false;
  17881. switch (expr.type) {
  17882. case syntax_1.Syntax.Identifier:
  17883. break;
  17884. case ArrowParameterPlaceHolder:
  17885. params = expr.params;
  17886. asyncArrow = expr.async;
  17887. break;
  17888. default:
  17889. return null;
  17890. }
  17891. options = {
  17892. simple: true,
  17893. paramSet: {}
  17894. };
  17895. for (var i = 0; i < params.length; ++i) {
  17896. var param = params[i];
  17897. if (param.type === syntax_1.Syntax.AssignmentPattern) {
  17898. if (param.right.type === syntax_1.Syntax.YieldExpression) {
  17899. if (param.right.argument) {
  17900. this.throwUnexpectedToken(this.lookahead);
  17901. }
  17902. param.right.type = syntax_1.Syntax.Identifier;
  17903. param.right.name = 'yield';
  17904. delete param.right.argument;
  17905. delete param.right.delegate;
  17906. }
  17907. }
  17908. else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') {
  17909. this.throwUnexpectedToken(this.lookahead);
  17910. }
  17911. this.checkPatternParam(options, param);
  17912. params[i] = param;
  17913. }
  17914. if (this.context.strict || !this.context.allowYield) {
  17915. for (var i = 0; i < params.length; ++i) {
  17916. var param = params[i];
  17917. if (param.type === syntax_1.Syntax.YieldExpression) {
  17918. this.throwUnexpectedToken(this.lookahead);
  17919. }
  17920. }
  17921. }
  17922. if (options.message === messages_1.Messages.StrictParamDupe) {
  17923. var token = this.context.strict ? options.stricted : options.firstRestricted;
  17924. this.throwUnexpectedToken(token, options.message);
  17925. }
  17926. return {
  17927. simple: options.simple,
  17928. params: params,
  17929. stricted: options.stricted,
  17930. firstRestricted: options.firstRestricted,
  17931. message: options.message
  17932. };
  17933. };
  17934. Parser.prototype.parseAssignmentExpression = function () {
  17935. var expr;
  17936. if (!this.context.allowYield && this.matchKeyword('yield')) {
  17937. expr = this.parseYieldExpression();
  17938. }
  17939. else {
  17940. var startToken = this.lookahead;
  17941. var token = startToken;
  17942. expr = this.parseConditionalExpression();
  17943. if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') {
  17944. if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) {
  17945. var arg = this.parsePrimaryExpression();
  17946. this.reinterpretExpressionAsPattern(arg);
  17947. expr = {
  17948. type: ArrowParameterPlaceHolder,
  17949. params: [arg],
  17950. async: true
  17951. };
  17952. }
  17953. }
  17954. if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) {
  17955. // https://tc39.github.io/ecma262/#sec-arrow-function-definitions
  17956. this.context.isAssignmentTarget = false;
  17957. this.context.isBindingElement = false;
  17958. var isAsync = expr.async;
  17959. var list = this.reinterpretAsCoverFormalsList(expr);
  17960. if (list) {
  17961. if (this.hasLineTerminator) {
  17962. this.tolerateUnexpectedToken(this.lookahead);
  17963. }
  17964. this.context.firstCoverInitializedNameError = null;
  17965. var previousStrict = this.context.strict;
  17966. var previousAllowStrictDirective = this.context.allowStrictDirective;
  17967. this.context.allowStrictDirective = list.simple;
  17968. var previousAllowYield = this.context.allowYield;
  17969. var previousAwait = this.context.await;
  17970. this.context.allowYield = true;
  17971. this.context.await = isAsync;
  17972. var node = this.startNode(startToken);
  17973. this.expect('=>');
  17974. var body = void 0;
  17975. if (this.match('{')) {
  17976. var previousAllowIn = this.context.allowIn;
  17977. this.context.allowIn = true;
  17978. body = this.parseFunctionSourceElements();
  17979. this.context.allowIn = previousAllowIn;
  17980. }
  17981. else {
  17982. body = this.isolateCoverGrammar(this.parseAssignmentExpression);
  17983. }
  17984. var expression = body.type !== syntax_1.Syntax.BlockStatement;
  17985. if (this.context.strict && list.firstRestricted) {
  17986. this.throwUnexpectedToken(list.firstRestricted, list.message);
  17987. }
  17988. if (this.context.strict && list.stricted) {
  17989. this.tolerateUnexpectedToken(list.stricted, list.message);
  17990. }
  17991. expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) :
  17992. this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression));
  17993. this.context.strict = previousStrict;
  17994. this.context.allowStrictDirective = previousAllowStrictDirective;
  17995. this.context.allowYield = previousAllowYield;
  17996. this.context.await = previousAwait;
  17997. }
  17998. }
  17999. else {
  18000. if (this.matchAssign()) {
  18001. if (!this.context.isAssignmentTarget) {
  18002. this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
  18003. }
  18004. if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
  18005. var id = expr;
  18006. if (this.scanner.isRestrictedWord(id.name)) {
  18007. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
  18008. }
  18009. if (this.scanner.isStrictModeReservedWord(id.name)) {
  18010. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
  18011. }
  18012. }
  18013. if (!this.match('=')) {
  18014. this.context.isAssignmentTarget = false;
  18015. this.context.isBindingElement = false;
  18016. }
  18017. else {
  18018. this.reinterpretExpressionAsPattern(expr);
  18019. }
  18020. token = this.nextToken();
  18021. var operator = token.value;
  18022. var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
  18023. expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right));
  18024. this.context.firstCoverInitializedNameError = null;
  18025. }
  18026. }
  18027. }
  18028. return expr;
  18029. };
  18030. // https://tc39.github.io/ecma262/#sec-comma-operator
  18031. Parser.prototype.parseExpression = function () {
  18032. var startToken = this.lookahead;
  18033. var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
  18034. if (this.match(',')) {
  18035. var expressions = [];
  18036. expressions.push(expr);
  18037. while (this.lookahead.type !== 2 /* EOF */) {
  18038. if (!this.match(',')) {
  18039. break;
  18040. }
  18041. this.nextToken();
  18042. expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
  18043. }
  18044. expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
  18045. }
  18046. return expr;
  18047. };
  18048. // https://tc39.github.io/ecma262/#sec-block
  18049. Parser.prototype.parseStatementListItem = function () {
  18050. var statement;
  18051. this.context.isAssignmentTarget = true;
  18052. this.context.isBindingElement = true;
  18053. if (this.lookahead.type === 4 /* Keyword */) {
  18054. switch (this.lookahead.value) {
  18055. case 'export':
  18056. if (!this.context.isModule) {
  18057. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
  18058. }
  18059. statement = this.parseExportDeclaration();
  18060. break;
  18061. case 'import':
  18062. if (!this.context.isModule) {
  18063. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
  18064. }
  18065. statement = this.parseImportDeclaration();
  18066. break;
  18067. case 'const':
  18068. statement = this.parseLexicalDeclaration({ inFor: false });
  18069. break;
  18070. case 'function':
  18071. statement = this.parseFunctionDeclaration();
  18072. break;
  18073. case 'class':
  18074. statement = this.parseClassDeclaration();
  18075. break;
  18076. case 'let':
  18077. statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
  18078. break;
  18079. default:
  18080. statement = this.parseStatement();
  18081. break;
  18082. }
  18083. }
  18084. else {
  18085. statement = this.parseStatement();
  18086. }
  18087. return statement;
  18088. };
  18089. Parser.prototype.parseBlock = function () {
  18090. var node = this.createNode();
  18091. this.expect('{');
  18092. var block = [];
  18093. while (true) {
  18094. if (this.match('}')) {
  18095. break;
  18096. }
  18097. block.push(this.parseStatementListItem());
  18098. }
  18099. this.expect('}');
  18100. return this.finalize(node, new Node.BlockStatement(block));
  18101. };
  18102. // https://tc39.github.io/ecma262/#sec-let-and-const-declarations
  18103. Parser.prototype.parseLexicalBinding = function (kind, options) {
  18104. var node = this.createNode();
  18105. var params = [];
  18106. var id = this.parsePattern(params, kind);
  18107. if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
  18108. if (this.scanner.isRestrictedWord(id.name)) {
  18109. this.tolerateError(messages_1.Messages.StrictVarName);
  18110. }
  18111. }
  18112. var init = null;
  18113. if (kind === 'const') {
  18114. if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) {
  18115. if (this.match('=')) {
  18116. this.nextToken();
  18117. init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  18118. }
  18119. else {
  18120. this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const');
  18121. }
  18122. }
  18123. }
  18124. else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) {
  18125. this.expect('=');
  18126. init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  18127. }
  18128. return this.finalize(node, new Node.VariableDeclarator(id, init));
  18129. };
  18130. Parser.prototype.parseBindingList = function (kind, options) {
  18131. var list = [this.parseLexicalBinding(kind, options)];
  18132. while (this.match(',')) {
  18133. this.nextToken();
  18134. list.push(this.parseLexicalBinding(kind, options));
  18135. }
  18136. return list;
  18137. };
  18138. Parser.prototype.isLexicalDeclaration = function () {
  18139. var state = this.scanner.saveState();
  18140. this.scanner.scanComments();
  18141. var next = this.scanner.lex();
  18142. this.scanner.restoreState(state);
  18143. return (next.type === 3 /* Identifier */) ||
  18144. (next.type === 7 /* Punctuator */ && next.value === '[') ||
  18145. (next.type === 7 /* Punctuator */ && next.value === '{') ||
  18146. (next.type === 4 /* Keyword */ && next.value === 'let') ||
  18147. (next.type === 4 /* Keyword */ && next.value === 'yield');
  18148. };
  18149. Parser.prototype.parseLexicalDeclaration = function (options) {
  18150. var node = this.createNode();
  18151. var kind = this.nextToken().value;
  18152. assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
  18153. var declarations = this.parseBindingList(kind, options);
  18154. this.consumeSemicolon();
  18155. return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
  18156. };
  18157. // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
  18158. Parser.prototype.parseBindingRestElement = function (params, kind) {
  18159. var node = this.createNode();
  18160. this.expect('...');
  18161. var arg = this.parsePattern(params, kind);
  18162. return this.finalize(node, new Node.RestElement(arg));
  18163. };
  18164. Parser.prototype.parseArrayPattern = function (params, kind) {
  18165. var node = this.createNode();
  18166. this.expect('[');
  18167. var elements = [];
  18168. while (!this.match(']')) {
  18169. if (this.match(',')) {
  18170. this.nextToken();
  18171. elements.push(null);
  18172. }
  18173. else {
  18174. if (this.match('...')) {
  18175. elements.push(this.parseBindingRestElement(params, kind));
  18176. break;
  18177. }
  18178. else {
  18179. elements.push(this.parsePatternWithDefault(params, kind));
  18180. }
  18181. if (!this.match(']')) {
  18182. this.expect(',');
  18183. }
  18184. }
  18185. }
  18186. this.expect(']');
  18187. return this.finalize(node, new Node.ArrayPattern(elements));
  18188. };
  18189. Parser.prototype.parsePropertyPattern = function (params, kind) {
  18190. var node = this.createNode();
  18191. var computed = false;
  18192. var shorthand = false;
  18193. var method = false;
  18194. var key;
  18195. var value;
  18196. if (this.lookahead.type === 3 /* Identifier */) {
  18197. var keyToken = this.lookahead;
  18198. key = this.parseVariableIdentifier();
  18199. var init = this.finalize(node, new Node.Identifier(keyToken.value));
  18200. if (this.match('=')) {
  18201. params.push(keyToken);
  18202. shorthand = true;
  18203. this.nextToken();
  18204. var expr = this.parseAssignmentExpression();
  18205. value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr));
  18206. }
  18207. else if (!this.match(':')) {
  18208. params.push(keyToken);
  18209. shorthand = true;
  18210. value = init;
  18211. }
  18212. else {
  18213. this.expect(':');
  18214. value = this.parsePatternWithDefault(params, kind);
  18215. }
  18216. }
  18217. else {
  18218. computed = this.match('[');
  18219. key = this.parseObjectPropertyKey();
  18220. this.expect(':');
  18221. value = this.parsePatternWithDefault(params, kind);
  18222. }
  18223. return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand));
  18224. };
  18225. Parser.prototype.parseObjectPattern = function (params, kind) {
  18226. var node = this.createNode();
  18227. var properties = [];
  18228. this.expect('{');
  18229. while (!this.match('}')) {
  18230. properties.push(this.parsePropertyPattern(params, kind));
  18231. if (!this.match('}')) {
  18232. this.expect(',');
  18233. }
  18234. }
  18235. this.expect('}');
  18236. return this.finalize(node, new Node.ObjectPattern(properties));
  18237. };
  18238. Parser.prototype.parsePattern = function (params, kind) {
  18239. var pattern;
  18240. if (this.match('[')) {
  18241. pattern = this.parseArrayPattern(params, kind);
  18242. }
  18243. else if (this.match('{')) {
  18244. pattern = this.parseObjectPattern(params, kind);
  18245. }
  18246. else {
  18247. if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) {
  18248. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
  18249. }
  18250. params.push(this.lookahead);
  18251. pattern = this.parseVariableIdentifier(kind);
  18252. }
  18253. return pattern;
  18254. };
  18255. Parser.prototype.parsePatternWithDefault = function (params, kind) {
  18256. var startToken = this.lookahead;
  18257. var pattern = this.parsePattern(params, kind);
  18258. if (this.match('=')) {
  18259. this.nextToken();
  18260. var previousAllowYield = this.context.allowYield;
  18261. this.context.allowYield = true;
  18262. var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
  18263. this.context.allowYield = previousAllowYield;
  18264. pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
  18265. }
  18266. return pattern;
  18267. };
  18268. // https://tc39.github.io/ecma262/#sec-variable-statement
  18269. Parser.prototype.parseVariableIdentifier = function (kind) {
  18270. var node = this.createNode();
  18271. var token = this.nextToken();
  18272. if (token.type === 4 /* Keyword */ && token.value === 'yield') {
  18273. if (this.context.strict) {
  18274. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
  18275. }
  18276. else if (!this.context.allowYield) {
  18277. this.throwUnexpectedToken(token);
  18278. }
  18279. }
  18280. else if (token.type !== 3 /* Identifier */) {
  18281. if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) {
  18282. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
  18283. }
  18284. else {
  18285. if (this.context.strict || token.value !== 'let' || kind !== 'var') {
  18286. this.throwUnexpectedToken(token);
  18287. }
  18288. }
  18289. }
  18290. else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') {
  18291. this.tolerateUnexpectedToken(token);
  18292. }
  18293. return this.finalize(node, new Node.Identifier(token.value));
  18294. };
  18295. Parser.prototype.parseVariableDeclaration = function (options) {
  18296. var node = this.createNode();
  18297. var params = [];
  18298. var id = this.parsePattern(params, 'var');
  18299. if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
  18300. if (this.scanner.isRestrictedWord(id.name)) {
  18301. this.tolerateError(messages_1.Messages.StrictVarName);
  18302. }
  18303. }
  18304. var init = null;
  18305. if (this.match('=')) {
  18306. this.nextToken();
  18307. init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  18308. }
  18309. else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
  18310. this.expect('=');
  18311. }
  18312. return this.finalize(node, new Node.VariableDeclarator(id, init));
  18313. };
  18314. Parser.prototype.parseVariableDeclarationList = function (options) {
  18315. var opt = { inFor: options.inFor };
  18316. var list = [];
  18317. list.push(this.parseVariableDeclaration(opt));
  18318. while (this.match(',')) {
  18319. this.nextToken();
  18320. list.push(this.parseVariableDeclaration(opt));
  18321. }
  18322. return list;
  18323. };
  18324. Parser.prototype.parseVariableStatement = function () {
  18325. var node = this.createNode();
  18326. this.expectKeyword('var');
  18327. var declarations = this.parseVariableDeclarationList({ inFor: false });
  18328. this.consumeSemicolon();
  18329. return this.finalize(node, new Node.VariableDeclaration(declarations, 'var'));
  18330. };
  18331. // https://tc39.github.io/ecma262/#sec-empty-statement
  18332. Parser.prototype.parseEmptyStatement = function () {
  18333. var node = this.createNode();
  18334. this.expect(';');
  18335. return this.finalize(node, new Node.EmptyStatement());
  18336. };
  18337. // https://tc39.github.io/ecma262/#sec-expression-statement
  18338. Parser.prototype.parseExpressionStatement = function () {
  18339. var node = this.createNode();
  18340. var expr = this.parseExpression();
  18341. this.consumeSemicolon();
  18342. return this.finalize(node, new Node.ExpressionStatement(expr));
  18343. };
  18344. // https://tc39.github.io/ecma262/#sec-if-statement
  18345. Parser.prototype.parseIfClause = function () {
  18346. if (this.context.strict && this.matchKeyword('function')) {
  18347. this.tolerateError(messages_1.Messages.StrictFunction);
  18348. }
  18349. return this.parseStatement();
  18350. };
  18351. Parser.prototype.parseIfStatement = function () {
  18352. var node = this.createNode();
  18353. var consequent;
  18354. var alternate = null;
  18355. this.expectKeyword('if');
  18356. this.expect('(');
  18357. var test = this.parseExpression();
  18358. if (!this.match(')') && this.config.tolerant) {
  18359. this.tolerateUnexpectedToken(this.nextToken());
  18360. consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
  18361. }
  18362. else {
  18363. this.expect(')');
  18364. consequent = this.parseIfClause();
  18365. if (this.matchKeyword('else')) {
  18366. this.nextToken();
  18367. alternate = this.parseIfClause();
  18368. }
  18369. }
  18370. return this.finalize(node, new Node.IfStatement(test, consequent, alternate));
  18371. };
  18372. // https://tc39.github.io/ecma262/#sec-do-while-statement
  18373. Parser.prototype.parseDoWhileStatement = function () {
  18374. var node = this.createNode();
  18375. this.expectKeyword('do');
  18376. var previousInIteration = this.context.inIteration;
  18377. this.context.inIteration = true;
  18378. var body = this.parseStatement();
  18379. this.context.inIteration = previousInIteration;
  18380. this.expectKeyword('while');
  18381. this.expect('(');
  18382. var test = this.parseExpression();
  18383. if (!this.match(')') && this.config.tolerant) {
  18384. this.tolerateUnexpectedToken(this.nextToken());
  18385. }
  18386. else {
  18387. this.expect(')');
  18388. if (this.match(';')) {
  18389. this.nextToken();
  18390. }
  18391. }
  18392. return this.finalize(node, new Node.DoWhileStatement(body, test));
  18393. };
  18394. // https://tc39.github.io/ecma262/#sec-while-statement
  18395. Parser.prototype.parseWhileStatement = function () {
  18396. var node = this.createNode();
  18397. var body;
  18398. this.expectKeyword('while');
  18399. this.expect('(');
  18400. var test = this.parseExpression();
  18401. if (!this.match(')') && this.config.tolerant) {
  18402. this.tolerateUnexpectedToken(this.nextToken());
  18403. body = this.finalize(this.createNode(), new Node.EmptyStatement());
  18404. }
  18405. else {
  18406. this.expect(')');
  18407. var previousInIteration = this.context.inIteration;
  18408. this.context.inIteration = true;
  18409. body = this.parseStatement();
  18410. this.context.inIteration = previousInIteration;
  18411. }
  18412. return this.finalize(node, new Node.WhileStatement(test, body));
  18413. };
  18414. // https://tc39.github.io/ecma262/#sec-for-statement
  18415. // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements
  18416. Parser.prototype.parseForStatement = function () {
  18417. var init = null;
  18418. var test = null;
  18419. var update = null;
  18420. var forIn = true;
  18421. var left, right;
  18422. var node = this.createNode();
  18423. this.expectKeyword('for');
  18424. this.expect('(');
  18425. if (this.match(';')) {
  18426. this.nextToken();
  18427. }
  18428. else {
  18429. if (this.matchKeyword('var')) {
  18430. init = this.createNode();
  18431. this.nextToken();
  18432. var previousAllowIn = this.context.allowIn;
  18433. this.context.allowIn = false;
  18434. var declarations = this.parseVariableDeclarationList({ inFor: true });
  18435. this.context.allowIn = previousAllowIn;
  18436. if (declarations.length === 1 && this.matchKeyword('in')) {
  18437. var decl = declarations[0];
  18438. if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
  18439. this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in');
  18440. }
  18441. init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
  18442. this.nextToken();
  18443. left = init;
  18444. right = this.parseExpression();
  18445. init = null;
  18446. }
  18447. else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
  18448. init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
  18449. this.nextToken();
  18450. left = init;
  18451. right = this.parseAssignmentExpression();
  18452. init = null;
  18453. forIn = false;
  18454. }
  18455. else {
  18456. init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
  18457. this.expect(';');
  18458. }
  18459. }
  18460. else if (this.matchKeyword('const') || this.matchKeyword('let')) {
  18461. init = this.createNode();
  18462. var kind = this.nextToken().value;
  18463. if (!this.context.strict && this.lookahead.value === 'in') {
  18464. init = this.finalize(init, new Node.Identifier(kind));
  18465. this.nextToken();
  18466. left = init;
  18467. right = this.parseExpression();
  18468. init = null;
  18469. }
  18470. else {
  18471. var previousAllowIn = this.context.allowIn;
  18472. this.context.allowIn = false;
  18473. var declarations = this.parseBindingList(kind, { inFor: true });
  18474. this.context.allowIn = previousAllowIn;
  18475. if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
  18476. init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
  18477. this.nextToken();
  18478. left = init;
  18479. right = this.parseExpression();
  18480. init = null;
  18481. }
  18482. else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
  18483. init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
  18484. this.nextToken();
  18485. left = init;
  18486. right = this.parseAssignmentExpression();
  18487. init = null;
  18488. forIn = false;
  18489. }
  18490. else {
  18491. this.consumeSemicolon();
  18492. init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
  18493. }
  18494. }
  18495. }
  18496. else {
  18497. var initStartToken = this.lookahead;
  18498. var previousAllowIn = this.context.allowIn;
  18499. this.context.allowIn = false;
  18500. init = this.inheritCoverGrammar(this.parseAssignmentExpression);
  18501. this.context.allowIn = previousAllowIn;
  18502. if (this.matchKeyword('in')) {
  18503. if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
  18504. this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
  18505. }
  18506. this.nextToken();
  18507. this.reinterpretExpressionAsPattern(init);
  18508. left = init;
  18509. right = this.parseExpression();
  18510. init = null;
  18511. }
  18512. else if (this.matchContextualKeyword('of')) {
  18513. if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
  18514. this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
  18515. }
  18516. this.nextToken();
  18517. this.reinterpretExpressionAsPattern(init);
  18518. left = init;
  18519. right = this.parseAssignmentExpression();
  18520. init = null;
  18521. forIn = false;
  18522. }
  18523. else {
  18524. if (this.match(',')) {
  18525. var initSeq = [init];
  18526. while (this.match(',')) {
  18527. this.nextToken();
  18528. initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
  18529. }
  18530. init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
  18531. }
  18532. this.expect(';');
  18533. }
  18534. }
  18535. }
  18536. if (typeof left === 'undefined') {
  18537. if (!this.match(';')) {
  18538. test = this.parseExpression();
  18539. }
  18540. this.expect(';');
  18541. if (!this.match(')')) {
  18542. update = this.parseExpression();
  18543. }
  18544. }
  18545. var body;
  18546. if (!this.match(')') && this.config.tolerant) {
  18547. this.tolerateUnexpectedToken(this.nextToken());
  18548. body = this.finalize(this.createNode(), new Node.EmptyStatement());
  18549. }
  18550. else {
  18551. this.expect(')');
  18552. var previousInIteration = this.context.inIteration;
  18553. this.context.inIteration = true;
  18554. body = this.isolateCoverGrammar(this.parseStatement);
  18555. this.context.inIteration = previousInIteration;
  18556. }
  18557. return (typeof left === 'undefined') ?
  18558. this.finalize(node, new Node.ForStatement(init, test, update, body)) :
  18559. forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) :
  18560. this.finalize(node, new Node.ForOfStatement(left, right, body));
  18561. };
  18562. // https://tc39.github.io/ecma262/#sec-continue-statement
  18563. Parser.prototype.parseContinueStatement = function () {
  18564. var node = this.createNode();
  18565. this.expectKeyword('continue');
  18566. var label = null;
  18567. if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
  18568. var id = this.parseVariableIdentifier();
  18569. label = id;
  18570. var key = '$' + id.name;
  18571. if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
  18572. this.throwError(messages_1.Messages.UnknownLabel, id.name);
  18573. }
  18574. }
  18575. this.consumeSemicolon();
  18576. if (label === null && !this.context.inIteration) {
  18577. this.throwError(messages_1.Messages.IllegalContinue);
  18578. }
  18579. return this.finalize(node, new Node.ContinueStatement(label));
  18580. };
  18581. // https://tc39.github.io/ecma262/#sec-break-statement
  18582. Parser.prototype.parseBreakStatement = function () {
  18583. var node = this.createNode();
  18584. this.expectKeyword('break');
  18585. var label = null;
  18586. if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
  18587. var id = this.parseVariableIdentifier();
  18588. var key = '$' + id.name;
  18589. if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
  18590. this.throwError(messages_1.Messages.UnknownLabel, id.name);
  18591. }
  18592. label = id;
  18593. }
  18594. this.consumeSemicolon();
  18595. if (label === null && !this.context.inIteration && !this.context.inSwitch) {
  18596. this.throwError(messages_1.Messages.IllegalBreak);
  18597. }
  18598. return this.finalize(node, new Node.BreakStatement(label));
  18599. };
  18600. // https://tc39.github.io/ecma262/#sec-return-statement
  18601. Parser.prototype.parseReturnStatement = function () {
  18602. if (!this.context.inFunctionBody) {
  18603. this.tolerateError(messages_1.Messages.IllegalReturn);
  18604. }
  18605. var node = this.createNode();
  18606. this.expectKeyword('return');
  18607. var hasArgument = !this.match(';') && !this.match('}') &&
  18608. !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */;
  18609. var argument = hasArgument ? this.parseExpression() : null;
  18610. this.consumeSemicolon();
  18611. return this.finalize(node, new Node.ReturnStatement(argument));
  18612. };
  18613. // https://tc39.github.io/ecma262/#sec-with-statement
  18614. Parser.prototype.parseWithStatement = function () {
  18615. if (this.context.strict) {
  18616. this.tolerateError(messages_1.Messages.StrictModeWith);
  18617. }
  18618. var node = this.createNode();
  18619. var body;
  18620. this.expectKeyword('with');
  18621. this.expect('(');
  18622. var object = this.parseExpression();
  18623. if (!this.match(')') && this.config.tolerant) {
  18624. this.tolerateUnexpectedToken(this.nextToken());
  18625. body = this.finalize(this.createNode(), new Node.EmptyStatement());
  18626. }
  18627. else {
  18628. this.expect(')');
  18629. body = this.parseStatement();
  18630. }
  18631. return this.finalize(node, new Node.WithStatement(object, body));
  18632. };
  18633. // https://tc39.github.io/ecma262/#sec-switch-statement
  18634. Parser.prototype.parseSwitchCase = function () {
  18635. var node = this.createNode();
  18636. var test;
  18637. if (this.matchKeyword('default')) {
  18638. this.nextToken();
  18639. test = null;
  18640. }
  18641. else {
  18642. this.expectKeyword('case');
  18643. test = this.parseExpression();
  18644. }
  18645. this.expect(':');
  18646. var consequent = [];
  18647. while (true) {
  18648. if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) {
  18649. break;
  18650. }
  18651. consequent.push(this.parseStatementListItem());
  18652. }
  18653. return this.finalize(node, new Node.SwitchCase(test, consequent));
  18654. };
  18655. Parser.prototype.parseSwitchStatement = function () {
  18656. var node = this.createNode();
  18657. this.expectKeyword('switch');
  18658. this.expect('(');
  18659. var discriminant = this.parseExpression();
  18660. this.expect(')');
  18661. var previousInSwitch = this.context.inSwitch;
  18662. this.context.inSwitch = true;
  18663. var cases = [];
  18664. var defaultFound = false;
  18665. this.expect('{');
  18666. while (true) {
  18667. if (this.match('}')) {
  18668. break;
  18669. }
  18670. var clause = this.parseSwitchCase();
  18671. if (clause.test === null) {
  18672. if (defaultFound) {
  18673. this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
  18674. }
  18675. defaultFound = true;
  18676. }
  18677. cases.push(clause);
  18678. }
  18679. this.expect('}');
  18680. this.context.inSwitch = previousInSwitch;
  18681. return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
  18682. };
  18683. // https://tc39.github.io/ecma262/#sec-labelled-statements
  18684. Parser.prototype.parseLabelledStatement = function () {
  18685. var node = this.createNode();
  18686. var expr = this.parseExpression();
  18687. var statement;
  18688. if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) {
  18689. this.nextToken();
  18690. var id = expr;
  18691. var key = '$' + id.name;
  18692. if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
  18693. this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name);
  18694. }
  18695. this.context.labelSet[key] = true;
  18696. var body = void 0;
  18697. if (this.matchKeyword('class')) {
  18698. this.tolerateUnexpectedToken(this.lookahead);
  18699. body = this.parseClassDeclaration();
  18700. }
  18701. else if (this.matchKeyword('function')) {
  18702. var token = this.lookahead;
  18703. var declaration = this.parseFunctionDeclaration();
  18704. if (this.context.strict) {
  18705. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
  18706. }
  18707. else if (declaration.generator) {
  18708. this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
  18709. }
  18710. body = declaration;
  18711. }
  18712. else {
  18713. body = this.parseStatement();
  18714. }
  18715. delete this.context.labelSet[key];
  18716. statement = new Node.LabeledStatement(id, body);
  18717. }
  18718. else {
  18719. this.consumeSemicolon();
  18720. statement = new Node.ExpressionStatement(expr);
  18721. }
  18722. return this.finalize(node, statement);
  18723. };
  18724. // https://tc39.github.io/ecma262/#sec-throw-statement
  18725. Parser.prototype.parseThrowStatement = function () {
  18726. var node = this.createNode();
  18727. this.expectKeyword('throw');
  18728. if (this.hasLineTerminator) {
  18729. this.throwError(messages_1.Messages.NewlineAfterThrow);
  18730. }
  18731. var argument = this.parseExpression();
  18732. this.consumeSemicolon();
  18733. return this.finalize(node, new Node.ThrowStatement(argument));
  18734. };
  18735. // https://tc39.github.io/ecma262/#sec-try-statement
  18736. Parser.prototype.parseCatchClause = function () {
  18737. var node = this.createNode();
  18738. this.expectKeyword('catch');
  18739. this.expect('(');
  18740. if (this.match(')')) {
  18741. this.throwUnexpectedToken(this.lookahead);
  18742. }
  18743. var params = [];
  18744. var param = this.parsePattern(params);
  18745. var paramMap = {};
  18746. for (var i = 0; i < params.length; i++) {
  18747. var key = '$' + params[i].value;
  18748. if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
  18749. this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value);
  18750. }
  18751. paramMap[key] = true;
  18752. }
  18753. if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
  18754. if (this.scanner.isRestrictedWord(param.name)) {
  18755. this.tolerateError(messages_1.Messages.StrictCatchVariable);
  18756. }
  18757. }
  18758. this.expect(')');
  18759. var body = this.parseBlock();
  18760. return this.finalize(node, new Node.CatchClause(param, body));
  18761. };
  18762. Parser.prototype.parseFinallyClause = function () {
  18763. this.expectKeyword('finally');
  18764. return this.parseBlock();
  18765. };
  18766. Parser.prototype.parseTryStatement = function () {
  18767. var node = this.createNode();
  18768. this.expectKeyword('try');
  18769. var block = this.parseBlock();
  18770. var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null;
  18771. var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null;
  18772. if (!handler && !finalizer) {
  18773. this.throwError(messages_1.Messages.NoCatchOrFinally);
  18774. }
  18775. return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
  18776. };
  18777. // https://tc39.github.io/ecma262/#sec-debugger-statement
  18778. Parser.prototype.parseDebuggerStatement = function () {
  18779. var node = this.createNode();
  18780. this.expectKeyword('debugger');
  18781. this.consumeSemicolon();
  18782. return this.finalize(node, new Node.DebuggerStatement());
  18783. };
  18784. // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations
  18785. Parser.prototype.parseStatement = function () {
  18786. var statement;
  18787. switch (this.lookahead.type) {
  18788. case 1 /* BooleanLiteral */:
  18789. case 5 /* NullLiteral */:
  18790. case 6 /* NumericLiteral */:
  18791. case 8 /* StringLiteral */:
  18792. case 10 /* Template */:
  18793. case 9 /* RegularExpression */:
  18794. statement = this.parseExpressionStatement();
  18795. break;
  18796. case 7 /* Punctuator */:
  18797. var value = this.lookahead.value;
  18798. if (value === '{') {
  18799. statement = this.parseBlock();
  18800. }
  18801. else if (value === '(') {
  18802. statement = this.parseExpressionStatement();
  18803. }
  18804. else if (value === ';') {
  18805. statement = this.parseEmptyStatement();
  18806. }
  18807. else {
  18808. statement = this.parseExpressionStatement();
  18809. }
  18810. break;
  18811. case 3 /* Identifier */:
  18812. statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
  18813. break;
  18814. case 4 /* Keyword */:
  18815. switch (this.lookahead.value) {
  18816. case 'break':
  18817. statement = this.parseBreakStatement();
  18818. break;
  18819. case 'continue':
  18820. statement = this.parseContinueStatement();
  18821. break;
  18822. case 'debugger':
  18823. statement = this.parseDebuggerStatement();
  18824. break;
  18825. case 'do':
  18826. statement = this.parseDoWhileStatement();
  18827. break;
  18828. case 'for':
  18829. statement = this.parseForStatement();
  18830. break;
  18831. case 'function':
  18832. statement = this.parseFunctionDeclaration();
  18833. break;
  18834. case 'if':
  18835. statement = this.parseIfStatement();
  18836. break;
  18837. case 'return':
  18838. statement = this.parseReturnStatement();
  18839. break;
  18840. case 'switch':
  18841. statement = this.parseSwitchStatement();
  18842. break;
  18843. case 'throw':
  18844. statement = this.parseThrowStatement();
  18845. break;
  18846. case 'try':
  18847. statement = this.parseTryStatement();
  18848. break;
  18849. case 'var':
  18850. statement = this.parseVariableStatement();
  18851. break;
  18852. case 'while':
  18853. statement = this.parseWhileStatement();
  18854. break;
  18855. case 'with':
  18856. statement = this.parseWithStatement();
  18857. break;
  18858. default:
  18859. statement = this.parseExpressionStatement();
  18860. break;
  18861. }
  18862. break;
  18863. default:
  18864. statement = this.throwUnexpectedToken(this.lookahead);
  18865. }
  18866. return statement;
  18867. };
  18868. // https://tc39.github.io/ecma262/#sec-function-definitions
  18869. Parser.prototype.parseFunctionSourceElements = function () {
  18870. var node = this.createNode();
  18871. this.expect('{');
  18872. var body = this.parseDirectivePrologues();
  18873. var previousLabelSet = this.context.labelSet;
  18874. var previousInIteration = this.context.inIteration;
  18875. var previousInSwitch = this.context.inSwitch;
  18876. var previousInFunctionBody = this.context.inFunctionBody;
  18877. this.context.labelSet = {};
  18878. this.context.inIteration = false;
  18879. this.context.inSwitch = false;
  18880. this.context.inFunctionBody = true;
  18881. while (this.lookahead.type !== 2 /* EOF */) {
  18882. if (this.match('}')) {
  18883. break;
  18884. }
  18885. body.push(this.parseStatementListItem());
  18886. }
  18887. this.expect('}');
  18888. this.context.labelSet = previousLabelSet;
  18889. this.context.inIteration = previousInIteration;
  18890. this.context.inSwitch = previousInSwitch;
  18891. this.context.inFunctionBody = previousInFunctionBody;
  18892. return this.finalize(node, new Node.BlockStatement(body));
  18893. };
  18894. Parser.prototype.validateParam = function (options, param, name) {
  18895. var key = '$' + name;
  18896. if (this.context.strict) {
  18897. if (this.scanner.isRestrictedWord(name)) {
  18898. options.stricted = param;
  18899. options.message = messages_1.Messages.StrictParamName;
  18900. }
  18901. if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
  18902. options.stricted = param;
  18903. options.message = messages_1.Messages.StrictParamDupe;
  18904. }
  18905. }
  18906. else if (!options.firstRestricted) {
  18907. if (this.scanner.isRestrictedWord(name)) {
  18908. options.firstRestricted = param;
  18909. options.message = messages_1.Messages.StrictParamName;
  18910. }
  18911. else if (this.scanner.isStrictModeReservedWord(name)) {
  18912. options.firstRestricted = param;
  18913. options.message = messages_1.Messages.StrictReservedWord;
  18914. }
  18915. else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
  18916. options.stricted = param;
  18917. options.message = messages_1.Messages.StrictParamDupe;
  18918. }
  18919. }
  18920. /* istanbul ignore next */
  18921. if (typeof Object.defineProperty === 'function') {
  18922. Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true });
  18923. }
  18924. else {
  18925. options.paramSet[key] = true;
  18926. }
  18927. };
  18928. Parser.prototype.parseRestElement = function (params) {
  18929. var node = this.createNode();
  18930. this.expect('...');
  18931. var arg = this.parsePattern(params);
  18932. if (this.match('=')) {
  18933. this.throwError(messages_1.Messages.DefaultRestParameter);
  18934. }
  18935. if (!this.match(')')) {
  18936. this.throwError(messages_1.Messages.ParameterAfterRestParameter);
  18937. }
  18938. return this.finalize(node, new Node.RestElement(arg));
  18939. };
  18940. Parser.prototype.parseFormalParameter = function (options) {
  18941. var params = [];
  18942. var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
  18943. for (var i = 0; i < params.length; i++) {
  18944. this.validateParam(options, params[i], params[i].value);
  18945. }
  18946. options.simple = options.simple && (param instanceof Node.Identifier);
  18947. options.params.push(param);
  18948. };
  18949. Parser.prototype.parseFormalParameters = function (firstRestricted) {
  18950. var options;
  18951. options = {
  18952. simple: true,
  18953. params: [],
  18954. firstRestricted: firstRestricted
  18955. };
  18956. this.expect('(');
  18957. if (!this.match(')')) {
  18958. options.paramSet = {};
  18959. while (this.lookahead.type !== 2 /* EOF */) {
  18960. this.parseFormalParameter(options);
  18961. if (this.match(')')) {
  18962. break;
  18963. }
  18964. this.expect(',');
  18965. if (this.match(')')) {
  18966. break;
  18967. }
  18968. }
  18969. }
  18970. this.expect(')');
  18971. return {
  18972. simple: options.simple,
  18973. params: options.params,
  18974. stricted: options.stricted,
  18975. firstRestricted: options.firstRestricted,
  18976. message: options.message
  18977. };
  18978. };
  18979. Parser.prototype.matchAsyncFunction = function () {
  18980. var match = this.matchContextualKeyword('async');
  18981. if (match) {
  18982. var state = this.scanner.saveState();
  18983. this.scanner.scanComments();
  18984. var next = this.scanner.lex();
  18985. this.scanner.restoreState(state);
  18986. match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function');
  18987. }
  18988. return match;
  18989. };
  18990. Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) {
  18991. var node = this.createNode();
  18992. var isAsync = this.matchContextualKeyword('async');
  18993. if (isAsync) {
  18994. this.nextToken();
  18995. }
  18996. this.expectKeyword('function');
  18997. var isGenerator = isAsync ? false : this.match('*');
  18998. if (isGenerator) {
  18999. this.nextToken();
  19000. }
  19001. var message;
  19002. var id = null;
  19003. var firstRestricted = null;
  19004. if (!identifierIsOptional || !this.match('(')) {
  19005. var token = this.lookahead;
  19006. id = this.parseVariableIdentifier();
  19007. if (this.context.strict) {
  19008. if (this.scanner.isRestrictedWord(token.value)) {
  19009. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
  19010. }
  19011. }
  19012. else {
  19013. if (this.scanner.isRestrictedWord(token.value)) {
  19014. firstRestricted = token;
  19015. message = messages_1.Messages.StrictFunctionName;
  19016. }
  19017. else if (this.scanner.isStrictModeReservedWord(token.value)) {
  19018. firstRestricted = token;
  19019. message = messages_1.Messages.StrictReservedWord;
  19020. }
  19021. }
  19022. }
  19023. var previousAllowAwait = this.context.await;
  19024. var previousAllowYield = this.context.allowYield;
  19025. this.context.await = isAsync;
  19026. this.context.allowYield = !isGenerator;
  19027. var formalParameters = this.parseFormalParameters(firstRestricted);
  19028. var params = formalParameters.params;
  19029. var stricted = formalParameters.stricted;
  19030. firstRestricted = formalParameters.firstRestricted;
  19031. if (formalParameters.message) {
  19032. message = formalParameters.message;
  19033. }
  19034. var previousStrict = this.context.strict;
  19035. var previousAllowStrictDirective = this.context.allowStrictDirective;
  19036. this.context.allowStrictDirective = formalParameters.simple;
  19037. var body = this.parseFunctionSourceElements();
  19038. if (this.context.strict && firstRestricted) {
  19039. this.throwUnexpectedToken(firstRestricted, message);
  19040. }
  19041. if (this.context.strict && stricted) {
  19042. this.tolerateUnexpectedToken(stricted, message);
  19043. }
  19044. this.context.strict = previousStrict;
  19045. this.context.allowStrictDirective = previousAllowStrictDirective;
  19046. this.context.await = previousAllowAwait;
  19047. this.context.allowYield = previousAllowYield;
  19048. return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) :
  19049. this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator));
  19050. };
  19051. Parser.prototype.parseFunctionExpression = function () {
  19052. var node = this.createNode();
  19053. var isAsync = this.matchContextualKeyword('async');
  19054. if (isAsync) {
  19055. this.nextToken();
  19056. }
  19057. this.expectKeyword('function');
  19058. var isGenerator = isAsync ? false : this.match('*');
  19059. if (isGenerator) {
  19060. this.nextToken();
  19061. }
  19062. var message;
  19063. var id = null;
  19064. var firstRestricted;
  19065. var previousAllowAwait = this.context.await;
  19066. var previousAllowYield = this.context.allowYield;
  19067. this.context.await = isAsync;
  19068. this.context.allowYield = !isGenerator;
  19069. if (!this.match('(')) {
  19070. var token = this.lookahead;
  19071. id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier();
  19072. if (this.context.strict) {
  19073. if (this.scanner.isRestrictedWord(token.value)) {
  19074. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
  19075. }
  19076. }
  19077. else {
  19078. if (this.scanner.isRestrictedWord(token.value)) {
  19079. firstRestricted = token;
  19080. message = messages_1.Messages.StrictFunctionName;
  19081. }
  19082. else if (this.scanner.isStrictModeReservedWord(token.value)) {
  19083. firstRestricted = token;
  19084. message = messages_1.Messages.StrictReservedWord;
  19085. }
  19086. }
  19087. }
  19088. var formalParameters = this.parseFormalParameters(firstRestricted);
  19089. var params = formalParameters.params;
  19090. var stricted = formalParameters.stricted;
  19091. firstRestricted = formalParameters.firstRestricted;
  19092. if (formalParameters.message) {
  19093. message = formalParameters.message;
  19094. }
  19095. var previousStrict = this.context.strict;
  19096. var previousAllowStrictDirective = this.context.allowStrictDirective;
  19097. this.context.allowStrictDirective = formalParameters.simple;
  19098. var body = this.parseFunctionSourceElements();
  19099. if (this.context.strict && firstRestricted) {
  19100. this.throwUnexpectedToken(firstRestricted, message);
  19101. }
  19102. if (this.context.strict && stricted) {
  19103. this.tolerateUnexpectedToken(stricted, message);
  19104. }
  19105. this.context.strict = previousStrict;
  19106. this.context.allowStrictDirective = previousAllowStrictDirective;
  19107. this.context.await = previousAllowAwait;
  19108. this.context.allowYield = previousAllowYield;
  19109. return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) :
  19110. this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator));
  19111. };
  19112. // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive
  19113. Parser.prototype.parseDirective = function () {
  19114. var token = this.lookahead;
  19115. var node = this.createNode();
  19116. var expr = this.parseExpression();
  19117. var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null;
  19118. this.consumeSemicolon();
  19119. return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr));
  19120. };
  19121. Parser.prototype.parseDirectivePrologues = function () {
  19122. var firstRestricted = null;
  19123. var body = [];
  19124. while (true) {
  19125. var token = this.lookahead;
  19126. if (token.type !== 8 /* StringLiteral */) {
  19127. break;
  19128. }
  19129. var statement = this.parseDirective();
  19130. body.push(statement);
  19131. var directive = statement.directive;
  19132. if (typeof directive !== 'string') {
  19133. break;
  19134. }
  19135. if (directive === 'use strict') {
  19136. this.context.strict = true;
  19137. if (firstRestricted) {
  19138. this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
  19139. }
  19140. if (!this.context.allowStrictDirective) {
  19141. this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
  19142. }
  19143. }
  19144. else {
  19145. if (!firstRestricted && token.octal) {
  19146. firstRestricted = token;
  19147. }
  19148. }
  19149. }
  19150. return body;
  19151. };
  19152. // https://tc39.github.io/ecma262/#sec-method-definitions
  19153. Parser.prototype.qualifiedPropertyName = function (token) {
  19154. switch (token.type) {
  19155. case 3 /* Identifier */:
  19156. case 8 /* StringLiteral */:
  19157. case 1 /* BooleanLiteral */:
  19158. case 5 /* NullLiteral */:
  19159. case 6 /* NumericLiteral */:
  19160. case 4 /* Keyword */:
  19161. return true;
  19162. case 7 /* Punctuator */:
  19163. return token.value === '[';
  19164. default:
  19165. break;
  19166. }
  19167. return false;
  19168. };
  19169. Parser.prototype.parseGetterMethod = function () {
  19170. var node = this.createNode();
  19171. var isGenerator = false;
  19172. var previousAllowYield = this.context.allowYield;
  19173. this.context.allowYield = false;
  19174. var formalParameters = this.parseFormalParameters();
  19175. if (formalParameters.params.length > 0) {
  19176. this.tolerateError(messages_1.Messages.BadGetterArity);
  19177. }
  19178. var method = this.parsePropertyMethod(formalParameters);
  19179. this.context.allowYield = previousAllowYield;
  19180. return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
  19181. };
  19182. Parser.prototype.parseSetterMethod = function () {
  19183. var node = this.createNode();
  19184. var isGenerator = false;
  19185. var previousAllowYield = this.context.allowYield;
  19186. this.context.allowYield = false;
  19187. var formalParameters = this.parseFormalParameters();
  19188. if (formalParameters.params.length !== 1) {
  19189. this.tolerateError(messages_1.Messages.BadSetterArity);
  19190. }
  19191. else if (formalParameters.params[0] instanceof Node.RestElement) {
  19192. this.tolerateError(messages_1.Messages.BadSetterRestParameter);
  19193. }
  19194. var method = this.parsePropertyMethod(formalParameters);
  19195. this.context.allowYield = previousAllowYield;
  19196. return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
  19197. };
  19198. Parser.prototype.parseGeneratorMethod = function () {
  19199. var node = this.createNode();
  19200. var isGenerator = true;
  19201. var previousAllowYield = this.context.allowYield;
  19202. this.context.allowYield = true;
  19203. var params = this.parseFormalParameters();
  19204. this.context.allowYield = false;
  19205. var method = this.parsePropertyMethod(params);
  19206. this.context.allowYield = previousAllowYield;
  19207. return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
  19208. };
  19209. // https://tc39.github.io/ecma262/#sec-generator-function-definitions
  19210. Parser.prototype.isStartOfExpression = function () {
  19211. var start = true;
  19212. var value = this.lookahead.value;
  19213. switch (this.lookahead.type) {
  19214. case 7 /* Punctuator */:
  19215. start = (value === '[') || (value === '(') || (value === '{') ||
  19216. (value === '+') || (value === '-') ||
  19217. (value === '!') || (value === '~') ||
  19218. (value === '++') || (value === '--') ||
  19219. (value === '/') || (value === '/='); // regular expression literal
  19220. break;
  19221. case 4 /* Keyword */:
  19222. start = (value === 'class') || (value === 'delete') ||
  19223. (value === 'function') || (value === 'let') || (value === 'new') ||
  19224. (value === 'super') || (value === 'this') || (value === 'typeof') ||
  19225. (value === 'void') || (value === 'yield');
  19226. break;
  19227. default:
  19228. break;
  19229. }
  19230. return start;
  19231. };
  19232. Parser.prototype.parseYieldExpression = function () {
  19233. var node = this.createNode();
  19234. this.expectKeyword('yield');
  19235. var argument = null;
  19236. var delegate = false;
  19237. if (!this.hasLineTerminator) {
  19238. var previousAllowYield = this.context.allowYield;
  19239. this.context.allowYield = false;
  19240. delegate = this.match('*');
  19241. if (delegate) {
  19242. this.nextToken();
  19243. argument = this.parseAssignmentExpression();
  19244. }
  19245. else if (this.isStartOfExpression()) {
  19246. argument = this.parseAssignmentExpression();
  19247. }
  19248. this.context.allowYield = previousAllowYield;
  19249. }
  19250. return this.finalize(node, new Node.YieldExpression(argument, delegate));
  19251. };
  19252. // https://tc39.github.io/ecma262/#sec-class-definitions
  19253. Parser.prototype.parseClassElement = function (hasConstructor) {
  19254. var token = this.lookahead;
  19255. var node = this.createNode();
  19256. var kind = '';
  19257. var key = null;
  19258. var value = null;
  19259. var computed = false;
  19260. var method = false;
  19261. var isStatic = false;
  19262. var isAsync = false;
  19263. if (this.match('*')) {
  19264. this.nextToken();
  19265. }
  19266. else {
  19267. computed = this.match('[');
  19268. key = this.parseObjectPropertyKey();
  19269. var id = key;
  19270. if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) {
  19271. token = this.lookahead;
  19272. isStatic = true;
  19273. computed = this.match('[');
  19274. if (this.match('*')) {
  19275. this.nextToken();
  19276. }
  19277. else {
  19278. key = this.parseObjectPropertyKey();
  19279. }
  19280. }
  19281. if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) {
  19282. var punctuator = this.lookahead.value;
  19283. if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') {
  19284. isAsync = true;
  19285. token = this.lookahead;
  19286. key = this.parseObjectPropertyKey();
  19287. if (token.type === 3 /* Identifier */) {
  19288. if (token.value === 'get' || token.value === 'set') {
  19289. this.tolerateUnexpectedToken(token);
  19290. }
  19291. else if (token.value === 'constructor') {
  19292. this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
  19293. }
  19294. }
  19295. }
  19296. }
  19297. }
  19298. var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
  19299. if (token.type === 3 /* Identifier */) {
  19300. if (token.value === 'get' && lookaheadPropertyKey) {
  19301. kind = 'get';
  19302. computed = this.match('[');
  19303. key = this.parseObjectPropertyKey();
  19304. this.context.allowYield = false;
  19305. value = this.parseGetterMethod();
  19306. }
  19307. else if (token.value === 'set' && lookaheadPropertyKey) {
  19308. kind = 'set';
  19309. computed = this.match('[');
  19310. key = this.parseObjectPropertyKey();
  19311. value = this.parseSetterMethod();
  19312. }
  19313. }
  19314. else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
  19315. kind = 'init';
  19316. computed = this.match('[');
  19317. key = this.parseObjectPropertyKey();
  19318. value = this.parseGeneratorMethod();
  19319. method = true;
  19320. }
  19321. if (!kind && key && this.match('(')) {
  19322. kind = 'init';
  19323. value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
  19324. method = true;
  19325. }
  19326. if (!kind) {
  19327. this.throwUnexpectedToken(this.lookahead);
  19328. }
  19329. if (kind === 'init') {
  19330. kind = 'method';
  19331. }
  19332. if (!computed) {
  19333. if (isStatic && this.isPropertyKey(key, 'prototype')) {
  19334. this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
  19335. }
  19336. if (!isStatic && this.isPropertyKey(key, 'constructor')) {
  19337. if (kind !== 'method' || !method || (value && value.generator)) {
  19338. this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
  19339. }
  19340. if (hasConstructor.value) {
  19341. this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
  19342. }
  19343. else {
  19344. hasConstructor.value = true;
  19345. }
  19346. kind = 'constructor';
  19347. }
  19348. }
  19349. return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic));
  19350. };
  19351. Parser.prototype.parseClassElementList = function () {
  19352. var body = [];
  19353. var hasConstructor = { value: false };
  19354. this.expect('{');
  19355. while (!this.match('}')) {
  19356. if (this.match(';')) {
  19357. this.nextToken();
  19358. }
  19359. else {
  19360. body.push(this.parseClassElement(hasConstructor));
  19361. }
  19362. }
  19363. this.expect('}');
  19364. return body;
  19365. };
  19366. Parser.prototype.parseClassBody = function () {
  19367. var node = this.createNode();
  19368. var elementList = this.parseClassElementList();
  19369. return this.finalize(node, new Node.ClassBody(elementList));
  19370. };
  19371. Parser.prototype.parseClassDeclaration = function (identifierIsOptional) {
  19372. var node = this.createNode();
  19373. var previousStrict = this.context.strict;
  19374. this.context.strict = true;
  19375. this.expectKeyword('class');
  19376. var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier();
  19377. var superClass = null;
  19378. if (this.matchKeyword('extends')) {
  19379. this.nextToken();
  19380. superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
  19381. }
  19382. var classBody = this.parseClassBody();
  19383. this.context.strict = previousStrict;
  19384. return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody));
  19385. };
  19386. Parser.prototype.parseClassExpression = function () {
  19387. var node = this.createNode();
  19388. var previousStrict = this.context.strict;
  19389. this.context.strict = true;
  19390. this.expectKeyword('class');
  19391. var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null;
  19392. var superClass = null;
  19393. if (this.matchKeyword('extends')) {
  19394. this.nextToken();
  19395. superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
  19396. }
  19397. var classBody = this.parseClassBody();
  19398. this.context.strict = previousStrict;
  19399. return this.finalize(node, new Node.ClassExpression(id, superClass, classBody));
  19400. };
  19401. // https://tc39.github.io/ecma262/#sec-scripts
  19402. // https://tc39.github.io/ecma262/#sec-modules
  19403. Parser.prototype.parseModule = function () {
  19404. this.context.strict = true;
  19405. this.context.isModule = true;
  19406. var node = this.createNode();
  19407. var body = this.parseDirectivePrologues();
  19408. while (this.lookahead.type !== 2 /* EOF */) {
  19409. body.push(this.parseStatementListItem());
  19410. }
  19411. return this.finalize(node, new Node.Module(body));
  19412. };
  19413. Parser.prototype.parseScript = function () {
  19414. var node = this.createNode();
  19415. var body = this.parseDirectivePrologues();
  19416. while (this.lookahead.type !== 2 /* EOF */) {
  19417. body.push(this.parseStatementListItem());
  19418. }
  19419. return this.finalize(node, new Node.Script(body));
  19420. };
  19421. // https://tc39.github.io/ecma262/#sec-imports
  19422. Parser.prototype.parseModuleSpecifier = function () {
  19423. var node = this.createNode();
  19424. if (this.lookahead.type !== 8 /* StringLiteral */) {
  19425. this.throwError(messages_1.Messages.InvalidModuleSpecifier);
  19426. }
  19427. var token = this.nextToken();
  19428. var raw = this.getTokenRaw(token);
  19429. return this.finalize(node, new Node.Literal(token.value, raw));
  19430. };
  19431. // import {<foo as bar>} ...;
  19432. Parser.prototype.parseImportSpecifier = function () {
  19433. var node = this.createNode();
  19434. var imported;
  19435. var local;
  19436. if (this.lookahead.type === 3 /* Identifier */) {
  19437. imported = this.parseVariableIdentifier();
  19438. local = imported;
  19439. if (this.matchContextualKeyword('as')) {
  19440. this.nextToken();
  19441. local = this.parseVariableIdentifier();
  19442. }
  19443. }
  19444. else {
  19445. imported = this.parseIdentifierName();
  19446. local = imported;
  19447. if (this.matchContextualKeyword('as')) {
  19448. this.nextToken();
  19449. local = this.parseVariableIdentifier();
  19450. }
  19451. else {
  19452. this.throwUnexpectedToken(this.nextToken());
  19453. }
  19454. }
  19455. return this.finalize(node, new Node.ImportSpecifier(local, imported));
  19456. };
  19457. // {foo, bar as bas}
  19458. Parser.prototype.parseNamedImports = function () {
  19459. this.expect('{');
  19460. var specifiers = [];
  19461. while (!this.match('}')) {
  19462. specifiers.push(this.parseImportSpecifier());
  19463. if (!this.match('}')) {
  19464. this.expect(',');
  19465. }
  19466. }
  19467. this.expect('}');
  19468. return specifiers;
  19469. };
  19470. // import <foo> ...;
  19471. Parser.prototype.parseImportDefaultSpecifier = function () {
  19472. var node = this.createNode();
  19473. var local = this.parseIdentifierName();
  19474. return this.finalize(node, new Node.ImportDefaultSpecifier(local));
  19475. };
  19476. // import <* as foo> ...;
  19477. Parser.prototype.parseImportNamespaceSpecifier = function () {
  19478. var node = this.createNode();
  19479. this.expect('*');
  19480. if (!this.matchContextualKeyword('as')) {
  19481. this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
  19482. }
  19483. this.nextToken();
  19484. var local = this.parseIdentifierName();
  19485. return this.finalize(node, new Node.ImportNamespaceSpecifier(local));
  19486. };
  19487. Parser.prototype.parseImportDeclaration = function () {
  19488. if (this.context.inFunctionBody) {
  19489. this.throwError(messages_1.Messages.IllegalImportDeclaration);
  19490. }
  19491. var node = this.createNode();
  19492. this.expectKeyword('import');
  19493. var src;
  19494. var specifiers = [];
  19495. if (this.lookahead.type === 8 /* StringLiteral */) {
  19496. // import 'foo';
  19497. src = this.parseModuleSpecifier();
  19498. }
  19499. else {
  19500. if (this.match('{')) {
  19501. // import {bar}
  19502. specifiers = specifiers.concat(this.parseNamedImports());
  19503. }
  19504. else if (this.match('*')) {
  19505. // import * as foo
  19506. specifiers.push(this.parseImportNamespaceSpecifier());
  19507. }
  19508. else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) {
  19509. // import foo
  19510. specifiers.push(this.parseImportDefaultSpecifier());
  19511. if (this.match(',')) {
  19512. this.nextToken();
  19513. if (this.match('*')) {
  19514. // import foo, * as foo
  19515. specifiers.push(this.parseImportNamespaceSpecifier());
  19516. }
  19517. else if (this.match('{')) {
  19518. // import foo, {bar}
  19519. specifiers = specifiers.concat(this.parseNamedImports());
  19520. }
  19521. else {
  19522. this.throwUnexpectedToken(this.lookahead);
  19523. }
  19524. }
  19525. }
  19526. else {
  19527. this.throwUnexpectedToken(this.nextToken());
  19528. }
  19529. if (!this.matchContextualKeyword('from')) {
  19530. var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
  19531. this.throwError(message, this.lookahead.value);
  19532. }
  19533. this.nextToken();
  19534. src = this.parseModuleSpecifier();
  19535. }
  19536. this.consumeSemicolon();
  19537. return this.finalize(node, new Node.ImportDeclaration(specifiers, src));
  19538. };
  19539. // https://tc39.github.io/ecma262/#sec-exports
  19540. Parser.prototype.parseExportSpecifier = function () {
  19541. var node = this.createNode();
  19542. var local = this.parseIdentifierName();
  19543. var exported = local;
  19544. if (this.matchContextualKeyword('as')) {
  19545. this.nextToken();
  19546. exported = this.parseIdentifierName();
  19547. }
  19548. return this.finalize(node, new Node.ExportSpecifier(local, exported));
  19549. };
  19550. Parser.prototype.parseExportDeclaration = function () {
  19551. if (this.context.inFunctionBody) {
  19552. this.throwError(messages_1.Messages.IllegalExportDeclaration);
  19553. }
  19554. var node = this.createNode();
  19555. this.expectKeyword('export');
  19556. var exportDeclaration;
  19557. if (this.matchKeyword('default')) {
  19558. // export default ...
  19559. this.nextToken();
  19560. if (this.matchKeyword('function')) {
  19561. // export default function foo () {}
  19562. // export default function () {}
  19563. var declaration = this.parseFunctionDeclaration(true);
  19564. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  19565. }
  19566. else if (this.matchKeyword('class')) {
  19567. // export default class foo {}
  19568. var declaration = this.parseClassDeclaration(true);
  19569. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  19570. }
  19571. else if (this.matchContextualKeyword('async')) {
  19572. // export default async function f () {}
  19573. // export default async function () {}
  19574. // export default async x => x
  19575. var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
  19576. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  19577. }
  19578. else {
  19579. if (this.matchContextualKeyword('from')) {
  19580. this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
  19581. }
  19582. // export default {};
  19583. // export default [];
  19584. // export default (1 + 2);
  19585. var declaration = this.match('{') ? this.parseObjectInitializer() :
  19586. this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression();
  19587. this.consumeSemicolon();
  19588. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  19589. }
  19590. }
  19591. else if (this.match('*')) {
  19592. // export * from 'foo';
  19593. this.nextToken();
  19594. if (!this.matchContextualKeyword('from')) {
  19595. var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
  19596. this.throwError(message, this.lookahead.value);
  19597. }
  19598. this.nextToken();
  19599. var src = this.parseModuleSpecifier();
  19600. this.consumeSemicolon();
  19601. exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
  19602. }
  19603. else if (this.lookahead.type === 4 /* Keyword */) {
  19604. // export var f = 1;
  19605. var declaration = void 0;
  19606. switch (this.lookahead.value) {
  19607. case 'let':
  19608. case 'const':
  19609. declaration = this.parseLexicalDeclaration({ inFor: false });
  19610. break;
  19611. case 'var':
  19612. case 'class':
  19613. case 'function':
  19614. declaration = this.parseStatementListItem();
  19615. break;
  19616. default:
  19617. this.throwUnexpectedToken(this.lookahead);
  19618. }
  19619. exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
  19620. }
  19621. else if (this.matchAsyncFunction()) {
  19622. var declaration = this.parseFunctionDeclaration();
  19623. exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
  19624. }
  19625. else {
  19626. var specifiers = [];
  19627. var source = null;
  19628. var isExportFromIdentifier = false;
  19629. this.expect('{');
  19630. while (!this.match('}')) {
  19631. isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default');
  19632. specifiers.push(this.parseExportSpecifier());
  19633. if (!this.match('}')) {
  19634. this.expect(',');
  19635. }
  19636. }
  19637. this.expect('}');
  19638. if (this.matchContextualKeyword('from')) {
  19639. // export {default} from 'foo';
  19640. // export {foo} from 'foo';
  19641. this.nextToken();
  19642. source = this.parseModuleSpecifier();
  19643. this.consumeSemicolon();
  19644. }
  19645. else if (isExportFromIdentifier) {
  19646. // export {default}; // missing fromClause
  19647. var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
  19648. this.throwError(message, this.lookahead.value);
  19649. }
  19650. else {
  19651. // export {foo};
  19652. this.consumeSemicolon();
  19653. }
  19654. exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source));
  19655. }
  19656. return exportDeclaration;
  19657. };
  19658. return Parser;
  19659. }());
  19660. exports.Parser = Parser;
  19661. /***/ },
  19662. /* 9 */
  19663. /***/ function(module, exports) {
  19664. "use strict";
  19665. // Ensure the condition is true, otherwise throw an error.
  19666. // This is only to have a better contract semantic, i.e. another safety net
  19667. // to catch a logic error. The condition shall be fulfilled in normal case.
  19668. // Do NOT use this to enforce a certain condition on any user input.
  19669. Object.defineProperty(exports, "__esModule", { value: true });
  19670. function assert(condition, message) {
  19671. /* istanbul ignore if */
  19672. if (!condition) {
  19673. throw new Error('ASSERT: ' + message);
  19674. }
  19675. }
  19676. exports.assert = assert;
  19677. /***/ },
  19678. /* 10 */
  19679. /***/ function(module, exports) {
  19680. "use strict";
  19681. /* tslint:disable:max-classes-per-file */
  19682. Object.defineProperty(exports, "__esModule", { value: true });
  19683. var ErrorHandler = (function () {
  19684. function ErrorHandler() {
  19685. this.errors = [];
  19686. this.tolerant = false;
  19687. }
  19688. ErrorHandler.prototype.recordError = function (error) {
  19689. this.errors.push(error);
  19690. };
  19691. ErrorHandler.prototype.tolerate = function (error) {
  19692. if (this.tolerant) {
  19693. this.recordError(error);
  19694. }
  19695. else {
  19696. throw error;
  19697. }
  19698. };
  19699. ErrorHandler.prototype.constructError = function (msg, column) {
  19700. var error = new Error(msg);
  19701. try {
  19702. throw error;
  19703. }
  19704. catch (base) {
  19705. /* istanbul ignore else */
  19706. if (Object.create && Object.defineProperty) {
  19707. error = Object.create(base);
  19708. Object.defineProperty(error, 'column', { value: column });
  19709. }
  19710. }
  19711. /* istanbul ignore next */
  19712. return error;
  19713. };
  19714. ErrorHandler.prototype.createError = function (index, line, col, description) {
  19715. var msg = 'Line ' + line + ': ' + description;
  19716. var error = this.constructError(msg, col);
  19717. error.index = index;
  19718. error.lineNumber = line;
  19719. error.description = description;
  19720. return error;
  19721. };
  19722. ErrorHandler.prototype.throwError = function (index, line, col, description) {
  19723. throw this.createError(index, line, col, description);
  19724. };
  19725. ErrorHandler.prototype.tolerateError = function (index, line, col, description) {
  19726. var error = this.createError(index, line, col, description);
  19727. if (this.tolerant) {
  19728. this.recordError(error);
  19729. }
  19730. else {
  19731. throw error;
  19732. }
  19733. };
  19734. return ErrorHandler;
  19735. }());
  19736. exports.ErrorHandler = ErrorHandler;
  19737. /***/ },
  19738. /* 11 */
  19739. /***/ function(module, exports) {
  19740. "use strict";
  19741. Object.defineProperty(exports, "__esModule", { value: true });
  19742. // Error messages should be identical to V8.
  19743. exports.Messages = {
  19744. BadGetterArity: 'Getter must not have any formal parameters',
  19745. BadSetterArity: 'Setter must have exactly one formal parameter',
  19746. BadSetterRestParameter: 'Setter function argument must not be a rest parameter',
  19747. ConstructorIsAsync: 'Class constructor may not be an async method',
  19748. ConstructorSpecialMethod: 'Class constructor may not be an accessor',
  19749. DeclarationMissingInitializer: 'Missing initializer in %0 declaration',
  19750. DefaultRestParameter: 'Unexpected token =',
  19751. DuplicateBinding: 'Duplicate binding %0',
  19752. DuplicateConstructor: 'A class may only have one constructor',
  19753. DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
  19754. ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer',
  19755. GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts',
  19756. IllegalBreak: 'Illegal break statement',
  19757. IllegalContinue: 'Illegal continue statement',
  19758. IllegalExportDeclaration: 'Unexpected token',
  19759. IllegalImportDeclaration: 'Unexpected token',
  19760. IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list',
  19761. IllegalReturn: 'Illegal return statement',
  19762. InvalidEscapedReservedWord: 'Keyword must not contain escaped characters',
  19763. InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence',
  19764. InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
  19765. InvalidLHSInForIn: 'Invalid left-hand side in for-in',
  19766. InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
  19767. InvalidModuleSpecifier: 'Unexpected token',
  19768. InvalidRegExp: 'Invalid regular expression',
  19769. LetInLexicalBinding: 'let is disallowed as a lexically bound name',
  19770. MissingFromClause: 'Unexpected token',
  19771. MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
  19772. NewlineAfterThrow: 'Illegal newline after throw',
  19773. NoAsAfterImportNamespace: 'Unexpected token',
  19774. NoCatchOrFinally: 'Missing catch or finally after try',
  19775. ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
  19776. Redeclaration: '%0 \'%1\' has already been declared',
  19777. StaticPrototype: 'Classes may not have static property named prototype',
  19778. StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
  19779. StrictDelete: 'Delete of an unqualified identifier in strict mode.',
  19780. StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block',
  19781. StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
  19782. StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
  19783. StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
  19784. StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
  19785. StrictModeWith: 'Strict mode code may not include a with statement',
  19786. StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
  19787. StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
  19788. StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
  19789. StrictReservedWord: 'Use of future reserved word in strict mode',
  19790. StrictVarName: 'Variable name may not be eval or arguments in strict mode',
  19791. TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
  19792. UnexpectedEOS: 'Unexpected end of input',
  19793. UnexpectedIdentifier: 'Unexpected identifier',
  19794. UnexpectedNumber: 'Unexpected number',
  19795. UnexpectedReserved: 'Unexpected reserved word',
  19796. UnexpectedString: 'Unexpected string',
  19797. UnexpectedTemplate: 'Unexpected quasi %0',
  19798. UnexpectedToken: 'Unexpected token %0',
  19799. UnexpectedTokenIllegal: 'Unexpected token ILLEGAL',
  19800. UnknownLabel: 'Undefined label \'%0\'',
  19801. UnterminatedRegExp: 'Invalid regular expression: missing /'
  19802. };
  19803. /***/ },
  19804. /* 12 */
  19805. /***/ function(module, exports, __webpack_require__) {
  19806. "use strict";
  19807. Object.defineProperty(exports, "__esModule", { value: true });
  19808. var assert_1 = __webpack_require__(9);
  19809. var character_1 = __webpack_require__(4);
  19810. var messages_1 = __webpack_require__(11);
  19811. function hexValue(ch) {
  19812. return '0123456789abcdef'.indexOf(ch.toLowerCase());
  19813. }
  19814. function octalValue(ch) {
  19815. return '01234567'.indexOf(ch);
  19816. }
  19817. var Scanner = (function () {
  19818. function Scanner(code, handler) {
  19819. this.source = code;
  19820. this.errorHandler = handler;
  19821. this.trackComment = false;
  19822. this.length = code.length;
  19823. this.index = 0;
  19824. this.lineNumber = (code.length > 0) ? 1 : 0;
  19825. this.lineStart = 0;
  19826. this.curlyStack = [];
  19827. }
  19828. Scanner.prototype.saveState = function () {
  19829. return {
  19830. index: this.index,
  19831. lineNumber: this.lineNumber,
  19832. lineStart: this.lineStart
  19833. };
  19834. };
  19835. Scanner.prototype.restoreState = function (state) {
  19836. this.index = state.index;
  19837. this.lineNumber = state.lineNumber;
  19838. this.lineStart = state.lineStart;
  19839. };
  19840. Scanner.prototype.eof = function () {
  19841. return this.index >= this.length;
  19842. };
  19843. Scanner.prototype.throwUnexpectedToken = function (message) {
  19844. if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
  19845. return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
  19846. };
  19847. Scanner.prototype.tolerateUnexpectedToken = function (message) {
  19848. if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
  19849. this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
  19850. };
  19851. // https://tc39.github.io/ecma262/#sec-comments
  19852. Scanner.prototype.skipSingleLineComment = function (offset) {
  19853. var comments = [];
  19854. var start, loc;
  19855. if (this.trackComment) {
  19856. comments = [];
  19857. start = this.index - offset;
  19858. loc = {
  19859. start: {
  19860. line: this.lineNumber,
  19861. column: this.index - this.lineStart - offset
  19862. },
  19863. end: {}
  19864. };
  19865. }
  19866. while (!this.eof()) {
  19867. var ch = this.source.charCodeAt(this.index);
  19868. ++this.index;
  19869. if (character_1.Character.isLineTerminator(ch)) {
  19870. if (this.trackComment) {
  19871. loc.end = {
  19872. line: this.lineNumber,
  19873. column: this.index - this.lineStart - 1
  19874. };
  19875. var entry = {
  19876. multiLine: false,
  19877. slice: [start + offset, this.index - 1],
  19878. range: [start, this.index - 1],
  19879. loc: loc
  19880. };
  19881. comments.push(entry);
  19882. }
  19883. if (ch === 13 && this.source.charCodeAt(this.index) === 10) {
  19884. ++this.index;
  19885. }
  19886. ++this.lineNumber;
  19887. this.lineStart = this.index;
  19888. return comments;
  19889. }
  19890. }
  19891. if (this.trackComment) {
  19892. loc.end = {
  19893. line: this.lineNumber,
  19894. column: this.index - this.lineStart
  19895. };
  19896. var entry = {
  19897. multiLine: false,
  19898. slice: [start + offset, this.index],
  19899. range: [start, this.index],
  19900. loc: loc
  19901. };
  19902. comments.push(entry);
  19903. }
  19904. return comments;
  19905. };
  19906. Scanner.prototype.skipMultiLineComment = function () {
  19907. var comments = [];
  19908. var start, loc;
  19909. if (this.trackComment) {
  19910. comments = [];
  19911. start = this.index - 2;
  19912. loc = {
  19913. start: {
  19914. line: this.lineNumber,
  19915. column: this.index - this.lineStart - 2
  19916. },
  19917. end: {}
  19918. };
  19919. }
  19920. while (!this.eof()) {
  19921. var ch = this.source.charCodeAt(this.index);
  19922. if (character_1.Character.isLineTerminator(ch)) {
  19923. if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) {
  19924. ++this.index;
  19925. }
  19926. ++this.lineNumber;
  19927. ++this.index;
  19928. this.lineStart = this.index;
  19929. }
  19930. else if (ch === 0x2A) {
  19931. // Block comment ends with '*/'.
  19932. if (this.source.charCodeAt(this.index + 1) === 0x2F) {
  19933. this.index += 2;
  19934. if (this.trackComment) {
  19935. loc.end = {
  19936. line: this.lineNumber,
  19937. column: this.index - this.lineStart
  19938. };
  19939. var entry = {
  19940. multiLine: true,
  19941. slice: [start + 2, this.index - 2],
  19942. range: [start, this.index],
  19943. loc: loc
  19944. };
  19945. comments.push(entry);
  19946. }
  19947. return comments;
  19948. }
  19949. ++this.index;
  19950. }
  19951. else {
  19952. ++this.index;
  19953. }
  19954. }
  19955. // Ran off the end of the file - the whole thing is a comment
  19956. if (this.trackComment) {
  19957. loc.end = {
  19958. line: this.lineNumber,
  19959. column: this.index - this.lineStart
  19960. };
  19961. var entry = {
  19962. multiLine: true,
  19963. slice: [start + 2, this.index],
  19964. range: [start, this.index],
  19965. loc: loc
  19966. };
  19967. comments.push(entry);
  19968. }
  19969. this.tolerateUnexpectedToken();
  19970. return comments;
  19971. };
  19972. Scanner.prototype.scanComments = function () {
  19973. var comments;
  19974. if (this.trackComment) {
  19975. comments = [];
  19976. }
  19977. var start = (this.index === 0);
  19978. while (!this.eof()) {
  19979. var ch = this.source.charCodeAt(this.index);
  19980. if (character_1.Character.isWhiteSpace(ch)) {
  19981. ++this.index;
  19982. }
  19983. else if (character_1.Character.isLineTerminator(ch)) {
  19984. ++this.index;
  19985. if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) {
  19986. ++this.index;
  19987. }
  19988. ++this.lineNumber;
  19989. this.lineStart = this.index;
  19990. start = true;
  19991. }
  19992. else if (ch === 0x2F) {
  19993. ch = this.source.charCodeAt(this.index + 1);
  19994. if (ch === 0x2F) {
  19995. this.index += 2;
  19996. var comment = this.skipSingleLineComment(2);
  19997. if (this.trackComment) {
  19998. comments = comments.concat(comment);
  19999. }
  20000. start = true;
  20001. }
  20002. else if (ch === 0x2A) {
  20003. this.index += 2;
  20004. var comment = this.skipMultiLineComment();
  20005. if (this.trackComment) {
  20006. comments = comments.concat(comment);
  20007. }
  20008. }
  20009. else {
  20010. break;
  20011. }
  20012. }
  20013. else if (start && ch === 0x2D) {
  20014. // U+003E is '>'
  20015. if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) {
  20016. // '-->' is a single-line comment
  20017. this.index += 3;
  20018. var comment = this.skipSingleLineComment(3);
  20019. if (this.trackComment) {
  20020. comments = comments.concat(comment);
  20021. }
  20022. }
  20023. else {
  20024. break;
  20025. }
  20026. }
  20027. else if (ch === 0x3C) {
  20028. if (this.source.slice(this.index + 1, this.index + 4) === '!--') {
  20029. this.index += 4; // `<!--`
  20030. var comment = this.skipSingleLineComment(4);
  20031. if (this.trackComment) {
  20032. comments = comments.concat(comment);
  20033. }
  20034. }
  20035. else {
  20036. break;
  20037. }
  20038. }
  20039. else {
  20040. break;
  20041. }
  20042. }
  20043. return comments;
  20044. };
  20045. // https://tc39.github.io/ecma262/#sec-future-reserved-words
  20046. Scanner.prototype.isFutureReservedWord = function (id) {
  20047. switch (id) {
  20048. case 'enum':
  20049. case 'export':
  20050. case 'import':
  20051. case 'super':
  20052. return true;
  20053. default:
  20054. return false;
  20055. }
  20056. };
  20057. Scanner.prototype.isStrictModeReservedWord = function (id) {
  20058. switch (id) {
  20059. case 'implements':
  20060. case 'interface':
  20061. case 'package':
  20062. case 'private':
  20063. case 'protected':
  20064. case 'public':
  20065. case 'static':
  20066. case 'yield':
  20067. case 'let':
  20068. return true;
  20069. default:
  20070. return false;
  20071. }
  20072. };
  20073. Scanner.prototype.isRestrictedWord = function (id) {
  20074. return id === 'eval' || id === 'arguments';
  20075. };
  20076. // https://tc39.github.io/ecma262/#sec-keywords
  20077. Scanner.prototype.isKeyword = function (id) {
  20078. switch (id.length) {
  20079. case 2:
  20080. return (id === 'if') || (id === 'in') || (id === 'do');
  20081. case 3:
  20082. return (id === 'var') || (id === 'for') || (id === 'new') ||
  20083. (id === 'try') || (id === 'let');
  20084. case 4:
  20085. return (id === 'this') || (id === 'else') || (id === 'case') ||
  20086. (id === 'void') || (id === 'with') || (id === 'enum');
  20087. case 5:
  20088. return (id === 'while') || (id === 'break') || (id === 'catch') ||
  20089. (id === 'throw') || (id === 'const') || (id === 'yield') ||
  20090. (id === 'class') || (id === 'super');
  20091. case 6:
  20092. return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
  20093. (id === 'switch') || (id === 'export') || (id === 'import');
  20094. case 7:
  20095. return (id === 'default') || (id === 'finally') || (id === 'extends');
  20096. case 8:
  20097. return (id === 'function') || (id === 'continue') || (id === 'debugger');
  20098. case 10:
  20099. return (id === 'instanceof');
  20100. default:
  20101. return false;
  20102. }
  20103. };
  20104. Scanner.prototype.codePointAt = function (i) {
  20105. var cp = this.source.charCodeAt(i);
  20106. if (cp >= 0xD800 && cp <= 0xDBFF) {
  20107. var second = this.source.charCodeAt(i + 1);
  20108. if (second >= 0xDC00 && second <= 0xDFFF) {
  20109. var first = cp;
  20110. cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
  20111. }
  20112. }
  20113. return cp;
  20114. };
  20115. Scanner.prototype.scanHexEscape = function (prefix) {
  20116. var len = (prefix === 'u') ? 4 : 2;
  20117. var code = 0;
  20118. for (var i = 0; i < len; ++i) {
  20119. if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
  20120. code = code * 16 + hexValue(this.source[this.index++]);
  20121. }
  20122. else {
  20123. return null;
  20124. }
  20125. }
  20126. return String.fromCharCode(code);
  20127. };
  20128. Scanner.prototype.scanUnicodeCodePointEscape = function () {
  20129. var ch = this.source[this.index];
  20130. var code = 0;
  20131. // At least, one hex digit is required.
  20132. if (ch === '}') {
  20133. this.throwUnexpectedToken();
  20134. }
  20135. while (!this.eof()) {
  20136. ch = this.source[this.index++];
  20137. if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) {
  20138. break;
  20139. }
  20140. code = code * 16 + hexValue(ch);
  20141. }
  20142. if (code > 0x10FFFF || ch !== '}') {
  20143. this.throwUnexpectedToken();
  20144. }
  20145. return character_1.Character.fromCodePoint(code);
  20146. };
  20147. Scanner.prototype.getIdentifier = function () {
  20148. var start = this.index++;
  20149. while (!this.eof()) {
  20150. var ch = this.source.charCodeAt(this.index);
  20151. if (ch === 0x5C) {
  20152. // Blackslash (U+005C) marks Unicode escape sequence.
  20153. this.index = start;
  20154. return this.getComplexIdentifier();
  20155. }
  20156. else if (ch >= 0xD800 && ch < 0xDFFF) {
  20157. // Need to handle surrogate pairs.
  20158. this.index = start;
  20159. return this.getComplexIdentifier();
  20160. }
  20161. if (character_1.Character.isIdentifierPart(ch)) {
  20162. ++this.index;
  20163. }
  20164. else {
  20165. break;
  20166. }
  20167. }
  20168. return this.source.slice(start, this.index);
  20169. };
  20170. Scanner.prototype.getComplexIdentifier = function () {
  20171. var cp = this.codePointAt(this.index);
  20172. var id = character_1.Character.fromCodePoint(cp);
  20173. this.index += id.length;
  20174. // '\u' (U+005C, U+0075) denotes an escaped character.
  20175. var ch;
  20176. if (cp === 0x5C) {
  20177. if (this.source.charCodeAt(this.index) !== 0x75) {
  20178. this.throwUnexpectedToken();
  20179. }
  20180. ++this.index;
  20181. if (this.source[this.index] === '{') {
  20182. ++this.index;
  20183. ch = this.scanUnicodeCodePointEscape();
  20184. }
  20185. else {
  20186. ch = this.scanHexEscape('u');
  20187. if (ch === null || ch === '\\' || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) {
  20188. this.throwUnexpectedToken();
  20189. }
  20190. }
  20191. id = ch;
  20192. }
  20193. while (!this.eof()) {
  20194. cp = this.codePointAt(this.index);
  20195. if (!character_1.Character.isIdentifierPart(cp)) {
  20196. break;
  20197. }
  20198. ch = character_1.Character.fromCodePoint(cp);
  20199. id += ch;
  20200. this.index += ch.length;
  20201. // '\u' (U+005C, U+0075) denotes an escaped character.
  20202. if (cp === 0x5C) {
  20203. id = id.substr(0, id.length - 1);
  20204. if (this.source.charCodeAt(this.index) !== 0x75) {
  20205. this.throwUnexpectedToken();
  20206. }
  20207. ++this.index;
  20208. if (this.source[this.index] === '{') {
  20209. ++this.index;
  20210. ch = this.scanUnicodeCodePointEscape();
  20211. }
  20212. else {
  20213. ch = this.scanHexEscape('u');
  20214. if (ch === null || ch === '\\' || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
  20215. this.throwUnexpectedToken();
  20216. }
  20217. }
  20218. id += ch;
  20219. }
  20220. }
  20221. return id;
  20222. };
  20223. Scanner.prototype.octalToDecimal = function (ch) {
  20224. // \0 is not octal escape sequence
  20225. var octal = (ch !== '0');
  20226. var code = octalValue(ch);
  20227. if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
  20228. octal = true;
  20229. code = code * 8 + octalValue(this.source[this.index++]);
  20230. // 3 digits are only allowed when string starts
  20231. // with 0, 1, 2, 3
  20232. if ('0123'.indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
  20233. code = code * 8 + octalValue(this.source[this.index++]);
  20234. }
  20235. }
  20236. return {
  20237. code: code,
  20238. octal: octal
  20239. };
  20240. };
  20241. // https://tc39.github.io/ecma262/#sec-names-and-keywords
  20242. Scanner.prototype.scanIdentifier = function () {
  20243. var type;
  20244. var start = this.index;
  20245. // Backslash (U+005C) starts an escaped character.
  20246. var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
  20247. // There is no keyword or literal with only one character.
  20248. // Thus, it must be an identifier.
  20249. if (id.length === 1) {
  20250. type = 3 /* Identifier */;
  20251. }
  20252. else if (this.isKeyword(id)) {
  20253. type = 4 /* Keyword */;
  20254. }
  20255. else if (id === 'null') {
  20256. type = 5 /* NullLiteral */;
  20257. }
  20258. else if (id === 'true' || id === 'false') {
  20259. type = 1 /* BooleanLiteral */;
  20260. }
  20261. else {
  20262. type = 3 /* Identifier */;
  20263. }
  20264. if (type !== 3 /* Identifier */ && (start + id.length !== this.index)) {
  20265. var restore = this.index;
  20266. this.index = start;
  20267. this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
  20268. this.index = restore;
  20269. }
  20270. return {
  20271. type: type,
  20272. value: id,
  20273. lineNumber: this.lineNumber,
  20274. lineStart: this.lineStart,
  20275. start: start,
  20276. end: this.index
  20277. };
  20278. };
  20279. // https://tc39.github.io/ecma262/#sec-punctuators
  20280. Scanner.prototype.scanPunctuator = function () {
  20281. var start = this.index;
  20282. // Check for most common single-character punctuators.
  20283. var str = this.source[this.index];
  20284. switch (str) {
  20285. case '(':
  20286. case '{':
  20287. if (str === '{') {
  20288. this.curlyStack.push('{');
  20289. }
  20290. ++this.index;
  20291. break;
  20292. case '.':
  20293. ++this.index;
  20294. if (this.source[this.index] === '.' && this.source[this.index + 1] === '.') {
  20295. // Spread operator: ...
  20296. this.index += 2;
  20297. str = '...';
  20298. }
  20299. break;
  20300. case '}':
  20301. ++this.index;
  20302. this.curlyStack.pop();
  20303. break;
  20304. case ')':
  20305. case ';':
  20306. case ',':
  20307. case '[':
  20308. case ']':
  20309. case ':':
  20310. case '?':
  20311. case '~':
  20312. ++this.index;
  20313. break;
  20314. default:
  20315. // 4-character punctuator.
  20316. str = this.source.substr(this.index, 4);
  20317. if (str === '>>>=') {
  20318. this.index += 4;
  20319. }
  20320. else {
  20321. // 3-character punctuators.
  20322. str = str.substr(0, 3);
  20323. if (str === '===' || str === '!==' || str === '>>>' ||
  20324. str === '<<=' || str === '>>=' || str === '**=') {
  20325. this.index += 3;
  20326. }
  20327. else {
  20328. // 2-character punctuators.
  20329. str = str.substr(0, 2);
  20330. if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
  20331. str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
  20332. str === '++' || str === '--' || str === '<<' || str === '>>' ||
  20333. str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
  20334. str === '<=' || str === '>=' || str === '=>' || str === '**') {
  20335. this.index += 2;
  20336. }
  20337. else {
  20338. // 1-character punctuators.
  20339. str = this.source[this.index];
  20340. if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
  20341. ++this.index;
  20342. }
  20343. }
  20344. }
  20345. }
  20346. }
  20347. if (this.index === start) {
  20348. this.throwUnexpectedToken();
  20349. }
  20350. return {
  20351. type: 7 /* Punctuator */,
  20352. value: str,
  20353. lineNumber: this.lineNumber,
  20354. lineStart: this.lineStart,
  20355. start: start,
  20356. end: this.index
  20357. };
  20358. };
  20359. // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
  20360. Scanner.prototype.scanHexLiteral = function (start) {
  20361. var num = '';
  20362. while (!this.eof()) {
  20363. if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
  20364. break;
  20365. }
  20366. num += this.source[this.index++];
  20367. }
  20368. if (num.length === 0) {
  20369. this.throwUnexpectedToken();
  20370. }
  20371. if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
  20372. this.throwUnexpectedToken();
  20373. }
  20374. return {
  20375. type: 6 /* NumericLiteral */,
  20376. value: parseInt('0x' + num, 16),
  20377. lineNumber: this.lineNumber,
  20378. lineStart: this.lineStart,
  20379. start: start,
  20380. end: this.index
  20381. };
  20382. };
  20383. Scanner.prototype.scanBinaryLiteral = function (start) {
  20384. var num = '';
  20385. var ch;
  20386. while (!this.eof()) {
  20387. ch = this.source[this.index];
  20388. if (ch !== '0' && ch !== '1') {
  20389. break;
  20390. }
  20391. num += this.source[this.index++];
  20392. }
  20393. if (num.length === 0) {
  20394. // only 0b or 0B
  20395. this.throwUnexpectedToken();
  20396. }
  20397. if (!this.eof()) {
  20398. ch = this.source.charCodeAt(this.index);
  20399. /* istanbul ignore else */
  20400. if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) {
  20401. this.throwUnexpectedToken();
  20402. }
  20403. }
  20404. return {
  20405. type: 6 /* NumericLiteral */,
  20406. value: parseInt(num, 2),
  20407. lineNumber: this.lineNumber,
  20408. lineStart: this.lineStart,
  20409. start: start,
  20410. end: this.index
  20411. };
  20412. };
  20413. Scanner.prototype.scanOctalLiteral = function (prefix, start) {
  20414. var num = '';
  20415. var octal = false;
  20416. if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
  20417. octal = true;
  20418. num = '0' + this.source[this.index++];
  20419. }
  20420. else {
  20421. ++this.index;
  20422. }
  20423. while (!this.eof()) {
  20424. if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
  20425. break;
  20426. }
  20427. num += this.source[this.index++];
  20428. }
  20429. if (!octal && num.length === 0) {
  20430. // only 0o or 0O
  20431. this.throwUnexpectedToken();
  20432. }
  20433. if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  20434. this.throwUnexpectedToken();
  20435. }
  20436. return {
  20437. type: 6 /* NumericLiteral */,
  20438. value: parseInt(num, 8),
  20439. octal: octal,
  20440. lineNumber: this.lineNumber,
  20441. lineStart: this.lineStart,
  20442. start: start,
  20443. end: this.index
  20444. };
  20445. };
  20446. Scanner.prototype.isImplicitOctalLiteral = function () {
  20447. // Implicit octal, unless there is a non-octal digit.
  20448. // (Annex B.1.1 on Numeric Literals)
  20449. for (var i = this.index + 1; i < this.length; ++i) {
  20450. var ch = this.source[i];
  20451. if (ch === '8' || ch === '9') {
  20452. return false;
  20453. }
  20454. if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  20455. return true;
  20456. }
  20457. }
  20458. return true;
  20459. };
  20460. Scanner.prototype.scanNumericLiteral = function () {
  20461. var start = this.index;
  20462. var ch = this.source[start];
  20463. assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point');
  20464. var num = '';
  20465. if (ch !== '.') {
  20466. num = this.source[this.index++];
  20467. ch = this.source[this.index];
  20468. // Hex number starts with '0x'.
  20469. // Octal number starts with '0'.
  20470. // Octal number in ES6 starts with '0o'.
  20471. // Binary number in ES6 starts with '0b'.
  20472. if (num === '0') {
  20473. if (ch === 'x' || ch === 'X') {
  20474. ++this.index;
  20475. return this.scanHexLiteral(start);
  20476. }
  20477. if (ch === 'b' || ch === 'B') {
  20478. ++this.index;
  20479. return this.scanBinaryLiteral(start);
  20480. }
  20481. if (ch === 'o' || ch === 'O') {
  20482. return this.scanOctalLiteral(ch, start);
  20483. }
  20484. if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  20485. if (this.isImplicitOctalLiteral()) {
  20486. return this.scanOctalLiteral(ch, start);
  20487. }
  20488. }
  20489. }
  20490. while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  20491. num += this.source[this.index++];
  20492. }
  20493. ch = this.source[this.index];
  20494. }
  20495. if (ch === '.') {
  20496. num += this.source[this.index++];
  20497. while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  20498. num += this.source[this.index++];
  20499. }
  20500. ch = this.source[this.index];
  20501. }
  20502. if (ch === 'e' || ch === 'E') {
  20503. num += this.source[this.index++];
  20504. ch = this.source[this.index];
  20505. if (ch === '+' || ch === '-') {
  20506. num += this.source[this.index++];
  20507. }
  20508. if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  20509. while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  20510. num += this.source[this.index++];
  20511. }
  20512. }
  20513. else {
  20514. this.throwUnexpectedToken();
  20515. }
  20516. }
  20517. if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
  20518. this.throwUnexpectedToken();
  20519. }
  20520. return {
  20521. type: 6 /* NumericLiteral */,
  20522. value: parseFloat(num),
  20523. lineNumber: this.lineNumber,
  20524. lineStart: this.lineStart,
  20525. start: start,
  20526. end: this.index
  20527. };
  20528. };
  20529. // https://tc39.github.io/ecma262/#sec-literals-string-literals
  20530. Scanner.prototype.scanStringLiteral = function () {
  20531. var start = this.index;
  20532. var quote = this.source[start];
  20533. assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
  20534. ++this.index;
  20535. var octal = false;
  20536. var str = '';
  20537. while (!this.eof()) {
  20538. var ch = this.source[this.index++];
  20539. if (ch === quote) {
  20540. quote = '';
  20541. break;
  20542. }
  20543. else if (ch === '\\') {
  20544. ch = this.source[this.index++];
  20545. if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  20546. switch (ch) {
  20547. case 'u':
  20548. if (this.source[this.index] === '{') {
  20549. ++this.index;
  20550. str += this.scanUnicodeCodePointEscape();
  20551. }
  20552. else {
  20553. var unescaped_1 = this.scanHexEscape(ch);
  20554. if (unescaped_1 === null) {
  20555. this.throwUnexpectedToken();
  20556. }
  20557. str += unescaped_1;
  20558. }
  20559. break;
  20560. case 'x':
  20561. var unescaped = this.scanHexEscape(ch);
  20562. if (unescaped === null) {
  20563. this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
  20564. }
  20565. str += unescaped;
  20566. break;
  20567. case 'n':
  20568. str += '\n';
  20569. break;
  20570. case 'r':
  20571. str += '\r';
  20572. break;
  20573. case 't':
  20574. str += '\t';
  20575. break;
  20576. case 'b':
  20577. str += '\b';
  20578. break;
  20579. case 'f':
  20580. str += '\f';
  20581. break;
  20582. case 'v':
  20583. str += '\x0B';
  20584. break;
  20585. case '8':
  20586. case '9':
  20587. str += ch;
  20588. this.tolerateUnexpectedToken();
  20589. break;
  20590. default:
  20591. if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  20592. var octToDec = this.octalToDecimal(ch);
  20593. octal = octToDec.octal || octal;
  20594. str += String.fromCharCode(octToDec.code);
  20595. }
  20596. else {
  20597. str += ch;
  20598. }
  20599. break;
  20600. }
  20601. }
  20602. else {
  20603. ++this.lineNumber;
  20604. if (ch === '\r' && this.source[this.index] === '\n') {
  20605. ++this.index;
  20606. }
  20607. this.lineStart = this.index;
  20608. }
  20609. }
  20610. else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  20611. break;
  20612. }
  20613. else {
  20614. str += ch;
  20615. }
  20616. }
  20617. if (quote !== '') {
  20618. this.index = start;
  20619. this.throwUnexpectedToken();
  20620. }
  20621. return {
  20622. type: 8 /* StringLiteral */,
  20623. value: str,
  20624. octal: octal,
  20625. lineNumber: this.lineNumber,
  20626. lineStart: this.lineStart,
  20627. start: start,
  20628. end: this.index
  20629. };
  20630. };
  20631. // https://tc39.github.io/ecma262/#sec-template-literal-lexical-components
  20632. Scanner.prototype.scanTemplate = function () {
  20633. var cooked = '';
  20634. var terminated = false;
  20635. var start = this.index;
  20636. var head = (this.source[start] === '`');
  20637. var tail = false;
  20638. var rawOffset = 2;
  20639. ++this.index;
  20640. while (!this.eof()) {
  20641. var ch = this.source[this.index++];
  20642. if (ch === '`') {
  20643. rawOffset = 1;
  20644. tail = true;
  20645. terminated = true;
  20646. break;
  20647. }
  20648. else if (ch === '$') {
  20649. if (this.source[this.index] === '{') {
  20650. this.curlyStack.push('${');
  20651. ++this.index;
  20652. terminated = true;
  20653. break;
  20654. }
  20655. cooked += ch;
  20656. }
  20657. else if (ch === '\\') {
  20658. ch = this.source[this.index++];
  20659. if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  20660. switch (ch) {
  20661. case 'n':
  20662. cooked += '\n';
  20663. break;
  20664. case 'r':
  20665. cooked += '\r';
  20666. break;
  20667. case 't':
  20668. cooked += '\t';
  20669. break;
  20670. case 'u':
  20671. if (this.source[this.index] === '{') {
  20672. ++this.index;
  20673. cooked += this.scanUnicodeCodePointEscape();
  20674. }
  20675. else {
  20676. var restore = this.index;
  20677. var unescaped_2 = this.scanHexEscape(ch);
  20678. if (unescaped_2 !== null) {
  20679. cooked += unescaped_2;
  20680. }
  20681. else {
  20682. this.index = restore;
  20683. cooked += ch;
  20684. }
  20685. }
  20686. break;
  20687. case 'x':
  20688. var unescaped = this.scanHexEscape(ch);
  20689. if (unescaped === null) {
  20690. this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
  20691. }
  20692. cooked += unescaped;
  20693. break;
  20694. case 'b':
  20695. cooked += '\b';
  20696. break;
  20697. case 'f':
  20698. cooked += '\f';
  20699. break;
  20700. case 'v':
  20701. cooked += '\v';
  20702. break;
  20703. default:
  20704. if (ch === '0') {
  20705. if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  20706. // Illegal: \01 \02 and so on
  20707. this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
  20708. }
  20709. cooked += '\0';
  20710. }
  20711. else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  20712. // Illegal: \1 \2
  20713. this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
  20714. }
  20715. else {
  20716. cooked += ch;
  20717. }
  20718. break;
  20719. }
  20720. }
  20721. else {
  20722. ++this.lineNumber;
  20723. if (ch === '\r' && this.source[this.index] === '\n') {
  20724. ++this.index;
  20725. }
  20726. this.lineStart = this.index;
  20727. }
  20728. }
  20729. else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  20730. ++this.lineNumber;
  20731. if (ch === '\r' && this.source[this.index] === '\n') {
  20732. ++this.index;
  20733. }
  20734. this.lineStart = this.index;
  20735. cooked += '\n';
  20736. }
  20737. else {
  20738. cooked += ch;
  20739. }
  20740. }
  20741. if (!terminated) {
  20742. this.throwUnexpectedToken();
  20743. }
  20744. if (!head) {
  20745. this.curlyStack.pop();
  20746. }
  20747. return {
  20748. type: 10 /* Template */,
  20749. value: this.source.slice(start + 1, this.index - rawOffset),
  20750. cooked: cooked,
  20751. head: head,
  20752. tail: tail,
  20753. lineNumber: this.lineNumber,
  20754. lineStart: this.lineStart,
  20755. start: start,
  20756. end: this.index
  20757. };
  20758. };
  20759. // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
  20760. Scanner.prototype.testRegExp = function (pattern, flags) {
  20761. // The BMP character to use as a replacement for astral symbols when
  20762. // translating an ES6 "u"-flagged pattern to an ES5-compatible
  20763. // approximation.
  20764. // Note: replacing with '\uFFFF' enables false positives in unlikely
  20765. // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
  20766. // pattern that would not be detected by this substitution.
  20767. var astralSubstitute = '\uFFFF';
  20768. var tmp = pattern;
  20769. var self = this;
  20770. if (flags.indexOf('u') >= 0) {
  20771. tmp = tmp
  20772. .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
  20773. var codePoint = parseInt($1 || $2, 16);
  20774. if (codePoint > 0x10FFFF) {
  20775. self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
  20776. }
  20777. if (codePoint <= 0xFFFF) {
  20778. return String.fromCharCode(codePoint);
  20779. }
  20780. return astralSubstitute;
  20781. })
  20782. .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
  20783. }
  20784. // First, detect invalid regular expressions.
  20785. try {
  20786. RegExp(tmp);
  20787. }
  20788. catch (e) {
  20789. this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
  20790. }
  20791. // Return a regular expression object for this pattern-flag pair, or
  20792. // `null` in case the current environment doesn't support the flags it
  20793. // uses.
  20794. try {
  20795. return new RegExp(pattern, flags);
  20796. }
  20797. catch (exception) {
  20798. /* istanbul ignore next */
  20799. return null;
  20800. }
  20801. };
  20802. Scanner.prototype.scanRegExpBody = function () {
  20803. var ch = this.source[this.index];
  20804. assert_1.assert(ch === '/', 'Regular expression literal must start with a slash');
  20805. var str = this.source[this.index++];
  20806. var classMarker = false;
  20807. var terminated = false;
  20808. while (!this.eof()) {
  20809. ch = this.source[this.index++];
  20810. str += ch;
  20811. if (ch === '\\') {
  20812. ch = this.source[this.index++];
  20813. // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
  20814. if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  20815. this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
  20816. }
  20817. str += ch;
  20818. }
  20819. else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  20820. this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
  20821. }
  20822. else if (classMarker) {
  20823. if (ch === ']') {
  20824. classMarker = false;
  20825. }
  20826. }
  20827. else {
  20828. if (ch === '/') {
  20829. terminated = true;
  20830. break;
  20831. }
  20832. else if (ch === '[') {
  20833. classMarker = true;
  20834. }
  20835. }
  20836. }
  20837. if (!terminated) {
  20838. this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
  20839. }
  20840. // Exclude leading and trailing slash.
  20841. return str.substr(1, str.length - 2);
  20842. };
  20843. Scanner.prototype.scanRegExpFlags = function () {
  20844. var str = '';
  20845. var flags = '';
  20846. while (!this.eof()) {
  20847. var ch = this.source[this.index];
  20848. if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
  20849. break;
  20850. }
  20851. ++this.index;
  20852. if (ch === '\\' && !this.eof()) {
  20853. ch = this.source[this.index];
  20854. if (ch === 'u') {
  20855. ++this.index;
  20856. var restore = this.index;
  20857. var char = this.scanHexEscape('u');
  20858. if (char !== null) {
  20859. flags += char;
  20860. for (str += '\\u'; restore < this.index; ++restore) {
  20861. str += this.source[restore];
  20862. }
  20863. }
  20864. else {
  20865. this.index = restore;
  20866. flags += 'u';
  20867. str += '\\u';
  20868. }
  20869. this.tolerateUnexpectedToken();
  20870. }
  20871. else {
  20872. str += '\\';
  20873. this.tolerateUnexpectedToken();
  20874. }
  20875. }
  20876. else {
  20877. flags += ch;
  20878. str += ch;
  20879. }
  20880. }
  20881. return flags;
  20882. };
  20883. Scanner.prototype.scanRegExp = function () {
  20884. var start = this.index;
  20885. var pattern = this.scanRegExpBody();
  20886. var flags = this.scanRegExpFlags();
  20887. var value = this.testRegExp(pattern, flags);
  20888. return {
  20889. type: 9 /* RegularExpression */,
  20890. value: '',
  20891. pattern: pattern,
  20892. flags: flags,
  20893. regex: value,
  20894. lineNumber: this.lineNumber,
  20895. lineStart: this.lineStart,
  20896. start: start,
  20897. end: this.index
  20898. };
  20899. };
  20900. Scanner.prototype.lex = function () {
  20901. if (this.eof()) {
  20902. return {
  20903. type: 2 /* EOF */,
  20904. value: '',
  20905. lineNumber: this.lineNumber,
  20906. lineStart: this.lineStart,
  20907. start: this.index,
  20908. end: this.index
  20909. };
  20910. }
  20911. var cp = this.source.charCodeAt(this.index);
  20912. if (character_1.Character.isIdentifierStart(cp)) {
  20913. return this.scanIdentifier();
  20914. }
  20915. // Very common: ( and ) and ;
  20916. if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
  20917. return this.scanPunctuator();
  20918. }
  20919. // String literal starts with single quote (U+0027) or double quote (U+0022).
  20920. if (cp === 0x27 || cp === 0x22) {
  20921. return this.scanStringLiteral();
  20922. }
  20923. // Dot (.) U+002E can also start a floating-point number, hence the need
  20924. // to check the next character.
  20925. if (cp === 0x2E) {
  20926. if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
  20927. return this.scanNumericLiteral();
  20928. }
  20929. return this.scanPunctuator();
  20930. }
  20931. if (character_1.Character.isDecimalDigit(cp)) {
  20932. return this.scanNumericLiteral();
  20933. }
  20934. // Template literals start with ` (U+0060) for template head
  20935. // or } (U+007D) for template middle or template tail.
  20936. if (cp === 0x60 || (cp === 0x7D && this.curlyStack[this.curlyStack.length - 1] === '${')) {
  20937. return this.scanTemplate();
  20938. }
  20939. // Possible identifier start in a surrogate pair.
  20940. if (cp >= 0xD800 && cp < 0xDFFF) {
  20941. if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
  20942. return this.scanIdentifier();
  20943. }
  20944. }
  20945. return this.scanPunctuator();
  20946. };
  20947. return Scanner;
  20948. }());
  20949. exports.Scanner = Scanner;
  20950. /***/ },
  20951. /* 13 */
  20952. /***/ function(module, exports) {
  20953. "use strict";
  20954. Object.defineProperty(exports, "__esModule", { value: true });
  20955. exports.TokenName = {};
  20956. exports.TokenName[1 /* BooleanLiteral */] = 'Boolean';
  20957. exports.TokenName[2 /* EOF */] = '<end>';
  20958. exports.TokenName[3 /* Identifier */] = 'Identifier';
  20959. exports.TokenName[4 /* Keyword */] = 'Keyword';
  20960. exports.TokenName[5 /* NullLiteral */] = 'Null';
  20961. exports.TokenName[6 /* NumericLiteral */] = 'Numeric';
  20962. exports.TokenName[7 /* Punctuator */] = 'Punctuator';
  20963. exports.TokenName[8 /* StringLiteral */] = 'String';
  20964. exports.TokenName[9 /* RegularExpression */] = 'RegularExpression';
  20965. exports.TokenName[10 /* Template */] = 'Template';
  20966. /***/ },
  20967. /* 14 */
  20968. /***/ function(module, exports) {
  20969. "use strict";
  20970. // Generated by generate-xhtml-entities.js. DO NOT MODIFY!
  20971. Object.defineProperty(exports, "__esModule", { value: true });
  20972. exports.XHTMLEntities = {
  20973. quot: '\u0022',
  20974. amp: '\u0026',
  20975. apos: '\u0027',
  20976. gt: '\u003E',
  20977. nbsp: '\u00A0',
  20978. iexcl: '\u00A1',
  20979. cent: '\u00A2',
  20980. pound: '\u00A3',
  20981. curren: '\u00A4',
  20982. yen: '\u00A5',
  20983. brvbar: '\u00A6',
  20984. sect: '\u00A7',
  20985. uml: '\u00A8',
  20986. copy: '\u00A9',
  20987. ordf: '\u00AA',
  20988. laquo: '\u00AB',
  20989. not: '\u00AC',
  20990. shy: '\u00AD',
  20991. reg: '\u00AE',
  20992. macr: '\u00AF',
  20993. deg: '\u00B0',
  20994. plusmn: '\u00B1',
  20995. sup2: '\u00B2',
  20996. sup3: '\u00B3',
  20997. acute: '\u00B4',
  20998. micro: '\u00B5',
  20999. para: '\u00B6',
  21000. middot: '\u00B7',
  21001. cedil: '\u00B8',
  21002. sup1: '\u00B9',
  21003. ordm: '\u00BA',
  21004. raquo: '\u00BB',
  21005. frac14: '\u00BC',
  21006. frac12: '\u00BD',
  21007. frac34: '\u00BE',
  21008. iquest: '\u00BF',
  21009. Agrave: '\u00C0',
  21010. Aacute: '\u00C1',
  21011. Acirc: '\u00C2',
  21012. Atilde: '\u00C3',
  21013. Auml: '\u00C4',
  21014. Aring: '\u00C5',
  21015. AElig: '\u00C6',
  21016. Ccedil: '\u00C7',
  21017. Egrave: '\u00C8',
  21018. Eacute: '\u00C9',
  21019. Ecirc: '\u00CA',
  21020. Euml: '\u00CB',
  21021. Igrave: '\u00CC',
  21022. Iacute: '\u00CD',
  21023. Icirc: '\u00CE',
  21024. Iuml: '\u00CF',
  21025. ETH: '\u00D0',
  21026. Ntilde: '\u00D1',
  21027. Ograve: '\u00D2',
  21028. Oacute: '\u00D3',
  21029. Ocirc: '\u00D4',
  21030. Otilde: '\u00D5',
  21031. Ouml: '\u00D6',
  21032. times: '\u00D7',
  21033. Oslash: '\u00D8',
  21034. Ugrave: '\u00D9',
  21035. Uacute: '\u00DA',
  21036. Ucirc: '\u00DB',
  21037. Uuml: '\u00DC',
  21038. Yacute: '\u00DD',
  21039. THORN: '\u00DE',
  21040. szlig: '\u00DF',
  21041. agrave: '\u00E0',
  21042. aacute: '\u00E1',
  21043. acirc: '\u00E2',
  21044. atilde: '\u00E3',
  21045. auml: '\u00E4',
  21046. aring: '\u00E5',
  21047. aelig: '\u00E6',
  21048. ccedil: '\u00E7',
  21049. egrave: '\u00E8',
  21050. eacute: '\u00E9',
  21051. ecirc: '\u00EA',
  21052. euml: '\u00EB',
  21053. igrave: '\u00EC',
  21054. iacute: '\u00ED',
  21055. icirc: '\u00EE',
  21056. iuml: '\u00EF',
  21057. eth: '\u00F0',
  21058. ntilde: '\u00F1',
  21059. ograve: '\u00F2',
  21060. oacute: '\u00F3',
  21061. ocirc: '\u00F4',
  21062. otilde: '\u00F5',
  21063. ouml: '\u00F6',
  21064. divide: '\u00F7',
  21065. oslash: '\u00F8',
  21066. ugrave: '\u00F9',
  21067. uacute: '\u00FA',
  21068. ucirc: '\u00FB',
  21069. uuml: '\u00FC',
  21070. yacute: '\u00FD',
  21071. thorn: '\u00FE',
  21072. yuml: '\u00FF',
  21073. OElig: '\u0152',
  21074. oelig: '\u0153',
  21075. Scaron: '\u0160',
  21076. scaron: '\u0161',
  21077. Yuml: '\u0178',
  21078. fnof: '\u0192',
  21079. circ: '\u02C6',
  21080. tilde: '\u02DC',
  21081. Alpha: '\u0391',
  21082. Beta: '\u0392',
  21083. Gamma: '\u0393',
  21084. Delta: '\u0394',
  21085. Epsilon: '\u0395',
  21086. Zeta: '\u0396',
  21087. Eta: '\u0397',
  21088. Theta: '\u0398',
  21089. Iota: '\u0399',
  21090. Kappa: '\u039A',
  21091. Lambda: '\u039B',
  21092. Mu: '\u039C',
  21093. Nu: '\u039D',
  21094. Xi: '\u039E',
  21095. Omicron: '\u039F',
  21096. Pi: '\u03A0',
  21097. Rho: '\u03A1',
  21098. Sigma: '\u03A3',
  21099. Tau: '\u03A4',
  21100. Upsilon: '\u03A5',
  21101. Phi: '\u03A6',
  21102. Chi: '\u03A7',
  21103. Psi: '\u03A8',
  21104. Omega: '\u03A9',
  21105. alpha: '\u03B1',
  21106. beta: '\u03B2',
  21107. gamma: '\u03B3',
  21108. delta: '\u03B4',
  21109. epsilon: '\u03B5',
  21110. zeta: '\u03B6',
  21111. eta: '\u03B7',
  21112. theta: '\u03B8',
  21113. iota: '\u03B9',
  21114. kappa: '\u03BA',
  21115. lambda: '\u03BB',
  21116. mu: '\u03BC',
  21117. nu: '\u03BD',
  21118. xi: '\u03BE',
  21119. omicron: '\u03BF',
  21120. pi: '\u03C0',
  21121. rho: '\u03C1',
  21122. sigmaf: '\u03C2',
  21123. sigma: '\u03C3',
  21124. tau: '\u03C4',
  21125. upsilon: '\u03C5',
  21126. phi: '\u03C6',
  21127. chi: '\u03C7',
  21128. psi: '\u03C8',
  21129. omega: '\u03C9',
  21130. thetasym: '\u03D1',
  21131. upsih: '\u03D2',
  21132. piv: '\u03D6',
  21133. ensp: '\u2002',
  21134. emsp: '\u2003',
  21135. thinsp: '\u2009',
  21136. zwnj: '\u200C',
  21137. zwj: '\u200D',
  21138. lrm: '\u200E',
  21139. rlm: '\u200F',
  21140. ndash: '\u2013',
  21141. mdash: '\u2014',
  21142. lsquo: '\u2018',
  21143. rsquo: '\u2019',
  21144. sbquo: '\u201A',
  21145. ldquo: '\u201C',
  21146. rdquo: '\u201D',
  21147. bdquo: '\u201E',
  21148. dagger: '\u2020',
  21149. Dagger: '\u2021',
  21150. bull: '\u2022',
  21151. hellip: '\u2026',
  21152. permil: '\u2030',
  21153. prime: '\u2032',
  21154. Prime: '\u2033',
  21155. lsaquo: '\u2039',
  21156. rsaquo: '\u203A',
  21157. oline: '\u203E',
  21158. frasl: '\u2044',
  21159. euro: '\u20AC',
  21160. image: '\u2111',
  21161. weierp: '\u2118',
  21162. real: '\u211C',
  21163. trade: '\u2122',
  21164. alefsym: '\u2135',
  21165. larr: '\u2190',
  21166. uarr: '\u2191',
  21167. rarr: '\u2192',
  21168. darr: '\u2193',
  21169. harr: '\u2194',
  21170. crarr: '\u21B5',
  21171. lArr: '\u21D0',
  21172. uArr: '\u21D1',
  21173. rArr: '\u21D2',
  21174. dArr: '\u21D3',
  21175. hArr: '\u21D4',
  21176. forall: '\u2200',
  21177. part: '\u2202',
  21178. exist: '\u2203',
  21179. empty: '\u2205',
  21180. nabla: '\u2207',
  21181. isin: '\u2208',
  21182. notin: '\u2209',
  21183. ni: '\u220B',
  21184. prod: '\u220F',
  21185. sum: '\u2211',
  21186. minus: '\u2212',
  21187. lowast: '\u2217',
  21188. radic: '\u221A',
  21189. prop: '\u221D',
  21190. infin: '\u221E',
  21191. ang: '\u2220',
  21192. and: '\u2227',
  21193. or: '\u2228',
  21194. cap: '\u2229',
  21195. cup: '\u222A',
  21196. int: '\u222B',
  21197. there4: '\u2234',
  21198. sim: '\u223C',
  21199. cong: '\u2245',
  21200. asymp: '\u2248',
  21201. ne: '\u2260',
  21202. equiv: '\u2261',
  21203. le: '\u2264',
  21204. ge: '\u2265',
  21205. sub: '\u2282',
  21206. sup: '\u2283',
  21207. nsub: '\u2284',
  21208. sube: '\u2286',
  21209. supe: '\u2287',
  21210. oplus: '\u2295',
  21211. otimes: '\u2297',
  21212. perp: '\u22A5',
  21213. sdot: '\u22C5',
  21214. lceil: '\u2308',
  21215. rceil: '\u2309',
  21216. lfloor: '\u230A',
  21217. rfloor: '\u230B',
  21218. loz: '\u25CA',
  21219. spades: '\u2660',
  21220. clubs: '\u2663',
  21221. hearts: '\u2665',
  21222. diams: '\u2666',
  21223. lang: '\u27E8',
  21224. rang: '\u27E9'
  21225. };
  21226. /***/ },
  21227. /* 15 */
  21228. /***/ function(module, exports, __webpack_require__) {
  21229. "use strict";
  21230. Object.defineProperty(exports, "__esModule", { value: true });
  21231. var error_handler_1 = __webpack_require__(10);
  21232. var scanner_1 = __webpack_require__(12);
  21233. var token_1 = __webpack_require__(13);
  21234. var Reader = (function () {
  21235. function Reader() {
  21236. this.values = [];
  21237. this.curly = this.paren = -1;
  21238. }
  21239. // A function following one of those tokens is an expression.
  21240. Reader.prototype.beforeFunctionExpression = function (t) {
  21241. return ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
  21242. 'return', 'case', 'delete', 'throw', 'void',
  21243. // assignment operators
  21244. '=', '+=', '-=', '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=',
  21245. '&=', '|=', '^=', ',',
  21246. // binary/unary operators
  21247. '+', '-', '*', '**', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
  21248. '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
  21249. '<=', '<', '>', '!=', '!=='].indexOf(t) >= 0;
  21250. };
  21251. // Determine if forward slash (/) is an operator or part of a regular expression
  21252. // https://github.com/mozilla/sweet.js/wiki/design
  21253. Reader.prototype.isRegexStart = function () {
  21254. var previous = this.values[this.values.length - 1];
  21255. var regex = (previous !== null);
  21256. switch (previous) {
  21257. case 'this':
  21258. case ']':
  21259. regex = false;
  21260. break;
  21261. case ')':
  21262. var keyword = this.values[this.paren - 1];
  21263. regex = (keyword === 'if' || keyword === 'while' || keyword === 'for' || keyword === 'with');
  21264. break;
  21265. case '}':
  21266. // Dividing a function by anything makes little sense,
  21267. // but we have to check for that.
  21268. regex = false;
  21269. if (this.values[this.curly - 3] === 'function') {
  21270. // Anonymous function, e.g. function(){} /42
  21271. var check = this.values[this.curly - 4];
  21272. regex = check ? !this.beforeFunctionExpression(check) : false;
  21273. }
  21274. else if (this.values[this.curly - 4] === 'function') {
  21275. // Named function, e.g. function f(){} /42/
  21276. var check = this.values[this.curly - 5];
  21277. regex = check ? !this.beforeFunctionExpression(check) : true;
  21278. }
  21279. break;
  21280. default:
  21281. break;
  21282. }
  21283. return regex;
  21284. };
  21285. Reader.prototype.push = function (token) {
  21286. if (token.type === 7 /* Punctuator */ || token.type === 4 /* Keyword */) {
  21287. if (token.value === '{') {
  21288. this.curly = this.values.length;
  21289. }
  21290. else if (token.value === '(') {
  21291. this.paren = this.values.length;
  21292. }
  21293. this.values.push(token.value);
  21294. }
  21295. else {
  21296. this.values.push(null);
  21297. }
  21298. };
  21299. return Reader;
  21300. }());
  21301. var Tokenizer = (function () {
  21302. function Tokenizer(code, config) {
  21303. this.errorHandler = new error_handler_1.ErrorHandler();
  21304. this.errorHandler.tolerant = config ? (typeof config.tolerant === 'boolean' && config.tolerant) : false;
  21305. this.scanner = new scanner_1.Scanner(code, this.errorHandler);
  21306. this.scanner.trackComment = config ? (typeof config.comment === 'boolean' && config.comment) : false;
  21307. this.trackRange = config ? (typeof config.range === 'boolean' && config.range) : false;
  21308. this.trackLoc = config ? (typeof config.loc === 'boolean' && config.loc) : false;
  21309. this.buffer = [];
  21310. this.reader = new Reader();
  21311. }
  21312. Tokenizer.prototype.errors = function () {
  21313. return this.errorHandler.errors;
  21314. };
  21315. Tokenizer.prototype.getNextToken = function () {
  21316. if (this.buffer.length === 0) {
  21317. var comments = this.scanner.scanComments();
  21318. if (this.scanner.trackComment) {
  21319. for (var i = 0; i < comments.length; ++i) {
  21320. var e = comments[i];
  21321. var value = this.scanner.source.slice(e.slice[0], e.slice[1]);
  21322. var comment = {
  21323. type: e.multiLine ? 'BlockComment' : 'LineComment',
  21324. value: value
  21325. };
  21326. if (this.trackRange) {
  21327. comment.range = e.range;
  21328. }
  21329. if (this.trackLoc) {
  21330. comment.loc = e.loc;
  21331. }
  21332. this.buffer.push(comment);
  21333. }
  21334. }
  21335. if (!this.scanner.eof()) {
  21336. var loc = void 0;
  21337. if (this.trackLoc) {
  21338. loc = {
  21339. start: {
  21340. line: this.scanner.lineNumber,
  21341. column: this.scanner.index - this.scanner.lineStart
  21342. },
  21343. end: {}
  21344. };
  21345. }
  21346. var startRegex = (this.scanner.source[this.scanner.index] === '/') && this.reader.isRegexStart();
  21347. var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex();
  21348. this.reader.push(token);
  21349. var entry = {
  21350. type: token_1.TokenName[token.type],
  21351. value: this.scanner.source.slice(token.start, token.end)
  21352. };
  21353. if (this.trackRange) {
  21354. entry.range = [token.start, token.end];
  21355. }
  21356. if (this.trackLoc) {
  21357. loc.end = {
  21358. line: this.scanner.lineNumber,
  21359. column: this.scanner.index - this.scanner.lineStart
  21360. };
  21361. entry.loc = loc;
  21362. }
  21363. if (token.type === 9 /* RegularExpression */) {
  21364. var pattern = token.pattern;
  21365. var flags = token.flags;
  21366. entry.regex = { pattern: pattern, flags: flags };
  21367. }
  21368. this.buffer.push(entry);
  21369. }
  21370. }
  21371. return this.buffer.shift();
  21372. };
  21373. return Tokenizer;
  21374. }());
  21375. exports.Tokenizer = Tokenizer;
  21376. /***/ }
  21377. /******/ ])
  21378. });
  21379. ;
  21380. /***/ }),
  21381. /* 115 */
  21382. /***/ (function(module, exports, __webpack_require__) {
  21383. "use strict";
  21384. var defaults = __webpack_require__(19);
  21385. module.exports = function(file, options) {
  21386. var opts = defaults(options);
  21387. if (file.data == null) {
  21388. file.data = {};
  21389. }
  21390. if (typeof opts.excerpt === 'function') {
  21391. return opts.excerpt(file, opts);
  21392. }
  21393. var sep = file.data.excerpt_separator || opts.excerpt_separator;
  21394. if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
  21395. return file;
  21396. }
  21397. var delimiter = sep || opts.delimiters[0];
  21398. if (typeof opts.excerpt === 'string') {
  21399. delimiter = opts.excerpt;
  21400. }
  21401. // if enabled, get the excerpt defined after front-matter
  21402. var idx = file.content.indexOf(delimiter);
  21403. if (idx !== -1) {
  21404. file.excerpt = file.content.slice(0, idx);
  21405. }
  21406. return file;
  21407. };
  21408. /***/ }),
  21409. /* 116 */
  21410. /***/ (function(module, exports, __webpack_require__) {
  21411. "use strict";
  21412. var getEngine = __webpack_require__(45);
  21413. var defaults = __webpack_require__(19);
  21414. module.exports = function(language, str, options) {
  21415. var opts = defaults(options);
  21416. var engine = getEngine(language, opts);
  21417. if (typeof engine.parse !== 'function') {
  21418. throw new TypeError('expected "' + language + '.parse" to be a function');
  21419. }
  21420. return engine.parse(str, opts);
  21421. };
  21422. /***/ }),
  21423. /* 117 */
  21424. /***/ (function(module, exports, __webpack_require__) {
  21425. "use strict";
  21426. var typeOf = __webpack_require__(25);
  21427. var stringify = __webpack_require__(47);
  21428. var utils = __webpack_require__(24);
  21429. /**
  21430. * Normalize the given value to ensure an object is returned
  21431. * with the expected properties.
  21432. */
  21433. module.exports = function(file) {
  21434. if (typeOf(file) !== 'object') {
  21435. file = { content: file };
  21436. }
  21437. if (typeOf(file.data) !== 'object') {
  21438. file.data = {};
  21439. }
  21440. if (file.content == null) {
  21441. file.content = file.contents;
  21442. }
  21443. var orig = utils.toBuffer(file.content);
  21444. Object.defineProperty(file, 'orig', {
  21445. configurable: true,
  21446. enumerable: false,
  21447. writable: true,
  21448. value: orig
  21449. });
  21450. Object.defineProperty(file, 'matter', {
  21451. configurable: true,
  21452. enumerable: false,
  21453. writable: true,
  21454. value: file.matter || ''
  21455. });
  21456. Object.defineProperty(file, 'language', {
  21457. configurable: true,
  21458. enumerable: false,
  21459. writable: true,
  21460. value: file.language || ''
  21461. });
  21462. Object.defineProperty(file, 'stringify', {
  21463. configurable: true,
  21464. enumerable: false,
  21465. writable: true,
  21466. value: function(data, options) {
  21467. if (options && options.language) {
  21468. file.language = options.language;
  21469. }
  21470. return stringify(file, data, options);
  21471. }
  21472. });
  21473. file.content = utils.toString(file.content);
  21474. file.excerpt = '';
  21475. return file;
  21476. };
  21477. /***/ }),
  21478. /* 118 */
  21479. /***/ (function(module, exports, __webpack_require__) {
  21480. "use strict";
  21481. var ansiRegex = __webpack_require__(43);
  21482. var re = new RegExp(ansiRegex().source); // remove the `g` flag
  21483. module.exports = re.test.bind(re);
  21484. /***/ }),
  21485. /* 119 */
  21486. /***/ (function(module, exports) {
  21487. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  21488. var e, m
  21489. var eLen = nBytes * 8 - mLen - 1
  21490. var eMax = (1 << eLen) - 1
  21491. var eBias = eMax >> 1
  21492. var nBits = -7
  21493. var i = isLE ? (nBytes - 1) : 0
  21494. var d = isLE ? -1 : 1
  21495. var s = buffer[offset + i]
  21496. i += d
  21497. e = s & ((1 << (-nBits)) - 1)
  21498. s >>= (-nBits)
  21499. nBits += eLen
  21500. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  21501. m = e & ((1 << (-nBits)) - 1)
  21502. e >>= (-nBits)
  21503. nBits += mLen
  21504. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  21505. if (e === 0) {
  21506. e = 1 - eBias
  21507. } else if (e === eMax) {
  21508. return m ? NaN : ((s ? -1 : 1) * Infinity)
  21509. } else {
  21510. m = m + Math.pow(2, mLen)
  21511. e = e - eBias
  21512. }
  21513. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  21514. }
  21515. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  21516. var e, m, c
  21517. var eLen = nBytes * 8 - mLen - 1
  21518. var eMax = (1 << eLen) - 1
  21519. var eBias = eMax >> 1
  21520. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  21521. var i = isLE ? 0 : (nBytes - 1)
  21522. var d = isLE ? 1 : -1
  21523. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  21524. value = Math.abs(value)
  21525. if (isNaN(value) || value === Infinity) {
  21526. m = isNaN(value) ? 1 : 0
  21527. e = eMax
  21528. } else {
  21529. e = Math.floor(Math.log(value) / Math.LN2)
  21530. if (value * (c = Math.pow(2, -e)) < 1) {
  21531. e--
  21532. c *= 2
  21533. }
  21534. if (e + eBias >= 1) {
  21535. value += rt / c
  21536. } else {
  21537. value += rt * Math.pow(2, 1 - eBias)
  21538. }
  21539. if (value * c >= 2) {
  21540. e++
  21541. c /= 2
  21542. }
  21543. if (e + eBias >= eMax) {
  21544. m = 0
  21545. e = eMax
  21546. } else if (e + eBias >= 1) {
  21547. m = (value * c - 1) * Math.pow(2, mLen)
  21548. e = e + eBias
  21549. } else {
  21550. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  21551. e = 0
  21552. }
  21553. }
  21554. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  21555. e = (e << mLen) | m
  21556. eLen += mLen
  21557. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  21558. buffer[offset + i - d] |= s * 128
  21559. }
  21560. /***/ }),
  21561. /* 120 */
  21562. /***/ (function(module, exports, __webpack_require__) {
  21563. "use strict";
  21564. /*!
  21565. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  21566. *
  21567. * Copyright (c) 2015, Jon Schlinkert.
  21568. * Licensed under the MIT License.
  21569. */
  21570. module.exports = function isExtendable(val) {
  21571. return typeof val !== 'undefined' && val !== null
  21572. && (typeof val === 'object' || typeof val === 'function');
  21573. };
  21574. /***/ }),
  21575. /* 121 */
  21576. /***/ (function(module, exports) {
  21577. var toString = {}.toString;
  21578. module.exports = Array.isArray || function (arr) {
  21579. return toString.call(arr) == '[object Array]';
  21580. };
  21581. /***/ }),
  21582. /* 122 */
  21583. /***/ (function(module, exports, __webpack_require__) {
  21584. "use strict";
  21585. var yaml = __webpack_require__(123);
  21586. module.exports = yaml;
  21587. /***/ }),
  21588. /* 123 */
  21589. /***/ (function(module, exports, __webpack_require__) {
  21590. "use strict";
  21591. var loader = __webpack_require__(125);
  21592. var dumper = __webpack_require__(124);
  21593. function deprecated(name) {
  21594. return function () {
  21595. throw new Error('Function ' + name + ' is deprecated and cannot be used.');
  21596. };
  21597. }
  21598. module.exports.Type = __webpack_require__(0);
  21599. module.exports.Schema = __webpack_require__(7);
  21600. module.exports.FAILSAFE_SCHEMA = __webpack_require__(26);
  21601. module.exports.JSON_SCHEMA = __webpack_require__(51);
  21602. module.exports.CORE_SCHEMA = __webpack_require__(50);
  21603. module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(12);
  21604. module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(20);
  21605. module.exports.load = loader.load;
  21606. module.exports.loadAll = loader.loadAll;
  21607. module.exports.safeLoad = loader.safeLoad;
  21608. module.exports.safeLoadAll = loader.safeLoadAll;
  21609. module.exports.dump = dumper.dump;
  21610. module.exports.safeDump = dumper.safeDump;
  21611. module.exports.YAMLException = __webpack_require__(11);
  21612. // Deprecated schema names from JS-YAML 2.0.x
  21613. module.exports.MINIMAL_SCHEMA = __webpack_require__(26);
  21614. module.exports.SAFE_SCHEMA = __webpack_require__(12);
  21615. module.exports.DEFAULT_SCHEMA = __webpack_require__(20);
  21616. // Deprecated functions from JS-YAML 1.x.x
  21617. module.exports.scan = deprecated('scan');
  21618. module.exports.parse = deprecated('parse');
  21619. module.exports.compose = deprecated('compose');
  21620. module.exports.addConstructor = deprecated('addConstructor');
  21621. /***/ }),
  21622. /* 124 */
  21623. /***/ (function(module, exports, __webpack_require__) {
  21624. "use strict";
  21625. /*eslint-disable no-use-before-define*/
  21626. var common = __webpack_require__(6);
  21627. var YAMLException = __webpack_require__(11);
  21628. var DEFAULT_FULL_SCHEMA = __webpack_require__(20);
  21629. var DEFAULT_SAFE_SCHEMA = __webpack_require__(12);
  21630. var _toString = Object.prototype.toString;
  21631. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  21632. var CHAR_TAB = 0x09; /* Tab */
  21633. var CHAR_LINE_FEED = 0x0A; /* LF */
  21634. var CHAR_SPACE = 0x20; /* Space */
  21635. var CHAR_EXCLAMATION = 0x21; /* ! */
  21636. var CHAR_DOUBLE_QUOTE = 0x22; /* " */
  21637. var CHAR_SHARP = 0x23; /* # */
  21638. var CHAR_PERCENT = 0x25; /* % */
  21639. var CHAR_AMPERSAND = 0x26; /* & */
  21640. var CHAR_SINGLE_QUOTE = 0x27; /* ' */
  21641. var CHAR_ASTERISK = 0x2A; /* * */
  21642. var CHAR_COMMA = 0x2C; /* , */
  21643. var CHAR_MINUS = 0x2D; /* - */
  21644. var CHAR_COLON = 0x3A; /* : */
  21645. var CHAR_GREATER_THAN = 0x3E; /* > */
  21646. var CHAR_QUESTION = 0x3F; /* ? */
  21647. var CHAR_COMMERCIAL_AT = 0x40; /* @ */
  21648. var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
  21649. var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
  21650. var CHAR_GRAVE_ACCENT = 0x60; /* ` */
  21651. var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
  21652. var CHAR_VERTICAL_LINE = 0x7C; /* | */
  21653. var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
  21654. var ESCAPE_SEQUENCES = {};
  21655. ESCAPE_SEQUENCES[0x00] = '\\0';
  21656. ESCAPE_SEQUENCES[0x07] = '\\a';
  21657. ESCAPE_SEQUENCES[0x08] = '\\b';
  21658. ESCAPE_SEQUENCES[0x09] = '\\t';
  21659. ESCAPE_SEQUENCES[0x0A] = '\\n';
  21660. ESCAPE_SEQUENCES[0x0B] = '\\v';
  21661. ESCAPE_SEQUENCES[0x0C] = '\\f';
  21662. ESCAPE_SEQUENCES[0x0D] = '\\r';
  21663. ESCAPE_SEQUENCES[0x1B] = '\\e';
  21664. ESCAPE_SEQUENCES[0x22] = '\\"';
  21665. ESCAPE_SEQUENCES[0x5C] = '\\\\';
  21666. ESCAPE_SEQUENCES[0x85] = '\\N';
  21667. ESCAPE_SEQUENCES[0xA0] = '\\_';
  21668. ESCAPE_SEQUENCES[0x2028] = '\\L';
  21669. ESCAPE_SEQUENCES[0x2029] = '\\P';
  21670. var DEPRECATED_BOOLEANS_SYNTAX = [
  21671. 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
  21672. 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
  21673. ];
  21674. function compileStyleMap(schema, map) {
  21675. var result, keys, index, length, tag, style, type;
  21676. if (map === null) return {};
  21677. result = {};
  21678. keys = Object.keys(map);
  21679. for (index = 0, length = keys.length; index < length; index += 1) {
  21680. tag = keys[index];
  21681. style = String(map[tag]);
  21682. if (tag.slice(0, 2) === '!!') {
  21683. tag = 'tag:yaml.org,2002:' + tag.slice(2);
  21684. }
  21685. type = schema.compiledTypeMap['fallback'][tag];
  21686. if (type && _hasOwnProperty.call(type.styleAliases, style)) {
  21687. style = type.styleAliases[style];
  21688. }
  21689. result[tag] = style;
  21690. }
  21691. return result;
  21692. }
  21693. function encodeHex(character) {
  21694. var string, handle, length;
  21695. string = character.toString(16).toUpperCase();
  21696. if (character <= 0xFF) {
  21697. handle = 'x';
  21698. length = 2;
  21699. } else if (character <= 0xFFFF) {
  21700. handle = 'u';
  21701. length = 4;
  21702. } else if (character <= 0xFFFFFFFF) {
  21703. handle = 'U';
  21704. length = 8;
  21705. } else {
  21706. throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
  21707. }
  21708. return '\\' + handle + common.repeat('0', length - string.length) + string;
  21709. }
  21710. function State(options) {
  21711. this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
  21712. this.indent = Math.max(1, (options['indent'] || 2));
  21713. this.skipInvalid = options['skipInvalid'] || false;
  21714. this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
  21715. this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
  21716. this.sortKeys = options['sortKeys'] || false;
  21717. this.lineWidth = options['lineWidth'] || 80;
  21718. this.noRefs = options['noRefs'] || false;
  21719. this.noCompatMode = options['noCompatMode'] || false;
  21720. this.condenseFlow = options['condenseFlow'] || false;
  21721. this.implicitTypes = this.schema.compiledImplicit;
  21722. this.explicitTypes = this.schema.compiledExplicit;
  21723. this.tag = null;
  21724. this.result = '';
  21725. this.duplicates = [];
  21726. this.usedDuplicates = null;
  21727. }
  21728. // Indents every line in a string. Empty lines (\n only) are not indented.
  21729. function indentString(string, spaces) {
  21730. var ind = common.repeat(' ', spaces),
  21731. position = 0,
  21732. next = -1,
  21733. result = '',
  21734. line,
  21735. length = string.length;
  21736. while (position < length) {
  21737. next = string.indexOf('\n', position);
  21738. if (next === -1) {
  21739. line = string.slice(position);
  21740. position = length;
  21741. } else {
  21742. line = string.slice(position, next + 1);
  21743. position = next + 1;
  21744. }
  21745. if (line.length && line !== '\n') result += ind;
  21746. result += line;
  21747. }
  21748. return result;
  21749. }
  21750. function generateNextLine(state, level) {
  21751. return '\n' + common.repeat(' ', state.indent * level);
  21752. }
  21753. function testImplicitResolving(state, str) {
  21754. var index, length, type;
  21755. for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
  21756. type = state.implicitTypes[index];
  21757. if (type.resolve(str)) {
  21758. return true;
  21759. }
  21760. }
  21761. return false;
  21762. }
  21763. // [33] s-white ::= s-space | s-tab
  21764. function isWhitespace(c) {
  21765. return c === CHAR_SPACE || c === CHAR_TAB;
  21766. }
  21767. // Returns true if the character can be printed without escaping.
  21768. // From YAML 1.2: "any allowed characters known to be non-printable
  21769. // should also be escaped. [However,] This isn’t mandatory"
  21770. // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
  21771. function isPrintable(c) {
  21772. return (0x00020 <= c && c <= 0x00007E)
  21773. || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
  21774. || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
  21775. || (0x10000 <= c && c <= 0x10FFFF);
  21776. }
  21777. // Simplified test for values allowed after the first character in plain style.
  21778. function isPlainSafe(c) {
  21779. // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
  21780. // where nb-char ::= c-printable - b-char - c-byte-order-mark.
  21781. return isPrintable(c) && c !== 0xFEFF
  21782. // - c-flow-indicator
  21783. && c !== CHAR_COMMA
  21784. && c !== CHAR_LEFT_SQUARE_BRACKET
  21785. && c !== CHAR_RIGHT_SQUARE_BRACKET
  21786. && c !== CHAR_LEFT_CURLY_BRACKET
  21787. && c !== CHAR_RIGHT_CURLY_BRACKET
  21788. // - ":" - "#"
  21789. && c !== CHAR_COLON
  21790. && c !== CHAR_SHARP;
  21791. }
  21792. // Simplified test for values allowed as the first character in plain style.
  21793. function isPlainSafeFirst(c) {
  21794. // Uses a subset of ns-char - c-indicator
  21795. // where ns-char = nb-char - s-white.
  21796. return isPrintable(c) && c !== 0xFEFF
  21797. && !isWhitespace(c) // - s-white
  21798. // - (c-indicator ::=
  21799. // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
  21800. && c !== CHAR_MINUS
  21801. && c !== CHAR_QUESTION
  21802. && c !== CHAR_COLON
  21803. && c !== CHAR_COMMA
  21804. && c !== CHAR_LEFT_SQUARE_BRACKET
  21805. && c !== CHAR_RIGHT_SQUARE_BRACKET
  21806. && c !== CHAR_LEFT_CURLY_BRACKET
  21807. && c !== CHAR_RIGHT_CURLY_BRACKET
  21808. // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
  21809. && c !== CHAR_SHARP
  21810. && c !== CHAR_AMPERSAND
  21811. && c !== CHAR_ASTERISK
  21812. && c !== CHAR_EXCLAMATION
  21813. && c !== CHAR_VERTICAL_LINE
  21814. && c !== CHAR_GREATER_THAN
  21815. && c !== CHAR_SINGLE_QUOTE
  21816. && c !== CHAR_DOUBLE_QUOTE
  21817. // | “%” | “@” | “`”)
  21818. && c !== CHAR_PERCENT
  21819. && c !== CHAR_COMMERCIAL_AT
  21820. && c !== CHAR_GRAVE_ACCENT;
  21821. }
  21822. var STYLE_PLAIN = 1,
  21823. STYLE_SINGLE = 2,
  21824. STYLE_LITERAL = 3,
  21825. STYLE_FOLDED = 4,
  21826. STYLE_DOUBLE = 5;
  21827. // Determines which scalar styles are possible and returns the preferred style.
  21828. // lineWidth = -1 => no limit.
  21829. // Pre-conditions: str.length > 0.
  21830. // Post-conditions:
  21831. // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
  21832. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
  21833. // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
  21834. function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
  21835. var i;
  21836. var char;
  21837. var hasLineBreak = false;
  21838. var hasFoldableLine = false; // only checked if shouldTrackWidth
  21839. var shouldTrackWidth = lineWidth !== -1;
  21840. var previousLineBreak = -1; // count the first line correctly
  21841. var plain = isPlainSafeFirst(string.charCodeAt(0))
  21842. && !isWhitespace(string.charCodeAt(string.length - 1));
  21843. if (singleLineOnly) {
  21844. // Case: no block styles.
  21845. // Check for disallowed characters to rule out plain and single.
  21846. for (i = 0; i < string.length; i++) {
  21847. char = string.charCodeAt(i);
  21848. if (!isPrintable(char)) {
  21849. return STYLE_DOUBLE;
  21850. }
  21851. plain = plain && isPlainSafe(char);
  21852. }
  21853. } else {
  21854. // Case: block styles permitted.
  21855. for (i = 0; i < string.length; i++) {
  21856. char = string.charCodeAt(i);
  21857. if (char === CHAR_LINE_FEED) {
  21858. hasLineBreak = true;
  21859. // Check if any line can be folded.
  21860. if (shouldTrackWidth) {
  21861. hasFoldableLine = hasFoldableLine ||
  21862. // Foldable line = too long, and not more-indented.
  21863. (i - previousLineBreak - 1 > lineWidth &&
  21864. string[previousLineBreak + 1] !== ' ');
  21865. previousLineBreak = i;
  21866. }
  21867. } else if (!isPrintable(char)) {
  21868. return STYLE_DOUBLE;
  21869. }
  21870. plain = plain && isPlainSafe(char);
  21871. }
  21872. // in case the end is missing a \n
  21873. hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
  21874. (i - previousLineBreak - 1 > lineWidth &&
  21875. string[previousLineBreak + 1] !== ' '));
  21876. }
  21877. // Although every style can represent \n without escaping, prefer block styles
  21878. // for multiline, since they're more readable and they don't add empty lines.
  21879. // Also prefer folding a super-long line.
  21880. if (!hasLineBreak && !hasFoldableLine) {
  21881. // Strings interpretable as another type have to be quoted;
  21882. // e.g. the string 'true' vs. the boolean true.
  21883. return plain && !testAmbiguousType(string)
  21884. ? STYLE_PLAIN : STYLE_SINGLE;
  21885. }
  21886. // Edge case: block indentation indicator can only have one digit.
  21887. if (string[0] === ' ' && indentPerLevel > 9) {
  21888. return STYLE_DOUBLE;
  21889. }
  21890. // At this point we know block styles are valid.
  21891. // Prefer literal style unless we want to fold.
  21892. return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
  21893. }
  21894. // Note: line breaking/folding is implemented for only the folded style.
  21895. // NB. We drop the last trailing newline (if any) of a returned block scalar
  21896. // since the dumper adds its own newline. This always works:
  21897. // • No ending newline => unaffected; already using strip "-" chomping.
  21898. // • Ending newline => removed then restored.
  21899. // Importantly, this keeps the "+" chomp indicator from gaining an extra line.
  21900. function writeScalar(state, string, level, iskey) {
  21901. state.dump = (function () {
  21902. if (string.length === 0) {
  21903. return "''";
  21904. }
  21905. if (!state.noCompatMode &&
  21906. DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
  21907. return "'" + string + "'";
  21908. }
  21909. var indent = state.indent * Math.max(1, level); // no 0-indent scalars
  21910. // As indentation gets deeper, let the width decrease monotonically
  21911. // to the lower bound min(state.lineWidth, 40).
  21912. // Note that this implies
  21913. // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
  21914. // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
  21915. // This behaves better than a constant minimum width which disallows narrower options,
  21916. // or an indent threshold which causes the width to suddenly increase.
  21917. var lineWidth = state.lineWidth === -1
  21918. ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
  21919. // Without knowing if keys are implicit/explicit, assume implicit for safety.
  21920. var singleLineOnly = iskey
  21921. // No block styles in flow mode.
  21922. || (state.flowLevel > -1 && level >= state.flowLevel);
  21923. function testAmbiguity(string) {
  21924. return testImplicitResolving(state, string);
  21925. }
  21926. switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
  21927. case STYLE_PLAIN:
  21928. return string;
  21929. case STYLE_SINGLE:
  21930. return "'" + string.replace(/'/g, "''") + "'";
  21931. case STYLE_LITERAL:
  21932. return '|' + blockHeader(string, state.indent)
  21933. + dropEndingNewline(indentString(string, indent));
  21934. case STYLE_FOLDED:
  21935. return '>' + blockHeader(string, state.indent)
  21936. + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
  21937. case STYLE_DOUBLE:
  21938. return '"' + escapeString(string, lineWidth) + '"';
  21939. default:
  21940. throw new YAMLException('impossible error: invalid scalar style');
  21941. }
  21942. }());
  21943. }
  21944. // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
  21945. function blockHeader(string, indentPerLevel) {
  21946. var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';
  21947. // note the special case: the string '\n' counts as a "trailing" empty line.
  21948. var clip = string[string.length - 1] === '\n';
  21949. var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
  21950. var chomp = keep ? '+' : (clip ? '' : '-');
  21951. return indentIndicator + chomp + '\n';
  21952. }
  21953. // (See the note for writeScalar.)
  21954. function dropEndingNewline(string) {
  21955. return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
  21956. }
  21957. // Note: a long line without a suitable break point will exceed the width limit.
  21958. // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
  21959. function foldString(string, width) {
  21960. // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
  21961. // unless they're before or after a more-indented line, or at the very
  21962. // beginning or end, in which case $k$ maps to $k$.
  21963. // Therefore, parse each chunk as newline(s) followed by a content line.
  21964. var lineRe = /(\n+)([^\n]*)/g;
  21965. // first line (possibly an empty line)
  21966. var result = (function () {
  21967. var nextLF = string.indexOf('\n');
  21968. nextLF = nextLF !== -1 ? nextLF : string.length;
  21969. lineRe.lastIndex = nextLF;
  21970. return foldLine(string.slice(0, nextLF), width);
  21971. }());
  21972. // If we haven't reached the first content line yet, don't add an extra \n.
  21973. var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
  21974. var moreIndented;
  21975. // rest of the lines
  21976. var match;
  21977. while ((match = lineRe.exec(string))) {
  21978. var prefix = match[1], line = match[2];
  21979. moreIndented = (line[0] === ' ');
  21980. result += prefix
  21981. + (!prevMoreIndented && !moreIndented && line !== ''
  21982. ? '\n' : '')
  21983. + foldLine(line, width);
  21984. prevMoreIndented = moreIndented;
  21985. }
  21986. return result;
  21987. }
  21988. // Greedy line breaking.
  21989. // Picks the longest line under the limit each time,
  21990. // otherwise settles for the shortest line over the limit.
  21991. // NB. More-indented lines *cannot* be folded, as that would add an extra \n.
  21992. function foldLine(line, width) {
  21993. if (line === '' || line[0] === ' ') return line;
  21994. // Since a more-indented line adds a \n, breaks can't be followed by a space.
  21995. var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
  21996. var match;
  21997. // start is an inclusive index. end, curr, and next are exclusive.
  21998. var start = 0, end, curr = 0, next = 0;
  21999. var result = '';
  22000. // Invariants: 0 <= start <= length-1.
  22001. // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
  22002. // Inside the loop:
  22003. // A match implies length >= 2, so curr and next are <= length-2.
  22004. while ((match = breakRe.exec(line))) {
  22005. next = match.index;
  22006. // maintain invariant: curr - start <= width
  22007. if (next - start > width) {
  22008. end = (curr > start) ? curr : next; // derive end <= length-2
  22009. result += '\n' + line.slice(start, end);
  22010. // skip the space that was output as \n
  22011. start = end + 1; // derive start <= length-1
  22012. }
  22013. curr = next;
  22014. }
  22015. // By the invariants, start <= length-1, so there is something left over.
  22016. // It is either the whole string or a part starting from non-whitespace.
  22017. result += '\n';
  22018. // Insert a break if the remainder is too long and there is a break available.
  22019. if (line.length - start > width && curr > start) {
  22020. result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
  22021. } else {
  22022. result += line.slice(start);
  22023. }
  22024. return result.slice(1); // drop extra \n joiner
  22025. }
  22026. // Escapes a double-quoted string.
  22027. function escapeString(string) {
  22028. var result = '';
  22029. var char, nextChar;
  22030. var escapeSeq;
  22031. for (var i = 0; i < string.length; i++) {
  22032. char = string.charCodeAt(i);
  22033. // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
  22034. if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
  22035. nextChar = string.charCodeAt(i + 1);
  22036. if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
  22037. // Combine the surrogate pair and store it escaped.
  22038. result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
  22039. // Advance index one extra since we already used that char here.
  22040. i++; continue;
  22041. }
  22042. }
  22043. escapeSeq = ESCAPE_SEQUENCES[char];
  22044. result += !escapeSeq && isPrintable(char)
  22045. ? string[i]
  22046. : escapeSeq || encodeHex(char);
  22047. }
  22048. return result;
  22049. }
  22050. function writeFlowSequence(state, level, object) {
  22051. var _result = '',
  22052. _tag = state.tag,
  22053. index,
  22054. length;
  22055. for (index = 0, length = object.length; index < length; index += 1) {
  22056. // Write only valid elements.
  22057. if (writeNode(state, level, object[index], false, false)) {
  22058. if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
  22059. _result += state.dump;
  22060. }
  22061. }
  22062. state.tag = _tag;
  22063. state.dump = '[' + _result + ']';
  22064. }
  22065. function writeBlockSequence(state, level, object, compact) {
  22066. var _result = '',
  22067. _tag = state.tag,
  22068. index,
  22069. length;
  22070. for (index = 0, length = object.length; index < length; index += 1) {
  22071. // Write only valid elements.
  22072. if (writeNode(state, level + 1, object[index], true, true)) {
  22073. if (!compact || index !== 0) {
  22074. _result += generateNextLine(state, level);
  22075. }
  22076. if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
  22077. _result += '-';
  22078. } else {
  22079. _result += '- ';
  22080. }
  22081. _result += state.dump;
  22082. }
  22083. }
  22084. state.tag = _tag;
  22085. state.dump = _result || '[]'; // Empty sequence if no valid values.
  22086. }
  22087. function writeFlowMapping(state, level, object) {
  22088. var _result = '',
  22089. _tag = state.tag,
  22090. objectKeyList = Object.keys(object),
  22091. index,
  22092. length,
  22093. objectKey,
  22094. objectValue,
  22095. pairBuffer;
  22096. for (index = 0, length = objectKeyList.length; index < length; index += 1) {
  22097. pairBuffer = state.condenseFlow ? '"' : '';
  22098. if (index !== 0) pairBuffer += ', ';
  22099. objectKey = objectKeyList[index];
  22100. objectValue = object[objectKey];
  22101. if (!writeNode(state, level, objectKey, false, false)) {
  22102. continue; // Skip this pair because of invalid key;
  22103. }
  22104. if (state.dump.length > 1024) pairBuffer += '? ';
  22105. pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
  22106. if (!writeNode(state, level, objectValue, false, false)) {
  22107. continue; // Skip this pair because of invalid value.
  22108. }
  22109. pairBuffer += state.dump;
  22110. // Both key and value are valid.
  22111. _result += pairBuffer;
  22112. }
  22113. state.tag = _tag;
  22114. state.dump = '{' + _result + '}';
  22115. }
  22116. function writeBlockMapping(state, level, object, compact) {
  22117. var _result = '',
  22118. _tag = state.tag,
  22119. objectKeyList = Object.keys(object),
  22120. index,
  22121. length,
  22122. objectKey,
  22123. objectValue,
  22124. explicitPair,
  22125. pairBuffer;
  22126. // Allow sorting keys so that the output file is deterministic
  22127. if (state.sortKeys === true) {
  22128. // Default sorting
  22129. objectKeyList.sort();
  22130. } else if (typeof state.sortKeys === 'function') {
  22131. // Custom sort function
  22132. objectKeyList.sort(state.sortKeys);
  22133. } else if (state.sortKeys) {
  22134. // Something is wrong
  22135. throw new YAMLException('sortKeys must be a boolean or a function');
  22136. }
  22137. for (index = 0, length = objectKeyList.length; index < length; index += 1) {
  22138. pairBuffer = '';
  22139. if (!compact || index !== 0) {
  22140. pairBuffer += generateNextLine(state, level);
  22141. }
  22142. objectKey = objectKeyList[index];
  22143. objectValue = object[objectKey];
  22144. if (!writeNode(state, level + 1, objectKey, true, true, true)) {
  22145. continue; // Skip this pair because of invalid key.
  22146. }
  22147. explicitPair = (state.tag !== null && state.tag !== '?') ||
  22148. (state.dump && state.dump.length > 1024);
  22149. if (explicitPair) {
  22150. if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
  22151. pairBuffer += '?';
  22152. } else {
  22153. pairBuffer += '? ';
  22154. }
  22155. }
  22156. pairBuffer += state.dump;
  22157. if (explicitPair) {
  22158. pairBuffer += generateNextLine(state, level);
  22159. }
  22160. if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
  22161. continue; // Skip this pair because of invalid value.
  22162. }
  22163. if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
  22164. pairBuffer += ':';
  22165. } else {
  22166. pairBuffer += ': ';
  22167. }
  22168. pairBuffer += state.dump;
  22169. // Both key and value are valid.
  22170. _result += pairBuffer;
  22171. }
  22172. state.tag = _tag;
  22173. state.dump = _result || '{}'; // Empty mapping if no valid pairs.
  22174. }
  22175. function detectType(state, object, explicit) {
  22176. var _result, typeList, index, length, type, style;
  22177. typeList = explicit ? state.explicitTypes : state.implicitTypes;
  22178. for (index = 0, length = typeList.length; index < length; index += 1) {
  22179. type = typeList[index];
  22180. if ((type.instanceOf || type.predicate) &&
  22181. (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
  22182. (!type.predicate || type.predicate(object))) {
  22183. state.tag = explicit ? type.tag : '?';
  22184. if (type.represent) {
  22185. style = state.styleMap[type.tag] || type.defaultStyle;
  22186. if (_toString.call(type.represent) === '[object Function]') {
  22187. _result = type.represent(object, style);
  22188. } else if (_hasOwnProperty.call(type.represent, style)) {
  22189. _result = type.represent[style](object, style);
  22190. } else {
  22191. throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
  22192. }
  22193. state.dump = _result;
  22194. }
  22195. return true;
  22196. }
  22197. }
  22198. return false;
  22199. }
  22200. // Serializes `object` and writes it to global `result`.
  22201. // Returns true on success, or false on invalid object.
  22202. //
  22203. function writeNode(state, level, object, block, compact, iskey) {
  22204. state.tag = null;
  22205. state.dump = object;
  22206. if (!detectType(state, object, false)) {
  22207. detectType(state, object, true);
  22208. }
  22209. var type = _toString.call(state.dump);
  22210. if (block) {
  22211. block = (state.flowLevel < 0 || state.flowLevel > level);
  22212. }
  22213. var objectOrArray = type === '[object Object]' || type === '[object Array]',
  22214. duplicateIndex,
  22215. duplicate;
  22216. if (objectOrArray) {
  22217. duplicateIndex = state.duplicates.indexOf(object);
  22218. duplicate = duplicateIndex !== -1;
  22219. }
  22220. if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
  22221. compact = false;
  22222. }
  22223. if (duplicate && state.usedDuplicates[duplicateIndex]) {
  22224. state.dump = '*ref_' + duplicateIndex;
  22225. } else {
  22226. if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
  22227. state.usedDuplicates[duplicateIndex] = true;
  22228. }
  22229. if (type === '[object Object]') {
  22230. if (block && (Object.keys(state.dump).length !== 0)) {
  22231. writeBlockMapping(state, level, state.dump, compact);
  22232. if (duplicate) {
  22233. state.dump = '&ref_' + duplicateIndex + state.dump;
  22234. }
  22235. } else {
  22236. writeFlowMapping(state, level, state.dump);
  22237. if (duplicate) {
  22238. state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
  22239. }
  22240. }
  22241. } else if (type === '[object Array]') {
  22242. if (block && (state.dump.length !== 0)) {
  22243. writeBlockSequence(state, level, state.dump, compact);
  22244. if (duplicate) {
  22245. state.dump = '&ref_' + duplicateIndex + state.dump;
  22246. }
  22247. } else {
  22248. writeFlowSequence(state, level, state.dump);
  22249. if (duplicate) {
  22250. state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
  22251. }
  22252. }
  22253. } else if (type === '[object String]') {
  22254. if (state.tag !== '?') {
  22255. writeScalar(state, state.dump, level, iskey);
  22256. }
  22257. } else {
  22258. if (state.skipInvalid) return false;
  22259. throw new YAMLException('unacceptable kind of an object to dump ' + type);
  22260. }
  22261. if (state.tag !== null && state.tag !== '?') {
  22262. state.dump = '!<' + state.tag + '> ' + state.dump;
  22263. }
  22264. }
  22265. return true;
  22266. }
  22267. function getDuplicateReferences(object, state) {
  22268. var objects = [],
  22269. duplicatesIndexes = [],
  22270. index,
  22271. length;
  22272. inspectNode(object, objects, duplicatesIndexes);
  22273. for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
  22274. state.duplicates.push(objects[duplicatesIndexes[index]]);
  22275. }
  22276. state.usedDuplicates = new Array(length);
  22277. }
  22278. function inspectNode(object, objects, duplicatesIndexes) {
  22279. var objectKeyList,
  22280. index,
  22281. length;
  22282. if (object !== null && typeof object === 'object') {
  22283. index = objects.indexOf(object);
  22284. if (index !== -1) {
  22285. if (duplicatesIndexes.indexOf(index) === -1) {
  22286. duplicatesIndexes.push(index);
  22287. }
  22288. } else {
  22289. objects.push(object);
  22290. if (Array.isArray(object)) {
  22291. for (index = 0, length = object.length; index < length; index += 1) {
  22292. inspectNode(object[index], objects, duplicatesIndexes);
  22293. }
  22294. } else {
  22295. objectKeyList = Object.keys(object);
  22296. for (index = 0, length = objectKeyList.length; index < length; index += 1) {
  22297. inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
  22298. }
  22299. }
  22300. }
  22301. }
  22302. }
  22303. function dump(input, options) {
  22304. options = options || {};
  22305. var state = new State(options);
  22306. if (!state.noRefs) getDuplicateReferences(input, state);
  22307. if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
  22308. return '';
  22309. }
  22310. function safeDump(input, options) {
  22311. return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  22312. }
  22313. module.exports.dump = dump;
  22314. module.exports.safeDump = safeDump;
  22315. /***/ }),
  22316. /* 125 */
  22317. /***/ (function(module, exports, __webpack_require__) {
  22318. "use strict";
  22319. /*eslint-disable max-len,no-use-before-define*/
  22320. var common = __webpack_require__(6);
  22321. var YAMLException = __webpack_require__(11);
  22322. var Mark = __webpack_require__(126);
  22323. var DEFAULT_SAFE_SCHEMA = __webpack_require__(12);
  22324. var DEFAULT_FULL_SCHEMA = __webpack_require__(20);
  22325. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  22326. var CONTEXT_FLOW_IN = 1;
  22327. var CONTEXT_FLOW_OUT = 2;
  22328. var CONTEXT_BLOCK_IN = 3;
  22329. var CONTEXT_BLOCK_OUT = 4;
  22330. var CHOMPING_CLIP = 1;
  22331. var CHOMPING_STRIP = 2;
  22332. var CHOMPING_KEEP = 3;
  22333. var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  22334. var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
  22335. var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
  22336. var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
  22337. var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
  22338. function is_EOL(c) {
  22339. return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
  22340. }
  22341. function is_WHITE_SPACE(c) {
  22342. return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
  22343. }
  22344. function is_WS_OR_EOL(c) {
  22345. return (c === 0x09/* Tab */) ||
  22346. (c === 0x20/* Space */) ||
  22347. (c === 0x0A/* LF */) ||
  22348. (c === 0x0D/* CR */);
  22349. }
  22350. function is_FLOW_INDICATOR(c) {
  22351. return c === 0x2C/* , */ ||
  22352. c === 0x5B/* [ */ ||
  22353. c === 0x5D/* ] */ ||
  22354. c === 0x7B/* { */ ||
  22355. c === 0x7D/* } */;
  22356. }
  22357. function fromHexCode(c) {
  22358. var lc;
  22359. if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
  22360. return c - 0x30;
  22361. }
  22362. /*eslint-disable no-bitwise*/
  22363. lc = c | 0x20;
  22364. if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
  22365. return lc - 0x61 + 10;
  22366. }
  22367. return -1;
  22368. }
  22369. function escapedHexLen(c) {
  22370. if (c === 0x78/* x */) { return 2; }
  22371. if (c === 0x75/* u */) { return 4; }
  22372. if (c === 0x55/* U */) { return 8; }
  22373. return 0;
  22374. }
  22375. function fromDecimalCode(c) {
  22376. if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
  22377. return c - 0x30;
  22378. }
  22379. return -1;
  22380. }
  22381. function simpleEscapeSequence(c) {
  22382. /* eslint-disable indent */
  22383. return (c === 0x30/* 0 */) ? '\x00' :
  22384. (c === 0x61/* a */) ? '\x07' :
  22385. (c === 0x62/* b */) ? '\x08' :
  22386. (c === 0x74/* t */) ? '\x09' :
  22387. (c === 0x09/* Tab */) ? '\x09' :
  22388. (c === 0x6E/* n */) ? '\x0A' :
  22389. (c === 0x76/* v */) ? '\x0B' :
  22390. (c === 0x66/* f */) ? '\x0C' :
  22391. (c === 0x72/* r */) ? '\x0D' :
  22392. (c === 0x65/* e */) ? '\x1B' :
  22393. (c === 0x20/* Space */) ? ' ' :
  22394. (c === 0x22/* " */) ? '\x22' :
  22395. (c === 0x2F/* / */) ? '/' :
  22396. (c === 0x5C/* \ */) ? '\x5C' :
  22397. (c === 0x4E/* N */) ? '\x85' :
  22398. (c === 0x5F/* _ */) ? '\xA0' :
  22399. (c === 0x4C/* L */) ? '\u2028' :
  22400. (c === 0x50/* P */) ? '\u2029' : '';
  22401. }
  22402. function charFromCodepoint(c) {
  22403. if (c <= 0xFFFF) {
  22404. return String.fromCharCode(c);
  22405. }
  22406. // Encode UTF-16 surrogate pair
  22407. // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
  22408. return String.fromCharCode(
  22409. ((c - 0x010000) >> 10) + 0xD800,
  22410. ((c - 0x010000) & 0x03FF) + 0xDC00
  22411. );
  22412. }
  22413. var simpleEscapeCheck = new Array(256); // integer, for fast access
  22414. var simpleEscapeMap = new Array(256);
  22415. for (var i = 0; i < 256; i++) {
  22416. simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
  22417. simpleEscapeMap[i] = simpleEscapeSequence(i);
  22418. }
  22419. function State(input, options) {
  22420. this.input = input;
  22421. this.filename = options['filename'] || null;
  22422. this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
  22423. this.onWarning = options['onWarning'] || null;
  22424. this.legacy = options['legacy'] || false;
  22425. this.json = options['json'] || false;
  22426. this.listener = options['listener'] || null;
  22427. this.implicitTypes = this.schema.compiledImplicit;
  22428. this.typeMap = this.schema.compiledTypeMap;
  22429. this.length = input.length;
  22430. this.position = 0;
  22431. this.line = 0;
  22432. this.lineStart = 0;
  22433. this.lineIndent = 0;
  22434. this.documents = [];
  22435. /*
  22436. this.version;
  22437. this.checkLineBreaks;
  22438. this.tagMap;
  22439. this.anchorMap;
  22440. this.tag;
  22441. this.anchor;
  22442. this.kind;
  22443. this.result;*/
  22444. }
  22445. function generateError(state, message) {
  22446. return new YAMLException(
  22447. message,
  22448. new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
  22449. }
  22450. function throwError(state, message) {
  22451. throw generateError(state, message);
  22452. }
  22453. function throwWarning(state, message) {
  22454. if (state.onWarning) {
  22455. state.onWarning.call(null, generateError(state, message));
  22456. }
  22457. }
  22458. var directiveHandlers = {
  22459. YAML: function handleYamlDirective(state, name, args) {
  22460. var match, major, minor;
  22461. if (state.version !== null) {
  22462. throwError(state, 'duplication of %YAML directive');
  22463. }
  22464. if (args.length !== 1) {
  22465. throwError(state, 'YAML directive accepts exactly one argument');
  22466. }
  22467. match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
  22468. if (match === null) {
  22469. throwError(state, 'ill-formed argument of the YAML directive');
  22470. }
  22471. major = parseInt(match[1], 10);
  22472. minor = parseInt(match[2], 10);
  22473. if (major !== 1) {
  22474. throwError(state, 'unacceptable YAML version of the document');
  22475. }
  22476. state.version = args[0];
  22477. state.checkLineBreaks = (minor < 2);
  22478. if (minor !== 1 && minor !== 2) {
  22479. throwWarning(state, 'unsupported YAML version of the document');
  22480. }
  22481. },
  22482. TAG: function handleTagDirective(state, name, args) {
  22483. var handle, prefix;
  22484. if (args.length !== 2) {
  22485. throwError(state, 'TAG directive accepts exactly two arguments');
  22486. }
  22487. handle = args[0];
  22488. prefix = args[1];
  22489. if (!PATTERN_TAG_HANDLE.test(handle)) {
  22490. throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
  22491. }
  22492. if (_hasOwnProperty.call(state.tagMap, handle)) {
  22493. throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
  22494. }
  22495. if (!PATTERN_TAG_URI.test(prefix)) {
  22496. throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
  22497. }
  22498. state.tagMap[handle] = prefix;
  22499. }
  22500. };
  22501. function captureSegment(state, start, end, checkJson) {
  22502. var _position, _length, _character, _result;
  22503. if (start < end) {
  22504. _result = state.input.slice(start, end);
  22505. if (checkJson) {
  22506. for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
  22507. _character = _result.charCodeAt(_position);
  22508. if (!(_character === 0x09 ||
  22509. (0x20 <= _character && _character <= 0x10FFFF))) {
  22510. throwError(state, 'expected valid JSON character');
  22511. }
  22512. }
  22513. } else if (PATTERN_NON_PRINTABLE.test(_result)) {
  22514. throwError(state, 'the stream contains non-printable characters');
  22515. }
  22516. state.result += _result;
  22517. }
  22518. }
  22519. function mergeMappings(state, destination, source, overridableKeys) {
  22520. var sourceKeys, key, index, quantity;
  22521. if (!common.isObject(source)) {
  22522. throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
  22523. }
  22524. sourceKeys = Object.keys(source);
  22525. for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
  22526. key = sourceKeys[index];
  22527. if (!_hasOwnProperty.call(destination, key)) {
  22528. destination[key] = source[key];
  22529. overridableKeys[key] = true;
  22530. }
  22531. }
  22532. }
  22533. function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
  22534. var index, quantity;
  22535. keyNode = String(keyNode);
  22536. if (_result === null) {
  22537. _result = {};
  22538. }
  22539. if (keyTag === 'tag:yaml.org,2002:merge') {
  22540. if (Array.isArray(valueNode)) {
  22541. for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
  22542. mergeMappings(state, _result, valueNode[index], overridableKeys);
  22543. }
  22544. } else {
  22545. mergeMappings(state, _result, valueNode, overridableKeys);
  22546. }
  22547. } else {
  22548. if (!state.json &&
  22549. !_hasOwnProperty.call(overridableKeys, keyNode) &&
  22550. _hasOwnProperty.call(_result, keyNode)) {
  22551. state.line = startLine || state.line;
  22552. state.position = startPos || state.position;
  22553. throwError(state, 'duplicated mapping key');
  22554. }
  22555. _result[keyNode] = valueNode;
  22556. delete overridableKeys[keyNode];
  22557. }
  22558. return _result;
  22559. }
  22560. function readLineBreak(state) {
  22561. var ch;
  22562. ch = state.input.charCodeAt(state.position);
  22563. if (ch === 0x0A/* LF */) {
  22564. state.position++;
  22565. } else if (ch === 0x0D/* CR */) {
  22566. state.position++;
  22567. if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
  22568. state.position++;
  22569. }
  22570. } else {
  22571. throwError(state, 'a line break is expected');
  22572. }
  22573. state.line += 1;
  22574. state.lineStart = state.position;
  22575. }
  22576. function skipSeparationSpace(state, allowComments, checkIndent) {
  22577. var lineBreaks = 0,
  22578. ch = state.input.charCodeAt(state.position);
  22579. while (ch !== 0) {
  22580. while (is_WHITE_SPACE(ch)) {
  22581. ch = state.input.charCodeAt(++state.position);
  22582. }
  22583. if (allowComments && ch === 0x23/* # */) {
  22584. do {
  22585. ch = state.input.charCodeAt(++state.position);
  22586. } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
  22587. }
  22588. if (is_EOL(ch)) {
  22589. readLineBreak(state);
  22590. ch = state.input.charCodeAt(state.position);
  22591. lineBreaks++;
  22592. state.lineIndent = 0;
  22593. while (ch === 0x20/* Space */) {
  22594. state.lineIndent++;
  22595. ch = state.input.charCodeAt(++state.position);
  22596. }
  22597. } else {
  22598. break;
  22599. }
  22600. }
  22601. if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
  22602. throwWarning(state, 'deficient indentation');
  22603. }
  22604. return lineBreaks;
  22605. }
  22606. function testDocumentSeparator(state) {
  22607. var _position = state.position,
  22608. ch;
  22609. ch = state.input.charCodeAt(_position);
  22610. // Condition state.position === state.lineStart is tested
  22611. // in parent on each call, for efficiency. No needs to test here again.
  22612. if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
  22613. ch === state.input.charCodeAt(_position + 1) &&
  22614. ch === state.input.charCodeAt(_position + 2)) {
  22615. _position += 3;
  22616. ch = state.input.charCodeAt(_position);
  22617. if (ch === 0 || is_WS_OR_EOL(ch)) {
  22618. return true;
  22619. }
  22620. }
  22621. return false;
  22622. }
  22623. function writeFoldedLines(state, count) {
  22624. if (count === 1) {
  22625. state.result += ' ';
  22626. } else if (count > 1) {
  22627. state.result += common.repeat('\n', count - 1);
  22628. }
  22629. }
  22630. function readPlainScalar(state, nodeIndent, withinFlowCollection) {
  22631. var preceding,
  22632. following,
  22633. captureStart,
  22634. captureEnd,
  22635. hasPendingContent,
  22636. _line,
  22637. _lineStart,
  22638. _lineIndent,
  22639. _kind = state.kind,
  22640. _result = state.result,
  22641. ch;
  22642. ch = state.input.charCodeAt(state.position);
  22643. if (is_WS_OR_EOL(ch) ||
  22644. is_FLOW_INDICATOR(ch) ||
  22645. ch === 0x23/* # */ ||
  22646. ch === 0x26/* & */ ||
  22647. ch === 0x2A/* * */ ||
  22648. ch === 0x21/* ! */ ||
  22649. ch === 0x7C/* | */ ||
  22650. ch === 0x3E/* > */ ||
  22651. ch === 0x27/* ' */ ||
  22652. ch === 0x22/* " */ ||
  22653. ch === 0x25/* % */ ||
  22654. ch === 0x40/* @ */ ||
  22655. ch === 0x60/* ` */) {
  22656. return false;
  22657. }
  22658. if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
  22659. following = state.input.charCodeAt(state.position + 1);
  22660. if (is_WS_OR_EOL(following) ||
  22661. withinFlowCollection && is_FLOW_INDICATOR(following)) {
  22662. return false;
  22663. }
  22664. }
  22665. state.kind = 'scalar';
  22666. state.result = '';
  22667. captureStart = captureEnd = state.position;
  22668. hasPendingContent = false;
  22669. while (ch !== 0) {
  22670. if (ch === 0x3A/* : */) {
  22671. following = state.input.charCodeAt(state.position + 1);
  22672. if (is_WS_OR_EOL(following) ||
  22673. withinFlowCollection && is_FLOW_INDICATOR(following)) {
  22674. break;
  22675. }
  22676. } else if (ch === 0x23/* # */) {
  22677. preceding = state.input.charCodeAt(state.position - 1);
  22678. if (is_WS_OR_EOL(preceding)) {
  22679. break;
  22680. }
  22681. } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
  22682. withinFlowCollection && is_FLOW_INDICATOR(ch)) {
  22683. break;
  22684. } else if (is_EOL(ch)) {
  22685. _line = state.line;
  22686. _lineStart = state.lineStart;
  22687. _lineIndent = state.lineIndent;
  22688. skipSeparationSpace(state, false, -1);
  22689. if (state.lineIndent >= nodeIndent) {
  22690. hasPendingContent = true;
  22691. ch = state.input.charCodeAt(state.position);
  22692. continue;
  22693. } else {
  22694. state.position = captureEnd;
  22695. state.line = _line;
  22696. state.lineStart = _lineStart;
  22697. state.lineIndent = _lineIndent;
  22698. break;
  22699. }
  22700. }
  22701. if (hasPendingContent) {
  22702. captureSegment(state, captureStart, captureEnd, false);
  22703. writeFoldedLines(state, state.line - _line);
  22704. captureStart = captureEnd = state.position;
  22705. hasPendingContent = false;
  22706. }
  22707. if (!is_WHITE_SPACE(ch)) {
  22708. captureEnd = state.position + 1;
  22709. }
  22710. ch = state.input.charCodeAt(++state.position);
  22711. }
  22712. captureSegment(state, captureStart, captureEnd, false);
  22713. if (state.result) {
  22714. return true;
  22715. }
  22716. state.kind = _kind;
  22717. state.result = _result;
  22718. return false;
  22719. }
  22720. function readSingleQuotedScalar(state, nodeIndent) {
  22721. var ch,
  22722. captureStart, captureEnd;
  22723. ch = state.input.charCodeAt(state.position);
  22724. if (ch !== 0x27/* ' */) {
  22725. return false;
  22726. }
  22727. state.kind = 'scalar';
  22728. state.result = '';
  22729. state.position++;
  22730. captureStart = captureEnd = state.position;
  22731. while ((ch = state.input.charCodeAt(state.position)) !== 0) {
  22732. if (ch === 0x27/* ' */) {
  22733. captureSegment(state, captureStart, state.position, true);
  22734. ch = state.input.charCodeAt(++state.position);
  22735. if (ch === 0x27/* ' */) {
  22736. captureStart = state.position;
  22737. state.position++;
  22738. captureEnd = state.position;
  22739. } else {
  22740. return true;
  22741. }
  22742. } else if (is_EOL(ch)) {
  22743. captureSegment(state, captureStart, captureEnd, true);
  22744. writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
  22745. captureStart = captureEnd = state.position;
  22746. } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
  22747. throwError(state, 'unexpected end of the document within a single quoted scalar');
  22748. } else {
  22749. state.position++;
  22750. captureEnd = state.position;
  22751. }
  22752. }
  22753. throwError(state, 'unexpected end of the stream within a single quoted scalar');
  22754. }
  22755. function readDoubleQuotedScalar(state, nodeIndent) {
  22756. var captureStart,
  22757. captureEnd,
  22758. hexLength,
  22759. hexResult,
  22760. tmp,
  22761. ch;
  22762. ch = state.input.charCodeAt(state.position);
  22763. if (ch !== 0x22/* " */) {
  22764. return false;
  22765. }
  22766. state.kind = 'scalar';
  22767. state.result = '';
  22768. state.position++;
  22769. captureStart = captureEnd = state.position;
  22770. while ((ch = state.input.charCodeAt(state.position)) !== 0) {
  22771. if (ch === 0x22/* " */) {
  22772. captureSegment(state, captureStart, state.position, true);
  22773. state.position++;
  22774. return true;
  22775. } else if (ch === 0x5C/* \ */) {
  22776. captureSegment(state, captureStart, state.position, true);
  22777. ch = state.input.charCodeAt(++state.position);
  22778. if (is_EOL(ch)) {
  22779. skipSeparationSpace(state, false, nodeIndent);
  22780. // TODO: rework to inline fn with no type cast?
  22781. } else if (ch < 256 && simpleEscapeCheck[ch]) {
  22782. state.result += simpleEscapeMap[ch];
  22783. state.position++;
  22784. } else if ((tmp = escapedHexLen(ch)) > 0) {
  22785. hexLength = tmp;
  22786. hexResult = 0;
  22787. for (; hexLength > 0; hexLength--) {
  22788. ch = state.input.charCodeAt(++state.position);
  22789. if ((tmp = fromHexCode(ch)) >= 0) {
  22790. hexResult = (hexResult << 4) + tmp;
  22791. } else {
  22792. throwError(state, 'expected hexadecimal character');
  22793. }
  22794. }
  22795. state.result += charFromCodepoint(hexResult);
  22796. state.position++;
  22797. } else {
  22798. throwError(state, 'unknown escape sequence');
  22799. }
  22800. captureStart = captureEnd = state.position;
  22801. } else if (is_EOL(ch)) {
  22802. captureSegment(state, captureStart, captureEnd, true);
  22803. writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
  22804. captureStart = captureEnd = state.position;
  22805. } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
  22806. throwError(state, 'unexpected end of the document within a double quoted scalar');
  22807. } else {
  22808. state.position++;
  22809. captureEnd = state.position;
  22810. }
  22811. }
  22812. throwError(state, 'unexpected end of the stream within a double quoted scalar');
  22813. }
  22814. function readFlowCollection(state, nodeIndent) {
  22815. var readNext = true,
  22816. _line,
  22817. _tag = state.tag,
  22818. _result,
  22819. _anchor = state.anchor,
  22820. following,
  22821. terminator,
  22822. isPair,
  22823. isExplicitPair,
  22824. isMapping,
  22825. overridableKeys = {},
  22826. keyNode,
  22827. keyTag,
  22828. valueNode,
  22829. ch;
  22830. ch = state.input.charCodeAt(state.position);
  22831. if (ch === 0x5B/* [ */) {
  22832. terminator = 0x5D;/* ] */
  22833. isMapping = false;
  22834. _result = [];
  22835. } else if (ch === 0x7B/* { */) {
  22836. terminator = 0x7D;/* } */
  22837. isMapping = true;
  22838. _result = {};
  22839. } else {
  22840. return false;
  22841. }
  22842. if (state.anchor !== null) {
  22843. state.anchorMap[state.anchor] = _result;
  22844. }
  22845. ch = state.input.charCodeAt(++state.position);
  22846. while (ch !== 0) {
  22847. skipSeparationSpace(state, true, nodeIndent);
  22848. ch = state.input.charCodeAt(state.position);
  22849. if (ch === terminator) {
  22850. state.position++;
  22851. state.tag = _tag;
  22852. state.anchor = _anchor;
  22853. state.kind = isMapping ? 'mapping' : 'sequence';
  22854. state.result = _result;
  22855. return true;
  22856. } else if (!readNext) {
  22857. throwError(state, 'missed comma between flow collection entries');
  22858. }
  22859. keyTag = keyNode = valueNode = null;
  22860. isPair = isExplicitPair = false;
  22861. if (ch === 0x3F/* ? */) {
  22862. following = state.input.charCodeAt(state.position + 1);
  22863. if (is_WS_OR_EOL(following)) {
  22864. isPair = isExplicitPair = true;
  22865. state.position++;
  22866. skipSeparationSpace(state, true, nodeIndent);
  22867. }
  22868. }
  22869. _line = state.line;
  22870. composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
  22871. keyTag = state.tag;
  22872. keyNode = state.result;
  22873. skipSeparationSpace(state, true, nodeIndent);
  22874. ch = state.input.charCodeAt(state.position);
  22875. if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
  22876. isPair = true;
  22877. ch = state.input.charCodeAt(++state.position);
  22878. skipSeparationSpace(state, true, nodeIndent);
  22879. composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
  22880. valueNode = state.result;
  22881. }
  22882. if (isMapping) {
  22883. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
  22884. } else if (isPair) {
  22885. _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
  22886. } else {
  22887. _result.push(keyNode);
  22888. }
  22889. skipSeparationSpace(state, true, nodeIndent);
  22890. ch = state.input.charCodeAt(state.position);
  22891. if (ch === 0x2C/* , */) {
  22892. readNext = true;
  22893. ch = state.input.charCodeAt(++state.position);
  22894. } else {
  22895. readNext = false;
  22896. }
  22897. }
  22898. throwError(state, 'unexpected end of the stream within a flow collection');
  22899. }
  22900. function readBlockScalar(state, nodeIndent) {
  22901. var captureStart,
  22902. folding,
  22903. chomping = CHOMPING_CLIP,
  22904. didReadContent = false,
  22905. detectedIndent = false,
  22906. textIndent = nodeIndent,
  22907. emptyLines = 0,
  22908. atMoreIndented = false,
  22909. tmp,
  22910. ch;
  22911. ch = state.input.charCodeAt(state.position);
  22912. if (ch === 0x7C/* | */) {
  22913. folding = false;
  22914. } else if (ch === 0x3E/* > */) {
  22915. folding = true;
  22916. } else {
  22917. return false;
  22918. }
  22919. state.kind = 'scalar';
  22920. state.result = '';
  22921. while (ch !== 0) {
  22922. ch = state.input.charCodeAt(++state.position);
  22923. if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
  22924. if (CHOMPING_CLIP === chomping) {
  22925. chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
  22926. } else {
  22927. throwError(state, 'repeat of a chomping mode identifier');
  22928. }
  22929. } else if ((tmp = fromDecimalCode(ch)) >= 0) {
  22930. if (tmp === 0) {
  22931. throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
  22932. } else if (!detectedIndent) {
  22933. textIndent = nodeIndent + tmp - 1;
  22934. detectedIndent = true;
  22935. } else {
  22936. throwError(state, 'repeat of an indentation width identifier');
  22937. }
  22938. } else {
  22939. break;
  22940. }
  22941. }
  22942. if (is_WHITE_SPACE(ch)) {
  22943. do { ch = state.input.charCodeAt(++state.position); }
  22944. while (is_WHITE_SPACE(ch));
  22945. if (ch === 0x23/* # */) {
  22946. do { ch = state.input.charCodeAt(++state.position); }
  22947. while (!is_EOL(ch) && (ch !== 0));
  22948. }
  22949. }
  22950. while (ch !== 0) {
  22951. readLineBreak(state);
  22952. state.lineIndent = 0;
  22953. ch = state.input.charCodeAt(state.position);
  22954. while ((!detectedIndent || state.lineIndent < textIndent) &&
  22955. (ch === 0x20/* Space */)) {
  22956. state.lineIndent++;
  22957. ch = state.input.charCodeAt(++state.position);
  22958. }
  22959. if (!detectedIndent && state.lineIndent > textIndent) {
  22960. textIndent = state.lineIndent;
  22961. }
  22962. if (is_EOL(ch)) {
  22963. emptyLines++;
  22964. continue;
  22965. }
  22966. // End of the scalar.
  22967. if (state.lineIndent < textIndent) {
  22968. // Perform the chomping.
  22969. if (chomping === CHOMPING_KEEP) {
  22970. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
  22971. } else if (chomping === CHOMPING_CLIP) {
  22972. if (didReadContent) { // i.e. only if the scalar is not empty.
  22973. state.result += '\n';
  22974. }
  22975. }
  22976. // Break this `while` cycle and go to the funciton's epilogue.
  22977. break;
  22978. }
  22979. // Folded style: use fancy rules to handle line breaks.
  22980. if (folding) {
  22981. // Lines starting with white space characters (more-indented lines) are not folded.
  22982. if (is_WHITE_SPACE(ch)) {
  22983. atMoreIndented = true;
  22984. // except for the first content line (cf. Example 8.1)
  22985. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
  22986. // End of more-indented block.
  22987. } else if (atMoreIndented) {
  22988. atMoreIndented = false;
  22989. state.result += common.repeat('\n', emptyLines + 1);
  22990. // Just one line break - perceive as the same line.
  22991. } else if (emptyLines === 0) {
  22992. if (didReadContent) { // i.e. only if we have already read some scalar content.
  22993. state.result += ' ';
  22994. }
  22995. // Several line breaks - perceive as different lines.
  22996. } else {
  22997. state.result += common.repeat('\n', emptyLines);
  22998. }
  22999. // Literal style: just add exact number of line breaks between content lines.
  23000. } else {
  23001. // Keep all line breaks except the header line break.
  23002. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
  23003. }
  23004. didReadContent = true;
  23005. detectedIndent = true;
  23006. emptyLines = 0;
  23007. captureStart = state.position;
  23008. while (!is_EOL(ch) && (ch !== 0)) {
  23009. ch = state.input.charCodeAt(++state.position);
  23010. }
  23011. captureSegment(state, captureStart, state.position, false);
  23012. }
  23013. return true;
  23014. }
  23015. function readBlockSequence(state, nodeIndent) {
  23016. var _line,
  23017. _tag = state.tag,
  23018. _anchor = state.anchor,
  23019. _result = [],
  23020. following,
  23021. detected = false,
  23022. ch;
  23023. if (state.anchor !== null) {
  23024. state.anchorMap[state.anchor] = _result;
  23025. }
  23026. ch = state.input.charCodeAt(state.position);
  23027. while (ch !== 0) {
  23028. if (ch !== 0x2D/* - */) {
  23029. break;
  23030. }
  23031. following = state.input.charCodeAt(state.position + 1);
  23032. if (!is_WS_OR_EOL(following)) {
  23033. break;
  23034. }
  23035. detected = true;
  23036. state.position++;
  23037. if (skipSeparationSpace(state, true, -1)) {
  23038. if (state.lineIndent <= nodeIndent) {
  23039. _result.push(null);
  23040. ch = state.input.charCodeAt(state.position);
  23041. continue;
  23042. }
  23043. }
  23044. _line = state.line;
  23045. composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
  23046. _result.push(state.result);
  23047. skipSeparationSpace(state, true, -1);
  23048. ch = state.input.charCodeAt(state.position);
  23049. if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
  23050. throwError(state, 'bad indentation of a sequence entry');
  23051. } else if (state.lineIndent < nodeIndent) {
  23052. break;
  23053. }
  23054. }
  23055. if (detected) {
  23056. state.tag = _tag;
  23057. state.anchor = _anchor;
  23058. state.kind = 'sequence';
  23059. state.result = _result;
  23060. return true;
  23061. }
  23062. return false;
  23063. }
  23064. function readBlockMapping(state, nodeIndent, flowIndent) {
  23065. var following,
  23066. allowCompact,
  23067. _line,
  23068. _pos,
  23069. _tag = state.tag,
  23070. _anchor = state.anchor,
  23071. _result = {},
  23072. overridableKeys = {},
  23073. keyTag = null,
  23074. keyNode = null,
  23075. valueNode = null,
  23076. atExplicitKey = false,
  23077. detected = false,
  23078. ch;
  23079. if (state.anchor !== null) {
  23080. state.anchorMap[state.anchor] = _result;
  23081. }
  23082. ch = state.input.charCodeAt(state.position);
  23083. while (ch !== 0) {
  23084. following = state.input.charCodeAt(state.position + 1);
  23085. _line = state.line; // Save the current line.
  23086. _pos = state.position;
  23087. //
  23088. // Explicit notation case. There are two separate blocks:
  23089. // first for the key (denoted by "?") and second for the value (denoted by ":")
  23090. //
  23091. if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
  23092. if (ch === 0x3F/* ? */) {
  23093. if (atExplicitKey) {
  23094. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  23095. keyTag = keyNode = valueNode = null;
  23096. }
  23097. detected = true;
  23098. atExplicitKey = true;
  23099. allowCompact = true;
  23100. } else if (atExplicitKey) {
  23101. // i.e. 0x3A/* : */ === character after the explicit key.
  23102. atExplicitKey = false;
  23103. allowCompact = true;
  23104. } else {
  23105. throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
  23106. }
  23107. state.position += 1;
  23108. ch = following;
  23109. //
  23110. // Implicit notation case. Flow-style node as the key first, then ":", and the value.
  23111. //
  23112. } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
  23113. if (state.line === _line) {
  23114. ch = state.input.charCodeAt(state.position);
  23115. while (is_WHITE_SPACE(ch)) {
  23116. ch = state.input.charCodeAt(++state.position);
  23117. }
  23118. if (ch === 0x3A/* : */) {
  23119. ch = state.input.charCodeAt(++state.position);
  23120. if (!is_WS_OR_EOL(ch)) {
  23121. throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
  23122. }
  23123. if (atExplicitKey) {
  23124. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  23125. keyTag = keyNode = valueNode = null;
  23126. }
  23127. detected = true;
  23128. atExplicitKey = false;
  23129. allowCompact = false;
  23130. keyTag = state.tag;
  23131. keyNode = state.result;
  23132. } else if (detected) {
  23133. throwError(state, 'can not read an implicit mapping pair; a colon is missed');
  23134. } else {
  23135. state.tag = _tag;
  23136. state.anchor = _anchor;
  23137. return true; // Keep the result of `composeNode`.
  23138. }
  23139. } else if (detected) {
  23140. throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
  23141. } else {
  23142. state.tag = _tag;
  23143. state.anchor = _anchor;
  23144. return true; // Keep the result of `composeNode`.
  23145. }
  23146. } else {
  23147. break; // Reading is done. Go to the epilogue.
  23148. }
  23149. //
  23150. // Common reading code for both explicit and implicit notations.
  23151. //
  23152. if (state.line === _line || state.lineIndent > nodeIndent) {
  23153. if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
  23154. if (atExplicitKey) {
  23155. keyNode = state.result;
  23156. } else {
  23157. valueNode = state.result;
  23158. }
  23159. }
  23160. if (!atExplicitKey) {
  23161. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
  23162. keyTag = keyNode = valueNode = null;
  23163. }
  23164. skipSeparationSpace(state, true, -1);
  23165. ch = state.input.charCodeAt(state.position);
  23166. }
  23167. if (state.lineIndent > nodeIndent && (ch !== 0)) {
  23168. throwError(state, 'bad indentation of a mapping entry');
  23169. } else if (state.lineIndent < nodeIndent) {
  23170. break;
  23171. }
  23172. }
  23173. //
  23174. // Epilogue.
  23175. //
  23176. // Special case: last mapping's node contains only the key in explicit notation.
  23177. if (atExplicitKey) {
  23178. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  23179. }
  23180. // Expose the resulting mapping.
  23181. if (detected) {
  23182. state.tag = _tag;
  23183. state.anchor = _anchor;
  23184. state.kind = 'mapping';
  23185. state.result = _result;
  23186. }
  23187. return detected;
  23188. }
  23189. function readTagProperty(state) {
  23190. var _position,
  23191. isVerbatim = false,
  23192. isNamed = false,
  23193. tagHandle,
  23194. tagName,
  23195. ch;
  23196. ch = state.input.charCodeAt(state.position);
  23197. if (ch !== 0x21/* ! */) return false;
  23198. if (state.tag !== null) {
  23199. throwError(state, 'duplication of a tag property');
  23200. }
  23201. ch = state.input.charCodeAt(++state.position);
  23202. if (ch === 0x3C/* < */) {
  23203. isVerbatim = true;
  23204. ch = state.input.charCodeAt(++state.position);
  23205. } else if (ch === 0x21/* ! */) {
  23206. isNamed = true;
  23207. tagHandle = '!!';
  23208. ch = state.input.charCodeAt(++state.position);
  23209. } else {
  23210. tagHandle = '!';
  23211. }
  23212. _position = state.position;
  23213. if (isVerbatim) {
  23214. do { ch = state.input.charCodeAt(++state.position); }
  23215. while (ch !== 0 && ch !== 0x3E/* > */);
  23216. if (state.position < state.length) {
  23217. tagName = state.input.slice(_position, state.position);
  23218. ch = state.input.charCodeAt(++state.position);
  23219. } else {
  23220. throwError(state, 'unexpected end of the stream within a verbatim tag');
  23221. }
  23222. } else {
  23223. while (ch !== 0 && !is_WS_OR_EOL(ch)) {
  23224. if (ch === 0x21/* ! */) {
  23225. if (!isNamed) {
  23226. tagHandle = state.input.slice(_position - 1, state.position + 1);
  23227. if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
  23228. throwError(state, 'named tag handle cannot contain such characters');
  23229. }
  23230. isNamed = true;
  23231. _position = state.position + 1;
  23232. } else {
  23233. throwError(state, 'tag suffix cannot contain exclamation marks');
  23234. }
  23235. }
  23236. ch = state.input.charCodeAt(++state.position);
  23237. }
  23238. tagName = state.input.slice(_position, state.position);
  23239. if (PATTERN_FLOW_INDICATORS.test(tagName)) {
  23240. throwError(state, 'tag suffix cannot contain flow indicator characters');
  23241. }
  23242. }
  23243. if (tagName && !PATTERN_TAG_URI.test(tagName)) {
  23244. throwError(state, 'tag name cannot contain such characters: ' + tagName);
  23245. }
  23246. if (isVerbatim) {
  23247. state.tag = tagName;
  23248. } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
  23249. state.tag = state.tagMap[tagHandle] + tagName;
  23250. } else if (tagHandle === '!') {
  23251. state.tag = '!' + tagName;
  23252. } else if (tagHandle === '!!') {
  23253. state.tag = 'tag:yaml.org,2002:' + tagName;
  23254. } else {
  23255. throwError(state, 'undeclared tag handle "' + tagHandle + '"');
  23256. }
  23257. return true;
  23258. }
  23259. function readAnchorProperty(state) {
  23260. var _position,
  23261. ch;
  23262. ch = state.input.charCodeAt(state.position);
  23263. if (ch !== 0x26/* & */) return false;
  23264. if (state.anchor !== null) {
  23265. throwError(state, 'duplication of an anchor property');
  23266. }
  23267. ch = state.input.charCodeAt(++state.position);
  23268. _position = state.position;
  23269. while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
  23270. ch = state.input.charCodeAt(++state.position);
  23271. }
  23272. if (state.position === _position) {
  23273. throwError(state, 'name of an anchor node must contain at least one character');
  23274. }
  23275. state.anchor = state.input.slice(_position, state.position);
  23276. return true;
  23277. }
  23278. function readAlias(state) {
  23279. var _position, alias,
  23280. ch;
  23281. ch = state.input.charCodeAt(state.position);
  23282. if (ch !== 0x2A/* * */) return false;
  23283. ch = state.input.charCodeAt(++state.position);
  23284. _position = state.position;
  23285. while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
  23286. ch = state.input.charCodeAt(++state.position);
  23287. }
  23288. if (state.position === _position) {
  23289. throwError(state, 'name of an alias node must contain at least one character');
  23290. }
  23291. alias = state.input.slice(_position, state.position);
  23292. if (!state.anchorMap.hasOwnProperty(alias)) {
  23293. throwError(state, 'unidentified alias "' + alias + '"');
  23294. }
  23295. state.result = state.anchorMap[alias];
  23296. skipSeparationSpace(state, true, -1);
  23297. return true;
  23298. }
  23299. function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
  23300. var allowBlockStyles,
  23301. allowBlockScalars,
  23302. allowBlockCollections,
  23303. indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
  23304. atNewLine = false,
  23305. hasContent = false,
  23306. typeIndex,
  23307. typeQuantity,
  23308. type,
  23309. flowIndent,
  23310. blockIndent;
  23311. if (state.listener !== null) {
  23312. state.listener('open', state);
  23313. }
  23314. state.tag = null;
  23315. state.anchor = null;
  23316. state.kind = null;
  23317. state.result = null;
  23318. allowBlockStyles = allowBlockScalars = allowBlockCollections =
  23319. CONTEXT_BLOCK_OUT === nodeContext ||
  23320. CONTEXT_BLOCK_IN === nodeContext;
  23321. if (allowToSeek) {
  23322. if (skipSeparationSpace(state, true, -1)) {
  23323. atNewLine = true;
  23324. if (state.lineIndent > parentIndent) {
  23325. indentStatus = 1;
  23326. } else if (state.lineIndent === parentIndent) {
  23327. indentStatus = 0;
  23328. } else if (state.lineIndent < parentIndent) {
  23329. indentStatus = -1;
  23330. }
  23331. }
  23332. }
  23333. if (indentStatus === 1) {
  23334. while (readTagProperty(state) || readAnchorProperty(state)) {
  23335. if (skipSeparationSpace(state, true, -1)) {
  23336. atNewLine = true;
  23337. allowBlockCollections = allowBlockStyles;
  23338. if (state.lineIndent > parentIndent) {
  23339. indentStatus = 1;
  23340. } else if (state.lineIndent === parentIndent) {
  23341. indentStatus = 0;
  23342. } else if (state.lineIndent < parentIndent) {
  23343. indentStatus = -1;
  23344. }
  23345. } else {
  23346. allowBlockCollections = false;
  23347. }
  23348. }
  23349. }
  23350. if (allowBlockCollections) {
  23351. allowBlockCollections = atNewLine || allowCompact;
  23352. }
  23353. if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
  23354. if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
  23355. flowIndent = parentIndent;
  23356. } else {
  23357. flowIndent = parentIndent + 1;
  23358. }
  23359. blockIndent = state.position - state.lineStart;
  23360. if (indentStatus === 1) {
  23361. if (allowBlockCollections &&
  23362. (readBlockSequence(state, blockIndent) ||
  23363. readBlockMapping(state, blockIndent, flowIndent)) ||
  23364. readFlowCollection(state, flowIndent)) {
  23365. hasContent = true;
  23366. } else {
  23367. if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
  23368. readSingleQuotedScalar(state, flowIndent) ||
  23369. readDoubleQuotedScalar(state, flowIndent)) {
  23370. hasContent = true;
  23371. } else if (readAlias(state)) {
  23372. hasContent = true;
  23373. if (state.tag !== null || state.anchor !== null) {
  23374. throwError(state, 'alias node should not have any properties');
  23375. }
  23376. } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
  23377. hasContent = true;
  23378. if (state.tag === null) {
  23379. state.tag = '?';
  23380. }
  23381. }
  23382. if (state.anchor !== null) {
  23383. state.anchorMap[state.anchor] = state.result;
  23384. }
  23385. }
  23386. } else if (indentStatus === 0) {
  23387. // Special case: block sequences are allowed to have same indentation level as the parent.
  23388. // http://www.yaml.org/spec/1.2/spec.html#id2799784
  23389. hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
  23390. }
  23391. }
  23392. if (state.tag !== null && state.tag !== '!') {
  23393. if (state.tag === '?') {
  23394. for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
  23395. type = state.implicitTypes[typeIndex];
  23396. // Implicit resolving is not allowed for non-scalar types, and '?'
  23397. // non-specific tag is only assigned to plain scalars. So, it isn't
  23398. // needed to check for 'kind' conformity.
  23399. if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
  23400. state.result = type.construct(state.result);
  23401. state.tag = type.tag;
  23402. if (state.anchor !== null) {
  23403. state.anchorMap[state.anchor] = state.result;
  23404. }
  23405. break;
  23406. }
  23407. }
  23408. } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
  23409. type = state.typeMap[state.kind || 'fallback'][state.tag];
  23410. if (state.result !== null && type.kind !== state.kind) {
  23411. throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
  23412. }
  23413. if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
  23414. throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
  23415. } else {
  23416. state.result = type.construct(state.result);
  23417. if (state.anchor !== null) {
  23418. state.anchorMap[state.anchor] = state.result;
  23419. }
  23420. }
  23421. } else {
  23422. throwError(state, 'unknown tag !<' + state.tag + '>');
  23423. }
  23424. }
  23425. if (state.listener !== null) {
  23426. state.listener('close', state);
  23427. }
  23428. return state.tag !== null || state.anchor !== null || hasContent;
  23429. }
  23430. function readDocument(state) {
  23431. var documentStart = state.position,
  23432. _position,
  23433. directiveName,
  23434. directiveArgs,
  23435. hasDirectives = false,
  23436. ch;
  23437. state.version = null;
  23438. state.checkLineBreaks = state.legacy;
  23439. state.tagMap = {};
  23440. state.anchorMap = {};
  23441. while ((ch = state.input.charCodeAt(state.position)) !== 0) {
  23442. skipSeparationSpace(state, true, -1);
  23443. ch = state.input.charCodeAt(state.position);
  23444. if (state.lineIndent > 0 || ch !== 0x25/* % */) {
  23445. break;
  23446. }
  23447. hasDirectives = true;
  23448. ch = state.input.charCodeAt(++state.position);
  23449. _position = state.position;
  23450. while (ch !== 0 && !is_WS_OR_EOL(ch)) {
  23451. ch = state.input.charCodeAt(++state.position);
  23452. }
  23453. directiveName = state.input.slice(_position, state.position);
  23454. directiveArgs = [];
  23455. if (directiveName.length < 1) {
  23456. throwError(state, 'directive name must not be less than one character in length');
  23457. }
  23458. while (ch !== 0) {
  23459. while (is_WHITE_SPACE(ch)) {
  23460. ch = state.input.charCodeAt(++state.position);
  23461. }
  23462. if (ch === 0x23/* # */) {
  23463. do { ch = state.input.charCodeAt(++state.position); }
  23464. while (ch !== 0 && !is_EOL(ch));
  23465. break;
  23466. }
  23467. if (is_EOL(ch)) break;
  23468. _position = state.position;
  23469. while (ch !== 0 && !is_WS_OR_EOL(ch)) {
  23470. ch = state.input.charCodeAt(++state.position);
  23471. }
  23472. directiveArgs.push(state.input.slice(_position, state.position));
  23473. }
  23474. if (ch !== 0) readLineBreak(state);
  23475. if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
  23476. directiveHandlers[directiveName](state, directiveName, directiveArgs);
  23477. } else {
  23478. throwWarning(state, 'unknown document directive "' + directiveName + '"');
  23479. }
  23480. }
  23481. skipSeparationSpace(state, true, -1);
  23482. if (state.lineIndent === 0 &&
  23483. state.input.charCodeAt(state.position) === 0x2D/* - */ &&
  23484. state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
  23485. state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
  23486. state.position += 3;
  23487. skipSeparationSpace(state, true, -1);
  23488. } else if (hasDirectives) {
  23489. throwError(state, 'directives end mark is expected');
  23490. }
  23491. composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
  23492. skipSeparationSpace(state, true, -1);
  23493. if (state.checkLineBreaks &&
  23494. PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
  23495. throwWarning(state, 'non-ASCII line breaks are interpreted as content');
  23496. }
  23497. state.documents.push(state.result);
  23498. if (state.position === state.lineStart && testDocumentSeparator(state)) {
  23499. if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
  23500. state.position += 3;
  23501. skipSeparationSpace(state, true, -1);
  23502. }
  23503. return;
  23504. }
  23505. if (state.position < (state.length - 1)) {
  23506. throwError(state, 'end of the stream or a document separator is expected');
  23507. } else {
  23508. return;
  23509. }
  23510. }
  23511. function loadDocuments(input, options) {
  23512. input = String(input);
  23513. options = options || {};
  23514. if (input.length !== 0) {
  23515. // Add tailing `\n` if not exists
  23516. if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
  23517. input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
  23518. input += '\n';
  23519. }
  23520. // Strip BOM
  23521. if (input.charCodeAt(0) === 0xFEFF) {
  23522. input = input.slice(1);
  23523. }
  23524. }
  23525. var state = new State(input, options);
  23526. // Use 0 as string terminator. That significantly simplifies bounds check.
  23527. state.input += '\0';
  23528. while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
  23529. state.lineIndent += 1;
  23530. state.position += 1;
  23531. }
  23532. while (state.position < (state.length - 1)) {
  23533. readDocument(state);
  23534. }
  23535. return state.documents;
  23536. }
  23537. function loadAll(input, iterator, options) {
  23538. var documents = loadDocuments(input, options), index, length;
  23539. if (typeof iterator !== 'function') {
  23540. return documents;
  23541. }
  23542. for (index = 0, length = documents.length; index < length; index += 1) {
  23543. iterator(documents[index]);
  23544. }
  23545. }
  23546. function load(input, options) {
  23547. var documents = loadDocuments(input, options);
  23548. if (documents.length === 0) {
  23549. /*eslint-disable no-undefined*/
  23550. return undefined;
  23551. } else if (documents.length === 1) {
  23552. return documents[0];
  23553. }
  23554. throw new YAMLException('expected a single document in the stream, but found more');
  23555. }
  23556. function safeLoadAll(input, output, options) {
  23557. if (typeof output === 'function') {
  23558. loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  23559. } else {
  23560. return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  23561. }
  23562. }
  23563. function safeLoad(input, options) {
  23564. return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  23565. }
  23566. module.exports.loadAll = loadAll;
  23567. module.exports.load = load;
  23568. module.exports.safeLoadAll = safeLoadAll;
  23569. module.exports.safeLoad = safeLoad;
  23570. /***/ }),
  23571. /* 126 */
  23572. /***/ (function(module, exports, __webpack_require__) {
  23573. "use strict";
  23574. var common = __webpack_require__(6);
  23575. function Mark(name, buffer, position, line, column) {
  23576. this.name = name;
  23577. this.buffer = buffer;
  23578. this.position = position;
  23579. this.line = line;
  23580. this.column = column;
  23581. }
  23582. Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
  23583. var head, start, tail, end, snippet;
  23584. if (!this.buffer) return null;
  23585. indent = indent || 4;
  23586. maxLength = maxLength || 75;
  23587. head = '';
  23588. start = this.position;
  23589. while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
  23590. start -= 1;
  23591. if (this.position - start > (maxLength / 2 - 1)) {
  23592. head = ' ... ';
  23593. start += 5;
  23594. break;
  23595. }
  23596. }
  23597. tail = '';
  23598. end = this.position;
  23599. while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
  23600. end += 1;
  23601. if (end - this.position > (maxLength / 2 - 1)) {
  23602. tail = ' ... ';
  23603. end -= 5;
  23604. break;
  23605. }
  23606. }
  23607. snippet = this.buffer.slice(start, end);
  23608. return common.repeat(' ', indent) + head + snippet + tail + '\n' +
  23609. common.repeat(' ', indent + this.position - start + head.length) + '^';
  23610. };
  23611. Mark.prototype.toString = function toString(compact) {
  23612. var snippet, where = '';
  23613. if (this.name) {
  23614. where += 'in "' + this.name + '" ';
  23615. }
  23616. where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
  23617. if (!compact) {
  23618. snippet = this.getSnippet();
  23619. if (snippet) {
  23620. where += ':\n' + snippet;
  23621. }
  23622. }
  23623. return where;
  23624. };
  23625. module.exports = Mark;
  23626. /***/ }),
  23627. /* 127 */
  23628. /***/ (function(module, exports, __webpack_require__) {
  23629. "use strict";
  23630. var require;
  23631. /*eslint-disable no-bitwise*/
  23632. var NodeBuffer;
  23633. try {
  23634. // A trick for browserified version, to not include `Buffer` shim
  23635. var _require = require;
  23636. NodeBuffer = __webpack_require__(10).Buffer;
  23637. } catch (__) {}
  23638. var Type = __webpack_require__(0);
  23639. // [ 64, 65, 66 ] -> [ padding, CR, LF ]
  23640. var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
  23641. function resolveYamlBinary(data) {
  23642. if (data === null) return false;
  23643. var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
  23644. // Convert one by one.
  23645. for (idx = 0; idx < max; idx++) {
  23646. code = map.indexOf(data.charAt(idx));
  23647. // Skip CR/LF
  23648. if (code > 64) continue;
  23649. // Fail on illegal characters
  23650. if (code < 0) return false;
  23651. bitlen += 6;
  23652. }
  23653. // If there are any bits left, source was corrupted
  23654. return (bitlen % 8) === 0;
  23655. }
  23656. function constructYamlBinary(data) {
  23657. var idx, tailbits,
  23658. input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
  23659. max = input.length,
  23660. map = BASE64_MAP,
  23661. bits = 0,
  23662. result = [];
  23663. // Collect by 6*4 bits (3 bytes)
  23664. for (idx = 0; idx < max; idx++) {
  23665. if ((idx % 4 === 0) && idx) {
  23666. result.push((bits >> 16) & 0xFF);
  23667. result.push((bits >> 8) & 0xFF);
  23668. result.push(bits & 0xFF);
  23669. }
  23670. bits = (bits << 6) | map.indexOf(input.charAt(idx));
  23671. }
  23672. // Dump tail
  23673. tailbits = (max % 4) * 6;
  23674. if (tailbits === 0) {
  23675. result.push((bits >> 16) & 0xFF);
  23676. result.push((bits >> 8) & 0xFF);
  23677. result.push(bits & 0xFF);
  23678. } else if (tailbits === 18) {
  23679. result.push((bits >> 10) & 0xFF);
  23680. result.push((bits >> 2) & 0xFF);
  23681. } else if (tailbits === 12) {
  23682. result.push((bits >> 4) & 0xFF);
  23683. }
  23684. // Wrap into Buffer for NodeJS and leave Array for browser
  23685. if (NodeBuffer) {
  23686. // Support node 6.+ Buffer API when available
  23687. return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
  23688. }
  23689. return result;
  23690. }
  23691. function representYamlBinary(object /*, style*/) {
  23692. var result = '', bits = 0, idx, tail,
  23693. max = object.length,
  23694. map = BASE64_MAP;
  23695. // Convert every three bytes to 4 ASCII characters.
  23696. for (idx = 0; idx < max; idx++) {
  23697. if ((idx % 3 === 0) && idx) {
  23698. result += map[(bits >> 18) & 0x3F];
  23699. result += map[(bits >> 12) & 0x3F];
  23700. result += map[(bits >> 6) & 0x3F];
  23701. result += map[bits & 0x3F];
  23702. }
  23703. bits = (bits << 8) + object[idx];
  23704. }
  23705. // Dump tail
  23706. tail = max % 3;
  23707. if (tail === 0) {
  23708. result += map[(bits >> 18) & 0x3F];
  23709. result += map[(bits >> 12) & 0x3F];
  23710. result += map[(bits >> 6) & 0x3F];
  23711. result += map[bits & 0x3F];
  23712. } else if (tail === 2) {
  23713. result += map[(bits >> 10) & 0x3F];
  23714. result += map[(bits >> 4) & 0x3F];
  23715. result += map[(bits << 2) & 0x3F];
  23716. result += map[64];
  23717. } else if (tail === 1) {
  23718. result += map[(bits >> 2) & 0x3F];
  23719. result += map[(bits << 4) & 0x3F];
  23720. result += map[64];
  23721. result += map[64];
  23722. }
  23723. return result;
  23724. }
  23725. function isBinary(object) {
  23726. return NodeBuffer && NodeBuffer.isBuffer(object);
  23727. }
  23728. module.exports = new Type('tag:yaml.org,2002:binary', {
  23729. kind: 'scalar',
  23730. resolve: resolveYamlBinary,
  23731. construct: constructYamlBinary,
  23732. predicate: isBinary,
  23733. represent: representYamlBinary
  23734. });
  23735. /***/ }),
  23736. /* 128 */
  23737. /***/ (function(module, exports, __webpack_require__) {
  23738. "use strict";
  23739. var Type = __webpack_require__(0);
  23740. function resolveYamlBoolean(data) {
  23741. if (data === null) return false;
  23742. var max = data.length;
  23743. return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
  23744. (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
  23745. }
  23746. function constructYamlBoolean(data) {
  23747. return data === 'true' ||
  23748. data === 'True' ||
  23749. data === 'TRUE';
  23750. }
  23751. function isBoolean(object) {
  23752. return Object.prototype.toString.call(object) === '[object Boolean]';
  23753. }
  23754. module.exports = new Type('tag:yaml.org,2002:bool', {
  23755. kind: 'scalar',
  23756. resolve: resolveYamlBoolean,
  23757. construct: constructYamlBoolean,
  23758. predicate: isBoolean,
  23759. represent: {
  23760. lowercase: function (object) { return object ? 'true' : 'false'; },
  23761. uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
  23762. camelcase: function (object) { return object ? 'True' : 'False'; }
  23763. },
  23764. defaultStyle: 'lowercase'
  23765. });
  23766. /***/ }),
  23767. /* 129 */
  23768. /***/ (function(module, exports, __webpack_require__) {
  23769. "use strict";
  23770. var common = __webpack_require__(6);
  23771. var Type = __webpack_require__(0);
  23772. var YAML_FLOAT_PATTERN = new RegExp(
  23773. // 2.5e4, 2.5 and integers
  23774. '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
  23775. // .2e4, .2
  23776. // special case, seems not from spec
  23777. '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
  23778. // 20:59
  23779. '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
  23780. // .inf
  23781. '|[-+]?\\.(?:inf|Inf|INF)' +
  23782. // .nan
  23783. '|\\.(?:nan|NaN|NAN))$');
  23784. function resolveYamlFloat(data) {
  23785. if (data === null) return false;
  23786. if (!YAML_FLOAT_PATTERN.test(data) ||
  23787. // Quick hack to not allow integers end with `_`
  23788. // Probably should update regexp & check speed
  23789. data[data.length - 1] === '_') {
  23790. return false;
  23791. }
  23792. return true;
  23793. }
  23794. function constructYamlFloat(data) {
  23795. var value, sign, base, digits;
  23796. value = data.replace(/_/g, '').toLowerCase();
  23797. sign = value[0] === '-' ? -1 : 1;
  23798. digits = [];
  23799. if ('+-'.indexOf(value[0]) >= 0) {
  23800. value = value.slice(1);
  23801. }
  23802. if (value === '.inf') {
  23803. return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
  23804. } else if (value === '.nan') {
  23805. return NaN;
  23806. } else if (value.indexOf(':') >= 0) {
  23807. value.split(':').forEach(function (v) {
  23808. digits.unshift(parseFloat(v, 10));
  23809. });
  23810. value = 0.0;
  23811. base = 1;
  23812. digits.forEach(function (d) {
  23813. value += d * base;
  23814. base *= 60;
  23815. });
  23816. return sign * value;
  23817. }
  23818. return sign * parseFloat(value, 10);
  23819. }
  23820. var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
  23821. function representYamlFloat(object, style) {
  23822. var res;
  23823. if (isNaN(object)) {
  23824. switch (style) {
  23825. case 'lowercase': return '.nan';
  23826. case 'uppercase': return '.NAN';
  23827. case 'camelcase': return '.NaN';
  23828. }
  23829. } else if (Number.POSITIVE_INFINITY === object) {
  23830. switch (style) {
  23831. case 'lowercase': return '.inf';
  23832. case 'uppercase': return '.INF';
  23833. case 'camelcase': return '.Inf';
  23834. }
  23835. } else if (Number.NEGATIVE_INFINITY === object) {
  23836. switch (style) {
  23837. case 'lowercase': return '-.inf';
  23838. case 'uppercase': return '-.INF';
  23839. case 'camelcase': return '-.Inf';
  23840. }
  23841. } else if (common.isNegativeZero(object)) {
  23842. return '-0.0';
  23843. }
  23844. res = object.toString(10);
  23845. // JS stringifier can build scientific format without dots: 5e-100,
  23846. // while YAML requres dot: 5.e-100. Fix it with simple hack
  23847. return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
  23848. }
  23849. function isFloat(object) {
  23850. return (Object.prototype.toString.call(object) === '[object Number]') &&
  23851. (object % 1 !== 0 || common.isNegativeZero(object));
  23852. }
  23853. module.exports = new Type('tag:yaml.org,2002:float', {
  23854. kind: 'scalar',
  23855. resolve: resolveYamlFloat,
  23856. construct: constructYamlFloat,
  23857. predicate: isFloat,
  23858. represent: representYamlFloat,
  23859. defaultStyle: 'lowercase'
  23860. });
  23861. /***/ }),
  23862. /* 130 */
  23863. /***/ (function(module, exports, __webpack_require__) {
  23864. "use strict";
  23865. var common = __webpack_require__(6);
  23866. var Type = __webpack_require__(0);
  23867. function isHexCode(c) {
  23868. return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
  23869. ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
  23870. ((0x61/* a */ <= c) && (c <= 0x66/* f */));
  23871. }
  23872. function isOctCode(c) {
  23873. return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
  23874. }
  23875. function isDecCode(c) {
  23876. return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
  23877. }
  23878. function resolveYamlInteger(data) {
  23879. if (data === null) return false;
  23880. var max = data.length,
  23881. index = 0,
  23882. hasDigits = false,
  23883. ch;
  23884. if (!max) return false;
  23885. ch = data[index];
  23886. // sign
  23887. if (ch === '-' || ch === '+') {
  23888. ch = data[++index];
  23889. }
  23890. if (ch === '0') {
  23891. // 0
  23892. if (index + 1 === max) return true;
  23893. ch = data[++index];
  23894. // base 2, base 8, base 16
  23895. if (ch === 'b') {
  23896. // base 2
  23897. index++;
  23898. for (; index < max; index++) {
  23899. ch = data[index];
  23900. if (ch === '_') continue;
  23901. if (ch !== '0' && ch !== '1') return false;
  23902. hasDigits = true;
  23903. }
  23904. return hasDigits && ch !== '_';
  23905. }
  23906. if (ch === 'x') {
  23907. // base 16
  23908. index++;
  23909. for (; index < max; index++) {
  23910. ch = data[index];
  23911. if (ch === '_') continue;
  23912. if (!isHexCode(data.charCodeAt(index))) return false;
  23913. hasDigits = true;
  23914. }
  23915. return hasDigits && ch !== '_';
  23916. }
  23917. // base 8
  23918. for (; index < max; index++) {
  23919. ch = data[index];
  23920. if (ch === '_') continue;
  23921. if (!isOctCode(data.charCodeAt(index))) return false;
  23922. hasDigits = true;
  23923. }
  23924. return hasDigits && ch !== '_';
  23925. }
  23926. // base 10 (except 0) or base 60
  23927. // value should not start with `_`;
  23928. if (ch === '_') return false;
  23929. for (; index < max; index++) {
  23930. ch = data[index];
  23931. if (ch === '_') continue;
  23932. if (ch === ':') break;
  23933. if (!isDecCode(data.charCodeAt(index))) {
  23934. return false;
  23935. }
  23936. hasDigits = true;
  23937. }
  23938. // Should have digits and should not end with `_`
  23939. if (!hasDigits || ch === '_') return false;
  23940. // if !base60 - done;
  23941. if (ch !== ':') return true;
  23942. // base60 almost not used, no needs to optimize
  23943. return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
  23944. }
  23945. function constructYamlInteger(data) {
  23946. var value = data, sign = 1, ch, base, digits = [];
  23947. if (value.indexOf('_') !== -1) {
  23948. value = value.replace(/_/g, '');
  23949. }
  23950. ch = value[0];
  23951. if (ch === '-' || ch === '+') {
  23952. if (ch === '-') sign = -1;
  23953. value = value.slice(1);
  23954. ch = value[0];
  23955. }
  23956. if (value === '0') return 0;
  23957. if (ch === '0') {
  23958. if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
  23959. if (value[1] === 'x') return sign * parseInt(value, 16);
  23960. return sign * parseInt(value, 8);
  23961. }
  23962. if (value.indexOf(':') !== -1) {
  23963. value.split(':').forEach(function (v) {
  23964. digits.unshift(parseInt(v, 10));
  23965. });
  23966. value = 0;
  23967. base = 1;
  23968. digits.forEach(function (d) {
  23969. value += (d * base);
  23970. base *= 60;
  23971. });
  23972. return sign * value;
  23973. }
  23974. return sign * parseInt(value, 10);
  23975. }
  23976. function isInteger(object) {
  23977. return (Object.prototype.toString.call(object)) === '[object Number]' &&
  23978. (object % 1 === 0 && !common.isNegativeZero(object));
  23979. }
  23980. module.exports = new Type('tag:yaml.org,2002:int', {
  23981. kind: 'scalar',
  23982. resolve: resolveYamlInteger,
  23983. construct: constructYamlInteger,
  23984. predicate: isInteger,
  23985. represent: {
  23986. binary: function (object) { return '0b' + object.toString(2); },
  23987. octal: function (object) { return '0' + object.toString(8); },
  23988. decimal: function (object) { return object.toString(10); },
  23989. hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
  23990. },
  23991. defaultStyle: 'decimal',
  23992. styleAliases: {
  23993. binary: [ 2, 'bin' ],
  23994. octal: [ 8, 'oct' ],
  23995. decimal: [ 10, 'dec' ],
  23996. hexadecimal: [ 16, 'hex' ]
  23997. }
  23998. });
  23999. /***/ }),
  24000. /* 131 */
  24001. /***/ (function(module, exports, __webpack_require__) {
  24002. "use strict";
  24003. var require;
  24004. var esprima;
  24005. // Browserified version does not have esprima
  24006. //
  24007. // 1. For node.js just require module as deps
  24008. // 2. For browser try to require mudule via external AMD system.
  24009. // If not found - try to fallback to window.esprima. If not
  24010. // found too - then fail to parse.
  24011. //
  24012. try {
  24013. // workaround to exclude package from browserify list.
  24014. var _require = require;
  24015. esprima = __webpack_require__(114);
  24016. } catch (_) {
  24017. /*global window */
  24018. if (typeof window !== 'undefined') esprima = window.esprima;
  24019. }
  24020. var Type = __webpack_require__(0);
  24021. function resolveJavascriptFunction(data) {
  24022. if (data === null) return false;
  24023. try {
  24024. var source = '(' + data + ')',
  24025. ast = esprima.parse(source, { range: true });
  24026. if (ast.type !== 'Program' ||
  24027. ast.body.length !== 1 ||
  24028. ast.body[0].type !== 'ExpressionStatement' ||
  24029. ast.body[0].expression.type !== 'FunctionExpression') {
  24030. return false;
  24031. }
  24032. return true;
  24033. } catch (err) {
  24034. return false;
  24035. }
  24036. }
  24037. function constructJavascriptFunction(data) {
  24038. /*jslint evil:true*/
  24039. var source = '(' + data + ')',
  24040. ast = esprima.parse(source, { range: true }),
  24041. params = [],
  24042. body;
  24043. if (ast.type !== 'Program' ||
  24044. ast.body.length !== 1 ||
  24045. ast.body[0].type !== 'ExpressionStatement' ||
  24046. ast.body[0].expression.type !== 'FunctionExpression') {
  24047. throw new Error('Failed to resolve function');
  24048. }
  24049. ast.body[0].expression.params.forEach(function (param) {
  24050. params.push(param.name);
  24051. });
  24052. body = ast.body[0].expression.body.range;
  24053. // Esprima's ranges include the first '{' and the last '}' characters on
  24054. // function expressions. So cut them out.
  24055. /*eslint-disable no-new-func*/
  24056. return new Function(params, source.slice(body[0] + 1, body[1] - 1));
  24057. }
  24058. function representJavascriptFunction(object /*, style*/) {
  24059. return object.toString();
  24060. }
  24061. function isFunction(object) {
  24062. return Object.prototype.toString.call(object) === '[object Function]';
  24063. }
  24064. module.exports = new Type('tag:yaml.org,2002:js/function', {
  24065. kind: 'scalar',
  24066. resolve: resolveJavascriptFunction,
  24067. construct: constructJavascriptFunction,
  24068. predicate: isFunction,
  24069. represent: representJavascriptFunction
  24070. });
  24071. /***/ }),
  24072. /* 132 */
  24073. /***/ (function(module, exports, __webpack_require__) {
  24074. "use strict";
  24075. var Type = __webpack_require__(0);
  24076. function resolveJavascriptRegExp(data) {
  24077. if (data === null) return false;
  24078. if (data.length === 0) return false;
  24079. var regexp = data,
  24080. tail = /\/([gim]*)$/.exec(data),
  24081. modifiers = '';
  24082. // if regexp starts with '/' it can have modifiers and must be properly closed
  24083. // `/foo/gim` - modifiers tail can be maximum 3 chars
  24084. if (regexp[0] === '/') {
  24085. if (tail) modifiers = tail[1];
  24086. if (modifiers.length > 3) return false;
  24087. // if expression starts with /, is should be properly terminated
  24088. if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
  24089. }
  24090. return true;
  24091. }
  24092. function constructJavascriptRegExp(data) {
  24093. var regexp = data,
  24094. tail = /\/([gim]*)$/.exec(data),
  24095. modifiers = '';
  24096. // `/foo/gim` - tail can be maximum 4 chars
  24097. if (regexp[0] === '/') {
  24098. if (tail) modifiers = tail[1];
  24099. regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
  24100. }
  24101. return new RegExp(regexp, modifiers);
  24102. }
  24103. function representJavascriptRegExp(object /*, style*/) {
  24104. var result = '/' + object.source + '/';
  24105. if (object.global) result += 'g';
  24106. if (object.multiline) result += 'm';
  24107. if (object.ignoreCase) result += 'i';
  24108. return result;
  24109. }
  24110. function isRegExp(object) {
  24111. return Object.prototype.toString.call(object) === '[object RegExp]';
  24112. }
  24113. module.exports = new Type('tag:yaml.org,2002:js/regexp', {
  24114. kind: 'scalar',
  24115. resolve: resolveJavascriptRegExp,
  24116. construct: constructJavascriptRegExp,
  24117. predicate: isRegExp,
  24118. represent: representJavascriptRegExp
  24119. });
  24120. /***/ }),
  24121. /* 133 */
  24122. /***/ (function(module, exports, __webpack_require__) {
  24123. "use strict";
  24124. var Type = __webpack_require__(0);
  24125. function resolveJavascriptUndefined() {
  24126. return true;
  24127. }
  24128. function constructJavascriptUndefined() {
  24129. /*eslint-disable no-undefined*/
  24130. return undefined;
  24131. }
  24132. function representJavascriptUndefined() {
  24133. return '';
  24134. }
  24135. function isUndefined(object) {
  24136. return typeof object === 'undefined';
  24137. }
  24138. module.exports = new Type('tag:yaml.org,2002:js/undefined', {
  24139. kind: 'scalar',
  24140. resolve: resolveJavascriptUndefined,
  24141. construct: constructJavascriptUndefined,
  24142. predicate: isUndefined,
  24143. represent: representJavascriptUndefined
  24144. });
  24145. /***/ }),
  24146. /* 134 */
  24147. /***/ (function(module, exports, __webpack_require__) {
  24148. "use strict";
  24149. var Type = __webpack_require__(0);
  24150. module.exports = new Type('tag:yaml.org,2002:map', {
  24151. kind: 'mapping',
  24152. construct: function (data) { return data !== null ? data : {}; }
  24153. });
  24154. /***/ }),
  24155. /* 135 */
  24156. /***/ (function(module, exports, __webpack_require__) {
  24157. "use strict";
  24158. var Type = __webpack_require__(0);
  24159. function resolveYamlMerge(data) {
  24160. return data === '<<' || data === null;
  24161. }
  24162. module.exports = new Type('tag:yaml.org,2002:merge', {
  24163. kind: 'scalar',
  24164. resolve: resolveYamlMerge
  24165. });
  24166. /***/ }),
  24167. /* 136 */
  24168. /***/ (function(module, exports, __webpack_require__) {
  24169. "use strict";
  24170. var Type = __webpack_require__(0);
  24171. function resolveYamlNull(data) {
  24172. if (data === null) return true;
  24173. var max = data.length;
  24174. return (max === 1 && data === '~') ||
  24175. (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
  24176. }
  24177. function constructYamlNull() {
  24178. return null;
  24179. }
  24180. function isNull(object) {
  24181. return object === null;
  24182. }
  24183. module.exports = new Type('tag:yaml.org,2002:null', {
  24184. kind: 'scalar',
  24185. resolve: resolveYamlNull,
  24186. construct: constructYamlNull,
  24187. predicate: isNull,
  24188. represent: {
  24189. canonical: function () { return '~'; },
  24190. lowercase: function () { return 'null'; },
  24191. uppercase: function () { return 'NULL'; },
  24192. camelcase: function () { return 'Null'; }
  24193. },
  24194. defaultStyle: 'lowercase'
  24195. });
  24196. /***/ }),
  24197. /* 137 */
  24198. /***/ (function(module, exports, __webpack_require__) {
  24199. "use strict";
  24200. var Type = __webpack_require__(0);
  24201. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  24202. var _toString = Object.prototype.toString;
  24203. function resolveYamlOmap(data) {
  24204. if (data === null) return true;
  24205. var objectKeys = [], index, length, pair, pairKey, pairHasKey,
  24206. object = data;
  24207. for (index = 0, length = object.length; index < length; index += 1) {
  24208. pair = object[index];
  24209. pairHasKey = false;
  24210. if (_toString.call(pair) !== '[object Object]') return false;
  24211. for (pairKey in pair) {
  24212. if (_hasOwnProperty.call(pair, pairKey)) {
  24213. if (!pairHasKey) pairHasKey = true;
  24214. else return false;
  24215. }
  24216. }
  24217. if (!pairHasKey) return false;
  24218. if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
  24219. else return false;
  24220. }
  24221. return true;
  24222. }
  24223. function constructYamlOmap(data) {
  24224. return data !== null ? data : [];
  24225. }
  24226. module.exports = new Type('tag:yaml.org,2002:omap', {
  24227. kind: 'sequence',
  24228. resolve: resolveYamlOmap,
  24229. construct: constructYamlOmap
  24230. });
  24231. /***/ }),
  24232. /* 138 */
  24233. /***/ (function(module, exports, __webpack_require__) {
  24234. "use strict";
  24235. var Type = __webpack_require__(0);
  24236. var _toString = Object.prototype.toString;
  24237. function resolveYamlPairs(data) {
  24238. if (data === null) return true;
  24239. var index, length, pair, keys, result,
  24240. object = data;
  24241. result = new Array(object.length);
  24242. for (index = 0, length = object.length; index < length; index += 1) {
  24243. pair = object[index];
  24244. if (_toString.call(pair) !== '[object Object]') return false;
  24245. keys = Object.keys(pair);
  24246. if (keys.length !== 1) return false;
  24247. result[index] = [ keys[0], pair[keys[0]] ];
  24248. }
  24249. return true;
  24250. }
  24251. function constructYamlPairs(data) {
  24252. if (data === null) return [];
  24253. var index, length, pair, keys, result,
  24254. object = data;
  24255. result = new Array(object.length);
  24256. for (index = 0, length = object.length; index < length; index += 1) {
  24257. pair = object[index];
  24258. keys = Object.keys(pair);
  24259. result[index] = [ keys[0], pair[keys[0]] ];
  24260. }
  24261. return result;
  24262. }
  24263. module.exports = new Type('tag:yaml.org,2002:pairs', {
  24264. kind: 'sequence',
  24265. resolve: resolveYamlPairs,
  24266. construct: constructYamlPairs
  24267. });
  24268. /***/ }),
  24269. /* 139 */
  24270. /***/ (function(module, exports, __webpack_require__) {
  24271. "use strict";
  24272. var Type = __webpack_require__(0);
  24273. module.exports = new Type('tag:yaml.org,2002:seq', {
  24274. kind: 'sequence',
  24275. construct: function (data) { return data !== null ? data : []; }
  24276. });
  24277. /***/ }),
  24278. /* 140 */
  24279. /***/ (function(module, exports, __webpack_require__) {
  24280. "use strict";
  24281. var Type = __webpack_require__(0);
  24282. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  24283. function resolveYamlSet(data) {
  24284. if (data === null) return true;
  24285. var key, object = data;
  24286. for (key in object) {
  24287. if (_hasOwnProperty.call(object, key)) {
  24288. if (object[key] !== null) return false;
  24289. }
  24290. }
  24291. return true;
  24292. }
  24293. function constructYamlSet(data) {
  24294. return data !== null ? data : {};
  24295. }
  24296. module.exports = new Type('tag:yaml.org,2002:set', {
  24297. kind: 'mapping',
  24298. resolve: resolveYamlSet,
  24299. construct: constructYamlSet
  24300. });
  24301. /***/ }),
  24302. /* 141 */
  24303. /***/ (function(module, exports, __webpack_require__) {
  24304. "use strict";
  24305. var Type = __webpack_require__(0);
  24306. module.exports = new Type('tag:yaml.org,2002:str', {
  24307. kind: 'scalar',
  24308. construct: function (data) { return data !== null ? data : ''; }
  24309. });
  24310. /***/ }),
  24311. /* 142 */
  24312. /***/ (function(module, exports, __webpack_require__) {
  24313. "use strict";
  24314. var Type = __webpack_require__(0);
  24315. var YAML_DATE_REGEXP = new RegExp(
  24316. '^([0-9][0-9][0-9][0-9])' + // [1] year
  24317. '-([0-9][0-9])' + // [2] month
  24318. '-([0-9][0-9])$'); // [3] day
  24319. var YAML_TIMESTAMP_REGEXP = new RegExp(
  24320. '^([0-9][0-9][0-9][0-9])' + // [1] year
  24321. '-([0-9][0-9]?)' + // [2] month
  24322. '-([0-9][0-9]?)' + // [3] day
  24323. '(?:[Tt]|[ \\t]+)' + // ...
  24324. '([0-9][0-9]?)' + // [4] hour
  24325. ':([0-9][0-9])' + // [5] minute
  24326. ':([0-9][0-9])' + // [6] second
  24327. '(?:\\.([0-9]*))?' + // [7] fraction
  24328. '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
  24329. '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
  24330. function resolveYamlTimestamp(data) {
  24331. if (data === null) return false;
  24332. if (YAML_DATE_REGEXP.exec(data) !== null) return true;
  24333. if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
  24334. return false;
  24335. }
  24336. function constructYamlTimestamp(data) {
  24337. var match, year, month, day, hour, minute, second, fraction = 0,
  24338. delta = null, tz_hour, tz_minute, date;
  24339. match = YAML_DATE_REGEXP.exec(data);
  24340. if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
  24341. if (match === null) throw new Error('Date resolve error');
  24342. // match: [1] year [2] month [3] day
  24343. year = +(match[1]);
  24344. month = +(match[2]) - 1; // JS month starts with 0
  24345. day = +(match[3]);
  24346. if (!match[4]) { // no hour
  24347. return new Date(Date.UTC(year, month, day));
  24348. }
  24349. // match: [4] hour [5] minute [6] second [7] fraction
  24350. hour = +(match[4]);
  24351. minute = +(match[5]);
  24352. second = +(match[6]);
  24353. if (match[7]) {
  24354. fraction = match[7].slice(0, 3);
  24355. while (fraction.length < 3) { // milli-seconds
  24356. fraction += '0';
  24357. }
  24358. fraction = +fraction;
  24359. }
  24360. // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
  24361. if (match[9]) {
  24362. tz_hour = +(match[10]);
  24363. tz_minute = +(match[11] || 0);
  24364. delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
  24365. if (match[9] === '-') delta = -delta;
  24366. }
  24367. date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
  24368. if (delta) date.setTime(date.getTime() - delta);
  24369. return date;
  24370. }
  24371. function representYamlTimestamp(object /*, style*/) {
  24372. return object.toISOString();
  24373. }
  24374. module.exports = new Type('tag:yaml.org,2002:timestamp', {
  24375. kind: 'scalar',
  24376. resolve: resolveYamlTimestamp,
  24377. construct: constructYamlTimestamp,
  24378. instanceOf: Date,
  24379. represent: representYamlTimestamp
  24380. });
  24381. /***/ }),
  24382. /* 143 */
  24383. /***/ (function(module, exports, __webpack_require__) {
  24384. "use strict";
  24385. Object.defineProperty(exports, "__esModule", {
  24386. value: true
  24387. });
  24388. exports.default = findExtendRule;
  24389. var extendRuleKeyWords = ['&', ':', 'extend'];
  24390. var extendRuleKeyWordsCount = extendRuleKeyWords.length;
  24391. function findExtendRule(tokens) {
  24392. var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  24393. var stack = [];
  24394. var len = tokens.length;
  24395. var end = start;
  24396. while (end < len) {
  24397. var token = tokens[end];
  24398. if (extendRuleKeyWords.indexOf(token[1]) >= 0) {
  24399. stack.push(token[1]);
  24400. } else if (token[0] !== 'space') {
  24401. break;
  24402. }
  24403. end++;
  24404. }
  24405. for (var index = 0; index < extendRuleKeyWordsCount; index++) {
  24406. if (stack[index] !== extendRuleKeyWords[index]) {
  24407. return null;
  24408. }
  24409. }
  24410. return tokens.slice(start, end);
  24411. }
  24412. module.exports = exports['default'];
  24413. /***/ }),
  24414. /* 144 */
  24415. /***/ (function(module, exports, __webpack_require__) {
  24416. "use strict";
  24417. Object.defineProperty(exports, "__esModule", {
  24418. value: true
  24419. });
  24420. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  24421. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  24422. var _rule = __webpack_require__(16);
  24423. var _rule2 = _interopRequireDefault(_rule);
  24424. var _lessStringify = __webpack_require__(21);
  24425. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  24426. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24427. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24428. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  24429. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  24430. var Import = function (_PostCssRule) {
  24431. _inherits(Import, _PostCssRule);
  24432. function Import(defaults) {
  24433. _classCallCheck(this, Import);
  24434. var _this = _possibleConstructorReturn(this, (Import.__proto__ || Object.getPrototypeOf(Import)).call(this, defaults));
  24435. _this.type = 'import';
  24436. return _this;
  24437. }
  24438. _createClass(Import, [{
  24439. key: 'toString',
  24440. value: function toString(stringifier) {
  24441. if (!stringifier) {
  24442. stringifier = {
  24443. stringify: _lessStringify2.default
  24444. };
  24445. }
  24446. return _get(Import.prototype.__proto__ || Object.getPrototypeOf(Import.prototype), 'toString', this).call(this, stringifier);
  24447. }
  24448. }]);
  24449. return Import;
  24450. }(_rule2.default);
  24451. exports.default = Import;
  24452. module.exports = exports['default'];
  24453. /***/ }),
  24454. /* 145 */
  24455. /***/ (function(module, exports, __webpack_require__) {
  24456. "use strict";
  24457. Object.defineProperty(exports, "__esModule", {
  24458. value: true
  24459. });
  24460. exports.default = isMixinToken;
  24461. var _globals = __webpack_require__(3);
  24462. var unpaddedFractionalNumbersPattern = /\.[0-9]/;
  24463. function isMixinToken(token) {
  24464. var symbol = token[1];
  24465. var firstSymbolCode = symbol ? symbol[0].charCodeAt(0) : null;
  24466. return (firstSymbolCode === _globals.dot || firstSymbolCode === _globals.hash) &&
  24467. // ignore hashes used for colors
  24468. _globals.hashColorPattern.test(symbol) === false &&
  24469. // ignore dots used for unpadded fractional numbers
  24470. unpaddedFractionalNumbersPattern.test(symbol) === false;
  24471. }
  24472. module.exports = exports['default'];
  24473. /***/ }),
  24474. /* 146 */
  24475. /***/ (function(module, exports, __webpack_require__) {
  24476. "use strict";
  24477. Object.defineProperty(exports, "__esModule", {
  24478. value: true
  24479. });
  24480. exports.default = lessParse;
  24481. var _input = __webpack_require__(37);
  24482. var _input2 = _interopRequireDefault(_input);
  24483. var _lessParser = __webpack_require__(42);
  24484. var _lessParser2 = _interopRequireDefault(_lessParser);
  24485. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24486. function lessParse(less, opts) {
  24487. var input = new _input2.default(less, opts);
  24488. var parser = new _lessParser2.default(input, opts);
  24489. // const parser = new Parser(input, opts);
  24490. parser.tokenize();
  24491. parser.loop();
  24492. return parser.root;
  24493. }
  24494. // import Parser from 'postcss/lib/parser';
  24495. module.exports = exports['default'];
  24496. /***/ }),
  24497. /* 147 */
  24498. /***/ (function(module, exports, __webpack_require__) {
  24499. "use strict";
  24500. Object.defineProperty(exports, "__esModule", {
  24501. value: true
  24502. });
  24503. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  24504. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  24505. var _stringifier = __webpack_require__(40);
  24506. var _stringifier2 = _interopRequireDefault(_stringifier);
  24507. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24508. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24509. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  24510. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  24511. var LessStringifier = function (_Stringifier) {
  24512. _inherits(LessStringifier, _Stringifier);
  24513. function LessStringifier() {
  24514. _classCallCheck(this, LessStringifier);
  24515. return _possibleConstructorReturn(this, (LessStringifier.__proto__ || Object.getPrototypeOf(LessStringifier)).apply(this, arguments));
  24516. }
  24517. _createClass(LessStringifier, [{
  24518. key: 'comment',
  24519. value: function comment(node) {
  24520. this.builder(node.raws.content, node);
  24521. }
  24522. }, {
  24523. key: 'import',
  24524. value: function _import(node) {
  24525. this.builder('@' + node.name);
  24526. this.builder((node.raws.afterName || '') + (node.directives || '') + (node.raws.between || '') + (node.urlFunc ? 'url(' : '') + (node.raws.beforeUrl || '') + (node.importPath || '') + (node.raws.afterUrl || '') + (node.urlFunc ? ')' : '') + (node.raws.after || ''));
  24527. if (node.raws.semicolon) {
  24528. this.builder(';');
  24529. }
  24530. }
  24531. }, {
  24532. key: 'rule',
  24533. value: function rule(node) {
  24534. _get(LessStringifier.prototype.__proto__ || Object.getPrototypeOf(LessStringifier.prototype), 'rule', this).call(this, node);
  24535. if (node.empty && node.raws.semicolon) {
  24536. if (node.important) {
  24537. if (node.raws.important) {
  24538. this.builder(node.raws.important);
  24539. } else {
  24540. this.builder(' !important');
  24541. }
  24542. }
  24543. if (node.raws.semicolon) {
  24544. this.builder(';');
  24545. }
  24546. }
  24547. }
  24548. }, {
  24549. key: 'block',
  24550. value: function block(node, start) {
  24551. var empty = node.empty;
  24552. var between = this.raw(node, 'between', 'beforeOpen');
  24553. var after = '';
  24554. if (empty) {
  24555. this.builder(start + between, node, 'start');
  24556. } else {
  24557. this.builder(start + between + '{', node, 'start');
  24558. }
  24559. if (node.nodes && node.nodes.length) {
  24560. this.body(node);
  24561. after = this.raw(node, 'after');
  24562. } else {
  24563. after = this.raw(node, 'after', 'emptyBody');
  24564. }
  24565. if (after) {
  24566. this.builder(after);
  24567. }
  24568. if (!empty) {
  24569. this.builder('}', node, 'end');
  24570. }
  24571. }
  24572. }]);
  24573. return LessStringifier;
  24574. }(_stringifier2.default);
  24575. exports.default = LessStringifier;
  24576. module.exports = exports['default'];
  24577. /***/ }),
  24578. /* 148 */
  24579. /***/ (function(module, exports, __webpack_require__) {
  24580. "use strict";
  24581. Object.defineProperty(exports, "__esModule", {
  24582. value: true
  24583. });
  24584. exports.default = lessTokenize;
  24585. var _globals = __webpack_require__(3);
  24586. var _tokenizeSymbol = __webpack_require__(162);
  24587. var _tokenizeSymbol2 = _interopRequireDefault(_tokenizeSymbol);
  24588. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24589. function lessTokenize(input) {
  24590. var state = {
  24591. input: input,
  24592. tokens: [],
  24593. css: input.css.valueOf(),
  24594. offset: -1,
  24595. line: 1,
  24596. pos: 0
  24597. };
  24598. state.length = state.css.length;
  24599. while (state.pos < state.length) {
  24600. state.symbolCode = state.css.charCodeAt(state.pos);
  24601. state.symbol = state.css[state.pos];
  24602. state.nextPos = null;
  24603. state.escaped = null;
  24604. state.lines = null;
  24605. state.lastLine = null;
  24606. state.cssPart = null;
  24607. state.escape = null;
  24608. state.nextLine = null;
  24609. state.nextOffset = null;
  24610. state.escapePos = null;
  24611. state.token = null;
  24612. if (state.symbolCode === _globals.newline) {
  24613. state.offset = state.pos;
  24614. state.line += 1;
  24615. }
  24616. (0, _tokenizeSymbol2.default)(state);
  24617. state.pos++;
  24618. }
  24619. return state.tokens;
  24620. }
  24621. module.exports = exports['default'];
  24622. /***/ }),
  24623. /* 149 */
  24624. /***/ (function(module, exports, __webpack_require__) {
  24625. "use strict";
  24626. Object.defineProperty(exports, "__esModule", {
  24627. value: true
  24628. });
  24629. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  24630. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  24631. var _root = __webpack_require__(39);
  24632. var _root2 = _interopRequireDefault(_root);
  24633. var _lessStringify = __webpack_require__(21);
  24634. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  24635. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24636. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24637. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  24638. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  24639. var Root = function (_PostCssRoot) {
  24640. _inherits(Root, _PostCssRoot);
  24641. function Root() {
  24642. _classCallCheck(this, Root);
  24643. return _possibleConstructorReturn(this, (Root.__proto__ || Object.getPrototypeOf(Root)).apply(this, arguments));
  24644. }
  24645. _createClass(Root, [{
  24646. key: 'toString',
  24647. value: function toString(stringifier) {
  24648. if (!stringifier) {
  24649. stringifier = {
  24650. stringify: _lessStringify2.default
  24651. };
  24652. }
  24653. return _get(Root.prototype.__proto__ || Object.getPrototypeOf(Root.prototype), 'toString', this).call(this, stringifier);
  24654. }
  24655. }]);
  24656. return Root;
  24657. }(_root2.default);
  24658. exports.default = Root;
  24659. module.exports = exports['default'];
  24660. /***/ }),
  24661. /* 150 */
  24662. /***/ (function(module, exports, __webpack_require__) {
  24663. "use strict";
  24664. Object.defineProperty(exports, "__esModule", {
  24665. value: true
  24666. });
  24667. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  24668. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  24669. var _rule = __webpack_require__(16);
  24670. var _rule2 = _interopRequireDefault(_rule);
  24671. var _lessStringify = __webpack_require__(21);
  24672. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  24673. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24674. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24675. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  24676. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  24677. var Rule = function (_PostCssRule) {
  24678. _inherits(Rule, _PostCssRule);
  24679. function Rule() {
  24680. _classCallCheck(this, Rule);
  24681. return _possibleConstructorReturn(this, (Rule.__proto__ || Object.getPrototypeOf(Rule)).apply(this, arguments));
  24682. }
  24683. _createClass(Rule, [{
  24684. key: 'toString',
  24685. value: function toString(stringifier) {
  24686. if (!stringifier) {
  24687. stringifier = {
  24688. stringify: _lessStringify2.default
  24689. };
  24690. }
  24691. return _get(Rule.prototype.__proto__ || Object.getPrototypeOf(Rule.prototype), 'toString', this).call(this, stringifier);
  24692. }
  24693. }]);
  24694. return Rule;
  24695. }(_rule2.default);
  24696. exports.default = Rule;
  24697. module.exports = exports['default'];
  24698. /***/ }),
  24699. /* 151 */
  24700. /***/ (function(module, exports, __webpack_require__) {
  24701. "use strict";
  24702. Object.defineProperty(exports, "__esModule", {
  24703. value: true
  24704. });
  24705. exports.default = findEndOfEscaping;
  24706. var _globals = __webpack_require__(3);
  24707. /**
  24708. * @param state
  24709. * @returns {number}
  24710. */
  24711. function findEndOfEscaping(state) {
  24712. var openQuotesCount = 0,
  24713. quoteCode = -1;
  24714. for (var i = state.pos + 1; i < state.length; i++) {
  24715. var symbolCode = state.css.charCodeAt(i);
  24716. var prevSymbolCode = state.css.charCodeAt(i - 1);
  24717. if (prevSymbolCode !== _globals.backslash && (symbolCode === _globals.singleQuote || symbolCode === _globals.doubleQuote || symbolCode === _globals.backTick)) {
  24718. if (quoteCode === -1) {
  24719. quoteCode = symbolCode;
  24720. openQuotesCount++;
  24721. } else if (symbolCode === quoteCode) {
  24722. openQuotesCount--;
  24723. if (!openQuotesCount) {
  24724. return i;
  24725. }
  24726. }
  24727. }
  24728. }
  24729. return -1;
  24730. }
  24731. module.exports = exports['default'];
  24732. /***/ }),
  24733. /* 152 */
  24734. /***/ (function(module, exports, __webpack_require__) {
  24735. "use strict";
  24736. Object.defineProperty(exports, "__esModule", {
  24737. value: true
  24738. });
  24739. exports.default = isEscaping;
  24740. var _globals = __webpack_require__(3);
  24741. var nextSymbolVariants = [_globals.backTick, _globals.doubleQuote, _globals.singleQuote];
  24742. function isEscaping(state) {
  24743. var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
  24744. return state.symbolCode === _globals.tilde && nextSymbolVariants.indexOf(nextSymbolCode) >= 0;
  24745. }
  24746. module.exports = exports['default'];
  24747. /***/ }),
  24748. /* 153 */
  24749. /***/ (function(module, exports, __webpack_require__) {
  24750. "use strict";
  24751. Object.defineProperty(exports, "__esModule", {
  24752. value: true
  24753. });
  24754. exports.default = tokenizeAtRule;
  24755. var _globals = __webpack_require__(3);
  24756. var _unclosed = __webpack_require__(13);
  24757. var _unclosed2 = _interopRequireDefault(_unclosed);
  24758. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24759. function tokenizeAtRule(state) {
  24760. // it's an interpolation
  24761. if (state.css.charCodeAt(state.pos + 1) === _globals.openedCurlyBracket) {
  24762. state.nextPos = state.css.indexOf('}', state.pos + 2);
  24763. if (state.nextPos === -1) {
  24764. (0, _unclosed2.default)(state, 'interpolation');
  24765. }
  24766. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  24767. state.lines = state.cssPart.split('\n');
  24768. state.lastLine = state.lines.length - 1;
  24769. if (state.lastLine > 0) {
  24770. state.nextLine = state.line + state.lastLine;
  24771. state.nextOffset = state.nextPos - state.lines[state.lastLine].length;
  24772. } else {
  24773. state.nextLine = state.line;
  24774. state.nextOffset = state.offset;
  24775. }
  24776. state.tokens.push(['word', state.cssPart, state.line, state.pos - state.offset, state.nextLine, state.nextPos - state.nextOffset]);
  24777. state.offset = state.nextOffset;
  24778. state.line = state.nextLine;
  24779. } else {
  24780. _globals.atEndPattern.lastIndex = state.pos + 1;
  24781. _globals.atEndPattern.test(state.css);
  24782. if (_globals.atEndPattern.lastIndex === 0) {
  24783. state.nextPos = state.css.length - 1;
  24784. } else {
  24785. state.nextPos = _globals.atEndPattern.lastIndex - 2;
  24786. }
  24787. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  24788. state.token = 'at-word';
  24789. // check if it's a variable
  24790. if (_globals.variablePattern.test(state.cssPart)) {
  24791. _globals.wordEndPattern.lastIndex = state.pos + 1;
  24792. _globals.wordEndPattern.test(state.css);
  24793. if (_globals.wordEndPattern.lastIndex === 0) {
  24794. state.nextPos = state.css.length - 1;
  24795. } else {
  24796. state.nextPos = _globals.wordEndPattern.lastIndex - 2;
  24797. }
  24798. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  24799. state.token = 'word';
  24800. }
  24801. state.tokens.push([state.token, state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  24802. }
  24803. state.pos = state.nextPos;
  24804. }
  24805. module.exports = exports['default'];
  24806. /***/ }),
  24807. /* 154 */
  24808. /***/ (function(module, exports, __webpack_require__) {
  24809. "use strict";
  24810. Object.defineProperty(exports, "__esModule", {
  24811. value: true
  24812. });
  24813. exports.default = tokenizeBackslash;
  24814. var _globals = __webpack_require__(3);
  24815. function tokenizeBackslash(state) {
  24816. state.nextPos = state.pos;
  24817. state.escape = true;
  24818. while (state.css.charCodeAt(state.nextPos + 1) === _globals.backslash) {
  24819. state.nextPos += 1;
  24820. state.escape = !state.escape;
  24821. }
  24822. state.symbolCode = state.css.charCodeAt(state.nextPos + 1);
  24823. if (state.escape && state.symbolCode !== _globals.slash && state.symbolCode !== _globals.space && state.symbolCode !== _globals.newline && state.symbolCode !== _globals.tab && state.symbolCode !== _globals.carriageReturn && state.symbolCode !== _globals.feed) {
  24824. state.nextPos += 1;
  24825. }
  24826. state.tokens.push(['word', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  24827. state.pos = state.nextPos;
  24828. }
  24829. module.exports = exports['default'];
  24830. /***/ }),
  24831. /* 155 */
  24832. /***/ (function(module, exports, __webpack_require__) {
  24833. "use strict";
  24834. Object.defineProperty(exports, "__esModule", {
  24835. value: true
  24836. });
  24837. exports.default = tokenizeBasicSymbol;
  24838. function tokenizeBasicSymbol(state) {
  24839. state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);
  24840. }
  24841. module.exports = exports["default"];
  24842. /***/ }),
  24843. /* 156 */
  24844. /***/ (function(module, exports, __webpack_require__) {
  24845. "use strict";
  24846. Object.defineProperty(exports, "__esModule", {
  24847. value: true
  24848. });
  24849. exports.default = tokenizeComma;
  24850. function tokenizeComma(state) {
  24851. state.tokens.push(['word', state.symbol, state.line, state.pos - state.offset, state.line, state.pos - state.offset + 1]);
  24852. }
  24853. module.exports = exports['default'];
  24854. /***/ }),
  24855. /* 157 */
  24856. /***/ (function(module, exports, __webpack_require__) {
  24857. "use strict";
  24858. Object.defineProperty(exports, "__esModule", {
  24859. value: true
  24860. });
  24861. exports.default = tokenizeDefault;
  24862. var _globals = __webpack_require__(3);
  24863. var _findEndOfEscaping = __webpack_require__(151);
  24864. var _findEndOfEscaping2 = _interopRequireDefault(_findEndOfEscaping);
  24865. var _isEscaping = __webpack_require__(152);
  24866. var _isEscaping2 = _interopRequireDefault(_isEscaping);
  24867. var _tokenizeInlineComment = __webpack_require__(158);
  24868. var _tokenizeInlineComment2 = _interopRequireDefault(_tokenizeInlineComment);
  24869. var _tokenizeMultilineComment = __webpack_require__(159);
  24870. var _tokenizeMultilineComment2 = _interopRequireDefault(_tokenizeMultilineComment);
  24871. var _unclosed = __webpack_require__(13);
  24872. var _unclosed2 = _interopRequireDefault(_unclosed);
  24873. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24874. function tokenizeDefault(state) {
  24875. var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
  24876. if (state.symbolCode === _globals.slash && nextSymbolCode === _globals.asterisk) {
  24877. (0, _tokenizeMultilineComment2.default)(state);
  24878. } else if (state.symbolCode === _globals.slash && nextSymbolCode === _globals.slash) {
  24879. (0, _tokenizeInlineComment2.default)(state);
  24880. } else {
  24881. if ((0, _isEscaping2.default)(state)) {
  24882. var pos = (0, _findEndOfEscaping2.default)(state);
  24883. if (pos < 0) {
  24884. (0, _unclosed2.default)(state, 'escaping');
  24885. } else {
  24886. state.nextPos = pos;
  24887. }
  24888. } else {
  24889. _globals.wordEndPattern.lastIndex = state.pos + 1;
  24890. _globals.wordEndPattern.test(state.css);
  24891. if (_globals.wordEndPattern.lastIndex === 0) {
  24892. state.nextPos = state.css.length - 1;
  24893. } else {
  24894. state.nextPos = _globals.wordEndPattern.lastIndex - 2;
  24895. }
  24896. }
  24897. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  24898. state.tokens.push(['word', state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  24899. state.pos = state.nextPos;
  24900. }
  24901. }
  24902. module.exports = exports['default'];
  24903. /***/ }),
  24904. /* 158 */
  24905. /***/ (function(module, exports, __webpack_require__) {
  24906. "use strict";
  24907. Object.defineProperty(exports, "__esModule", {
  24908. value: true
  24909. });
  24910. exports.default = tokenizeInlineComment;
  24911. function tokenizeInlineComment(state) {
  24912. state.nextPos = state.css.indexOf('\n', state.pos + 2) - 1;
  24913. if (state.nextPos === -2) {
  24914. state.nextPos = state.css.length - 1;
  24915. }
  24916. state.tokens.push(['comment', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset, 'inline']);
  24917. state.pos = state.nextPos;
  24918. }
  24919. module.exports = exports['default'];
  24920. /***/ }),
  24921. /* 159 */
  24922. /***/ (function(module, exports, __webpack_require__) {
  24923. "use strict";
  24924. Object.defineProperty(exports, "__esModule", {
  24925. value: true
  24926. });
  24927. exports.default = tokenizeMultilineComment;
  24928. var _unclosed = __webpack_require__(13);
  24929. var _unclosed2 = _interopRequireDefault(_unclosed);
  24930. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24931. function tokenizeMultilineComment(state) {
  24932. state.nextPos = state.css.indexOf('*/', state.pos + 2) + 1;
  24933. if (state.nextPos === 0) {
  24934. (0, _unclosed2.default)(state, 'comment');
  24935. }
  24936. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  24937. state.lines = state.cssPart.split('\n');
  24938. state.lastLine = state.lines.length - 1;
  24939. if (state.lastLine > 0) {
  24940. state.nextLine = state.line + state.lastLine;
  24941. state.nextOffset = state.nextPos - state.lines[state.lastLine].length;
  24942. } else {
  24943. state.nextLine = state.line;
  24944. state.nextOffset = state.offset;
  24945. }
  24946. state.tokens.push(['comment', state.cssPart, state.line, state.pos - state.offset, state.nextLine, state.nextPos - state.nextOffset]);
  24947. state.offset = state.nextOffset;
  24948. state.line = state.nextLine;
  24949. state.pos = state.nextPos;
  24950. }
  24951. module.exports = exports['default'];
  24952. /***/ }),
  24953. /* 160 */
  24954. /***/ (function(module, exports, __webpack_require__) {
  24955. "use strict";
  24956. Object.defineProperty(exports, "__esModule", {
  24957. value: true
  24958. });
  24959. exports.default = tokenizeOpenedParenthesis;
  24960. var _globals = __webpack_require__(3);
  24961. var _unclosed = __webpack_require__(13);
  24962. var _unclosed2 = _interopRequireDefault(_unclosed);
  24963. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24964. function findClosedParenthesisPosition(css, length, start) {
  24965. var openedParenthesisCount = 0;
  24966. for (var i = start; i < length; i++) {
  24967. var symbol = css[i];
  24968. if (symbol === '(') {
  24969. openedParenthesisCount++;
  24970. } else if (symbol === ')') {
  24971. openedParenthesisCount--;
  24972. if (!openedParenthesisCount) {
  24973. return i;
  24974. }
  24975. }
  24976. }
  24977. return -1;
  24978. }
  24979. // it is not very reasonable to reduce complexity beyond this level
  24980. // eslint-disable-next-line complexity
  24981. function tokenizeOpenedParenthesis(state) {
  24982. var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
  24983. var tokensCount = state.tokens.length;
  24984. var prevTokenCssPart = tokensCount ? state.tokens[tokensCount - 1][1] : '';
  24985. if (prevTokenCssPart === 'url' && nextSymbolCode !== _globals.singleQuote && nextSymbolCode !== _globals.doubleQuote && nextSymbolCode !== _globals.space && nextSymbolCode !== _globals.newline && nextSymbolCode !== _globals.tab && nextSymbolCode !== _globals.feed && nextSymbolCode !== _globals.carriageReturn) {
  24986. state.nextPos = state.pos;
  24987. do {
  24988. state.escaped = false;
  24989. state.nextPos = state.css.indexOf(')', state.nextPos + 1);
  24990. if (state.nextPos === -1) {
  24991. (0, _unclosed2.default)(state, 'bracket');
  24992. }
  24993. state.escapePos = state.nextPos;
  24994. while (state.css.charCodeAt(state.escapePos - 1) === _globals.backslash) {
  24995. state.escapePos -= 1;
  24996. state.escaped = !state.escaped;
  24997. }
  24998. } while (state.escaped);
  24999. state.tokens.push(['brackets', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  25000. state.pos = state.nextPos;
  25001. } else {
  25002. state.nextPos = findClosedParenthesisPosition(state.css, state.length, state.pos);
  25003. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  25004. var foundParam = state.cssPart.indexOf('@') >= 0;
  25005. var foundString = /['"]/.test(state.cssPart);
  25006. if (state.cssPart.length === 0 || state.cssPart === '...' || foundParam && !foundString) {
  25007. // we're dealing with a mixin param block
  25008. if (state.nextPos === -1) {
  25009. (0, _unclosed2.default)(state, 'bracket');
  25010. }
  25011. state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);
  25012. } else {
  25013. var badBracket = _globals.badBracketPattern.test(state.cssPart);
  25014. if (state.nextPos === -1 || badBracket) {
  25015. state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);
  25016. } else {
  25017. state.tokens.push(['brackets', state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  25018. state.pos = state.nextPos;
  25019. }
  25020. }
  25021. }
  25022. }
  25023. module.exports = exports['default'];
  25024. /***/ }),
  25025. /* 161 */
  25026. /***/ (function(module, exports, __webpack_require__) {
  25027. "use strict";
  25028. Object.defineProperty(exports, "__esModule", {
  25029. value: true
  25030. });
  25031. exports.default = tokenizeQuotes;
  25032. var _globals = __webpack_require__(3);
  25033. var _unclosed = __webpack_require__(13);
  25034. var _unclosed2 = _interopRequireDefault(_unclosed);
  25035. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25036. function tokenizeQuotes(state) {
  25037. state.nextPos = state.pos;
  25038. do {
  25039. state.escaped = false;
  25040. state.nextPos = state.css.indexOf(state.symbol, state.nextPos + 1);
  25041. if (state.nextPos === -1) {
  25042. (0, _unclosed2.default)(state, 'quote');
  25043. }
  25044. state.escapePos = state.nextPos;
  25045. while (state.css.charCodeAt(state.escapePos - 1) === _globals.backslash) {
  25046. state.escapePos -= 1;
  25047. state.escaped = !state.escaped;
  25048. }
  25049. } while (state.escaped);
  25050. state.tokens.push(['string', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  25051. state.pos = state.nextPos;
  25052. }
  25053. module.exports = exports['default'];
  25054. /***/ }),
  25055. /* 162 */
  25056. /***/ (function(module, exports, __webpack_require__) {
  25057. "use strict";
  25058. Object.defineProperty(exports, "__esModule", {
  25059. value: true
  25060. });
  25061. exports.default = tokenizeSymbol;
  25062. var _globals = __webpack_require__(3);
  25063. var _tokenizeAtRule = __webpack_require__(153);
  25064. var _tokenizeAtRule2 = _interopRequireDefault(_tokenizeAtRule);
  25065. var _tokenizeBackslash = __webpack_require__(154);
  25066. var _tokenizeBackslash2 = _interopRequireDefault(_tokenizeBackslash);
  25067. var _tokenizeBasicSymbol = __webpack_require__(155);
  25068. var _tokenizeBasicSymbol2 = _interopRequireDefault(_tokenizeBasicSymbol);
  25069. var _tokenizeComma = __webpack_require__(156);
  25070. var _tokenizeComma2 = _interopRequireDefault(_tokenizeComma);
  25071. var _tokenizeDefault = __webpack_require__(157);
  25072. var _tokenizeDefault2 = _interopRequireDefault(_tokenizeDefault);
  25073. var _tokenizeOpenedParenthesis = __webpack_require__(160);
  25074. var _tokenizeOpenedParenthesis2 = _interopRequireDefault(_tokenizeOpenedParenthesis);
  25075. var _tokenizeQuotes = __webpack_require__(161);
  25076. var _tokenizeQuotes2 = _interopRequireDefault(_tokenizeQuotes);
  25077. var _tokenizeWhitespace = __webpack_require__(163);
  25078. var _tokenizeWhitespace2 = _interopRequireDefault(_tokenizeWhitespace);
  25079. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25080. // we cannot reduce complexity beyond this level
  25081. // eslint-disable-next-line complexity
  25082. function tokenizeSymbol(state) {
  25083. switch (state.symbolCode) {
  25084. case _globals.newline:
  25085. case _globals.space:
  25086. case _globals.tab:
  25087. case _globals.carriageReturn:
  25088. case _globals.feed:
  25089. (0, _tokenizeWhitespace2.default)(state);
  25090. break;
  25091. case _globals.comma:
  25092. (0, _tokenizeComma2.default)(state);
  25093. break;
  25094. case _globals.colon:
  25095. case _globals.semicolon:
  25096. case _globals.openedCurlyBracket:
  25097. case _globals.closedCurlyBracket:
  25098. case _globals.closedParenthesis:
  25099. case _globals.openSquareBracket:
  25100. case _globals.closeSquareBracket:
  25101. (0, _tokenizeBasicSymbol2.default)(state);
  25102. break;
  25103. case _globals.openedParenthesis:
  25104. (0, _tokenizeOpenedParenthesis2.default)(state);
  25105. break;
  25106. case _globals.singleQuote:
  25107. case _globals.doubleQuote:
  25108. (0, _tokenizeQuotes2.default)(state);
  25109. break;
  25110. case _globals.atRule:
  25111. (0, _tokenizeAtRule2.default)(state);
  25112. break;
  25113. case _globals.backslash:
  25114. (0, _tokenizeBackslash2.default)(state);
  25115. break;
  25116. default:
  25117. (0, _tokenizeDefault2.default)(state);
  25118. break;
  25119. }
  25120. }
  25121. module.exports = exports['default'];
  25122. /***/ }),
  25123. /* 163 */
  25124. /***/ (function(module, exports, __webpack_require__) {
  25125. "use strict";
  25126. Object.defineProperty(exports, "__esModule", {
  25127. value: true
  25128. });
  25129. exports.default = tokenizeWhitespace;
  25130. var _globals = __webpack_require__(3);
  25131. function tokenizeWhitespace(state) {
  25132. state.nextPos = state.pos;
  25133. // collect all neighbour space symbols
  25134. do {
  25135. state.nextPos += 1;
  25136. state.symbolCode = state.css.charCodeAt(state.nextPos);
  25137. if (state.symbolCode === _globals.newline) {
  25138. state.offset = state.nextPos;
  25139. state.line += 1;
  25140. }
  25141. } while (state.symbolCode === _globals.space || state.symbolCode === _globals.newline || state.symbolCode === _globals.tab || state.symbolCode === _globals.carriageReturn || state.symbolCode === _globals.feed);
  25142. state.tokens.push(['space', state.css.slice(state.pos, state.nextPos)]);
  25143. state.pos = state.nextPos - 1;
  25144. }
  25145. module.exports = exports['default'];
  25146. /***/ }),
  25147. /* 164 */
  25148. /***/ (function(module, exports, __webpack_require__) {
  25149. "use strict";
  25150. Object.defineProperty(exports, "__esModule", {
  25151. value: true
  25152. });
  25153. exports.parseMediaFeature = parseMediaFeature;
  25154. exports.parseMediaQuery = parseMediaQuery;
  25155. exports.parseMediaList = parseMediaList;
  25156. var _Node = __webpack_require__(53);
  25157. var _Node2 = _interopRequireDefault(_Node);
  25158. var _Container = __webpack_require__(52);
  25159. var _Container2 = _interopRequireDefault(_Container);
  25160. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25161. /**
  25162. * Parses a media feature expression, e.g. `max-width: 10px`, `(color)`
  25163. *
  25164. * @param {string} string - the source expression string, can be inside parens
  25165. * @param {Number} index - the index of `string` in the overall input
  25166. *
  25167. * @return {Array} an array of Nodes, the first element being a media feature,
  25168. * the secont - its value (may be missing)
  25169. */
  25170. function parseMediaFeature(string) {
  25171. var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  25172. var modesEntered = [{
  25173. mode: 'normal',
  25174. character: null
  25175. }];
  25176. var result = [];
  25177. var lastModeIndex = 0;
  25178. var mediaFeature = '';
  25179. var colon = null;
  25180. var mediaFeatureValue = null;
  25181. var indexLocal = index;
  25182. var stringNormalized = string;
  25183. // Strip trailing parens (if any), and correct the starting index
  25184. if (string[0] === '(' && string[string.length - 1] === ')') {
  25185. stringNormalized = string.substring(1, string.length - 1);
  25186. indexLocal++;
  25187. }
  25188. for (var i = 0; i < stringNormalized.length; i++) {
  25189. var character = stringNormalized[i];
  25190. // If entering/exiting a string
  25191. if (character === '\'' || character === '"') {
  25192. if (modesEntered[lastModeIndex].isCalculationEnabled === true) {
  25193. modesEntered.push({
  25194. mode: 'string',
  25195. isCalculationEnabled: false,
  25196. character: character
  25197. });
  25198. lastModeIndex++;
  25199. } else if (modesEntered[lastModeIndex].mode === 'string' && modesEntered[lastModeIndex].character === character && stringNormalized[i - 1] !== '\\') {
  25200. modesEntered.pop();
  25201. lastModeIndex--;
  25202. }
  25203. }
  25204. // If entering/exiting interpolation
  25205. if (character === '{') {
  25206. modesEntered.push({
  25207. mode: 'interpolation',
  25208. isCalculationEnabled: true
  25209. });
  25210. lastModeIndex++;
  25211. } else if (character === '}') {
  25212. modesEntered.pop();
  25213. lastModeIndex--;
  25214. }
  25215. // If a : is met outside of a string, function call or interpolation, than
  25216. // this : separates a media feature and a value
  25217. if (modesEntered[lastModeIndex].mode === 'normal' && character === ':') {
  25218. var mediaFeatureValueStr = stringNormalized.substring(i + 1);
  25219. mediaFeatureValue = {
  25220. type: 'value',
  25221. before: /^(\s*)/.exec(mediaFeatureValueStr)[1],
  25222. after: /(\s*)$/.exec(mediaFeatureValueStr)[1],
  25223. value: mediaFeatureValueStr.trim()
  25224. };
  25225. // +1 for the colon
  25226. mediaFeatureValue.sourceIndex = mediaFeatureValue.before.length + i + 1 + indexLocal;
  25227. colon = {
  25228. type: 'colon',
  25229. sourceIndex: i + indexLocal,
  25230. after: mediaFeatureValue.before,
  25231. value: ':' };
  25232. break;
  25233. }
  25234. mediaFeature += character;
  25235. }
  25236. // Forming a media feature node
  25237. mediaFeature = {
  25238. type: 'media-feature',
  25239. before: /^(\s*)/.exec(mediaFeature)[1],
  25240. after: /(\s*)$/.exec(mediaFeature)[1],
  25241. value: mediaFeature.trim()
  25242. };
  25243. mediaFeature.sourceIndex = mediaFeature.before.length + indexLocal;
  25244. result.push(mediaFeature);
  25245. if (colon !== null) {
  25246. colon.before = mediaFeature.after;
  25247. result.push(colon);
  25248. }
  25249. if (mediaFeatureValue !== null) {
  25250. result.push(mediaFeatureValue);
  25251. }
  25252. return result;
  25253. }
  25254. /**
  25255. * Parses a media query, e.g. `screen and (color)`, `only tv`
  25256. *
  25257. * @param {string} string - the source media query string
  25258. * @param {Number} index - the index of `string` in the overall input
  25259. *
  25260. * @return {Array} an array of Nodes and Containers
  25261. */
  25262. function parseMediaQuery(string) {
  25263. var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  25264. var result = [];
  25265. // How many timies the parser entered parens/curly braces
  25266. var localLevel = 0;
  25267. // Has any keyword, media type, media feature expression or interpolation
  25268. // ('element' hereafter) started
  25269. var insideSomeValue = false;
  25270. var node = void 0;
  25271. function resetNode() {
  25272. return {
  25273. before: '',
  25274. after: '',
  25275. value: ''
  25276. };
  25277. }
  25278. node = resetNode();
  25279. for (var i = 0; i < string.length; i++) {
  25280. var character = string[i];
  25281. // If not yet entered any element
  25282. if (!insideSomeValue) {
  25283. if (character.search(/\s/) !== -1) {
  25284. // A whitespace
  25285. // Don't form 'after' yet; will do it later
  25286. node.before += character;
  25287. } else {
  25288. // Not a whitespace - entering an element
  25289. // Expression start
  25290. if (character === '(') {
  25291. node.type = 'media-feature-expression';
  25292. localLevel++;
  25293. }
  25294. node.value = character;
  25295. node.sourceIndex = index + i;
  25296. insideSomeValue = true;
  25297. }
  25298. } else {
  25299. // Already in the middle of some alement
  25300. node.value += character;
  25301. // Here parens just increase localLevel and don't trigger a start of
  25302. // a media feature expression (since they can't be nested)
  25303. // Interpolation start
  25304. if (character === '{' || character === '(') {
  25305. localLevel++;
  25306. }
  25307. // Interpolation/function call/media feature expression end
  25308. if (character === ')' || character === '}') {
  25309. localLevel--;
  25310. }
  25311. }
  25312. // If exited all parens/curlies and the next symbol
  25313. if (insideSomeValue && localLevel === 0 && (character === ')' || i === string.length - 1 || string[i + 1].search(/\s/) !== -1)) {
  25314. if (['not', 'only', 'and'].indexOf(node.value) !== -1) {
  25315. node.type = 'keyword';
  25316. }
  25317. // if it's an expression, parse its contents
  25318. if (node.type === 'media-feature-expression') {
  25319. node.nodes = parseMediaFeature(node.value, node.sourceIndex);
  25320. }
  25321. result.push(Array.isArray(node.nodes) ? new _Container2.default(node) : new _Node2.default(node));
  25322. node = resetNode();
  25323. insideSomeValue = false;
  25324. }
  25325. }
  25326. // Now process the result array - to specify undefined types of the nodes
  25327. // and specify the `after` prop
  25328. for (var _i = 0; _i < result.length; _i++) {
  25329. node = result[_i];
  25330. if (_i > 0) {
  25331. result[_i - 1].after = node.before;
  25332. }
  25333. // Node types. Might not be set because contains interpolation/function
  25334. // calls or fully consists of them
  25335. if (node.type === undefined) {
  25336. if (_i > 0) {
  25337. // only `and` can follow an expression
  25338. if (result[_i - 1].type === 'media-feature-expression') {
  25339. node.type = 'keyword';
  25340. continue;
  25341. }
  25342. // Anything after 'only|not' is a media type
  25343. if (result[_i - 1].value === 'not' || result[_i - 1].value === 'only') {
  25344. node.type = 'media-type';
  25345. continue;
  25346. }
  25347. // Anything after 'and' is an expression
  25348. if (result[_i - 1].value === 'and') {
  25349. node.type = 'media-feature-expression';
  25350. continue;
  25351. }
  25352. if (result[_i - 1].type === 'media-type') {
  25353. // if it is the last element - it might be an expression
  25354. // or 'and' depending on what is after it
  25355. if (!result[_i + 1]) {
  25356. node.type = 'media-feature-expression';
  25357. } else {
  25358. node.type = result[_i + 1].type === 'media-feature-expression' ? 'keyword' : 'media-feature-expression';
  25359. }
  25360. }
  25361. }
  25362. if (_i === 0) {
  25363. // `screen`, `fn( ... )`, `#{ ... }`. Not an expression, since then
  25364. // its type would have been set by now
  25365. if (!result[_i + 1]) {
  25366. node.type = 'media-type';
  25367. continue;
  25368. }
  25369. // `screen and` or `#{...} (max-width: 10px)`
  25370. if (result[_i + 1] && (result[_i + 1].type === 'media-feature-expression' || result[_i + 1].type === 'keyword')) {
  25371. node.type = 'media-type';
  25372. continue;
  25373. }
  25374. if (result[_i + 2]) {
  25375. // `screen and (color) ...`
  25376. if (result[_i + 2].type === 'media-feature-expression') {
  25377. node.type = 'media-type';
  25378. result[_i + 1].type = 'keyword';
  25379. continue;
  25380. }
  25381. // `only screen and ...`
  25382. if (result[_i + 2].type === 'keyword') {
  25383. node.type = 'keyword';
  25384. result[_i + 1].type = 'media-type';
  25385. continue;
  25386. }
  25387. }
  25388. if (result[_i + 3]) {
  25389. // `screen and (color) ...`
  25390. if (result[_i + 3].type === 'media-feature-expression') {
  25391. node.type = 'keyword';
  25392. result[_i + 1].type = 'media-type';
  25393. result[_i + 2].type = 'keyword';
  25394. continue;
  25395. }
  25396. }
  25397. }
  25398. }
  25399. }
  25400. return result;
  25401. }
  25402. /**
  25403. * Parses a media query list. Takes a possible `url()` at the start into
  25404. * account, and divides the list into media queries that are parsed separately
  25405. *
  25406. * @param {string} string - the source media query list string
  25407. *
  25408. * @return {Array} an array of Nodes/Containers
  25409. */
  25410. function parseMediaList(string) {
  25411. var result = [];
  25412. var interimIndex = 0;
  25413. var levelLocal = 0;
  25414. // Check for a `url(...)` part (if it is contents of an @import rule)
  25415. var doesHaveUrl = /^(\s*)url\s*\(/.exec(string);
  25416. if (doesHaveUrl !== null) {
  25417. var i = doesHaveUrl[0].length;
  25418. var parenthesesLv = 1;
  25419. while (parenthesesLv > 0) {
  25420. var character = string[i];
  25421. if (character === '(') {
  25422. parenthesesLv++;
  25423. }
  25424. if (character === ')') {
  25425. parenthesesLv--;
  25426. }
  25427. i++;
  25428. }
  25429. result.unshift(new _Node2.default({
  25430. type: 'url',
  25431. value: string.substring(0, i).trim(),
  25432. sourceIndex: doesHaveUrl[1].length,
  25433. before: doesHaveUrl[1],
  25434. after: /^(\s*)/.exec(string.substring(i))[1]
  25435. }));
  25436. interimIndex = i;
  25437. }
  25438. // Start processing the media query list
  25439. for (var _i2 = interimIndex; _i2 < string.length; _i2++) {
  25440. var _character = string[_i2];
  25441. // Dividing the media query list into comma-separated media queries
  25442. // Only count commas that are outside of any parens
  25443. // (i.e., not part of function call params list, etc.)
  25444. if (_character === '(') {
  25445. levelLocal++;
  25446. }
  25447. if (_character === ')') {
  25448. levelLocal--;
  25449. }
  25450. if (levelLocal === 0 && _character === ',') {
  25451. var _mediaQueryString = string.substring(interimIndex, _i2);
  25452. var _spaceBefore = /^(\s*)/.exec(_mediaQueryString)[1];
  25453. result.push(new _Container2.default({
  25454. type: 'media-query',
  25455. value: _mediaQueryString.trim(),
  25456. sourceIndex: interimIndex + _spaceBefore.length,
  25457. nodes: parseMediaQuery(_mediaQueryString, interimIndex),
  25458. before: _spaceBefore,
  25459. after: /(\s*)$/.exec(_mediaQueryString)[1]
  25460. }));
  25461. interimIndex = _i2 + 1;
  25462. }
  25463. }
  25464. var mediaQueryString = string.substring(interimIndex);
  25465. var spaceBefore = /^(\s*)/.exec(mediaQueryString)[1];
  25466. result.push(new _Container2.default({
  25467. type: 'media-query',
  25468. value: mediaQueryString.trim(),
  25469. sourceIndex: interimIndex + spaceBefore.length,
  25470. nodes: parseMediaQuery(mediaQueryString, interimIndex),
  25471. before: spaceBefore,
  25472. after: /(\s*)$/.exec(mediaQueryString)[1]
  25473. }));
  25474. return result;
  25475. }
  25476. /***/ }),
  25477. /* 165 */
  25478. /***/ (function(module, exports, __webpack_require__) {
  25479. "use strict";
  25480. exports.__esModule = true;
  25481. var _container = __webpack_require__(22);
  25482. var _container2 = _interopRequireDefault(_container);
  25483. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25484. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25485. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  25486. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  25487. var NestedDeclaration = function (_Container) {
  25488. _inherits(NestedDeclaration, _Container);
  25489. function NestedDeclaration(defaults) {
  25490. _classCallCheck(this, NestedDeclaration);
  25491. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  25492. _this.type = 'decl';
  25493. _this.isNested = true;
  25494. if (!_this.nodes) _this.nodes = [];
  25495. return _this;
  25496. }
  25497. return NestedDeclaration;
  25498. }(_container2.default);
  25499. exports.default = NestedDeclaration;
  25500. module.exports = exports['default'];
  25501. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5lc3RlZC1kZWNsYXJhdGlvbi5lczYiXSwibmFtZXMiOlsiTmVzdGVkRGVjbGFyYXRpb24iLCJkZWZhdWx0cyIsInR5cGUiLCJpc05lc3RlZCIsIm5vZGVzIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7Ozs7OztJQUVNQSxpQjs7O0FBRUYsK0JBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsc0JBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQUwsR0FBZ0IsTUFBaEI7QUFDQSxjQUFLQyxRQUFMLEdBQWdCLElBQWhCO0FBQ0EsWUFBSyxDQUFDLE1BQUtDLEtBQVgsRUFBbUIsTUFBS0EsS0FBTCxHQUFhLEVBQWI7QUFKRDtBQUtyQjs7Ozs7a0JBSVVKLGlCIiwiZmlsZSI6Im5lc3RlZC1kZWNsYXJhdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb250YWluZXIgZnJvbSAncG9zdGNzcy9saWIvY29udGFpbmVyJztcblxuY2xhc3MgTmVzdGVkRGVjbGFyYXRpb24gZXh0ZW5kcyBDb250YWluZXIge1xuXG4gICAgY29uc3RydWN0b3IoZGVmYXVsdHMpIHtcbiAgICAgICAgc3VwZXIoZGVmYXVsdHMpO1xuICAgICAgICB0aGlzLnR5cGUgICAgID0gJ2RlY2wnO1xuICAgICAgICB0aGlzLmlzTmVzdGVkID0gdHJ1ZTtcbiAgICAgICAgaWYgKCAhdGhpcy5ub2RlcyApIHRoaXMubm9kZXMgPSBbXTtcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgTmVzdGVkRGVjbGFyYXRpb247XG4iXX0=
  25502. /***/ }),
  25503. /* 166 */
  25504. /***/ (function(module, exports, __webpack_require__) {
  25505. "use strict";
  25506. exports.__esModule = true;
  25507. exports.default = scssParse;
  25508. var _input = __webpack_require__(29);
  25509. var _input2 = _interopRequireDefault(_input);
  25510. var _scssParser = __webpack_require__(167);
  25511. var _scssParser2 = _interopRequireDefault(_scssParser);
  25512. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25513. function scssParse(scss, opts) {
  25514. var input = new _input2.default(scss, opts);
  25515. var parser = new _scssParser2.default(input);
  25516. parser.parse();
  25517. return parser.root;
  25518. }
  25519. module.exports = exports['default'];
  25520. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtcGFyc2UuZXM2Il0sIm5hbWVzIjpbInNjc3NQYXJzZSIsInNjc3MiLCJvcHRzIiwiaW5wdXQiLCJwYXJzZXIiLCJwYXJzZSIsInJvb3QiXSwibWFwcGluZ3MiOiI7OztrQkFJd0JBLFM7O0FBSnhCOzs7O0FBRUE7Ozs7OztBQUVlLFNBQVNBLFNBQVQsQ0FBbUJDLElBQW5CLEVBQXlCQyxJQUF6QixFQUErQjtBQUMxQyxRQUFJQyxRQUFRLG9CQUFVRixJQUFWLEVBQWdCQyxJQUFoQixDQUFaOztBQUVBLFFBQUlFLFNBQVMseUJBQWVELEtBQWYsQ0FBYjtBQUNBQyxXQUFPQyxLQUFQOztBQUVBLFdBQU9ELE9BQU9FLElBQWQ7QUFDSCIsImZpbGUiOiJzY3NzLXBhcnNlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IElucHV0IGZyb20gJ3Bvc3Rjc3MvbGliL2lucHV0JztcblxuaW1wb3J0IFNjc3NQYXJzZXIgZnJvbSAnLi9zY3NzLXBhcnNlcic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHNjc3NQYXJzZShzY3NzLCBvcHRzKSB7XG4gICAgbGV0IGlucHV0ID0gbmV3IElucHV0KHNjc3MsIG9wdHMpO1xuXG4gICAgbGV0IHBhcnNlciA9IG5ldyBTY3NzUGFyc2VyKGlucHV0KTtcbiAgICBwYXJzZXIucGFyc2UoKTtcblxuICAgIHJldHVybiBwYXJzZXIucm9vdDtcbn1cbiJdfQ==
  25521. /***/ }),
  25522. /* 167 */
  25523. /***/ (function(module, exports, __webpack_require__) {
  25524. "use strict";
  25525. exports.__esModule = true;
  25526. var _comment = __webpack_require__(28);
  25527. var _comment2 = _interopRequireDefault(_comment);
  25528. var _parser = __webpack_require__(58);
  25529. var _parser2 = _interopRequireDefault(_parser);
  25530. var _nestedDeclaration = __webpack_require__(165);
  25531. var _nestedDeclaration2 = _interopRequireDefault(_nestedDeclaration);
  25532. var _scssTokenize = __webpack_require__(170);
  25533. var _scssTokenize2 = _interopRequireDefault(_scssTokenize);
  25534. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25535. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25536. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  25537. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  25538. var ScssParser = function (_Parser) {
  25539. _inherits(ScssParser, _Parser);
  25540. function ScssParser() {
  25541. _classCallCheck(this, ScssParser);
  25542. return _possibleConstructorReturn(this, _Parser.apply(this, arguments));
  25543. }
  25544. ScssParser.prototype.createTokenizer = function createTokenizer() {
  25545. this.tokenizer = (0, _scssTokenize2.default)(this.input);
  25546. };
  25547. ScssParser.prototype.rule = function rule(tokens) {
  25548. var withColon = false;
  25549. var brackets = 0;
  25550. var value = '';
  25551. for (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  25552. var _ref;
  25553. if (_isArray) {
  25554. if (_i >= _iterator.length) break;
  25555. _ref = _iterator[_i++];
  25556. } else {
  25557. _i = _iterator.next();
  25558. if (_i.done) break;
  25559. _ref = _i.value;
  25560. }
  25561. var i = _ref;
  25562. if (withColon) {
  25563. if (i[0] !== 'comment' && i[0] !== '{') {
  25564. value += i[1];
  25565. }
  25566. } else if (i[0] === 'space' && i[1].indexOf('\n') !== -1) {
  25567. break;
  25568. } else if (i[0] === '(') {
  25569. brackets += 1;
  25570. } else if (i[0] === ')') {
  25571. brackets -= 1;
  25572. } else if (brackets === 0 && i[0] === ':') {
  25573. withColon = true;
  25574. }
  25575. }
  25576. if (!withColon || value.trim() === '' || /^[a-zA-Z-:#]/.test(value)) {
  25577. _Parser.prototype.rule.call(this, tokens);
  25578. } else {
  25579. tokens.pop();
  25580. var node = new _nestedDeclaration2.default();
  25581. this.init(node);
  25582. var last = tokens[tokens.length - 1];
  25583. if (last[4]) {
  25584. node.source.end = { line: last[4], column: last[5] };
  25585. } else {
  25586. node.source.end = { line: last[2], column: last[3] };
  25587. }
  25588. while (tokens[0][0] !== 'word') {
  25589. node.raws.before += tokens.shift()[1];
  25590. }
  25591. node.source.start = { line: tokens[0][2], column: tokens[0][3] };
  25592. node.prop = '';
  25593. while (tokens.length) {
  25594. var type = tokens[0][0];
  25595. if (type === ':' || type === 'space' || type === 'comment') {
  25596. break;
  25597. }
  25598. node.prop += tokens.shift()[1];
  25599. }
  25600. node.raws.between = '';
  25601. var token = void 0;
  25602. while (tokens.length) {
  25603. token = tokens.shift();
  25604. if (token[0] === ':') {
  25605. node.raws.between += token[1];
  25606. break;
  25607. } else {
  25608. node.raws.between += token[1];
  25609. }
  25610. }
  25611. if (node.prop[0] === '_' || node.prop[0] === '*') {
  25612. node.raws.before += node.prop[0];
  25613. node.prop = node.prop.slice(1);
  25614. }
  25615. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  25616. this.precheckMissedSemicolon(tokens);
  25617. for (var _i2 = tokens.length - 1; _i2 > 0; _i2--) {
  25618. token = tokens[_i2];
  25619. if (token[1] === '!important') {
  25620. node.important = true;
  25621. var string = this.stringFrom(tokens, _i2);
  25622. string = this.spacesFromEnd(tokens) + string;
  25623. if (string !== ' !important') {
  25624. node.raws.important = string;
  25625. }
  25626. break;
  25627. } else if (token[1] === 'important') {
  25628. var cache = tokens.slice(0);
  25629. var str = '';
  25630. for (var j = _i2; j > 0; j--) {
  25631. var _type = cache[j][0];
  25632. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  25633. break;
  25634. }
  25635. str = cache.pop()[1] + str;
  25636. }
  25637. if (str.trim().indexOf('!') === 0) {
  25638. node.important = true;
  25639. node.raws.important = str;
  25640. tokens = cache;
  25641. }
  25642. }
  25643. if (token[0] !== 'space' && token[0] !== 'comment') {
  25644. break;
  25645. }
  25646. }
  25647. this.raw(node, 'value', tokens);
  25648. if (node.value.indexOf(':') !== -1) {
  25649. this.checkMissedSemicolon(tokens);
  25650. }
  25651. this.current = node;
  25652. }
  25653. };
  25654. ScssParser.prototype.comment = function comment(token) {
  25655. if (token[6] === 'inline') {
  25656. var node = new _comment2.default();
  25657. this.init(node, token[2], token[3]);
  25658. node.raws.inline = true;
  25659. node.source.end = { line: token[4], column: token[5] };
  25660. var text = token[1].slice(2);
  25661. if (/^\s*$/.test(text)) {
  25662. node.text = '';
  25663. node.raws.left = text;
  25664. node.raws.right = '';
  25665. } else {
  25666. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  25667. var fixed = match[2].replace(/(\*\/|\/\*)/g, '*//*');
  25668. node.text = fixed;
  25669. node.raws.left = match[1];
  25670. node.raws.right = match[3];
  25671. node.raws.text = match[2];
  25672. }
  25673. } else {
  25674. _Parser.prototype.comment.call(this, token);
  25675. }
  25676. };
  25677. ScssParser.prototype.raw = function raw(node, prop, tokens) {
  25678. _Parser.prototype.raw.call(this, node, prop, tokens);
  25679. if (node.raws[prop]) {
  25680. var scss = node.raws[prop].raw;
  25681. node.raws[prop].raw = tokens.reduce(function (all, i) {
  25682. if (i[0] === 'comment' && i[6] === 'inline') {
  25683. var text = i[1].slice(2).replace(/(\*\/|\/\*)/g, '*//*');
  25684. return all + '/*' + text + '*/';
  25685. } else {
  25686. return all + i[1];
  25687. }
  25688. }, '');
  25689. if (scss !== node.raws[prop].raw) {
  25690. node.raws[prop].scss = scss;
  25691. }
  25692. }
  25693. };
  25694. return ScssParser;
  25695. }(_parser2.default);
  25696. exports.default = ScssParser;
  25697. module.exports = exports['default'];
  25698. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtcGFyc2VyLmVzNiJdLCJuYW1lcyI6WyJTY3NzUGFyc2VyIiwiY3JlYXRlVG9rZW5pemVyIiwidG9rZW5pemVyIiwiaW5wdXQiLCJydWxlIiwidG9rZW5zIiwid2l0aENvbG9uIiwiYnJhY2tldHMiLCJ2YWx1ZSIsImkiLCJpbmRleE9mIiwidHJpbSIsInRlc3QiLCJwb3AiLCJub2RlIiwiaW5pdCIsImxhc3QiLCJsZW5ndGgiLCJzb3VyY2UiLCJlbmQiLCJsaW5lIiwiY29sdW1uIiwicmF3cyIsImJlZm9yZSIsInNoaWZ0Iiwic3RhcnQiLCJwcm9wIiwidHlwZSIsImJldHdlZW4iLCJ0b2tlbiIsInNsaWNlIiwic3BhY2VzQW5kQ29tbWVudHNGcm9tU3RhcnQiLCJwcmVjaGVja01pc3NlZFNlbWljb2xvbiIsImltcG9ydGFudCIsInN0cmluZyIsInN0cmluZ0Zyb20iLCJzcGFjZXNGcm9tRW5kIiwiY2FjaGUiLCJzdHIiLCJqIiwicmF3IiwiY2hlY2tNaXNzZWRTZW1pY29sb24iLCJjdXJyZW50IiwiY29tbWVudCIsImlubGluZSIsInRleHQiLCJsZWZ0IiwicmlnaHQiLCJtYXRjaCIsImZpeGVkIiwicmVwbGFjZSIsInNjc3MiLCJyZWR1Y2UiLCJhbGwiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUNBOzs7O0FBRUE7Ozs7QUFDQTs7Ozs7Ozs7Ozs7O0lBRXFCQSxVOzs7Ozs7Ozs7eUJBRWpCQyxlLDhCQUFrQjtBQUNkLGFBQUtDLFNBQ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B1dCk7XG4gICAgfVxuXG4gICAgcnVsZSh0b2tlbnMpIHtcbiAgICAgICAgbGV0IHdpdGhDb2xvbiA9IGZhbHNlO1xuICAgICAgICBsZXQgYnJhY2tldHMgID0gMDtcbiAgICAgICAgbGV0IHZhbHVlICAgICA9ICcnO1xuICAgICAgICBmb3IgKCBsZXQgaSBvZiB0b2tlbnMgKSB7XG4gICAgICAgICAgICBpZiAoIHdpdGhDb2xvbiApIHtcbiAgICAgICAgICAgICAgICBpZiAoIGlbMF0gIT09ICdjb21tZW50JyAmJiBpWzBdICE9PSAneycgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlICs9IGlbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggaVswXSA9PT0gJ3NwYWNlJyAmJiBpWzFdLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGlbMF0gPT09ICcoJyApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggaVswXSA9PT0gJyknICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzIC09IDE7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cyA9PT0gMCAmJiBpWzBdID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgd2l0aENvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggIXdpdGhDb2xvbiB8fCB2YWx1ZS50cmltKCkgPT09ICcnIHx8IC9eW2EtekEtWi06I10vLnRlc3QodmFsdWUpICkge1xuICAgICAgICAgICAgc3VwZXIucnVsZSh0b2tlbnMpO1xuICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICB0b2tlbnMucG9wKCk7XG4gICAgICAgICAgICBsZXQgbm9kZSA9IG5ldyBOZXN0ZWREZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgdGhpcy5pbml0KG5vZGUpO1xuXG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBpZiAobGFzdFs0XSkge1xuICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFs0XSwgY29sdW1uOiBsYXN0WzVdIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFsyXSwgY29sdW1uOiBsYXN0WzNdIH07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdoaWxlICh0b2tlbnNbMF1bMF0gIT09ICd3b3JkJykge1xuICAgICAgICAgICAgICAgIG5vZGUucmF3cy5iZWZvcmUgKz0gdG9rZW5zLnNoaWZ0KClbMV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnNvdXJjZS5zdGFydCA9IHsgbGluZTogdG9rZW5zWzBdWzJdLCBjb2x1bW46IHRva2Vuc1swXVszXSB9O1xuXG4gICAgICAgICAgICBub2RlLnByb3AgPSAnJztcbiAgICAgICAgICAgIHdoaWxlICh0b2tlbnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSB0b2tlbnNbMF1bMF07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09ICc6JyB8fCB0eXBlID09PSAnc3BhY2UnIHx8IHR5cGUgPT09ICdjb21tZW50Jykge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbm9kZS5wcm9wICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuXG4gICAgICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgICAgICB3aGlsZSAodG9rZW5zLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRva2VuID0gdG9rZW5zLnNoaWZ0KCk7XG5cbiAgICAgICAgICAgICAgICBpZiAodG9rZW5bMF0gPT09ICc6Jykge1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdG9rZW5bMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAobm9kZS5wcm9wWzBdID09PSAnXycgfHwgbm9kZS5wcm9wWzBdID09PSAnKicpIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlICs9IG5vZGUucHJvcFswXTtcbiAgICAgICAgICAgICAgICBub2RlLnByb3AgPSBub2RlLnByb3Auc2xpY2UoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2Vucyk7XG4gICAgICAgICAgICB0aGlzLnByZWNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG5cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSkge1xuICAgICAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlblsxXSA9PT0gJyFpbXBvcnRhbnQnKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN0cmluZyA9IHRoaXMuc3RyaW5nRnJvbSh0b2tlbnMsIGkpO1xuICAgICAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmluZyAhPT0gJyAhaW1wb3J0YW50Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHN0cmluZztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0gPT09ICdpbXBvcnRhbnQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjYWNoZSA9IHRva2Vucy5zbGljZSgwKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN0ciAgID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSBpOyBqID4gMDsgai0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGNhY2hlW2pdWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSAhPT0gJ3NwYWNlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgPSBjYWNoZS5wb3AoKVsxXSArIHN0cjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyLnRyaW0oKS5pbmRleE9mKCchJykgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHI7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBjYWNoZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICh0b2tlblswXSAhPT0gJ3NwYWNlJyAmJiB0b2tlblswXSAhPT0gJ2NvbW1lbnQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5yYXcobm9kZSwgJ3ZhbHVlJywgdG9rZW5zKTtcblxuICAgICAgICAgICAgaWYgKG5vZGUudmFsdWUuaW5kZXhPZignOicpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIHRoaXMuY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gbm9kZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNvbW1lbnQodG9rZW4pIHtcbiAgICAgICAgaWYgKHRva2VuWzZdID09PSAnaW5saW5lJykge1xuICAgICAgICAgICAgbGV0IG5vZGUgPSBuZXcgQ29tbWVudCgpO1xuICAgICAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgICAgICAgICBub2RlLnJhd3MuaW5saW5lID0gdHJ1ZTtcbiAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG5cbiAgICAgICAgICAgIGxldCB0ZXh0ID0gdG9rZW5bMV0uc2xpY2UoMik7XG4gICAgICAgICAgICBpZiAoIC9eXFxzKiQvLnRlc3QodGV4dCkgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS50ZXh0ICAgICAgID0gJyc7XG4gICAgICAgICAgICAgICAgbm9kZS5yYXdzLmxlZnQgID0gdGV4dDtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSAnJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hdGNoID0gdGV4dC5tYXRjaCgvXihcXHMqKShbXl0qW15cXHNdKShcXHMqKSQvKTtcbiAgICAgICAgICAgICAgICBsZXQgZml4ZWQgPSBtYXRjaFsyXS5yZXBsYWNlKC8oXFwqXFwvfFxcL1xcKikvZywgJyovLyonKTtcbiAgICAgICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSBmaXhlZDtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MubGVmdCAgPSBtYXRjaFsxXTtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSBtYXRjaFszXTtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MudGV4dCAgPSBtYXRjaFsyXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN1cGVyLmNvbW1lbnQodG9rZW4pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIHByb3AsIHRva2Vucykge1xuICAgICAgICBzdXBlci5yYXcobm9kZSwgcHJvcCwgdG9rZW5zKTtcbiAgICAgICAgaWYgKCBub2RlLnJhd3NbcHJvcF0gKSB7XG4gICAgICAgICAgICBsZXQgc2NzcyA9IG5vZGUucmF3c1twcm9wXS5yYXc7XG4gICAgICAgICAgICBub2RlLnJhd3NbcHJvcF0ucmF3ID0gdG9rZW5zLnJlZHVjZSggKGFsbCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggaVswXSA9PT0gJ2NvbW1lbnQnICYmIGlbNl0gPT09ICdpbmxpbmUnICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dCA9IGlbMV0uc2xpY2UoMikucmVwbGFjZSgvKFxcKlxcL3xcXC9cXCopL2csICcqLy8qJyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhbGwgKyAnLyonICsgdGV4dCArICcqLyc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFsbCArIGlbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgJycpO1xuICAgICAgICAgICAgaWYgKCBzY3NzICE9PSBub2RlLnJhd3NbcHJvcF0ucmF3ICkge1xuICAgICAgICAgICAgICAgIG5vZGUucmF3c1twcm9wXS5zY3NzID0gc2NzcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxufVxuIl19
  25699. /***/ }),
  25700. /* 168 */
  25701. /***/ (function(module, exports, __webpack_require__) {
  25702. "use strict";
  25703. exports.__esModule = true;
  25704. var _stringifier = __webpack_require__(32);
  25705. var _stringifier2 = _interopRequireDefault(_stringifier);
  25706. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25707. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25708. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  25709. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  25710. var ScssStringifier = function (_Stringifier) {
  25711. _inherits(ScssStringifier, _Stringifier);
  25712. function ScssStringifier() {
  25713. _classCallCheck(this, ScssStringifier);
  25714. return _possibleConstructorReturn(this, _Stringifier.apply(this, arguments));
  25715. }
  25716. ScssStringifier.prototype.comment = function comment(node) {
  25717. var left = this.raw(node, 'left', 'commentLeft');
  25718. var right = this.raw(node, 'right', 'commentRight');
  25719. if (node.raws.inline) {
  25720. var text = node.raws.text || node.text;
  25721. this.builder('//' + left + text + right, node);
  25722. } else {
  25723. this.builder('/*' + left + node.text + right + '*/', node);
  25724. }
  25725. };
  25726. ScssStringifier.prototype.decl = function decl(node, semicolon) {
  25727. if (!node.isNested) {
  25728. _Stringifier.prototype.decl.call(this, node, semicolon);
  25729. } else {
  25730. var between = this.raw(node, 'between', 'colon');
  25731. var string = node.prop + between + this.rawValue(node, 'value');
  25732. if (node.important) {
  25733. string += node.raws.important || ' !important';
  25734. }
  25735. this.builder(string + '{', node, 'start');
  25736. var after = void 0;
  25737. if (node.nodes && node.nodes.length) {
  25738. this.body(node);
  25739. after = this.raw(node, 'after');
  25740. } else {
  25741. after = this.raw(node, 'after', 'emptyBody');
  25742. }
  25743. if (after) this.builder(after);
  25744. this.builder('}', node, 'end');
  25745. }
  25746. };
  25747. ScssStringifier.prototype.rawValue = function rawValue(node, prop) {
  25748. var value = node[prop];
  25749. var raw = node.raws[prop];
  25750. if (raw && raw.value === value) {
  25751. return raw.scss ? raw.scss : raw.raw;
  25752. } else {
  25753. return value;
  25754. }
  25755. };
  25756. return ScssStringifier;
  25757. }(_stringifier2.default);
  25758. exports.default = ScssStringifier;
  25759. module.exports = exports['default'];
  25760. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3RyaW5naWZpZXIuZXM2Il0sIm5hbWVzIjpbIlNjc3NTdHJpbmdpZmllciIsImNvbW1lbnQiLCJub2RlIiwibGVmdCIsInJhdyIsInJpZ2h0IiwicmF3cyIsImlubGluZSIsInRleHQiLCJidWlsZGVyIiwiZGVjbCIsInNlbWljb2xvbiIsImlzTmVzdGVkIiwiYmV0d2VlbiIsInN0cmluZyIsInByb3AiLCJyYXdWYWx1ZSIsImltcG9ydGFudCIsImFmdGVyIiwibm9kZXMiLCJsZW5ndGgiLCJib2R5IiwidmFsdWUiLCJzY3NzIl0sIm1hcHBpbmdzIj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yJpbXBvcnQgU3RyaW5naWZpZXIgZnJvbSAncG9zdGNzcy9saWIvc3RyaW5naWZpZXInO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBTY3NzU3RyaW5naWZpZXIgZXh0ZW5kcyBTdHJpbmdpZmllciB7XG5cbiAgICBjb21tZW50KG5vZGUpIHtcbiAgICAgICAgbGV0IGxlZnQgID0gdGhpcy5yYXcobm9kZSwgJ2xlZnQnLCAgJ2NvbW1lbnRMZWZ0Jyk7XG4gICAgICAgIGxldCByaWdodCA9IHRoaXMucmF3KG5vZGUsICdyaWdodCcsICdjb21tZW50UmlnaHQnKTtcblxuICAgICAgICBpZiAoIG5vZGUucmF3cy5pbmxpbmUgKSB7XG4gICAgICAgICAgICBsZXQgdGV4dCA9IG5vZGUucmF3cy50ZXh0IHx8IG5vZGUudGV4dDtcbiAgICAgICAgICAgIHRoaXMuYnVpbGRlcignLy8nICsgbGVmdCArIHRleHQgKyByaWdodCwgbm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkZXIoJy8qJyArIGxlZnQgKyBub2RlLnRleHQgKyByaWdodCArICcqLycsIG5vZGUpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVjbChub2RlLCBzZW1pY29sb24pIHtcbiAgICAgICAgaWYgKCAhbm9kZS5pc05lc3RlZCApIHtcbiAgICAgICAgICAgIHN1cGVyLmRlY2wobm9kZSwgc2VtaWNvbG9uKTtcbiAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgbGV0IGJldHdlZW4gPSB0aGlzLnJhdyhub2RlLCAnYmV0d2VlbicsICdjb2xvbicpO1xuICAgICAgICAgICAgbGV0IHN0cmluZyAgPSBub2RlLnByb3AgKyBiZXR3ZWVuICsgdGhpcy5yYXdWYWx1ZShub2RlLCAndmFsdWUnKTtcbiAgICAgICAgICAgIGlmICggbm9kZS5pbXBvcnRhbnQgKSB7XG4gICAgICAgICAgICAgICAgc3RyaW5nICs9IG5vZGUucmF3cy5pbXBvcnRhbnQgfHwgJyAhaW1wb3J0YW50JztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5idWlsZGVyKHN0cmluZyArICd7Jywgbm9kZSwgJ3N0YXJ0Jyk7XG5cbiAgICAgICAgICAgIGxldCBhZnRlcjtcbiAgICAgICAgICAgIGlmICggbm9kZS5ub2RlcyAmJiBub2RlLm5vZGVzLmxlbmd0aCApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmJvZHkobm9kZSk7XG4gICAgICAgICAgICAgICAgYWZ0ZXIgPSB0aGlzLnJhdyhub2RlLCAnYWZ0ZXInKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYWZ0ZXIgPSB0aGlzLnJhdyhub2RlLCAnYWZ0ZXInLCAnZW1wdHlCb2R5Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIGFmdGVyICkgdGhpcy5idWlsZGVyKGFmdGVyKTtcbiAgICAgICAgICAgIHRoaXMuYnVpbGRlcignfScsIG5vZGUsICdlbmQnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJhd1ZhbHVlKG5vZGUsIHByb3ApIHtcbiAgICAgICAgbGV0IHZhbHVlID0gbm9kZVtwcm9wXTtcbiAgICAgICAgbGV0IHJhdyAgID0gbm9kZS5yYXdzW3Byb3BdO1xuICAgICAgICBpZiAoIHJhdyAmJiByYXcudmFsdWUgPT09IHZhbHVlICkge1xuICAgICAgICAgICAgcmV0dXJuIHJhdy5zY3NzID8gcmF3LnNjc3MgOiByYXcucmF3O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG4gICAgfVxuXG59XG4iXX0=
  25761. /***/ }),
  25762. /* 169 */
  25763. /***/ (function(module, exports, __webpack_require__) {
  25764. "use strict";
  25765. exports.__esModule = true;
  25766. exports.default = scssStringify;
  25767. var _scssStringifier = __webpack_require__(168);
  25768. var _scssStringifier2 = _interopRequireDefault(_scssStringifier);
  25769. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  25770. function scssStringify(node, builder) {
  25771. var str = new _scssStringifier2.default(builder);
  25772. str.stringify(node);
  25773. }
  25774. module.exports = exports['default'];
  25775. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3RyaW5naWZ5LmVzNiJdLCJuYW1lcyI6WyJzY3NzU3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiLCJzdHJpbmdpZnkiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLGE7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxhQUFULENBQXVCQyxJQUF2QixFQUE2QkMsT0FBN0IsRUFBc0M7QUFDakQsUUFBSUMsTUFBTSw4QkFBb0JELE9BQXBCLENBQVY7QUFDQUMsUUFBSUMsU0FBSixDQUFjSCxJQUFkO0FBQ0giLCJmaWxlIjoic2Nzcy1zdHJpbmdpZnkuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgU2Nzc1N0cmluZ2lmaWVyIGZyb20gJy4vc2Nzcy1zdHJpbmdpZmllcic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHNjc3NTdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU2Nzc1N0cmluZ2lmaWVyKGJ1aWxkZXIpO1xuICAgIHN0ci5zdHJpbmdpZnkobm9kZSk7XG59XG4iXX0=
  25776. /***/ }),
  25777. /* 170 */
  25778. /***/ (function(module, exports, __webpack_require__) {
  25779. "use strict";
  25780. exports.__esModule = true;
  25781. exports.default = scssTokenize;
  25782. var SINGLE_QUOTE = 39;
  25783. var DOUBLE_QUOTE = 34;
  25784. var BACKSLASH = 92;
  25785. var SLASH = 47;
  25786. var NEWLINE = 10;
  25787. var SPACE = 32;
  25788. var FEED = 12;
  25789. var TAB = 9;
  25790. var CR = 13;
  25791. var OPEN_SQUARE = 91;
  25792. var CLOSE_SQUARE = 93;
  25793. var OPEN_PARENTHESES = 40;
  25794. var CLOSE_PARENTHESES = 41;
  25795. var OPEN_CURLY = 123;
  25796. var CLOSE_CURLY = 125;
  25797. var SEMICOLON = 59;
  25798. var ASTERISK = 42;
  25799. var COLON = 58;
  25800. var AT = 64;
  25801. // SCSS PATCH {
  25802. var COMMA = 44;
  25803. var HASH = 35;
  25804. // } SCSS PATCH
  25805. var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  25806. var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
  25807. var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
  25808. var RE_HEX_ESCAPE = /[a-f0-9]/i;
  25809. var RE_NEW_LINE = /[\r\f\n]/g; // SCSS PATCH
  25810. // SCSS PATCH function name was changed
  25811. function scssTokenize(input) {
  25812. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  25813. var css = input.css.valueOf();
  25814. var ignore = options.ignoreErrors;
  25815. var code = void 0,
  25816. next = void 0,
  25817. quote = void 0,
  25818. lines = void 0,
  25819. last = void 0,
  25820. content = void 0,
  25821. escape = void 0,
  25822. nextLine = void 0,
  25823. nextOffset = void 0,
  25824. escaped = void 0,
  25825. escapePos = void 0,
  25826. prev = void 0,
  25827. n = void 0,
  25828. currentToken = void 0;
  25829. var brackets = void 0; // SCSS PATCH
  25830. var length = css.length;
  25831. var offset = -1;
  25832. var line = 1;
  25833. var pos = 0;
  25834. var buffer = [];
  25835. var returned = [];
  25836. function unclosed(what) {
  25837. throw input.error('Unclosed ' + what, line, pos - offset);
  25838. }
  25839. function endOfFile() {
  25840. return returned.length === 0 && pos >= length;
  25841. }
  25842. function nextToken() {
  25843. if (returned.length) return returned.pop();
  25844. if (pos >= length) return;
  25845. code = css.charCodeAt(pos);
  25846. if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
  25847. offset = pos;
  25848. line += 1;
  25849. }
  25850. switch (code) {
  25851. case NEWLINE:
  25852. case SPACE:
  25853. case TAB:
  25854. case CR:
  25855. case FEED:
  25856. next = pos;
  25857. do {
  25858. next += 1;
  25859. code = css.charCodeAt(next);
  25860. if (code === NEWLINE) {
  25861. offset = next;
  25862. line += 1;
  25863. }
  25864. } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
  25865. currentToken = ['space', css.slice(pos, next)];
  25866. pos = next - 1;
  25867. break;
  25868. case OPEN_SQUARE:
  25869. currentToken = ['[', '[', line, pos - offset];
  25870. break;
  25871. case CLOSE_SQUARE:
  25872. currentToken = [']', ']', line, pos - offset];
  25873. break;
  25874. case OPEN_CURLY:
  25875. currentToken = ['{', '{', line, pos - offset];
  25876. break;
  25877. case CLOSE_CURLY:
  25878. currentToken = ['}', '}', line, pos - offset];
  25879. break;
  25880. // SCSS PATCH {
  25881. case COMMA:
  25882. currentToken = ['word', ',', line, pos - offset, line, pos - offset + 1];
  25883. break;
  25884. // } SCSS PATCH
  25885. case COLON:
  25886. currentToken = [':', ':', line, pos - offset];
  25887. break;
  25888. case SEMICOLON:
  25889. currentToken = [';', ';', line, pos - offset];
  25890. break;
  25891. case OPEN_PARENTHESES:
  25892. prev = buffer.length ? buffer.pop()[1] : '';
  25893. n = css.charCodeAt(pos + 1);
  25894. // SCSS PATCH {
  25895. if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE) {
  25896. brackets = 1;
  25897. escaped = false;
  25898. next = pos + 1;
  25899. while (next <= css.length - 1) {
  25900. n = css.charCodeAt(next);
  25901. if (n === BACKSLASH) {
  25902. escaped = !escaped;
  25903. } else if (n === OPEN_PARENTHESES) {
  25904. brackets += 1;
  25905. } else if (n === CLOSE_PARENTHESES) {
  25906. brackets -= 1;
  25907. if (brackets === 0) break;
  25908. }
  25909. next += 1;
  25910. }
  25911. content = css.slice(pos, next + 1);
  25912. lines = content.split('\n');
  25913. last = lines.length - 1;
  25914. if (last > 0) {
  25915. nextLine = line + last;
  25916. nextOffset = next - lines[last].length;
  25917. } else {
  25918. nextLine = line;
  25919. nextOffset = offset;
  25920. }
  25921. currentToken = ['brackets', content, line, pos - offset, nextLine, next - nextOffset];
  25922. offset = nextOffset;
  25923. line = nextLine;
  25924. pos = next;
  25925. // } SCSS PATCH
  25926. } else {
  25927. next = css.indexOf(')', pos + 1);
  25928. content = css.slice(pos, next + 1);
  25929. if (next === -1 || RE_BAD_BRACKET.test(content)) {
  25930. currentToken = ['(', '(', line, pos - offset];
  25931. } else {
  25932. currentToken = ['brackets', content, line, pos - offset, line, next - offset];
  25933. pos = next;
  25934. }
  25935. }
  25936. break;
  25937. case CLOSE_PARENTHESES:
  25938. currentToken = [')', ')', line, pos - offset];
  25939. break;
  25940. case SINGLE_QUOTE:
  25941. case DOUBLE_QUOTE:
  25942. quote = code === SINGLE_QUOTE ? '\'' : '"';
  25943. next = pos;
  25944. do {
  25945. escaped = false;
  25946. next = css.indexOf(quote, next + 1);
  25947. if (next === -1) {
  25948. if (ignore) {
  25949. next = pos + 1;
  25950. break;
  25951. } else {
  25952. unclosed('string');
  25953. }
  25954. }
  25955. escapePos = next;
  25956. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  25957. escapePos -= 1;
  25958. escaped = !escaped;
  25959. }
  25960. } while (escaped);
  25961. content = css.slice(pos, next + 1);
  25962. lines = content.split('\n');
  25963. last = lines.length - 1;
  25964. if (last > 0) {
  25965. nextLine = line + last;
  25966. nextOffset = next - lines[last].length;
  25967. } else {
  25968. nextLine = line;
  25969. nextOffset = offset;
  25970. }
  25971. currentToken = ['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset];
  25972. offset = nextOffset;
  25973. line = nextLine;
  25974. pos = next;
  25975. break;
  25976. case AT:
  25977. RE_AT_END.lastIndex = pos + 1;
  25978. RE_AT_END.test(css);
  25979. if (RE_AT_END.lastIndex === 0) {
  25980. next = css.length - 1;
  25981. } else {
  25982. next = RE_AT_END.lastIndex - 2;
  25983. }
  25984. currentToken = ['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  25985. pos = next;
  25986. break;
  25987. case BACKSLASH:
  25988. next = pos;
  25989. escape = true;
  25990. while (css.charCodeAt(next + 1) === BACKSLASH) {
  25991. next += 1;
  25992. escape = !escape;
  25993. }
  25994. code = css.charCodeAt(next + 1);
  25995. if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
  25996. next += 1;
  25997. if (RE_HEX_ESCAPE.test(css.charAt(next))) {
  25998. while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
  25999. next += 1;
  26000. }
  26001. if (css.charCodeAt(next + 1) === SPACE) {
  26002. next += 1;
  26003. }
  26004. }
  26005. }
  26006. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  26007. pos = next;
  26008. break;
  26009. default:
  26010. // SCSS PATCH {
  26011. n = css.charCodeAt(pos + 1);
  26012. if (code === HASH && n === OPEN_CURLY) {
  26013. var deep = 1;
  26014. next = pos;
  26015. while (deep > 0) {
  26016. next += 1;
  26017. if (css.length <= next) unclosed('interpolation');
  26018. code = css.charCodeAt(next);
  26019. n = css.charCodeAt(next + 1);
  26020. if (code === CLOSE_CURLY) {
  26021. deep -= 1;
  26022. } else if (code === HASH && n === OPEN_CURLY) {
  26023. deep += 1;
  26024. }
  26025. }
  26026. content = css.slice(pos, next + 1);
  26027. lines = content.split('\n');
  26028. last = lines.length - 1;
  26029. if (last > 0) {
  26030. nextLine = line + last;
  26031. nextOffset = next - lines[last].length;
  26032. } else {
  26033. nextLine = line;
  26034. nextOffset = offset;
  26035. }
  26036. currentToken = ['word', content, line, pos - offset, nextLine, next - nextOffset];
  26037. offset = nextOffset;
  26038. line = nextLine;
  26039. pos = next;
  26040. } else if (code === SLASH && n === ASTERISK) {
  26041. // } SCSS PATCH
  26042. next = css.indexOf('*/', pos + 2) + 1;
  26043. if (next === 0) {
  26044. if (ignore) {
  26045. next = css.length;
  26046. } else {
  26047. unclosed('comment');
  26048. }
  26049. }
  26050. content = css.slice(pos, next + 1);
  26051. lines = content.split('\n');
  26052. last = lines.length - 1;
  26053. if (last > 0) {
  26054. nextLine = line + last;
  26055. nextOffset = next - lines[last].length;
  26056. } else {
  26057. nextLine = line;
  26058. nextOffset = offset;
  26059. }
  26060. currentToken = ['comment', content, line, pos - offset, nextLine, next - nextOffset];
  26061. offset = nextOffset;
  26062. line = nextLine;
  26063. pos = next;
  26064. // SCSS PATCH {
  26065. } else if (code === SLASH && n === SLASH) {
  26066. RE_NEW_LINE.lastIndex = pos + 1;
  26067. RE_NEW_LINE.test(css);
  26068. if (RE_NEW_LINE.lastIndex === 0) {
  26069. next = css.length - 1;
  26070. } else {
  26071. next = RE_NEW_LINE.lastIndex - 2;
  26072. }
  26073. content = css.slice(pos, next + 1);
  26074. currentToken = ['comment', content, line, pos - offset, line, next - offset, 'inline'];
  26075. pos = next;
  26076. // } SCSS PATCH
  26077. } else {
  26078. RE_WORD_END.lastIndex = pos + 1;
  26079. RE_WORD_END.test(css);
  26080. if (RE_WORD_END.lastIndex === 0) {
  26081. next = css.length - 1;
  26082. } else {
  26083. next = RE_WORD_END.lastIndex - 2;
  26084. }
  26085. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  26086. buffer.push(currentToken);
  26087. pos = next;
  26088. }
  26089. break;
  26090. }
  26091. pos++;
  26092. return currentToken;
  26093. }
  26094. function back(token) {
  26095. returned.push(token);
  26096. }
  26097. return {
  26098. back: back,
  26099. nextToken: nextToken,
  26100. endOfFile: endOfFile
  26101. };
  26102. }
  26103. module.exports = exports['default'];
  26104. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtdG9rZW5pemUuZXM2Il0sIm5h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SgpIHtcbiAgICAgICAgcmV0dXJuIHJldHVybmVkLmxlbmd0aCA9PT0gMCAmJiBwb3MgPj0gbGVuZ3RoO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG5leHRUb2tlbigpIHtcbiAgICAgICAgaWYgKCByZXR1cm5lZC5sZW5ndGggKSByZXR1cm4gcmV0dXJuZWQucG9wKCk7XG4gICAgICAgIGlmICggcG9zID49IGxlbmd0aCApIHJldHVybjtcblxuICAgICAgICBjb2RlID0gY3NzLmNoYXJDb2RlQXQocG9zKTtcbiAgICAgICAgaWYgKCBjb2RlID09PSBORVdMSU5FIHx8IGNvZGUgPT09IEZFRUQgfHxcbiAgICAgICAgICAgICBjb2RlID09PSBDUiAmJiBjc3MuY2hhckNvZGVBdChwb3MgKyAxKSAhPT0gTkVXTElORSApIHtcbiAgICAgICAgICAgIG9mZnNldCA9IHBvcztcbiAgICAgICAgICAgIGxpbmUgKz0gMTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAoIGNvZGUgKSB7XG4gICAgICAgIGNhc2UgTkVXTElORTpcbiAgICAgICAgY2FzZSBTUEFDRTpcbiAgICAgICAgY2FzZSBUQUI6XG4gICAgICAgIGNhc2UgQ1I6XG4gICAgICAgIGNhc2UgRkVFRDpcbiAgICAgICAgICAgIG5leHQgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgKSB7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxpbmUgKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICggY29kZSA9PT0gU1BBQ0UgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IE5FV0xJTkUgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBUQUIgICAgIHx8XG4gICAgICAgICAgICAgICAgICAgICAgY29kZSA9PT0gQ1IgICAgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IEZFRUQgKTtcblxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydzcGFjZScsIGNzcy5zbGljZShwb3MsIG5leHQpXTtcbiAgICAgICAgICAgIHBvcyA9IG5leHQgLSAxO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1NRVUFSRTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnWycsICdbJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfU1FVQVJFOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyddJywgJ10nLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX0NVUkxZOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyd7JywgJ3snLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTE9TRV9DVVJMWTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnfScsICd9JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIC8vIFNDU1MgUEFUQ0gge1xuICAgICAgICBjYXNlIENPTU1BOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gW1xuICAgICAgICAgICAgICAgICd3b3JkJyxcbiAgICAgICAgICAgICAgICAnLCcsXG4gICAgICAgICAgICAgICAgbGluZSwgcG9zIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAtIG9mZnNldCArIDFcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgLy8gfSBTQ1NTIFBBVENIXG5cbiAgICAgICAgY2FzZSBDT0xPTjpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnOicsICc6JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgU0VNSUNPTE9OOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyc7JywgJzsnLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1BBUkVOVEhFU0VTOlxuICAgICAgICAgICAgcHJldiA9IGJ1ZmZlci5sZW5ndGggPyBidWZmZXIucG9wKClbMV0gOiAnJztcbiAgICAgICAgICAgIG4gICAgPSBjc3MuY2hhckNvZGVBdChwb3MgKyAxKTtcblxuICAgICAgICAgICAgLy8gU0NTUyBQQVRDSCB7XG4gICAgICAgICAgICBpZiAoIHByZXYgPT09ICd1cmwnICYmIG4gIT09IFNJTkdMRV9RVU9URSAmJiBuICE9PSBET1VCTEVfUVVPVEUgKSB7XG4gICAgICAgICAgICAgICAgYnJhY2tldHMgPSAxO1xuICAgICAgICAgICAgICAgIGVzY2FwZWQgID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbmV4dCAgICAgPSBwb3MgKyAxO1xuICAgICAgICAgICAgICAgIHdoaWxlICggbmV4dCA8PSBjc3MubGVuZ3RoIC0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGNzcy5jaGFyQ29kZUF0KG5leHQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIG4gPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVzY2FwZWQgPSAhZXNjYXBlZDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggbiA9PT0gT1BFTl9QQVJFTlRIRVNFUyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyYWNrZXRzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIG4gPT09IENMT1NFX1BBUkVOVEhFU0VTICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJhY2tldHMgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggYnJhY2tldHMgPT09IDAgKSBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29udGVudCA9IGNzcy5zbGljZShwb3MsIG5leHQgKyAxKTtcbiAgICAgICAgICAgICAgICBsaW5lcyAgID0gY29udGVudC5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICAgICAgbGFzdCAgICA9IGxpbmVzLmxlbmd0aCAtIDE7XG5cbiAgICAgICAgICAgICAgICBpZiAoIGxhc3QgPiAwICkge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZSArIGxhc3Q7XG4gICAgICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBuZXh0IC0gbGluZXNbbGFzdF0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gb2Zmc2V0O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnYnJhY2tldHMnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHRPZmZzZXQ7XG4gICAgICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcbiAgICAgICAgICAgIC8vIH0gU0NTUyBQQVRDSFxuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHQgICAgPSBjc3MuaW5kZXhPZignKScsIHBvcyArIDEpO1xuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIG5leHQgPT09IC0xIHx8IFJFX0JBRF9CUkFDS0VULnRlc3QoY29udGVudCkgKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnKCcsICcoJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ2JyYWNrZXRzJywgY29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lLCBuZXh0IC0gb2Zmc2V0XG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENMT1NFX1BBUkVOVEhFU0VTOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWycpJywgJyknLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBTSU5HTEVfUVVPVEU6XG4gICAgICAgIGNhc2UgRE9VQkxFX1FVT1RFOlxuICAgICAgICAgICAgcXVvdGUgPSBjb2RlID09PSBTSU5HTEVfUVVPVEUgPyAnXFwnJyA6ICdcIic7XG4gICAgICAgICAgICBuZXh0ICA9IHBvcztcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBlc2NhcGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbmV4dCAgICA9IGNzcy5pbmRleE9mKHF1b3RlLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBpZ25vcmUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ3N0cmluZycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgd2hpbGUgKCBjc3MuY2hhckNvZGVBdChlc2NhcGVQb3MgLSAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGVQb3MgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gd2hpbGUgKCBlc2NhcGVkICk7XG5cbiAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICBsaW5lcyAgID0gY29udGVudC5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICBsYXN0ICAgID0gbGluZXMubGVuZ3RoIC0gMTtcblxuICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZSArIGxhc3Q7XG4gICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG5leHQgLSBsaW5lc1tsYXN0XS5sZW5ndGg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBvZmZzZXQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnc3RyaW5nJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICBvZmZzZXQgPSBuZXh0T2Zmc2V0O1xuICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICBwb3MgICAgPSBuZXh0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBBVDpcbiAgICAgICAgICAgIFJFX0FUX0VORC5sYXN0SW5kZXggPSBwb3MgKyAxO1xuICAgICAgICAgICAgUkVfQVRfRU5ELnRlc3QoY3NzKTtcbiAgICAgICAgICAgIGlmICggUkVfQVRfRU5ELmxhc3RJbmRleCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gY3NzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHQgPSBSRV9BVF9FTkQubGFzdEluZGV4IC0gMjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydhdC13b3JkJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQkFDS1NMQVNIOlxuICAgICAgICAgICAgbmV4dCAgID0gcG9zO1xuICAgICAgICAgICAgZXNjYXBlID0gdHJ1ZTtcbiAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQobmV4dCArIDEpID09PSBCQUNLU0xBU0ggKSB7XG4gICAgICAgICAgICAgICAgbmV4dCAgKz0gMTtcbiAgICAgICAgICAgICAgICBlc2NhcGUgPSAhZXNjYXBlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29kZSA9IGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKTtcbiAgICAgICAgICAgIGlmICggZXNjYXBlICYmIChjb2RlICE9PSBTTEFTSCAgICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gU1BBQ0UgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IE5FV0xJTkUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBUQUIgICAgICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gQ1IgICAgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IEZFRUQgKSApIHtcbiAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgaWYgKCBSRV9IRVhfRVNDQVBFLnRlc3QoY3NzLmNoYXJBdChuZXh0KSkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICggUkVfSEVYX0VTQ0FQRS50ZXN0KGNzcy5jaGFyQXQobmV4dCArIDEpKSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKSA9PT0gU1BBQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgLy8gU0NTUyBQQVRDSCB7XG4gICAgICAgICAgICBuID0gY3NzLmNoYXJDb2RlQXQocG9zICsgMSk7XG5cbiAgICAgICAgICAgIGlmICggY29kZSA9PT0gSEFTSCAmJiBuID09PSBPUEVOX0NVUkxZICkge1xuICAgICAgICAgICAgICAgIGxldCBkZWVwID0gMTtcbiAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgIHdoaWxlICggZGVlcCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBjc3MubGVuZ3RoIDw9IG5leHQgKSB1bmNsb3NlZCgnaW50ZXJwb2xhdGlvbicpO1xuXG4gICAgICAgICAgICAgICAgICAgIGNvZGUgID0gY3NzLmNoYXJDb2RlQXQobmV4dCk7XG4gICAgICAgICAgICAgICAgICAgIG4gICAgID0gY3NzLmNoYXJDb2RlQXQobmV4dCArIDEpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICggY29kZSA9PT0gQ0xPU0VfQ1VSTFkgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWVwIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIGNvZGUgPT09IEhBU0ggJiYgbiA9PT0gT1BFTl9DVVJMWSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZXAgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgICAgIGxhc3QgICAgPSBsaW5lcy5sZW5ndGggLSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbmV4dCAtIGxpbmVzW2xhc3RdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ3dvcmQnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHRPZmZzZXQ7XG4gICAgICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcblxuICAgICAgICAgICAgfSBlbHNlIGlmICggY29kZSA9PT0gU0xBU0ggJiYgbiA9PT0gQVNURVJJU0sgKSB7XG4gICAgICAgICAgICAvLyB9IFNDU1MgUEFUQ0hcbiAgICAgICAgICAgICAgICBuZXh0ID0gY3NzLmluZGV4T2YoJyovJywgcG9zICsgMikgKyAxO1xuICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBpZ25vcmUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gY3NzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuY2xvc2VkKCdjb21tZW50Jyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuICAgICAgICAgICAgICAgIGxpbmVzICAgPSBjb250ZW50LnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgICAgICBsYXN0ICAgID0gbGluZXMubGVuZ3RoIC0gMTtcblxuICAgICAgICAgICAgICAgIGlmICggbGFzdCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lICsgbGFzdDtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG5leHQgLSBsaW5lc1tsYXN0XS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmU7XG4gICAgICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBvZmZzZXQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydjb21tZW50JywgY29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgICAgIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIG5leHRMaW5lLCBuZXh0IC0gbmV4dE9mZnNldFxuICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBuZXh0T2Zmc2V0O1xuICAgICAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgICAgIHBvcyAgICA9IG5leHQ7XG5cbiAgICAgICAgICAgIC8vIFNDU1MgUEFUQ0gge1xuICAgICAgICAgICAgfSBlbHNlIGlmICggY29kZSA9PT0gU0xBU0ggJiYgbiA9PT0gU0xBU0ggKSB7XG4gICAgICAgICAgICAgICAgUkVfTkVXX0xJTkUubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICBSRV9ORVdfTElORS50ZXN0KGNzcyk7XG4gICAgICAgICAgICAgICAgaWYgKCBSRV9ORVdfTElORS5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0ID0gUkVfTkVXX0xJTkUubGFzdEluZGV4IC0gMjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuXG4gICAgICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydjb21tZW50JywgY29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgJ2lubGluZSdcbiAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgICAgICAvLyB9IFNDU1MgUEFUQ0hcblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBSRV9XT1JEX0VORC5sYXN0SW5kZXggPSBwb3MgKyAxO1xuICAgICAgICAgICAgICAgIFJFX1dPUkRfRU5ELnRlc3QoY3NzKTtcbiAgICAgICAgICAgICAgICBpZiAoIFJFX1dPUkRfRU5ELmxhc3RJbmRleCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBSRV9XT1JEX0VORC5sYXN0SW5kZXggLSAyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICBidWZmZXIucHVzaChjdXJyZW50VG9rZW4pO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBwb3MrKztcbiAgICAgICAgcmV0dXJuIGN1cnJlbnRUb2tlbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBiYWNrKHRva2VuKSB7XG4gICAgICAgIHJldHVybmVkLnB1c2godG9rZW4pO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAgIGJhY2ssXG4gICAgICAgIG5leHRUb2tlbixcbiAgICAgICAgZW5kT2ZGaWxlXG4gICAgfTtcbn1cbiJdfQ==
  26105. /***/ }),
  26106. /* 171 */
  26107. /***/ (function(module, exports, __webpack_require__) {
  26108. "use strict";
  26109. exports.__esModule = true;
  26110. /**
  26111. * Contains helpers for safely splitting lists of CSS values,
  26112. * preserving parentheses and quotes.
  26113. *
  26114. * @example
  26115. * const list = postcss.list;
  26116. *
  26117. * @namespace list
  26118. */
  26119. var list = {
  26120. split: function split(string, separators, last) {
  26121. var array = [];
  26122. var current = '';
  26123. var split = false;
  26124. var func = 0;
  26125. var quote = false;
  26126. var escape = false;
  26127. for (var i = 0; i < string.length; i++) {
  26128. var letter = string[i];
  26129. if (quote) {
  26130. if (escape) {
  26131. escape = false;
  26132. } else if (letter === '\\') {
  26133. escape = true;
  26134. } else if (letter === quote) {
  26135. quote = false;
  26136. }
  26137. } else if (letter === '"' || letter === '\'') {
  26138. quote = letter;
  26139. } else if (letter === '(') {
  26140. func += 1;
  26141. } else if (letter === ')') {
  26142. if (func > 0) func -= 1;
  26143. } else if (func === 0) {
  26144. if (separators.indexOf(letter) !== -1) split = true;
  26145. }
  26146. if (split) {
  26147. if (current !== '') array.push(current.trim());
  26148. current = '';
  26149. split = false;
  26150. } else {
  26151. current += letter;
  26152. }
  26153. }
  26154. if (last || current !== '') array.push(current.trim());
  26155. return array;
  26156. },
  26157. /**
  26158. * Safely splits space-separated values (such as those for `background`,
  26159. * `border-radius`, and other shorthand properties).
  26160. *
  26161. * @param {string} string - space-separated values
  26162. *
  26163. * @return {string[]} split values
  26164. *
  26165. * @example
  26166. * postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
  26167. */
  26168. space: function space(string) {
  26169. var spaces = [' ', '\n', '\t'];
  26170. return list.split(string, spaces);
  26171. },
  26172. /**
  26173. * Safely splits comma-separated values (such as those for `transition-*`
  26174. * and `background` properties).
  26175. *
  26176. * @param {string} string - comma-separated values
  26177. *
  26178. * @return {string[]} split values
  26179. *
  26180. * @example
  26181. * postcss.list.comma('black, linear-gradient(white, black)')
  26182. * //=> ['black', 'linear-gradient(white, black)']
  26183. */
  26184. comma: function comma(string) {
  26185. var comma = ',';
  26186. return list.split(string, [comma], true);
  26187. }
  26188. };
  26189. exports.default = list;
  26190. module.exports = ex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sc2UgaWYgKCBsZXR0ZXIgPT09IHF1b3RlICkge1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGxldHRlciA9PT0gJ1wiJyB8fCBsZXR0ZXIgPT09ICdcXCcnICkge1xuICAgICAgICAgICAgICAgIHF1b3RlID0gbGV0dGVyO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKCcgKSB7XG4gICAgICAgICAgICAgICAgZnVuYyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKScgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBmdW5jID4gMCApIGZ1bmMgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGZ1bmMgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBzZXBhcmF0b3JzLmluZGV4T2YobGV0dGVyKSAhPT0gLTEgKSBzcGxpdCA9IHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggc3BsaXQgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBjdXJyZW50ICE9PSAnJyApIGFycmF5LnB1c2goY3VycmVudC50cmltKCkpO1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSAnJztcbiAgICAgICAgICAgICAgICBzcGxpdCAgID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgKz0gbGV0dGVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBsYXN0IHx8IGN1cnJlbnQgIT09ICcnICkgYXJyYXkucHVzaChjdXJyZW50LnRyaW0oKSk7XG4gICAgICAgIHJldHVybiBhcnJheTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogU2FmZWx5IHNwbGl0cyBzcGFjZS1zZXBhcmF0ZWQgdmF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jayknXVxuICAgICAqL1xuICAgIGNvbW1hKHN0cmluZykge1xuICAgICAgICBsZXQgY29tbWEgPSAnLCc7XG4gICAgICAgIHJldHVybiBsaXN0LnNwbGl0KHN0cmluZywgW2NvbW1hXSwgdHJ1ZSk7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBsaXN0O1xuIl19
  26192. /***/ }),
  26193. /* 172 */
  26194. /***/ (function(module, exports, __webpack_require__) {
  26195. "use strict";
  26196. /* WEBPACK VAR INJECTION */(function(Buffer) {
  26197. exports.__esModule = true;
  26198. var _sourceMap = __webpack_require__(66);
  26199. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  26200. var _path = __webpack_require__(8);
  26201. var _path2 = _interopRequireDefault(_path);
  26202. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  26203. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26204. var MapGenerator = function () {
  26205. function MapGenerator(stringify, root, opts) {
  26206. _classCallCheck(this, MapGenerator);
  26207. this.stringify = stringify;
  26208. this.mapOpts = opts.map || {};
  26209. this.root = root;
  26210. this.opts = opts;
  26211. }
  26212. MapGenerator.prototype.isMap = function isMap() {
  26213. if (typeof this.opts.map !== 'undefined') {
  26214. return !!this.opts.map;
  26215. } else {
  26216. return this.previous().length > 0;
  26217. }
  26218. };
  26219. MapGenerator.prototype.previous = function previous() {
  26220. var _this = this;
  26221. if (!this.previousMaps) {
  26222. this.previousMaps = [];
  26223. this.root.walk(function (node) {
  26224. if (node.source && node.source.input.map) {
  26225. var map = node.source.input.map;
  26226. if (_this.previousMaps.indexOf(map) === -1) {
  26227. _this.previousMaps.push(map);
  26228. }
  26229. }
  26230. });
  26231. }
  26232. return this.previousMaps;
  26233. };
  26234. MapGenerator.prototype.isInline = function isInline() {
  26235. if (typeof this.mapOpts.inline !== 'undefined') {
  26236. return this.mapOpts.inline;
  26237. }
  26238. var annotation = this.mapOpts.annotation;
  26239. if (typeof annotation !== 'undefined' && annotation !== true) {
  26240. return false;
  26241. }
  26242. if (this.previous().length) {
  26243. return this.previous().some(function (i) {
  26244. return i.inline;
  26245. });
  26246. } else {
  26247. return true;
  26248. }
  26249. };
  26250. MapGenerator.prototype.isSourcesContent = function isSourcesContent() {
  26251. if (typeof this.mapOpts.sourcesContent !== 'undefined') {
  26252. return this.mapOpts.sourcesContent;
  26253. }
  26254. if (this.previous().length) {
  26255. return this.previous().some(function (i) {
  26256. return i.withContent();
  26257. });
  26258. } else {
  26259. return true;
  26260. }
  26261. };
  26262. MapGenerator.prototype.clearAnnotation = function clearAnnotation() {
  26263. if (this.mapOpts.annotation === false) return;
  26264. var node = void 0;
  26265. for (var i = this.root.nodes.length - 1; i >= 0; i--) {
  26266. node = this.root.nodes[i];
  26267. if (node.type !== 'comment') continue;
  26268. if (node.text.indexOf('# sourceMappingURL=') === 0) {
  26269. this.root.removeChild(i);
  26270. }
  26271. }
  26272. };
  26273. MapGenerator.prototype.setSourcesContent = function setSourcesContent() {
  26274. var _this2 = this;
  26275. var already = {};
  26276. this.root.walk(function (node) {
  26277. if (node.source) {
  26278. var from = node.source.input.from;
  26279. if (from && !already[from]) {
  26280. already[from] = true;
  26281. var relative = _this2.relative(from);
  26282. _this2.map.setSourceContent(relative, node.source.input.css);
  26283. }
  26284. }
  26285. });
  26286. };
  26287. MapGenerator.prototype.applyPrevMaps = function applyPrevMaps() {
  26288. for (var _iterator = this.previous(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  26289. var _ref;
  26290. if (_isArray) {
  26291. if (_i >= _iterator.length) break;
  26292. _ref = _iterator[_i++];
  26293. } else {
  26294. _i = _iterator.next();
  26295. if (_i.done) break;
  26296. _ref = _i.value;
  26297. }
  26298. var prev = _ref;
  26299. var from = this.relative(prev.file);
  26300. var root = prev.root || _path2.default.dirname(prev.file);
  26301. var map = void 0;
  26302. if (this.mapOpts.sourcesContent === false) {
  26303. map = new _sourceMap2.default.SourceMapConsumer(prev.text);
  26304. if (map.sourcesContent) {
  26305. map.sourcesContent = map.sourcesContent.map(function () {
  26306. return null;
  26307. });
  26308. }
  26309. } else {
  26310. map = prev.consumer();
  26311. }
  26312. this.map.applySourceMap(map, from, this.relative(root));
  26313. }
  26314. };
  26315. MapGenerator.prototype.isAnnotation = function isAnnotation() {
  26316. if (this.isInline()) {
  26317. return true;
  26318. } else if (typeof this.mapOpts.annotation !== 'undefined') {
  26319. return this.mapOpts.annotation;
  26320. } else if (this.previous().length) {
  26321. return this.previous().some(function (i) {
  26322. return i.annotation;
  26323. });
  26324. } else {
  26325. return true;
  26326. }
  26327. };
  26328. MapGenerator.prototype.toBase64 = function toBase64(str) {
  26329. if (Buffer) {
  26330. if (Buffer.from && Buffer.from !== Uint8Array.from) {
  26331. return Buffer.from(str).toString('base64');
  26332. } else {
  26333. return new Buffer(str).toString('base64');
  26334. }
  26335. } else {
  26336. return window.btoa(unescape(encodeURIComponent(str)));
  26337. }
  26338. };
  26339. MapGenerator.prototype.addAnnotation = function addAnnotation() {
  26340. var content = void 0;
  26341. if (this.isInline()) {
  26342. content = 'data:application/json;base64,' + this.toBase64(this.map.toString());
  26343. } else if (typeof this.mapOpts.annotation === 'string') {
  26344. content = this.mapOpts.annotation;
  26345. } else {
  26346. content = this.outputFile() + '.map';
  26347. }
  26348. var eol = '\n';
  26349. if (this.css.indexOf('\r\n') !== -1) eol = '\r\n';
  26350. this.css += eol + '/*# sourceMappingURL=' + content + ' */';
  26351. };
  26352. MapGenerator.prototype.outputFile = function outputFile() {
  26353. if (this.opts.to) {
  26354. return this.relative(this.opts.to);
  26355. } else if (this.opts.from) {
  26356. return this.relative(this.opts.from);
  26357. } else {
  26358. return 'to.css';
  26359. }
  26360. };
  26361. MapGenerator.prototype.generateMap = function generateMap() {
  26362. this.generateString();
  26363. if (this.isSourcesContent()) this.setSourcesContent();
  26364. if (this.previous().length > 0) this.applyPrevMaps();
  26365. if (this.isAnnotation()) this.addAnnotation();
  26366. if (this.isInline()) {
  26367. return [this.css];
  26368. } else {
  26369. return [this.css, this.map];
  26370. }
  26371. };
  26372. MapGenerator.prototype.relative = function relative(file) {
  26373. if (file.indexOf('<') === 0) return file;
  26374. if (/^\w+:\/\//.test(file)) return file;
  26375. var from = this.opts.to ? _path2.default.dirname(this.opts.to) : '.';
  26376. if (typeof this.mapOpts.annotation === 'string') {
  26377. from = _path2.default.dirname(_path2.default.resolve(from, this.mapOpts.annotation));
  26378. }
  26379. file = _path2.default.relative(from, file);
  26380. if (_path2.default.sep === '\\') {
  26381. return file.replace(/\\/g, '/');
  26382. } else {
  26383. return file;
  26384. }
  26385. };
  26386. MapGenerator.prototype.sourcePath = function sourcePath(node) {
  26387. if (this.mapOpts.from) {
  26388. return this.mapOpts.from;
  26389. } else {
  26390. return this.relative(node.source.input.from);
  26391. }
  26392. };
  26393. MapGenerator.prototype.generateString = function generateString() {
  26394. var _this3 = this;
  26395. this.css = '';
  26396. this.map = new _sourceMap2.default.SourceMapGenerator({ file: this.outputFile() });
  26397. var line = 1;
  26398. var column = 1;
  26399. var lines = void 0,
  26400. last = void 0;
  26401. this.stringify(this.root, function (str, node, type) {
  26402. _this3.css += str;
  26403. if (node && type !== 'end') {
  26404. if (node.source && node.source.start) {
  26405. _this3.map.addMapping({
  26406. source: _this3.sourcePath(node),
  26407. generated: { line: line, column: column - 1 },
  26408. original: {
  26409. line: node.source.start.line,
  26410. column: node.source.start.column - 1
  26411. }
  26412. });
  26413. } else {
  26414. _this3.map.addMapping({
  26415. source: '<no source>',
  26416. original: { line: 1, column: 0 },
  26417. generated: { line: line, column: column - 1 }
  26418. });
  26419. }
  26420. }
  26421. lines = str.match(/\n/g);
  26422. if (lines) {
  26423. line += lines.length;
  26424. last = str.lastIndexOf('\n');
  26425. column = str.length - last;
  26426. } else {
  26427. column += str.length;
  26428. }
  26429. if (node && type !== 'start') {
  26430. if (node.source && node.source.end) {
  26431. _this3.map.addMapping({
  26432. source: _this3.sourcePath(node),
  26433. generated: { line: line, column: column - 1 },
  26434. original: {
  26435. line: node.source.end.line,
  26436. column: node.source.end.column
  26437. }
  26438. });
  26439. } else {
  26440. _this3.map.addMapping({
  26441. source: '<no source>',
  26442. original: { line: 1, column: 0 },
  26443. generated: { line: line, column: column - 1 }
  26444. });
  26445. }
  26446. }
  26447. });
  26448. };
  26449. MapGenerator.prototype.generate = function generate() {
  26450. this.clearAnnotation();
  26451. if (this.isMap()) {
  26452. return this.generateMap();
  26453. } else {
  26454. var result = '';
  26455. this.stringify(this.root, function (i) {
  26456. result += i;
  26457. });
  26458. return [result];
  26459. }
  26460. };
  26461. return MapGenerator;
  26462. }();
  26463. exports.default = MapGenerator;
  26464. module.exports = exports['default'];
  26465. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hcC1nZW5lcmF0b3IuZXM2Il0sIm5hbWVzIjpbIk1hcEdlbmVyYXRvciIsInN0cmluZ2lmeSIsInJvb3QiLCJvcHRzIiwibWFwT3B0cyIsIm1hcCIsImlzTWFwIiwicHJldmlvdXMiLCJsZW5ndGgiLCJwcmV2aW91c01hcHMiLCJ3YWxrIiwibm9kZSIsInNvdXJjZSIsImlucHV0IiwiaW5kZXhPZiIsInB1c2giLCJpc0lubGluZSIsImlubGluZSIsImFubm90YXRpb24iLCJzb21lIiwiaSIsImlzU291cmNlc0NvbnRlbnQiLCJzb3VyY2VzQ29udGVudCIsIndpdGhDb250ZW50IiwiY2xlYXJBbm5vdGF0aW9uIiwibm9kZXMiLCJ0eXBlIiwidGV4dCIsInJlbW92ZUNoaWxkIiwic2V0U291cmNlc0NvbnRlbnQiLCJhbHJlYWR5IiwiZnJvbSIsInJlbGF0aXZlIiwic2V0U291cmNlQ29udGVudCIsImNzcyIsImFwcGx5UHJldk1hcHMiLCJwcmV2IiwiZmlsZSIsImRpcm5hbWUiLCJTb3VyY2VNYXBDb25zdW1lciIsIm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1hcCA9IG5vZGUuc291cmNlLmlucHV0Lm1hcDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB0aGlzLnByZXZpb3VzTWFwcy5pbmRleE9mKG1hcCkgPT09IC0xICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wcmV2aW91c01hcHMucHVzaChtYXApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5wcmV2aW91c01hcHM7XG4gICAgfVxuXG4gICAgaXNJbmxpbmUoKSB7XG4gICAgICAgIGlmICggdHlwZW9mIHRoaXMubWFwT3B0cy5pbmxpbmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFwT3B0cy5pbmxpbmU7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgYW5ub3RhdGlvbiA9IHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uO1xuICAgICAgICBpZiAoIHR5cGVvZiBhbm5vdGF0aW9uICE9PSAndW5kZWZpbmVkJyAmJiBhbm5vdGF0aW9uICE9PSB0cnVlICkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCB0aGlzLnByZXZpb3VzKCkubGVuZ3RoICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJldmlvdXMoKS5zb21lKCBpID0+IGkuaW5saW5lICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzU291cmNlc0NvbnRlbnQoKSB7XG4gICAgICAgIGlmICggdHlwZW9mIHRoaXMubWFwT3B0cy5zb3VyY2VzQ29udGVudCAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXBPcHRzLnNvdXJjZXNDb250ZW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICggdGhpcy5wcmV2aW91cygpLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkuc29tZSggaSA9PiBpLndpdGhDb250ZW50KCkgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgY2xlYXJBbm5vdGF0aW9uKCkge1xuICAgICAgICBpZiAoIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uID09PSBmYWxzZSApIHJldHVybjtcblxuICAgICAgICBsZXQgbm9kZTtcbiAgICAgICAgZm9yICggbGV0IGkgPSB0aGlzLnJvb3Qubm9kZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0gKSB7XG4gICAgICAgICAgICBub2RlID0gdGhpcy5yb290Lm5vZGVzW2ldO1xuICAgICAgICAgICAgaWYgKCBub2RlLnR5cGUgIT09ICdjb21tZW50JyApIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKCBub2RlLnRleHQuaW5kZXhPZignIyBzb3VyY2VNYXBwaW5nVVJMPScpID09PSAwICkge1xuICAgICAgICAgICAgICAgIHRoaXMucm9vdC5yZW1vdmVDaGlsZChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNldFNvdXJjZXNDb250ZW50KCkge1xuICAgICAgICBsZXQgYWxyZWFkeSA9IHsgfTtcbiAgICAgICAgdGhpcy5yb290LndhbGsoIG5vZGUgPT4ge1xuICAgICAgICAgICAgaWYgKCBub2RlLnNvdXJjZSApIHtcbiAgICAgICAgICAgICAgICBsZXQgZnJvbSA9IG5vZGUuc291cmNlLmlucHV0LmZyb207XG4gICAgICAgICAgICAgICAgaWYgKCBmcm9tICYmICFhbHJlYWR5W2Zyb21dICkge1xuICAgICAgICAgICAgICAgICAgICBhbHJlYWR5W2Zyb21dID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlbGF0aXZlID0gdGhpcy5yZWxhdGl2ZShmcm9tKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuc2V0U291cmNlQ29udGVudChyZWxhdGl2ZSwgbm9kZS5zb3VyY2UuaW5wdXQuY3NzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFwcGx5UHJldk1hcHMoKSB7XG4gICAgICAgIGZvciAoIGxldCBwcmV2IG9mIHRoaXMucHJldmlvdXMoKSApIHtcbiAgICAgICAgICAgIGxldCBmcm9tID0gdGhpcy5yZWxhdGl2ZShwcmV2LmZpbGUpO1xuICAgICAgICAgICAgbGV0IHJvb3QgPSBwcmV2LnJvb3QgfHwgcGF0aC5kaXJuYW1lKHByZXYuZmlsZSk7XG4gICAgICAgICAgICBsZXQgbWFwO1xuXG4gICAgICAgICAgICBpZiAoIHRoaXMubWFwT3B0cy5zb3VyY2VzQ29udGVudCA9PT0gZmFsc2UgKSB7XG4gICAgICAgICAgICAgICAgbWFwID0gbmV3IG1vemlsbGEuU291cmNlTWFwQ29uc3VtZXIocHJldi50ZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIG1hcC5zb3VyY2VzQ29udGVudCApIHtcbiAgICAgICAgICAgICAgICAgICAgbWFwLnNvdXJjZXNDb250ZW50ID0gbWFwLnNvdXJjZXNDb250ZW50Lm1hcCggKCkgPT4gbnVsbCApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWFwID0gcHJldi5jb25zdW1lcigpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLm1hcC5hcHBseVNvdXJjZU1hcChtYXAsIGZyb20sIHRoaXMucmVsYXRpdmUocm9vdCkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaXNBbm5vdGF0aW9uKCkge1xuICAg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aWNhdGlvbi9qc29uO2Jhc2U2NCwnICtcbiAgICAgICAgICAgICAgICB0aGlzLnRvQmFzZTY0KHRoaXMubWFwLnRvU3RyaW5nKCkpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbiA9PT0gJ3N0cmluZycgKSB7XG4gICAgICAgICAgICBjb250ZW50ID0gdGhpcy5tYXBPcHRzLmFubm90YXRpb247XG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRlbnQgPSB0aGlzLm91dHB1dEZpbGUoKSArICcubWFwJztcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBlb2wgICA9ICdcXG4nO1xuICAgICAgICBpZiAoIHRoaXMuY3NzLmluZGV4T2YoJ1xcclxcbicpICE9PSAtMSApIGVvbCA9ICdcXHJcXG4nO1xuXG4gICAgICAgIHRoaXMuY3NzICs9IGVvbCArICcvKiMgc291cmNlTWFwcGluZ1VSTD0nICsgY29udGVudCArICcgKi8nO1xuICAgIH1cblxuICAgIG91dHB1dEZpbGUoKSB7XG4gICAgICAgIGlmICggdGhpcy5vcHRzLnRvICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucmVsYXRpdmUodGhpcy5vcHRzLnRvKTtcbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5vcHRzLmZyb20gKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5yZWxhdGl2ZSh0aGlzLm9wdHMuZnJvbSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gJ3RvLmNzcyc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZW5lcmF0ZU1hcCgpIHtcbiAgICAgICAgdGhpcy5nZW5lcmF0ZVN0cmluZygpO1xuICAgICAgICBpZiAoIHRoaXMuaXNTb3VyY2VzQ29udGVudCgpICkgICAgdGhpcy5zZXRTb3VyY2VzQ29udGVudCgpO1xuICAgICAgICBpZiAoIHRoaXMucHJldmlvdXMoKS5sZW5ndGggPiAwICkgdGhpcy5hcHBseVByZXZNYXBzKCk7XG4gICAgICAgIGlmICggdGhpcy5pc0Fubm90YXRpb24oKSApICAgICAgICB0aGlzLmFkZEFubm90YXRpb24oKTtcblxuICAgICAgICBpZiAoIHRoaXMuaXNJbmxpbmUoKSApIHtcbiAgICAgICAgICAgIHJldHVybiBbdGhpcy5jc3NdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIFt0aGlzLmNzcywgdGhpcy5tYXBdO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVsYXRpdmUoZmlsZSkge1xuICAgICAgICBpZiAoIGZpbGUuaW5kZXhPZignPCcpID09PSAwICkgcmV0dXJuIGZpbGU7XG4gICAgICAgIGlmICggL15cXHcrOlxcL1xcLy8udGVzdChmaWxlKSApIHJldHVybiBmaWxlO1xuXG4gICAgICAgIGxldCBmcm9tID0gdGhpcy5vcHRzLnRvID8gcGF0aC5kaXJuYW1lKHRoaXMub3B0cy50bykgOiAnLic7XG5cbiAgICAgICAgaWYgKCB0eXBlb2YgdGhpcy5tYXBPcHRzLmFubm90YXRpb24gPT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgZnJvbSA9IHBhdGguZGlybmFtZSggcGF0aC5yZXNvbHZlKGZyb20sIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uKSApO1xuICAgICAgICB9XG5cbiAgICAgICAgZmlsZSA9IHBhdGgucmVsYXRpdmUoZnJvbSwgZmlsZSk7XG4gICAgICAgIGlmICggcGF0aC5zZXAgPT09ICdcXFxcJyApIHtcbiAgICAgICAgICAgIHJldHVybiBmaWxlLnJlcGxhY2UoL1xcXFwvZywgJy8nKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmaWxlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc291cmNlUGF0aChub2RlKSB7XG4gICAgICAgIGlmICggdGhpcy5tYXBPcHRzLmZyb20gKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXBPcHRzLmZyb207XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5yZWxhdGl2ZShub2RlLnNvdXJjZS5pbnB1dC5mcm9tKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGdlbmVyYXRlU3RyaW5nKCkge1xuICAgICAgICB0aGlzLmNzcyA9ICcnO1xuICAgICAgICB0aGlzLm1hcCA9IG5ldyBtb3ppbGxhLlNvdXJjZU1hcEdlbmVyYXRvcih7IGZpbGU6IHRoaXMub3V0cHV0RmlsZSgpIH0pO1xuXG4gICAgICAgIGxldCBsaW5lICAgPSAxO1xuICAgICAgICBsZXQgY29sdW1uID0gMTtcblxuICAgICAgICBsZXQgbGluZXMsIGxhc3Q7XG4gICAgICAgIHRoaXMuc3RyaW5naWZ5KHRoaXMucm9vdCwgKHN0ciwgbm9kZSwgdHlwZSkgPT4ge1xuICAgICAgICAgICAgdGhpcy5jc3MgKz0gc3RyO1xuXG4gICAgICAgICAgICBpZiAoIG5vZGUgJiYgdHlwZSAhPT0gJ2VuZCcgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBub2RlLnNvdXJjZSAmJiBub2RlLnNvdXJjZS5zdGFydCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgIHRoaXMuc291cmNlUGF0aChub2RlKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRlZDogeyBsaW5lLCBjb2x1bW46IGNvbHVtbiAtIDEgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsOiAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6ICAgbm9kZS5zb3VyY2Uuc3RhcnQubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IG5vZGUuc291cmNlLnN0YXJ0LmNvbHVtbiAtIDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgICc8bm8gc291cmNlPicsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogIHsgbGluZTogMSwgY29sdW1uOiAwIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQ6IHsgbGluZSwgY29sdW1uOiBjb2x1bW4gLSAxIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsaW5lcyA9IHN0ci5tYXRjaCgvXFxuL2cpO1xuICAgICAgICAgICAgaWYgKCBsaW5lcyApIHtcbiAgICAgICAgICAgICAgICBsaW5lICArPSBsaW5lcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgbGFzdCAgID0gc3RyLmxhc3RJbmRleE9mKCdcXG4nKTtcbiAgICAgICAgICAgICAgICBjb2x1bW4gPSBzdHIubGVuZ3RoIC0gbGFzdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29sdW1uICs9IHN0ci5sZW5ndGg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggbm9kZSAmJiB0eXBlICE9PSAnc3RhcnQnICkge1xuICAgICAgICAgICAgICAgIGlmICggbm9kZS5zb3VyY2UgJiYgbm9kZS5zb3VyY2UuZW5kICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcC5hZGRNYXBwaW5nKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogICAgdGhpcy5zb3VyY2VQYXRoKG5vZGUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkOiB7IGxpbmUsIGNvbHVtbjogY29sdW1uIC0gMSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6ICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZTogICBub2RlLnNvdXJjZS5lbmQubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IG5vZGUuc291cmNlLmVuZC5jb2x1bW5cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgICc8bm8gc291cmNlPicsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogIHsgbGluZTogMSwgY29sdW1uOiAwIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQ6IHsgbGluZSwgY29sdW1uOiBjb2x1bW4gLSAxIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZW5lcmF0ZSgpIHtcbiAgICAgICAgdGhpcy5jbGVhckFubm90YXRpb24oKTtcblxuICAgICAgICBpZiAoIHRoaXMuaXNNYXAoKSApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmdlbmVyYXRlTWFwKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gJyc7XG4gICAgICAgICAgICB0aGlzLnN0cmluZ2lmeSh0aGlzLnJvb3QsIGkgPT4ge1xuICAgICAgICAgICAgICAgIHJlc3VsdCArPSBpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gW3Jlc3VsdF07XG4gICAgICAgIH1cbiAgICB9XG5cbn1cbiJdfQ==
  26466. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10).Buffer))
  26467. /***/ }),
  26468. /* 173 */
  26469. /***/ (function(module, exports, __webpack_require__) {
  26470. "use strict";
  26471. /* WEBPACK VAR INJECTION */(function(Buffer) {
  26472. exports.__esModule = true;
  26473. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  26474. var _sourceMap = __webpack_require__(66);
  26475. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  26476. var _path = __webpack_require__(8);
  26477. var _path2 = _interopRequireDefault(_path);
  26478. var _fs = __webpack_require__(217);
  26479. var _fs2 = _interopRequireDefault(_fs);
  26480. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  26481. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26482. function fromBase64(str) {
  26483. if (Buffer) {
  26484. if (Buffer.from && Buffer.from !== Uint8Array.from) {
  26485. return Buffer.from(str, 'base64').toString();
  26486. } else {
  26487. return new Buffer(str, 'base64').toString();
  26488. }
  26489. } else {
  26490. return window.atob(str);
  26491. }
  26492. }
  26493. /**
  26494. * Source map information from input CSS.
  26495. * For example, source map after Sass compiler.
  26496. *
  26497. * This class will automatically find source map in input CSS or in file system
  26498. * near input file (according `from` option).
  26499. *
  26500. * @example
  26501. * const root = postcss.parse(css, { from: 'a.sass.css' });
  26502. * root.input.map //=> PreviousMap
  26503. */
  26504. var PreviousMap = function () {
  26505. /**
  26506. * @param {string} css - input CSS source
  26507. * @param {processOptions} [opts] - {@link Processor#process} options
  26508. */
  26509. function PreviousMap(css, opts) {
  26510. _classCallCheck(this, PreviousMap);
  26511. this.loadAnnotation(css);
  26512. /**
  26513. * @member {boolean} - Was source map inlined by data-uri to input CSS.
  26514. */
  26515. this.inline = this.startWith(this.annotation, 'data:');
  26516. var prev = opts.map ? opts.map.prev : undefined;
  26517. var text = this.loadMap(opts.from, prev);
  26518. if (text) this.text = text;
  26519. }
  26520. /**
  26521. * Create a instance of `SourceMapGenerator` class
  26522. * from the `source-map` library to work with source map information.
  26523. *
  26524. * It is lazy method, so it will create object only on first call
  26525. * and then it will use cache.
  26526. *
  26527. * @return {SourceMapGenerator} object with source map information
  26528. */
  26529. PreviousMap.prototype.consumer = function consumer() {
  26530. if (!this.consumerCache) {
  26531. this.consumerCache = new _sourceMap2.default.SourceMapConsumer(this.text);
  26532. }
  26533. return this.consumerCache;
  26534. };
  26535. /**
  26536. * Does source map contains `sourcesContent` with input source text.
  26537. *
  26538. * @return {boolean} Is `sourcesContent` present
  26539. */
  26540. PreviousMap.prototype.withContent = function withContent() {
  26541. return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
  26542. };
  26543. PreviousMap.prototype.startWith = function startWith(string, start) {
  26544. if (!string) return false;
  26545. return string.substr(0, start.length) === start;
  26546. };
  26547. PreviousMap.prototype.loadAnnotation = function loadAnnotation(css) {
  26548. var match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);
  26549. if (match) this.annotation = match[1].trim();
  26550. };
  26551. PreviousMap.prototype.decodeInline = function decodeInline(text) {
  26552. // data:application/json;charset=utf-8;base64,
  26553. // data:application/json;charset=utf8;base64,
  26554. // data:application/json;base64,
  26555. var baseUri = /^data:application\/json;(?:charset=utf-?8;)?base64,/;
  26556. var uri = 'data:application/json,';
  26557. if (this.startWith(text, uri)) {
  26558. return decodeURIComponent(text.substr(uri.length));
  26559. } else if (baseUri.test(text)) {
  26560. return fromBase64(text.substr(RegExp.lastMatch.length));
  26561. } else {
  26562. var encoding = text.match(/data:application\/json;([^,]+),/)[1];
  26563. throw new Error('Unsupported source map encoding ' + encoding);
  26564. }
  26565. };
  26566. PreviousMap.prototype.loadMap = function loadMap(file, prev) {
  26567. if (prev === false) return false;
  26568. if (prev) {
  26569. if (typeof prev === 'string') {
  26570. return prev;
  26571. } else if (typeof prev === 'function') {
  26572. var prevPath = prev(file);
  26573. if (prevPath && _fs2.default.existsSync && _fs2.default.existsSync(prevPath)) {
  26574. return _fs2.default.readFileSync(prevPath, 'utf-8').toString().trim();
  26575. } else {
  26576. throw new Error('Unable to load previous source map: ' + prevPath.toString());
  26577. }
  26578. } else if (prev instanceof _sourceMap2.default.SourceMapConsumer) {
  26579. return _sourceMap2.default.SourceMapGenerator.fromSourceMap(prev).toString();
  26580. } else if (prev instanceof _sourceMap2.default.SourceMapGenerator) {
  26581. return prev.toString();
  26582. } else if (this.isMap(prev)) {
  26583. return JSON.stringify(prev);
  26584. } else {
  26585. throw new Error('Unsupported previous source map format: ' + prev.toString());
  26586. }
  26587. } else if (this.inline) {
  26588. return this.decodeInline(this.annotation);
  26589. } else if (this.annotation) {
  26590. var map = this.annotation;
  26591. if (file) map = _path2.default.join(_path2.default.dirname(file), map);
  26592. this.root = _path2.default.dirname(map);
  26593. if (_fs2.default.existsSync && _fs2.default.existsSync(map)) {
  26594. return _fs2.default.readFileSync(map, 'utf-8').toString().trim();
  26595. } else {
  26596. return false;
  26597. }
  26598. }
  26599. };
  26600. PreviousMap.prototype.isMap = function isMap(map) {
  26601. if ((typeof map === 'undefined' ? 'undefined' : _typeof(map)) !== 'object') return false;
  26602. return typeof map.mappings === 'string' || typeof map._mappings === 'string';
  26603. };
  26604. return PreviousMap;
  26605. }();
  26606. exports.default = PreviousMap;
  26607. module.exports = exports['default'];
  26608. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByZXZpb3VzLW1hcC5lczYiXSwibmFtZXMiOlsiZnJvbUJhc2U2NCIsInN0ciIsIkJ1ZmZlciIsImZyb20iLCJVaW50OEFycmF5IiwidG9TdHJpbmciLCJ3aW5kb3ciLCJhdG9iIiwiUHJldmlvdXNN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uY3Rpb24nICkge1xuICAgICAgICAgICAgICAgIGxldCBwcmV2UGF0aCA9IHByZXYoZmlsZSk7XG4gICAgICAgICAgICAgICAgaWYgKCBwcmV2UGF0aCAmJiBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMocHJldlBhdGgpICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKHByZXZQYXRoLCAndXRmLTgnKS50b1N0cmluZygpLnRyaW0oKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuYWJsZSB0byBsb2FkIHByZXZpb3VzIHNvdXJjZSBtYXA6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2UGF0aC50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwcmV2IGluc3RhbmNlb2YgbW96aWxsYS5Tb3VyY2VNYXBDb25zdW1lciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW96aWxsYS5Tb3VyY2VNYXBHZW5lcmF0b3JcbiAgICAgICAgICAgICAgICAgICAgLmZyb21Tb3VyY2VNYXAocHJldikudG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHByZXYgaW5zdGFuY2VvZiBtb3ppbGxhLlNvdXJjZU1hcEdlbmVyYXRvciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldi50b1N0cmluZygpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdGhpcy5pc01hcChwcmV2KSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocHJldik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5zdXBwb3J0ZWQgcHJldmlvdXMgc291cmNlIG1hcCBmb3JtYXQ6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2LnRvU3RyaW5nKCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMuaW5saW5lICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVjb2RlSW5saW5lKHRoaXMuYW5ub3RhdGlvbik7XG5cbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5hbm5vdGF0aW9uICkge1xuICAgICAgICAgICAgbGV0IG1hcCA9IHRoaXMuYW5ub3RhdGlvbjtcbiAgICAgICAgICAgIGlmICggZmlsZSApIG1hcCA9IHBhdGguam9pbihwYXRoLmRpcm5hbWUoZmlsZSksIG1hcCk7XG5cbiAgICAgICAgICAgIHRoaXMucm9vdCA9IHBhdGguZGlybmFtZShtYXApO1xuICAgICAgICAgICAgaWYgKCBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMobWFwKSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKG1hcCwgJ3V0Zi04JykudG9TdHJpbmcoKS50cmltKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzTWFwKG1hcCkge1xuICAgICAgICBpZiAoIHR5cGVvZiBtYXAgIT09ICdvYmplY3QnICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICByZXR1cm4gdHlwZW9mIG1hcC5tYXBwaW5ncyA9PT0gJ3N0cmluZycgfHxcbiAgICAgICAgICAgICAgIHR5cGVvZiBtYXAuX21hcHBpbmdzID09PSAnc3RyaW5nJztcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFByZXZpb3VzTWFwO1xuIl19
  26609. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10).Buffer))
  26610. /***/ }),
  26611. /* 174 */
  26612. /***/ (function(module, exports, __webpack_require__) {
  26613. "use strict";
  26614. exports.__esModule = true;
  26615. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  26616. var _lazyResult = __webpack_require__(56);
  26617. var _lazyResult2 = _interopRequireDefault(_lazyResult);
  26618. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  26619. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26620. /**
  26621. * Contains plugins to process CSS. Create one `Processor` instance,
  26622. * initialize its plugins, and then use that instance on numerous CSS files.
  26623. *
  26624. * @example
  26625. * const processor = postcss([autoprefixer, precss]);
  26626. * processor.process(css1).then(result => console.log(result.css));
  26627. * processor.process(css2).then(result => console.log(result.css));
  26628. */
  26629. var Processor = function () {
  26630. /**
  26631. * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
  26632. * plugins. See {@link Processor#use} for plugin format.
  26633. */
  26634. function Processor() {
  26635. var plugins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  26636. _classCallCheck(this, Processor);
  26637. /**
  26638. * @member {string} - Current PostCSS version.
  26639. *
  26640. * @example
  26641. * if ( result.processor.version.split('.')[0] !== '6' ) {
  26642. * throw new Error('This plugin works only with PostCSS 6');
  26643. * }
  26644. */
  26645. this.version = '6.0.21';
  26646. /**
  26647. * @member {pluginFunction[]} - Plugins added to this processor.
  26648. *
  26649. * @example
  26650. * const processor = postcss([autoprefixer, precss]);
  26651. * processor.plugins.length //=> 2
  26652. */
  26653. this.plugins = this.normalize(plugins);
  26654. }
  26655. /**
  26656. * Adds a plugin to be used as a CSS processor.
  26657. *
  26658. * PostCSS plugin can be in 4 formats:
  26659. * * A plugin created by {@link postcss.plugin} method.
  26660. * * A function. PostCSS will pass the function a @{link Root}
  26661. * as the first argument and current {@link Result} instance
  26662. * as the second.
  26663. * * An object with a `postcss` method. PostCSS will use that method
  26664. * as described in #2.
  26665. * * Another {@link Processor} instance. PostCSS will copy plugins
  26666. * from that instance into this one.
  26667. *
  26668. * Plugins can also be added by passing them as arguments when creating
  26669. * a `postcss` instance (see [`postcss(plugins)`]).
  26670. *
  26671. * Asynchronous plugins should return a `Promise` instance.
  26672. *
  26673. * @param {Plugin|pluginFunction|Processor} plugin - PostCSS plugin
  26674. * or {@link Processor}
  26675. * with plugins
  26676. *
  26677. * @example
  26678. * const processor = postcss()
  26679. * .use(autoprefixer)
  26680. * .use(precss);
  26681. *
  26682. * @return {Processes} current processor to make methods chain
  26683. */
  26684. Processor.prototype.use = function use(plugin) {
  26685. this.plugins = this.plugins.concat(this.normalize([plugin]));
  26686. return this;
  26687. };
  26688. /**
  26689. * Parses source CSS and returns a {@link LazyResult} Promise proxy.
  26690. * Because some plugins can be asynchronous it doesn’t make
  26691. * any transformations. Transformations will be applied
  26692. * in the {@link LazyResult} methods.
  26693. *
  26694. * @param {string|toString|Result} css - String with input CSS or
  26695. * any object with a `toString()`
  26696. * method, like a Buffer.
  26697. * Optionally, send a {@link Result}
  26698. * instance and the processor will
  26699. * take the {@link Root} from it.
  26700. * @param {processOptions} [opts] - options
  26701. *
  26702. * @return {LazyResult} Promise proxy
  26703. *
  26704. * @example
  26705. * processor.process(css, { from: 'a.css', to: 'a.out.css' })
  26706. * .then(result => {
  26707. * console.log(result.css);
  26708. * });
  26709. */
  26710. Processor.prototype.process = function process(css) {
  26711. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26712. return new _lazyResult2.default(this, css, opts);
  26713. };
  26714. Processor.prototype.normalize = function normalize(plugins) {
  26715. var normalized = [];
  26716. for (var _iterator = plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  26717. var _ref;
  26718. if (_isArray) {
  26719. if (_i >= _iterator.length) break;
  26720. _ref = _iterator[_i++];
  26721. } else {
  26722. _i = _iterator.next();
  26723. if (_i.done) break;
  26724. _ref = _i.value;
  26725. }
  26726. var i = _ref;
  26727. if (i.postcss) i = i.postcss;
  26728. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && Array.isArray(i.plugins)) {
  26729. normalized = normalized.concat(i.plugins);
  26730. } else if (typeof i === 'function') {
  26731. normalized.push(i);
  26732. } else if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && (i.parse || i.stringify)) {
  26733. throw new Error('PostCSS syntaxes cannot be used as plugins. ' + 'Instead, please use one of the ' + 'syntax/parser/stringifier options as ' + 'outlined in your PostCSS ' + 'runner documentation.');
  26734. } else {
  26735. throw new Error(i + ' is not a PostCSS plugin');
  26736. }
  26737. }
  26738. return normalized;
  26739. };
  26740. return Processor;
  26741. }();
  26742. exports.default = Processor;
  26743. /**
  26744. * @callback builder
  26745. * @param {string} part - part of generated CSS connected to this node
  26746. * @param {Node} node - AST node
  26747. * @param {"start"|"end"} [type] - node’s part type
  26748. */
  26749. /**
  26750. * @callback parser
  26751. *
  26752. * @param {string|toString} css - string with input CSS or any object
  26753. * with toString() method, like a Buffer
  26754. * @param {processOptions} [opts] - options with only `from` and `map` keys
  26755. *
  26756. * @return {Root} PostCSS AST
  26757. */
  26758. /**
  26759. * @callback stringifier
  26760. *
  26761. * @param {Node} node - start node for stringifing. Usually {@link Root}.
  26762. * @param {builder} builder - function to concatenate CSS from node’s parts
  26763. * or generate string and source map
  26764. *
  26765. * @return {void}
  26766. */
  26767. /**
  26768. * @typedef {object} syntax
  26769. * @property {parser} parse - function to generate AST by string
  26770. * @property {stringifier} stringify - function to generate string by AST
  26771. */
  26772. /**
  26773. * @typedef {object} toString
  26774. * @property {function} toString
  26775. */
  26776. /**
  26777. * @callback pluginFunction
  26778. * @param {Root} root - parsed input CSS
  26779. * @param {Result} result - result to set warnings or check other plugins
  26780. */
  26781. /**
  26782. * @typedef {object} Plugin
  26783. * @property {function} postcss - PostCSS plugin function
  26784. */
  26785. /**
  26786. * @typedef {object} processOptions
  26787. * @property {string} from - the path of the CSS source file.
  26788. * You should always set `from`,
  26789. * because it is used in source map
  26790. * generation and syntax error messages.
  26791. * @property {string} to - the path where you’ll put the output
  26792. * CSS file. You should always set `to`
  26793. * to generate correct source maps.
  26794. * @property {parser} parser - function to generate AST by string
  26795. * @property {stringifier} stringifier - class to generate string by AST
  26796. * @property {syntax} syntax - object with `parse` and `stringify`
  26797. * @property {object} map - source map options
  26798. * @property {boolean} map.inline - does source map should
  26799. * be embedded in the output
  26800. * CSS as a base64-encoded
  26801. * comment
  26802. * @property {string|object|false|function} map.prev - source map content
  26803. * from a previous
  26804. * processing step
  26805. * (for example, Sass).
  26806. * PostCSS will try to find
  26807. * previous map
  26808. * automatically, so you
  26809. * could disable it by
  26810. * `false` value.
  26811. * @property {boolean} map.sourcesContent - does PostCSS should set
  26812. * the origin content to map
  26813. * @property {string|false} map.annotation - does PostCSS should set
  26814. * annotation comment to map
  26815. * @property {string} map.from - override `from` in map’s
  26816. * `sources`
  26817. */
  26818. module.exports = exports['default'];
  26819. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2Nlc3Nvci5lczYiXSwibmFtZXMiOlsiUHJvY2Vzc29yIiwicGx1Z2lucyIsInZlcnNpb24iLCJub3JtYWxpemUiLCJ1c2UiLCJwbHVnaW4iLCJjb25jYXQiLCJwcm9jZXNzIiwiY3NzIiwib3B0cyIsIm5vcm1hbGl6ZWQiLCJpIiwicG9zdGNzcyIsIkFycmF5IiwiaXNBcnJheSIsInB1c2giLCJwYXJzZSIsInN0cmluZ2lmeSIsIkVycm9yIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7O0lBU01BLFM7O0FBRUY7Ozs7QUFJQSx1QkFBMEI7QUFBQSxRQUFkQyxPQUFjLHVFQUFKLEVBQUk7O0FBQUE7O0FBQ3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3RyaW5nfHRvU3RyaW5nfFJlc3VsdH0gY3NzIC0gU3RyaW5nIHdpdGggaW5wdXQgQ1NTIG9yXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbnkgb2JqZWN0IHdpdGggYSBgdG9TdHJpbmcoKWBcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZCwgbGlrZSBhIEJ1ZmZlci5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wdGlvbmFsbHksIHNlbmQgYSB7QGxpbmsgUmVzdWx0fVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zdGFuY2UgYW5kIHRoZSBwcm9jZXNzb3Igd2lsbFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFrZSB0aGUge0BsaW5rIFJvb3R9IGZyb20gaXQuXG4gICAgICogQHBhcmFtIHtwcm9jZXNzT3B0aW9uc30gW29wdHNdICAgICAgLSBvcHRpb25zXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtMYXp5UmVzdWx0fSBQcm9taXNlIHByb3h5XG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHByb2Nlc3Nvci5wcm9jZXNzKGNzcywgeyBmcm9tOiAnYS5jc3MnLCB0bzogJ2Eub3V0LmNzcycgfSlcbiAgICAgKiAgIC50aGVuKHJlc3VsdCA9PiB7XG4gICAgICogICAgICBjb25zb2xlLmxvZyhyZXN1bHQuY3NzKTtcbiAgICAgKiAgIH0pO1xuICAgICAqL1xuICAgIHByb2Nlc3MoY3NzLCBvcHRzID0geyB9KSB7XG4gICAgICAgIHJldHVybiBuZXcgTGF6eVJlc3VsdCh0aGlzLCBjc3MsIG9wdHMpO1xuICAgIH1cblxuICAgIG5vcm1hbGl6ZShwbHVnaW5zKSB7XG4gICAgICAgIGxldCBub3JtYWxpemVkID0gW107XG4gICAgICAgIGZvciAoIGxldCBpIG9mIHBsdWdpbnMgKSB7XG4gICAgICAgICAgICBpZiAoIGkucG9zdGNzcyApIGkgPSBpLnBvc3Rjc3M7XG5cbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkgPT09ICdvYmplY3QnICYmIEFycmF5LmlzQXJyYXkoaS5wbHVnaW5zKSApIHtcbiAgICAgICAgICAgICAgICBub3JtYWxpemVkID0gbm9ybWFsaXplZC5jb25jYXQoaS5wbHVnaW5zKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiBpID09PSAnZnVuY3Rpb24nICkge1xuICAgICAgICAgICAgICAgIG5vcm1hbGl6ZWQucHVzaChpKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiBpID09PSAnb2JqZWN0JyAmJiAoaS5wYXJzZSB8fCBpLnN0cmluZ2lmeSkgKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdQb3N0Q1NTIHN5bnRheGVzIGNhbm5vdCBiZSB1c2VkIGFzIHBsdWdpbnMuICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnSW5zdGVhZCwgcGxlYXNlIHVzZSBvbmUgb2YgdGhlICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnc3ludGF4L3BhcnNlci9zdHJpbmdpZmllciBvcHRpb25zIGFzICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnb3V0bGluZWQgaW4geW91ciBQb3N0Q1NTICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAncnVubmVyIGRvY3VtZW50YXRpb24uJyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihpICsgJyBpcyBub3QgYSBQb3N0Q1NTIHBsdWdpbicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBub3J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NlZCBpbiBzb3VyY2UgbWFwXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRpb24gYW5kIHN5bnRheCBlcnJvciBtZXNzYWdlcy5cbiAqIEBwcm9wZXJ0eSB7c3RyaW5nfSB0byAgICAgICAgICAgICAgIC0gdGhlIHBhdGggd2hlcmUgeW914oCZbGwgcHV0IHRoZSBvdXRwdXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NTIGZpbGUuIFlvdSBzaG91bGQgYWx3YXlzIHNldCBgdG9gXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIGdlbmVyYXRlIGNvcnJlY3Qgc291cmNlIG1hcHMuXG4gKiBAcHJvcGVydHkge3BhcnNlcn0gcGFyc2VyICAgICAgICAgICAtIGZ1bmN0aW9uIHRvIGdlbmVyYXRlIEFTVCBieSBzdHJpbmdcbiAqIEBwcm9wZXJ0eSB7c3RyaW5naWZpZXJ9IHN0cmluZ2lmaWVyIC0gY2xhc3MgdG8gZ2VuZXJhdGUgc3RyaW5nIGJ5IEFTVFxuICogQHByb3BlcnR5IHtzeW50YXh9IHN5bnRheCAgICAgICAgICAgLSBvYmplY3Qgd2l0aCBgcGFyc2VgIGFuZCBgc3RyaW5naWZ5YFxuICogQHByb3BlcnR5IHtvYmplY3R9IG1hcCAgICAgICAgICAgICAgLSBzb3VyY2UgbWFwIG9wdGlvbnNcbiAqIEBwcm9wZXJ0eSB7Ym9vbGVhbn0gbWFwLmlubGluZSAgICAgICAgICAgICAgICAgICAgLSBkb2VzIHNvdXJjZSBtYXAgc2hvdWxkXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgZW1iZWRkZWQgaW4gdGhlIG91dHB1dFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUyBhcyBhIGJhc2U2NC1lbmNvZGVkXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWVudFxuICogQHByb3BlcnR5IHtzdHJpbmd8b2JqZWN0fGZhbHNlfGZ1bmN0aW9ufSBtYXAucHJldiAtIHNvdXJjZSBtYXAgY29udGVudFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gYSBwcmV2aW91c1xuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3Npbmcgc3RlcFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgZXhhbXBsZSwgU2FzcykuXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG9zdENTUyB3aWxsIHRyeSB0byBmaW5kXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXMgbWFwXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b21hdGljYWxseSwgc28geW91XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bGQgZGlzYWJsZSBpdCBieVxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBmYWxzZWAgdmFsdWUuXG4gKiBAcHJvcGVydHkge2Jvb2xlYW59IG1hcC5zb3VyY2VzQ29udGVudCAgICAgICAgICAgIC0gZG9lcyBQb3N0Q1NTIHNob3VsZCBzZXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgb3JpZ2luIGNvbnRlbnQgdG8gbWFwXG4gKiBAcHJvcGVydHkge3N0cmluZ3xmYWxzZX0gbWFwLmFubm90YXRpb24gICAgICAgICAgIC0gZG9lcyBQb3N0Q1NTIHNob3VsZCBzZXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbm5vdGF0aW9uIGNvbW1lbnQgdG8gbWFwXG4gKiBAcHJvcGVydHkge3N0cmluZ30gbWFwLmZyb20gICAgICAgICAgICAgICAgICAgICAgIC0gb3ZlcnJpZGUgYGZyb21gIGluIG1hcOKAmXNcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgc291cmNlc2BcbiAqL1xuIl19
  26820. /***/ }),
  26821. /* 175 */
  26822. /***/ (function(module, exports, __webpack_require__) {
  26823. "use strict";
  26824. exports.__esModule = true;
  26825. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  26826. var _warning = __webpack_require__(177);
  26827. var _warning2 = _interopRequireDefault(_warning);
  26828. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  26829. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26830. /**
  26831. * Provides the result of the PostCSS transformations.
  26832. *
  26833. * A Result instance is returned by {@link LazyResult#then}
  26834. * or {@link Root#toResult} methods.
  26835. *
  26836. * @example
  26837. * postcss([cssnext]).process(css).then(function (result) {
  26838. * console.log(result.css);
  26839. * });
  26840. *
  26841. * @example
  26842. * var result2 = postcss.parse(css).toResult();
  26843. */
  26844. var Result = function () {
  26845. /**
  26846. * @param {Processor} processor - processor used for this transformation.
  26847. * @param {Root} root - Root node after all transformations.
  26848. * @param {processOptions} opts - options from the {@link Processor#process}
  26849. * or {@link Root#toResult}
  26850. */
  26851. function Result(processor, root, opts) {
  26852. _classCallCheck(this, Result);
  26853. /**
  26854. * @member {Processor} - The Processor instance used
  26855. * for this transformation.
  26856. *
  26857. * @example
  26858. * for ( let plugin of result.processor.plugins) {
  26859. * if ( plugin.postcssPlugin === 'postcss-bad' ) {
  26860. * throw 'postcss-good is incompatible with postcss-bad';
  26861. * }
  26862. * });
  26863. */
  26864. this.processor = processor;
  26865. /**
  26866. * @member {Message[]} - Contains messages from plugins
  26867. * (e.g., warnings or custom messages).
  26868. * Each message should have type
  26869. * and plugin properties.
  26870. *
  26871. * @example
  26872. * postcss.plugin('postcss-min-browser', () => {
  26873. * return (root, result) => {
  26874. * var browsers = detectMinBrowsersByCanIUse(root);
  26875. * result.messages.push({
  26876. * type: 'min-browser',
  26877. * plugin: 'postcss-min-browser',
  26878. * browsers: browsers
  26879. * });
  26880. * };
  26881. * });
  26882. */
  26883. this.messages = [];
  26884. /**
  26885. * @member {Root} - Root node after all transformations.
  26886. *
  26887. * @example
  26888. * root.toResult().root == root;
  26889. */
  26890. this.root = root;
  26891. /**
  26892. * @member {processOptions} - Options from the {@link Processor#process}
  26893. * or {@link Root#toResult} call
  26894. * that produced this Result instance.
  26895. *
  26896. * @example
  26897. * root.toResult(opts).opts == opts;
  26898. */
  26899. this.opts = opts;
  26900. /**
  26901. * @member {string} - A CSS string representing of {@link Result#root}.
  26902. *
  26903. * @example
  26904. * postcss.parse('a{}').toResult().css //=> "a{}"
  26905. */
  26906. this.css = undefined;
  26907. /**
  26908. * @member {SourceMapGenerator} - An instance of `SourceMapGenerator`
  26909. * class from the `source-map` library,
  26910. * representing changes
  26911. * to the {@link Result#root} instance.
  26912. *
  26913. * @example
  26914. * result.map.toJSON() //=> { version: 3, file: 'a.css', … }
  26915. *
  26916. * @example
  26917. * if ( result.map ) {
  26918. * fs.writeFileSync(result.opts.to + '.map', result.map.toString());
  26919. * }
  26920. */
  26921. this.map = undefined;
  26922. }
  26923. /**
  26924. * Returns for @{link Result#css} content.
  26925. *
  26926. * @example
  26927. * result + '' === result.css
  26928. *
  26929. * @return {string} string representing of {@link Result#root}
  26930. */
  26931. Result.prototype.toString = function toString() {
  26932. return this.css;
  26933. };
  26934. /**
  26935. * Creates an instance of {@link Warning} and adds it
  26936. * to {@link Result#messages}.
  26937. *
  26938. * @param {string} text - warning message
  26939. * @param {Object} [opts] - warning options
  26940. * @param {Node} opts.node - CSS node that caused the warning
  26941. * @param {string} opts.word - word in CSS source that caused the warning
  26942. * @param {number} opts.index - index in CSS node string that caused
  26943. * the warning
  26944. * @param {string} opts.plugin - name of the plugin that created
  26945. * this warning. {@link Result#warn} fills
  26946. * this property automatically.
  26947. *
  26948. * @return {Warning} created warning
  26949. */
  26950. Result.prototype.warn = function warn(text) {
  26951. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26952. if (!opts.plugin) {
  26953. if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
  26954. opts.plugin = this.lastPlugin.postcssPlugin;
  26955. }
  26956. }
  26957. var warning = new _warning2.default(text, opts);
  26958. this.messages.push(warning);
  26959. return warning;
  26960. };
  26961. /**
  26962. * Returns warnings from plugins. Filters {@link Warning} instances
  26963. * from {@link Result#messages}.
  26964. *
  26965. * @example
  26966. * result.warnings().forEach(warn => {
  26967. * console.warn(warn.toString());
  26968. * });
  26969. *
  26970. * @return {Warning[]} warnings from plugins
  26971. */
  26972. Result.prototype.warnings = function warnings() {
  26973. return this.messages.filter(function (i) {
  26974. return i.type === 'warning';
  26975. });
  26976. };
  26977. /**
  26978. * An alias for the {@link Result#css} property.
  26979. * Use it with syntaxes that generate non-CSS output.
  26980. * @type {string}
  26981. *
  26982. * @example
  26983. * result.css === result.content;
  26984. */
  26985. _createClass(Result, [{
  26986. key: 'content',
  26987. get: function get() {
  26988. return this.css;
  26989. }
  26990. }]);
  26991. return Result;
  26992. }();
  26993. exports.default = Result;
  26994. /**
  26995. * @typedef {object} Message
  26996. * @property {string} type - message type
  26997. * @property {string} plugin - source PostCSS plugin name
  26998. */
  26999. module.exports = exports['default'];
  27000. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlc3VsdC5lczYiXSwibmFtZXMiOlsiUmVzdWx0IiwicHJvY2Vzc29yIiwicm9vdCIsIm9wdHMiLCJtZXNzYWdlcyIsImNzcyIsInVuZGVmaW5lZCIsIm1hcCIsInRvU3RyaW5nIiwid2FybiIsInRleHQiLCJwbHVnaW4iLCJsYXN0UGx1Z2luIiwicG9zdGNzc1BsdWdpbiIsIndhcm5pbmciLCJwdXNoIiwid2FybmluZ3MiLCJmaWx0ZXIiLCJpIiwidHlwZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7O0lBY01BLE07O0FBRUY7Ozs7OztBQU1BLGtCQUFZQyxTQUFaLEVBQXVCQyxJQUF2QixFQUE2QkMsSUFBN0IsRUFBbUM7QUFBQTs7QUFDL0I7Ozs7Ozs7Ozs7O0FBV0EsU0FBS0YsU0FBTCxHQUFpQkEsU0FBakI7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBa0JBLFNBQUtHLFFBQUwsR0FBZ0IsRUFBaEI7QUFDQTs7Ozs7O0FBTUEsU0FBS0YsSUFBTCxHQUFZQSxJQUFaO0FBQ0E7Ozs7Ozs7O0FBUUEsU0FBS0MsSUFBTCxHQUFZQSxJQUFaO0FBQ0E7Ozs7OztBQU1BLFNBQUtFLEdBQUwsR0FBV0MsU0FBWDtBQUNBOzs7Ozs7Ozs7Ozs7OztBQWNBLFNBQUtDLEdBQUwsR0FBV0QsU0FBWDtBQUNIOztBQUVEOzs7Ozs7Ozs7O21CQVFBRSxRLHVCQUFXO0FBQ1AsV0FBTyxLQUFLSCxHQUFaO0FBQ0gsRzs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0gJ3Bvc3Rjc3MtYmFkJyApIHtcbiAgICAgICAgICogICAgIHRocm93ICdwb3N0Y3NzLWdvb2QgaXMgaW5jb21wYXRpYmxlIHdpdGggcG9zdGNzcy1iYWQnO1xuICAgICAgICAgKiAgIH1cbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnByb2Nlc3NvciA9IHByb2Nlc3NvcjtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge01lc3NhZ2VbXX0gLSBDb250YWlucyBtZXNzYWdlcyBmcm9tIHBsdWdpbnNcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIChlLmcuLCB3YXJuaW5ncyBvciBjdXN0b20gbWVzc2FnZXMpLlxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgRWFjaCBtZXNzYWdlIHNob3VsZCBoYXZlIHR5cGVcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIGFuZCBwbHVnaW4gcHJvcGVydGllcy5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcG9zdGNzcy5wbHVnaW4oJ3Bvc3Rjc3MtbWluLWJyb3dzZXInLCAoKSA9PiB7XG4gICAgICAgICAqICAgcmV0dXJuIChyb290LCByZXN1bHQpID0+IHtcbiAgICAgICAgICogICAgIHZhciBicm93c2VycyA9IGRldGVjdE1pbkJyb3dzZXJzQnlDYW5JVXNlKHJvb3QpO1xuICAgICAgICAgKiAgICAgcmVzdWx0Lm1lc3NhZ2VzLnB1c2goe1xuICAgICAgICAgKiAgICAgICB0eXBlOiAgICAnbWluLWJyb3dzZXInLFxuICAgICAgICAgKiAgICAgICBwbHVnaW46ICAncG9zdGNzcy1taW4tYnJvd3NlcicsXG4gICAgICAgICAqICAgICAgIGJyb3dzZXJzOiBicm93c2Vyc1xuICAgICAgICAgKiAgICAgfSk7XG4gICAgICAgICAqICAgfTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLm1lc3NhZ2VzID0gW107XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtSb290fSAtIFJvb3Qgbm9kZSBhZnRlciBhbGwgdHJhbnNmb3JtYXRpb25zLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KCkucm9vdCA9PSByb290O1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yb290ID0gcm9vdDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3Byb2Nlc3NPcHRpb25zfSAtIE9wdGlvbnMgZnJvbSB0aGUge0BsaW5rIFByb2Nlc3NvciNwcm9jZXNzfVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvciB7QGxpbmsgUm9vdCN0b1Jlc3VsdH0gY2FsbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0IHByb2R1Y2VkIHRoaXMgUmVzdWx0IGluc3RhbmNlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KG9wdHMpLm9wdHMgPT0gb3B0cztcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMub3B0cyA9IG9wdHM7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyBvZiB7QGxpbmsgUmVzdWx0I3Jvb3R9LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiBwb3N0Y3NzLnBhcnNlKCdhe30nKS50b1Jlc3VsdCgpLmNzcyAvLz0+IFwiYXt9XCJcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuY3NzID0gdW5kZWZpbmVkO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7U291cmNlTWFwR2VuZXJhdG9yfSAtIEFuIGluc3RhbmNlIG9mIGBTb3VyY2VNYXBHZW5lcmF0b3JgXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyBmcm9tIHRoZSBgc291cmNlLW1hcGAgbGlicmFyeSxcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcHJlc2VudGluZyBjaGFuZ2VzXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUge0BsaW5rIFJlc3VsdCNyb290fSBpbnN0YW5jZS5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcmVzdWx0Lm1hcC50b0pTT04oKSAvLz0+IHsgdmVyc2lvbjogMywgZmlsZTogJ2EuY3NzJywg4oCmIH1cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogaWYgKCByZXN1bHQubWFwICkge1xuICAgICAgICAgKiAgIGZzLndyaXRlRmlsZVN5bmMocmVzdWx0Lm9wdHMudG8gKyAnLm1hcCcsIHJlc3VsdC5tYXAudG9TdHJpbmcoKSk7XG4gICAgICAgICAqIH1cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubWFwID0gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgZm9yIEB7bGluayBSZXN1bHQjY3NzfSBjb250ZW50LlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiByZXN1bHQgKyAnJyA9PT0gcmVzdWx0LmNzc1xuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBzdHJpbmcgcmVwcmVzZW50aW5nIG9mIHtAbGluayBSZXN1bHQjcm9vdH1cbiAgICAgKi9cbiAgICB0b1N0cmluZygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY3NzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgY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ICYmIHRoaXMubGFzdFBsdWdpbi5wb3N0Y3NzUGx1Z2luICkge1xuICAgICAgICAgICAgICAgIG9wdHMucGx1Z2luID0gdGhpcy5sYXN0UGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgd2FybmluZyA9IG5ldyBXYXJuaW5nKHRleHQsIG9wdHMpO1xuICAgICAgICB0aGlzLm1lc3NhZ2VzLnB1c2god2FybmluZyk7XG5cbiAgICAgICAgcmV0dXJuIHdhcm5pbmc7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyB3YXJuaW5ncyBmcm9tIHBsdWdpbnMuIEZpbHRlcnMge0BsaW5rIFdhcm5pbmd9IGluc3RhbmNlc1xuICAgICAqIGZyb20ge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHJlc3VsdC53YXJuaW5ncygpLmZvckVhY2god2FybiA9PiB7XG4gICAgICogICBjb25zb2xlLndhcm4od2Fybi50b1N0cmluZygpKTtcbiAgICAgKiB9KTtcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1dhcm5pbmdbXX0gd2FybmluZ3MgZnJvbSBwbHVnaW5zXG4gICAgICovXG4gICAgd2FybmluZ3MoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1lc3NhZ2VzLmZpbHRlciggaSA9PiBpLnR5cGUgPT09ICd3YXJuaW5nJyApO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEFuIGFsaWFzIGZvciB0aGUge0BsaW5rIFJlc3VsdCNjc3N9IHByb3BlcnR5LlxuICAgICAqIFVzZSBpdCB3aXRoIHN5bnRheGVzIHRoYXQgZ2VuZXJhdGUgbm9uLUNTUyBvdXRwdXQuXG4gICAgICogQHR5cGUge3N0cmluZ31cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcmVzdWx0LmNzcyA9PT0gcmVzdWx0LmNvbnRlbnQ7XG4gICAgICovXG4gICAgZ2V0IGNvbnRlbnQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNzcztcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUmVzdWx0O1xuXG4vKipcbiAqIEB0eXBlZGVmICB7b2JqZWN0fSBNZXNzYWdlXG4gKiBAcHJvcGVydHkge3N0cmluZ30gdHlwZSAgIC0gbWVzc2FnZSB0eXBlXG4gKiBAcHJvcGVydHkge3N0cmluZ30gcGx1Z2luIC0gc291cmNlIFBvc3RDU1MgcGx1Z2luIG5hbWVcbiAqL1xuIl19
  27001. /***/ }),
  27002. /* 176 */
  27003. /***/ (function(module, exports, __webpack_require__) {
  27004. "use strict";
  27005. exports.__esModule = true;
  27006. var _chalk = __webpack_require__(104);
  27007. var _chalk2 = _interopRequireDefault(_chalk);
  27008. var _tokenize = __webpack_require__(61);
  27009. var _tokenize2 = _interopRequireDefault(_tokenize);
  27010. var _input = __webpack_require__(29);
  27011. var _input2 = _interopRequireDefault(_input);
  27012. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  27013. var HIGHLIGHT_THEME = {
  27014. 'brackets': _chalk2.default.cyan,
  27015. 'at-word': _chalk2.default.cyan,
  27016. 'call': _chalk2.default.cyan,
  27017. 'comment': _chalk2.default.gray,
  27018. 'string': _chalk2.default.green,
  27019. 'class': _chalk2.default.yellow,
  27020. 'hash': _chalk2.default.magenta,
  27021. '(': _chalk2.default.cyan,
  27022. ')': _chalk2.default.cyan,
  27023. '{': _chalk2.default.yellow,
  27024. '}': _chalk2.default.yellow,
  27025. '[': _chalk2.default.yellow,
  27026. ']': _chalk2.default.yellow,
  27027. ':': _chalk2.default.yellow,
  27028. ';': _chalk2.default.yellow
  27029. };
  27030. function getTokenType(_ref, processor) {
  27031. var type = _ref[0],
  27032. value = _ref[1];
  27033. if (type === 'word') {
  27034. if (value[0] === '.') {
  27035. return 'class';
  27036. }
  27037. if (value[0] === '#') {
  27038. return 'hash';
  27039. }
  27040. }
  27041. if (!processor.endOfFile()) {
  27042. var next = processor.nextToken();
  27043. processor.back(next);
  27044. if (next[0] === 'brackets' || next[0] === '(') return 'call';
  27045. }
  27046. return type;
  27047. }
  27048. function terminalHighlight(css) {
  27049. var processor = (0, _tokenize2.default)(new _input2.default(css), { ignoreErrors: true });
  27050. var result = '';
  27051. var _loop = function _loop() {
  27052. var token = processor.nextToken();
  27053. var color = HIGHLIGHT_THEME[getTokenType(token, processor)];
  27054. if (color) {
  27055. result += token[1].split(/\r?\n/).map(function (i) {
  27056. return color(i);
  27057. }).join('\n');
  27058. } else {
  27059. result += token[1];
  27060. }
  27061. };
  27062. while (!processor.endOfFile()) {
  27063. _loop();
  27064. }
  27065. return result;
  27066. }
  27067. exports.default = terminalHighlight;
  27068. module.exports = exports['default'];
  27069. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlcm1pbmFsLWhpZ2hsaWdodC5lczYiXSwibmFtZXMiOlsiSElHSExJR0hUX1RIRU1FIiwiY3lhbiIsImdyYXkiLCJncmVlbiIsInllbGxvdyIsIm1hZ2VudGEiLCJnZXRUb2tlblR5cGUiLCJwcm9jZXNzb3IiLCJ0eXBlIiwidmFsdWUiLCJlbmRPZkZpbGUiLCJuZXh0IiwibmV4dFRva2VuIiwiYmFjayIsInRlcm1pbmFsSGlnaGxpZ2h0IiwiY3NzIiwiaWdub3JlRXJyb3JzIiwicmVzdWx0IiwidG9rZW4iLCJjb2xvciIsInNwbGl0IiwibWFwIiwiaSIsImpvaW4iXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUVBOzs7O0FBQ0E7Ozs7OztBQUVBLElBQU1BLGtCQUFrQjtBQUNwQixnQkFBWSxnQkFBTUMsSUFERTtBQUVwQixlQUFZLGdCQUFNQSxJQUZFO0FBR3BCLFlBQVksZ0JBQU1BLElBSEU7QUFJcEIsZUFBWSxn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2gnOiAgICAgY2hhbGsubWFnZW50YSxcbiAgICAnKCc6ICAgICAgICBjaGFsay5jeWFuLFxuICAgICcpJzogICAgICAgIGNoYWxrLmN5YW4sXG4gICAgJ3snOiAgICAgICAgY2hhbGsueWVsbG93LFxuICAgICd9JzogICAgICAgIGNoYWxrLnllbGxvdyxcbiAgICAnWyc6ICAgICAgICBjaGFsay55ZWxsb3csXG4gICAgJ10nOiAgICAgICAgY2hhbGsueWVsbG93LFxuICAgICc6JzogICAgICAgIGNoYWxrLnllbGxvdyxcbiAgICAnOyc6ICAgICAgICBjaGFsay55ZWxsb3dcbn07XG5cbmZ1bmN0aW9uIGdldFRva2VuVHlwZShbdHlwZSwgdmFsdWVdLCBwcm9jZXNzb3IpIHtcbiAgICBpZiAoIHR5cGUgPT09ICd3b3JkJyApIHtcbiAgICAgICAgaWYgKCB2YWx1ZVswXSA9PT0gJy4nICkge1xuICAgICAgICAgICAgcmV0dXJuICdjbGFzcyc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB2YWx1ZVswXSA9PT0gJyMnICkge1xuICAgICAgICAgICAgcmV0dXJuICdoYXNoJztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICggIXByb2Nlc3Nvci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgbGV0IG5leHQgPSBwcm9jZXNzb3IubmV4dFRva2VuKCk7XG4gICAgICAgIHByb2Nlc3Nvci5iYWNrKG5leHQpO1xuICAgICAgICBpZiAoIG5leHRbMF0gPT09ICdicmFja2V0cycgfHwgbmV4dFswXSA9PT0gJygnICkgcmV0dXJuICdjYWxsJztcbiAgICB9XG5cbiAgICByZXR1cm4gdHlwZTtcbn1cblxuZnVuY3Rpb24gdGVybWluYWxIaWdobGlnaHQoY3NzKSB7XG4gICAgbGV0IHByb2Nlc3NvciA9IHRva2VuaXplcihuZXcgSW5wdXQoY3NzKSwgeyBpZ25vcmVFcnJvcnM6IHRydWUgfSk7XG4gICAgbGV0IHJlc3VsdCA9ICcnO1xuICAgIHdoaWxlICggIXByb2Nlc3Nvci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgbGV0IHRva2VuID0gcHJvY2Vzc29yLm5leHRUb2tlbigpO1xuICAgICAgICBsZXQgY29sb3IgPSBISUdITElHSFRfVEhFTUVbZ2V0VG9rZW5UeXBlKHRva2VuLCBwcm9jZXNzb3IpXTtcbiAgICAgICAgaWYgKCBjb2xvciApIHtcbiAgICAgICAgICAgIHJlc3VsdCArPSB0b2tlblsxXS5zcGxpdCgvXFxyP1xcbi8pXG4gICAgICAgICAgICAgICAgLm1hcCggaSA9PiBjb2xvcihpKSApXG4gICAgICAgICAgICAgICAgLmpvaW4oJ1xcbicpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ICs9IHRva2VuWzFdO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG59XG5cbmV4cG9ydCBkZWZhdWx0IHRlcm1pbmFsSGlnaGxpZ2h0O1xuIl19
  27070. /***/ }),
  27071. /* 177 */
  27072. /***/ (function(module, exports, __webpack_require__) {
  27073. "use strict";
  27074. exports.__esModule = true;
  27075. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27076. /**
  27077. * Represents a plugin’s warning. It can be created using {@link Node#warn}.
  27078. *
  27079. * @example
  27080. * if ( decl.important ) {
  27081. * decl.warn(result, 'Avoid !important', { word: '!important' });
  27082. * }
  27083. */
  27084. var Warning = function () {
  27085. /**
  27086. * @param {string} text - warning message
  27087. * @param {Object} [opts] - warning options
  27088. * @param {Node} opts.node - CSS node that caused the warning
  27089. * @param {string} opts.word - word in CSS source that caused the warning
  27090. * @param {number} opts.index - index in CSS node string that caused
  27091. * the warning
  27092. * @param {string} opts.plugin - name of the plugin that created
  27093. * this warning. {@link Result#warn} fills
  27094. * this property automatically.
  27095. */
  27096. function Warning(text) {
  27097. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  27098. _classCallCheck(this, Warning);
  27099. /**
  27100. * @member {string} - Type to filter warnings from
  27101. * {@link Result#messages}. Always equal
  27102. * to `"warning"`.
  27103. *
  27104. * @example
  27105. * const nonWarning = result.messages.filter(i => i.type !== 'warning')
  27106. */
  27107. this.type = 'warning';
  27108. /**
  27109. * @member {string} - The warning message.
  27110. *
  27111. * @example
  27112. * warning.text //=> 'Try to avoid !important'
  27113. */
  27114. this.text = text;
  27115. if (opts.node && opts.node.source) {
  27116. var pos = opts.node.positionBy(opts);
  27117. /**
  27118. * @member {number} - Line in the input file
  27119. * with this warning’s source
  27120. *
  27121. * @example
  27122. * warning.line //=> 5
  27123. */
  27124. this.line = pos.line;
  27125. /**
  27126. * @member {number} - Column in the input file
  27127. * with this warning’s source.
  27128. *
  27129. * @example
  27130. * warning.column //=> 6
  27131. */
  27132. this.column = pos.column;
  27133. }
  27134. for (var opt in opts) {
  27135. this[opt] = opts[opt];
  27136. }
  27137. }
  27138. /**
  27139. * Returns a warning position and message.
  27140. *
  27141. * @example
  27142. * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
  27143. *
  27144. * @return {string} warning position and message
  27145. */
  27146. Warning.prototype.toString = function toString() {
  27147. if (this.node) {
  27148. return this.node.error(this.text, {
  27149. plugin: this.plugin,
  27150. index: this.index,
  27151. word: this.word
  27152. }).message;
  27153. } else if (this.plugin) {
  27154. return this.plugin + ': ' + this.text;
  27155. } else {
  27156. return this.text;
  27157. }
  27158. };
  27159. /**
  27160. * @memberof Warning#
  27161. * @member {string} plugin - The name of the plugin that created
  27162. * it will fill this property automatically.
  27163. * this warning. When you call {@link Node#warn}
  27164. *
  27165. * @example
  27166. * warning.plugin //=> 'postcss-important'
  27167. */
  27168. /**
  27169. * @memberof Warning#
  27170. * @member {Node} node - Contains the CSS node that caused the warning.
  27171. *
  27172. * @example
  27173. * warning.node.toString() //=> 'color: white !important'
  27174. */
  27175. return Warning;
  27176. }();
  27177. exports.default = Warning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cHRzLndvcmQgICAtIHdvcmQgaW4gQ1NTIHNvdXJjZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZ1xuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBvcHRzLmluZGV4ICAtIGluZGV4IGluIENTUyBub2RlIHN0cmluZyB0aGF0IGNhdXNlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB3YXJuaW5nXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMucGx1Z2luIC0gbmFtZSBvZiB0aGUgcGx1Z2luIHRoYXQgY3JlYXRlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgd2FybmluZy4ge0BsaW5rIFJlc3VsdCN3YXJufSBmaWxsc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgcHJvcGVydHkgYXV0b21hdGljYWxseS5cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3Rvcih0ZXh0LCBvcHRzID0geyB9KSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gVHlwZSB0byBmaWx0ZXIgd2FybmluZ3MgZnJvbVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uIEFsd2F5cyBlcXVhbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgdG8gYFwid2FybmluZ1wiYC5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogY29uc3Qgbm9uV2FybmluZyA9IHJlc3VsdC5tZXNzYWdlcy5maWx0ZXIoaSA9PiBpLnR5cGUgIT09ICd3YXJuaW5nJylcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9ICd3YXJuaW5nJztcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgd2FybmluZyBtZXNzYWdlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiB3YXJuaW5nLnRleHQgLy89PiAnVHJ5IHRvIGF2b2lkICFpbXBvcnRhbnQnXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnRleHQgPSB0ZXh0O1xuXG4gICAgICAgIGlmICggb3B0cy5ub2RlICYmIG9wdHMubm9kZS5zb3VyY2UgKSB7XG4gICAgICAgICAgICBsZXQgcG9zICAgICA9IG9wdHMubm9kZS5wb3NpdGlvbkJ5KG9wdHMpO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gTGluZSBpbiB0aGUgaW5wdXQgZmlsZVxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIHdpdGggdGhpcyB3YXJuaW5n4oCZcyBzb3VyY2VcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5saW5lIC8vPT4gNVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmxpbmUgICA9IHBvcy5saW5lO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gQ29sdW1uIGluIHRoZSBpbnB1dCBmaWxlXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgd2l0aCB0aGlzIHdhcm5pbmfigJlzIHNvdXJjZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5jb2x1bW4gLy89PiA2XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoIGxldCBvcHQgaW4gb3B0cyApIHRoaXNbb3B0XSA9IG9wdHNbb3B0XTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGEgd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZS5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy50b1N0cmluZygpIC8vPT4gJ3Bvc3Rjc3MtbGludDphLmNzczoxMDoxNDogQXZvaWQgIWltcG9ydGFudCdcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZVxuICAgICAqL1xuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICBpZiAoIHRoaXMubm9kZSApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm5vZGUuZXJyb3IodGhpcy50ZXh0LCB7XG4gICAgICAgICAgICAgICAgcGx1Z2luOiB0aGlzLnBsdWdpbixcbiAgICAgICAgICAgICAgICBpbmRleDogIHRoaXMuaW5kZXgsXG4gICAgICAgICAgICAgICAgd29yZDogICB0aGlzLndvcmRcbiAgICAgICAgICAgIH0pLm1lc3NhZ2U7XG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMucGx1Z2luICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGx1Z2luICsgJzogJyArIHRoaXMudGV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgV2FybmluZyNcbiAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IHBsdWdpbiAtIFRoZSBuYW1lIG9mIHRoZSBwbHVnaW4gdGhhdCBjcmVhdGVkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICBpdCB3aWxsIGZpbGwgdGhpcyBwcm9wZXJ0eSBhdXRvbWF0aWNhbGx5LlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyB3YXJuaW5nLiBXaGVuIHlvdSBjYWxsIHtAbGluayBOb2RlI3dhcm59XG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHdhcm5pbmcucGx1Z2luIC8vPT4gJ3Bvc3Rjc3MtaW1wb3J0YW50J1xuICAgICAqL1xuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIFdhcm5pbmcjXG4gICAgICogQG1lbWJlciB7Tm9kZX0gbm9kZSAtIENvbnRhaW5zIHRoZSBDU1Mgbm9kZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy5ub2RlLnRvU3RyaW5nKCkgLy89PiAnY29sb3I6IHdoaXRlICFpbXBvcnRhbnQnXG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgV2FybmluZztcbiJdfQ==
  27180. /***/ }),
  27181. /* 178 */
  27182. /***/ (function(module, exports) {
  27183. /* -*- Mode: js; js-indent-level: 2; -*- */
  27184. /*
  27185. * Copyright 2011 Mozilla Foundation and contributors
  27186. * Licensed under the New BSD license. See LICENSE or:
  27187. * http://opensource.org/licenses/BSD-3-Clause
  27188. */
  27189. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  27190. /**
  27191. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  27192. */
  27193. exports.encode = function (number) {
  27194. if (0 <= number && number < intToCharMap.length) {
  27195. return intToCharMap[number];
  27196. }
  27197. throw new TypeError("Must be between 0 and 63: " + number);
  27198. };
  27199. /**
  27200. * Decode a single base 64 character code digit to an integer. Returns -1 on
  27201. * failure.
  27202. */
  27203. exports.decode = function (charCode) {
  27204. var bigA = 65; // 'A'
  27205. var bigZ = 90; // 'Z'
  27206. var littleA = 97; // 'a'
  27207. var littleZ = 122; // 'z'
  27208. var zero = 48; // '0'
  27209. var nine = 57; // '9'
  27210. var plus = 43; // '+'
  27211. var slash = 47; // '/'
  27212. var littleOffset = 26;
  27213. var numberOffset = 52;
  27214. // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  27215. if (bigA <= charCode && charCode <= bigZ) {
  27216. return (charCode - bigA);
  27217. }
  27218. // 26 - 51: abcdefghijklmnopqrstuvwxyz
  27219. if (littleA <= charCode && charCode <= littleZ) {
  27220. return (charCode - littleA + littleOffset);
  27221. }
  27222. // 52 - 61: 0123456789
  27223. if (zero <= charCode && charCode <= nine) {
  27224. return (charCode - zero + numberOffset);
  27225. }
  27226. // 62: +
  27227. if (charCode == plus) {
  27228. return 62;
  27229. }
  27230. // 63: /
  27231. if (charCode == slash) {
  27232. return 63;
  27233. }
  27234. // Invalid base64 digit.
  27235. return -1;
  27236. };
  27237. /***/ }),
  27238. /* 179 */
  27239. /***/ (function(module, exports) {
  27240. /* -*- Mode: js; js-indent-level: 2; -*- */
  27241. /*
  27242. * Copyright 2011 Mozilla Foundation and contributors
  27243. * Licensed under the New BSD license. See LICENSE or:
  27244. * http://opensource.org/licenses/BSD-3-Clause
  27245. */
  27246. exports.GREATEST_LOWER_BOUND = 1;
  27247. exports.LEAST_UPPER_BOUND = 2;
  27248. /**
  27249. * Recursive implementation of binary search.
  27250. *
  27251. * @param aLow Indices here and lower do not contain the needle.
  27252. * @param aHigh Indices here and higher do not contain the needle.
  27253. * @param aNeedle The element being searched for.
  27254. * @param aHaystack The non-empty array being searched.
  27255. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  27256. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  27257. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  27258. * closest element that is smaller than or greater than the one we are
  27259. * searching for, respectively, if the exact element cannot be found.
  27260. */
  27261. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  27262. // This function terminates when one of the following is true:
  27263. //
  27264. // 1. We find the exact element we are looking for.
  27265. //
  27266. // 2. We did not find the exact element, but we can return the index of
  27267. // the next-closest element.
  27268. //
  27269. // 3. We did not find the exact element, and there is no next-closest
  27270. // element than the one we are searching for, so we return -1.
  27271. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  27272. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  27273. if (cmp === 0) {
  27274. // Found the element we are looking for.
  27275. return mid;
  27276. }
  27277. else if (cmp > 0) {
  27278. // Our needle is greater than aHaystack[mid].
  27279. if (aHigh - mid > 1) {
  27280. // The element is in the upper half.
  27281. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  27282. }
  27283. // The exact needle element was not found in this haystack. Determine if
  27284. // we are in termination case (3) or (2) and return the appropriate thing.
  27285. if (aBias == exports.LEAST_UPPER_BOUND) {
  27286. return aHigh < aHaystack.length ? aHigh : -1;
  27287. } else {
  27288. return mid;
  27289. }
  27290. }
  27291. else {
  27292. // Our needle is less than aHaystack[mid].
  27293. if (mid - aLow > 1) {
  27294. // The element is in the lower half.
  27295. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  27296. }
  27297. // we are in termination case (3) or (2) and return the appropriate thing.
  27298. if (aBias == exports.LEAST_UPPER_BOUND) {
  27299. return mid;
  27300. } else {
  27301. return aLow < 0 ? -1 : aLow;
  27302. }
  27303. }
  27304. }
  27305. /**
  27306. * This is an implementation of binary search which will always try and return
  27307. * the index of the closest element if there is no exact hit. This is because
  27308. * mappings between original and generated line/col pairs are single points,
  27309. * and there is an implicit region between each of them, so a miss just means
  27310. * that you aren't on the very start of a region.
  27311. *
  27312. * @param aNeedle The element you are looking for.
  27313. * @param aHaystack The array that is being searched.
  27314. * @param aCompare A function which takes the needle and an element in the
  27315. * array and returns -1, 0, or 1 depending on whether the needle is less
  27316. * than, equal to, or greater than the element, respectively.
  27317. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  27318. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  27319. * closest element that is smaller than or greater than the one we are
  27320. * searching for, respectively, if the exact element cannot be found.
  27321. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  27322. */
  27323. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  27324. if (aHaystack.length === 0) {
  27325. return -1;
  27326. }
  27327. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
  27328. aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  27329. if (index < 0) {
  27330. return -1;
  27331. }
  27332. // We have found either the exact element, or the next-closest element than
  27333. // the one we are searching for. However, there may be more than one such
  27334. // element. Make sure we always return the smallest of these.
  27335. while (index - 1 >= 0) {
  27336. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  27337. break;
  27338. }
  27339. --index;
  27340. }
  27341. return index;
  27342. };
  27343. /***/ }),
  27344. /* 180 */
  27345. /***/ (function(module, exports, __webpack_require__) {
  27346. /* -*- Mode: js; js-indent-level: 2; -*- */
  27347. /*
  27348. * Copyright 2014 Mozilla Foundation and contributors
  27349. * Licensed under the New BSD license. See LICENSE or:
  27350. * http://opensource.org/licenses/BSD-3-Clause
  27351. */
  27352. var util = __webpack_require__(14);
  27353. /**
  27354. * Determine whether mappingB is after mappingA with respect to generated
  27355. * position.
  27356. */
  27357. function generatedPositionAfter(mappingA, mappingB) {
  27358. // Optimized for most common case
  27359. var lineA = mappingA.generatedLine;
  27360. var lineB = mappingB.generatedLine;
  27361. var columnA = mappingA.generatedColumn;
  27362. var columnB = mappingB.generatedColumn;
  27363. return lineB > lineA || lineB == lineA && columnB >= columnA ||
  27364. util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  27365. }
  27366. /**
  27367. * A data structure to provide a sorted view of accumulated mappings in a
  27368. * performance conscious manner. It trades a neglibable overhead in general
  27369. * case for a large speedup in case of mappings being added in order.
  27370. */
  27371. function MappingList() {
  27372. this._array = [];
  27373. this._sorted = true;
  27374. // Serves as infimum
  27375. this._last = {generatedLine: -1, generatedColumn: 0};
  27376. }
  27377. /**
  27378. * Iterate through internal items. This method takes the same arguments that
  27379. * `Array.prototype.forEach` takes.
  27380. *
  27381. * NOTE: The order of the mappings is NOT guaranteed.
  27382. */
  27383. MappingList.prototype.unsortedForEach =
  27384. function MappingList_forEach(aCallback, aThisArg) {
  27385. this._array.forEach(aCallback, aThisArg);
  27386. };
  27387. /**
  27388. * Add the given source mapping.
  27389. *
  27390. * @param Object aMapping
  27391. */
  27392. MappingList.prototype.add = function MappingList_add(aMapping) {
  27393. if (generatedPositionAfter(this._last, aMapping)) {
  27394. this._last = aMapping;
  27395. this._array.push(aMapping);
  27396. } else {
  27397. this._sorted = false;
  27398. this._array.push(aMapping);
  27399. }
  27400. };
  27401. /**
  27402. * Returns the flat, sorted array of mappings. The mappings are sorted by
  27403. * generated position.
  27404. *
  27405. * WARNING: This method returns internal data without copying, for
  27406. * performance. The return value must NOT be mutated, and should be treated as
  27407. * an immutable borrow. If you want to take ownership, you must make your own
  27408. * copy.
  27409. */
  27410. MappingList.prototype.toArray = function MappingList_toArray() {
  27411. if (!this._sorted) {
  27412. this._array.sort(util.compareByGeneratedPositionsInflated);
  27413. this._sorted = true;
  27414. }
  27415. return this._array;
  27416. };
  27417. exports.MappingList = MappingList;
  27418. /***/ }),
  27419. /* 181 */
  27420. /***/ (function(module, exports) {
  27421. /* -*- Mode: js; js-indent-level: 2; -*- */
  27422. /*
  27423. * Copyright 2011 Mozilla Foundation and contributors
  27424. * Licensed under the New BSD license. See LICENSE or:
  27425. * http://opensource.org/licenses/BSD-3-Clause
  27426. */
  27427. // It turns out that some (most?) JavaScript engines don't self-host
  27428. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  27429. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  27430. // custom comparator function, calling back and forth between the VM's C++ and
  27431. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  27432. // worse generated code for the comparator function than would be optimal. In
  27433. // fact, when sorting with a comparator, these costs outweigh the benefits of
  27434. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  27435. // a ~3500ms mean speed-up in `bench/bench.html`.
  27436. /**
  27437. * Swap the elements indexed by `x` and `y` in the array `ary`.
  27438. *
  27439. * @param {Array} ary
  27440. * The array.
  27441. * @param {Number} x
  27442. * The index of the first item.
  27443. * @param {Number} y
  27444. * The index of the second item.
  27445. */
  27446. function swap(ary, x, y) {
  27447. var temp = ary[x];
  27448. ary[x] = ary[y];
  27449. ary[y] = temp;
  27450. }
  27451. /**
  27452. * Returns a random integer within the range `low .. high` inclusive.
  27453. *
  27454. * @param {Number} low
  27455. * The lower bound on the range.
  27456. * @param {Number} high
  27457. * The upper bound on the range.
  27458. */
  27459. function randomIntInRange(low, high) {
  27460. return Math.round(low + (Math.random() * (high - low)));
  27461. }
  27462. /**
  27463. * The Quick Sort algorithm.
  27464. *
  27465. * @param {Array} ary
  27466. * An array to sort.
  27467. * @param {function} comparator
  27468. * Function to use to compare two items.
  27469. * @param {Number} p
  27470. * Start index of the array
  27471. * @param {Number} r
  27472. * End index of the array
  27473. */
  27474. function doQuickSort(ary, comparator, p, r) {
  27475. // If our lower bound is less than our upper bound, we (1) partition the
  27476. // array into two pieces and (2) recurse on each half. If it is not, this is
  27477. // the empty array and our base case.
  27478. if (p < r) {
  27479. // (1) Partitioning.
  27480. //
  27481. // The partitioning chooses a pivot between `p` and `r` and moves all
  27482. // elements that are less than or equal to the pivot to the before it, and
  27483. // all the elements that are greater than it after it. The effect is that
  27484. // once partition is done, the pivot is in the exact place it will be when
  27485. // the array is put in sorted order, and it will not need to be moved
  27486. // again. This runs in O(n) time.
  27487. // Always choose a random pivot so that an input array which is reverse
  27488. // sorted does not cause O(n^2) running time.
  27489. var pivotIndex = randomIntInRange(p, r);
  27490. var i = p - 1;
  27491. swap(ary, pivotIndex, r);
  27492. var pivot = ary[r];
  27493. // Immediately after `j` is incremented in this loop, the following hold
  27494. // true:
  27495. //
  27496. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  27497. //
  27498. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  27499. for (var j = p; j < r; j++) {
  27500. if (comparator(ary[j], pivot) <= 0) {
  27501. i += 1;
  27502. swap(ary, i, j);
  27503. }
  27504. }
  27505. swap(ary, i + 1, j);
  27506. var q = i + 1;
  27507. // (2) Recurse on each half.
  27508. doQuickSort(ary, comparator, p, q - 1);
  27509. doQuickSort(ary, comparator, q + 1, r);
  27510. }
  27511. }
  27512. /**
  27513. * Sort the given array in-place with the given comparator function.
  27514. *
  27515. * @param {Array} ary
  27516. * An array to sort.
  27517. * @param {function} comparator
  27518. * Function to use to compare two items.
  27519. */
  27520. exports.quickSort = function (ary, comparator) {
  27521. doQuickSort(ary, comparator, 0, ary.length - 1);
  27522. };
  27523. /***/ }),
  27524. /* 182 */
  27525. /***/ (function(module, exports, __webpack_require__) {
  27526. /* -*- Mode: js; js-indent-level: 2; -*- */
  27527. /*
  27528. * Copyright 2011 Mozilla Foundation and contributors
  27529. * Licensed under the New BSD license. See LICENSE or:
  27530. * http://opensource.org/licenses/BSD-3-Clause
  27531. */
  27532. var util = __webpack_require__(14);
  27533. var binarySearch = __webpack_require__(179);
  27534. var ArraySet = __webpack_require__(63).ArraySet;
  27535. var base64VLQ = __webpack_require__(64);
  27536. var quickSort = __webpack_require__(181).quickSort;
  27537. function SourceMapConsumer(aSourceMap, aSourceMapURL) {
  27538. var sourceMap = aSourceMap;
  27539. if (typeof aSourceMap === 'string') {
  27540. sourceMap = util.parseSourceMapInput(aSourceMap);
  27541. }
  27542. return sourceMap.sections != null
  27543. ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
  27544. : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
  27545. }
  27546. SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
  27547. return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
  27548. }
  27549. /**
  27550. * The version of the source mapping spec that we are consuming.
  27551. */
  27552. SourceMapConsumer.prototype._version = 3;
  27553. // `__generatedMappings` and `__originalMappings` are arrays that hold the
  27554. // parsed mapping coordinates from the source map's "mappings" attribute. They
  27555. // are lazily instantiated, accessed via the `_generatedMappings` and
  27556. // `_originalMappings` getters respectively, and we only parse the mappings
  27557. // and create these arrays once queried for a source location. We jump through
  27558. // these hoops because there can be many thousands of mappings, and parsing
  27559. // them is expensive, so we only want to do it if we must.
  27560. //
  27561. // Each object in the arrays is of the form:
  27562. //
  27563. // {
  27564. // generatedLine: The line number in the generated code,
  27565. // generatedColumn: The column number in the generated code,
  27566. // source: The path to the original source file that generated this
  27567. // chunk of code,
  27568. // originalLine: The line number in the original source that
  27569. // corresponds to this chunk of generated code,
  27570. // originalColumn: The column number in the original source that
  27571. // corresponds to this chunk of generated code,
  27572. // name: The name of the original symbol which generated this chunk of
  27573. // code.
  27574. // }
  27575. //
  27576. // All properties except for `generatedLine` and `generatedColumn` can be
  27577. // `null`.
  27578. //
  27579. // `_generatedMappings` is ordered by the generated positions.
  27580. //
  27581. // `_originalMappings` is ordered by the original positions.
  27582. SourceMapConsumer.prototype.__generatedMappings = null;
  27583. Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  27584. configurable: true,
  27585. enumerable: true,
  27586. get: function () {
  27587. if (!this.__generatedMappings) {
  27588. this._parseMappings(this._mappings, this.sourceRoot);
  27589. }
  27590. return this.__generatedMappings;
  27591. }
  27592. });
  27593. SourceMapConsumer.prototype.__originalMappings = null;
  27594. Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  27595. configurable: true,
  27596. enumerable: true,
  27597. get: function () {
  27598. if (!this.__originalMappings) {
  27599. this._parseMappings(this._mappings, this.sourceRoot);
  27600. }
  27601. return this.__originalMappings;
  27602. }
  27603. });
  27604. SourceMapConsumer.prototype._charIsMappingSeparator =
  27605. function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  27606. var c = aStr.charAt(index);
  27607. return c === ";" || c === ",";
  27608. };
  27609. /**
  27610. * Parse the mappings in a string in to a data structure which we can easily
  27611. * query (the ordered arrays in the `this.__generatedMappings` and
  27612. * `this.__originalMappings` properties).
  27613. */
  27614. SourceMapConsumer.prototype._parseMappings =
  27615. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  27616. throw new Error("Subclasses must implement _parseMappings");
  27617. };
  27618. SourceMapConsumer.GENERATED_ORDER = 1;
  27619. SourceMapConsumer.ORIGINAL_ORDER = 2;
  27620. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  27621. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  27622. /**
  27623. * Iterate over each mapping between an original source/line/column and a
  27624. * generated line/column in this source map.
  27625. *
  27626. * @param Function aCallback
  27627. * The function that is called with each mapping.
  27628. * @param Object aContext
  27629. * Optional. If specified, this object will be the value of `this` every
  27630. * time that `aCallback` is called.
  27631. * @param aOrder
  27632. * Either `SourceMapConsumer.GENERATED_ORDER` or
  27633. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  27634. * iterate over the mappings sorted by the generated file's line/column
  27635. * order or the original's source/line/column order, respectively. Defaults to
  27636. * `SourceMapConsumer.GENERATED_ORDER`.
  27637. */
  27638. SourceMapConsumer.prototype.eachMapping =
  27639. function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  27640. var context = aContext || null;
  27641. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  27642. var mappings;
  27643. switch (order) {
  27644. case SourceMapConsumer.GENERATED_ORDER:
  27645. mappings = this._generatedMappings;
  27646. break;
  27647. case SourceMapConsumer.ORIGINAL_ORDER:
  27648. mappings = this._originalMappings;
  27649. break;
  27650. default:
  27651. throw new Error("Unknown order of iteration.");
  27652. }
  27653. var sourceRoot = this.sourceRoot;
  27654. mappings.map(function (mapping) {
  27655. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  27656. source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
  27657. return {
  27658. source: source,
  27659. generatedLine: mapping.generatedLine,
  27660. generatedColumn: mapping.generatedColumn,
  27661. originalLine: mapping.originalLine,
  27662. originalColumn: mapping.originalColumn,
  27663. name: mapping.name === null ? null : this._names.at(mapping.name)
  27664. };
  27665. }, this).forEach(aCallback, context);
  27666. };
  27667. /**
  27668. * Returns all generated line and column information for the original source,
  27669. * line, and column provided. If no column is provided, returns all mappings
  27670. * corresponding to a either the line we are searching for or the next
  27671. * closest line that has any mappings. Otherwise, returns all mappings
  27672. * corresponding to the given line and either the column we are searching for
  27673. * or the next closest column that has any offsets.
  27674. *
  27675. * The only argument is an object with the following properties:
  27676. *
  27677. * - source: The filename of the original source.
  27678. * - line: The line number in the original source. The line number is 1-based.
  27679. * - column: Optional. the column number in the original source.
  27680. * The column number is 0-based.
  27681. *
  27682. * and an array of objects is returned, each with the following properties:
  27683. *
  27684. * - line: The line number in the generated source, or null. The
  27685. * line number is 1-based.
  27686. * - column: The column number in the generated source, or null.
  27687. * The column number is 0-based.
  27688. */
  27689. SourceMapConsumer.prototype.allGeneratedPositionsFor =
  27690. function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  27691. var line = util.getArg(aArgs, 'line');
  27692. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  27693. // returns the index of the closest mapping less than the needle. By
  27694. // setting needle.originalColumn to 0, we thus find the last mapping for
  27695. // the given line, provided such a mapping exists.
  27696. var needle = {
  27697. source: util.getArg(aArgs, 'source'),
  27698. originalLine: line,
  27699. originalColumn: util.getArg(aArgs, 'column', 0)
  27700. };
  27701. needle.source = this._findSourceIndex(needle.source);
  27702. if (needle.source < 0) {
  27703. return [];
  27704. }
  27705. var mappings = [];
  27706. var index = this._findMapping(needle,
  27707. this._originalMappings,
  27708. "originalLine",
  27709. "originalColumn",
  27710. util.compareByOriginalPositions,
  27711. binarySearch.LEAST_UPPER_BOUND);
  27712. if (index >= 0) {
  27713. var mapping = this._originalMappings[index];
  27714. if (aArgs.column === undefined) {
  27715. var originalLine = mapping.originalLine;
  27716. // Iterate until either we run out of mappings, or we run into
  27717. // a mapping for a different line than the one we found. Since
  27718. // mappings are sorted, this is guaranteed to find all mappings for
  27719. // the line we found.
  27720. while (mapping && mapping.originalLine === originalLine) {
  27721. mappings.push({
  27722. line: util.getArg(mapping, 'generatedLine', null),
  27723. column: util.getArg(mapping, 'generatedColumn', null),
  27724. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  27725. });
  27726. mapping = this._originalMappings[++index];
  27727. }
  27728. } else {
  27729. var originalColumn = mapping.originalColumn;
  27730. // Iterate until either we run out of mappings, or we run into
  27731. // a mapping for a different line than the one we were searching for.
  27732. // Since mappings are sorted, this is guaranteed to find all mappings for
  27733. // the line we are searching for.
  27734. while (mapping &&
  27735. mapping.originalLine === line &&
  27736. mapping.originalColumn == originalColumn) {
  27737. mappings.push({
  27738. line: util.getArg(mapping, 'generatedLine', null),
  27739. column: util.getArg(mapping, 'generatedColumn', null),
  27740. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  27741. });
  27742. mapping = this._originalMappings[++index];
  27743. }
  27744. }
  27745. }
  27746. return mappings;
  27747. };
  27748. exports.SourceMapConsumer = SourceMapConsumer;
  27749. /**
  27750. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  27751. * query for information about the original file positions by giving it a file
  27752. * position in the generated source.
  27753. *
  27754. * The first parameter is the raw source map (either as a JSON string, or
  27755. * already parsed to an object). According to the spec, source maps have the
  27756. * following attributes:
  27757. *
  27758. * - version: Which version of the source map spec this map is following.
  27759. * - sources: An array of URLs to the original source files.
  27760. * - names: An array of identifiers which can be referrenced by individual mappings.
  27761. * - sourceRoot: Optional. The URL root from which all sources are relative.
  27762. * - sourcesContent: Optional. An array of contents of the original source files.
  27763. * - mappings: A string of base64 VLQs which contain the actual mappings.
  27764. * - file: Optional. The generated file this source map is associated with.
  27765. *
  27766. * Here is an example source map, taken from the source map spec[0]:
  27767. *
  27768. * {
  27769. * version : 3,
  27770. * file: "out.js",
  27771. * sourceRoot : "",
  27772. * sources: ["foo.js", "bar.js"],
  27773. * names: ["src", "maps", "are", "fun"],
  27774. * mappings: "AA,AB;;ABCDE;"
  27775. * }
  27776. *
  27777. * The second parameter, if given, is a string whose value is the URL
  27778. * at which the source map was found. This URL is used to compute the
  27779. * sources array.
  27780. *
  27781. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  27782. */
  27783. function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
  27784. var sourceMap = aSourceMap;
  27785. if (typeof aSourceMap === 'string') {
  27786. sourceMap = util.parseSourceMapInput(aSourceMap);
  27787. }
  27788. var version = util.getArg(sourceMap, 'version');
  27789. var sources = util.getArg(sourceMap, 'sources');
  27790. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  27791. // requires the array) to play nice here.
  27792. var names = util.getArg(sourceMap, 'names', []);
  27793. var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  27794. var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  27795. var mappings = util.getArg(sourceMap, 'mappings');
  27796. var file = util.getArg(sourceMap, 'file', null);
  27797. // Once again, Sass deviates from the spec and supplies the version as a
  27798. // string rather than a number, so we use loose equality checking here.
  27799. if (version != this._version) {
  27800. throw new Error('Unsupported version: ' + version);
  27801. }
  27802. if (sourceRoot) {
  27803. sourceRoot = util.normalize(sourceRoot);
  27804. }
  27805. sources = sources
  27806. .map(String)
  27807. // Some source maps produce relative source paths like "./foo.js" instead of
  27808. // "foo.js". Normalize these first so that future comparisons will succeed.
  27809. // See bugzil.la/1090768.
  27810. .map(util.normalize)
  27811. // Always ensure that absolute sources are internally stored relative to
  27812. // the source root, if the source root is absolute. Not doing this would
  27813. // be particularly problematic when the source root is a prefix of the
  27814. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  27815. .map(function (source) {
  27816. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
  27817. ? util.relative(sourceRoot, source)
  27818. : source;
  27819. });
  27820. // Pass `true` below to allow duplicate names and sources. While source maps
  27821. // are intended to be compressed and deduplicated, the TypeScript compiler
  27822. // sometimes generates source maps with duplicates in them. See Github issue
  27823. // #72 and bugzil.la/889492.
  27824. this._names = ArraySet.fromArray(names.map(String), true);
  27825. this._sources = ArraySet.fromArray(sources, true);
  27826. this._absoluteSources = this._sources.toArray().map(function (s) {
  27827. return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
  27828. });
  27829. this.sourceRoot = sourceRoot;
  27830. this.sourcesContent = sourcesContent;
  27831. this._mappings = mappings;
  27832. this._sourceMapURL = aSourceMapURL;
  27833. this.file = file;
  27834. }
  27835. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  27836. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  27837. /**
  27838. * Utility function to find the index of a source. Returns -1 if not
  27839. * found.
  27840. */
  27841. BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
  27842. var relativeSource = aSource;
  27843. if (this.sourceRoot != null) {
  27844. relativeSource = util.relative(this.sourceRoot, relativeSource);
  27845. }
  27846. if (this._sources.has(relativeSource)) {
  27847. return this._sources.indexOf(relativeSource);
  27848. }
  27849. // Maybe aSource is an absolute URL as returned by |sources|. In
  27850. // this case we can't simply undo the transform.
  27851. var i;
  27852. for (i = 0; i < this._absoluteSources.length; ++i) {
  27853. if (this._absoluteSources[i] == aSource) {
  27854. return i;
  27855. }
  27856. }
  27857. return -1;
  27858. };
  27859. /**
  27860. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  27861. *
  27862. * @param SourceMapGenerator aSourceMap
  27863. * The source map that will be consumed.
  27864. * @param String aSourceMapURL
  27865. * The URL at which the source map can be found (optional)
  27866. * @returns BasicSourceMapConsumer
  27867. */
  27868. BasicSourceMapConsumer.fromSourceMap =
  27869. function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
  27870. var smc = Object.create(BasicSourceMapConsumer.prototype);
  27871. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  27872. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  27873. smc.sourceRoot = aSourceMap._sourceRoot;
  27874. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
  27875. smc.sourceRoot);
  27876. smc.file = aSourceMap._file;
  27877. smc._sourceMapURL = aSourceMapURL;
  27878. smc._absoluteSources = smc._sources.toArray().map(function (s) {
  27879. return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
  27880. });
  27881. // Because we are modifying the entries (by converting string sources and
  27882. // names to indices into the sources and names ArraySets), we have to make
  27883. // a copy of the entry or else bad things happen. Shared mutable state
  27884. // strikes again! See github issue #191.
  27885. var generatedMappings = aSourceMap._mappings.toArray().slice();
  27886. var destGeneratedMappings = smc.__generatedMappings = [];
  27887. var destOriginalMappings = smc.__originalMappings = [];
  27888. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  27889. var srcMapping = generatedMappings[i];
  27890. var destMapping = new Mapping;
  27891. destMapping.generatedLine = srcMapping.generatedLine;
  27892. destMapping.generatedColumn = srcMapping.generatedColumn;
  27893. if (srcMapping.source) {
  27894. destMapping.source = sources.indexOf(srcMapping.source);
  27895. destMapping.originalLine = srcMapping.originalLine;
  27896. destMapping.originalColumn = srcMapping.originalColumn;
  27897. if (srcMapping.name) {
  27898. destMapping.name = names.indexOf(srcMapping.name);
  27899. }
  27900. destOriginalMappings.push(destMapping);
  27901. }
  27902. destGeneratedMappings.push(destMapping);
  27903. }
  27904. quickSort(smc.__originalMappings, util.compareByOriginalPositions);
  27905. return smc;
  27906. };
  27907. /**
  27908. * The version of the source mapping spec that we are consuming.
  27909. */
  27910. BasicSourceMapConsumer.prototype._version = 3;
  27911. /**
  27912. * The list of original sources.
  27913. */
  27914. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  27915. get: function () {
  27916. return this._absoluteSources.slice();
  27917. }
  27918. });
  27919. /**
  27920. * Provide the JIT with a nice shape / hidden class.
  27921. */
  27922. function Mapping() {
  27923. this.generatedLine = 0;
  27924. this.generatedColumn = 0;
  27925. this.source = null;
  27926. this.originalLine = null;
  27927. this.originalColumn = null;
  27928. this.name = null;
  27929. }
  27930. /**
  27931. * Parse the mappings in a string in to a data structure which we can easily
  27932. * query (the ordered arrays in the `this.__generatedMappings` and
  27933. * `this.__originalMappings` properties).
  27934. */
  27935. BasicSourceMapConsumer.prototype._parseMappings =
  27936. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  27937. var generatedLine = 1;
  27938. var previousGeneratedColumn = 0;
  27939. var previousOriginalLine = 0;
  27940. var previousOriginalColumn = 0;
  27941. var previousSource = 0;
  27942. var previousName = 0;
  27943. var length = aStr.length;
  27944. var index = 0;
  27945. var cachedSegments = {};
  27946. var temp = {};
  27947. var originalMappings = [];
  27948. var generatedMappings = [];
  27949. var mapping, str, segment, end, value;
  27950. while (index < length) {
  27951. if (aStr.charAt(index) === ';') {
  27952. generatedLine++;
  27953. index++;
  27954. previousGeneratedColumn = 0;
  27955. }
  27956. else if (aStr.charAt(index) === ',') {
  27957. index++;
  27958. }
  27959. else {
  27960. mapping = new Mapping();
  27961. mapping.generatedLine = generatedLine;
  27962. // Because each offset is encoded relative to the previous one,
  27963. // many segments often have the same encoding. We can exploit this
  27964. // fact by caching the parsed variable length fields of each segment,
  27965. // allowing us to avoid a second parse if we encounter the same
  27966. // segment again.
  27967. for (end = index; end < length; end++) {
  27968. if (this._charIsMappingSeparator(aStr, end)) {
  27969. break;
  27970. }
  27971. }
  27972. str = aStr.slice(index, end);
  27973. segment = cachedSegments[str];
  27974. if (segment) {
  27975. index += str.length;
  27976. } else {
  27977. segment = [];
  27978. while (index < end) {
  27979. base64VLQ.decode(aStr, index, temp);
  27980. value = temp.value;
  27981. index = temp.rest;
  27982. segment.push(value);
  27983. }
  27984. if (segment.length === 2) {
  27985. throw new Error('Found a source, but no line and column');
  27986. }
  27987. if (segment.length === 3) {
  27988. throw new Error('Found a source and line, but no column');
  27989. }
  27990. cachedSegments[str] = segment;
  27991. }
  27992. // Generated column.
  27993. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  27994. previousGeneratedColumn = mapping.generatedColumn;
  27995. if (segment.length > 1) {
  27996. // Original source.
  27997. mapping.source = previousSource + segment[1];
  27998. previousSource += segment[1];
  27999. // Original line.
  28000. mapping.originalLine = previousOriginalLine + segment[2];
  28001. previousOriginalLine = mapping.originalLine;
  28002. // Lines are stored 0-based
  28003. mapping.originalLine += 1;
  28004. // Original column.
  28005. mapping.originalColumn = previousOriginalColumn + segment[3];
  28006. previousOriginalColumn = mapping.originalColumn;
  28007. if (segment.length > 4) {
  28008. // Original name.
  28009. mapping.name = previousName + segment[4];
  28010. previousName += segment[4];
  28011. }
  28012. }
  28013. generatedMappings.push(mapping);
  28014. if (typeof mapping.originalLine === 'number') {
  28015. originalMappings.push(mapping);
  28016. }
  28017. }
  28018. }
  28019. quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
  28020. this.__generatedMappings = generatedMappings;
  28021. quickSort(originalMappings, util.compareByOriginalPositions);
  28022. this.__originalMappings = originalMappings;
  28023. };
  28024. /**
  28025. * Find the mapping that best matches the hypothetical "needle" mapping that
  28026. * we are searching for in the given "haystack" of mappings.
  28027. */
  28028. BasicSourceMapConsumer.prototype._findMapping =
  28029. function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
  28030. aColumnName, aComparator, aBias) {
  28031. // To return the position we are searching for, we must first find the
  28032. // mapping for the given position and then return the opposite position it
  28033. // points to. Because the mappings are sorted, we can use binary search to
  28034. // find the best mapping.
  28035. if (aNeedle[aLineName] <= 0) {
  28036. throw new TypeError('Line must be greater than or equal to 1, got '
  28037. + aNeedle[aLineName]);
  28038. }
  28039. if (aNeedle[aColumnName] < 0) {
  28040. throw new TypeError('Column must be greater than or equal to 0, got '
  28041. + aNeedle[aColumnName]);
  28042. }
  28043. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  28044. };
  28045. /**
  28046. * Compute the last column for each generated mapping. The last column is
  28047. * inclusive.
  28048. */
  28049. BasicSourceMapConsumer.prototype.computeColumnSpans =
  28050. function SourceMapConsumer_computeColumnSpans() {
  28051. for (var index = 0; index < this._generatedMappings.length; ++index) {
  28052. var mapping = this._generatedMappings[index];
  28053. // Mappings do not contain a field for the last generated columnt. We
  28054. // can come up with an optimistic estimate, however, by assuming that
  28055. // mappings are contiguous (i.e. given two consecutive mappings, the
  28056. // first mapping ends where the second one starts).
  28057. if (index + 1 < this._generatedMappings.length) {
  28058. var nextMapping = this._generatedMappings[index + 1];
  28059. if (mapping.generatedLine === nextMapping.generatedLine) {
  28060. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  28061. continue;
  28062. }
  28063. }
  28064. // The last mapping for each line spans the entire line.
  28065. mapping.lastGeneratedColumn = Infinity;
  28066. }
  28067. };
  28068. /**
  28069. * Returns the original source, line, and column information for the generated
  28070. * source's line and column positions provided. The only argument is an object
  28071. * with the following properties:
  28072. *
  28073. * - line: The line number in the generated source. The line number
  28074. * is 1-based.
  28075. * - column: The column number in the generated source. The column
  28076. * number is 0-based.
  28077. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  28078. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  28079. * closest element that is smaller than or greater than the one we are
  28080. * searching for, respectively, if the exact element cannot be found.
  28081. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  28082. *
  28083. * and an object is returned with the following properties:
  28084. *
  28085. * - source: The original source file, or null.
  28086. * - line: The line number in the original source, or null. The
  28087. * line number is 1-based.
  28088. * - column: The column number in the original source, or null. The
  28089. * column number is 0-based.
  28090. * - name: The original identifier, or null.
  28091. */
  28092. BasicSourceMapConsumer.prototype.originalPositionFor =
  28093. function SourceMapConsumer_originalPositionFor(aArgs) {
  28094. var needle = {
  28095. generatedLine: util.getArg(aArgs, 'line'),
  28096. generatedColumn: util.getArg(aArgs, 'column')
  28097. };
  28098. var index = this._findMapping(
  28099. needle,
  28100. this._generatedMappings,
  28101. "generatedLine",
  28102. "generatedColumn",
  28103. util.compareByGeneratedPositionsDeflated,
  28104. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  28105. );
  28106. if (index >= 0) {
  28107. var mapping = this._generatedMappings[index];
  28108. if (mapping.generatedLine === needle.generatedLine) {
  28109. var source = util.getArg(mapping, 'source', null);
  28110. if (source !== null) {
  28111. source = this._sources.at(source);
  28112. source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
  28113. }
  28114. var name = util.getArg(mapping, 'name', null);
  28115. if (name !== null) {
  28116. name = this._names.at(name);
  28117. }
  28118. return {
  28119. source: source,
  28120. line: util.getArg(mapping, 'originalLine', null),
  28121. column: util.getArg(mapping, 'originalColumn', null),
  28122. name: name
  28123. };
  28124. }
  28125. }
  28126. return {
  28127. source: null,
  28128. line: null,
  28129. column: null,
  28130. name: null
  28131. };
  28132. };
  28133. /**
  28134. * Return true if we have the source content for every source in the source
  28135. * map, false otherwise.
  28136. */
  28137. BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  28138. function BasicSourceMapConsumer_hasContentsOfAllSources() {
  28139. if (!this.sourcesContent) {
  28140. return false;
  28141. }
  28142. return this.sourcesContent.length >= this._sources.size() &&
  28143. !this.sourcesContent.some(function (sc) { return sc == null; });
  28144. };
  28145. /**
  28146. * Returns the original source content. The only argument is the url of the
  28147. * original source file. Returns null if no original source content is
  28148. * available.
  28149. */
  28150. BasicSourceMapConsumer.prototype.sourceContentFor =
  28151. function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  28152. if (!this.sourcesContent) {
  28153. return null;
  28154. }
  28155. var index = this._findSourceIndex(aSource);
  28156. if (index >= 0) {
  28157. return this.sourcesContent[index];
  28158. }
  28159. var relativeSource = aSource;
  28160. if (this.sourceRoot != null) {
  28161. relativeSource = util.relative(this.sourceRoot, relativeSource);
  28162. }
  28163. var url;
  28164. if (this.sourceRoot != null
  28165. && (url = util.urlParse(this.sourceRoot))) {
  28166. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  28167. // many users. We can help them out when they expect file:// URIs to
  28168. // behave like it would if they were running a local HTTP server. See
  28169. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  28170. var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
  28171. if (url.scheme == "file"
  28172. && this._sources.has(fileUriAbsPath)) {
  28173. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
  28174. }
  28175. if ((!url.path || url.path == "/")
  28176. && this._sources.has("/" + relativeSource)) {
  28177. return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
  28178. }
  28179. }
  28180. // This function is used recursively from
  28181. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  28182. // don't want to throw if we can't find the source - we just want to
  28183. // return null, so we provide a flag to exit gracefully.
  28184. if (nullOnMissing) {
  28185. return null;
  28186. }
  28187. else {
  28188. throw new Error('"' + relativeSource + '" is not in the SourceMap.');
  28189. }
  28190. };
  28191. /**
  28192. * Returns the generated line and column information for the original source,
  28193. * line, and column positions provided. The only argument is an object with
  28194. * the following properties:
  28195. *
  28196. * - source: The filename of the original source.
  28197. * - line: The line number in the original source. The line number
  28198. * is 1-based.
  28199. * - column: The column number in the original source. The column
  28200. * number is 0-based.
  28201. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  28202. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  28203. * closest element that is smaller than or greater than the one we are
  28204. * searching for, respectively, if the exact element cannot be found.
  28205. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  28206. *
  28207. * and an object is returned with the following properties:
  28208. *
  28209. * - line: The line number in the generated source, or null. The
  28210. * line number is 1-based.
  28211. * - column: The column number in the generated source, or null.
  28212. * The column number is 0-based.
  28213. */
  28214. BasicSourceMapConsumer.prototype.generatedPositionFor =
  28215. function SourceMapConsumer_generatedPositionFor(aArgs) {
  28216. var source = util.getArg(aArgs, 'source');
  28217. source = this._findSourceIndex(source);
  28218. if (source < 0) {
  28219. return {
  28220. line: null,
  28221. column: null,
  28222. lastColumn: null
  28223. };
  28224. }
  28225. var needle = {
  28226. source: source,
  28227. originalLine: util.getArg(aArgs, 'line'),
  28228. originalColumn: util.getArg(aArgs, 'column')
  28229. };
  28230. var index = this._findMapping(
  28231. needle,
  28232. this._originalMappings,
  28233. "originalLine",
  28234. "originalColumn",
  28235. util.compareByOriginalPositions,
  28236. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  28237. );
  28238. if (index >= 0) {
  28239. var mapping = this._originalMappings[index];
  28240. if (mapping.source === needle.source) {
  28241. return {
  28242. line: util.getArg(mapping, 'generatedLine', null),
  28243. column: util.getArg(mapping, 'generatedColumn', null),
  28244. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  28245. };
  28246. }
  28247. }
  28248. return {
  28249. line: null,
  28250. column: null,
  28251. lastColumn: null
  28252. };
  28253. };
  28254. exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
  28255. /**
  28256. * An IndexedSourceMapConsumer instance represents a parsed source map which
  28257. * we can query for information. It differs from BasicSourceMapConsumer in
  28258. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  28259. * input.
  28260. *
  28261. * The first parameter is a raw source map (either as a JSON string, or already
  28262. * parsed to an object). According to the spec for indexed source maps, they
  28263. * have the following attributes:
  28264. *
  28265. * - version: Which version of the source map spec this map is following.
  28266. * - file: Optional. The generated file this source map is associated with.
  28267. * - sections: A list of section definitions.
  28268. *
  28269. * Each value under the "sections" field has two fields:
  28270. * - offset: The offset into the original specified at which this section
  28271. * begins to apply, defined as an object with a "line" and "column"
  28272. * field.
  28273. * - map: A source map definition. This source map could also be indexed,
  28274. * but doesn't have to be.
  28275. *
  28276. * Instead of the "map" field, it's also possible to have a "url" field
  28277. * specifying a URL to retrieve a source map from, but that's currently
  28278. * unsupported.
  28279. *
  28280. * Here's an example source map, taken from the source map spec[0], but
  28281. * modified to omit a section which uses the "url" field.
  28282. *
  28283. * {
  28284. * version : 3,
  28285. * file: "app.js",
  28286. * sections: [{
  28287. * offset: {line:100, column:10},
  28288. * map: {
  28289. * version : 3,
  28290. * file: "section.js",
  28291. * sources: ["foo.js", "bar.js"],
  28292. * names: ["src", "maps", "are", "fun"],
  28293. * mappings: "AAAA,E;;ABCDE;"
  28294. * }
  28295. * }],
  28296. * }
  28297. *
  28298. * The second parameter, if given, is a string whose value is the URL
  28299. * at which the source map was found. This URL is used to compute the
  28300. * sources array.
  28301. *
  28302. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  28303. */
  28304. function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
  28305. var sourceMap = aSourceMap;
  28306. if (typeof aSourceMap === 'string') {
  28307. sourceMap = util.parseSourceMapInput(aSourceMap);
  28308. }
  28309. var version = util.getArg(sourceMap, 'version');
  28310. var sections = util.getArg(sourceMap, 'sections');
  28311. if (version != this._version) {
  28312. throw new Error('Unsupported version: ' + version);
  28313. }
  28314. this._sources = new ArraySet();
  28315. this._names = new ArraySet();
  28316. var lastOffset = {
  28317. line: -1,
  28318. column: 0
  28319. };
  28320. this._sections = sections.map(function (s) {
  28321. if (s.url) {
  28322. // The url field will require support for asynchronicity.
  28323. // See https://github.com/mozilla/source-map/issues/16
  28324. throw new Error('Support for url field in sections not implemented.');
  28325. }
  28326. var offset = util.getArg(s, 'offset');
  28327. var offsetLine = util.getArg(offset, 'line');
  28328. var offsetColumn = util.getArg(offset, 'column');
  28329. if (offsetLine < lastOffset.line ||
  28330. (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
  28331. throw new Error('Section offsets must be ordered and non-overlapping.');
  28332. }
  28333. lastOffset = offset;
  28334. return {
  28335. generatedOffset: {
  28336. // The offset fields are 0-based, but we use 1-based indices when
  28337. // encoding/decoding from VLQ.
  28338. generatedLine: offsetLine + 1,
  28339. generatedColumn: offsetColumn + 1
  28340. },
  28341. consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
  28342. }
  28343. });
  28344. }
  28345. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  28346. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
  28347. /**
  28348. * The version of the source mapping spec that we are consuming.
  28349. */
  28350. IndexedSourceMapConsumer.prototype._version = 3;
  28351. /**
  28352. * The list of original sources.
  28353. */
  28354. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  28355. get: function () {
  28356. var sources = [];
  28357. for (var i = 0; i < this._sections.length; i++) {
  28358. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  28359. sources.push(this._sections[i].consumer.sources[j]);
  28360. }
  28361. }
  28362. return sources;
  28363. }
  28364. });
  28365. /**
  28366. * Returns the original source, line, and column information for the generated
  28367. * source's line and column positions provided. The only argument is an object
  28368. * with the following properties:
  28369. *
  28370. * - line: The line number in the generated source. The line number
  28371. * is 1-based.
  28372. * - column: The column number in the generated source. The column
  28373. * number is 0-based.
  28374. *
  28375. * and an object is returned with the following properties:
  28376. *
  28377. * - source: The original source file, or null.
  28378. * - line: The line number in the original source, or null. The
  28379. * line number is 1-based.
  28380. * - column: The column number in the original source, or null. The
  28381. * column number is 0-based.
  28382. * - name: The original identifier, or null.
  28383. */
  28384. IndexedSourceMapConsumer.prototype.originalPositionFor =
  28385. function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  28386. var needle = {
  28387. generatedLine: util.getArg(aArgs, 'line'),
  28388. generatedColumn: util.getArg(aArgs, 'column')
  28389. };
  28390. // Find the section containing the generated position we're trying to map
  28391. // to an original position.
  28392. var sectionIndex = binarySearch.search(needle, this._sections,
  28393. function(needle, section) {
  28394. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  28395. if (cmp) {
  28396. return cmp;
  28397. }
  28398. return (needle.generatedColumn -
  28399. section.generatedOffset.generatedColumn);
  28400. });
  28401. var section = this._sections[sectionIndex];
  28402. if (!section) {
  28403. return {
  28404. source: null,
  28405. line: null,
  28406. column: null,
  28407. name: null
  28408. };
  28409. }
  28410. return section.consumer.originalPositionFor({
  28411. line: needle.generatedLine -
  28412. (section.generatedOffset.generatedLine - 1),
  28413. column: needle.generatedColumn -
  28414. (section.generatedOffset.generatedLine === needle.generatedLine
  28415. ? section.generatedOffset.generatedColumn - 1
  28416. : 0),
  28417. bias: aArgs.bias
  28418. });
  28419. };
  28420. /**
  28421. * Return true if we have the source content for every source in the source
  28422. * map, false otherwise.
  28423. */
  28424. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  28425. function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  28426. return this._sections.every(function (s) {
  28427. return s.consumer.hasContentsOfAllSources();
  28428. });
  28429. };
  28430. /**
  28431. * Returns the original source content. The only argument is the url of the
  28432. * original source file. Returns null if no original source content is
  28433. * available.
  28434. */
  28435. IndexedSourceMapConsumer.prototype.sourceContentFor =
  28436. function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  28437. for (var i = 0; i < this._sections.length; i++) {
  28438. var section = this._sections[i];
  28439. var content = section.consumer.sourceContentFor(aSource, true);
  28440. if (content) {
  28441. return content;
  28442. }
  28443. }
  28444. if (nullOnMissing) {
  28445. return null;
  28446. }
  28447. else {
  28448. throw new Error('"' + aSource + '" is not in the SourceMap.');
  28449. }
  28450. };
  28451. /**
  28452. * Returns the generated line and column information for the original source,
  28453. * line, and column positions provided. The only argument is an object with
  28454. * the following properties:
  28455. *
  28456. * - source: The filename of the original source.
  28457. * - line: The line number in the original source. The line number
  28458. * is 1-based.
  28459. * - column: The column number in the original source. The column
  28460. * number is 0-based.
  28461. *
  28462. * and an object is returned with the following properties:
  28463. *
  28464. * - line: The line number in the generated source, or null. The
  28465. * line number is 1-based.
  28466. * - column: The column number in the generated source, or null.
  28467. * The column number is 0-based.
  28468. */
  28469. IndexedSourceMapConsumer.prototype.generatedPositionFor =
  28470. function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  28471. for (var i = 0; i < this._sections.length; i++) {
  28472. var section = this._sections[i];
  28473. // Only consider this section if the requested source is in the list of
  28474. // sources of the consumer.
  28475. if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
  28476. continue;
  28477. }
  28478. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  28479. if (generatedPosition) {
  28480. var ret = {
  28481. line: generatedPosition.line +
  28482. (section.generatedOffset.generatedLine - 1),
  28483. column: generatedPosition.column +
  28484. (section.generatedOffset.generatedLine === generatedPosition.line
  28485. ? section.generatedOffset.generatedColumn - 1
  28486. : 0)
  28487. };
  28488. return ret;
  28489. }
  28490. }
  28491. return {
  28492. line: null,
  28493. column: null
  28494. };
  28495. };
  28496. /**
  28497. * Parse the mappings in a string in to a data structure which we can easily
  28498. * query (the ordered arrays in the `this.__generatedMappings` and
  28499. * `this.__originalMappings` properties).
  28500. */
  28501. IndexedSourceMapConsumer.prototype._parseMappings =
  28502. function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  28503. this.__generatedMappings = [];
  28504. this.__originalMappings = [];
  28505. for (var i = 0; i < this._sections.length; i++) {
  28506. var section = this._sections[i];
  28507. var sectionMappings = section.consumer._generatedMappings;
  28508. for (var j = 0; j < sectionMappings.length; j++) {
  28509. var mapping = sectionMappings[j];
  28510. var source = section.consumer._sources.at(mapping.source);
  28511. source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
  28512. this._sources.add(source);
  28513. source = this._sources.indexOf(source);
  28514. var name = null;
  28515. if (mapping.name) {
  28516. name = section.consumer._names.at(mapping.name);
  28517. this._names.add(name);
  28518. name = this._names.indexOf(name);
  28519. }
  28520. // The mappings coming from the consumer for the section have
  28521. // generated positions relative to the start of the section, so we
  28522. // need to offset them to be relative to the start of the concatenated
  28523. // generated file.
  28524. var adjustedMapping = {
  28525. source: source,
  28526. generatedLine: mapping.generatedLine +
  28527. (section.generatedOffset.generatedLine - 1),
  28528. generatedColumn: mapping.generatedColumn +
  28529. (section.generatedOffset.generatedLine === mapping.generatedLine
  28530. ? section.generatedOffset.generatedColumn - 1
  28531. : 0),
  28532. originalLine: mapping.originalLine,
  28533. originalColumn: mapping.originalColumn,
  28534. name: name
  28535. };
  28536. this.__generatedMappings.push(adjustedMapping);
  28537. if (typeof adjustedMapping.originalLine === 'number') {
  28538. this.__originalMappings.push(adjustedMapping);
  28539. }
  28540. }
  28541. }
  28542. quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
  28543. quickSort(this.__originalMappings, util.compareByOriginalPositions);
  28544. };
  28545. exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  28546. /***/ }),
  28547. /* 183 */
  28548. /***/ (function(module, exports, __webpack_require__) {
  28549. /* -*- Mode: js; js-indent-level: 2; -*- */
  28550. /*
  28551. * Copyright 2011 Mozilla Foundation and contributors
  28552. * Licensed under the New BSD license. See LICENSE or:
  28553. * http://opensource.org/licenses/BSD-3-Clause
  28554. */
  28555. var SourceMapGenerator = __webpack_require__(65).SourceMapGenerator;
  28556. var util = __webpack_require__(14);
  28557. // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  28558. // operating systems these days (capturing the result).
  28559. var REGEX_NEWLINE = /(\r?\n)/;
  28560. // Newline character code for charCodeAt() comparisons
  28561. var NEWLINE_CODE = 10;
  28562. // Private symbol for identifying `SourceNode`s when multiple versions of
  28563. // the source-map library are loaded. This MUST NOT CHANGE across
  28564. // versions!
  28565. var isSourceNode = "$$$isSourceNode$$$";
  28566. /**
  28567. * SourceNodes provide a way to abstract over interpolating/concatenating
  28568. * snippets of generated JavaScript source code while maintaining the line and
  28569. * column information associated with the original source code.
  28570. *
  28571. * @param aLine The original line number.
  28572. * @param aColumn The original column number.
  28573. * @param aSource The original source's filename.
  28574. * @param aChunks Optional. An array of strings which are snippets of
  28575. * generated JS, or other SourceNodes.
  28576. * @param aName The original identifier.
  28577. */
  28578. function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  28579. this.children = [];
  28580. this.sourceContents = {};
  28581. this.line = aLine == null ? null : aLine;
  28582. this.column = aColumn == null ? null : aColumn;
  28583. this.source = aSource == null ? null : aSource;
  28584. this.name = aName == null ? null : aName;
  28585. this[isSourceNode] = true;
  28586. if (aChunks != null) this.add(aChunks);
  28587. }
  28588. /**
  28589. * Creates a SourceNode from generated code and a SourceMapConsumer.
  28590. *
  28591. * @param aGeneratedCode The generated code
  28592. * @param aSourceMapConsumer The SourceMap for the generated code
  28593. * @param aRelativePath Optional. The path that relative sources in the
  28594. * SourceMapConsumer should be relative to.
  28595. */
  28596. SourceNode.fromStringWithSourceMap =
  28597. function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  28598. // The SourceNode we want to fill with the generated code
  28599. // and the SourceMap
  28600. var node = new SourceNode();
  28601. // All even indices of this array are one line of the generated code,
  28602. // while all odd indices are the newlines between two adjacent lines
  28603. // (since `REGEX_NEWLINE` captures its match).
  28604. // Processed fragments are accessed by calling `shiftNextLine`.
  28605. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  28606. var remainingLinesIndex = 0;
  28607. var shiftNextLine = function() {
  28608. var lineContents = getNextLine();
  28609. // The last line of a file might not have a newline.
  28610. var newLine = getNextLine() || "";
  28611. return lineContents + newLine;
  28612. function getNextLine() {
  28613. return remainingLinesIndex < remainingLines.length ?
  28614. remainingLines[remainingLinesIndex++] : undefined;
  28615. }
  28616. };
  28617. // We need to remember the position of "remainingLines"
  28618. var lastGeneratedLine = 1, lastGeneratedColumn = 0;
  28619. // The generate SourceNodes we need a code range.
  28620. // To extract it current and last mapping is used.
  28621. // Here we store the last mapping.
  28622. var lastMapping = null;
  28623. aSourceMapConsumer.eachMapping(function (mapping) {
  28624. if (lastMapping !== null) {
  28625. // We add the code from "lastMapping" to "mapping":
  28626. // First check if there is a new line in between.
  28627. if (lastGeneratedLine < mapping.generatedLine) {
  28628. // Associate first line with "lastMapping"
  28629. addMappingWithCode(lastMapping, shiftNextLine());
  28630. lastGeneratedLine++;
  28631. lastGeneratedColumn = 0;
  28632. // The remaining code is added without mapping
  28633. } else {
  28634. // There is no new line in between.
  28635. // Associate the code between "lastGeneratedColumn" and
  28636. // "mapping.generatedColumn" with "lastMapping"
  28637. var nextLine = remainingLines[remainingLinesIndex] || '';
  28638. var code = nextLine.substr(0, mapping.generatedColumn -
  28639. lastGeneratedColumn);
  28640. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
  28641. lastGeneratedColumn);
  28642. lastGeneratedColumn = mapping.generatedColumn;
  28643. addMappingWithCode(lastMapping, code);
  28644. // No more remaining code, continue
  28645. lastMapping = mapping;
  28646. return;
  28647. }
  28648. }
  28649. // We add the generated code until the first mapping
  28650. // to the SourceNode without any mapping.
  28651. // Each line is added as separate string.
  28652. while (lastGeneratedLine < mapping.generatedLine) {
  28653. node.add(shiftNextLine());
  28654. lastGeneratedLine++;
  28655. }
  28656. if (lastGeneratedColumn < mapping.generatedColumn) {
  28657. var nextLine = remainingLines[remainingLinesIndex] || '';
  28658. node.add(nextLine.substr(0, mapping.generatedColumn));
  28659. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
  28660. lastGeneratedColumn = mapping.generatedColumn;
  28661. }
  28662. lastMapping = mapping;
  28663. }, this);
  28664. // We have processed all mappings.
  28665. if (remainingLinesIndex < remainingLines.length) {
  28666. if (lastMapping) {
  28667. // Associate the remaining code in the current line with "lastMapping"
  28668. addMappingWithCode(lastMapping, shiftNextLine());
  28669. }
  28670. // and add the remaining lines without any mapping
  28671. node.add(remainingLines.splice(remainingLinesIndex).join(""));
  28672. }
  28673. // Copy sourcesContent into SourceNode
  28674. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  28675. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  28676. if (content != null) {
  28677. if (aRelativePath != null) {
  28678. sourceFile = util.join(aRelativePath, sourceFile);
  28679. }
  28680. node.setSourceContent(sourceFile, content);
  28681. }
  28682. });
  28683. return node;
  28684. function addMappingWithCode(mapping, code) {
  28685. if (mapping === null || mapping.source === undefined) {
  28686. node.add(code);
  28687. } else {
  28688. var source = aRelativePath
  28689. ? util.join(aRelativePath, mapping.source)
  28690. : mapping.source;
  28691. node.add(new SourceNode(mapping.originalLine,
  28692. mapping.originalColumn,
  28693. source,
  28694. code,
  28695. mapping.name));
  28696. }
  28697. }
  28698. };
  28699. /**
  28700. * Add a chunk of generated JS to this source node.
  28701. *
  28702. * @param aChunk A string snippet of generated JS code, another instance of
  28703. * SourceNode, or an array where each member is one of those things.
  28704. */
  28705. SourceNode.prototype.add = function SourceNode_add(aChunk) {
  28706. if (Array.isArray(aChunk)) {
  28707. aChunk.forEach(function (chunk) {
  28708. this.add(chunk);
  28709. }, this);
  28710. }
  28711. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  28712. if (aChunk) {
  28713. this.children.push(aChunk);
  28714. }
  28715. }
  28716. else {
  28717. throw new TypeError(
  28718. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  28719. );
  28720. }
  28721. return this;
  28722. };
  28723. /**
  28724. * Add a chunk of generated JS to the beginning of this source node.
  28725. *
  28726. * @param aChunk A string snippet of generated JS code, another instance of
  28727. * SourceNode, or an array where each member is one of those things.
  28728. */
  28729. SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  28730. if (Array.isArray(aChunk)) {
  28731. for (var i = aChunk.length-1; i >= 0; i--) {
  28732. this.prepend(aChunk[i]);
  28733. }
  28734. }
  28735. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  28736. this.children.unshift(aChunk);
  28737. }
  28738. else {
  28739. throw new TypeError(
  28740. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  28741. );
  28742. }
  28743. return this;
  28744. };
  28745. /**
  28746. * Walk over the tree of JS snippets in this node and its children. The
  28747. * walking function is called once for each snippet of JS and is passed that
  28748. * snippet and the its original associated source's line/column location.
  28749. *
  28750. * @param aFn The traversal function.
  28751. */
  28752. SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  28753. var chunk;
  28754. for (var i = 0, len = this.children.length; i < len; i++) {
  28755. chunk = this.children[i];
  28756. if (chunk[isSourceNode]) {
  28757. chunk.walk(aFn);
  28758. }
  28759. else {
  28760. if (chunk !== '') {
  28761. aFn(chunk, { source: this.source,
  28762. line: this.line,
  28763. column: this.column,
  28764. name: this.name });
  28765. }
  28766. }
  28767. }
  28768. };
  28769. /**
  28770. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  28771. * each of `this.children`.
  28772. *
  28773. * @param aSep The separator.
  28774. */
  28775. SourceNode.prototype.join = function SourceNode_join(aSep) {
  28776. var newChildren;
  28777. var i;
  28778. var len = this.children.length;
  28779. if (len > 0) {
  28780. newChildren = [];
  28781. for (i = 0; i < len-1; i++) {
  28782. newChildren.push(this.children[i]);
  28783. newChildren.push(aSep);
  28784. }
  28785. newChildren.push(this.children[i]);
  28786. this.children = newChildren;
  28787. }
  28788. return this;
  28789. };
  28790. /**
  28791. * Call String.prototype.replace on the very right-most source snippet. Useful
  28792. * for trimming whitespace from the end of a source node, etc.
  28793. *
  28794. * @param aPattern The pattern to replace.
  28795. * @param aReplacement The thing to replace the pattern with.
  28796. */
  28797. SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  28798. var lastChild = this.children[this.children.length - 1];
  28799. if (lastChild[isSourceNode]) {
  28800. lastChild.replaceRight(aPattern, aReplacement);
  28801. }
  28802. else if (typeof lastChild === 'string') {
  28803. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  28804. }
  28805. else {
  28806. this.children.push(''.replace(aPattern, aReplacement));
  28807. }
  28808. return this;
  28809. };
  28810. /**
  28811. * Set the source content for a source file. This will be added to the SourceMapGenerator
  28812. * in the sourcesContent field.
  28813. *
  28814. * @param aSourceFile The filename of the source file
  28815. * @param aSourceContent The content of the source file
  28816. */
  28817. SourceNode.prototype.setSourceContent =
  28818. function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  28819. this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  28820. };
  28821. /**
  28822. * Walk over the tree of SourceNodes. The walking function is called for each
  28823. * source file content and is passed the filename and source content.
  28824. *
  28825. * @param aFn The traversal function.
  28826. */
  28827. SourceNode.prototype.walkSourceContents =
  28828. function SourceNode_walkSourceContents(aFn) {
  28829. for (var i = 0, len = this.children.length; i < len; i++) {
  28830. if (this.children[i][isSourceNode]) {
  28831. this.children[i].walkSourceContents(aFn);
  28832. }
  28833. }
  28834. var sources = Object.keys(this.sourceContents);
  28835. for (var i = 0, len = sources.length; i < len; i++) {
  28836. aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  28837. }
  28838. };
  28839. /**
  28840. * Return the string representation of this source node. Walks over the tree
  28841. * and concatenates all the various snippets together to one string.
  28842. */
  28843. SourceNode.prototype.toString = function SourceNode_toString() {
  28844. var str = "";
  28845. this.walk(function (chunk) {
  28846. str += chunk;
  28847. });
  28848. return str;
  28849. };
  28850. /**
  28851. * Returns the string representation of this source node along with a source
  28852. * map.
  28853. */
  28854. SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  28855. var generated = {
  28856. code: "",
  28857. line: 1,
  28858. column: 0
  28859. };
  28860. var map = new SourceMapGenerator(aArgs);
  28861. var sourceMappingActive = false;
  28862. var lastOriginalSource = null;
  28863. var lastOriginalLine = null;
  28864. var lastOriginalColumn = null;
  28865. var lastOriginalName = null;
  28866. this.walk(function (chunk, original) {
  28867. generated.code += chunk;
  28868. if (original.source !== null
  28869. && original.line !== null
  28870. && original.column !== null) {
  28871. if(lastOriginalSource !== original.source
  28872. || lastOriginalLine !== original.line
  28873. || lastOriginalColumn !== original.column
  28874. || lastOriginalName !== original.name) {
  28875. map.addMapping({
  28876. source: original.source,
  28877. original: {
  28878. line: original.line,
  28879. column: original.column
  28880. },
  28881. generated: {
  28882. line: generated.line,
  28883. column: generated.column
  28884. },
  28885. name: original.name
  28886. });
  28887. }
  28888. lastOriginalSource = original.source;
  28889. lastOriginalLine = original.line;
  28890. lastOriginalColumn = original.column;
  28891. lastOriginalName = original.name;
  28892. sourceMappingActive = true;
  28893. } else if (sourceMappingActive) {
  28894. map.addMapping({
  28895. generated: {
  28896. line: generated.line,
  28897. column: generated.column
  28898. }
  28899. });
  28900. lastOriginalSource = null;
  28901. sourceMappingActive = false;
  28902. }
  28903. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  28904. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  28905. generated.line++;
  28906. generated.column = 0;
  28907. // Mappings end at eol
  28908. if (idx + 1 === length) {
  28909. lastOriginalSource = null;
  28910. sourceMappingActive = false;
  28911. } else if (sourceMappingActive) {
  28912. map.addMapping({
  28913. source: original.source,
  28914. original: {
  28915. line: original.line,
  28916. column: original.column
  28917. },
  28918. generated: {
  28919. line: generated.line,
  28920. column: generated.column
  28921. },
  28922. name: original.name
  28923. });
  28924. }
  28925. } else {
  28926. generated.column++;
  28927. }
  28928. }
  28929. });
  28930. this.walkSourceContents(function (sourceFile, sourceContent) {
  28931. map.setSourceContent(sourceFile, sourceContent);
  28932. });
  28933. return { code: generated.code, map: map };
  28934. };
  28935. exports.SourceNode = SourceNode;
  28936. /***/ }),
  28937. /* 184 */
  28938. /***/ (function(module, exports, __webpack_require__) {
  28939. "use strict";
  28940. exports.__esModule = true;
  28941. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  28942. var _flatten = __webpack_require__(44);
  28943. var _flatten2 = _interopRequireDefault(_flatten);
  28944. var _indexesOf = __webpack_require__(48);
  28945. var _indexesOf2 = _interopRequireDefault(_indexesOf);
  28946. var _uniq = __webpack_require__(103);
  28947. var _uniq2 = _interopRequireDefault(_uniq);
  28948. var _root = __webpack_require__(74);
  28949. var _root2 = _interopRequireDefault(_root);
  28950. var _selector = __webpack_require__(75);
  28951. var _selector2 = _interopRequireDefault(_selector);
  28952. var _className = __webpack_require__(68);
  28953. var _className2 = _interopRequireDefault(_className);
  28954. var _comment = __webpack_require__(70);
  28955. var _comment2 = _interopRequireDefault(_comment);
  28956. var _id = __webpack_require__(71);
  28957. var _id2 = _interopRequireDefault(_id);
  28958. var _tag = __webpack_require__(77);
  28959. var _tag2 = _interopRequireDefault(_tag);
  28960. var _string = __webpack_require__(76);
  28961. var _string2 = _interopRequireDefault(_string);
  28962. var _pseudo = __webpack_require__(73);
  28963. var _pseudo2 = _interopRequireDefault(_pseudo);
  28964. var _attribute = __webpack_require__(67);
  28965. var _attribute2 = _interopRequireDefault(_attribute);
  28966. var _universal = __webpack_require__(78);
  28967. var _universal2 = _interopRequireDefault(_universal);
  28968. var _combinator = __webpack_require__(69);
  28969. var _combinator2 = _interopRequireDefault(_combinator);
  28970. var _nesting = __webpack_require__(72);
  28971. var _nesting2 = _interopRequireDefault(_nesting);
  28972. var _sortAscending = __webpack_require__(186);
  28973. var _sortAscending2 = _interopRequireDefault(_sortAscending);
  28974. var _tokenize = __webpack_require__(187);
  28975. var _tokenize2 = _interopRequireDefault(_tokenize);
  28976. var _types = __webpack_require__(1);
  28977. var types = _interopRequireWildcard(_types);
  28978. 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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  28979. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28980. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28981. var Parser = function () {
  28982. function Parser(input) {
  28983. _classCallCheck(this, Parser);
  28984. this.input = input;
  28985. this.lossy = input.options.lossless === false;
  28986. this.position = 0;
  28987. this.root = new _root2.default();
  28988. var selectors = new _selector2.default();
  28989. this.root.append(selectors);
  28990. this.current = selectors;
  28991. if (this.lossy) {
  28992. this.tokens = (0, _tokenize2.default)({ safe: input.safe, css: input.css.trim() });
  28993. } else {
  28994. this.tokens = (0, _tokenize2.default)(input);
  28995. }
  28996. return this.loop();
  28997. }
  28998. Parser.prototype.attribute = function attribute() {
  28999. var str = '';
  29000. var attr = void 0;
  29001. var startingToken = this.currToken;
  29002. this.position++;
  29003. while (this.position < this.tokens.length && this.currToken[0] !== ']') {
  29004. str += this.tokens[this.position][1];
  29005. this.position++;
  29006. }
  29007. if (this.position === this.tokens.length && !~str.indexOf(']')) {
  29008. this.error('Expected a closing square bracket.');
  29009. }
  29010. var parts = str.split(/((?:[*~^$|]?=))([^]*)/);
  29011. var namespace = parts[0].split(/(\|)/g);
  29012. var attributeProps = {
  29013. operator: parts[1],
  29014. value: parts[2],
  29015. source: {
  29016. start: {
  29017. line: startingToken[2],
  29018. column: startingToken[3]
  29019. },
  29020. end: {
  29021. line: this.currToken[2],
  29022. column: this.currToken[3]
  29023. }
  29024. },
  29025. sourceIndex: startingToken[4]
  29026. };
  29027. if (namespace.length > 1) {
  29028. if (namespace[0] === '') {
  29029. namespace[0] = true;
  29030. }
  29031. attributeProps.attribute = this.parseValue(namespace[2]);
  29032. attributeProps.namespace = this.parseNamespace(namespace[0]);
  29033. } else {
  29034. attributeProps.attribute = this.parseValue(parts[0]);
  29035. }
  29036. attr = new _attribute2.default(attributeProps);
  29037. if (parts[2]) {
  29038. var insensitive = parts[2].split(/(\s+i\s*?)$/);
  29039. var trimmedValue = insensitive[0].trim();
  29040. attr.value = this.lossy ? trimmedValue : insensitive[0];
  29041. if (insensitive[1]) {
  29042. attr.insensitive = true;
  29043. if (!this.lossy) {
  29044. attr.raws.insensitive = insensitive[1];
  29045. }
  29046. }
  29047. attr.quoted = trimmedValue[0] === '\'' || trimmedValue[0] === '"';
  29048. attr.raws.unquoted = attr.quoted ? trimmedValue.slice(1, -1) : trimmedValue;
  29049. }
  29050. this.newNode(attr);
  29051. this.position++;
  29052. };
  29053. Parser.prototype.combinator = function combinator() {
  29054. if (this.currToken[1] === '|') {
  29055. return this.namespace();
  29056. }
  29057. var node = new _combinator2.default({
  29058. value: '',
  29059. source: {
  29060. start: {
  29061. line: this.currToken[2],
  29062. column: this.currToken[3]
  29063. },
  29064. end: {
  29065. line: this.currToken[2],
  29066. column: this.currToken[3]
  29067. }
  29068. },
  29069. sourceIndex: this.currToken[4]
  29070. });
  29071. while (this.position < this.tokens.length && this.currToken && (this.currToken[0] === 'space' || this.currToken[0] === 'combinator')) {
  29072. if (this.nextToken && this.nextToken[0] === 'combinator') {
  29073. node.spaces.before = this.parseSpace(this.currToken[1]);
  29074. node.source.start.line = this.nextToken[2];
  29075. node.source.start.column = this.nextToken[3];
  29076. node.source.end.column = this.nextToken[3];
  29077. node.source.end.line = this.nextToken[2];
  29078. node.sourceIndex = this.nextToken[4];
  29079. } else if (this.prevToken && this.prevToken[0] === 'combinator') {
  29080. node.spaces.after = this.parseSpace(this.currToken[1]);
  29081. } else if (this.currToken[0] === 'combinator') {
  29082. node.value = this.currToken[1];
  29083. } else if (this.currToken[0] === 'space') {
  29084. node.value = this.parseSpace(this.currToken[1], ' ');
  29085. }
  29086. this.position++;
  29087. }
  29088. return this.newNode(node);
  29089. };
  29090. Parser.prototype.comma = function comma() {
  29091. if (this.position === this.tokens.length - 1) {
  29092. this.root.trailingComma = true;
  29093. this.position++;
  29094. return;
  29095. }
  29096. var selectors = new _selector2.default();
  29097. this.current.parent.append(selectors);
  29098. this.current = selectors;
  29099. this.position++;
  29100. };
  29101. Parser.prototype.comment = function comment() {
  29102. var node = new _comment2.default({
  29103. value: this.currToken[1],
  29104. source: {
  29105. start: {
  29106. line: this.currToken[2],
  29107. column: this.currToken[3]
  29108. },
  29109. end: {
  29110. line: this.currToken[4],
  29111. column: this.currToken[5]
  29112. }
  29113. },
  29114. sourceIndex: this.currToken[6]
  29115. });
  29116. this.newNode(node);
  29117. this.position++;
  29118. };
  29119. Parser.prototype.error = function error(message) {
  29120. throw new this.input.error(message); // eslint-disable-line new-cap
  29121. };
  29122. Parser.prototype.missingBackslash = function missingBackslash() {
  29123. return this.error('Expected a backslash preceding the semicolon.');
  29124. };
  29125. Parser.prototype.missingParenthesis = function missingParenthesis() {
  29126. return this.error('Expected opening parenthesis.');
  29127. };
  29128. Parser.prototype.missingSquareBracket = function missingSquareBracket() {
  29129. return this.error('Expected opening square bracket.');
  29130. };
  29131. Parser.prototype.namespace = function namespace() {
  29132. var before = this.prevToken && this.prevToken[1] || true;
  29133. if (this.nextToken[0] === 'word') {
  29134. this.position++;
  29135. return this.word(before);
  29136. } else if (this.nextToken[0] === '*') {
  29137. this.position++;
  29138. return this.universal(before);
  29139. }
  29140. };
  29141. Parser.prototype.nesting = function nesting() {
  29142. this.newNode(new _nesting2.default({
  29143. value: this.currToken[1],
  29144. source: {
  29145. start: {
  29146. line: this.currToken[2],
  29147. column: this.currToken[3]
  29148. },
  29149. end: {
  29150. line: this.currToken[2],
  29151. column: this.currToken[3]
  29152. }
  29153. },
  29154. sourceIndex: this.currToken[4]
  29155. }));
  29156. this.position++;
  29157. };
  29158. Parser.prototype.parentheses = function parentheses() {
  29159. var last = this.current.last;
  29160. if (last && last.type === types.PSEUDO) {
  29161. var selector = new _selector2.default();
  29162. var cache = this.current;
  29163. last.append(selector);
  29164. this.current = selector;
  29165. var balanced = 1;
  29166. this.position++;
  29167. while (this.position < this.tokens.length && balanced) {
  29168. if (this.currToken[0] === '(') {
  29169. balanced++;
  29170. }
  29171. if (this.currToken[0] === ')') {
  29172. balanced--;
  29173. }
  29174. if (balanced) {
  29175. this.parse();
  29176. } else {
  29177. selector.parent.source.end.line = this.currToken[2];
  29178. selector.parent.source.end.column = this.currToken[3];
  29179. this.position++;
  29180. }
  29181. }
  29182. if (balanced) {
  29183. this.error('Expected closing parenthesis.');
  29184. }
  29185. this.current = cache;
  29186. } else {
  29187. var _balanced = 1;
  29188. this.position++;
  29189. last.value += '(';
  29190. while (this.position < this.tokens.length && _balanced) {
  29191. if (this.currToken[0] === '(') {
  29192. _balanced++;
  29193. }
  29194. if (this.currToken[0] === ')') {
  29195. _balanced--;
  29196. }
  29197. last.value += this.parseParenthesisToken(this.currToken);
  29198. this.position++;
  29199. }
  29200. if (_balanced) {
  29201. this.error('Expected closing parenthesis.');
  29202. }
  29203. }
  29204. };
  29205. Parser.prototype.pseudo = function pseudo() {
  29206. var _this = this;
  29207. var pseudoStr = '';
  29208. var startingToken = this.currToken;
  29209. while (this.currToken && this.currToken[0] === ':') {
  29210. pseudoStr += this.currToken[1];
  29211. this.position++;
  29212. }
  29213. if (!this.currToken) {
  29214. return this.error('Expected pseudo-class or pseudo-element');
  29215. }
  29216. if (this.currToken[0] === 'word') {
  29217. var pseudo = void 0;
  29218. this.splitWord(false, function (first, length) {
  29219. pseudoStr += first;
  29220. pseudo = new _pseudo2.default({
  29221. value: pseudoStr,
  29222. source: {
  29223. start: {
  29224. line: startingToken[2],
  29225. column: startingToken[3]
  29226. },
  29227. end: {
  29228. line: _this.currToken[4],
  29229. column: _this.currToken[5]
  29230. }
  29231. },
  29232. sourceIndex: startingToken[4]
  29233. });
  29234. _this.newNode(pseudo);
  29235. if (length > 1 && _this.nextToken && _this.nextToken[0] === '(') {
  29236. _this.error('Misplaced parenthesis.');
  29237. }
  29238. });
  29239. } else {
  29240. this.error('Unexpected "' + this.currToken[0] + '" found.');
  29241. }
  29242. };
  29243. Parser.prototype.space = function space() {
  29244. var token = this.currToken;
  29245. // Handle space before and after the selector
  29246. if (this.position === 0 || this.prevToken[0] === ',' || this.prevToken[0] === '(') {
  29247. this.spaces = this.parseSpace(token[1]);
  29248. this.position++;
  29249. } else if (this.position === this.tokens.length - 1 || this.nextToken[0] === ',' || this.nextToken[0] === ')') {
  29250. this.current.last.spaces.after = this.parseSpace(token[1]);
  29251. this.position++;
  29252. } else {
  29253. this.combinator();
  29254. }
  29255. };
  29256. Parser.prototype.string = function string() {
  29257. var token = this.currToken;
  29258. this.newNode(new _string2.default({
  29259. value: this.currToken[1],
  29260. source: {
  29261. start: {
  29262. line: token[2],
  29263. column: token[3]
  29264. },
  29265. end: {
  29266. line: token[4],
  29267. column: token[5]
  29268. }
  29269. },
  29270. sourceIndex: token[6]
  29271. }));
  29272. this.position++;
  29273. };
  29274. Parser.prototype.universal = function universal(namespace) {
  29275. var nextToken = this.nextToken;
  29276. if (nextToken && nextToken[1] === '|') {
  29277. this.position++;
  29278. return this.namespace();
  29279. }
  29280. this.newNode(new _universal2.default({
  29281. value: this.currToken[1],
  29282. source: {
  29283. start: {
  29284. line: this.currToken[2],
  29285. column: this.currToken[3]
  29286. },
  29287. end: {
  29288. line: this.currToken[2],
  29289. column: this.currToken[3]
  29290. }
  29291. },
  29292. sourceIndex: this.currToken[4]
  29293. }), namespace);
  29294. this.position++;
  29295. };
  29296. Parser.prototype.splitWord = function splitWord(namespace, firstCallback) {
  29297. var _this2 = this;
  29298. var nextToken = this.nextToken;
  29299. var word = this.currToken[1];
  29300. while (nextToken && nextToken[0] === 'word') {
  29301. this.position++;
  29302. var current = this.currToken[1];
  29303. word += current;
  29304. if (current.lastIndexOf('\\') === current.length - 1) {
  29305. var next = this.nextToken;
  29306. if (next && next[0] === 'space') {
  29307. word += this.parseSpace(next[1], ' ');
  29308. this.position++;
  29309. }
  29310. }
  29311. nextToken = this.nextToken;
  29312. }
  29313. var hasClass = (0, _indexesOf2.default)(word, '.');
  29314. var hasId = (0, _indexesOf2.default)(word, '#');
  29315. // Eliminate Sass interpolations from the list of id indexes
  29316. var interpolations = (0, _indexesOf2.default)(word, '#{');
  29317. if (interpolations.length) {
  29318. hasId = hasId.filter(function (hashIndex) {
  29319. return !~interpolations.indexOf(hashIndex);
  29320. });
  29321. }
  29322. var indices = (0, _sortAscending2.default)((0, _uniq2.default)((0, _flatten2.default)([[0], hasClass, hasId])));
  29323. indices.forEach(function (ind, i) {
  29324. var index = indices[i + 1] || word.length;
  29325. var value = word.slice(ind, index);
  29326. if (i === 0 && firstCallback) {
  29327. return firstCallback.call(_this2, value, indices.length);
  29328. }
  29329. var node = void 0;
  29330. if (~hasClass.indexOf(ind)) {
  29331. node = new _className2.default({
  29332. value: value.slice(1),
  29333. source: {
  29334. start: {
  29335. line: _this2.currToken[2],
  29336. column: _this2.currToken[3] + ind
  29337. },
  29338. end: {
  29339. line: _this2.currToken[4],
  29340. column: _this2.currToken[3] + (index - 1)
  29341. }
  29342. },
  29343. sourceIndex: _this2.currToken[6] + indices[i]
  29344. });
  29345. } else if (~hasId.indexOf(ind)) {
  29346. node = new _id2.default({
  29347. value: value.slice(1),
  29348. source: {
  29349. start: {
  29350. line: _this2.currToken[2],
  29351. column: _this2.currToken[3] + ind
  29352. },
  29353. end: {
  29354. line: _this2.currToken[4],
  29355. column: _this2.currToken[3] + (index - 1)
  29356. }
  29357. },
  29358. sourceIndex: _this2.currToken[6] + indices[i]
  29359. });
  29360. } else {
  29361. node = new _tag2.default({
  29362. value: value,
  29363. source: {
  29364. start: {
  29365. line: _this2.currToken[2],
  29366. column: _this2.currToken[3] + ind
  29367. },
  29368. end: {
  29369. line: _this2.currToken[4],
  29370. column: _this2.currToken[3] + (index - 1)
  29371. }
  29372. },
  29373. sourceIndex: _this2.currToken[6] + indices[i]
  29374. });
  29375. }
  29376. _this2.newNode(node, namespace);
  29377. });
  29378. this.position++;
  29379. };
  29380. Parser.prototype.word = function word(namespace) {
  29381. var nextToken = this.nextToken;
  29382. if (nextToken && nextToken[1] === '|') {
  29383. this.position++;
  29384. return this.namespace();
  29385. }
  29386. return this.splitWord(namespace);
  29387. };
  29388. Parser.prototype.loop = function loop() {
  29389. while (this.position < this.tokens.length) {
  29390. this.parse(true);
  29391. }
  29392. return this.root;
  29393. };
  29394. Parser.prototype.parse = function parse(throwOnParenthesis) {
  29395. switch (this.currToken[0]) {
  29396. case 'space':
  29397. this.space();
  29398. break;
  29399. case 'comment':
  29400. this.comment();
  29401. break;
  29402. case '(':
  29403. this.parentheses();
  29404. break;
  29405. case ')':
  29406. if (throwOnParenthesis) {
  29407. this.missingParenthesis();
  29408. }
  29409. break;
  29410. case '[':
  29411. this.attribute();
  29412. break;
  29413. case ']':
  29414. this.missingSquareBracket();
  29415. break;
  29416. case 'at-word':
  29417. case 'word':
  29418. this.word();
  29419. break;
  29420. case ':':
  29421. this.pseudo();
  29422. break;
  29423. case ';':
  29424. this.missingBackslash();
  29425. break;
  29426. case ',':
  29427. this.comma();
  29428. break;
  29429. case '*':
  29430. this.universal();
  29431. break;
  29432. case '&':
  29433. this.nesting();
  29434. break;
  29435. case 'combinator':
  29436. this.combinator();
  29437. break;
  29438. case 'string':
  29439. this.string();
  29440. break;
  29441. }
  29442. };
  29443. /**
  29444. * Helpers
  29445. */
  29446. Parser.prototype.parseNamespace = function parseNamespace(namespace) {
  29447. if (this.lossy && typeof namespace === 'string') {
  29448. var trimmed = namespace.trim();
  29449. if (!trimmed.length) {
  29450. return true;
  29451. }
  29452. return trimmed;
  29453. }
  29454. return namespace;
  29455. };
  29456. Parser.prototype.parseSpace = function parseSpace(space, replacement) {
  29457. return this.lossy ? replacement || '' : space;
  29458. };
  29459. Parser.prototype.parseValue = function parseValue(value) {
  29460. return this.lossy && value && typeof value === 'string' ? value.trim() : value;
  29461. };
  29462. Parser.prototype.parseParenthesisToken = function parseParenthesisToken(token) {
  29463. if (!this.lossy) {
  29464. return token[1];
  29465. }
  29466. if (token[0] === 'space') {
  29467. return this.parseSpace(token[1], ' ');
  29468. }
  29469. return this.parseValue(token[1]);
  29470. };
  29471. Parser.prototype.newNode = function newNode(node, namespace) {
  29472. if (namespace) {
  29473. node.namespace = this.parseNamespace(namespace);
  29474. }
  29475. if (this.spaces) {
  29476. node.spaces.before = this.spaces;
  29477. this.spaces = '';
  29478. }
  29479. return this.current.append(node);
  29480. };
  29481. _createClass(Parser, [{
  29482. key: 'currToken',
  29483. get: function get() {
  29484. return this.tokens[this.position];
  29485. }
  29486. }, {
  29487. key: 'nextToken',
  29488. get: function get() {
  29489. return this.tokens[this.position + 1];
  29490. }
  29491. }, {
  29492. key: 'prevToken',
  29493. get: function get() {
  29494. return this.tokens[this.position - 1];
  29495. }
  29496. }]);
  29497. return Parser;
  29498. }();
  29499. exports.default = Parser;
  29500. module.exports = exports['default'];
  29501. /***/ }),
  29502. /* 185 */
  29503. /***/ (function(module, exports, __webpack_require__) {
  29504. "use strict";
  29505. exports.__esModule = true;
  29506. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  29507. var _parser = __webpack_require__(184);
  29508. var _parser2 = _interopRequireDefault(_parser);
  29509. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29510. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29511. var Processor = function () {
  29512. function Processor(func) {
  29513. _classCallCheck(this, Processor);
  29514. this.func = func || function noop() {};
  29515. return this;
  29516. }
  29517. Processor.prototype.process = function process(selectors) {
  29518. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  29519. var input = new _parser2.default({
  29520. css: selectors,
  29521. error: function error(e) {
  29522. throw new Error(e);
  29523. },
  29524. options: options
  29525. });
  29526. this.res = input;
  29527. this.func(input);
  29528. return this;
  29529. };
  29530. _createClass(Processor, [{
  29531. key: 'result',
  29532. get: function get() {
  29533. return String(this.res);
  29534. }
  29535. }]);
  29536. return Processor;
  29537. }();
  29538. exports.default = Processor;
  29539. module.exports = exports['default'];
  29540. /***/ }),
  29541. /* 186 */
  29542. /***/ (function(module, exports, __webpack_require__) {
  29543. "use strict";
  29544. exports.__esModule = true;
  29545. exports.default = sortAscending;
  29546. function sortAscending(list) {
  29547. return list.sort(function (a, b) {
  29548. return a - b;
  29549. });
  29550. };
  29551. module.exports = exports["default"];
  29552. /***/ }),
  29553. /* 187 */
  29554. /***/ (function(module, exports, __webpack_require__) {
  29555. "use strict";
  29556. exports.__esModule = true;
  29557. exports.default = tokenize;
  29558. var singleQuote = 39,
  29559. doubleQuote = 34,
  29560. backslash = 92,
  29561. slash = 47,
  29562. newline = 10,
  29563. space = 32,
  29564. feed = 12,
  29565. tab = 9,
  29566. cr = 13,
  29567. plus = 43,
  29568. gt = 62,
  29569. tilde = 126,
  29570. pipe = 124,
  29571. comma = 44,
  29572. openBracket = 40,
  29573. closeBracket = 41,
  29574. openSq = 91,
  29575. closeSq = 93,
  29576. semicolon = 59,
  29577. asterisk = 42,
  29578. colon = 58,
  29579. ampersand = 38,
  29580. at = 64,
  29581. atEnd = /[ \n\t\r\{\(\)'"\\;/]/g,
  29582. wordEnd = /[ \n\t\r\(\)\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;
  29583. function tokenize(input) {
  29584. var tokens = [];
  29585. var css = input.css.valueOf();
  29586. var code = void 0,
  29587. next = void 0,
  29588. quote = void 0,
  29589. lines = void 0,
  29590. last = void 0,
  29591. content = void 0,
  29592. escape = void 0,
  29593. nextLine = void 0,
  29594. nextOffset = void 0,
  29595. escaped = void 0,
  29596. escapePos = void 0;
  29597. var length = css.length;
  29598. var offset = -1;
  29599. var line = 1;
  29600. var pos = 0;
  29601. var unclosed = function unclosed(what, end) {
  29602. if (input.safe) {
  29603. css += end;
  29604. next = css.length - 1;
  29605. } else {
  29606. throw input.error('Unclosed ' + what, line, pos - offset, pos);
  29607. }
  29608. };
  29609. while (pos < length) {
  29610. code = css.charCodeAt(pos);
  29611. if (code === newline) {
  29612. offset = pos;
  29613. line += 1;
  29614. }
  29615. switch (code) {
  29616. case newline:
  29617. case space:
  29618. case tab:
  29619. case cr:
  29620. case feed:
  29621. next = pos;
  29622. do {
  29623. next += 1;
  29624. code = css.charCodeAt(next);
  29625. if (code === newline) {
  29626. offset = next;
  29627. line += 1;
  29628. }
  29629. } while (code === space || code === newline || code === tab || code === cr || code === feed);
  29630. tokens.push(['space', css.slice(pos, next), line, pos - offset, pos]);
  29631. pos = next - 1;
  29632. break;
  29633. case plus:
  29634. case gt:
  29635. case tilde:
  29636. case pipe:
  29637. next = pos;
  29638. do {
  29639. next += 1;
  29640. code = css.charCodeAt(next);
  29641. } while (code === plus || code === gt || code === tilde || code === pipe);
  29642. tokens.push(['combinator', css.slice(pos, next), line, pos - offset, pos]);
  29643. pos = next - 1;
  29644. break;
  29645. case asterisk:
  29646. tokens.push(['*', '*', line, pos - offset, pos]);
  29647. break;
  29648. case ampersand:
  29649. tokens.push(['&', '&', line, pos - offset, pos]);
  29650. break;
  29651. case comma:
  29652. tokens.push([',', ',', line, pos - offset, pos]);
  29653. break;
  29654. case openSq:
  29655. tokens.push(['[', '[', line, pos - offset, pos]);
  29656. break;
  29657. case closeSq:
  29658. tokens.push([']', ']', line, pos - offset, pos]);
  29659. break;
  29660. case colon:
  29661. tokens.push([':', ':', line, pos - offset, pos]);
  29662. break;
  29663. case semicolon:
  29664. tokens.push([';', ';', line, pos - offset, pos]);
  29665. break;
  29666. case openBracket:
  29667. tokens.push(['(', '(', line, pos - offset, pos]);
  29668. break;
  29669. case closeBracket:
  29670. tokens.push([')', ')', line, pos - offset, pos]);
  29671. break;
  29672. case singleQuote:
  29673. case doubleQuote:
  29674. quote = code === singleQuote ? "'" : '"';
  29675. next = pos;
  29676. do {
  29677. escaped = false;
  29678. next = css.indexOf(quote, next + 1);
  29679. if (next === -1) {
  29680. unclosed('quote', quote);
  29681. }
  29682. escapePos = next;
  29683. while (css.charCodeAt(escapePos - 1) === backslash) {
  29684. escapePos -= 1;
  29685. escaped = !escaped;
  29686. }
  29687. } while (escaped);
  29688. tokens.push(['string', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  29689. pos = next;
  29690. break;
  29691. case at:
  29692. atEnd.lastIndex = pos + 1;
  29693. atEnd.test(css);
  29694. if (atEnd.lastIndex === 0) {
  29695. next = css.length - 1;
  29696. } else {
  29697. next = atEnd.lastIndex - 2;
  29698. }
  29699. tokens.push(['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  29700. pos = next;
  29701. break;
  29702. case backslash:
  29703. next = pos;
  29704. escape = true;
  29705. while (css.charCodeAt(next + 1) === backslash) {
  29706. next += 1;
  29707. escape = !escape;
  29708. }
  29709. code = css.charCodeAt(next + 1);
  29710. if (escape && code !== slash && code !== space && code !== newline && code !== tab && code !== cr && code !== feed) {
  29711. next += 1;
  29712. }
  29713. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  29714. pos = next;
  29715. break;
  29716. default:
  29717. if (code === slash && css.charCodeAt(pos + 1) === asterisk) {
  29718. next = css.indexOf('*/', pos + 2) + 1;
  29719. if (next === 0) {
  29720. unclosed('comment', '*/');
  29721. }
  29722. content = css.slice(pos, next + 1);
  29723. lines = content.split('\n');
  29724. last = lines.length - 1;
  29725. if (last > 0) {
  29726. nextLine = line + last;
  29727. nextOffset = next - lines[last].length;
  29728. } else {
  29729. nextLine = line;
  29730. nextOffset = offset;
  29731. }
  29732. tokens.push(['comment', content, line, pos - offset, nextLine, next - nextOffset, pos]);
  29733. offset = nextOffset;
  29734. line = nextLine;
  29735. pos = next;
  29736. } else {
  29737. wordEnd.lastIndex = pos + 1;
  29738. wordEnd.test(css);
  29739. if (wordEnd.lastIndex === 0) {
  29740. next = css.length - 1;
  29741. } else {
  29742. next = wordEnd.lastIndex - 2;
  29743. }
  29744. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  29745. pos = next;
  29746. }
  29747. break;
  29748. }
  29749. pos++;
  29750. }
  29751. return tokens;
  29752. }
  29753. module.exports = exports['default'];
  29754. /***/ }),
  29755. /* 188 */
  29756. /***/ (function(module, exports, __webpack_require__) {
  29757. "use strict";
  29758. class ParserError extends Error {
  29759. constructor(message) {
  29760. super(message);
  29761. this.name = this.constructor.name;
  29762. this.message = message || 'An error ocurred while parsing.';
  29763. if (typeof Error.captureStackTrace === 'function') {
  29764. Error.captureStackTrace(this, this.constructor);
  29765. }
  29766. else {
  29767. this.stack = (new Error(message)).stack;
  29768. }
  29769. }
  29770. }
  29771. module.exports = ParserError;
  29772. /***/ }),
  29773. /* 189 */
  29774. /***/ (function(module, exports, __webpack_require__) {
  29775. "use strict";
  29776. class TokenizeError extends Error {
  29777. constructor(message) {
  29778. super(message);
  29779. this.name = this.constructor.name;
  29780. this.message = message || 'An error ocurred while tokzenizing.';
  29781. if (typeof Error.captureStackTrace === 'function') {
  29782. Error.captureStackTrace(this, this.constructor);
  29783. }
  29784. else {
  29785. this.stack = (new Error(message)).stack;
  29786. }
  29787. }
  29788. }
  29789. module.exports = TokenizeError;
  29790. /***/ }),
  29791. /* 190 */
  29792. /***/ (function(module, exports, __webpack_require__) {
  29793. "use strict";
  29794. const Root = __webpack_require__(191);
  29795. const Value = __webpack_require__(89);
  29796. const AtWord = __webpack_require__(79);
  29797. const Colon = __webpack_require__(80);
  29798. const Comma = __webpack_require__(81);
  29799. const Comment = __webpack_require__(82);
  29800. const Func = __webpack_require__(83);
  29801. const Numbr = __webpack_require__(84);
  29802. const Operator = __webpack_require__(85);
  29803. const Paren = __webpack_require__(86);
  29804. const Str = __webpack_require__(87);
  29805. const Word = __webpack_require__(90);
  29806. const UnicodeRange = __webpack_require__(88);
  29807. const tokenize = __webpack_require__(192);
  29808. const flatten = __webpack_require__(44);
  29809. const indexesOf = __webpack_require__(48);
  29810. const uniq = __webpack_require__(103);
  29811. const ParserError = __webpack_require__(188);
  29812. function sortAscending (list) {
  29813. return list.sort((a, b) => a - b);
  29814. }
  29815. module.exports = class Parser {
  29816. constructor (input, options) {
  29817. const defaults = { loose: false };
  29818. // cache needs to be an array for values with more than 1 level of function nesting
  29819. this.cache = [];
  29820. this.input = input;
  29821. this.options = Object.assign({}, defaults, options);
  29822. this.position = 0;
  29823. // we'll use this to keep track of the paren balance
  29824. this.unbalanced = 0;
  29825. this.root = new Root();
  29826. let value = new Value();
  29827. this.root.append(value);
  29828. this.current = value;
  29829. this.tokens = tokenize(input, this.options);
  29830. }
  29831. parse () {
  29832. return this.loop();
  29833. }
  29834. colon () {
  29835. let token = this.currToken;
  29836. this.newNode(new Colon({
  29837. value: token[1],
  29838. source: {
  29839. start: {
  29840. line: token[2],
  29841. column: token[3]
  29842. },
  29843. end: {
  29844. line: token[4],
  29845. column: token[5]
  29846. }
  29847. },
  29848. sourceIndex: token[6]
  29849. }));
  29850. this.position ++;
  29851. }
  29852. comma () {
  29853. let token = this.currToken;
  29854. this.newNode(new Comma({
  29855. value: token[1],
  29856. source: {
  29857. start: {
  29858. line: token[2],
  29859. column: token[3]
  29860. },
  29861. end: {
  29862. line: token[4],
  29863. column: token[5]
  29864. }
  29865. },
  29866. sourceIndex: token[6]
  29867. }));
  29868. this.position ++;
  29869. }
  29870. comment () {
  29871. let inline = false,
  29872. value = this.currToken[1].replace(/\/\*|\*\//g, ''),
  29873. node;
  29874. if (this.options.loose && value.startsWith("//")) {
  29875. value = value.substring(2);
  29876. inline = true;
  29877. }
  29878. node = new Comment({
  29879. value: value,
  29880. inline: inline,
  29881. source: {
  29882. start: {
  29883. line: this.currToken[2],
  29884. column: this.currToken[3]
  29885. },
  29886. end: {
  29887. line: this.currToken[4],
  29888. column: this.currToken[5]
  29889. }
  29890. },
  29891. sourceIndex: this.currToken[6]
  29892. });
  29893. this.newNode(node);
  29894. this.position++;
  29895. }
  29896. error (message, token) {
  29897. throw new ParserError(message + ` at line: ${token[2]}, column ${token[3]}`);
  29898. }
  29899. loop () {
  29900. while (this.position < this.tokens.length) {
  29901. this.parseTokens();
  29902. }
  29903. if (!this.current.last && this.spaces) {
  29904. this.current.raws.before += this.spaces;
  29905. }
  29906. else if (this.spaces) {
  29907. this.current.last.raws.after += this.spaces;
  29908. }
  29909. this.spaces = '';
  29910. return this.root;
  29911. }
  29912. operator () {
  29913. // if a +|- operator is followed by a non-word character (. is allowed) and
  29914. // is preceded by a non-word character. (5+5)
  29915. let char = this.currToken[1],
  29916. node;
  29917. if (char === '+' || char === '-') {
  29918. // only inspect if the operator is not the first token, and we're only
  29919. // within a calc() function: the only spec-valid place for math expressions
  29920. if (!this.options.loose) {
  29921. if (this.position > 0) {
  29922. if (this.current.type === 'func' && this.current.value === 'calc') {
  29923. // allow operators to be proceeded by spaces and opening parens
  29924. if (this.prevToken[0] !== 'space' && this.prevToken[0] !== '(') {
  29925. this.error('Syntax Error', this.currToken);
  29926. }
  29927. // valid: calc(1 - +2)
  29928. // invalid: calc(1 -+2)
  29929. else if (this.nextToken[0] !== 'space' && this.nextToken[0] !== 'word') {
  29930. this.error('Syntax Error', this.currToken);
  29931. }
  29932. // valid: calc(1 - +2)
  29933. // valid: calc(-0.5 + 2)
  29934. // invalid: calc(1 -2)
  29935. else if (this.nextToken[0] === 'word' && this.current.last.type !== 'operator' &&
  29936. this.current.last.value !== '(') {
  29937. this.error('Syntax Error', this.currToken);
  29938. }
  29939. }
  29940. // if we're not in a function and someone has doubled up on operators,
  29941. // or they're trying to perform a calc outside of a calc
  29942. // eg. +-4px or 5+ 5, throw an error
  29943. else if (this.nextToken[0] === 'space'
  29944. || this.nextToken[0] === 'operator'
  29945. || this.prevToken[0] === 'operator') {
  29946. this.error('Syntax Error', this.currToken);
  29947. }
  29948. }
  29949. }
  29950. if (!this.options.loose) {
  29951. if (this.nextToken[0] === 'word') {
  29952. return this.word();
  29953. }
  29954. }
  29955. else {
  29956. if ((!this.current.nodes.length || (this.current.last && this.current.last.type === 'operator')) && this.nextToken[0] === 'word') {
  29957. return this.word();
  29958. }
  29959. }
  29960. }
  29961. node = new Operator({
  29962. value: this.currToken[1],
  29963. source: {
  29964. start: {
  29965. line: this.currToken[2],
  29966. column: this.currToken[3]
  29967. },
  29968. end: {
  29969. line: this.currToken[2],
  29970. column: this.currToken[3]
  29971. }
  29972. },
  29973. sourceIndex: this.currToken[4]
  29974. });
  29975. this.position ++;
  29976. return this.newNode(node);
  29977. }
  29978. parseTokens () {
  29979. switch (this.currToken[0]) {
  29980. case 'space':
  29981. this.space();
  29982. break;
  29983. case 'colon':
  29984. this.colon();
  29985. break;
  29986. case 'comma':
  29987. this.comma();
  29988. break;
  29989. case 'comment':
  29990. this.comment();
  29991. break;
  29992. case '(':
  29993. this.parenOpen();
  29994. break;
  29995. case ')':
  29996. this.parenClose();
  29997. break;
  29998. case 'atword':
  29999. case 'word':
  30000. this.word();
  30001. break;
  30002. case 'operator':
  30003. this.operator();
  30004. break;
  30005. case 'string':
  30006. this.string();
  30007. break;
  30008. case 'unicoderange':
  30009. this.unicodeRange();
  30010. break;
  30011. default:
  30012. this.word();
  30013. break;
  30014. }
  30015. }
  30016. parenOpen () {
  30017. let unbalanced = 1,
  30018. pos = this.position + 1,
  30019. token = this.currToken,
  30020. last;
  30021. // check for balanced parens
  30022. while (pos < this.tokens.length && unbalanced) {
  30023. let tkn = this.tokens[pos];
  30024. if (tkn[0] === '(') {
  30025. unbalanced++;
  30026. }
  30027. if (tkn[0] === ')') {
  30028. unbalanced--;
  30029. }
  30030. pos ++;
  30031. }
  30032. if (unbalanced) {
  30033. this.error('Expected closing parenthesis', token);
  30034. }
  30035. // ok, all parens are balanced. continue on
  30036. last = this.current.last;
  30037. if (last && last.type === 'func' && last.unbalanced < 0) {
  30038. last.unbalanced = 0; // ok we're ready to add parens now
  30039. this.current = last;
  30040. }
  30041. this.current.unbalanced ++;
  30042. this.newNode(new Paren({
  30043. value: token[1],
  30044. source: {
  30045. start: {
  30046. line: token[2],
  30047. column: token[3]
  30048. },
  30049. end: {
  30050. line: token[4],
  30051. column: token[5]
  30052. }
  30053. },
  30054. sourceIndex: token[6]
  30055. }));
  30056. this.position ++;
  30057. // url functions get special treatment, and anything between the function
  30058. // parens get treated as one word, if the contents aren't not a string.
  30059. if (this.current.type === 'func' && this.current.unbalanced &&
  30060. this.current.value === 'url' && this.currToken[0] !== 'string' &&
  30061. this.currToken[0] !== ')' && !this.options.loose) {
  30062. let nextToken = this.nextToken,
  30063. value = this.currToken[1],
  30064. start = {
  30065. line: this.currToken[2],
  30066. column: this.currToken[3]
  30067. };
  30068. while (nextToken && nextToken[0] !== ')' && this.current.unbalanced) {
  30069. this.position ++;
  30070. value += this.currToken[1];
  30071. nextToken = this.nextToken;
  30072. }
  30073. if (this.position !== this.tokens.length - 1) {
  30074. // skip the following word definition, or it'll be a duplicate
  30075. this.position ++;
  30076. this.newNode(new Word({
  30077. value,
  30078. source: {
  30079. start,
  30080. end: {
  30081. line: this.currToken[4],
  30082. column: this.currToken[5]
  30083. }
  30084. },
  30085. sourceIndex: this.currToken[6]
  30086. }));
  30087. }
  30088. }
  30089. }
  30090. parenClose () {
  30091. let token = this.currToken;
  30092. this.newNode(new Paren({
  30093. value: token[1],
  30094. source: {
  30095. start: {
  30096. line: token[2],
  30097. column: token[3]
  30098. },
  30099. end: {
  30100. line: token[4],
  30101. column: token[5]
  30102. }
  30103. },
  30104. sourceIndex: token[6]
  30105. }));
  30106. this.position ++;
  30107. if (this.position >= this.tokens.length - 1 && !this.current.unbalanced) {
  30108. return;
  30109. }
  30110. this.current.unbalanced --;
  30111. if (this.current.unbalanced < 0) {
  30112. this.error('Expected opening parenthesis', token);
  30113. }
  30114. if (!this.current.unbalanced && this.cache.length) {
  30115. this.current = this.cache.pop();
  30116. }
  30117. }
  30118. space () {
  30119. let token = this.currToken;
  30120. // Handle space before and after the selector
  30121. if (this.position === (this.tokens.length - 1) || this.nextToken[0] === ',' || this.nextToken[0] === ')') {
  30122. this.current.last.raws.after += token[1];
  30123. this.position ++;
  30124. }
  30125. else {
  30126. this.spaces = token[1];
  30127. this.position ++;
  30128. }
  30129. }
  30130. unicodeRange () {
  30131. let token = this.currToken;
  30132. this.newNode(new UnicodeRange({
  30133. value: token[1],
  30134. source: {
  30135. start: {
  30136. line: token[2],
  30137. column: token[3]
  30138. },
  30139. end: {
  30140. line: token[4],
  30141. column: token[5]
  30142. }
  30143. },
  30144. sourceIndex: token[6]
  30145. }));
  30146. this.position ++;
  30147. }
  30148. splitWord () {
  30149. let nextToken = this.nextToken,
  30150. word = this.currToken[1],
  30151. rNumber = /^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,
  30152. // treat css-like groupings differently so they can be inspected,
  30153. // but don't address them as anything but a word, but allow hex values
  30154. // to pass through.
  30155. rNoFollow = /^(?!\#([a-z0-9]+))[\#\{\}]/gi,
  30156. hasAt, indices;
  30157. if (!rNoFollow.test(word)) {
  30158. while (nextToken && nextToken[0] === 'word') {
  30159. this.position ++;
  30160. let current = this.currToken[1];
  30161. word += current;
  30162. nextToken = this.nextToken;
  30163. }
  30164. }
  30165. hasAt = indexesOf(word, '@');
  30166. indices = sortAscending(uniq(flatten([[0], hasAt])));
  30167. indices.forEach((ind, i) => {
  30168. let index = indices[i + 1] || word.length,
  30169. value = word.slice(ind, index),
  30170. node;
  30171. if (~hasAt.indexOf(ind)) {
  30172. node = new AtWord({
  30173. value: value.slice(1),
  30174. source: {
  30175. start: {
  30176. line: this.currToken[2],
  30177. column: this.currToken[3] + ind
  30178. },
  30179. end: {
  30180. line: this.currToken[4],
  30181. column: this.currToken[3] + (index - 1)
  30182. }
  30183. },
  30184. sourceIndex: this.currToken[6] + indices[i]
  30185. });
  30186. }
  30187. else if (rNumber.test(this.currToken[1])) {
  30188. let unit = value.replace(rNumber, '');
  30189. node = new Numbr({
  30190. value: value.replace(unit, ''),
  30191. source: {
  30192. start: {
  30193. line: this.currToken[2],
  30194. column: this.currToken[3] + ind
  30195. },
  30196. end: {
  30197. line: this.currToken[4],
  30198. column: this.currToken[3] + (index - 1)
  30199. }
  30200. },
  30201. sourceIndex: this.currToken[6] + indices[i],
  30202. unit
  30203. });
  30204. }
  30205. else {
  30206. node = new (nextToken && nextToken[0] === '(' ? Func : Word)({
  30207. value,
  30208. source: {
  30209. start: {
  30210. line: this.currToken[2],
  30211. column: this.currToken[3] + ind
  30212. },
  30213. end: {
  30214. line: this.currToken[4],
  30215. column: this.currToken[3] + (index - 1)
  30216. }
  30217. },
  30218. sourceIndex: this.currToken[6] + indices[i]
  30219. });
  30220. if (node.constructor.name === 'Word') {
  30221. node.isHex = /^#(.+)/.test(value);
  30222. node.isColor = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(value);
  30223. }
  30224. else {
  30225. this.cache.push(this.current);
  30226. }
  30227. }
  30228. this.newNode(node);
  30229. });
  30230. this.position ++;
  30231. }
  30232. string () {
  30233. let token = this.currToken,
  30234. value = this.currToken[1],
  30235. rQuote = /^(\"|\')/,
  30236. quoted = rQuote.test(value),
  30237. quote = '',
  30238. node;
  30239. if (quoted) {
  30240. quote = value.match(rQuote)[0];
  30241. // set value to the string within the quotes
  30242. // quotes are stored in raws
  30243. value = value.slice(1, value.length - 1);
  30244. }
  30245. node = new Str({
  30246. value,
  30247. source: {
  30248. start: {
  30249. line: token[2],
  30250. column: token[3]
  30251. },
  30252. end: {
  30253. line: token[4],
  30254. column: token[5]
  30255. }
  30256. },
  30257. sourceIndex: token[6],
  30258. quoted
  30259. });
  30260. node.raws.quote = quote;
  30261. this.newNode(node);
  30262. this.position++;
  30263. }
  30264. word () {
  30265. return this.splitWord();
  30266. }
  30267. newNode (node) {
  30268. if (this.spaces) {
  30269. node.raws.before += this.spaces;
  30270. this.spaces = '';
  30271. }
  30272. return this.current.append(node);
  30273. }
  30274. get currToken () {
  30275. return this.tokens[this.position];
  30276. }
  30277. get nextToken () {
  30278. return this.tokens[this.position + 1];
  30279. }
  30280. get prevToken () {
  30281. return this.tokens[this.position - 1];
  30282. }
  30283. };
  30284. /***/ }),
  30285. /* 191 */
  30286. /***/ (function(module, exports, __webpack_require__) {
  30287. "use strict";
  30288. const Container = __webpack_require__(2);
  30289. module.exports = class Root extends Container {
  30290. constructor (opts) {
  30291. super(opts);
  30292. this.type = 'root';
  30293. }
  30294. };
  30295. /***/ }),
  30296. /* 192 */
  30297. /***/ (function(module, exports, __webpack_require__) {
  30298. "use strict";
  30299. const openBracket = '{'.charCodeAt(0);
  30300. const closeBracket = '}'.charCodeAt(0);
  30301. const openParen = '('.charCodeAt(0);
  30302. const closeParen = ')'.charCodeAt(0);
  30303. const singleQuote = '\''.charCodeAt(0);
  30304. const doubleQuote = '"'.charCodeAt(0);
  30305. const backslash = '\\'.charCodeAt(0);
  30306. const slash = '/'.charCodeAt(0);
  30307. const period = '.'.charCodeAt(0);
  30308. const comma = ','.charCodeAt(0);
  30309. const colon = ':'.charCodeAt(0);
  30310. const asterisk = '*'.charCodeAt(0);
  30311. const minus = '-'.charCodeAt(0);
  30312. const plus = '+'.charCodeAt(0);
  30313. const pound = '#'.charCodeAt(0);
  30314. const newline = '\n'.charCodeAt(0);
  30315. const space = ' '.charCodeAt(0);
  30316. const feed = '\f'.charCodeAt(0);
  30317. const tab = '\t'.charCodeAt(0);
  30318. const cr = '\r'.charCodeAt(0);
  30319. const at = '@'.charCodeAt(0);
  30320. const lowerE = 'e'.charCodeAt(0);
  30321. const upperE = 'E'.charCodeAt(0);
  30322. const digit0 = '0'.charCodeAt(0);
  30323. const digit9 = '9'.charCodeAt(0);
  30324. const lowerU = 'u'.charCodeAt(0);
  30325. const upperU = 'U'.charCodeAt(0);
  30326. const atEnd = /[ \n\t\r\{\(\)'"\\;,/]/g;
  30327. const wordEnd = /[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;
  30328. const wordEndNum = /[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g;
  30329. const alphaNum = /^[a-z0-9]/i;
  30330. const unicodeRange = /^[a-f0-9?\-]/i;
  30331. const util = __webpack_require__(213);
  30332. const TokenizeError = __webpack_require__(189);
  30333. module.exports = function tokenize (input, options) {
  30334. options = options || {};
  30335. let tokens = [],
  30336. css = input.valueOf(),
  30337. length = css.length,
  30338. offset = -1,
  30339. line = 1,
  30340. pos = 0,
  30341. parentCount = 0,
  30342. isURLArg = null,
  30343. code, next, quote, lines, last, content, escape, nextLine, nextOffset,
  30344. escaped, escapePos, nextChar;
  30345. function unclosed (what) {
  30346. let message = util.format('Unclosed %s at line: %d, column: %d, token: %d', what, line, pos - offset, pos);
  30347. throw new TokenizeError(message);
  30348. }
  30349. function tokenizeError () {
  30350. let message = util.format('Syntax error at line: %d, column: %d, token: %d', line, pos - offset, pos);
  30351. throw new TokenizeError(message);
  30352. }
  30353. while (pos < length) {
  30354. code = css.charCodeAt(pos);
  30355. if (code === newline) {
  30356. offset = pos;
  30357. line += 1;
  30358. }
  30359. switch (code) {
  30360. case newline:
  30361. case space:
  30362. case tab:
  30363. case cr:
  30364. case feed:
  30365. next = pos;
  30366. do {
  30367. next += 1;
  30368. code = css.charCodeAt(next);
  30369. if (code === newline) {
  30370. offset = next;
  30371. line += 1;
  30372. }
  30373. } while (code === space ||
  30374. code === newline ||
  30375. code === tab ||
  30376. code === cr ||
  30377. code === feed);
  30378. tokens.push(['space', css.slice(pos, next),
  30379. line, pos - offset,
  30380. line, next - offset,
  30381. pos
  30382. ]);
  30383. pos = next - 1;
  30384. break;
  30385. case colon:
  30386. next = pos + 1;
  30387. tokens.push(['colon', css.slice(pos, next),
  30388. line, pos - offset,
  30389. line, next - offset,
  30390. pos
  30391. ]);
  30392. pos = next - 1;
  30393. break;
  30394. case comma:
  30395. next = pos + 1;
  30396. tokens.push(['comma', css.slice(pos, next),
  30397. line, pos - offset,
  30398. line, next - offset,
  30399. pos
  30400. ]);
  30401. pos = next - 1;
  30402. break;
  30403. case openBracket:
  30404. tokens.push(['{', '{',
  30405. line, pos - offset,
  30406. line, next - offset,
  30407. pos
  30408. ]);
  30409. break;
  30410. case closeBracket:
  30411. tokens.push(['}', '}',
  30412. line, pos - offset,
  30413. line, next - offset,
  30414. pos
  30415. ]);
  30416. break;
  30417. case openParen:
  30418. parentCount++;
  30419. isURLArg = !isURLArg && parentCount === 1 &&
  30420. tokens.length > 0 &&
  30421. tokens[tokens.length - 1][0] === "word" &&
  30422. tokens[tokens.length - 1][1] === "url";
  30423. tokens.push(['(', '(',
  30424. line, pos - offset,
  30425. line, next - offset,
  30426. pos
  30427. ]);
  30428. break;
  30429. case closeParen:
  30430. parentCount--;
  30431. isURLArg = !isURLArg && parentCount === 1;
  30432. tokens.push([')', ')',
  30433. line, pos - offset,
  30434. line, next - offset,
  30435. pos
  30436. ]);
  30437. break;
  30438. case singleQuote:
  30439. case doubleQuote:
  30440. quote = code === singleQuote ? '\'' : '"';
  30441. next = pos;
  30442. do {
  30443. escaped = false;
  30444. next = css.indexOf(quote, next + 1);
  30445. if (next === -1) {
  30446. unclosed('quote', quote);
  30447. }
  30448. escapePos = next;
  30449. while (css.charCodeAt(escapePos - 1) === backslash) {
  30450. escapePos -= 1;
  30451. escaped = !escaped;
  30452. }
  30453. } while (escaped);
  30454. tokens.push(['string', css.slice(pos, next + 1),
  30455. line, pos - offset,
  30456. line, next - offset,
  30457. pos
  30458. ]);
  30459. pos = next;
  30460. break;
  30461. case at:
  30462. atEnd.lastIndex = pos + 1;
  30463. atEnd.test(css);
  30464. if (atEnd.lastIndex === 0) {
  30465. next = css.length - 1;
  30466. }
  30467. else {
  30468. next = atEnd.lastIndex - 2;
  30469. }
  30470. tokens.push(['atword', css.slice(pos, next + 1),
  30471. line, pos - offset,
  30472. line, next - offset,
  30473. pos
  30474. ]);
  30475. pos = next;
  30476. break;
  30477. case backslash:
  30478. next = pos;
  30479. code = css.charCodeAt(next + 1);
  30480. if (escape && (code !== slash && code !== space &&
  30481. code !== newline && code !== tab &&
  30482. code !== cr && code !== feed)) {
  30483. next += 1;
  30484. }
  30485. tokens.push(['word', css.slice(pos, next + 1),
  30486. line, pos - offset,
  30487. line, next - offset,
  30488. pos
  30489. ]);
  30490. pos = next;
  30491. break;
  30492. case plus:
  30493. case minus:
  30494. case asterisk:
  30495. next = pos + 1;
  30496. nextChar = css.slice(pos + 1, next + 1);
  30497. let prevChar = css.slice(pos - 1, pos);
  30498. // if the operator is immediately followed by a word character, then we
  30499. // have a prefix of some kind, and should fall-through. eg. -webkit
  30500. // look for --* for custom variables
  30501. if (code === minus && nextChar.charCodeAt(0) === minus) {
  30502. next++;
  30503. tokens.push(['word', css.slice(pos, next),
  30504. line, pos - offset,
  30505. line, next - offset,
  30506. pos
  30507. ]);
  30508. pos = next - 1;
  30509. break;
  30510. }
  30511. tokens.push(['operator', css.slice(pos, next),
  30512. line, pos - offset,
  30513. line, next - offset,
  30514. pos
  30515. ]);
  30516. pos = next - 1;
  30517. break;
  30518. default:
  30519. if (code === slash && (css.charCodeAt(pos + 1) === asterisk || (options.loose && !isURLArg && css.charCodeAt(pos + 1) === slash))) {
  30520. const isStandardComment = css.charCodeAt(pos + 1) === asterisk;
  30521. if (isStandardComment) {
  30522. next = css.indexOf('*/', pos + 2) + 1;
  30523. if (next === 0) {
  30524. unclosed('comment', '*/');
  30525. }
  30526. }
  30527. else {
  30528. const newlinePos = css.indexOf('\n', pos + 2);
  30529. next = newlinePos !== -1 ? newlinePos - 1 : length;
  30530. }
  30531. content = css.slice(pos, next + 1);
  30532. lines = content.split('\n');
  30533. last = lines.length - 1;
  30534. if (last > 0) {
  30535. nextLine = line + last;
  30536. nextOffset = next - lines[last].length;
  30537. }
  30538. else {
  30539. nextLine = line;
  30540. nextOffset = offset;
  30541. }
  30542. tokens.push(['comment', content,
  30543. line, pos - offset,
  30544. nextLine, next - nextOffset,
  30545. pos
  30546. ]);
  30547. offset = nextOffset;
  30548. line = nextLine;
  30549. pos = next;
  30550. }
  30551. else if (code === pound && !alphaNum.test(css.slice(pos + 1, pos + 2))) {
  30552. next = pos + 1;
  30553. tokens.push(['#', css.slice(pos, next),
  30554. line, pos - offset,
  30555. line, next - offset,
  30556. pos
  30557. ]);
  30558. pos = next - 1;
  30559. }
  30560. else if ((code === lowerU || code === upperU) && css.charCodeAt(pos + 1) === plus) {
  30561. next = pos + 2;
  30562. do {
  30563. next += 1;
  30564. code = css.charCodeAt(next);
  30565. } while (next < length && unicodeRange.test(css.slice(next, next + 1)));
  30566. tokens.push(['unicoderange', css.slice(pos, next),
  30567. line, pos - offset,
  30568. line, next - offset,
  30569. pos
  30570. ]);
  30571. pos = next - 1;
  30572. }
  30573. // catch a regular slash, that isn't a comment
  30574. else if (code === slash) {
  30575. next = pos + 1;
  30576. tokens.push(['operator', css.slice(pos, next),
  30577. line, pos - offset,
  30578. line, next - offset,
  30579. pos
  30580. ]);
  30581. pos = next - 1;
  30582. }
  30583. else {
  30584. let regex = wordEnd;
  30585. // we're dealing with a word that starts with a number
  30586. // those get treated differently
  30587. if (code >= digit0 && code <= digit9) {
  30588. regex = wordEndNum;
  30589. }
  30590. regex.lastIndex = pos + 1;
  30591. regex.test(css);
  30592. if (regex.lastIndex === 0) {
  30593. next = css.length - 1;
  30594. }
  30595. else {
  30596. next = regex.lastIndex - 2;
  30597. }
  30598. // Exponential number notation with minus or plus: 1e-10, 1e+10
  30599. if (regex === wordEndNum || code === period) {
  30600. let ncode = css.charCodeAt(next),
  30601. ncode1 = css.charCodeAt(next + 1),
  30602. ncode2 = css.charCodeAt(next + 2);
  30603. if (
  30604. (ncode === lowerE || ncode === upperE) &&
  30605. (ncode1 === minus || ncode1 === plus) &&
  30606. (ncode2 >= digit0 && ncode2 <= digit9)
  30607. ) {
  30608. wordEndNum.lastIndex = next + 2;
  30609. wordEndNum.test(css);
  30610. if (wordEndNum.lastIndex === 0) {
  30611. next = css.length - 1;
  30612. }
  30613. else {
  30614. next = wordEndNum.lastIndex - 2;
  30615. }
  30616. }
  30617. }
  30618. tokens.push(['word', css.slice(pos, next + 1),
  30619. line, pos - offset,
  30620. line, next - offset,
  30621. pos
  30622. ]);
  30623. pos = next;
  30624. }
  30625. break;
  30626. }
  30627. pos ++;
  30628. }
  30629. return tokens;
  30630. };
  30631. /***/ }),
  30632. /* 193 */
  30633. /***/ (function(module, exports, __webpack_require__) {
  30634. "use strict";
  30635. exports.__esModule = true;
  30636. /**
  30637. * Contains helpers for safely splitting lists of CSS values,
  30638. * preserving parentheses and quotes.
  30639. *
  30640. * @example
  30641. * const list = postcss.list;
  30642. *
  30643. * @namespace list
  30644. */
  30645. var list = {
  30646. split: function split(string, separators, last) {
  30647. var array = [];
  30648. var current = '';
  30649. var split = false;
  30650. var func = 0;
  30651. var quote = false;
  30652. var escape = false;
  30653. for (var i = 0; i < string.length; i++) {
  30654. var letter = string[i];
  30655. if (quote) {
  30656. if (escape) {
  30657. escape = false;
  30658. } else if (letter === '\\') {
  30659. escape = true;
  30660. } else if (letter === quote) {
  30661. quote = false;
  30662. }
  30663. } else if (letter === '"' || letter === '\'') {
  30664. quote = letter;
  30665. } else if (letter === '(') {
  30666. func += 1;
  30667. } else if (letter === ')') {
  30668. if (func > 0) func -= 1;
  30669. } else if (func === 0) {
  30670. if (separators.indexOf(letter) !== -1) split = true;
  30671. }
  30672. if (split) {
  30673. if (current !== '') array.push(current.trim());
  30674. current = '';
  30675. split = false;
  30676. } else {
  30677. current += letter;
  30678. }
  30679. }
  30680. if (last || current !== '') array.push(current.trim());
  30681. return array;
  30682. },
  30683. /**
  30684. * Safely splits space-separated values (such as those for `background`,
  30685. * `border-radius`, and other shorthand properties).
  30686. *
  30687. * @param {string} string - space-separated values
  30688. *
  30689. * @return {string[]} split values
  30690. *
  30691. * @example
  30692. * postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
  30693. */
  30694. space: function space(string) {
  30695. var spaces = [' ', '\n', '\t'];
  30696. return list.split(string, spaces);
  30697. },
  30698. /**
  30699. * Safely splits comma-separated values (such as those for `transition-*`
  30700. * and `background` properties).
  30701. *
  30702. * @param {string} string - comma-separated values
  30703. *
  30704. * @return {string[]} split values
  30705. *
  30706. * @example
  30707. * postcss.list.comma('black, linear-gradient(white, black)')
  30708. * //=> ['black', 'linear-gradient(white, black)']
  30709. */
  30710. comma: function comma(string) {
  30711. var comma = ',';
  30712. return list.split(string, [comma], true);
  30713. }
  30714. };
  30715. exports.default = list;
  30716. module.exports = exports['default'];
  30717. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QuZXM2Il0sIm5hbWVzIjpbImxpc3QiLCJzcGxpdCIsInN0cmluZyIsInNlcGFyYXRvcnMiLCJsYXN0IiwiYXJyYXkiLCJjdXJyZW50IiwiZnVuYyIsInF1b3RlIiwiZXNjYXBlIiwiaSIsImxlbmd0aCIsImxldHRlciIsImluZGV4T2YiLCJwdXNoIiwidHJpbSIsInNwYWNlIiwic3BhY2VzIiwiY29tbWEiXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7Ozs7QUFTQSxJQUFJQSxPQUFPO0FBRVBDLFNBRk8saUJBRURDLE1BRkMsRUFFT0MsVUFGUCxFQUVtQkMsSUFGbkIsRUFFeUI7QUFDNUIsWUFBSUMsUUFBVSxFQUFkO0FBQ0EsWUFBSUMsVUFBVSxFQUFkO0FBQ0EsWUFBSUwsUUFBVSxLQUFkOztBQUVBLFlBQUlNLE9BQVUsQ0FBZDtBQUNBLFlBQUlDLFFBQVUsS0FBZDtBQUNBLFlBQUlDLFNBQVUsS0FBZDs7QUFFQSxhQUFNLElBQUlDLElBQUksQ0FBZCxFQUFpQkEsSUFBSVIsT0FBT1MsTUFBNUIsRUFBb0NELEdBQXBDLEVBQTBDO0FBQ3RDLGdCQUFJRSxTQUFTVixPQUFPUSxDQUFQLENBQWI7O0FBRUEsZ0JBQUtGLEtBQUwsRUFBYTtBQUNULG9CQUFLQyxNQUFMLEVBQWM7QUFDVkEsNkJBQVMsS0FBVDtBQUNILGlCQUZELE1BRU8sSUFBS0csV0FBVyxJQU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BlICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBsZXR0ZXIgPT09ICdcXFxcJyApIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBsZXR0ZXIgPT09IHF1b3RlICkge1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGxldHRlciA9PT0gJ1wiJyB8fCBsZXR0ZXIgPT09ICdcXCcnICkge1xuICAgICAgICAgICAgICAgIHF1b3RlID0gbGV0dGVyO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKCcgKSB7XG4gICAgICAgICAgICAgICAgZnVuYyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKScgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBmdW5jID4gMCApIGZ1bmMgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGZ1bmMgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBzZXBhcmF0b3JzLmluZGV4T2YobGV0dGVyKSAhPT0gLTEgKSBzcGxpdCA9IHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggc3BsaXQgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBjdXJyZW50ICE9PSAnJyApIGFycmF5LnB1c2goY3VycmVudC50cmltKCkpO1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSAnJztcbiAgICAgICAgICAgICAgICBzcGxpdCAgID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgKz0gbGV0dGVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAg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G4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MubGlzdC5jb21tYSgnYmxhY2ssIGxpbmVhci1ncmFkaWVudCh3aGl0ZSwgYmxhY2spJylcbiAgICAgKiAvLz0+IFsnYmxhY2snLCAnbGluZWFyLWdyYWRpZW50KHdoaXRlLCBibGFjayknXVxuICAgICAqL1xuICAgIGNvbW1hKHN0cmluZykge1xuICAgICAgICBsZXQgY29tbWEgPSAnLCc7XG4gICAgICAgIHJldHVybiBsaXN0LnNwbGl0KHN0cmluZywgW2NvbW1hXSwgdHJ1ZSk7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBsaXN0O1xuIl19
  30718. /***/ }),
  30719. /* 194 */
  30720. /***/ (function(module, exports, __webpack_require__) {
  30721. "use strict";
  30722. exports.__esModule = true;
  30723. var _jsBase = __webpack_require__(49);
  30724. var _sourceMap = __webpack_require__(102);
  30725. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  30726. var _path = __webpack_require__(8);
  30727. var _path2 = _interopRequireDefault(_path);
  30728. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30729. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30730. var MapGenerator = function () {
  30731. function MapGenerator(stringify, root, opts) {
  30732. _classCallCheck(this, MapGenerator);
  30733. this.stringify = stringify;
  30734. this.mapOpts = opts.map || {};
  30735. this.root = root;
  30736. this.opts = opts;
  30737. }
  30738. MapGenerator.prototype.isMap = function isMap() {
  30739. if (typeof this.opts.map !== 'undefined') {
  30740. return !!this.opts.map;
  30741. } else {
  30742. return this.previous().length > 0;
  30743. }
  30744. };
  30745. MapGenerator.prototype.previous = function previous() {
  30746. var _this = this;
  30747. if (!this.previousMaps) {
  30748. this.previousMaps = [];
  30749. this.root.walk(function (node) {
  30750. if (node.source && node.source.input.map) {
  30751. var map = node.source.input.map;
  30752. if (_this.previousMaps.indexOf(map) === -1) {
  30753. _this.previousMaps.push(map);
  30754. }
  30755. }
  30756. });
  30757. }
  30758. return this.previousMaps;
  30759. };
  30760. MapGenerator.prototype.isInline = function isInline() {
  30761. if (typeof this.mapOpts.inline !== 'undefined') {
  30762. return this.mapOpts.inline;
  30763. }
  30764. var annotation = this.mapOpts.annotation;
  30765. if (typeof annotation !== 'undefined' && annotation !== true) {
  30766. return false;
  30767. }
  30768. if (this.previous().length) {
  30769. return this.previous().some(function (i) {
  30770. return i.inline;
  30771. });
  30772. } else {
  30773. return true;
  30774. }
  30775. };
  30776. MapGenerator.prototype.isSourcesContent = function isSourcesContent() {
  30777. if (typeof this.mapOpts.sourcesContent !== 'undefined') {
  30778. return this.mapOpts.sourcesContent;
  30779. }
  30780. if (this.previous().length) {
  30781. return this.previous().some(function (i) {
  30782. return i.withContent();
  30783. });
  30784. } else {
  30785. return true;
  30786. }
  30787. };
  30788. MapGenerator.prototype.clearAnnotation = function clearAnnotation() {
  30789. if (this.mapOpts.annotation === false) return;
  30790. var node = void 0;
  30791. for (var i = this.root.nodes.length - 1; i >= 0; i--) {
  30792. node = this.root.nodes[i];
  30793. if (node.type !== 'comment') continue;
  30794. if (node.text.indexOf('# sourceMappingURL=') === 0) {
  30795. this.root.removeChild(i);
  30796. }
  30797. }
  30798. };
  30799. MapGenerator.prototype.setSourcesContent = function setSourcesContent() {
  30800. var _this2 = this;
  30801. var already = {};
  30802. this.root.walk(function (node) {
  30803. if (node.source) {
  30804. var from = node.source.input.from;
  30805. if (from && !already[from]) {
  30806. already[from] = true;
  30807. var relative = _this2.relative(from);
  30808. _this2.map.setSourceContent(relative, node.source.input.css);
  30809. }
  30810. }
  30811. });
  30812. };
  30813. MapGenerator.prototype.applyPrevMaps = function applyPrevMaps() {
  30814. for (var _iterator = this.previous(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  30815. var _ref;
  30816. if (_isArray) {
  30817. if (_i >= _iterator.length) break;
  30818. _ref = _iterator[_i++];
  30819. } else {
  30820. _i = _iterator.next();
  30821. if (_i.done) break;
  30822. _ref = _i.value;
  30823. }
  30824. var prev = _ref;
  30825. var from = this.relative(prev.file);
  30826. var root = prev.root || _path2.default.dirname(prev.file);
  30827. var map = void 0;
  30828. if (this.mapOpts.sourcesContent === false) {
  30829. map = new _sourceMap2.default.SourceMapConsumer(prev.text);
  30830. if (map.sourcesContent) {
  30831. map.sourcesContent = map.sourcesContent.map(function () {
  30832. return null;
  30833. });
  30834. }
  30835. } else {
  30836. map = prev.consumer();
  30837. }
  30838. this.map.applySourceMap(map, from, this.relative(root));
  30839. }
  30840. };
  30841. MapGenerator.prototype.isAnnotation = function isAnnotation() {
  30842. if (this.isInline()) {
  30843. return true;
  30844. } else if (typeof this.mapOpts.annotation !== 'undefined') {
  30845. return this.mapOpts.annotation;
  30846. } else if (this.previous().length) {
  30847. return this.previous().some(function (i) {
  30848. return i.annotation;
  30849. });
  30850. } else {
  30851. return true;
  30852. }
  30853. };
  30854. MapGenerator.prototype.addAnnotation = function addAnnotation() {
  30855. var content = void 0;
  30856. if (this.isInline()) {
  30857. content = 'data:application/json;base64,' + _jsBase.Base64.encode(this.map.toString());
  30858. } else if (typeof this.mapOpts.annotation === 'string') {
  30859. content = this.mapOpts.annotation;
  30860. } else {
  30861. content = this.outputFile() + '.map';
  30862. }
  30863. var eol = '\n';
  30864. if (this.css.indexOf('\r\n') !== -1) eol = '\r\n';
  30865. this.css += eol + '/*# sourceMappingURL=' + content + ' */';
  30866. };
  30867. MapGenerator.prototype.outputFile = function outputFile() {
  30868. if (this.opts.to) {
  30869. return this.relative(this.opts.to);
  30870. } else if (this.opts.from) {
  30871. return this.relative(this.opts.from);
  30872. } else {
  30873. return 'to.css';
  30874. }
  30875. };
  30876. MapGenerator.prototype.generateMap = function generateMap() {
  30877. this.generateString();
  30878. if (this.isSourcesContent()) this.setSourcesContent();
  30879. if (this.previous().length > 0) this.applyPrevMaps();
  30880. if (this.isAnnotation()) this.addAnnotation();
  30881. if (this.isInline()) {
  30882. return [this.css];
  30883. } else {
  30884. return [this.css, this.map];
  30885. }
  30886. };
  30887. MapGenerator.prototype.relative = function relative(file) {
  30888. if (file.indexOf('<') === 0) return file;
  30889. if (/^\w+:\/\//.test(file)) return file;
  30890. var from = this.opts.to ? _path2.default.dirname(this.opts.to) : '.';
  30891. if (typeof this.mapOpts.annotation === 'string') {
  30892. from = _path2.default.dirname(_path2.default.resolve(from, this.mapOpts.annotation));
  30893. }
  30894. file = _path2.default.relative(from, file);
  30895. if (_path2.default.sep === '\\') {
  30896. return file.replace(/\\/g, '/');
  30897. } else {
  30898. return file;
  30899. }
  30900. };
  30901. MapGenerator.prototype.sourcePath = function sourcePath(node) {
  30902. if (this.mapOpts.from) {
  30903. return this.mapOpts.from;
  30904. } else {
  30905. return this.relative(node.source.input.from);
  30906. }
  30907. };
  30908. MapGenerator.prototype.generateString = function generateString() {
  30909. var _this3 = this;
  30910. this.css = '';
  30911. this.map = new _sourceMap2.default.SourceMapGenerator({ file: this.outputFile() });
  30912. var line = 1;
  30913. var column = 1;
  30914. var lines = void 0,
  30915. last = void 0;
  30916. this.stringify(this.root, function (str, node, type) {
  30917. _this3.css += str;
  30918. if (node && type !== 'end') {
  30919. if (node.source && node.source.start) {
  30920. _this3.map.addMapping({
  30921. source: _this3.sourcePath(node),
  30922. generated: { line: line, column: column - 1 },
  30923. original: {
  30924. line: node.source.start.line,
  30925. column: node.source.start.column - 1
  30926. }
  30927. });
  30928. } else {
  30929. _this3.map.addMapping({
  30930. source: '<no source>',
  30931. original: { line: 1, column: 0 },
  30932. generated: { line: line, column: column - 1 }
  30933. });
  30934. }
  30935. }
  30936. lines = str.match(/\n/g);
  30937. if (lines) {
  30938. line += lines.length;
  30939. last = str.lastIndexOf('\n');
  30940. column = str.length - last;
  30941. } else {
  30942. column += str.length;
  30943. }
  30944. if (node && type !== 'start') {
  30945. if (node.source && node.source.end) {
  30946. _this3.map.addMapping({
  30947. source: _this3.sourcePath(node),
  30948. generated: { line: line, column: column - 1 },
  30949. original: {
  30950. line: node.source.end.line,
  30951. column: node.source.end.column
  30952. }
  30953. });
  30954. } else {
  30955. _this3.map.addMapping({
  30956. source: '<no source>',
  30957. original: { line: 1, column: 0 },
  30958. generated: { line: line, column: column - 1 }
  30959. });
  30960. }
  30961. }
  30962. });
  30963. };
  30964. MapGenerator.prototype.generate = function generate() {
  30965. this.clearAnnotation();
  30966. if (this.isMap()) {
  30967. return this.generateMap();
  30968. } else {
  30969. var result = '';
  30970. this.stringify(this.root, function (i) {
  30971. result += i;
  30972. });
  30973. return [result];
  30974. }
  30975. };
  30976. return MapGenerator;
  30977. }();
  30978. exports.default = MapGenerator;
  30979. module.exports = exports['default'];
  30980. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hcC1nZW5lcmF0b3IuZXM2Il0sIm5hbWVzIjpbIk1hcEdlbmVyYXRvciIsInN0cmluZ2lmeSIsInJvb3QiLCJvcHRzIiwibWFwT3B0cyIsIm1hcCIsImlzTWFwIiwicHJldmlvdXMiLCJsZW5ndGgiLCJwcmV2aW91c01hcHMiLCJ3YWxrIiwibm9kZSIsInNvdXJjZSIsImlucHV0IiwiaW5kZXhPZiIsInB1c2giLCJpc0lubGluZSIsImlubGluZSIsImFubm90YXRpb24iLCJzb21lIiwiaSIsImlzU291cmNlc0NvbnRlbnQiLCJzb3VyY2VzQ29udGVudCIsIndpdGhDb250ZW50IiwiY2xlYXJBbm5vdGF0aW9uIiwibm9kZXMiLCJ0eXBlIiwidGV4dCIsInJlbW92ZUNoaWxkIiwic2V0U291cmNlc0NvbnRlbnQiLCJhbHJlYWR5IiwiZnJvbSIsInJlbGF0aXZlIiwic2V0U291cmNlQ29udGVudCIsImNzcyIsImFwcGx5UHJldk1hcHMiLCJwcmV2IiwiZmlsZSIsImRpcm5hbWUiLCJTb3VyY2VNYXBDb25zdW1lciIsImNvbnN1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gICAgICA9IG9wdHM7XG4gICAgfVxuXG4gICAgaXNNYXAoKSB7XG4gICAgICAgIGlmICggdHlwZW9mIHRoaXMub3B0cy5tYXAgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuICEhdGhpcy5vcHRzLm1hcDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkubGVuZ3RoID4gMDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHByZXZpb3VzKCkge1xuICAgICAgICBpZiAoICF0aGlzLnByZXZpb3VzTWFwcyApIHtcbiAgICAgICAgICAgIHRoaXMucHJldmlvdXNNYXBzID0gW107XG4gICAgICAgICAgICB0aGlzLnJvb3Qud2Fsayggbm9kZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBub2RlLnNvdXJjZSAmJiBub2RlLnNvdXJjZS5pbnB1dC5tYXAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXAgPSBub2RlLnNvdXJjZS5pbnB1dC5tYXA7XG4gICAgICAgICAgICAgICAgICAgIGlmICggdGhpcy5wcmV2aW91c01hcHMuaW5kZXhPZihtYXApID09PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucHJldmlvdXNNYXBzLnB1c2gobWFwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMucHJldmlvdXNNYXBzO1xuICAgIH1cblxuICAgIGlzSW5saW5lKCkge1xuICAgICAgICBpZiAoIHR5cGVvZiB0aGlzLm1hcE9wdHMuaW5saW5lICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcE9wdHMuaW5saW5lO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGFubm90YXRpb24gPSB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbjtcbiAgICAgICAgaWYgKCB0eXBlb2YgYW5ub3RhdGlvbiAhPT0gJ3VuZGVmaW5lZCcgJiYgYW5ub3RhdGlvbiAhPT0gdHJ1ZSApIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggdGhpcy5wcmV2aW91cygpLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkuc29tZSggaSA9PiBpLmlubGluZSApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpc1NvdXJjZXNDb250ZW50KCkge1xuICAgICAgICBpZiAoIHR5cGVvZiB0aGlzLm1hcE9wdHMuc291cmNlc0NvbnRlbnQgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFwT3B0cy5zb3VyY2VzQ29udGVudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHRoaXMucHJldmlvdXMoKS5sZW5ndGggKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wcmV2aW91cygpLnNvbWUoIGkgPT4gaS53aXRoQ29udGVudCgpICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNsZWFyQW5ub3RhdGlvbigpIHtcbiAgICAgICAgaWYgKCB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbiA9PT0gZmFsc2UgKSByZXR1cm47XG5cbiAgICAgICAgbGV0IG5vZGU7XG4gICAgICAgIGZvciAoIGxldCBpID0gdGhpcy5yb290Lm5vZGVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tICkge1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMucm9vdC5ub2Rlc1tpXTtcbiAgICAgICAgICAgIGlmICggbm9kZS50eXBlICE9PSAnY29tbWVudCcgKSBjb250aW51ZTtcbiAgICAgICAgICAgIGlmICggbm9kZS50ZXh0LmluZGV4T2YoJyMgc291cmNlTWFwcGluZ1VSTD0nKSA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJvb3QucmVtb3ZlQ2hpbGQoaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzZXRTb3VyY2VzQ29udGVudCgpIHtcbiAgICAgICAgbGV0IGFscmVhZHkgPSB7IH07XG4gICAgICAgIHRoaXMucm9vdC53YWxrKCBub2RlID0+IHtcbiAgICAgICAgICAgIGlmICggbm9kZS5zb3VyY2UgKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZyb20gPSBub2RlLnNvdXJjZS5pbnB1dC5mcm9tO1xuICAgICAgICAgICAgICAgIGlmICggZnJvbSAmJiAhYWxyZWFkeVtmcm9tXSApIHtcbiAgICAgICAgICAgICAgICAgICAgYWxyZWFkeVtmcm9tXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGxldCByZWxhdGl2ZSA9IHRoaXMucmVsYXRpdmUoZnJvbSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLnNldFNvdXJjZUNvbnRlbnQocmVsYXRpdmUsIG5vZGUuc291cmNlLmlucHV0LmNzcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhcHBseVByZXZNYXBzKCkge1xuICAgICAgICBmb3IgKCBsZXQgcHJldiBvZiB0aGlzLnByZXZpb3VzKCkgKSB7XG4gICAgICAgICAgICBsZXQgZnJvbSA9IHRoaXMucmVsYXRpdmUocHJldi5maWxlKTtcbiAgICAgICAgICAgIGxldCByb290ID0gcHJldi5yb290IHx8IHBhdGguZGlybmFtZShwcmV2LmZpbGUpO1xuICAgICAgICAgICAgbGV0IG1hcDtcblxuICAgICAgICAgICAgaWYgKCB0aGlzLm1hcE9wdHMuc291cmNlc0NvbnRlbnQgPT09IGZhbHNlICkge1xuICAgICAgICAgICAgICAgIG1hcCA9IG5ldyBtb3ppbGxhLlNvdXJjZU1hcENvbnN1bWVyKHByZXYudGV4dCk7XG4gICAgICAgICAgICAgICAgaWYgKCBtYXAuc291cmNlc0NvbnRlbnQgKSB7XG4gICAgICAgICAgICAgICAgICAgIG1hcC5zb3VyY2VzQ29udGVudCA9IG1hcC5zb3VyY2VzQ29udGVudC5tYXAoICgpID0+IG51bGwgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG1hcCA9IHByZXYuY29uc3VtZXIoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5tYXAuYXBwbHlTb3VyY2VNYXAobWFwLCBmcm9tLCB0aGlzLnJlbGF0aXZlKHJvb3QpKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzQW5ub3RhdGlvbigpIHtcbiAgICAgICAgaWYgKCB0aGlzLmlzSW5saW5lKCkgKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIGlmICggdHlwZW9mIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbjtcbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5wcmV2aW91cygpLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkuc29tZSggaSA9PiBpLmFubm90YXRpb24gKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYWRkQW5ub3RhdGlvbigpIHtcbiAgICAgICAgbGV0IGNvbnRlbnQ7XG5cbiAgICAgICAgaWYgKCB0aGlzLmlzSW5saW5lKCkgKSB7XG4gICAgICAgICAgICBjb250ZW50ID0gJ2RhdGE6YXBwbGljYXRpb24vanNvbjtiYXNlNjQsJyArXG4gICAgICAgICAgICAgICAgICAgICAgIEJhc2U2NC5lbmNvZGUoIHRoaXMubWFwLnRvU3RyaW5nKCkgKTtcblxuICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgdGhpcy5tYXBPcHRzLmFubm90YXRpb24gPT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgY29udGVudCA9IHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uO1xuXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb250ZW50ID0gdGhpcy5vdXRwdXRGaWxlKCkgKyAnLm1hcCc7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgZW9sICAgPSAnXFxuJztcbiAgICAgICAgaWYgKCB0aGlzLmNzcy5pbmRleE9mKCdcXHJcXG4nKSAhPT0gLTEgKSBlb2wgPSAnXFxyXFxuJztcblxuICAgICAgICB0aGlzLmNzcyArPSBlb2wgKyAnLyojIHNvdXJjZU1hcHBpbmdVUkw9JyArIGNvbnRlbnQgKyAnICovJztcbiAgICB9XG5cbiAgICBvdXRwdXRGaWxlKCkge1xuICAgICAgICBpZiAoIHRoaXMub3B0cy50byApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnJlbGF0aXZlKHRoaXMub3B0cy50byk7XG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMub3B0cy5mcm9tICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucmVsYXRpdmUodGhpcy5vcHRzLmZyb20pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuICd0by5jc3MnO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZ2VuZXJhdGVNYXAoKSB7XG4gICAgICAgIHRoaXMuZ2VuZXJhdGVTdHJpbmcoKTtcbiAgICAgICAgaWYgKCB0aGlzLmlzU291cmNlc0Nvb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m4gZmlsZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNvdXJjZVBhdGgobm9kZSkge1xuICAgICAgICBpZiAoIHRoaXMubWFwT3B0cy5mcm9tICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFwT3B0cy5mcm9tO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucmVsYXRpdmUobm9kZS5zb3VyY2UuaW5wdXQuZnJvbSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZW5lcmF0ZVN0cmluZygpIHtcbiAgICAgICAgdGhpcy5jc3MgPSAnJztcbiAgICAgICAgdGhpcy5tYXAgPSBuZXcgbW96aWxsYS5Tb3VyY2VNYXBHZW5lcmF0b3IoeyBmaWxlOiB0aGlzLm91dHB1dEZpbGUoKSB9KTtcblxuICAgICAgICBsZXQgbGluZSAgID0gMTtcbiAgICAgICAgbGV0IGNvbHVtbiA9IDE7XG5cbiAgICAgICAgbGV0IGxpbmVzLCBsYXN0O1xuICAgICAgICB0aGlzLnN0cmluZ2lmeSh0aGlzLnJvb3QsIChzdHIsIG5vZGUsIHR5cGUpID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3NzICs9IHN0cjtcblxuICAgICAgICAgICAgaWYgKCBub2RlICYmIHR5cGUgIT09ICdlbmQnICkge1xuICAgICAgICAgICAgICAgIGlmICggbm9kZS5zb3VyY2UgJiYgbm9kZS5zb3VyY2Uuc3RhcnQgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAgICB0aGlzLnNvdXJjZVBhdGgobm9kZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQ6IHsgbGluZSwgY29sdW1uOiBjb2x1bW4gLSAxIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lOiAgIG5vZGUuc291cmNlLnN0YXJ0LmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBub2RlLnNvdXJjZS5zdGFydC5jb2x1bW4gLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAgICAnPG5vIHNvdXJjZT4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6ICB7IGxpbmU6IDEsIGNvbHVtbjogMCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkOiB7IGxpbmUsIGNvbHVtbjogY29sdW1uIC0gMSB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGluZXMgPSBzdHIubWF0Y2goL1xcbi9nKTtcbiAgICAgICAgICAgIGlmICggbGluZXMgKSB7XG4gICAgICAgICAgICAgICAgbGluZSAgKz0gbGluZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGxhc3QgICA9IHN0ci5sYXN0SW5kZXhPZignXFxuJyk7XG4gICAgICAgICAgICAgICAgY29sdW1uID0gc3RyLmxlbmd0aCAtIGxhc3Q7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbHVtbiArPSBzdHIubGVuZ3RoO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIG5vZGUgJiYgdHlwZSAhPT0gJ3N0YXJ0JyApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG5vZGUuc291cmNlICYmIG5vZGUuc291cmNlLmVuZCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgIHRoaXMuc291cmNlUGF0aChub2RlKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRlZDogeyBsaW5lLCBjb2x1bW46IGNvbHVtbiAtIDEgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsOiAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6ICAgbm9kZS5zb3VyY2UuZW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBub2RlLnNvdXJjZS5lbmQuY29sdW1uXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAgICAnPG5vIHNvdXJjZT4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6ICB7IGxpbmU6IDEsIGNvbHVtbjogMCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkOiB7IGxpbmUsIGNvbHVtbjogY29sdW1uIC0gMSB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZ2VuZXJhdGUoKSB7XG4gICAgICAgIHRoaXMuY2xlYXJBbm5vdGF0aW9uKCk7XG5cbiAgICAgICAgaWYgKCB0aGlzLmlzTWFwKCkgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5nZW5lcmF0ZU1hcCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IHJlc3VsdCA9ICcnO1xuICAgICAgICAgICAgdGhpcy5zdHJpbmdpZnkodGhpcy5yb290LCBpID0+IHtcbiAgICAgICAgICAgICAgICByZXN1bHQgKz0gaTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIFtyZXN1bHRdO1xuICAgICAgICB9XG4gICAgfVxuXG59XG4iXX0=
  30981. /***/ }),
  30982. /* 195 */
  30983. /***/ (function(module, exports, __webpack_require__) {
  30984. "use strict";
  30985. exports.__esModule = true;
  30986. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  30987. var _jsBase = __webpack_require__(49);
  30988. var _sourceMap = __webpack_require__(102);
  30989. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  30990. var _path = __webpack_require__(8);
  30991. var _path2 = _interopRequireDefault(_path);
  30992. var _fs = __webpack_require__(219);
  30993. var _fs2 = _interopRequireDefault(_fs);
  30994. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30995. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30996. /**
  30997. * Source map information from input CSS.
  30998. * For example, source map after Sass compiler.
  30999. *
  31000. * This class will automatically find source map in input CSS or in file system
  31001. * near input file (according `from` option).
  31002. *
  31003. * @example
  31004. * const root = postcss.parse(css, { from: 'a.sass.css' });
  31005. * root.input.map //=> PreviousMap
  31006. */
  31007. var PreviousMap = function () {
  31008. /**
  31009. * @param {string} css - input CSS source
  31010. * @param {processOptions} [opts] - {@link Processor#process} options
  31011. */
  31012. function PreviousMap(css, opts) {
  31013. _classCallCheck(this, PreviousMap);
  31014. this.loadAnnotation(css);
  31015. /**
  31016. * @member {boolean} - Was source map inlined by data-uri to input CSS.
  31017. */
  31018. this.inline = this.startWith(this.annotation, 'data:');
  31019. var prev = opts.map ? opts.map.prev : undefined;
  31020. var text = this.loadMap(opts.from, prev);
  31021. if (text) this.text = text;
  31022. }
  31023. /**
  31024. * Create a instance of `SourceMapGenerator` class
  31025. * from the `source-map` library to work with source map information.
  31026. *
  31027. * It is lazy method, so it will create object only on first call
  31028. * and then it will use cache.
  31029. *
  31030. * @return {SourceMapGenerator} object with source map information
  31031. */
  31032. PreviousMap.prototype.consumer = function consumer() {
  31033. if (!this.consumerCache) {
  31034. this.consumerCache = new _sourceMap2.default.SourceMapConsumer(this.text);
  31035. }
  31036. return this.consumerCache;
  31037. };
  31038. /**
  31039. * Does source map contains `sourcesContent` with input source text.
  31040. *
  31041. * @return {boolean} Is `sourcesContent` present
  31042. */
  31043. PreviousMap.prototype.withContent = function withContent() {
  31044. return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
  31045. };
  31046. PreviousMap.prototype.startWith = function startWith(string, start) {
  31047. if (!string) return false;
  31048. return string.substr(0, start.length) === start;
  31049. };
  31050. PreviousMap.prototype.loadAnnotation = function loadAnnotation(css) {
  31051. var match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);
  31052. if (match) this.annotation = match[1].trim();
  31053. };
  31054. PreviousMap.prototype.decodeInline = function decodeInline(text) {
  31055. var utfd64 = 'data:application/json;charset=utf-8;base64,';
  31056. var utf64 = 'data:application/json;charset=utf8;base64,';
  31057. var b64 = 'data:application/json;base64,';
  31058. var uri = 'data:application/json,';
  31059. if (this.startWith(text, uri)) {
  31060. return decodeURIComponent(text.substr(uri.length));
  31061. } else if (this.startWith(text, b64)) {
  31062. return _jsBase.Base64.decode(text.substr(b64.length));
  31063. } else if (this.startWith(text, utf64)) {
  31064. return _jsBase.Base64.decode(text.substr(utf64.length));
  31065. } else if (this.startWith(text, utfd64)) {
  31066. return _jsBase.Base64.decode(text.substr(utfd64.length));
  31067. } else {
  31068. var encoding = text.match(/data:application\/json;([^,]+),/)[1];
  31069. throw new Error('Unsupported source map encoding ' + encoding);
  31070. }
  31071. };
  31072. PreviousMap.prototype.loadMap = function loadMap(file, prev) {
  31073. if (prev === false) return false;
  31074. if (prev) {
  31075. if (typeof prev === 'string') {
  31076. return prev;
  31077. } else if (typeof prev === 'function') {
  31078. var prevPath = prev(file);
  31079. if (prevPath && _fs2.default.existsSync && _fs2.default.existsSync(prevPath)) {
  31080. return _fs2.default.readFileSync(prevPath, 'utf-8').toString().trim();
  31081. } else {
  31082. throw new Error('Unable to load previous source map: ' + prevPath.toString());
  31083. }
  31084. } else if (prev instanceof _sourceMap2.default.SourceMapConsumer) {
  31085. return _sourceMap2.default.SourceMapGenerator.fromSourceMap(prev).toString();
  31086. } else if (prev instanceof _sourceMap2.default.SourceMapGenerator) {
  31087. return prev.toString();
  31088. } else if (this.isMap(prev)) {
  31089. return JSON.stringify(prev);
  31090. } else {
  31091. throw new Error('Unsupported previous source map format: ' + prev.toString());
  31092. }
  31093. } else if (this.inline) {
  31094. return this.decodeInline(this.annotation);
  31095. } else if (this.annotation) {
  31096. var map = this.annotation;
  31097. if (file) map = _path2.default.join(_path2.default.dirname(file), map);
  31098. this.root = _path2.default.dirname(map);
  31099. if (_fs2.default.existsSync && _fs2.default.existsSync(map)) {
  31100. return _fs2.default.readFileSync(map, 'utf-8').toString().trim();
  31101. } else {
  31102. return false;
  31103. }
  31104. }
  31105. };
  31106. PreviousMap.prototype.isMap = function isMap(map) {
  31107. if ((typeof map === 'undefined' ? 'undefined' : _typeof(map)) !== 'object') return false;
  31108. return typeof map.mappings === 'string' || typeof map._mappings === 'string';
  31109. };
  31110. return PreviousMap;
  31111. }();
  31112. exports.default = PreviousMap;
  31113. module.exports = exports['default'];
  31114. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByZXZpb3VzLW1hcC5lczYiXSwibmFtZXMiOlsiUHJldmlvdXNNYXAiLCJjc3MiLCJvcHRzIiwibG9hZEFubm90YXRpb24iLCJpbmxpbmUiLCJzdGFydFdpdGgiLCJhbm5vdGF0aW9uIiwicHJldiIsIm1hcCIsInVuZGVmaW5lZCI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eW5jKHByZXZQYXRoLCAndXRmLTgnKS50b1N0cmluZygpLnRyaW0oKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuYWJsZSB0byBsb2FkIHByZXZpb3VzIHNvdXJjZSBtYXA6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2UGF0aC50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwcmV2IGluc3RhbmNlb2YgbW96aWxsYS5Tb3VyY2VNYXBDb25zdW1lciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW96aWxsYS5Tb3VyY2VNYXBHZW5lcmF0b3JcbiAgICAgICAgICAgICAgICAgICAgLmZyb21Tb3VyY2VNYXAocHJldikudG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHByZXYgaW5zdGFuY2VvZiBtb3ppbGxhLlNvdXJjZU1hcEdlbmVyYXRvciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldi50b1N0cmluZygpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdGhpcy5pc01hcChwcmV2KSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocHJldik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5zdXBwb3J0ZWQgcHJldmlvdXMgc291cmNlIG1hcCBmb3JtYXQ6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2LnRvU3RyaW5nKCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMuaW5saW5lICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVjb2RlSW5saW5lKHRoaXMuYW5ub3RhdGlvbik7XG5cbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5hbm5vdGF0aW9uICkge1xuICAgICAgICAgICAgbGV0IG1hcCA9IHRoaXMuYW5ub3RhdGlvbjtcbiAgICAgICAgICAgIGlmICggZmlsZSApIG1hcCA9IHBhdGguam9pbihwYXRoLmRpcm5hbWUoZmlsZSksIG1hcCk7XG5cbiAgICAgICAgICAgIHRoaXMucm9vdCA9IHBhdGguZGlybmFtZShtYXApO1xuICAgICAgICAgICAgaWYgKCBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMobWFwKSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKG1hcCwgJ3V0Zi04JykudG9TdHJpbmcoKS50cmltKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzTWFwKG1hcCkge1xuICAgICAgICBpZiAoIHR5cGVvZiBtYXAgIT09ICdvYmplY3QnICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICByZXR1cm4gdHlwZW9mIG1hcC5tYXBwaW5ncyA9PT0gJ3N0cmluZycgfHxcbiAgICAgICAgICAgICAgIHR5cGVvZiBtYXAuX21hcHBpbmdzID09PSAnc3RyaW5nJztcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFByZXZpb3VzTWFwO1xuIl19
  31115. /***/ }),
  31116. /* 196 */
  31117. /***/ (function(module, exports, __webpack_require__) {
  31118. "use strict";
  31119. exports.__esModule = true;
  31120. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  31121. var _lazyResult = __webpack_require__(93);
  31122. var _lazyResult2 = _interopRequireDefault(_lazyResult);
  31123. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31124. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31125. /**
  31126. * Contains plugins to process CSS. Create one `Processor` instance,
  31127. * initialize its plugins, and then use that instance on numerous CSS files.
  31128. *
  31129. * @example
  31130. * const processor = postcss([autoprefixer, precss]);
  31131. * processor.process(css1).then(result => console.log(result.css));
  31132. * processor.process(css2).then(result => console.log(result.css));
  31133. */
  31134. var Processor = function () {
  31135. /**
  31136. * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
  31137. * plugins. See {@link Processor#use} for plugin format.
  31138. */
  31139. function Processor() {
  31140. var plugins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  31141. _classCallCheck(this, Processor);
  31142. /**
  31143. * @member {string} - Current PostCSS version.
  31144. *
  31145. * @example
  31146. * if ( result.processor.version.split('.')[0] !== '5' ) {
  31147. * throw new Error('This plugin works only with PostCSS 5');
  31148. * }
  31149. */
  31150. this.version = '5.2.17';
  31151. /**
  31152. * @member {pluginFunction[]} - Plugins added to this processor.
  31153. *
  31154. * @example
  31155. * const processor = postcss([autoprefixer, precss]);
  31156. * processor.plugins.length //=> 2
  31157. */
  31158. this.plugins = this.normalize(plugins);
  31159. }
  31160. /**
  31161. * Adds a plugin to be used as a CSS processor.
  31162. *
  31163. * PostCSS plugin can be in 4 formats:
  31164. * * A plugin created by {@link postcss.plugin} method.
  31165. * * A function. PostCSS will pass the function a @{link Root}
  31166. * as the first argument and current {@link Result} instance
  31167. * as the second.
  31168. * * An object with a `postcss` method. PostCSS will use that method
  31169. * as described in #2.
  31170. * * Another {@link Processor} instance. PostCSS will copy plugins
  31171. * from that instance into this one.
  31172. *
  31173. * Plugins can also be added by passing them as arguments when creating
  31174. * a `postcss` instance (see [`postcss(plugins)`]).
  31175. *
  31176. * Asynchronous plugins should return a `Promise` instance.
  31177. *
  31178. * @param {Plugin|pluginFunction|Processor} plugin - PostCSS plugin
  31179. * or {@link Processor}
  31180. * with plugins
  31181. *
  31182. * @example
  31183. * const processor = postcss()
  31184. * .use(autoprefixer)
  31185. * .use(precss);
  31186. *
  31187. * @return {Processes} current processor to make methods chain
  31188. */
  31189. Processor.prototype.use = function use(plugin) {
  31190. this.plugins = this.plugins.concat(this.normalize([plugin]));
  31191. return this;
  31192. };
  31193. /**
  31194. * Parses source CSS and returns a {@link LazyResult} Promise proxy.
  31195. * Because some plugins can be asynchronous it doesn’t make
  31196. * any transformations. Transformations will be applied
  31197. * in the {@link LazyResult} methods.
  31198. *
  31199. * @param {string|toString|Result} css - String with input CSS or
  31200. * any object with a `toString()`
  31201. * method, like a Buffer.
  31202. * Optionally, send a {@link Result}
  31203. * instance and the processor will
  31204. * take the {@link Root} from it.
  31205. * @param {processOptions} [opts] - options
  31206. *
  31207. * @return {LazyResult} Promise proxy
  31208. *
  31209. * @example
  31210. * processor.process(css, { from: 'a.css', to: 'a.out.css' })
  31211. * .then(result => {
  31212. * console.log(result.css);
  31213. * });
  31214. */
  31215. Processor.prototype.process = function process(css) {
  31216. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  31217. return new _lazyResult2.default(this, css, opts);
  31218. };
  31219. Processor.prototype.normalize = function normalize(plugins) {
  31220. var normalized = [];
  31221. for (var _iterator = plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  31222. var _ref;
  31223. if (_isArray) {
  31224. if (_i >= _iterator.length) break;
  31225. _ref = _iterator[_i++];
  31226. } else {
  31227. _i = _iterator.next();
  31228. if (_i.done) break;
  31229. _ref = _i.value;
  31230. }
  31231. var i = _ref;
  31232. if (i.postcss) i = i.postcss;
  31233. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && Array.isArray(i.plugins)) {
  31234. normalized = normalized.concat(i.plugins);
  31235. } else if (typeof i === 'function') {
  31236. normalized.push(i);
  31237. } else if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && (i.parse || i.stringify)) {
  31238. throw new Error('PostCSS syntaxes cannot be used as plugins. ' + 'Instead, please use one of the ' + 'syntax/parser/stringifier options as ' + 'outlined in your PostCSS ' + 'runner documentation.');
  31239. } else {
  31240. throw new Error(i + ' is not a PostCSS plugin');
  31241. }
  31242. }
  31243. return normalized;
  31244. };
  31245. return Processor;
  31246. }();
  31247. exports.default = Processor;
  31248. /**
  31249. * @callback builder
  31250. * @param {string} part - part of generated CSS connected to this node
  31251. * @param {Node} node - AST node
  31252. * @param {"start"|"end"} [type] - node’s part type
  31253. */
  31254. /**
  31255. * @callback parser
  31256. *
  31257. * @param {string|toString} css - string with input CSS or any object
  31258. * with toString() method, like a Buffer
  31259. * @param {processOptions} [opts] - options with only `from` and `map` keys
  31260. *
  31261. * @return {Root} PostCSS AST
  31262. */
  31263. /**
  31264. * @callback stringifier
  31265. *
  31266. * @param {Node} node - start node for stringifing. Usually {@link Root}.
  31267. * @param {builder} builder - function to concatenate CSS from node’s parts
  31268. * or generate string and source map
  31269. *
  31270. * @return {void}
  31271. */
  31272. /**
  31273. * @typedef {object} syntax
  31274. * @property {parser} parse - function to generate AST by string
  31275. * @property {stringifier} stringify - function to generate string by AST
  31276. */
  31277. /**
  31278. * @typedef {object} toString
  31279. * @property {function} toString
  31280. */
  31281. /**
  31282. * @callback pluginFunction
  31283. * @param {Root} root - parsed input CSS
  31284. * @param {Result} result - result to set warnings or check other plugins
  31285. */
  31286. /**
  31287. * @typedef {object} Plugin
  31288. * @property {function} postcss - PostCSS plugin function
  31289. */
  31290. /**
  31291. * @typedef {object} processOptions
  31292. * @property {string} from - the path of the CSS source file.
  31293. * You should always set `from`,
  31294. * because it is used in source map
  31295. * generation and syntax error messages.
  31296. * @property {string} to - the path where you’ll put the output
  31297. * CSS file. You should always set `to`
  31298. * to generate correct source maps.
  31299. * @property {parser} parser - function to generate AST by string
  31300. * @property {stringifier} stringifier - class to generate string by AST
  31301. * @property {syntax} syntax - object with `parse` and `stringify`
  31302. * @property {object} map - source map options
  31303. * @property {boolean} map.inline - does source map should
  31304. * be embedded in the output
  31305. * CSS as a base64-encoded
  31306. * comment
  31307. * @property {string|object|false|function} map.prev - source map content
  31308. * from a previous
  31309. * processing step
  31310. * (for example, Sass).
  31311. * PostCSS will try to find
  31312. * previous map
  31313. * automatically, so you
  31314. * could disable it by
  31315. * `false` value.
  31316. * @property {boolean} map.sourcesContent - does PostCSS should set
  31317. * the origin content to map
  31318. * @property {string|false} map.annotation - does PostCSS should set
  31319. * annotation comment to map
  31320. * @property {string} map.from - override `from` in map’s
  31321. * `sources`
  31322. */
  31323. module.exports = exports['default'];
  31324. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2Nlc3Nvci5lczYiXSwibmFtZXMiOlsiUHJvY2Vzc29yIiwicGx1Z2lucyIsInZlcnNpb24iLCJub3JtYWxpemUiLCJ1c2UiLCJwbHVnaW4iLCJjb25jYXQiLCJwcm9jZXNzIiwiY3NzIiwib3B0cyIsIm5vcm1hbGl6ZWQiLCJpIiwicG9zdGNzcyIsIkFycmF5IiwiaXNBcnJheSIsInB1c2giLCJwYXJzZSIsInN0cmluZ2lmeSIsIkVycm9yIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7O0lBU01BLFM7O0FBRUY7Ozs7QUFJQSx1QkFBMEI7QUFBQSxRQUFkQyxPQUFjLHVFQUFKLEVBQUk7O0FBQUE7O0FBQ3RCOzs7Ozs7OztBQVFBLFNBQUtDLE9BQUwsR0FBZSxRQUFmO0FBQ0E7Ozs7Ozs7QUFPQSxTQUFLRCxPQUFMLEdBQWUsS0FBS0UsU0FBTCxDQUFlRixPQUFmLENBQWY7QUFDSDs7QUFFRDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztzQkE2QkFHLEcsZ0JBQUlDLE0sRUFBUTtBQUNSLFNBQUtKLE9BQUwsR0FB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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIHBsdWdpbnNcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3QgcHJvY2Vzc29yID0gcG9zdGNzcygpXG4gICAgICogICAudXNlKGF1dG9wcmVmaXhlcilcbiAgICAgKiAgIC51c2UocHJlY3NzKTtcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1Byb2Nlc3Nlc30gY3VycmVudCBwcm9jZXNzb3IgdG8gbWFrZSBtZXRob2RzIGNoYWluXG4gICAgICovXG4gICAgdXNlKHBsdWdpbikge1xuICAgICAgICB0aGlzLnBsdWdpbnMgPSB0aGlzLnBsdWdpbnMuY29uY2F0KHRoaXMubm9ybWFsaXplKFtwbHVnaW5dKSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFBhcnNlcyBzb3VyY2UgQ1NTIGFuZCByZXR1cm5zIGEge0BsaW5rIExhenlSZXN1bHR9IFByb21pc2UgcHJveHkuXG4gICAgICogQmVjYXVzZSBzb21lIHBsdWdpbnMgY2FuIGJlIGFzeW5jaHJvbm91cyBpdCBkb2VzbuKAmXQgbWFrZVxuICAgICAqIGFueSB0cmFuc2Zvcm1hdGlvbnMuIFRyYW5zZm9ybWF0aW9ucyB3aWxsIGJlIGFwcGxpZWRcbiAgICAgKiBpbiB0aGUge0BsaW5rIExhenlSZXN1bHR9IG1ldGhvZHMuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge3N0cmluZ3x0b1N0cmluZ3xSZXN1bHR9IGNzcyAtIFN0cmluZyB3aXRoIGlucHV0IENTUyBvclxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW55IG9iamVjdCB3aXRoIGEgYHRvU3RyaW5nKClgXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2QsIGxpa2UgYSBCdWZmZXIuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcHRpb25hbGx5LCBzZW5kIGEge0BsaW5rIFJlc3VsdH1cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluc3RhbmNlIGFuZCB0aGUgcHJvY2Vzc29yIHdpbGxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRha2UgdGhlIHtAbGluayBSb290fSBmcm9tIGl0LlxuICAgICAqIEBwYXJhbSB7cHJvY2Vzc09wdGlvbnN9IFtvcHRzXSAgICAgIC0gb3B0aW9uc1xuICAgICAqXG4gICAgICogQHJldHVybiB7TGF6eVJlc3VsdH0gUHJvbWlzZSBwcm94eVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBwcm9jZXNzb3IucHJvY2Vzcyhjc3MsIHsgZnJvbTogJ2EuY3NzJywgdG86ICdhLm91dC5jc3MnIH0pXG4gICAgICogICAudGhlbihyZXN1bHQgPT4ge1xuICAgICAqICAgICAgY29uc29sZS5sb2cocmVzdWx0LmNzcyk7XG4gICAgICogICB9KTtcbiAgICAgKi9cbiAgICBwcm9jZXNzKGNzcywgb3B0cyA9IHsgfSkge1xuICAgICAgICByZXR1cm4gbmV3IExhenlSZXN1bHQodGhpcywgY3NzLCBvcHRzKTtcbiAgICB9XG5cbiAgICBub3JtYWxpemUocGx1Z2lucykge1xuICAgICAgICBsZXQgbm9ybWFsaXplZCA9IFtdO1xuICAgICAgICBmb3IgKCBsZXQgaSBvZiBwbHVnaW5zICkge1xuICAgICAgICAgICAgaWYgKCBpLnBvc3Rjc3MgKSBpID0gaS5wb3N0Y3NzO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpID09PSAnb2JqZWN0JyAmJiBBcnJheS5pc0FycmF5KGkucGx1Z2lucykgKSB7XG4gICAgICAgICAgICAgICAgbm9ybWFsaXplZCA9IG5vcm1hbGl6ZWQuY29uY2F0KGkucGx1Z2lucyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgaSA9PT0gJ2Z1bmN0aW9uJyApIHtcbiAgICAgICAgICAgICAgICBub3JtYWxpemVkLnB1c2goaSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgaSA9PT0gJ29iamVjdCcgJiYgKGkucGFyc2UgfHwgaS5zdHJpbmdpZnkpICkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUG9zdENTUyBzeW50YXhlcyBjYW5ub3QgYmUgdXNlZCBhcyBwbHVnaW5zLiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0luc3RlYWQsIHBsZWFzZSB1c2Ugb25lIG9mIHRoZSAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bnRheC9wYXJzZXIvc3RyaW5naWZpZXIgb3B0aW9ucyBhcyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ291dGxpbmVkIGluIHlvdXIgUG9zdENTUyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3J1bm5lciBkb2N1bWVudGF0aW9uLicpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoaSArICcgaXMgbm90IGEgUG9zdENTUyBwbHVnaW4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbm9ybWFsaXplZDtcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUHJvY2Vzc29yO1xuXG4vKipcbiAqIEBjYWxsYmFjayBidWlsZGVyXG4gKiBAcGFyYW0ge3N0cmluZ30gcGFydCAgICAgICAgICAtIHBhcnQgb2YgZ2VuZXJhdGVkIENTUyBjb25uZWN0ZWQgdG8gdGhpcyBub2RlXG4gKiBAcGFyYW0ge05vZGV9ICAgbm9kZSAgICAgICAgICAtIEFT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WxlLiBZb3Ugc2hvdWxkIGFsd2F5cyBzZXQgYHRvYFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBnZW5lcmF0ZSBjb3JyZWN0IHNvdXJjZSBtYXBzLlxuICogQHByb3BlcnR5IHtwYXJzZXJ9IHBhcnNlciAgICAgICAgICAgLSBmdW5jdGlvbiB0byBnZW5lcmF0ZSBBU1QgYnkgc3RyaW5nXG4gKiBAcHJvcGVydHkge3N0cmluZ2lmaWVyfSBzdHJpbmdpZmllciAtIGNsYXNzIHRvIGdlbmVyYXRlIHN0cmluZyBieSBBU1RcbiAqIEBwcm9wZXJ0eSB7c3ludGF4fSBzeW50YXggICAgICAgICAgIC0gb2JqZWN0IHdpdGggYHBhcnNlYCBhbmQgYHN0cmluZ2lmeWBcbiAqIEBwcm9wZXJ0eSB7b2JqZWN0fSBtYXAgICAgICAgICAgICAgIC0gc291cmNlIG1hcCBvcHRpb25zXG4gKiBAcHJvcGVydHkge2Jvb2xlYW59IG1hcC5pbmxpbmUgICAgICAgICAgICAgICAgICAgIC0gZG9lcyBzb3VyY2UgbWFwIHNob3VsZFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIGVtYmVkZGVkIGluIHRoZSBvdXRwdXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1MgYXMgYSBiYXNlNjQtZW5jb2RlZFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1lbnRcbiAqIEBwcm9wZXJ0eSB7c3RyaW5nfG9iamVjdHxmYWxzZXxmdW5jdGlvbn0gbWFwLnByZXYgLSBzb3VyY2UgbWFwIGNvbnRlbnRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tIGEgcHJldmlvdXNcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzaW5nIHN0ZXBcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yIGV4YW1wbGUsIFNhc3MpLlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBvc3RDU1Mgd2lsbCB0cnkgdG8gZmluZFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzIG1hcFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9tYXRpY2FsbHksIHNvIHlvdVxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdWxkIGRpc2FibGUgaXQgYnlcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgZmFsc2VgIHZhbHVlLlxuICogQHByb3BlcnR5IHtib29sZWFufSBtYXAuc291cmNlc0NvbnRlbnQgICAgICAgICAgICAtIGRvZXMgUG9zdENTUyBzaG91bGQgc2V0XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIG9yaWdpbiBjb250ZW50IHRvIG1hcFxuICogQHByb3BlcnR5IHtzdHJpbmd8ZmFsc2V9IG1hcC5hbm5vdGF0aW9uICAgICAgICAgICAtIGRvZXMgUG9zdENTUyBzaG91bGQgc2V0XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ub3RhdGlvbiBjb21tZW50IHRvIG1hcFxuICogQHByb3BlcnR5IHtzdHJpbmd9IG1hcC5mcm9tICAgICAgICAgICAgICAgICAgICAgICAtIG92ZXJyaWRlIGBmcm9tYCBpbiBtYXDigJlzXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYHNvdXJjZXNgXG4gKi9cbiJdfQ==
  31325. /***/ }),
  31326. /* 197 */
  31327. /***/ (function(module, exports, __webpack_require__) {
  31328. "use strict";
  31329. exports.__esModule = true;
  31330. var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  31331. var _warning = __webpack_require__(199);
  31332. var _warning2 = _interopRequireDefault(_warning);
  31333. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31334. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31335. /**
  31336. * Provides the result of the PostCSS transformations.
  31337. *
  31338. * A Result instance is returned by {@link LazyResult#then}
  31339. * or {@link Root#toResult} methods.
  31340. *
  31341. * @example
  31342. * postcss([cssnext]).process(css).then(function (result) {
  31343. * console.log(result.css);
  31344. * });
  31345. *
  31346. * @example
  31347. * var result2 = postcss.parse(css).toResult();
  31348. */
  31349. var Result = function () {
  31350. /**
  31351. * @param {Processor} processor - processor used for this transformation.
  31352. * @param {Root} root - Root node after all transformations.
  31353. * @param {processOptions} opts - options from the {@link Processor#process}
  31354. * or {@link Root#toResult}
  31355. */
  31356. function Result(processor, root, opts) {
  31357. _classCallCheck(this, Result);
  31358. /**
  31359. * @member {Processor} - The Processor instance used
  31360. * for this transformation.
  31361. *
  31362. * @example
  31363. * for ( let plugin of result.processor.plugins) {
  31364. * if ( plugin.postcssPlugin === 'postcss-bad' ) {
  31365. * throw 'postcss-good is incompatible with postcss-bad';
  31366. * }
  31367. * });
  31368. */
  31369. this.processor = processor;
  31370. /**
  31371. * @member {Message[]} - Contains messages from plugins
  31372. * (e.g., warnings or custom messages).
  31373. * Each message should have type
  31374. * and plugin properties.
  31375. *
  31376. * @example
  31377. * postcss.plugin('postcss-min-browser', () => {
  31378. * return (root, result) => {
  31379. * var browsers = detectMinBrowsersByCanIUse(root);
  31380. * result.messages.push({
  31381. * type: 'min-browser',
  31382. * plugin: 'postcss-min-browser',
  31383. * browsers: browsers
  31384. * });
  31385. * };
  31386. * });
  31387. */
  31388. this.messages = [];
  31389. /**
  31390. * @member {Root} - Root node after all transformations.
  31391. *
  31392. * @example
  31393. * root.toResult().root == root;
  31394. */
  31395. this.root = root;
  31396. /**
  31397. * @member {processOptions} - Options from the {@link Processor#process}
  31398. * or {@link Root#toResult} call
  31399. * that produced this Result instance.
  31400. *
  31401. * @example
  31402. * root.toResult(opts).opts == opts;
  31403. */
  31404. this.opts = opts;
  31405. /**
  31406. * @member {string} - A CSS string representing of {@link Result#root}.
  31407. *
  31408. * @example
  31409. * postcss.parse('a{}').toResult().css //=> "a{}"
  31410. */
  31411. this.css = undefined;
  31412. /**
  31413. * @member {SourceMapGenerator} - An instance of `SourceMapGenerator`
  31414. * class from the `source-map` library,
  31415. * representing changes
  31416. * to the {@link Result#root} instance.
  31417. *
  31418. * @example
  31419. * result.map.toJSON() //=> { version: 3, file: 'a.css', … }
  31420. *
  31421. * @example
  31422. * if ( result.map ) {
  31423. * fs.writeFileSync(result.opts.to + '.map', result.map.toString());
  31424. * }
  31425. */
  31426. this.map = undefined;
  31427. }
  31428. /**
  31429. * Returns for @{link Result#css} content.
  31430. *
  31431. * @example
  31432. * result + '' === result.css
  31433. *
  31434. * @return {string} string representing of {@link Result#root}
  31435. */
  31436. Result.prototype.toString = function toString() {
  31437. return this.css;
  31438. };
  31439. /**
  31440. * Creates an instance of {@link Warning} and adds it
  31441. * to {@link Result#messages}.
  31442. *
  31443. * @param {string} text - warning message
  31444. * @param {Object} [opts] - warning options
  31445. * @param {Node} opts.node - CSS node that caused the warning
  31446. * @param {string} opts.word - word in CSS source that caused the warning
  31447. * @param {number} opts.index - index in CSS node string that caused
  31448. * the warning
  31449. * @param {string} opts.plugin - name of the plugin that created
  31450. * this warning. {@link Result#warn} fills
  31451. * this property automatically.
  31452. *
  31453. * @return {Warning} created warning
  31454. */
  31455. Result.prototype.warn = function warn(text) {
  31456. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  31457. if (!opts.plugin) {
  31458. if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
  31459. opts.plugin = this.lastPlugin.postcssPlugin;
  31460. }
  31461. }
  31462. var warning = new _warning2.default(text, opts);
  31463. this.messages.push(warning);
  31464. return warning;
  31465. };
  31466. /**
  31467. * Returns warnings from plugins. Filters {@link Warning} instances
  31468. * from {@link Result#messages}.
  31469. *
  31470. * @example
  31471. * result.warnings().forEach(warn => {
  31472. * console.warn(warn.toString());
  31473. * });
  31474. *
  31475. * @return {Warning[]} warnings from plugins
  31476. */
  31477. Result.prototype.warnings = function warnings() {
  31478. return this.messages.filter(function (i) {
  31479. return i.type === 'warning';
  31480. });
  31481. };
  31482. /**
  31483. * An alias for the {@link Result#css} property.
  31484. * Use it with syntaxes that generate non-CSS output.
  31485. * @type {string}
  31486. *
  31487. * @example
  31488. * result.css === result.content;
  31489. */
  31490. _createClass(Result, [{
  31491. key: 'content',
  31492. get: function get() {
  31493. return this.css;
  31494. }
  31495. }]);
  31496. return Result;
  31497. }();
  31498. exports.default = Result;
  31499. /**
  31500. * @typedef {object} Message
  31501. * @property {string} type - message type
  31502. * @property {string} plugin - source PostCSS plugin name
  31503. */
  31504. module.exports = exports['default'];
  31505. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlc3VsdC5lczYiXSwibmFtZXMiOlsiUmVzdWx0IiwicHJvY2Vzc29yIiwicm9vdCIsIm9wdHMiLCJtZXNzYWdlcyIsImNzcyIsInVuZGVma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0gLSBDb250YWlucyBtZXNzYWdlcyBmcm9tIHBsdWdpbnNcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIChlLmcuLCB3YXJuaW5ncyBvciBjdXN0b20gbWVzc2FnZXMpLlxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgRWFjaCBtZXNzYWdlIHNob3VsZCBoYXZlIHR5cGVcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIGFuZCBwbHVnaW4gcHJvcGVydGllcy5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcG9zdGNzcy5wbHVnaW4oJ3Bvc3Rjc3MtbWluLWJyb3dzZXInLCAoKSA9PiB7XG4gICAgICAgICAqICAgcmV0dXJuIChyb290LCByZXN1bHQpID0+IHtcbiAgICAgICAgICogICAgIHZhciBicm93c2VycyA9IGRldGVjdE1pbkJyb3dzZXJzQnlDYW5JVXNlKHJvb3QpO1xuICAgICAgICAgKiAgICAgcmVzdWx0Lm1lc3NhZ2VzLnB1c2goe1xuICAgICAgICAgKiAgICAgICB0eXBlOiAgICAnbWluLWJyb3dzZXInLFxuICAgICAgICAgKiAgICAgICBwbHVnaW46ICAncG9zdGNzcy1taW4tYnJvd3NlcicsXG4gICAgICAgICAqICAgICAgIGJyb3dzZXJzOiBicm93c2Vyc1xuICAgICAgICAgKiAgICAgfSk7XG4gICAgICAgICAqICAgfTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLm1lc3NhZ2VzID0gW107XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtSb290fSAtIFJvb3Qgbm9kZSBhZnRlciBhbGwgdHJhbnNmb3JtYXRpb25zLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KCkucm9vdCA9PSByb290O1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yb290ID0gcm9vdDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3Byb2Nlc3NPcHRpb25zfSAtIE9wdGlvbnMgZnJvbSB0aGUge0BsaW5rIFByb2Nlc3NvciNwcm9jZXNzfVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvciB7QGxpbmsgUm9vdCN0b1Jlc3VsdH0gY2FsbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0IHByb2R1Y2VkIHRoaXMgUmVzdWx0IGluc3RhbmNlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KG9wdHMpLm9wdHMgPT0gb3B0cztcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMub3B0cyA9IG9wdHM7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyBvZiB7QGxpbmsgUmVzdWx0I3Jvb3R9LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiBwb3N0Y3NzLnBhcnNlKCdhe30nKS50b1Jlc3VsdCgpLmNzcyAvLz0+IFwiYXt9XCJcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuY3NzID0gdW5kZWZpbmVkO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7U291cmNlTWFwR2VuZXJhdG9yfSAtIEFuIGluc3RhbmNlIG9mIGBTb3VyY2VNYXBHZW5lcmF0b3JgXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyBmcm9tIHRoZSBgc291cmNlLW1hcGAgbGlicmFyeSxcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcHJlc2VudGluZyBjaGFuZ2VzXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUge0BsaW5rIFJlc3VsdCNyb290fSBpbnN0YW5jZS5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcmVzdWx0Lm1hcC50b0pTT04oKSAvLz0+IHsgdmVyc2lvbjogMywgZmlsZTogJ2EuY3NzJywg4oCmIH1cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogaWYgKCByZXN1bHQubWFwICkge1xuICAgICAgICAgKiAgIGZzLndyaXRlRmlsZVN5bmMocmVzdWx0Lm9wdHMudG8gKyAnLm1hcCcsIHJlc3VsdC5tYXAudG9TdHJpbmcoKSk7XG4gICAgICAgICAqIH1cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubWFwID0gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgZm9yIEB7bGluayBSZXN1bHQjY3NzfSBjb250ZW50LlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiByZXN1bHQgKyAnJyA9PT0gcmVzdWx0LmNzc1xuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBzdHJpbmcgcmVwcmVzZW50aW5nIG9mIHtAbGluayBSZXN1bHQjcm9vdH1cbiAgICAgKi9cbiAgICB0b1N0cmluZygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY3NzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYW4gaW5zdGFuY2Ugb2Yge0BsaW5rIFdhcm5pbmd9IGFuZCBhZGRzIGl0XG4gICAgICogdG8ge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gdGV4dCAgICAgICAgLSB3YXJuaW5nIG1lc3NhZ2VcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gW29wdHNdICAgICAgLSB3YXJuaW5nIG9wdGlvbnNcbiAgICAgKiBAcGFyYW0ge05vZGV9ICAgb3B0cy5ub2RlICAgLSBDU1Mgbm9kZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZ1xuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBvcHRzLndvcmQgICAtIHdvcmQgaW4gQ1NTIHNvdXJjZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZ1xuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBvcHRzLmluZGV4ICAtIGluZGV4IGluIENTUyBub2RlIHN0cmluZyB0aGF0IGNhdXNlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB3YXJuaW5nXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMucGx1Z2luIC0gbmFtZSBvZiB0aGUgcGx1Z2luIHRoYXQgY3JlYXRlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgd2FybmluZy4ge0BsaW5rIFJlc3VsdCN3YXJufSBmaWxsc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgcHJvcGVydHkgYXV0b21hdGljYWxseS5cbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1dhcm5pbmd9IGNyZWF0ZWQgd2FybmluZ1xuICAgICAqL1xuICAgIHdhcm4odGV4dCwgb3B0cyA9IHsgfSkge1xuICAgICAgICBpZiAoICFvcHRzLnBsdWdpbiApIHtcbiAgICAgICAgICAgIGlmICggdGhpcy5sYXN0UGx1Z2luICYmIHRoaXMubGFzdFBsdWdpbi5wb3N0Y3NzUGx1Z2luICkge1xuICAgICAgICAgICAgICAgIG9wdHMucGx1Z2luID0gdGhpcy5sYXN0UGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgd2FybmluZyA9IG5ldyBXYXJuaW5nKHRleHQsIG9wdHMpO1xuICAgICAgICB0aGlzLm1lc3NhZ2VzLnB1c2god2FybmluZyk7XG5cbiA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N0cmluZ30gcGx1Z2luIC0gc291cmNlIFBvc3RDU1MgcGx1Z2luIG5hbWVcbiAqL1xuIl19
  31506. /***/ }),
  31507. /* 198 */
  31508. /***/ (function(module, exports, __webpack_require__) {
  31509. "use strict";
  31510. exports.__esModule = true;
  31511. var _chalk = __webpack_require__(98);
  31512. var _chalk2 = _interopRequireDefault(_chalk);
  31513. var _tokenize = __webpack_require__(97);
  31514. var _tokenize2 = _interopRequireDefault(_tokenize);
  31515. var _input = __webpack_require__(37);
  31516. var _input2 = _interopRequireDefault(_input);
  31517. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31518. var colors = new _chalk2.default.constructor({ enabled: true });
  31519. var HIGHLIGHT_THEME = {
  31520. 'brackets': colors.cyan,
  31521. 'at-word': colors.cyan,
  31522. 'call': colors.cyan,
  31523. 'comment': colors.gray,
  31524. 'string': colors.green,
  31525. 'class': colors.yellow,
  31526. 'hash': colors.magenta,
  31527. '(': colors.cyan,
  31528. ')': colors.cyan,
  31529. '{': colors.yellow,
  31530. '}': colors.yellow,
  31531. '[': colors.yellow,
  31532. ']': colors.yellow,
  31533. ':': colors.yellow,
  31534. ';': colors.yellow
  31535. };
  31536. function getTokenType(_ref, index, tokens) {
  31537. var type = _ref[0],
  31538. value = _ref[1];
  31539. if (type === 'word') {
  31540. if (value[0] === '.') {
  31541. return 'class';
  31542. }
  31543. if (value[0] === '#') {
  31544. return 'hash';
  31545. }
  31546. }
  31547. var nextToken = tokens[index + 1];
  31548. if (nextToken && (nextToken[0] === 'brackets' || nextToken[0] === '(')) {
  31549. return 'call';
  31550. }
  31551. return type;
  31552. }
  31553. function terminalHighlight(css) {
  31554. var tokens = (0, _tokenize2.default)(new _input2.default(css), { ignoreErrors: true });
  31555. return tokens.map(function (token, index) {
  31556. var color = HIGHLIGHT_THEME[getTokenType(token, index, tokens)];
  31557. if (color) {
  31558. return token[1].split(/\r?\n/).map(function (i) {
  31559. return color(i);
  31560. }).join('\n');
  31561. } else {
  31562. return token[1];
  31563. }
  31564. }).join('');
  31565. }
  31566. exports.default = terminalHighlight;
  31567. module.exports = exports['default'];
  31568. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlcm1pbmFsLWhpZ2hsaWdodC5lczYiXSwibmFtZXMiOlsiY29sb3JzIiwiY29uc3RydWN0b3IiLCJlbmFibGVkIiwiSElHSExJR0hUX1RIRU1FIiwiY3lhbiIsImdyYXkiLCJncmVlbiIsInllbGxvdyIsIm1hZ2VudGEiLCJnZXRUb2tlblR5cGUiLCJpbmRleCIsInRva2VucyIsInR5cGUiLCJ2YWx1ZSIsIm5leHRUb2tlbiIsInRlcm1pbmFsSGlnaGxpZ2h0IiwiY3NzIiwiaWdub3JlRXJyb3JzIiwibWFwIiwidG9rZW4iLCJjb2xvciIsInNwbGl0IiwiaSIsImpvaW4iXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUVBOzs7O0FBQ0E7Ozs7OztBQUVBLElBQUlBLFNBQVMsSUFBSSxnQkFBTUMsV0FBVixDQUFzQixFQUFFQyxTQUFTLElBQVgsRUFBdEIsQ0FBYjs7QUFFQSxJQUFNQyxrQkFBa0I7QUFDcEIsZ0JBQVlILE9BQU9JLElBREM7QUFFcEIsZUFBWUosT0FBT0ksSUFGQztBQUdwQixZQUFZSixPQUFPSSxJQUhDO0FBSXBCLGVBQVlKLE9BQU9LLElBSkM7QUFLcEIsY0FBWUwsT0FBT00sS0FMQztBQU1wQixhQUFZTixPQUFPTyxNQU5DO0FBT3BCLFlBQVlQLE9BQU9RLE9BUEM7QUFRcEIsU0FBWVIsT0FBT0ksSUFSQztBQVNwQixTQUFZSixPQUFPSSxJQVRDO0FBVXBCLFNBQVlKLE9BQU9PLE1BVkM7QUFXcEIsU0FBWVAsT0FBT08sTUFYQztBQVlwQixTQUFZUCxPQUFPTyxNQVpDO0FBYXBCLFNBQVlQLE9BQU9PLE1BYkM7QUFjcEI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WVsbG93XG59O1xuXG5mdW5jdGlvbiBnZXRUb2tlblR5cGUoW3R5cGUsIHZhbHVlXSwgaW5kZXgsIHRva2Vucykge1xuICAgIGlmICh0eXBlID09PSAnd29yZCcpIHtcbiAgICAgICAgaWYgKHZhbHVlWzBdID09PSAnLicpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xhc3MnO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2YWx1ZVswXSA9PT0gJyMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2hhc2gnO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbGV0IG5leHRUb2tlbiA9IHRva2Vuc1tpbmRleCArIDFdO1xuICAgIGlmIChuZXh0VG9rZW4gJiYgKG5leHRUb2tlblswXSA9PT0gJ2JyYWNrZXRzJyB8fCBuZXh0VG9rZW5bMF0gPT09ICcoJykpIHtcbiAgICAgICAgcmV0dXJuICdjYWxsJztcbiAgICB9XG5cbiAgICByZXR1cm4gdHlwZTtcbn1cblxuZnVuY3Rpb24gdGVybWluYWxIaWdobGlnaHQoY3NzKSB7XG4gICAgbGV0IHRva2VucyA9IHRva2VuaXplKG5ldyBJbnB1dChjc3MpLCB7IGlnbm9yZUVycm9yczogdHJ1ZSB9KTtcbiAgICByZXR1cm4gdG9rZW5zLm1hcCgodG9rZW4sIGluZGV4KSA9PiB7XG4gICAgICAgIGxldCBjb2xvciA9IEhJR0hMSUdIVF9USEVNRVtnZXRUb2tlblR5cGUodG9rZW4sIGluZGV4LCB0b2tlbnMpXTtcbiAgICAgICAgaWYgKCBjb2xvciApIHtcbiAgICAgICAgICAgIHJldHVybiB0b2tlblsxXS5zcGxpdCgvXFxyP1xcbi8pXG4gICAgICAgICAgICAgIC5tYXAoIGkgPT4gY29sb3IoaSkgKVxuICAgICAgICAgICAgICAuam9pbignXFxuJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5bMV07XG4gICAgICAgIH1cbiAgICB9KS5qb2luKCcnKTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgdGVybWluYWxIaWdobGlnaHQ7XG4iXX0=
  31569. /***/ }),
  31570. /* 199 */
  31571. /***/ (function(module, exports, __webpack_require__) {
  31572. "use strict";
  31573. exports.__esModule = true;
  31574. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31575. /**
  31576. * Represents a plugin’s warning. It can be created using {@link Node#warn}.
  31577. *
  31578. * @example
  31579. * if ( decl.important ) {
  31580. * decl.warn(result, 'Avoid !important', { word: '!important' });
  31581. * }
  31582. */
  31583. var Warning = function () {
  31584. /**
  31585. * @param {string} text - warning message
  31586. * @param {Object} [opts] - warning options
  31587. * @param {Node} opts.node - CSS node that caused the warning
  31588. * @param {string} opts.word - word in CSS source that caused the warning
  31589. * @param {number} opts.index - index in CSS node string that caused
  31590. * the warning
  31591. * @param {string} opts.plugin - name of the plugin that created
  31592. * this warning. {@link Result#warn} fills
  31593. * this property automatically.
  31594. */
  31595. function Warning(text) {
  31596. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  31597. _classCallCheck(this, Warning);
  31598. /**
  31599. * @member {string} - Type to filter warnings from
  31600. * {@link Result#messages}. Always equal
  31601. * to `"warning"`.
  31602. *
  31603. * @example
  31604. * const nonWarning = result.messages.filter(i => i.type !== 'warning')
  31605. */
  31606. this.type = 'warning';
  31607. /**
  31608. * @member {string} - The warning message.
  31609. *
  31610. * @example
  31611. * warning.text //=> 'Try to avoid !important'
  31612. */
  31613. this.text = text;
  31614. if (opts.node && opts.node.source) {
  31615. var pos = opts.node.positionBy(opts);
  31616. /**
  31617. * @member {number} - Line in the input file
  31618. * with this warning’s source
  31619. *
  31620. * @example
  31621. * warning.line //=> 5
  31622. */
  31623. this.line = pos.line;
  31624. /**
  31625. * @member {number} - Column in the input file
  31626. * with this warning’s source.
  31627. *
  31628. * @example
  31629. * warning.column //=> 6
  31630. */
  31631. this.column = pos.column;
  31632. }
  31633. for (var opt in opts) {
  31634. this[opt] = opts[opt];
  31635. }
  31636. }
  31637. /**
  31638. * Returns a warning position and message.
  31639. *
  31640. * @example
  31641. * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
  31642. *
  31643. * @return {string} warning position and message
  31644. */
  31645. Warning.prototype.toString = function toString() {
  31646. if (this.node) {
  31647. return this.node.error(this.text, {
  31648. plugin: this.plugin,
  31649. index: this.index,
  31650. word: this.word
  31651. }).message;
  31652. } else if (this.plugin) {
  31653. return this.plugin + ': ' + this.text;
  31654. } else {
  31655. return this.text;
  31656. }
  31657. };
  31658. /**
  31659. * @memberof Warning#
  31660. * @member {string} plugin - The name of the plugin that created
  31661. * it will fill this property automatically.
  31662. * this warning. When you call {@link Node#warn}
  31663. *
  31664. * @example
  31665. * warning.plugin //=> 'postcss-important'
  31666. */
  31667. /**
  31668. * @memberof Warning#
  31669. * @member {Node} node - Contains the CSS node that caused the warning.
  31670. *
  31671. * @example
  31672. * warning.node.toString() //=> 'color: white !important'
  31673. */
  31674. return Warning;
  31675. }();
  31676. exports.default = Warning;
  31677. module.exports = exports['default'];
  31678. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm5pbmcuZXM2Il0sIm5hbWVzIjpbIldhcm5pbmciLCJ0ZXh0Iiwib3B0cyIsInR5cGUiLCJub2RlIiwic291cmNlIiwicG9zIiwicG9zaXRpb25CeSIsImxpbmUiLCJjb2x1bW4iLCJvcHQiLCJ0b1N0cmluZyIsImVycm9yIiwicGx1Z2luIiwiaW5kZXgiLCJ3b3JkIiwibWVzc2FnZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7Ozs7O0lBUU1BLE87O0FBRUY7Ozs7Ozs7Ozs7O0FBV0EsbUJBQVlDLElBQVosRUFBOEI7QUFBQSxRQUFaQyxJQUFZLHVFQUFMLEVBQUs7O0FBQUE7O0FBQzFCOzs7Ozs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0b21hdGljYWxseS5cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3Rvcih0ZXh0LCBvcHRzID0geyB9KSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gVHlwZSB0byBmaWx0ZXIgd2FybmluZ3MgZnJvbVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uIEFsd2F5cyBlcXVhbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgdG8gYFwid2FybmluZ1wiYC5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogY29uc3Qgbm9uV2FybmluZyA9IHJlc3VsdC5tZXNzYWdlcy5maWx0ZXIoaSA9PiBpLnR5cGUgIT09ICd3YXJuaW5nJylcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9ICd3YXJuaW5nJztcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgd2FybmluZyBtZXNzYWdlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiB3YXJuaW5nLnRleHQgLy89PiAnVHJ5IHRvIGF2b2lkICFpbXBvcnRhbnQnXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnRleHQgPSB0ZXh0O1xuXG4gICAgICAgIGlmICggb3B0cy5ub2RlICYmIG9wdHMubm9kZS5zb3VyY2UgKSB7XG4gICAgICAgICAgICBsZXQgcG9zICAgICA9IG9wdHMubm9kZS5wb3NpdGlvbkJ5KG9wdHMpO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gTGluZSBpbiB0aGUgaW5wdXQgZmlsZVxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIHdpdGggdGhpcyB3YXJuaW5n4oCZcyBzb3VyY2VcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5saW5lIC8vPT4gNVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmxpbmUgICA9IHBvcy5saW5lO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gQ29sdW1uIGluIHRoZSBpbnB1dCBmaWxlXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgd2l0aCB0aGlzIHdhcm5pbmfigJlzIHNvdXJjZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5jb2x1bW4gLy89PiA2XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoIGxldCBvcHQgaW4gb3B0cyApIHRoaXNbb3B0XSA9IG9wdHNbb3B0XTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGEgd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZS5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy50b1N0cmluZygpIC8vPT4gJ3Bvc3Rjc3MtbGludDphLmNzczoxMDoxNDogQXZvaWQgIWltcG9ydGFudCdcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZVxuICAgICAqL1xuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICBpZiAoIHRoaXMubm9kZSApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm5vZGUuZXJyb3IodGhpcy50ZXh0LCB7XG4gICAgICAgICAgICAgICAgcGx1Z2luOiB0aGlzLnBsdWdpbixcbiAgICAgICAgICAgICAgICBpbmRleDogIHRoaXMuaW5kZXgsXG4gICAgICAgICAgICAgICAgd29yZDogICB0aGlzLndvcmRcbiAgICAgICAgICAgIH0pLm1lc3NhZ2U7XG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMucGx1Z2luICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGx1Z2luICsgJzogJyArIHRoaXMudGV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgV2FybmluZyNcbiAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IHBsdWdpbiAtIFRoZSBuYW1lIG9mIHRoZSBwbHVnaW4gdGhhdCBjcmVhdGVkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICBpdCB3aWxsIGZpbGwgdGhpcyBwcm9wZXJ0eSBhdXRvbWF0aWNhbGx5LlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyB3YXJuaW5nLiBXaGVuIHlvdSBjYWxsIHtAbGluayBOb2RlI3dhcm59XG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHdhcm5pbmcucGx1Z2luIC8vPT4gJ3Bvc3Rjc3MtaW1wb3J0YW50J1xuICAgICAqL1xuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIFdhcm5pbmcjXG4gICAgICogQG1lbWJlciB7Tm9kZX0gbm9kZSAtIENvbnRhaW5zIHRoZSBDU1Mgbm9kZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy5ub2RlLnRvU3RyaW5nKCkgLy89PiAnY29sb3I6IHdoaXRlICFpbXBvcnRhbnQnXG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgV2FybmluZztcbiJdfQ==
  31679. /***/ }),
  31680. /* 200 */
  31681. /***/ (function(module, exports, __webpack_require__) {
  31682. "use strict";
  31683. /* WEBPACK VAR INJECTION */(function(module) {
  31684. function assembleStyles () {
  31685. var styles = {
  31686. modifiers: {
  31687. reset: [0, 0],
  31688. bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
  31689. dim: [2, 22],
  31690. italic: [3, 23],
  31691. underline: [4, 24],
  31692. inverse: [7, 27],
  31693. hidden: [8, 28],
  31694. strikethrough: [9, 29]
  31695. },
  31696. colors: {
  31697. black: [30, 39],
  31698. red: [31, 39],
  31699. green: [32, 39],
  31700. yellow: [33, 39],
  31701. blue: [34, 39],
  31702. magenta: [35, 39],
  31703. cyan: [36, 39],
  31704. white: [37, 39],
  31705. gray: [90, 39]
  31706. },
  31707. bgColors: {
  31708. bgBlack: [40, 49],
  31709. bgRed: [41, 49],
  31710. bgGreen: [42, 49],
  31711. bgYellow: [43, 49],
  31712. bgBlue: [44, 49],
  31713. bgMagenta: [45, 49],
  31714. bgCyan: [46, 49],
  31715. bgWhite: [47, 49]
  31716. }
  31717. };
  31718. // fix humans
  31719. styles.colors.grey = styles.colors.gray;
  31720. Object.keys(styles).forEach(function (groupName) {
  31721. var group = styles[groupName];
  31722. Object.keys(group).forEach(function (styleName) {
  31723. var style = group[styleName];
  31724. styles[styleName] = group[styleName] = {
  31725. open: '\u001b[' + style[0] + 'm',
  31726. close: '\u001b[' + style[1] + 'm'
  31727. };
  31728. });
  31729. Object.defineProperty(styles, groupName, {
  31730. value: group,
  31731. enumerable: false
  31732. });
  31733. });
  31734. return styles;
  31735. }
  31736. Object.defineProperty(module, 'exports', {
  31737. enumerable: true,
  31738. get: assembleStyles
  31739. });
  31740. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(214)(module)))
  31741. /***/ }),
  31742. /* 201 */
  31743. /***/ (function(module, exports, __webpack_require__) {
  31744. "use strict";
  31745. /* WEBPACK VAR INJECTION */(function(process) {
  31746. var argv = process.argv;
  31747. var terminator = argv.indexOf('--');
  31748. var hasFlag = function (flag) {
  31749. flag = '--' + flag;
  31750. var pos = argv.indexOf(flag);
  31751. return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
  31752. };
  31753. module.exports = (function () {
  31754. if ('FORCE_COLOR' in process.env) {
  31755. return true;
  31756. }
  31757. if (hasFlag('no-color') ||
  31758. hasFlag('no-colors') ||
  31759. hasFlag('color=false')) {
  31760. return false;
  31761. }
  31762. if (hasFlag('color') ||
  31763. hasFlag('colors') ||
  31764. hasFlag('color=true') ||
  31765. hasFlag('color=always')) {
  31766. return true;
  31767. }
  31768. if (process.stdout && !process.stdout.isTTY) {
  31769. return false;
  31770. }
  31771. if (process.platform === 'win32') {
  31772. return true;
  31773. }
  31774. if ('COLORTERM' in process.env) {
  31775. return true;
  31776. }
  31777. if (process.env.TERM === 'dumb') {
  31778. return false;
  31779. }
  31780. if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
  31781. return true;
  31782. }
  31783. return false;
  31784. })();
  31785. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(23)))
  31786. /***/ }),
  31787. /* 202 */
  31788. /***/ (function(module, exports, __webpack_require__) {
  31789. "use strict";
  31790. var ansiRegex = __webpack_require__(43)();
  31791. module.exports = function (str) {
  31792. return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
  31793. };
  31794. /***/ }),
  31795. /* 203 */
  31796. /***/ (function(module, exports) {
  31797. /* -*- Mode: js; js-indent-level: 2; -*- */
  31798. /*
  31799. * Copyright 2011 Mozilla Foundation and contributors
  31800. * Licensed under the New BSD license. See LICENSE or:
  31801. * http://opensource.org/licenses/BSD-3-Clause
  31802. */
  31803. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  31804. /**
  31805. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  31806. */
  31807. exports.encode = function (number) {
  31808. if (0 <= number && number < intToCharMap.length) {
  31809. return intToCharMap[number];
  31810. }
  31811. throw new TypeError("Must be between 0 and 63: " + number);
  31812. };
  31813. /**
  31814. * Decode a single base 64 character code digit to an integer. Returns -1 on
  31815. * failure.
  31816. */
  31817. exports.decode = function (charCode) {
  31818. var bigA = 65; // 'A'
  31819. var bigZ = 90; // 'Z'
  31820. var littleA = 97; // 'a'
  31821. var littleZ = 122; // 'z'
  31822. var zero = 48; // '0'
  31823. var nine = 57; // '9'
  31824. var plus = 43; // '+'
  31825. var slash = 47; // '/'
  31826. var littleOffset = 26;
  31827. var numberOffset = 52;
  31828. // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  31829. if (bigA <= charCode && charCode <= bigZ) {
  31830. return (charCode - bigA);
  31831. }
  31832. // 26 - 51: abcdefghijklmnopqrstuvwxyz
  31833. if (littleA <= charCode && charCode <= littleZ) {
  31834. return (charCode - littleA + littleOffset);
  31835. }
  31836. // 52 - 61: 0123456789
  31837. if (zero <= charCode && charCode <= nine) {
  31838. return (charCode - zero + numberOffset);
  31839. }
  31840. // 62: +
  31841. if (charCode == plus) {
  31842. return 62;
  31843. }
  31844. // 63: /
  31845. if (charCode == slash) {
  31846. return 63;
  31847. }
  31848. // Invalid base64 digit.
  31849. return -1;
  31850. };
  31851. /***/ }),
  31852. /* 204 */
  31853. /***/ (function(module, exports) {
  31854. /* -*- Mode: js; js-indent-level: 2; -*- */
  31855. /*
  31856. * Copyright 2011 Mozilla Foundation and contributors
  31857. * Licensed under the New BSD license. See LICENSE or:
  31858. * http://opensource.org/licenses/BSD-3-Clause
  31859. */
  31860. exports.GREATEST_LOWER_BOUND = 1;
  31861. exports.LEAST_UPPER_BOUND = 2;
  31862. /**
  31863. * Recursive implementation of binary search.
  31864. *
  31865. * @param aLow Indices here and lower do not contain the needle.
  31866. * @param aHigh Indices here and higher do not contain the needle.
  31867. * @param aNeedle The element being searched for.
  31868. * @param aHaystack The non-empty array being searched.
  31869. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  31870. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  31871. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  31872. * closest element that is smaller than or greater than the one we are
  31873. * searching for, respectively, if the exact element cannot be found.
  31874. */
  31875. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  31876. // This function terminates when one of the following is true:
  31877. //
  31878. // 1. We find the exact element we are looking for.
  31879. //
  31880. // 2. We did not find the exact element, but we can return the index of
  31881. // the next-closest element.
  31882. //
  31883. // 3. We did not find the exact element, and there is no next-closest
  31884. // element than the one we are searching for, so we return -1.
  31885. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  31886. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  31887. if (cmp === 0) {
  31888. // Found the element we are looking for.
  31889. return mid;
  31890. }
  31891. else if (cmp > 0) {
  31892. // Our needle is greater than aHaystack[mid].
  31893. if (aHigh - mid > 1) {
  31894. // The element is in the upper half.
  31895. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  31896. }
  31897. // The exact needle element was not found in this haystack. Determine if
  31898. // we are in termination case (3) or (2) and return the appropriate thing.
  31899. if (aBias == exports.LEAST_UPPER_BOUND) {
  31900. return aHigh < aHaystack.length ? aHigh : -1;
  31901. } else {
  31902. return mid;
  31903. }
  31904. }
  31905. else {
  31906. // Our needle is less than aHaystack[mid].
  31907. if (mid - aLow > 1) {
  31908. // The element is in the lower half.
  31909. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  31910. }
  31911. // we are in termination case (3) or (2) and return the appropriate thing.
  31912. if (aBias == exports.LEAST_UPPER_BOUND) {
  31913. return mid;
  31914. } else {
  31915. return aLow < 0 ? -1 : aLow;
  31916. }
  31917. }
  31918. }
  31919. /**
  31920. * This is an implementation of binary search which will always try and return
  31921. * the index of the closest element if there is no exact hit. This is because
  31922. * mappings between original and generated line/col pairs are single points,
  31923. * and there is an implicit region between each of them, so a miss just means
  31924. * that you aren't on the very start of a region.
  31925. *
  31926. * @param aNeedle The element you are looking for.
  31927. * @param aHaystack The array that is being searched.
  31928. * @param aCompare A function which takes the needle and an element in the
  31929. * array and returns -1, 0, or 1 depending on whether the needle is less
  31930. * than, equal to, or greater than the element, respectively.
  31931. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  31932. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  31933. * closest element that is smaller than or greater than the one we are
  31934. * searching for, respectively, if the exact element cannot be found.
  31935. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  31936. */
  31937. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  31938. if (aHaystack.length === 0) {
  31939. return -1;
  31940. }
  31941. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
  31942. aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  31943. if (index < 0) {
  31944. return -1;
  31945. }
  31946. // We have found either the exact element, or the next-closest element than
  31947. // the one we are searching for. However, there may be more than one such
  31948. // element. Make sure we always return the smallest of these.
  31949. while (index - 1 >= 0) {
  31950. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  31951. break;
  31952. }
  31953. --index;
  31954. }
  31955. return index;
  31956. };
  31957. /***/ }),
  31958. /* 205 */
  31959. /***/ (function(module, exports, __webpack_require__) {
  31960. /* -*- Mode: js; js-indent-level: 2; -*- */
  31961. /*
  31962. * Copyright 2014 Mozilla Foundation and contributors
  31963. * Licensed under the New BSD license. See LICENSE or:
  31964. * http://opensource.org/licenses/BSD-3-Clause
  31965. */
  31966. var util = __webpack_require__(17);
  31967. /**
  31968. * Determine whether mappingB is after mappingA with respect to generated
  31969. * position.
  31970. */
  31971. function generatedPositionAfter(mappingA, mappingB) {
  31972. // Optimized for most common case
  31973. var lineA = mappingA.generatedLine;
  31974. var lineB = mappingB.generatedLine;
  31975. var columnA = mappingA.generatedColumn;
  31976. var columnB = mappingB.generatedColumn;
  31977. return lineB > lineA || lineB == lineA && columnB >= columnA ||
  31978. util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  31979. }
  31980. /**
  31981. * A data structure to provide a sorted view of accumulated mappings in a
  31982. * performance conscious manner. It trades a neglibable overhead in general
  31983. * case for a large speedup in case of mappings being added in order.
  31984. */
  31985. function MappingList() {
  31986. this._array = [];
  31987. this._sorted = true;
  31988. // Serves as infimum
  31989. this._last = {generatedLine: -1, generatedColumn: 0};
  31990. }
  31991. /**
  31992. * Iterate through internal items. This method takes the same arguments that
  31993. * `Array.prototype.forEach` takes.
  31994. *
  31995. * NOTE: The order of the mappings is NOT guaranteed.
  31996. */
  31997. MappingList.prototype.unsortedForEach =
  31998. function MappingList_forEach(aCallback, aThisArg) {
  31999. this._array.forEach(aCallback, aThisArg);
  32000. };
  32001. /**
  32002. * Add the given source mapping.
  32003. *
  32004. * @param Object aMapping
  32005. */
  32006. MappingList.prototype.add = function MappingList_add(aMapping) {
  32007. if (generatedPositionAfter(this._last, aMapping)) {
  32008. this._last = aMapping;
  32009. this._array.push(aMapping);
  32010. } else {
  32011. this._sorted = false;
  32012. this._array.push(aMapping);
  32013. }
  32014. };
  32015. /**
  32016. * Returns the flat, sorted array of mappings. The mappings are sorted by
  32017. * generated position.
  32018. *
  32019. * WARNING: This method returns internal data without copying, for
  32020. * performance. The return value must NOT be mutated, and should be treated as
  32021. * an immutable borrow. If you want to take ownership, you must make your own
  32022. * copy.
  32023. */
  32024. MappingList.prototype.toArray = function MappingList_toArray() {
  32025. if (!this._sorted) {
  32026. this._array.sort(util.compareByGeneratedPositionsInflated);
  32027. this._sorted = true;
  32028. }
  32029. return this._array;
  32030. };
  32031. exports.MappingList = MappingList;
  32032. /***/ }),
  32033. /* 206 */
  32034. /***/ (function(module, exports) {
  32035. /* -*- Mode: js; js-indent-level: 2; -*- */
  32036. /*
  32037. * Copyright 2011 Mozilla Foundation and contributors
  32038. * Licensed under the New BSD license. See LICENSE or:
  32039. * http://opensource.org/licenses/BSD-3-Clause
  32040. */
  32041. // It turns out that some (most?) JavaScript engines don't self-host
  32042. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  32043. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  32044. // custom comparator function, calling back and forth between the VM's C++ and
  32045. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  32046. // worse generated code for the comparator function than would be optimal. In
  32047. // fact, when sorting with a comparator, these costs outweigh the benefits of
  32048. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  32049. // a ~3500ms mean speed-up in `bench/bench.html`.
  32050. /**
  32051. * Swap the elements indexed by `x` and `y` in the array `ary`.
  32052. *
  32053. * @param {Array} ary
  32054. * The array.
  32055. * @param {Number} x
  32056. * The index of the first item.
  32057. * @param {Number} y
  32058. * The index of the second item.
  32059. */
  32060. function swap(ary, x, y) {
  32061. var temp = ary[x];
  32062. ary[x] = ary[y];
  32063. ary[y] = temp;
  32064. }
  32065. /**
  32066. * Returns a random integer within the range `low .. high` inclusive.
  32067. *
  32068. * @param {Number} low
  32069. * The lower bound on the range.
  32070. * @param {Number} high
  32071. * The upper bound on the range.
  32072. */
  32073. function randomIntInRange(low, high) {
  32074. return Math.round(low + (Math.random() * (high - low)));
  32075. }
  32076. /**
  32077. * The Quick Sort algorithm.
  32078. *
  32079. * @param {Array} ary
  32080. * An array to sort.
  32081. * @param {function} comparator
  32082. * Function to use to compare two items.
  32083. * @param {Number} p
  32084. * Start index of the array
  32085. * @param {Number} r
  32086. * End index of the array
  32087. */
  32088. function doQuickSort(ary, comparator, p, r) {
  32089. // If our lower bound is less than our upper bound, we (1) partition the
  32090. // array into two pieces and (2) recurse on each half. If it is not, this is
  32091. // the empty array and our base case.
  32092. if (p < r) {
  32093. // (1) Partitioning.
  32094. //
  32095. // The partitioning chooses a pivot between `p` and `r` and moves all
  32096. // elements that are less than or equal to the pivot to the before it, and
  32097. // all the elements that are greater than it after it. The effect is that
  32098. // once partition is done, the pivot is in the exact place it will be when
  32099. // the array is put in sorted order, and it will not need to be moved
  32100. // again. This runs in O(n) time.
  32101. // Always choose a random pivot so that an input array which is reverse
  32102. // sorted does not cause O(n^2) running time.
  32103. var pivotIndex = randomIntInRange(p, r);
  32104. var i = p - 1;
  32105. swap(ary, pivotIndex, r);
  32106. var pivot = ary[r];
  32107. // Immediately after `j` is incremented in this loop, the following hold
  32108. // true:
  32109. //
  32110. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  32111. //
  32112. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  32113. for (var j = p; j < r; j++) {
  32114. if (comparator(ary[j], pivot) <= 0) {
  32115. i += 1;
  32116. swap(ary, i, j);
  32117. }
  32118. }
  32119. swap(ary, i + 1, j);
  32120. var q = i + 1;
  32121. // (2) Recurse on each half.
  32122. doQuickSort(ary, comparator, p, q - 1);
  32123. doQuickSort(ary, comparator, q + 1, r);
  32124. }
  32125. }
  32126. /**
  32127. * Sort the given array in-place with the given comparator function.
  32128. *
  32129. * @param {Array} ary
  32130. * An array to sort.
  32131. * @param {function} comparator
  32132. * Function to use to compare two items.
  32133. */
  32134. exports.quickSort = function (ary, comparator) {
  32135. doQuickSort(ary, comparator, 0, ary.length - 1);
  32136. };
  32137. /***/ }),
  32138. /* 207 */
  32139. /***/ (function(module, exports, __webpack_require__) {
  32140. /* -*- Mode: js; js-indent-level: 2; -*- */
  32141. /*
  32142. * Copyright 2011 Mozilla Foundation and contributors
  32143. * Licensed under the New BSD license. See LICENSE or:
  32144. * http://opensource.org/licenses/BSD-3-Clause
  32145. */
  32146. var util = __webpack_require__(17);
  32147. var binarySearch = __webpack_require__(204);
  32148. var ArraySet = __webpack_require__(99).ArraySet;
  32149. var base64VLQ = __webpack_require__(100);
  32150. var quickSort = __webpack_require__(206).quickSort;
  32151. function SourceMapConsumer(aSourceMap) {
  32152. var sourceMap = aSourceMap;
  32153. if (typeof aSourceMap === 'string') {
  32154. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  32155. }
  32156. return sourceMap.sections != null
  32157. ? new IndexedSourceMapConsumer(sourceMap)
  32158. : new BasicSourceMapConsumer(sourceMap);
  32159. }
  32160. SourceMapConsumer.fromSourceMap = function(aSourceMap) {
  32161. return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
  32162. }
  32163. /**
  32164. * The version of the source mapping spec that we are consuming.
  32165. */
  32166. SourceMapConsumer.prototype._version = 3;
  32167. // `__generatedMappings` and `__originalMappings` are arrays that hold the
  32168. // parsed mapping coordinates from the source map's "mappings" attribute. They
  32169. // are lazily instantiated, accessed via the `_generatedMappings` and
  32170. // `_originalMappings` getters respectively, and we only parse the mappings
  32171. // and create these arrays once queried for a source location. We jump through
  32172. // these hoops because there can be many thousands of mappings, and parsing
  32173. // them is expensive, so we only want to do it if we must.
  32174. //
  32175. // Each object in the arrays is of the form:
  32176. //
  32177. // {
  32178. // generatedLine: The line number in the generated code,
  32179. // generatedColumn: The column number in the generated code,
  32180. // source: The path to the original source file that generated this
  32181. // chunk of code,
  32182. // originalLine: The line number in the original source that
  32183. // corresponds to this chunk of generated code,
  32184. // originalColumn: The column number in the original source that
  32185. // corresponds to this chunk of generated code,
  32186. // name: The name of the original symbol which generated this chunk of
  32187. // code.
  32188. // }
  32189. //
  32190. // All properties except for `generatedLine` and `generatedColumn` can be
  32191. // `null`.
  32192. //
  32193. // `_generatedMappings` is ordered by the generated positions.
  32194. //
  32195. // `_originalMappings` is ordered by the original positions.
  32196. SourceMapConsumer.prototype.__generatedMappings = null;
  32197. Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  32198. get: function () {
  32199. if (!this.__generatedMappings) {
  32200. this._parseMappings(this._mappings, this.sourceRoot);
  32201. }
  32202. return this.__generatedMappings;
  32203. }
  32204. });
  32205. SourceMapConsumer.prototype.__originalMappings = null;
  32206. Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  32207. get: function () {
  32208. if (!this.__originalMappings) {
  32209. this._parseMappings(this._mappings, this.sourceRoot);
  32210. }
  32211. return this.__originalMappings;
  32212. }
  32213. });
  32214. SourceMapConsumer.prototype._charIsMappingSeparator =
  32215. function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  32216. var c = aStr.charAt(index);
  32217. return c === ";" || c === ",";
  32218. };
  32219. /**
  32220. * Parse the mappings in a string in to a data structure which we can easily
  32221. * query (the ordered arrays in the `this.__generatedMappings` and
  32222. * `this.__originalMappings` properties).
  32223. */
  32224. SourceMapConsumer.prototype._parseMappings =
  32225. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  32226. throw new Error("Subclasses must implement _parseMappings");
  32227. };
  32228. SourceMapConsumer.GENERATED_ORDER = 1;
  32229. SourceMapConsumer.ORIGINAL_ORDER = 2;
  32230. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  32231. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  32232. /**
  32233. * Iterate over each mapping between an original source/line/column and a
  32234. * generated line/column in this source map.
  32235. *
  32236. * @param Function aCallback
  32237. * The function that is called with each mapping.
  32238. * @param Object aContext
  32239. * Optional. If specified, this object will be the value of `this` every
  32240. * time that `aCallback` is called.
  32241. * @param aOrder
  32242. * Either `SourceMapConsumer.GENERATED_ORDER` or
  32243. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  32244. * iterate over the mappings sorted by the generated file's line/column
  32245. * order or the original's source/line/column order, respectively. Defaults to
  32246. * `SourceMapConsumer.GENERATED_ORDER`.
  32247. */
  32248. SourceMapConsumer.prototype.eachMapping =
  32249. function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  32250. var context = aContext || null;
  32251. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  32252. var mappings;
  32253. switch (order) {
  32254. case SourceMapConsumer.GENERATED_ORDER:
  32255. mappings = this._generatedMappings;
  32256. break;
  32257. case SourceMapConsumer.ORIGINAL_ORDER:
  32258. mappings = this._originalMappings;
  32259. break;
  32260. default:
  32261. throw new Error("Unknown order of iteration.");
  32262. }
  32263. var sourceRoot = this.sourceRoot;
  32264. mappings.map(function (mapping) {
  32265. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  32266. if (source != null && sourceRoot != null) {
  32267. source = util.join(sourceRoot, source);
  32268. }
  32269. return {
  32270. source: source,
  32271. generatedLine: mapping.generatedLine,
  32272. generatedColumn: mapping.generatedColumn,
  32273. originalLine: mapping.originalLine,
  32274. originalColumn: mapping.originalColumn,
  32275. name: mapping.name === null ? null : this._names.at(mapping.name)
  32276. };
  32277. }, this).forEach(aCallback, context);
  32278. };
  32279. /**
  32280. * Returns all generated line and column information for the original source,
  32281. * line, and column provided. If no column is provided, returns all mappings
  32282. * corresponding to a either the line we are searching for or the next
  32283. * closest line that has any mappings. Otherwise, returns all mappings
  32284. * corresponding to the given line and either the column we are searching for
  32285. * or the next closest column that has any offsets.
  32286. *
  32287. * The only argument is an object with the following properties:
  32288. *
  32289. * - source: The filename of the original source.
  32290. * - line: The line number in the original source.
  32291. * - column: Optional. the column number in the original source.
  32292. *
  32293. * and an array of objects is returned, each with the following properties:
  32294. *
  32295. * - line: The line number in the generated source, or null.
  32296. * - column: The column number in the generated source, or null.
  32297. */
  32298. SourceMapConsumer.prototype.allGeneratedPositionsFor =
  32299. function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  32300. var line = util.getArg(aArgs, 'line');
  32301. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  32302. // returns the index of the closest mapping less than the needle. By
  32303. // setting needle.originalColumn to 0, we thus find the last mapping for
  32304. // the given line, provided such a mapping exists.
  32305. var needle = {
  32306. source: util.getArg(aArgs, 'source'),
  32307. originalLine: line,
  32308. originalColumn: util.getArg(aArgs, 'column', 0)
  32309. };
  32310. if (this.sourceRoot != null) {
  32311. needle.source = util.relative(this.sourceRoot, needle.source);
  32312. }
  32313. if (!this._sources.has(needle.source)) {
  32314. return [];
  32315. }
  32316. needle.source = this._sources.indexOf(needle.source);
  32317. var mappings = [];
  32318. var index = this._findMapping(needle,
  32319. this._originalMappings,
  32320. "originalLine",
  32321. "originalColumn",
  32322. util.compareByOriginalPositions,
  32323. binarySearch.LEAST_UPPER_BOUND);
  32324. if (index >= 0) {
  32325. var mapping = this._originalMappings[index];
  32326. if (aArgs.column === undefined) {
  32327. var originalLine = mapping.originalLine;
  32328. // Iterate until either we run out of mappings, or we run into
  32329. // a mapping for a different line than the one we found. Since
  32330. // mappings are sorted, this is guaranteed to find all mappings for
  32331. // the line we found.
  32332. while (mapping && mapping.originalLine === originalLine) {
  32333. mappings.push({
  32334. line: util.getArg(mapping, 'generatedLine', null),
  32335. column: util.getArg(mapping, 'generatedColumn', null),
  32336. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  32337. });
  32338. mapping = this._originalMappings[++index];
  32339. }
  32340. } else {
  32341. var originalColumn = mapping.originalColumn;
  32342. // Iterate until either we run out of mappings, or we run into
  32343. // a mapping for a different line than the one we were searching for.
  32344. // Since mappings are sorted, this is guaranteed to find all mappings for
  32345. // the line we are searching for.
  32346. while (mapping &&
  32347. mapping.originalLine === line &&
  32348. mapping.originalColumn == originalColumn) {
  32349. mappings.push({
  32350. line: util.getArg(mapping, 'generatedLine', null),
  32351. column: util.getArg(mapping, 'generatedColumn', null),
  32352. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  32353. });
  32354. mapping = this._originalMappings[++index];
  32355. }
  32356. }
  32357. }
  32358. return mappings;
  32359. };
  32360. exports.SourceMapConsumer = SourceMapConsumer;
  32361. /**
  32362. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  32363. * query for information about the original file positions by giving it a file
  32364. * position in the generated source.
  32365. *
  32366. * The only parameter is the raw source map (either as a JSON string, or
  32367. * already parsed to an object). According to the spec, source maps have the
  32368. * following attributes:
  32369. *
  32370. * - version: Which version of the source map spec this map is following.
  32371. * - sources: An array of URLs to the original source files.
  32372. * - names: An array of identifiers which can be referrenced by individual mappings.
  32373. * - sourceRoot: Optional. The URL root from which all sources are relative.
  32374. * - sourcesContent: Optional. An array of contents of the original source files.
  32375. * - mappings: A string of base64 VLQs which contain the actual mappings.
  32376. * - file: Optional. The generated file this source map is associated with.
  32377. *
  32378. * Here is an example source map, taken from the source map spec[0]:
  32379. *
  32380. * {
  32381. * version : 3,
  32382. * file: "out.js",
  32383. * sourceRoot : "",
  32384. * sources: ["foo.js", "bar.js"],
  32385. * names: ["src", "maps", "are", "fun"],
  32386. * mappings: "AA,AB;;ABCDE;"
  32387. * }
  32388. *
  32389. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  32390. */
  32391. function BasicSourceMapConsumer(aSourceMap) {
  32392. var sourceMap = aSourceMap;
  32393. if (typeof aSourceMap === 'string') {
  32394. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  32395. }
  32396. var version = util.getArg(sourceMap, 'version');
  32397. var sources = util.getArg(sourceMap, 'sources');
  32398. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  32399. // requires the array) to play nice here.
  32400. var names = util.getArg(sourceMap, 'names', []);
  32401. var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  32402. var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  32403. var mappings = util.getArg(sourceMap, 'mappings');
  32404. var file = util.getArg(sourceMap, 'file', null);
  32405. // Once again, Sass deviates from the spec and supplies the version as a
  32406. // string rather than a number, so we use loose equality checking here.
  32407. if (version != this._version) {
  32408. throw new Error('Unsupported version: ' + version);
  32409. }
  32410. sources = sources
  32411. .map(String)
  32412. // Some source maps produce relative source paths like "./foo.js" instead of
  32413. // "foo.js". Normalize these first so that future comparisons will succeed.
  32414. // See bugzil.la/1090768.
  32415. .map(util.normalize)
  32416. // Always ensure that absolute sources are internally stored relative to
  32417. // the source root, if the source root is absolute. Not doing this would
  32418. // be particularly problematic when the source root is a prefix of the
  32419. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  32420. .map(function (source) {
  32421. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
  32422. ? util.relative(sourceRoot, source)
  32423. : source;
  32424. });
  32425. // Pass `true` below to allow duplicate names and sources. While source maps
  32426. // are intended to be compressed and deduplicated, the TypeScript compiler
  32427. // sometimes generates source maps with duplicates in them. See Github issue
  32428. // #72 and bugzil.la/889492.
  32429. this._names = ArraySet.fromArray(names.map(String), true);
  32430. this._sources = ArraySet.fromArray(sources, true);
  32431. this.sourceRoot = sourceRoot;
  32432. this.sourcesContent = sourcesContent;
  32433. this._mappings = mappings;
  32434. this.file = file;
  32435. }
  32436. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  32437. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  32438. /**
  32439. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  32440. *
  32441. * @param SourceMapGenerator aSourceMap
  32442. * The source map that will be consumed.
  32443. * @returns BasicSourceMapConsumer
  32444. */
  32445. BasicSourceMapConsumer.fromSourceMap =
  32446. function SourceMapConsumer_fromSourceMap(aSourceMap) {
  32447. var smc = Object.create(BasicSourceMapConsumer.prototype);
  32448. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  32449. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  32450. smc.sourceRoot = aSourceMap._sourceRoot;
  32451. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
  32452. smc.sourceRoot);
  32453. smc.file = aSourceMap._file;
  32454. // Because we are modifying the entries (by converting string sources and
  32455. // names to indices into the sources and names ArraySets), we have to make
  32456. // a copy of the entry or else bad things happen. Shared mutable state
  32457. // strikes again! See github issue #191.
  32458. var generatedMappings = aSourceMap._mappings.toArray().slice();
  32459. var destGeneratedMappings = smc.__generatedMappings = [];
  32460. var destOriginalMappings = smc.__originalMappings = [];
  32461. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  32462. var srcMapping = generatedMappings[i];
  32463. var destMapping = new Mapping;
  32464. destMapping.generatedLine = srcMapping.generatedLine;
  32465. destMapping.generatedColumn = srcMapping.generatedColumn;
  32466. if (srcMapping.source) {
  32467. destMapping.source = sources.indexOf(srcMapping.source);
  32468. destMapping.originalLine = srcMapping.originalLine;
  32469. destMapping.originalColumn = srcMapping.originalColumn;
  32470. if (srcMapping.name) {
  32471. destMapping.name = names.indexOf(srcMapping.name);
  32472. }
  32473. destOriginalMappings.push(destMapping);
  32474. }
  32475. destGeneratedMappings.push(destMapping);
  32476. }
  32477. quickSort(smc.__originalMappings, util.compareByOriginalPositions);
  32478. return smc;
  32479. };
  32480. /**
  32481. * The version of the source mapping spec that we are consuming.
  32482. */
  32483. BasicSourceMapConsumer.prototype._version = 3;
  32484. /**
  32485. * The list of original sources.
  32486. */
  32487. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  32488. get: function () {
  32489. return this._sources.toArray().map(function (s) {
  32490. return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
  32491. }, this);
  32492. }
  32493. });
  32494. /**
  32495. * Provide the JIT with a nice shape / hidden class.
  32496. */
  32497. function Mapping() {
  32498. this.generatedLine = 0;
  32499. this.generatedColumn = 0;
  32500. this.source = null;
  32501. this.originalLine = null;
  32502. this.originalColumn = null;
  32503. this.name = null;
  32504. }
  32505. /**
  32506. * Parse the mappings in a string in to a data structure which we can easily
  32507. * query (the ordered arrays in the `this.__generatedMappings` and
  32508. * `this.__originalMappings` properties).
  32509. */
  32510. BasicSourceMapConsumer.prototype._parseMappings =
  32511. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  32512. var generatedLine = 1;
  32513. var previousGeneratedColumn = 0;
  32514. var previousOriginalLine = 0;
  32515. var previousOriginalColumn = 0;
  32516. var previousSource = 0;
  32517. var previousName = 0;
  32518. var length = aStr.length;
  32519. var index = 0;
  32520. var cachedSegments = {};
  32521. var temp = {};
  32522. var originalMappings = [];
  32523. var generatedMappings = [];
  32524. var mapping, str, segment, end, value;
  32525. while (index < length) {
  32526. if (aStr.charAt(index) === ';') {
  32527. generatedLine++;
  32528. index++;
  32529. previousGeneratedColumn = 0;
  32530. }
  32531. else if (aStr.charAt(index) === ',') {
  32532. index++;
  32533. }
  32534. else {
  32535. mapping = new Mapping();
  32536. mapping.generatedLine = generatedLine;
  32537. // Because each offset is encoded relative to the previous one,
  32538. // many segments often have the same encoding. We can exploit this
  32539. // fact by caching the parsed variable length fields of each segment,
  32540. // allowing us to avoid a second parse if we encounter the same
  32541. // segment again.
  32542. for (end = index; end < length; end++) {
  32543. if (this._charIsMappingSeparator(aStr, end)) {
  32544. break;
  32545. }
  32546. }
  32547. str = aStr.slice(index, end);
  32548. segment = cachedSegments[str];
  32549. if (segment) {
  32550. index += str.length;
  32551. } else {
  32552. segment = [];
  32553. while (index < end) {
  32554. base64VLQ.decode(aStr, index, temp);
  32555. value = temp.value;
  32556. index = temp.rest;
  32557. segment.push(value);
  32558. }
  32559. if (segment.length === 2) {
  32560. throw new Error('Found a source, but no line and column');
  32561. }
  32562. if (segment.length === 3) {
  32563. throw new Error('Found a source and line, but no column');
  32564. }
  32565. cachedSegments[str] = segment;
  32566. }
  32567. // Generated column.
  32568. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  32569. previousGeneratedColumn = mapping.generatedColumn;
  32570. if (segment.length > 1) {
  32571. // Original source.
  32572. mapping.source = previousSource + segment[1];
  32573. previousSource += segment[1];
  32574. // Original line.
  32575. mapping.originalLine = previousOriginalLine + segment[2];
  32576. previousOriginalLine = mapping.originalLine;
  32577. // Lines are stored 0-based
  32578. mapping.originalLine += 1;
  32579. // Original column.
  32580. mapping.originalColumn = previousOriginalColumn + segment[3];
  32581. previousOriginalColumn = mapping.originalColumn;
  32582. if (segment.length > 4) {
  32583. // Original name.
  32584. mapping.name = previousName + segment[4];
  32585. previousName += segment[4];
  32586. }
  32587. }
  32588. generatedMappings.push(mapping);
  32589. if (typeof mapping.originalLine === 'number') {
  32590. originalMappings.push(mapping);
  32591. }
  32592. }
  32593. }
  32594. quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
  32595. this.__generatedMappings = generatedMappings;
  32596. quickSort(originalMappings, util.compareByOriginalPositions);
  32597. this.__originalMappings = originalMappings;
  32598. };
  32599. /**
  32600. * Find the mapping that best matches the hypothetical "needle" mapping that
  32601. * we are searching for in the given "haystack" of mappings.
  32602. */
  32603. BasicSourceMapConsumer.prototype._findMapping =
  32604. function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
  32605. aColumnName, aComparator, aBias) {
  32606. // To return the position we are searching for, we must first find the
  32607. // mapping for the given position and then return the opposite position it
  32608. // points to. Because the mappings are sorted, we can use binary search to
  32609. // find the best mapping.
  32610. if (aNeedle[aLineName] <= 0) {
  32611. throw new TypeError('Line must be greater than or equal to 1, got '
  32612. + aNeedle[aLineName]);
  32613. }
  32614. if (aNeedle[aColumnName] < 0) {
  32615. throw new TypeError('Column must be greater than or equal to 0, got '
  32616. + aNeedle[aColumnName]);
  32617. }
  32618. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  32619. };
  32620. /**
  32621. * Compute the last column for each generated mapping. The last column is
  32622. * inclusive.
  32623. */
  32624. BasicSourceMapConsumer.prototype.computeColumnSpans =
  32625. function SourceMapConsumer_computeColumnSpans() {
  32626. for (var index = 0; index < this._generatedMappings.length; ++index) {
  32627. var mapping = this._generatedMappings[index];
  32628. // Mappings do not contain a field for the last generated columnt. We
  32629. // can come up with an optimistic estimate, however, by assuming that
  32630. // mappings are contiguous (i.e. given two consecutive mappings, the
  32631. // first mapping ends where the second one starts).
  32632. if (index + 1 < this._generatedMappings.length) {
  32633. var nextMapping = this._generatedMappings[index + 1];
  32634. if (mapping.generatedLine === nextMapping.generatedLine) {
  32635. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  32636. continue;
  32637. }
  32638. }
  32639. // The last mapping for each line spans the entire line.
  32640. mapping.lastGeneratedColumn = Infinity;
  32641. }
  32642. };
  32643. /**
  32644. * Returns the original source, line, and column information for the generated
  32645. * source's line and column positions provided. The only argument is an object
  32646. * with the following properties:
  32647. *
  32648. * - line: The line number in the generated source.
  32649. * - column: The column number in the generated source.
  32650. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  32651. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  32652. * closest element that is smaller than or greater than the one we are
  32653. * searching for, respectively, if the exact element cannot be found.
  32654. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  32655. *
  32656. * and an object is returned with the following properties:
  32657. *
  32658. * - source: The original source file, or null.
  32659. * - line: The line number in the original source, or null.
  32660. * - column: The column number in the original source, or null.
  32661. * - name: The original identifier, or null.
  32662. */
  32663. BasicSourceMapConsumer.prototype.originalPositionFor =
  32664. function SourceMapConsumer_originalPositionFor(aArgs) {
  32665. var needle = {
  32666. generatedLine: util.getArg(aArgs, 'line'),
  32667. generatedColumn: util.getArg(aArgs, 'column')
  32668. };
  32669. var index = this._findMapping(
  32670. needle,
  32671. this._generatedMappings,
  32672. "generatedLine",
  32673. "generatedColumn",
  32674. util.compareByGeneratedPositionsDeflated,
  32675. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  32676. );
  32677. if (index >= 0) {
  32678. var mapping = this._generatedMappings[index];
  32679. if (mapping.generatedLine === needle.generatedLine) {
  32680. var source = util.getArg(mapping, 'source', null);
  32681. if (source !== null) {
  32682. source = this._sources.at(source);
  32683. if (this.sourceRoot != null) {
  32684. source = util.join(this.sourceRoot, source);
  32685. }
  32686. }
  32687. var name = util.getArg(mapping, 'name', null);
  32688. if (name !== null) {
  32689. name = this._names.at(name);
  32690. }
  32691. return {
  32692. source: source,
  32693. line: util.getArg(mapping, 'originalLine', null),
  32694. column: util.getArg(mapping, 'originalColumn', null),
  32695. name: name
  32696. };
  32697. }
  32698. }
  32699. return {
  32700. source: null,
  32701. line: null,
  32702. column: null,
  32703. name: null
  32704. };
  32705. };
  32706. /**
  32707. * Return true if we have the source content for every source in the source
  32708. * map, false otherwise.
  32709. */
  32710. BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  32711. function BasicSourceMapConsumer_hasContentsOfAllSources() {
  32712. if (!this.sourcesContent) {
  32713. return false;
  32714. }
  32715. return this.sourcesContent.length >= this._sources.size() &&
  32716. !this.sourcesContent.some(function (sc) { return sc == null; });
  32717. };
  32718. /**
  32719. * Returns the original source content. The only argument is the url of the
  32720. * original source file. Returns null if no original source content is
  32721. * available.
  32722. */
  32723. BasicSourceMapConsumer.prototype.sourceContentFor =
  32724. function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  32725. if (!this.sourcesContent) {
  32726. return null;
  32727. }
  32728. if (this.sourceRoot != null) {
  32729. aSource = util.relative(this.sourceRoot, aSource);
  32730. }
  32731. if (this._sources.has(aSource)) {
  32732. return this.sourcesContent[this._sources.indexOf(aSource)];
  32733. }
  32734. var url;
  32735. if (this.sourceRoot != null
  32736. && (url = util.urlParse(this.sourceRoot))) {
  32737. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  32738. // many users. We can help them out when they expect file:// URIs to
  32739. // behave like it would if they were running a local HTTP server. See
  32740. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  32741. var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
  32742. if (url.scheme == "file"
  32743. && this._sources.has(fileUriAbsPath)) {
  32744. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
  32745. }
  32746. if ((!url.path || url.path == "/")
  32747. && this._sources.has("/" + aSource)) {
  32748. return this.sourcesContent[this._sources.indexOf("/" + aSource)];
  32749. }
  32750. }
  32751. // This function is used recursively from
  32752. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  32753. // don't want to throw if we can't find the source - we just want to
  32754. // return null, so we provide a flag to exit gracefully.
  32755. if (nullOnMissing) {
  32756. return null;
  32757. }
  32758. else {
  32759. throw new Error('"' + aSource + '" is not in the SourceMap.');
  32760. }
  32761. };
  32762. /**
  32763. * Returns the generated line and column information for the original source,
  32764. * line, and column positions provided. The only argument is an object with
  32765. * the following properties:
  32766. *
  32767. * - source: The filename of the original source.
  32768. * - line: The line number in the original source.
  32769. * - column: The column number in the original source.
  32770. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  32771. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  32772. * closest element that is smaller than or greater than the one we are
  32773. * searching for, respectively, if the exact element cannot be found.
  32774. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  32775. *
  32776. * and an object is returned with the following properties:
  32777. *
  32778. * - line: The line number in the generated source, or null.
  32779. * - column: The column number in the generated source, or null.
  32780. */
  32781. BasicSourceMapConsumer.prototype.generatedPositionFor =
  32782. function SourceMapConsumer_generatedPositionFor(aArgs) {
  32783. var source = util.getArg(aArgs, 'source');
  32784. if (this.sourceRoot != null) {
  32785. source = util.relative(this.sourceRoot, source);
  32786. }
  32787. if (!this._sources.has(source)) {
  32788. return {
  32789. line: null,
  32790. column: null,
  32791. lastColumn: null
  32792. };
  32793. }
  32794. source = this._sources.indexOf(source);
  32795. var needle = {
  32796. source: source,
  32797. originalLine: util.getArg(aArgs, 'line'),
  32798. originalColumn: util.getArg(aArgs, 'column')
  32799. };
  32800. var index = this._findMapping(
  32801. needle,
  32802. this._originalMappings,
  32803. "originalLine",
  32804. "originalColumn",
  32805. util.compareByOriginalPositions,
  32806. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  32807. );
  32808. if (index >= 0) {
  32809. var mapping = this._originalMappings[index];
  32810. if (mapping.source === needle.source) {
  32811. return {
  32812. line: util.getArg(mapping, 'generatedLine', null),
  32813. column: util.getArg(mapping, 'generatedColumn', null),
  32814. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  32815. };
  32816. }
  32817. }
  32818. return {
  32819. line: null,
  32820. column: null,
  32821. lastColumn: null
  32822. };
  32823. };
  32824. exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
  32825. /**
  32826. * An IndexedSourceMapConsumer instance represents a parsed source map which
  32827. * we can query for information. It differs from BasicSourceMapConsumer in
  32828. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  32829. * input.
  32830. *
  32831. * The only parameter is a raw source map (either as a JSON string, or already
  32832. * parsed to an object). According to the spec for indexed source maps, they
  32833. * have the following attributes:
  32834. *
  32835. * - version: Which version of the source map spec this map is following.
  32836. * - file: Optional. The generated file this source map is associated with.
  32837. * - sections: A list of section definitions.
  32838. *
  32839. * Each value under the "sections" field has two fields:
  32840. * - offset: The offset into the original specified at which this section
  32841. * begins to apply, defined as an object with a "line" and "column"
  32842. * field.
  32843. * - map: A source map definition. This source map could also be indexed,
  32844. * but doesn't have to be.
  32845. *
  32846. * Instead of the "map" field, it's also possible to have a "url" field
  32847. * specifying a URL to retrieve a source map from, but that's currently
  32848. * unsupported.
  32849. *
  32850. * Here's an example source map, taken from the source map spec[0], but
  32851. * modified to omit a section which uses the "url" field.
  32852. *
  32853. * {
  32854. * version : 3,
  32855. * file: "app.js",
  32856. * sections: [{
  32857. * offset: {line:100, column:10},
  32858. * map: {
  32859. * version : 3,
  32860. * file: "section.js",
  32861. * sources: ["foo.js", "bar.js"],
  32862. * names: ["src", "maps", "are", "fun"],
  32863. * mappings: "AAAA,E;;ABCDE;"
  32864. * }
  32865. * }],
  32866. * }
  32867. *
  32868. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  32869. */
  32870. function IndexedSourceMapConsumer(aSourceMap) {
  32871. var sourceMap = aSourceMap;
  32872. if (typeof aSourceMap === 'string') {
  32873. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  32874. }
  32875. var version = util.getArg(sourceMap, 'version');
  32876. var sections = util.getArg(sourceMap, 'sections');
  32877. if (version != this._version) {
  32878. throw new Error('Unsupported version: ' + version);
  32879. }
  32880. this._sources = new ArraySet();
  32881. this._names = new ArraySet();
  32882. var lastOffset = {
  32883. line: -1,
  32884. column: 0
  32885. };
  32886. this._sections = sections.map(function (s) {
  32887. if (s.url) {
  32888. // The url field will require support for asynchronicity.
  32889. // See https://github.com/mozilla/source-map/issues/16
  32890. throw new Error('Support for url field in sections not implemented.');
  32891. }
  32892. var offset = util.getArg(s, 'offset');
  32893. var offsetLine = util.getArg(offset, 'line');
  32894. var offsetColumn = util.getArg(offset, 'column');
  32895. if (offsetLine < lastOffset.line ||
  32896. (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
  32897. throw new Error('Section offsets must be ordered and non-overlapping.');
  32898. }
  32899. lastOffset = offset;
  32900. return {
  32901. generatedOffset: {
  32902. // The offset fields are 0-based, but we use 1-based indices when
  32903. // encoding/decoding from VLQ.
  32904. generatedLine: offsetLine + 1,
  32905. generatedColumn: offsetColumn + 1
  32906. },
  32907. consumer: new SourceMapConsumer(util.getArg(s, 'map'))
  32908. }
  32909. });
  32910. }
  32911. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  32912. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
  32913. /**
  32914. * The version of the source mapping spec that we are consuming.
  32915. */
  32916. IndexedSourceMapConsumer.prototype._version = 3;
  32917. /**
  32918. * The list of original sources.
  32919. */
  32920. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  32921. get: function () {
  32922. var sources = [];
  32923. for (var i = 0; i < this._sections.length; i++) {
  32924. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  32925. sources.push(this._sections[i].consumer.sources[j]);
  32926. }
  32927. }
  32928. return sources;
  32929. }
  32930. });
  32931. /**
  32932. * Returns the original source, line, and column information for the generated
  32933. * source's line and column positions provided. The only argument is an object
  32934. * with the following properties:
  32935. *
  32936. * - line: The line number in the generated source.
  32937. * - column: The column number in the generated source.
  32938. *
  32939. * and an object is returned with the following properties:
  32940. *
  32941. * - source: The original source file, or null.
  32942. * - line: The line number in the original source, or null.
  32943. * - column: The column number in the original source, or null.
  32944. * - name: The original identifier, or null.
  32945. */
  32946. IndexedSourceMapConsumer.prototype.originalPositionFor =
  32947. function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  32948. var needle = {
  32949. generatedLine: util.getArg(aArgs, 'line'),
  32950. generatedColumn: util.getArg(aArgs, 'column')
  32951. };
  32952. // Find the section containing the generated position we're trying to map
  32953. // to an original position.
  32954. var sectionIndex = binarySearch.search(needle, this._sections,
  32955. function(needle, section) {
  32956. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  32957. if (cmp) {
  32958. return cmp;
  32959. }
  32960. return (needle.generatedColumn -
  32961. section.generatedOffset.generatedColumn);
  32962. });
  32963. var section = this._sections[sectionIndex];
  32964. if (!section) {
  32965. return {
  32966. source: null,
  32967. line: null,
  32968. column: null,
  32969. name: null
  32970. };
  32971. }
  32972. return section.consumer.originalPositionFor({
  32973. line: needle.generatedLine -
  32974. (section.generatedOffset.generatedLine - 1),
  32975. column: needle.generatedColumn -
  32976. (section.generatedOffset.generatedLine === needle.generatedLine
  32977. ? section.generatedOffset.generatedColumn - 1
  32978. : 0),
  32979. bias: aArgs.bias
  32980. });
  32981. };
  32982. /**
  32983. * Return true if we have the source content for every source in the source
  32984. * map, false otherwise.
  32985. */
  32986. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  32987. function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  32988. return this._sections.every(function (s) {
  32989. return s.consumer.hasContentsOfAllSources();
  32990. });
  32991. };
  32992. /**
  32993. * Returns the original source content. The only argument is the url of the
  32994. * original source file. Returns null if no original source content is
  32995. * available.
  32996. */
  32997. IndexedSourceMapConsumer.prototype.sourceContentFor =
  32998. function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  32999. for (var i = 0; i < this._sections.length; i++) {
  33000. var section = this._sections[i];
  33001. var content = section.consumer.sourceContentFor(aSource, true);
  33002. if (content) {
  33003. return content;
  33004. }
  33005. }
  33006. if (nullOnMissing) {
  33007. return null;
  33008. }
  33009. else {
  33010. throw new Error('"' + aSource + '" is not in the SourceMap.');
  33011. }
  33012. };
  33013. /**
  33014. * Returns the generated line and column information for the original source,
  33015. * line, and column positions provided. The only argument is an object with
  33016. * the following properties:
  33017. *
  33018. * - source: The filename of the original source.
  33019. * - line: The line number in the original source.
  33020. * - column: The column number in the original source.
  33021. *
  33022. * and an object is returned with the following properties:
  33023. *
  33024. * - line: The line number in the generated source, or null.
  33025. * - column: The column number in the generated source, or null.
  33026. */
  33027. IndexedSourceMapConsumer.prototype.generatedPositionFor =
  33028. function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  33029. for (var i = 0; i < this._sections.length; i++) {
  33030. var section = this._sections[i];
  33031. // Only consider this section if the requested source is in the list of
  33032. // sources of the consumer.
  33033. if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
  33034. continue;
  33035. }
  33036. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  33037. if (generatedPosition) {
  33038. var ret = {
  33039. line: generatedPosition.line +
  33040. (section.generatedOffset.generatedLine - 1),
  33041. column: generatedPosition.column +
  33042. (section.generatedOffset.generatedLine === generatedPosition.line
  33043. ? section.generatedOffset.generatedColumn - 1
  33044. : 0)
  33045. };
  33046. return ret;
  33047. }
  33048. }
  33049. return {
  33050. line: null,
  33051. column: null
  33052. };
  33053. };
  33054. /**
  33055. * Parse the mappings in a string in to a data structure which we can easily
  33056. * query (the ordered arrays in the `this.__generatedMappings` and
  33057. * `this.__originalMappings` properties).
  33058. */
  33059. IndexedSourceMapConsumer.prototype._parseMappings =
  33060. function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  33061. this.__generatedMappings = [];
  33062. this.__originalMappings = [];
  33063. for (var i = 0; i < this._sections.length; i++) {
  33064. var section = this._sections[i];
  33065. var sectionMappings = section.consumer._generatedMappings;
  33066. for (var j = 0; j < sectionMappings.length; j++) {
  33067. var mapping = sectionMappings[j];
  33068. var source = section.consumer._sources.at(mapping.source);
  33069. if (section.consumer.sourceRoot !== null) {
  33070. source = util.join(section.consumer.sourceRoot, source);
  33071. }
  33072. this._sources.add(source);
  33073. source = this._sources.indexOf(source);
  33074. var name = section.consumer._names.at(mapping.name);
  33075. this._names.add(name);
  33076. name = this._names.indexOf(name);
  33077. // The mappings coming from the consumer for the section have
  33078. // generated positions relative to the start of the section, so we
  33079. // need to offset them to be relative to the start of the concatenated
  33080. // generated file.
  33081. var adjustedMapping = {
  33082. source: source,
  33083. generatedLine: mapping.generatedLine +
  33084. (section.generatedOffset.generatedLine - 1),
  33085. generatedColumn: mapping.generatedColumn +
  33086. (section.generatedOffset.generatedLine === mapping.generatedLine
  33087. ? section.generatedOffset.generatedColumn - 1
  33088. : 0),
  33089. originalLine: mapping.originalLine,
  33090. originalColumn: mapping.originalColumn,
  33091. name: name
  33092. };
  33093. this.__generatedMappings.push(adjustedMapping);
  33094. if (typeof adjustedMapping.originalLine === 'number') {
  33095. this.__originalMappings.push(adjustedMapping);
  33096. }
  33097. }
  33098. }
  33099. quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
  33100. quickSort(this.__originalMappings, util.compareByOriginalPositions);
  33101. };
  33102. exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  33103. /***/ }),
  33104. /* 208 */
  33105. /***/ (function(module, exports, __webpack_require__) {
  33106. /* -*- Mode: js; js-indent-level: 2; -*- */
  33107. /*
  33108. * Copyright 2011 Mozilla Foundation and contributors
  33109. * Licensed under the New BSD license. See LICENSE or:
  33110. * http://opensource.org/licenses/BSD-3-Clause
  33111. */
  33112. var SourceMapGenerator = __webpack_require__(101).SourceMapGenerator;
  33113. var util = __webpack_require__(17);
  33114. // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  33115. // operating systems these days (capturing the result).
  33116. var REGEX_NEWLINE = /(\r?\n)/;
  33117. // Newline character code for charCodeAt() comparisons
  33118. var NEWLINE_CODE = 10;
  33119. // Private symbol for identifying `SourceNode`s when multiple versions of
  33120. // the source-map library are loaded. This MUST NOT CHANGE across
  33121. // versions!
  33122. var isSourceNode = "$$$isSourceNode$$$";
  33123. /**
  33124. * SourceNodes provide a way to abstract over interpolating/concatenating
  33125. * snippets of generated JavaScript source code while maintaining the line and
  33126. * column information associated with the original source code.
  33127. *
  33128. * @param aLine The original line number.
  33129. * @param aColumn The original column number.
  33130. * @param aSource The original source's filename.
  33131. * @param aChunks Optional. An array of strings which are snippets of
  33132. * generated JS, or other SourceNodes.
  33133. * @param aName The original identifier.
  33134. */
  33135. function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  33136. this.children = [];
  33137. this.sourceContents = {};
  33138. this.line = aLine == null ? null : aLine;
  33139. this.column = aColumn == null ? null : aColumn;
  33140. this.source = aSource == null ? null : aSource;
  33141. this.name = aName == null ? null : aName;
  33142. this[isSourceNode] = true;
  33143. if (aChunks != null) this.add(aChunks);
  33144. }
  33145. /**
  33146. * Creates a SourceNode from generated code and a SourceMapConsumer.
  33147. *
  33148. * @param aGeneratedCode The generated code
  33149. * @param aSourceMapConsumer The SourceMap for the generated code
  33150. * @param aRelativePath Optional. The path that relative sources in the
  33151. * SourceMapConsumer should be relative to.
  33152. */
  33153. SourceNode.fromStringWithSourceMap =
  33154. function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  33155. // The SourceNode we want to fill with the generated code
  33156. // and the SourceMap
  33157. var node = new SourceNode();
  33158. // All even indices of this array are one line of the generated code,
  33159. // while all odd indices are the newlines between two adjacent lines
  33160. // (since `REGEX_NEWLINE` captures its match).
  33161. // Processed fragments are removed from this array, by calling `shiftNextLine`.
  33162. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  33163. var shiftNextLine = function() {
  33164. var lineContents = remainingLines.shift();
  33165. // The last line of a file might not have a newline.
  33166. var newLine = remainingLines.shift() || "";
  33167. return lineContents + newLine;
  33168. };
  33169. // We need to remember the position of "remainingLines"
  33170. var lastGeneratedLine = 1, lastGeneratedColumn = 0;
  33171. // The generate SourceNodes we need a code range.
  33172. // To extract it current and last mapping is used.
  33173. // Here we store the last mapping.
  33174. var lastMapping = null;
  33175. aSourceMapConsumer.eachMapping(function (mapping) {
  33176. if (lastMapping !== null) {
  33177. // We add the code from "lastMapping" to "mapping":
  33178. // First check if there is a new line in between.
  33179. if (lastGeneratedLine < mapping.generatedLine) {
  33180. // Associate first line with "lastMapping"
  33181. addMappingWithCode(lastMapping, shiftNextLine());
  33182. lastGeneratedLine++;
  33183. lastGeneratedColumn = 0;
  33184. // The remaining code is added without mapping
  33185. } else {
  33186. // There is no new line in between.
  33187. // Associate the code between "lastGeneratedColumn" and
  33188. // "mapping.generatedColumn" with "lastMapping"
  33189. var nextLine = remainingLines[0];
  33190. var code = nextLine.substr(0, mapping.generatedColumn -
  33191. lastGeneratedColumn);
  33192. remainingLines[0] = nextLine.substr(mapping.generatedColumn -
  33193. lastGeneratedColumn);
  33194. lastGeneratedColumn = mapping.generatedColumn;
  33195. addMappingWithCode(lastMapping, code);
  33196. // No more remaining code, continue
  33197. lastMapping = mapping;
  33198. return;
  33199. }
  33200. }
  33201. // We add the generated code until the first mapping
  33202. // to the SourceNode without any mapping.
  33203. // Each line is added as separate string.
  33204. while (lastGeneratedLine < mapping.generatedLine) {
  33205. node.add(shiftNextLine());
  33206. lastGeneratedLine++;
  33207. }
  33208. if (lastGeneratedColumn < mapping.generatedColumn) {
  33209. var nextLine = remainingLines[0];
  33210. node.add(nextLine.substr(0, mapping.generatedColumn));
  33211. remainingLines[0] = nextLine.substr(mapping.generatedColumn);
  33212. lastGeneratedColumn = mapping.generatedColumn;
  33213. }
  33214. lastMapping = mapping;
  33215. }, this);
  33216. // We have processed all mappings.
  33217. if (remainingLines.length > 0) {
  33218. if (lastMapping) {
  33219. // Associate the remaining code in the current line with "lastMapping"
  33220. addMappingWithCode(lastMapping, shiftNextLine());
  33221. }
  33222. // and add the remaining lines without any mapping
  33223. node.add(remainingLines.join(""));
  33224. }
  33225. // Copy sourcesContent into SourceNode
  33226. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  33227. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  33228. if (content != null) {
  33229. if (aRelativePath != null) {
  33230. sourceFile = util.join(aRelativePath, sourceFile);
  33231. }
  33232. node.setSourceContent(sourceFile, content);
  33233. }
  33234. });
  33235. return node;
  33236. function addMappingWithCode(mapping, code) {
  33237. if (mapping === null || mapping.source === undefined) {
  33238. node.add(code);
  33239. } else {
  33240. var source = aRelativePath
  33241. ? util.join(aRelativePath, mapping.source)
  33242. : mapping.source;
  33243. node.add(new SourceNode(mapping.originalLine,
  33244. mapping.originalColumn,
  33245. source,
  33246. code,
  33247. mapping.name));
  33248. }
  33249. }
  33250. };
  33251. /**
  33252. * Add a chunk of generated JS to this source node.
  33253. *
  33254. * @param aChunk A string snippet of generated JS code, another instance of
  33255. * SourceNode, or an array where each member is one of those things.
  33256. */
  33257. SourceNode.prototype.add = function SourceNode_add(aChunk) {
  33258. if (Array.isArray(aChunk)) {
  33259. aChunk.forEach(function (chunk) {
  33260. this.add(chunk);
  33261. }, this);
  33262. }
  33263. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  33264. if (aChunk) {
  33265. this.children.push(aChunk);
  33266. }
  33267. }
  33268. else {
  33269. throw new TypeError(
  33270. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  33271. );
  33272. }
  33273. return this;
  33274. };
  33275. /**
  33276. * Add a chunk of generated JS to the beginning of this source node.
  33277. *
  33278. * @param aChunk A string snippet of generated JS code, another instance of
  33279. * SourceNode, or an array where each member is one of those things.
  33280. */
  33281. SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  33282. if (Array.isArray(aChunk)) {
  33283. for (var i = aChunk.length-1; i >= 0; i--) {
  33284. this.prepend(aChunk[i]);
  33285. }
  33286. }
  33287. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  33288. this.children.unshift(aChunk);
  33289. }
  33290. else {
  33291. throw new TypeError(
  33292. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  33293. );
  33294. }
  33295. return this;
  33296. };
  33297. /**
  33298. * Walk over the tree of JS snippets in this node and its children. The
  33299. * walking function is called once for each snippet of JS and is passed that
  33300. * snippet and the its original associated source's line/column location.
  33301. *
  33302. * @param aFn The traversal function.
  33303. */
  33304. SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  33305. var chunk;
  33306. for (var i = 0, len = this.children.length; i < len; i++) {
  33307. chunk = this.children[i];
  33308. if (chunk[isSourceNode]) {
  33309. chunk.walk(aFn);
  33310. }
  33311. else {
  33312. if (chunk !== '') {
  33313. aFn(chunk, { source: this.source,
  33314. line: this.line,
  33315. column: this.column,
  33316. name: this.name });
  33317. }
  33318. }
  33319. }
  33320. };
  33321. /**
  33322. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  33323. * each of `this.children`.
  33324. *
  33325. * @param aSep The separator.
  33326. */
  33327. SourceNode.prototype.join = function SourceNode_join(aSep) {
  33328. var newChildren;
  33329. var i;
  33330. var len = this.children.length;
  33331. if (len > 0) {
  33332. newChildren = [];
  33333. for (i = 0; i < len-1; i++) {
  33334. newChildren.push(this.children[i]);
  33335. newChildren.push(aSep);
  33336. }
  33337. newChildren.push(this.children[i]);
  33338. this.children = newChildren;
  33339. }
  33340. return this;
  33341. };
  33342. /**
  33343. * Call String.prototype.replace on the very right-most source snippet. Useful
  33344. * for trimming whitespace from the end of a source node, etc.
  33345. *
  33346. * @param aPattern The pattern to replace.
  33347. * @param aReplacement The thing to replace the pattern with.
  33348. */
  33349. SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  33350. var lastChild = this.children[this.children.length - 1];
  33351. if (lastChild[isSourceNode]) {
  33352. lastChild.replaceRight(aPattern, aReplacement);
  33353. }
  33354. else if (typeof lastChild === 'string') {
  33355. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  33356. }
  33357. else {
  33358. this.children.push(''.replace(aPattern, aReplacement));
  33359. }
  33360. return this;
  33361. };
  33362. /**
  33363. * Set the source content for a source file. This will be added to the SourceMapGenerator
  33364. * in the sourcesContent field.
  33365. *
  33366. * @param aSourceFile The filename of the source file
  33367. * @param aSourceContent The content of the source file
  33368. */
  33369. SourceNode.prototype.setSourceContent =
  33370. function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  33371. this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  33372. };
  33373. /**
  33374. * Walk over the tree of SourceNodes. The walking function is called for each
  33375. * source file content and is passed the filename and source content.
  33376. *
  33377. * @param aFn The traversal function.
  33378. */
  33379. SourceNode.prototype.walkSourceContents =
  33380. function SourceNode_walkSourceContents(aFn) {
  33381. for (var i = 0, len = this.children.length; i < len; i++) {
  33382. if (this.children[i][isSourceNode]) {
  33383. this.children[i].walkSourceContents(aFn);
  33384. }
  33385. }
  33386. var sources = Object.keys(this.sourceContents);
  33387. for (var i = 0, len = sources.length; i < len; i++) {
  33388. aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  33389. }
  33390. };
  33391. /**
  33392. * Return the string representation of this source node. Walks over the tree
  33393. * and concatenates all the various snippets together to one string.
  33394. */
  33395. SourceNode.prototype.toString = function SourceNode_toString() {
  33396. var str = "";
  33397. this.walk(function (chunk) {
  33398. str += chunk;
  33399. });
  33400. return str;
  33401. };
  33402. /**
  33403. * Returns the string representation of this source node along with a source
  33404. * map.
  33405. */
  33406. SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  33407. var generated = {
  33408. code: "",
  33409. line: 1,
  33410. column: 0
  33411. };
  33412. var map = new SourceMapGenerator(aArgs);
  33413. var sourceMappingActive = false;
  33414. var lastOriginalSource = null;
  33415. var lastOriginalLine = null;
  33416. var lastOriginalColumn = null;
  33417. var lastOriginalName = null;
  33418. this.walk(function (chunk, original) {
  33419. generated.code += chunk;
  33420. if (original.source !== null
  33421. && original.line !== null
  33422. && original.column !== null) {
  33423. if(lastOriginalSource !== original.source
  33424. || lastOriginalLine !== original.line
  33425. || lastOriginalColumn !== original.column
  33426. || lastOriginalName !== original.name) {
  33427. map.addMapping({
  33428. source: original.source,
  33429. original: {
  33430. line: original.line,
  33431. column: original.column
  33432. },
  33433. generated: {
  33434. line: generated.line,
  33435. column: generated.column
  33436. },
  33437. name: original.name
  33438. });
  33439. }
  33440. lastOriginalSource = original.source;
  33441. lastOriginalLine = original.line;
  33442. lastOriginalColumn = original.column;
  33443. lastOriginalName = original.name;
  33444. sourceMappingActive = true;
  33445. } else if (sourceMappingActive) {
  33446. map.addMapping({
  33447. generated: {
  33448. line: generated.line,
  33449. column: generated.column
  33450. }
  33451. });
  33452. lastOriginalSource = null;
  33453. sourceMappingActive = false;
  33454. }
  33455. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  33456. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  33457. generated.line++;
  33458. generated.column = 0;
  33459. // Mappings end at eol
  33460. if (idx + 1 === length) {
  33461. lastOriginalSource = null;
  33462. sourceMappingActive = false;
  33463. } else if (sourceMappingActive) {
  33464. map.addMapping({
  33465. source: original.source,
  33466. original: {
  33467. line: original.line,
  33468. column: original.column
  33469. },
  33470. generated: {
  33471. line: generated.line,
  33472. column: generated.column
  33473. },
  33474. name: original.name
  33475. });
  33476. }
  33477. } else {
  33478. generated.column++;
  33479. }
  33480. }
  33481. });
  33482. this.walkSourceContents(function (sourceFile, sourceContent) {
  33483. map.setSourceContent(sourceFile, sourceContent);
  33484. });
  33485. return { code: generated.code, map: map };
  33486. };
  33487. exports.SourceNode = SourceNode;
  33488. /***/ }),
  33489. /* 209 */
  33490. /***/ (function(module, exports, __webpack_require__) {
  33491. "use strict";
  33492. /*!
  33493. * strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
  33494. *
  33495. * Copyright (c) 2015, 2017, Jon Schlinkert.
  33496. * Released under the MIT License.
  33497. */
  33498. module.exports = function(str) {
  33499. if (typeof str === 'string' && str.charAt(0) === '\ufeff') {
  33500. return str.slice(1);
  33501. }
  33502. return str;
  33503. };
  33504. /***/ }),
  33505. /* 210 */
  33506. /***/ (function(module, exports, __webpack_require__) {
  33507. "use strict";
  33508. module.exports = false;
  33509. /***/ }),
  33510. /* 211 */
  33511. /***/ (function(module, exports) {
  33512. if (typeof Object.create === 'function') {
  33513. // implementation from standard node.js 'util' module
  33514. module.exports = function inherits(ctor, superCtor) {
  33515. ctor.super_ = superCtor
  33516. ctor.prototype = Object.create(superCtor.prototype, {
  33517. constructor: {
  33518. value: ctor,
  33519. enumerable: false,
  33520. writable: true,
  33521. configurable: true
  33522. }
  33523. });
  33524. };
  33525. } else {
  33526. // old school shim for old browsers
  33527. module.exports = function inherits(ctor, superCtor) {
  33528. ctor.super_ = superCtor
  33529. var TempCtor = function () {}
  33530. TempCtor.prototype = superCtor.prototype
  33531. ctor.prototype = new TempCtor()
  33532. ctor.prototype.constructor = ctor
  33533. }
  33534. }
  33535. /***/ }),
  33536. /* 212 */
  33537. /***/ (function(module, exports) {
  33538. module.exports = function isBuffer(arg) {
  33539. return arg && typeof arg === 'object'
  33540. && typeof arg.copy === 'function'
  33541. && typeof arg.fill === 'function'
  33542. && typeof arg.readUInt8 === 'function';
  33543. }
  33544. /***/ }),
  33545. /* 213 */
  33546. /***/ (function(module, exports, __webpack_require__) {
  33547. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  33548. //
  33549. // Permission is hereby granted, free of charge, to any person obtaining a
  33550. // copy of this software and associated documentation files (the
  33551. // "Software"), to deal in the Software without restriction, including
  33552. // without limitation the rights to use, copy, modify, merge, publish,
  33553. // distribute, sublicense, and/or sell copies of the Software, and to permit
  33554. // persons to whom the Software is furnished to do so, subject to the
  33555. // following conditions:
  33556. //
  33557. // The above copyright notice and this permission notice shall be included
  33558. // in all copies or substantial portions of the Software.
  33559. //
  33560. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  33561. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  33562. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  33563. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  33564. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  33565. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  33566. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  33567. var formatRegExp = /%[sdj%]/g;
  33568. exports.format = function(f) {
  33569. if (!isString(f)) {
  33570. var objects = [];
  33571. for (var i = 0; i < arguments.length; i++) {
  33572. objects.push(inspect(arguments[i]));
  33573. }
  33574. return objects.join(' ');
  33575. }
  33576. var i = 1;
  33577. var args = arguments;
  33578. var len = args.length;
  33579. var str = String(f).replace(formatRegExp, function(x) {
  33580. if (x === '%%') return '%';
  33581. if (i >= len) return x;
  33582. switch (x) {
  33583. case '%s': return String(args[i++]);
  33584. case '%d': return Number(args[i++]);
  33585. case '%j':
  33586. try {
  33587. return JSON.stringify(args[i++]);
  33588. } catch (_) {
  33589. return '[Circular]';
  33590. }
  33591. default:
  33592. return x;
  33593. }
  33594. });
  33595. for (var x = args[i]; i < len; x = args[++i]) {
  33596. if (isNull(x) || !isObject(x)) {
  33597. str += ' ' + x;
  33598. } else {
  33599. str += ' ' + inspect(x);
  33600. }
  33601. }
  33602. return str;
  33603. };
  33604. // Mark that a method should not be used.
  33605. // Returns a modified function which warns once by default.
  33606. // If --no-deprecation is set, then it is a no-op.
  33607. exports.deprecate = function(fn, msg) {
  33608. // Allow for deprecating things in the process of starting up.
  33609. if (isUndefined(global.process)) {
  33610. return function() {
  33611. return exports.deprecate(fn, msg).apply(this, arguments);
  33612. };
  33613. }
  33614. if (process.noDeprecation === true) {
  33615. return fn;
  33616. }
  33617. var warned = false;
  33618. function deprecated() {
  33619. if (!warned) {
  33620. if (process.throwDeprecation) {
  33621. throw new Error(msg);
  33622. } else if (process.traceDeprecation) {
  33623. console.trace(msg);
  33624. } else {
  33625. console.error(msg);
  33626. }
  33627. warned = true;
  33628. }
  33629. return fn.apply(this, arguments);
  33630. }
  33631. return deprecated;
  33632. };
  33633. var debugs = {};
  33634. var debugEnviron;
  33635. exports.debuglog = function(set) {
  33636. if (isUndefined(debugEnviron))
  33637. debugEnviron = process.env.NODE_DEBUG || '';
  33638. set = set.toUpperCase();
  33639. if (!debugs[set]) {
  33640. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  33641. var pid = process.pid;
  33642. debugs[set] = function() {
  33643. var msg = exports.format.apply(exports, arguments);
  33644. console.error('%s %d: %s', set, pid, msg);
  33645. };
  33646. } else {
  33647. debugs[set] = function() {};
  33648. }
  33649. }
  33650. return debugs[set];
  33651. };
  33652. /**
  33653. * Echos the value of a value. Trys to print the value out
  33654. * in the best way possible given the different types.
  33655. *
  33656. * @param {Object} obj The object to print out.
  33657. * @param {Object} opts Optional options object that alters the output.
  33658. */
  33659. /* legacy: obj, showHidden, depth, colors*/
  33660. function inspect(obj, opts) {
  33661. // default options
  33662. var ctx = {
  33663. seen: [],
  33664. stylize: stylizeNoColor
  33665. };
  33666. // legacy...
  33667. if (arguments.length >= 3) ctx.depth = arguments[2];
  33668. if (arguments.length >= 4) ctx.colors = arguments[3];
  33669. if (isBoolean(opts)) {
  33670. // legacy...
  33671. ctx.showHidden = opts;
  33672. } else if (opts) {
  33673. // got an "options" object
  33674. exports._extend(ctx, opts);
  33675. }
  33676. // set default options
  33677. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  33678. if (isUndefined(ctx.depth)) ctx.depth = 2;
  33679. if (isUndefined(ctx.colors)) ctx.colors = false;
  33680. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  33681. if (ctx.colors) ctx.stylize = stylizeWithColor;
  33682. return formatValue(ctx, obj, ctx.depth);
  33683. }
  33684. exports.inspect = inspect;
  33685. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  33686. inspect.colors = {
  33687. 'bold' : [1, 22],
  33688. 'italic' : [3, 23],
  33689. 'underline' : [4, 24],
  33690. 'inverse' : [7, 27],
  33691. 'white' : [37, 39],
  33692. 'grey' : [90, 39],
  33693. 'black' : [30, 39],
  33694. 'blue' : [34, 39],
  33695. 'cyan' : [36, 39],
  33696. 'green' : [32, 39],
  33697. 'magenta' : [35, 39],
  33698. 'red' : [31, 39],
  33699. 'yellow' : [33, 39]
  33700. };
  33701. // Don't use 'blue' not visible on cmd.exe
  33702. inspect.styles = {
  33703. 'special': 'cyan',
  33704. 'number': 'yellow',
  33705. 'boolean': 'yellow',
  33706. 'undefined': 'grey',
  33707. 'null': 'bold',
  33708. 'string': 'green',
  33709. 'date': 'magenta',
  33710. // "name": intentionally not styling
  33711. 'regexp': 'red'
  33712. };
  33713. function stylizeWithColor(str, styleType) {
  33714. var style = inspect.styles[styleType];
  33715. if (style) {
  33716. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  33717. '\u001b[' + inspect.colors[style][1] + 'm';
  33718. } else {
  33719. return str;
  33720. }
  33721. }
  33722. function stylizeNoColor(str, styleType) {
  33723. return str;
  33724. }
  33725. function arrayToHash(array) {
  33726. var hash = {};
  33727. array.forEach(function(val, idx) {
  33728. hash[val] = true;
  33729. });
  33730. return hash;
  33731. }
  33732. function formatValue(ctx, value, recurseTimes) {
  33733. // Provide a hook for user-specified inspect functions.
  33734. // Check that value is an object with an inspect function on it
  33735. if (ctx.customInspect &&
  33736. value &&
  33737. isFunction(value.inspect) &&
  33738. // Filter out the util module, it's inspect function is special
  33739. value.inspect !== exports.inspect &&
  33740. // Also filter out any prototype objects using the circular check.
  33741. !(value.constructor && value.constructor.prototype === value)) {
  33742. var ret = value.inspect(recurseTimes, ctx);
  33743. if (!isString(ret)) {
  33744. ret = formatValue(ctx, ret, recurseTimes);
  33745. }
  33746. return ret;
  33747. }
  33748. // Primitive types cannot have properties
  33749. var primitive = formatPrimitive(ctx, value);
  33750. if (primitive) {
  33751. return primitive;
  33752. }
  33753. // Look up the keys of the object.
  33754. var keys = Object.keys(value);
  33755. var visibleKeys = arrayToHash(keys);
  33756. if (ctx.showHidden) {
  33757. keys = Object.getOwnPropertyNames(value);
  33758. }
  33759. // IE doesn't make error fields non-enumerable
  33760. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  33761. if (isError(value)
  33762. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  33763. return formatError(value);
  33764. }
  33765. // Some type of object without properties can be shortcutted.
  33766. if (keys.length === 0) {
  33767. if (isFunction(value)) {
  33768. var name = value.name ? ': ' + value.name : '';
  33769. return ctx.stylize('[Function' + name + ']', 'special');
  33770. }
  33771. if (isRegExp(value)) {
  33772. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  33773. }
  33774. if (isDate(value)) {
  33775. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  33776. }
  33777. if (isError(value)) {
  33778. return formatError(value);
  33779. }
  33780. }
  33781. var base = '', array = false, braces = ['{', '}'];
  33782. // Make Array say that they are Array
  33783. if (isArray(value)) {
  33784. array = true;
  33785. braces = ['[', ']'];
  33786. }
  33787. // Make functions say that they are functions
  33788. if (isFunction(value)) {
  33789. var n = value.name ? ': ' + value.name : '';
  33790. base = ' [Function' + n + ']';
  33791. }
  33792. // Make RegExps say that they are RegExps
  33793. if (isRegExp(value)) {
  33794. base = ' ' + RegExp.prototype.toString.call(value);
  33795. }
  33796. // Make dates with properties first say the date
  33797. if (isDate(value)) {
  33798. base = ' ' + Date.prototype.toUTCString.call(value);
  33799. }
  33800. // Make error with message first say the error
  33801. if (isError(value)) {
  33802. base = ' ' + formatError(value);
  33803. }
  33804. if (keys.length === 0 && (!array || value.length == 0)) {
  33805. return braces[0] + base + braces[1];
  33806. }
  33807. if (recurseTimes < 0) {
  33808. if (isRegExp(value)) {
  33809. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  33810. } else {
  33811. return ctx.stylize('[Object]', 'special');
  33812. }
  33813. }
  33814. ctx.seen.push(value);
  33815. var output;
  33816. if (array) {
  33817. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  33818. } else {
  33819. output = keys.map(function(key) {
  33820. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  33821. });
  33822. }
  33823. ctx.seen.pop();
  33824. return reduceToSingleString(output, base, braces);
  33825. }
  33826. function formatPrimitive(ctx, value) {
  33827. if (isUndefined(value))
  33828. return ctx.stylize('undefined', 'undefined');
  33829. if (isString(value)) {
  33830. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  33831. .replace(/'/g, "\\'")
  33832. .replace(/\\"/g, '"') + '\'';
  33833. return ctx.stylize(simple, 'string');
  33834. }
  33835. if (isNumber(value))
  33836. return ctx.stylize('' + value, 'number');
  33837. if (isBoolean(value))
  33838. return ctx.stylize('' + value, 'boolean');
  33839. // For some reason typeof null is "object", so special case here.
  33840. if (isNull(value))
  33841. return ctx.stylize('null', 'null');
  33842. }
  33843. function formatError(value) {
  33844. return '[' + Error.prototype.toString.call(value) + ']';
  33845. }
  33846. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  33847. var output = [];
  33848. for (var i = 0, l = value.length; i < l; ++i) {
  33849. if (hasOwnProperty(value, String(i))) {
  33850. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  33851. String(i), true));
  33852. } else {
  33853. output.push('');
  33854. }
  33855. }
  33856. keys.forEach(function(key) {
  33857. if (!key.match(/^\d+$/)) {
  33858. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  33859. key, true));
  33860. }
  33861. });
  33862. return output;
  33863. }
  33864. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  33865. var name, str, desc;
  33866. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  33867. if (desc.get) {
  33868. if (desc.set) {
  33869. str = ctx.stylize('[Getter/Setter]', 'special');
  33870. } else {
  33871. str = ctx.stylize('[Getter]', 'special');
  33872. }
  33873. } else {
  33874. if (desc.set) {
  33875. str = ctx.stylize('[Setter]', 'special');
  33876. }
  33877. }
  33878. if (!hasOwnProperty(visibleKeys, key)) {
  33879. name = '[' + key + ']';
  33880. }
  33881. if (!str) {
  33882. if (ctx.seen.indexOf(desc.value) < 0) {
  33883. if (isNull(recurseTimes)) {
  33884. str = formatValue(ctx, desc.value, null);
  33885. } else {
  33886. str = formatValue(ctx, desc.value, recurseTimes - 1);
  33887. }
  33888. if (str.indexOf('\n') > -1) {
  33889. if (array) {
  33890. str = str.split('\n').map(function(line) {
  33891. return ' ' + line;
  33892. }).join('\n').substr(2);
  33893. } else {
  33894. str = '\n' + str.split('\n').map(function(line) {
  33895. return ' ' + line;
  33896. }).join('\n');
  33897. }
  33898. }
  33899. } else {
  33900. str = ctx.stylize('[Circular]', 'special');
  33901. }
  33902. }
  33903. if (isUndefined(name)) {
  33904. if (array && key.match(/^\d+$/)) {
  33905. return str;
  33906. }
  33907. name = JSON.stringify('' + key);
  33908. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  33909. name = name.substr(1, name.length - 2);
  33910. name = ctx.stylize(name, 'name');
  33911. } else {
  33912. name = name.replace(/'/g, "\\'")
  33913. .replace(/\\"/g, '"')
  33914. .replace(/(^"|"$)/g, "'");
  33915. name = ctx.stylize(name, 'string');
  33916. }
  33917. }
  33918. return name + ': ' + str;
  33919. }
  33920. function reduceToSingleString(output, base, braces) {
  33921. var numLinesEst = 0;
  33922. var length = output.reduce(function(prev, cur) {
  33923. numLinesEst++;
  33924. if (cur.indexOf('\n') >= 0) numLinesEst++;
  33925. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  33926. }, 0);
  33927. if (length > 60) {
  33928. return braces[0] +
  33929. (base === '' ? '' : base + '\n ') +
  33930. ' ' +
  33931. output.join(',\n ') +
  33932. ' ' +
  33933. braces[1];
  33934. }
  33935. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  33936. }
  33937. // NOTE: These type checking functions intentionally don't use `instanceof`
  33938. // because it is fragile and can be easily faked with `Object.create()`.
  33939. function isArray(ar) {
  33940. return Array.isArray(ar);
  33941. }
  33942. exports.isArray = isArray;
  33943. function isBoolean(arg) {
  33944. return typeof arg === 'boolean';
  33945. }
  33946. exports.isBoolean = isBoolean;
  33947. function isNull(arg) {
  33948. return arg === null;
  33949. }
  33950. exports.isNull = isNull;
  33951. function isNullOrUndefined(arg) {
  33952. return arg == null;
  33953. }
  33954. exports.isNullOrUndefined = isNullOrUndefined;
  33955. function isNumber(arg) {
  33956. return typeof arg === 'number';
  33957. }
  33958. exports.isNumber = isNumber;
  33959. function isString(arg) {
  33960. return typeof arg === 'string';
  33961. }
  33962. exports.isString = isString;
  33963. function isSymbol(arg) {
  33964. return typeof arg === 'symbol';
  33965. }
  33966. exports.isSymbol = isSymbol;
  33967. function isUndefined(arg) {
  33968. return arg === void 0;
  33969. }
  33970. exports.isUndefined = isUndefined;
  33971. function isRegExp(re) {
  33972. return isObject(re) && objectToString(re) === '[object RegExp]';
  33973. }
  33974. exports.isRegExp = isRegExp;
  33975. function isObject(arg) {
  33976. return typeof arg === 'object' && arg !== null;
  33977. }
  33978. exports.isObject = isObject;
  33979. function isDate(d) {
  33980. return isObject(d) && objectToString(d) === '[object Date]';
  33981. }
  33982. exports.isDate = isDate;
  33983. function isError(e) {
  33984. return isObject(e) &&
  33985. (objectToString(e) === '[object Error]' || e instanceof Error);
  33986. }
  33987. exports.isError = isError;
  33988. function isFunction(arg) {
  33989. return typeof arg === 'function';
  33990. }
  33991. exports.isFunction = isFunction;
  33992. function isPrimitive(arg) {
  33993. return arg === null ||
  33994. typeof arg === 'boolean' ||
  33995. typeof arg === 'number' ||
  33996. typeof arg === 'string' ||
  33997. typeof arg === 'symbol' || // ES6 symbol
  33998. typeof arg === 'undefined';
  33999. }
  34000. exports.isPrimitive = isPrimitive;
  34001. exports.isBuffer = __webpack_require__(212);
  34002. function objectToString(o) {
  34003. return Object.prototype.toString.call(o);
  34004. }
  34005. function pad(n) {
  34006. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  34007. }
  34008. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  34009. 'Oct', 'Nov', 'Dec'];
  34010. // 26 Feb 16:19:34
  34011. function timestamp() {
  34012. var d = new Date();
  34013. var time = [pad(d.getHours()),
  34014. pad(d.getMinutes()),
  34015. pad(d.getSeconds())].join(':');
  34016. return [d.getDate(), months[d.getMonth()], time].join(' ');
  34017. }
  34018. // log is just a thin wrapper to console.log that prepends a timestamp
  34019. exports.log = function() {
  34020. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  34021. };
  34022. /**
  34023. * Inherit the prototype methods from one constructor into another.
  34024. *
  34025. * The Function.prototype.inherits from lang.js rewritten as a standalone
  34026. * function (not on Function.prototype). NOTE: If this file is to be loaded
  34027. * during bootstrapping this function needs to be rewritten using some native
  34028. * functions as prototype setup using normal JavaScript does not work as
  34029. * expected during bootstrapping (see mirror.js in r114903).
  34030. *
  34031. * @param {function} ctor Constructor function which needs to inherit the
  34032. * prototype.
  34033. * @param {function} superCtor Constructor function to inherit prototype from.
  34034. */
  34035. exports.inherits = __webpack_require__(211);
  34036. exports._extend = function(origin, add) {
  34037. // Don't do anything if add isn't an object
  34038. if (!add || !isObject(add)) return origin;
  34039. var keys = Object.keys(add);
  34040. var i = keys.length;
  34041. while (i--) {
  34042. origin[keys[i]] = add[keys[i]];
  34043. }
  34044. return origin;
  34045. };
  34046. function hasOwnProperty(obj, prop) {
  34047. return Object.prototype.hasOwnProperty.call(obj, prop);
  34048. }
  34049. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(41), __webpack_require__(23)))
  34050. /***/ }),
  34051. /* 214 */
  34052. /***/ (function(module, exports) {
  34053. module.exports = function(module) {
  34054. if(!module.webpackPolyfill) {
  34055. module.deprecate = function() {};
  34056. module.paths = [];
  34057. // module.parent = undefined by default
  34058. if(!module.children) module.children = [];
  34059. Object.defineProperty(module, "loaded", {
  34060. enumerable: true,
  34061. get: function() {
  34062. return module.l;
  34063. }
  34064. });
  34065. Object.defineProperty(module, "id", {
  34066. enumerable: true,
  34067. get: function() {
  34068. return module.i;
  34069. }
  34070. });
  34071. module.webpackPolyfill = 1;
  34072. }
  34073. return module;
  34074. };
  34075. /***/ }),
  34076. /* 215 */
  34077. /***/ (function(module, exports, __webpack_require__) {
  34078. "use strict";
  34079. const createError = __webpack_require__(111);
  34080. const grayMatter = __webpack_require__(105);
  34081. function parseSelector(selector) {
  34082. // If there's a comment inside of a selector, the parser tries to parse
  34083. // the content of the comment as selectors which turns it into complete
  34084. // garbage. Better to print the whole selector as-is and not try to parse
  34085. // and reformat it.
  34086. if (selector.match(/\/\/|\/\*/)) {
  34087. return {
  34088. type: "selector-comment",
  34089. value: selector.replace(/^ +/, "").replace(/ +$/, "")
  34090. };
  34091. }
  34092. const selectorParser = __webpack_require__(109);
  34093. let result;
  34094. selectorParser(result_ => {
  34095. result = result_;
  34096. }).process(selector);
  34097. return addTypePrefix(result, "selector-");
  34098. }
  34099. function parseValueNodes(nodes) {
  34100. let parenGroup = {
  34101. open: null,
  34102. close: null,
  34103. groups: [],
  34104. type: "paren_group"
  34105. };
  34106. const parenGroupStack = [parenGroup];
  34107. const rootParenGroup = parenGroup;
  34108. let commaGroup = {
  34109. groups: [],
  34110. type: "comma_group"
  34111. };
  34112. const commaGroupStack = [commaGroup];
  34113. for (let i = 0; i < nodes.length; ++i) {
  34114. const node = nodes[i];
  34115. const isUnquotedDataURLCall =
  34116. node.type === "func" &&
  34117. node.value === "url" &&
  34118. node.group &&
  34119. node.group.groups &&
  34120. node.group.groups[0] &&
  34121. node.group.groups[0].groups &&
  34122. node.group.groups[0].groups.length > 2 &&
  34123. node.group.groups[0].groups[0].type === "word" &&
  34124. node.group.groups[0].groups[0].value === "data" &&
  34125. node.group.groups[0].groups[1].type === "colon" &&
  34126. node.group.groups[0].groups[1].value === ":";
  34127. if (isUnquotedDataURLCall) {
  34128. node.group.groups = [stringifyGroup(node)];
  34129. }
  34130. if (node.type === "paren" && node.value === "(") {
  34131. parenGroup = {
  34132. open: node,
  34133. close: null,
  34134. groups: [],
  34135. type: "paren_group"
  34136. };
  34137. parenGroupStack.push(parenGroup);
  34138. commaGroup = {
  34139. groups: [],
  34140. type: "comma_group"
  34141. };
  34142. commaGroupStack.push(commaGroup);
  34143. } else if (node.type === "paren" && node.value === ")") {
  34144. if (commaGroup.groups.length) {
  34145. parenGroup.groups.push(commaGroup);
  34146. }
  34147. parenGroup.close = node;
  34148. if (commaGroupStack.length === 1) {
  34149. throw new Error("Unbalanced parenthesis");
  34150. }
  34151. commaGroupStack.pop();
  34152. commaGroup = commaGroupStack[commaGroupStack.length - 1];
  34153. commaGroup.groups.push(parenGroup);
  34154. parenGroupStack.pop();
  34155. parenGroup = parenGroupStack[parenGroupStack.length - 1];
  34156. } else if (node.type === "comma") {
  34157. parenGroup.groups.push(commaGroup);
  34158. commaGroup = {
  34159. groups: [],
  34160. type: "comma_group"
  34161. };
  34162. commaGroupStack[commaGroupStack.length - 1] = commaGroup;
  34163. } else {
  34164. commaGroup.groups.push(node);
  34165. }
  34166. }
  34167. if (commaGroup.groups.length > 0) {
  34168. parenGroup.groups.push(commaGroup);
  34169. }
  34170. return rootParenGroup;
  34171. }
  34172. function stringifyGroup(node) {
  34173. if (node.group) {
  34174. return stringifyGroup(node.group);
  34175. }
  34176. if (node.groups) {
  34177. return node.groups.reduce((previousValue, currentValue, index) => {
  34178. return (
  34179. previousValue +
  34180. stringifyGroup(currentValue) +
  34181. (currentValue.type === "comma_group" && index !== node.groups.length - 1
  34182. ? ","
  34183. : "")
  34184. );
  34185. }, "");
  34186. }
  34187. const before = node.raws && node.raws.before ? node.raws.before : "";
  34188. const value = node.value ? node.value : "";
  34189. const unit = node.unit ? node.unit : "";
  34190. const after = node.raws && node.raws.after ? node.raws.after : "";
  34191. return before + value + unit + after;
  34192. }
  34193. function flattenGroups(node) {
  34194. if (
  34195. node.type === "paren_group" &&
  34196. !node.open &&
  34197. !node.close &&
  34198. node.groups.length === 1
  34199. ) {
  34200. return flattenGroups(node.groups[0]);
  34201. }
  34202. if (node.type === "comma_group" && node.groups.length === 1) {
  34203. return flattenGroups(node.groups[0]);
  34204. }
  34205. if (node.type === "paren_group" || node.type === "comma_group") {
  34206. return Object.assign({}, node, { groups: node.groups.map(flattenGroups) });
  34207. }
  34208. return node;
  34209. }
  34210. function addTypePrefix(node, prefix) {
  34211. if (node && typeof node === "object") {
  34212. delete node.parent;
  34213. for (const key in node) {
  34214. addTypePrefix(node[key], prefix);
  34215. if (key === "type" && typeof node[key] === "string") {
  34216. if (!node[key].startsWith(prefix)) {
  34217. node[key] = prefix + node[key];
  34218. }
  34219. }
  34220. }
  34221. }
  34222. return node;
  34223. }
  34224. function addMissingType(node) {
  34225. if (node && typeof node === "object") {
  34226. delete node.parent;
  34227. for (const key in node) {
  34228. addMissingType(node[key]);
  34229. }
  34230. if (!Array.isArray(node) && node.value && !node.type) {
  34231. node.type = "unknown";
  34232. }
  34233. }
  34234. return node;
  34235. }
  34236. function parseNestedValue(node) {
  34237. if (node && typeof node === "object") {
  34238. delete node.parent;
  34239. for (const key in node) {
  34240. parseNestedValue(node[key]);
  34241. if (key === "nodes") {
  34242. node.group = flattenGroups(parseValueNodes(node[key]));
  34243. delete node[key];
  34244. }
  34245. }
  34246. }
  34247. return node;
  34248. }
  34249. function parseValue(value) {
  34250. const valueParser = __webpack_require__(110);
  34251. const result = valueParser(value, { loose: true }).parse();
  34252. const parsedResult = parseNestedValue(result);
  34253. return addTypePrefix(parsedResult, "value-");
  34254. }
  34255. function parseMediaQuery(value) {
  34256. const mediaParser = __webpack_require__(107).default;
  34257. const result = addMissingType(mediaParser(value));
  34258. return addTypePrefix(result, "media-");
  34259. }
  34260. const DEFAULT_SCSS_DIRECTIVE = /(\s*?)(!default).*$/;
  34261. const GLOBAL_SCSS_DIRECTIVE = /(\s*?)(!global).*$/;
  34262. function parseNestedCSS(node) {
  34263. if (node && typeof node === "object") {
  34264. delete node.parent;
  34265. for (const key in node) {
  34266. parseNestedCSS(node[key]);
  34267. }
  34268. if (!node.type) {
  34269. return node;
  34270. }
  34271. if (!node.raws) {
  34272. node.raws = {};
  34273. }
  34274. let selector = "";
  34275. if (typeof node.selector === "string") {
  34276. selector =
  34277. node.raws.selector && node.raws.selector.raw
  34278. ? node.raws.selector.raw
  34279. : node.selector;
  34280. if (node.raws.between && node.raws.between.trim().length > 0) {
  34281. selector += node.raws.between;
  34282. }
  34283. node.raws.selector = selector;
  34284. }
  34285. let value = "";
  34286. if (typeof node.value === "string") {
  34287. value =
  34288. node.raws.value && node.raws.value.raw
  34289. ? node.raws.value.raw
  34290. : node.value;
  34291. value = value.trim();
  34292. node.raws.value = selector;
  34293. }
  34294. let params = "";
  34295. if (typeof node.params === "string") {
  34296. params =
  34297. node.raws.params && node.raws.params.raw
  34298. ? node.raws.params.raw
  34299. : node.params;
  34300. if (node.raws.afterName && node.raws.afterName.trim().length > 0) {
  34301. params = node.raws.afterName + params;
  34302. }
  34303. if (node.raws.between && node.raws.between.trim().length > 0) {
  34304. params = params + node.raws.between;
  34305. }
  34306. params = params.trim();
  34307. node.raws.params = params;
  34308. }
  34309. // Ignore LESS mixin declaration
  34310. if (selector.trim().length > 0) {
  34311. if (selector.startsWith("@") && selector.endsWith(":")) {
  34312. return node;
  34313. }
  34314. // Ignore LESS mixins
  34315. if (node.mixin) {
  34316. node.selector = parseValue(selector);
  34317. return node;
  34318. }
  34319. try {
  34320. node.selector = parseSelector(selector);
  34321. } catch (e) {
  34322. // Fail silently. It's better to print it as is than to try and parse it
  34323. // Note: A common failure is for SCSS nested properties. `background:
  34324. // none { color: red; }` is parsed as a NestedDeclaration by
  34325. // postcss-scss, while `background: { color: red; }` is parsed as a Rule
  34326. // with a selector ending with a colon. See:
  34327. // https://github.com/postcss/postcss-scss/issues/39
  34328. node.selector = {
  34329. type: "selector-root-invalid",
  34330. value: selector
  34331. };
  34332. }
  34333. return node;
  34334. }
  34335. if (node.type !== "css-comment-yaml" && value.length > 0) {
  34336. try {
  34337. const defaultSCSSDirectiveIndex = value.match(DEFAULT_SCSS_DIRECTIVE);
  34338. if (defaultSCSSDirectiveIndex) {
  34339. value = value.substring(0, defaultSCSSDirectiveIndex.index);
  34340. node.scssDefault = true;
  34341. if (defaultSCSSDirectiveIndex[0].trim() !== "!default") {
  34342. node.raws.scssDefault = defaultSCSSDirectiveIndex[0];
  34343. }
  34344. }
  34345. const globalSCSSDirectiveIndex = value.match(GLOBAL_SCSS_DIRECTIVE);
  34346. if (globalSCSSDirectiveIndex) {
  34347. value = value.substring(0, globalSCSSDirectiveIndex.index);
  34348. node.scssGlobal = true;
  34349. if (globalSCSSDirectiveIndex[0].trim() !== "!global") {
  34350. node.raws.scssGlobal = globalSCSSDirectiveIndex[0];
  34351. }
  34352. }
  34353. if (value.startsWith("progid:")) {
  34354. return node;
  34355. }
  34356. node.value = parseValue(value);
  34357. } catch (e) {
  34358. throw createError(
  34359. "(postcss-values-parser) " + e.toString(),
  34360. node.source
  34361. );
  34362. }
  34363. return node;
  34364. }
  34365. if (node.type === "css-atrule" && params.length > 0) {
  34366. const name = node.name;
  34367. const lowercasedName = node.name.toLowerCase();
  34368. if (name === "warn" || name === "error") {
  34369. node.params = {
  34370. type: "media-unknown",
  34371. value: params
  34372. };
  34373. return node;
  34374. }
  34375. if (name === "extend" || name === "nest") {
  34376. node.selector = parseSelector(params);
  34377. delete node.params;
  34378. return node;
  34379. }
  34380. if (name === "at-root") {
  34381. if (/^\(\s*(without|with)\s*:[\s\S]+\)$/.test(params)) {
  34382. node.params = parseMediaQuery(params);
  34383. } else {
  34384. node.selector = parseSelector(params);
  34385. delete node.params;
  34386. }
  34387. return node;
  34388. }
  34389. if (
  34390. [
  34391. "if",
  34392. "else",
  34393. "for",
  34394. "each",
  34395. "while",
  34396. "debug",
  34397. "mixin",
  34398. "include",
  34399. "function",
  34400. "return",
  34401. "define-mixin",
  34402. "add-mixin"
  34403. ].indexOf(name) !== -1
  34404. ) {
  34405. // Remove unnecessary spaces in SCSS variable arguments
  34406. params = params.replace(/(\$\S+?)\s+?\.\.\./, "$1...");
  34407. // Remove unnecessary spaces before SCSS control, mixin and function directives
  34408. params = params.replace(/^(?!if)(\S+)\s+\(/, "$1(");
  34409. node.value = parseValue(params);
  34410. delete node.params;
  34411. return node;
  34412. }
  34413. if (name === "custom-selector") {
  34414. const customSelector = params.match(/:--\S+?\s+/)[0].trim();
  34415. node.customSelector = customSelector;
  34416. node.selector = parseSelector(params.substring(customSelector.length));
  34417. delete node.params;
  34418. return node;
  34419. }
  34420. if (
  34421. ["namespace", "import", "media", "supports", "custom-media"].indexOf(
  34422. lowercasedName
  34423. ) !== -1
  34424. ) {
  34425. if (params.includes("#{")) {
  34426. // Workaround for media at rule with scss interpolation
  34427. return {
  34428. type: "media-unknown",
  34429. value: params
  34430. };
  34431. }
  34432. node.params = parseMediaQuery(params);
  34433. return node;
  34434. }
  34435. node.params = params;
  34436. return node;
  34437. }
  34438. }
  34439. return node;
  34440. }
  34441. function parseWithParser(parser, text, frontMatter) {
  34442. let result;
  34443. try {
  34444. result = parser.parse(text);
  34445. } catch (e) {
  34446. if (typeof e.line !== "number") {
  34447. throw e;
  34448. }
  34449. throw createError("(postcss) " + e.name + " " + e.reason, { start: e });
  34450. }
  34451. if (Object.keys(frontMatter.data).length > 0) {
  34452. result.nodes.unshift({
  34453. type: "comment-yaml",
  34454. value: grayMatter.stringify("", frontMatter.data).replace(/\s$/, "")
  34455. });
  34456. }
  34457. const prefixedResult = addTypePrefix(result, "css-");
  34458. const parsedResult = parseNestedCSS(prefixedResult);
  34459. return parsedResult;
  34460. }
  34461. function requireParser(isSCSS) {
  34462. if (isSCSS) {
  34463. return __webpack_require__(108);
  34464. }
  34465. // TODO: Remove this hack when this issue is fixed:
  34466. // https://github.com/shellscape/postcss-less/issues/88
  34467. const LessParser = __webpack_require__(42);
  34468. LessParser.prototype.atrule = function() {
  34469. return Object.getPrototypeOf(LessParser.prototype).atrule.apply(
  34470. this,
  34471. arguments
  34472. );
  34473. };
  34474. return __webpack_require__(106);
  34475. }
  34476. const IS_POSSIBLY_SCSS = /(\w\s*: [^}:]+|#){|@import[^\n]+(url|,)/;
  34477. function parse(text, parsers, opts) {
  34478. const hasExplicitParserChoice =
  34479. opts.parser === "less" || opts.parser === "scss";
  34480. const isSCSS = hasExplicitParserChoice
  34481. ? opts.parser === "scss"
  34482. : IS_POSSIBLY_SCSS.test(text);
  34483. const frontMatter = grayMatter(text);
  34484. const normalizedText = frontMatter.content;
  34485. try {
  34486. return parseWithParser(requireParser(isSCSS), normalizedText, frontMatter);
  34487. } catch (originalError) {
  34488. if (hasExplicitParserChoice) {
  34489. throw originalError;
  34490. }
  34491. try {
  34492. return parseWithParser(
  34493. requireParser(!isSCSS),
  34494. normalizedText,
  34495. frontMatter
  34496. );
  34497. } catch (_secondError) {
  34498. throw originalError;
  34499. }
  34500. }
  34501. }
  34502. module.exports = parse;
  34503. /***/ }),
  34504. /* 216 */
  34505. /***/ (function(module, exports) {
  34506. /* (ignored) */
  34507. /***/ }),
  34508. /* 217 */
  34509. /***/ (function(module, exports) {
  34510. /* (ignored) */
  34511. /***/ }),
  34512. /* 218 */
  34513. /***/ (function(module, exports) {
  34514. /* (ignored) */
  34515. /***/ }),
  34516. /* 219 */
  34517. /***/ (function(module, exports) {
  34518. /* (ignored) */
  34519. /***/ })
  34520. /******/ ]);