123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197 |
- window["simulate"] =
- (function(modules) {
-
- var installedModules = {};
-
- function __webpack_require__(moduleId) {
-
- if(installedModules[moduleId]) {
- return installedModules[moduleId].exports;
- }
-
- var module = installedModules[moduleId] = {
- i: moduleId,
- l: false,
- exports: {}
- };
-
- modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
- module.l = true;
-
- return module.exports;
- }
-
- __webpack_require__.m = modules;
-
- __webpack_require__.c = installedModules;
-
- __webpack_require__.d = function(exports, name, getter) {
- if(!__webpack_require__.o(exports, name)) {
- Object.defineProperty(exports, name, { enumerable: true, get: getter });
- }
- };
-
- __webpack_require__.r = function(exports) {
- if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- }
- Object.defineProperty(exports, '__esModule', { value: true });
- };
-
-
-
-
-
- __webpack_require__.t = function(value, mode) {
- if(mode & 1) value = __webpack_require__(value);
- if(mode & 8) return value;
- if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- var ns = Object.create(null);
- __webpack_require__.r(ns);
- Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- return ns;
- };
-
- __webpack_require__.n = function(module) {
- var getter = module && module.__esModule ?
- function getDefault() { return module['default']; } :
- function getModuleExports() { return module; };
- __webpack_require__.d(getter, 'a', getter);
- return getter;
- };
-
- __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-
- __webpack_require__.p = "";
-
- return __webpack_require__(__webpack_require__.s = 59);
- })
- ([
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(99);
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = __webpack_require__(97);
- }),
- (function(module, exports) {
- var g;
- g = (function() {
- return this;
- })();
- try {
-
- g = g || new Function("return this")();
- } catch (e) {
-
- if (typeof window === "object") g = window;
- }
- module.exports = g;
- }),
- (function(module, exports) {
- function normalizeArray(parts, allowAboveRoot) {
-
- var up = 0;
- for (var i = parts.length - 1; i >= 0; i--) {
- var last = parts[i];
- if (last === '.') {
- parts.splice(i, 1);
- } else if (last === '..') {
- parts.splice(i, 1);
- up++;
- } else if (up) {
- parts.splice(i, 1);
- up--;
- }
- }
-
- if (allowAboveRoot) {
- for (; up--; up) {
- parts.unshift('..');
- }
- }
- return parts;
- }
- exports.resolve = function() {
- var resolvedPath = '',
- resolvedAbsolute = false;
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path = (i >= 0) ? arguments[i] : process.cwd();
-
- if (typeof path !== 'string') {
- throw new TypeError('Arguments to path.resolve must be strings');
- } else if (!path) {
- continue;
- }
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
- }
-
-
-
- resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
- return !!p;
- }), !resolvedAbsolute).join('/');
- return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
- };
- exports.normalize = function(path) {
- var isAbsolute = exports.isAbsolute(path),
- trailingSlash = substr(path, -1) === '/';
-
- path = normalizeArray(filter(path.split('/'), function(p) {
- return !!p;
- }), !isAbsolute).join('/');
- if (!path && !isAbsolute) {
- path = '.';
- }
- if (path && trailingSlash) {
- path += '/';
- }
- return (isAbsolute ? '/' : '') + path;
- };
- exports.isAbsolute = function(path) {
- return path.charAt(0) === '/';
- };
- exports.join = function() {
- var paths = Array.prototype.slice.call(arguments, 0);
- return exports.normalize(filter(paths, function(p, index) {
- if (typeof p !== 'string') {
- throw new TypeError('Arguments to path.join must be strings');
- }
- return p;
- }).join('/'));
- };
- exports.relative = function(from, to) {
- from = exports.resolve(from).substr(1);
- to = exports.resolve(to).substr(1);
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
- if (start > end) return [];
- return arr.slice(start, end - start + 1);
- }
- var fromParts = trim(from.split('/'));
- var toParts = trim(to.split('/'));
- var length = Math.min(fromParts.length, toParts.length);
- var samePartsLength = length;
- for (var i = 0; i < length; i++) {
- if (fromParts[i] !== toParts[i]) {
- samePartsLength = i;
- break;
- }
- }
- var outputParts = [];
- for (var i = samePartsLength; i < fromParts.length; i++) {
- outputParts.push('..');
- }
- outputParts = outputParts.concat(toParts.slice(samePartsLength));
- return outputParts.join('/');
- };
- exports.sep = '/';
- exports.delimiter = ':';
- exports.dirname = function (path) {
- if (typeof path !== 'string') path = path + '';
- if (path.length === 0) return '.';
- var code = path.charCodeAt(0);
- var hasRoot = code === 47 ;
- var end = -1;
- var matchedSlash = true;
- for (var i = path.length - 1; i >= 1; --i) {
- code = path.charCodeAt(i);
- if (code === 47 ) {
- if (!matchedSlash) {
- end = i;
- break;
- }
- } else {
-
- matchedSlash = false;
- }
- }
- if (end === -1) return hasRoot ? '/' : '.';
- if (hasRoot && end === 1) {
-
-
- return '/';
- }
- return path.slice(0, end);
- };
- function basename(path) {
- if (typeof path !== 'string') path = path + '';
- var start = 0;
- var end = -1;
- var matchedSlash = true;
- var i;
- for (i = path.length - 1; i >= 0; --i) {
- if (path.charCodeAt(i) === 47 ) {
-
-
- if (!matchedSlash) {
- start = i + 1;
- break;
- }
- } else if (end === -1) {
-
-
- matchedSlash = false;
- end = i + 1;
- }
- }
- if (end === -1) return '';
- return path.slice(start, end);
- }
- exports.basename = function (path, ext) {
- var f = basename(path);
- if (ext && f.substr(-1 * ext.length) === ext) {
- f = f.substr(0, f.length - ext.length);
- }
- return f;
- };
- exports.extname = function (path) {
- if (typeof path !== 'string') path = path + '';
- var startDot = -1;
- var startPart = 0;
- var end = -1;
- var matchedSlash = true;
-
-
- var preDotState = 0;
- for (var i = path.length - 1; i >= 0; --i) {
- var code = path.charCodeAt(i);
- if (code === 47 ) {
-
-
- if (!matchedSlash) {
- startPart = i + 1;
- break;
- }
- continue;
- }
- if (end === -1) {
-
-
- matchedSlash = false;
- end = i + 1;
- }
- if (code === 46 ) {
-
- if (startDot === -1)
- startDot = i;
- else if (preDotState !== 1)
- preDotState = 1;
- } else if (startDot !== -1) {
-
-
- preDotState = -1;
- }
- }
- if (startDot === -1 || end === -1 ||
-
- preDotState === 0 ||
-
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
- return '';
- }
- return path.slice(startDot, end);
- };
- function filter (xs, f) {
- if (xs.filter) return xs.filter(f);
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- if (f(xs[i], i, xs)) res.push(xs[i]);
- }
- return res;
- }
- var substr = 'ab'.substr(-1) === 'b'
- ? function (str, start, len) { return str.substr(start, len) }
- : function (str, start, len) {
- if (start < 0) start = str.length + start;
- return str.substr(start, len);
- }
- ;
- }),
- (function(module, exports) {
- module.exports=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){var n=r(1),o=r(3),i=r(5),a=r(6),l=r(7),s=r(8),_=r(9),c=r(15),u=r(12),d=r(17),f=r(18),p=r(19),h=r(16),v=r(10),m=r(20),b=r(14),g=r(4),w=r(13),y=r(21);t.FreeTmpl=y,t.precompileTemplate=y.precompiler?y.precompiler.compile:null,t.precompiler=y.precompiler?y.precompiler:null,t.HtmlLLParser=y.htmlParser?y.htmlParser:null,t.LLParser=n,t.dataPath=l,t.dataUtils=i,t.Event=a,t.Element=_,t.TextNode=u,t.NativeNode=d,t.VirtualNode=f,t.ShadowRoot=p,t.Behavior=s,t.Component=c,t.Observer=v,t.DataGroup=h,t.ElementIterator=m,t.FakeDomElement=b,t.registerBehavior=s.create,t.registerElement=c.register,t.createElement=c.create,t.createTextNode=u.create,t.createVirtualNode=f.create,t.appendChild=_.appendChild,t.insertBefore=_.insertBefore,t.removeChild=_.removeChild,t.replaceChild=_.replaceChild,t.addListenerToElement=a.addListenerToElement,t.removeListenerFromElement=a.removeListenerFromElement,t.triggerEvent=a.triggerEvent,t.safeCallback=o.safeCallback,t.addGlobalErrorListener=o.addGlobalErrorListener,t.removeGlobalErrorListener=o.removeGlobalErrorListener,t.globalOptions=g,t.globalState=w,c._setDefaultTemplateEngine(y);var x=t.updateDefaultComponent=function(){delete c._list[""],c.register({is:"",options:{writeOnly:!0,allowInWriteOnly:!0,lazyRegistration:!1,classPrefix:"",addGlobalClass:!1,templateEngine:null,renderingMode:"full",multipleSlots:!1,reflectToAttributes:!1}})};x();var C=function(e){var t="";if(e instanceof exparser.Element&&(e.id&&(t+=' id="'+e.id+'"'),e.slot&&(t+=' slot="'+e.slot+'"'),e.__slotName&&(t+=' name="'+e.__slotName+'"'),e.classList&&(t+=' class="'+e.class+'"'),e.$$&&e.$$.getAttribute("style")&&(t+=' style="'+e.$$.getAttribute("style")+'"')),e instanceof exparser.VirtualNode)return t;if(e instanceof exparser.Component)return c.listPublicProperties(e).forEach(function(r){t+=" "+r+"="+JSON.stringify(e[r])}),t;for(var r=e.attributes,n=0;n<r.length;n++)t+=" "+r[n].name+'="'+r[n].value+'"';return t},E=t.dumpElementToString=function(e,t,r){var n=null;g.hasDOMBackend&&(n=window);var o=0;r=r||0;var i="";for(o=r;o;o--)i+=" ";var a="";if(e instanceof exparser.Element)a+=i+"<"+(e.$$?e.$$.tagName.toLowerCase()+":":"")+e.is+C(e)+">",a+=e instanceof exparser.VirtualNode?" [Exp-Virtual]":e instanceof exparser.NativeNode?" [Exp-Native]":" [Exp-Component]",a+="\n"+E(t?e.__wxSlotChildren:e.childNodes,t,r+1);else if(e instanceof exparser.TextNode)a+=i+e.textContent+" [Exp-Text]\n";else if(n&&n.HTMLElement&&e instanceof n.HTMLElement)a+=i+"<"+e.tagName.toLowerCase()+C(e)+"> [DOM-Element]",a+="\n"+E(t?e.__wxSlotChildren||e.childNodes:e.childNodes,t,r+1);else if(n&&n.Text&&e instanceof n.Text)a+=i+e.textContent+" [DOM-Text]\n";else if(void 0!==e.length)for(o=0;o<e.length;o++)a+=E(e[o],t,r);else a=i+"[unknown node]\n";return a};t.dumpElement=function(e,t){console.log(E(e,t))}},function(e,t,r){var n=null,o=16384,i=128,a=128,l=0,s=1,_=65536,c=function(){},u=c.stats={all:0,copyIn:0,parse:0,constructOut:0},d=function(e){var t=n.llparser_create_descriptor(e,1);return t},f=function(e,t){var r=n.llparser_create_descriptor(e,0),o=!1;"^"===t[0]&&(o=!0);for(var i=o?1:0;i<t.length;i++){var a=t.charCodeAt(i);if("-"===t[i+1]){var l=t.charCodeAt(i+2);a<=l?(n.llparser_descriptor_add_range(r,a,l),i+=2):n.llparser_descriptor_add_char(r,a)}else n.llparser_descriptor_add_char(r,a)}return o&&n.llparser_descriptor_revert(r),r};c.create=function(e,t,u){n||(n=r(2));var p=new c;u=u||o;var h=p._llp=n.llparser_create(u,i,a),v={},m={},b="";v.ALL=n.llparser_create_descriptor(h,0),n.llparser_descriptor_set_all(v.ALL),v.NULL=n.llparser_create_descriptor(h,0),n.llparser_descriptor_set_nil(v.NULL);for(b in e)v[b]=d(h);for(b in e)for(var g=e[b],w=v[b],y=0;y<g.length;y++){for(var x=g[y].id,C=g[y].states,E=[],S=0;S<C.length;S++){var O=C[S];v[O]||(v[O]=f(h,O)),E.push(v[O])}var N=l;"_raw"===x?N=s:"_jump"===x?N=_+0:"_blank"===x&&(N=_+1);var k=n.llparser_add_rule(h,N,w,E.length,E[0],E[1],E[2],E[3],E[4],E[5],E[6],E[7]);N===l&&(m[k]=t[x])}return n.llparser_prepare(h),p._inputPtr=n.llparser_get_input_buffer(h),p._resultPtr=n.llparser_get_result(h),p._stateIdMap=v,p._ruleCbMap=m,p._charCountLimit=u,p};var p=function(e,t,r,n,o){for(var i=[],a={i:0,r:0,n:!1,cc:-1,c:[]},l=a,s=o.pos,_=!1,c=!1,u=!1;;){var d=t[s],f=t[s+1];if(f<0?(c=!0,f=-f-1):c=!1,d>=0){u=!0;var p=r.slice(d,f);l.c.push(p),_=c}else{if(d===-1&&0===f)break;u=!1;var h=-d,v=f,m={i:l.c.length-(_?1:0),r:h,n:c,cc:v,c:[]};if(_){var b=l.c.length-1,g=l.c[b];m.c.push(g),l.c[b]=m}else l.c.push(m);i.push(l),l=m,_=!1}if(!u||!_)for(;l.c.length===l.cc;){_=l.n;var w=i.pop();if(w.c[l.i]=n[l.r].call(e,l.c),l=w,_)break}s+=2}return a.c[0]},h=function(e,t,r,n){for(var o=n>e.length?e.length:n,i=0;i<o;i++)t[r+i]=e.charCodeAt(i);t[r+o]=0};c.prototype.parse=function(e,t){var r=Date.now();h(t,new Uint16Array(n.memory.buffer),this._inputPtr>>1,this._charCountLimit),u.copyIn=u.copyIn+Date.now()-r,r=Date.now();var o=n.llparser_parse(this._llp,this._stateIdMap[e]);if(u.parse=u.parse+Date.now()-r,r=Date.now(),o)throw new Error("Parsing failed at character position "+(o-1)+' near "'+t.slice(o-20,o)+'"');var i=p(this,new Int32Array(n.memory.buffer),t,this._ruleCbMap,{pos:this._resultPtr>>2});return u.constructOut=u.constructOut+Date.now()-r,i},c.prototype.destroy=function(){n.llparser_destroy(this._llp)},e.exports=c},function(e,t){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(t){return e[t]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function n(e,t,r){return m.llparser_create(e,t,r)}function o(e){m.llparser_destroy(e)}function i(e,t){return m.llparser_create_descriptor(e,t)}function a(e){m.llparser_descriptor_set_all(e)}function l(e){m.llparser_descriptor_set_nil(e)}function s(e,t){m.llparser_descriptor_add_char(e,t)}function _(e,t,r){m.llparser_descriptor_add_range(e,t,r)}function c(e){m.llparser_descriptor_revert(e)}function u(e,t,r,n,o,i,a,l,s,_,c,u){return m.llparser_add_rule(e,t,r,n,o,i,a,l,s,_,c,u)}function d(e){m.llparser_prepare(e)}function f(e,t){return m.llparser_parse(e,t)}function p(e){return m.llparser_get_input_buffer(e)}function h(e){return m.llparser_get_result(e)}function v(){m.wasm_main()}r.r(t),r.d(t,"llparser_create",function(){return n}),r.d(t,"llparser_destroy",function(){return o}),r.d(t,"llparser_create_descriptor",function(){return i}),r.d(t,"llparser_descriptor_set_all",function(){return a}),r.d(t,"llparser_descriptor_set_nil",function(){return l}),r.d(t,"llparser_descriptor_add_char",function(){return s}),r.d(t,"llparser_descriptor_add_range",function(){return _}),r.d(t,"llparser_descriptor_revert",function(){return c}),r.d(t,"llparser_add_rule",function(){return u}),r.d(t,"llparser_prepare",function(){return d}),r.d(t,"llparser_parse",function(){return f}),r.d(t,"llparser_get_input_buffer",function(){return p}),r.d(t,"llparser_get_result",function(){return h}),r.d(t,"wasm_main",function(){return v}),r.d(t,"memory",function(){return b});var m=r(1),b=m.memory;m.__wbindgen_start()},function(e,t,r){"use strict";r.r(t),r.d(t,"memory",function(){return i}),r.d(t,"rust_calloc",function(){return a}),r.d(t,"rust_free",function(){return l}),r.d(t,"llparser_create",function(){return s}),r.d(t,"llparser_destroy",function(){return _}),r.d(t,"llparser_create_descriptor",function(){return c}),r.d(t,"llparser_descriptor_set_all",function(){return u}),r.d(t,"llparser_descriptor_set_nil",function(){return d}),r.d(t,"llparser_descriptor_add_char",function(){return f}),r.d(t,"llparser_descriptor_add_range",function(){return p}),r.d(t,"llparser_descriptor_revert",function(){return h}),r.d(t,"llparser_add_rule",function(){return v}),r.d(t,"llparser_prepare",function(){return m}),r.d(t,"llparser_parse",function(){return b}),r.d(t,"llparser_get_input_buffer",function(){return g}),r.d(t,"llparser_get_result",function(){return w}),r.d(t,"wasm_main",function(){return y}),r.d(t,"__wbindgen_start",function(){return x});var n=new ArrayBuffer(1114112),o=function(e,t,r){function n(e){var t=0,r=0,n=0,o=0,i=0,a=0,_=0;r=(t=e+-8|0)+(e=-8&(o=m[e+-4>>2]))|0;e:{t:{r:{n:{o:if(!(1&o)){if(!(3&o))break n;if(e=(o=m[t>>2])+e|0,(0|(t=t-o|0))==m[262246]){if(3!=(3&m[r+4>>2]))break o;return m[262244]=e,m[r+4>>2]=-2&m[r+4>>2],m[t+4>>2]=1|e,void(m[e+t>>2]=e)}o>>>0>=256?s(t):(0|(n=m[t+8>>2]))==(0|(i=m[t+12>>2]))?(a=1048576,_=m[262144]&p(o>>>3),m[a>>2]=_):(m[n+12>>2]=i,m[i+8>>2]=n)}if(2&(o=m[r+4>>2]))m[r+4>>2]=-2&o,m[t+4>>2]=1|e,m[e+t>>2]=e;else{o:{if(m[262247]!=(0|r)){if((0|r)!=m[262246])break o;return m[262246]=t,e=m[262244]+e|0,m[262244]=e,m[t+4>>2]=1|e,void(m[e+t>>2]=e)}if(m[262247]=t,e=m[262245]+e|0,m[262245]=e,m[t+4>>2]=1|e,(0|t)==m[262246]&&(m[262244]=0,m[262246]=0),(r=m[262254])>>>0>=e>>>0)break n;if(!(e=m[262247]))break n;i:if(!((o=m[262245])>>>0<41))for(t=1049e3;;){if((n=m[t>>2])+m[t+4>>2]>>>0>e>>>0&&n>>>0<=e>>>0)break i;if(!(t=m[t+8>>2]))break}if(n=4095,e=m[262252]){for(t=0;t=t+1|0,e=m[e+8>>2];);n=t>>>0>4095?t:4095}if(m[262256]=n,o>>>0<=r>>>0)break n;return void(m[262254]=-1)}if(e=(n=-8&o)+e|0,n>>>0>=256?s(r):(0|(n=m[r+12>>2]))==(0|(r=m[r+8>>2]))?(a=1048576,_=m[262144]&p(o>>>3),m[a>>2]=_):(m[r+12>>2]=n,m[n+8>>2]=r),m[t+4>>2]=1|e,m[e+t>>2]=e,m[262246]==(0|t)){m[262244]=e;break n}}if(e>>>0<256)break r;if(l(t,e),e=m[262256]+-1|0,m[262256]=e,!e){if(e=m[262252])break t;e=4095;break e}}return}return e=1048584+((r=e>>>3)<<3)|0,o=m[262144],r=1<<(31&r),n=m[e+8>>2],o&r||(m[262144]=r|o,n=e),r=n,m[e+8>>2]=t,m[r+12>>2]=t,m[t+12>>2]=e,void(m[t+8>>2]=r)}for(t=0;t=t+1|0,e=m[e+8>>2];);e=t>>>0>4095?t:4095}m[262256]=e}function o(e,t,r,n,o,i,a,l,s,_,c,u){var d;return C=d=C+-64|0,m[d+60>>2]=e,m[d+56>>2]=t,m[d+52>>2]=r,m[d+48>>2]=n,m[d+44>>2]=o,m[d+40>>2]=i,m[d+36>>2]=a,m[d+32>>2]=l,m[d+28>>2]=s,m[d+24>>2]=_,m[d+20>>2]=c,m[d+16>>2]=u,t=m[m[d+60>>2]+28>>2],r=m[d+60>>2],e=m[r>>2],m[r>>2]=e+1,m[d+12>>2]=t+y(e,44),m[m[d+12>>2]>>2]=m[d+52>>2],m[m[d+12>>2]+4>>2]=m[d+48>>2],m[d+48>>2]>0&&(m[m[d+12>>2]+8>>2]=m[d+44>>2]),m[d+48>>2]>1&&(m[m[d+12>>2]+12>>2]=m[d+40>>2]),m[d+48>>2]>2&&(m[m[d+12>>2]+16>>2]=m[d+36>>2]),m[d+48>>2]>3&&(m[m[d+12>>2]+20>>2]=m[d+32>>2]),m[d+48>>2]>4&&(m[m[d+12>>2]+24>>2]=m[d+28>>2]),m[d+48>>2]>5&&(m[m[d+12>>2]+28>>2]=m[d+24>>2]),m[d+48>>2]>6&&(m[m[d+12>>2]+32>>2]=m[d+20>>2]),m[d+48>>2]>7&&(m[m[d+12>>2]+36>>2]=m[d+16>>2]),m[m[d+12>>2]+40>>2]=m[d+56>>2],m[d+48>>2]>0&&function(e,t,r){var n=0;m[28+(n=C-32|0)>>2]=e,m[n+24>>2]=t,m[n+20>>2]=r,m[n+16>>2]=(m[n+20>>2]-m[m[n+28>>2]+24>>2]|0)/140,1==m[m[n+20>>2]+4>>2]&&(t=m[m[n+28>>2]+40>>2],r=m[n+28>>2],e=m[r+8>>2],m[r+8>>2]=e+1,m[n+12>>2]=t+(e<<3),m[m[n+12>>2]>>2]=m[n+24>>2],m[m[n+12>>2]+4>>2]=m[m[n+20>>2]+136>>2],m[m[n+20>>2]+136>>2]=m[n+12>>2])}(m[d+60>>2],m[d+12>>2],m[d+52>>2]),C=d- -64|0,m[d+12>>2]}function i(e,t,r,n,o){var a;if(C=a=C-48|0,m[a+44>>2]=e,m[a+40>>2]=t,m[a+36>>2]=r,m[a+32>>2]=n,m[a+28>>2]=o,m[m[a+40>>2]>>2]!=m[a+36>>2])for(m[m[a+40>>2]>>2]=m[a+36>>2],m[a+24>>2]=m[m[a+40>>2]+136>>2],m[a+20>>2]=1&(0!=m[a+28>>2]^-1^-1);m[a+24>>2];){for(m[a+20>>2]||(m[a+28>>2]=m[a+24>>2]),m[a+16>>2]=m[m[m[a+24>>2]>>2]+8>>2],1==m[m[a+16>>2]+4>>2]&&i(m[a+44>>2],m[a+16>>2],m[a+36>>2],m[a+32>>2],m[a+28>>2]),m[a+12>>2]=0;!(m[a+12>>2]>=128);)b[m[a+12>>2]+(m[a+16>>2]+8|0)|0]&&(w[m[a+28>>2]>>2]>=w[m[a+32>>2]+(m[a+12>>2]<<2)>>2]&&m[m[a+32>>2]+(m[a+12>>2]<<2)>>2]||(m[m[a+32>>2]+(m[a+12>>2]<<2)>>2]=m[m[a+28>>2]>>2])),m[a+12>>2]=m[a+12>>2]+1;m[a+24>>2]=m[m[a+24>>2]+4>>2]}C=a+48|0}function a(e,t,r,n){var o;for(m[44+(o=C-48|0)>>2]=e,m[o+40>>2]=t,m[o+36>>2]=r,m[o+32>>2]=n,m[o+28>>2]=m[m[o+40>>2]+136>>2];m[o+28>>2];){if(m[o+24>>2]=m[m[m[o+28>>2]>>2]+8>>2],m[o+24>>2]==m[o+40>>2])for(m[o+20>>2]=m[m[m[o+28>>2]>>2]+12>>2],m[o+16>>2]=0;!(m[o+16>>2]>=128);){e:{if(1!=m[m[o+20>>2]+4>>2]){if(!b[m[o+16>>2]+(m[o+20>>2]+8|0)|0])break e}else if(m[o+12>>2]=m[m[o+44>>2]+32>>2]+((m[o+20>>2]-m[m[o+44>>2]+24>>2]|0)/140<<9),!m[m[o+12>>2]+(m[o+16>>2]<<2)>>2])break e;w[m[o+28>>2]>>2]>=w[m[o+32>>2]+(m[o+16>>2]<<2)>>2]&&m[m[o+32>>2]+(m[o+16>>2]<<2)>>2]||(m[m[o+32>>2]+(m[o+16>>2]<<2)>>2]=m[m[o+28>>2]>>2])}m[o+16>>2]=m[o+16>>2]+1}m[o+28>>2]=m[m[o+28>>2]+4>>2]}}function l(e,t){var r=0,n=0,o=0,i=0;m[e+16>>2]=0,m[e+20>>2]=0,o=e,r=0,(n=t>>>8)&&(r=31,t>>>0>16777215||(r=62+((t>>>(6-(n=x(n))&31)&1)-(n<<1)|0)|0)),m[o+28>>2]=r,o=1048848+(r<<2)|0;e:{t:{r:{n:{if((i=m[262145])&(n=1<<(31&r))){if(n=m[o>>2],(-8&m[n+4>>2])!=(0|t))break n;r=n;break r}m[262145]=n|i,m[o>>2]=e,m[e+24>>2]=o;break e}for(o=t<<(31==(0|r)?0:25-(r>>>1)&31);;){if(!(r=m[(i=16+((o>>>29&4)+n|0)|0)>>2]))break t;if(o<<=1,n=r,(-8&m[r+4>>2])==(0|t))break}}return t=m[r+8>>2],m[t+12>>2]=e,m[r+8>>2]=e,m[e+24>>2]=0,m[e+12>>2]=r,void(m[e+8>>2]=t)}m[i>>2]=e,m[e+24>>2]=n}m[e+12>>2]=e,m[e+8>>2]=e}function s(e){var t,r=0,n=0,o=0,i=0,a=0,l=0;t=m[e+24>>2];e:{t:{if((0|e)==(0|(r=m[e+12>>2]))){if(o=m[(r=e+20|0)>>2],n=m[(o?20:16)+e>>2])break t;r=0;break e}n=m[e+8>>2],m[n+12>>2]=r,m[r+8>>2]=n;break e}for(o=o?r:e+16|0;i=o,(n=m[(o=(r=n)+20|0)>>2])||(o=r+16|0,n=m[r+16>>2]),n;);m[i>>2]=0}e:if(t){n=1048848+(m[e+28>>2]<<2)|0;t:{if((0|e)==m[n>>2]){if(m[n>>2]=r,r)break t;return a=1048580,l=m[262145]&p(m[e+28>>2]),void(m[a>>2]=l)}if(m[(m[t+16>>2]==(0|e)?16:20)+t>>2]=r,!r)break e}m[r+24>>2]=t,(n=m[e+16>>2])&&(m[r+16>>2]=n,m[n+24>>2]=r),(e=m[e+20>>2])&&(m[r+20>>2]=e,m[e+24>>2]=r)}}function _(e,t){var r,n,o;return C=r=C-32|0,m[r+24>>2]=e,m[r+20>>2]=t,m[r+16>>2]=0,m[r+12>>2]=0,n=r,o=function e(t,r,n,o,i,a,l){var s,_=0,c=0;C=s=C-96|0,m[s+88>>2]=t,m[s+84>>2]=r,m[s+80>>2]=n,m[s+76>>2]=o,m[s+72>>2]=i,m[s+68>>2]=a,m[s+64>>2]=l,m[s+60>>2]=g[m[s+80>>2]+(m[m[s+76>>2]>>2]<<1)>>1],w[s+60>>2]>=128&&(m[s+60>>2]=1);e:if(m[m[s+72>>2]>>2]>(m[s+64>>2]-4|0))m[s+92>>2]=-1;else if(1==m[m[s+84>>2]+4>>2])if(m[s+56>>2]=m[m[s+76>>2]>>2],m[s+52>>2]=m[m[s+72>>2]>>2],m[s+48>>2]=0,m[s+44>>2]=0,m[s+40>>2]=m[m[s+88>>2]+32>>2]+((m[s+84>>2]-m[m[s+88>>2]+24>>2]|0)/140<<9),m[s+36>>2]=0,!m[m[s+40>>2]+(m[s+60>>2]<<2)>>2]|w[s+60>>2]<=0|w[s+60>>2]>=127?!m[s+60>>2]|!m[m[s+40>>2]+508>>2]?m[m[s+40>>2]>>2]&&(m[s+36>>2]=m[m[s+40>>2]>>2]):m[s+36>>2]=m[m[s+40>>2]+508>>2]:m[s+36>>2]=m[m[s+40>>2]+(m[s+60>>2]<<2)>>2],m[s+36>>2]){for(m[s+68>>2]||m[m[s+36>>2]+40>>2]||(m[s+48>>2]=m[m[s+72>>2]>>2],t=m[s+72>>2],m[t>>2]=m[t>>2]+2),m[s+32>>2]=0;m[s+32>>2]<m[m[s+36>>2]+4>>2];){if(m[s+28>>2]=m[s+68>>2],m[s+68>>2]||!m[m[s+36>>2]+40>>2]|m[m[s+36>>2]+40>>2]==(m[s+32>>2]+65536|0)||(m[s+28>>2]=1),_=s,c=e(m[s+88>>2],m[(m[s+36>>2]+8|0)+(m[s+32>>2]<<2)>>2],m[s+80>>2],m[s+76>>2],m[s+72>>2],m[s+28>>2],m[s+64>>2]),m[_+24>>2]=c,m[s+24>>2]<0){m[s+92>>2]=-1;break e}m[s+68>>2]|m[m[s+36>>2]+40>>2]!=(m[s+32>>2]+65536|0)||(m[s+44>>2]=m[s+24>>2]),m[s+32>>2]=m[s+32>>2]+1}for(m[s+68>>2]||(m[m[s+36>>2]+40>>2]?1==m[m[s+36>>2]+40>>2]&&(r=m[s+56>>2],n=m[m[s+88>>2]+48>>2],o=m[s+72>>2],t=m[o>>2],m[o>>2]=t+1,m[n+(t<<2)>>2]=r,m[s+44>>2]=m[m[s+72>>2]>>2],r=m[m[s+76>>2]>>2],n=m[m[s+88>>2]+48>>2],o=m[s+72>>2],t=m[o>>2],m[o>>2]=t+1,m[n+(t<<2)>>2]=r):(m[m[m[s+88>>2]+48>>2]+(m[s+48>>2]<<2)>>2]=0-m[s+36>>2],m[m[m[s+88>>2]+48>>2]+(m[s+48>>2]+1<<2)>>2]=m[m[s+36>>2]+4>>2],m[s+44>>2]=m[s+48>>2]+1));;){if(m[m[s+72>>2]>>2]>(m[s+64>>2]-4|0)){m[s+92>>2]=-1;break e}if(m[s+20>>2]=m[m[s+88>>2]+36>>2]+((m[s+84>>2]-m[m[s+88>>2]+24>>2]|0)/140<<9),m[s+16>>2]=0,m[s+60>>2]=g[m[s+80>>2]+(m[m[s+76>>2]>>2]<<1)>>1],w[s+60>>2]>=128&&(m[s+60>>2]=1),!m[m[s+20>>2]+(m[s+60>>2]<<2)>>2]|w[s+60>>2]<=0|w[s+60>>2]>=127?!m[s+60>>2]|!m[m[s+20>>2]+508>>2]||(m[s+16>>2]=m[m[s+20>>2]+508>>2]):m[s+16>>2]=m[m[s+20>>2]+(m[s+60>>2]<<2)>>2],!m[s+16>>2])break;for(m[s+68>>2]||(m[m[s+16>>2]+40>>2]?65536!=m[m[s+16>>2]+40>>2]&&(m[m[s+72>>2]>>2]=m[s+52>>2]):(m[m[m[s+88>>2]+48>>2]+(m[s+44>>2]<<2)>>2]=(0-m[m[m[s+88>>2]+48>>2]+(m[s+44>>2]<<2)>>2]|0)-1,m[s+48>>2]=m[m[s+72>>2]>>2],t=m[s+72>>2],m[t>>2]=m[t>>2]+2)),m[s+12>>2]=1;m[s+12>>2]<m[m[s+16>>2]+4>>2];){if(m[s+8>>2]=m[s+68>>2],m[s+68>>2]||!m[m[s+16>>2]+40>>2]|m[m[s+16>>2]+40>>2]==(m[s+12>>2]+65536|0)||(m[s+8>>2]=1),_=s,c=e(m[s+88>>2],m[(m[s+16>>2]+8|0)+(m[s+12>>2]<<2)>>2],m[s+80>>2],m[s+76>>2],m[s+72>>2],m[s+8>>2],m[s+64>>2]),m[_+4>>2]=c,m[s+4>>2]<0){m[s+92>>2]=-1;break e}m[s+68>>2]|m[m[s+16>>2]+40>>2]!=(m[s+12>>2]+65536|0)||(m[s+44>>2]=m[s+4>>2]),m[s+12>>2]=m[s+12>>2]+1}m[s+68>>2]||(m[m[s+16>>2]+40>>2]?1==m[m[s+16>>2]+40>>2]&&(r=m[s+56>>2],n=m[m[s+88>>2]+48>>2],o=m[s+72>>2],t=m[o>>2],m[o>>2]=t+1,m[n+(t<<2)>>2]=r,m[s+44>>2]=m[m[s+72>>2]>>2],r=m[m[s+76>>2]>>2],n=m[m[s+88>>2]+48>>2],o=m[s+72>>2],t=m[o>>2],m[o>>2]=t+1,m[n+(t<<2)>>2]=r):(m[m[m[s+88>>2]+48>>2]+(m[s+48>>2]<<2)>>2]=0-m[s+16>>2],m[m[m[s+88>>2]+48>>2]+(m[s+48>>2]+1<<2)>>2]=m[m[s+16>>2]+4>>2],m[s+44>>2]=m[s+48>>2]+1))}m[s+92>>2]=m[s+44>>2]}else m[s+92>>2]=-1;else{if(m[s+60>>2]&&(-1==m[m[s+84>>2]+4>>2]&&(t=m[s+76>>2],m[t>>2]=m[t>>2]+1),!m[m[s+84>>2]+4>>2])){if(!b[m[s+60>>2]+(m[s+84>>2]+8|0)|0]){m[s+92>>2]=-1;break e}t=m[s+76>>2],m[t>>2]=m[t>>2]+1}m[s+68>>2]||(r=m[m[s+76>>2]>>2],n=m[m[s+84>>2]+4>>2],o=m[m[s+88>>2]+48>>2],i=m[s+72>>2],t=m[i>>2],m[i>>2]=t+1,m[o+(t<<2)>>2]=r-(-2==(0|n)?0:1),r=m[m[s+76>>2]>>2],n=m[m[s+88>>2]+48>>2],o=m[s+72>>2],t=m[o>>2],m[o>>2]=t+1,m[n+(t<<2)>>2]=r),m[s+92>>2]=m[m[s+72>>2]>>2]-1}return C=s+96|0,m[s+92>>2]}(m[r+24>>2],m[r+20>>2],m[m[r+24>>2]+44>>2],r+12|0,r+16|0,0,m[m[r+24>>2]+12>>2]<<1),m[n+8>>2]=o,e=m[m[r+24>>2]+48>>2],t=m[r+16>>2],m[r+16>>2]=t+1,m[e+(t<<2)>>2]=-1,e=m[m[r+24>>2]+48>>2],t=m[r+16>>2],m[r+16>>2]=t+1,m[e+(t<<2)>>2]=0,g[m[m[r+24>>2]+44>>2]+(m[r+12>>2]<<1)>>1]|m[r+8>>2]<0?m[r+28>>2]=m[r+12>>2]+1:m[r+28>>2]=0,C=r+32|0,m[r+28>>2]}function c(e){var t;return!(t=function(e){var t=0,r=0,n=0,o=0,i=0,a=0,_=0,c=0,u=0,d=0,v=0;e:{t:{r:{if(e>>>0>=245){if(e>>>0>=4294901709)break t;if(o=-8&(e=e+11|0),!(c=m[262145]))break r;r=0-o|0,_=0,(e>>>=8)&&(_=31,o>>>0>16777215||(_=62+((o>>>(6-(e=x(e))&31)&1)-(e<<1)|0)|0));n:{o:{if(e=m[1048848+(_<<2)>>2]){for(i=o<<(31==(0|_)?0:25-(_>>>1)&31);;){if(!((a=-8&m[e+4>>2])>>>0<o>>>0||(a=a-o|0)>>>0>=r>>>0||(n=e,r=a))){r=0;break o}if(a=m[e+20>>2],e=m[16+((i>>>29&4)+e|0)>>2],t=a&&(0|a)!=(0|e)?a:t,i<<=1,!e)break}if(t){e=t;break o}if(n)break n}if(n=0,!(e=(0-(e=2<<(31&_))|e)&c))break r;if(!(e=m[1048848+(f(e&0-e)<<2)>>2]))break r}for(;n=(a=(i=(t=-8&m[e+4>>2])-o|0)>>>0<r>>>0&t>>>0>=o>>>0)?e:n,r=a?i:r,e=(t=m[e+16>>2])||m[e+20>>2];);if(!n)break r}if(r>>>0>=(e=m[262244])-o>>>0&&e>>>0>=o>>>0)break r;s(n);n:if(r>>>0>=16){if(m[n+4>>2]=3|o,m[4+(t=n+o|0)>>2]=1|r,m[t+r>>2]=r,r>>>0>=256){l(t,r);break n}e=1048584+((r>>>=3)<<3)|0,i=m[262144],r=1<<(31&r),_=m[e+8>>2],i&r||(m[262144]=r|i,_=e),r=_,m[e+8>>2]=t,m[r+12>>2]=t,m[t+12>>2]=e,m[t+8>>2]=r}else e=r+o|0,m[n+4>>2]=3|e,m[4+(e=e+n|0)>>2]=1|m[e+4>>2];return n+8|0}n:{o:{if(!(3&(e=(t=m[262144])>>>(n=31&(r=(o=e>>>0<11?16:e+11&-8)>>>3))))){if(o>>>0<=w[262244])break r;if(e)break o;if(!(e=m[262145]))break r;for(t=m[1048848+(f(e&0-e)<<2)>>2],r=(-8&m[t+4>>2])-o|0,i=t;;){if(!(e=m[t+16>>2])&&!(e=m[t+20>>2]))break n;r=(t=(n=(-8&m[e+4>>2])-o|0)>>>0<r>>>0)?n:r,i=t?e:i,t=e}}r=(e=m[1048592+(a=(n=r+(1&(-1^e))|0)<<3)>>2])+8|0,(0|(i=m[e+8>>2]))==(0|(a=a+1048584|0))?(d=1048576,v=p(n)&t,m[d>>2]=v):(m[i+12>>2]=a,m[a+8>>2]=i),t=n<<3,m[e+4>>2]=3|t,m[4+(e=e+t|0)>>2]=1|m[e+4>>2];break t}return n=f(0-(e=(r=e<<n)&(0-(e=2<<n)|e))&e),e=m[1048592+(i=n<<3)>>2],(0|(r=m[e+8>>2]))==(0|(i=i+1048584|0))?(d=1048576,v=p(n)&t,m[d>>2]=v):(m[r+12>>2]=i,m[i+8>>2]=r),i=e+8|0,m[e+4>>2]=3|o,r=(t=n<<3)-o|0,m[4+(a=e+o|0)>>2]=1|r,m[e+t>>2]=r,(e=m[262244])&&(e=1048584+((n=e>>>3)<<3)|0,t=m[262246],o=m[262144],n=1<<(31&n),_=m[e+8>>2],o&n||(m[262144]=n|o,_=e),n=_,m[e+8>>2]=t,m[n+12>>2]=t,m[t+12>>2]=e,m[t+8>>2]=n),m[262246]=a,m[262244]=r,i}return s(i),r>>>0>=16?(m[i+4>>2]=3|o,m[4+(a=o+i|0)>>2]=1|r,m[r+a>>2]=r,(e=m[262244])&&(e=1048584+((n=e>>>3)<<3)|0,t=m[262246],o=m[262144],n=1<<(31&n),_=m[e+8>>2],o&n||(m[262144]=n|o,_=e),n=_,m[e+8>>2]=t,m[n+12>>2]=t,m[t+12>>2]=e,m[t+8>>2]=n),m[262246]=a,m[262244]=r):(e=r+o|0,m[i+4>>2]=3|e,m[4+(e=e+i|0)>>2]=1|m[e+4>>2]),i+8|0}r:{n:{o:{i:{if((t=m[262244])>>>0<o>>>0){if((e=m[262245])>>>0>o>>>0)break e;if(r=0,-1==(0|(t=h((e=o+65583|0)>>>16))))break t;if(!(n=t<<16))break t;if(e=(i=-65536&e)+m[262248]|0,m[262248]=e,t=m[262249],m[262249]=t>>>0>e>>>0?t:e,!(r=m[262247]))break i;for(e=1049e3;;){if((0|n)==((t=m[e>>2])+(a=m[e+4>>2])|0))break o;if(!(e=m[e+8>>2]))break}break n}return e=m[262246],(n=t-o|0)>>>0<=15?(m[262246]=0,m[262244]=0,m[e+4>>2]=3|t,o=4+(t=e+t|0)|0,r=1|m[t+4>>2]):(m[262244]=n,r=e+o|0,m[262246]=r,m[r+4>>2]=1|n,m[e+t>>2]=n,r=3|o,o=e+4|0),m[o>>2]=r,e+8|0}for((e=m[262255])>>>0<=n>>>0&&e||(m[262255]=n),e=0,m[262256]=4095,m[262251]=i,m[262250]=n,m[262253]=0;t=e+1048584|0,m[e+1048592>>2]=t,m[e+1048596>>2]=t,256!=(0|(e=e+8|0)););m[262247]=n,e=i+-40|0,m[262245]=e,m[n+4>>2]=1|e,m[4+(e+n|0)>>2]=40,m[262254]=2097152;break r}if(!(m[e+12>>2]|n>>>0<=r>>>0|t>>>0>r>>>0)){m[e+4>>2]=i+a,t=(e=m[262247])+15&-8,m[262247]=t+-8,r=8+((n=i+m[262245]|0)+(e-t|0)|0)|0,m[262245]=r,m[t+-4>>2]=1|r,m[4+(e+n|0)>>2]=40,m[262254]=2097152;break r}}e=m[262255],m[262255]=e>>>0<n>>>0?e:n,t=n+i|0,e=1049e3;n:{for(;;){if((0|t)!=m[e>>2]){if(e=m[e+8>>2])continue;break n}break}if(!m[e+12>>2]){m[e>>2]=n,m[e+4>>2]=i+m[e+4>>2],m[n+4>>2]=3|o,i=n+o|0,o=(t-n|0)-o|0;o:{i:{if((0|t)!=m[262247]){if(m[262246]==(0|t))break i;if(1==(3&(e=m[t+4>>2]))&&((r=-8&e)>>>0>=256?s(t):(0|(a=m[t+12>>2]))==(0|(_=m[t+8>>2]))?(d=1048576,v=m[262144]&p(e>>>3),m[d>>2]=v):(m[_+12>>2]=a,m[a+8>>2]=_),o=r+o|0,t=t+r|0),m[t+4>>2]=-2&m[t+4>>2],m[i+4>>2]=1|o,m[o+i>>2]=o,o>>>0>=256){l(i,o);break o}e=1048584+((t=o>>>3)<<3)|0,r=m[262144],t=1<<(31&t),_=m[e+8>>2],r&t||(m[262144]=t|r,_=e),r=_,m[e+8>>2]=i,m[r+12>>2]=i,m[i+12>>2]=e,m[i+8>>2]=r;break o}m[262247]=i,e=m[262245]+o|0,m[262245]=e,m[i+4>>2]=1|e;break o}m[262246]=i,e=m[262244]+o|0,m[262244]=e,m[i+4>>2]=1|e,m[e+i>>2]=e}return n+8|0}}for(e=1049e3;!((t=m[e>>2])>>>0<=r>>>0&&(a=t+m[e+4>>2]|0)>>>0>r>>>0);)e=m[e+8>>2];for(m[262247]=n,e=i+-40|0,m[262245]=e,m[n+4>>2]=1|e,m[4+(e+n|0)>>2]=40,m[262254]=2097152,m[(t=(e=(a+-32&-8)-8|0)>>>0<r+16>>>0?r:e)+4>>2]=27,e=m[262250],_=m[262251],u=m[262253],m[(c=t+16|0)>>2]=m[262252],m[c+4>>2]=u,m[t+8>>2]=e,m[t+12>>2]=_,m[262251]=i,m[262250]=n,m[262252]=t+8,m[262253]=0,e=t+28|0;m[e>>2]=7,a>>>0>(e=e+4|0)>>>0;);(0|t)!=(0|r)&&(m[t+4>>2]=-2&m[t+4>>2],e=t-r|0,m[r+4>>2]=1|e,m[t>>2]=e,e>>>0>=256?l(r,e):(e=1048584+((t=e>>>3)<<3)|0,n=m[262144],t=1<<(31&t),_=m[e+8>>2],n&t||(m[262144]=t|n,_=e),t=_,m[e+8>>2]=r,m[t+12>>2]=r,m[r+12>>2]=e,m[r+8>>2]=t))}if(r=0,!((e=m[262245])>>>0<=o>>>0))break e}return r}return t=e-o|0,m[262245]=t,n=(e=m[262247])+o|0,m[262247]=n,m[n+4>>2]=1|t,m[e+4>>2]=3|o,e+8|0}(e))|!(3&b[t+-4|0])||function(e,t){if(t)for(;v[0|e]=0,e=e+1|0,t=t+-1|0;);}(t,e),t}function u(e,t){return 0|c(y(e|=0,t|=0))}function d(){}function f(e){return e?31-x(e+-1^e)|0:32}function p(e){var t;return(-1>>>(t=31&e)&-2)<<t|(-1<<(e=0-e&31)&-2)>>>e}function h(t){t|=0;var n=0|r.byteLength/65536,o=n+t|0;if(n<o&&o<65536){var i=new ArrayBuffer(y(o,65536)),a=new e.Int8Array(i);a.set(v),v=a,v=new e.Int8Array(i),new e.Int16Array(i),m=new e.Int32Array(i),b=new e.Uint8Array(i),g=new e.Uint16Array(i),w=new e.Uint32Array(i),new e.Float32Array(i),new e.Float64Array(i),r=i}return n}var v=new e.Int8Array(r),m=(new e.Int16Array(r),new e.Int32Array(r)),b=new e.Uint8Array(r),g=new e.Uint16Array(r),w=new e.Uint32Array(r),y=(new e.Float32Array(r),new e.Float64Array(r),e.Math.imul),x=(e.Math.fround,e.Math.abs,e.Math.clz32),C=(e.Math.min,e.Math.max,e.Math.floor,e.Math.ceil,e.Math.sqrt,t.abort,e.NaN,e.Infinity,1048576);return{memory:Object.create(Object.prototype,{grow:{value:h},buffer:{get:function(){return r}}}),rust_calloc:u,rust_free:function(e){n(e|=0)},llparser_create:function(e,t,r){return 0|function(e,t,r){var n,o,i;return C=n=C-32|0,m[n+28>>2]=e,m[n+24>>2]=t,m[n+20>>2]=r,e=n,t=m[n+28>>2]?m[n+28>>2]:256,m[e+28>>2]=t,e=n,t=m[n+24>>2]?m[n+24>>2]:256,m[e+24>>2]=t,e=n,t=m[n+20>>2]?m[n+20>>2]:256,m[e+20>>2]=t,o=n,i=u(((((((y(m[n+24>>2],140)+52|0)+y(m[n+20>>2],44)|0)+(m[n+24>>2]<<9)|0)+(m[n+24>>2]<<9)|0)+y(m[n+20>>2],m[n+24>>2]<<3)|0)+(m[n+28>>2]<<1)|0)+(m[n+28>>2]<<3)|0,1),m[o+16>>2]=i,m[m[n+16>>2]+12>>2]=m[n+28>>2],m[m[n+16>>2]+16>>2]=m[n+24>>2],m[m[n+16>>2]+20>>2]=m[n+20>>2],m[m[n+16>>2]+4>>2]=0,m[m[n+16>>2]>>2]=0,m[m[n+16>>2]+8>>2]=0,m[n+12>>2]=m[n+16>>2]+52,m[m[n+16>>2]+24>>2]=m[n+12>>2],m[n+12>>2]=m[n+12>>2]+y(m[n+24>>2],140),m[m[n+16>>2]+28>>2]=m[n+12>>2],m[n+12>>2]=m[n+12>>2]+y(m[n+20>>2],44),m[m[n+16>>2]+32>>2]=m[n+12>>2],m[n+12>>2]=m[n+12>>2]+(m[n+24>>2]<<9),m[m[n+16>>2]+36>>2]=m[n+12>>2],m[n+12>>2]=m[n+12>>2]+(m[n+24>>2]<<9),m[m[n+16>>2]+40>>2]=m[n+12>>2],m[n+12>>2]=m[n+12>>2]+y(m[n+20>>2],m[n+24>>2]<<3),m[m[n+16>>2]+44>>2]=m[n+12>>2],m[n+12>>2]=m[n+12>>2]+(m[n+28>>2]<<1),m[m[n+16>>2]+48>>2]=m[n+12>>2],C=n+32|0,m[n+16>>2]}(e|=0,t|=0,r|=0)},llparser_destroy:function(e){!function(e){var t;C=t=C-16|0,m[t+12>>2]=e,n(m[t+12>>2]),C=t+16|0}(e|=0)},llparser_create_descriptor:function(e,t){return 0|function(e,t){var r,n;return m[12+(r=C-16|0)>>2]=e,m[r+8>>2]=t,t=m[m[r+12>>2]+24>>2],n=m[r+12>>2],e=m[n+4>>2],m[n+4>>2]=e+1,m[r+4>>2]=t+y(e,140),m[m[r+4>>2]+4>>2]=m[r+8>>2]?1:0,m[r+4>>2]}(e|=0,t|=0)},llparser_descriptor_set_all:function(e){var t;e|=0,m[12+(t=C-16|0)>>2]=e,m[m[t+12>>2]+4>>2]=-1,v[m[t+12>>2]+135|0]=1},llparser_descriptor_set_nil:function(e){var t;e|=0,m[12+(t=C-16|0)>>2]=e,m[m[t+12>>2]+4>>2]=-2,v[m[t+12>>2]+8|0]=1},llparser_descriptor_add_char:function(e,t){!function(e,t){var r;m[12+(r=C-16|0)>>2]=e,m[r+8>>2]=t,v[m[r+8>>2]+(m[r+12>>2]+8|0)|0]=1}(e|=0,t|=0)},llparser_descriptor_add_range:function(e,t,r){!function(e,t,r){var n;for(m[12+(n=C-16|0)>>2]=e,m[n+8>>2]=t,m[n+4>>2]=r,m[n>>2]=m[n+8>>2];!(m[n>>2]>m[n+4>>2]);)v[m[n>>2]+(m[n+12>>2]+8|0)|0]=1,m[n>>2]=m[n>>2]+1}(e|=0,t|=0,r|=0)},llparser_descriptor_revert:function(e){!function(e){var t;for(m[12+(t=C-16|0)>>2]=e,m[t+8>>2]=1;!(m[t+8>>2]>=127);)v[m[t+8>>2]+(m[t+12>>2]+8|0)|0]=1&(0!=b[m[t+8>>2]+(m[t+12>>2]+8|0)|0]^-1),m[t+8>>2]=m[t+8>>2]+1}(e|=0)},llparser_add_rule:function(e,t,r,n,i,a,l,s,_,c,u,d){return 0|o(e|=0,t|=0,r|=0,n|=0,i|=0,a|=0,l|=0,s|=0,_|=0,c|=0,u|=0,d|=0)},llparser_prepare:function(e){!function(e){var t;for(C=t=C-32|0,m[t+28>>2]=e,m[t+24>>2]=0;!(m[t+24>>2]>=m[m[t+28>>2]+4>>2]);)m[t+20>>2]=m[m[t+28>>2]+24>>2]+y(m[t+24>>2],140),1==m[m[t+20>>2]+4>>2]&&i(m[t+28>>2],m[t+20>>2],m[t+20>>2],m[m[t+28>>2]+32>>2]+(m[t+24>>2]<<9)|0,0),m[t+24>>2]=m[t+24>>2]+1;for(m[t+16>>2]=0;!(m[t+16>>2]>=m[m[t+28>>2]+4>>2]);)m[t+12>>2]=m[m[t+28>>2]+24>>2]+y(m[t+16>>2],140),1==m[m[t+12>>2]+4>>2]&&(m[m[t+12>>2]>>2]=0,a(m[t+28>>2],m[t+12>>2],m[t+12>>2],m[m[t+28>>2]+36>>2]+(m[t+16>>2]<<9)|0)),m[t+16>>2]=m[t+16>>2]+1;C=t+32|0}(e|=0)},llparser_parse:function(e,t){return 0|_(e|=0,t|=0)},llparser_get_input_buffer:function(e){var t;return e|=0,m[12+(t=C-16|0)>>2]=e,m[m[t+12>>2]+44>>2]},llparser_get_result:function(e){var t;return e|=0,m[12+(t=C-16|0)>>2]=e,m[m[t+12>>2]+48>>2]},wasm_main:d,__wbindgen_start:d}}({Math:Math,Int8Array:Int8Array,Uint8Array:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0},{abort:function(){throw new Error("abort")}},n),i=o.memory,a=o.rust_calloc,l=o.rust_free,s=o.llparser_create,_=o.llparser_destroy,c=o.llparser_create_descriptor,u=o.llparser_descriptor_set_all,d=o.llparser_descriptor_set_nil,f=o.llparser_descriptor_add_char,p=o.llparser_descriptor_add_range,h=o.llparser_descriptor_revert,v=o.llparser_add_rule,m=o.llparser_prepare,b=o.llparser_parse,g=o.llparser_get_input_buffer,w=o.llparser_get_result,y=o.wasm_main,x=o.__wbindgen_start}])},function(e,t,r){var n=r(4),o=function(e){this.empty=!0,this._type=e,this._arr=[],this._index=0};o.create=function(e){return new o(e)},o.prototype.add=function(e){var t=this._index++;return this._arr.push({id:t,func:e}),this.empty=!1,t},o.prototype.remove=function(e){var t=this._arr,r=0;if("function"==typeof e)for(r=0;r<t.length;r++){var n=t[r].func;if(n===e)return t.splice(r,1),this.empty=!t.length,n}else for(r=0;r<t.length;r++)if(t[r].id===e){var o=t[r].func;return t.splice(r,1),this.empty=!t.length,o}return null},o.prototype.call=function(e,t,r){for(var n=this._arr,o=!1,i=0;i<n.length;i++){var l=a(this._type,n[i].func,e,t,r);l===!1&&(o=!0)}if(o)return!1};var i=function(e,t){if(!t.type||l.call(null,[e,t])!==!1){if(n.throwGlobalError)throw e;console.error(e.stack)}},a=o.safeCallback=function(e,t,r,n,o){try{return t.apply(r,n)}catch(l){var a="[Exparser] [Error] [Component] "+(e||"Error Listener")+" Error @ ";r&&r.is&&(a+=r.is),a+="#"+(t.name||"(anonymous)"),o&&o.triggerLifeTime("error",[l]),i(l,{message:a,type:e,element:r,method:t,args:n})}},l=o.create();o.addGlobalErrorListener=function(e){return l.add(e)},o.removeGlobalErrorListener=function(e){return l.remove(e)},e.exports=o},function(e,t){var r={lazyRegistration:!0,publicProperties:!1,availability:null,domain:"",writeOnly:!1,allowInWriteOnly:!1,classPrefix:null,addGlobalClass:!1,templateEngine:null,renderingMode:"full",multipleSlots:!1,reflectToAttributes:!1,writeFieldsToNode:!0,writeIdToDOM:!1,separateInnerData:!0,innerDataExclude:null,listenerChangeLifeTimes:!1,randomizeTagName:!1,virtualHost:!1,throwGlobalError:!1,writeExtraInfoToAttr:!1,documentBackend:"undefined"!=typeof window&&"undefined"!=typeof document?"dom":"none",hasDOMBackend:!("undefined"==typeof window||"undefined"==typeof document)};e.exports=r},function(e,t){var r=Object.prototype.hasOwnProperty,n=function(e,t){var o=typeof e;if("object"===o&&null!==e){var i=t?t.get(e):void 0;if(void 0!==i)return i;if(e instanceof Array){i=[],t&&t.set(e,i);for(var a=0;a<e.length;a++)i[a]=n(e[a],t)}else{i={},t&&t.set(e,i);for(var l in e)r.call(e,l)&&(i[l]=n(e[l],t))}return i}if("symbol"!==o)return e};t.deepCopy=function(e,t){var r=t&&"undefined"!=typeof WeakMap?new WeakMap:null;return n(e,r)}},function(e,t,r){var n=r(3),o=(Object.prototype.hasOwnProperty,function(){});o.prototype=Object.create(Object.prototype,{constructor:{value:o,writable:!0,configurable:!0}});var i=null;o._setElementSystem=function(e){i=e,o._setElementSystem=null};var a=null;o._setComponent=function(e){a=e,o._setComponent=null};var l=Date.now();o.setInitTimeStamp=function(e){return l=void 0===e?Date.now():e},o.getInitTimeStamp=function(e){return l},o.create=function(e,t,r){r=r||{};var n=r.originalEvent,i=r.extraFields||{},a=Date.now()-l,s=new o;s.currentTarget=null,s.type=e,s.timeStamp=a,s.mark=null,s.detail=t,s.bubbles=!!r.bubbles,s.composed=!!r.composed,s.__originalEvent=n,s.__hasCapture=!!r.capturePhase,s.__stopped=!1,s.__dispatched=!1;for(var _ in i)s[_]=i[_];return s},o.prototype.preventDefault=function(){this.__originalEvent&&this.__originalEvent.preventDefault()},o.prototype.stopPropagation=function(){this.__stopped=!0},o.prototype.isStopped=function(){return!!this.__stopped};o.prototype.markMutated=function(){this.__mutatedMarked=!0},o.prototype.mutatedMarked=function(){return!!this.__mutatedMarked};var s=function(e,t,r,n){for(var o=e,a=e instanceof i?e.collectMarks():{},l=[],s=[],_=e;_;){if(o!==_&&(l.push(e),e=_,s.push(a),a=e instanceof i?e.collectMarks():{}),o=_.parentNode,n(_,e,a)===!1)return;if(_.__wxHost){if(r)break;e=l.pop()||_.__wxHost,a=s.pop()||(e instanceof i?e.collectMarks():{}),_=_.__wxHost,o=_}else{var c=!0;_ instanceof i&&(c=!1),_=c||r?_.parentNode:_.__wxSlotParent;
- }}};o.dispatchEvent=function(e,t){if(!t.__dispatched){t.__dispatched=!0,e.__wxElement&&e.__wxHost!==e.__wxElement&&(e=e.__wxElement,e.shadowRoot instanceof i&&(e=e.shadowRoot)),t.target=e instanceof i?e.__methodCaller:e;var r=function(e,r,n){if(!(r&&r.length&&t.mutatedMarked())){var o=t.currentTarget=n instanceof i?n.__methodCaller:n,l=e.call(o,[t],n instanceof a?n:void 0);r&&r.length&&t.markMutated(),l===!1&&(t.__originalEvent&&t.__originalEvent.preventDefault(),t.__stopped=!0)}},n=t.type,o=!t.composed;if(t.__hasCapture){var l=[];s(e,n,o,function(e,t,r){return e.__wxCaptureEvents&&e.__wxCaptureEvents[n]&&l.push([e,t,r]),!0});for(var _=l.length-1;_>=0;_--){var c=l[_],u=c[0],d=c[1];t.target=d instanceof i?d.__methodCaller:d,t.mark=c[2];var f=u.__wxCaptureMutated&&u.__wxCaptureMutated[n];if(r(u.__wxCaptureEvents[n],f,u),t.__stopped)break}}if(t.target=e instanceof i?e.__methodCaller:e,!t.__stopped){var p=!t.bubbles;s(e,n,o,function(e,o,a){t.target=o instanceof i?o.__methodCaller:o,t.mark=a;var l=e.__wxMutated&&e.__wxMutated[n];return e.__wxEvents&&e.__wxEvents[n]&&r(e.__wxEvents[n],l,e),!p&&!t.__stopped})}}},o.triggerEvent=function(e,t,r,n){var i=o.create(t,r,n);o.dispatchEvent(e,i)},o.addListenerToElement=function(e,t,r,o){var i=o&&o.mutated;if(i){var l=r;r=function(e){if(!e.mutatedMarked()){var t=Array.prototype.slice.call(arguments);return l.apply(this,t)}}}var s=void 0;return o&&(o.useCapture||o.capture)?(e.__wxCaptureEvents||(e.__wxCaptureEvents=Object.create(null)),e.__wxCaptureEvents[t]||(e.__wxCaptureEvents[t]=n.create("Event Listener")),s=e.__wxCaptureEvents[t].add(r),i&&(e.__wxCaptureMutated||(e.__wxCaptureMutated=Object.create(null)),e.__wxCaptureMutated[t]||(e.__wxCaptureMutated[t]=[]),e.__wxCaptureMutated[t].push(s))):(e.__wxEvents||(e.__wxEvents=Object.create(null)),e.__wxEvents[t]||(e.__wxEvents[t]=n.create("Event Listener")),s=e.__wxEvents[t].add(r),i&&(e.__wxMutated||(e.__wxMutated=Object.create(null)),e.__wxMutated[t]||(e.__wxMutated[t]=[]),e.__wxMutated[t].push(s))),e instanceof a&&e.__componentOptions.listenerChangeLifeTimes&&e.triggerLifeTime("listenerChanged",[!0,t,r,o]),s},o.removeListenerFromElement=function(e,t,r,n){var o=null;if(n&&(n.useCapture||n.capture)){if(e.__wxCaptureEvents&&e.__wxCaptureEvents[t]&&(o=e.__wxCaptureEvents[t].remove(r)),e.__wxCaptureMutated&&e.__wxCaptureMutated[t]){var i=e.__wxCaptureMutated[t].indexOf(r);i!==-1&&e.__wxCaptureMutated[t].splice(i,1)}}else if(e.__wxEvents&&e.__wxEvents[t]&&(o=e.__wxEvents[t].remove(r)),e.__wxMutated&&e.__wxMutated[t]){var i=e.__wxMutated[t].indexOf(r);i!==-1&&e.__wxMutated[t].splice(i,1)}o&&e instanceof a&&e.__componentOptions.listenerChangeLifeTimes&&e.triggerLifeTime("listenerChanged",[!1,t,o,n])},e.exports=o},function(e,t,r){var n=r(1),o=" \n\r\t\f",i=null,a=function(){i=n.create({MULTIPLE_PATHS:[{id:"arrayConcat",states:["MULTIPLE_PATHS",",","SINGLE_PATH"]},{id:"array",states:["SINGLE_PATH"]}],SINGLE_PATH:[{id:"arrayConcat",states:["SINGLE_PATH",".","VAR_NAME"]},{id:"arrayConcat",states:["SINGLE_PATH","[","INT","]"]},{id:"array",states:["VAR_NAME"]},{id:"_jump",states:["SINGLE_PATH",o]}],VAR_NAME:[{id:"_blank",states:[o,"VAR_NAME"]},{id:"_jump",states:["VAR_NAME",o]},{id:"_raw",states:["*","*"]},{id:"_raw",states:["_a-zA-Z$","VAR_NAME_AFTER"]}],VAR_NAME_AFTER:[{id:"_raw",states:["_a-zA-Z0-9$","VAR_NAME_AFTER"]},{id:"_raw",states:["NULL"]}],INT:[{id:"_blank",states:[o,"INT"]},{id:"_jump",states:["INT",o]},{id:"toNumber",states:["0-9","INT_AFTER"]}],INT_AFTER:[{id:"_raw",states:["0-9","INT_AFTER"]},{id:"_raw",states:["NULL"]}]},{arrayConcat:function(e){return e[0].push(e[2]),e[0]},array:function(e){return e},toNumber:function(e){return parseInt(e[0]+e[1],10)}})};t.parseMultiPaths=function(e){return i||a(),i.parse("MULTIPLE_PATHS",e)},t.parseSinglePath=function(e){for(var t=e.length,r=[],n="",o=0,i=!1,a=!1,l=0;l<t;l++){var s=e[l];if("\\"===s)l+1<t&&("."===e[l+1]||"["===e[l+1]||"]"===e[l+1]||"\\"===e[l+1])?(n+=e[l+1],l++):n+="\\";else if("."===s)n&&(r.push(n),n="");else if("["===s){if(n&&(r.push(n),n=""),0===r.length)throw new Error("The path string should not start with []: "+e);a=!0,i=!1}else if("]"===s){if(!i)throw new Error("There should be digits inside [] in the path string: "+e);a=!1,r.push(o),o=0}else if(a){if(s<"0"||s>"9")throw new Error("Only digits (0-9) can be put inside [] in the path string: "+e);i=!0,o=10*o+s.charCodeAt(0)-48}else n+=s}if(n&&r.push(n),0===t)throw new Error("The path string should not be empty");return r}},function(e,t,r){var n=r(3),o=r(4),i=r(7),a=["created","ready","cacheAttached","attached","moved","detached","saved","restored","error","listenerChanged","performanceData"],l=[String,Number,Boolean,Object,Array,null],s=function(){},_=i.parseMultiPaths,c=function(){},u=(c.matchTypeWithValue=function(e,t){if(e===String){if("string"!=typeof t)return!1}else if(e===Number){if(!Number.isFinite(t))return!1}else if(e===Boolean){if("boolean"!=typeof t)return!1}else if(e===Object){if(null===t||t.constructor!==Object)return!1}else if(e===Array){if(t.constructor!==Array)return!1}else if(void 0===t)return!1;return!0},function(e){for(var t=[],r=0;r<e.length;r++)t[r]=e[r];return t}),d=function(e){var t={};for(var r in e)t[r]=e[r];return t},f=function(e,t){for(var r in t)hasOwnProperty.call(e,r)?"object"!=typeof e[r]||"object"!=typeof t[r]||null===t[r]||t[r]instanceof Array?e[r]=t[r]:(e[r]instanceof Array?e[r]=u(e[r]):e[r]=d(e[r]),f(e[r],t[r])):e[r]=t[r]};c.create=function(e){var t=new c;return t.is=e.is||"",t.using=e.using||{},t.generics=e.generics||{},t.template=e.template,t.externalClasses=e.externalClasses||[],t.data="object"==typeof e.data?{}:null,t.properties=Object.create(null),t.methods=Object.create(null),t.listeners=Object.create(null),t.relations=Object.create(null),t.ancestors=[],t.initiator=e.initiator,t.lifetimes=Object.create(null),t.pageLifetimes=Object.create(null),t.observers=[],t.options={publicProperties:!!(e.options&&void 0!==e.options.publicProperties?e.options.publicProperties:o.publicProperties)},t.definitionFilter=e.definitionFilter,t._unprepared=e,(e.options&&void 0!==e.options.lazyRegistration?e.options.lazyRegistration:o.lazyRegistration)||c.prepare(t),e.is&&(c._list[e.is]=t),t},c.prepare=function(e){var t=e._unprepared;if(t){e._unprepared=null;var r=e.ancestors,n="",o=0;for(o=0;o<(t.behaviors||[]).length;o++){var i=t.behaviors[o],u=i;"string"==typeof u&&(u=c._list[i]),u._unprepared&&c.prepare(u),"object"==typeof u.data&&(null===e.data?e.data=u.data:f(e.data,u.data));for(n in u.generics){var d=u.generics[n];"object"!=typeof d&&(d={}),e.generics[n]={default:d.default}}for(n in u.properties)e.properties[n]=u.properties[n];for(n in u.relations)e.relations[n]=u.relations[n];for(n in u.methods)e.methods[n]=u.methods[n];for(var p=0;p<u.ancestors.length;p++)r.indexOf(u.ancestors[p])<0&&r.push(u.ancestors[p])}"object"==typeof t.data&&(null===e.data?e.data=t.data:f(e.data,t.data));for(n in t.properties){var h=t.properties[n];l.indexOf(h)>=0?h={type:h}:l.indexOf(h.type)<0&&h.optionalTypes&&h.optionalTypes.length>0&&(h.type=h.optionalTypes[0]),void 0===h.value&&(h.type===String?h.value="":h.type===Number?h.value=0:h.type===Boolean?h.value=!1:h.type===Array?h.value=[]:h.value=null),e.properties[n]={type:h.type,optionalTypes:h.optionalTypes,value:h.value,filter:h.filter,observer:h.observer,public:!!(void 0===h.public?e.options.publicProperties:h.public),availability:h.availability,observeAssignments:!!h.observeAssignments}}if(t.lifetimes&&"object"==typeof t.lifetimes)for(n in t.lifetimes)e.lifetimes[n]=t.lifetimes[n];for(o=0;o<a.length;o++)void 0===e.lifetimes[a[o]]&&(e.lifetimes[a[o]]=t[a[o]]);for(n in t.listeners)e.listeners[n]=t.listeners[n];var v=t.observers;if(v instanceof Array)for(o=0;o<v.length;o++){var m=v[o];e.observers.push({paths:_(m.fields||"**"),observer:m.observer})}else for(n in v)e.observers.push({paths:_(n),observer:v[n]});if(t.pageLifetimes&&"object"==typeof t.pageLifetimes)for(n in t.pageLifetimes)e.pageLifetimes[n]=t.pageLifetimes[n];for(n in t.relations){var b=t.relations[n];e.relations[n]={target:b.target||n,type:b.type,linked:b.linked||s,linkChanged:b.linkChanged||s,unlinked:b.unlinked||s,linkFailed:b.linkFailed||s}}for(n in t.methods)"function"==typeof t.methods[n]&&(e.methods[n]=t.methods[n]);r.push(e)}},c._list=Object.create(null),c.prototype.hasBehavior=function(e){this._unprepared&&c.prepare(this);for(var t=0;t<this.ancestors.length;t++)if(e instanceof c){if(this.ancestors[t]===e)return!0}else if(this.ancestors[t]===c._list[e])return!0;return!1},c.prototype._getAllListeners=function(){for(var e={},t=this.ancestors,r=0;r<t.length;r++){var n=this.ancestors[r];for(var o in n.listeners)Object.prototype.hasOwnProperty.call(e,o)?e[o].push(n.listeners[o]):e[o]=[n.listeners[o]]}return e},c.prototype._addObserversToDataProxy=function(e){for(var t=this.ancestors,r=0;r<t.length;r++)for(var n=this.ancestors[r].observers,o=0;o<n.length;o++){var i=n[o];e.addObserver(i.observer,i.paths)}},c.prototype._getAllLifeTimeFuncs=function(){var e={},t=this.ancestors;a.forEach(function(t){e[t]=n.create("Lifetime Method")});for(var r=0;r<t.length;r++){var o=t[r];for(var i in o.lifetimes)o.lifetimes[i]&&(e[i]||(e[i]=n.create("Lifetime Method")),e[i].add(o.lifetimes[i]))}return e},c.prototype._getAllPageLifeTimeFuncs=function(){for(var e={},t=this.ancestors,r=0;r<t.length;r++){var o=t[r];for(var i in o.pageLifetimes)o.pageLifetimes[i]&&(e[i]||(e[i]=n.create("Page Lifetime Method")),e[i].add(o.pageLifetimes[i]))}return e},c.callDefinitionFilter=function(e){var t=e.definitionFilter,r=[];return e.behaviors instanceof Array&&e.behaviors.forEach(function(t){t="string"==typeof t?c._list[t]:t,t&&t.definitionFilter&&(r.push(t.definitionFilter),t.definitionFilter.call(null,e))}),"function"==typeof t?function(e){t(e,r)}:null},e.exports=c},function(e,t,r){var n=r(6),o=r(10),i=r(11),a=r(12),l=r(14),s=r(4),_=r(13),c=function(e){u(this,e||null)};c.prototype=Object.create(Object.prototype,{constructor:{value:c,writable:!0,configurable:!0},id:{get:function(){return this.__id},set:function(e){var t=String(e);if(this.__id!==t){if(this.__id=t,this.ownerShadowRoot){var r=this.ownerShadowRoot.__wxHost;r.__idCacheDirty=!0,this.__domElement&&r.__componentOptions.writeIdToDOM&&(this.__domElement.id=t)}s.writeExtraInfoToAttr&&this.__domElement&&this.__domElement.setAttribute("exparser:info-attr-id",t),(this.__propObservers&&!this.__propObservers.empty||this.__subtreeObserversCount)&&o._callObservers(this,"__propObservers",{type:"properties",target:this,propertyName:"id"})}},configurable:!0},slot:{get:function(){return this.__slot},set:function(e){e=String(e),this.__slot!==e&&(this.__inheritSlots||(this.__slot=e,w(this),(this.__propObservers&&!this.__propObservers.empty||this.__subtreeObserversCount)&&o._callObservers(this,"__propObservers",{type:"properties",target:this,propertyName:"slot"})))},configurable:!0},attributes:{get:function(){var e=[];if(!this.__attributes)return e;for(var t in this.__attributes)e.push({name:t,value:this.__attributes[t]});return e},set:function(){},configurable:!0},class:{get:function(){return this.classList.getClassNames()},set:function(e){this.classList&&this.classList.setClassNames(e),(this.__propObservers&&!this.__propObservers.empty||this.__subtreeObserversCount)&&o._callObservers(this,"__propObservers",{type:"properties",target:this,propertyName:"class"})},configurable:!0},style:{get:function(){return this.__domElement?this.__domElement.style:null},set:function(e){return P.call(this,e)},configurable:!0}}),n._setElementSystem(c),i._setElementSystem(c);var u=c.initialize=function(e,t,r){e.__id="",e.__slot="",e.__virtual=!1,e.__inheritSlots=!1,e.__attributes=null,e.__marks=null,e.__attached=!1,e.parentNode=null,e.childNodes=[],e.ownerShadowRoot=r,e.__wxSlotParent=null,e.__wxSlotChildren=e.childNodes,e.__subtreeObserversCount=0,e.classList=null,e.__styleSegments=[],e.__methodCaller=e,e.__relationHandler=null,e.__backendExtracted=_.backendExtractedDefault,e.__domElement=t,e.$$=t,t&&(t.__wxElement=e)};c._clone=function(e,t,r,n){if(e.__id=t.__id,e.__slot=t.__slot,e.__virtual=t.__virtual,e.__inheritSlots=t.__inheritSlots,e.__marks=t.__marks?{}:null,t.__marks)for(var o in t.__marks)e.__marks[o]=t.__marks[o];e.__attributes=Object.create(null);for(var i in t.__attributes)e.__attributes[i]=t.__attributes[i];e.__attached=!1,e.parentNode=null,e.childNodes=[],e.ownerShadowRoot=n,e.__wxSlotParent=null,e.__wxSlotChildren=e.childNodes,e.__subtreeObserversCount=0,e.classList=null,e.__styleSegments=[],e.__methodCaller=e,e.__relationHandler=null,e.__backendExtracted=_.backendExtractedDefault,e.__domElement=r,e.$$=r,r&&(r.__wxElement=e)};var d=function(e){if(!e.parentNode||e.parentNode.__attached){var t=function(e){if(e instanceof c){e.__attached=!0,e.__lifeTimeFuncs&&e.__lifeTimeFuncs.attached.call(e.__methodCaller,[],e),e.__relationHandler&&e.__relationHandler("attached"),e.__attachedObservers&&!e.__attachedObservers.empty&&o._callSingleObserver(e,"__attachedObservers",{type:"attachStatus",target:e,status:"attached"}),e.shadowRoot instanceof c&&t(e.shadowRoot);for(var r=e.childNodes,n=0;n<r.length;n++)t(r[n])}};t(e)}},f=function(e){if(e.__attached){var t=function(e){if(e instanceof c){for(var r=e.childNodes,n=0;n<r.length;n++)t(r[n]);e.shadowRoot instanceof c&&t(e.shadowRoot),e.__attached=!1,e.__lifeTimeFuncs&&e.__lifeTimeFuncs.detached.call(e.__methodCaller,[],e),e.__relationHandler&&e.__relationHandler("detached"),e.__attachedObservers&&!e.__attachedObservers.empty&&o._callSingleObserver(e,"__attachedObservers",{type:"attachStatus",target:e,status:"detached"})}};t(e)}},p=function(e){if(!e.__attached)return d(e);var t=function(e){if(e instanceof c){for(var r=e.childNodes,n=0;n<r.length;n++)t(r[n]);e.shadowRoot instanceof c&&t(e.shadowRoot),e.__lifeTimeFuncs&&e.__lifeTimeFuncs.moved.call(e.__methodCaller,[],e),e.__relationHandler&&e.__relationHandler("moved")}};t(e)},h=function(e,t,r){if(e.__childObservers&&!e.__childObservers.empty||e.__subtreeObserversCount){var n=null,i=[r];n="add"===t?{type:"childList",target:e,addedNodes:i}:"remove"===t?{type:"childList",target:e,removedNodes:i}:{type:"childList",target:e,addedNodes:i,removedNodes:i},o._callObservers(e,"__childObservers",n)}},v=function(e,t){if(e instanceof c&&(!t.__wxHost.__idCacheDirty||!t.__slotCacheDirty)){var r=function(e){e.__id&&(t.__wxHost.__idCacheDirty=!0),void 0!==e.__slotName&&(t.__slotCacheDirty=!0);for(var n=e.childNodes,o=0;o<n.length;o++){var i=n[o];i instanceof c&&r(i)}};r(e)}};c._updateIdMap=function(e){var t=e.shadowRoot;if(e.__idCacheDirty){e.__idCacheDirty=!1;var r=e.__idCache=Object.create(null),n=function(e){e.__id&&(r[e.__id]||(r[e.__id]=e));for(var t=e.childNodes,o=0;o<t.length;o++)t[o]instanceof c&&n(t[o])};n(t)}};var m=function(e){if(e.__hostAssociated&&e.__slotCacheDirty){e.__slotCacheDirty=!1;var t=e.__wxHost,r=null,n=Object.create(null);r=void 0!==t.__singleSlot?{"":t.__singleSlot}:t.__slots;var o=function(e){void 0!==e.__slotName&&(n[e.__slotName]||(n[e.__slotName]=e));for(var t=e.childNodes,r=0;r<t.length;r++)t[r]instanceof c&&o(t[r])};o(e),void 0!==t.__singleSlot?t.__singleSlot!==n[""]&&(n[""]&&(n[""].__wxSlotChildren=t.childNodes),b(t,n,r,!0),t.__singleSlot&&(t.__singleSlot.__wxSlotChildren=[]),t.__singleSlot=n[""]||null):(b(t,n,r,!1),t.__slots=n)}},b=function(e,t,r,n){var o=e.childNodes,i=0;if(n){var a=t[""];if(a)for(;i<o.length;i++)x(a,o[i],null,!1,!1,!1,-1);else if(a=r[""])for(;i<o.length;i++)x(a,null,o[i],!0,!1,!1,i)}else{var l=function(e){for(var n=0;n<e.length;n++){var o=e[n],i=o.__slot||"",a=t[i];a?x(a,o,null,!1,!0,!0):(a=r[i],a&&x(a,null,o,!0,!0,!0)),o.__inheritSlots&&l(o.childNodes)}};l(o)}},g=function(e,t,r,n){for(var o=function(e,t,n){var i=e.childNodes,a=0;for(t&&(a=i.indexOf(t)+(n?0:1));a<i.length;a++){var l=i[a];if(l.__slot===r)return l;if(l.__inheritSlots){var s=o(l,null,!1);if(s)return s}}return null};t!==e;t=t.parentNode){var i=o(t.parentNode,t,n);if(i)return i;n=!1}return null},w=function(e){for(var t=e.parentNode;t&&t.__inheritSlots;)t=t.parentNode;if(t&&void 0===t.__singleSlot){var r=e.__slot||"",n=t.__slots[r];if(n){var o=g(t,e,r,!1);x(n,e,o,!1,!0,!0)}else n=e.__wxSlotParent,n&&x(n,null,e,!0,!0,!0)}},y=function(e,t,r,n,o){var i=e;if(i instanceof c){for(;i.__virtual;){var a=i.__wxSlotParent;if(!a){i=null;break}if(t&&!r){var l=a.__wxSlotChildren.indexOf(i);r=a.__wxSlotChildren[l+1]}i=a}i instanceof c&&(i=i.__domElement)}if(i){var s=n,_=null,u=null;if(t)if(t.__virtual){var d=document.createDocumentFragment(),f=function(e){for(var t=0;t<e.__wxSlotChildren.length;t++){var r=e.__wxSlotChildren[t];r.__virtual?f(r):d.appendChild(r.__domElement)}};f(t),_=d}else _=t.__domElement;if(r)if(r.__virtual){var p=e,h=0;if(n){var v=function(e){for(var t=0;t<e.__wxSlotChildren.length;t++){var r=e.__wxSlotChildren[t];r.__virtual?v(r):i.removeChild(r.__domElement)}};v(r),s=!1,h=o+1}else p=r.__wxSlotParent,h=r===t?o:p.__wxSlotChildren.indexOf(r);if(t){var m=function(e,t){for(;t<e.__wxSlotChildren.length;t++){var r=e.__wxSlotChildren[t];if(!r.__virtual)return r;var n=m(r,0);if(n)return n}};r=null;for(var b=p;r=m(b,h),!r&&b.__virtual;b=b.__wxSlotParent)h=b.__wxSlotParent.__wxSlotChildren.indexOf(b)+1;r&&(u=r.__domElement)}}else u=r.__domElement;s?_?i.replaceChild(_,u):i.removeChild(u):_&&(u?i.insertBefore(_,u):i.appendChild(_))}else if(t&&t.__wxSlotParent){var g=function(e){if(e.__virtual)for(var t=0;t<e.__wxSlotChildren.length;t++)g(e.__wxSlotChildren[t]);else{var r=e.__domElement;r&&r.parentNode&&r.parentNode.removeChild(r)}};g(t)}},x=function(e,t,r,n,o,i,a){if(n&&(r.__wxSlotParent=null),o&&(a=e.__wxSlotChildren.indexOf(r)),t){var l=t.__wxSlotParent;if(t.__wxSlotParent=e,l&&i){var _=l.__wxSlotChildren.indexOf(t);l.__wxSlotChildren.splice(_,1),l===e&&_<a&&a--}}var u=!1;t&&t.__backendExtracted?u=!0:r&&r.__backendExtracted&&(u=!0),u||y(e,t,r,n,a),s.writeExtraInfoToAttr&&(n&&r instanceof c&&r.__domElement&&r.__domElement.removeAttribute("exparser:info-in-slot-of"),t instanceof c&&t.__domElement&&(void 0!==e.__slotName&&e.ownerShadowRoot?t.__domElement.setAttribute("exparser:info-in-slot-of",e.ownerShadowRoot.__wxHost.__componentInstanceId):t.__domElement.removeAttribute("exparser:info-in-slot-of"))),o&&(a===-1&&(a=e.__wxSlotChildren.length),t?e.__wxSlotChildren.splice(a,n?1:0,t):e.__wxSlotChildren.splice(a,n?1:0))},C=function(e,t){for(var r=e.childNodes,n=0;n<r.length;n++){var o=r[n];t(e,o),o.__inheritSlots&&C(o,t)}},E=c.insertChildToElement=function(e,t,r,n){if(void 0!==e.__slotName)return!1;var i=r>=0?e.childNodes[r]:null;n&&t===i&&(n=!1);var a=null,l=e,s=e;if(t){a=t.parentNode,t.parentNode=e;var _=e.__subtreeObserversCount;if(a){var c=a.childNodes.indexOf(t);a.childNodes.splice(c,1),a===e&&c<r&&r--,_-=a.__subtreeObserversCount}_&&o._updateSubtreeCaches(t,_)}for(var u=e;u&&u.__inheritSlots;)u=u.parentNode;for(var b=!u||!u.__slots,w=!b||e.__inheritSlots,y=a;y&&y.__inheritSlots;)y=y.parentNode;var E=!y||!y.__slots,S=!E||a&&a.__inheritSlots;if(b)void 0!==e.__singleSlot&&(l=s=e.__singleSlot),l?x(l,t,i,n,w,S,r):t.__wxSlotParent&&x(t.__wxSlotParent,null,t,!0,S,!1),t&&!E&&t.__inheritSlots&&C(t,function(e,t){x(e,t,null,!1,!0,!0,-1)});else{var O="";if(t&&(O=t.__slot||"",l=u.__slots[O]||null),i&&(s=u.__slots[i.__slot||""]||null),i&&s&&n&&x(s,null,i,n,!0,!1),t)if(l){var N=i?g(u,i,O,!n):g(u,e,O,!1);x(l,t,N,!1,!0,S)}else t.__wxSlotParent&&x(t.__wxSlotParent,null,t,!0,S,!1);i&&n&&i.__inheritSlots&&C(i,function(e,t){x(e,t,null,!1,!0,!0,-1)}),t&&t.__inheritSlots&&C(t,function(t,r){var o=r.__slot||"",a=u.__slots[o]||null;if(a){var l=i?g(u,i,o,!n):g(u,e,o,!1);x(a,r,l,!1,!0,!0)}else r.__wxSlotParent&&x(r.__wxSlotParent,null,r,!0,!0,!1)})}return n&&(e.__subtreeObserversCount&&o._updateSubtreeCaches(i,-e.__subtreeObserversCount),i.parentNode=null),r===-1&&(r=e.childNodes.length),t?e.childNodes.splice(r,n?1:0,t):e.childNodes.splice(r,n?1:0),e.ownerShadowRoot&&(n&&v(i,e.ownerShadowRoot),t&&v(t,e.ownerShadowRoot),m(e.ownerShadowRoot)),n&&(f(i),h(e,"remove",i)),t&&(a?p(t):d(t),a===e?h(e,"move",t):(a&&h(a,"remove",t),h(e,"add",t))),!0},S=function(e,t,r,n){if(t&&e.ownerShadowRoot!==t.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");var o=n?r:t,i=-1;if(r&&(i=e.childNodes.indexOf(r),i<0))return null;var a=E(e,t,i,n);return a?o:null};c._attachShadowRoot=function(e){var t=e.__wxHost;t.__wxSlotChildren=[e],x(t,e,null,!1,!1,0),e.__hostAssociated=!0,m(e)},c.appendChild=function(e,t){return S(e,t,null,!1)},c.insertBefore=function(e,t,r){return S(e,t,r,!1)},c.removeChild=function(e,t){return S(e,null,t,!0)},c.replaceChild=function(e,t,r){return S(e,t,r,!0)},c.prototype.appendChild=function(e){return S(this,e,null,!1)},c.prototype.insertBefore=function(e,t){return S(this,e,t,!1)},c.prototype.removeChild=function(e){return S(this,null,e,!0)},c.prototype.replaceChild=function(e,t){return S(this,e,t,!0)};var O=function(e){var t=!0,r=!0;if(e instanceof c?(e.__backendExtracted=!0,e.$$=e.__domElement=null,r=!1):e instanceof a&&(e.__backendExtracted=!0,e.$$=e.__domElement=null,t=!1,r=!1),t&&e.__wxSlotChildren)for(var n=0;n<e.__wxSlotChildren.length;n++){var o=e.__wxSlotChildren[n];O(o)}else if(r&&e.childNodes)for(var i=0;i<e.childNodes.length;i++)O(e.childNodes[i])};c.extractBackend=function(e){if(e.__backendExtracted)return null;var t=e.__domElement;return O(e),t};var N=function(e,t){if(!t){var r=l.toElement(e.__domElement);return e.$$=e.__domElement=r,r}if(e.__domElement.tagName.toUpperCase()===t.tagName)e.$$=e.__domElement=t;else{var n=l.toElement(e.__domElement);e.$$=e.__domElement=n,t.parentNode.replaceChild(n,t)}return null},k=function(e,t){if(!t){var r=document.createTextNode(e.textContent);return e.$$=e.__domElement=r,r}if("undefined"!=typeof t.textContent)t.textContent=e.textContent,e.$$=e.__domElement=t;else{var n=document.createTextNode(e.textContent);e.$$=e.__domElement=n,t.parentNode.replaceChild(n,t)}return null},T=function(e,t){if(!t)return e;for(;e.childNodes&&t.childNodes&&t.childNodes.length;)e.appendChild(t.childNodes[0]);return t.parentNode.replaceChild(e,t),null},A=function(e,t,r){var n=e instanceof c&&e.__virtual,o=t?t.childNodes[r]:void 0,i=!0,l=!0,s=null;if(e instanceof c)e.__backendExtracted=!1,n||(s=N(e,o)),l=!1;else if(e instanceof a)e.__backendExtracted=!1,s=k(e,o),i=!1,l=!1;else{var _=document.createDocumentFragment();if(_.__wxSlotChildren=e.__wxSlotChildren,o&&o.childNodes)for(;o.childNodes.length;)_.appendChild(o.childNodes[0]);s=T(e,o),e=_}s?(t.appendChild(s),o=s):o=t?t.childNodes[r]:void 0;var u=0;if(i&&e.__wxSlotChildren)for(var d=0;d<e.__wxSlotChildren.length;d++){var f=e.__wxSlotChildren[d];if(n)r=A(f,t,r);else if(f.asShadowRoot){for(var p=0;p<f.asShadowRoot.childNodes.length;p++)u=A(f.asShadowRoot.childNodes[p],o,u);e.shadowRoot=o,o.__wxHost=e,e.__wxSlotChildren[0]=o,o.__wxSlotParent=e,e.__singleSlot===f&&(e.__singleSlot=o)}else u=A(f,o,u)}else if(l&&e.childNodes)for(var h=0;h<e.childNodes.length;h++)u=A(e.childNodes[h],o,u);if(n)return r;for(;o.childNodes.length>u;)o.removeChild(o.childNodes[u]);return r+1};c.injectBackend=function(e,t){if(e.__backendExtracted){var r=document.createDocumentFragment();r.appendChild(t),A(e,r,0)}},c.prototype.triggerEvent=function(e,t,r){n.triggerEvent(this,e,t,r)},c.prototype.dispatchEvent=function(e){n.dispatchEvent(this,e)},c.prototype.addListener=function(e,t,r){n.addListenerToElement(this,e,t,r)},c.prototype.removeListener=function(e,t,r){n.removeListenerFromElement(this,e,t,r)},c.setMethodCaller=function(e,t){e.__methodCaller=t},c.getMethodCaller=function(e){return e.__methodCaller},c.prototype.getAttribute=function(e){if(!this.__attributes)return null;var t=this.__attributes[e];return void 0===t?null:t},c.prototype.setAttribute=function(e,t){this.__attributes||(this.__attributes=Object.create(null)),t=String(t),this.__attributes[e]=t,this.__domElement&&this.__domElement.setAttribute(e,t)},c.prototype.removeAttribute=function(e){this.__attributes&&(delete this.__attributes[e],this.__domElement&&this.__domElement.removeAttribute(e))},c.prototype.setMark=function(e,t){this.__marks||(this.__marks={}),this.__marks[e]=t},c.prototype.collectMarks=function(){for(var e={},t=this;t;t=t.parentNode)if(t.__marks)for(var r in t.__marks)hasOwnProperty.call(e,r)||(e[r]=t.__marks[r]);return e};var P=c.prototype.setNodeStyle=function(e,t){this.__styleSegments[t||0]=e;var r=this.__styleSegments.join(";");if(this.__domElement&&this.ownerShadowRoot&&this.ownerShadowRoot.__childrenPropsFilter){var n=this.ownerShadowRoot.__childrenPropsFilter,i=n.style;if("function"==typeof i)return void this.__domElement.setAttribute("style",i.call(this,r))}this.__domElement&&this.__domElement.setAttribute("style",r),(this.__propObservers&&!this.__propObservers.empty||this.__subtreeObserversCount)&&o._callObservers(this,"__propObservers",{type:"properties",target:this,propertyName:"style"})};c.replaceDocumentElement=function(e,t){e.__attached||(t.parentNode.replaceChild(e.__domElement,t),d(e))},c.pretendAttached=function(e){e.__attached||d(e)},c.pretendDetached=function(e){e.__attached&&f(e)},c.isAttached=function(e){return e.__attached},c.setSlotName=function(e,t){if(t=null==t?"":String(t),void 0===e.__slotName){if(0!==e.childNodes.length||0!==e.__wxSlotChildren.length)return;e.__wxSlotChildren=[]}e.__slotName=t,e.ownerShadowRoot&&(e.ownerShadowRoot.__slotCacheDirty=!0,m(e.ownerShadowRoot))},c.setInheritSlots=function(e){e.__singleSlot||e.__slots||e.__wxSlotChildren.length||(e.__wxSlotChildren=[],e.__inheritSlots=!0)},c.getInheritSlots=function(e){return e.__inheritSlots};var L=function(e,t){var r=e.match(/^(#[_a-zA-Z][-_a-zA-Z0-9:]*|)((?:\.-?[_a-zA-Z][-_a-zA-Z0-9]*)+|)$/);if(!r)return null;var n=r[1].slice(1),o=r[2].split(".");return o.shift(),n||o.length?{id:n,classes:o,relation:t||""}:null},M=c.parseSelector=function(e){for(var t=String(e||"").split(","),r=[],n=!1,o=0;o<t.length;o++){for(var i=t[o].split(/( |\t|>+)/g),a=[],l="",s=0;s<i.length;s++){var _=i[s];if(_&&" "!==_&&"\t"!==_)if(">"!==_[0]){var c=L(_,l);if(l="",!c)break;a.push(c)}else{if(""!==l)break;l=_,">>>"===_&&(n=!0)}}s===i.length&&a.length&&r.push(a)}return r.length?{crossShadow:n,union:r}:null},R=function(e,t,r,n,o){if(t===e)return!1;var i=r[n],a=!0;i.id&&i.id!==t.__id&&(a=!1);for(var l=i.classes,s=0;a&&s<l.length;s++)t.classList.contains(l[s])||(a=!1);if(!a&&">"===o)return!1;var _=t;if(a&&0===n){if(null===e)return!0;for(_=_.parentNode;_;_=_.parentNode)if(_===e)return!0;if(">>>"!==o)return!1;_=t,a=!1}var c=a?i.relation:o;do _.parentNode?_=_.parentNode:">>>"===c?_=_.__wxHost:">>>"===o?(a=!1,_=_.__wxHost):_=null,_===e&&(_=null);while(_&&_.__virtual);if(!_)return!1;if(a){var u=R(e,_,r,n-1,c);if(u)return!0;if(">>>"!==o)return!1}return R(e,_,r,n,o)},I=function(e,t,r){if(r.__virtual)return!1;for(var n=e.union,o=0;o<n.length;o++){var i=n[o];if(R(t,r,i,i.length-1,">"))return!0}return!1},D=function(e,t,r,n,o){if(I(t,r,n)&&(e.push(n),o))return!0;if(n.shadowRoot&&t.crossShadow){var i=n.ownerShadowRoot?n.ownerShadowRoot.__wxHost.__componentOptions.domain:s.domain,a=n.__componentOptions.domain;if(i===a&&D(e,t,r,n.shadowRoot,o)&&o)return!0}for(var l=n.childNodes,_=0;_<l.length;_++)if(l[_]instanceof c&&D(e,t,r,l[_],o)&&o)return!0;return!1};c.prototype.querySelector=function(e){var t="object"==typeof e?e:M(e);if(!t)return null;var r=[];return D(r,t,this,this,!0),r[0]||null},c.prototype.querySelectorAll=function(e){var t="object"==typeof e?e:M(e),r=[];return t?(D(r,t,this,this,!1),r):[]},c.matchSelector=function(e,t){var r="object"==typeof e?e:M(e);return!!r&&I(r,null,t)},c.prototype.matchSelector=function(e,t){var r="object"==typeof e?e:M(e);return!!r&&I(r,this,t)},e.exports=c},function(e,t,r){var n=r(3),o=function(){};o.prototype=Object.create(Object.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),o.create=function(e){var t=new o;return t._cb=e,t._noSubtreeCb=function(t){t.target===this&&e.call(this,t)},t._binded=[],t},o.prototype.observe=function(e,t){t=t||{};var r=0,o=t.subtree?this._cb:this._noSubtreeCb;t.properties&&(e.__propObservers||(e.__propObservers=n.create("Observer Callback")),this._binded.push({funcArr:e.__propObservers,id:e.__propObservers.add(o),subtree:t.subtree?e:null}),r++),t.childList&&(e.__childObservers||(e.__childObservers=n.create("Observer Callback")),this._binded.push({funcArr:e.__childObservers,id:e.__childObservers.add(o),subtree:t.subtree?e:null}),r++),t.characterData&&(e.__textObservers||(e.__textObservers=n.create("Observer Callback")),this._binded.push({funcArr:e.__textObservers,id:e.__textObservers.add(o),subtree:t.subtree?e:null}),r++),t.subtree&&i(e,r),t.attachStatus&&(e.__attachedObservers||(e.__attachedObservers=n.create("Observer Callback")),this._binded.push({funcArr:e.__attachedObservers,id:e.__attachedObservers.add(o),subtree:null}))},o.prototype.disconnect=function(){for(var e=this._binded,t=0;t<e.length;t++){var r=e[t];r.funcArr.remove(r.id),r.subtree&&i(r.subtree,-1)}this._binded=[]};var i=o._updateSubtreeCaches=function(e,t){e.__subtreeObserversCount+=t;var r=e.childNodes;if(r)for(var n=0;n<r.length;n++)i(r[n],t)};o._callObservers=function(e,t,r){do e[t]&&e[t].call(e,[r]),e=e.parentNode;while(e&&e.__subtreeObserversCount)},o._callSingleObserver=function(e,t,r){e[t]&&e[t].call(e,[r])},e.exports=o},function(e,t){var r=function(){},n=/(~|\^+)?-?[_0-9a-z][-_0-9a-z]*/gi,o=null;r._setElementSystem=function(e){o=e,r._setElementSystem=null};var i=Object.prototype.hasOwnProperty;r.create=function(e,t){var n=new r;n._prefix="",n._addOriginalClass=!1,n._alias=t,n._resolvedAlias={};for(var o in t)n._resolvedAlias[o]="";return n._rawNames=[],n._elem=e,n._owner=null,n};var a=function(e){var t="",r=e._rawNames,n=e._prefix,o=e._owner?e._owner._resolvedAlias:null,a=e._addOriginalClass;n&&(n+="--");for(var l=0;l<r.length;l++){var s=r[l];if(l&&(t+=" "),o&&i.call(o,s))t+=o[s];else if("~"===s[0])t+=s.slice(1);else if("^"===s[0]){s=s.slice(1);for(var _=e._owner||null;"^"===s[0];)s=s.slice(1),_=_?_._owner:null;var c=_?_._prefix:"";c&&(c+="--"),t+=c+s}else a&&(t+=s+" "),t+=n+s}return t},l=function(e){var t=e._elem.__domElement;if(t){var r=a(e);r?t.setAttribute("class",r):t.removeAttribute("class")}},s=function(e){var t=e.classList;t instanceof r&&(t._alias&&_(t),l(t));for(var n=e.childNodes,i=0;i<n.length;i++)n[i]instanceof o&&s(n[i])},_=function(e){var t=e._owner;if(!t)return!1;var r=!1;for(var n in e._alias){var a=e._alias[n],l=[];if(a)for(var _=0;_<a.length;_++){var c=a[_];if(i.call(t._alias,c)){var u=t._resolvedAlias[c];l.push(u)}else{var d=e._prefix&&c?e._prefix+"--"+c:c;l.push(d)}}var f=l.join(" ");e._resolvedAlias[n]!==f&&(r=!0,e._resolvedAlias[n]=f)}r&&e._elem.shadowRoot instanceof o&&s(e._elem.shadowRoot)};r.prototype.toggle=function(e,t){var r=this._rawNames.indexOf(e);void 0===t&&(t=r<0),t?r<0&&(this._rawNames.push(e),l(this)):r>=0&&(this._rawNames.splice(r,1),l(this))},r.prototype.contains=function(e){for(var t=this._rawNames,r=0;r<t.length;r++){var n=t[r];if("~"===n[0]){if(n.slice(1)===e)return!0}else if("^"===n[0]){for(var o=1;"^"===n[o];)o++;if(n.slice(o)===e)return!0}else if(n===e)return!0}return!1},r.prototype._setOwnerOptions=function(e,t,r){var n=this._prefix;this._prefix=t,n!==t&&(this._addOriginalClass=r,this._owner=e,this._alias&&_(this),l(this))},r.prototype._setAlias=function(e,t){var r=this._owner,o=String(t).match(n);this._alias[e]=o;var a=[];if(o)for(var l=0;l<o.length;l++){var _=o[l];r&&i.call(r._alias,_)?a.push(r._resolvedAlias[_]):a.push(this._prefix?this._prefix+"--"+_:_)}this._resolvedAlias[e]=a.join(" "),s(this._elem.shadowRoot)},r.prototype.setClassNames=function(e){e=void 0===e||null===e?"":String(e),this._rawNames=e.match(n)||[],l(this)},r.prototype.getClassNames=function(){return a(this)},r.prototype.getPrefix=function(){return this._prefix},r.prototype.getAddOriginalClass=function(){return this._addOriginalClass},e.exports=r},function(e,t,r){var n=r(10),o=r(4),i=r(13),a=function(){};a.prototype=Object.create(Object.prototype,{constructor:{
- value:a,writable:!0,configurable:!0}});var l=a._advancedCreate=function(e,t){var r=new a;r.__slot="";var n=null;return i.backendExtractedDefault||"dom"!==o.documentBackend?r.__textContent=e:(n=document.createTextNode(e||""),n.__wxElement=r),r.$$=r.__domElement=n,r.__backendExtracted=i.backendExtractedDefault,r.__subtreeObserversCount=0,r.parentNode=null,r.ownerShadowRoot=t,r};a.create=function(e){return l(e,null)},Object.defineProperty(a.prototype,"textContent",{get:function(){return this.__domElement?this.__domElement.textContent:this.__textContent},set:function(e){this.__domElement?this.__domElement.textContent=e:this.__textContent=String(e),(this.__textObservers&&!this.__textObservers.empty||this.__subtreeObserversCount)&&n._callObservers(this,"__textObservers",{type:"characterData",target:this})}}),e.exports=a},function(e,t){t.backendExtractedDefault=!1,t.enableBackendExtractedDefault=function(){t.backendExtractedDefault=!0},t.disableBackendExtractedDefault=function(){t.backendExtractedDefault=!1}},function(e,t){var r=function(e){this.tagName=e,this.id="",this.attrs={}};r.toElement=function(e){var t=document.createElement(e.tagName);e.id&&(t.id=e.id);for(var r in e.attrs)t.setAttribute(r,e.attrs[r]);return t},r.fromElement=function(e){var t=new r(e.tagName);t.id=e.id;for(var n=e.attributes,o=0;o<n.length;o++)t.attrs[n[o].name]=n[o].value;return t},r.prototype.cloneNode=function(){var e=new r;e.id=this.id;for(var t in this.attrs)e.attrs[t]=this.attrs[t];return e},r.prototype.removeAttribute=function(e,t){delete this.attrs[e]},r.prototype.setAttribute=function(e,t){this.attrs[e]=t},r.prototype.getAttribute=function(e){return this.attrs[e]},e.exports=r},function(e,t,r){var n=r(3),o=r(5),i=r(16),a=r(6),l=r(8),s=r(9),_=r(17),c=r(10),u=r(11),d=r(14),f=r(4),p=r(13),h=r(7),v=a.addListenerToElement,m=h.parseSinglePath,b=o.deepCopy,g=function(){};g.prototype=Object.create(s.prototype,{constructor:{value:g,writable:!0,configurable:!0},data:{get:function(){return this.__dataProxy._data},set:function(e){var t=this.__dataProxy;for(var r in e)t.scheduleReplace([r],e[r]);t.doUpdates()},configurable:!0},$:{get:function(){return s._updateIdMap(this),this.__idCache},set:function(){}}});var w=function(){};w.prototype=Object.create(Object.prototype),a._setComponent(g);var y=null;g._setDefaultTemplateEngine=function(e){y=e,g._setDefaultTemplateEngine=null};var x=function(e,t,r){if(r)for(var n=0;n<r.length;n++)if(l.matchTypeWithValue(r[n],e))return e;return t===String?null===e||void 0===e?"":String(e):t===Number?isFinite(e)?Number(e):0:t===Boolean?!!e:t===Array?e instanceof Array?e:[]:t===Object?"object"==typeof e?e:null:void 0===e?null:e},C=function(e,t,r){var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}),o=typeof r;"boolean"===o?r?e.__domElement.setAttribute(n,""):e.__domElement.removeAttribute(n):"object"===o?e.__domElement.setAttribute(n,JSON.stringify(r)):e.__domElement.setAttribute(n,r)},E=function(e,t,r){var o=[t?t.__wxHost.__componentOptions.domain:void 0],i=n.safeCallback("Availablity Controller",r,e,o);return!!i},S=function(e,t,r,o){var i=[e.ownerShadowRoot?e.ownerShadowRoot.__wxHost.__componentOptions.domain:void 0,o?void 0:r],a=n.safeCallback("Availablity Controller",t,e.__methodCaller,i,e);return!!a};i.setPropUpdater(function(e,t,r,o){var i=e[0],a=this.__propData[i];r=x(r,t.type,t.optionalTypes);var l=!t.availability||S(this,t.availability,r,o);if(!l)return a;if(t.filter){var s=n.safeCallback("Property Filter",t.filter,this.__methodCaller,o?[]:[r,a,e],this);void 0!==s&&(r=s)}return this.__domElement&&this.__componentOptions.reflectToAttributes&&this.__propPublic[i]&&C(this,i,r),r}),i.setPropObserver(function(e,t,r,o,i,a){if(o.observeAssignments||e!==t){var l=r[0];this.__propertyChangeListeners&&this.__propertyChangeListeners[l]&&!a&&n.safeCallback("Property Observer",this.__propertyChangeListeners[l],this.__methodCaller,[e],this),o.observer&&n.safeCallback("Property Observer",o.observer,this.__methodCaller,i?[]:[e,t,r],this),o.public&&(this.__propObservers&&!this.__propObservers.empty||this.__subtreeObserversCount)&&c._callObservers(this,"__propObservers",{type:"properties",target:this,propertyName:l})}});var O=function(e,t,r){t.__relationLinks||(t.__relationLinks={});for(var n=t.__relationLinks[r]=[],o=0;o<e.length;o++)n.push(null)},N=function(e,t,r,o,i){for(var a=g.prototype.hasBehavior,s="parent"===o,_="shadowHost"===o,c=0;c<e.length;c++){var u=e[c],d=null;if(d="object"!=typeof u.target?l._list[u.target]:u.target){var f=t[c],p=null;if(!i)for(var h=_?r.ownerShadowRoot&&r.ownerShadowRoot.__wxHost:r.parentNode;h;h=_?h.ownerShadowRoot&&h.ownerShadowRoot.__wxHost:h.parentNode)if(!h.__virtual){if(a.call(h,d)){var v=null;v=s?h.__relationMap.child:_?h.__relationMap.shadowContent:h.__relationMap.descendant;for(var m=0;m<v.length;m++){var b=v[m],w=null;if(w="object"!=typeof b.target?l._list[b.target]:b.target,w&&a.call(r,w)){p={parent:h,relation:b};break}}}if(s||p)break}t[c]=p,!f||p&&f.parent===p.parent||(n.safeCallback("Relation Unlinked Callback",f.relation.unlinked,f.parent.__methodCaller,[r.__methodCaller],f.parent),n.safeCallback("Relation Unlinked Callback",u.unlinked,r.__methodCaller,[f.parent.__methodCaller],r)),!p||f&&f.parent===p.parent||(n.safeCallback("Relation Linked Callback",p.relation.linked,p.parent.__methodCaller,[r.__methodCaller],p.parent),n.safeCallback("Relation Linked Callback",u.linked,r.__methodCaller,[p.parent.__methodCaller],r)),f&&p&&f.parent===p.parent&&(n.safeCallback("Relation Link Changed Callback",p.relation.linkChanged,p.parent.__methodCaller,[r.__methodCaller],p.parent),n.safeCallback("Relation Link Changed Callback",u.linkChanged,r.__methodCaller,[p.parent.__methodCaller],r)),i||p||n.safeCallback("Relation Link Failed Callback",u.linkFailed,r.__methodCaller,[],r)}}},k=function(e,t){var r=[],n=t.type,o="child"===n,i="shadowContent"===n,a=function(n){for(var l=n.childNodes,_=0;_<l.length;_++){var c=l[_];if(c instanceof s)if(c.__virtual)a(c);else{if(c.__relationLinks){var u=null;if(u=o?c.__relationLinks.parent:i?c.__relationLinks.shadowHost:c.__relationLinks.ancestor)for(var d=0;d<u.length;d++){var f=u[d];if(f&&f.parent===e&&f.relation===t){r.push(c);break}}}i&&c instanceof g&&a(c.shadowRoot),o||a(c)}}};return a(i?e.shadowRoot:e),r},T=function(e,t,r){if(e instanceof s){var n=0,o=null;if(e instanceof g){for(e.__pageLifeTimeFuncs[t]&&e.__pageLifeTimeFuncs[t].call(e.__methodCaller,r||[]),o=e.childNodes,n=0;n<o.length;n++)T(o[n],t,r);e=e.shadowRoot}for(o=e.childNodes,n=0;n<o.length;n++)T(o[n],t,r)}};g._list={},g.register=function(e){var t=e.options||{},r=l.create(e),n=void 0!==t.classPrefix?t.classPrefix:f.classPrefix;null!==n&&void 0!==n||(n=r.is||"");var o=new w;return o._unprepared=r,o.is=e.is||"",o.behavior=r,o.protoFunc=null,o.props=null,o.template=null,o.innerEvents=null,o.generics=r.generics,o.initiator=r.initiator||null,o.options={availability:t.availability||f.availability,domain:t.domain||f.domain,writeOnly:!!(void 0!==t.writeOnly?t.writeOnly:f.writeOnly),allowInWriteOnly:!!(void 0!==t.allowInWriteOnly?t.allowInWriteOnly:f.allowInWriteOnly),classPrefix:n,addGlobalClass:!!(void 0!==t.addGlobalClass?t.addGlobalClass:f.addGlobalClass),templateEngine:t.templateEngine||f.templateEngine||y,renderingMode:t.renderingMode||f.renderingMode,multipleSlots:!!(void 0!==t.multipleSlots?t.multipleSlots:f.multipleSlots),reflectToAttributes:!!(void 0!==t.reflectToAttributes?t.reflectToAttributes:f.reflectToAttributes),writeFieldsToNode:!!(void 0!==t.writeFieldsToNode?t.writeFieldsToNode:f.writeFieldsToNode),writeIdToDOM:!!(void 0!==t.writeIdToDOM?t.writeIdToDOM:f.writeIdToDOM),separateInnerData:!!(void 0!==t.separateInnerData?t.separateInnerData:f.separateInnerData),innerDataExclude:t.innerDataExclude||f.innerDataExclude,listenerChangeLifeTimes:!!(void 0!==t.listenerChangeLifeTimes?t.listenerChangeLifeTimes:f.listenerChangeLifeTimes),randomizeTagName:!!(void 0!==t.randomizeTagName?t.randomizeTagName:f.randomizeTagName),virtualHost:!!(void 0!==t.virtualHost?t.virtualHost:f.virtualHost)},r._unprepared||g.prepare(o),void 0!==e.is&&(g._list[r.is]=o),o},g.isPrepared=function(e){return!e._unprepared},g.prepare=function(e){var t=e._unprepared;if(t){e._unprepared=null;var r=e.options,n={};t._unprepared&&l.prepare(t),r.writeOnly&&(n.data={value:null});var o=e.props={};Object.keys(t.properties).forEach(function(e){var i=t.properties[e];o[e]={type:i.type,optionalTypes:i.optionalTypes,value:i.value,filter:"function"==typeof i.filter?i.filter:null==i.filter?null:t.methods[i.filter],observer:"function"==typeof i.observer?i.observer:null==i.observer?null:t.methods[i.observer],public:i.public,availability:i.availability,observeAssignments:i.observeAssignments},r.writeFieldsToNode&&(n[e]={enumerable:!0,get:function(){return this.__propData[e]},set:function(t){var r=this.__dataProxy;r.scheduleReplace([e],t),r.doUpdates()}})});var a=function(){};e.protoFunc=a;var s=a.prototype=Object.create(g.prototype,n);if(s.is=e.is,s.__componentOptions=r,s.__using=t.using,e.dataGroupObserverTree=i._createObserverTree(o),t._addObserversToDataProxy(e.dataGroupObserverTree),s.__behavior=t,r.writeFieldsToNode)for(var _ in t.methods)s[_]=t.methods[_];s.__lifeTimeFuncs=t._getAllLifeTimeFuncs(),s.__pageLifeTimeFuncs=t._getAllPageLifeTimeFuncs();var c=t.relations,u=s.__relationMap={};for(var d in c){var f=c[d],p=f.type;u[p]?u[p].push(f):u[p]=[f]}var h=[];u.parent&&h.push(function(e){N(this.__relationMap.parent,this.__relationLinks.parent,this,"parent","detached"===e)}),u.ancestor&&h.push(function(e){N(this.__relationMap.ancestor,this.__relationLinks.ancestor,this,"ancestor","detached"===e)}),u.shadowHost&&h.push(function(e){N(this.__relationMap.shadowHost,this.__relationLinks.shadowHost,this,"shadowHost","detached"===e)}),e.relationHandler=function(e){for(var t=0;t<h.length;t++)h[t].call(this,e)};var v={},m={},b=t.data,w="";for(w in b)m[w]=b[w];for(w in o){var y=o[w];m[w]=y.value,v[w]=y.public}var x=m,C=r.separateInnerData,E=r.innerDataExclude;if(E){x={};for(var S in m)E.test(S)||(x[S]=m[S]);C||(m=x)}var O=r.templateEngine;e.template=O.create(t,m,x,r),s.__propPublic=v;var k=t._getAllListeners(),T=e.innerEvents=[];for(var A in k){for(var P=k[A],L=A.indexOf("."),M=A.slice(L+1),R=L<1?"":A.slice(0,L),I=[],D=0;D<P.length;D++){var j=P[D];"function"!=typeof j&&(j=null==j?null:t.methods[j]),I.push(j)}T.push({id:R,name:M,funcs:I})}}};var A=1,P=Object.prototype.hasOwnProperty,L=function(e,t){return function(r){return e.call(t.__methodCaller,r,t)}},M=function(e,t,r){var n={};for(var o in e){var i=e[o],a=t[o];"object"!=typeof a&&(a=g._list[a]),"object"!=typeof a&&null!=i.default&&(a=g._list[i.default]),a&&(n[o]=a)}return n},R=g._advancedCreate=function(e,t,r,o,a){var l=t;l._unprepared&&g.prepare(l);var _=l.options,c=!_.availability||E(l,r,_.availability);c||(l=g._list[""]);var h=l.protoFunc,m=new h,w=l.generics;w?m.__generics=M(w,o||{},_):m.__generics={};var y=null,x=f.documentBackend;if(_.virtualHost){var y=null;"dom"===f.documentBackend&&(y=void 0),s.initialize(m,y,r),m.__virtual=!0}else"dom"===x?(y=p.backendExtractedDefault?new d(e):document.createElement(e),s.initialize(m,y,r)):s.initialize(m,null,r);var C=0,S=m.__externalClassAlias={};if(l.behavior.externalClasses){var N=l.behavior.externalClasses;for(C=0;C<N.length;C++)S[N[C]]=null}if(m.classList=u.create(m,S),r){var k=r.__wxHost;m.classList._setOwnerOptions(k.classList,k.__componentOptions.classPrefix,k.__componentOptions.addGlobalClass),f.writeExtraInfoToAttr&&y&&y.setAttribute("exparser:info-class-prefix",k.__componentOptions.classPrefix&&k.__componentOptions.classPrefix+"--")}f.writeExtraInfoToAttr&&y&&(m.__componentInstanceId=A++,y.setAttribute("exparser:info-component-id",m.__componentInstanceId));var T=m.__templateInstance=l.template.createInstance(m,a);m.__propData=T.data;var P=_.separateInnerData;m.__innerData=P?b(m.__propData):null;var R=_.innerDataExclude;if(P&&R){var I={};for(var D in m.__innerData)R.test(D)||(I[D]=m.__innerData[D]);m.__innerData=I}m.__dataProxy=i._advancedCreate(m,m.__propData,m.__innerData,R,l.dataGroupObserverTree,function(e,t,r,n){m.__templateInstance.updateValues(m,P?m.__innerData:m.__propData,e,t,r,n)}),T.beforeMergeValues&&m.__dataProxy.setBeforeMergeCb(function(e,t,r){m.__templateInstance.beforeMergeValues(e,t,r)}),T.beforeUpdateValues&&m.__dataProxy.setBeforeUpdateCb(function(e){m.__templateInstance.beforeUpdateValues(m,P?m.__innerData:m.__propData,e)}),_.writeOnly&&m.__dataProxy.setHidingValue(!0),m.__idCacheDirty=!1,m.__idCache=T.idMap,null===T.slots[""]&&(T.slots[""]=y),l.options.multipleSlots?m.__slots=T.slots:(m.__singleSlot=T.slots[""]||null,m.__singleSlot&&(m.__singleSlot.__wxSlotChildren=m.childNodes)),T.shadowRoot instanceof s?(m.shadowRoot=T.shadowRoot,s._attachShadowRoot(T.shadowRoot)):y instanceof d?(m.shadowRoot=y,y.__wxHost=m,m.__domElement.asShadowRoot=T.shadowRoot,m.__wxSlotChildren=[y],y.__wxSlotParent=m):(m.shadowRoot=y,y.__wxHost=m,m.__domElement.appendChild(T.shadowRoot),m.__wxSlotChildren=[y],y.__wxSlotParent=m);for(var j=T.listeners,F=0;F<j.length;F++){var H=j[F];v(H.target,H.name,L(H.func,m))}var B=l.innerEvents;for(C=0;C<B.length;C++){var U=B[C],V=U.id?"this"===U.id?m:m.__idCache[U.id]:m.shadowRoot;if(V)for(var $=U.name,G=U.funcs,z=0;z<G.length;z++)v(V,$,L(G[z],m))}var W=m.__relationMap;return W.parent&&(O(W.parent,m,"parent"),m.__relationHandler=l.relationHandler),W.ancestor&&(O(W.ancestor,m,"ancestor"),m.__relationHandler=l.relationHandler),W.shadowHost&&(O(W.shadowHost,m,"shadowHost"),m.__relationHandler=l.relationHandler),m.__propertyChangeListeners=null,l.initiator&&n.safeCallback("Component Initiator",l.initiator,m.__methodCaller,[],m),m.__lifeTimeFuncs.created.call(m.__methodCaller,[],m),m};g.createWithGenerics=function(e,t,r,n){return"object"==typeof e?R(e.is,e,null,r,n):e?e.indexOf("-")<0&&!t?_.create(e):R(e.toLowerCase(),t||P.call(g._list,e)&&g._list[e]||g._list[""],null,r,n):R("virtual",g._list[""],null,r,n)},g.create=function(e,t,r){return g.createWithGenerics(e,t,null,r)},g.listProperties=function(e){var t=[];for(var r in e.__propPublic)void 0!==e.__propPublic[r]&&t.push(r);return t},g.listPublicProperties=function(e){var t=[];for(var r in e.__propPublic)e.__propPublic[r]===!0&&t.push(r);return t},g.hasProperty=function(e,t){return void 0!==e.__propPublic[t]},g.hasPublicProperty=function(e,t){return e.__propPublic[t]===!0},g.getMethodsFromDef=function(e){return e.behavior._unprepared&&l.prepare(e.behavior),e.behavior.methods},g.getMethod=function(e,t){return e.__behavior.methods[t]},g.getComponentOptions=function(e){return e.__componentOptions},g.prototype.triggerLifeTime=function(e,t){this.__lifeTimeFuncs[e].call(this.__methodCaller,t||[])},g.prototype.triggerPageLifeTime=function(e,t){T(this,e,t)},g.prototype.hasBehavior=function(e){return"object"!=typeof e&&Object.prototype.hasOwnProperty.call(this.__using,e)&&(e=this.__using[e]),!!this.__behavior&&this.__behavior.hasBehavior(e)},g.prototype.getRootBehavior=function(){return this.__behavior},g.prototype.getRelationNodes=function(e){var t=this.__behavior.relations[e];if(!t)return null;if("parent"===t.type||"ancestor"===t.type||"shadowHost"===t.type){for(var r=this.__relationMap[t.type],n=0;n<r.length&&r[n]!==t;n++);return this.__relationLinks[t.type][n]?[this.__relationLinks[t.type][n].parent]:[]}return k(this,t)},g.prototype.hasExternalClass=function(e){return P.call(this.__externalClassAlias,e)},g.prototype.setExternalClass=function(e,t){this.classList._setAlias(e,t)},g.prototype.setPropertyChangeListener=function(e,t){this.__propertyChangeListeners||(this.__propertyChangeListeners={}),this.__propertyChangeListeners[e]=t},g.prototype.replaceDataOnPath=function(e,t){this.__dataProxy.scheduleReplace(e,t)},g.prototype.isInnerDataExcluded=function(e){var t=this.__componentOptions.innerDataExclude;return!!t&&t.test(e)},g.getInnerData=function(e){return e.__innerData},g.getDataProxy=function(e){return e.__dataProxy},g.replaceWholeData=function(e,t,r){e.__propData=t,e.__dataProxy.replaceWholeData(t,r)},g.prototype.applyDataUpdates=function(){this.__dataProxy.doUpdates()},g.prototype.setData=function(e){var t=this.__dataProxy;for(var r in e)t.scheduleReplace(m(r),e[r]);t.doUpdates()},e.exports=g},function(e,t,r){var n=r(3),o=r(5),i=null,a=null,l=Object.prototype.hasOwnProperty,s=o.deepCopy,_=function(e,t,r,n,o,i){this._data=t,this._innerData=r,this._innerDataExclude=n,this._comp=e,this._updateCb=i,this._beforeMergeCb=null,this._beforeUpdateCb=null,this._hidingValue=!1,this._changes=[],this._doingUpdates=null,this._propFields=o._propFields,this._observers=o._observers,this._observerTree=o._observerTree,this._relatedObserverTreeObj=o,this._observerStatus=[]};_._advancedCreate=function(e,t,r,n,o,i){return new _(e,t,r,n,o,i)};var c=function(e){this._propFields=e,this._observerIdInc=0,this._observers=[],this._observerTree={}};_._createObserverTree=function(e){return new c(e)},_.create=function(e,t,r){var n=new c({});return new _({__methodCaller:e},t,null,null,n,r)},_.setPropUpdater=function(e){i=e},_.setPropObserver=function(e){a=e},_.prototype.replaceWholeData=function(e,t){this._data=e},_.prototype.setHidingValue=function(e){this._hidingValue=!!e},_.prototype.setBeforeMergeCb=function(e){this._beforeMergeCb=e},_.prototype.setBeforeUpdateCb=function(e){this._beforeUpdateCb=e};var u=function(e,t,r){for(var n=e,o=0;o<t.length;o++){var i=t[o];if("**"===i)return n["**"]||(n["**"]=[]),void n["**"].push(r);n[i]||(n[i]={}),n=n[i]}n["~"]||(n["~"]=[]),n["~"].push(r)},d=function(e,t,r){for(var n=0;n<t.length;n++)u(e,t[n],r)},f=function(e,t,r){for(var n=e,o=0,i="";o<t.length&&(i=t[o],"**"!==i);o++){if(!n)return;n=n[i]}var a="**"===i?n["**"]:n["~"];if(a)for(o=0;o<a.length;o++)if(a[o]===r){a.splice(o,1);break}},p=function(e,t,r){for(var n=0;n<t.length;n++)f(e,t[n],r)};c.prototype.addObserver=function(e,t){var r=this._observerIdInc++;return this._observers[r]={pathObj:t,func:e},d(this._observerTree,t,r),r},c.prototype.removeObserver=function(e){var t=this._observers[e];p(this._observerTree,t.pathObj,e),this._observers[e]=null},c.prototype.moveObserver=function(e,t){var r=this._observers[e];p(this._observerTree,r.pathObj,e),r.pathObj=t,d(this._observerTree,t,e)},_.prototype.getObserverTree=function(){return this._relatedObserverTreeObj};var h=function(e,t,r){for(var o=[],i=r.pathObj,a=0;a<i.length;a++){for(var l=i[a],s=t,_=0;_<l.length;_++){var c=l[_];if("**"===c)break;if("object"!=typeof s){s=void 0;break}s=s[c]}o[a]=s}n.safeCallback("Data Observer",r.func,e.__methodCaller,o,e)},v=function(e,t){var r=null,n=0,o=-1;for(var i in e)if("~"!==i)if("**"!==i)v(e[i],t);else for(r=e["**"],n=0;n<r.length;n++)o=r[n],t[o]=!0;else for(r=e["~"],n=0;n<r.length;n++)o=r[n],t[o]=!0},m=function(e,t,r){for(var n=e,o=0;o<r.length;o++){if(n["**"])for(var i=n["**"],a=0;a<i.length;a++){var s=i[a];t[s]=!0}var _=r[o];if("number"==typeof _){if(!l.call(n,_)){n=null;break}}else if(!/^[_a-zA-Z]/.test(_)||!l.call(n,_)){n=null;break}n=n[_]}n&&v(n,t)},b=function(e,t,r,n,o){for(var i=0;i<e.length;i++){var a=e[i],l=t[i];l&&l&&(t[i]=!1,h(r,o?void 0:n,a))}};_.prototype.scheduleReplace=function(e,t,r){this._changes.push([e,t,r])},_.prototype.setChanges=function(e){this._changes=e},_.prototype.getChanges=function(){return this._changes},_.prototype.doUpdates=function(e,t){var r=this._propFields,n=this._comp,o=this._hidingValue,_=this._innerDataExclude,c=!!this._doingUpdates,u=this._relatedObserverTreeObj._observerIdInc,d=null,f=null,p=null;u?(c||(this._doingUpdates={changedPaths:[],changedValues:[],combinedChanges:[],changesTotal:0}),d=this._doingUpdates.changedPaths,f=this._doingUpdates.changedValues,p=this._doingUpdates.combinedChanges):(d=[],f=[],p=[]);var h=this._changes;this._changes=[];var v=[];this._beforeMergeCb&&this._beforeMergeCb(h,v,e);for(var g=0;g<h.length;g++){var w=h[g],y=w[0],x=w[1],C=x,E=void 0,S=y[0],O=!!_&&_.test(S),N=r[S];if(N&&1===y.length)E=this._data[S],x=i.call(this._comp,y,N,x,this._hidingValue),O||(this._innerData?(C=s(x),v[g]||(this._innerData[S]=C)):C=x,w[1]=C),O&&!this._innerData||(this._data[S]=x);else{var k=this._data,T=S,A=null,P=1;if(!O||this._innerData){for(;P<y.length;P++)A=y[P],"number"==typeof A&&isFinite(A)?l.call(k,T)&&k[T]instanceof Array||(k[T]=[]):(!l.call(k,T)||null===k[T]||"object"!=typeof k[T]||k[T]instanceof Array)&&(k[T]={}),k=k[T],T=A;k[T]=x}if(this._innerData&&(k=this._innerData,T=S,!O)){for(P=1;P<y.length;P++)A=y[P],"number"==typeof A&&isFinite(A)?l.call(k,T)&&k[T]instanceof Array||(k[T]=[]):(!l.call(k,T)||null===k[T]||"object"!=typeof k[T]||k[T]instanceof Array)&&(k[T]={}),k=k[T],T=A;C=s(x),v[g]||(k[T]=C),w[1]=C}}m(this._observerTree,this._observerStatus,y),O||(d.push(y),f.push([C,E,x]),p.push(w)),u&&(this._doingUpdates.changesTotal+=1)}if(!c){if(this._beforeUpdateCb&&this._beforeUpdateCb(e),u){var L=0;do L=this._doingUpdates.changesTotal,b(this._observers,this._observerStatus,n,this._data,o);while(L!==this._doingUpdates.changesTotal);this._doingUpdates=null}this._updateCb(d,f,p,e);for(var M=0;M<f.length;M++){var R=f[M];if(R){var I=d[M],D=I[0],j=r[D];j&&a.call(n,R[2],R[1],I,j,o,t)}}}},e.exports=_},function(e,t,r){var n=r(9),o=r(11),i=r(14),a=r(4),l=r(13),s=function(){};s.prototype=Object.create(n.prototype,{constructor:{value:s,writable:!0,configurable:!0}});var _=s._advancedCreate=function(e,t){var r=new s;r.is=e.toLowerCase();var _=null;if("dom"===a.documentBackend&&(_=l.backendExtractedDefault?new i(e):document.createElement(e)),n.initialize(r,_,t),r.classList=o.create(r,null),t){var c=t.__wxHost;r.classList._setOwnerOptions(c.classList,c.__componentOptions.classPrefix,c.__componentOptions.addGlobalClass),a.writeExtraInfoToAttr&&_&&_.setAttribute("exparser:info-class-prefix",c.__componentOptions.classPrefix&&c.__componentOptions.classPrefix+"--")}return r};s.create=function(e){return _(e,null)};var c=s._advancedClone=function(e,t){var r=new s;r.is=e.is;var _=null;if(e.__domElement&&(_=e.__domElement instanceof i?l.backendExtractedDefault?e.__domElement.cloneNode():i.toElement(e.__domElement):l.backendExtractedDefault?i.fromElement(e.__domElement):document.importNode?document.importNode(e.__domElement,!1):e.__domElement.cloneNode(!1)),n._clone(r,e,_,t),r.classList=o.create(r,null),t){var c=t.__wxHost;r.classList._setOwnerOptions(c.classList,c.__componentOptions.classPrefix,c.__componentOptions.addGlobalClass),a.writeExtraInfoToAttr&&_&&_.setAttribute("exparser:info-class-prefix",c.__componentOptions.classPrefix&&c.__componentOptions.classPrefix+"--")}return r};s.cloneNode=function(e){return c(e,null)},e.exports=s},function(e,t,r){var n=r(9),o=r(4),i=function(e,t){a(this,e,t)};i.prototype=Object.create(n.prototype);var a=i.initialize=function(e,t,r){e.is=t||"";var i=null;"dom"===o.documentBackend&&(i=void 0),n.initialize(e,i,r),e.__virtual=!0};i._advancedCreate=function(e,t){return new i(e,t)},i.create=function(e){return new i(e,null)},e.exports=i},function(e,t,r){var n=r(9),o=r(15),i=r(18),a=r(17),l=r(12),s=Object.prototype.hasOwnProperty,_=function(e){i.initialize(this,"shadow",this),this.__hostAssociated=!1,this.__wxHost=e,this.__childrenPropsFilter=null,this.__slotCacheDirty=!1};_.prototype=Object.create(i.prototype),_.create=function(e){var t=new _(e);if(e.ownerShadowRoot&&e.ownerShadowRoot.__childrenPropsFilter)if(t.__childrenPropsFilter)for(var r in e.ownerShadowRoot.__childrenPropsFilter)t.__childrenPropsFilter[r]||(t.__childrenPropsFilter[r]=e.ownerShadowRoot.__childrenPropsFilter[r]);else t.__childrenPropsFilter=e.ownerShadowRoot.__childrenPropsFilter;return t};var c=function(e,t){var r={};for(var n in e){var i=e[n];"object"!=typeof i&&(s.call(t.__using,i)?i=t.__using[i]:s.call(t.__generics,i)&&(i=t.__generics[i]||o._list[""]),r[n]=i)}return r},u="abcdefghijklmnopqrstuvwxyz",d=function(){for(var e=Date.now(),t="exparser-",r=0;r<8;r++){var n=(e+Math.floor(26*Math.random()))%26;e=Math.floor(e/26),t+=u[n]}return t};_.prototype.createTextNode=function(e){return l._advancedCreate(e,this)},_.prototype.createNativeNode=function(e){return a._advancedCreate(e,this)},_.prototype.cloneNativeNode=function(e){return a._advancedClone(e,this)},_.prototype.createVirtualNode=function(e){return i._advancedCreate(e,this)},_.prototype.createComponent=function(e,t,r,n){var i=null;i=void 0===t?e:t;var a=this.__wxHost;return"object"!=typeof i&&(s.call(a.__using,i)?i=a.__using[i]:s.call(a.__generics,i)&&(i=a.__generics[i]),"object"!=typeof i&&(i=o._list[i]||o._list[""])),r&&(r=c(r,a)),"object"==typeof e&&(e=i.is),a.__componentOptions.randomizeTagName&&(e=d()),a.__componentOptions.writeOnly&&!i.options.allowInWriteOnly&&(i=o._list[""]),o._advancedCreate(e,i,this,r,n)},_.prototype.tagNameUsed=function(e){var t=this.__wxHost;return!!s.call(t.__using,e)||!!s.call(t.__generics,e)},_.prototype.getHostNode=function(){return this.__wxHost},_.prototype.getElementById=function(e){return n._updateIdMap(this.__wxHost),this.__wxHost.__idCache[e]},e.exports=_},function(e,t,r){var n=r(9),o=r(12),i=function(){};i.create=function(e,t,r){var a=new i;if(!(e instanceof n||e instanceof o))throw new Error("ElementIterator can only be used for exparser.Element or exparser.TextNode");a._elem=e,a._elemTypeLimit=r||n;var l=t.split("-");if("shadow"===l[0])a._composed=!1;else{if("composed"!==l[0])throw new Error("Unrecognized iterator type: "+t);a._composed=!0}if("ancestors"===l[1])a._relation="ancestors",a._order=0;else{if("descendants"!==l[1])throw new Error("Unrecognized iterator type: "+t);if(a._relation="descendants","root"!==l[2])throw new Error("Unrecognized iterator type: "+t);if("first"===l[3])a._order=-1;else{if("last"!==l[3])throw new Error("Unrecognized iterator type: "+t);a._order=1}}return a};var a=function(e,t,r,n){for(;e;e=r?e.__wxSlotParent||e.__wxHost||e.parentNode:e.parentNode)if(e instanceof t&&n(e)===!1)return!1;return!0},l=function(e,t,r,n,o){if(n<0&&e instanceof t&&o(e)===!1)return!1;var i=r?e.__wxSlotChildren||e.childNodes:e.childNodes;if(i)for(var a=0;a<i.length;a++)if(l(i[a],t,r,n,o)===!1)return!1;return!(n>0&&e instanceof t&&o(e)===!1)};i.prototype.forEach=function(e){return"ancestors"===this._relation?a(this._elem,this._elemTypeLimit,this._composed,e):l(this._elem,this._elemTypeLimit,this._composed,this._order,e)},e.exports=i},function(e,t,r){(function(t){var n=r(4),o=r(3),i=r(9),a=r(17),l=r(12),s=r(19),_=r(15),c=r(23),u=r(24),d=function(){};d.prototype=Object.create(Object.prototype,{constructor:{value:d,writable:!0,configurable:!0}});var f=function(){};f.prototype=Object.create(Object.prototype,{constructor:{value:f,writable:!0,configurable:!0}});var p=null,h=null;d.precompiler=h,d.htmlParser=p;var v=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},m=Object.prototype.hasOwnProperty,b=function(e,t){if(null!==e&&"object"==typeof e&&m.call(e,t))return e[t]},g=function(e,t,r,n){if(m.call(t,r)){var i=t[r];if("function"==typeof i)return o.safeCallback("Template Method",i,e,n)}},w=function(e,t){return[{t:1,n:"slot",a:[],c:[],p:null}]},y={t:1,n:'"slot"',v:!0,sn:"",a:[],c:[],p:null},x=function(e,t,r){e.classList.toggle(t,!!r)},C=function(e,t,r){e[t]=r},E=function(e,t,r){var n=e.__dataProxy;n.scheduleReplace([t],r),n.doUpdates()},S=function(e,t,r){e.class=r},O=function(e,t,r){e.setAttribute("style",r)},N=function(e,t,r){e.setAttribute("class",r)},k=function(e,t,r){e.textContent=r},T=function(e,t,r){e.dataset||(e.dataset={}),e.dataset[t]=r},A={$:function(e,t,r){r===!0?e.setAttribute(t,""):r===!1||void 0===r||null===r?e.removeAttribute(t):e.setAttribute(t,r)},":":C,c:x,s:function(e,t,r){var n=e.style;n&&(n[t]=r)},d:T},P=function(e,t,r){return[{t:1,n:"slot",v:!0,sn:"",a:[],c:[]}]};d.create=function(e,r,n,o){var i=void 0===e.template?P:e.template,a=i;if("function"!=typeof i)if(h&&"undefined"!=typeof window&&"undefined"!=typeof document){var l="__exparserFreeTmpl",s=h.compile(i),_=document.createElement("script");_.type="text/javascript",_.innerHTML="window."+l+"="+s,document.head.appendChild(_),document.head.removeChild(_),a=window[l],window[l]=null}else a="undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node?d.precompileAndGetCreator(i):w;var c=Object.create(d.prototype);return c._initValuesJSON=JSON.stringify(n),r!==n?c._dataJSON=JSON.stringify(r):c._dataJSON=null,c._tagTreeRoot=L(a,n,e.methods,o),c._renderingMode=o.renderingMode,c};var L=function(e,t,r,o){var i=o.renderingMode,l="native"===i,s=l,_=!1,c=Object.create(null);l&&!n.hasDOMBackend&&(e=w);var d={},f=e(b,g,r),p=function(e){for(var r=0;r<e.length;r++){var n=e[r];if(3!==n.t){var o=n.n,i=!(l||"string"==typeof o&&o.indexOf("-")<0);"slot"===o&&""===n.sn&&(_=!0),n.n=o;var c=n.st;c&&c.e&&(c.o=O,s&&(c.v=c.e(t,d,null)));var f=n.cl;f&&f.e&&(f.o=l?N:S,s&&(f.v=f.e(t,d,null)));var h=null;i||(n.p=h=l?document.createElement(n.n):a.create(n.n),c&&void 0!==c.v&&h.setAttribute("style",c.v),l&&f&&void 0!==f.v&&h.setAttribute("class",f.v));for(var m=n.a,b=0;b<m.length;b++){var g=m[b];if(g.d)l||u[g.n].register(g.n,g,n);else{l||("bind"===g.n.slice(0,4)?(g.evCatch=!1,g.ev=v(g.n.slice(4)),":"===g.ev[0]&&(g.ev=g.ev.slice(1))):"catch"===g.n.slice(0,5)&&(g.evCatch=!0,g.ev=v(g.n.slice(5)),":"===g.ev[0]&&(g.ev=g.ev.slice(1))));var w=g.o;if(i)w?"&"===w?g.o=A[":"]:g.o=A[w]:(g.o=A[":"],g.n=v(g.n)),g.o===C&&(g.o=E),s&&g.e&&(g.v=g.e(t,d,null));else if(!g.ev){var y=A;w?"&"===w?g.o=y[":"]:g.o=y[w]:g.o=y.$,s?(g.e&&(g.v=g.e(t,d,null)),(g.o!==x||l)&&g.o(h,g.n,g.v)):g.e||g.o(h,g.n,g.v)}}}p(n.c),l&&(1!==n.c.length||void 0===n.c[0].sn||n.c[0].compressed||(n.sn=n.c[0].sn,n.compressed=!0,n.c.pop()))}else n.e&&(n.o=k,n.c=s?n.e(t,d,null):"")}};return p(f,c,!0),l&&(_||f.push(y),1!==f.length||""!==f[0].sn||f[0].compressed||f.pop()),f},M=function(e,t){return function(r){if(this[e](r),t)return!1}},R=function(e,t,r,n,o,a,l,s){for(var d=null,f=0,p=null,h=0;h<e.length;h++){var v=l,m=e[h];if(3===m.t)d=m.e?t.createTextNode(m.e(n,o,null)):t.createTextNode(m.c),m.e&&c.addBindings(a,v,m.b,d,m),i.appendChild(r,d);else{var b=m.cl,g=m.st,w=m.a,y=!1;for(f=0;f<w.length;f++)if(p=w[f],p.d){var S=u[p.n].create(p.n,p,m,n,o,a,v,s,t,R,r);if(u[p.n].requireBlock){d=S,i.appendChild(r,d),y=!0;break}}if(y)continue;if(m.v)d=t.createVirtualNode(m.n);else if(m.p){for(d=t.cloneNativeNode(m.p),f=0;f<w.length;f++)p=w[f],p.d||(p.ev?s(d,p.ev,p.v,p.evCatch):p.o===C?d.__domElement&&(p.o(d.__domElement,p.n,p.e(n,o,null)),c.addBindings(a,v,p.b,d.__domElement,p)):(p.e&&p.o(d,p.n,p.e(n,o,null)),(p.e||p.o===x||p.o===T)&&c.addBindings(a,v,p.b,d,p)));g&&g.e&&(d.setAttribute("style",g.e(n,o,null)),c.addBindings(a,v,g.b,d,g))}else{if(m.cpf){var O={},N=t.__wxHost;for(var k in m.cpf)!function(e){var t=m.cpf[e];O[e]=N.__behavior.methods[t]}(k);t.__childrenPropsFilter=O}for(d=t.createComponent(m.n,void 0,m.g,void 0),f=0;f<w.length;f++)if(p=w[f],!p.d){var A=p.v;p.o===E&&_.hasPublicProperty(d,p.n)?(p.e&&(A=p.e(n,o,null),c.addBindings(a,v,p.b,d,p)),p.e?E(d,p.n,A):d.__behavior.properties[p.n].type===Boolean?E(d,p.n,!0):E(d,p.n,A)):p.ev?s(d,p.ev,A,p.evCatch):p.o!==E&&(p.e&&(A=p.e(n,o,null),c.addBindings(a,v,p.b,d,p)),p.o(d,p.n,A))}g&&(g.e?(d.__domElement.setAttribute("style",g.e(n,o,null)),c.addBindings(a,v,g.b,d.__domElement,g)):d.__domElement.setAttribute("style",g.v))}m.id&&(d.id=m.id),b&&(b.e?d.class=b.e(n,o,null):d.class=b.v,b.o&&c.addBindings(a,v,b.b,d,b)),m.sl&&(d.slot=m.sl),void 0!==m.sn&&i.setSlotName(d,m.sn),i.appendChild(r,d),R(m.c,t,d,n,o,a,v,s)}}},I=function(e,t,r){for(var n=e.childNodes,o=0;o<n.length;o++){var i=n[o];i instanceof l||(i.__id&&(t[i.__id]=i),void 0!==i.__slotName&&(r[i.__slotName]=i),I(i,t,r))}},D=function(e,t,r,n,o,i){for(var a=null,l=0,s=null,_=0;_<e.length;_++){var u=e[_];if(void 0===u.n)a=document.createTextNode(u.c),u.e&&c.addBindings(o,i,u.b,a,u),t.appendChild(a);else{var d=u.cl,f=u.st,p=u.a;for(a=u.v?document.createElement("virtual"):document.importNode?document.importNode(u.p,!1):u.p.cloneNode(!1),l=0;l<p.length;l++)s=p[l],s.e&&c.addBindings(o,i,s.b,a,s);t.appendChild(a),u.id&&(r[u.id]=a),d&&d.e&&c.addBindings(o,i,d.b,a,d),
- f&&f.e&&c.addBindings(o,i,f.b,a,f),void 0!==u.sn&&(n[u.sn]=a),D(u.c,a,r,n,o,i)}}};d.prototype.createInstance=function(e){var t=Object.create(f.prototype),r=JSON.parse(this._initValuesJSON),o=null===this._dataJSON?r:JSON.parse(this._dataJSON),i=Object.create(null),a=Object.create(null),l=[],_=c.create("",null,null,null,null,[],function(e,t){}),u=null;if("native"===this._renderingMode)"dom"===n.documentBackend&&(u=document.createDocumentFragment()),D(this._tagTreeRoot,u,i,a,_,{}),a[""]||(a[""]=null);else{var d=function(e,t,r,n){u.__wxHost?e.addListener(t,M(r,n).bind(u.__wxHost)):l.push({target:e,name:t,func:M(r,n)})};if(u=s.create(e),e.ownerShadowRoot&&e.ownerShadowRoot.__childrenPropsFilter)if(u.__childrenPropsFilter)for(var p in e.ownerShadowRoot.__childrenPropsFilter)u.__childrenPropsFilter[p]||(u.__childrenPropsFilter[p]=e.ownerShadowRoot.__childrenPropsFilter[p]);else u.__childrenPropsFilter=e.ownerShadowRoot.__childrenPropsFilter;R(this._tagTreeRoot,u,u,r,{},_,{},d),I(u,i,a)}return t.data=o,t.shadowRoot=u,t.idMap=i,t.slots=a,t.listeners=l,t._topScope=_,t},f.prototype.updateValues=function(e,t,r){for(var n=i.getMethodCaller(e),o=0;o<r.length;o++){var a=r[o];c.updateBinding(this._topScope,a,t,{},n)}},e.exports=d}).call(t,r(22))},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(u===clearTimeout)return clearTimeout(e);if((u===n||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}function a(){h&&f&&(h=!1,f.length?p=f.concat(p):v=-1,p.length&&l())}function l(){if(!h){var e=o(a);h=!0;for(var t=p.length;t;){for(f=p,p=[];++v<t;)f&&f[v].run();v=-1,t=p.length}f=null,h=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function _(){}var c,u,d=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(e){c=r}try{u="function"==typeof clearTimeout?clearTimeout:n}catch(e){u=n}}();var f,p=[],h=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new s(e,t)),1!==p.length||h||o(l)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=_,d.addListener=_,d.once=_,d.off=_,d.removeListener=_,d.removeAllListeners=_,d.emit=_,d.prependListener=_,d.prependOnceListener=_,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t){var r={};r.create=function(e,t,r,o,i,a,l){for(var s={inc:1,name:e,exp:o,lp:i,scopes:{},targets:{},children:null,lu:l,__scopeBinded:[]},_=0;_<a.length;_++){var c=a[_];null===c[0]?n(t,c,null,s):n(r[c[0]],c,null,s)}return s},r.proxyTopScope=function(e){var t={inc:1,linked:e,scopes:{},targets:{},children:null,__scopeBinded:[]};return n(e,[null],null,t),t},r.proxySubScopes=function(e){var t={};for(var r in e)t[r]={inc:1,linked:e[r],scopes:{},targets:{},children:null,__scopeBinded:[]},n(e[r],[null],null,t[r]);return t};var n=r.addBinding=function(e,t,r,n){for(var o=e,i=1;i<t.length;i++){var a=t[i];o.children||(o.children=Object.create(null));var l=o.children;l[a]||(l[a]={scopes:{},targets:{},children:null}),o=l[a]}var s=e.inc++;return r?o.targets[s]=[r,n]:(o.scopes[s]=n,n.__scopeBinded.push([o,s])),s};r.addBindings=function(e,t,r,o,i){for(var a=0;a<r.length;a++){var l=r[a];l[0]?n(t[l[0]],l,o,i):n(e,l,o,i)}},r.updateLvaluePath=function(e,t){e.lp=t},r.removeBindingsForScope=function(e){for(var t=e.__scopeBinded,r=0;r<t.length;r++){var n=t[r];delete n[0].scopes[n[1]]}};var o=function(e,t,r,n,o){if(e.linked)return void i(e,t,r,n,o);var a=n[e.name];n[e.name]=e.exp(r,n,o),i(e,t,r,n,o),n[e.name]=a},i=r.updateBinding=function(e,t,r,n,i){for(var a=e,l=0,s=0;s<t.length;s++){for(l in a.scopes)o(a.scopes[l],t,r,n,i);var _=t[s];if(!a.children)return;var c=a.children;if(!c[_])return;a=c[_]}var u=function(e){for(l in e.targets){var t=e.targets[l],a=t[1];a.o(t[0],a.n,a.e(r,n,i))}for(l in e.scopes)o(e.scopes[l],[],r,n,i);for(l in e.children)u(e.children[l])};u(a)};e.exports=r},function(e,t,r){e.exports={if:r(25),elif:r(25),else:r(25),for:r(27),key:r(28),"for-index":r(29),"for-item":r(30),alias:r(31)}},function(e,t,r){var n=r(23),o=r(26).RUNTIME_NAMES;o.TOP_SCOPE+","+o.SUB_SCOPE+","+o.CALLER;e.exports={requireBlock:!0,register:function(e,t,r){},create:function(e,t,r,o,i,a,l,s,_,c,u){var d=_.createVirtualNode("wx:"+e);d.__wxIfCondValue=!0,d.__wxIfNextNode=null,d.__wxIfHasTrueCond=!0;var f=null;"if"!==e&&(f=u.childNodes[u.childNodes.length-1],"wx:if"!==f.is&&"wx:elif"!==f.is?f=null:f.__wxIfNextNode=d),r.id&&(d.id=r.id);var p=d.__wxIfUpdateNode=function(){var e=d.__wxIfCondValue;if(f&&f.__wxIfHasTrueCond&&(e=!1),e&&!d.childNodes.length){var t=n.proxyTopScope(a),u=n.proxySubScopes(l);d.__wxTopScope=t,d.__wxSubScopes=u,c(r.c,_,d,o,i,t,u,s)}else if(!e&&d.childNodes.length){n.removeBindingsForScope(d.__wxTopScope);for(var p in d.__wxSubScopes)n.removeBindingsForScope(d.__wxSubScopes[p]);for(;d.childNodes.length;)d.removeChild(d.childNodes[0])}d.__wxIfNextNode&&d.__wxIfNextNode.__wxIfUpdateNode()},h=function(e){d.__wxIfCondValue=!!e,d.__wxIfHasTrueCond=d.__wxIfCondValue||f&&f.__wxIfHasTrueCond,p()};return"else"===e?h(!0):(n.addBindings(a,l,t.b,d,{e:t.d,o:function(e,t,r){h(r)}}),h(t.d(o,i,null))),d}}},function(e,t){t.TAG_TYPES={TAG_START:1,TAG_END:-1,TEXT:3,COMMENT:8},t.RUNTIME_NAMES={MEMBER:"m",CALL:"f",METHODS:"e",CALLER:"c",TOP_SCOPE:"t",SUB_SCOPE:"s"};var r=t.STRING_UNESCAPE_MAP={n:"\n",r:"\r",b:"\b",f:"\f",t:"\t",v:"\v",'"':'"',"'":"'","\\":"\\","\r":"\r","\n":"\n"},n=t.STRING_ESCAPE_MAP={},o="";for(var i in r)n[r[i]]=i,o+=r[i];t.STRING_ESCAPE_REGEXP=new RegExp("["+o+"]","g")},function(e,t,r){var n=(r(18),r(23)),o=r(26).RUNTIME_NAMES;o.TOP_SCOPE+","+o.SUB_SCOPE+","+o.CALLER;e.exports={requireBlock:!0,addDefaultAttrs:[{n:"wx:for-index",v:"index"},{n:"wx:for-item",v:"item"}],register:function(e,t,r){},create:function(e,t,r,o,i,a,l,s,_,c){var u=r._wxForIndex||"index",d=r._wxForItem||"item",f=r._wxKey,p=_.createVirtualNode("wx:for:list");r.id&&(p.id=r.id),n.create("",a,l,function(e,r,n){var o=t.d(e,r,null);return g(o,e,r,n),o},t.l,t.b);var h=function(e,t,o,i,f){var h=_.createVirtualNode("wx:for:item"),v=n.proxyTopScope(a),m=n.proxySubScopes(l);h.__wxTopScope=v,h.__wxSubScopes=m,h.__wxForToRemove=!1,h.__wxForKeyStr="";var b=n.create(u,v,m,null,null,[]),g=n.create(d,v,m,null,[o],[]);return m[u]=b,m[d]=g,t[u]=o,t[d]=i,c(r.c,_,h,e,t,v,m,s),void 0===f?p.appendChild(h):p.insertBefore(h,f),h},v=function(e,t,r,i,a,l){var s=e.__wxSubScopes[d];n.updateLvaluePath(s,[i]),a&&(l?p.insertBefore(e,l):p.appendChild(e));var _=e.__wxSubScopes[u];r[u]=i,n.updateBinding(_,[],o,r,t)},m=function(e,t,r,o,i,a){o[d]=i,n.updateBinding(e.__wxSubScopes[d],t,r,o,a)},b=function(e){n.removeBindingsForScope(e.__wxTopScope);for(var t in p.__wxSubScopes)n.removeBindingsForScope(e.__wxSubScopes[t]);p.removeChild(e)},g=function(e,t,r,n){var o="",i=e;"object"==typeof e&&null!==e||(i=[]);var a={};for(o in r)a[o]=r[o];var l=0;if(f){var s=[],_=e instanceof Array,c=[];if(!_){var u=i;i=[];for(o in u)i.push(u[o]),c.push(o)}for(l=0;l<i.length;l++)s.push(String(i[l][f]));if(0===i.length)for(;p.childNodes.length;)b(p.childNodes[0]);else{var d=Object.create(null),g=Object.create(null),w=p.childNodes,y=null,x="";for(l=0;l<w.length;l++)y=w[l],x=y.__wxForKeyStr,d[x]>=0?(b(y),l--):(d[x]=l,g[x]=y,y.__wxForToRemove=!0);var C=-1,E=0,S=1,O=[];for(E=d[i[0][f]],E>=0||(E=-1),w[E]&&(w[E].__wxForToRemove=!1),l=1;l<i.length;l++)S=d[i[l][f]],S>=0&&(C<E&&(E<S||C>S)&&(O.push(w[E]),C=E),E=S,w[E]&&(w[E].__wxForToRemove=!1));for(C<E&&O.push(w[E]),l=0;l<w.length;l++)y=w[l],y.__wxForToRemove&&(b(y),l--);var N=O.shift(),k=0;for(l=0;l<i.length;l++){var T=i[l],A=g[T[f]];if(g[T[f]]=null,A){var P=!0;if(A===N){for(;w[k]!==N;)k++;k++,N=O.shift(),P=!1}y=A,v(y,n,a,_?l:c[l],P,w[k]),P&&w[k]===y&&k++,m(y,[],t,a,i[l],n)}else y=h(t,a,_?l:c[l],i[l],w[k]),k++,y.__wxForKeyStr=String(T[f])}}}else{for(;p.childNodes.length;)b(p.childNodes[0]);if(e instanceof Array)for(l=0;l<i.length;l++)h(t,a,l,i[l]);else for(o in i)h(t,a,o,i[o])}};return g(t.d(o,i,null),o,i,null),p}}},function(e,t){e.exports={attachedToBlock:!0,register:function(e,t,r){r._wxKey=t.d},create:function(){}}},function(e,t){e.exports={attachedToBlock:"for",register:function(e,t,r){r._wxForIndex=t.d},create:function(){}}},function(e,t){e.exports={attachedToBlock:"for",register:function(e,t,r){r._wxForItem=t.d},create:function(){}}},function(e,t,r){var n=r(23),o=r(26).RUNTIME_NAMES;o.TOP_SCOPE+","+o.SUB_SCOPE+","+o.CALLER;e.exports={requireBlock:!0,register:function(e,t,r){},create:function(e,t,r,o,i,a,l,s,_,c){var u=t.s[0],d=n.create(u,a,l,t.d,t.l,t.b),f={},p="";for(p in l)f[p]=l[p];f[u]=d;var h={};for(p in i)h[p]=i[p];h[u]=t.d(o,i,null);var v=_.createVirtualNode("wx:alias");return r.id&&(v.id=r.id),c(r.c,_,v,o,h,a,f,s),v}}}]);
- }),
- (function(module, exports) {
- let seed = 1e14 + Math.floor(Math.random() * 9e14)
- const charString = 'abcdefghij'
- function getId(notNumber) {
- const id = ++seed
- return notNumber ? id.toString().split('').map(item => charString[+item]).join('') : id
- }
- function copy(src) {
- if (typeof src === 'object' && src !== null) {
- let dest
- if (Array.isArray(src)) {
- dest = src.map(item => copy(item))
- } else {
- dest = {}
- Object.keys(src).forEach(key => dest[key] = copy(src[key]))
- }
- return dest
- }
- if (typeof src === 'symbol') return undefined
- return src
- }
- const tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'dfn', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr']
- function isHtmlTag(tagName) {
- return tags.indexOf(tagName) >= 0
- }
- const officialTags = [
- 'view', 'scroll-view', 'swiper', 'movable-view', 'cover-view', 'cover-view',
- 'icon', 'text', 'rich-text', 'progress',
- 'button', 'checkbox', 'form', 'input', 'label', 'picker', 'picker', 'picker-view', 'radio', 'slider', 'switch', 'textarea',
- 'navigator', 'function-page-navigator',
- 'audio', 'image', 'video', 'camera', 'live-player', 'live-pusher',
- 'map',
- 'canvas',
- 'open-data', 'web-view', 'ad'
- ]
- function isOfficialTag(tagName) {
- return officialTags.indexOf(tagName) >= 0 || officialTags.indexOf(`wx-${tagName}`) >= 0
- }
- function transformRpx(style) {
- return style.replace(/(\d+)rpx/ig, '$1px')
- }
- function dashToCamelCase(dash) {
- return dash.replace(/-[a-z]/g, s => s[1].toUpperCase())
- }
- function camelToDashCase(camel) {
- return camel.replace(/([A-Z])/g, '-$1').toLowerCase()
- }
- function animationToStyle({animates, option = {}}) {
- const {transformOrigin, transition} = option
- if (transition === undefined || animates === undefined) {
- return {
- transformOrigin: '',
- transform: '',
- transition: '',
- }
- }
- const addPx = value => (typeof value === 'number' ? value + 'px' : value)
- const transform = animates.filter(({type}) => type !== 'style').map(({type, args}) => {
- switch (type) {
- case 'matrix':
- return `matrix(${args.join(',')})`
- case 'matrix3d':
- return `matrix3d(${args.join(',')})`
- case 'rotate':
- return `rotate(${args[0]}deg)`
- case 'rotate3d':
- args[3] += 'deg'
- return `rotate3d(${args.join(',')})`
- case 'rotateX':
- return `rotateX(${args[0]}deg)`
- case 'rotateY':
- return `rotateY(${args[0]}deg)`
- case 'rotateZ':
- return `rotateZ(${args[0]}deg)`
- case 'scale':
- return `scale(${args.join(',')})`
- case 'scale3d':
- return `scale3d(${args.join(',')})`
- case 'scaleX':
- return `scaleX(${args[0]})`
- case 'scaleY':
- return `scaleY(${args[0]})`
- case 'scaleZ':
- return `scaleZ(${args[0]})`
- case 'translate':
- return `translate(${args.map(addPx).join(',')})`
- case 'translate3d':
- return `translate3d(${args.map(addPx).join(',')})`
- case 'translateX':
- return `translateX(${addPx(args[0])})`
- case 'translateY':
- return `translateY(${addPx(args[0])})`
- case 'translateZ':
- return `translateZ(${addPx(args[0])})`
- case 'skew':
- return `skew(${args.map(value => value + 'deg').join(',')})`
- case 'skewX':
- return `skewX(${args[0]}deg)`
- case 'skewY':
- return `skewY(${args[0]}deg)`
- default:
- return ''
- }
- }).join(' ')
- const style = animates.filter(({type}) => type === 'style').reduce((previous, current) => {
- previous[current.args[0]] = current.args[1]
- return previous
- }, {})
- return {
- style,
- transformOrigin,
- transform,
- transitionProperty: ['transform', ...Object.keys(style)].join(','),
- transition: `${transition.duration}ms ${transition.timingFunction} ${transition.delay}ms`,
- }
- }
- function adjustExparserDefinition(definition) {
-
- const properties = definition.properties || {}
- Object.keys(properties).forEach(key => {
- const value = properties[key]
- if (value === null) {
- properties[key] = {type: null}
- } else if (value === Number || value === String || value === Boolean || value === Object || value === Array) {
- properties[key] = {type: value}
- } else if (value.public === undefined || value.public) {
- properties[key] = {
- type: value.type === null ? null : value.type,
- value: value.value,
- observer: value.observer,
- }
- }
- })
- return definition
- }
- const idTagNameMap = {}
- function setTagName(id, tagName) {
- idTagNameMap[id] = tagName
- }
- function getTagName(id) {
- return idTagNameMap[id]
- }
- const CACHE = {}
- function cache(id, instance) {
- if (instance) {
-
- CACHE[id] = instance
- } else {
-
- return CACHE[id]
- }
- }
- function parseEvent(name, value) {
- const res = /^(capture-)?(mut-)?(bind|catch|)(?::)?(.*)$/ig.exec(name)
- if (res[3] && res[4]) {
-
- const isCapture = !!res[1]
- const isMutated = !!res[2]
- const isCatch = res[3] === 'catch'
- const eventName = res[4]
- return {
- name: eventName,
- isMutated,
- isCapture,
- isCatch,
- handler: value,
- }
- }
- }
- function normalizeAbsolute(absolutePath) {
- if (!absolutePath) return null
- absolutePath = absolutePath.replace(/\\/g, '/')
- return absolutePath.split('/').filter(item => !!item).join('/')
- }
- function relativeToAbsolute(basePath, relativePath) {
- let baseDirPath = normalizeAbsolute(basePath).split('/')
- baseDirPath.pop()
- baseDirPath = baseDirPath.join('/')
- const pathList = []
- normalizeAbsolute(`${baseDirPath}/${relativePath}`).split('/').forEach(item => {
- if (item === '..') {
- pathList.pop()
- } else if (item !== '.') {
- pathList.push(item)
- }
- })
- return pathList.join('/')
- }
- function getDom(exparserNode) {
- let dom = exparserNode.$$
- if (!dom) {
- dom = document.createElement('virtual')
- const fragment = document.createDocumentFragment()
- const shadowRoot = exparserNode.shadowRoot
- const childNodes = shadowRoot && shadowRoot.childNodes
- if (childNodes && childNodes.length) {
- childNodes.forEach(child => fragment.appendChild(getDom(child)))
- }
- dom.appendChild(fragment)
- }
- return dom
- }
- module.exports = {
- getId,
- copy,
- isHtmlTag,
- isOfficialTag,
- transformRpx,
- dashToCamelCase,
- camelToDashCase,
- animationToStyle,
- adjustExparserDefinition,
- setTagName,
- getTagName,
- cache,
- parseEvent,
- normalizeAbsolute,
- relativeToAbsolute,
- getDom,
- }
- }),
- (function(module, exports) {
- module.exports = {
-
- TYPE_ROOT: 10,
- TYPE_SLOT: 11,
- TYPE_TEMPLATE: 12,
- TYPE_BLOCK: 13,
- TYPE_IMPORT: 14,
- TYPE_INCLUDE: 15,
- TYPE_WXS: 16,
- TYPE_COMPONENT: 17,
- TYPE_TEXT: 18,
- TYPE_IF: 19,
- TYPE_FOR: 20,
- TYPE_FORITEM: 21,
- TYPE_NATIVE: 22,
- }
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- function createItem(data) {
- return {
- prev: null,
- next: null,
- data: data
- };
- }
- function allocateCursor(node, prev, next) {
- var cursor;
- if (cursors !== null) {
- cursor = cursors;
- cursors = cursors.cursor;
- cursor.prev = prev;
- cursor.next = next;
- cursor.cursor = node.cursor;
- } else {
- cursor = {
- prev: prev,
- next: next,
- cursor: node.cursor
- };
- }
- node.cursor = cursor;
- return cursor;
- }
- function releaseCursor(node) {
- var cursor = node.cursor;
- node.cursor = cursor.cursor;
- cursor.prev = null;
- cursor.next = null;
- cursor.cursor = cursors;
- cursors = cursor;
- }
- var cursors = null;
- var List = function() {
- this.cursor = null;
- this.head = null;
- this.tail = null;
- };
- List.createItem = createItem;
- List.prototype.createItem = createItem;
- List.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
- var cursor = this.cursor;
- while (cursor !== null) {
- if (cursor.prev === prevOld) {
- cursor.prev = prevNew;
- }
- if (cursor.next === nextOld) {
- cursor.next = nextNew;
- }
- cursor = cursor.cursor;
- }
- };
- List.prototype.getSize = function() {
- var size = 0;
- var cursor = this.head;
- while (cursor) {
- size++;
- cursor = cursor.next;
- }
- return size;
- };
- List.prototype.fromArray = function(array) {
- var cursor = null;
- this.head = null;
- for (var i = 0; i < array.length; i++) {
- var item = createItem(array[i]);
- if (cursor !== null) {
- cursor.next = item;
- } else {
- this.head = item;
- }
- item.prev = cursor;
- cursor = item;
- }
- this.tail = cursor;
- return this;
- };
- List.prototype.toArray = function() {
- var cursor = this.head;
- var result = [];
- while (cursor) {
- result.push(cursor.data);
- cursor = cursor.next;
- }
- return result;
- };
- List.prototype.toJSON = List.prototype.toArray;
- List.prototype.isEmpty = function() {
- return this.head === null;
- };
- List.prototype.first = function() {
- return this.head && this.head.data;
- };
- List.prototype.last = function() {
- return this.tail && this.tail.data;
- };
- List.prototype.each = function(fn, context) {
- var item;
- if (context === undefined) {
- context = this;
- }
-
- var cursor = allocateCursor(this, null, this.head);
- while (cursor.next !== null) {
- item = cursor.next;
- cursor.next = item.next;
- fn.call(context, item.data, item, this);
- }
-
- releaseCursor(this);
- };
- List.prototype.forEach = List.prototype.each;
- List.prototype.eachRight = function(fn, context) {
- var item;
- if (context === undefined) {
- context = this;
- }
-
- var cursor = allocateCursor(this, this.tail, null);
- while (cursor.prev !== null) {
- item = cursor.prev;
- cursor.prev = item.prev;
- fn.call(context, item.data, item, this);
- }
-
- releaseCursor(this);
- };
- List.prototype.forEachRight = List.prototype.eachRight;
- List.prototype.nextUntil = function(start, fn, context) {
- if (start === null) {
- return;
- }
- var item;
- if (context === undefined) {
- context = this;
- }
-
- var cursor = allocateCursor(this, null, start);
- while (cursor.next !== null) {
- item = cursor.next;
- cursor.next = item.next;
- if (fn.call(context, item.data, item, this)) {
- break;
- }
- }
-
- releaseCursor(this);
- };
- List.prototype.prevUntil = function(start, fn, context) {
- if (start === null) {
- return;
- }
- var item;
- if (context === undefined) {
- context = this;
- }
-
- var cursor = allocateCursor(this, start, null);
- while (cursor.prev !== null) {
- item = cursor.prev;
- cursor.prev = item.prev;
- if (fn.call(context, item.data, item, this)) {
- break;
- }
- }
-
- releaseCursor(this);
- };
- List.prototype.some = function(fn, context) {
- var cursor = this.head;
- if (context === undefined) {
- context = this;
- }
- while (cursor !== null) {
- if (fn.call(context, cursor.data, cursor, this)) {
- return true;
- }
- cursor = cursor.next;
- }
- return false;
- };
- List.prototype.map = function(fn, context) {
- var result = new List();
- var cursor = this.head;
- if (context === undefined) {
- context = this;
- }
- while (cursor !== null) {
- result.appendData(fn.call(context, cursor.data, cursor, this));
- cursor = cursor.next;
- }
- return result;
- };
- List.prototype.filter = function(fn, context) {
- var result = new List();
- var cursor = this.head;
- if (context === undefined) {
- context = this;
- }
- while (cursor !== null) {
- if (fn.call(context, cursor.data, cursor, this)) {
- result.appendData(cursor.data);
- }
- cursor = cursor.next;
- }
- return result;
- };
- List.prototype.clear = function() {
- this.head = null;
- this.tail = null;
- };
- List.prototype.copy = function() {
- var result = new List();
- var cursor = this.head;
- while (cursor !== null) {
- result.insert(createItem(cursor.data));
- cursor = cursor.next;
- }
- return result;
- };
- List.prototype.prepend = function(item) {
-
-
-
- this.updateCursors(null, item, this.head, item);
-
- if (this.head !== null) {
-
- this.head.prev = item;
-
- item.next = this.head;
- } else {
-
-
- this.tail = item;
- }
-
- this.head = item;
- return this;
- };
- List.prototype.prependData = function(data) {
- return this.prepend(createItem(data));
- };
- List.prototype.append = function(item) {
- return this.insert(item);
- };
- List.prototype.appendData = function(data) {
- return this.insert(createItem(data));
- };
- List.prototype.insert = function(item, before) {
- if (before !== undefined && before !== null) {
-
-
-
- this.updateCursors(before.prev, item, before, item);
- if (before.prev === null) {
-
- if (this.head !== before) {
- throw new Error('before doesn\'t belong to list');
- }
-
-
- this.head = item;
- before.prev = item;
- item.next = before;
- this.updateCursors(null, item);
- } else {
-
- before.prev.next = item;
- item.prev = before.prev;
- before.prev = item;
- item.next = before;
- }
- } else {
-
-
-
- this.updateCursors(this.tail, item, null, item);
-
- if (this.tail !== null) {
-
- this.tail.next = item;
-
- item.prev = this.tail;
- } else {
-
-
- this.head = item;
- }
-
- this.tail = item;
- }
- return this;
- };
- List.prototype.insertData = function(data, before) {
- return this.insert(createItem(data), before);
- };
- List.prototype.remove = function(item) {
-
-
-
- this.updateCursors(item, item.prev, item, item.next);
- if (item.prev !== null) {
- item.prev.next = item.next;
- } else {
- if (this.head !== item) {
- throw new Error('item doesn\'t belong to list');
- }
- this.head = item.next;
- }
- if (item.next !== null) {
- item.next.prev = item.prev;
- } else {
- if (this.tail !== item) {
- throw new Error('item doesn\'t belong to list');
- }
- this.tail = item.prev;
- }
- item.prev = null;
- item.next = null;
- return item;
- };
- List.prototype.push = function(data) {
- this.insert(createItem(data));
- };
- List.prototype.pop = function() {
- if (this.tail !== null) {
- return this.remove(this.tail);
- }
- };
- List.prototype.unshift = function(data) {
- this.prepend(createItem(data));
- };
- List.prototype.shift = function() {
- if (this.head !== null) {
- return this.remove(this.head);
- }
- };
- List.prototype.prependList = function(list) {
- return this.insertList(list, this.head);
- };
- List.prototype.appendList = function(list) {
- return this.insertList(list);
- };
- List.prototype.insertList = function(list, before) {
-
- if (list.head === null) {
- return this;
- }
- if (before !== undefined && before !== null) {
- this.updateCursors(before.prev, list.tail, before, list.head);
-
- if (before.prev !== null) {
-
- before.prev.next = list.head;
- list.head.prev = before.prev;
- } else {
- this.head = list.head;
- }
- before.prev = list.tail;
- list.tail.next = before;
- } else {
- this.updateCursors(this.tail, list.tail, null, list.head);
-
- if (this.tail !== null) {
-
-
-
- this.tail.next = list.head;
-
- list.head.prev = this.tail;
- } else {
-
-
- this.head = list.head;
- }
-
- this.tail = list.tail;
- }
- list.head = null;
- list.tail = null;
- return this;
- };
- List.prototype.replace = function(oldItem, newItemOrList) {
- if ('head' in newItemOrList) {
- this.insertList(newItemOrList, oldItem);
- } else {
- this.insert(newItemOrList, oldItem);
- }
- this.remove(oldItem);
- };
- module.exports = List;
- }),
- (function(module, exports) {
- function getArg(aArgs, aName, aDefaultValue) {
- if (aName in aArgs) {
- return aArgs[aName];
- } else if (arguments.length === 3) {
- return aDefaultValue;
- } else {
- throw new Error('"' + aName + '" is a required argument.');
- }
- }
- exports.getArg = getArg;
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
- var dataUrlRegexp = /^data:.+\,.+$/;
- function urlParse(aUrl) {
- var match = aUrl.match(urlRegexp);
- if (!match) {
- return null;
- }
- return {
- scheme: match[1],
- auth: match[2],
- host: match[3],
- port: match[4],
- path: match[5]
- };
- }
- exports.urlParse = urlParse;
- function urlGenerate(aParsedUrl) {
- var url = '';
- if (aParsedUrl.scheme) {
- url += aParsedUrl.scheme + ':';
- }
- url += '//';
- if (aParsedUrl.auth) {
- url += aParsedUrl.auth + '@';
- }
- if (aParsedUrl.host) {
- url += aParsedUrl.host;
- }
- if (aParsedUrl.port) {
- url += ":" + aParsedUrl.port
- }
- if (aParsedUrl.path) {
- url += aParsedUrl.path;
- }
- return url;
- }
- exports.urlGenerate = urlGenerate;
- function normalize(aPath) {
- var path = aPath;
- var url = urlParse(aPath);
- if (url) {
- if (!url.path) {
- return aPath;
- }
- path = url.path;
- }
- var isAbsolute = exports.isAbsolute(path);
- var parts = path.split(/\/+/);
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
- part = parts[i];
- if (part === '.') {
- parts.splice(i, 1);
- } else if (part === '..') {
- up++;
- } else if (up > 0) {
- if (part === '') {
-
-
-
- parts.splice(i + 1, up);
- up = 0;
- } else {
- parts.splice(i, 2);
- up--;
- }
- }
- }
- path = parts.join('/');
- if (path === '') {
- path = isAbsolute ? '/' : '.';
- }
- if (url) {
- url.path = path;
- return urlGenerate(url);
- }
- return path;
- }
- exports.normalize = normalize;
- function join(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- if (aPath === "") {
- aPath = ".";
- }
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
-
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
-
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
- aRootUrl.host = aPath;
- return urlGenerate(aRootUrl);
- }
- var joined = aPath.charAt(0) === '/'
- ? aPath
- : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
- if (aRootUrl) {
- aRootUrl.path = joined;
- return urlGenerate(aRootUrl);
- }
- return joined;
- }
- exports.join = join;
- exports.isAbsolute = function (aPath) {
- return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
- };
- function relative(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- aRoot = aRoot.replace(/\/$/, '');
-
-
-
-
- var level = 0;
- while (aPath.indexOf(aRoot + '/') !== 0) {
- var index = aRoot.lastIndexOf("/");
- if (index < 0) {
- return aPath;
- }
-
-
-
- aRoot = aRoot.slice(0, index);
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
- return aPath;
- }
- ++level;
- }
-
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
- }
- exports.relative = relative;
- var supportsNullProto = (function () {
- var obj = Object.create(null);
- return !('__proto__' in obj);
- }());
- function identity (s) {
- return s;
- }
- function toSetString(aStr) {
- if (isProtoString(aStr)) {
- return '$' + aStr;
- }
- return aStr;
- }
- exports.toSetString = supportsNullProto ? identity : toSetString;
- function fromSetString(aStr) {
- if (isProtoString(aStr)) {
- return aStr.slice(1);
- }
- return aStr;
- }
- exports.fromSetString = supportsNullProto ? identity : fromSetString;
- function isProtoString(s) {
- if (!s) {
- return false;
- }
- var length = s.length;
- if (length < 9 ) {
- return false;
- }
- if (s.charCodeAt(length - 1) !== 95 ||
- s.charCodeAt(length - 2) !== 95 ||
- s.charCodeAt(length - 3) !== 111 ||
- s.charCodeAt(length - 4) !== 116 ||
- s.charCodeAt(length - 5) !== 111 ||
- s.charCodeAt(length - 6) !== 114 ||
- s.charCodeAt(length - 7) !== 112 ||
- s.charCodeAt(length - 8) !== 95 ||
- s.charCodeAt(length - 9) !== 95 ) {
- return false;
- }
- for (var i = length - 10; i >= 0; i--) {
- if (s.charCodeAt(i) !== 36 ) {
- return false;
- }
- }
- return true;
- }
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
- var cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0 || onlyCompareOriginal) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByOriginalPositions = compareByOriginalPositions;
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0 || onlyCompareGenerated) {
- return cmp;
- }
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
- function strcmp(aStr1, aStr2) {
- if (aStr1 === aStr2) {
- return 0;
- }
- if (aStr1 === null) {
- return 1;
- }
- if (aStr2 === null) {
- return -1;
- }
- if (aStr1 > aStr2) {
- return 1;
- }
- return -1;
- }
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
- function parseSourceMapInput(str) {
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
- }
- exports.parseSourceMapInput = parseSourceMapInput;
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
- sourceURL = sourceURL || '';
- if (sourceRoot) {
-
- if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
- sourceRoot += '/';
- }
-
-
-
-
-
- sourceURL = sourceRoot + sourceURL;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (sourceMapURL) {
- var parsed = urlParse(sourceMapURL);
- if (!parsed) {
- throw new Error("sourceMapURL could not be parsed");
- }
- if (parsed.path) {
-
- var index = parsed.path.lastIndexOf('/');
- if (index >= 0) {
- parsed.path = parsed.path.substring(0, index + 1);
- }
- }
- sourceURL = join(urlGenerate(parsed), sourceURL);
- }
- return normalize(sourceURL);
- }
- exports.computeSourceURL = computeSourceURL;
- }),
- (function(module, exports) {
- function getArg(aArgs, aName, aDefaultValue) {
- if (aName in aArgs) {
- return aArgs[aName];
- } else if (arguments.length === 3) {
- return aDefaultValue;
- } else {
- throw new Error('"' + aName + '" is a required argument.');
- }
- }
- exports.getArg = getArg;
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
- var dataUrlRegexp = /^data:.+\,.+$/;
- function urlParse(aUrl) {
- var match = aUrl.match(urlRegexp);
- if (!match) {
- return null;
- }
- return {
- scheme: match[1],
- auth: match[2],
- host: match[3],
- port: match[4],
- path: match[5]
- };
- }
- exports.urlParse = urlParse;
- function urlGenerate(aParsedUrl) {
- var url = '';
- if (aParsedUrl.scheme) {
- url += aParsedUrl.scheme + ':';
- }
- url += '//';
- if (aParsedUrl.auth) {
- url += aParsedUrl.auth + '@';
- }
- if (aParsedUrl.host) {
- url += aParsedUrl.host;
- }
- if (aParsedUrl.port) {
- url += ":" + aParsedUrl.port
- }
- if (aParsedUrl.path) {
- url += aParsedUrl.path;
- }
- return url;
- }
- exports.urlGenerate = urlGenerate;
- function normalize(aPath) {
- var path = aPath;
- var url = urlParse(aPath);
- if (url) {
- if (!url.path) {
- return aPath;
- }
- path = url.path;
- }
- var isAbsolute = exports.isAbsolute(path);
- var parts = path.split(/\/+/);
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
- part = parts[i];
- if (part === '.') {
- parts.splice(i, 1);
- } else if (part === '..') {
- up++;
- } else if (up > 0) {
- if (part === '') {
-
-
-
- parts.splice(i + 1, up);
- up = 0;
- } else {
- parts.splice(i, 2);
- up--;
- }
- }
- }
- path = parts.join('/');
- if (path === '') {
- path = isAbsolute ? '/' : '.';
- }
- if (url) {
- url.path = path;
- return urlGenerate(url);
- }
- return path;
- }
- exports.normalize = normalize;
- function join(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- if (aPath === "") {
- aPath = ".";
- }
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
-
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
-
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
- aRootUrl.host = aPath;
- return urlGenerate(aRootUrl);
- }
- var joined = aPath.charAt(0) === '/'
- ? aPath
- : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
- if (aRootUrl) {
- aRootUrl.path = joined;
- return urlGenerate(aRootUrl);
- }
- return joined;
- }
- exports.join = join;
- exports.isAbsolute = function (aPath) {
- return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
- };
- function relative(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- aRoot = aRoot.replace(/\/$/, '');
-
-
-
-
- var level = 0;
- while (aPath.indexOf(aRoot + '/') !== 0) {
- var index = aRoot.lastIndexOf("/");
- if (index < 0) {
- return aPath;
- }
-
-
-
- aRoot = aRoot.slice(0, index);
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
- return aPath;
- }
- ++level;
- }
-
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
- }
- exports.relative = relative;
- var supportsNullProto = (function () {
- var obj = Object.create(null);
- return !('__proto__' in obj);
- }());
- function identity (s) {
- return s;
- }
- function toSetString(aStr) {
- if (isProtoString(aStr)) {
- return '$' + aStr;
- }
- return aStr;
- }
- exports.toSetString = supportsNullProto ? identity : toSetString;
- function fromSetString(aStr) {
- if (isProtoString(aStr)) {
- return aStr.slice(1);
- }
- return aStr;
- }
- exports.fromSetString = supportsNullProto ? identity : fromSetString;
- function isProtoString(s) {
- if (!s) {
- return false;
- }
- var length = s.length;
- if (length < 9 ) {
- return false;
- }
- if (s.charCodeAt(length - 1) !== 95 ||
- s.charCodeAt(length - 2) !== 95 ||
- s.charCodeAt(length - 3) !== 111 ||
- s.charCodeAt(length - 4) !== 116 ||
- s.charCodeAt(length - 5) !== 111 ||
- s.charCodeAt(length - 6) !== 114 ||
- s.charCodeAt(length - 7) !== 112 ||
- s.charCodeAt(length - 8) !== 95 ||
- s.charCodeAt(length - 9) !== 95 ) {
- return false;
- }
- for (var i = length - 10; i >= 0; i--) {
- if (s.charCodeAt(i) !== 36 ) {
- return false;
- }
- }
- return true;
- }
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
- var cmp = mappingA.source - mappingB.source;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0 || onlyCompareOriginal) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- return mappingA.name - mappingB.name;
- }
- exports.compareByOriginalPositions = compareByOriginalPositions;
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0 || onlyCompareGenerated) {
- return cmp;
- }
- cmp = mappingA.source - mappingB.source;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
- return mappingA.name - mappingB.name;
- }
- exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
- function strcmp(aStr1, aStr2) {
- if (aStr1 === aStr2) {
- return 0;
- }
- if (aStr1 > aStr2) {
- return 1;
- }
- return -1;
- }
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
- }),
- (function(module, exports, __webpack_require__) {
- (function(global) {const path = __webpack_require__(3)
- const compilerName = 'miniprogram-compiler'
- let env = 'nodejs'
- let fs = null
- let compiler = null
- let runJs = null
- function getEnv() {
- return env
- }
- function setNodeJsEnv() {
- env = 'nodejs'
- fs = __webpack_require__(71)
-
- compiler = __webpack_require__(14)(compilerName)
- runJs = filePath => {
-
- __webpack_require__(14)(filePath)
- delete __webpack_require__.c[(__webpack_require__(14).resolve(filePath))]
- }
- }
- function setBrowserEnv() {
- env = 'browser'
- fs = {
- readFileSync(filePath) {
- const fileMap = window.__FILE_MAP__ || {}
- if (fileMap[filePath]) {
- return fileMap[filePath]
- } else if (filePath[0] === '/') {
-
- return fileMap[filePath.substr(1)] || null
- }
- return null
- }
- }
- window.require = runJs = filePath => {
- const content = fs.readFileSync(filePath + '.js')
- if (content) {
-
- const func = new Function('require', 'module', content)
- const mod = {exports: {}}
- func.call(null, relativePath => {
- const realPath = path.join(path.dirname(filePath), relativePath)
- return window.require(realPath)
- }, mod)
- return mod.exports
- }
- return null
- }
- }
- try {
- if (typeof global === 'object' && typeof process === 'object') {
-
- setNodeJsEnv()
- } else {
-
- setBrowserEnv()
- }
- } catch (err) {
-
- setBrowserEnv()
- }
- function readFile(filePath) {
- try {
- return fs.readFileSync(filePath, 'utf8')
- } catch (err) {
- return null
- }
- }
- function readJson(filePath) {
- try {
- const content = readFile(filePath)
- return JSON.parse(content)
- } catch (err) {
- return null
- }
- }
- function transformRpx(style) {
- return style.replace(/(\d+)rpx/ig, '$1px')
- }
- function getCompiler() {
- return compiler
- }
- let seed = +new Date()
- const charString = 'abcdefghij'
- function getId() {
- const id = ++seed
- return id.toString().split('').map(item => charString[+item]).join('')
- }
- function isAbsolute(input) {
- if (typeof input !== 'string') return false
- if (!input.length) return false
- return /^(\/|\\|([a-zA-Z]:[/\\]))/.test(input)
- }
- module.exports = {
- getEnv,
- setNodeJsEnv,
- setBrowserEnv,
- runJs,
- readFile,
- readJson,
- transformRpx,
- getCompiler,
- getId,
- isAbsolute,
- }
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports) {
- var OMIT_PLUSSIGN = /^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/;
- var KEEP_PLUSSIGN = /^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/;
- var unsafeToRemovePlusSignAfter = {
- Dimension: true,
- HexColor: true,
- Identifier: true,
- Number: true,
- Raw: true,
- UnicodeRange: true
- };
- function packNumber(value, item) {
-
- var regexp = item && item.prev !== null && unsafeToRemovePlusSignAfter.hasOwnProperty(item.prev.data.type)
- ? KEEP_PLUSSIGN
- : OMIT_PLUSSIGN;
-
-
-
-
-
-
-
-
-
- value = String(value).replace(regexp, '$1$2$3');
- if (value === '' || value === '-') {
- value = '0';
- }
- return value;
- }
- module.exports = function(node, item) {
- node.value = packNumber(node.value, item);
- };
- module.exports.pack = packNumber;
- }),
- (function(module, exports) {
- function runInAsync(options, res) {
- setTimeout(() => {
- if (res.errMsg.indexOf(':ok') >= 0 && typeof options.success === 'function') options.success(res)
- if (res.errMsg.indexOf(':fail') >= 0 && typeof options.fail === 'function') options.fail(res)
- if (typeof options.complete === 'function') options.complete(res)
- }, 0)
- }
- function getSize(string) {
- let total = 0
- for (let i = 0, len = string.length; i < len; i++) {
- const charCode = string.charCodeAt(i)
- if (charCode <= 0x007f) {
- total += 1
- } else if (charCode <= 0x07ff) {
- total += 2
- } else if (charCode <= 0xffff) {
- total += 3
- } else {
- total += 4
- }
- }
- return total
- }
- function mockSync(ret) {
- return () => ret
- }
- function mockAsync(name) {
- return (options = {}) => {
- const res = {
- errMsg: `${name}:ok`,
- }
- runInAsync(options, res)
- }
- }
- module.exports = {
- runInAsync,
- getSize,
- mockSync,
- mockAsync,
- }
- }),
- (function(module, exports, __webpack_require__) {
- const exparser = __webpack_require__(4)
- const CONSTANT = __webpack_require__(6)
- const _ = __webpack_require__(5)
- const transitionKeys = ['transition', 'transitionProperty', 'transform', 'transformOrigin', 'webkitTransition', 'webkitTransitionProperty', 'webkitTransform', 'webkitTransformOrigin']
- function updateAttrs(exparserNode, attrs) {
- const isComponentNode = exparserNode instanceof exparser.Component
- const dataProxy = exparser.Component.getDataProxy(exparserNode)
- let needDoUpdate = false
- exparserNode.dataset = exparserNode.dataset || {}
- for (const {name, value} of attrs) {
- if (name === 'id' || name === 'slot' || (isComponentNode && name === 'class')) {
-
- exparserNode[name] = value || ''
- } else if (isComponentNode && name === 'style' && exparserNode.$$) {
-
- let animationStyle = exparserNode.__animationStyle || {}
- animationStyle = transitionKeys.map(key => {
- const styleValue = animationStyle[key.replace('webkitT', 't')]
- return styleValue !== undefined ? `${_.camelToDashCase(key)}:${styleValue}` : ''
- }).filter(item => !!item.trim()).join(';')
- exparserNode.setNodeStyle(_.transformRpx(value || '', true) + animationStyle)
- } else if (isComponentNode && exparser.Component.hasPublicProperty(exparserNode, _.dashToCamelCase(name))) {
-
- dataProxy.scheduleReplace([_.dashToCamelCase(name)], value)
- needDoUpdate = true
- } else if (/^data-/.test(name)) {
-
- exparserNode.dataset[_.dashToCamelCase(name.slice(5).toLowerCase())] = value
- exparserNode.setAttribute(name, value)
- } else if (isComponentNode && name === 'animation') {
-
- if (exparserNode.$$ && value && value.actions && value.actions.length > 0) {
- let index = 0
- const actions = value.actions
- const length = actions.length
- const step = function () {
- if (index < length) {
- const styleObject = _.animationToStyle(actions[index])
- const extraStyle = styleObject.style
- transitionKeys.forEach(key => {
- exparserNode.$$.style[key] = styleObject[key.replace('webkitT', 't')]
- })
- Object.keys(extraStyle).forEach(key => {
- exparserNode.$$.style[key] = _.transformRpx(extraStyle[key])
- })
- exparserNode.__animationStyle = styleObject
- }
- }
- exparserNode.addListener('transitionend', () => {
- index += 1
- step()
- })
- step()
- }
- } else if (isComponentNode && exparserNode.hasExternalClass(_.camelToDashCase(name))) {
-
- exparserNode.setExternalClass(_.camelToDashCase(name), value)
- }
- }
- if (needDoUpdate) dataProxy.doUpdates(true)
- }
- function updateEvent(exparserNode, event) {
- const convertEventTarget = (target, currentTarget) => {
- if (currentTarget && (target instanceof exparser.VirtualNode) && !target.id && !Object.keys(target.dataset).length) {
-
- target = currentTarget
- }
- return {
- id: target.id,
- offsetLeft: target.$$ && target.$$.offsetLeft || 0,
- offsetTop: target.$$ && target.$$.offsetTop || 0,
- dataset: target.dataset,
- }
- }
- Object.keys(event).forEach(key => {
- const {
- name, isCapture, isMutated, isCatch, handler
- } = event[key]
- if (!handler) return
- event[key].id = exparser.addListenerToElement(exparserNode, name, function (evt) {
- const shadowRoot = exparserNode.ownerShadowRoot
- const mutatedMarked = evt.mutatedMarked()
- if (isMutated && evt.mutatedMarked()) return
- if (isMutated) evt.markMutated()
- if (shadowRoot) {
- const host = shadowRoot.getHostNode()
- const writeOnly = exparser.Component.getComponentOptions(host).writeOnly
- if (!writeOnly) {
- const caller = exparser.Element.getMethodCaller(host)
- if (typeof caller[handler] === 'function') {
- caller[handler]({
- type: evt.type,
- timeStamp: evt.timeStamp,
- target: convertEventTarget(evt.target, this),
- currentTarget: convertEventTarget(this, null),
- detail: evt.detail,
- touches: evt.touches,
- changedTouches: evt.changedTouches,
- mut: mutatedMarked,
- })
- }
- }
- }
- if (isCatch) return false
- }, {capture: isCapture})
- })
- }
- function renderExparserNode(options, shadowRootHost, shadowRoot) {
- const type = options.type
- const tagName = options.tagName
- const componentId = options.componentId
- let exparserNode
- if (type === CONSTANT.TYPE_TEXT) {
- exparserNode = shadowRoot.createTextNode(options.content)
- } else {
- if (type === CONSTANT.TYPE_ROOT) {
- shadowRoot = exparser.ShadowRoot.create(shadowRootHost)
- exparserNode = shadowRoot
- } else if (type === CONSTANT.TYPE_SLOT) {
- exparserNode = shadowRoot.createVirtualNode(tagName)
- exparser.Element.setSlotName(exparserNode, options.slotName)
- } else if (type === CONSTANT.TYPE_TEMPLATE || type === CONSTANT.TYPE_IF || type === CONSTANT.TYPE_FOR || type === CONSTANT.TYPE_FORITEM) {
- exparserNode = shadowRoot.createVirtualNode(tagName)
- exparser.Element.setInheritSlots(exparserNode)
- } else {
- const componentTagName = _.getTagName(componentId || tagName) || tagName
- const componentName = componentId || tagName
- exparserNode = shadowRoot.createComponent(componentTagName, componentName, options.generics)
- }
- updateAttrs(exparserNode, options.attrs)
- updateEvent(exparserNode, options.event)
-
- options.children.forEach(vt => {
- const childExparserNode = renderExparserNode(vt, null, shadowRoot)
- exparserNode.appendChild(childExparserNode)
- })
- }
- options.exparserNode = exparserNode
- exparserNode._vt = options
- return exparserNode
- }
- module.exports = {
- updateAttrs,
- updateEvent,
- renderExparserNode,
- }
- }),
- (function(module, exports) {
- function webpackEmptyContext(req) {
- var e = new Error("Cannot find module '" + req + "'");
- e.code = 'MODULE_NOT_FOUND';
- throw e;
- }
- webpackEmptyContext.keys = function() { return []; };
- webpackEmptyContext.resolve = webpackEmptyContext;
- module.exports = webpackEmptyContext;
- webpackEmptyContext.id = 14;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _node = _interopRequireDefault(__webpack_require__(16));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var Declaration = function (_Node) {
- _inheritsLoose(Declaration, _Node);
- function Declaration(defaults) {
- var _this;
- _this = _Node.call(this, defaults) || this;
- _this.type = 'decl';
- return _this;
- }
-
-
-
-
- return Declaration;
- }(_node.default);
- var _default = Declaration;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _cssSyntaxError = _interopRequireDefault(__webpack_require__(34));
- var _stringifier = _interopRequireDefault(__webpack_require__(35));
- var _stringify = _interopRequireDefault(__webpack_require__(17));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function cloneNode(obj, parent) {
- var cloned = new obj.constructor();
- for (var i in obj) {
- if (!obj.hasOwnProperty(i)) continue;
- var value = obj[i];
- var type = typeof value;
- if (i === 'parent' && type === 'object') {
- if (parent) cloned[i] = parent;
- } else if (i === 'source') {
- cloned[i] = value;
- } else if (value instanceof Array) {
- cloned[i] = value.map(function (j) {
- return cloneNode(j, cloned);
- });
- } else {
- if (type === 'object' && value !== null) value = cloneNode(value);
- cloned[i] = value;
- }
- }
- return cloned;
- }
- var Node = function () {
-
- function Node(defaults) {
- if (defaults === void 0) {
- defaults = {};
- }
- this.raws = {};
- if (false) {}
- for (var name in defaults) {
- this[name] = defaults[name];
- }
- }
-
- var _proto = Node.prototype;
- _proto.error = function error(message, opts) {
- if (opts === void 0) {
- opts = {};
- }
- if (this.source) {
- var pos = this.positionBy(opts);
- return this.source.input.error(message, pos.line, pos.column, opts);
- }
- return new _cssSyntaxError.default(message);
- }
-
- ;
- _proto.warn = function warn(result, text, opts) {
- var data = {
- node: this
- };
- for (var i in opts) {
- data[i] = opts[i];
- }
- return result.warn(text, data);
- }
-
- ;
- _proto.remove = function remove() {
- if (this.parent) {
- this.parent.removeChild(this);
- }
- this.parent = undefined;
- return this;
- }
-
- ;
- _proto.toString = function toString(stringifier) {
- if (stringifier === void 0) {
- stringifier = _stringify.default;
- }
- if (stringifier.stringify) stringifier = stringifier.stringify;
- var result = '';
- stringifier(this, function (i) {
- result += i;
- });
- return result;
- }
-
- ;
- _proto.clone = function clone(overrides) {
- if (overrides === void 0) {
- overrides = {};
- }
- var cloned = cloneNode(this);
- for (var name in overrides) {
- cloned[name] = overrides[name];
- }
- return cloned;
- }
-
- ;
- _proto.cloneBefore = function cloneBefore(overrides) {
- if (overrides === void 0) {
- overrides = {};
- }
- var cloned = this.clone(overrides);
- this.parent.insertBefore(this, cloned);
- return cloned;
- }
-
- ;
- _proto.cloneAfter = function cloneAfter(overrides) {
- if (overrides === void 0) {
- overrides = {};
- }
- var cloned = this.clone(overrides);
- this.parent.insertAfter(this, cloned);
- return cloned;
- }
-
- ;
- _proto.replaceWith = function replaceWith() {
- if (this.parent) {
- for (var _len = arguments.length, nodes = new Array(_len), _key = 0; _key < _len; _key++) {
- nodes[_key] = arguments[_key];
- }
- for (var _i = 0, _nodes = nodes; _i < _nodes.length; _i++) {
- var node = _nodes[_i];
- this.parent.insertBefore(this, node);
- }
- this.remove();
- }
- return this;
- }
-
- ;
- _proto.next = function next() {
- if (!this.parent) return undefined;
- var index = this.parent.index(this);
- return this.parent.nodes[index + 1];
- }
-
- ;
- _proto.prev = function prev() {
- if (!this.parent) return undefined;
- var index = this.parent.index(this);
- return this.parent.nodes[index - 1];
- }
-
- ;
- _proto.before = function before(add) {
- this.parent.insertBefore(this, add);
- return this;
- }
-
- ;
- _proto.after = function after(add) {
- this.parent.insertAfter(this, add);
- return this;
- };
- _proto.toJSON = function toJSON() {
- var fixed = {};
- for (var name in this) {
- if (!this.hasOwnProperty(name)) continue;
- if (name === 'parent') continue;
- var value = this[name];
- if (value instanceof Array) {
- fixed[name] = value.map(function (i) {
- if (typeof i === 'object' && i.toJSON) {
- return i.toJSON();
- } else {
- return i;
- }
- });
- } else if (typeof value === 'object' && value.toJSON) {
- fixed[name] = value.toJSON();
- } else {
- fixed[name] = value;
- }
- }
- return fixed;
- }
-
- ;
- _proto.raw = function raw(prop, defaultType) {
- var str = new _stringifier.default();
- return str.raw(this, prop, defaultType);
- }
-
- ;
- _proto.root = function root() {
- var result = this;
- while (result.parent) {
- result = result.parent;
- }
- return result;
- }
-
- ;
- _proto.cleanRaws = function cleanRaws(keepBetween) {
- delete this.raws.before;
- delete this.raws.after;
- if (!keepBetween) delete this.raws.between;
- };
- _proto.positionInside = function positionInside(index) {
- var string = this.toString();
- var column = this.source.start.column;
- var line = this.source.start.line;
- for (var i = 0; i < index; i++) {
- if (string[i] === '\n') {
- column = 1;
- line += 1;
- } else {
- column += 1;
- }
- }
- return {
- line: line,
- column: column
- };
- };
- _proto.positionBy = function positionBy(opts) {
- var pos = this.source.start;
- if (opts.index) {
- pos = this.positionInside(opts.index);
- } else if (opts.word) {
- var index = this.toString().indexOf(opts.word);
- if (index !== -1) pos = this.positionInside(index);
- }
- return pos;
- }
-
-
-
-
- ;
- return Node;
- }();
- var _default = Node;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _stringifier = _interopRequireDefault(__webpack_require__(35));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function stringify(node, builder) {
- var str = new _stringifier.default(builder);
- str.stringify(node);
- }
- var _default = stringify;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _parser = _interopRequireDefault(__webpack_require__(89));
- var _input = _interopRequireDefault(__webpack_require__(91));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function parse(css, opts) {
- var input = new _input.default(css, opts);
- var parser = new _parser.default(input);
- try {
- parser.parse();
- } catch (e) {
- if (false) {}
- throw e;
- }
- return parser.root;
- }
- var _default = parse;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _node = _interopRequireDefault(__webpack_require__(16));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var Comment = function (_Node) {
- _inheritsLoose(Comment, _Node);
- function Comment(defaults) {
- var _this;
- _this = _Node.call(this, defaults) || this;
- _this.type = 'comment';
- return _this;
- }
-
-
- return Comment;
- }(_node.default);
- var _default = Comment;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _container = _interopRequireDefault(__webpack_require__(21));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var AtRule = function (_Container) {
- _inheritsLoose(AtRule, _Container);
- function AtRule(defaults) {
- var _this;
- _this = _Container.call(this, defaults) || this;
- _this.type = 'atrule';
- return _this;
- }
- var _proto = AtRule.prototype;
- _proto.append = function append() {
- var _Container$prototype$;
- if (!this.nodes) this.nodes = [];
- for (var _len = arguments.length, children = new Array(_len), _key = 0; _key < _len; _key++) {
- children[_key] = arguments[_key];
- }
- return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
- };
- _proto.prepend = function prepend() {
- var _Container$prototype$2;
- if (!this.nodes) this.nodes = [];
- for (var _len2 = arguments.length, children = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- children[_key2] = arguments[_key2];
- }
- return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
- }
-
-
-
- ;
- return AtRule;
- }(_container.default);
- var _default = AtRule;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _declaration = _interopRequireDefault(__webpack_require__(15));
- var _comment = _interopRequireDefault(__webpack_require__(19));
- var _node = _interopRequireDefault(__webpack_require__(16));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- function _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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- function cleanSource(nodes) {
- return nodes.map(function (i) {
- if (i.nodes) i.nodes = cleanSource(i.nodes);
- delete i.source;
- return i;
- });
- }
- var Container = function (_Node) {
- _inheritsLoose(Container, _Node);
- function Container() {
- return _Node.apply(this, arguments) || this;
- }
- var _proto = Container.prototype;
- _proto.push = function push(child) {
- child.parent = this;
- this.nodes.push(child);
- return this;
- }
-
- ;
- _proto.each = function each(callback) {
- if (!this.lastEach) this.lastEach = 0;
- if (!this.indexes) this.indexes = {};
- this.lastEach += 1;
- var id = this.lastEach;
- this.indexes[id] = 0;
- if (!this.nodes) return undefined;
- var index, result;
- while (this.indexes[id] < this.nodes.length) {
- index = this.indexes[id];
- result = callback(this.nodes[index], index);
- if (result === false) break;
- this.indexes[id] += 1;
- }
- delete this.indexes[id];
- return result;
- }
-
- ;
- _proto.walk = function walk(callback) {
- return this.each(function (child, i) {
- var result;
- try {
- result = callback(child, i);
- } catch (e) {
- e.postcssNode = child;
- if (e.stack && child.source && /\n\s{4}at /.test(e.stack)) {
- var s = child.source;
- e.stack = e.stack.replace(/\n\s{4}at /, "$&" + s.input.from + ":" + s.start.line + ":" + s.start.column + "$&");
- }
- throw e;
- }
- if (result !== false && child.walk) {
- result = child.walk(callback);
- }
- return result;
- });
- }
-
- ;
- _proto.walkDecls = function walkDecls(prop, callback) {
- if (!callback) {
- callback = prop;
- return this.walk(function (child, i) {
- if (child.type === 'decl') {
- return callback(child, i);
- }
- });
- }
- if (prop instanceof RegExp) {
- return this.walk(function (child, i) {
- if (child.type === 'decl' && prop.test(child.prop)) {
- return callback(child, i);
- }
- });
- }
- return this.walk(function (child, i) {
- if (child.type === 'decl' && child.prop === prop) {
- return callback(child, i);
- }
- });
- }
-
- ;
- _proto.walkRules = function walkRules(selector, callback) {
- if (!callback) {
- callback = selector;
- return this.walk(function (child, i) {
- if (child.type === 'rule') {
- return callback(child, i);
- }
- });
- }
- if (selector instanceof RegExp) {
- return this.walk(function (child, i) {
- if (child.type === 'rule' && selector.test(child.selector)) {
- return callback(child, i);
- }
- });
- }
- return this.walk(function (child, i) {
- if (child.type === 'rule' && child.selector === selector) {
- return callback(child, i);
- }
- });
- }
-
- ;
- _proto.walkAtRules = function walkAtRules(name, callback) {
- if (!callback) {
- callback = name;
- return this.walk(function (child, i) {
- if (child.type === 'atrule') {
- return callback(child, i);
- }
- });
- }
- if (name instanceof RegExp) {
- return this.walk(function (child, i) {
- if (child.type === 'atrule' && name.test(child.name)) {
- return callback(child, i);
- }
- });
- }
- return this.walk(function (child, i) {
- if (child.type === 'atrule' && child.name === name) {
- return callback(child, i);
- }
- });
- }
-
- ;
- _proto.walkComments = function walkComments(callback) {
- return this.walk(function (child, i) {
- if (child.type === 'comment') {
- return callback(child, i);
- }
- });
- }
-
- ;
- _proto.append = function append() {
- for (var _len = arguments.length, children = new Array(_len), _key = 0; _key < _len; _key++) {
- children[_key] = arguments[_key];
- }
- for (var _i = 0, _children = children; _i < _children.length; _i++) {
- var child = _children[_i];
- var nodes = this.normalize(child, this.last);
- for (var _iterator = _createForOfIteratorHelperLoose(nodes), _step; !(_step = _iterator()).done;) {
- var node = _step.value;
- this.nodes.push(node);
- }
- }
- return this;
- }
-
- ;
- _proto.prepend = function prepend() {
- for (var _len2 = arguments.length, children = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- children[_key2] = arguments[_key2];
- }
- children = children.reverse();
- for (var _iterator2 = _createForOfIteratorHelperLoose(children), _step2; !(_step2 = _iterator2()).done;) {
- var child = _step2.value;
- var nodes = this.normalize(child, this.first, 'prepend').reverse();
- for (var _iterator3 = _createForOfIteratorHelperLoose(nodes), _step3; !(_step3 = _iterator3()).done;) {
- var node = _step3.value;
- this.nodes.unshift(node);
- }
- for (var id in this.indexes) {
- this.indexes[id] = this.indexes[id] + nodes.length;
- }
- }
- return this;
- };
- _proto.cleanRaws = function cleanRaws(keepBetween) {
- _Node.prototype.cleanRaws.call(this, keepBetween);
- if (this.nodes) {
- for (var _iterator4 = _createForOfIteratorHelperLoose(this.nodes), _step4; !(_step4 = _iterator4()).done;) {
- var node = _step4.value;
- node.cleanRaws(keepBetween);
- }
- }
- }
-
- ;
- _proto.insertBefore = function insertBefore(exist, add) {
- exist = this.index(exist);
- var type = exist === 0 ? 'prepend' : false;
- var nodes = this.normalize(add, this.nodes[exist], type).reverse();
- for (var _iterator5 = _createForOfIteratorHelperLoose(nodes), _step5; !(_step5 = _iterator5()).done;) {
- var node = _step5.value;
- this.nodes.splice(exist, 0, node);
- }
- var index;
- for (var id in this.indexes) {
- index = this.indexes[id];
- if (exist <= index) {
- this.indexes[id] = index + nodes.length;
- }
- }
- return this;
- }
-
- ;
- _proto.insertAfter = function insertAfter(exist, add) {
- exist = this.index(exist);
- var nodes = this.normalize(add, this.nodes[exist]).reverse();
- for (var _iterator6 = _createForOfIteratorHelperLoose(nodes), _step6; !(_step6 = _iterator6()).done;) {
- var node = _step6.value;
- this.nodes.splice(exist + 1, 0, node);
- }
- var index;
- for (var id in this.indexes) {
- index = this.indexes[id];
- if (exist < index) {
- this.indexes[id] = index + nodes.length;
- }
- }
- return this;
- }
-
- ;
- _proto.removeChild = function removeChild(child) {
- child = this.index(child);
- this.nodes[child].parent = undefined;
- this.nodes.splice(child, 1);
- var index;
- for (var id in this.indexes) {
- index = this.indexes[id];
- if (index >= child) {
- this.indexes[id] = index - 1;
- }
- }
- return this;
- }
-
- ;
- _proto.removeAll = function removeAll() {
- for (var _iterator7 = _createForOfIteratorHelperLoose(this.nodes), _step7; !(_step7 = _iterator7()).done;) {
- var node = _step7.value;
- node.parent = undefined;
- }
- this.nodes = [];
- return this;
- }
-
- ;
- _proto.replaceValues = function replaceValues(pattern, opts, callback) {
- if (!callback) {
- callback = opts;
- opts = {};
- }
- this.walkDecls(function (decl) {
- if (opts.props && opts.props.indexOf(decl.prop) === -1) return;
- if (opts.fast && decl.value.indexOf(opts.fast) === -1) return;
- decl.value = decl.value.replace(pattern, callback);
- });
- return this;
- }
-
- ;
- _proto.every = function every(condition) {
- return this.nodes.every(condition);
- }
-
- ;
- _proto.some = function some(condition) {
- return this.nodes.some(condition);
- }
-
- ;
- _proto.index = function index(child) {
- if (typeof child === 'number') {
- return child;
- }
- return this.nodes.indexOf(child);
- }
-
- ;
- _proto.normalize = function normalize(nodes, sample) {
- var _this = this;
- if (typeof nodes === 'string') {
- var parse = __webpack_require__(18);
- nodes = cleanSource(parse(nodes).nodes);
- } else if (Array.isArray(nodes)) {
- nodes = nodes.slice(0);
- for (var _iterator8 = _createForOfIteratorHelperLoose(nodes), _step8; !(_step8 = _iterator8()).done;) {
- var i = _step8.value;
- if (i.parent) i.parent.removeChild(i, 'ignore');
- }
- } else if (nodes.type === 'root') {
- nodes = nodes.nodes.slice(0);
- for (var _iterator9 = _createForOfIteratorHelperLoose(nodes), _step9; !(_step9 = _iterator9()).done;) {
- var _i2 = _step9.value;
- if (_i2.parent) _i2.parent.removeChild(_i2, 'ignore');
- }
- } else if (nodes.type) {
- nodes = [nodes];
- } else if (nodes.prop) {
- if (typeof nodes.value === 'undefined') {
- throw new Error('Value field is missed in node creation');
- } else if (typeof nodes.value !== 'string') {
- nodes.value = String(nodes.value);
- }
- nodes = [new _declaration.default(nodes)];
- } else if (nodes.selector) {
- var Rule = __webpack_require__(22);
- nodes = [new Rule(nodes)];
- } else if (nodes.name) {
- var AtRule = __webpack_require__(20);
- nodes = [new AtRule(nodes)];
- } else if (nodes.text) {
- nodes = [new _comment.default(nodes)];
- } else {
- throw new Error('Unknown node type in node creation');
- }
- var processed = nodes.map(function (i) {
- if (i.parent) i.parent.removeChild(i);
- if (typeof i.raws.before === 'undefined') {
- if (sample && typeof sample.raws.before !== 'undefined') {
- i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
- }
- }
- i.parent = _this;
- return i;
- });
- return processed;
- }
-
- ;
- _createClass(Container, [{
- key: "first",
- get: function get() {
- if (!this.nodes) return undefined;
- return this.nodes[0];
- }
-
- }, {
- key: "last",
- get: function get() {
- if (!this.nodes) return undefined;
- return this.nodes[this.nodes.length - 1];
- }
- }]);
- return Container;
- }(_node.default);
- var _default = Container;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _container = _interopRequireDefault(__webpack_require__(21));
- var _list = _interopRequireDefault(__webpack_require__(43));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var Rule = function (_Container) {
- _inheritsLoose(Rule, _Container);
- function Rule(defaults) {
- var _this;
- _this = _Container.call(this, defaults) || this;
- _this.type = 'rule';
- if (!_this.nodes) _this.nodes = [];
- return _this;
- }
-
- _createClass(Rule, [{
- key: "selectors",
- get: function get() {
- return _list.default.comma(this.selector);
- },
- set: function set(values) {
- var match = this.selector ? this.selector.match(/,\s*/) : null;
- var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
- this.selector = values.join(sep);
- }
-
-
- }]);
- return Rule;
- }(_container.default);
- var _default = Rule;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports) {
- module.exports = function createCustomError(name, message) {
-
-
- var error = Object.create(SyntaxError.prototype);
- var errorStack = new Error();
- error.name = name;
- error.message = message;
- Object.defineProperty(error, 'stack', {
- get: function() {
- return (errorStack.stack || '').replace(/^(.+\n){1,3}/, name + ': ' + message + '\n');
- }
- });
- return error;
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var WHITESPACE = 1;
- var IDENTIFIER = 2;
- var NUMBER = 3;
- var STRING = 4;
- var COMMENT = 5;
- var PUNCTUATOR = 6;
- var CDO = 7;
- var CDC = 8;
- var ATKEYWORD = 14;
- var FUNCTION = 15;
- var URL = 16;
- var RAW = 17;
- var TAB = 9;
- var N = 10;
- var F = 12;
- var R = 13;
- var SPACE = 32;
- var TYPE = {
- WhiteSpace: WHITESPACE,
- Identifier: IDENTIFIER,
- Number: NUMBER,
- String: STRING,
- Comment: COMMENT,
- Punctuator: PUNCTUATOR,
- CDO: CDO,
- CDC: CDC,
- AtKeyword: ATKEYWORD,
- Function: FUNCTION,
- Url: URL,
- Raw: RAW,
- ExclamationMark: 33,
- QuotationMark: 34,
- NumberSign: 35,
- DollarSign: 36,
- PercentSign: 37,
- Ampersand: 38,
- Apostrophe: 39,
- LeftParenthesis: 40,
- RightParenthesis: 41,
- Asterisk: 42,
- PlusSign: 43,
- Comma: 44,
- HyphenMinus: 45,
- FullStop: 46,
- Solidus: 47,
- Colon: 58,
- Semicolon: 59,
- LessThanSign: 60,
- EqualsSign: 61,
- GreaterThanSign: 62,
- QuestionMark: 63,
- CommercialAt: 64,
- LeftSquareBracket: 91,
- Backslash: 92,
- RightSquareBracket: 93,
- CircumflexAccent: 94,
- LowLine: 95,
- GraveAccent: 96,
- LeftCurlyBracket: 123,
- VerticalLine: 124,
- RightCurlyBracket: 125,
- Tilde: 126
- };
- var NAME = Object.keys(TYPE).reduce(function(result, key) {
- result[TYPE[key]] = key;
- return result;
- }, {});
- var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array;
- var SYMBOL_TYPE = new SafeUint32Array(0x80);
- var PUNCTUATION = new SafeUint32Array(0x80);
- var STOP_URL_RAW = new SafeUint32Array(0x80);
- for (var i = 0; i < SYMBOL_TYPE.length; i++) {
- SYMBOL_TYPE[i] = IDENTIFIER;
- }
- [
- TYPE.ExclamationMark,
- TYPE.QuotationMark,
- TYPE.NumberSign,
- TYPE.DollarSign,
- TYPE.PercentSign,
- TYPE.Ampersand,
- TYPE.Apostrophe,
- TYPE.LeftParenthesis,
- TYPE.RightParenthesis,
- TYPE.Asterisk,
- TYPE.PlusSign,
- TYPE.Comma,
- TYPE.HyphenMinus,
- TYPE.FullStop,
- TYPE.Solidus,
- TYPE.Colon,
- TYPE.Semicolon,
- TYPE.LessThanSign,
- TYPE.EqualsSign,
- TYPE.GreaterThanSign,
- TYPE.QuestionMark,
- TYPE.CommercialAt,
- TYPE.LeftSquareBracket,
-
- TYPE.RightSquareBracket,
- TYPE.CircumflexAccent,
-
- TYPE.GraveAccent,
- TYPE.LeftCurlyBracket,
- TYPE.VerticalLine,
- TYPE.RightCurlyBracket,
- TYPE.Tilde
- ].forEach(function(key) {
- SYMBOL_TYPE[Number(key)] = PUNCTUATOR;
- PUNCTUATION[Number(key)] = PUNCTUATOR;
- });
- for (var i = 48; i <= 57; i++) {
- SYMBOL_TYPE[i] = NUMBER;
- }
- SYMBOL_TYPE[SPACE] = WHITESPACE;
- SYMBOL_TYPE[TAB] = WHITESPACE;
- SYMBOL_TYPE[N] = WHITESPACE;
- SYMBOL_TYPE[R] = WHITESPACE;
- SYMBOL_TYPE[F] = WHITESPACE;
- SYMBOL_TYPE[TYPE.Apostrophe] = STRING;
- SYMBOL_TYPE[TYPE.QuotationMark] = STRING;
- STOP_URL_RAW[SPACE] = 1;
- STOP_URL_RAW[TAB] = 1;
- STOP_URL_RAW[N] = 1;
- STOP_URL_RAW[R] = 1;
- STOP_URL_RAW[F] = 1;
- STOP_URL_RAW[TYPE.Apostrophe] = 1;
- STOP_URL_RAW[TYPE.QuotationMark] = 1;
- STOP_URL_RAW[TYPE.LeftParenthesis] = 1;
- STOP_URL_RAW[TYPE.RightParenthesis] = 1;
- PUNCTUATION[SPACE] = PUNCTUATOR;
- PUNCTUATION[TAB] = PUNCTUATOR;
- PUNCTUATION[N] = PUNCTUATOR;
- PUNCTUATION[R] = PUNCTUATOR;
- PUNCTUATION[F] = PUNCTUATOR;
- PUNCTUATION[TYPE.HyphenMinus] = 0;
- module.exports = {
- TYPE: TYPE,
- NAME: NAME,
- SYMBOL_TYPE: SYMBOL_TYPE,
- PUNCTUATION: PUNCTUATION,
- STOP_URL_RAW: STOP_URL_RAW
- };
- }),
- (function(module, exports) {
- function noop(value) {
- return value;
- }
- function generateMultiplier(multiplier) {
- if (multiplier.min === 0 && multiplier.max === 0) {
- return '*';
- }
- if (multiplier.min === 0 && multiplier.max === 1) {
- return '?';
- }
- if (multiplier.min === 1 && multiplier.max === 0) {
- return multiplier.comma ? '#' : '+';
- }
- if (multiplier.min === 1 && multiplier.max === 1) {
- return '';
- }
- return (
- (multiplier.comma ? '#' : '') +
- (multiplier.min === multiplier.max
- ? '{' + multiplier.min + '}'
- : '{' + multiplier.min + ',' + (multiplier.max !== 0 ? multiplier.max : '') + '}'
- )
- );
- }
- function generateSequence(node, forceBraces, decorate) {
- var result = node.terms.map(function(term) {
- return generate(term, forceBraces, decorate);
- }).join(node.combinator === ' ' ? ' ' : ' ' + node.combinator + ' ');
- if (node.explicit || forceBraces) {
- result = (result[0] !== ',' ? '[ ' : '[') + result + ' ]';
- }
- return result;
- }
- function generate(node, forceBraces, decorate) {
- var result;
- switch (node.type) {
- case 'Group':
- result =
- generateSequence(node, forceBraces, decorate) +
- (node.disallowEmpty ? '!' : '');
- break;
- case 'Multiplier':
-
- return (
- generate(node.term, forceBraces, decorate) +
- decorate(generateMultiplier(node), node)
- );
- case 'Type':
- result = '<' + node.name + '>';
- break;
- case 'Property':
- result = '<\'' + node.name + '\'>';
- break;
- case 'Keyword':
- result = node.name;
- break;
- case 'AtKeyword':
- result = '@' + node.name;
- break;
- case 'Function':
- result = node.name + '(';
- break;
- case 'String':
- case 'Token':
- result = node.value;
- break;
- case 'Comma':
- result = ',';
- break;
- default:
- throw new Error('Unknown node type `' + node.type + '`');
- }
- return decorate(result, node);
- }
- module.exports = function(node, options) {
- var decorate = noop;
- var forceBraces = false;
- if (typeof options === 'function') {
- decorate = options;
- } else if (options) {
- forceBraces = Boolean(options.forceBraces);
- if (typeof options.decorate === 'function') {
- decorate = options.decorate;
- }
- }
- return generate(node, forceBraces, decorate);
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var keywords = Object.create(null);
- var properties = Object.create(null);
- var HYPHENMINUS = 45;
- function isCustomProperty(str, offset) {
- offset = offset || 0;
- return str.length - offset >= 2 &&
- str.charCodeAt(offset) === HYPHENMINUS &&
- str.charCodeAt(offset + 1) === HYPHENMINUS;
- }
- function getVendorPrefix(str, offset) {
- offset = offset || 0;
-
- if (str.length - offset >= 3) {
-
- if (str.charCodeAt(offset) === HYPHENMINUS &&
- str.charCodeAt(offset + 1) !== HYPHENMINUS) {
-
- var secondDashIndex = str.indexOf('-', offset + 2);
- if (secondDashIndex !== -1) {
- return str.substring(offset, secondDashIndex + 1);
- }
- }
- }
- return '';
- }
- function getKeywordDescriptor(keyword) {
- if (hasOwnProperty.call(keywords, keyword)) {
- return keywords[keyword];
- }
- var name = keyword.toLowerCase();
- if (hasOwnProperty.call(keywords, name)) {
- return keywords[keyword] = keywords[name];
- }
- var custom = isCustomProperty(name, 0);
- var vendor = !custom ? getVendorPrefix(name, 0) : '';
- return keywords[keyword] = Object.freeze({
- basename: name.substr(vendor.length),
- name: name,
- vendor: vendor,
- prefix: vendor,
- custom: custom
- });
- }
- function getPropertyDescriptor(property) {
- if (hasOwnProperty.call(properties, property)) {
- return properties[property];
- }
- var name = property;
- var hack = property[0];
- if (hack === '/') {
- hack = property[1] === '/' ? '//' : '/';
- } else if (hack !== '_' &&
- hack !== '*' &&
- hack !== '$' &&
- hack !== '#' &&
- hack !== '+') {
- hack = '';
- }
- var custom = isCustomProperty(name, hack.length);
-
- if (!custom) {
- name = name.toLowerCase();
- if (hasOwnProperty.call(properties, name)) {
- return properties[property] = properties[name];
- }
- }
- var vendor = !custom ? getVendorPrefix(name, hack.length) : '';
- var prefix = name.substr(0, hack.length + vendor.length);
- return properties[property] = Object.freeze({
- basename: name.substr(prefix.length),
- name: name.substr(hack.length),
- hack: hack,
- vendor: vendor,
- prefix: prefix,
- custom: custom
- });
- }
- module.exports = {
- keyword: getKeywordDescriptor,
- property: getPropertyDescriptor,
- isCustomProperty: isCustomProperty,
- vendorPrefix: getVendorPrefix
- };
- }),
- (function(module, exports, __webpack_require__) {
- var Tokenizer = __webpack_require__(103);
- var TAB = 9;
- var N = 10;
- var F = 12;
- var R = 13;
- var SPACE = 32;
- var EXCLAMATIONMARK = 33;
- var NUMBERSIGN = 35;
- var AMPERSAND = 38;
- var APOSTROPHE = 39;
- var LEFTPARENTHESIS = 40;
- var RIGHTPARENTHESIS = 41;
- var ASTERISK = 42;
- var PLUSSIGN = 43;
- var COMMA = 44;
- var LESSTHANSIGN = 60;
- var GREATERTHANSIGN = 62;
- var QUESTIONMARK = 63;
- var COMMERCIALAT = 64;
- var LEFTSQUAREBRACKET = 91;
- var RIGHTSQUAREBRACKET = 93;
- var LEFTCURLYBRACKET = 123;
- var VERTICALLINE = 124;
- var RIGHTCURLYBRACKET = 125;
- var NAME_CHAR = createCharMap(function(ch) {
- return /[a-zA-Z0-9\-]/.test(ch);
- });
- var COMBINATOR_PRECEDENCE = {
- ' ': 1,
- '&&': 2,
- '||': 3,
- '|': 4
- };
- function createCharMap(fn) {
- var array = typeof Uint32Array === 'function' ? new Uint32Array(128) : new Array(128);
- for (var i = 0; i < 128; i++) {
- array[i] = fn(String.fromCharCode(i)) ? 1 : 0;
- }
- return array;
- }
- function scanSpaces(tokenizer) {
- return tokenizer.substringToPos(
- tokenizer.findWsEnd(tokenizer.pos + 1)
- );
- }
- function scanWord(tokenizer) {
- var end = tokenizer.pos;
- for (; end < tokenizer.str.length; end++) {
- var code = tokenizer.str.charCodeAt(end);
- if (code >= 128 || NAME_CHAR[code] === 0) {
- break;
- }
- }
- if (tokenizer.pos === end) {
- tokenizer.error('Expect a keyword');
- }
- return tokenizer.substringToPos(end);
- }
- function scanNumber(tokenizer) {
- var end = tokenizer.pos;
- for (; end < tokenizer.str.length; end++) {
- var code = tokenizer.str.charCodeAt(end);
- if (code < 48 || code > 57) {
- break;
- }
- }
- if (tokenizer.pos === end) {
- tokenizer.error('Expect a number');
- }
- return tokenizer.substringToPos(end);
- }
- function scanString(tokenizer) {
- var end = tokenizer.str.indexOf('\'', tokenizer.pos + 1);
- if (end === -1) {
- tokenizer.pos = tokenizer.str.length;
- tokenizer.error('Expect an apostrophe');
- }
- return tokenizer.substringToPos(end + 1);
- }
- function readMultiplierRange(tokenizer) {
- var min = null;
- var max = null;
- tokenizer.eat(LEFTCURLYBRACKET);
- min = scanNumber(tokenizer);
- if (tokenizer.charCode() === COMMA) {
- tokenizer.pos++;
- if (tokenizer.charCode() !== RIGHTCURLYBRACKET) {
- max = scanNumber(tokenizer);
- }
- } else {
- max = min;
- }
- tokenizer.eat(RIGHTCURLYBRACKET);
- return {
- min: Number(min),
- max: max ? Number(max) : 0
- };
- }
- function readMultiplier(tokenizer) {
- var range = null;
- var comma = false;
- switch (tokenizer.charCode()) {
- case ASTERISK:
- tokenizer.pos++;
- range = {
- min: 0,
- max: 0
- };
- break;
- case PLUSSIGN:
- tokenizer.pos++;
- range = {
- min: 1,
- max: 0
- };
- break;
- case QUESTIONMARK:
- tokenizer.pos++;
- range = {
- min: 0,
- max: 1
- };
- break;
- case NUMBERSIGN:
- tokenizer.pos++;
- comma = true;
- if (tokenizer.charCode() === LEFTCURLYBRACKET) {
- range = readMultiplierRange(tokenizer);
- } else {
- range = {
- min: 1,
- max: 0
- };
- }
- break;
- case LEFTCURLYBRACKET:
- range = readMultiplierRange(tokenizer);
- break;
- default:
- return null;
- }
- return {
- type: 'Multiplier',
- comma: comma,
- min: range.min,
- max: range.max,
- term: null
- };
- }
- function maybeMultiplied(tokenizer, node) {
- var multiplier = readMultiplier(tokenizer);
- if (multiplier !== null) {
- multiplier.term = node;
- return multiplier;
- }
- return node;
- }
- function maybeToken(tokenizer) {
- var ch = tokenizer.peek();
- if (ch === '') {
- return null;
- }
- return {
- type: 'Token',
- value: ch
- };
- }
- function readProperty(tokenizer) {
- var name;
- tokenizer.eat(LESSTHANSIGN);
- tokenizer.eat(APOSTROPHE);
- name = scanWord(tokenizer);
- tokenizer.eat(APOSTROPHE);
- tokenizer.eat(GREATERTHANSIGN);
- return maybeMultiplied(tokenizer, {
- type: 'Property',
- name: name
- });
- }
- function readType(tokenizer) {
- var name;
- tokenizer.eat(LESSTHANSIGN);
- name = scanWord(tokenizer);
- if (tokenizer.charCode() === LEFTPARENTHESIS &&
- tokenizer.nextCharCode() === RIGHTPARENTHESIS) {
- tokenizer.pos += 2;
- name += '()';
- }
- tokenizer.eat(GREATERTHANSIGN);
- return maybeMultiplied(tokenizer, {
- type: 'Type',
- name: name
- });
- }
- function readKeywordOrFunction(tokenizer) {
- var name;
- name = scanWord(tokenizer);
- if (tokenizer.charCode() === LEFTPARENTHESIS) {
- tokenizer.pos++;
- return {
- type: 'Function',
- name: name
- };
- }
- return maybeMultiplied(tokenizer, {
- type: 'Keyword',
- name: name
- });
- }
- function regroupTerms(terms, combinators) {
- function createGroup(terms, combinator) {
- return {
- type: 'Group',
- terms: terms,
- combinator: combinator,
- disallowEmpty: false,
- explicit: false
- };
- }
- combinators = Object.keys(combinators).sort(function(a, b) {
- return COMBINATOR_PRECEDENCE[a] - COMBINATOR_PRECEDENCE[b];
- });
- while (combinators.length > 0) {
- var combinator = combinators.shift();
- for (var i = 0, subgroupStart = 0; i < terms.length; i++) {
- var term = terms[i];
- if (term.type === 'Combinator') {
- if (term.value === combinator) {
- if (subgroupStart === -1) {
- subgroupStart = i - 1;
- }
- terms.splice(i, 1);
- i--;
- } else {
- if (subgroupStart !== -1 && i - subgroupStart > 1) {
- terms.splice(
- subgroupStart,
- i - subgroupStart,
- createGroup(terms.slice(subgroupStart, i), combinator)
- );
- i = subgroupStart + 1;
- }
- subgroupStart = -1;
- }
- }
- }
- if (subgroupStart !== -1 && combinators.length) {
- terms.splice(
- subgroupStart,
- i - subgroupStart,
- createGroup(terms.slice(subgroupStart, i), combinator)
- );
- }
- }
- return combinator;
- }
- function readImplicitGroup(tokenizer) {
- var terms = [];
- var combinators = {};
- var token;
- var prevToken = null;
- var prevTokenPos = tokenizer.pos;
- while (token = peek(tokenizer)) {
- if (token.type !== 'Spaces') {
- if (token.type === 'Combinator') {
-
- if (prevToken === null || prevToken.type === 'Combinator') {
- tokenizer.pos = prevTokenPos;
- tokenizer.error('Unexpected combinator');
- }
- combinators[token.value] = true;
- } else if (prevToken !== null && prevToken.type !== 'Combinator') {
- combinators[' '] = true;
- terms.push({
- type: 'Combinator',
- value: ' '
- });
- }
- terms.push(token);
- prevToken = token;
- prevTokenPos = tokenizer.pos;
- }
- }
-
- if (prevToken !== null && prevToken.type === 'Combinator') {
- tokenizer.pos -= prevTokenPos;
- tokenizer.error('Unexpected combinator');
- }
- return {
- type: 'Group',
- terms: terms,
- combinator: regroupTerms(terms, combinators) || ' ',
- disallowEmpty: false,
- explicit: false
- };
- }
- function readGroup(tokenizer) {
- var result;
- tokenizer.eat(LEFTSQUAREBRACKET);
- result = readImplicitGroup(tokenizer);
- tokenizer.eat(RIGHTSQUAREBRACKET);
- result.explicit = true;
- if (tokenizer.charCode() === EXCLAMATIONMARK) {
- tokenizer.pos++;
- result.disallowEmpty = true;
- }
- return result;
- }
- function peek(tokenizer) {
- var code = tokenizer.charCode();
- if (code < 128 && NAME_CHAR[code] === 1) {
- return readKeywordOrFunction(tokenizer);
- }
- switch (code) {
- case RIGHTSQUAREBRACKET:
-
- break;
- case LEFTSQUAREBRACKET:
- return maybeMultiplied(tokenizer, readGroup(tokenizer));
- case LESSTHANSIGN:
- return tokenizer.nextCharCode() === APOSTROPHE
- ? readProperty(tokenizer)
- : readType(tokenizer);
- case VERTICALLINE:
- return {
- type: 'Combinator',
- value: tokenizer.substringToPos(
- tokenizer.nextCharCode() === VERTICALLINE
- ? tokenizer.pos + 2
- : tokenizer.pos + 1
- )
- };
- case AMPERSAND:
- tokenizer.pos++;
- tokenizer.eat(AMPERSAND);
- return {
- type: 'Combinator',
- value: '&&'
- };
- case COMMA:
- tokenizer.pos++;
- return {
- type: 'Comma'
- };
- case APOSTROPHE:
- return maybeMultiplied(tokenizer, {
- type: 'String',
- value: scanString(tokenizer)
- });
- case SPACE:
- case TAB:
- case N:
- case R:
- case F:
- return {
- type: 'Spaces',
- value: scanSpaces(tokenizer)
- };
- case COMMERCIALAT:
- code = tokenizer.nextCharCode();
- if (code < 128 && NAME_CHAR[code] === 1) {
- tokenizer.pos++;
- return {
- type: 'AtKeyword',
- name: scanWord(tokenizer)
- };
- }
- return maybeToken(tokenizer);
- case ASTERISK:
- case PLUSSIGN:
- case QUESTIONMARK:
- case NUMBERSIGN:
- case EXCLAMATIONMARK:
-
- break;
- case LEFTCURLYBRACKET:
-
-
- code = tokenizer.nextCharCode();
- if (code < 48 || code > 57) {
- return maybeToken(tokenizer);
- }
- break;
- default:
- return maybeToken(tokenizer);
- }
- }
- function parse(str) {
- var tokenizer = new Tokenizer(str);
- var result = readImplicitGroup(tokenizer);
- if (tokenizer.pos !== str.length) {
- tokenizer.error('Unexpected input');
- }
-
- if (result.terms.length === 1 && result.terms[0].type === 'Group') {
- result = result.terms[0];
- }
- return result;
- }
- parse('[a&&<b>#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
- module.exports = parse;
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- AnPlusB: __webpack_require__(127),
- Atrule: __webpack_require__(128),
- AtrulePrelude: __webpack_require__(129),
- AttributeSelector: __webpack_require__(130),
- Block: __webpack_require__(131),
- Brackets: __webpack_require__(132),
- CDC: __webpack_require__(133),
- CDO: __webpack_require__(134),
- ClassSelector: __webpack_require__(135),
- Combinator: __webpack_require__(136),
- Comment: __webpack_require__(137),
- Declaration: __webpack_require__(138),
- DeclarationList: __webpack_require__(139),
- Dimension: __webpack_require__(140),
- Function: __webpack_require__(141),
- HexColor: __webpack_require__(142),
- Identifier: __webpack_require__(143),
- IdSelector: __webpack_require__(144),
- MediaFeature: __webpack_require__(145),
- MediaQuery: __webpack_require__(146),
- MediaQueryList: __webpack_require__(147),
- Nth: __webpack_require__(148),
- Number: __webpack_require__(149),
- Operator: __webpack_require__(150),
- Parentheses: __webpack_require__(151),
- Percentage: __webpack_require__(152),
- PseudoClassSelector: __webpack_require__(153),
- PseudoElementSelector: __webpack_require__(154),
- Ratio: __webpack_require__(155),
- Raw: __webpack_require__(156),
- Rule: __webpack_require__(157),
- Selector: __webpack_require__(158),
- SelectorList: __webpack_require__(159),
- String: __webpack_require__(160),
- StyleSheet: __webpack_require__(161),
- TypeSelector: __webpack_require__(162),
- UnicodeRange: __webpack_require__(163),
- Url: __webpack_require__(164),
- Value: __webpack_require__(165),
- WhiteSpace: __webpack_require__(166)
- };
- }),
- (function(module, exports, __webpack_require__) {
- var lexer = __webpack_require__(1).lexer;
- var packNumber = __webpack_require__(11).pack;
- var NAME_TO_HEX = {
- 'aliceblue': 'f0f8ff',
- 'antiquewhite': 'faebd7',
- 'aqua': '0ff',
- 'aquamarine': '7fffd4',
- 'azure': 'f0ffff',
- 'beige': 'f5f5dc',
- 'bisque': 'ffe4c4',
- 'black': '000',
- 'blanchedalmond': 'ffebcd',
- 'blue': '00f',
- 'blueviolet': '8a2be2',
- 'brown': 'a52a2a',
- 'burlywood': 'deb887',
- 'cadetblue': '5f9ea0',
- 'chartreuse': '7fff00',
- 'chocolate': 'd2691e',
- 'coral': 'ff7f50',
- 'cornflowerblue': '6495ed',
- 'cornsilk': 'fff8dc',
- 'crimson': 'dc143c',
- 'cyan': '0ff',
- 'darkblue': '00008b',
- 'darkcyan': '008b8b',
- 'darkgoldenrod': 'b8860b',
- 'darkgray': 'a9a9a9',
- 'darkgrey': 'a9a9a9',
- 'darkgreen': '006400',
- 'darkkhaki': 'bdb76b',
- 'darkmagenta': '8b008b',
- 'darkolivegreen': '556b2f',
- 'darkorange': 'ff8c00',
- 'darkorchid': '9932cc',
- 'darkred': '8b0000',
- 'darksalmon': 'e9967a',
- 'darkseagreen': '8fbc8f',
- 'darkslateblue': '483d8b',
- 'darkslategray': '2f4f4f',
- 'darkslategrey': '2f4f4f',
- 'darkturquoise': '00ced1',
- 'darkviolet': '9400d3',
- 'deeppink': 'ff1493',
- 'deepskyblue': '00bfff',
- 'dimgray': '696969',
- 'dimgrey': '696969',
- 'dodgerblue': '1e90ff',
- 'firebrick': 'b22222',
- 'floralwhite': 'fffaf0',
- 'forestgreen': '228b22',
- 'fuchsia': 'f0f',
- 'gainsboro': 'dcdcdc',
- 'ghostwhite': 'f8f8ff',
- 'gold': 'ffd700',
- 'goldenrod': 'daa520',
- 'gray': '808080',
- 'grey': '808080',
- 'green': '008000',
- 'greenyellow': 'adff2f',
- 'honeydew': 'f0fff0',
- 'hotpink': 'ff69b4',
- 'indianred': 'cd5c5c',
- 'indigo': '4b0082',
- 'ivory': 'fffff0',
- 'khaki': 'f0e68c',
- 'lavender': 'e6e6fa',
- 'lavenderblush': 'fff0f5',
- 'lawngreen': '7cfc00',
- 'lemonchiffon': 'fffacd',
- 'lightblue': 'add8e6',
- 'lightcoral': 'f08080',
- 'lightcyan': 'e0ffff',
- 'lightgoldenrodyellow': 'fafad2',
- 'lightgray': 'd3d3d3',
- 'lightgrey': 'd3d3d3',
- 'lightgreen': '90ee90',
- 'lightpink': 'ffb6c1',
- 'lightsalmon': 'ffa07a',
- 'lightseagreen': '20b2aa',
- 'lightskyblue': '87cefa',
- 'lightslategray': '789',
- 'lightslategrey': '789',
- 'lightsteelblue': 'b0c4de',
- 'lightyellow': 'ffffe0',
- 'lime': '0f0',
- 'limegreen': '32cd32',
- 'linen': 'faf0e6',
- 'magenta': 'f0f',
- 'maroon': '800000',
- 'mediumaquamarine': '66cdaa',
- 'mediumblue': '0000cd',
- 'mediumorchid': 'ba55d3',
- 'mediumpurple': '9370db',
- 'mediumseagreen': '3cb371',
- 'mediumslateblue': '7b68ee',
- 'mediumspringgreen': '00fa9a',
- 'mediumturquoise': '48d1cc',
- 'mediumvioletred': 'c71585',
- 'midnightblue': '191970',
- 'mintcream': 'f5fffa',
- 'mistyrose': 'ffe4e1',
- 'moccasin': 'ffe4b5',
- 'navajowhite': 'ffdead',
- 'navy': '000080',
- 'oldlace': 'fdf5e6',
- 'olive': '808000',
- 'olivedrab': '6b8e23',
- 'orange': 'ffa500',
- 'orangered': 'ff4500',
- 'orchid': 'da70d6',
- 'palegoldenrod': 'eee8aa',
- 'palegreen': '98fb98',
- 'paleturquoise': 'afeeee',
- 'palevioletred': 'db7093',
- 'papayawhip': 'ffefd5',
- 'peachpuff': 'ffdab9',
- 'peru': 'cd853f',
- 'pink': 'ffc0cb',
- 'plum': 'dda0dd',
- 'powderblue': 'b0e0e6',
- 'purple': '800080',
- 'rebeccapurple': '639',
- 'red': 'f00',
- 'rosybrown': 'bc8f8f',
- 'royalblue': '4169e1',
- 'saddlebrown': '8b4513',
- 'salmon': 'fa8072',
- 'sandybrown': 'f4a460',
- 'seagreen': '2e8b57',
- 'seashell': 'fff5ee',
- 'sienna': 'a0522d',
- 'silver': 'c0c0c0',
- 'skyblue': '87ceeb',
- 'slateblue': '6a5acd',
- 'slategray': '708090',
- 'slategrey': '708090',
- 'snow': 'fffafa',
- 'springgreen': '00ff7f',
- 'steelblue': '4682b4',
- 'tan': 'd2b48c',
- 'teal': '008080',
- 'thistle': 'd8bfd8',
- 'tomato': 'ff6347',
- 'turquoise': '40e0d0',
- 'violet': 'ee82ee',
- 'wheat': 'f5deb3',
- 'white': 'fff',
- 'whitesmoke': 'f5f5f5',
- 'yellow': 'ff0',
- 'yellowgreen': '9acd32'
- };
- var HEX_TO_NAME = {
- '800000': 'maroon',
- '800080': 'purple',
- '808000': 'olive',
- '808080': 'gray',
- '00ffff': 'cyan',
- 'f0ffff': 'azure',
- 'f5f5dc': 'beige',
- 'ffe4c4': 'bisque',
- '000000': 'black',
- '0000ff': 'blue',
- 'a52a2a': 'brown',
- 'ff7f50': 'coral',
- 'ffd700': 'gold',
- '008000': 'green',
- '4b0082': 'indigo',
- 'fffff0': 'ivory',
- 'f0e68c': 'khaki',
- '00ff00': 'lime',
- 'faf0e6': 'linen',
- '000080': 'navy',
- 'ffa500': 'orange',
- 'da70d6': 'orchid',
- 'cd853f': 'peru',
- 'ffc0cb': 'pink',
- 'dda0dd': 'plum',
- 'f00': 'red',
- 'ff0000': 'red',
- 'fa8072': 'salmon',
- 'a0522d': 'sienna',
- 'c0c0c0': 'silver',
- 'fffafa': 'snow',
- 'd2b48c': 'tan',
- '008080': 'teal',
- 'ff6347': 'tomato',
- 'ee82ee': 'violet',
- 'f5deb3': 'wheat',
- 'ffffff': 'white',
- 'ffff00': 'yellow'
- };
- function hueToRgb(p, q, t) {
- if (t < 0) {
- t += 1;
- }
- if (t > 1) {
- t -= 1;
- }
- if (t < 1 / 6) {
- return p + (q - p) * 6 * t;
- }
- if (t < 1 / 2) {
- return q;
- }
- if (t < 2 / 3) {
- return p + (q - p) * (2 / 3 - t) * 6;
- }
- return p;
- }
- function hslToRgb(h, s, l, a) {
- var r;
- var g;
- var b;
- if (s === 0) {
- r = g = b = l;
- } else {
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
- var p = 2 * l - q;
- r = hueToRgb(p, q, h + 1 / 3);
- g = hueToRgb(p, q, h);
- b = hueToRgb(p, q, h - 1 / 3);
- }
- return [
- Math.round(r * 255),
- Math.round(g * 255),
- Math.round(b * 255),
- a
- ];
- }
- function toHex(value) {
- value = value.toString(16);
- return value.length === 1 ? '0' + value : value;
- }
- function parseFunctionArgs(functionArgs, count, rgb) {
- var cursor = functionArgs.head;
- var args = [];
- var wasValue = false;
- while (cursor !== null) {
- var node = cursor.data;
- var type = node.type;
- switch (type) {
- case 'Number':
- case 'Percentage':
- if (wasValue) {
- return;
- }
- wasValue = true;
- args.push({
- type: type,
- value: Number(node.value)
- });
- break;
- case 'Operator':
- if (node.value === ',') {
- if (!wasValue) {
- return;
- }
- wasValue = false;
- } else if (wasValue || node.value !== '+') {
- return;
- }
- break;
- default:
-
- return;
- }
- cursor = cursor.next;
- }
- if (args.length !== count) {
-
-
- return;
- }
- if (args.length === 4) {
- if (args[3].type !== 'Number') {
-
-
- return;
- }
- args[3].type = 'Alpha';
- }
- if (rgb) {
- if (args[0].type !== args[1].type || args[0].type !== args[2].type) {
-
-
- return;
- }
- } else {
- if (args[0].type !== 'Number' ||
- args[1].type !== 'Percentage' ||
- args[2].type !== 'Percentage') {
-
-
- return;
- }
- args[0].type = 'Angle';
- }
- return args.map(function(arg) {
- var value = Math.max(0, arg.value);
- switch (arg.type) {
- case 'Number':
-
- value = Math.min(value, 255);
- break;
- case 'Percentage':
-
- value = Math.min(value, 100) / 100;
- if (!rgb) {
- return value;
- }
- value = 255 * value;
- break;
- case 'Angle':
-
- return (((value % 360) + 360) % 360) / 360;
- case 'Alpha':
-
- return Math.min(value, 1);
- }
- return Math.round(value);
- });
- }
- function compressFunction(node, item, list) {
- var functionName = node.name;
- var args;
- if (functionName === 'rgba' || functionName === 'hsla') {
- args = parseFunctionArgs(node.children, 4, functionName === 'rgba');
- if (!args) {
-
- return;
- }
- if (functionName === 'hsla') {
- args = hslToRgb.apply(null, args);
- node.name = 'rgba';
- }
- if (args[3] === 0) {
-
-
-
-
- var scopeFunctionName = this['function'] && this['function'].name;
- if ((args[0] === 0 && args[1] === 0 && args[2] === 0) ||
- !/^(?:to|from|color-stop)$|gradient$/i.test(scopeFunctionName)) {
- item.data = {
- type: 'Identifier',
- loc: node.loc,
- name: 'transparent'
- };
- return;
- }
- }
- if (args[3] !== 1) {
-
- node.children.each(function(node, item, list) {
- if (node.type === 'Operator') {
- if (node.value !== ',') {
- list.remove(item);
- }
- return;
- }
- item.data = {
- type: 'Number',
- loc: node.loc,
- value: packNumber(args.shift(), null)
- };
- });
- return;
- }
-
- functionName = 'rgb';
- }
- if (functionName === 'hsl') {
- args = args || parseFunctionArgs(node.children, 3, false);
- if (!args) {
-
- return;
- }
-
- args = hslToRgb.apply(null, args);
- functionName = 'rgb';
- }
- if (functionName === 'rgb') {
- args = args || parseFunctionArgs(node.children, 3, true);
- if (!args) {
-
- return;
- }
-
- var next = item.next;
- if (next && next.data.type !== 'WhiteSpace') {
- list.insert(list.createItem({
- type: 'WhiteSpace',
- value: ' '
- }), next);
- }
- item.data = {
- type: 'HexColor',
- loc: node.loc,
- value: toHex(args[0]) + toHex(args[1]) + toHex(args[2])
- };
- compressHex(item.data, item);
- }
- }
- function compressIdent(node, item) {
- if (this.declaration === null) {
- return;
- }
- var color = node.name.toLowerCase();
- if (NAME_TO_HEX.hasOwnProperty(color) &&
- lexer.matchDeclaration(this.declaration).isType(node, 'color')) {
- var hex = NAME_TO_HEX[color];
- if (hex.length + 1 <= color.length) {
-
- item.data = {
- type: 'HexColor',
- loc: node.loc,
- value: hex
- };
- } else {
-
- if (color === 'grey') {
- color = 'gray';
- }
-
- node.name = color;
- }
- }
- }
- function compressHex(node, item) {
- var color = node.value.toLowerCase();
-
- if (color.length === 6 &&
- color[0] === color[1] &&
- color[2] === color[3] &&
- color[4] === color[5]) {
- color = color[0] + color[2] + color[4];
- }
- if (HEX_TO_NAME[color]) {
- item.data = {
- type: 'Identifier',
- loc: node.loc,
- name: HEX_TO_NAME[color]
- };
- } else {
- node.value = color;
- }
- }
- module.exports = {
- compressFunction: compressFunction,
- compressIdent: compressIdent,
- compressHex: compressHex
- };
- }),
- (function(module, exports) {
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function isEqualSelectors(a, b) {
- var cursor1 = a.head;
- var cursor2 = b.head;
- while (cursor1 !== null && cursor2 !== null && cursor1.data.id === cursor2.data.id) {
- cursor1 = cursor1.next;
- cursor2 = cursor2.next;
- }
- return cursor1 === null && cursor2 === null;
- }
- function isEqualDeclarations(a, b) {
- var cursor1 = a.head;
- var cursor2 = b.head;
- while (cursor1 !== null && cursor2 !== null && cursor1.data.id === cursor2.data.id) {
- cursor1 = cursor1.next;
- cursor2 = cursor2.next;
- }
- return cursor1 === null && cursor2 === null;
- }
- function compareDeclarations(declarations1, declarations2) {
- var result = {
- eq: [],
- ne1: [],
- ne2: [],
- ne2overrided: []
- };
- var fingerprints = Object.create(null);
- var declarations2hash = Object.create(null);
- for (var cursor = declarations2.head; cursor; cursor = cursor.next) {
- declarations2hash[cursor.data.id] = true;
- }
- for (var cursor = declarations1.head; cursor; cursor = cursor.next) {
- var data = cursor.data;
- if (data.fingerprint) {
- fingerprints[data.fingerprint] = data.important;
- }
- if (declarations2hash[data.id]) {
- declarations2hash[data.id] = false;
- result.eq.push(data);
- } else {
- result.ne1.push(data);
- }
- }
- for (var cursor = declarations2.head; cursor; cursor = cursor.next) {
- var data = cursor.data;
- if (declarations2hash[data.id]) {
-
-
- if (hasOwnProperty.call(fingerprints, data.fingerprint) &&
- Number(fingerprints[data.fingerprint]) >= Number(data.important)) {
- result.ne2overrided.push(data);
- } else {
- result.ne2.push(data);
- }
- }
- }
- return result;
- }
- function addSelectors(dest, source) {
- source.each(function(sourceData) {
- var newStr = sourceData.id;
- var cursor = dest.head;
- while (cursor) {
- var nextStr = cursor.data.id;
- if (nextStr === newStr) {
- return;
- }
- if (nextStr > newStr) {
- break;
- }
- cursor = cursor.next;
- }
- dest.insert(dest.createItem(sourceData), cursor);
- });
- return dest;
- }
- function hasSimilarSelectors(selectors1, selectors2) {
- var cursor1 = selectors1.head;
- while (cursor1 !== null) {
- var cursor2 = selectors2.head;
- while (cursor2 !== null) {
- if (cursor1.data.compareMarker === cursor2.data.compareMarker) {
- return true;
- }
- cursor2 = cursor2.next;
- }
- cursor1 = cursor1.next;
- }
- return false;
- }
- function unsafeToSkipNode(node) {
- switch (node.type) {
- case 'Rule':
-
- return hasSimilarSelectors(node.prelude.children, this);
- case 'Atrule':
-
- if (node.block) {
-
- return node.block.children.some(unsafeToSkipNode, this);
- }
- break;
- case 'Declaration':
- return false;
- }
-
- return true;
- }
- module.exports = {
- isEqualSelectors: isEqualSelectors,
- isEqualDeclarations: isEqualDeclarations,
- compareDeclarations: compareDeclarations,
- addSelectors: addSelectors,
- hasSimilarSelectors: hasSimilarSelectors,
- unsafeToSkipNode: unsafeToSkipNode
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(61);
- }),
- (function(module, exports, __webpack_require__) {
- const Expression = __webpack_require__(66)
- module.exports = {
-
- getExpression(content) {
- let end = 0
- let start = content.indexOf('{{', end)
- const res = []
- while (start >= 0) {
- let expression
- res.push(content.substring(end, start))
- start += 2
- end = content.indexOf('}}', start)
- if (end >= 0) {
- expression = new Expression(content.substring(start, end))
- end += 2
- } else {
-
- res.push(content.substring(start - 2))
- end = content.length
- }
- if (expression) res.push(expression.parse())
- start = content.indexOf('{{', end)
- }
- res.push(content.substring(end))
- return res.filter(item => !!item)
- },
-
- calcExpression(arr, data = {}) {
- if (!arr || typeof arr === 'string' || typeof arr === 'number' || typeof arr === 'boolean') {
- return arr
- } if (arr.length === 1 && typeof arr[0] === 'function') {
- return arr[0](data)
- }
- return arr.map(item => {
- if (typeof item === 'string') return item
- if (typeof item === 'function') return item(data)
- return ''
- }).join('')
- },
- }
- }),
- (function(module, exports, __webpack_require__) {
- const exparser = __webpack_require__(4)
- const _ = __webpack_require__(5)
- function measureIntersect(baseRect, newRect) {
- const rect = {
- left: baseRect.left < newRect.left ? newRect.left : baseRect.left,
- top: baseRect.top < newRect.top ? newRect.top : baseRect.top,
- right: baseRect.right > newRect.right ? newRect.right : baseRect.right,
- bottom: baseRect.bottom > newRect.bottom ? newRect.bottom : baseRect.bottom,
- width: 0,
- height: 0,
- }
- if (rect.right > rect.left) rect.width = rect.right - rect.left
- else rect.right = rect.left = rect.bottom = rect.top = 0
- if (rect.bottom > rect.top) rect.height = rect.bottom - rect.top
- else rect.right = rect.left = rect.bottom = rect.top = 0
- return rect
- }
- function measureRelativeRect(relatives) {
- const clientWidth = document.documentElement.clientWidth
- const clientHeight = document.documentElement.clientHeight
- let retRect = null
- for (let i = 0; i < relatives.length; i++) {
- const {node, margins} = relatives[i]
- const boundingRect = node ? node.$$.getBoundingClientRect() : {
- left: 0,
- top: 0,
- right: clientWidth,
- bottom: clientHeight,
- width: clientWidth,
- height: clientHeight
- }
- const rect = {
- left: boundingRect.left - margins.left,
- top: boundingRect.top - margins.top,
- right: boundingRect.right + margins.right,
- bottom: boundingRect.bottom + margins.bottom,
- }
- if (retRect) retRect = measureIntersect(retRect, rect)
- else retRect = rect
- }
- return retRect
- }
- class IntersectionObserver {
- constructor(compInst, options = {}) {
- this._exparserNode = compInst._exparserNode
- this._relativeInfo = []
- this._options = options
- this._disconnected = false
- this._observers = []
- this._exparserNode._listenInfoMap = this._exparserNode._listenInfoMap || {}
- }
-
- static updateTargetIntersection(listenerInfo) {
- const {
- targetNode, relatives, thresholds, minWidthOrHeight, currentRatio, callback
- } = listenerInfo
- const targetRect = targetNode.$$.getBoundingClientRect()
- if (targetRect.right - targetRect.left < minWidthOrHeight) {
- targetRect.right = targetRect.left + minWidthOrHeight
- targetRect.width = minWidthOrHeight
- }
- if (targetRect.bottom - targetRect.top < minWidthOrHeight) {
- targetRect.bottom = targetRect.top + minWidthOrHeight
- targetRect.height = minWidthOrHeight
- }
- const relativeRect = measureRelativeRect(relatives)
- const intersectRect = measureIntersect(relativeRect, targetRect)
- const targetArea = targetRect.width * targetRect.height
- const intersectRatio = targetArea ? intersectRect.width * intersectRect.height / targetArea : 0
- listenerInfo.currentRatio = intersectRatio
- let isUpdate = currentRatio === undefined
- if (intersectRatio !== currentRatio) {
- thresholds.forEach(threshold => {
- if (isUpdate) return
- if (intersectRatio <= threshold && currentRatio >= threshold) isUpdate = true
- else if (intersectRatio >= threshold && currentRatio <= threshold) isUpdate = true
- })
- }
- if (isUpdate) {
- callback.call(targetNode, {
- id: targetNode.id,
- dataset: targetNode.dataset,
- time: Date.now(),
- boundingClientRect: targetRect,
- intersectionRatio: intersectRatio,
- intersectionRect: intersectRect,
- relativeRect,
- })
- }
- }
- disconnect() {
- this._disconnected = true
- this._observers.forEach(observer => observer.disconnect())
- this._observers = []
- }
- observe(selector, callback) {
-
- const shadowRoot = this._exparserNode.shadowRoot
- let targetNodes = this._options.observeAll ? shadowRoot.querySelectorAll(selector) : shadowRoot.querySelector(selector)
- if (!Array.isArray(targetNodes)) targetNodes = targetNodes ? [targetNodes] : []
-
- const relatives = []
- this._relativeInfo.forEach(item => {
- const {selector, margins} = item
- const node = selector === null ? null : shadowRoot.querySelector(selector)
- if (selector === null || node) {
- relatives.push({
- node,
- margins: {
- left: margins.left || 0,
- top: margins.top || 0,
- right: margins.right || 0,
- bottom: margins.bottom || 0,
- },
- })
- }
- })
- targetNodes.forEach(targetNode => {
- const id = _.getId()
- const listenerInfo = {
- targetNode,
- relatives,
- thresholds: this._options.thresholds || [0],
- currentRatio: this._options.initialRatio || 0,
- minWidthOrHeight: 0,
- callback,
- }
- const observer = exparser.Observer.create(evt => {
- if (evt.status === 'attached') {
- this._exparserNode._listenInfoMap[id] = listenerInfo
- window.requestAnimationFrame(() => {
- if (!this._disconnected) IntersectionObserver.updateTargetIntersection(listenerInfo)
- })
- } else if (evt.status === 'detached') {
- delete this._exparserNode._listenInfoMap[id]
- observer.disconnect()
- }
- })
- observer.observe(targetNode, {attachStatus: true})
- if (exparser.Element.isAttached(targetNode)) {
- this._exparserNode._listenInfoMap[id] = listenerInfo
- window.requestAnimationFrame(() => {
- if (!this._disconnected) IntersectionObserver.updateTargetIntersection(listenerInfo)
- })
- }
- this._observers.push(observer)
- })
- }
- relativeTo(selector, margins = {}) {
- this._relativeInfo.push({
- selector,
- margins,
- })
- return this
- }
- relativeToViewport(margins = {}) {
- this._relativeInfo.push({
- selector: null,
- margins,
- })
- return this
- }
- }
- module.exports = IntersectionObserver
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _picocolors = _interopRequireDefault(__webpack_require__(74));
- var _terminalHighlight = _interopRequireDefault(__webpack_require__(75));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
- function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var CssSyntaxError = function (_Error) {
- _inheritsLoose(CssSyntaxError, _Error);
-
- function CssSyntaxError(message, line, column, source, file, plugin) {
- var _this;
- _this = _Error.call(this, message) || this;
-
- _this.name = 'CssSyntaxError';
-
- _this.reason = message;
- if (file) {
-
- _this.file = file;
- }
- if (source) {
-
- _this.source = source;
- }
- if (plugin) {
-
- _this.plugin = plugin;
- }
- if (typeof line !== 'undefined' && typeof column !== 'undefined') {
-
- _this.line = line;
-
- _this.column = column;
- }
- _this.setMessage();
- if (Error.captureStackTrace) {
- Error.captureStackTrace(_assertThisInitialized(_this), CssSyntaxError);
- }
- return _this;
- }
- var _proto = CssSyntaxError.prototype;
- _proto.setMessage = function setMessage() {
-
- this.message = this.plugin ? this.plugin + ': ' : '';
- this.message += this.file ? this.file : '<css input>';
- if (typeof this.line !== 'undefined') {
- this.message += ':' + this.line + ':' + this.column;
- }
- this.message += ': ' + this.reason;
- }
-
- ;
- _proto.showSourceCode = function showSourceCode(color) {
- var _this2 = this;
- if (!this.source) return '';
- var css = this.source;
- if (_terminalHighlight.default) {
- if (typeof color === 'undefined') color = _picocolors.default.isColorSupported;
- if (color) css = (0, _terminalHighlight.default)(css);
- }
- var lines = css.split(/\r?\n/);
- var start = Math.max(this.line - 3, 0);
- var end = Math.min(this.line + 2, lines.length);
- var maxWidth = String(end).length;
- function mark(text) {
- if (color && _picocolors.default.red) {
- return _picocolors.default.red(_picocolors.default.bold(text));
- }
- return text;
- }
- function aside(text) {
- if (color && _picocolors.default.gray) {
- return _picocolors.default.gray(text);
- }
- return text;
- }
- return lines.slice(start, end).map(function (line, index) {
- var number = start + 1 + index;
- var gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ';
- if (number === _this2.line) {
- var spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, _this2.column - 1).replace(/[^\t]/g, ' ');
- return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^');
- }
- return ' ' + aside(gutter) + line;
- }).join('\n');
- }
-
- ;
- _proto.toString = function toString() {
- var code = this.showSourceCode();
- if (code) {
- code = '\n\n' + code + '\n';
- }
- return this.name + ': ' + this.message + code;
- }
-
- ;
- return CssSyntaxError;
- }( _wrapNativeSuper(Error));
- var _default = CssSyntaxError;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var DEFAULT_RAW = {
- colon: ': ',
- indent: ' ',
- beforeDecl: '\n',
- beforeRule: '\n',
- beforeOpen: ' ',
- beforeClose: '\n',
- beforeComment: '\n',
- after: '\n',
- emptyBody: '',
- commentLeft: ' ',
- commentRight: ' ',
- semicolon: false
- };
- function capitalize(str) {
- return str[0].toUpperCase() + str.slice(1);
- }
- var Stringifier = function () {
- function Stringifier(builder) {
- this.builder = builder;
- }
- var _proto = Stringifier.prototype;
- _proto.stringify = function stringify(node, semicolon) {
- this[node.type](node, semicolon);
- };
- _proto.root = function root(node) {
- this.body(node);
- if (node.raws.after) this.builder(node.raws.after);
- };
- _proto.comment = function comment(node) {
- var left = this.raw(node, 'left', 'commentLeft');
- var right = this.raw(node, 'right', 'commentRight');
- this.builder('/*' + left + node.text + right + '*/', node);
- };
- _proto.decl = function decl(node, semicolon) {
- var between = this.raw(node, 'between', 'colon');
- var string = node.prop + between + this.rawValue(node, 'value');
- if (node.important) {
- string += node.raws.important || ' !important';
- }
- if (semicolon) string += ';';
- this.builder(string, node);
- };
- _proto.rule = function rule(node) {
- this.block(node, this.rawValue(node, 'selector'));
- if (node.raws.ownSemicolon) {
- this.builder(node.raws.ownSemicolon, node, 'end');
- }
- };
- _proto.atrule = function atrule(node, semicolon) {
- var name = '@' + node.name;
- var params = node.params ? this.rawValue(node, 'params') : '';
- if (typeof node.raws.afterName !== 'undefined') {
- name += node.raws.afterName;
- } else if (params) {
- name += ' ';
- }
- if (node.nodes) {
- this.block(node, name + params);
- } else {
- var end = (node.raws.between || '') + (semicolon ? ';' : '');
- this.builder(name + params + end, node);
- }
- };
- _proto.body = function body(node) {
- var last = node.nodes.length - 1;
- while (last > 0) {
- if (node.nodes[last].type !== 'comment') break;
- last -= 1;
- }
- var semicolon = this.raw(node, 'semicolon');
- for (var i = 0; i < node.nodes.length; i++) {
- var child = node.nodes[i];
- var before = this.raw(child, 'before');
- if (before) this.builder(before);
- this.stringify(child, last !== i || semicolon);
- }
- };
- _proto.block = function block(node, start) {
- var between = this.raw(node, 'between', 'beforeOpen');
- this.builder(start + between + '{', node, 'start');
- var after;
- if (node.nodes && node.nodes.length) {
- this.body(node);
- after = this.raw(node, 'after');
- } else {
- after = this.raw(node, 'after', 'emptyBody');
- }
- if (after) this.builder(after);
- this.builder('}', node, 'end');
- };
- _proto.raw = function raw(node, own, detect) {
- var value;
- if (!detect) detect = own;
- if (own) {
- value = node.raws[own];
- if (typeof value !== 'undefined') return value;
- }
- var parent = node.parent;
- if (detect === 'before') {
- if (!parent || parent.type === 'root' && parent.first === node) {
- return '';
- }
- }
- if (!parent) return DEFAULT_RAW[detect];
- var root = node.root();
- if (!root.rawCache) root.rawCache = {};
- if (typeof root.rawCache[detect] !== 'undefined') {
- return root.rawCache[detect];
- }
- if (detect === 'before' || detect === 'after') {
- return this.beforeAfter(node, detect);
- } else {
- var method = 'raw' + capitalize(detect);
- if (this[method]) {
- value = this[method](root, node);
- } else {
- root.walk(function (i) {
- value = i.raws[own];
- if (typeof value !== 'undefined') return false;
- });
- }
- }
- if (typeof value === 'undefined') value = DEFAULT_RAW[detect];
- root.rawCache[detect] = value;
- return value;
- };
- _proto.rawSemicolon = function rawSemicolon(root) {
- var value;
- root.walk(function (i) {
- if (i.nodes && i.nodes.length && i.last.type === 'decl') {
- value = i.raws.semicolon;
- if (typeof value !== 'undefined') return false;
- }
- });
- return value;
- };
- _proto.rawEmptyBody = function rawEmptyBody(root) {
- var value;
- root.walk(function (i) {
- if (i.nodes && i.nodes.length === 0) {
- value = i.raws.after;
- if (typeof value !== 'undefined') return false;
- }
- });
- return value;
- };
- _proto.rawIndent = function rawIndent(root) {
- if (root.raws.indent) return root.raws.indent;
- var value;
- root.walk(function (i) {
- var p = i.parent;
- if (p && p !== root && p.parent && p.parent === root) {
- if (typeof i.raws.before !== 'undefined') {
- var parts = i.raws.before.split('\n');
- value = parts[parts.length - 1];
- value = value.replace(/[^\s]/g, '');
- return false;
- }
- }
- });
- return value;
- };
- _proto.rawBeforeComment = function rawBeforeComment(root, node) {
- var value;
- root.walkComments(function (i) {
- if (typeof i.raws.before !== 'undefined') {
- value = i.raws.before;
- if (value.indexOf('\n') !== -1) {
- value = value.replace(/[^\n]+$/, '');
- }
- return false;
- }
- });
- if (typeof value === 'undefined') {
- value = this.raw(node, null, 'beforeDecl');
- } else if (value) {
- value = value.replace(/[^\s]/g, '');
- }
- return value;
- };
- _proto.rawBeforeDecl = function rawBeforeDecl(root, node) {
- var value;
- root.walkDecls(function (i) {
- if (typeof i.raws.before !== 'undefined') {
- value = i.raws.before;
- if (value.indexOf('\n') !== -1) {
- value = value.replace(/[^\n]+$/, '');
- }
- return false;
- }
- });
- if (typeof value === 'undefined') {
- value = this.raw(node, null, 'beforeRule');
- } else if (value) {
- value = value.replace(/[^\s]/g, '');
- }
- return value;
- };
- _proto.rawBeforeRule = function rawBeforeRule(root) {
- var value;
- root.walk(function (i) {
- if (i.nodes && (i.parent !== root || root.first !== i)) {
- if (typeof i.raws.before !== 'undefined') {
- value = i.raws.before;
- if (value.indexOf('\n') !== -1) {
- value = value.replace(/[^\n]+$/, '');
- }
- return false;
- }
- }
- });
- if (value) value = value.replace(/[^\s]/g, '');
- return value;
- };
- _proto.rawBeforeClose = function rawBeforeClose(root) {
- var value;
- root.walk(function (i) {
- if (i.nodes && i.nodes.length > 0) {
- if (typeof i.raws.after !== 'undefined') {
- value = i.raws.after;
- if (value.indexOf('\n') !== -1) {
- value = value.replace(/[^\n]+$/, '');
- }
- return false;
- }
- }
- });
- if (value) value = value.replace(/[^\s]/g, '');
- return value;
- };
- _proto.rawBeforeOpen = function rawBeforeOpen(root) {
- var value;
- root.walk(function (i) {
- if (i.type !== 'decl') {
- value = i.raws.between;
- if (typeof value !== 'undefined') return false;
- }
- });
- return value;
- };
- _proto.rawColon = function rawColon(root) {
- var value;
- root.walkDecls(function (i) {
- if (typeof i.raws.between !== 'undefined') {
- value = i.raws.between.replace(/[^\s:]/g, '');
- return false;
- }
- });
- return value;
- };
- _proto.beforeAfter = function beforeAfter(node, detect) {
- var value;
- if (node.type === 'decl') {
- value = this.raw(node, null, 'beforeDecl');
- } else if (node.type === 'comment') {
- value = this.raw(node, null, 'beforeComment');
- } else if (detect === 'before') {
- value = this.raw(node, null, 'beforeRule');
- } else {
- value = this.raw(node, null, 'beforeClose');
- }
- var buf = node.parent;
- var depth = 0;
- while (buf && buf.type !== 'root') {
- depth += 1;
- buf = buf.parent;
- }
- if (value.indexOf('\n') !== -1) {
- var indent = this.raw(node, null, 'indent');
- if (indent.length) {
- for (var step = 0; step < depth; step++) {
- value += indent;
- }
- }
- }
- return value;
- };
- _proto.rawValue = function rawValue(node, prop) {
- var value = node[prop];
- var raw = node.raws[prop];
- if (raw && raw.value === value) {
- return raw.raw;
- }
- return value;
- };
- return Stringifier;
- }();
- var _default = Stringifier;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _lazyResult = _interopRequireDefault(__webpack_require__(37));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- var Processor = function () {
-
- function Processor(plugins) {
- if (plugins === void 0) {
- plugins = [];
- }
-
- this.version = '7.0.39';
-
- this.plugins = this.normalize(plugins);
- }
-
- var _proto = Processor.prototype;
- _proto.use = function use(plugin) {
- this.plugins = this.plugins.concat(this.normalize([plugin]));
- return this;
- }
-
- ;
- _proto.process = function (_process) {
- function process(_x) {
- return _process.apply(this, arguments);
- }
- process.toString = function () {
- return _process.toString();
- };
- return process;
- }(function (css, opts) {
- if (opts === void 0) {
- opts = {};
- }
- if (this.plugins.length === 0 && opts.parser === opts.stringifier) {
- if (false) {}
- }
- return new _lazyResult.default(this, css, opts);
- });
- _proto.normalize = function normalize(plugins) {
- var normalized = [];
- for (var _iterator = _createForOfIteratorHelperLoose(plugins), _step; !(_step = _iterator()).done;) {
- var i = _step.value;
- if (i.postcss === true) {
- var plugin = i();
- throw new Error('PostCSS plugin ' + plugin.postcssPlugin + ' requires PostCSS 8.\n' + 'Migration guide for end-users:\n' + 'https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users');
- }
- if (i.postcss) i = i.postcss;
- if (typeof i === 'object' && Array.isArray(i.plugins)) {
- normalized = normalized.concat(i.plugins);
- } else if (typeof i === 'function') {
- normalized.push(i);
- } else if (typeof i === 'object' && (i.parse || i.stringify)) {
- if (false) {}
- } else if (typeof i === 'object' && i.postcssPlugin) {
- throw new Error('PostCSS plugin ' + i.postcssPlugin + ' requires PostCSS 8.\n' + 'Migration guide for end-users:\n' + 'https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users');
- } else {
- throw new Error(i + ' is not a PostCSS plugin');
- }
- }
- return normalized;
- };
- return Processor;
- }();
- var _default = Processor;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _mapGenerator = _interopRequireDefault(__webpack_require__(76));
- var _stringify2 = _interopRequireDefault(__webpack_require__(17));
- var _warnOnce = _interopRequireDefault(__webpack_require__(86));
- var _result = _interopRequireDefault(__webpack_require__(87));
- var _parse = _interopRequireDefault(__webpack_require__(18));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- function _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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- function isPromise(obj) {
- return typeof obj === 'object' && typeof obj.then === 'function';
- }
- var LazyResult = function () {
- function LazyResult(processor, css, opts) {
- this.stringified = false;
- this.processed = false;
- var root;
- if (typeof css === 'object' && css !== null && css.type === 'root') {
- root = css;
- } else if (css instanceof LazyResult || css instanceof _result.default) {
- root = css.root;
- if (css.map) {
- if (typeof opts.map === 'undefined') opts.map = {};
- if (!opts.map.inline) opts.map.inline = false;
- opts.map.prev = css.map;
- }
- } else {
- var parser = _parse.default;
- if (opts.syntax) parser = opts.syntax.parse;
- if (opts.parser) parser = opts.parser;
- if (parser.parse) parser = parser.parse;
- try {
- root = parser(css, opts);
- } catch (error) {
- this.error = error;
- }
- }
- this.result = new _result.default(processor, root, opts);
- }
-
- var _proto = LazyResult.prototype;
-
- _proto.warnings = function warnings() {
- return this.sync().warnings();
- }
-
- ;
- _proto.toString = function toString() {
- return this.css;
- }
-
- ;
- _proto.then = function then(onFulfilled, onRejected) {
- if (false) {}
- return this.async().then(onFulfilled, onRejected);
- }
-
- ;
- _proto.catch = function _catch(onRejected) {
- return this.async().catch(onRejected);
- }
-
- ;
- _proto.finally = function _finally(onFinally) {
- return this.async().then(onFinally, onFinally);
- };
- _proto.handleError = function handleError(error, plugin) {
- try {
- this.error = error;
- if (error.name === 'CssSyntaxError' && !error.plugin) {
- error.plugin = plugin.postcssPlugin;
- error.setMessage();
- } else if (plugin.postcssVersion) {
- if (false) { var b, a, runtimeVer, pluginVer, pluginName; }
- }
- } catch (err) {
- if (console && console.error) console.error(err);
- }
- };
- _proto.asyncTick = function asyncTick(resolve, reject) {
- var _this = this;
- if (this.plugin >= this.processor.plugins.length) {
- this.processed = true;
- return resolve();
- }
- try {
- var plugin = this.processor.plugins[this.plugin];
- var promise = this.run(plugin);
- this.plugin += 1;
- if (isPromise(promise)) {
- promise.then(function () {
- _this.asyncTick(resolve, reject);
- }).catch(function (error) {
- _this.handleError(error, plugin);
- _this.processed = true;
- reject(error);
- });
- } else {
- this.asyncTick(resolve, reject);
- }
- } catch (error) {
- this.processed = true;
- reject(error);
- }
- };
- _proto.async = function async() {
- var _this2 = this;
- if (this.processed) {
- return new Promise(function (resolve, reject) {
- if (_this2.error) {
- reject(_this2.error);
- } else {
- resolve(_this2.stringify());
- }
- });
- }
- if (this.processing) {
- return this.processing;
- }
- this.processing = new Promise(function (resolve, reject) {
- if (_this2.error) return reject(_this2.error);
- _this2.plugin = 0;
- _this2.asyncTick(resolve, reject);
- }).then(function () {
- _this2.processed = true;
- return _this2.stringify();
- });
- return this.processing;
- };
- _proto.sync = function sync() {
- if (this.processed) return this.result;
- this.processed = true;
- if (this.processing) {
- throw new Error('Use process(css).then(cb) to work with async plugins');
- }
- if (this.error) throw this.error;
- for (var _iterator = _createForOfIteratorHelperLoose(this.result.processor.plugins), _step; !(_step = _iterator()).done;) {
- var plugin = _step.value;
- var promise = this.run(plugin);
- if (isPromise(promise)) {
- throw new Error('Use process(css).then(cb) to work with async plugins');
- }
- }
- return this.result;
- };
- _proto.run = function run(plugin) {
- this.result.lastPlugin = plugin;
- try {
- return plugin(this.result.root, this.result);
- } catch (error) {
- this.handleError(error, plugin);
- throw error;
- }
- };
- _proto.stringify = function stringify() {
- if (this.stringified) return this.result;
- this.stringified = true;
- this.sync();
- var opts = this.result.opts;
- var str = _stringify2.default;
- if (opts.syntax) str = opts.syntax.stringify;
- if (opts.stringifier) str = opts.stringifier;
- if (str.stringify) str = str.stringify;
- var map = new _mapGenerator.default(str, this.result.root, this.result.opts);
- var data = map.generate();
- this.result.css = data[0];
- this.result.map = data[1];
- return this.result;
- };
- _createClass(LazyResult, [{
- key: "processor",
- get: function get() {
- return this.result.processor;
- }
-
- }, {
- key: "opts",
- get: function get() {
- return this.result.opts;
- }
-
- }, {
- key: "css",
- get: function get() {
- return this.stringify().css;
- }
-
- }, {
- key: "content",
- get: function get() {
- return this.stringify().content;
- }
-
- }, {
- key: "map",
- get: function get() {
- return this.stringify().map;
- }
-
- }, {
- key: "root",
- get: function get() {
- return this.sync().root;
- }
-
- }, {
- key: "messages",
- get: function get() {
- return this.sync().messages;
- }
- }]);
- return LazyResult;
- }();
- var _default = LazyResult;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- (function(global) {
- var base64 = __webpack_require__(77)
- var ieee754 = __webpack_require__(78)
- var isArray = __webpack_require__(79)
- exports.Buffer = Buffer
- exports.SlowBuffer = SlowBuffer
- exports.INSPECT_MAX_BYTES = 50
- Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
- ? global.TYPED_ARRAY_SUPPORT
- : typedArraySupport()
- exports.kMaxLength = kMaxLength()
- function typedArraySupport () {
- try {
- var arr = new Uint8Array(1)
- arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
- return arr.foo() === 42 &&
- typeof arr.subarray === 'function' &&
- arr.subarray(1, 1).byteLength === 0
- } catch (e) {
- return false
- }
- }
- function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
- ? 0x7fffffff
- : 0x3fffffff
- }
- function createBuffer (that, length) {
- if (kMaxLength() < length) {
- throw new RangeError('Invalid typed array length')
- }
- if (Buffer.TYPED_ARRAY_SUPPORT) {
-
- that = new Uint8Array(length)
- that.__proto__ = Buffer.prototype
- } else {
-
- if (that === null) {
- that = new Buffer(length)
- }
- that.length = length
- }
- return that
- }
- function Buffer (arg, encodingOrOffset, length) {
- if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
- return new Buffer(arg, encodingOrOffset, length)
- }
-
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new Error(
- 'If encoding is specified then the first argument must be a string'
- )
- }
- return allocUnsafe(this, arg)
- }
- return from(this, arg, encodingOrOffset, length)
- }
- Buffer.poolSize = 8192
- Buffer._augment = function (arr) {
- arr.__proto__ = Buffer.prototype
- return arr
- }
- function from (that, value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('"value" argument must not be a number')
- }
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
- return fromArrayBuffer(that, value, encodingOrOffset, length)
- }
- if (typeof value === 'string') {
- return fromString(that, value, encodingOrOffset)
- }
- return fromObject(that, value)
- }
- Buffer.from = function (value, encodingOrOffset, length) {
- return from(null, value, encodingOrOffset, length)
- }
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
- if (typeof Symbol !== 'undefined' && Symbol.species &&
- Buffer[Symbol.species] === Buffer) {
-
- Object.defineProperty(Buffer, Symbol.species, {
- value: null,
- configurable: true
- })
- }
- }
- function assertSize (size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be a number')
- } else if (size < 0) {
- throw new RangeError('"size" argument must not be negative')
- }
- }
- function alloc (that, size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(that, size)
- }
- if (fill !== undefined) {
-
-
-
- return typeof encoding === 'string'
- ? createBuffer(that, size).fill(fill, encoding)
- : createBuffer(that, size).fill(fill)
- }
- return createBuffer(that, size)
- }
- Buffer.alloc = function (size, fill, encoding) {
- return alloc(null, size, fill, encoding)
- }
- function allocUnsafe (that, size) {
- assertSize(size)
- that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < size; ++i) {
- that[i] = 0
- }
- }
- return that
- }
- Buffer.allocUnsafe = function (size) {
- return allocUnsafe(null, size)
- }
- Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(null, size)
- }
- function fromString (that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('"encoding" must be a valid string encoding')
- }
- var length = byteLength(string, encoding) | 0
- that = createBuffer(that, length)
- var actual = that.write(string, encoding)
- if (actual !== length) {
-
-
-
- that = that.slice(0, actual)
- }
- return that
- }
- function fromArrayLike (that, array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- that = createBuffer(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
- }
- function fromArrayBuffer (that, array, byteOffset, length) {
- array.byteLength
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('\'offset\' is out of bounds')
- }
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('\'length\' is out of bounds')
- }
- if (byteOffset === undefined && length === undefined) {
- array = new Uint8Array(array)
- } else if (length === undefined) {
- array = new Uint8Array(array, byteOffset)
- } else {
- array = new Uint8Array(array, byteOffset, length)
- }
- if (Buffer.TYPED_ARRAY_SUPPORT) {
-
- that = array
- that.__proto__ = Buffer.prototype
- } else {
-
- that = fromArrayLike(that, array)
- }
- return that
- }
- function fromObject (that, obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- that = createBuffer(that, len)
- if (that.length === 0) {
- return that
- }
- obj.copy(that, 0, 0, len)
- return that
- }
- if (obj) {
- if ((typeof ArrayBuffer !== 'undefined' &&
- obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
- if (typeof obj.length !== 'number' || isnan(obj.length)) {
- return createBuffer(that, 0)
- }
- return fromArrayLike(that, obj)
- }
- if (obj.type === 'Buffer' && isArray(obj.data)) {
- return fromArrayLike(that, obj.data)
- }
- }
- throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
- }
- function checked (length) {
-
-
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
- }
- return length | 0
- }
- function SlowBuffer (length) {
- if (+length != length) {
- length = 0
- }
- return Buffer.alloc(+length)
- }
- Buffer.isBuffer = function isBuffer (b) {
- return !!(b != null && b._isBuffer)
- }
- Buffer.compare = function compare (a, b) {
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError('Arguments must be Buffers')
- }
- if (a === b) return 0
- var x = a.length
- var y = b.length
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
- Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
- }
- Buffer.concat = function concat (list, length) {
- if (!isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- buf.copy(buffer, pos)
- pos += buf.length
- }
- return buffer
- }
- function byteLength (string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
- (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- string = '' + string
- }
- var len = string.length
- if (len === 0) return 0
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- case undefined:
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) return utf8ToBytes(string).length
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.byteLength = byteLength
- function slowToString (encoding, start, end) {
- var loweredCase = false
-
-
-
-
-
-
- if (start === undefined || start < 0) {
- start = 0
- }
-
-
- if (start > this.length) {
- return ''
- }
- if (end === undefined || end > this.length) {
- end = this.length
- }
- if (end <= 0) {
- return ''
- }
-
- end >>>= 0
- start >>>= 0
- if (end <= start) {
- return ''
- }
- if (!encoding) encoding = 'utf8'
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
- case 'ascii':
- return asciiSlice(this, start, end)
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
- case 'base64':
- return base64Slice(this, start, end)
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.prototype._isBuffer = true
- function swap (b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
- }
- Buffer.prototype.swap16 = function swap16 () {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
- }
- Buffer.prototype.swap32 = function swap32 () {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
- }
- Buffer.prototype.swap64 = function swap64 () {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
- }
- Buffer.prototype.toString = function toString () {
- var length = this.length | 0
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
- }
- Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
- }
- Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- if (this.length > 0) {
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
- if (this.length > max) str += ' ... '
- }
- return '<Buffer ' + str + '>'
- }
- Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
- if (!Buffer.isBuffer(target)) {
- throw new TypeError('Argument must be a Buffer')
- }
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
- if (this === target) return 0
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
- function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
-
- if (buffer.length === 0) return -1
-
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset
- if (isNaN(byteOffset)) {
-
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- if (Buffer.isBuffer(val)) {
-
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF
- if (Buffer.TYPED_ARRAY_SUPPORT &&
- typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
- }
- throw new TypeError('val must be string, number or Buffer')
- }
- function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
- function read (buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
- return -1
- }
- Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
- }
- Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
- }
- Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
- }
- function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- var strLen = string.length
- if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (isNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
- }
- function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
- }
- function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
- }
- function latin1Write (buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
- }
- function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
- }
- function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
- }
- Buffer.prototype.write = function write (string, offset, length, encoding) {
-
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
-
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
-
- } else if (isFinite(offset)) {
- offset = offset | 0
- if (isFinite(length)) {
- length = length | 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
-
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
- if (!encoding) encoding = 'utf8'
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
- case 'ascii':
- return asciiWrite(this, string, offset, length)
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length)
- case 'base64':
-
- return base64Write(this, string, offset, length)
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- }
- function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
- }
- function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
- if (codePoint === null) {
-
-
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
-
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
- res.push(codePoint)
- i += bytesPerSequence
- }
- return decodeCodePointsArray(res)
- }
- var MAX_ARGUMENTS_LENGTH = 0x1000
- function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints)
- }
-
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
- }
- function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
- }
- function latin1Slice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
- }
- function hexSlice (buf, start, end) {
- var len = buf.length
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
- var out = ''
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i])
- }
- return out
- }
- function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
- }
- return res
- }
- Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
- if (end < start) end = start
- var newBuf
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- newBuf = this.subarray(start, end)
- newBuf.__proto__ = Buffer.prototype
- } else {
- var sliceLen = end - start
- newBuf = new Buffer(sliceLen, undefined)
- for (var i = 0; i < sliceLen; ++i) {
- newBuf[i] = this[i + start]
- }
- }
- return newBuf
- }
- function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
- }
- Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- return val
- }
- Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
- return val
- }
- Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
- }
- Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
- }
- Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
- }
- Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
- }
- Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
- }
- Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
- return val
- }
- Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
- return val
- }
- Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
- }
- Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
- Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
- Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
- }
- Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
- }
- Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
- }
- Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
- }
- Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
- }
- Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
- }
- function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- }
- Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- this[offset] = (value & 0xff)
- return offset + 1
- }
- function objectWriteUInt16 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
- buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
- (littleEndian ? i : 1 - i) * 8
- }
- }
- Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
- }
- Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
- }
- function objectWriteUInt32 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffffffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
- buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
- }
- }
- Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
- }
- Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
- }
- Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
- }
- Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
- }
- Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
- }
- Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
- }
- Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
- }
- function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
- }
- function writeFloat (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
- }
- Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
- }
- Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
- }
- function writeDouble (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
- }
- Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
- }
- Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
- }
- Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
- var len = end - start
- var i
- if (this === target && start < targetStart && targetStart < end) {
-
- for (i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start]
- }
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
-
- for (i = 0; i < len; ++i) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, start + len),
- targetStart
- )
- }
- return len
- }
- Buffer.prototype.fill = function fill (val, start, end, encoding) {
-
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if (code < 256) {
- val = code
- }
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- } else if (typeof val === 'number') {
- val = val & 255
- }
-
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
- if (end <= start) {
- return this
- }
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
- if (!val) val = 0
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : utf8ToBytes(new Buffer(val, encoding).toString())
- var len = bytes.length
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
- return this
- }
- var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
- function base64clean (str) {
-
- str = stringtrim(str).replace(INVALID_BASE64_RE, '')
-
- if (str.length < 2) return ''
-
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
- }
- function stringtrim (str) {
- if (str.trim) return str.trim()
- return str.replace(/^\s+|\s+$/g, '')
- }
- function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
- }
- function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
-
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
-
- if (!leadSurrogate) {
-
- if (codePoint > 0xDBFF) {
-
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
-
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- leadSurrogate = codePoint
- continue
- }
-
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
-
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
- leadSurrogate = null
-
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
- return bytes
- }
- function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
-
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
- }
- function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
- return byteArray
- }
- function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
- }
- function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
- }
- function isnan (val) {
- return val !== val
- }
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports, __webpack_require__) {
- exports.SourceMapGenerator = __webpack_require__(40).SourceMapGenerator;
- exports.SourceMapConsumer = __webpack_require__(82).SourceMapConsumer;
- exports.SourceNode = __webpack_require__(85).SourceNode;
- }),
- (function(module, exports, __webpack_require__) {
- var base64VLQ = __webpack_require__(41);
- var util = __webpack_require__(8);
- var ArraySet = __webpack_require__(42).ArraySet;
- var MappingList = __webpack_require__(81).MappingList;
- function SourceMapGenerator(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util.getArg(aArgs, 'file', null);
- this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
- this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet();
- this._names = new ArraySet();
- this._mappings = new MappingList();
- this._sourcesContents = null;
- }
- SourceMapGenerator.prototype._version = 3;
- SourceMapGenerator.fromSourceMap =
- function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
- file: aSourceMapConsumer.file,
- sourceRoot: sourceRoot
- });
- aSourceMapConsumer.eachMapping(function (mapping) {
- var newMapping = {
- generated: {
- line: mapping.generatedLine,
- column: mapping.generatedColumn
- }
- };
- if (mapping.source != null) {
- newMapping.source = mapping.source;
- if (sourceRoot != null) {
- newMapping.source = util.relative(sourceRoot, newMapping.source);
- }
- newMapping.original = {
- line: mapping.originalLine,
- column: mapping.originalColumn
- };
- if (mapping.name != null) {
- newMapping.name = mapping.name;
- }
- }
- generator.addMapping(newMapping);
- });
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var sourceRelative = sourceFile;
- if (sourceRoot !== null) {
- sourceRelative = util.relative(sourceRoot, sourceFile);
- }
- if (!generator._sources.has(sourceRelative)) {
- generator._sources.add(sourceRelative);
- }
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- generator.setSourceContent(sourceFile, content);
- }
- });
- return generator;
- };
- SourceMapGenerator.prototype.addMapping =
- function SourceMapGenerator_addMapping(aArgs) {
- var generated = util.getArg(aArgs, 'generated');
- var original = util.getArg(aArgs, 'original', null);
- var source = util.getArg(aArgs, 'source', null);
- var name = util.getArg(aArgs, 'name', null);
- if (!this._skipValidation) {
- this._validateMapping(generated, original, source, name);
- }
- if (source != null) {
- source = String(source);
- if (!this._sources.has(source)) {
- this._sources.add(source);
- }
- }
- if (name != null) {
- name = String(name);
- if (!this._names.has(name)) {
- this._names.add(name);
- }
- }
- this._mappings.add({
- generatedLine: generated.line,
- generatedColumn: generated.column,
- originalLine: original != null && original.line,
- originalColumn: original != null && original.column,
- source: source,
- name: name
- });
- };
- SourceMapGenerator.prototype.setSourceContent =
- function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot != null) {
- source = util.relative(this._sourceRoot, source);
- }
- if (aSourceContent != null) {
-
-
- if (!this._sourcesContents) {
- this._sourcesContents = Object.create(null);
- }
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
- } else if (this._sourcesContents) {
-
-
- delete this._sourcesContents[util.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
- SourceMapGenerator.prototype.applySourceMap =
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- var sourceFile = aSourceFile;
-
- if (aSourceFile == null) {
- if (aSourceMapConsumer.file == null) {
- throw new Error(
- 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
- 'or the source map\'s "file" property. Both were omitted.'
- );
- }
- sourceFile = aSourceMapConsumer.file;
- }
- var sourceRoot = this._sourceRoot;
-
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
-
-
- var newSources = new ArraySet();
- var newNames = new ArraySet();
-
- this._mappings.unsortedForEach(function (mapping) {
- if (mapping.source === sourceFile && mapping.originalLine != null) {
-
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source != null) {
-
- mapping.source = original.source;
- if (aSourceMapPath != null) {
- mapping.source = util.join(aSourceMapPath, mapping.source)
- }
- if (sourceRoot != null) {
- mapping.source = util.relative(sourceRoot, mapping.source);
- }
- mapping.originalLine = original.line;
- mapping.originalColumn = original.column;
- if (original.name != null) {
- mapping.name = original.name;
- }
- }
- }
- var source = mapping.source;
- if (source != null && !newSources.has(source)) {
- newSources.add(source);
- }
- var name = mapping.name;
- if (name != null && !newNames.has(name)) {
- newNames.add(name);
- }
- }, this);
- this._sources = newSources;
- this._names = newNames;
-
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aSourceMapPath != null) {
- sourceFile = util.join(aSourceMapPath, sourceFile);
- }
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
- SourceMapGenerator.prototype._validateMapping =
- function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
- aName) {
-
-
-
-
- if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
- throw new Error(
- 'original.line and original.column are not numbers -- you probably meant to omit ' +
- 'the original mapping entirely and only map the generated position. If so, pass ' +
- 'null for the original mapping instead of an object with empty or null values.'
- );
- }
- if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aGenerated.line > 0 && aGenerated.column >= 0
- && !aOriginal && !aSource && !aName) {
-
- return;
- }
- else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aOriginal && 'line' in aOriginal && 'column' in aOriginal
- && aGenerated.line > 0 && aGenerated.column >= 0
- && aOriginal.line > 0 && aOriginal.column >= 0
- && aSource) {
-
- return;
- }
- else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
- SourceMapGenerator.prototype._serializeMappings =
- function SourceMapGenerator_serializeMappings() {
- var previousGeneratedColumn = 0;
- var previousGeneratedLine = 1;
- var previousOriginalColumn = 0;
- var previousOriginalLine = 0;
- var previousName = 0;
- var previousSource = 0;
- var result = '';
- var next;
- var mapping;
- var nameIdx;
- var sourceIdx;
- var mappings = this._mappings.toArray();
- for (var i = 0, len = mappings.length; i < len; i++) {
- mapping = mappings[i];
- next = ''
- if (mapping.generatedLine !== previousGeneratedLine) {
- previousGeneratedColumn = 0;
- while (mapping.generatedLine !== previousGeneratedLine) {
- next += ';';
- previousGeneratedLine++;
- }
- }
- else {
- if (i > 0) {
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
- continue;
- }
- next += ',';
- }
- }
- next += base64VLQ.encode(mapping.generatedColumn
- - previousGeneratedColumn);
- previousGeneratedColumn = mapping.generatedColumn;
- if (mapping.source != null) {
- sourceIdx = this._sources.indexOf(mapping.source);
- next += base64VLQ.encode(sourceIdx - previousSource);
- previousSource = sourceIdx;
-
- next += base64VLQ.encode(mapping.originalLine - 1
- - previousOriginalLine);
- previousOriginalLine = mapping.originalLine - 1;
- next += base64VLQ.encode(mapping.originalColumn
- - previousOriginalColumn);
- previousOriginalColumn = mapping.originalColumn;
- if (mapping.name != null) {
- nameIdx = this._names.indexOf(mapping.name);
- next += base64VLQ.encode(nameIdx - previousName);
- previousName = nameIdx;
- }
- }
- result += next;
- }
- return result;
- };
- SourceMapGenerator.prototype._generateSourcesContent =
- function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot != null) {
- source = util.relative(aSourceRoot, source);
- }
- var key = util.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
- ? this._sourcesContents[key]
- : null;
- }, this);
- };
- SourceMapGenerator.prototype.toJSON =
- function SourceMapGenerator_toJSON() {
- var map = {
- version: this._version,
- sources: this._sources.toArray(),
- names: this._names.toArray(),
- mappings: this._serializeMappings()
- };
- if (this._file != null) {
- map.file = this._file;
- }
- if (this._sourceRoot != null) {
- map.sourceRoot = this._sourceRoot;
- }
- if (this._sourcesContents) {
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
- }
- return map;
- };
- SourceMapGenerator.prototype.toString =
- function SourceMapGenerator_toString() {
- return JSON.stringify(this.toJSON());
- };
- exports.SourceMapGenerator = SourceMapGenerator;
- }),
- (function(module, exports, __webpack_require__) {
- var base64 = __webpack_require__(80);
- var VLQ_BASE_SHIFT = 5;
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
- var VLQ_BASE_MASK = VLQ_BASE - 1;
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
- function toVLQSigned(aValue) {
- return aValue < 0
- ? ((-aValue) << 1) + 1
- : (aValue << 1) + 0;
- }
- function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative
- ? -shifted
- : shifted;
- }
- exports.encode = function base64VLQ_encode(aValue) {
- var encoded = "";
- var digit;
- var vlq = toVLQSigned(aValue);
- do {
- digit = vlq & VLQ_BASE_MASK;
- vlq >>>= VLQ_BASE_SHIFT;
- if (vlq > 0) {
-
-
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
- return encoded;
- };
- exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
- var strLen = aStr.length;
- var result = 0;
- var shift = 0;
- var continuation, digit;
- do {
- if (aIndex >= strLen) {
- throw new Error("Expected more digits in base 64 VLQ value.");
- }
- digit = base64.decode(aStr.charCodeAt(aIndex++));
- if (digit === -1) {
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
- }
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
- digit &= VLQ_BASE_MASK;
- result = result + (digit << shift);
- shift += VLQ_BASE_SHIFT;
- } while (continuation);
- aOutParam.value = fromVLQSigned(result);
- aOutParam.rest = aIndex;
- };
- }),
- (function(module, exports, __webpack_require__) {
- var util = __webpack_require__(8);
- var has = Object.prototype.hasOwnProperty;
- var hasNativeMap = typeof Map !== "undefined";
- function ArraySet() {
- this._array = [];
- this._set = hasNativeMap ? new Map() : Object.create(null);
- }
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
- };
- /**
- * Return how many unique items are in this ArraySet. If duplicates have been
- * added, than those do not count towards the size.
- *
- * @returns Number
- */
- ArraySet.prototype.size = function ArraySet_size() {
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
- };
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
- var idx = this._array.length;
- if (!isDuplicate || aAllowDuplicates) {
- this._array.push(aStr);
- }
- if (!isDuplicate) {
- if (hasNativeMap) {
- this._set.set(aStr, idx);
- } else {
- this._set[sStr] = idx;
- }
- }
- };
- ArraySet.prototype.has = function ArraySet_has(aStr) {
- if (hasNativeMap) {
- return this._set.has(aStr);
- } else {
- var sStr = util.toSetString(aStr);
- return has.call(this._set, sStr);
- }
- };
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (hasNativeMap) {
- var idx = this._set.get(aStr);
- if (idx >= 0) {
- return idx;
- }
- } else {
- var sStr = util.toSetString(aStr);
- if (has.call(this._set, sStr)) {
- return this._set[sStr];
- }
- }
- throw new Error('"' + aStr + '" is not in the set.');
- };
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
- if (aIdx >= 0 && aIdx < this._array.length) {
- return this._array[aIdx];
- }
- throw new Error('No element indexed by ' + aIdx);
- };
- ArraySet.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
- };
- exports.ArraySet = ArraySet;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var list = {
- split: function split(string, separators, last) {
- var array = [];
- var current = '';
- var split = false;
- var func = 0;
- var quote = false;
- var escape = false;
- for (var i = 0; i < string.length; i++) {
- var letter = string[i];
- if (quote) {
- if (escape) {
- escape = false;
- } else if (letter === '\\') {
- escape = true;
- } else if (letter === quote) {
- quote = false;
- }
- } else if (letter === '"' || letter === '\'') {
- quote = letter;
- } else if (letter === '(') {
- func += 1;
- } else if (letter === ')') {
- if (func > 0) func -= 1;
- } else if (func === 0) {
- if (separators.indexOf(letter) !== -1) split = true;
- }
- if (split) {
- if (current !== '') array.push(current.trim());
- current = '';
- split = false;
- } else {
- current += letter;
- }
- }
- if (last || current !== '') array.push(current.trim());
- return array;
- },
-
- space: function space(string) {
- var spaces = [' ', '\n', '\t'];
- return list.split(string, spaces);
- },
-
- comma: function comma(string) {
- return list.split(string, [','], true);
- }
- };
- var _default = list;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _container = _interopRequireDefault(__webpack_require__(21));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var Root = function (_Container) {
- _inheritsLoose(Root, _Container);
- function Root(defaults) {
- var _this;
- _this = _Container.call(this, defaults) || this;
- _this.type = 'root';
- if (!_this.nodes) _this.nodes = [];
- return _this;
- }
- var _proto = Root.prototype;
- _proto.removeChild = function removeChild(child, ignore) {
- var index = this.index(child);
- if (!ignore && index === 0 && this.nodes.length > 1) {
- this.nodes[1].raws.before = this.nodes[index].raws.before;
- }
- return _Container.prototype.removeChild.call(this, child);
- };
- _proto.normalize = function normalize(child, sample, type) {
- var nodes = _Container.prototype.normalize.call(this, child);
- if (sample) {
- if (type === 'prepend') {
- if (this.nodes.length > 1) {
- sample.raws.before = this.nodes[1].raws.before;
- } else {
- delete sample.raws.before;
- }
- } else if (this.first !== sample) {
- for (var _iterator = _createForOfIteratorHelperLoose(nodes), _step; !(_step = _iterator()).done;) {
- var node = _step.value;
- node.raws.before = sample.raws.before;
- }
- }
- }
- return nodes;
- }
-
- ;
- _proto.toResult = function toResult(opts) {
- if (opts === void 0) {
- opts = {};
- }
- var LazyResult = __webpack_require__(37);
- var Processor = __webpack_require__(36);
- var lazy = new LazyResult(new Processor(), this, opts);
- return lazy.stringify();
- }
-
- ;
- return Root;
- }(_container.default);
- var _default = Root;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var constants = __webpack_require__(24);
- var PUNCTUATION = constants.PUNCTUATION;
- var STOP_URL_RAW = constants.STOP_URL_RAW;
- var TYPE = constants.TYPE;
- var FULLSTOP = TYPE.FullStop;
- var PLUSSIGN = TYPE.PlusSign;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var PUNCTUATOR = TYPE.Punctuator;
- var TAB = 9;
- var N = 10;
- var F = 12;
- var R = 13;
- var SPACE = 32;
- var BACK_SLASH = 92;
- var E = 101;
- function firstCharOffset(source) {
-
- if (source.charCodeAt(0) === 0xFEFF ||
- source.charCodeAt(0) === 0xFFFE) {
- return 1;
- }
- return 0;
- }
- function isHex(code) {
- return (code >= 48 && code <= 57) ||
- (code >= 65 && code <= 70) ||
- (code >= 97 && code <= 102);
- }
- function isNumber(code) {
- return code >= 48 && code <= 57;
- }
- function isWhiteSpace(code) {
- return code === SPACE || code === TAB || isNewline(code);
- }
- function isNewline(code) {
- return code === R || code === N || code === F;
- }
- function getNewlineLength(source, offset, code) {
- if (isNewline(code)) {
- if (code === R && offset + 1 < source.length && source.charCodeAt(offset + 1) === N) {
- return 2;
- }
- return 1;
- }
- return 0;
- }
- function cmpChar(testStr, offset, referenceCode) {
- var code = testStr.charCodeAt(offset);
-
- if (code >= 65 && code <= 90) {
- code = code | 32;
- }
- return code === referenceCode;
- }
- function cmpStr(testStr, start, end, referenceStr) {
- if (end - start !== referenceStr.length) {
- return false;
- }
- if (start < 0 || end > testStr.length) {
- return false;
- }
- for (var i = start; i < end; i++) {
- var testCode = testStr.charCodeAt(i);
- var refCode = referenceStr.charCodeAt(i - start);
-
- if (testCode >= 65 && testCode <= 90) {
- testCode = testCode | 32;
- }
- if (testCode !== refCode) {
- return false;
- }
- }
- return true;
- }
- function findWhiteSpaceStart(source, offset) {
- while (offset >= 0 && isWhiteSpace(source.charCodeAt(offset))) {
- offset--;
- }
- return offset + 1;
- }
- function findWhiteSpaceEnd(source, offset) {
- while (offset < source.length && isWhiteSpace(source.charCodeAt(offset))) {
- offset++;
- }
- return offset;
- }
- function findCommentEnd(source, offset) {
- var commentEnd = source.indexOf('*/', offset);
- if (commentEnd === -1) {
- return source.length;
- }
- return commentEnd + 2;
- }
- function findStringEnd(source, offset, quote) {
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
-
- if (code === BACK_SLASH) {
- offset++;
- } else if (code === quote) {
- offset++;
- break;
- }
- }
- return offset;
- }
- function findDecimalNumberEnd(source, offset) {
- while (offset < source.length && isNumber(source.charCodeAt(offset))) {
- offset++;
- }
- return offset;
- }
- function findNumberEnd(source, offset, allowFraction) {
- var code;
- offset = findDecimalNumberEnd(source, offset);
-
- if (allowFraction && offset + 1 < source.length && source.charCodeAt(offset) === FULLSTOP) {
- code = source.charCodeAt(offset + 1);
- if (isNumber(code)) {
- offset = findDecimalNumberEnd(source, offset + 1);
- }
- }
-
- if (offset + 1 < source.length) {
- if ((source.charCodeAt(offset) | 32) === E) {
- code = source.charCodeAt(offset + 1);
- if (code === PLUSSIGN || code === HYPHENMINUS) {
- if (offset + 2 < source.length) {
- code = source.charCodeAt(offset + 2);
- }
- }
- if (isNumber(code)) {
- offset = findDecimalNumberEnd(source, offset + 2);
- }
- }
- }
- return offset;
- }
- function findEscapeEnd(source, offset) {
- for (var i = 0; i < 7 && offset + i < source.length; i++) {
- var code = source.charCodeAt(offset + i);
- if (i !== 6 && isHex(code)) {
- continue;
- }
- if (i > 0) {
- offset += i - 1 + getNewlineLength(source, offset + i, code);
- if (code === SPACE || code === TAB) {
- offset++;
- }
- }
- break;
- }
- return offset;
- }
- function findIdentifierEnd(source, offset) {
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
- if (code === BACK_SLASH) {
- offset = findEscapeEnd(source, offset + 1);
- } else if (code < 0x80 && PUNCTUATION[code] === PUNCTUATOR) {
- break;
- }
- }
- return offset;
- }
- function findUrlRawEnd(source, offset) {
- for (; offset < source.length; offset++) {
- var code = source.charCodeAt(offset);
- if (code === BACK_SLASH) {
- offset = findEscapeEnd(source, offset + 1);
- } else if (code < 0x80 && STOP_URL_RAW[code] === 1) {
- break;
- }
- }
- return offset;
- }
- module.exports = {
- firstCharOffset: firstCharOffset,
- isHex: isHex,
- isNumber: isNumber,
- isWhiteSpace: isWhiteSpace,
- isNewline: isNewline,
- getNewlineLength: getNewlineLength,
- cmpChar: cmpChar,
- cmpStr: cmpStr,
- findWhiteSpaceStart: findWhiteSpaceStart,
- findWhiteSpaceEnd: findWhiteSpaceEnd,
- findCommentEnd: findCommentEnd,
- findStringEnd: findStringEnd,
- findDecimalNumberEnd: findDecimalNumberEnd,
- findNumberEnd: findNumberEnd,
- findEscapeEnd: findEscapeEnd,
- findIdentifierEnd: findIdentifierEnd,
- findUrlRawEnd: findUrlRawEnd
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var createCustomError = __webpack_require__(23);
- var generateGrammar = __webpack_require__(25);
- function fromMatchResult(matchResult) {
- var tokens = matchResult.tokens;
- var longestMatch = matchResult.longestMatch;
- var node = longestMatch < tokens.length ? tokens[longestMatch].node : null;
- var mismatchOffset = 0;
- var entries = 0;
- var css = '';
- for (var i = 0; i < tokens.length; i++) {
- if (i === longestMatch) {
- mismatchOffset = css.length;
- }
- if (node !== null && tokens[i].node === node) {
- if (i <= longestMatch) {
- entries++;
- } else {
- entries = 0;
- }
- }
- css += tokens[i].value;
- }
- if (node === null) {
- mismatchOffset = css.length;
- }
- return {
- node: node,
- css: css,
- mismatchOffset: mismatchOffset,
- last: node === null || entries > 1
- };
- }
- function getLocation(node, point) {
- var loc = node && node.loc && node.loc[point];
- if (loc) {
- return {
- offset: loc.offset,
- line: loc.line,
- column: loc.column
- };
- }
- return null;
- }
- var SyntaxReferenceError = function(type, referenceName) {
- var error = createCustomError(
- 'SyntaxReferenceError',
- type + (referenceName ? ' `' + referenceName + '`' : '')
- );
- error.reference = referenceName;
- return error;
- };
- var MatchError = function(message, lexer, syntax, node, matchResult) {
- var error = createCustomError('SyntaxMatchError', message);
- var details = fromMatchResult(matchResult);
- var mismatchOffset = details.mismatchOffset || 0;
- var badNode = details.node || node;
- var end = getLocation(badNode, 'end');
- var start = details.last ? end : getLocation(badNode, 'start');
- var css = details.css;
- error.rawMessage = message;
- error.syntax = syntax ? generateGrammar(syntax) : '<generic>';
- error.css = css;
- error.mismatchOffset = mismatchOffset;
- error.loc = {
- source: (badNode && badNode.loc && badNode.loc.source) || '<unknown>',
- start: start,
- end: end
- };
- error.line = start ? start.line : undefined;
- error.column = start ? start.column : undefined;
- error.offset = start ? start.offset : undefined;
- error.message = message + '\n' +
- ' syntax: ' + error.syntax + '\n' +
- ' value: ' + (error.css || '<empty string>') + '\n' +
- ' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';
- return error;
- };
- module.exports = {
- SyntaxReferenceError: SyntaxReferenceError,
- MatchError: MatchError
- };
- }),
- (function(module, exports, __webpack_require__) {
- var createCustomError = __webpack_require__(23);
- var SyntaxParseError = function(message, input, offset) {
- var error = createCustomError('SyntaxParseError', message);
- error.input = input;
- error.offset = offset;
- error.rawMessage = message;
- error.message = error.rawMessage + '\n' +
- ' ' + error.input + '\n' +
- '--' + new Array((error.offset || error.input.length) + 1).join('-') + '^';
- return error;
- };
- module.exports = {
- SyntaxParseError: SyntaxParseError
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var noop = function() {};
- function ensureFunction(value) {
- return typeof value === 'function' ? value : noop;
- }
- module.exports = function(node, options, context) {
- function walk(node) {
- enter.call(context, node);
- switch (node.type) {
- case 'Group':
- node.terms.forEach(walk);
- break;
- case 'Multiplier':
- walk(node.term);
- break;
- case 'Type':
- case 'Property':
- case 'Keyword':
- case 'AtKeyword':
- case 'Function':
- case 'String':
- case 'Token':
- case 'Comma':
- break;
- default:
- throw new Error('Unknown type: ' + node.type);
- }
- leave.call(context, node);
- }
- var enter = noop;
- var leave = noop;
- if (typeof options === 'function') {
- enter = options;
- } else if (options) {
- enter = ensureFunction(options.enter);
- leave = ensureFunction(options.leave);
- }
- if (enter === noop && leave === noop) {
- throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
- }
- walk(node, context);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var parse = __webpack_require__(27);
- var MATCH = { type: 'Match' };
- var MISMATCH = { type: 'Mismatch' };
- var DISALLOW_EMPTY = { type: 'DisallowEmpty' };
- var LEFTPARENTHESIS = 40;
- var RIGHTPARENTHESIS = 41;
- function createCondition(match, thenBranch, elseBranch) {
-
- if (thenBranch === MATCH && elseBranch === MISMATCH) {
- return match;
- }
- if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
- return match;
- }
- if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
- thenBranch = match.then;
- match = match.match;
- }
- return {
- type: 'If',
- match: match,
- then: thenBranch,
- else: elseBranch
- };
- }
- function isFunctionType(name) {
- return (
- name.length > 2 &&
- name.charCodeAt(name.length - 2) === LEFTPARENTHESIS &&
- name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS
- );
- }
- function isEnumCapatible(term) {
- return (
- term.type === 'Keyword' ||
- term.type === 'AtKeyword' ||
- term.type === 'Function' ||
- term.type === 'Type' && isFunctionType(term.name)
- );
- }
- function buildGroupMatchGraph(combinator, terms, atLeastOneTermMatched) {
- switch (combinator) {
- case ' ':
-
-
-
-
-
-
-
-
-
-
-
- var result = MATCH;
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
- result = createCondition(
- term,
- result,
- MISMATCH
- );
- };
- return result;
- case '|':
-
-
-
-
-
-
-
-
-
-
-
- var result = MISMATCH;
- var map = null;
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
-
- if (isEnumCapatible(term)) {
- if (map === null && i > 0 && isEnumCapatible(terms[i - 1])) {
- map = Object.create(null);
- result = createCondition(
- {
- type: 'Enum',
- map: map
- },
- MATCH,
- result
- );
- }
- if (map !== null) {
- var key = (isFunctionType(term.name) ? term.name.slice(0, -1) : term.name).toLowerCase();
- if (key in map === false) {
- map[key] = term;
- continue;
- }
- }
- }
- map = null;
-
- result = createCondition(
- term,
- MATCH,
- result
- );
- };
- return result;
- case '&&':
-
-
-
-
- if (terms.length > 5) {
- return {
- type: 'MatchOnce',
- terms: terms,
- all: true
- };
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var result = MISMATCH;
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
- var thenClause;
- if (terms.length > 1) {
- thenClause = buildGroupMatchGraph(
- combinator,
- terms.filter(function(newGroupTerm) {
- return newGroupTerm !== term;
- }),
- false
- );
- } else {
- thenClause = MATCH;
- }
- result = createCondition(
- term,
- thenClause,
- result
- );
- };
- return result;
- case '||':
-
-
-
-
- if (terms.length > 5) {
- return {
- type: 'MatchOnce',
- terms: terms,
- all: false
- };;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var result = atLeastOneTermMatched ? MATCH : MISMATCH;
- for (var i = terms.length - 1; i >= 0; i--) {
- var term = terms[i];
- var thenClause;
- if (terms.length > 1) {
- thenClause = buildGroupMatchGraph(
- combinator,
- terms.filter(function(newGroupTerm) {
- return newGroupTerm !== term;
- }),
- true
- );
- } else {
- thenClause = MATCH;
- }
- result = createCondition(
- term,
- thenClause,
- result
- );
- };
- return result;
- }
- }
- function buildMultiplierMatchGraph(node) {
- var result = MATCH;
- var matchTerm = buildMatchGraph(node.term);
- if (node.max === 0) {
-
- matchTerm = createCondition(
- matchTerm,
- DISALLOW_EMPTY,
- MISMATCH
- );
-
-
- result = createCondition(
- matchTerm,
- null,
- MISMATCH
- );
- result.then = createCondition(
- MATCH,
- MATCH,
- result
- );
- if (node.comma) {
- result.then.else = createCondition(
- { type: 'Comma', syntax: node },
- result,
- MISMATCH
- );
- }
- } else {
-
- for (var i = node.min || 1; i <= node.max; i++) {
- if (node.comma && result !== MATCH) {
- result = createCondition(
- { type: 'Comma', syntax: node },
- result,
- MISMATCH
- );
- }
- result = createCondition(
- matchTerm,
- createCondition(
- MATCH,
- MATCH,
- result
- ),
- MISMATCH
- );
- }
- }
- if (node.min === 0) {
-
- result = createCondition(
- MATCH,
- MATCH,
- result
- );
- } else {
-
- for (var i = 0; i < node.min - 1; i++) {
- if (node.comma && result !== MATCH) {
- result = createCondition(
- { type: 'Comma', syntax: node },
- result,
- MISMATCH
- );
- }
- result = createCondition(
- matchTerm,
- result,
- MISMATCH
- );
- }
- }
- return result;
- }
- function buildMatchGraph(node) {
- if (typeof node === 'function') {
- return {
- type: 'Generic',
- fn: node
- };
- }
- switch (node.type) {
- case 'Group':
- var result = buildGroupMatchGraph(
- node.combinator,
- node.terms.map(buildMatchGraph),
- false
- );
- if (node.disallowEmpty) {
- result = createCondition(
- result,
- DISALLOW_EMPTY,
- MISMATCH
- );
- }
- return result;
- case 'Multiplier':
- return buildMultiplierMatchGraph(node);
- case 'Type':
- case 'Property':
- return {
- type: node.type,
- name: node.name,
- syntax: node
- };
- case 'Keyword':
- return {
- type: node.type,
- name: node.name.toLowerCase(),
- syntax: node
- };
- case 'AtKeyword':
- return {
- type: node.type,
- name: '@' + node.name.toLowerCase(),
- syntax: node
- };
- case 'Function':
- return {
- type: node.type,
- name: node.name.toLowerCase() + '(',
- syntax: node
- };
- case 'String':
-
- if (node.value.length === 3) {
- return {
- type: 'Token',
- value: node.value.charAt(1),
- syntax: node
- };
- }
-
- return {
- type: node.type,
- value: node.value,
- syntax: node
- };
- case 'Token':
- return {
- type: node.type,
- value: node.value,
- syntax: node
- };
- case 'Comma':
- return {
- type: node.type,
- syntax: node
- };
- default:
- throw new Error('Unknown node type:', node.type);
- }
- }
- module.exports = {
- MATCH: MATCH,
- MISMATCH: MISMATCH,
- DISALLOW_EMPTY: DISALLOW_EMPTY,
- buildMatchGraph: function(syntaxTree, ref) {
- if (typeof syntaxTree === 'string') {
- syntaxTree = parse(syntaxTree);
- }
- return {
- type: 'MatchGraph',
- match: buildMatchGraph(syntaxTree),
- syntax: ref || null,
- source: syntaxTree
- };
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var base64VLQ = __webpack_require__(51);
- var util = __webpack_require__(9);
- var ArraySet = __webpack_require__(52).ArraySet;
- var MappingList = __webpack_require__(116).MappingList;
- function SourceMapGenerator(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util.getArg(aArgs, 'file', null);
- this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
- this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet();
- this._names = new ArraySet();
- this._mappings = new MappingList();
- this._sourcesContents = null;
- }
- SourceMapGenerator.prototype._version = 3;
- SourceMapGenerator.fromSourceMap =
- function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
- file: aSourceMapConsumer.file,
- sourceRoot: sourceRoot
- });
- aSourceMapConsumer.eachMapping(function (mapping) {
- var newMapping = {
- generated: {
- line: mapping.generatedLine,
- column: mapping.generatedColumn
- }
- };
- if (mapping.source != null) {
- newMapping.source = mapping.source;
- if (sourceRoot != null) {
- newMapping.source = util.relative(sourceRoot, newMapping.source);
- }
- newMapping.original = {
- line: mapping.originalLine,
- column: mapping.originalColumn
- };
- if (mapping.name != null) {
- newMapping.name = mapping.name;
- }
- }
- generator.addMapping(newMapping);
- });
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- generator.setSourceContent(sourceFile, content);
- }
- });
- return generator;
- };
- SourceMapGenerator.prototype.addMapping =
- function SourceMapGenerator_addMapping(aArgs) {
- var generated = util.getArg(aArgs, 'generated');
- var original = util.getArg(aArgs, 'original', null);
- var source = util.getArg(aArgs, 'source', null);
- var name = util.getArg(aArgs, 'name', null);
- if (!this._skipValidation) {
- this._validateMapping(generated, original, source, name);
- }
- if (source != null) {
- source = String(source);
- if (!this._sources.has(source)) {
- this._sources.add(source);
- }
- }
- if (name != null) {
- name = String(name);
- if (!this._names.has(name)) {
- this._names.add(name);
- }
- }
- this._mappings.add({
- generatedLine: generated.line,
- generatedColumn: generated.column,
- originalLine: original != null && original.line,
- originalColumn: original != null && original.column,
- source: source,
- name: name
- });
- };
- SourceMapGenerator.prototype.setSourceContent =
- function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot != null) {
- source = util.relative(this._sourceRoot, source);
- }
- if (aSourceContent != null) {
-
-
- if (!this._sourcesContents) {
- this._sourcesContents = Object.create(null);
- }
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
- } else if (this._sourcesContents) {
-
-
- delete this._sourcesContents[util.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
- SourceMapGenerator.prototype.applySourceMap =
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- var sourceFile = aSourceFile;
-
- if (aSourceFile == null) {
- if (aSourceMapConsumer.file == null) {
- throw new Error(
- 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
- 'or the source map\'s "file" property. Both were omitted.'
- );
- }
- sourceFile = aSourceMapConsumer.file;
- }
- var sourceRoot = this._sourceRoot;
-
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
-
-
- var newSources = new ArraySet();
- var newNames = new ArraySet();
-
- this._mappings.unsortedForEach(function (mapping) {
- if (mapping.source === sourceFile && mapping.originalLine != null) {
-
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source != null) {
-
- mapping.source = original.source;
- if (aSourceMapPath != null) {
- mapping.source = util.join(aSourceMapPath, mapping.source)
- }
- if (sourceRoot != null) {
- mapping.source = util.relative(sourceRoot, mapping.source);
- }
- mapping.originalLine = original.line;
- mapping.originalColumn = original.column;
- if (original.name != null) {
- mapping.name = original.name;
- }
- }
- }
- var source = mapping.source;
- if (source != null && !newSources.has(source)) {
- newSources.add(source);
- }
- var name = mapping.name;
- if (name != null && !newNames.has(name)) {
- newNames.add(name);
- }
- }, this);
- this._sources = newSources;
- this._names = newNames;
-
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aSourceMapPath != null) {
- sourceFile = util.join(aSourceMapPath, sourceFile);
- }
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
- SourceMapGenerator.prototype._validateMapping =
- function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
- aName) {
-
-
-
-
- if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
- throw new Error(
- 'original.line and original.column are not numbers -- you probably meant to omit ' +
- 'the original mapping entirely and only map the generated position. If so, pass ' +
- 'null for the original mapping instead of an object with empty or null values.'
- );
- }
- if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aGenerated.line > 0 && aGenerated.column >= 0
- && !aOriginal && !aSource && !aName) {
-
- return;
- }
- else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aOriginal && 'line' in aOriginal && 'column' in aOriginal
- && aGenerated.line > 0 && aGenerated.column >= 0
- && aOriginal.line > 0 && aOriginal.column >= 0
- && aSource) {
-
- return;
- }
- else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
- SourceMapGenerator.prototype._serializeMappings =
- function SourceMapGenerator_serializeMappings() {
- var previousGeneratedColumn = 0;
- var previousGeneratedLine = 1;
- var previousOriginalColumn = 0;
- var previousOriginalLine = 0;
- var previousName = 0;
- var previousSource = 0;
- var result = '';
- var next;
- var mapping;
- var nameIdx;
- var sourceIdx;
- var mappings = this._mappings.toArray();
- for (var i = 0, len = mappings.length; i < len; i++) {
- mapping = mappings[i];
- next = ''
- if (mapping.generatedLine !== previousGeneratedLine) {
- previousGeneratedColumn = 0;
- while (mapping.generatedLine !== previousGeneratedLine) {
- next += ';';
- previousGeneratedLine++;
- }
- }
- else {
- if (i > 0) {
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
- continue;
- }
- next += ',';
- }
- }
- next += base64VLQ.encode(mapping.generatedColumn
- - previousGeneratedColumn);
- previousGeneratedColumn = mapping.generatedColumn;
- if (mapping.source != null) {
- sourceIdx = this._sources.indexOf(mapping.source);
- next += base64VLQ.encode(sourceIdx - previousSource);
- previousSource = sourceIdx;
-
- next += base64VLQ.encode(mapping.originalLine - 1
- - previousOriginalLine);
- previousOriginalLine = mapping.originalLine - 1;
- next += base64VLQ.encode(mapping.originalColumn
- - previousOriginalColumn);
- previousOriginalColumn = mapping.originalColumn;
- if (mapping.name != null) {
- nameIdx = this._names.indexOf(mapping.name);
- next += base64VLQ.encode(nameIdx - previousName);
- previousName = nameIdx;
- }
- }
- result += next;
- }
- return result;
- };
- SourceMapGenerator.prototype._generateSourcesContent =
- function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot != null) {
- source = util.relative(aSourceRoot, source);
- }
- var key = util.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
- ? this._sourcesContents[key]
- : null;
- }, this);
- };
- SourceMapGenerator.prototype.toJSON =
- function SourceMapGenerator_toJSON() {
- var map = {
- version: this._version,
- sources: this._sources.toArray(),
- names: this._names.toArray(),
- mappings: this._serializeMappings()
- };
- if (this._file != null) {
- map.file = this._file;
- }
- if (this._sourceRoot != null) {
- map.sourceRoot = this._sourceRoot;
- }
- if (this._sourcesContents) {
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
- }
- return map;
- };
- SourceMapGenerator.prototype.toString =
- function SourceMapGenerator_toString() {
- return JSON.stringify(this.toJSON());
- };
- exports.SourceMapGenerator = SourceMapGenerator;
- }),
- (function(module, exports, __webpack_require__) {
- var base64 = __webpack_require__(115);
- var VLQ_BASE_SHIFT = 5;
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
- var VLQ_BASE_MASK = VLQ_BASE - 1;
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
- function toVLQSigned(aValue) {
- return aValue < 0
- ? ((-aValue) << 1) + 1
- : (aValue << 1) + 0;
- }
- function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative
- ? -shifted
- : shifted;
- }
- exports.encode = function base64VLQ_encode(aValue) {
- var encoded = "";
- var digit;
- var vlq = toVLQSigned(aValue);
- do {
- digit = vlq & VLQ_BASE_MASK;
- vlq >>>= VLQ_BASE_SHIFT;
- if (vlq > 0) {
-
-
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
- return encoded;
- };
- exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
- var strLen = aStr.length;
- var result = 0;
- var shift = 0;
- var continuation, digit;
- do {
- if (aIndex >= strLen) {
- throw new Error("Expected more digits in base 64 VLQ value.");
- }
- digit = base64.decode(aStr.charCodeAt(aIndex++));
- if (digit === -1) {
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
- }
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
- digit &= VLQ_BASE_MASK;
- result = result + (digit << shift);
- shift += VLQ_BASE_SHIFT;
- } while (continuation);
- aOutParam.value = fromVLQSigned(result);
- aOutParam.rest = aIndex;
- };
- }),
- (function(module, exports, __webpack_require__) {
- var util = __webpack_require__(9);
- var has = Object.prototype.hasOwnProperty;
- var hasNativeMap = typeof Map !== "undefined";
- function ArraySet() {
- this._array = [];
- this._set = hasNativeMap ? new Map() : Object.create(null);
- }
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
- };
- /**
- * Return how many unique items are in this ArraySet. If duplicates have been
- * added, than those do not count towards the size.
- *
- * @returns Number
- */
- ArraySet.prototype.size = function ArraySet_size() {
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
- };
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
- var idx = this._array.length;
- if (!isDuplicate || aAllowDuplicates) {
- this._array.push(aStr);
- }
- if (!isDuplicate) {
- if (hasNativeMap) {
- this._set.set(aStr, idx);
- } else {
- this._set[sStr] = idx;
- }
- }
- };
- ArraySet.prototype.has = function ArraySet_has(aStr) {
- if (hasNativeMap) {
- return this._set.has(aStr);
- } else {
- var sStr = util.toSetString(aStr);
- return has.call(this._set, sStr);
- }
- };
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (hasNativeMap) {
- var idx = this._set.get(aStr);
- if (idx >= 0) {
- return idx;
- }
- } else {
- var sStr = util.toSetString(aStr);
- if (has.call(this._set, sStr)) {
- return this._set[sStr];
- }
- }
- throw new Error('"' + aStr + '" is not in the set.');
- };
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
- if (aIdx >= 0 && aIdx < this._array.length) {
- return this._array[aIdx];
- }
- throw new Error('No element indexed by ' + aIdx);
- };
- ArraySet.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
- };
- exports.ArraySet = ArraySet;
- }),
- (function(module, exports, __webpack_require__) {
- var cmpChar = __webpack_require__(0).cmpChar;
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var STRING = TYPE.String;
- var NUMBER = TYPE.Number;
- var FUNCTION = TYPE.Function;
- var URL = TYPE.Url;
- var NUMBERSIGN = TYPE.NumberSign;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
- var PLUSSIGN = TYPE.PlusSign;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var COMMA = TYPE.Comma;
- var SOLIDUS = TYPE.Solidus;
- var ASTERISK = TYPE.Asterisk;
- var PERCENTSIGN = TYPE.PercentSign;
- var BACKSLASH = TYPE.Backslash;
- var U = 117;
- module.exports = function defaultRecognizer(context) {
- switch (this.scanner.tokenType) {
- case NUMBERSIGN:
- return this.HexColor();
- case COMMA:
- context.space = null;
- context.ignoreWSAfter = true;
- return this.Operator();
- case SOLIDUS:
- case ASTERISK:
- case PLUSSIGN:
- case HYPHENMINUS:
- return this.Operator();
- case LEFTPARENTHESIS:
- return this.Parentheses(this.readSequence, context.recognizer);
- case LEFTSQUAREBRACKET:
- return this.Brackets(this.readSequence, context.recognizer);
- case STRING:
- return this.String();
- case NUMBER:
- switch (this.scanner.lookupType(1)) {
- case PERCENTSIGN:
- return this.Percentage();
- case IDENTIFIER:
-
- if (cmpChar(this.scanner.source, this.scanner.tokenEnd, BACKSLASH)) {
- return this.Number();
- } else {
- return this.Dimension();
- }
- default:
- return this.Number();
- }
- case FUNCTION:
- return this.Function(this.readSequence, context.recognizer);
- case URL:
- return this.Url();
- case IDENTIFIER:
-
- if (cmpChar(this.scanner.source, this.scanner.tokenStart, U) &&
- cmpChar(this.scanner.source, this.scanner.tokenStart + 1, PLUSSIGN)) {
- return this.UnicodeRange();
- } else {
- return this.Identifier();
- }
- }
- };
- }),
- (function(module, exports) {
- module.exports = function() {
- this.scanner.skipSC();
- var children = this.createSingleNodeList(
- this.IdSelector()
- );
- this.scanner.skipSC();
- return children;
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: function selectorList() {
- return this.createSingleNodeList(
- this.SelectorList()
- );
- }
- };
- }),
- (function(module, exports) {
- var ALLOW_OF_CLAUSE = true;
- module.exports = {
- parse: function nthWithOfClause() {
- return this.createSingleNodeList(
- this.Nth(ALLOW_OF_CLAUSE)
- );
- }
- };
- }),
- (function(module, exports) {
- var DISALLOW_OF_CLAUSE = false;
- module.exports = {
- parse: function nth() {
- return this.createSingleNodeList(
- this.Nth(DISALLOW_OF_CLAUSE)
- );
- }
- };
- }),
- (function(module, exports) {
- function removeItemAndRedundantWhiteSpace(list, item) {
- var prev = item.prev;
- var next = item.next;
- if (next !== null) {
- if (next.data.type === 'WhiteSpace' && (prev === null || prev.data.type === 'WhiteSpace')) {
- list.remove(next);
- }
- } else if (prev !== null && prev.data.type === 'WhiteSpace') {
- list.remove(prev);
- }
- list.remove(item);
- }
- module.exports = function compressBorder(node) {
- node.children.each(function(node, item, list) {
- if (node.type === 'Identifier' && node.name.toLowerCase() === 'none') {
- if (list.head === list.tail) {
-
- item.data = {
- type: 'Number',
- loc: node.loc,
- value: '0'
- };
- } else {
- removeItemAndRedundantWhiteSpace(list, item);
- }
- }
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(60)
- }),
- (function(module, exports, __webpack_require__) {
- (function(global) {
- const path = __webpack_require__(3)
- const jComponent = __webpack_require__(31)
- const _ = __webpack_require__(10)
- const wxss = __webpack_require__(72)
- const compile = __webpack_require__(227)
- const injectPolyfill = __webpack_require__(228)
- const injectDefinition = __webpack_require__(229)
- const componentMap = {}
- let nowLoad = null
- global.Component = options => {
- const component = nowLoad
- const pathToIdMap = component.pathToIdMap
- const definition = Object.assign({
- id: component.id,
- path: component.path,
- template: component.wxml,
- usingComponents: component.json.usingComponents,
- tagName: component.tagName,
- }, options)
- definition.options = Object.assign({
- classPrefix: component.tagName,
- }, definition.options || {})
-
- if (definition.relations) {
- Object.keys(definition.relations).forEach(key => {
- const value = definition.relations[key]
- const componentPath = _.isAbsolute(key) ? key : path.join(path.dirname(component.path), key)
- const id = pathToIdMap[componentPath]
- if (id) {
-
- value.target = id
- definition.relations[id] = value
- delete definition.relations[key]
- }
- })
- }
- jComponent.register(definition)
- }
- global.Behavior = definition => jComponent.behavior(definition)
- function behavior(definition) {
- if (typeof definition !== 'object') {
- throw new Error('definition must be a object')
- }
- return jComponent.behavior(definition)
- }
- function register(componentPath, tagName, cache, hasRegisterCache) {
-
- window.__webview_engine_version__ = 0.02
- if (typeof componentPath === 'object') {
-
- const definition = componentPath
- return jComponent.register(definition)
- }
- if (typeof componentPath !== 'string') {
- throw new Error('componentPath must be a string')
- }
- if (!tagName || typeof tagName !== 'string') {
- tagName = 'main'
- }
- const id = _.getId()
- if (hasRegisterCache[componentPath]) return hasRegisterCache[componentPath]
- hasRegisterCache[componentPath] = id
- const component = {
- id,
- path: componentPath,
- tagName,
- json: _.readJson(`${componentPath}.json`),
- }
- if (!component.json) {
- throw new Error(`invalid componentPath: ${componentPath}`)
- }
-
- const rootPath = cache.options.rootPath
- const usingComponents = component.json.usingComponents || {}
- const overrideUsingComponents = cache.options.usingComponents || {}
- Object.assign(usingComponents, overrideUsingComponents)
- const usingComponentKeys = Object.keys(usingComponents)
- for (let i = 0, len = usingComponentKeys.length; i < len; i++) {
- const key = usingComponentKeys[i]
- const value = usingComponents[key]
- const usingPath = _.isAbsolute(value) ? path.join(rootPath, value) : path.join(path.dirname(componentPath), value)
-
- if (_.readFile(`${usingPath}.json`)) {
-
- const id = register(usingPath, key, cache, hasRegisterCache)
- usingComponents[key] = id
- }
- }
-
- component.wxml = compile.getWxml(componentPath, cache.options)
- component.wxss = wxss.getContent(`${componentPath}.wxss`)
-
- cache.needRunJsList.push([componentPath, component])
-
- cache.wxss.push(wxss.compile(component.wxss, {
- prefix: tagName,
- ...cache.options,
- }))
- return component.id
- }
- function load(componentPath, tagName, options = {}) {
- if (typeof tagName === 'object') {
- options = tagName
- tagName = ''
- }
- if (typeof componentPath === 'string') {
- options = Object.assign({
- compiler: 'official',
- rootPath: path.dirname(componentPath),
- }, options)
- } else {
- options = Object.assign({
- compiler: 'simulate',
- rootPath: '',
- }, options)
- }
- const cache = {
- wxss: [],
- options,
- needRunJsList: [],
- }
- const hasRegisterCache = {}
- const id = register(componentPath, tagName, cache, hasRegisterCache)
-
- cache.needRunJsList.forEach(item => {
- const oldLoad = nowLoad
- nowLoad = item[1]
- nowLoad.pathToIdMap = hasRegisterCache
- _.runJs(item[0])
- nowLoad = oldLoad
- })
-
- componentMap[id] = cache
- return id
- }
- function render(id, properties) {
- if (!id) throw new Error('you need to pass the componentId')
- const cache = componentMap[id]
- if (cache) {
-
- wxss.insert(cache.wxss, id)
- }
- return jComponent.create(id, properties)
- }
- function match(dom, html) {
- if (!(dom instanceof window.Element) || !html || typeof html !== 'string') return false
-
- html = html.trim()
- .replace(/(>)[\n\r\s\t]+(<)/g, '$1$2')
- const a = dom.cloneNode()
- const b = dom.cloneNode()
- a.innerHTML = dom.innerHTML
- b.innerHTML = html
- return a.isEqualNode(b)
- }
- function sleep(time = 0) {
- return new Promise(resolve => {
- setTimeout(() => {
- resolve()
- }, time)
- })
- }
- function scroll(comp, destOffset = 0, times = 20, propName = 'scrollTop') {
- if (!comp || !comp.dom) throw new Error('invalid params')
- if (typeof times !== 'number' || times <= 0) times = 1
- destOffset = destOffset < 0 ? 0 : destOffset
- const dom = comp.dom
- const delta = destOffset - dom[propName]
-
- const unit = ~~(delta / times)
- const env = _.getEnv()
- if (env === 'nodejs') {
- for (let i = 0; i < times; i++) {
-
- setTimeout(() => {
- if (i === times - 1) dom[propName] = destOffset
- else dom[propName] += unit
-
- dom.dispatchEvent(new Event('scroll', {bubbles: true, cancelable: false}))
- }, 0)
- }
- } else {
-
- dom[propName] = destOffset
- }
- }
- injectPolyfill()
- injectDefinition()
- module.exports = {
- behavior,
- load,
- render,
- match,
- sleep,
- scroll,
- }
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports, __webpack_require__) {
- (function(global) {const exparser = __webpack_require__(4)
- const ComponentManager = __webpack_require__(62)
- const RootComponent = __webpack_require__(70)
- const _ = __webpack_require__(5)
- module.exports = {
-
- register(definition = {}) {
- const componentManager = new ComponentManager(definition)
- return componentManager.id
- },
-
- behavior(definition) {
- definition.is = _.getId(true)
- definition.options = {
- lazyRegistration: true,
- publicProperties: true,
- }
- _.adjustExparserDefinition(definition)
- definition.definitionFilter = exparser.Behavior.callDefinitionFilter(definition)
- exparser.registerBehavior(definition)
- return definition.is
- },
-
- create(id, properties) {
- const componentManager = _.cache(id)
- if (!componentManager) return
- return new RootComponent(componentManager, properties)
- },
- }
- global.wxFormField = module.exports.behavior({
- id: 'wx://form-field',
- properties: {
- name: {
- type: String
- },
- value: {
- type: null
- }
- }
- })
- global.wxFormFieldGroup = module.exports.behavior({
- is: 'wx://form-field-group',
- })
- global.wxFormFieldButton = module.exports.behavior({
- is: 'wx://form-field-button',
- listeners: {
- formSubmit(data) {
- this.triggerEvent('formSubmit', data, {bubbles: true})
- },
- formReset(data) {
- this.triggerEvent('formReset', data, {bubbles: true})
- },
- }
- })
- global.wxComponentExport = module.exports.behavior({
- is: 'wx://component-export',
- definitionFilter(def) {
- if (typeof def.export === 'function') {
- if (typeof def.methods === 'object') {
- def.methods.__export__ = def.export
- } else {
- def.methods = {
- __export__: def.export,
- }
- }
- }
- }
- })
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports, __webpack_require__) {
- (function(global) {const exparser = __webpack_require__(4)
- const compile = __webpack_require__(63)
- const transform = __webpack_require__(67)
- const diff = __webpack_require__(68)
- const render = __webpack_require__(13)
- const _ = __webpack_require__(5)
- const SelectorQuery = __webpack_require__(69)
- const IntersectionObserver = __webpack_require__(33)
- const PATH_TO_ID_MAP = []
- class ComponentManager {
- constructor(definition) {
- this.id = definition.id || _.getId(true)
- this.path = _.normalizeAbsolute(definition.path)
- this.definition = definition
- if (definition.tagName) _.setTagName(this.id, definition.tagName)
- if (this.path) PATH_TO_ID_MAP[this.path] = this.id
- const template = definition.template
- this.data = {}
- this.generateFunc = typeof template === 'function' ? transform(template, definition.usingComponents || {}) : compile(template, this.data, definition.usingComponents || {})
- this.exparserDef = this.registerToExparser()
- _.cache(this.id, this)
- }
-
- registerToExparser() {
- const definition = this.definition
- const options = definition.options || {}
- const usingComponents = definition.usingComponents || {}
- const using = Object.keys(usingComponents).map(key => usingComponents[key])
- let methods = {}
- definition.behaviors = definition.behaviors || []
- definition.behaviors = definition.behaviors.map((item) => {
-
- if (item === 'wx://component-export') {
- return global.wxComponentExport
- } else if (item === 'wx://form-field') {
- return global.wxFormField
- } else if (item === 'wx://form-field-group') {
- return global.wxFormFieldGroup
- } else if (item === 'wx://form-field-button') {
- return global.wxFormFieldButton
- }
- return item
- })
- _.adjustExparserDefinition(definition)
- const path = this.path
- const definitionFilter = exparser.Behavior.callDefinitionFilter(definition)
- const exparserDef = {
- is: this.id,
- using,
- generics: [],
- template: {
- func: this.generateFunc,
- data: this.data,
- },
- properties: definition.properties,
- data: definition.data,
- methods: definition.methods,
- behaviors: definition.behaviors,
- created: definition.created,
- attached: definition.attached,
- ready: definition.ready,
- moved: definition.moved,
- detached: definition.detached,
- saved: definition.saved,
- restored: definition.restored,
- relations: definition.relations,
- externalClasses: definition.externalClasses,
- options: {
- domain: `${options.writeOnly ? 'wo://' : ''}/`,
- writeOnly: options.writeOnly || false,
- allowInWriteOnly: false,
- lazyRegistration: true,
- classPrefix: options.classPrefix || '',
- addGlobalClass: false,
- templateEngine: TemplateEngine,
- renderingMode: 'full',
- multipleSlots: options.multipleSlots || false,
- publicProperties: true,
- reflectToAttributes: false,
- writeFieldsToNode: false,
- writeIdToDOM: false,
- virtualHost: options.virtualHost || undefined,
- },
- lifetimes: definition.lifetimes,
- pageLifetimes: definition.pageLifetimes,
- observers: definition.observers,
- definitionFilter,
- initiator() {
-
- const caller = Object.create(this, {
- data: {
- get: () => this.data,
- set: newData => this.data = newData,
- configurable: true
- },
- })
- const originalSetData = caller.setData
- const getSelectComponentResult = selected => {
- const selectedFilter = exparser.Component.getMethod(selected, '__export__')
- const defaultResult = exparser.Element.getMethodCaller(selected)
- if (selectedFilter) {
- const res = selectedFilter.call(exparser.Element.getMethodCaller(selected), caller)
- return res === undefined ? defaultResult : res
- }
- return defaultResult
- }
- caller._exparserNode = this
- caller.properties = caller.data
- caller.selectComponent = selector => {
- const exparserNode = this.shadowRoot.querySelector(selector)
- return getSelectComponentResult(exparserNode)
- }
- caller.selectAllComponents = selector => {
- const exparserNodes = this.shadowRoot.querySelectorAll(selector)
- return exparserNodes.map(item => getSelectComponentResult(item))
- }
- caller.createSelectorQuery = () => new SelectorQuery(caller)
- caller.createIntersectionObserver = options => new IntersectionObserver(caller, options)
- caller.setData = (data, callback) => {
- if (!originalSetData || typeof originalSetData !== 'function') return
- originalSetData.call(this, data)
- if (typeof callback === 'function') {
-
- Promise.resolve().then(callback).catch(console.error)
- }
- }
- caller.getRelationNodes = relationKey => {
- if (!path || !relationKey) return null
- const id = PATH_TO_ID_MAP[_.relativeToAbsolute(path, relationKey)]
- if (!id) return null
- const res = this.getRelationNodes(id)
- if (!res) return null
- return res.map(exparserNode => exparser.Element.getMethodCaller(exparserNode))
- }
- Object.keys(methods).forEach(name => caller[name] = methods[name])
- exparser.Element.setMethodCaller(this, caller)
- },
- }
- const exparserReg = exparser.registerElement(exparserDef)
- exparser.Behavior.prepare(exparserReg.behavior)
- methods = exparserReg.behavior.methods
- return exparserReg
- }
- }
- class TemplateEngine {
- static create(behavior, initValues) {
- const templateEngine = new TemplateEngine()
- const data = Object.assign({}, initValues, behavior.template.data)
- templateEngine._data = data
- templateEngine._generateFunc = behavior.template.func
- return templateEngine
- }
- static collectIdMapAndSlots(exparserNode, idMap, slots) {
- const children = exparserNode.childNodes
- for (const child of children) {
- if (child instanceof exparser.TextNode) continue
- if (child.__id) idMap[child.__id] = child
- if (child.__slotName !== undefined) slots[child.__slotName] = child
- TemplateEngine.collectIdMapAndSlots(child, idMap, slots)
- }
- }
- createInstance(exparserNode, properties = {}) {
- this._data = Object.assign(this._data, properties)
- this._vt = this._generateFunc({data: this._data})
- const instance = new TemplateEngineInstance()
- instance._generateFunc = this._generateFunc
- instance._vt = this._vt
- instance.data = _.copy(this._data)
- instance.idMap = {}
- instance.slots = {}
- instance.shadowRoot = render.renderExparserNode(instance._vt, exparserNode, null)
- instance.shadowRoot._vt = instance._vt
- instance.listeners = []
- TemplateEngine.collectIdMapAndSlots(instance.shadowRoot, instance.idMap, instance.slots)
- return instance
- }
- }
- class TemplateEngineInstance {
-
- updateValues(exparserNode, data, changedPaths, changedValues, changes) {
- const newVt = this._generateFunc({data})
-
- const callerData = exparser.Element.getMethodCaller(exparserNode).data
- const hasOwnProperty = Object.prototype.hasOwnProperty
- for (const changeInfo of changes) {
- if (!changeInfo) continue
- const path = changeInfo[0]
- const newData = changeInfo[1]
- let currentData = callerData
- let currentPath = path[0]
-
- for (let i = 1, len = path.length; i < len; i++) {
- const nextPath = path[i]
- const currentValue = currentData[currentPath]
- if (!hasOwnProperty.call(currentData, currentPath)) {
-
- if (typeof nextPath === 'number' && isFinite(nextPath)) {
-
- if (!Array.isArray(currentValue)) currentData[currentPath] = []
- } else if (currentValue === null || typeof currentValue !== 'object' || Array.isArray(currentValue)) {
-
- currentData[currentPath] = {}
- }
- }
- currentData = currentData[currentPath]
- currentPath = nextPath
- }
- const oldData = currentData[currentPath]
- currentData[currentPath] = _.copy(newData)
- changedValues = [currentData[currentPath], oldData]
- }
-
- diff.diffVt(this._vt, newVt)
- this._vt = newVt
- }
- }
- module.exports = ComponentManager
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports, __webpack_require__) {
- const parse = __webpack_require__(64)
- const VirtualNode = __webpack_require__(65)
- const expr = __webpack_require__(32)
- const _ = __webpack_require__(5)
- const CONSTANT = __webpack_require__(6)
- function filterAttrs(attrs) {
- const statement = {}
- const event = {}
- const normalAttrs = []
- for (const attr of attrs) {
- const name = attr.name
- const value = attr.value || ''
- if (name === 'wx:if') {
- statement.if = expr.getExpression(value)
- } else if (name === 'wx:elif') {
- statement.elif = expr.getExpression(value)
- } else if (name === 'wx:else') {
- statement.else = true
- } else if (name === 'wx:for') {
- statement.for = expr.getExpression(value)
- } else if (name === 'wx:for-item') {
- statement.forItem = value
- } else if (name === 'wx:for-index') {
- statement.forIndex = value
- } else if (name === 'wx:key') {
- statement.forKey = value
- } else {
- const eventObj = _.parseEvent(name, value)
- if (eventObj) {
-
- event[eventObj.name] = eventObj
- } else {
-
- normalAttrs.push(attr)
- }
- }
- }
- return {
- statement,
- event,
- normalAttrs,
- }
- }
- module.exports = function (template, data, usingComponents) {
- if (!template || typeof template !== 'string' || !template.trim()) throw new Error('invalid template')
- template = template.trim()
-
- const rootNode = new VirtualNode({
- type: CONSTANT.TYPE_ROOT,
- componentManager: this,
- data,
- })
- const stack = [rootNode]
- stack.last = function () {
- return this[this.length - 1]
- }
- parse(template, {
- start: (tagName, attrs, unary) => {
- let type
- let componentManager
- let id = ''
- if (tagName === 'slot') {
- type = CONSTANT.TYPE_SLOT
- } else if (tagName === 'template') {
- type = CONSTANT.TYPE_TEMPLATE
- tagName = 'virtual'
- } else if (tagName === 'block') {
- type = CONSTANT.TYPE_BLOCK
- } else if (tagName === 'import') {
- type = CONSTANT.TYPE_IMPORT
- } else if (tagName === 'include') {
- type = CONSTANT.TYPE_INCLUDE
- } else if (tagName === 'wxs') {
- type = CONSTANT.TYPE_WXS
- } else if (_.isHtmlTag(tagName)) {
- type = CONSTANT.TYPE_NATIVE
- id = tagName
- } else {
- type = CONSTANT.TYPE_COMPONENT
- id = usingComponents[tagName]
- componentManager = id ? _.cache(id) : _.cache(tagName)
- if (!componentManager) throw new Error(`component ${tagName} not found`)
- else id = componentManager.id
- }
- const {statement, event, normalAttrs} = filterAttrs(attrs)
- const parent = stack.last()
- const node = new VirtualNode({
- type,
- tagName,
- componentId: id,
- attrs: normalAttrs,
- event,
- generics: {},
- componentManager,
- root: rootNode,
- })
- let appendNode = node
-
- if (statement.for) {
- const itemNode = new VirtualNode({
- type: CONSTANT.TYPE_FORITEM,
- tagName: 'virtual',
- statement: {
- forItem: statement.forItem || 'item',
- forIndex: statement.forIndex || 'index',
- forKey: statement.forKey,
- },
- children: [node],
- root: rootNode,
- })
- node.setParent(itemNode, 0)
- const forNode = new VirtualNode({
- type: CONSTANT.TYPE_FOR,
- tagName: 'wx:for',
- statement: {
- for: statement.for,
- },
- children: [itemNode],
- root: rootNode,
- })
- itemNode.setParent(forNode, 0)
- appendNode = forNode
- }
-
- if (statement.if || statement.elif || statement.else) {
- const ifNode = new VirtualNode({
- type: CONSTANT.TYPE_IF,
- tagName: 'wx:if',
- statement: {
- if: statement.if,
- elif: statement.elif,
- else: statement.else,
- },
- children: [node],
- root: rootNode,
- })
- node.setParent(ifNode, 0)
- appendNode = ifNode
- }
- if (!unary) {
- stack.push(node)
- }
- appendNode.setParent(parent, parent.children.length)
- parent.appendChild(appendNode)
- },
-
- end: tagName => {
- stack.pop()
- },
- text: content => {
- content = content.trim()
- if (!content) return
- const parent = stack.last()
- if (parent.type === CONSTANT.TYPE_WXS) {
-
- parent.setWxsContent(content)
- } else {
-
- parent.appendChild(new VirtualNode({
- type: CONSTANT.TYPE_TEXT,
- content: content.replace(/[\n\r\t\s]+/g, ' '),
- parent,
- index: parent.children.length,
- componentManager: this,
- root: rootNode,
- }))
- }
- },
- })
- if (stack.length !== 1) throw new Error(`build ast error: ${template}`)
- return rootNode.generate.bind(rootNode)
- }
- }),
- (function(module, exports) {
- const startTagReg = /^<([-A-Za-z0-9_]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/
- const endTagReg = /^<\/([-A-Za-z0-9_]+)[^>]*>/
- const attrReg = /([-A-Za-z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g
- module.exports = function (content, handler = {}) {
- const stack = []
- let last = content
- stack.last = function () {
- return this[this.length - 1]
- }
- while (content) {
- let isText = true
- if (!stack.last() || stack.last() !== 'wxs') {
- if (content.indexOf('<!--') === 0) {
-
- const index = content.indexOf('-->')
- if (index >= 0) {
- content = content.substring(index + 3)
- isText = false
- }
- } else if (content.indexOf('</') === 0) {
-
- const match = content.match(endTagReg)
- if (match) {
- content = content.substring(match[0].length)
- match[0].replace(endTagReg, parseEndTag)
- isText = false
- }
- } else if (content.indexOf('<') === 0) {
-
- const match = content.match(startTagReg)
- if (match) {
- content = content.substring(match[0].length)
- match[0].replace(startTagReg, parseStartTag)
- isText = false
- }
- }
- if (isText) {
- const index = content.indexOf('<')
- const text = index < 0 ? content : content.substring(0, index)
- content = index < 0 ? '' : content.substring(index)
- if (handler.text) handler.text(text)
- }
- } else {
- const execRes = (new RegExp(`</${stack.last()}[^>]*>`)).exec(content)
- if (execRes) {
- let text = content.substring(0, execRes.index)
- content = content.substring(execRes.index + execRes[0].length)
- text = text.replace(/<!--(.*?)-->/g, '')
- if (text && handler.text) handler.text(text)
- }
- parseEndTag('', stack.last())
- }
- if (content === last) throw new Error(`parse error: ${content}`)
- last = content
- }
-
- parseEndTag()
- function parseStartTag(tag, tagName, rest, unary) {
- unary = !!unary
- if (!unary) stack.push(tagName)
- if (handler.start) {
- const attrs = []
- rest.replace(attrReg, (all, $1, $2, $3, $4) => {
- attrs.push({
- name: $1,
- value: $2 !== undefined ? $2 : $3 !== undefined ? $3 : $4 !== undefined ? $4 : true,
- })
- })
- if (handler.start) handler.start(tagName, attrs, unary)
- }
- }
- function parseEndTag(tag, tagName) {
- let pos
- if (!tagName) {
- pos = 0
- } else {
-
- for (pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos] === tagName) break
- }
- }
- if (pos >= 0) {
-
- for (let i = stack.length - 1; i >= pos; i--) {
- if (handler.end) handler.end(stack[i])
- }
- stack.length = pos
- }
- }
- }
- }),
- (function(module, exports, __webpack_require__) {
- const expr = __webpack_require__(32)
- const CONSTANT = __webpack_require__(6)
- class VirtualNode {
- constructor(options = {}) {
- this.type = options.type
- this.tagName = options.tagName || ''
- this.componentId = options.componentId
- this.root = options.root || this
- this.parent = options.parent
- this.index = options.index || 0
- this.content = options.content && expr.getExpression(options.content)
- this.attrs = options.attrs || []
- this.event = options.event || {}
- this.statement = options.statement || {}
- this.children = options.children || []
- this.generics = options.generics
- this.componentManager = options.componentManager
-
- this.data = options.data || {}
-
- this.wxsModuleName = ''
-
- this.slotName = ''
- this.checkAttrs()
- }
-
- checkAttrs() {
- const type = this.type
- const attrs = this.attrs
- const filterAttrs = []
- for (const attr of attrs) {
- const name = attr.name
- const value = attr.value
- if (type === CONSTANT.TYPE_WXS && name === 'module') {
-
- this.wxsModuleName = value || ''
- } else if (type === CONSTANT.TYPE_SLOT && name === 'name') {
-
- this.slotName = value || ''
- } else {
- if (value && typeof value === 'string') attr.value = expr.getExpression(value)
- filterAttrs.push(attr)
- }
- }
- this.attrs = filterAttrs
- }
-
- setParent(parent, index = 0) {
- if (!parent) return
- this.parent = parent
- this.index = index
- }
-
- appendChild(node) {
- this.children.push(node)
- }
-
- setWxsContent(content) {
- if (!this.wxsModuleName) return
-
- const func = new Function('require', 'module', content)
- const req = () => {}
- const mod = {exports: {}}
- func.call(null, req, mod)
- this.root.data[this.wxsModuleName] = mod.exports
- }
-
- nextSibling() {
- return this.parent && this.parent.children[this.index + 1]
- }
-
- previousSibling() {
- return this.parent && this.parent.children[this.index - 1]
- }
-
- checkIf(data) {
- const statement = this.statement
- if (!statement.if) return true
- return expr.calcExpression(statement.if, data)
- }
-
- checkElif(data) {
- const statement = this.statement
- if (!statement.elif) return true
- return this.checkPreviousCondition(data) ? false : expr.calcExpression(statement.elif, data)
- }
-
- checkElse(data) {
- const statement = this.statement
- if (!statement.else) return true
- return !this.checkPreviousCondition(data)
- }
-
- checkPreviousCondition(data) {
- let previousSibling = this.previousSibling()
- while (previousSibling) {
- const statement = previousSibling.statement
- if (previousSibling.type !== CONSTANT.TYPE_IF) return false
- if (!statement.if && !statement.elif) return false
- if (statement.if) return previousSibling.checkIf(data)
- if (statement.elif) {
- if (!previousSibling.checkElif(data)) {
- previousSibling = previousSibling.previousSibling()
- } else {
- return true
- }
- }
- }
- return false
- }
-
- generate(options = {}) {
- const data = options.data || {}
- const statement = this.statement
- let key = options.key || ''
- options.data = data
- delete options.key
-
- if (this.type === CONSTANT.TYPE_INCLUDE) {
- return null
- }
-
- if (this.type === CONSTANT.TYPE_IMPORT) {
- return null
- }
-
- if (this.type === CONSTANT.TYPE_TEMPLATE) {
- return null
- }
-
- if (this.type === CONSTANT.TYPE_WXS) {
- return null
- }
-
- if (this.type === CONSTANT.TYPE_IF && (!this.checkIf(data) || !this.checkElif(data) || !this.checkElse(data))) {
- return null
- }
- let children = []
-
- if (this.children && this.children.length) {
- if (this.type === CONSTANT.TYPE_FOR) {
-
- const list = expr.calcExpression(statement.for, data) || []
- options.extra = options.extra || {}
- for (let i = 0, len = list.length; i < len; i++) {
- const {forItem: bakItem, forIndex: bakIndex} = options.extra
- options.extra.forItem = list[i]
- options.extra.forIndex = i
-
- this.children.forEach(node => {
- const vt = node.generate(options)
- children.push(vt)
- })
- options.extra.forItem = bakItem
- options.extra.forIndex = bakIndex
- }
- } else if (this.type === CONSTANT.TYPE_FORITEM) {
-
- options.extra = options.extra || {}
- const {forItem, forIndex} = options.extra
- const {forItem: bakItem, forIndex: bakIndex} = data
- data[statement.forItem] = forItem
- data[statement.forIndex] = forIndex
- if (statement.forKey) key = statement.forKey === '*this' ? forItem : forItem[statement.forKey]
- children = this.children.map(node => node.generate(options))
- data[statement.forItem] = bakItem
- data[statement.forIndex] = bakIndex
- } else {
-
- children = this.children.map(node => node.generate(options))
- }
- }
-
- const filterChildren = []
- for (const child of children) {
- if (!child) continue
- if (child.type === CONSTANT.TYPE_BLOCK) {
-
- const grandChildren = child.children
- for (const grandChild of grandChildren) {
- filterChildren.push(grandChild)
- }
- } else {
- filterChildren.push(child)
- }
- }
-
- const attrs = []
- for (const {name, value} of this.attrs) {
- attrs.push({
- name,
- value: value ? expr.calcExpression(value, data) : value,
- })
- }
-
- let content = expr.calcExpression(this.content, data)
- content = content !== undefined ? String(content) : ''
- return {
- type: this.type,
- tagName: this.tagName,
- componentId: this.componentId,
- content,
- key,
- children: filterChildren,
- generics: this.generics,
- attrs,
- event: this.event,
- slotName: this.slotName,
- }
- }
- }
- module.exports = VirtualNode
- }),
- (function(module, exports) {
- const ESCAPE = {
- 'n': '\n',
- 'f': '\f',
- 'r': '\r',
- 't': '\t',
- 'v': '\v',
- };
- const CONSTANTS = {
- 'null': data => null,
- 'true': data => true,
- 'false': data => false,
- 'undefined': data => undefined,
- }
- const OPERATORS = {
- '+': (data, a, b) => a(data) + b(data),
- '-': (data, a, b) => a(data) - b(data),
- '*': (data, a, b) => a(data) * b(data),
- '/': (data, a, b) => a(data) / b(data),
- '%': (data, a, b) => a(data) % b(data),
- '===': (data, a, b) => a(data) === b(data),
- '!==': (data, a, b) => a(data) !== b(data),
- '==': (data, a, b) => a(data) == b(data),
- '!=': (data, a, b) => a(data) != b(data),
- '<': (data, a, b) => a(data) < b(data),
- '>': (data, a, b) => a(data) > b(data),
- '<=': (data, a, b) => a(data) <= b(data),
- '>=': (data, a, b) => a(data) >= b(data),
- '&&': (data, a, b) => a(data) && b(data),
- '||': (data, a, b) => a(data) || b(data),
- '!': (data, a) => !a(data),
- };
- function isNumber(char) {
- return char >= '0' && char <= '9' && typeof char === 'string';
- }
- function isExpOperator(char) {
- return (char === '-' || char === '+' || isNumber(char));
- }
- function isIdent(char) {
- return char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z' || char === '_' || char === '$';
- }
- class Expression {
- constructor(content) {
- if (!content) throw new Error('invalid expression');
- this.content = content;
- }
- lex() {
- let content = this.content;
- let length = content.length;
- let index = 0;
- let tokens = [];
- while (index < length) {
- let char = content.charAt(index);
- if (char === '"' || char === '\'') {
-
- let start = ++index;
- let escape = false;
- let value = '';
- let token;
- while (index < length) {
- let c = content.charAt(index);
- if (escape) {
- if (c === 'u') {
- let hex = content.substring(index + 1, index + 5);
- if (!hex.match(/[\da-f]{4}/i)) {
- throw new Error(`invalid expression: ${content}, invalid unicode escape [\\u${hex}]`);
- }
- index += 4;
- value += String.fromCharCode(parseInt(hex, 16));
- } else {
- let rep = ESCAPE[c];
- value = value + (rep || c);
- }
- escape = false;
- } else if (c === '\\') {
- escape = true;
- } else if (c === char) {
- index++;
- token = {
- index: start,
- constant: true,
- text: char + value + char,
- value,
- };
- break;
- } else {
- value += c;
- }
- index++;
- }
- if (!token) {
- throw new Error(`invalid expression: ${content}`);
- } else {
- tokens.push(token);
- }
- } else if (isNumber(char) || (char === '.' && isNumber(content.charAt(index + 1)))) {
-
- let start = index;
- let value = '';
- while (index < length) {
- let c = content.charAt(index).toLowerCase();
- if (c === '.' || isNumber(c)) {
- value += c;
- } else {
- let c2 = content.charAt(index + 1);
- if (c === 'e' && isExpOperator(c2)) {
- value += c;
- } else if (isExpOperator(c) && c2 && isNumber(c2) && value.charAt(value.length - 1) === 'e') {
- value += c;
- } else if (isExpOperator(c) && (!c2 || !isNumber(c2)) && value.charAt(value.length - 1) == 'e') {
- throw new Error(`invalid expression: ${content}`);
- } else {
- break;
- }
- }
- index++;
- }
- tokens.push({
- index: start,
- constant: true,
- text: value,
- value: Number(value),
- })
- } else if (isIdent(char)) {
-
- let start = index;
- while (index < length) {
- let c = content.charAt(index);
- if (!(isIdent(c) || isNumber(c))) {
- break;
- }
- index++;
- }
- tokens.push({
- index: start,
- text: content.slice(start, index),
- identifier: true
- });
- } else if ('(){}[].,;:?'.indexOf(char) >= 0) {
-
- tokens.push({
- index,
- text: char
- });
- index++;
- } else if (char === ' ' || char === '\r' || char === '\t' || char === '\n' || char === '\v' || char === '\u00A0') {
-
- index++;
- } else {
-
- let char2 = char + content.charAt(index + 1);
- let char3 = char2 + content.charAt(index + 2);
- let op1 = OPERATORS[char];
- let op2 = OPERATORS[char2];
- let op3 = OPERATORS[char3];
- if (op1 || op2 || op3) {
- let text = op3 ? char3 : op2 ? char2 : char;
- tokens.push({
- index: index,
- text,
- operator: true
- });
- index += text.length;
- } else {
- throw new Error(`invalid expression: ${content}`);
- }
- }
- }
- this.tokens = tokens;
- return tokens;
- }
- parse() {
- let tokens = this.lex();
- let func;
- let token = tokens[0];
- let text = token.text;
- if (tokens.length > 0 && text !== '}' && text !== ')' && text !== ']') {
- func = this.expression();
- }
- return data => func && func(data);
- }
- expect(text) {
- let tokens = this.tokens;
- let token = tokens[0];
- if (!text || text === (token && token.text)) {
- return tokens.shift();
- }
- }
- consume(text) {
- if (!this.tokens.length) throw new Error(`parse expression error: ${this.content}`);
- let token = this.expect(text);
- if (!token) throw new Error(`parse expression error: ${this.content}`);
- return token;
- }
- expression() {
- return this.ternary();
- }
- ternary() {
- let left = this.logicalOR();
- let token;
- if (token = this.expect('?')) {
- let middle = this.expression();
- this.consume(':')
- let right = this.expression();
- return data => left(data) ? middle(data) : right(data);
- }
- return left;
- }
- binary(left, op, right) {
- let fn = OPERATORS[op];
- return data => fn(data, left, right);
- }
- unary() {
- let token;
- if (this.expect('+')) {
- return this.primary();
- } else if (token = this.expect('-')) {
- return this.binary(data => 0, token.text, this.unary());
- } else if (token = this.expect('!')) {
- let fn = OPERATORS[token.text];
- let right = this.unary();
- return data => fn(data, right);
- } else {
- return this.primary();
- }
- }
- logicalOR() {
- let left = this.logicalAND();
- let token;
- while (token = this.expect('||')) {
- left = this.binary(left, token.text, this.logicalAND());
- }
- return left;
- }
- logicalAND() {
- let left = this.equality();
- let token;
- while (token = this.expect('&&')) {
- left = this.binary(left, token.text, this.equality());
- }
- return left;
- }
- equality() {
- let left = this.relational();
- let token;
- while (token = this.expect('==') || this.expect('!=') || this.expect('===') || this.expect('!==')) {
- left = this.binary(left, token.text, this.relational());
- }
- return left;
- }
- relational() {
- let left = this.additive();
- let token;
- while (token = this.expect('<') || this.expect('>') || this.expect('<=') || this.expect('>=')) {
- left = this.binary(left, token.text, this.additive());
- }
- return left;
- }
- additive() {
- let left = this.multiplicative();
- let token;
- while (token = this.expect('+') || this.expect('-')) {
- left = this.binary(left, token.text, this.multiplicative());
- }
- return left;
- }
- multiplicative() {
- let left = this.unary();
- let token;
- while (token = this.expect('*') || this.expect('/') || this.expect('%')) {
- left = this.binary(left, token.text, this.unary());
- }
- return left;
- }
- primary() {
- let token = this.tokens[0];
- let primary;
- if (this.expect('(')) {
- primary = this.expression();
- this.consume(')');
- } else if (this.expect('[')) {
- primary = this.array();
- } else if (this.expect('{')) {
- primary = this.object();
- } else if (token.identifier && token.text in CONSTANTS) {
- primary = CONSTANTS[this.consume().text];
- } else if (token.identifier) {
- primary = this.identifier();
- } else if (token.constant) {
- primary = this.constant();
- } else {
- throw new Error(`parse expression error: ${this.content}`);
- }
- let next;
- let context;
- while (next = this.expect('(') || this.expect('[') || this.expect('.')) {
- if (next.text === '(') {
- primary = this.functionCall(primary, context);
- context = null;
- } else if (next.text === '[') {
- context = primary;
- primary = this.objectIndex(primary);
- } else {
- context = primary;
- primary = this.fieldAccess(primary);
- }
- }
- return primary;
- }
- fieldAccess(object) {
- let getter = this.identifier();
- return data => {
- let o = object(data);
- return o && getter(o);
- };
- }
- objectIndex(object) {
- let indexFn = this.expression();
- this.consume(']');
- return data => {
- let o = object(data);
- let key = indexFn(data) + '';
- return o && o[key];
- };
- }
- functionCall(func, context) {
- let args = [];
- if (this.tokens[0].text !== ')') {
- do {
- args.push(this.expression());
- } while (this.expect(','));
- }
- this.consume(')');
- return data => {
- let callContext = context && context(data);
- let fn = func(data, callContext);
- return fn && fn.apply(callContext, args.length ? args.map(arg => arg(data)) : null);
- };
- }
- array() {
- let elements = [];
- let token = this.tokens[0];
- if (token.text !== ']') {
- do {
- if (this.tokens[0].text === ']') break;
- elements.push(this.expression());
- } while (this.expect(','));
- }
- this.consume(']');
- return data => elements.map(element => element(data));
- }
- object() {
- let keys = [];
- let values = [];
- let token = this.tokens[0];
- if (token.text !== '}') {
- do {
- token = this.tokens[0];
- if (token.text === '}') break;
- token = this.consume();
- if (token.constant) {
- keys.push(token.value);
- } else if (token.identifier) {
- keys.push(token.text);
- } else {
- throw new Error(`parse expression error: ${this.content}`);
- }
- this.consume(':');
- values.push(this.expression());
- } while (this.expect(','));
- }
- this.consume('}');
- return data => {
- let object = {};
- for (let i = 0, length = values.length; i < length; i++) {
- object[keys[i]] = values[i](data);
- }
- return object;
- };
- }
- identifier() {
- let id = this.consume().text;
- let token = this.tokens[0];
- let token2 = this.tokens[1];
- let token3 = this.tokens[2];
-
- while (token && token.text === '.' && token2 && token2.identifier && token3 && token3.text !== '(') {
- id += this.consume().text + this.consume().text;
- token = this.tokens[0];
- token2 = this.tokens[1];
- token3 = this.tokens[2];
- }
- return data => {
- let elements = id.split('.');
- let key;
- for (let i = 0; elements.length > 1; i++) {
- key = elements.shift();
- data = data[key];
- if (!data) break;
- }
- key = elements.shift();
- return data && data[key];
- };
- }
- constant() {
- let value = this.consume().value;
- return data => value;
- }
- }
- module.exports = Expression;
- }),
- (function(module, exports, __webpack_require__) {
- const CONSTANT = __webpack_require__(6)
- const _ = __webpack_require__(5)
- function filterAttrs(attrs = {}) {
- const event = {}
- const normalAttrs = []
- let slotName = ''
- const attrsKeyList = Object.keys(attrs)
- for (const name of attrsKeyList) {
- const value = attrs[name] === undefined ? '' : attrs[name]
- const eventObj = _.parseEvent(name, value)
- if (eventObj) {
-
- event[eventObj.name] = eventObj
- } else {
-
- if (name === 'name') slotName = value
- normalAttrs.push({name, value})
- }
- }
- return {
- event,
- normalAttrs,
- slotName,
- }
- }
- function transformCompileResTree(obj, parent, usingComponents) {
- let node = null
-
- if (typeof obj === 'string' || (typeof obj === 'number' && obj % 1 === 0)) {
-
- node = {
- type: CONSTANT.TYPE_TEXT,
- tagName: '',
- componentId: '',
- content: '' + obj,
- key: '',
- children: [],
- generics: [],
- attrs: [],
- event: {},
- slotName: '',
- }
- } else {
-
- const children = []
- const {
- tag, wxKey, wxXCkey, attr
- } = obj
- const tagName = tag.indexOf('wx-') === 0 && (tag === 'wx-slot' || !_.isOfficialTag(tag)) ? tag.substr(3) : tag
- const key = wxKey !== undefined && wxKey !== null ? '' + wxKey : undefined
- const {event, normalAttrs, slotName} = filterAttrs(attr)
- const isIf = wxXCkey === 1 || wxXCkey === 3
- const isFor = wxXCkey === 2 || wxXCkey === 4
- const isSlot = tagName === 'slot'
- const isRoot = tagName === 'shadow'
- let type = isRoot ? CONSTANT.TYPE_ROOT : isIf ? CONSTANT.TYPE_IF : isFor ? CONSTANT.TYPE_FOR : isSlot ? CONSTANT.TYPE_SLOT : CONSTANT.TYPE_COMPONENT
- if (parent && parent.type === CONSTANT.TYPE_FOR) {
- type = CONSTANT.TYPE_FORITEM
- }
- node = {
- type,
- tagName,
- componentId: usingComponents[tagName] || tagName,
- content: '',
- key,
- children,
- generics: obj.generics,
- attrs: normalAttrs,
- event,
- slotName: isSlot ? slotName : '',
- }
- obj.children.forEach(child => children.push(transformCompileResTree(child, node, usingComponents)))
- }
- return node
- }
- module.exports = function (generateFunc, usingComponents) {
- return function (options = {}) {
- const data = options.data || {}
- const compileRes = generateFunc(data)
- if (compileRes.type !== CONSTANT.TYPE_ROOT && (compileRes.tag === 'wx-page' || compileRes.tag === 'shadow')) {
-
- compileRes.tag = 'shadow'
- return transformCompileResTree(compileRes, null, usingComponents)
- } else {
- return compileRes
- }
- }
- }
- }),
- (function(module, exports, __webpack_require__) {
- const exparser = __webpack_require__(4)
- const render = __webpack_require__(13)
- const CONSTANT = __webpack_require__(6)
- function diffVt(oldVt, newVt) {
- const node = oldVt.exparserNode
- const parent = node.parentNode
- newVt.exparserNode = node
- if (!newVt) {
-
- if (parent) parent.removeChild(node)
- } else if (oldVt.type === CONSTANT.TYPE_TEXT) {
-
- if (newVt.type !== CONSTANT.TYPE_TEXT || newVt.content !== oldVt.content) {
- if (parent) {
- const newNode = render.renderExparserNode(newVt, null, parent.ownerShadowRoot)
- newNode._vt = newVt
- parent.replaceChild(newNode, node)
- }
- }
- } else {
-
-
- if (newVt.type === CONSTANT.TYPE_TEXT) {
-
- if (parent) {
- const newNode = render.renderExparserNode(newVt, null, parent.ownerShadowRoot)
- newNode._vt = newVt
- parent.replaceChild(newNode, node)
- }
- } else if (newVt.type === oldVt.type && newVt.componentId === oldVt.componentId && newVt.key === oldVt.key) {
-
- const attrs = diffAttrs(oldVt.attrs, newVt.attrs)
- if (attrs) {
-
- newVt.attrs = attrs
- render.updateAttrs(node, attrs)
- }
-
- Object.keys(oldVt.event).forEach(key => {
- const {name, isCapture, id} = oldVt.event[key]
- exparser.removeListenerFromElement(node, name, id, {capture: isCapture})
- })
- render.updateEvent(node, newVt.event)
-
- const oldChildren = oldVt.children
- const newChildren = newVt.children
- const diffs = diffList(oldChildren, newChildren)
-
- for (let i = 0, len = oldChildren.length; i < len; i++) {
- const oldChild = oldChildren[i]
- const newChild = diffs.children[i]
- if (newChild) diffVt(oldChild, newChild)
- }
- if (diffs.moves) {
-
- let {inserts} = diffs.moves
- const {removes} = diffs.moves
- const children = node.childNodes
- inserts = inserts.map(({oldIndex, index}) => {
- const newNode = children[oldIndex] || render.renderExparserNode(newChildren[index], null, node.ownerShadowRoot)
- newNode._vt = newChildren[index]
- return {
- newNode,
- index,
- }
- })
- removes.forEach(index => node.removeChild(children[index]))
- inserts.forEach(({newNode, index}) => node.insertBefore(newNode, children[index]))
- }
- node._vt = newVt
- } else if (parent) {
- const newNode = render.renderExparserNode(newVt, null, parent.ownerShadowRoot)
- newNode._vt = newVt
- parent.replaceChild(newNode, node)
- }
- }
- }
- function diffAttrs(oldAttrs, newAttrs) {
- const oldAttrsMap = {}
- const newAttrsMap = {}
- const retAttrs = []
- let isChange = false
- oldAttrs.forEach(attr => oldAttrsMap[attr.name] = attr.value)
- for (const attr of newAttrs) {
-
- newAttrsMap[attr.name] = attr.value
- retAttrs.push(attr)
- if (oldAttrsMap[attr.name] === undefined || oldAttrsMap[attr.name] !== attr.value) isChange = true
- }
- for (const attr of oldAttrs) {
- if (newAttrsMap[attr.name] === undefined) {
-
- attr.value = undefined
- retAttrs.push(attr)
- isChange = true
- }
- }
- return isChange ? retAttrs : false
- }
- function diffList(oldList, newList) {
- const oldKeyMap = {}
- const newKeyMap = {}
- const oldFreeList = []
- const newFreeList = []
- oldList.forEach((item, index) => {
- if (item.key) {
-
- if (Object.prototype.hasOwnProperty.call(oldKeyMap, item.key)) item.key = ''
- else oldKeyMap[item.key] = index
- } else {
-
- oldFreeList.push(index)
- }
- })
- newList.forEach((item, index) => {
- if (item.key) {
-
- if (Object.prototype.hasOwnProperty.call(newKeyMap, item.key)) newFreeList.push(index)
- else newKeyMap[item.key] = index
- } else {
-
- newFreeList.push(index)
- }
- })
- const children = []
- let removes = []
- const inserts = []
-
- for (let i = 0, j = 0; i < oldList.length; i++) {
- const item = oldList[i]
- const key = item.key
- if (key) {
- if (Object.prototype.hasOwnProperty.call(newKeyMap, key)) {
-
- children.push(newList[newKeyMap[key]])
- } else {
-
- removes.push(i)
- children.push(null)
- }
- } else if (j < newFreeList.length) {
-
- children.push(newList[newFreeList[j++]])
- } else {
-
- removes.push(i)
- children.push(null)
- }
- }
- removes = removes.reverse()
-
- const hasCheckIndexMap = {}
- for (let i = 0, j = 0, k = 0, len = newList.length; i < len; i++) {
- const item = newList[i]
- const key = item.key
- while (children[j] === null || hasCheckIndexMap[j]) j++
- if (key) {
- if (Object.prototype.hasOwnProperty.call(oldKeyMap, key) && children[j]) {
-
- if (children[j].key === key) {
-
- j++
- } else {
-
- const oldIndex = oldKeyMap[key]
- hasCheckIndexMap[oldIndex] = true
- if (oldIndex !== i) inserts.push({oldIndex, index: i})
- }
- } else {
-
- inserts.push({oldIndex: -1, index: i})
- }
- } else if (k < oldFreeList.length) {
-
- const oldIndex = oldFreeList[k++]
- hasCheckIndexMap[oldIndex] = true
- if (oldIndex !== i) inserts.push({oldIndex, index: i})
- } else {
-
- inserts.push({oldIndex: -1, index: i})
- }
- }
- return {
- children,
- moves: {removes, inserts},
- }
- }
- module.exports = {
- diffVt,
- diffAttrs,
- diffList,
- }
- }),
- (function(module, exports, __webpack_require__) {
- const exparser = __webpack_require__(4)
- class NodesRef {
- constructor(selectorQuery, exparserNode, selector, isSelectSingle) {
- this._selectorQuery = selectorQuery
- this._exparserNode = exparserNode
- this._selector = selector
- this._isSelectSingle = isSelectSingle
- }
- boundingClientRect(callback) {
- return this._selectorQuery._push(this._selector, this._exparserNode, this._isSelectSingle, {
- id: true,
- dataset: true,
- rect: true,
- size: true,
- }, callback)
- }
- scrollOffset(callback) {
- return this._selectorQuery._push(this._selector, this._exparserNode, this._isSelectSingle, {
- id: true,
- dataset: true,
- scrollOffset: true,
- }, callback)
- }
- context(callback) {
- return this._selectorQuery._push(this._selector, this._exparserNode, this._isSelectSingle, {
- context: true,
- }, callback)
- }
- fields(fields, callback) {
- return this._selectorQuery._push(this._selector, this._exparserNode, this._isSelectSingle, fields, callback)
- }
- }
- class SelectorQuery {
- constructor(compInst) {
- this._exparserNode = compInst && compInst._exparserNode || null
- this._queue = []
- this._queueCallback = []
- }
- _push(selector, exparserNode, isSelectSingle, fields, callback) {
- this._queue.push({
- selector,
- exparserNode,
- isSelectSingle,
- fields,
- })
- this._queueCallback.push(callback || null)
- return this
- }
- in(compInst) {
- if (!compInst || typeof compInst !== 'object') {
- throw new Error('invalid params')
- }
- this._exparserNode = compInst._exparserNode
- return this
- }
- select(selector) {
- return new NodesRef(this, this._exparserNode, selector, true)
- }
- selectAll(selector) {
- return new NodesRef(this, this._exparserNode, selector, false)
- }
- selectViewport() {
- return new NodesRef(this, 0, '', false)
- }
- exec(callback) {
- Promise.resolve().then(() => {
- const res = []
- this._queue.forEach((item, index) => {
- const {
- selector, exparserNode, isSelectSingle, fields
- } = item
- if (exparserNode === 0) {
- const itemRes = {}
- if (fields.id) {
- itemRes.id = ''
- }
- if (fields.dataset) {
- itemRes.dataset = {}
- }
- if (fields.rect) {
- itemRes.left = 0
- itemRes.right = 0
- itemRes.top = 0
- itemRes.bottom = 0
- }
- if (fields.size) {
- itemRes.width = document.documentElement.clientWidth
- itemRes.height = document.documentElement.clientHeight
- }
- if (fields.scrollOffset) {
- itemRes.scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft || 0
- itemRes.scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0
- }
- res.push(itemRes)
- } else {
- const shadowRoot = exparserNode.shadowRoot
- const nodes = isSelectSingle ? [shadowRoot.querySelector(selector)] : shadowRoot.querySelectorAll(selector)
- const itemResList = []
- for (const node of nodes) {
- if (!node) continue
- const itemRes = {}
- if (fields.id) {
- itemRes.id = node.id || ''
- }
- if (fields.dataset) {
- itemRes.dataset = Object.assign({}, node.dataset || {})
- }
- if (fields.rect || fields.size) {
- const rect = node.$$.getBoundingClientRect()
- if (fields.rect) {
- itemRes.left = rect.left
- itemRes.right = rect.right
- itemRes.top = rect.top
- itemRes.bottom = rect.bottom
- }
- if (fields.size) {
- itemRes.width = rect.width
- itemRes.height = rect.height
- }
- }
- if (fields.properties) {
- fields.properties.forEach(name => {
- name = name.replace(/-([a-z])/g, (all, $1) => $1.toUpperCase())
- if (exparser.Component.hasPublicProperty(node, name)) {
- itemRes[name] = node.data[name]
- }
- })
- }
- if (fields.scrollOffset) {
- itemRes.scrollLeft = node.$$.scrollLeft || 0
- itemRes.scrollTop = node.$$.scrollTop || 0
- }
- if (fields.computedStyle && fields.computedStyle.length) {
- const style = window.getComputedStyle(node.$$)
- fields.computedStyle.forEach(key => {
- if (key && style[key] !== undefined) itemRes[key] = style[key]
- })
- }
- if (fields.context) {
- itemRes.context = {}
- }
- itemResList.push(itemRes)
- }
- res.push(isSelectSingle ? (itemResList[0] || null) : itemResList)
- }
- if (typeof this._queueCallback[index] === 'function') this._queueCallback[index].call(this, res[index])
- })
- if (typeof callback === 'function') callback.call(this, res)
-
- this._queue = []
- this._queueCallback = []
- }).catch(console.error)
- }
- }
- module.exports = SelectorQuery
- }),
- (function(module, exports, __webpack_require__) {
- const exparser = __webpack_require__(4)
- const _ = __webpack_require__(5)
- const IntersectionObserver = __webpack_require__(33)
- const CONSTANT = __webpack_require__(6)
- const render = __webpack_require__(13)
- const MOVE_DELTA = 10
- const LONGPRESS_TIME = 350
- const SCROLL_PROTECTED = 150
- const NATIVE_TOUCH_EVENT = ['touchstart', 'touchmove', 'touchend', 'touchcancel']
- function dfsExparserTree(node, callback, fromTopToBottom) {
- if (node instanceof exparser.Component) {
- if (fromTopToBottom) callback(node)
- if (node.shadowRoot instanceof exparser.Element) dfsExparserTree(node.shadowRoot, callback, fromTopToBottom)
- if (!fromTopToBottom) callback(node)
- }
- node.childNodes.forEach(child => {
- if (child instanceof exparser.Element) dfsExparserTree(child, callback, fromTopToBottom)
- })
- }
- const JSONSymbol = typeof Symbol === 'function' && Symbol.for ? Symbol.for('j-component.json') : 0xd846fe
- function exparserNodeEventToJSON(node) {
- return node._vt ? node._vt.event : {}
- }
- function exparserNodeAttrsToJSON(node) {
- const attrs = []
- const vt = node._vt
- if (vt) {
- vt.attrs.forEach(attr => {
- if (!exparser.Component.hasPublicProperty(node, _.dashToCamelCase(attr.name))) {
- attrs.push(attr)
- }
- })
- }
- return attrs
- }
- function exparserTreeToJSON(node) {
- const _inner = (node, array) => {
- let children = array
- const vt = node._vt
- if (vt) {
- if (vt.type === CONSTANT.TYPE_TEXT) {
- array.push(vt.content)
- } else if (vt.type === CONSTANT.TYPE_NATIVE || vt.type === CONSTANT.TYPE_COMPONENT) {
- children = []
- const child = {
- tagName: _.getTagName(vt.componentId || vt.tagName) || vt.tagName,
- event: exparserNodeEventToJSON(node),
- attrs: exparserNodeAttrsToJSON(node),
- children,
- }
- Object.defineProperty(child, '$$typeof', {
- get() {
- return JSONSymbol
- }
- })
- array.push(child)
- }
- }
- (node.__wxSlotChildren || []).forEach(child => _inner(child, children))
- return array
- }
- return _inner(node, [])[0]
- }
- class Component {
- constructor(exparserNode) {
- this._exparserNode = exparserNode
- }
- get dom() {
- return this._exparserNode.$$
- }
- get data() {
- const caller = exparser.Element.getMethodCaller(this._exparserNode)
- return caller && caller.data
- }
- get instance() {
- return exparser.Element.getMethodCaller(this._exparserNode)
- }
-
- dispatchEvent(eventName, options = {}) {
- const dom = this.dom
- if (NATIVE_TOUCH_EVENT.indexOf(eventName) >= 0) {
-
- let touches = options.touches
- let changedTouches = options.changedTouches
- if (eventName === 'touchstart' || eventName === 'touchmove') {
- touches = touches || [{x: 0, y: 0}]
- changedTouches = changedTouches || [{x: 0, y: 0}]
- } else if (eventName === 'touchend' || eventName === 'touchcancel') {
- touches = touches || []
- changedTouches = changedTouches || [{x: 0, y: 0}]
- }
- const touchEvent = new TouchEvent(eventName, {
- cancelable: true,
- bubbles: true,
- touches: touches.map(touch => new Touch({
- identifier: _.getId(),
- target: dom,
- clientX: touch.x,
- clientY: touch.y,
- pageX: touch.x,
- pageY: touch.y,
- })),
- targetTouches: [],
- changedTouches: changedTouches.map(touch => new Touch({
- identifier: _.getId(),
- target: dom,
- clientX: touch.x,
- clientY: touch.y,
- pageX: touch.x,
- pageY: touch.y,
- })),
- })
-
- Promise.resolve().then(() => {
- dom.dispatchEvent(touchEvent)
- }).catch(console.error)
- } else {
-
- const customEvent = new CustomEvent(eventName, options)
-
- Promise.resolve().then(() => {
- dom.dispatchEvent(customEvent)
- if (customEvent.target.__wxElement) {
- exparser.Event.dispatchEvent(customEvent.target.__wxElement, exparser.Event.create(eventName, options.detail || {}, {
- originalEvent: customEvent,
- bubbles: true,
- capturePhase: true,
- composed: true,
- extraFields: {
- touches: options.touches || {},
- changedTouches: options.changedTouches || {},
- },
- }))
- }
- }).catch(console.error)
- }
- }
-
- addEventListener(eventName, handler, capture = false) {
- if (typeof capture === 'object') capture = !!capture.capture
- this._exparserNode.addListener(eventName, handler, {capture})
- }
-
- removeEventListener(eventName, handler, capture = false) {
- if (typeof capture === 'object') capture = !!capture.capture
- this._exparserNode.removeListener(eventName, handler, {capture})
- }
-
- querySelector(selector) {
- const shadowRoot = this._exparserNode.shadowRoot
- const selExparserNode = shadowRoot && shadowRoot.querySelector(selector)
- if (selExparserNode) {
- return selExparserNode.__componentNode__ ? selExparserNode.__componentNode__ : new Component(selExparserNode)
- }
- }
-
- querySelectorAll(selector) {
- const shadowRoot = this._exparserNode.shadowRoot
- const selExparserNodes = shadowRoot.querySelectorAll(selector) || []
- return selExparserNodes.map(selExparserNode => (selExparserNode.__componentNode__ ? selExparserNode.__componentNode__ : new Component(selExparserNode)))
- }
-
- setData(data, callback) {
- const caller = exparser.Element.getMethodCaller(this._exparserNode)
- if (caller && typeof caller.setData === 'function') caller.setData(data)
- if (typeof callback === 'function') {
-
- Promise.resolve().then(callback).catch(console.error)
- }
- }
-
- triggerLifeTime(lifeTime, ...args) {
- this._exparserNode.triggerLifeTime(lifeTime, args)
- }
-
- triggerPageLifeTime(lifeTime, ...args) {
- this._exparserNode.triggerPageLifeTime(lifeTime, args)
- }
-
- toJSON() {
- return exparserTreeToJSON(this._exparserNode)
- }
- }
- class RootComponent extends Component {
- constructor(componentManager, properties) {
- super()
- const id = componentManager.id
- const tagName = _.getTagName(id)
- const exparserDef = componentManager.exparserDef
- this._exparserNode = exparser.createElement(tagName || id, exparserDef)
- this._isTapCancel = false
- this._lastScrollTime = 0
- const attrs = Object.keys(properties || {}).map(key => ({name: key, value: properties[key]}))
- if (attrs.length) {
-
- render.updateAttrs(this._exparserNode, attrs)
- }
- this._exparserNode._vt = {
- type: CONSTANT.TYPE_COMPONENT,
- tagName: tagName || 'main',
- attrs,
- event: {},
- children: []
- }
- this.parentNode = null
- this._bindEvent()
- }
- get dom() {
- return _.getDom(this._exparserNode)
- }
-
- _bindEvent() {
- const dom = this.dom
-
- dom.addEventListener('touchstart', evt => {
- this._triggerExparserEvent(evt, 'touchstart')
- if (this._touchstartEvt || evt.defaultPrevented) return
- if (evt.touches.length === 1) {
- if (this._longpressTimer) this._longpressTimer = clearTimeout(this._longpressTimer)
- this._touchstartX = evt.touches[0].pageX
- this._touchstartY = evt.touches[0].pageY
- this._touchstartEvt = evt
- if ((+new Date()) - this._lastScrollTime < SCROLL_PROTECTED) {
-
- this._isTapCancel = true
- this._lastScrollTime = 0
- } else {
- this._isTapCancel = false
- this._longpressTimer = setTimeout(() => {
- this._isTapCancel = true
- this._triggerExparserEvent(evt, 'longpress', {x: this._touchstartX, y: this._touchstartY})
- }, LONGPRESS_TIME)
- }
- }
- }, {capture: true, passive: false})
- dom.addEventListener('touchmove', evt => {
- this._triggerExparserEvent(evt, 'touchmove')
- if (!this._touchstartEvt) return
- if (evt.touches.length === 1) {
- if (!(Math.abs(evt.touches[0].pageX - this._touchstartX) < MOVE_DELTA && Math.abs(evt.touches[0].pageY - this._touchstartY) < MOVE_DELTA)) {
-
- if (this._longpressTimer) this._longpressTimer = clearTimeout(this._longpressTimer)
- this._isTapCancel = true
- }
- }
- }, {capture: true, passive: false})
- dom.addEventListener('touchend', evt => {
- this._triggerExparserEvent(evt, 'touchend')
- if (!this._touchstartEvt) return
- if (evt.touches.length === 0) {
- if (this._longpressTimer) this._longpressTimer = clearTimeout(this._longpressTimer)
- if (!this._isTapCancel) this._triggerExparserEvent(this._touchstartEvt, 'tap', {x: evt.changedTouches[0].pageX, y: evt.changedTouches[0].pageY})
- }
- this._touchstartEvt = null
- }, {capture: true, passive: false})
- dom.addEventListener('touchcancel', evt => {
- this._triggerExparserEvent(evt, 'touchcancel')
- if (!this._touchstartEvt) return
- if (this._longpressTimer) this._longpressTimer = clearTimeout(this._longpressTimer)
- this._touchstartEvt = null
- }, {capture: true, passive: false})
-
- dom.addEventListener('scroll', evt => {
-
- const listenInfoMap = this._exparserNode._listenInfoMap || {}
- Object.keys(listenInfoMap).forEach(key => {
- const listenInfo = listenInfoMap[key]
- IntersectionObserver.updateTargetIntersection(listenInfo)
- })
- this._lastScrollTime = +new Date()
- this._triggerExparserEvent(evt, 'scroll')
- }, {capture: true, passive: false})
-
- dom.addEventListener('blur', evt => {
- if (this._longpressTimer) this._longpressTimer = clearTimeout(this._longpressTimer)
- }, {capture: true, passive: false})
- }
-
- _triggerExparserEvent(evt, name, detail = {}) {
- Promise.resolve().then(() => {
- exparser.Event.dispatchEvent(evt.target, exparser.Event.create(name, detail, {
- originalEvent: evt,
- bubbles: true,
- capturePhase: true,
- composed: true,
- extraFields: {
- touches: evt.touches || {},
- changedTouches: evt.changedTouches || {},
- },
- }))
- }).catch(console.error)
- }
-
- attach(parent) {
- parent.appendChild(this.dom)
- this.parentNode = parent
- exparser.Element.pretendAttached(this._exparserNode)
- dfsExparserTree(this._exparserNode, node => node.triggerLifeTime('ready'))
- }
-
- detach() {
- if (!this.parentNode) return
- this.parentNode.removeChild(this.dom)
- this.parentNode = null
- exparser.Element.pretendDetached(this._exparserNode)
- }
- }
- module.exports = RootComponent
- }),
- (function(module, exports) {
- }),
- (function(module, exports, __webpack_require__) {
- const postcss = __webpack_require__(73)
- const path = __webpack_require__(3)
- const less = __webpack_require__(95)
- const csso = __webpack_require__(96)
- const _ = __webpack_require__(10)
- const wxssCache = {}
- const addClassPrefixPlugin = function(prefix = '') {
- return postcss.plugin('addClassPrefix', () => root => {
-
- root.walk(child => {
- if (child.type === 'rule') {
- const selectors = []
- child.selectors.forEach(selector => {
-
- selectors.push(selector.replace(/(.)?\.([-_a-zA-Z0-9]+)/igs, (all, $1, $2) => (/\d/.test($1) ? all : `${$1 || ''}.${prefix}--${$2}`)))
- })
- child.selectors = selectors
- }
- })
- })
- }
- function getImportList(wxss, filePath) {
- const reg = /@import\s+(?:(?:"([^"]+)")|(?:'([^']+)'));/ig
- const importList = []
- let execRes = reg.exec(wxss)
- while (execRes && (execRes[1] || execRes[2])) {
- importList.push({
- code: execRes[0],
- path: path.join(path.dirname(filePath), execRes[1] || execRes[2]),
- })
- execRes = reg.exec(wxss)
- }
- return importList
- }
- function getContent(filePath) {
-
- if (wxssCache[filePath]) {
- return wxssCache[filePath]
- }
- let wxss = _.readFile(filePath)
- if (wxss) {
- const importList = getImportList(wxss, filePath)
- importList.forEach(item => {
- wxss = wxss.replace(item.code, getContent(item.path))
- })
- }
-
- wxssCache[filePath] = wxss || ''
- return wxssCache[filePath]
- }
- function compile(wxss, options = {}) {
- if (options.less) {
- less.render(wxss, (err, output) => {
- if (!err) wxss = output.css
- })
- }
- wxss = postcss([addClassPrefixPlugin(options.prefix)]).process(wxss, {
- from: undefined,
- map: null,
- }).css
-
- return csso.minify(wxss, {restructure: false}).css
- }
- function insert(wxss, id) {
- if (!Array.isArray(wxss)) {
- wxss = [wxss]
- }
-
- document.querySelectorAll(`style#${id}`).forEach(style => {
- style.parentNode.removeChild(style)
- })
- const style = document.createElement('style')
- style.type = 'text/css'
- style.id = id
- style.innerHTML = _.transformRpx(wxss.join(''))
- const head = document.getElementsByTagName('head')
- if (head && head.length) head.item(0).appendChild(style)
- }
- module.exports = {
- getContent,
- compile,
- insert,
- }
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _declaration = _interopRequireDefault(__webpack_require__(15));
- var _processor = _interopRequireDefault(__webpack_require__(36));
- var _stringify = _interopRequireDefault(__webpack_require__(17));
- var _comment = _interopRequireDefault(__webpack_require__(19));
- var _atRule = _interopRequireDefault(__webpack_require__(20));
- var _vendor = _interopRequireDefault(__webpack_require__(94));
- var _parse = _interopRequireDefault(__webpack_require__(18));
- var _list = _interopRequireDefault(__webpack_require__(43));
- var _rule = _interopRequireDefault(__webpack_require__(22));
- var _root = _interopRequireDefault(__webpack_require__(44));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function postcss() {
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
- plugins[_key] = arguments[_key];
- }
- if (plugins.length === 1 && Array.isArray(plugins[0])) {
- plugins = plugins[0];
- }
- return new _processor.default(plugins);
- }
- postcss.plugin = function plugin(name, initializer) {
- function creator() {
- var transformer = initializer.apply(void 0, arguments);
- transformer.postcssPlugin = name;
- transformer.postcssVersion = new _processor.default().version;
- return transformer;
- }
- var cache;
- Object.defineProperty(creator, 'postcss', {
- get: function get() {
- if (!cache) cache = creator();
- return cache;
- }
- });
- creator.process = function (css, processOpts, pluginOpts) {
- return postcss([creator(pluginOpts)]).process(css, processOpts);
- };
- return creator;
- };
- postcss.stringify = _stringify.default;
- postcss.parse = _parse.default;
- postcss.vendor = _vendor.default;
- postcss.list = _list.default;
- postcss.comment = function (defaults) {
- return new _comment.default(defaults);
- };
- postcss.atRule = function (defaults) {
- return new _atRule.default(defaults);
- };
- postcss.decl = function (defaults) {
- return new _declaration.default(defaults);
- };
- postcss.rule = function (defaults) {
- return new _rule.default(defaults);
- };
- postcss.root = function (defaults) {
- return new _root.default(defaults);
- };
- var _default = postcss;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports) {
- var x=String;
- var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};
- module.exports=create();
- module.exports.createColors = create;
- }),
- (function(module, exports) {
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- (function(Buffer) {
- exports.__esModule = true;
- exports.default = void 0;
- var _sourceMap = _interopRequireDefault(__webpack_require__(39));
- var _path = _interopRequireDefault(__webpack_require__(3));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- var MapGenerator = function () {
- function MapGenerator(stringify, root, opts) {
- this.stringify = stringify;
- this.mapOpts = opts.map || {};
- this.root = root;
- this.opts = opts;
- }
- var _proto = MapGenerator.prototype;
- _proto.isMap = function isMap() {
- if (typeof this.opts.map !== 'undefined') {
- return !!this.opts.map;
- }
- return this.previous().length > 0;
- };
- _proto.previous = function previous() {
- var _this = this;
- if (!this.previousMaps) {
- this.previousMaps = [];
- this.root.walk(function (node) {
- if (node.source && node.source.input.map) {
- var map = node.source.input.map;
- if (_this.previousMaps.indexOf(map) === -1) {
- _this.previousMaps.push(map);
- }
- }
- });
- }
- return this.previousMaps;
- };
- _proto.isInline = function isInline() {
- if (typeof this.mapOpts.inline !== 'undefined') {
- return this.mapOpts.inline;
- }
- var annotation = this.mapOpts.annotation;
- if (typeof annotation !== 'undefined' && annotation !== true) {
- return false;
- }
- if (this.previous().length) {
- return this.previous().some(function (i) {
- return i.inline;
- });
- }
- return true;
- };
- _proto.isSourcesContent = function isSourcesContent() {
- if (typeof this.mapOpts.sourcesContent !== 'undefined') {
- return this.mapOpts.sourcesContent;
- }
- if (this.previous().length) {
- return this.previous().some(function (i) {
- return i.withContent();
- });
- }
- return true;
- };
- _proto.clearAnnotation = function clearAnnotation() {
- if (this.mapOpts.annotation === false) return;
- var node;
- for (var i = this.root.nodes.length - 1; i >= 0; i--) {
- node = this.root.nodes[i];
- if (node.type !== 'comment') continue;
- if (node.text.indexOf('# sourceMappingURL=') === 0) {
- this.root.removeChild(i);
- }
- }
- };
- _proto.setSourcesContent = function setSourcesContent() {
- var _this2 = this;
- var already = {};
- this.root.walk(function (node) {
- if (node.source) {
- var from = node.source.input.from;
- if (from && !already[from]) {
- already[from] = true;
- var relative = _this2.relative(from);
- _this2.map.setSourceContent(relative, node.source.input.css);
- }
- }
- });
- };
- _proto.applyPrevMaps = function applyPrevMaps() {
- for (var _iterator = _createForOfIteratorHelperLoose(this.previous()), _step; !(_step = _iterator()).done;) {
- var prev = _step.value;
- var from = this.relative(prev.file);
- var root = prev.root || _path.default.dirname(prev.file);
- var map = void 0;
- if (this.mapOpts.sourcesContent === false) {
- map = new _sourceMap.default.SourceMapConsumer(prev.text);
- if (map.sourcesContent) {
- map.sourcesContent = map.sourcesContent.map(function () {
- return null;
- });
- }
- } else {
- map = prev.consumer();
- }
- this.map.applySourceMap(map, from, this.relative(root));
- }
- };
- _proto.isAnnotation = function isAnnotation() {
- if (this.isInline()) {
- return true;
- }
- if (typeof this.mapOpts.annotation !== 'undefined') {
- return this.mapOpts.annotation;
- }
- if (this.previous().length) {
- return this.previous().some(function (i) {
- return i.annotation;
- });
- }
- return true;
- };
- _proto.toBase64 = function toBase64(str) {
- if (Buffer) {
- return Buffer.from(str).toString('base64');
- }
- return window.btoa(unescape(encodeURIComponent(str)));
- };
- _proto.addAnnotation = function addAnnotation() {
- var content;
- if (this.isInline()) {
- content = 'data:application/json;base64,' + this.toBase64(this.map.toString());
- } else if (typeof this.mapOpts.annotation === 'string') {
- content = this.mapOpts.annotation;
- } else {
- content = this.outputFile() + '.map';
- }
- var eol = '\n';
- if (this.css.indexOf('\r\n') !== -1) eol = '\r\n';
- this.css += eol + '/*# sourceMappingURL=' + content + ' */';
- };
- _proto.outputFile = function outputFile() {
- if (this.opts.to) {
- return this.relative(this.opts.to);
- }
- if (this.opts.from) {
- return this.relative(this.opts.from);
- }
- return 'to.css';
- };
- _proto.generateMap = function generateMap() {
- this.generateString();
- if (this.isSourcesContent()) this.setSourcesContent();
- if (this.previous().length > 0) this.applyPrevMaps();
- if (this.isAnnotation()) this.addAnnotation();
- if (this.isInline()) {
- return [this.css];
- }
- return [this.css, this.map];
- };
- _proto.relative = function relative(file) {
- if (file.indexOf('<') === 0) return file;
- if (/^\w+:\/\//.test(file)) return file;
- var from = this.opts.to ? _path.default.dirname(this.opts.to) : '.';
- if (typeof this.mapOpts.annotation === 'string') {
- from = _path.default.dirname(_path.default.resolve(from, this.mapOpts.annotation));
- }
- file = _path.default.relative(from, file);
- if (_path.default.sep === '\\') {
- return file.replace(/\\/g, '/');
- }
- return file;
- };
- _proto.sourcePath = function sourcePath(node) {
- if (this.mapOpts.from) {
- return this.mapOpts.from;
- }
- return this.relative(node.source.input.from);
- };
- _proto.generateString = function generateString() {
- var _this3 = this;
- this.css = '';
- this.map = new _sourceMap.default.SourceMapGenerator({
- file: this.outputFile()
- });
- var line = 1;
- var column = 1;
- var lines, last;
- this.stringify(this.root, function (str, node, type) {
- _this3.css += str;
- if (node && type !== 'end') {
- if (node.source && node.source.start) {
- _this3.map.addMapping({
- source: _this3.sourcePath(node),
- generated: {
- line: line,
- column: column - 1
- },
- original: {
- line: node.source.start.line,
- column: node.source.start.column - 1
- }
- });
- } else {
- _this3.map.addMapping({
- source: '<no source>',
- original: {
- line: 1,
- column: 0
- },
- generated: {
- line: line,
- column: column - 1
- }
- });
- }
- }
- lines = str.match(/\n/g);
- if (lines) {
- line += lines.length;
- last = str.lastIndexOf('\n');
- column = str.length - last;
- } else {
- column += str.length;
- }
- if (node && type !== 'start') {
- var p = node.parent || {
- raws: {}
- };
- if (node.type !== 'decl' || node !== p.last || p.raws.semicolon) {
- if (node.source && node.source.end) {
- _this3.map.addMapping({
- source: _this3.sourcePath(node),
- generated: {
- line: line,
- column: column - 2
- },
- original: {
- line: node.source.end.line,
- column: node.source.end.column - 1
- }
- });
- } else {
- _this3.map.addMapping({
- source: '<no source>',
- original: {
- line: 1,
- column: 0
- },
- generated: {
- line: line,
- column: column - 1
- }
- });
- }
- }
- }
- });
- };
- _proto.generate = function generate() {
- this.clearAnnotation();
- if (this.isMap()) {
- return this.generateMap();
- }
- var result = '';
- this.stringify(this.root, function (i) {
- result += i;
- });
- return [result];
- };
- return MapGenerator;
- }();
- var _default = MapGenerator;
- exports.default = _default;
- module.exports = exports.default;
- }.call(this, __webpack_require__(38).Buffer))
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.byteLength = byteLength
- exports.toByteArray = toByteArray
- exports.fromByteArray = fromByteArray
- var lookup = []
- var revLookup = []
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
- }
- revLookup['-'.charCodeAt(0)] = 62
- revLookup['_'.charCodeAt(0)] = 63
- function getLens (b64) {
- var len = b64.length
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
-
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
- return [validLen, placeHoldersLen]
- }
- function byteLength (b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
- function _byteLength (b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
- function toByteArray (b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
- var curByte = 0
-
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
- var i
- for (i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
- return arr
- }
- function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
- }
- function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
- }
- function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3
- var parts = []
- var maxChunkLength = 16383
-
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
- }
-
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
- return parts.join('')
- }
- }),
- (function(module, exports) {
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
- i += d
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
- }
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
- value = Math.abs(value)
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = ((value * c) - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
- buffer[offset + i - d] |= s * 128
- }
- }),
- (function(module, exports) {
- var toString = {}.toString;
- module.exports = Array.isArray || function (arr) {
- return toString.call(arr) == '[object Array]';
- };
- }),
- (function(module, exports) {
- var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
- exports.encode = function (number) {
- if (0 <= number && number < intToCharMap.length) {
- return intToCharMap[number];
- }
- throw new TypeError("Must be between 0 and 63: " + number);
- };
- exports.decode = function (charCode) {
- var bigA = 65;
- var bigZ = 90;
- var littleA = 97;
- var littleZ = 122;
- var zero = 48;
- var nine = 57;
- var plus = 43;
- var slash = 47;
- var littleOffset = 26;
- var numberOffset = 52;
-
- if (bigA <= charCode && charCode <= bigZ) {
- return (charCode - bigA);
- }
-
- if (littleA <= charCode && charCode <= littleZ) {
- return (charCode - littleA + littleOffset);
- }
-
- if (zero <= charCode && charCode <= nine) {
- return (charCode - zero + numberOffset);
- }
-
- if (charCode == plus) {
- return 62;
- }
-
- if (charCode == slash) {
- return 63;
- }
-
- return -1;
- };
- }),
- (function(module, exports, __webpack_require__) {
- var util = __webpack_require__(8);
- function generatedPositionAfter(mappingA, mappingB) {
-
- var lineA = mappingA.generatedLine;
- var lineB = mappingB.generatedLine;
- var columnA = mappingA.generatedColumn;
- var columnB = mappingB.generatedColumn;
- return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
- }
- function MappingList() {
- this._array = [];
- this._sorted = true;
-
- this._last = {generatedLine: -1, generatedColumn: 0};
- }
- MappingList.prototype.unsortedForEach =
- function MappingList_forEach(aCallback, aThisArg) {
- this._array.forEach(aCallback, aThisArg);
- };
- MappingList.prototype.add = function MappingList_add(aMapping) {
- if (generatedPositionAfter(this._last, aMapping)) {
- this._last = aMapping;
- this._array.push(aMapping);
- } else {
- this._sorted = false;
- this._array.push(aMapping);
- }
- };
- MappingList.prototype.toArray = function MappingList_toArray() {
- if (!this._sorted) {
- this._array.sort(util.compareByGeneratedPositionsInflated);
- this._sorted = true;
- }
- return this._array;
- };
- exports.MappingList = MappingList;
- }),
- (function(module, exports, __webpack_require__) {
- var util = __webpack_require__(8);
- var binarySearch = __webpack_require__(83);
- var ArraySet = __webpack_require__(42).ArraySet;
- var base64VLQ = __webpack_require__(41);
- var quickSort = __webpack_require__(84).quickSort;
- function SourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util.parseSourceMapInput(aSourceMap);
- }
- return sourceMap.sections != null
- ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
- : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
- }
- SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
- }
- SourceMapConsumer.prototype._version = 3;
- SourceMapConsumer.prototype.__generatedMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
- configurable: true,
- enumerable: true,
- get: function () {
- if (!this.__generatedMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__generatedMappings;
- }
- });
- SourceMapConsumer.prototype.__originalMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
- configurable: true,
- enumerable: true,
- get: function () {
- if (!this.__originalMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__originalMappings;
- }
- });
- SourceMapConsumer.prototype._charIsMappingSeparator =
- function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
- var c = aStr.charAt(index);
- return c === ";" || c === ",";
- };
- SourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- throw new Error("Subclasses must implement _parseMappings");
- };
- SourceMapConsumer.GENERATED_ORDER = 1;
- SourceMapConsumer.ORIGINAL_ORDER = 2;
- SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
- SourceMapConsumer.LEAST_UPPER_BOUND = 2;
- SourceMapConsumer.prototype.eachMapping =
- function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
- var context = aContext || null;
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
- var mappings;
- switch (order) {
- case SourceMapConsumer.GENERATED_ORDER:
- mappings = this._generatedMappings;
- break;
- case SourceMapConsumer.ORIGINAL_ORDER:
- mappings = this._originalMappings;
- break;
- default:
- throw new Error("Unknown order of iteration.");
- }
- var sourceRoot = this.sourceRoot;
- mappings.map(function (mapping) {
- var source = mapping.source === null ? null : this._sources.at(mapping.source);
- source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
- return {
- source: source,
- generatedLine: mapping.generatedLine,
- generatedColumn: mapping.generatedColumn,
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: mapping.name === null ? null : this._names.at(mapping.name)
- };
- }, this).forEach(aCallback, context);
- };
- SourceMapConsumer.prototype.allGeneratedPositionsFor =
- function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
- var line = util.getArg(aArgs, 'line');
-
-
-
-
- var needle = {
- source: util.getArg(aArgs, 'source'),
- originalLine: line,
- originalColumn: util.getArg(aArgs, 'column', 0)
- };
- needle.source = this._findSourceIndex(needle.source);
- if (needle.source < 0) {
- return [];
- }
- var mappings = [];
- var index = this._findMapping(needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions,
- binarySearch.LEAST_UPPER_BOUND);
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (aArgs.column === undefined) {
- var originalLine = mapping.originalLine;
-
-
-
-
- while (mapping && mapping.originalLine === originalLine) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- } else {
- var originalColumn = mapping.originalColumn;
-
-
-
-
- while (mapping &&
- mapping.originalLine === line &&
- mapping.originalColumn == originalColumn) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- }
- }
- return mappings;
- };
- exports.SourceMapConsumer = SourceMapConsumer;
- function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util.parseSourceMapInput(aSourceMap);
- }
- var version = util.getArg(sourceMap, 'version');
- var sources = util.getArg(sourceMap, 'sources');
-
-
- var names = util.getArg(sourceMap, 'names', []);
- var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
- var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
- var mappings = util.getArg(sourceMap, 'mappings');
- var file = util.getArg(sourceMap, 'file', null);
-
-
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- if (sourceRoot) {
- sourceRoot = util.normalize(sourceRoot);
- }
- sources = sources
- .map(String)
-
-
-
- .map(util.normalize)
-
-
-
-
- .map(function (source) {
- return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
- ? util.relative(sourceRoot, source)
- : source;
- });
-
-
-
-
- this._names = ArraySet.fromArray(names.map(String), true);
- this._sources = ArraySet.fromArray(sources, true);
- this._absoluteSources = this._sources.toArray().map(function (s) {
- return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
- });
- this.sourceRoot = sourceRoot;
- this.sourcesContent = sourcesContent;
- this._mappings = mappings;
- this._sourceMapURL = aSourceMapURL;
- this.file = file;
- }
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
- BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
- var relativeSource = aSource;
- if (this.sourceRoot != null) {
- relativeSource = util.relative(this.sourceRoot, relativeSource);
- }
- if (this._sources.has(relativeSource)) {
- return this._sources.indexOf(relativeSource);
- }
-
-
- var i;
- for (i = 0; i < this._absoluteSources.length; ++i) {
- if (this._absoluteSources[i] == aSource) {
- return i;
- }
- }
- return -1;
- };
- BasicSourceMapConsumer.fromSourceMap =
- function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
- var smc = Object.create(BasicSourceMapConsumer.prototype);
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
- smc.sourceRoot = aSourceMap._sourceRoot;
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
- smc.sourceRoot);
- smc.file = aSourceMap._file;
- smc._sourceMapURL = aSourceMapURL;
- smc._absoluteSources = smc._sources.toArray().map(function (s) {
- return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
- });
-
-
-
-
- var generatedMappings = aSourceMap._mappings.toArray().slice();
- var destGeneratedMappings = smc.__generatedMappings = [];
- var destOriginalMappings = smc.__originalMappings = [];
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
- var srcMapping = generatedMappings[i];
- var destMapping = new Mapping;
- destMapping.generatedLine = srcMapping.generatedLine;
- destMapping.generatedColumn = srcMapping.generatedColumn;
- if (srcMapping.source) {
- destMapping.source = sources.indexOf(srcMapping.source);
- destMapping.originalLine = srcMapping.originalLine;
- destMapping.originalColumn = srcMapping.originalColumn;
- if (srcMapping.name) {
- destMapping.name = names.indexOf(srcMapping.name);
- }
- destOriginalMappings.push(destMapping);
- }
- destGeneratedMappings.push(destMapping);
- }
- quickSort(smc.__originalMappings, util.compareByOriginalPositions);
- return smc;
- };
- BasicSourceMapConsumer.prototype._version = 3;
- Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
- get: function () {
- return this._absoluteSources.slice();
- }
- });
- function Mapping() {
- this.generatedLine = 0;
- this.generatedColumn = 0;
- this.source = null;
- this.originalLine = null;
- this.originalColumn = null;
- this.name = null;
- }
- BasicSourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- var generatedLine = 1;
- var previousGeneratedColumn = 0;
- var previousOriginalLine = 0;
- var previousOriginalColumn = 0;
- var previousSource = 0;
- var previousName = 0;
- var length = aStr.length;
- var index = 0;
- var cachedSegments = {};
- var temp = {};
- var originalMappings = [];
- var generatedMappings = [];
- var mapping, str, segment, end, value;
- while (index < length) {
- if (aStr.charAt(index) === ';') {
- generatedLine++;
- index++;
- previousGeneratedColumn = 0;
- }
- else if (aStr.charAt(index) === ',') {
- index++;
- }
- else {
- mapping = new Mapping();
- mapping.generatedLine = generatedLine;
-
-
-
-
-
- for (end = index; end < length; end++) {
- if (this._charIsMappingSeparator(aStr, end)) {
- break;
- }
- }
- str = aStr.slice(index, end);
- segment = cachedSegments[str];
- if (segment) {
- index += str.length;
- } else {
- segment = [];
- while (index < end) {
- base64VLQ.decode(aStr, index, temp);
- value = temp.value;
- index = temp.rest;
- segment.push(value);
- }
- if (segment.length === 2) {
- throw new Error('Found a source, but no line and column');
- }
- if (segment.length === 3) {
- throw new Error('Found a source and line, but no column');
- }
- cachedSegments[str] = segment;
- }
-
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
- previousGeneratedColumn = mapping.generatedColumn;
- if (segment.length > 1) {
-
- mapping.source = previousSource + segment[1];
- previousSource += segment[1];
-
- mapping.originalLine = previousOriginalLine + segment[2];
- previousOriginalLine = mapping.originalLine;
-
- mapping.originalLine += 1;
-
- mapping.originalColumn = previousOriginalColumn + segment[3];
- previousOriginalColumn = mapping.originalColumn;
- if (segment.length > 4) {
-
- mapping.name = previousName + segment[4];
- previousName += segment[4];
- }
- }
- generatedMappings.push(mapping);
- if (typeof mapping.originalLine === 'number') {
- originalMappings.push(mapping);
- }
- }
- }
- quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
- this.__generatedMappings = generatedMappings;
- quickSort(originalMappings, util.compareByOriginalPositions);
- this.__originalMappings = originalMappings;
- };
- BasicSourceMapConsumer.prototype._findMapping =
- function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
- aColumnName, aComparator, aBias) {
-
-
-
-
- if (aNeedle[aLineName] <= 0) {
- throw new TypeError('Line must be greater than or equal to 1, got '
- + aNeedle[aLineName]);
- }
- if (aNeedle[aColumnName] < 0) {
- throw new TypeError('Column must be greater than or equal to 0, got '
- + aNeedle[aColumnName]);
- }
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
- };
- BasicSourceMapConsumer.prototype.computeColumnSpans =
- function SourceMapConsumer_computeColumnSpans() {
- for (var index = 0; index < this._generatedMappings.length; ++index) {
- var mapping = this._generatedMappings[index];
-
-
-
-
- if (index + 1 < this._generatedMappings.length) {
- var nextMapping = this._generatedMappings[index + 1];
- if (mapping.generatedLine === nextMapping.generatedLine) {
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
- continue;
- }
- }
-
- mapping.lastGeneratedColumn = Infinity;
- }
- };
- BasicSourceMapConsumer.prototype.originalPositionFor =
- function SourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
- var index = this._findMapping(
- needle,
- this._generatedMappings,
- "generatedLine",
- "generatedColumn",
- util.compareByGeneratedPositionsDeflated,
- util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
- );
- if (index >= 0) {
- var mapping = this._generatedMappings[index];
- if (mapping.generatedLine === needle.generatedLine) {
- var source = util.getArg(mapping, 'source', null);
- if (source !== null) {
- source = this._sources.at(source);
- source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
- }
- var name = util.getArg(mapping, 'name', null);
- if (name !== null) {
- name = this._names.at(name);
- }
- return {
- source: source,
- line: util.getArg(mapping, 'originalLine', null),
- column: util.getArg(mapping, 'originalColumn', null),
- name: name
- };
- }
- }
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- };
- BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
- function BasicSourceMapConsumer_hasContentsOfAllSources() {
- if (!this.sourcesContent) {
- return false;
- }
- return this.sourcesContent.length >= this._sources.size() &&
- !this.sourcesContent.some(function (sc) { return sc == null; });
- };
- BasicSourceMapConsumer.prototype.sourceContentFor =
- function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- if (!this.sourcesContent) {
- return null;
- }
- var index = this._findSourceIndex(aSource);
- if (index >= 0) {
- return this.sourcesContent[index];
- }
- var relativeSource = aSource;
- if (this.sourceRoot != null) {
- relativeSource = util.relative(this.sourceRoot, relativeSource);
- }
- var url;
- if (this.sourceRoot != null
- && (url = util.urlParse(this.sourceRoot))) {
-
-
-
-
- var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
- if (url.scheme == "file"
- && this._sources.has(fileUriAbsPath)) {
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
- }
- if ((!url.path || url.path == "/")
- && this._sources.has("/" + relativeSource)) {
- return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
- }
- }
-
-
-
-
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + relativeSource + '" is not in the SourceMap.');
- }
- };
- BasicSourceMapConsumer.prototype.generatedPositionFor =
- function SourceMapConsumer_generatedPositionFor(aArgs) {
- var source = util.getArg(aArgs, 'source');
- source = this._findSourceIndex(source);
- if (source < 0) {
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- }
- var needle = {
- source: source,
- originalLine: util.getArg(aArgs, 'line'),
- originalColumn: util.getArg(aArgs, 'column')
- };
- var index = this._findMapping(
- needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions,
- util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
- );
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (mapping.source === needle.source) {
- return {
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- };
- }
- }
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- };
- exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
- function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util.parseSourceMapInput(aSourceMap);
- }
- var version = util.getArg(sourceMap, 'version');
- var sections = util.getArg(sourceMap, 'sections');
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- this._sources = new ArraySet();
- this._names = new ArraySet();
- var lastOffset = {
- line: -1,
- column: 0
- };
- this._sections = sections.map(function (s) {
- if (s.url) {
-
-
- throw new Error('Support for url field in sections not implemented.');
- }
- var offset = util.getArg(s, 'offset');
- var offsetLine = util.getArg(offset, 'line');
- var offsetColumn = util.getArg(offset, 'column');
- if (offsetLine < lastOffset.line ||
- (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
- throw new Error('Section offsets must be ordered and non-overlapping.');
- }
- lastOffset = offset;
- return {
- generatedOffset: {
-
-
- generatedLine: offsetLine + 1,
- generatedColumn: offsetColumn + 1
- },
- consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
- }
- });
- }
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
- IndexedSourceMapConsumer.prototype._version = 3;
- Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
- get: function () {
- var sources = [];
- for (var i = 0; i < this._sections.length; i++) {
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
- sources.push(this._sections[i].consumer.sources[j]);
- }
- }
- return sources;
- }
- });
- IndexedSourceMapConsumer.prototype.originalPositionFor =
- function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
-
-
- var sectionIndex = binarySearch.search(needle, this._sections,
- function(needle, section) {
- var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
- if (cmp) {
- return cmp;
- }
- return (needle.generatedColumn -
- section.generatedOffset.generatedColumn);
- });
- var section = this._sections[sectionIndex];
- if (!section) {
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- }
- return section.consumer.originalPositionFor({
- line: needle.generatedLine -
- (section.generatedOffset.generatedLine - 1),
- column: needle.generatedColumn -
- (section.generatedOffset.generatedLine === needle.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- bias: aArgs.bias
- });
- };
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
- function IndexedSourceMapConsumer_hasContentsOfAllSources() {
- return this._sections.every(function (s) {
- return s.consumer.hasContentsOfAllSources();
- });
- };
- IndexedSourceMapConsumer.prototype.sourceContentFor =
- function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var content = section.consumer.sourceContentFor(aSource, true);
- if (content) {
- return content;
- }
- }
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- }
- };
- IndexedSourceMapConsumer.prototype.generatedPositionFor =
- function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
-
-
- if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
- continue;
- }
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
- if (generatedPosition) {
- var ret = {
- line: generatedPosition.line +
- (section.generatedOffset.generatedLine - 1),
- column: generatedPosition.column +
- (section.generatedOffset.generatedLine === generatedPosition.line
- ? section.generatedOffset.generatedColumn - 1
- : 0)
- };
- return ret;
- }
- }
- return {
- line: null,
- column: null
- };
- };
- IndexedSourceMapConsumer.prototype._parseMappings =
- function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- this.__generatedMappings = [];
- this.__originalMappings = [];
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var sectionMappings = section.consumer._generatedMappings;
- for (var j = 0; j < sectionMappings.length; j++) {
- var mapping = sectionMappings[j];
- var source = section.consumer._sources.at(mapping.source);
- source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
- this._sources.add(source);
- source = this._sources.indexOf(source);
- var name = null;
- if (mapping.name) {
- name = section.consumer._names.at(mapping.name);
- this._names.add(name);
- name = this._names.indexOf(name);
- }
-
-
-
-
- var adjustedMapping = {
- source: source,
- generatedLine: mapping.generatedLine +
- (section.generatedOffset.generatedLine - 1),
- generatedColumn: mapping.generatedColumn +
- (section.generatedOffset.generatedLine === mapping.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: name
- };
- this.__generatedMappings.push(adjustedMapping);
- if (typeof adjustedMapping.originalLine === 'number') {
- this.__originalMappings.push(adjustedMapping);
- }
- }
- }
- quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
- quickSort(this.__originalMappings, util.compareByOriginalPositions);
- };
- exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
- }),
- (function(module, exports) {
- exports.GREATEST_LOWER_BOUND = 1;
- exports.LEAST_UPPER_BOUND = 2;
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
-
-
-
-
-
-
-
-
-
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
- if (cmp === 0) {
-
- return mid;
- }
- else if (cmp > 0) {
-
- if (aHigh - mid > 1) {
-
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
- }
-
-
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return aHigh < aHaystack.length ? aHigh : -1;
- } else {
- return mid;
- }
- }
- else {
-
- if (mid - aLow > 1) {
-
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
- }
-
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return mid;
- } else {
- return aLow < 0 ? -1 : aLow;
- }
- }
- }
- exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
- if (aHaystack.length === 0) {
- return -1;
- }
- var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
- aCompare, aBias || exports.GREATEST_LOWER_BOUND);
- if (index < 0) {
- return -1;
- }
-
-
-
- while (index - 1 >= 0) {
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
- break;
- }
- --index;
- }
- return index;
- };
- }),
- (function(module, exports) {
- function swap(ary, x, y) {
- var temp = ary[x];
- ary[x] = ary[y];
- ary[y] = temp;
- }
- function randomIntInRange(low, high) {
- return Math.round(low + (Math.random() * (high - low)));
- }
- function doQuickSort(ary, comparator, p, r) {
-
-
-
- if (p < r) {
-
-
-
-
-
-
-
-
-
-
- var pivotIndex = randomIntInRange(p, r);
- var i = p - 1;
- swap(ary, pivotIndex, r);
- var pivot = ary[r];
-
-
-
-
-
-
- for (var j = p; j < r; j++) {
- if (comparator(ary[j], pivot) <= 0) {
- i += 1;
- swap(ary, i, j);
- }
- }
- swap(ary, i + 1, j);
- var q = i + 1;
-
- doQuickSort(ary, comparator, p, q - 1);
- doQuickSort(ary, comparator, q + 1, r);
- }
- }
- exports.quickSort = function (ary, comparator) {
- doQuickSort(ary, comparator, 0, ary.length - 1);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var SourceMapGenerator = __webpack_require__(40).SourceMapGenerator;
- var util = __webpack_require__(8);
- var REGEX_NEWLINE = /(\r?\n)/;
- var NEWLINE_CODE = 10;
- var isSourceNode = "$$$isSourceNode$$$";
- function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
- this.children = [];
- this.sourceContents = {};
- this.line = aLine == null ? null : aLine;
- this.column = aColumn == null ? null : aColumn;
- this.source = aSource == null ? null : aSource;
- this.name = aName == null ? null : aName;
- this[isSourceNode] = true;
- if (aChunks != null) this.add(aChunks);
- }
- SourceNode.fromStringWithSourceMap =
- function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
-
-
- var node = new SourceNode();
-
-
-
-
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
- var remainingLinesIndex = 0;
- var shiftNextLine = function() {
- var lineContents = getNextLine();
-
- var newLine = getNextLine() || "";
- return lineContents + newLine;
- function getNextLine() {
- return remainingLinesIndex < remainingLines.length ?
- remainingLines[remainingLinesIndex++] : undefined;
- }
- };
-
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
-
-
-
- var lastMapping = null;
- aSourceMapConsumer.eachMapping(function (mapping) {
- if (lastMapping !== null) {
-
-
- if (lastGeneratedLine < mapping.generatedLine) {
-
- addMappingWithCode(lastMapping, shiftNextLine());
- lastGeneratedLine++;
- lastGeneratedColumn = 0;
-
- } else {
-
-
-
- var nextLine = remainingLines[remainingLinesIndex] || '';
- var code = nextLine.substr(0, mapping.generatedColumn -
- lastGeneratedColumn);
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
- lastGeneratedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- addMappingWithCode(lastMapping, code);
-
- lastMapping = mapping;
- return;
- }
- }
-
-
-
- while (lastGeneratedLine < mapping.generatedLine) {
- node.add(shiftNextLine());
- lastGeneratedLine++;
- }
- if (lastGeneratedColumn < mapping.generatedColumn) {
- var nextLine = remainingLines[remainingLinesIndex] || '';
- node.add(nextLine.substr(0, mapping.generatedColumn));
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- }
- lastMapping = mapping;
- }, this);
-
- if (remainingLinesIndex < remainingLines.length) {
- if (lastMapping) {
-
- addMappingWithCode(lastMapping, shiftNextLine());
- }
-
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
- }
-
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aRelativePath != null) {
- sourceFile = util.join(aRelativePath, sourceFile);
- }
- node.setSourceContent(sourceFile, content);
- }
- });
- return node;
- function addMappingWithCode(mapping, code) {
- if (mapping === null || mapping.source === undefined) {
- node.add(code);
- } else {
- var source = aRelativePath
- ? util.join(aRelativePath, mapping.source)
- : mapping.source;
- node.add(new SourceNode(mapping.originalLine,
- mapping.originalColumn,
- source,
- code,
- mapping.name));
- }
- }
- };
- SourceNode.prototype.add = function SourceNode_add(aChunk) {
- if (Array.isArray(aChunk)) {
- aChunk.forEach(function (chunk) {
- this.add(chunk);
- }, this);
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- if (aChunk) {
- this.children.push(aChunk);
- }
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
- SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
- if (Array.isArray(aChunk)) {
- for (var i = aChunk.length-1; i >= 0; i--) {
- this.prepend(aChunk[i]);
- }
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- this.children.unshift(aChunk);
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
- SourceNode.prototype.walk = function SourceNode_walk(aFn) {
- var chunk;
- for (var i = 0, len = this.children.length; i < len; i++) {
- chunk = this.children[i];
- if (chunk[isSourceNode]) {
- chunk.walk(aFn);
- }
- else {
- if (chunk !== '') {
- aFn(chunk, { source: this.source,
- line: this.line,
- column: this.column,
- name: this.name });
- }
- }
- }
- };
- SourceNode.prototype.join = function SourceNode_join(aSep) {
- var newChildren;
- var i;
- var len = this.children.length;
- if (len > 0) {
- newChildren = [];
- for (i = 0; i < len-1; i++) {
- newChildren.push(this.children[i]);
- newChildren.push(aSep);
- }
- newChildren.push(this.children[i]);
- this.children = newChildren;
- }
- return this;
- };
- SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
- var lastChild = this.children[this.children.length - 1];
- if (lastChild[isSourceNode]) {
- lastChild.replaceRight(aPattern, aReplacement);
- }
- else if (typeof lastChild === 'string') {
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
- }
- else {
- this.children.push(''.replace(aPattern, aReplacement));
- }
- return this;
- };
- SourceNode.prototype.setSourceContent =
- function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
- };
- SourceNode.prototype.walkSourceContents =
- function SourceNode_walkSourceContents(aFn) {
- for (var i = 0, len = this.children.length; i < len; i++) {
- if (this.children[i][isSourceNode]) {
- this.children[i].walkSourceContents(aFn);
- }
- }
- var sources = Object.keys(this.sourceContents);
- for (var i = 0, len = sources.length; i < len; i++) {
- aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
- }
- };
- SourceNode.prototype.toString = function SourceNode_toString() {
- var str = "";
- this.walk(function (chunk) {
- str += chunk;
- });
- return str;
- };
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
- var generated = {
- code: "",
- line: 1,
- column: 0
- };
- var map = new SourceMapGenerator(aArgs);
- var sourceMappingActive = false;
- var lastOriginalSource = null;
- var lastOriginalLine = null;
- var lastOriginalColumn = null;
- var lastOriginalName = null;
- this.walk(function (chunk, original) {
- generated.code += chunk;
- if (original.source !== null
- && original.line !== null
- && original.column !== null) {
- if(lastOriginalSource !== original.source
- || lastOriginalLine !== original.line
- || lastOriginalColumn !== original.column
- || lastOriginalName !== original.name) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- lastOriginalSource = original.source;
- lastOriginalLine = original.line;
- lastOriginalColumn = original.column;
- lastOriginalName = original.name;
- sourceMappingActive = true;
- } else if (sourceMappingActive) {
- map.addMapping({
- generated: {
- line: generated.line,
- column: generated.column
- }
- });
- lastOriginalSource = null;
- sourceMappingActive = false;
- }
- for (var idx = 0, length = chunk.length; idx < length; idx++) {
- if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
- generated.line++;
- generated.column = 0;
-
- if (idx + 1 === length) {
- lastOriginalSource = null;
- sourceMappingActive = false;
- } else if (sourceMappingActive) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- } else {
- generated.column++;
- }
- }
- });
- this.walkSourceContents(function (sourceFile, sourceContent) {
- map.setSourceContent(sourceFile, sourceContent);
- });
- return { code: generated.code, map: map };
- };
- exports.SourceNode = SourceNode;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = warnOnce;
- var printed = {};
- function warnOnce(message) {
- if (printed[message]) return;
- printed[message] = true;
- if (typeof console !== 'undefined' && console.warn) {
- console.warn(message);
- }
- }
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _warning = _interopRequireDefault(__webpack_require__(88));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- var Result = function () {
-
- function Result(processor, root, opts) {
-
- this.processor = processor;
-
- this.messages = [];
-
- this.root = root;
-
- this.opts = opts;
-
- this.css = undefined;
-
- this.map = undefined;
- }
-
- var _proto = Result.prototype;
- _proto.toString = function toString() {
- return this.css;
- }
-
- ;
- _proto.warn = function warn(text, opts) {
- if (opts === void 0) {
- opts = {};
- }
- if (!opts.plugin) {
- if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
- opts.plugin = this.lastPlugin.postcssPlugin;
- }
- }
- var warning = new _warning.default(text, opts);
- this.messages.push(warning);
- return warning;
- }
-
- ;
- _proto.warnings = function warnings() {
- return this.messages.filter(function (i) {
- return i.type === 'warning';
- });
- }
-
- ;
- _createClass(Result, [{
- key: "content",
- get: function get() {
- return this.css;
- }
- }]);
- return Result;
- }();
- var _default = Result;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var Warning = function () {
-
- function Warning(text, opts) {
- if (opts === void 0) {
- opts = {};
- }
-
- this.type = 'warning';
-
- this.text = text;
- if (opts.node && opts.node.source) {
- var pos = opts.node.positionBy(opts);
-
- this.line = pos.line;
-
- this.column = pos.column;
- }
- for (var opt in opts) {
- this[opt] = opts[opt];
- }
- }
-
- var _proto = Warning.prototype;
- _proto.toString = function toString() {
- if (this.node) {
- return this.node.error(this.text, {
- plugin: this.plugin,
- index: this.index,
- word: this.word
- }).message;
- }
- if (this.plugin) {
- return this.plugin + ': ' + this.text;
- }
- return this.text;
- }
-
-
- ;
- return Warning;
- }();
- var _default = Warning;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _declaration = _interopRequireDefault(__webpack_require__(15));
- var _tokenize = _interopRequireDefault(__webpack_require__(90));
- var _comment = _interopRequireDefault(__webpack_require__(19));
- var _atRule = _interopRequireDefault(__webpack_require__(20));
- var _root = _interopRequireDefault(__webpack_require__(44));
- var _rule = _interopRequireDefault(__webpack_require__(22));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var Parser = function () {
- function Parser(input) {
- this.input = input;
- this.root = new _root.default();
- this.current = this.root;
- this.spaces = '';
- this.semicolon = false;
- this.createTokenizer();
- this.root.source = {
- input: input,
- start: {
- line: 1,
- column: 1
- }
- };
- }
- var _proto = Parser.prototype;
- _proto.createTokenizer = function createTokenizer() {
- this.tokenizer = (0, _tokenize.default)(this.input);
- };
- _proto.parse = function parse() {
- var token;
- while (!this.tokenizer.endOfFile()) {
- token = this.tokenizer.nextToken();
- switch (token[0]) {
- case 'space':
- this.spaces += token[1];
- break;
- case ';':
- this.freeSemicolon(token);
- break;
- case '}':
- this.end(token);
- break;
- case 'comment':
- this.comment(token);
- break;
- case 'at-word':
- this.atrule(token);
- break;
- case '{':
- this.emptyRule(token);
- break;
- default:
- this.other(token);
- break;
- }
- }
- this.endFile();
- };
- _proto.comment = function comment(token) {
- var node = new _comment.default();
- this.init(node, token[2], token[3]);
- node.source.end = {
- line: token[4],
- column: token[5]
- };
- var text = token[1].slice(2, -2);
- if (/^\s*$/.test(text)) {
- node.text = '';
- node.raws.left = text;
- node.raws.right = '';
- } else {
- var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
- node.text = match[2];
- node.raws.left = match[1];
- node.raws.right = match[3];
- }
- };
- _proto.emptyRule = function emptyRule(token) {
- var node = new _rule.default();
- this.init(node, token[2], token[3]);
- node.selector = '';
- node.raws.between = '';
- this.current = node;
- };
- _proto.other = function other(start) {
- var end = false;
- var type = null;
- var colon = false;
- var bracket = null;
- var brackets = [];
- var tokens = [];
- var token = start;
- while (token) {
- type = token[0];
- tokens.push(token);
- if (type === '(' || type === '[') {
- if (!bracket) bracket = token;
- brackets.push(type === '(' ? ')' : ']');
- } else if (brackets.length === 0) {
- if (type === ';') {
- if (colon) {
- this.decl(tokens);
- return;
- } else {
- break;
- }
- } else if (type === '{') {
- this.rule(tokens);
- return;
- } else if (type === '}') {
- this.tokenizer.back(tokens.pop());
- end = true;
- break;
- } else if (type === ':') {
- colon = true;
- }
- } else if (type === brackets[brackets.length - 1]) {
- brackets.pop();
- if (brackets.length === 0) bracket = null;
- }
- token = this.tokenizer.nextToken();
- }
- if (this.tokenizer.endOfFile()) end = true;
- if (brackets.length > 0) this.unclosedBracket(bracket);
- if (end && colon) {
- while (tokens.length) {
- token = tokens[tokens.length - 1][0];
- if (token !== 'space' && token !== 'comment') break;
- this.tokenizer.back(tokens.pop());
- }
- this.decl(tokens);
- } else {
- this.unknownWord(tokens);
- }
- };
- _proto.rule = function rule(tokens) {
- tokens.pop();
- var node = new _rule.default();
- this.init(node, tokens[0][2], tokens[0][3]);
- node.raws.between = this.spacesAndCommentsFromEnd(tokens);
- this.raw(node, 'selector', tokens);
- this.current = node;
- };
- _proto.decl = function decl(tokens) {
- var node = new _declaration.default();
- this.init(node);
- var last = tokens[tokens.length - 1];
- if (last[0] === ';') {
- this.semicolon = true;
- tokens.pop();
- }
- if (last[4]) {
- node.source.end = {
- line: last[4],
- column: last[5]
- };
- } else {
- node.source.end = {
- line: last[2],
- column: last[3]
- };
- }
- while (tokens[0][0] !== 'word') {
- if (tokens.length === 1) this.unknownWord(tokens);
- node.raws.before += tokens.shift()[1];
- }
- node.source.start = {
- line: tokens[0][2],
- column: tokens[0][3]
- };
- node.prop = '';
- while (tokens.length) {
- var type = tokens[0][0];
- if (type === ':' || type === 'space' || type === 'comment') {
- break;
- }
- node.prop += tokens.shift()[1];
- }
- node.raws.between = '';
- var token;
- while (tokens.length) {
- token = tokens.shift();
- if (token[0] === ':') {
- node.raws.between += token[1];
- break;
- } else {
- if (token[0] === 'word' && /\w/.test(token[1])) {
- this.unknownWord([token]);
- }
- node.raws.between += token[1];
- }
- }
- if (node.prop[0] === '_' || node.prop[0] === '*') {
- node.raws.before += node.prop[0];
- node.prop = node.prop.slice(1);
- }
- node.raws.between += this.spacesAndCommentsFromStart(tokens);
- this.precheckMissedSemicolon(tokens);
- for (var i = tokens.length - 1; i > 0; i--) {
- token = tokens[i];
- if (token[1].toLowerCase() === '!important') {
- node.important = true;
- var string = this.stringFrom(tokens, i);
- string = this.spacesFromEnd(tokens) + string;
- if (string !== ' !important') node.raws.important = string;
- break;
- } else if (token[1].toLowerCase() === 'important') {
- var cache = tokens.slice(0);
- var str = '';
- for (var j = i; j > 0; j--) {
- var _type = cache[j][0];
- if (str.trim().indexOf('!') === 0 && _type !== 'space') {
- break;
- }
- str = cache.pop()[1] + str;
- }
- if (str.trim().indexOf('!') === 0) {
- node.important = true;
- node.raws.important = str;
- tokens = cache;
- }
- }
- if (token[0] !== 'space' && token[0] !== 'comment') {
- break;
- }
- }
- this.raw(node, 'value', tokens);
- if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens);
- };
- _proto.atrule = function atrule(token) {
- var node = new _atRule.default();
- node.name = token[1].slice(1);
- if (node.name === '') {
- this.unnamedAtrule(node, token);
- }
- this.init(node, token[2], token[3]);
- var prev;
- var shift;
- var last = false;
- var open = false;
- var params = [];
- while (!this.tokenizer.endOfFile()) {
- token = this.tokenizer.nextToken();
- if (token[0] === ';') {
- node.source.end = {
- line: token[2],
- column: token[3]
- };
- this.semicolon = true;
- break;
- } else if (token[0] === '{') {
- open = true;
- break;
- } else if (token[0] === '}') {
- if (params.length > 0) {
- shift = params.length - 1;
- prev = params[shift];
- while (prev && prev[0] === 'space') {
- prev = params[--shift];
- }
- if (prev) {
- node.source.end = {
- line: prev[4],
- column: prev[5]
- };
- }
- }
- this.end(token);
- break;
- } else {
- params.push(token);
- }
- if (this.tokenizer.endOfFile()) {
- last = true;
- break;
- }
- }
- node.raws.between = this.spacesAndCommentsFromEnd(params);
- if (params.length) {
- node.raws.afterName = this.spacesAndCommentsFromStart(params);
- this.raw(node, 'params', params);
- if (last) {
- token = params[params.length - 1];
- node.source.end = {
- line: token[4],
- column: token[5]
- };
- this.spaces = node.raws.between;
- node.raws.between = '';
- }
- } else {
- node.raws.afterName = '';
- node.params = '';
- }
- if (open) {
- node.nodes = [];
- this.current = node;
- }
- };
- _proto.end = function end(token) {
- if (this.current.nodes && this.current.nodes.length) {
- this.current.raws.semicolon = this.semicolon;
- }
- this.semicolon = false;
- this.current.raws.after = (this.current.raws.after || '') + this.spaces;
- this.spaces = '';
- if (this.current.parent) {
- this.current.source.end = {
- line: token[2],
- column: token[3]
- };
- this.current = this.current.parent;
- } else {
- this.unexpectedClose(token);
- }
- };
- _proto.endFile = function endFile() {
- if (this.current.parent) this.unclosedBlock();
- if (this.current.nodes && this.current.nodes.length) {
- this.current.raws.semicolon = this.semicolon;
- }
- this.current.raws.after = (this.current.raws.after || '') + this.spaces;
- };
- _proto.freeSemicolon = function freeSemicolon(token) {
- this.spaces += token[1];
- if (this.current.nodes) {
- var prev = this.current.nodes[this.current.nodes.length - 1];
- if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
- prev.raws.ownSemicolon = this.spaces;
- this.spaces = '';
- }
- }
- }
- ;
- _proto.init = function init(node, line, column) {
- this.current.push(node);
- node.source = {
- start: {
- line: line,
- column: column
- },
- input: this.input
- };
- node.raws.before = this.spaces;
- this.spaces = '';
- if (node.type !== 'comment') this.semicolon = false;
- };
- _proto.raw = function raw(node, prop, tokens) {
- var token, type;
- var length = tokens.length;
- var value = '';
- var clean = true;
- var next, prev;
- var pattern = /^([.|#])?([\w])+/i;
- for (var i = 0; i < length; i += 1) {
- token = tokens[i];
- type = token[0];
- if (type === 'comment' && node.type === 'rule') {
- prev = tokens[i - 1];
- next = tokens[i + 1];
- if (prev[0] !== 'space' && next[0] !== 'space' && pattern.test(prev[1]) && pattern.test(next[1])) {
- value += token[1];
- } else {
- clean = false;
- }
- continue;
- }
- if (type === 'comment' || type === 'space' && i === length - 1) {
- clean = false;
- } else {
- value += token[1];
- }
- }
- if (!clean) {
- var raw = tokens.reduce(function (all, i) {
- return all + i[1];
- }, '');
- node.raws[prop] = {
- value: value,
- raw: raw
- };
- }
- node[prop] = value;
- };
- _proto.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) {
- var lastTokenType;
- var spaces = '';
- while (tokens.length) {
- lastTokenType = tokens[tokens.length - 1][0];
- if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
- spaces = tokens.pop()[1] + spaces;
- }
- return spaces;
- };
- _proto.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) {
- var next;
- var spaces = '';
- while (tokens.length) {
- next = tokens[0][0];
- if (next !== 'space' && next !== 'comment') break;
- spaces += tokens.shift()[1];
- }
- return spaces;
- };
- _proto.spacesFromEnd = function spacesFromEnd(tokens) {
- var lastTokenType;
- var spaces = '';
- while (tokens.length) {
- lastTokenType = tokens[tokens.length - 1][0];
- if (lastTokenType !== 'space') break;
- spaces = tokens.pop()[1] + spaces;
- }
- return spaces;
- };
- _proto.stringFrom = function stringFrom(tokens, from) {
- var result = '';
- for (var i = from; i < tokens.length; i++) {
- result += tokens[i][1];
- }
- tokens.splice(from, tokens.length - from);
- return result;
- };
- _proto.colon = function colon(tokens) {
- var brackets = 0;
- var token, type, prev;
- for (var i = 0; i < tokens.length; i++) {
- token = tokens[i];
- type = token[0];
- if (type === '(') {
- brackets += 1;
- }
- if (type === ')') {
- brackets -= 1;
- }
- if (brackets === 0 && type === ':') {
- if (!prev) {
- this.doubleColon(token);
- } else if (prev[0] === 'word' && prev[1] === 'progid') {
- continue;
- } else {
- return i;
- }
- }
- prev = token;
- }
- return false;
- }
- ;
- _proto.unclosedBracket = function unclosedBracket(bracket) {
- throw this.input.error('Unclosed bracket', bracket[2], bracket[3]);
- };
- _proto.unknownWord = function unknownWord(tokens) {
- throw this.input.error('Unknown word', tokens[0][2], tokens[0][3]);
- };
- _proto.unexpectedClose = function unexpectedClose(token) {
- throw this.input.error('Unexpected }', token[2], token[3]);
- };
- _proto.unclosedBlock = function unclosedBlock() {
- var pos = this.current.source.start;
- throw this.input.error('Unclosed block', pos.line, pos.column);
- };
- _proto.doubleColon = function doubleColon(token) {
- throw this.input.error('Double colon', token[2], token[3]);
- };
- _proto.unnamedAtrule = function unnamedAtrule(node, token) {
- throw this.input.error('At-rule without name', token[2], token[3]);
- };
- _proto.precheckMissedSemicolon = function precheckMissedSemicolon()
- /* tokens */
- {
- };
- _proto.checkMissedSemicolon = function checkMissedSemicolon(tokens) {
- var colon = this.colon(tokens);
- if (colon === false) return;
- var founded = 0;
- var token;
- for (var j = colon - 1; j >= 0; j--) {
- token = tokens[j];
- if (token[0] !== 'space') {
- founded += 1;
- if (founded === 2) break;
- }
- }
- throw this.input.error('Missed semicolon', token[2], token[3]);
- };
- return Parser;
- }();
- exports.default = Parser;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = tokenizer;
- var SINGLE_QUOTE = '\''.charCodeAt(0);
- var DOUBLE_QUOTE = '"'.charCodeAt(0);
- var BACKSLASH = '\\'.charCodeAt(0);
- var SLASH = '/'.charCodeAt(0);
- var NEWLINE = '\n'.charCodeAt(0);
- var SPACE = ' '.charCodeAt(0);
- var FEED = '\f'.charCodeAt(0);
- var TAB = '\t'.charCodeAt(0);
- var CR = '\r'.charCodeAt(0);
- var OPEN_SQUARE = '['.charCodeAt(0);
- var CLOSE_SQUARE = ']'.charCodeAt(0);
- var OPEN_PARENTHESES = '('.charCodeAt(0);
- var CLOSE_PARENTHESES = ')'.charCodeAt(0);
- var OPEN_CURLY = '{'.charCodeAt(0);
- var CLOSE_CURLY = '}'.charCodeAt(0);
- var SEMICOLON = ';'.charCodeAt(0);
- var ASTERISK = '*'.charCodeAt(0);
- var COLON = ':'.charCodeAt(0);
- var AT = '@'.charCodeAt(0);
- var RE_AT_END = /[ \n\t\r\f{}()'"\\;/[\]#]/g;
- var RE_WORD_END = /[ \n\t\r\f(){}:;@!'"\\\][#]|\/(?=\*)/g;
- var RE_BAD_BRACKET = /.[\\/("'\n]/;
- var RE_HEX_ESCAPE = /[a-f0-9]/i;
- function tokenizer(input, options) {
- if (options === void 0) {
- options = {};
- }
- var css = input.css.valueOf();
- var ignore = options.ignoreErrors;
- var code, next, quote, lines, last, content, escape;
- var nextLine, nextOffset, escaped, escapePos, prev, n, currentToken;
- var length = css.length;
- var offset = -1;
- var line = 1;
- var pos = 0;
- var buffer = [];
- var returned = [];
- function position() {
- return pos;
- }
- function unclosed(what) {
- throw input.error('Unclosed ' + what, line, pos - offset);
- }
- function endOfFile() {
- return returned.length === 0 && pos >= length;
- }
- function nextToken(opts) {
- if (returned.length) return returned.pop();
- if (pos >= length) return;
- var ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
- code = css.charCodeAt(pos);
- if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
- offset = pos;
- line += 1;
- }
- switch (code) {
- case NEWLINE:
- case SPACE:
- case TAB:
- case CR:
- case FEED:
- next = pos;
- do {
- next += 1;
- code = css.charCodeAt(next);
- if (code === NEWLINE) {
- offset = next;
- line += 1;
- }
- } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
- currentToken = ['space', css.slice(pos, next)];
- pos = next - 1;
- break;
- case OPEN_SQUARE:
- case CLOSE_SQUARE:
- case OPEN_CURLY:
- case CLOSE_CURLY:
- case COLON:
- case SEMICOLON:
- case CLOSE_PARENTHESES:
- var controlChar = String.fromCharCode(code);
- currentToken = [controlChar, controlChar, line, pos - offset];
- break;
- case OPEN_PARENTHESES:
- prev = buffer.length ? buffer.pop()[1] : '';
- n = css.charCodeAt(pos + 1);
- if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
- next = pos;
- do {
- escaped = false;
- next = css.indexOf(')', next + 1);
- if (next === -1) {
- if (ignore || ignoreUnclosed) {
- next = pos;
- break;
- } else {
- unclosed('bracket');
- }
- }
- escapePos = next;
- while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
- escapePos -= 1;
- escaped = !escaped;
- }
- } while (escaped);
- currentToken = ['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
- pos = next;
- } else {
- next = css.indexOf(')', pos + 1);
- content = css.slice(pos, next + 1);
- if (next === -1 || RE_BAD_BRACKET.test(content)) {
- currentToken = ['(', '(', line, pos - offset];
- } else {
- currentToken = ['brackets', content, line, pos - offset, line, next - offset];
- pos = next;
- }
- }
- break;
- case SINGLE_QUOTE:
- case DOUBLE_QUOTE:
- quote = code === SINGLE_QUOTE ? '\'' : '"';
- next = pos;
- do {
- escaped = false;
- next = css.indexOf(quote, next + 1);
- if (next === -1) {
- if (ignore || ignoreUnclosed) {
- next = pos + 1;
- break;
- } else {
- unclosed('string');
- }
- }
- escapePos = next;
- while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
- escapePos -= 1;
- escaped = !escaped;
- }
- } while (escaped);
- content = css.slice(pos, next + 1);
- lines = content.split('\n');
- last = lines.length - 1;
- if (last > 0) {
- nextLine = line + last;
- nextOffset = next - lines[last].length;
- } else {
- nextLine = line;
- nextOffset = offset;
- }
- currentToken = ['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset];
- offset = nextOffset;
- line = nextLine;
- pos = next;
- break;
- case AT:
- RE_AT_END.lastIndex = pos + 1;
- RE_AT_END.test(css);
- if (RE_AT_END.lastIndex === 0) {
- next = css.length - 1;
- } else {
- next = RE_AT_END.lastIndex - 2;
- }
- currentToken = ['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
- pos = next;
- break;
- case BACKSLASH:
- next = pos;
- escape = true;
- while (css.charCodeAt(next + 1) === BACKSLASH) {
- next += 1;
- escape = !escape;
- }
- code = css.charCodeAt(next + 1);
- if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
- next += 1;
- if (RE_HEX_ESCAPE.test(css.charAt(next))) {
- while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
- next += 1;
- }
- if (css.charCodeAt(next + 1) === SPACE) {
- next += 1;
- }
- }
- }
- currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
- pos = next;
- break;
- default:
- if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
- next = css.indexOf('*/', pos + 2) + 1;
- if (next === 0) {
- if (ignore || ignoreUnclosed) {
- next = css.length;
- } else {
- unclosed('comment');
- }
- }
- content = css.slice(pos, next + 1);
- lines = content.split('\n');
- last = lines.length - 1;
- if (last > 0) {
- nextLine = line + last;
- nextOffset = next - lines[last].length;
- } else {
- nextLine = line;
- nextOffset = offset;
- }
- currentToken = ['comment', content, line, pos - offset, nextLine, next - nextOffset];
- offset = nextOffset;
- line = nextLine;
- pos = next;
- } else {
- RE_WORD_END.lastIndex = pos + 1;
- RE_WORD_END.test(css);
- if (RE_WORD_END.lastIndex === 0) {
- next = css.length - 1;
- } else {
- next = RE_WORD_END.lastIndex - 2;
- }
- currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
- buffer.push(currentToken);
- pos = next;
- }
- break;
- }
- pos++;
- return currentToken;
- }
- function back(token) {
- returned.push(token);
- }
- return {
- back: back,
- nextToken: nextToken,
- endOfFile: endOfFile,
- position: position
- };
- }
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var _path = _interopRequireDefault(__webpack_require__(3));
- var _cssSyntaxError = _interopRequireDefault(__webpack_require__(34));
- var _previousMap = _interopRequireDefault(__webpack_require__(92));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- var sequence = 0;
- var Input = function () {
-
- function Input(css, opts) {
- if (opts === void 0) {
- opts = {};
- }
- if (css === null || typeof css === 'undefined' || typeof css === 'object' && !css.toString) {
- throw new Error("PostCSS received " + css + " instead of CSS string");
- }
-
- this.css = css.toString();
- if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") {
- this.hasBOM = true;
- this.css = this.css.slice(1);
- } else {
- this.hasBOM = false;
- }
- if (opts.from) {
- if (/^\w+:\/\//.test(opts.from) || _path.default.isAbsolute(opts.from)) {
-
- this.file = opts.from;
- } else {
- this.file = _path.default.resolve(opts.from);
- }
- }
- var map = new _previousMap.default(this.css, opts);
- if (map.text) {
-
- this.map = map;
- var file = map.consumer().file;
- if (!this.file && file) this.file = this.mapResolve(file);
- }
- if (!this.file) {
- sequence += 1;
-
- this.id = '<input css ' + sequence + '>';
- }
- if (this.map) this.map.file = this.from;
- }
- var _proto = Input.prototype;
- _proto.error = function error(message, line, column, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var result;
- var origin = this.origin(line, column);
- if (origin) {
- result = new _cssSyntaxError.default(message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
- } else {
- result = new _cssSyntaxError.default(message, line, column, this.css, this.file, opts.plugin);
- }
- result.input = {
- line: line,
- column: column,
- source: this.css
- };
- if (this.file) result.input.file = this.file;
- return result;
- }
-
- ;
- _proto.origin = function origin(line, column) {
- if (!this.map) return false;
- var consumer = this.map.consumer();
- var from = consumer.originalPositionFor({
- line: line,
- column: column
- });
- if (!from.source) return false;
- var result = {
- file: this.mapResolve(from.source),
- line: from.line,
- column: from.column
- };
- var source = consumer.sourceContentFor(from.source);
- if (source) result.source = source;
- return result;
- };
- _proto.mapResolve = function mapResolve(file) {
- if (/^\w+:\/\//.test(file)) {
- return file;
- }
- return _path.default.resolve(this.map.consumer().sourceRoot || '.', file);
- }
-
- ;
- _createClass(Input, [{
- key: "from",
- get: function get() {
- return this.file || this.id;
- }
- }]);
- return Input;
- }();
- var _default = Input;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- (function(Buffer) {
- exports.__esModule = true;
- exports.default = void 0;
- var _sourceMap = _interopRequireDefault(__webpack_require__(39));
- var _path = _interopRequireDefault(__webpack_require__(3));
- var _fs = _interopRequireDefault(__webpack_require__(93));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function fromBase64(str) {
- if (Buffer) {
- return Buffer.from(str, 'base64').toString();
- } else {
- return window.atob(str);
- }
- }
- var PreviousMap = function () {
-
- function PreviousMap(css, opts) {
- this.loadAnnotation(css);
-
- this.inline = this.startWith(this.annotation, 'data:');
- var prev = opts.map ? opts.map.prev : undefined;
- var text = this.loadMap(opts.from, prev);
- if (text) this.text = text;
- }
-
- var _proto = PreviousMap.prototype;
- _proto.consumer = function consumer() {
- if (!this.consumerCache) {
- this.consumerCache = new _sourceMap.default.SourceMapConsumer(this.text);
- }
- return this.consumerCache;
- }
-
- ;
- _proto.withContent = function withContent() {
- return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
- };
- _proto.startWith = function startWith(string, start) {
- if (!string) return false;
- return string.substr(0, start.length) === start;
- };
- _proto.getAnnotationURL = function getAnnotationURL(sourceMapString) {
- return sourceMapString.match(/\/\*\s*# sourceMappingURL=((?:(?!sourceMappingURL=).)*)\*\//)[1].trim();
- };
- _proto.loadAnnotation = function loadAnnotation(css) {
- var annotations = css.match(/\/\*\s*# sourceMappingURL=(?:(?!sourceMappingURL=).)*\*\//gm);
- if (annotations && annotations.length > 0) {
-
-
- var lastAnnotation = annotations[annotations.length - 1];
- if (lastAnnotation) {
- this.annotation = this.getAnnotationURL(lastAnnotation);
- }
- }
- };
- _proto.decodeInline = function decodeInline(text) {
- var baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/;
- var baseUri = /^data:application\/json;base64,/;
- var uri = 'data:application/json,';
- if (this.startWith(text, uri)) {
- return decodeURIComponent(text.substr(uri.length));
- }
- if (baseCharsetUri.test(text) || baseUri.test(text)) {
- return fromBase64(text.substr(RegExp.lastMatch.length));
- }
- var encoding = text.match(/data:application\/json;([^,]+),/)[1];
- throw new Error('Unsupported source map encoding ' + encoding);
- };
- _proto.loadMap = function loadMap(file, prev) {
- if (prev === false) return false;
- if (prev) {
- if (typeof prev === 'string') {
- return prev;
- } else if (typeof prev === 'function') {
- var prevPath = prev(file);
- if (prevPath && _fs.default.existsSync && _fs.default.existsSync(prevPath)) {
- return _fs.default.readFileSync(prevPath, 'utf-8').toString().trim();
- } else {
- throw new Error('Unable to load previous source map: ' + prevPath.toString());
- }
- } else if (prev instanceof _sourceMap.default.SourceMapConsumer) {
- return _sourceMap.default.SourceMapGenerator.fromSourceMap(prev).toString();
- } else if (prev instanceof _sourceMap.default.SourceMapGenerator) {
- return prev.toString();
- } else if (this.isMap(prev)) {
- return JSON.stringify(prev);
- } else {
- throw new Error('Unsupported previous source map format: ' + prev.toString());
- }
- } else if (this.inline) {
- return this.decodeInline(this.annotation);
- } else if (this.annotation) {
- var map = this.annotation;
- if (file) map = _path.default.join(_path.default.dirname(file), map);
- this.root = _path.default.dirname(map);
- if (_fs.default.existsSync && _fs.default.existsSync(map)) {
- return _fs.default.readFileSync(map, 'utf-8').toString().trim();
- } else {
- return false;
- }
- }
- };
- _proto.isMap = function isMap(map) {
- if (typeof map !== 'object') return false;
- return typeof map.mappings === 'string' || typeof map._mappings === 'string';
- };
- return PreviousMap;
- }();
- var _default = PreviousMap;
- exports.default = _default;
- module.exports = exports.default;
- }.call(this, __webpack_require__(38).Buffer))
- }),
- (function(module, exports) {
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var vendor = {
-
- prefix: function prefix(prop) {
- var match = prop.match(/^(-\w+-)/);
- if (match) {
- return match[0];
- }
- return '';
- },
-
- unprefixed: function unprefixed(prop) {
- return prop.replace(/^-\w+-/, '');
- }
- };
- var _default = vendor;
- exports.default = _default;
- module.exports = exports.default;
- }),
- (function(module, exports, __webpack_require__) {
- (function (global, factory) {
- true ? module.exports = factory() :
- undefined;
- }(this, (function () { 'use strict';
-
- var defaultOptions = (function () { return ({
-
- javascriptEnabled: false,
-
- depends: false,
-
- compress: false,
-
- lint: false,
-
- paths: [],
-
- color: true,
-
- strictImports: false,
-
- insecure: false,
-
- rootpath: '',
-
- rewriteUrls: false,
-
- math: 0,
-
- strictUnits: false,
-
- globalVars: null,
-
- modifyVars: null,
-
- urlArgs: ''
- }); });
- function extractId(href) {
- return href.replace(/^[a-z-]+:\/+?[^\/]+/, '')
- .replace(/[\?\&]livereload=\w+/, '')
- .replace(/^\//, '')
- .replace(/\.[a-zA-Z]+$/, '')
- .replace(/[^\.\w-]+/g, '-')
- .replace(/\./g, ':');
- }
- function addDataAttr(options, tag) {
- for (var opt in tag.dataset) {
- if (tag.dataset.hasOwnProperty(opt)) {
- if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {
- options[opt] = tag.dataset[opt];
- }
- else {
- try {
- options[opt] = JSON.parse(tag.dataset[opt]);
- }
- catch (_) { }
- }
- }
- }
- }
- var browser = {
- createCSS: function (document, styles, sheet) {
-
- var href = sheet.href || '';
-
- var id = "less:" + (sheet.title || extractId(href));
-
- var oldStyleNode = document.getElementById(id);
- var keepOldStyleNode = false;
-
- var styleNode = document.createElement('style');
- styleNode.setAttribute('type', 'text/css');
- if (sheet.media) {
- styleNode.setAttribute('media', sheet.media);
- }
- styleNode.id = id;
- if (!styleNode.styleSheet) {
- styleNode.appendChild(document.createTextNode(styles));
-
- keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 &&
- oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);
- }
- var head = document.getElementsByTagName('head')[0];
-
-
- if (oldStyleNode === null || keepOldStyleNode === false) {
- var nextEl = sheet && sheet.nextSibling || null;
- if (nextEl) {
- nextEl.parentNode.insertBefore(styleNode, nextEl);
- }
- else {
- head.appendChild(styleNode);
- }
- }
- if (oldStyleNode && keepOldStyleNode === false) {
- oldStyleNode.parentNode.removeChild(oldStyleNode);
- }
-
-
-
- if (styleNode.styleSheet) {
- try {
- styleNode.styleSheet.cssText = styles;
- }
- catch (e) {
- throw new Error('Couldn\'t reassign styleSheet.cssText.');
- }
- }
- },
- currentScript: function (window) {
- var document = window.document;
- return document.currentScript || (function () {
- var scripts = document.getElementsByTagName('script');
- return scripts[scripts.length - 1];
- })();
- }
- };
- var addDefaultOptions = (function (window, options) {
-
- addDataAttr(options, browser.currentScript(window));
- if (options.isFileProtocol === undefined) {
- options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);
- }
-
-
-
-
-
-
- options.async = options.async || false;
- options.fileAsync = options.fileAsync || false;
-
- options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);
- options.env = options.env || (window.location.hostname == '127.0.0.1' ||
- window.location.hostname == '0.0.0.0' ||
- window.location.hostname == 'localhost' ||
- (window.location.port &&
- window.location.port.length > 0) ||
- options.isFileProtocol ? 'development'
- : 'production');
- var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);
- if (dumpLineNumbers) {
- options.dumpLineNumbers = dumpLineNumbers[1];
- }
- if (options.useFileCache === undefined) {
- options.useFileCache = true;
- }
- if (options.onReady === undefined) {
- options.onReady = true;
- }
- if (options.relativeUrls) {
- options.rewriteUrls = 'all';
- }
- });
-
-
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b)
- if (b.hasOwnProperty(p))
- d[p] = b[p]; };
- return extendStatics(d, b);
- };
- function __extends(d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- function __spreadArrays() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
- s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
- }
- var colors = {
- 'aliceblue': '#f0f8ff',
- 'antiquewhite': '#faebd7',
- 'aqua': '#00ffff',
- 'aquamarine': '#7fffd4',
- 'azure': '#f0ffff',
- 'beige': '#f5f5dc',
- 'bisque': '#ffe4c4',
- 'black': '#000000',
- 'blanchedalmond': '#ffebcd',
- 'blue': '#0000ff',
- 'blueviolet': '#8a2be2',
- 'brown': '#a52a2a',
- 'burlywood': '#deb887',
- 'cadetblue': '#5f9ea0',
- 'chartreuse': '#7fff00',
- 'chocolate': '#d2691e',
- 'coral': '#ff7f50',
- 'cornflowerblue': '#6495ed',
- 'cornsilk': '#fff8dc',
- 'crimson': '#dc143c',
- 'cyan': '#00ffff',
- 'darkblue': '#00008b',
- 'darkcyan': '#008b8b',
- 'darkgoldenrod': '#b8860b',
- 'darkgray': '#a9a9a9',
- 'darkgrey': '#a9a9a9',
- 'darkgreen': '#006400',
- 'darkkhaki': '#bdb76b',
- 'darkmagenta': '#8b008b',
- 'darkolivegreen': '#556b2f',
- 'darkorange': '#ff8c00',
- 'darkorchid': '#9932cc',
- 'darkred': '#8b0000',
- 'darksalmon': '#e9967a',
- 'darkseagreen': '#8fbc8f',
- 'darkslateblue': '#483d8b',
- 'darkslategray': '#2f4f4f',
- 'darkslategrey': '#2f4f4f',
- 'darkturquoise': '#00ced1',
- 'darkviolet': '#9400d3',
- 'deeppink': '#ff1493',
- 'deepskyblue': '#00bfff',
- 'dimgray': '#696969',
- 'dimgrey': '#696969',
- 'dodgerblue': '#1e90ff',
- 'firebrick': '#b22222',
- 'floralwhite': '#fffaf0',
- 'forestgreen': '#228b22',
- 'fuchsia': '#ff00ff',
- 'gainsboro': '#dcdcdc',
- 'ghostwhite': '#f8f8ff',
- 'gold': '#ffd700',
- 'goldenrod': '#daa520',
- 'gray': '#808080',
- 'grey': '#808080',
- 'green': '#008000',
- 'greenyellow': '#adff2f',
- 'honeydew': '#f0fff0',
- 'hotpink': '#ff69b4',
- 'indianred': '#cd5c5c',
- 'indigo': '#4b0082',
- 'ivory': '#fffff0',
- 'khaki': '#f0e68c',
- 'lavender': '#e6e6fa',
- 'lavenderblush': '#fff0f5',
- 'lawngreen': '#7cfc00',
- 'lemonchiffon': '#fffacd',
- 'lightblue': '#add8e6',
- 'lightcoral': '#f08080',
- 'lightcyan': '#e0ffff',
- 'lightgoldenrodyellow': '#fafad2',
- 'lightgray': '#d3d3d3',
- 'lightgrey': '#d3d3d3',
- 'lightgreen': '#90ee90',
- 'lightpink': '#ffb6c1',
- 'lightsalmon': '#ffa07a',
- 'lightseagreen': '#20b2aa',
- 'lightskyblue': '#87cefa',
- 'lightslategray': '#778899',
- 'lightslategrey': '#778899',
- 'lightsteelblue': '#b0c4de',
- 'lightyellow': '#ffffe0',
- 'lime': '#00ff00',
- 'limegreen': '#32cd32',
- 'linen': '#faf0e6',
- 'magenta': '#ff00ff',
- 'maroon': '#800000',
- 'mediumaquamarine': '#66cdaa',
- 'mediumblue': '#0000cd',
- 'mediumorchid': '#ba55d3',
- 'mediumpurple': '#9370d8',
- 'mediumseagreen': '#3cb371',
- 'mediumslateblue': '#7b68ee',
- 'mediumspringgreen': '#00fa9a',
- 'mediumturquoise': '#48d1cc',
- 'mediumvioletred': '#c71585',
- 'midnightblue': '#191970',
- 'mintcream': '#f5fffa',
- 'mistyrose': '#ffe4e1',
- 'moccasin': '#ffe4b5',
- 'navajowhite': '#ffdead',
- 'navy': '#000080',
- 'oldlace': '#fdf5e6',
- 'olive': '#808000',
- 'olivedrab': '#6b8e23',
- 'orange': '#ffa500',
- 'orangered': '#ff4500',
- 'orchid': '#da70d6',
- 'palegoldenrod': '#eee8aa',
- 'palegreen': '#98fb98',
- 'paleturquoise': '#afeeee',
- 'palevioletred': '#d87093',
- 'papayawhip': '#ffefd5',
- 'peachpuff': '#ffdab9',
- 'peru': '#cd853f',
- 'pink': '#ffc0cb',
- 'plum': '#dda0dd',
- 'powderblue': '#b0e0e6',
- 'purple': '#800080',
- 'rebeccapurple': '#663399',
- 'red': '#ff0000',
- 'rosybrown': '#bc8f8f',
- 'royalblue': '#4169e1',
- 'saddlebrown': '#8b4513',
- 'salmon': '#fa8072',
- 'sandybrown': '#f4a460',
- 'seagreen': '#2e8b57',
- 'seashell': '#fff5ee',
- 'sienna': '#a0522d',
- 'silver': '#c0c0c0',
- 'skyblue': '#87ceeb',
- 'slateblue': '#6a5acd',
- 'slategray': '#708090',
- 'slategrey': '#708090',
- 'snow': '#fffafa',
- 'springgreen': '#00ff7f',
- 'steelblue': '#4682b4',
- 'tan': '#d2b48c',
- 'teal': '#008080',
- 'thistle': '#d8bfd8',
- 'tomato': '#ff6347',
- 'turquoise': '#40e0d0',
- 'violet': '#ee82ee',
- 'wheat': '#f5deb3',
- 'white': '#ffffff',
- 'whitesmoke': '#f5f5f5',
- 'yellow': '#ffff00',
- 'yellowgreen': '#9acd32'
- };
- var unitConversions = {
- length: {
- 'm': 1,
- 'cm': 0.01,
- 'mm': 0.001,
- 'in': 0.0254,
- 'px': 0.0254 / 96,
- 'pt': 0.0254 / 72,
- 'pc': 0.0254 / 72 * 12
- },
- duration: {
- 's': 1,
- 'ms': 0.001
- },
- angle: {
- 'rad': 1 / (2 * Math.PI),
- 'deg': 1 / 360,
- 'grad': 1 / 400,
- 'turn': 1
- }
- };
- var data = { colors: colors, unitConversions: unitConversions };
-
- var Node = (function () {
- function Node() {
- this.parent = null;
- this.visibilityBlocks = undefined;
- this.nodeVisible = undefined;
- this.rootNode = null;
- this.parsed = null;
- var self = this;
- Object.defineProperty(this, 'currentFileInfo', {
- get: function () { return self.fileInfo(); }
- });
- Object.defineProperty(this, 'index', {
- get: function () { return self.getIndex(); }
- });
- }
- Node.prototype.setParent = function (nodes, parent) {
- function set(node) {
- if (node && node instanceof Node) {
- node.parent = parent;
- }
- }
- if (Array.isArray(nodes)) {
- nodes.forEach(set);
- }
- else {
- set(nodes);
- }
- };
- Node.prototype.getIndex = function () {
- return this._index || (this.parent && this.parent.getIndex()) || 0;
- };
- Node.prototype.fileInfo = function () {
- return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};
- };
- Node.prototype.isRulesetLike = function () {
- return false;
- };
- Node.prototype.toCSS = function (context) {
- var strs = [];
- this.genCSS(context, {
- add: function (chunk, fileInfo, index) {
- strs.push(chunk);
- },
- isEmpty: function () {
- return strs.length === 0;
- }
- });
- return strs.join('');
- };
- Node.prototype.genCSS = function (context, output) {
- output.add(this.value);
- };
- Node.prototype.accept = function (visitor) {
- this.value = visitor.visit(this.value);
- };
- Node.prototype.eval = function () { return this; };
- Node.prototype._operate = function (context, op, a, b) {
- switch (op) {
- case '+': return a + b;
- case '-': return a - b;
- case '*': return a * b;
- case '/': return a / b;
- }
- };
- Node.prototype.fround = function (context, value) {
- var precision = context && context.numPrecision;
-
- return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;
- };
-
- Node.prototype.blocksVisibility = function () {
- if (this.visibilityBlocks == null) {
- this.visibilityBlocks = 0;
- }
- return this.visibilityBlocks !== 0;
- };
- Node.prototype.addVisibilityBlock = function () {
- if (this.visibilityBlocks == null) {
- this.visibilityBlocks = 0;
- }
- this.visibilityBlocks = this.visibilityBlocks + 1;
- };
- Node.prototype.removeVisibilityBlock = function () {
- if (this.visibilityBlocks == null) {
- this.visibilityBlocks = 0;
- }
- this.visibilityBlocks = this.visibilityBlocks - 1;
- };
-
-
- Node.prototype.ensureVisibility = function () {
- this.nodeVisible = true;
- };
-
-
- Node.prototype.ensureInvisibility = function () {
- this.nodeVisible = false;
- };
-
-
-
-
- Node.prototype.isVisible = function () {
- return this.nodeVisible;
- };
- Node.prototype.visibilityInfo = function () {
- return {
- visibilityBlocks: this.visibilityBlocks,
- nodeVisible: this.nodeVisible
- };
- };
- Node.prototype.copyVisibilityInfo = function (info) {
- if (!info) {
- return;
- }
- this.visibilityBlocks = info.visibilityBlocks;
- this.nodeVisible = info.nodeVisible;
- };
- return Node;
- }());
- Node.compare = function (a, b) {
-
- if ((a.compare) &&
-
-
- !(b.type === 'Quoted' || b.type === 'Anonymous')) {
- return a.compare(b);
- }
- else if (b.compare) {
- return -b.compare(a);
- }
- else if (a.type !== b.type) {
- return undefined;
- }
- a = a.value;
- b = b.value;
- if (!Array.isArray(a)) {
- return a === b ? 0 : undefined;
- }
- if (a.length !== b.length) {
- return undefined;
- }
- for (var i = 0; i < a.length; i++) {
- if (Node.compare(a[i], b[i]) !== 0) {
- return undefined;
- }
- }
- return 0;
- };
- Node.numericCompare = function (a, b) { return a < b ? -1
- : a === b ? 0
- : a > b ? 1 : undefined; };
-
-
-
- var Color = function (rgb, a, originalForm) {
- var self = this;
-
-
-
-
-
-
- if (Array.isArray(rgb)) {
- this.rgb = rgb;
- }
- else if (rgb.length >= 6) {
- this.rgb = [];
- rgb.match(/.{2}/g).map(function (c, i) {
- if (i < 3) {
- self.rgb.push(parseInt(c, 16));
- }
- else {
- self.alpha = (parseInt(c, 16)) / 255;
- }
- });
- }
- else {
- this.rgb = [];
- rgb.split('').map(function (c, i) {
- if (i < 3) {
- self.rgb.push(parseInt(c + c, 16));
- }
- else {
- self.alpha = (parseInt(c + c, 16)) / 255;
- }
- });
- }
- this.alpha = this.alpha || (typeof a === 'number' ? a : 1);
- if (typeof originalForm !== 'undefined') {
- this.value = originalForm;
- }
- };
- Color.prototype = new Node();
- Color.prototype.luma = function () {
- var r = this.rgb[0] / 255;
- var g = this.rgb[1] / 255;
- var b = this.rgb[2] / 255;
- r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);
- g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);
- b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
- };
- Color.prototype.genCSS = function (context, output) {
- output.add(this.toCSS(context));
- };
- Color.prototype.toCSS = function (context, doNotCompress) {
- var compress = context && context.compress && !doNotCompress;
- var color;
- var alpha;
- var colorFunction;
- var args = [];
-
-
-
- alpha = this.fround(context, this.alpha);
- if (this.value) {
- if (this.value.indexOf('rgb') === 0) {
- if (alpha < 1) {
- colorFunction = 'rgba';
- }
- }
- else if (this.value.indexOf('hsl') === 0) {
- if (alpha < 1) {
- colorFunction = 'hsla';
- }
- else {
- colorFunction = 'hsl';
- }
- }
- else {
- return this.value;
- }
- }
- else {
- if (alpha < 1) {
- colorFunction = 'rgba';
- }
- }
- switch (colorFunction) {
- case 'rgba':
- args = this.rgb.map(function (c) { return clamp(Math.round(c), 255); }).concat(clamp(alpha, 1));
- break;
- case 'hsla':
- args.push(clamp(alpha, 1));
- case 'hsl':
- color = this.toHSL();
- args = [
- this.fround(context, color.h),
- this.fround(context, color.s * 100) + "%",
- this.fround(context, color.l * 100) + "%"
- ].concat(args);
- }
- if (colorFunction) {
-
- return colorFunction + "(" + args.join("," + (compress ? '' : ' ')) + ")";
- }
- color = this.toRGB();
- if (compress) {
- var splitcolor = color.split('');
-
- if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {
- color = "#" + splitcolor[1] + splitcolor[3] + splitcolor[5];
- }
- }
- return color;
- };
-
-
-
-
-
-
- Color.prototype.operate = function (context, op, other) {
- var rgb = new Array(3);
- var alpha = this.alpha * (1 - other.alpha) + other.alpha;
- for (var c = 0; c < 3; c++) {
- rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);
- }
- return new Color(rgb, alpha);
- };
- Color.prototype.toRGB = function () {
- return toHex(this.rgb);
- };
- Color.prototype.toHSL = function () {
- var r = this.rgb[0] / 255;
- var g = this.rgb[1] / 255;
- var b = this.rgb[2] / 255;
- var a = this.alpha;
- var max = Math.max(r, g, b);
- var min = Math.min(r, g, b);
- var h;
- var s;
- var l = (max + min) / 2;
- var d = max - min;
- if (max === min) {
- h = s = 0;
- }
- else {
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
- switch (max) {
- case r:
- h = (g - b) / d + (g < b ? 6 : 0);
- break;
- case g:
- h = (b - r) / d + 2;
- break;
- case b:
- h = (r - g) / d + 4;
- break;
- }
- h /= 6;
- }
- return { h: h * 360, s: s, l: l, a: a };
- };
-
- Color.prototype.toHSV = function () {
- var r = this.rgb[0] / 255;
- var g = this.rgb[1] / 255;
- var b = this.rgb[2] / 255;
- var a = this.alpha;
- var max = Math.max(r, g, b);
- var min = Math.min(r, g, b);
- var h;
- var s;
- var v = max;
- var d = max - min;
- if (max === 0) {
- s = 0;
- }
- else {
- s = d / max;
- }
- if (max === min) {
- h = 0;
- }
- else {
- switch (max) {
- case r:
- h = (g - b) / d + (g < b ? 6 : 0);
- break;
- case g:
- h = (b - r) / d + 2;
- break;
- case b:
- h = (r - g) / d + 4;
- break;
- }
- h /= 6;
- }
- return { h: h * 360, s: s, v: v, a: a };
- };
- Color.prototype.toARGB = function () {
- return toHex([this.alpha * 255].concat(this.rgb));
- };
- Color.prototype.compare = function (x) {
- return (x.rgb &&
- x.rgb[0] === this.rgb[0] &&
- x.rgb[1] === this.rgb[1] &&
- x.rgb[2] === this.rgb[2] &&
- x.alpha === this.alpha) ? 0 : undefined;
- };
- Color.prototype.type = 'Color';
- function clamp(v, max) {
- return Math.min(Math.max(v, 0), max);
- }
- function toHex(v) {
- return "#" + v.map(function (c) {
- c = clamp(Math.round(c), 255);
- return (c < 16 ? '0' : '') + c.toString(16);
- }).join('');
- }
- Color.fromKeyword = function (keyword) {
- var c;
- var key = keyword.toLowerCase();
- if (colors.hasOwnProperty(key)) {
- c = new Color(colors[key].slice(1));
- }
- else if (key === 'transparent') {
- c = new Color([0, 0, 0], 0);
- }
- if (c) {
- c.value = keyword;
- return c;
- }
- };
- var Paren = function (node) {
- this.value = node;
- };
- Paren.prototype = new Node();
- Paren.prototype.genCSS = function (context, output) {
- output.add('(');
- this.value.genCSS(context, output);
- output.add(')');
- };
- Paren.prototype.eval = function (context) {
- return new Paren(this.value.eval(context));
- };
- Paren.prototype.type = 'Paren';
- var _noSpaceCombinators = {
- '': true,
- ' ': true,
- '|': true
- };
- var Combinator = function (value) {
- if (value === ' ') {
- this.value = ' ';
- this.emptyOrWhitespace = true;
- }
- else {
- this.value = value ? value.trim() : '';
- this.emptyOrWhitespace = this.value === '';
- }
- };
- Combinator.prototype = new Node();
- Combinator.prototype.genCSS = function (context, output) {
- var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';
- output.add(spaceOrEmpty + this.value + spaceOrEmpty);
- };
- Combinator.prototype.type = 'Combinator';
- var Element = function (combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {
- this.combinator = combinator instanceof Combinator ?
- combinator : new Combinator(combinator);
- if (typeof value === 'string') {
- this.value = value.trim();
- }
- else if (value) {
- this.value = value;
- }
- else {
- this.value = '';
- }
- this.isVariable = isVariable;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.copyVisibilityInfo(visibilityInfo);
- this.setParent(this.combinator, this);
- };
- Element.prototype = new Node();
- Element.prototype.accept = function (visitor) {
- var value = this.value;
- this.combinator = visitor.visit(this.combinator);
- if (typeof value === 'object') {
- this.value = visitor.visit(value);
- }
- };
- Element.prototype.eval = function (context) {
- return new Element(this.combinator, this.value.eval ? this.value.eval(context) : this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo());
- };
- Element.prototype.clone = function () {
- return new Element(this.combinator, this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo());
- };
- Element.prototype.genCSS = function (context, output) {
- output.add(this.toCSS(context), this.fileInfo(), this.getIndex());
- };
- Element.prototype.toCSS = function (context) {
- if (context === void 0) { context = {}; }
- var value = this.value;
- var firstSelector = context.firstSelector;
- if (value instanceof Paren) {
-
-
- context.firstSelector = true;
- }
- value = value.toCSS ? value.toCSS(context) : value;
- context.firstSelector = firstSelector;
- if (value === '' && this.combinator.value.charAt(0) === '&') {
- return '';
- }
- else {
- return this.combinator.toCSS(context) + value;
- }
- };
- Element.prototype.type = 'Element';
- var Math$1 = {
- ALWAYS: 0,
- PARENS_DIVISION: 1,
- PARENS: 2,
- STRICT_LEGACY: 3
- };
- var RewriteUrls = {
- OFF: 0,
- LOCAL: 1,
- ALL: 2
- };
-
- function getType(payload) {
- return Object.prototype.toString.call(payload).slice(8, -1);
- }
-
- function isPlainObject(payload) {
- if (getType(payload) !== 'Object')
- return false;
- return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
- }
-
- function isArray(payload) {
- return getType(payload) === 'Array';
- }
-
- function __spreadArrays$1() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
- s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
- }
- function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
- var propType = {}.propertyIsEnumerable.call(originalObject, key)
- ? 'enumerable'
- : 'nonenumerable';
- if (propType === 'enumerable')
- carry[key] = newVal;
- if (includeNonenumerable && propType === 'nonenumerable') {
- Object.defineProperty(carry, key, {
- value: newVal,
- enumerable: false,
- writable: true,
- configurable: true,
- });
- }
- }
-
- function copy(target, options) {
- if (options === void 0) {
- options = {};
- }
- if (isArray(target))
- return target.map(function (i) { return copy(i, options); });
- if (!isPlainObject(target))
- return target;
- var props = Object.getOwnPropertyNames(target);
- var symbols = Object.getOwnPropertySymbols(target);
- return __spreadArrays$1(props, symbols).reduce(function (carry, key) {
- if (isArray(options.props) && !options.props.includes(key)) {
- return carry;
- }
- var val = target[key];
- var newVal = copy(val, options);
- assignProp(carry, key, newVal, target, options.nonenumerable);
- return carry;
- }, {});
- }
-
- function getLocation(index, inputStream) {
- var n = index + 1;
- var line = null;
- var column = -1;
- while (--n >= 0 && inputStream.charAt(n) !== '\n') {
- column++;
- }
- if (typeof index === 'number') {
- line = (inputStream.slice(0, index).match(/\n/g) || '').length;
- }
- return {
- line: line,
- column: column
- };
- }
- function copyArray(arr) {
- var i;
- var length = arr.length;
- var copy = new Array(length);
- for (i = 0; i < length; i++) {
- copy[i] = arr[i];
- }
- return copy;
- }
- function clone(obj) {
- var cloned = {};
- for (var prop in obj) {
- if (obj.hasOwnProperty(prop)) {
- cloned[prop] = obj[prop];
- }
- }
- return cloned;
- }
- function defaults(obj1, obj2) {
- var newObj = obj2 || {};
- if (!obj2._defaults) {
- newObj = {};
- var defaults_1 = copy(obj1);
- newObj._defaults = defaults_1;
- var cloned = obj2 ? copy(obj2) : {};
- Object.assign(newObj, defaults_1, cloned);
- }
- return newObj;
- }
- function copyOptions(obj1, obj2) {
- if (obj2 && obj2._defaults) {
- return obj2;
- }
- var opts = defaults(obj1, obj2);
- if (opts.strictMath) {
- opts.math = Math$1.STRICT_LEGACY;
- }
-
- if (opts.relativeUrls) {
- opts.rewriteUrls = RewriteUrls.ALL;
- }
- if (typeof opts.math === 'string') {
- switch (opts.math.toLowerCase()) {
- case 'always':
- opts.math = Math$1.ALWAYS;
- break;
- case 'parens-division':
- opts.math = Math$1.PARENS_DIVISION;
- break;
- case 'strict':
- case 'parens':
- opts.math = Math$1.PARENS;
- break;
- case 'strict-legacy':
- opts.math = Math$1.STRICT_LEGACY;
- }
- }
- if (typeof opts.rewriteUrls === 'string') {
- switch (opts.rewriteUrls.toLowerCase()) {
- case 'off':
- opts.rewriteUrls = RewriteUrls.OFF;
- break;
- case 'local':
- opts.rewriteUrls = RewriteUrls.LOCAL;
- break;
- case 'all':
- opts.rewriteUrls = RewriteUrls.ALL;
- break;
- }
- }
- return opts;
- }
- function merge(obj1, obj2) {
- for (var prop in obj2) {
- if (obj2.hasOwnProperty(prop)) {
- obj1[prop] = obj2[prop];
- }
- }
- return obj1;
- }
- function flattenArray(arr, result) {
- if (result === void 0) { result = []; }
- for (var i = 0, length_1 = arr.length; i < length_1; i++) {
- var value = arr[i];
- if (Array.isArray(value)) {
- flattenArray(value, result);
- }
- else {
- if (value !== undefined) {
- result.push(value);
- }
- }
- }
- return result;
- }
- var utils = Object.freeze({
- __proto__: null,
- getLocation: getLocation,
- copyArray: copyArray,
- clone: clone,
- defaults: defaults,
- copyOptions: copyOptions,
- merge: merge,
- flattenArray: flattenArray
- });
- var anonymousFunc = /(<anonymous>|Function):(\d+):(\d+)/;
-
- var LessError = function LessError(e, fileContentMap, currentFilename) {
- Error.call(this);
- var filename = e.filename || currentFilename;
- this.message = e.message;
- this.stack = e.stack;
- if (fileContentMap && filename) {
- var input = fileContentMap.contents[filename];
- var loc = getLocation(e.index, input);
- var line = loc.line;
- var col = loc.column;
- var callLine = e.call && getLocation(e.call, input).line;
- var lines = input ? input.split('\n') : '';
- this.type = e.type || 'Syntax';
- this.filename = filename;
- this.index = e.index;
- this.line = typeof line === 'number' ? line + 1 : null;
- this.column = col;
- if (!this.line && this.stack) {
- var found = this.stack.match(anonymousFunc);
-
- var func = new Function('a', 'throw new Error()');
- var lineAdjust = 0;
- try {
- func();
- }
- catch (e) {
- var match = e.stack.match(anonymousFunc);
- var line_1 = parseInt(match[2]);
- lineAdjust = 1 - line_1;
- }
- if (found) {
- if (found[2]) {
- this.line = parseInt(found[2]) + lineAdjust;
- }
- if (found[3]) {
- this.column = parseInt(found[3]);
- }
- }
- }
- this.callLine = callLine + 1;
- this.callExtract = lines[callLine];
- this.extract = [
- lines[this.line - 2],
- lines[this.line - 1],
- lines[this.line]
- ];
- }
- };
- if (typeof Object.create === 'undefined') {
- var F = function () { };
- F.prototype = Error.prototype;
- LessError.prototype = new F();
- }
- else {
- LessError.prototype = Object.create(Error.prototype);
- }
- LessError.prototype.constructor = LessError;
-
- LessError.prototype.toString = function (options) {
- if (options === void 0) { options = {}; }
- var message = '';
- var extract = this.extract || [];
- var error = [];
- var stylize = function (str) { return str; };
- if (options.stylize) {
- var type = typeof options.stylize;
- if (type !== 'function') {
- throw Error("options.stylize should be a function, got a " + type + "!");
- }
- stylize = options.stylize;
- }
- if (this.line !== null) {
- if (typeof extract[0] === 'string') {
- error.push(stylize(this.line - 1 + " " + extract[0], 'grey'));
- }
- if (typeof extract[1] === 'string') {
- var errorTxt = this.line + " ";
- if (extract[1]) {
- errorTxt += extract[1].slice(0, this.column) +
- stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +
- extract[1].slice(this.column + 1), 'red'), 'inverse');
- }
- error.push(errorTxt);
- }
- if (typeof extract[2] === 'string') {
- error.push(stylize(this.line + 1 + " " + extract[2], 'grey'));
- }
- error = error.join('\n') + stylize('', 'reset') + "\n";
- }
- message += stylize(this.type + "Error: " + this.message, 'red');
- if (this.filename) {
- message += stylize(' in ', 'red') + this.filename;
- }
- if (this.line) {
- message += stylize(" on line " + this.line + ", column " + (this.column + 1) + ":", 'grey');
- }
- message += "\n" + error;
- if (this.callLine) {
- message += stylize('from ', 'red') + (this.filename || '') + "/n";
- message += stylize(this.callLine, 'grey') + " " + this.callExtract + "/n";
- }
- return message;
- };
- var Selector = function (elements, extendList, condition, index, currentFileInfo, visibilityInfo) {
- this.extendList = extendList;
- this.condition = condition;
- this.evaldCondition = !condition;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.elements = this.getElements(elements);
- this.mixinElements_ = undefined;
- this.copyVisibilityInfo(visibilityInfo);
- this.setParent(this.elements, this);
- };
- Selector.prototype = new Node();
- Selector.prototype.accept = function (visitor) {
- if (this.elements) {
- this.elements = visitor.visitArray(this.elements);
- }
- if (this.extendList) {
- this.extendList = visitor.visitArray(this.extendList);
- }
- if (this.condition) {
- this.condition = visitor.visit(this.condition);
- }
- };
- Selector.prototype.createDerived = function (elements, extendList, evaldCondition) {
- elements = this.getElements(elements);
- var newSelector = new Selector(elements, extendList || this.extendList, null, this.getIndex(), this.fileInfo(), this.visibilityInfo());
- newSelector.evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition;
- newSelector.mediaEmpty = this.mediaEmpty;
- return newSelector;
- };
- Selector.prototype.getElements = function (els) {
- if (!els) {
- return [new Element('', '&', false, this._index, this._fileInfo)];
- }
- if (typeof els === 'string') {
- this.parse.parseNode(els, ['selector'], this._index, this._fileInfo, function (err, result) {
- if (err) {
- throw new LessError({
- index: err.index,
- message: err.message
- }, this.parse.imports, this._fileInfo.filename);
- }
- els = result[0].elements;
- });
- }
- return els;
- };
- Selector.prototype.createEmptySelectors = function () {
- var el = new Element('', '&', false, this._index, this._fileInfo);
- var sels = [new Selector([el], null, null, this._index, this._fileInfo)];
- sels[0].mediaEmpty = true;
- return sels;
- };
- Selector.prototype.match = function (other) {
- var elements = this.elements;
- var len = elements.length;
- var olen;
- var i;
- other = other.mixinElements();
- olen = other.length;
- if (olen === 0 || len < olen) {
- return 0;
- }
- else {
- for (i = 0; i < olen; i++) {
- if (elements[i].value !== other[i]) {
- return 0;
- }
- }
- }
- return olen;
- };
- Selector.prototype.mixinElements = function () {
- if (this.mixinElements_) {
- return this.mixinElements_;
- }
- var elements = this.elements.map(function (v) { return v.combinator.value + (v.value.value || v.value); }).join('').match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);
- if (elements) {
- if (elements[0] === '&') {
- elements.shift();
- }
- }
- else {
- elements = [];
- }
- return (this.mixinElements_ = elements);
- };
- Selector.prototype.isJustParentSelector = function () {
- return !this.mediaEmpty &&
- this.elements.length === 1 &&
- this.elements[0].value === '&' &&
- (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');
- };
- Selector.prototype.eval = function (context) {
- var evaldCondition = this.condition && this.condition.eval(context);
- var elements = this.elements;
- var extendList = this.extendList;
- elements = elements && elements.map(function (e) { return e.eval(context); });
- extendList = extendList && extendList.map(function (extend) { return extend.eval(context); });
- return this.createDerived(elements, extendList, evaldCondition);
- };
- Selector.prototype.genCSS = function (context, output) {
- var i;
- var element;
- if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {
- output.add(' ', this.fileInfo(), this.getIndex());
- }
- for (i = 0; i < this.elements.length; i++) {
- element = this.elements[i];
- element.genCSS(context, output);
- }
- };
- Selector.prototype.getIsOutput = function () {
- return this.evaldCondition;
- };
- Selector.prototype.type = 'Selector';
- var Value = function (value) {
- if (!value) {
- throw new Error('Value requires an array argument');
- }
- if (!Array.isArray(value)) {
- this.value = [value];
- }
- else {
- this.value = value;
- }
- };
- Value.prototype = new Node();
- Value.prototype.accept = function (visitor) {
- if (this.value) {
- this.value = visitor.visitArray(this.value);
- }
- };
- Value.prototype.eval = function (context) {
- if (this.value.length === 1) {
- return this.value[0].eval(context);
- }
- else {
- return new Value(this.value.map(function (v) { return v.eval(context); }));
- }
- };
- Value.prototype.genCSS = function (context, output) {
- var i;
- for (i = 0; i < this.value.length; i++) {
- this.value[i].genCSS(context, output);
- if (i + 1 < this.value.length) {
- output.add((context && context.compress) ? ',' : ', ');
- }
- }
- };
- Value.prototype.type = 'Value';
- var Keyword = function (value) {
- this.value = value;
- };
- Keyword.prototype = new Node();
- Keyword.prototype.genCSS = function (context, output) {
- if (this.value === '%') {
- throw { type: 'Syntax', message: 'Invalid % without number' };
- }
- output.add(this.value);
- };
- Keyword.prototype.type = 'Keyword';
- Keyword.True = new Keyword('true');
- Keyword.False = new Keyword('false');
- var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
- this.value = value;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.mapLines = mapLines;
- this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
- this.allowRoot = true;
- this.copyVisibilityInfo(visibilityInfo);
- };
- Anonymous.prototype = new Node();
- Anonymous.prototype.eval = function () {
- return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
- };
- Anonymous.prototype.compare = function (other) {
- return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
- };
- Anonymous.prototype.isRulesetLike = function () {
- return this.rulesetLike;
- };
- Anonymous.prototype.genCSS = function (context, output) {
- this.nodeVisible = Boolean(this.value);
- if (this.nodeVisible) {
- output.add(this.value, this._fileInfo, this._index, this.mapLines);
- }
- };
- Anonymous.prototype.type = 'Anonymous';
- var MATH = Math$1;
- var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) {
- this.name = name;
- this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);
- this.important = important ? " " + important.trim() : '';
- this.merge = merge;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.inline = inline || false;
- this.variable = (variable !== undefined) ? variable
- : (name.charAt && (name.charAt(0) === '@'));
- this.allowRoot = true;
- this.setParent(this.value, this);
- };
- Declaration.prototype = new Node();
- Declaration.prototype.genCSS = function (context, output) {
- output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());
- try {
- this.value.genCSS(context, output);
- }
- catch (e) {
- e.index = this._index;
- e.filename = this._fileInfo.filename;
- throw e;
- }
- output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);
- };
- Declaration.prototype.eval = function (context) {
- var mathBypass = false;
- var prevMath;
- var name = this.name;
- var evaldValue;
- var variable = this.variable;
- if (typeof name !== 'string') {
-
-
- name = (name.length === 1) && (name[0] instanceof Keyword) ?
- name[0].value : evalName(context, name);
- variable = false;
- }
-
- if (name === 'font' && context.math === MATH.ALWAYS) {
- mathBypass = true;
- prevMath = context.math;
- context.math = MATH.PARENS_DIVISION;
- }
- try {
- context.importantScope.push({});
- evaldValue = this.value.eval(context);
- if (!this.variable && evaldValue.type === 'DetachedRuleset') {
- throw { message: 'Rulesets cannot be evaluated on a property.',
- index: this.getIndex(), filename: this.fileInfo().filename };
- }
- var important = this.important;
- var importantResult = context.importantScope.pop();
- if (!important && importantResult.important) {
- important = importantResult.important;
- }
- return new Declaration(name, evaldValue, important, this.merge, this.getIndex(), this.fileInfo(), this.inline, variable);
- }
- catch (e) {
- if (typeof e.index !== 'number') {
- e.index = this.getIndex();
- e.filename = this.fileInfo().filename;
- }
- throw e;
- }
- finally {
- if (mathBypass) {
- context.math = prevMath;
- }
- }
- };
- Declaration.prototype.makeImportant = function () {
- return new Declaration(this.name, this.value, '!important', this.merge, this.getIndex(), this.fileInfo(), this.inline);
- };
- function evalName(context, name) {
- var value = '';
- var i;
- var n = name.length;
- var output = { add: function (s) { value += s; } };
- for (i = 0; i < n; i++) {
- name[i].eval(context).genCSS(context, output);
- }
- return value;
- }
- Declaration.prototype.type = 'Declaration';
- var debugInfo = function (context, ctx, lineSeparator) {
- var result = '';
- if (context.dumpLineNumbers && !context.compress) {
- switch (context.dumpLineNumbers) {
- case 'comments':
- result = debugInfo.asComment(ctx);
- break;
- case 'mediaquery':
- result = debugInfo.asMediaQuery(ctx);
- break;
- case 'all':
- result = debugInfo.asComment(ctx) + (lineSeparator || '') + debugInfo.asMediaQuery(ctx);
- break;
- }
- }
- return result;
- };
- debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; };
- debugInfo.asMediaQuery = function (ctx) {
- if (!ctx.debugInfo) {
- return '';
- }
- var filenameWithProtocol = ctx.debugInfo.fileName;
- if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
- filenameWithProtocol = "file://" + filenameWithProtocol;
- }
- return "@media -sass-debug-info{filename{font-family:" + filenameWithProtocol.replace(/([.:\/\\])/g, function (a) {
- if (a == '\\') {
- a = '\/';
- }
- return "\\" + a;
- }) + "}line{font-family:\\00003" + ctx.debugInfo.lineNumber + "}}\n";
- };
- var Comment = function (value, isLineComment, index, currentFileInfo) {
- this.value = value;
- this.isLineComment = isLineComment;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.allowRoot = true;
- };
- Comment.prototype = new Node();
- Comment.prototype.genCSS = function (context, output) {
- if (this.debugInfo) {
- output.add(debugInfo(context, this), this.fileInfo(), this.getIndex());
- }
- output.add(this.value);
- };
- Comment.prototype.isSilent = function (context) {
- var isCompressed = context.compress && this.value[2] !== '!';
- return this.isLineComment || isCompressed;
- };
- Comment.prototype.type = 'Comment';
- var contexts = {};
- var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {
- if (!original) {
- return;
- }
- for (var i = 0; i < propertiesToCopy.length; i++) {
- if (original.hasOwnProperty(propertiesToCopy[i])) {
- destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];
- }
- }
- };
-
- var parseCopyProperties = [
-
- 'paths',
- 'rewriteUrls',
- 'rootpath',
- 'strictImports',
- 'insecure',
- 'dumpLineNumbers',
- 'compress',
- 'syncImport',
- 'chunkInput',
- 'mime',
- 'useFileCache',
-
- 'processImports',
-
- 'pluginManager'
- ];
- contexts.Parse = function (options) {
- copyFromOriginal(options, this, parseCopyProperties);
- if (typeof this.paths === 'string') {
- this.paths = [this.paths];
- }
- };
- var evalCopyProperties = [
- 'paths',
- 'compress',
- 'math',
- 'strictUnits',
- 'sourceMap',
- 'importMultiple',
- 'urlArgs',
- 'javascriptEnabled',
- 'pluginManager',
- 'importantScope',
- 'rewriteUrls'
- ];
- function isPathRelative(path) {
- return !/^(?:[a-z-]+:|\/|#)/i.test(path);
- }
- function isPathLocalRelative(path) {
- return path.charAt(0) === '.';
- }
- contexts.Eval = (function () {
- function Eval(options, frames) {
- copyFromOriginal(options, this, evalCopyProperties);
- if (typeof this.paths === 'string') {
- this.paths = [this.paths];
- }
- this.frames = frames || [];
- this.importantScope = this.importantScope || [];
- this.inCalc = false;
- this.mathOn = true;
- }
- Eval.prototype.enterCalc = function () {
- if (!this.calcStack) {
- this.calcStack = [];
- }
- this.calcStack.push(true);
- this.inCalc = true;
- };
- Eval.prototype.exitCalc = function () {
- this.calcStack.pop();
- if (!this.calcStack.length) {
- this.inCalc = false;
- }
- };
- Eval.prototype.inParenthesis = function () {
- if (!this.parensStack) {
- this.parensStack = [];
- }
- this.parensStack.push(true);
- };
- Eval.prototype.outOfParenthesis = function () {
- this.parensStack.pop();
- };
- Eval.prototype.isMathOn = function (op) {
- if (!this.mathOn) {
- return false;
- }
- if (op === '/' && this.math !== Math$1.ALWAYS && (!this.parensStack || !this.parensStack.length)) {
- return false;
- }
- if (this.math > Math$1.PARENS_DIVISION) {
- return this.parensStack && this.parensStack.length;
- }
- return true;
- };
- Eval.prototype.pathRequiresRewrite = function (path) {
- var isRelative = this.rewriteUrls === RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;
- return isRelative(path);
- };
- Eval.prototype.rewritePath = function (path, rootpath) {
- var newPath;
- rootpath = rootpath || '';
- newPath = this.normalizePath(rootpath + path);
-
-
- if (isPathLocalRelative(path) &&
- isPathRelative(rootpath) &&
- isPathLocalRelative(newPath) === false) {
- newPath = "./" + newPath;
- }
- return newPath;
- };
- Eval.prototype.normalizePath = function (path) {
- var segments = path.split('/').reverse();
- var segment;
- path = [];
- while (segments.length !== 0) {
- segment = segments.pop();
- switch (segment) {
- case '.':
- break;
- case '..':
- if ((path.length === 0) || (path[path.length - 1] === '..')) {
- path.push(segment);
- }
- else {
- path.pop();
- }
- break;
- default:
- path.push(segment);
- break;
- }
- }
- return path.join('/');
- };
- return Eval;
- }());
- function makeRegistry(base) {
- return {
- _data: {},
- add: function (name, func) {
-
-
- name = name.toLowerCase();
- if (this._data.hasOwnProperty(name)) ;
- this._data[name] = func;
- },
- addMultiple: function (functions) {
- var _this = this;
- Object.keys(functions).forEach(function (name) {
- _this.add(name, functions[name]);
- });
- },
- get: function (name) {
- return this._data[name] || (base && base.get(name));
- },
- getLocalFunctions: function () {
- return this._data;
- },
- inherit: function () {
- return makeRegistry(this);
- },
- create: function (base) {
- return makeRegistry(base);
- }
- };
- }
- var functionRegistry = makeRegistry(null);
- var defaultFunc = {
- eval: function () {
- var v = this.value_;
- var e = this.error_;
- if (e) {
- throw e;
- }
- if (v != null) {
- return v ? Keyword.True : Keyword.False;
- }
- },
- value: function (v) {
- this.value_ = v;
- },
- error: function (e) {
- this.error_ = e;
- },
- reset: function () {
- this.value_ = this.error_ = null;
- }
- };
- var Ruleset = function (selectors, rules, strictImports, visibilityInfo) {
- this.selectors = selectors;
- this.rules = rules;
- this._lookups = {};
- this._variables = null;
- this._properties = null;
- this.strictImports = strictImports;
- this.copyVisibilityInfo(visibilityInfo);
- this.allowRoot = true;
- this.setParent(this.selectors, this);
- this.setParent(this.rules, this);
- };
- Ruleset.prototype = new Node();
- Ruleset.prototype.isRulesetLike = function () {
- return true;
- };
- Ruleset.prototype.accept = function (visitor) {
- if (this.paths) {
- this.paths = visitor.visitArray(this.paths, true);
- }
- else if (this.selectors) {
- this.selectors = visitor.visitArray(this.selectors);
- }
- if (this.rules && this.rules.length) {
- this.rules = visitor.visitArray(this.rules);
- }
- };
- Ruleset.prototype.eval = function (context) {
- var selectors;
- var selCnt;
- var selector;
- var i;
- var hasVariable;
- var hasOnePassingSelector = false;
- if (this.selectors && (selCnt = this.selectors.length)) {
- selectors = new Array(selCnt);
- defaultFunc.error({
- type: 'Syntax',
- message: 'it is currently only allowed in parametric mixin guards,'
- });
- for (i = 0; i < selCnt; i++) {
- selector = this.selectors[i].eval(context);
- for (var j = 0; j < selector.elements.length; j++) {
- if (selector.elements[j].isVariable) {
- hasVariable = true;
- break;
- }
- }
- selectors[i] = selector;
- if (selector.evaldCondition) {
- hasOnePassingSelector = true;
- }
- }
- if (hasVariable) {
- var toParseSelectors = new Array(selCnt);
- for (i = 0; i < selCnt; i++) {
- selector = selectors[i];
- toParseSelectors[i] = selector.toCSS(context);
- }
- this.parse.parseNode(toParseSelectors.join(','), ["selectors"], selectors[0].getIndex(), selectors[0].fileInfo(), function (err, result) {
- if (result) {
- selectors = flattenArray(result);
- }
- });
- }
- defaultFunc.reset();
- }
- else {
- hasOnePassingSelector = true;
- }
- var rules = this.rules ? copyArray(this.rules) : null;
- var ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());
- var rule;
- var subRule;
- ruleset.originalRuleset = this;
- ruleset.root = this.root;
- ruleset.firstRoot = this.firstRoot;
- ruleset.allowImports = this.allowImports;
- if (this.debugInfo) {
- ruleset.debugInfo = this.debugInfo;
- }
- if (!hasOnePassingSelector) {
- rules.length = 0;
- }
-
-
- ruleset.functionRegistry = (function (frames) {
- var i = 0;
- var n = frames.length;
- var found;
- for (; i !== n; ++i) {
- found = frames[i].functionRegistry;
- if (found) {
- return found;
- }
- }
- return functionRegistry;
- })(context.frames).inherit();
-
- var ctxFrames = context.frames;
- ctxFrames.unshift(ruleset);
-
- var ctxSelectors = context.selectors;
- if (!ctxSelectors) {
- context.selectors = ctxSelectors = [];
- }
- ctxSelectors.unshift(this.selectors);
-
- if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {
- ruleset.evalImports(context);
- }
-
-
- var rsRules = ruleset.rules;
- for (i = 0; (rule = rsRules[i]); i++) {
- if (rule.evalFirst) {
- rsRules[i] = rule.eval(context);
- }
- }
- var mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;
-
- for (i = 0; (rule = rsRules[i]); i++) {
- if (rule.type === 'MixinCall') {
-
- rules = rule.eval(context).filter(function (r) {
- if ((r instanceof Declaration) && r.variable) {
-
-
-
- return !(ruleset.variable(r.name));
- }
- return true;
- });
- rsRules.splice.apply(rsRules, [i, 1].concat(rules));
- i += rules.length - 1;
- ruleset.resetCache();
- }
- else if (rule.type === 'VariableCall') {
-
- rules = rule.eval(context).rules.filter(function (r) {
- if ((r instanceof Declaration) && r.variable) {
-
- return false;
- }
- return true;
- });
- rsRules.splice.apply(rsRules, [i, 1].concat(rules));
- i += rules.length - 1;
- ruleset.resetCache();
- }
- }
-
- for (i = 0; (rule = rsRules[i]); i++) {
- if (!rule.evalFirst) {
- rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;
- }
- }
-
- for (i = 0; (rule = rsRules[i]); i++) {
-
- if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {
-
- if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {
- rsRules.splice(i--, 1);
- for (var j = 0; (subRule = rule.rules[j]); j++) {
- if (subRule instanceof Node) {
- subRule.copyVisibilityInfo(rule.visibilityInfo());
- if (!(subRule instanceof Declaration) || !subRule.variable) {
- rsRules.splice(++i, 0, subRule);
- }
- }
- }
- }
- }
- }
-
- ctxFrames.shift();
- ctxSelectors.shift();
- if (context.mediaBlocks) {
- for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {
- context.mediaBlocks[i].bubbleSelectors(selectors);
- }
- }
- return ruleset;
- };
- Ruleset.prototype.evalImports = function (context) {
- var rules = this.rules;
- var i;
- var importRules;
- if (!rules) {
- return;
- }
- for (i = 0; i < rules.length; i++) {
- if (rules[i].type === 'Import') {
- importRules = rules[i].eval(context);
- if (importRules && (importRules.length || importRules.length === 0)) {
- rules.splice.apply(rules, [i, 1].concat(importRules));
- i += importRules.length - 1;
- }
- else {
- rules.splice(i, 1, importRules);
- }
- this.resetCache();
- }
- }
- };
- Ruleset.prototype.makeImportant = function () {
- var result = new Ruleset(this.selectors, this.rules.map(function (r) {
- if (r.makeImportant) {
- return r.makeImportant();
- }
- else {
- return r;
- }
- }), this.strictImports, this.visibilityInfo());
- return result;
- };
- Ruleset.prototype.matchArgs = function (args) {
- return !args || args.length === 0;
- };
-
- Ruleset.prototype.matchCondition = function (args, context) {
- var lastSelector = this.selectors[this.selectors.length - 1];
- if (!lastSelector.evaldCondition) {
- return false;
- }
- if (lastSelector.condition &&
- !lastSelector.condition.eval(new contexts.Eval(context, context.frames))) {
- return false;
- }
- return true;
- };
- Ruleset.prototype.resetCache = function () {
- this._rulesets = null;
- this._variables = null;
- this._properties = null;
- this._lookups = {};
- };
- Ruleset.prototype.variables = function () {
- if (!this._variables) {
- this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {
- if (r instanceof Declaration && r.variable === true) {
- hash[r.name] = r;
- }
-
-
-
- if (r.type === 'Import' && r.root && r.root.variables) {
- var vars = r.root.variables();
- for (var name_1 in vars) {
- if (vars.hasOwnProperty(name_1)) {
- hash[name_1] = r.root.variable(name_1);
- }
- }
- }
- return hash;
- }, {});
- }
- return this._variables;
- };
- Ruleset.prototype.properties = function () {
- if (!this._properties) {
- this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {
- if (r instanceof Declaration && r.variable !== true) {
- var name_2 = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?
- r.name[0].value : r.name;
-
- if (!hash["$" + name_2]) {
- hash["$" + name_2] = [r];
- }
- else {
- hash["$" + name_2].push(r);
- }
- }
- return hash;
- }, {});
- }
- return this._properties;
- };
- Ruleset.prototype.variable = function (name) {
- var decl = this.variables()[name];
- if (decl) {
- return this.parseValue(decl);
- }
- };
- Ruleset.prototype.property = function (name) {
- var decl = this.properties()[name];
- if (decl) {
- return this.parseValue(decl);
- }
- };
- Ruleset.prototype.lastDeclaration = function () {
- for (var i = this.rules.length; i > 0; i--) {
- var decl = this.rules[i - 1];
- if (decl instanceof Declaration) {
- return this.parseValue(decl);
- }
- }
- };
- Ruleset.prototype.parseValue = function (toParse) {
- var self = this;
- function transformDeclaration(decl) {
- if (decl.value instanceof Anonymous && !decl.parsed) {
- if (typeof decl.value.value === 'string') {
- this.parse.parseNode(decl.value.value, ['value', 'important'], decl.value.getIndex(), decl.fileInfo(), function (err, result) {
- if (err) {
- decl.parsed = true;
- }
- if (result) {
- decl.value = result[0];
- decl.important = result[1] || '';
- decl.parsed = true;
- }
- });
- }
- else {
- decl.parsed = true;
- }
- return decl;
- }
- else {
- return decl;
- }
- }
- if (!Array.isArray(toParse)) {
- return transformDeclaration.call(self, toParse);
- }
- else {
- var nodes_1 = [];
- toParse.forEach(function (n) {
- nodes_1.push(transformDeclaration.call(self, n));
- });
- return nodes_1;
- }
- };
- Ruleset.prototype.rulesets = function () {
- if (!this.rules) {
- return [];
- }
- var filtRules = [];
- var rules = this.rules;
- var i;
- var rule;
- for (i = 0; (rule = rules[i]); i++) {
- if (rule.isRuleset) {
- filtRules.push(rule);
- }
- }
- return filtRules;
- };
- Ruleset.prototype.prependRule = function (rule) {
- var rules = this.rules;
- if (rules) {
- rules.unshift(rule);
- }
- else {
- this.rules = [rule];
- }
- this.setParent(rule, this);
- };
- Ruleset.prototype.find = function (selector, self, filter) {
- if (self === void 0) { self = this; }
- var rules = [];
- var match;
- var foundMixins;
- var key = selector.toCSS();
- if (key in this._lookups) {
- return this._lookups[key];
- }
- this.rulesets().forEach(function (rule) {
- if (rule !== self) {
- for (var j = 0; j < rule.selectors.length; j++) {
- match = selector.match(rule.selectors[j]);
- if (match) {
- if (selector.elements.length > match) {
- if (!filter || filter(rule)) {
- foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);
- for (var i = 0; i < foundMixins.length; ++i) {
- foundMixins[i].path.push(rule);
- }
- Array.prototype.push.apply(rules, foundMixins);
- }
- }
- else {
- rules.push({ rule: rule, path: [] });
- }
- break;
- }
- }
- }
- });
- this._lookups[key] = rules;
- return rules;
- };
- Ruleset.prototype.genCSS = function (context, output) {
- var i;
- var j;
- var charsetRuleNodes = [];
- var ruleNodes = [];
- var
- debugInfo$1;
- var rule;
- var path;
- context.tabLevel = (context.tabLevel || 0);
- if (!this.root) {
- context.tabLevel++;
- }
- var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');
- var tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');
- var sep;
- var charsetNodeIndex = 0;
- var importNodeIndex = 0;
- for (i = 0; (rule = this.rules[i]); i++) {
- if (rule instanceof Comment) {
- if (importNodeIndex === i) {
- importNodeIndex++;
- }
- ruleNodes.push(rule);
- }
- else if (rule.isCharset && rule.isCharset()) {
- ruleNodes.splice(charsetNodeIndex, 0, rule);
- charsetNodeIndex++;
- importNodeIndex++;
- }
- else if (rule.type === 'Import') {
- ruleNodes.splice(importNodeIndex, 0, rule);
- importNodeIndex++;
- }
- else {
- ruleNodes.push(rule);
- }
- }
- ruleNodes = charsetRuleNodes.concat(ruleNodes);
-
-
- if (!this.root) {
- debugInfo$1 = debugInfo(context, this, tabSetStr);
- if (debugInfo$1) {
- output.add(debugInfo$1);
- output.add(tabSetStr);
- }
- var paths = this.paths;
- var pathCnt = paths.length;
- var pathSubCnt = void 0;
- sep = context.compress ? ',' : (",\n" + tabSetStr);
- for (i = 0; i < pathCnt; i++) {
- path = paths[i];
- if (!(pathSubCnt = path.length)) {
- continue;
- }
- if (i > 0) {
- output.add(sep);
- }
- context.firstSelector = true;
- path[0].genCSS(context, output);
- context.firstSelector = false;
- for (j = 1; j < pathSubCnt; j++) {
- path[j].genCSS(context, output);
- }
- }
- output.add((context.compress ? '{' : ' {\n') + tabRuleStr);
- }
-
- for (i = 0; (rule = ruleNodes[i]); i++) {
- if (i + 1 === ruleNodes.length) {
- context.lastRule = true;
- }
- var currentLastRule = context.lastRule;
- if (rule.isRulesetLike(rule)) {
- context.lastRule = false;
- }
- if (rule.genCSS) {
- rule.genCSS(context, output);
- }
- else if (rule.value) {
- output.add(rule.value.toString());
- }
- context.lastRule = currentLastRule;
- if (!context.lastRule && rule.isVisible()) {
- output.add(context.compress ? '' : ("\n" + tabRuleStr));
- }
- else {
- context.lastRule = false;
- }
- }
- if (!this.root) {
- output.add((context.compress ? '}' : "\n" + tabSetStr + "}"));
- context.tabLevel--;
- }
- if (!output.isEmpty() && !context.compress && this.firstRoot) {
- output.add('\n');
- }
- };
- Ruleset.prototype.joinSelectors = function (paths, context, selectors) {
- for (var s = 0; s < selectors.length; s++) {
- this.joinSelector(paths, context, selectors[s]);
- }
- };
- Ruleset.prototype.joinSelector = function (paths, context, selector) {
- function createParenthesis(elementsToPak, originalElement) {
- var replacementParen;
- var j;
- if (elementsToPak.length === 0) {
- replacementParen = new Paren(elementsToPak[0]);
- }
- else {
- var insideParent = new Array(elementsToPak.length);
- for (j = 0; j < elementsToPak.length; j++) {
- insideParent[j] = new Element(null, elementsToPak[j], originalElement.isVariable, originalElement._index, originalElement._fileInfo);
- }
- replacementParen = new Paren(new Selector(insideParent));
- }
- return replacementParen;
- }
- function createSelector(containedElement, originalElement) {
- var element;
- var selector;
- element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);
- selector = new Selector([element]);
- return selector;
- }
-
-
-
- function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {
- var newSelectorPath;
- var lastSelector;
- var newJoinedSelector;
-
- newSelectorPath = [];
-
-
- if (beginningPath.length > 0) {
- newSelectorPath = copyArray(beginningPath);
- lastSelector = newSelectorPath.pop();
- newJoinedSelector = originalSelector.createDerived(copyArray(lastSelector.elements));
- }
- else {
- newJoinedSelector = originalSelector.createDerived([]);
- }
- if (addPath.length > 0) {
-
-
-
-
-
- var combinator = replacedElement.combinator;
- var parentEl = addPath[0].elements[0];
- if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {
- combinator = parentEl.combinator;
- }
-
- newJoinedSelector.elements.push(new Element(combinator, parentEl.value, replacedElement.isVariable, replacedElement._index, replacedElement._fileInfo));
- newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));
- }
-
- if (newJoinedSelector.elements.length !== 0) {
- newSelectorPath.push(newJoinedSelector);
- }
-
- if (addPath.length > 1) {
- var restOfPath = addPath.slice(1);
- restOfPath = restOfPath.map(function (selector) { return selector.createDerived(selector.elements, []); });
- newSelectorPath = newSelectorPath.concat(restOfPath);
- }
- return newSelectorPath;
- }
-
-
-
- function addAllReplacementsIntoPath(beginningPath, addPaths, replacedElement, originalSelector, result) {
- var j;
- for (j = 0; j < beginningPath.length; j++) {
- var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);
- result.push(newSelectorPath);
- }
- return result;
- }
- function mergeElementsOnToSelectors(elements, selectors) {
- var i;
- var sel;
- if (elements.length === 0) {
- return;
- }
- if (selectors.length === 0) {
- selectors.push([new Selector(elements)]);
- return;
- }
- for (i = 0; (sel = selectors[i]); i++) {
-
- if (sel.length > 0) {
- sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));
- }
- else {
- sel.push(new Selector(elements));
- }
- }
- }
-
-
-
- function replaceParentSelector(paths, context, inSelector) {
-
-
-
-
-
-
-
-
-
-
- var i;
- var j;
- var k;
- var currentElements;
- var newSelectors;
- var selectorsMultiplied;
- var sel;
- var el;
- var hadParentSelector = false;
- var length;
- var lastSelector;
- function findNestedSelector(element) {
- var maybeSelector;
- if (!(element.value instanceof Paren)) {
- return null;
- }
- maybeSelector = element.value.value;
- if (!(maybeSelector instanceof Selector)) {
- return null;
- }
- return maybeSelector;
- }
-
- currentElements = [];
-
-
-
- newSelectors = [
- []
- ];
- for (i = 0; (el = inSelector.elements[i]); i++) {
-
- if (el.value !== '&') {
- var nestedSelector = findNestedSelector(el);
- if (nestedSelector != null) {
-
-
- mergeElementsOnToSelectors(currentElements, newSelectors);
- var nestedPaths = [];
- var replaced = void 0;
- var replacedNewSelectors = [];
- replaced = replaceParentSelector(nestedPaths, context, nestedSelector);
- hadParentSelector = hadParentSelector || replaced;
-
- for (k = 0; k < nestedPaths.length; k++) {
- var replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);
- addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);
- }
- newSelectors = replacedNewSelectors;
- currentElements = [];
- }
- else {
- currentElements.push(el);
- }
- }
- else {
- hadParentSelector = true;
-
- selectorsMultiplied = [];
-
-
- mergeElementsOnToSelectors(currentElements, newSelectors);
-
- for (j = 0; j < newSelectors.length; j++) {
- sel = newSelectors[j];
-
-
- if (context.length === 0) {
-
-
- if (sel.length > 0) {
- sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));
- }
- selectorsMultiplied.push(sel);
- }
- else {
-
- for (k = 0; k < context.length; k++) {
-
-
- var newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);
-
- selectorsMultiplied.push(newSelectorPath);
- }
- }
- }
-
- newSelectors = selectorsMultiplied;
- currentElements = [];
- }
- }
-
-
- mergeElementsOnToSelectors(currentElements, newSelectors);
- for (i = 0; i < newSelectors.length; i++) {
- length = newSelectors[i].length;
- if (length > 0) {
- paths.push(newSelectors[i]);
- lastSelector = newSelectors[i][length - 1];
- newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);
- }
- }
- return hadParentSelector;
- }
- function deriveSelector(visibilityInfo, deriveFrom) {
- var newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);
- newSelector.copyVisibilityInfo(visibilityInfo);
- return newSelector;
- }
-
- var i;
- var newPaths;
- var hadParentSelector;
- newPaths = [];
- hadParentSelector = replaceParentSelector(newPaths, context, selector);
- if (!hadParentSelector) {
- if (context.length > 0) {
- newPaths = [];
- for (i = 0; i < context.length; i++) {
- var concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));
- concatenated.push(selector);
- newPaths.push(concatenated);
- }
- }
- else {
- newPaths = [[selector]];
- }
- }
- for (i = 0; i < newPaths.length; i++) {
- paths.push(newPaths[i]);
- }
- };
- Ruleset.prototype.type = 'Ruleset';
- Ruleset.prototype.isRuleset = true;
- var AtRule = function (name, value, rules, index, currentFileInfo, debugInfo, isRooted, visibilityInfo) {
- var i;
- this.name = name;
- this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);
- if (rules) {
- if (Array.isArray(rules)) {
- this.rules = rules;
- }
- else {
- this.rules = [rules];
- this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();
- }
- for (i = 0; i < this.rules.length; i++) {
- this.rules[i].allowImports = true;
- }
- this.setParent(this.rules, this);
- }
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.debugInfo = debugInfo;
- this.isRooted = isRooted || false;
- this.copyVisibilityInfo(visibilityInfo);
- this.allowRoot = true;
- };
- AtRule.prototype = new Node();
- AtRule.prototype.accept = function (visitor) {
- var value = this.value;
- var rules = this.rules;
- if (rules) {
- this.rules = visitor.visitArray(rules);
- }
- if (value) {
- this.value = visitor.visit(value);
- }
- };
- AtRule.prototype.isRulesetLike = function () {
- return this.rules || !this.isCharset();
- };
- AtRule.prototype.isCharset = function () {
- return '@charset' === this.name;
- };
- AtRule.prototype.genCSS = function (context, output) {
- var value = this.value;
- var rules = this.rules;
- output.add(this.name, this.fileInfo(), this.getIndex());
- if (value) {
- output.add(' ');
- value.genCSS(context, output);
- }
- if (rules) {
- this.outputRuleset(context, output, rules);
- }
- else {
- output.add(';');
- }
- };
- AtRule.prototype.eval = function (context) {
- var mediaPathBackup;
- var mediaBlocksBackup;
- var value = this.value;
- var rules = this.rules;
-
-
- mediaPathBackup = context.mediaPath;
- mediaBlocksBackup = context.mediaBlocks;
-
- context.mediaPath = [];
- context.mediaBlocks = [];
- if (value) {
- value = value.eval(context);
- }
- if (rules) {
-
- rules = [rules[0].eval(context)];
- rules[0].root = true;
- }
-
- context.mediaPath = mediaPathBackup;
- context.mediaBlocks = mediaBlocksBackup;
- return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());
- };
- AtRule.prototype.variable = function (name) {
- if (this.rules) {
-
- return Ruleset.prototype.variable.call(this.rules[0], name);
- }
- };
- AtRule.prototype.find = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (this.rules) {
-
- return Ruleset.prototype.find.apply(this.rules[0], args);
- }
- };
- AtRule.prototype.rulesets = function () {
- if (this.rules) {
-
- return Ruleset.prototype.rulesets.apply(this.rules[0]);
- }
- };
- AtRule.prototype.outputRuleset = function (context, output, rules) {
- var ruleCnt = rules.length;
- var i;
- context.tabLevel = (context.tabLevel | 0) + 1;
-
- if (context.compress) {
- output.add('{');
- for (i = 0; i < ruleCnt; i++) {
- rules[i].genCSS(context, output);
- }
- output.add('}');
- context.tabLevel--;
- return;
- }
-
- var tabSetStr = "\n" + Array(context.tabLevel).join(' ');
- var tabRuleStr = tabSetStr + " ";
- if (!ruleCnt) {
- output.add(" {" + tabSetStr + "}");
- }
- else {
- output.add(" {" + tabRuleStr);
- rules[0].genCSS(context, output);
- for (i = 1; i < ruleCnt; i++) {
- output.add(tabRuleStr);
- rules[i].genCSS(context, output);
- }
- output.add(tabSetStr + "}");
- }
- context.tabLevel--;
- };
- AtRule.prototype.type = 'AtRule';
- var DetachedRuleset = function (ruleset, frames) {
- this.ruleset = ruleset;
- this.frames = frames;
- this.setParent(this.ruleset, this);
- };
- DetachedRuleset.prototype = new Node();
- DetachedRuleset.prototype.accept = function (visitor) {
- this.ruleset = visitor.visit(this.ruleset);
- };
- DetachedRuleset.prototype.eval = function (context) {
- var frames = this.frames || copyArray(context.frames);
- return new DetachedRuleset(this.ruleset, frames);
- };
- DetachedRuleset.prototype.callEval = function (context) {
- return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);
- };
- DetachedRuleset.prototype.type = 'DetachedRuleset';
- DetachedRuleset.prototype.evalFirst = true;
- var Unit = function (numerator, denominator, backupUnit) {
- this.numerator = numerator ? copyArray(numerator).sort() : [];
- this.denominator = denominator ? copyArray(denominator).sort() : [];
- if (backupUnit) {
- this.backupUnit = backupUnit;
- }
- else if (numerator && numerator.length) {
- this.backupUnit = numerator[0];
- }
- };
- Unit.prototype = new Node();
- Unit.prototype.clone = function () {
- return new Unit(copyArray(this.numerator), copyArray(this.denominator), this.backupUnit);
- };
- Unit.prototype.genCSS = function (context, output) {
-
- var strictUnits = context && context.strictUnits;
- if (this.numerator.length === 1) {
- output.add(this.numerator[0]);
- }
- else if (!strictUnits && this.backupUnit) {
- output.add(this.backupUnit);
- }
- else if (!strictUnits && this.denominator.length) {
- output.add(this.denominator[0]);
- }
- };
- Unit.prototype.toString = function () {
- var i;
- var returnStr = this.numerator.join('*');
- for (i = 0; i < this.denominator.length; i++) {
- returnStr += "/" + this.denominator[i];
- }
- return returnStr;
- };
- Unit.prototype.compare = function (other) {
- return this.is(other.toString()) ? 0 : undefined;
- };
- Unit.prototype.is = function (unitString) {
- return this.toString().toUpperCase() === unitString.toUpperCase();
- };
- Unit.prototype.isLength = function () {
- return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());
- };
- Unit.prototype.isEmpty = function () {
- return this.numerator.length === 0 && this.denominator.length === 0;
- };
- Unit.prototype.isSingular = function () {
- return this.numerator.length <= 1 && this.denominator.length === 0;
- };
- Unit.prototype.map = function (callback) {
- var i;
- for (i = 0; i < this.numerator.length; i++) {
- this.numerator[i] = callback(this.numerator[i], false);
- }
- for (i = 0; i < this.denominator.length; i++) {
- this.denominator[i] = callback(this.denominator[i], true);
- }
- };
- Unit.prototype.usedUnits = function () {
- var group;
- var result = {};
- var mapUnit;
- var groupName;
- mapUnit = function (atomicUnit) {
-
- if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {
- result[groupName] = atomicUnit;
- }
- return atomicUnit;
- };
- for (groupName in unitConversions) {
- if (unitConversions.hasOwnProperty(groupName)) {
- group = unitConversions[groupName];
- this.map(mapUnit);
- }
- }
- return result;
- };
- Unit.prototype.cancel = function () {
- var counter = {};
- var atomicUnit;
- var i;
- for (i = 0; i < this.numerator.length; i++) {
- atomicUnit = this.numerator[i];
- counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;
- }
- for (i = 0; i < this.denominator.length; i++) {
- atomicUnit = this.denominator[i];
- counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;
- }
- this.numerator = [];
- this.denominator = [];
- for (atomicUnit in counter) {
- if (counter.hasOwnProperty(atomicUnit)) {
- var count = counter[atomicUnit];
- if (count > 0) {
- for (i = 0; i < count; i++) {
- this.numerator.push(atomicUnit);
- }
- }
- else if (count < 0) {
- for (i = 0; i < -count; i++) {
- this.denominator.push(atomicUnit);
- }
- }
- }
- }
- this.numerator.sort();
- this.denominator.sort();
- };
- Unit.prototype.type = 'Unit';
-
-
-
- var Dimension = function (value, unit) {
- this.value = parseFloat(value);
- if (isNaN(this.value)) {
- throw new Error('Dimension is not a number.');
- }
- this.unit = (unit && unit instanceof Unit) ? unit :
- new Unit(unit ? [unit] : undefined);
- this.setParent(this.unit, this);
- };
- Dimension.prototype = new Node();
- Dimension.prototype.accept = function (visitor) {
- this.unit = visitor.visit(this.unit);
- };
- Dimension.prototype.eval = function (context) {
- return this;
- };
- Dimension.prototype.toColor = function () {
- return new Color([this.value, this.value, this.value]);
- };
- Dimension.prototype.genCSS = function (context, output) {
- if ((context && context.strictUnits) && !this.unit.isSingular()) {
- throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: " + this.unit.toString());
- }
- var value = this.fround(context, this.value);
- var strValue = String(value);
- if (value !== 0 && value < 0.000001 && value > -0.000001) {
-
- strValue = value.toFixed(20).replace(/0+$/, '');
- }
- if (context && context.compress) {
-
- if (value === 0 && this.unit.isLength()) {
- output.add(strValue);
- return;
- }
-
- if (value > 0 && value < 1) {
- strValue = (strValue).substr(1);
- }
- }
- output.add(strValue);
- this.unit.genCSS(context, output);
- };
-
-
-
- Dimension.prototype.operate = function (context, op, other) {
-
- var value = this._operate(context, op, this.value, other.value);
- var unit = this.unit.clone();
- if (op === '+' || op === '-') {
- if (unit.numerator.length === 0 && unit.denominator.length === 0) {
- unit = other.unit.clone();
- if (this.unit.backupUnit) {
- unit.backupUnit = this.unit.backupUnit;
- }
- }
- else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) ;
- else {
- other = other.convertTo(this.unit.usedUnits());
- if (context.strictUnits && other.unit.toString() !== unit.toString()) {
- throw new Error("Incompatible units. Change the units or use the unit function. " +
- ("Bad units: '" + unit.toString() + "' and '" + other.unit.toString() + "'."));
- }
- value = this._operate(context, op, this.value, other.value);
- }
- }
- else if (op === '*') {
- unit.numerator = unit.numerator.concat(other.unit.numerator).sort();
- unit.denominator = unit.denominator.concat(other.unit.denominator).sort();
- unit.cancel();
- }
- else if (op === '/') {
- unit.numerator = unit.numerator.concat(other.unit.denominator).sort();
- unit.denominator = unit.denominator.concat(other.unit.numerator).sort();
- unit.cancel();
- }
- return new Dimension(value, unit);
- };
- Dimension.prototype.compare = function (other) {
- var a;
- var b;
- if (!(other instanceof Dimension)) {
- return undefined;
- }
- if (this.unit.isEmpty() || other.unit.isEmpty()) {
- a = this;
- b = other;
- }
- else {
- a = this.unify();
- b = other.unify();
- if (a.unit.compare(b.unit) !== 0) {
- return undefined;
- }
- }
- return Node.numericCompare(a.value, b.value);
- };
- Dimension.prototype.unify = function () {
- return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });
- };
- Dimension.prototype.convertTo = function (conversions) {
- var value = this.value;
- var unit = this.unit.clone();
- var i;
- var groupName;
- var group;
- var targetUnit;
- var derivedConversions = {};
- var applyUnit;
- if (typeof conversions === 'string') {
- for (i in unitConversions) {
- if (unitConversions[i].hasOwnProperty(conversions)) {
- derivedConversions = {};
- derivedConversions[i] = conversions;
- }
- }
- conversions = derivedConversions;
- }
- applyUnit = function (atomicUnit, denominator) {
-
- if (group.hasOwnProperty(atomicUnit)) {
- if (denominator) {
- value = value / (group[atomicUnit] / group[targetUnit]);
- }
- else {
- value = value * (group[atomicUnit] / group[targetUnit]);
- }
- return targetUnit;
- }
- return atomicUnit;
- };
- for (groupName in conversions) {
- if (conversions.hasOwnProperty(groupName)) {
- targetUnit = conversions[groupName];
- group = unitConversions[groupName];
- unit.map(applyUnit);
- }
- }
- unit.cancel();
- return new Dimension(value, unit);
- };
- Dimension.prototype.type = 'Dimension';
- var MATH$1 = Math$1;
- var Operation = function (op, operands, isSpaced) {
- this.op = op.trim();
- this.operands = operands;
- this.isSpaced = isSpaced;
- };
- Operation.prototype = new Node();
- Operation.prototype.accept = function (visitor) {
- this.operands = visitor.visitArray(this.operands);
- };
- Operation.prototype.eval = function (context) {
- var a = this.operands[0].eval(context);
- var b = this.operands[1].eval(context);
- var op;
- if (context.isMathOn(this.op)) {
- op = this.op === './' ? '/' : this.op;
- if (a instanceof Dimension && b instanceof Color) {
- a = a.toColor();
- }
- if (b instanceof Dimension && a instanceof Color) {
- b = b.toColor();
- }
- if (!a.operate) {
- if (a instanceof Operation && a.op === '/' && context.math === MATH$1.PARENS_DIVISION) {
- return new Operation(this.op, [a, b], this.isSpaced);
- }
- throw { type: 'Operation',
- message: 'Operation on an invalid type' };
- }
- return a.operate(context, op, b);
- }
- else {
- return new Operation(this.op, [a, b], this.isSpaced);
- }
- };
- Operation.prototype.genCSS = function (context, output) {
- this.operands[0].genCSS(context, output);
- if (this.isSpaced) {
- output.add(' ');
- }
- output.add(this.op);
- if (this.isSpaced) {
- output.add(' ');
- }
- this.operands[1].genCSS(context, output);
- };
- Operation.prototype.type = 'Operation';
- var MATH$2 = Math$1;
- var Expression = function (value, noSpacing) {
- this.value = value;
- this.noSpacing = noSpacing;
- if (!value) {
- throw new Error('Expression requires an array parameter');
- }
- };
- Expression.prototype = new Node();
- Expression.prototype.accept = function (visitor) {
- this.value = visitor.visitArray(this.value);
- };
- Expression.prototype.eval = function (context) {
- var returnValue;
- var mathOn = context.isMathOn();
- var inParenthesis = this.parens &&
- (context.math !== MATH$2.STRICT_LEGACY || !this.parensInOp);
- var doubleParen = false;
- if (inParenthesis) {
- context.inParenthesis();
- }
- if (this.value.length > 1) {
- returnValue = new Expression(this.value.map(function (e) {
- if (!e.eval) {
- return e;
- }
- return e.eval(context);
- }), this.noSpacing);
- }
- else if (this.value.length === 1) {
- if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {
- doubleParen = true;
- }
- returnValue = this.value[0].eval(context);
- }
- else {
- returnValue = this;
- }
- if (inParenthesis) {
- context.outOfParenthesis();
- }
- if (this.parens && this.parensInOp && !mathOn && !doubleParen
- && (!(returnValue instanceof Dimension))) {
- returnValue = new Paren(returnValue);
- }
- return returnValue;
- };
- Expression.prototype.genCSS = function (context, output) {
- for (var i = 0; i < this.value.length; i++) {
- this.value[i].genCSS(context, output);
- if (!this.noSpacing && i + 1 < this.value.length) {
- output.add(' ');
- }
- }
- };
- Expression.prototype.throwAwayComments = function () {
- this.value = this.value.filter(function (v) { return !(v instanceof Comment); });
- };
- Expression.prototype.type = 'Expression';
- var functionCaller = (function () {
- function functionCaller(name, context, index, currentFileInfo) {
- this.name = name.toLowerCase();
- this.index = index;
- this.context = context;
- this.currentFileInfo = currentFileInfo;
- this.func = context.frames[0].functionRegistry.get(this.name);
- }
- functionCaller.prototype.isValid = function () {
- return Boolean(this.func);
- };
- functionCaller.prototype.call = function (args) {
- var _this = this;
- var evalArgs = this.func.evalArgs;
- if (evalArgs !== false) {
- args = args.map(function (a) { return a.eval(_this.context); });
- }
-
-
- if (Array.isArray(args)) {
- args = args.filter(function (item) {
- if (item.type === 'Comment') {
- return false;
- }
- return true;
- })
- .map(function (item) {
- if (item.type === 'Expression') {
- var subNodes = item.value.filter(function (item) {
- if (item.type === 'Comment') {
- return false;
- }
- return true;
- });
- if (subNodes.length === 1) {
- return subNodes[0];
- }
- else {
- return new Expression(subNodes);
- }
- }
- return item;
- });
- }
- if (evalArgs === false) {
- return this.func.apply(this, __spreadArrays([this.context], args));
- }
- return this.func.apply(this, args);
- };
- return functionCaller;
- }());
-
-
-
- var Call = function (name, args, index, currentFileInfo) {
- this.name = name;
- this.args = args;
- this.calc = name === 'calc';
- this._index = index;
- this._fileInfo = currentFileInfo;
- };
- Call.prototype = new Node();
- Call.prototype.accept = function (visitor) {
- if (this.args) {
- this.args = visitor.visitArray(this.args);
- }
- };
-
-
-
-
-
-
-
-
-
-
-
- Call.prototype.eval = function (context) {
- var _this = this;
-
- var currentMathContext = context.mathOn;
- context.mathOn = !this.calc;
- if (this.calc || context.inCalc) {
- context.enterCalc();
- }
- var exitCalc = function () {
- if (_this.calc || context.inCalc) {
- context.exitCalc();
- }
- context.mathOn = currentMathContext;
- };
- var result;
- var funcCaller = new functionCaller(this.name, context, this.getIndex(), this.fileInfo());
- if (funcCaller.isValid()) {
- try {
- result = funcCaller.call(this.args);
- exitCalc();
- }
- catch (e) {
- if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {
- throw e;
- }
- throw {
- type: e.type || 'Runtime',
- message: "error evaluating function `" + this.name + "`" + (e.message ? ": " + e.message : ''),
- index: this.getIndex(),
- filename: this.fileInfo().filename,
- line: e.lineNumber,
- column: e.columnNumber
- };
- }
- if (result !== null && result !== undefined) {
-
-
- if (!(result instanceof Node)) {
- if (!result || result === true) {
- result = new Anonymous(null);
- }
- else {
- result = new Anonymous(result.toString());
- }
- }
- result._index = this._index;
- result._fileInfo = this._fileInfo;
- return result;
- }
- }
- var args = this.args.map(function (a) { return a.eval(context); });
- exitCalc();
- return new Call(this.name, args, this.getIndex(), this.fileInfo());
- };
- Call.prototype.genCSS = function (context, output) {
- output.add(this.name + "(", this.fileInfo(), this.getIndex());
- for (var i = 0; i < this.args.length; i++) {
- this.args[i].genCSS(context, output);
- if (i + 1 < this.args.length) {
- output.add(', ');
- }
- }
- output.add(')');
- };
- Call.prototype.type = 'Call';
- var Variable = function (name, index, currentFileInfo) {
- this.name = name;
- this._index = index;
- this._fileInfo = currentFileInfo;
- };
- Variable.prototype = new Node();
- Variable.prototype.eval = function (context) {
- var variable;
- var name = this.name;
- if (name.indexOf('@@') === 0) {
- name = "@" + new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value;
- }
- if (this.evaluating) {
- throw { type: 'Name', message: "Recursive variable definition for " + name, filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- this.evaluating = true;
- variable = this.find(context.frames, function (frame) {
- var v = frame.variable(name);
- if (v) {
- if (v.important) {
- var importantScope = context.importantScope[context.importantScope.length - 1];
- importantScope.important = v.important;
- }
-
- if (context.inCalc) {
- return (new Call('_SELF', [v.value])).eval(context);
- }
- else {
- return v.value.eval(context);
- }
- }
- });
- if (variable) {
- this.evaluating = false;
- return variable;
- }
- else {
- throw { type: 'Name', message: "variable " + name + " is undefined", filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- };
- Variable.prototype.find = function (obj, fun) {
- for (var i = 0, r = void 0; i < obj.length; i++) {
- r = fun.call(obj, obj[i]);
- if (r) {
- return r;
- }
- }
- return null;
- };
- Variable.prototype.type = 'Variable';
- var Property = function (name, index, currentFileInfo) {
- this.name = name;
- this._index = index;
- this._fileInfo = currentFileInfo;
- };
- Property.prototype = new Node();
- Property.prototype.eval = function (context) {
- var property;
- var name = this.name;
-
- var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;
- if (this.evaluating) {
- throw { type: 'Name', message: "Recursive property reference for " + name, filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- this.evaluating = true;
- property = this.find(context.frames, function (frame) {
- var v;
- var vArr = frame.property(name);
- if (vArr) {
- for (var i = 0; i < vArr.length; i++) {
- v = vArr[i];
- vArr[i] = new Declaration(v.name, v.value, v.important, v.merge, v.index, v.currentFileInfo, v.inline, v.variable);
- }
- mergeRules(vArr);
- v = vArr[vArr.length - 1];
- if (v.important) {
- var importantScope = context.importantScope[context.importantScope.length - 1];
- importantScope.important = v.important;
- }
- v = v.value.eval(context);
- return v;
- }
- });
- if (property) {
- this.evaluating = false;
- return property;
- }
- else {
- throw { type: 'Name', message: "Property '" + name + "' is undefined", filename: this.currentFileInfo.filename,
- index: this.index };
- }
- };
- Property.prototype.find = function (obj, fun) {
- for (var i = 0, r = void 0; i < obj.length; i++) {
- r = fun.call(obj, obj[i]);
- if (r) {
- return r;
- }
- }
- return null;
- };
- Property.prototype.type = 'Property';
- var Attribute = function (key, op, value) {
- this.key = key;
- this.op = op;
- this.value = value;
- };
- Attribute.prototype = new Node();
- Attribute.prototype.eval = function (context) {
- return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value);
- };
- Attribute.prototype.genCSS = function (context, output) {
- output.add(this.toCSS(context));
- };
- Attribute.prototype.toCSS = function (context) {
- var value = this.key.toCSS ? this.key.toCSS(context) : this.key;
- if (this.op) {
- value += this.op;
- value += (this.value.toCSS ? this.value.toCSS(context) : this.value);
- }
- return "[" + value + "]";
- };
- Attribute.prototype.type = 'Attribute';
- var Quoted = function (str, content, escaped, index, currentFileInfo) {
- this.escaped = (escaped == null) ? true : escaped;
- this.value = content || '';
- this.quote = str.charAt(0);
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.variableRegex = /@\{([\w-]+)\}/g;
- this.propRegex = /\$\{([\w-]+)\}/g;
- this.allowRoot = escaped;
- };
- Quoted.prototype = new Node();
- Quoted.prototype.genCSS = function (context, output) {
- if (!this.escaped) {
- output.add(this.quote, this.fileInfo(), this.getIndex());
- }
- output.add(this.value);
- if (!this.escaped) {
- output.add(this.quote);
- }
- };
- Quoted.prototype.containsVariables = function () {
- return this.value.match(this.variableRegex);
- };
- Quoted.prototype.eval = function (context) {
- var that = this;
- var value = this.value;
- var variableReplacement = function (_, name) {
- var v = new Variable("@" + name, that.getIndex(), that.fileInfo()).eval(context, true);
- return (v instanceof Quoted) ? v.value : v.toCSS();
- };
- var propertyReplacement = function (_, name) {
- var v = new Property("$" + name, that.getIndex(), that.fileInfo()).eval(context, true);
- return (v instanceof Quoted) ? v.value : v.toCSS();
- };
- function iterativeReplace(value, regexp, replacementFnc) {
- var evaluatedValue = value;
- do {
- value = evaluatedValue.toString();
- evaluatedValue = value.replace(regexp, replacementFnc);
- } while (value !== evaluatedValue);
- return evaluatedValue;
- }
- value = iterativeReplace(value, this.variableRegex, variableReplacement);
- value = iterativeReplace(value, this.propRegex, propertyReplacement);
- return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());
- };
- Quoted.prototype.compare = function (other) {
-
- if (other.type === 'Quoted' && !this.escaped && !other.escaped) {
- return Node.numericCompare(this.value, other.value);
- }
- else {
- return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
- }
- };
- Quoted.prototype.type = 'Quoted';
- var URL = function (val, index, currentFileInfo, isEvald) {
- this.value = val;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.isEvald = isEvald;
- };
- URL.prototype = new Node();
- URL.prototype.accept = function (visitor) {
- this.value = visitor.visit(this.value);
- };
- URL.prototype.genCSS = function (context, output) {
- output.add('url(');
- this.value.genCSS(context, output);
- output.add(')');
- };
- URL.prototype.eval = function (context) {
- var val = this.value.eval(context);
- var rootpath;
- if (!this.isEvald) {
-
- rootpath = this.fileInfo() && this.fileInfo().rootpath;
- if (typeof rootpath === 'string' &&
- typeof val.value === 'string' &&
- context.pathRequiresRewrite(val.value)) {
- if (!val.quote) {
- rootpath = escapePath(rootpath);
- }
- val.value = context.rewritePath(val.value, rootpath);
- }
- else {
- val.value = context.normalizePath(val.value);
- }
-
- if (context.urlArgs) {
- if (!val.value.match(/^\s*data:/)) {
- var delimiter = val.value.indexOf('?') === -1 ? '?' : '&';
- var urlArgs = delimiter + context.urlArgs;
- if (val.value.indexOf('#') !== -1) {
- val.value = val.value.replace('#', urlArgs + "#");
- }
- else {
- val.value += urlArgs;
- }
- }
- }
- }
- return new URL(val, this.getIndex(), this.fileInfo(), true);
- };
- URL.prototype.type = 'Url';
- function escapePath(path) {
- return path.replace(/[\(\)'"\s]/g, function (match) { return "\\" + match; });
- }
- var Media = function (value, features, index, currentFileInfo, visibilityInfo) {
- this._index = index;
- this._fileInfo = currentFileInfo;
- var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();
- this.features = new Value(features);
- this.rules = [new Ruleset(selectors, value)];
- this.rules[0].allowImports = true;
- this.copyVisibilityInfo(visibilityInfo);
- this.allowRoot = true;
- this.setParent(selectors, this);
- this.setParent(this.features, this);
- this.setParent(this.rules, this);
- };
- Media.prototype = new AtRule();
- Media.prototype.isRulesetLike = function () {
- return true;
- };
- Media.prototype.accept = function (visitor) {
- if (this.features) {
- this.features = visitor.visit(this.features);
- }
- if (this.rules) {
- this.rules = visitor.visitArray(this.rules);
- }
- };
- Media.prototype.genCSS = function (context, output) {
- output.add('@media ', this._fileInfo, this._index);
- this.features.genCSS(context, output);
- this.outputRuleset(context, output, this.rules);
- };
- Media.prototype.eval = function (context) {
- if (!context.mediaBlocks) {
- context.mediaBlocks = [];
- context.mediaPath = [];
- }
- var media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());
- if (this.debugInfo) {
- this.rules[0].debugInfo = this.debugInfo;
- media.debugInfo = this.debugInfo;
- }
- media.features = this.features.eval(context);
- context.mediaPath.push(media);
- context.mediaBlocks.push(media);
- this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();
- context.frames.unshift(this.rules[0]);
- media.rules = [this.rules[0].eval(context)];
- context.frames.shift();
- context.mediaPath.pop();
- return context.mediaPath.length === 0 ? media.evalTop(context) :
- media.evalNested(context);
- };
- Media.prototype.evalTop = function (context) {
- var result = this;
-
- if (context.mediaBlocks.length > 1) {
- var selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();
- result = new Ruleset(selectors, context.mediaBlocks);
- result.multiMedia = true;
- result.copyVisibilityInfo(this.visibilityInfo());
- this.setParent(result, this);
- }
- delete context.mediaBlocks;
- delete context.mediaPath;
- return result;
- };
- Media.prototype.evalNested = function (context) {
- var i;
- var value;
- var path = context.mediaPath.concat([this]);
-
- for (i = 0; i < path.length; i++) {
- value = path[i].features instanceof Value ?
- path[i].features.value : path[i].features;
- path[i] = Array.isArray(value) ? value : [value];
- }
-
-
-
-
-
-
-
- this.features = new Value(this.permute(path).map(function (path) {
- path = path.map(function (fragment) { return fragment.toCSS ? fragment : new Anonymous(fragment); });
- for (i = path.length - 1; i > 0; i--) {
- path.splice(i, 0, new Anonymous('and'));
- }
- return new Expression(path);
- }));
- this.setParent(this.features, this);
-
- return new Ruleset([], []);
- };
- Media.prototype.permute = function (arr) {
- if (arr.length === 0) {
- return [];
- }
- else if (arr.length === 1) {
- return arr[0];
- }
- else {
- var result = [];
- var rest = this.permute(arr.slice(1));
- for (var i = 0; i < rest.length; i++) {
- for (var j = 0; j < arr[0].length; j++) {
- result.push([arr[0][j]].concat(rest[i]));
- }
- }
- return result;
- }
- };
- Media.prototype.bubbleSelectors = function (selectors) {
- if (!selectors) {
- return;
- }
- this.rules = [new Ruleset(copyArray(selectors), [this.rules[0]])];
- this.setParent(this.rules, this);
- };
- Media.prototype.type = 'Media';
-
-
-
-
-
-
-
-
-
-
-
-
- var Import = function (path, features, options, index, currentFileInfo, visibilityInfo) {
- this.options = options;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.path = path;
- this.features = features;
- this.allowRoot = true;
- if (this.options.less !== undefined || this.options.inline) {
- this.css = !this.options.less || this.options.inline;
- }
- else {
- var pathValue = this.getPath();
- if (pathValue && /[#\.\&\?]css([\?;].*)?$/.test(pathValue)) {
- this.css = true;
- }
- }
- this.copyVisibilityInfo(visibilityInfo);
- this.setParent(this.features, this);
- this.setParent(this.path, this);
- };
- Import.prototype = new Node();
- Import.prototype.accept = function (visitor) {
- if (this.features) {
- this.features = visitor.visit(this.features);
- }
- this.path = visitor.visit(this.path);
- if (!this.options.isPlugin && !this.options.inline && this.root) {
- this.root = visitor.visit(this.root);
- }
- };
- Import.prototype.genCSS = function (context, output) {
- if (this.css && this.path._fileInfo.reference === undefined) {
- output.add('@import ', this._fileInfo, this._index);
- this.path.genCSS(context, output);
- if (this.features) {
- output.add(' ');
- this.features.genCSS(context, output);
- }
- output.add(';');
- }
- };
- Import.prototype.getPath = function () {
- return (this.path instanceof URL) ?
- this.path.value.value : this.path.value;
- };
- Import.prototype.isVariableImport = function () {
- var path = this.path;
- if (path instanceof URL) {
- path = path.value;
- }
- if (path instanceof Quoted) {
- return path.containsVariables();
- }
- return true;
- };
- Import.prototype.evalForImport = function (context) {
- var path = this.path;
- if (path instanceof URL) {
- path = path.value;
- }
- return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());
- };
- Import.prototype.evalPath = function (context) {
- var path = this.path.eval(context);
- var fileInfo = this._fileInfo;
- if (!(path instanceof URL)) {
-
- var pathValue = path.value;
- if (fileInfo &&
- pathValue &&
- context.pathRequiresRewrite(pathValue)) {
- path.value = context.rewritePath(pathValue, fileInfo.rootpath);
- }
- else {
- path.value = context.normalizePath(path.value);
- }
- }
- return path;
- };
- Import.prototype.eval = function (context) {
- var result = this.doEval(context);
- if (this.options.reference || this.blocksVisibility()) {
- if (result.length || result.length === 0) {
- result.forEach(function (node) {
- node.addVisibilityBlock();
- });
- }
- else {
- result.addVisibilityBlock();
- }
- }
- return result;
- };
- Import.prototype.doEval = function (context) {
- var ruleset;
- var registry;
- var features = this.features && this.features.eval(context);
- if (this.options.isPlugin) {
- if (this.root && this.root.eval) {
- try {
- this.root.eval(context);
- }
- catch (e) {
- e.message = 'Plugin error during evaluation';
- throw new LessError(e, this.root.imports, this.root.filename);
- }
- }
- registry = context.frames[0] && context.frames[0].functionRegistry;
- if (registry && this.root && this.root.functions) {
- registry.addMultiple(this.root.functions);
- }
- return [];
- }
- if (this.skip) {
- if (typeof this.skip === 'function') {
- this.skip = this.skip();
- }
- if (this.skip) {
- return [];
- }
- }
- if (this.options.inline) {
- var contents = new Anonymous(this.root, 0, {
- filename: this.importedFilename,
- reference: this.path._fileInfo && this.path._fileInfo.reference
- }, true, true);
- return this.features ? new Media([contents], this.features.value) : [contents];
- }
- else if (this.css) {
- var newImport = new Import(this.evalPath(context), features, this.options, this._index);
- if (!newImport.css && this.error) {
- throw this.error;
- }
- return newImport;
- }
- else if (this.root) {
- ruleset = new Ruleset(null, copyArray(this.root.rules));
- ruleset.evalImports(context);
- return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;
- }
- else {
- return [];
- }
- };
- Import.prototype.type = 'Import';
- var JsEvalNode = function () { };
- JsEvalNode.prototype = new Node();
- JsEvalNode.prototype.evaluateJavaScript = function (expression, context) {
- var result;
- var that = this;
- var evalContext = {};
- if (!context.javascriptEnabled) {
- throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',
- filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) { return that.jsify(new Variable("@" + name, that.getIndex(), that.fileInfo()).eval(context)); });
- try {
- expression = new Function("return (" + expression + ")");
- }
- catch (e) {
- throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`", filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- var variables = context.frames[0].variables();
- for (var k in variables) {
- if (variables.hasOwnProperty(k)) {
-
- evalContext[k.slice(1)] = {
- value: variables[k].value,
- toJS: function () {
- return this.value.eval(context).toCSS();
- }
- };
- }
- }
- try {
- result = expression.call(evalContext);
- }
- catch (e) {
- throw { message: "JavaScript evaluation error: '" + e.name + ": " + e.message.replace(/["]/g, '\'') + "'", filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- return result;
- };
- JsEvalNode.prototype.jsify = function (obj) {
- if (Array.isArray(obj.value) && (obj.value.length > 1)) {
- return "[" + obj.value.map(function (v) { return v.toCSS(); }).join(', ') + "]";
- }
- else {
- return obj.toCSS();
- }
- };
- var JavaScript = function (string, escaped, index, currentFileInfo) {
- this.escaped = escaped;
- this.expression = string;
- this._index = index;
- this._fileInfo = currentFileInfo;
- };
- JavaScript.prototype = new JsEvalNode();
- JavaScript.prototype.eval = function (context) {
- var result = this.evaluateJavaScript(this.expression, context);
- var type = typeof result;
- if (type === 'number' && !isNaN(result)) {
- return new Dimension(result);
- }
- else if (type === 'string') {
- return new Quoted("\"" + result + "\"", result, this.escaped, this._index);
- }
- else if (Array.isArray(result)) {
- return new Anonymous(result.join(', '));
- }
- else {
- return new Anonymous(result);
- }
- };
- JavaScript.prototype.type = 'JavaScript';
- var Assignment = function (key, val) {
- this.key = key;
- this.value = val;
- };
- Assignment.prototype = new Node();
- Assignment.prototype.accept = function (visitor) {
- this.value = visitor.visit(this.value);
- };
- Assignment.prototype.eval = function (context) {
- if (this.value.eval) {
- return new Assignment(this.key, this.value.eval(context));
- }
- return this;
- };
- Assignment.prototype.genCSS = function (context, output) {
- output.add(this.key + "=");
- if (this.value.genCSS) {
- this.value.genCSS(context, output);
- }
- else {
- output.add(this.value);
- }
- };
- Assignment.prototype.type = 'Assignment';
- var Condition = function (op, l, r, i, negate) {
- this.op = op.trim();
- this.lvalue = l;
- this.rvalue = r;
- this._index = i;
- this.negate = negate;
- };
- Condition.prototype = new Node();
- Condition.prototype.accept = function (visitor) {
- this.lvalue = visitor.visit(this.lvalue);
- this.rvalue = visitor.visit(this.rvalue);
- };
- Condition.prototype.eval = function (context) {
- var result = (function (op, a, b) {
- switch (op) {
- case 'and': return a && b;
- case 'or': return a || b;
- default:
- switch (Node.compare(a, b)) {
- case -1:
- return op === '<' || op === '=<' || op === '<=';
- case 0:
- return op === '=' || op === '>=' || op === '=<' || op === '<=';
- case 1:
- return op === '>' || op === '>=';
- default:
- return false;
- }
- }
- })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));
- return this.negate ? !result : result;
- };
- Condition.prototype.type = 'Condition';
- var UnicodeDescriptor = function (value) {
- this.value = value;
- };
- UnicodeDescriptor.prototype = new Node();
- UnicodeDescriptor.prototype.type = 'UnicodeDescriptor';
- var Negative = function (node) {
- this.value = node;
- };
- Negative.prototype = new Node();
- Negative.prototype.genCSS = function (context, output) {
- output.add('-');
- this.value.genCSS(context, output);
- };
- Negative.prototype.eval = function (context) {
- if (context.isMathOn()) {
- return (new Operation('*', [new Dimension(-1), this.value])).eval(context);
- }
- return new Negative(this.value.eval(context));
- };
- Negative.prototype.type = 'Negative';
- var Extend = function (selector, option, index, currentFileInfo, visibilityInfo) {
- this.selector = selector;
- this.option = option;
- this.object_id = Extend.next_id++;
- this.parent_ids = [this.object_id];
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.copyVisibilityInfo(visibilityInfo);
- this.allowRoot = true;
- switch (option) {
- case 'all':
- this.allowBefore = true;
- this.allowAfter = true;
- break;
- default:
- this.allowBefore = false;
- this.allowAfter = false;
- break;
- }
- this.setParent(this.selector, this);
- };
- Extend.prototype = new Node();
- Extend.prototype.accept = function (visitor) {
- this.selector = visitor.visit(this.selector);
- };
- Extend.prototype.eval = function (context) {
- return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());
- };
- Extend.prototype.clone = function (context) {
- return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());
- };
-
- Extend.prototype.findSelfSelectors = function (selectors) {
- var selfElements = [];
- var i;
- var selectorElements;
- for (i = 0; i < selectors.length; i++) {
- selectorElements = selectors[i].elements;
-
-
- if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {
- selectorElements[0].combinator.value = ' ';
- }
- selfElements = selfElements.concat(selectors[i].elements);
- }
- this.selfSelectors = [new Selector(selfElements)];
- this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());
- };
-
- Extend.next_id = 0;
- Extend.prototype.type = 'Extend';
- var VariableCall = function (variable, index, currentFileInfo) {
- this.variable = variable;
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.allowRoot = true;
- };
- VariableCall.prototype = new Node();
- VariableCall.prototype.eval = function (context) {
- var rules;
- var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);
- var error = new LessError({ message: "Could not evaluate variable call " + this.variable });
- if (!detachedRuleset.ruleset) {
- if (detachedRuleset.rules) {
- rules = detachedRuleset;
- }
- else if (Array.isArray(detachedRuleset)) {
- rules = new Ruleset('', detachedRuleset);
- }
- else if (Array.isArray(detachedRuleset.value)) {
- rules = new Ruleset('', detachedRuleset.value);
- }
- else {
- throw error;
- }
- detachedRuleset = new DetachedRuleset(rules);
- }
- if (detachedRuleset.ruleset) {
- return detachedRuleset.callEval(context);
- }
- throw error;
- };
- VariableCall.prototype.type = 'VariableCall';
- var NamespaceValue = function (ruleCall, lookups, index, fileInfo) {
- this.value = ruleCall;
- this.lookups = lookups;
- this._index = index;
- this._fileInfo = fileInfo;
- };
- NamespaceValue.prototype = new Node();
- NamespaceValue.prototype.eval = function (context) {
- var i;
- var name;
- var rules = this.value.eval(context);
- for (i = 0; i < this.lookups.length; i++) {
- name = this.lookups[i];
-
- if (Array.isArray(rules)) {
- rules = new Ruleset([new Selector()], rules);
- }
- if (name === '') {
- rules = rules.lastDeclaration();
- }
- else if (name.charAt(0) === '@') {
- if (name.charAt(1) === '@') {
- name = "@" + new Variable(name.substr(1)).eval(context).value;
- }
- if (rules.variables) {
- rules = rules.variable(name);
- }
- if (!rules) {
- throw { type: 'Name', message: "variable " + name + " not found", filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
- }
- else {
- if (name.substring(0, 2) === '$@') {
- name = "$" + new Variable(name.substr(1)).eval(context).value;
- }
- else {
- name = name.charAt(0) === '$' ? name : "$" + name;
- }
- if (rules.properties) {
- rules = rules.property(name);
- }
- if (!rules) {
- throw { type: 'Name', message: "property \"" + name.substr(1) + "\" not found", filename: this.fileInfo().filename,
- index: this.getIndex() };
- }
-
-
- rules = rules[rules.length - 1];
- }
- if (rules.value) {
- rules = rules.eval(context).value;
- }
- if (rules.ruleset) {
- rules = rules.ruleset.eval(context);
- }
- }
- return rules;
- };
- NamespaceValue.prototype.type = 'NamespaceValue';
- var Definition = function (name, params, rules, condition, variadic, frames, visibilityInfo) {
- this.name = name || 'anonymous mixin';
- this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];
- this.params = params;
- this.condition = condition;
- this.variadic = variadic;
- this.arity = params.length;
- this.rules = rules;
- this._lookups = {};
- var optionalParameters = [];
- this.required = params.reduce(function (count, p) {
- if (!p.name || (p.name && !p.value)) {
- return count + 1;
- }
- else {
- optionalParameters.push(p.name);
- return count;
- }
- }, 0);
- this.optionalParameters = optionalParameters;
- this.frames = frames;
- this.copyVisibilityInfo(visibilityInfo);
- this.allowRoot = true;
- };
- Definition.prototype = new Ruleset();
- Definition.prototype.accept = function (visitor) {
- if (this.params && this.params.length) {
- this.params = visitor.visitArray(this.params);
- }
- this.rules = visitor.visitArray(this.rules);
- if (this.condition) {
- this.condition = visitor.visit(this.condition);
- }
- };
- Definition.prototype.evalParams = function (context, mixinEnv, args, evaldArguments) {
-
- var frame = new Ruleset(null, null);
- var varargs;
- var arg;
- var params = copyArray(this.params);
- var i;
- var j;
- var val;
- var name;
- var isNamedFound;
- var argIndex;
- var argsLength = 0;
- if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {
- frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();
- }
- mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));
- if (args) {
- args = copyArray(args);
- argsLength = args.length;
- for (i = 0; i < argsLength; i++) {
- arg = args[i];
- if (name = (arg && arg.name)) {
- isNamedFound = false;
- for (j = 0; j < params.length; j++) {
- if (!evaldArguments[j] && name === params[j].name) {
- evaldArguments[j] = arg.value.eval(context);
- frame.prependRule(new Declaration(name, arg.value.eval(context)));
- isNamedFound = true;
- break;
- }
- }
- if (isNamedFound) {
- args.splice(i, 1);
- i--;
- continue;
- }
- else {
- throw { type: 'Runtime', message: "Named argument for " + this.name + " " + args[i].name + " not found" };
- }
- }
- }
- }
- argIndex = 0;
- for (i = 0; i < params.length; i++) {
- if (evaldArguments[i]) {
- continue;
- }
- arg = args && args[argIndex];
- if (name = params[i].name) {
- if (params[i].variadic) {
- varargs = [];
- for (j = argIndex; j < argsLength; j++) {
- varargs.push(args[j].value.eval(context));
- }
- frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));
- }
- else {
- val = arg && arg.value;
- if (val) {
-
- if (Array.isArray(val)) {
- val = new DetachedRuleset(new Ruleset('', val));
- }
- else {
- val = val.eval(context);
- }
- }
- else if (params[i].value) {
- val = params[i].value.eval(mixinEnv);
- frame.resetCache();
- }
- else {
- throw { type: 'Runtime', message: "wrong number of arguments for " + this.name + " (" + argsLength + " for " + this.arity + ")" };
- }
- frame.prependRule(new Declaration(name, val));
- evaldArguments[i] = val;
- }
- }
- if (params[i].variadic && args) {
- for (j = argIndex; j < argsLength; j++) {
- evaldArguments[j] = args[j].value.eval(context);
- }
- }
- argIndex++;
- }
- return frame;
- };
- Definition.prototype.makeImportant = function () {
- var rules = !this.rules ? this.rules : this.rules.map(function (r) {
- if (r.makeImportant) {
- return r.makeImportant(true);
- }
- else {
- return r;
- }
- });
- var result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);
- return result;
- };
- Definition.prototype.eval = function (context) {
- return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || copyArray(context.frames));
- };
- Definition.prototype.evalCall = function (context, args, important) {
- var _arguments = [];
- var mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;
- var frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);
- var rules;
- var ruleset;
- frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));
- rules = copyArray(this.rules);
- ruleset = new Ruleset(null, rules);
- ruleset.originalRuleset = this;
- ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));
- if (important) {
- ruleset = ruleset.makeImportant();
- }
- return ruleset;
- };
- Definition.prototype.matchCondition = function (args, context) {
- if (this.condition && !this.condition.eval(new contexts.Eval(context, [this.evalParams(context, new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]
- .concat(this.frames || [])
- .concat(context.frames)))) {
- return false;
- }
- return true;
- };
- Definition.prototype.matchArgs = function (args, context) {
- var allArgsCnt = (args && args.length) || 0;
- var len;
- var optionalParameters = this.optionalParameters;
- var requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {
- if (optionalParameters.indexOf(p.name) < 0) {
- return count + 1;
- }
- else {
- return count;
- }
- }, 0);
- if (!this.variadic) {
- if (requiredArgsCnt < this.required) {
- return false;
- }
- if (allArgsCnt > this.params.length) {
- return false;
- }
- }
- else {
- if (requiredArgsCnt < (this.required - 1)) {
- return false;
- }
- }
-
- len = Math.min(requiredArgsCnt, this.arity);
- for (var i = 0; i < len; i++) {
- if (!this.params[i].name && !this.params[i].variadic) {
- if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {
- return false;
- }
- }
- }
- return true;
- };
- Definition.prototype.type = 'MixinDefinition';
- Definition.prototype.evalFirst = true;
- var MixinCall = function (elements, args, index, currentFileInfo, important) {
- this.selector = new Selector(elements);
- this.arguments = args || [];
- this._index = index;
- this._fileInfo = currentFileInfo;
- this.important = important;
- this.allowRoot = true;
- this.setParent(this.selector, this);
- };
- MixinCall.prototype = new Node();
- MixinCall.prototype.accept = function (visitor) {
- if (this.selector) {
- this.selector = visitor.visit(this.selector);
- }
- if (this.arguments.length) {
- this.arguments = visitor.visitArray(this.arguments);
- }
- };
- MixinCall.prototype.eval = function (context) {
- var mixins;
- var mixin;
- var mixinPath;
- var args = [];
- var arg;
- var argValue;
- var rules = [];
- var match = false;
- var i;
- var m;
- var f;
- var isRecursive;
- var isOneFound;
- var candidates = [];
- var candidate;
- var conditionResult = [];
- var defaultResult;
- var defFalseEitherCase = -1;
- var defNone = 0;
- var defTrue = 1;
- var defFalse = 2;
- var count;
- var originalRuleset;
- var noArgumentsFilter;
- this.selector = this.selector.eval(context);
- function calcDefGroup(mixin, mixinPath) {
- var f;
- var p;
- var namespace;
- for (f = 0; f < 2; f++) {
- conditionResult[f] = true;
- defaultFunc.value(f);
- for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {
- namespace = mixinPath[p];
- if (namespace.matchCondition) {
- conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);
- }
- }
- if (mixin.matchCondition) {
- conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);
- }
- }
- if (conditionResult[0] || conditionResult[1]) {
- if (conditionResult[0] != conditionResult[1]) {
- return conditionResult[1] ?
- defTrue : defFalse;
- }
- return defNone;
- }
- return defFalseEitherCase;
- }
- for (i = 0; i < this.arguments.length; i++) {
- arg = this.arguments[i];
- argValue = arg.value.eval(context);
- if (arg.expand && Array.isArray(argValue.value)) {
- argValue = argValue.value;
- for (m = 0; m < argValue.length; m++) {
- args.push({ value: argValue[m] });
- }
- }
- else {
- args.push({ name: arg.name, value: argValue });
- }
- }
- noArgumentsFilter = function (rule) { return rule.matchArgs(null, context); };
- for (i = 0; i < context.frames.length; i++) {
- if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {
- isOneFound = true;
-
-
-
-
- for (m = 0; m < mixins.length; m++) {
- mixin = mixins[m].rule;
- mixinPath = mixins[m].path;
- isRecursive = false;
- for (f = 0; f < context.frames.length; f++) {
- if ((!(mixin instanceof Definition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {
- isRecursive = true;
- break;
- }
- }
- if (isRecursive) {
- continue;
- }
- if (mixin.matchArgs(args, context)) {
- candidate = { mixin: mixin, group: calcDefGroup(mixin, mixinPath) };
- if (candidate.group !== defFalseEitherCase) {
- candidates.push(candidate);
- }
- match = true;
- }
- }
- defaultFunc.reset();
- count = [0, 0, 0];
- for (m = 0; m < candidates.length; m++) {
- count[candidates[m].group]++;
- }
- if (count[defNone] > 0) {
- defaultResult = defFalse;
- }
- else {
- defaultResult = defTrue;
- if ((count[defTrue] + count[defFalse]) > 1) {
- throw { type: 'Runtime', message: "Ambiguous use of `default()` found when matching for `" + this.format(args) + "`", index: this.getIndex(), filename: this.fileInfo().filename };
- }
- }
- for (m = 0; m < candidates.length; m++) {
- candidate = candidates[m].group;
- if ((candidate === defNone) || (candidate === defaultResult)) {
- try {
- mixin = candidates[m].mixin;
- if (!(mixin instanceof Definition)) {
- originalRuleset = mixin.originalRuleset || mixin;
- mixin = new Definition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());
- mixin.originalRuleset = originalRuleset;
- }
- var newRules = mixin.evalCall(context, args, this.important).rules;
- this._setVisibilityToReplacement(newRules);
- Array.prototype.push.apply(rules, newRules);
- }
- catch (e) {
- throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };
- }
- }
- }
- if (match) {
- return rules;
- }
- }
- }
- if (isOneFound) {
- throw { type: 'Runtime', message: "No matching definition was found for `" + this.format(args) + "`", index: this.getIndex(), filename: this.fileInfo().filename };
- }
- else {
- throw { type: 'Name', message: this.selector.toCSS().trim() + " is undefined", index: this.getIndex(), filename: this.fileInfo().filename };
- }
- };
- MixinCall.prototype._setVisibilityToReplacement = function (replacement) {
- var i;
- var rule;
- if (this.blocksVisibility()) {
- for (i = 0; i < replacement.length; i++) {
- rule = replacement[i];
- rule.addVisibilityBlock();
- }
- }
- };
- MixinCall.prototype.format = function (args) {
- return this.selector.toCSS().trim() + "(" + (args ? args.map(function (a) {
- var argValue = '';
- if (a.name) {
- argValue += a.name + ":";
- }
- if (a.value.toCSS) {
- argValue += a.value.toCSS();
- }
- else {
- argValue += '???';
- }
- return argValue;
- }).join(', ') : '') + ")";
- };
- MixinCall.prototype.type = 'MixinCall';
- var tree = {
- Node: Node, Color: Color, AtRule: AtRule, DetachedRuleset: DetachedRuleset, Operation: Operation,
- Dimension: Dimension, Unit: Unit, Keyword: Keyword, Variable: Variable, Property: Property,
- Ruleset: Ruleset, Element: Element, Attribute: Attribute, Combinator: Combinator, Selector: Selector,
- Quoted: Quoted, Expression: Expression, Declaration: Declaration, Call: Call, URL: URL, Import: Import,
- Comment: Comment, Anonymous: Anonymous, Value: Value, JavaScript: JavaScript, Assignment: Assignment,
- Condition: Condition, Paren: Paren, Media: Media, UnicodeDescriptor: UnicodeDescriptor, Negative: Negative,
- Extend: Extend, VariableCall: VariableCall, NamespaceValue: NamespaceValue,
- mixin: {
- Call: MixinCall,
- Definition: Definition
- }
- };
- var logger = {
- error: function (msg) {
- this._fireEvent('error', msg);
- },
- warn: function (msg) {
- this._fireEvent('warn', msg);
- },
- info: function (msg) {
- this._fireEvent('info', msg);
- },
- debug: function (msg) {
- this._fireEvent('debug', msg);
- },
- addListener: function (listener) {
- this._listeners.push(listener);
- },
- removeListener: function (listener) {
- for (var i = 0; i < this._listeners.length; i++) {
- if (this._listeners[i] === listener) {
- this._listeners.splice(i, 1);
- return;
- }
- }
- },
- _fireEvent: function (type, msg) {
- for (var i = 0; i < this._listeners.length; i++) {
- var logFunction = this._listeners[i][type];
- if (logFunction) {
- logFunction(msg);
- }
- }
- },
- _listeners: []
- };
-
- var environment = (function () {
- function environment(externalEnvironment, fileManagers) {
- this.fileManagers = fileManagers || [];
- externalEnvironment = externalEnvironment || {};
- var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];
- var requiredFunctions = [];
- var functions = requiredFunctions.concat(optionalFunctions);
- for (var i = 0; i < functions.length; i++) {
- var propName = functions[i];
- var environmentFunc = externalEnvironment[propName];
- if (environmentFunc) {
- this[propName] = environmentFunc.bind(externalEnvironment);
- }
- else if (i < requiredFunctions.length) {
- this.warn("missing required function in environment - " + propName);
- }
- }
- }
- environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) {
- if (!filename) {
- logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');
- }
- if (currentDirectory == null) {
- logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');
- }
- var fileManagers = this.fileManagers;
- if (options.pluginManager) {
- fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());
- }
- for (var i = fileManagers.length - 1; i >= 0; i--) {
- var fileManager = fileManagers[i];
- if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {
- return fileManager;
- }
- }
- return null;
- };
- environment.prototype.addFileManager = function (fileManager) {
- this.fileManagers.push(fileManager);
- };
- environment.prototype.clearFileManagers = function () {
- this.fileManagers = [];
- };
- return environment;
- }());
- var AbstractFileManager = (function () {
- function AbstractFileManager() {
- }
- AbstractFileManager.prototype.getPath = function (filename) {
- var j = filename.lastIndexOf('?');
- if (j > 0) {
- filename = filename.slice(0, j);
- }
- j = filename.lastIndexOf('/');
- if (j < 0) {
- j = filename.lastIndexOf('\\');
- }
- if (j < 0) {
- return '';
- }
- return filename.slice(0, j + 1);
- };
- AbstractFileManager.prototype.tryAppendExtension = function (path, ext) {
- return /(\.[a-z]*$)|([\?;].*)$/.test(path) ? path : path + ext;
- };
- AbstractFileManager.prototype.tryAppendLessExtension = function (path) {
- return this.tryAppendExtension(path, '.less');
- };
- AbstractFileManager.prototype.supportsSync = function () { return false; };
- AbstractFileManager.prototype.alwaysMakePathsAbsolute = function () { return false; };
- AbstractFileManager.prototype.isPathAbsolute = function (filename) {
- return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename);
- };
-
- AbstractFileManager.prototype.join = function (basePath, laterPath) {
- if (!basePath) {
- return laterPath;
- }
- return basePath + laterPath;
- };
- AbstractFileManager.prototype.pathDiff = function (url, baseUrl) {
-
- var urlParts = this.extractUrlParts(url);
- var baseUrlParts = this.extractUrlParts(baseUrl);
- var i;
- var max;
- var urlDirectories;
- var baseUrlDirectories;
- var diff = '';
- if (urlParts.hostPart !== baseUrlParts.hostPart) {
- return '';
- }
- max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);
- for (i = 0; i < max; i++) {
- if (baseUrlParts.directories[i] !== urlParts.directories[i]) {
- break;
- }
- }
- baseUrlDirectories = baseUrlParts.directories.slice(i);
- urlDirectories = urlParts.directories.slice(i);
- for (i = 0; i < baseUrlDirectories.length - 1; i++) {
- diff += '../';
- }
- for (i = 0; i < urlDirectories.length - 1; i++) {
- diff += urlDirectories[i] + "/";
- }
- return diff;
- };
-
- AbstractFileManager.prototype.extractUrlParts = function (url, baseUrl) {
-
-
-
-
-
- var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i;
- var urlParts = url.match(urlPartsRegex);
- var returner = {};
- var rawDirectories = [];
- var directories = [];
- var i;
- var baseUrlParts;
- if (!urlParts) {
- throw new Error("Could not parse sheet href - '" + url + "'");
- }
-
- if (baseUrl && (!urlParts[1] || urlParts[2])) {
- baseUrlParts = baseUrl.match(urlPartsRegex);
- if (!baseUrlParts) {
- throw new Error("Could not parse page url - '" + baseUrl + "'");
- }
- urlParts[1] = urlParts[1] || baseUrlParts[1] || '';
- if (!urlParts[2]) {
- urlParts[3] = baseUrlParts[3] + urlParts[3];
- }
- }
- if (urlParts[3]) {
- rawDirectories = urlParts[3].replace(/\\/g, '/').split('/');
-
- for (i = 0; i < rawDirectories.length; i++) {
- if (rawDirectories[i] === '..') {
- directories.pop();
- }
- else if (rawDirectories[i] !== '.') {
- directories.push(rawDirectories[i]);
- }
- }
- }
- returner.hostPart = urlParts[1];
- returner.directories = directories;
- returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');
- returner.path = (urlParts[1] || '') + directories.join('/');
- returner.filename = urlParts[4];
- returner.fileUrl = returner.path + (urlParts[4] || '');
- returner.url = returner.fileUrl + (urlParts[5] || '');
- return returner;
- };
- return AbstractFileManager;
- }());
- var AbstractPluginLoader = (function () {
- function AbstractPluginLoader() {
-
- this.require = function () { return null; };
- }
- AbstractPluginLoader.prototype.evalPlugin = function (contents, context, imports, pluginOptions, fileInfo) {
- var loader;
- var registry;
- var pluginObj;
- var localModule;
- var pluginManager;
- var filename;
- var result;
- pluginManager = context.pluginManager;
- if (fileInfo) {
- if (typeof fileInfo === 'string') {
- filename = fileInfo;
- }
- else {
- filename = fileInfo.filename;
- }
- }
- var shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;
- if (filename) {
- pluginObj = pluginManager.get(filename);
- if (pluginObj) {
- result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
- if (result) {
- return result;
- }
- try {
- if (pluginObj.use) {
- pluginObj.use.call(this.context, pluginObj);
- }
- }
- catch (e) {
- e.message = e.message || 'Error during @plugin call';
- return new LessError(e, imports, filename);
- }
- return pluginObj;
- }
- }
- localModule = {
- exports: {},
- pluginManager: pluginManager,
- fileInfo: fileInfo
- };
- registry = functionRegistry.create();
- var registerPlugin = function (obj) {
- pluginObj = obj;
- };
- try {
- loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);
- loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);
- }
- catch (e) {
- return new LessError(e, imports, filename);
- }
- if (!pluginObj) {
- pluginObj = localModule.exports;
- }
- pluginObj = this.validatePlugin(pluginObj, filename, shortname);
- if (pluginObj instanceof LessError) {
- return pluginObj;
- }
- if (pluginObj) {
- pluginObj.imports = imports;
- pluginObj.filename = filename;
-
- if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {
- result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
- if (result) {
- return result;
- }
- }
-
- pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);
- pluginObj.functions = registry.getLocalFunctions();
-
- result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
- if (result) {
- return result;
- }
-
- try {
- if (pluginObj.use) {
- pluginObj.use.call(this.context, pluginObj);
- }
- }
- catch (e) {
- e.message = e.message || 'Error during @plugin call';
- return new LessError(e, imports, filename);
- }
- }
- else {
- return new LessError({ message: 'Not a valid plugin' }, imports, filename);
- }
- return pluginObj;
- };
- AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) {
- if (options && !plugin.setOptions) {
- return new LessError({
- message: "Options have been provided but the plugin " + name + " does not support any options."
- });
- }
- try {
- plugin.setOptions && plugin.setOptions(options);
- }
- catch (e) {
- return new LessError(e);
- }
- };
- AbstractPluginLoader.prototype.validatePlugin = function (plugin, filename, name) {
- if (plugin) {
-
-
- if (typeof plugin === 'function') {
- plugin = new plugin();
- }
- if (plugin.minVersion) {
- if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {
- return new LessError({
- message: "Plugin " + name + " requires version " + this.versionToString(plugin.minVersion)
- });
- }
- }
- return plugin;
- }
- return null;
- };
- AbstractPluginLoader.prototype.compareVersion = function (aVersion, bVersion) {
- if (typeof aVersion === 'string') {
- aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/);
- aVersion.shift();
- }
- for (var i = 0; i < aVersion.length; i++) {
- if (aVersion[i] !== bVersion[i]) {
- return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;
- }
- }
- return 0;
- };
- AbstractPluginLoader.prototype.versionToString = function (version) {
- var versionString = '';
- for (var i = 0; i < version.length; i++) {
- versionString += (versionString ? '.' : '') + version[i];
- }
- return versionString;
- };
- AbstractPluginLoader.prototype.printUsage = function (plugins) {
- for (var i = 0; i < plugins.length; i++) {
- var plugin = plugins[i];
- if (plugin.printUsage) {
- plugin.printUsage();
- }
- }
- };
- return AbstractPluginLoader;
- }());
- var _visitArgs = { visitDeeper: true };
- var _hasIndexed = false;
- function _noop(node) {
- return node;
- }
- function indexNodeTypes(parent, ticker) {
-
- var key;
- var child;
- for (key in parent) {
-
- child = parent[key];
- switch (typeof child) {
- case 'function':
-
-
- if (child.prototype && child.prototype.type) {
- child.prototype.typeIndex = ticker++;
- }
- break;
- case 'object':
- ticker = indexNodeTypes(child, ticker);
- break;
- }
- }
- return ticker;
- }
- var Visitor = (function () {
- function Visitor(implementation) {
- this._implementation = implementation;
- this._visitInCache = {};
- this._visitOutCache = {};
- if (!_hasIndexed) {
- indexNodeTypes(tree, 1);
- _hasIndexed = true;
- }
- }
- Visitor.prototype.visit = function (node) {
- if (!node) {
- return node;
- }
- var nodeTypeIndex = node.typeIndex;
- if (!nodeTypeIndex) {
-
- if (node.value && node.value.typeIndex) {
- this.visit(node.value);
- }
- return node;
- }
- var impl = this._implementation;
- var func = this._visitInCache[nodeTypeIndex];
- var funcOut = this._visitOutCache[nodeTypeIndex];
- var visitArgs = _visitArgs;
- var fnName;
- visitArgs.visitDeeper = true;
- if (!func) {
- fnName = "visit" + node.type;
- func = impl[fnName] || _noop;
- funcOut = impl[fnName + "Out"] || _noop;
- this._visitInCache[nodeTypeIndex] = func;
- this._visitOutCache[nodeTypeIndex] = funcOut;
- }
- if (func !== _noop) {
- var newNode = func.call(impl, node, visitArgs);
- if (node && impl.isReplacing) {
- node = newNode;
- }
- }
- if (visitArgs.visitDeeper && node) {
- if (node.length) {
- for (var i = 0, cnt = node.length; i < cnt; i++) {
- if (node[i].accept) {
- node[i].accept(this);
- }
- }
- }
- else if (node.accept) {
- node.accept(this);
- }
- }
- if (funcOut != _noop) {
- funcOut.call(impl, node);
- }
- return node;
- };
- Visitor.prototype.visitArray = function (nodes, nonReplacing) {
- if (!nodes) {
- return nodes;
- }
- var cnt = nodes.length;
- var i;
-
- if (nonReplacing || !this._implementation.isReplacing) {
- for (i = 0; i < cnt; i++) {
- this.visit(nodes[i]);
- }
- return nodes;
- }
-
- var out = [];
- for (i = 0; i < cnt; i++) {
- var evald = this.visit(nodes[i]);
- if (evald === undefined) {
- continue;
- }
- if (!evald.splice) {
- out.push(evald);
- }
- else if (evald.length) {
- this.flatten(evald, out);
- }
- }
- return out;
- };
- Visitor.prototype.flatten = function (arr, out) {
- if (!out) {
- out = [];
- }
- var cnt;
- var i;
- var item;
- var nestedCnt;
- var j;
- var nestedItem;
- for (i = 0, cnt = arr.length; i < cnt; i++) {
- item = arr[i];
- if (item === undefined) {
- continue;
- }
- if (!item.splice) {
- out.push(item);
- continue;
- }
- for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {
- nestedItem = item[j];
- if (nestedItem === undefined) {
- continue;
- }
- if (!nestedItem.splice) {
- out.push(nestedItem);
- }
- else if (nestedItem.length) {
- this.flatten(nestedItem, out);
- }
- }
- }
- return out;
- };
- return Visitor;
- }());
- var ImportSequencer = (function () {
- function ImportSequencer(onSequencerEmpty) {
- this.imports = [];
- this.variableImports = [];
- this._onSequencerEmpty = onSequencerEmpty;
- this._currentDepth = 0;
- }
- ImportSequencer.prototype.addImport = function (callback) {
- var importSequencer = this;
- var importItem = {
- callback: callback,
- args: null,
- isReady: false
- };
- this.imports.push(importItem);
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- importItem.args = Array.prototype.slice.call(args, 0);
- importItem.isReady = true;
- importSequencer.tryRun();
- };
- };
- ImportSequencer.prototype.addVariableImport = function (callback) {
- this.variableImports.push(callback);
- };
- ImportSequencer.prototype.tryRun = function () {
- this._currentDepth++;
- try {
- while (true) {
- while (this.imports.length > 0) {
- var importItem = this.imports[0];
- if (!importItem.isReady) {
- return;
- }
- this.imports = this.imports.slice(1);
- importItem.callback.apply(null, importItem.args);
- }
- if (this.variableImports.length === 0) {
- break;
- }
- var variableImport = this.variableImports[0];
- this.variableImports = this.variableImports.slice(1);
- variableImport();
- }
- }
- finally {
- this._currentDepth--;
- }
- if (this._currentDepth === 0 && this._onSequencerEmpty) {
- this._onSequencerEmpty();
- }
- };
- return ImportSequencer;
- }());
- var ImportVisitor = function (importer, finish) {
- this._visitor = new Visitor(this);
- this._importer = importer;
- this._finish = finish;
- this.context = new contexts.Eval();
- this.importCount = 0;
- this.onceFileDetectionMap = {};
- this.recursionDetector = {};
- this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));
- };
- ImportVisitor.prototype = {
- isReplacing: false,
- run: function (root) {
- try {
-
- this._visitor.visit(root);
- }
- catch (e) {
- this.error = e;
- }
- this.isFinished = true;
- this._sequencer.tryRun();
- },
- _onSequencerEmpty: function () {
- if (!this.isFinished) {
- return;
- }
- this._finish(this.error);
- },
- visitImport: function (importNode, visitArgs) {
- var inlineCSS = importNode.options.inline;
- if (!importNode.css || inlineCSS) {
- var context = new contexts.Eval(this.context, copyArray(this.context.frames));
- var importParent = context.frames[0];
- this.importCount++;
- if (importNode.isVariableImport()) {
- this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));
- }
- else {
- this.processImportNode(importNode, context, importParent);
- }
- }
- visitArgs.visitDeeper = false;
- },
- processImportNode: function (importNode, context, importParent) {
- var evaldImportNode;
- var inlineCSS = importNode.options.inline;
- try {
- evaldImportNode = importNode.evalForImport(context);
- }
- catch (e) {
- if (!e.filename) {
- e.index = importNode.getIndex();
- e.filename = importNode.fileInfo().filename;
- }
-
- importNode.css = true;
-
- importNode.error = e;
- }
- if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {
- if (evaldImportNode.options.multiple) {
- context.importMultiple = true;
- }
-
- var tryAppendLessExtension = evaldImportNode.css === undefined;
- for (var i = 0; i < importParent.rules.length; i++) {
- if (importParent.rules[i] === importNode) {
- importParent.rules[i] = evaldImportNode;
- break;
- }
- }
- var onImported = this.onImported.bind(this, evaldImportNode, context);
- var sequencedOnImported = this._sequencer.addImport(onImported);
- this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(), evaldImportNode.options, sequencedOnImported);
- }
- else {
- this.importCount--;
- if (this.isFinished) {
- this._sequencer.tryRun();
- }
- }
- },
- onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {
- if (e) {
- if (!e.filename) {
- e.index = importNode.getIndex();
- e.filename = importNode.fileInfo().filename;
- }
- this.error = e;
- }
- var importVisitor = this;
- var inlineCSS = importNode.options.inline;
- var isPlugin = importNode.options.isPlugin;
- var isOptional = importNode.options.optional;
- var duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;
- if (!context.importMultiple) {
- if (duplicateImport) {
- importNode.skip = true;
- }
- else {
- importNode.skip = function () {
- if (fullPath in importVisitor.onceFileDetectionMap) {
- return true;
- }
- importVisitor.onceFileDetectionMap[fullPath] = true;
- return false;
- };
- }
- }
- if (!fullPath && isOptional) {
- importNode.skip = true;
- }
- if (root) {
- importNode.root = root;
- importNode.importedFilename = fullPath;
- if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {
- importVisitor.recursionDetector[fullPath] = true;
- var oldContext = this.context;
- this.context = context;
- try {
- this._visitor.visit(root);
- }
- catch (e) {
- this.error = e;
- }
- this.context = oldContext;
- }
- }
- importVisitor.importCount--;
- if (importVisitor.isFinished) {
- importVisitor._sequencer.tryRun();
- }
- },
- visitDeclaration: function (declNode, visitArgs) {
- if (declNode.value.type === 'DetachedRuleset') {
- this.context.frames.unshift(declNode);
- }
- else {
- visitArgs.visitDeeper = false;
- }
- },
- visitDeclarationOut: function (declNode) {
- if (declNode.value.type === 'DetachedRuleset') {
- this.context.frames.shift();
- }
- },
- visitAtRule: function (atRuleNode, visitArgs) {
- this.context.frames.unshift(atRuleNode);
- },
- visitAtRuleOut: function (atRuleNode) {
- this.context.frames.shift();
- },
- visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {
- this.context.frames.unshift(mixinDefinitionNode);
- },
- visitMixinDefinitionOut: function (mixinDefinitionNode) {
- this.context.frames.shift();
- },
- visitRuleset: function (rulesetNode, visitArgs) {
- this.context.frames.unshift(rulesetNode);
- },
- visitRulesetOut: function (rulesetNode) {
- this.context.frames.shift();
- },
- visitMedia: function (mediaNode, visitArgs) {
- this.context.frames.unshift(mediaNode.rules[0]);
- },
- visitMediaOut: function (mediaNode) {
- this.context.frames.shift();
- }
- };
- var SetTreeVisibilityVisitor = (function () {
- function SetTreeVisibilityVisitor(visible) {
- this.visible = visible;
- }
- SetTreeVisibilityVisitor.prototype.run = function (root) {
- this.visit(root);
- };
- SetTreeVisibilityVisitor.prototype.visitArray = function (nodes) {
- if (!nodes) {
- return nodes;
- }
- var cnt = nodes.length;
- var i;
- for (i = 0; i < cnt; i++) {
- this.visit(nodes[i]);
- }
- return nodes;
- };
- SetTreeVisibilityVisitor.prototype.visit = function (node) {
- if (!node) {
- return node;
- }
- if (node.constructor === Array) {
- return this.visitArray(node);
- }
- if (!node.blocksVisibility || node.blocksVisibility()) {
- return node;
- }
- if (this.visible) {
- node.ensureVisibility();
- }
- else {
- node.ensureInvisibility();
- }
- node.accept(this);
- return node;
- };
- return SetTreeVisibilityVisitor;
- }());
-
- var ExtendFinderVisitor = (function () {
- function ExtendFinderVisitor() {
- this._visitor = new Visitor(this);
- this.contexts = [];
- this.allExtendsStack = [[]];
- }
- ExtendFinderVisitor.prototype.run = function (root) {
- root = this._visitor.visit(root);
- root.allExtends = this.allExtendsStack[0];
- return root;
- };
- ExtendFinderVisitor.prototype.visitDeclaration = function (declNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- ExtendFinderVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- ExtendFinderVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) {
- if (rulesetNode.root) {
- return;
- }
- var i;
- var j;
- var extend;
- var allSelectorsExtendList = [];
- var extendList;
-
- var rules = rulesetNode.rules;
- var ruleCnt = rules ? rules.length : 0;
- for (i = 0; i < ruleCnt; i++) {
- if (rulesetNode.rules[i] instanceof tree.Extend) {
- allSelectorsExtendList.push(rules[i]);
- rulesetNode.extendOnEveryPath = true;
- }
- }
-
-
- var paths = rulesetNode.paths;
- for (i = 0; i < paths.length; i++) {
- var selectorPath = paths[i];
- var selector = selectorPath[selectorPath.length - 1];
- var selExtendList = selector.extendList;
- extendList = selExtendList ? copyArray(selExtendList).concat(allSelectorsExtendList)
- : allSelectorsExtendList;
- if (extendList) {
- extendList = extendList.map(function (allSelectorsExtend) { return allSelectorsExtend.clone(); });
- }
- for (j = 0; j < extendList.length; j++) {
- this.foundExtends = true;
- extend = extendList[j];
- extend.findSelfSelectors(selectorPath);
- extend.ruleset = rulesetNode;
- if (j === 0) {
- extend.firstExtendOnThisSelectorPath = true;
- }
- this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);
- }
- }
- this.contexts.push(rulesetNode.selectors);
- };
- ExtendFinderVisitor.prototype.visitRulesetOut = function (rulesetNode) {
- if (!rulesetNode.root) {
- this.contexts.length = this.contexts.length - 1;
- }
- };
- ExtendFinderVisitor.prototype.visitMedia = function (mediaNode, visitArgs) {
- mediaNode.allExtends = [];
- this.allExtendsStack.push(mediaNode.allExtends);
- };
- ExtendFinderVisitor.prototype.visitMediaOut = function (mediaNode) {
- this.allExtendsStack.length = this.allExtendsStack.length - 1;
- };
- ExtendFinderVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) {
- atRuleNode.allExtends = [];
- this.allExtendsStack.push(atRuleNode.allExtends);
- };
- ExtendFinderVisitor.prototype.visitAtRuleOut = function (atRuleNode) {
- this.allExtendsStack.length = this.allExtendsStack.length - 1;
- };
- return ExtendFinderVisitor;
- }());
- var ProcessExtendsVisitor = (function () {
- function ProcessExtendsVisitor() {
- this._visitor = new Visitor(this);
- }
- ProcessExtendsVisitor.prototype.run = function (root) {
- var extendFinder = new ExtendFinderVisitor();
- this.extendIndices = {};
- extendFinder.run(root);
- if (!extendFinder.foundExtends) {
- return root;
- }
- root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));
- this.allExtendsStack = [root.allExtends];
- var newRoot = this._visitor.visit(root);
- this.checkExtendsForNonMatched(root.allExtends);
- return newRoot;
- };
- ProcessExtendsVisitor.prototype.checkExtendsForNonMatched = function (extendList) {
- var indices = this.extendIndices;
- extendList.filter(function (extend) { return !extend.hasFoundMatches && extend.parent_ids.length == 1; }).forEach(function (extend) {
- var selector = '_unknown_';
- try {
- selector = extend.selector.toCSS({});
- }
- catch (_) { }
- if (!indices[extend.index + " " + selector]) {
- indices[extend.index + " " + selector] = true;
- logger.warn("extend '" + selector + "' has no matches");
- }
- });
- };
- ProcessExtendsVisitor.prototype.doExtendChaining = function (extendsList, extendsListTarget, iterationCount) {
-
-
-
-
-
-
-
-
- var extendIndex;
- var targetExtendIndex;
- var matches;
- var extendsToAdd = [];
- var newSelector;
- var extendVisitor = this;
- var selectorPath;
- var extend;
- var targetExtend;
- var newExtend;
- iterationCount = iterationCount || 0;
-
-
-
-
-
-
- for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {
- for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {
- extend = extendsList[extendIndex];
- targetExtend = extendsListTarget[targetExtendIndex];
-
- if (extend.parent_ids.indexOf(targetExtend.object_id) >= 0) {
- continue;
- }
-
- selectorPath = [targetExtend.selfSelectors[0]];
- matches = extendVisitor.findMatch(extend, selectorPath);
- if (matches.length) {
- extend.hasFoundMatches = true;
-
- extend.selfSelectors.forEach(function (selfSelector) {
- var info = targetExtend.visibilityInfo();
-
- newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());
-
- newExtend = new (tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);
- newExtend.selfSelectors = newSelector;
-
- newSelector[newSelector.length - 1].extendList = [newExtend];
-
- extendsToAdd.push(newExtend);
- newExtend.ruleset = targetExtend.ruleset;
-
- newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);
-
-
-
- if (targetExtend.firstExtendOnThisSelectorPath) {
- newExtend.firstExtendOnThisSelectorPath = true;
- targetExtend.ruleset.paths.push(newSelector);
- }
- });
- }
- }
- }
- if (extendsToAdd.length) {
-
-
- this.extendChainCount++;
- if (iterationCount > 100) {
- var selectorOne = '{unable to calculate}';
- var selectorTwo = '{unable to calculate}';
- try {
- selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();
- selectorTwo = extendsToAdd[0].selector.toCSS();
- }
- catch (e) { }
- throw { message: "extend circular reference detected. One of the circular extends is currently:" + selectorOne + ":extend(" + selectorTwo + ")" };
- }
-
-
- return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));
- }
- else {
- return extendsToAdd;
- }
- };
- ProcessExtendsVisitor.prototype.visitDeclaration = function (ruleNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- ProcessExtendsVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- ProcessExtendsVisitor.prototype.visitSelector = function (selectorNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- ProcessExtendsVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) {
- if (rulesetNode.root) {
- return;
- }
- var matches;
- var pathIndex;
- var extendIndex;
- var allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];
- var selectorsToAdd = [];
- var extendVisitor = this;
- var selectorPath;
-
- for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {
- for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {
- selectorPath = rulesetNode.paths[pathIndex];
-
- if (rulesetNode.extendOnEveryPath) {
- continue;
- }
- var extendList = selectorPath[selectorPath.length - 1].extendList;
- if (extendList && extendList.length) {
- continue;
- }
- matches = this.findMatch(allExtends[extendIndex], selectorPath);
- if (matches.length) {
- allExtends[extendIndex].hasFoundMatches = true;
- allExtends[extendIndex].selfSelectors.forEach(function (selfSelector) {
- var extendedSelectors;
- extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());
- selectorsToAdd.push(extendedSelectors);
- });
- }
- }
- }
- rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);
- };
- ProcessExtendsVisitor.prototype.findMatch = function (extend, haystackSelectorPath) {
-
-
-
-
- var haystackSelectorIndex;
- var hackstackSelector;
- var hackstackElementIndex;
- var haystackElement;
- var targetCombinator;
- var i;
- var extendVisitor = this;
- var needleElements = extend.selector.elements;
- var potentialMatches = [];
- var potentialMatch;
- var matches = [];
-
- for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {
- hackstackSelector = haystackSelectorPath[haystackSelectorIndex];
- for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {
- haystackElement = hackstackSelector.elements[hackstackElementIndex];
-
- if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {
- potentialMatches.push({ pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,
- initialCombinator: haystackElement.combinator });
- }
- for (i = 0; i < potentialMatches.length; i++) {
- potentialMatch = potentialMatches[i];
-
-
-
- targetCombinator = haystackElement.combinator.value;
- if (targetCombinator === '' && hackstackElementIndex === 0) {
- targetCombinator = ' ';
- }
-
- if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||
- (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {
- potentialMatch = null;
- }
- else {
- potentialMatch.matched++;
- }
-
- if (potentialMatch) {
- potentialMatch.finished = potentialMatch.matched === needleElements.length;
- if (potentialMatch.finished &&
- (!extend.allowAfter &&
- (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {
- potentialMatch = null;
- }
- }
-
- if (potentialMatch) {
- if (potentialMatch.finished) {
- potentialMatch.length = needleElements.length;
- potentialMatch.endPathIndex = haystackSelectorIndex;
- potentialMatch.endPathElementIndex = hackstackElementIndex + 1;
- potentialMatches.length = 0;
- matches.push(potentialMatch);
- }
- }
- else {
- potentialMatches.splice(i, 1);
- i--;
- }
- }
- }
- }
- return matches;
- };
- ProcessExtendsVisitor.prototype.isElementValuesEqual = function (elementValue1, elementValue2) {
- if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {
- return elementValue1 === elementValue2;
- }
- if (elementValue1 instanceof tree.Attribute) {
- if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {
- return false;
- }
- if (!elementValue1.value || !elementValue2.value) {
- if (elementValue1.value || elementValue2.value) {
- return false;
- }
- return true;
- }
- elementValue1 = elementValue1.value.value || elementValue1.value;
- elementValue2 = elementValue2.value.value || elementValue2.value;
- return elementValue1 === elementValue2;
- }
- elementValue1 = elementValue1.value;
- elementValue2 = elementValue2.value;
- if (elementValue1 instanceof tree.Selector) {
- if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {
- return false;
- }
- for (var i = 0; i < elementValue1.elements.length; i++) {
- if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {
- if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {
- return false;
- }
- }
- if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {
- return false;
- }
- }
- return true;
- }
- return false;
- };
- ProcessExtendsVisitor.prototype.extendSelector = function (matches, selectorPath, replacementSelector, isVisible) {
-
- var currentSelectorPathIndex = 0;
- var currentSelectorPathElementIndex = 0;
- var path = [];
- var matchIndex;
- var selector;
- var firstElement;
- var match;
- var newElements;
- for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {
- match = matches[matchIndex];
- selector = selectorPath[match.pathIndex];
- firstElement = new tree.Element(match.initialCombinator, replacementSelector.elements[0].value, replacementSelector.elements[0].isVariable, replacementSelector.elements[0].getIndex(), replacementSelector.elements[0].fileInfo());
- if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {
- path[path.length - 1].elements = path[path.length - 1]
- .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));
- currentSelectorPathElementIndex = 0;
- currentSelectorPathIndex++;
- }
- newElements = selector.elements
- .slice(currentSelectorPathElementIndex, match.index)
- .concat([firstElement])
- .concat(replacementSelector.elements.slice(1));
- if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {
- path[path.length - 1].elements =
- path[path.length - 1].elements.concat(newElements);
- }
- else {
- path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));
- path.push(new tree.Selector(newElements));
- }
- currentSelectorPathIndex = match.endPathIndex;
- currentSelectorPathElementIndex = match.endPathElementIndex;
- if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {
- currentSelectorPathElementIndex = 0;
- currentSelectorPathIndex++;
- }
- }
- if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {
- path[path.length - 1].elements = path[path.length - 1]
- .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));
- currentSelectorPathIndex++;
- }
- path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));
- path = path.map(function (currentValue) {
-
- var derived = currentValue.createDerived(currentValue.elements);
- if (isVisible) {
- derived.ensureVisibility();
- }
- else {
- derived.ensureInvisibility();
- }
- return derived;
- });
- return path;
- };
- ProcessExtendsVisitor.prototype.visitMedia = function (mediaNode, visitArgs) {
- var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);
- newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));
- this.allExtendsStack.push(newAllExtends);
- };
- ProcessExtendsVisitor.prototype.visitMediaOut = function (mediaNode) {
- var lastIndex = this.allExtendsStack.length - 1;
- this.allExtendsStack.length = lastIndex;
- };
- ProcessExtendsVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) {
- var newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);
- newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));
- this.allExtendsStack.push(newAllExtends);
- };
- ProcessExtendsVisitor.prototype.visitAtRuleOut = function (atRuleNode) {
- var lastIndex = this.allExtendsStack.length - 1;
- this.allExtendsStack.length = lastIndex;
- };
- return ProcessExtendsVisitor;
- }());
- var JoinSelectorVisitor = (function () {
- function JoinSelectorVisitor() {
- this.contexts = [[]];
- this._visitor = new Visitor(this);
- }
- JoinSelectorVisitor.prototype.run = function (root) {
- return this._visitor.visit(root);
- };
- JoinSelectorVisitor.prototype.visitDeclaration = function (declNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- JoinSelectorVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) {
- visitArgs.visitDeeper = false;
- };
- JoinSelectorVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) {
- var context = this.contexts[this.contexts.length - 1];
- var paths = [];
- var selectors;
- this.contexts.push(paths);
- if (!rulesetNode.root) {
- selectors = rulesetNode.selectors;
- if (selectors) {
- selectors = selectors.filter(function (selector) { return selector.getIsOutput(); });
- rulesetNode.selectors = selectors.length ? selectors : (selectors = null);
- if (selectors) {
- rulesetNode.joinSelectors(paths, context, selectors);
- }
- }
- if (!selectors) {
- rulesetNode.rules = null;
- }
- rulesetNode.paths = paths;
- }
- };
- JoinSelectorVisitor.prototype.visitRulesetOut = function (rulesetNode) {
- this.contexts.length = this.contexts.length - 1;
- };
- JoinSelectorVisitor.prototype.visitMedia = function (mediaNode, visitArgs) {
- var context = this.contexts[this.contexts.length - 1];
- mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);
- };
- JoinSelectorVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) {
- var context = this.contexts[this.contexts.length - 1];
- if (atRuleNode.rules && atRuleNode.rules.length) {
- atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);
- }
- };
- return JoinSelectorVisitor;
- }());
- var CSSVisitorUtils = (function () {
- function CSSVisitorUtils(context) {
- this._visitor = new Visitor(this);
- this._context = context;
- }
- CSSVisitorUtils.prototype.containsSilentNonBlockedChild = function (bodyRules) {
- var rule;
- if (!bodyRules) {
- return false;
- }
- for (var r = 0; r < bodyRules.length; r++) {
- rule = bodyRules[r];
- if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {
-
-
- return true;
- }
- }
- return false;
- };
- CSSVisitorUtils.prototype.keepOnlyVisibleChilds = function (owner) {
- if (owner && owner.rules) {
- owner.rules = owner.rules.filter(function (thing) { return thing.isVisible(); });
- }
- };
- CSSVisitorUtils.prototype.isEmpty = function (owner) {
- return (owner && owner.rules)
- ? (owner.rules.length === 0) : true;
- };
- CSSVisitorUtils.prototype.hasVisibleSelector = function (rulesetNode) {
- return (rulesetNode && rulesetNode.paths)
- ? (rulesetNode.paths.length > 0) : false;
- };
- CSSVisitorUtils.prototype.resolveVisibility = function (node, originalRules) {
- if (!node.blocksVisibility()) {
- if (this.isEmpty(node) && !this.containsSilentNonBlockedChild(originalRules)) {
- return;
- }
- return node;
- }
- var compiledRulesBody = node.rules[0];
- this.keepOnlyVisibleChilds(compiledRulesBody);
- if (this.isEmpty(compiledRulesBody)) {
- return;
- }
- node.ensureVisibility();
- node.removeVisibilityBlock();
- return node;
- };
- CSSVisitorUtils.prototype.isVisibleRuleset = function (rulesetNode) {
- if (rulesetNode.firstRoot) {
- return true;
- }
- if (this.isEmpty(rulesetNode)) {
- return false;
- }
- if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {
- return false;
- }
- return true;
- };
- return CSSVisitorUtils;
- }());
- var ToCSSVisitor = function (context) {
- this._visitor = new Visitor(this);
- this._context = context;
- this.utils = new CSSVisitorUtils(context);
- };
- ToCSSVisitor.prototype = {
- isReplacing: true,
- run: function (root) {
- return this._visitor.visit(root);
- },
- visitDeclaration: function (declNode, visitArgs) {
- if (declNode.blocksVisibility() || declNode.variable) {
- return;
- }
- return declNode;
- },
- visitMixinDefinition: function (mixinNode, visitArgs) {
-
-
- mixinNode.frames = [];
- },
- visitExtend: function (extendNode, visitArgs) {
- },
- visitComment: function (commentNode, visitArgs) {
- if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {
- return;
- }
- return commentNode;
- },
- visitMedia: function (mediaNode, visitArgs) {
- var originalRules = mediaNode.rules[0].rules;
- mediaNode.accept(this._visitor);
- visitArgs.visitDeeper = false;
- return this.utils.resolveVisibility(mediaNode, originalRules);
- },
- visitImport: function (importNode, visitArgs) {
- if (importNode.blocksVisibility()) {
- return;
- }
- return importNode;
- },
- visitAtRule: function (atRuleNode, visitArgs) {
- if (atRuleNode.rules && atRuleNode.rules.length) {
- return this.visitAtRuleWithBody(atRuleNode, visitArgs);
- }
- else {
- return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);
- }
- },
- visitAnonymous: function (anonymousNode, visitArgs) {
- if (!anonymousNode.blocksVisibility()) {
- anonymousNode.accept(this._visitor);
- return anonymousNode;
- }
- },
- visitAtRuleWithBody: function (atRuleNode, visitArgs) {
-
-
- function hasFakeRuleset(atRuleNode) {
- var bodyRules = atRuleNode.rules;
- return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);
- }
- function getBodyRules(atRuleNode) {
- var nodeRules = atRuleNode.rules;
- if (hasFakeRuleset(atRuleNode)) {
- return nodeRules[0].rules;
- }
- return nodeRules;
- }
-
-
-
- var originalRules = getBodyRules(atRuleNode);
- atRuleNode.accept(this._visitor);
- visitArgs.visitDeeper = false;
- if (!this.utils.isEmpty(atRuleNode)) {
- this._mergeRules(atRuleNode.rules[0].rules);
- }
- return this.utils.resolveVisibility(atRuleNode, originalRules);
- },
- visitAtRuleWithoutBody: function (atRuleNode, visitArgs) {
- if (atRuleNode.blocksVisibility()) {
- return;
- }
- if (atRuleNode.name === '@charset') {
-
-
-
- if (this.charset) {
- if (atRuleNode.debugInfo) {
- var comment = new tree.Comment("/* " + atRuleNode.toCSS(this._context).replace(/\n/g, '') + " */\n");
- comment.debugInfo = atRuleNode.debugInfo;
- return this._visitor.visit(comment);
- }
- return;
- }
- this.charset = true;
- }
- return atRuleNode;
- },
- checkValidNodes: function (rules, isRoot) {
- if (!rules) {
- return;
- }
- for (var i = 0; i < rules.length; i++) {
- var ruleNode = rules[i];
- if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {
- throw { message: 'Properties must be inside selector blocks. They cannot be in the root',
- index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
- }
- if (ruleNode instanceof tree.Call) {
- throw { message: "Function '" + ruleNode.name + "' is undefined", index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
- }
- if (ruleNode.type && !ruleNode.allowRoot) {
- throw { message: ruleNode.type + " node returned by a function is not valid here", index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
- }
- }
- },
- visitRuleset: function (rulesetNode, visitArgs) {
-
- var rule;
- var rulesets = [];
- this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);
- if (!rulesetNode.root) {
-
- this._compileRulesetPaths(rulesetNode);
-
- var nodeRules = rulesetNode.rules;
- var nodeRuleCnt = nodeRules ? nodeRules.length : 0;
- for (var i = 0; i < nodeRuleCnt;) {
- rule = nodeRules[i];
- if (rule && rule.rules) {
-
- rulesets.push(this._visitor.visit(rule));
- nodeRules.splice(i, 1);
- nodeRuleCnt--;
- continue;
- }
- i++;
- }
-
-
-
- if (nodeRuleCnt > 0) {
- rulesetNode.accept(this._visitor);
- }
- else {
- rulesetNode.rules = null;
- }
- visitArgs.visitDeeper = false;
- }
- else {
- rulesetNode.accept(this._visitor);
- visitArgs.visitDeeper = false;
- }
- if (rulesetNode.rules) {
- this._mergeRules(rulesetNode.rules);
- this._removeDuplicateRules(rulesetNode.rules);
- }
-
- if (this.utils.isVisibleRuleset(rulesetNode)) {
- rulesetNode.ensureVisibility();
- rulesets.splice(0, 0, rulesetNode);
- }
- if (rulesets.length === 1) {
- return rulesets[0];
- }
- return rulesets;
- },
- _compileRulesetPaths: function (rulesetNode) {
- if (rulesetNode.paths) {
- rulesetNode.paths = rulesetNode.paths
- .filter(function (p) {
- var i;
- if (p[0].elements[0].combinator.value === ' ') {
- p[0].elements[0].combinator = new (tree.Combinator)('');
- }
- for (i = 0; i < p.length; i++) {
- if (p[i].isVisible() && p[i].getIsOutput()) {
- return true;
- }
- }
- return false;
- });
- }
- },
- _removeDuplicateRules: function (rules) {
- if (!rules) {
- return;
- }
-
- var ruleCache = {};
- var ruleList;
- var rule;
- var i;
- for (i = rules.length - 1; i >= 0; i--) {
- rule = rules[i];
- if (rule instanceof tree.Declaration) {
- if (!ruleCache[rule.name]) {
- ruleCache[rule.name] = rule;
- }
- else {
- ruleList = ruleCache[rule.name];
- if (ruleList instanceof tree.Declaration) {
- ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];
- }
- var ruleCSS = rule.toCSS(this._context);
- if (ruleList.indexOf(ruleCSS) !== -1) {
- rules.splice(i, 1);
- }
- else {
- ruleList.push(ruleCSS);
- }
- }
- }
- }
- },
- _mergeRules: function (rules) {
- if (!rules) {
- return;
- }
- var groups = {};
- var groupsArr = [];
- for (var i = 0; i < rules.length; i++) {
- var rule = rules[i];
- if (rule.merge) {
- var key = rule.name;
- groups[key] ? rules.splice(i--, 1) :
- groupsArr.push(groups[key] = []);
- groups[key].push(rule);
- }
- }
- groupsArr.forEach(function (group) {
- if (group.length > 0) {
- var result_1 = group[0];
- var space_1 = [];
- var comma_1 = [new tree.Expression(space_1)];
- group.forEach(function (rule) {
- if ((rule.merge === '+') && (space_1.length > 0)) {
- comma_1.push(new tree.Expression(space_1 = []));
- }
- space_1.push(rule.value);
- result_1.important = result_1.important || rule.important;
- });
- result_1.value = new tree.Value(comma_1);
- }
- });
- }
- };
- var visitors = {
- Visitor: Visitor,
- ImportVisitor: ImportVisitor,
- MarkVisibleSelectorsVisitor: SetTreeVisibilityVisitor,
- ExtendVisitor: ProcessExtendsVisitor,
- JoinSelectorVisitor: JoinSelectorVisitor,
- ToCSSVisitor: ToCSSVisitor
- };
-
- var chunker = (function (input, fail) {
- var len = input.length;
- var level = 0;
- var parenLevel = 0;
- var lastOpening;
- var lastOpeningParen;
- var lastMultiComment;
- var lastMultiCommentEndBrace;
- var chunks = [];
- var emitFrom = 0;
- var chunkerCurrentIndex;
- var currentChunkStartIndex;
- var cc;
- var cc2;
- var matched;
- function emitChunk(force) {
- var len = chunkerCurrentIndex - emitFrom;
- if (((len < 512) && !force) || !len) {
- return;
- }
- chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));
- emitFrom = chunkerCurrentIndex + 1;
- }
- for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {
- cc = input.charCodeAt(chunkerCurrentIndex);
- if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {
-
- continue;
- }
- switch (cc) {
- case 40:
- parenLevel++;
- lastOpeningParen = chunkerCurrentIndex;
- continue;
- case 41:
- if (--parenLevel < 0) {
- return fail('missing opening `(`', chunkerCurrentIndex);
- }
- continue;
- case 59:
- if (!parenLevel) {
- emitChunk();
- }
- continue;
- case 123:
- level++;
- lastOpening = chunkerCurrentIndex;
- continue;
- case 125:
- if (--level < 0) {
- return fail('missing opening `{`', chunkerCurrentIndex);
- }
- if (!level && !parenLevel) {
- emitChunk();
- }
- continue;
- case 92:
- if (chunkerCurrentIndex < len - 1) {
- chunkerCurrentIndex++;
- continue;
- }
- return fail('unescaped `\\`', chunkerCurrentIndex);
- case 34:
- case 39:
- case 96:
- matched = 0;
- currentChunkStartIndex = chunkerCurrentIndex;
- for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {
- cc2 = input.charCodeAt(chunkerCurrentIndex);
- if (cc2 > 96) {
- continue;
- }
- if (cc2 == cc) {
- matched = 1;
- break;
- }
- if (cc2 == 92) {
- if (chunkerCurrentIndex == len - 1) {
- return fail('unescaped `\\`', chunkerCurrentIndex);
- }
- chunkerCurrentIndex++;
- }
- }
- if (matched) {
- continue;
- }
- return fail("unmatched `" + String.fromCharCode(cc) + "`", currentChunkStartIndex);
- case 47:
- if (parenLevel || (chunkerCurrentIndex == len - 1)) {
- continue;
- }
- cc2 = input.charCodeAt(chunkerCurrentIndex + 1);
- if (cc2 == 47) {
-
- for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {
- cc2 = input.charCodeAt(chunkerCurrentIndex);
- if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) {
- break;
- }
- }
- }
- else if (cc2 == 42) {
-
- lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;
- for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {
- cc2 = input.charCodeAt(chunkerCurrentIndex);
- if (cc2 == 125) {
- lastMultiCommentEndBrace = chunkerCurrentIndex;
- }
- if (cc2 != 42) {
- continue;
- }
- if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) {
- break;
- }
- }
- if (chunkerCurrentIndex == len - 1) {
- return fail('missing closing `*/`', currentChunkStartIndex);
- }
- chunkerCurrentIndex++;
- }
- continue;
- case 42:
- if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {
- return fail('unmatched `/*`', chunkerCurrentIndex);
- }
- continue;
- }
- }
- if (level !== 0) {
- if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {
- return fail('missing closing `}` or `*/`', lastOpening);
- }
- else {
- return fail('missing closing `}`', lastOpening);
- }
- }
- else if (parenLevel !== 0) {
- return fail('missing closing `)`', lastOpeningParen);
- }
- emitChunk(true);
- return chunks;
- });
- var getParserInput = (function () {
- var
- input;
- var
- j;
- var
- saveStack = [];
- var
- furthest;
- var
- furthestPossibleErrorMessage;
- var
- chunks;
- var
- current;
- var
- currentPos;
- var parserInput = {};
- var CHARCODE_SPACE = 32;
- var CHARCODE_TAB = 9;
- var CHARCODE_LF = 10;
- var CHARCODE_CR = 13;
- var CHARCODE_PLUS = 43;
- var CHARCODE_COMMA = 44;
- var CHARCODE_FORWARD_SLASH = 47;
- var CHARCODE_9 = 57;
- function skipWhitespace(length) {
- var oldi = parserInput.i;
- var oldj = j;
- var curr = parserInput.i - currentPos;
- var endIndex = parserInput.i + current.length - curr;
- var mem = (parserInput.i += length);
- var inp = input;
- var c;
- var nextChar;
- var comment;
- for (; parserInput.i < endIndex; parserInput.i++) {
- c = inp.charCodeAt(parserInput.i);
- if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {
- nextChar = inp.charAt(parserInput.i + 1);
- if (nextChar === '/') {
- comment = { index: parserInput.i, isLineComment: true };
- var nextNewLine = inp.indexOf('\n', parserInput.i + 2);
- if (nextNewLine < 0) {
- nextNewLine = endIndex;
- }
- parserInput.i = nextNewLine;
- comment.text = inp.substr(comment.index, parserInput.i - comment.index);
- parserInput.commentStore.push(comment);
- continue;
- }
- else if (nextChar === '*') {
- var nextStarSlash = inp.indexOf('*/', parserInput.i + 2);
- if (nextStarSlash >= 0) {
- comment = {
- index: parserInput.i,
- text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),
- isLineComment: false
- };
- parserInput.i += comment.text.length - 1;
- parserInput.commentStore.push(comment);
- continue;
- }
- }
- break;
- }
- if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {
- break;
- }
- }
- current = current.slice(length + parserInput.i - mem + curr);
- currentPos = parserInput.i;
- if (!current.length) {
- if (j < chunks.length - 1) {
- current = chunks[++j];
- skipWhitespace(0);
- return true;
- }
- parserInput.finished = true;
- }
- return oldi !== parserInput.i || oldj !== j;
- }
- parserInput.save = function () {
- currentPos = parserInput.i;
- saveStack.push({ current: current, i: parserInput.i, j: j });
- };
- parserInput.restore = function (possibleErrorMessage) {
- if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {
- furthest = parserInput.i;
- furthestPossibleErrorMessage = possibleErrorMessage;
- }
- var state = saveStack.pop();
- current = state.current;
- currentPos = parserInput.i = state.i;
- j = state.j;
- };
- parserInput.forget = function () {
- saveStack.pop();
- };
- parserInput.isWhitespace = function (offset) {
- var pos = parserInput.i + (offset || 0);
- var code = input.charCodeAt(pos);
- return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);
- };
-
- parserInput.$re = function (tok) {
- if (parserInput.i > currentPos) {
- current = current.slice(parserInput.i - currentPos);
- currentPos = parserInput.i;
- }
- var m = tok.exec(current);
- if (!m) {
- return null;
- }
- skipWhitespace(m[0].length);
- if (typeof m === 'string') {
- return m;
- }
- return m.length === 1 ? m[0] : m;
- };
- parserInput.$char = function (tok) {
- if (input.charAt(parserInput.i) !== tok) {
- return null;
- }
- skipWhitespace(1);
- return tok;
- };
- parserInput.$str = function (tok) {
- var tokLength = tok.length;
-
- for (var i = 0; i < tokLength; i++) {
- if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {
- return null;
- }
- }
- skipWhitespace(tokLength);
- return tok;
- };
- parserInput.$quoted = function (loc) {
- var pos = loc || parserInput.i;
- var startChar = input.charAt(pos);
- if (startChar !== '\'' && startChar !== '"') {
- return;
- }
- var length = input.length;
- var currentPosition = pos;
- for (var i = 1; i + currentPosition < length; i++) {
- var nextChar = input.charAt(i + currentPosition);
- switch (nextChar) {
- case '\\':
- i++;
- continue;
- case '\r':
- case '\n':
- break;
- case startChar:
- var str = input.substr(currentPosition, i + 1);
- if (!loc && loc !== 0) {
- skipWhitespace(i + 1);
- return str;
- }
- return [startChar, str];
- }
- }
- return null;
- };
-
- parserInput.$parseUntil = function (tok) {
- var quote = '';
- var returnVal = null;
- var inComment = false;
- var blockDepth = 0;
- var blockStack = [];
- var parseGroups = [];
- var length = input.length;
- var startPos = parserInput.i;
- var lastPos = parserInput.i;
- var i = parserInput.i;
- var loop = true;
- var testChar;
- if (typeof tok === 'string') {
- testChar = function (char) { return char === tok; };
- }
- else {
- testChar = function (char) { return tok.test(char); };
- }
- do {
- var nextChar = input.charAt(i);
- if (blockDepth === 0 && testChar(nextChar)) {
- returnVal = input.substr(lastPos, i - lastPos);
- if (returnVal) {
- parseGroups.push(returnVal);
- }
- else {
- parseGroups.push(' ');
- }
- returnVal = parseGroups;
- skipWhitespace(i - startPos);
- loop = false;
- }
- else {
- if (inComment) {
- if (nextChar === '*' &&
- input.charAt(i + 1) === '/') {
- i++;
- blockDepth--;
- inComment = false;
- }
- i++;
- continue;
- }
- switch (nextChar) {
- case '\\':
- i++;
- nextChar = input.charAt(i);
- parseGroups.push(input.substr(lastPos, i - lastPos + 1));
- lastPos = i + 1;
- break;
- case '/':
- if (input.charAt(i + 1) === '*') {
- i++;
- inComment = true;
- blockDepth++;
- }
- break;
- case '\'':
- case '"':
- quote = parserInput.$quoted(i);
- if (quote) {
- parseGroups.push(input.substr(lastPos, i - lastPos), quote);
- i += quote[1].length - 1;
- lastPos = i + 1;
- }
- else {
- skipWhitespace(i - startPos);
- returnVal = nextChar;
- loop = false;
- }
- break;
- case '{':
- blockStack.push('}');
- blockDepth++;
- break;
- case '(':
- blockStack.push(')');
- blockDepth++;
- break;
- case '[':
- blockStack.push(']');
- blockDepth++;
- break;
- case '}':
- case ')':
- case ']':
- var expected = blockStack.pop();
- if (nextChar === expected) {
- blockDepth--;
- }
- else {
-
- skipWhitespace(i - startPos);
- returnVal = expected;
- loop = false;
- }
- }
- i++;
- if (i > length) {
- loop = false;
- }
- }
- } while (loop);
- return returnVal ? returnVal : null;
- };
- parserInput.autoCommentAbsorb = true;
- parserInput.commentStore = [];
- parserInput.finished = false;
-
-
- parserInput.peek = function (tok) {
- if (typeof tok === 'string') {
-
- for (var i = 0; i < tok.length; i++) {
- if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {
- return false;
- }
- }
- return true;
- }
- else {
- return tok.test(current);
- }
- };
-
-
- parserInput.peekChar = function (tok) { return input.charAt(parserInput.i) === tok; };
- parserInput.currentChar = function () { return input.charAt(parserInput.i); };
- parserInput.prevChar = function () { return input.charAt(parserInput.i - 1); };
- parserInput.getInput = function () { return input; };
- parserInput.peekNotNumeric = function () {
- var c = input.charCodeAt(parserInput.i);
-
- return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;
- };
- parserInput.start = function (str, chunkInput, failFunction) {
- input = str;
- parserInput.i = j = currentPos = furthest = 0;
-
-
-
-
-
-
-
-
-
-
- if (chunkInput) {
- chunks = chunker(str, failFunction);
- }
- else {
- chunks = [str];
- }
- current = chunks[0];
- skipWhitespace(0);
- };
- parserInput.end = function () {
- var message;
- var isFinished = parserInput.i >= input.length;
- if (parserInput.i < furthest) {
- message = furthestPossibleErrorMessage;
- parserInput.i = furthest;
- }
- return {
- isFinished: isFinished,
- furthest: parserInput.i,
- furthestPossibleErrorMessage: message,
- furthestReachedEnd: parserInput.i >= input.length - 1,
- furthestChar: input[parserInput.i]
- };
- };
- return parserInput;
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var Parser = function Parser(context, imports, fileInfo) {
- var parsers;
- var parserInput = getParserInput();
- function error(msg, type) {
- throw new LessError({
- index: parserInput.i,
- filename: fileInfo.filename,
- type: type || 'Syntax',
- message: msg
- }, imports);
- }
- function expect(arg, msg) {
-
- var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);
- if (result) {
- return result;
- }
- error(msg || (typeof arg === 'string'
- ? "expected '" + arg + "' got '" + parserInput.currentChar() + "'"
- : 'unexpected token'));
- }
-
- function expectChar(arg, msg) {
- if (parserInput.$char(arg)) {
- return arg;
- }
- error(msg || "expected '" + arg + "' got '" + parserInput.currentChar() + "'");
- }
- function getDebugInfo(index) {
- var filename = fileInfo.filename;
- return {
- lineNumber: getLocation(index, parserInput.getInput()).line + 1,
- fileName: filename
- };
- }
-
- function parseNode(str, parseList, currentIndex, fileInfo, callback) {
- var result;
- var returnNodes = [];
- var parser = parserInput;
- try {
- parser.start(str, false, function fail(msg, index) {
- callback({
- message: msg,
- index: index + currentIndex
- });
- });
- for (var x = 0, p = void 0, i = void 0; (p = parseList[x]); x++) {
- i = parser.i;
- result = parsers[p]();
- if (result) {
- try {
- result._index = i + currentIndex;
- result._fileInfo = fileInfo;
- }
- catch (e) { }
- returnNodes.push(result);
- }
- else {
- returnNodes.push(null);
- }
- }
- var endInfo = parser.end();
- if (endInfo.isFinished) {
- callback(null, returnNodes);
- }
- else {
- callback(true, null);
- }
- }
- catch (e) {
- throw new LessError({
- index: e.index + currentIndex,
- message: e.message
- }, imports, fileInfo.filename);
- }
- }
-
-
-
- return {
- parserInput: parserInput,
- imports: imports,
- fileInfo: fileInfo,
- parseNode: parseNode,
-
-
-
-
-
-
- parse: function (str, callback, additionalData) {
- var root;
- var error = null;
- var globalVars;
- var modifyVars;
- var ignored;
- var preText = '';
- globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars) + "\n" : '';
- modifyVars = (additionalData && additionalData.modifyVars) ? "\n" + Parser.serializeVars(additionalData.modifyVars) : '';
- if (context.pluginManager) {
- var preProcessors = context.pluginManager.getPreProcessors();
- for (var i = 0; i < preProcessors.length; i++) {
- str = preProcessors[i].process(str, { context: context, imports: imports, fileInfo: fileInfo });
- }
- }
- if (globalVars || (additionalData && additionalData.banner)) {
- preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;
- ignored = imports.contentsIgnoredChars;
- ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;
- ignored[fileInfo.filename] += preText.length;
- }
- str = str.replace(/\r\n?/g, '\n');
-
- str = preText + str.replace(/^\uFEFF/, '') + modifyVars;
- imports.contents[fileInfo.filename] = str;
-
-
-
-
- try {
- parserInput.start(str, context.chunkInput, function fail(msg, index) {
- throw new LessError({
- index: index,
- type: 'Parse',
- message: msg,
- filename: fileInfo.filename
- }, imports);
- });
- tree.Node.prototype.parse = this;
- root = new tree.Ruleset(null, this.parsers.primary());
- tree.Node.prototype.rootNode = root;
- root.root = true;
- root.firstRoot = true;
- root.functionRegistry = functionRegistry.inherit();
- }
- catch (e) {
- return callback(new LessError(e, imports, fileInfo.filename));
- }
-
-
-
-
-
-
-
-
- var endInfo = parserInput.end();
- if (!endInfo.isFinished) {
- var message = endInfo.furthestPossibleErrorMessage;
- if (!message) {
- message = 'Unrecognised input';
- if (endInfo.furthestChar === '}') {
- message += '. Possibly missing opening \'{\'';
- }
- else if (endInfo.furthestChar === ')') {
- message += '. Possibly missing opening \'(\'';
- }
- else if (endInfo.furthestReachedEnd) {
- message += '. Possibly missing something';
- }
- }
- error = new LessError({
- type: 'Parse',
- message: message,
- index: endInfo.furthest,
- filename: fileInfo.filename
- }, imports);
- }
- var finish = function (e) {
- e = error || e || imports.error;
- if (e) {
- if (!(e instanceof LessError)) {
- e = new LessError(e, imports, fileInfo.filename);
- }
- return callback(e);
- }
- else {
- return callback(null, root);
- }
- };
- if (context.processImports !== false) {
- new visitors.ImportVisitor(imports, finish)
- .run(root);
- }
- else {
- return finish();
- }
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- parsers: parsers = {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- primary: function () {
- var mixin = this.mixin;
- var root = [];
- var node;
- while (true) {
- while (true) {
- node = this.comment();
- if (!node) {
- break;
- }
- root.push(node);
- }
-
- if (parserInput.finished) {
- break;
- }
- if (parserInput.peek('}')) {
- break;
- }
- node = this.extendRule();
- if (node) {
- root = root.concat(node);
- continue;
- }
- node = mixin.definition() || this.declaration() || mixin.call(false, false) ||
- this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();
- if (node) {
- root.push(node);
- }
- else {
- var foundSemiColon = false;
- while (parserInput.$char(';')) {
- foundSemiColon = true;
- }
- if (!foundSemiColon) {
- break;
- }
- }
- }
- return root;
- },
-
-
- comment: function () {
- if (parserInput.commentStore.length) {
- var comment = parserInput.commentStore.shift();
- return new (tree.Comment)(comment.text, comment.isLineComment, comment.index, fileInfo);
- }
- },
-
-
-
- entities: {
- mixinLookup: function () {
- return parsers.mixin.call(true, true);
- },
-
-
-
-
-
- quoted: function (forceEscaped) {
- var str;
- var index = parserInput.i;
- var isEscaped = false;
- parserInput.save();
- if (parserInput.$char('~')) {
- isEscaped = true;
- }
- else if (forceEscaped) {
- parserInput.restore();
- return;
- }
- str = parserInput.$quoted();
- if (!str) {
- parserInput.restore();
- return;
- }
- parserInput.forget();
- return new (tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index, fileInfo);
- },
-
-
-
-
-
- keyword: function () {
- var k = parserInput.$char('%') || parserInput.$re(/^\[?(?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\]?/);
- if (k) {
- return tree.Color.fromKeyword(k) || new (tree.Keyword)(k);
- }
- },
-
-
-
-
-
-
-
- call: function () {
- var name;
- var args;
- var func;
- var index = parserInput.i;
-
- if (parserInput.peek(/^url\(/i)) {
- return;
- }
- parserInput.save();
- name = parserInput.$re(/^([\w-]+|%|progid:[\w\.]+)\(/);
- if (!name) {
- parserInput.forget();
- return;
- }
- name = name[1];
- func = this.customFuncCall(name);
- if (func) {
- args = func.parse();
- if (args && func.stop) {
- parserInput.forget();
- return args;
- }
- }
- args = this.arguments(args);
- if (!parserInput.$char(')')) {
- parserInput.restore('Could not parse call arguments or missing \')\'');
- return;
- }
- parserInput.forget();
- return new (tree.Call)(name, args, index, fileInfo);
- },
-
-
-
-
-
-
-
-
- customFuncCall: function (name) {
-
- return {
- alpha: f(parsers.ieAlpha, true),
- boolean: f(condition),
- 'if': f(condition)
- }[name.toLowerCase()];
- function f(parse, stop) {
- return {
- parse: parse,
- stop: stop
-
- };
- }
- function condition() {
- return [expect(parsers.condition, 'expected condition')];
- }
- },
- arguments: function (prevArgs) {
- var argsComma = prevArgs || [];
- var argsSemiColon = [];
- var isSemiColonSeparated;
- var value;
- parserInput.save();
- while (true) {
- if (prevArgs) {
- prevArgs = false;
- }
- else {
- value = parsers.detachedRuleset() || this.assignment() || parsers.expression();
- if (!value) {
- break;
- }
- if (value.value && value.value.length == 1) {
- value = value.value[0];
- }
- argsComma.push(value);
- }
- if (parserInput.$char(',')) {
- continue;
- }
- if (parserInput.$char(';') || isSemiColonSeparated) {
- isSemiColonSeparated = true;
- value = (argsComma.length < 1) ? argsComma[0]
- : new tree.Value(argsComma);
- argsSemiColon.push(value);
- argsComma = [];
- }
- }
- parserInput.forget();
- return isSemiColonSeparated ? argsSemiColon : argsComma;
- },
- literal: function () {
- return this.dimension() ||
- this.color() ||
- this.quoted() ||
- this.unicodeDescriptor();
- },
-
-
-
-
-
- assignment: function () {
- var key;
- var value;
- parserInput.save();
- key = parserInput.$re(/^\w+(?=\s?=)/i);
- if (!key) {
- parserInput.restore();
- return;
- }
- if (!parserInput.$char('=')) {
- parserInput.restore();
- return;
- }
- value = parsers.entity();
- if (value) {
- parserInput.forget();
- return new (tree.Assignment)(key, value);
- }
- else {
- parserInput.restore();
- }
- },
-
-
-
-
-
-
-
- url: function () {
- var value;
- var index = parserInput.i;
- parserInput.autoCommentAbsorb = false;
- if (!parserInput.$str('url(')) {
- parserInput.autoCommentAbsorb = true;
- return;
- }
- value = this.quoted() || this.variable() || this.property() ||
- parserInput.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || '';
- parserInput.autoCommentAbsorb = true;
- expectChar(')');
- return new (tree.URL)((value.value != null ||
- value instanceof tree.Variable ||
- value instanceof tree.Property) ?
- value : new (tree.Anonymous)(value, index), index, fileInfo);
- },
-
-
-
-
-
-
-
-
- variable: function () {
- var ch;
- var name;
- var index = parserInput.i;
- parserInput.save();
- if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) {
- ch = parserInput.currentChar();
- if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\s/)) {
-
- var result = parsers.variableCall(name);
- if (result) {
- parserInput.forget();
- return result;
- }
- }
- parserInput.forget();
- return new (tree.Variable)(name, index, fileInfo);
- }
- parserInput.restore();
- },
-
- variableCurly: function () {
- var curly;
- var index = parserInput.i;
- if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) {
- return new (tree.Variable)("@" + curly[1], index, fileInfo);
- }
- },
-
-
-
-
-
- property: function () {
- var name;
- var index = parserInput.i;
- if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\$[\w-]+/))) {
- return new (tree.Property)(name, index, fileInfo);
- }
- },
-
- propertyCurly: function () {
- var curly;
- var index = parserInput.i;
- if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) {
- return new (tree.Property)("$" + curly[1], index, fileInfo);
- }
- },
-
-
-
-
-
-
-
- color: function () {
- var rgb;
- parserInput.save();
- if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\w.#\[])?/))) {
- if (!rgb[2]) {
- parserInput.forget();
- return new (tree.Color)(rgb[1], undefined, rgb[0]);
- }
- }
- parserInput.restore();
- },
- colorKeyword: function () {
- parserInput.save();
- var autoCommentAbsorb = parserInput.autoCommentAbsorb;
- parserInput.autoCommentAbsorb = false;
- var k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);
- parserInput.autoCommentAbsorb = autoCommentAbsorb;
- if (!k) {
- parserInput.forget();
- return;
- }
- parserInput.restore();
- var color = tree.Color.fromKeyword(k);
- if (color) {
- parserInput.$str(k);
- return color;
- }
- },
-
-
-
-
-
- dimension: function () {
- if (parserInput.peekNotNumeric()) {
- return;
- }
- var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i);
- if (value) {
- return new (tree.Dimension)(value[1], value[2]);
- }
- },
-
-
-
-
-
- unicodeDescriptor: function () {
- var ud;
- ud = parserInput.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/);
- if (ud) {
- return new (tree.UnicodeDescriptor)(ud[0]);
- }
- },
-
-
-
-
-
- javascript: function () {
- var js;
- var index = parserInput.i;
- parserInput.save();
- var escape = parserInput.$char('~');
- var jsQuote = parserInput.$char('`');
- if (!jsQuote) {
- parserInput.restore();
- return;
- }
- js = parserInput.$re(/^[^`]*`/);
- if (js) {
- parserInput.forget();
- return new (tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index, fileInfo);
- }
- parserInput.restore('invalid javascript definition');
- }
- },
-
-
-
-
-
- variable: function () {
- var name;
- if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) {
- return name[1];
- }
- },
-
-
-
-
-
-
-
-
- variableCall: function (parsedName) {
- var lookups;
- var i = parserInput.i;
- var inValue = !!parsedName;
- var name = parsedName;
- parserInput.save();
- if (name || (parserInput.currentChar() === '@'
- && (name = parserInput.$re(/^(@[\w-]+)(\(\s*\))?/)))) {
- lookups = this.mixin.ruleLookups();
- if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {
- parserInput.restore('Missing \'[...]\' lookup in variable call');
- return;
- }
- if (!inValue) {
- name = name[1];
- }
- var call = new tree.VariableCall(name, i, fileInfo);
- if (!inValue && parsers.end()) {
- parserInput.forget();
- return call;
- }
- else {
- parserInput.forget();
- return new tree.NamespaceValue(call, lookups, i, fileInfo);
- }
- }
- parserInput.restore();
- },
-
-
-
- extend: function (isRule) {
- var elements;
- var e;
- var index = parserInput.i;
- var option;
- var extendList;
- var extend;
- if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {
- return;
- }
- do {
- option = null;
- elements = null;
- while (!(option = parserInput.$re(/^(all)(?=\s*(\)|,))/))) {
- e = this.element();
- if (!e) {
- break;
- }
- if (elements) {
- elements.push(e);
- }
- else {
- elements = [e];
- }
- }
- option = option && option[1];
- if (!elements) {
- error('Missing target selector for :extend().');
- }
- extend = new (tree.Extend)(new (tree.Selector)(elements), option, index, fileInfo);
- if (extendList) {
- extendList.push(extend);
- }
- else {
- extendList = [extend];
- }
- } while (parserInput.$char(','));
- expect(/^\)/);
- if (isRule) {
- expect(/^;/);
- }
- return extendList;
- },
-
-
-
- extendRule: function () {
- return this.extend(true);
- },
-
-
-
- mixin: {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- call: function (inValue, getLookup) {
- var s = parserInput.currentChar();
- var important = false;
- var lookups;
- var index = parserInput.i;
- var elements;
- var args;
- var hasParens;
- if (s !== '.' && s !== '#') {
- return;
- }
- parserInput.save();
- elements = this.elements();
- if (elements) {
- if (parserInput.$char('(')) {
- args = this.args(true).args;
- expectChar(')');
- hasParens = true;
- }
- if (getLookup !== false) {
- lookups = this.ruleLookups();
- }
- if (getLookup === true && !lookups) {
- parserInput.restore();
- return;
- }
- if (inValue && !lookups && !hasParens) {
-
- parserInput.restore();
- return;
- }
- if (!inValue && parsers.important()) {
- important = true;
- }
- if (inValue || parsers.end()) {
- parserInput.forget();
- var mixin = new (tree.mixin.Call)(elements, args, index, fileInfo, !lookups && important);
- if (lookups) {
- return new tree.NamespaceValue(mixin, lookups);
- }
- else {
- return mixin;
- }
- }
- }
- parserInput.restore();
- },
-
- elements: function () {
- var elements;
- var e;
- var c;
- var elem;
- var elemIndex;
- var re = /^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;
- while (true) {
- elemIndex = parserInput.i;
- e = parserInput.$re(re);
- if (!e) {
- break;
- }
- elem = new (tree.Element)(c, e, false, elemIndex, fileInfo);
- if (elements) {
- elements.push(elem);
- }
- else {
- elements = [elem];
- }
- c = parserInput.$char('>');
- }
- return elements;
- },
- args: function (isCall) {
- var entities = parsers.entities;
- var returner = { args: null, variadic: false };
- var expressions = [];
- var argsSemiColon = [];
- var argsComma = [];
- var isSemiColonSeparated;
- var expressionContainsNamed;
- var name;
- var nameLoop;
- var value;
- var arg;
- var expand;
- var hasSep = true;
- parserInput.save();
- while (true) {
- if (isCall) {
- arg = parsers.detachedRuleset() || parsers.expression();
- }
- else {
- parserInput.commentStore.length = 0;
- if (parserInput.$str('...')) {
- returner.variadic = true;
- if (parserInput.$char(';') && !isSemiColonSeparated) {
- isSemiColonSeparated = true;
- }
- (isSemiColonSeparated ? argsSemiColon : argsComma)
- .push({ variadic: true });
- break;
- }
- arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);
- }
- if (!arg || !hasSep) {
- break;
- }
- nameLoop = null;
- if (arg.throwAwayComments) {
- arg.throwAwayComments();
- }
- value = arg;
- var val = null;
- if (isCall) {
-
- if (arg.value && arg.value.length == 1) {
- val = arg.value[0];
- }
- }
- else {
- val = arg;
- }
- if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {
- if (parserInput.$char(':')) {
- if (expressions.length > 0) {
- if (isSemiColonSeparated) {
- error('Cannot mix ; and , as delimiter types');
- }
- expressionContainsNamed = true;
- }
- value = parsers.detachedRuleset() || parsers.expression();
- if (!value) {
- if (isCall) {
- error('could not understand value for named argument');
- }
- else {
- parserInput.restore();
- returner.args = [];
- return returner;
- }
- }
- nameLoop = (name = val.name);
- }
- else if (parserInput.$str('...')) {
- if (!isCall) {
- returner.variadic = true;
- if (parserInput.$char(';') && !isSemiColonSeparated) {
- isSemiColonSeparated = true;
- }
- (isSemiColonSeparated ? argsSemiColon : argsComma)
- .push({ name: arg.name, variadic: true });
- break;
- }
- else {
- expand = true;
- }
- }
- else if (!isCall) {
- name = nameLoop = val.name;
- value = null;
- }
- }
- if (value) {
- expressions.push(value);
- }
- argsComma.push({ name: nameLoop, value: value, expand: expand });
- if (parserInput.$char(',')) {
- hasSep = true;
- continue;
- }
- hasSep = parserInput.$char(';') === ';';
- if (hasSep || isSemiColonSeparated) {
- if (expressionContainsNamed) {
- error('Cannot mix ; and , as delimiter types');
- }
- isSemiColonSeparated = true;
- if (expressions.length > 1) {
- value = new (tree.Value)(expressions);
- }
- argsSemiColon.push({ name: name, value: value, expand: expand });
- name = null;
- expressions = [];
- expressionContainsNamed = false;
- }
- }
- parserInput.forget();
- returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;
- return returner;
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- definition: function () {
- var name;
- var params = [];
- var match;
- var ruleset;
- var cond;
- var variadic = false;
- if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||
- parserInput.peek(/^[^{]*\}/)) {
- return;
- }
- parserInput.save();
- match = parserInput.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/);
- if (match) {
- name = match[1];
- var argInfo = this.args(false);
- params = argInfo.args;
- variadic = argInfo.variadic;
-
-
-
-
-
- if (!parserInput.$char(')')) {
- parserInput.restore('Missing closing \')\'');
- return;
- }
- parserInput.commentStore.length = 0;
- if (parserInput.$str('when')) {
- cond = expect(parsers.conditions, 'expected condition');
- }
- ruleset = parsers.block();
- if (ruleset) {
- parserInput.forget();
- return new (tree.mixin.Definition)(name, params, ruleset, cond, variadic);
- }
- else {
- parserInput.restore();
- }
- }
- else {
- parserInput.restore();
- }
- },
- ruleLookups: function () {
- var rule;
- var lookups = [];
- if (parserInput.currentChar() !== '[') {
- return;
- }
- while (true) {
- parserInput.save();
- rule = this.lookupValue();
- if (!rule && rule !== '') {
- parserInput.restore();
- break;
- }
- lookups.push(rule);
- parserInput.forget();
- }
- if (lookups.length > 0) {
- return lookups;
- }
- },
- lookupValue: function () {
- parserInput.save();
- if (!parserInput.$char('[')) {
- parserInput.restore();
- return;
- }
- var name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);
- if (!parserInput.$char(']')) {
- parserInput.restore();
- return;
- }
- if (name || name === '') {
- parserInput.forget();
- return name;
- }
- parserInput.restore();
- }
- },
-
-
-
-
- entity: function () {
- var entities = this.entities;
- return this.comment() || entities.literal() || entities.variable() || entities.url() ||
- entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||
- entities.javascript();
- },
-
-
-
-
-
- end: function () {
- return parserInput.$char(';') || parserInput.peek('}');
- },
-
-
-
-
-
- ieAlpha: function () {
- var value;
-
- if (!parserInput.$re(/^opacity=/i)) {
- return;
- }
- value = parserInput.$re(/^\d+/);
- if (!value) {
- value = expect(parsers.entities.variable, 'Could not parse alpha');
- value = "@{" + value.name.slice(1) + "}";
- }
- expectChar(')');
- return new tree.Quoted('', "alpha(opacity=" + value + ")");
- },
-
-
-
-
-
-
-
-
-
-
-
-
- element: function () {
- var e;
- var c;
- var v;
- var index = parserInput.i;
- c = this.combinator();
- e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) ||
- parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||
- parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||
- parserInput.$re(/^\([^&()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) ||
- this.entities.variableCurly();
- if (!e) {
- parserInput.save();
- if (parserInput.$char('(')) {
- if ((v = this.selector(false)) && parserInput.$char(')')) {
- e = new (tree.Paren)(v);
- parserInput.forget();
- }
- else {
- parserInput.restore('Missing closing \')\'');
- }
- }
- else {
- parserInput.forget();
- }
- }
- if (e) {
- return new (tree.Element)(c, e, e instanceof tree.Variable, index, fileInfo);
- }
- },
-
-
-
-
-
-
-
-
-
- combinator: function () {
- var c = parserInput.currentChar();
- if (c === '/') {
- parserInput.save();
- var slashedCombinator = parserInput.$re(/^\/[a-z]+\//i);
- if (slashedCombinator) {
- parserInput.forget();
- return new (tree.Combinator)(slashedCombinator);
- }
- parserInput.restore();
- }
- if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {
- parserInput.i++;
- if (c === '^' && parserInput.currentChar() === '^') {
- c = '^^';
- parserInput.i++;
- }
- while (parserInput.isWhitespace()) {
- parserInput.i++;
- }
- return new (tree.Combinator)(c);
- }
- else if (parserInput.isWhitespace(-1)) {
- return new (tree.Combinator)(' ');
- }
- else {
- return new (tree.Combinator)(null);
- }
- },
-
-
-
-
-
-
-
-
-
- selector: function (isLess) {
- var index = parserInput.i;
- var elements;
- var extendList;
- var c;
- var e;
- var allExtends;
- var when;
- var condition;
- isLess = isLess !== false;
- while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {
- if (when) {
- condition = expect(this.conditions, 'expected condition');
- }
- else if (condition) {
- error('CSS guard can only be used at the end of selector');
- }
- else if (extendList) {
- if (allExtends) {
- allExtends = allExtends.concat(extendList);
- }
- else {
- allExtends = extendList;
- }
- }
- else {
- if (allExtends) {
- error('Extend can only be used at the end of selector');
- }
- c = parserInput.currentChar();
- if (elements) {
- elements.push(e);
- }
- else {
- elements = [e];
- }
- e = null;
- }
- if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {
- break;
- }
- }
- if (elements) {
- return new (tree.Selector)(elements, allExtends, condition, index, fileInfo);
- }
- if (allExtends) {
- error('Extend must be used to extend a selector, it cannot be used on its own');
- }
- },
- selectors: function () {
- var s;
- var selectors;
- while (true) {
- s = this.selector();
- if (!s) {
- break;
- }
- if (selectors) {
- selectors.push(s);
- }
- else {
- selectors = [s];
- }
- parserInput.commentStore.length = 0;
- if (s.condition && selectors.length > 1) {
- error("Guards are only currently allowed on a single selector.");
- }
- if (!parserInput.$char(',')) {
- break;
- }
- if (s.condition) {
- error("Guards are only currently allowed on a single selector.");
- }
- parserInput.commentStore.length = 0;
- }
- return selectors;
- },
- attribute: function () {
- if (!parserInput.$char('[')) {
- return;
- }
- var entities = this.entities;
- var key;
- var val;
- var op;
- if (!(key = entities.variableCurly())) {
- key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/);
- }
- op = parserInput.$re(/^[|~*$^]?=/);
- if (op) {
- val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly();
- }
- expectChar(']');
- return new (tree.Attribute)(key, op, val);
- },
-
-
-
-
- block: function () {
- var content;
- if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {
- return content;
- }
- },
- blockRuleset: function () {
- var block = this.block();
- if (block) {
- block = new tree.Ruleset(null, block);
- }
- return block;
- },
- detachedRuleset: function () {
- var argInfo;
- var params;
- var variadic;
- parserInput.save();
- if (parserInput.$re(/^[.#]\(/)) {
-
- argInfo = this.mixin.args(false);
- params = argInfo.args;
- variadic = argInfo.variadic;
- if (!parserInput.$char(')')) {
- parserInput.restore();
- return;
- }
- }
- var blockRuleset = this.blockRuleset();
- if (blockRuleset) {
- parserInput.forget();
- if (params) {
- return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);
- }
- return new tree.DetachedRuleset(blockRuleset);
- }
- parserInput.restore();
- },
-
-
-
- ruleset: function () {
- var selectors;
- var rules;
- var debugInfo;
- parserInput.save();
- if (context.dumpLineNumbers) {
- debugInfo = getDebugInfo(parserInput.i);
- }
- selectors = this.selectors();
- if (selectors && (rules = this.block())) {
- parserInput.forget();
- var ruleset = new (tree.Ruleset)(selectors, rules, context.strictImports);
- if (context.dumpLineNumbers) {
- ruleset.debugInfo = debugInfo;
- }
- return ruleset;
- }
- else {
- parserInput.restore();
- }
- },
- declaration: function () {
- var name;
- var value;
- var index = parserInput.i;
- var hasDR;
- var c = parserInput.currentChar();
- var important;
- var merge;
- var isVariable;
- if (c === '.' || c === '#' || c === '&' || c === ':') {
- return;
- }
- parserInput.save();
- name = this.variable() || this.ruleProperty();
- if (name) {
- isVariable = typeof name === 'string';
- if (isVariable) {
- value = this.detachedRuleset();
- if (value) {
- hasDR = true;
- }
- }
- parserInput.commentStore.length = 0;
- if (!value) {
-
-
-
- merge = !isVariable && name.length > 1 && name.pop().value;
-
- if (name[0].value && name[0].value.slice(0, 2) === '--') {
- value = this.permissiveValue();
- }
-
-
- else {
- value = this.anonymousValue();
- }
- if (value) {
- parserInput.forget();
-
- return new (tree.Declaration)(name, value, false, merge, index, fileInfo);
- }
- if (!value) {
- value = this.value();
- }
- if (value) {
- important = this.important();
- }
- else if (isVariable) {
-
- value = this.permissiveValue();
- }
- }
- if (value && (this.end() || hasDR)) {
- parserInput.forget();
- return new (tree.Declaration)(name, value, important, merge, index, fileInfo);
- }
- else {
- parserInput.restore();
- }
- }
- else {
- parserInput.restore();
- }
- },
- anonymousValue: function () {
- var index = parserInput.i;
- var match = parserInput.$re(/^([^.#@\$+\/'"*`(;{}-]*);/);
- if (match) {
- return new (tree.Anonymous)(match[1], index);
- }
- },
-
- permissiveValue: function (untilTokens) {
- var i;
- var e;
- var done;
- var value;
- var tok = untilTokens || ';';
- var index = parserInput.i;
- var result = [];
- function testCurrentChar() {
- var char = parserInput.currentChar();
- if (typeof tok === 'string') {
- return char === tok;
- }
- else {
- return tok.test(char);
- }
- }
- if (testCurrentChar()) {
- return;
- }
- value = [];
- do {
- e = this.comment();
- if (e) {
- value.push(e);
- continue;
- }
- e = this.entity();
- if (e) {
- value.push(e);
- }
- } while (e);
- done = testCurrentChar();
- if (value.length > 0) {
- value = new (tree.Expression)(value);
- if (done) {
- return value;
- }
- else {
- result.push(value);
- }
-
- if (parserInput.prevChar() === ' ') {
- result.push(new tree.Anonymous(' ', index));
- }
- }
- parserInput.save();
- value = parserInput.$parseUntil(tok);
- if (value) {
- if (typeof value === 'string') {
- error("Expected '" + value + "'", 'Parse');
- }
- if (value.length === 1 && value[0] === ' ') {
- parserInput.forget();
- return new tree.Anonymous('', index);
- }
- var item = void 0;
- for (i = 0; i < value.length; i++) {
- item = value[i];
- if (Array.isArray(item)) {
-
- result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));
- }
- else {
- if (i === value.length - 1) {
- item = item.trim();
- }
-
- var quote = new tree.Quoted('\'', item, true, index, fileInfo);
- quote.variableRegex = /@([\w-]+)/g;
- quote.propRegex = /\$([\w-]+)/g;
- result.push(quote);
- }
- }
- parserInput.forget();
- return new tree.Expression(result, true);
- }
- parserInput.restore();
- },
-
-
-
-
-
-
-
-
-
-
- 'import': function () {
- var path;
- var features;
- var index = parserInput.i;
- var dir = parserInput.$re(/^@import?\s+/);
- if (dir) {
- var options = (dir ? this.importOptions() : null) || {};
- if ((path = this.entities.quoted() || this.entities.url())) {
- features = this.mediaFeatures();
- if (!parserInput.$char(';')) {
- parserInput.i = index;
- error('missing semi-colon or unrecognised media features on import');
- }
- features = features && new (tree.Value)(features);
- return new (tree.Import)(path, features, options, index, fileInfo);
- }
- else {
- parserInput.i = index;
- error('malformed import statement');
- }
- }
- },
- importOptions: function () {
- var o;
- var options = {};
- var optionName;
- var value;
-
- if (!parserInput.$char('(')) {
- return null;
- }
- do {
- o = this.importOption();
- if (o) {
- optionName = o;
- value = true;
- switch (optionName) {
- case 'css':
- optionName = 'less';
- value = false;
- break;
- case 'once':
- optionName = 'multiple';
- value = false;
- break;
- }
- options[optionName] = value;
- if (!parserInput.$char(',')) {
- break;
- }
- }
- } while (o);
- expectChar(')');
- return options;
- },
- importOption: function () {
- var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);
- if (opt) {
- return opt[1];
- }
- },
- mediaFeature: function () {
- var entities = this.entities;
- var nodes = [];
- var e;
- var p;
- parserInput.save();
- do {
- e = entities.keyword() || entities.variable() || entities.mixinLookup();
- if (e) {
- nodes.push(e);
- }
- else if (parserInput.$char('(')) {
- p = this.property();
- e = this.value();
- if (parserInput.$char(')')) {
- if (p && e) {
- nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i, fileInfo, true)));
- }
- else if (e) {
- nodes.push(new (tree.Paren)(e));
- }
- else {
- error('badly formed media feature definition');
- }
- }
- else {
- error('Missing closing \')\'', 'Parse');
- }
- }
- } while (e);
- parserInput.forget();
- if (nodes.length > 0) {
- return new (tree.Expression)(nodes);
- }
- },
- mediaFeatures: function () {
- var entities = this.entities;
- var features = [];
- var e;
- do {
- e = this.mediaFeature();
- if (e) {
- features.push(e);
- if (!parserInput.$char(',')) {
- break;
- }
- }
- else {
- e = entities.variable() || entities.mixinLookup();
- if (e) {
- features.push(e);
- if (!parserInput.$char(',')) {
- break;
- }
- }
- }
- } while (e);
- return features.length > 0 ? features : null;
- },
- media: function () {
- var features;
- var rules;
- var media;
- var debugInfo;
- var index = parserInput.i;
- if (context.dumpLineNumbers) {
- debugInfo = getDebugInfo(index);
- }
- parserInput.save();
- if (parserInput.$str('@media')) {
- features = this.mediaFeatures();
- rules = this.block();
- if (!rules) {
- error('media definitions require block statements after any features');
- }
- parserInput.forget();
- media = new (tree.Media)(rules, features, index, fileInfo);
- if (context.dumpLineNumbers) {
- media.debugInfo = debugInfo;
- }
- return media;
- }
- parserInput.restore();
- },
-
-
-
-
-
- plugin: function () {
- var path;
- var args;
- var options;
- var index = parserInput.i;
- var dir = parserInput.$re(/^@plugin?\s+/);
- if (dir) {
- args = this.pluginArgs();
- if (args) {
- options = {
- pluginArgs: args,
- isPlugin: true
- };
- }
- else {
- options = { isPlugin: true };
- }
- if ((path = this.entities.quoted() || this.entities.url())) {
- if (!parserInput.$char(';')) {
- parserInput.i = index;
- error('missing semi-colon on @plugin');
- }
- return new (tree.Import)(path, null, options, index, fileInfo);
- }
- else {
- parserInput.i = index;
- error('malformed @plugin statement');
- }
- }
- },
- pluginArgs: function () {
-
- parserInput.save();
- if (!parserInput.$char('(')) {
- parserInput.restore();
- return null;
- }
- var args = parserInput.$re(/^\s*([^\);]+)\)\s*/);
- if (args[1]) {
- parserInput.forget();
- return args[1].trim();
- }
- else {
- parserInput.restore();
- return null;
- }
- },
-
-
-
-
-
- atrule: function () {
- var index = parserInput.i;
- var name;
- var value;
- var rules;
- var nonVendorSpecificName;
- var hasIdentifier;
- var hasExpression;
- var hasUnknown;
- var hasBlock = true;
- var isRooted = true;
- if (parserInput.currentChar() !== '@') {
- return;
- }
- value = this['import']() || this.plugin() || this.media();
- if (value) {
- return value;
- }
- parserInput.save();
- name = parserInput.$re(/^@[a-z-]+/);
- if (!name) {
- return;
- }
- nonVendorSpecificName = name;
- if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {
- nonVendorSpecificName = "@" + name.slice(name.indexOf('-', 2) + 1);
- }
- switch (nonVendorSpecificName) {
- case '@charset':
- hasIdentifier = true;
- hasBlock = false;
- break;
- case '@namespace':
- hasExpression = true;
- hasBlock = false;
- break;
- case '@keyframes':
- case '@counter-style':
- hasIdentifier = true;
- break;
- case '@document':
- case '@supports':
- hasUnknown = true;
- isRooted = false;
- break;
- default:
- hasUnknown = true;
- break;
- }
- parserInput.commentStore.length = 0;
- if (hasIdentifier) {
- value = this.entity();
- if (!value) {
- error("expected " + name + " identifier");
- }
- }
- else if (hasExpression) {
- value = this.expression();
- if (!value) {
- error("expected " + name + " expression");
- }
- }
- else if (hasUnknown) {
- value = this.permissiveValue(/^[{;]/);
- hasBlock = (parserInput.currentChar() === '{');
- if (!value) {
- if (!hasBlock && parserInput.currentChar() !== ';') {
- error(name + " rule is missing block or ending semi-colon");
- }
- }
- else if (!value.value) {
- value = null;
- }
- }
- if (hasBlock) {
- rules = this.blockRuleset();
- }
- if (rules || (!hasBlock && value && parserInput.$char(';'))) {
- parserInput.forget();
- return new (tree.AtRule)(name, value, rules, index, fileInfo, context.dumpLineNumbers ? getDebugInfo(index) : null, isRooted);
- }
- parserInput.restore('at-rule options not recognised');
- },
-
-
-
-
-
-
-
-
- value: function () {
- var e;
- var expressions = [];
- var index = parserInput.i;
- do {
- e = this.expression();
- if (e) {
- expressions.push(e);
- if (!parserInput.$char(',')) {
- break;
- }
- }
- } while (e);
- if (expressions.length > 0) {
- return new (tree.Value)(expressions, index);
- }
- },
- important: function () {
- if (parserInput.currentChar() === '!') {
- return parserInput.$re(/^! *important/);
- }
- },
- sub: function () {
- var a;
- var e;
- parserInput.save();
- if (parserInput.$char('(')) {
- a = this.addition();
- if (a && parserInput.$char(')')) {
- parserInput.forget();
- e = new (tree.Expression)([a]);
- e.parens = true;
- return e;
- }
- parserInput.restore('Expected \')\'');
- return;
- }
- parserInput.restore();
- },
- multiplication: function () {
- var m;
- var a;
- var op;
- var operation;
- var isSpaced;
- m = this.operand();
- if (m) {
- isSpaced = parserInput.isWhitespace(-1);
- while (true) {
- if (parserInput.peek(/^\/[*\/]/)) {
- break;
- }
- parserInput.save();
- op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');
- if (!op) {
- parserInput.forget();
- break;
- }
- a = this.operand();
- if (!a) {
- parserInput.restore();
- break;
- }
- parserInput.forget();
- m.parensInOp = true;
- a.parensInOp = true;
- operation = new (tree.Operation)(op, [operation || m, a], isSpaced);
- isSpaced = parserInput.isWhitespace(-1);
- }
- return operation || m;
- }
- },
- addition: function () {
- var m;
- var a;
- var op;
- var operation;
- var isSpaced;
- m = this.multiplication();
- if (m) {
- isSpaced = parserInput.isWhitespace(-1);
- while (true) {
- op = parserInput.$re(/^[-+]\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));
- if (!op) {
- break;
- }
- a = this.multiplication();
- if (!a) {
- break;
- }
- m.parensInOp = true;
- a.parensInOp = true;
- operation = new (tree.Operation)(op, [operation || m, a], isSpaced);
- isSpaced = parserInput.isWhitespace(-1);
- }
- return operation || m;
- }
- },
- conditions: function () {
- var a;
- var b;
- var index = parserInput.i;
- var condition;
- a = this.condition(true);
- if (a) {
- while (true) {
- if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(',')) {
- break;
- }
- b = this.condition(true);
- if (!b) {
- break;
- }
- condition = new (tree.Condition)('or', condition || a, b, index);
- }
- return condition || a;
- }
- },
- condition: function (needsParens) {
- var result;
- var logical;
- var next;
- function or() {
- return parserInput.$str('or');
- }
- result = this.conditionAnd(needsParens);
- if (!result) {
- return;
- }
- logical = or();
- if (logical) {
- next = this.condition(needsParens);
- if (next) {
- result = new (tree.Condition)(logical, result, next);
- }
- else {
- return;
- }
- }
- return result;
- },
- conditionAnd: function (needsParens) {
- var result;
- var logical;
- var next;
- var self = this;
- function insideCondition() {
- var cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);
- if (!cond && !needsParens) {
- return self.atomicCondition(needsParens);
- }
- return cond;
- }
- function and() {
- return parserInput.$str('and');
- }
- result = insideCondition();
- if (!result) {
- return;
- }
- logical = and();
- if (logical) {
- next = this.conditionAnd(needsParens);
- if (next) {
- result = new (tree.Condition)(logical, result, next);
- }
- else {
- return;
- }
- }
- return result;
- },
- negatedCondition: function (needsParens) {
- if (parserInput.$str('not')) {
- var result = this.parenthesisCondition(needsParens);
- if (result) {
- result.negate = !result.negate;
- }
- return result;
- }
- },
- parenthesisCondition: function (needsParens) {
- function tryConditionFollowedByParenthesis(me) {
- var body;
- parserInput.save();
- body = me.condition(needsParens);
- if (!body) {
- parserInput.restore();
- return;
- }
- if (!parserInput.$char(')')) {
- parserInput.restore();
- return;
- }
- parserInput.forget();
- return body;
- }
- var body;
- parserInput.save();
- if (!parserInput.$str('(')) {
- parserInput.restore();
- return;
- }
- body = tryConditionFollowedByParenthesis(this);
- if (body) {
- parserInput.forget();
- return body;
- }
- body = this.atomicCondition(needsParens);
- if (!body) {
- parserInput.restore();
- return;
- }
- if (!parserInput.$char(')')) {
- parserInput.restore("expected ')' got '" + parserInput.currentChar() + "'");
- return;
- }
- parserInput.forget();
- return body;
- },
- atomicCondition: function (needsParens) {
- var entities = this.entities;
- var index = parserInput.i;
- var a;
- var b;
- var c;
- var op;
- function cond() {
- return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();
- }
- cond = cond.bind(this);
- a = cond();
- if (a) {
- if (parserInput.$char('>')) {
- if (parserInput.$char('=')) {
- op = '>=';
- }
- else {
- op = '>';
- }
- }
- else if (parserInput.$char('<')) {
- if (parserInput.$char('=')) {
- op = '<=';
- }
- else {
- op = '<';
- }
- }
- else if (parserInput.$char('=')) {
- if (parserInput.$char('>')) {
- op = '=>';
- }
- else if (parserInput.$char('<')) {
- op = '=<';
- }
- else {
- op = '=';
- }
- }
- if (op) {
- b = cond();
- if (b) {
- c = new (tree.Condition)(op, a, b, index, false);
- }
- else {
- error('expected expression');
- }
- }
- else {
- c = new (tree.Condition)('=', a, new (tree.Keyword)('true'), index, false);
- }
- return c;
- }
- },
-
-
-
-
- operand: function () {
- var entities = this.entities;
- var negate;
- if (parserInput.peek(/^-[@\$\(]/)) {
- negate = parserInput.$char('-');
- }
- var o = this.sub() || entities.dimension() ||
- entities.color() || entities.variable() ||
- entities.property() || entities.call() ||
- entities.quoted(true) || entities.colorKeyword() ||
- entities.mixinLookup();
- if (negate) {
- o.parensInOp = true;
- o = new (tree.Negative)(o);
- }
- return o;
- },
-
-
-
-
-
-
-
- expression: function () {
- var entities = [];
- var e;
- var delim;
- var index = parserInput.i;
- do {
- e = this.comment();
- if (e) {
- entities.push(e);
- continue;
- }
- e = this.addition() || this.entity();
- if (e instanceof tree.Comment) {
- e = null;
- }
- if (e) {
- entities.push(e);
-
- if (!parserInput.peek(/^\/[\/*]/)) {
- delim = parserInput.$char('/');
- if (delim) {
- entities.push(new (tree.Anonymous)(delim, index));
- }
- }
- }
- } while (e);
- if (entities.length > 0) {
- return new (tree.Expression)(entities);
- }
- },
- property: function () {
- var name = parserInput.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);
- if (name) {
- return name[1];
- }
- },
- ruleProperty: function () {
- var name = [];
- var index = [];
- var s;
- var k;
- parserInput.save();
- var simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\s*:/);
- if (simpleProperty) {
- name = [new (tree.Keyword)(simpleProperty[1])];
- parserInput.forget();
- return name;
- }
- function match(re) {
- var i = parserInput.i;
- var chunk = parserInput.$re(re);
- if (chunk) {
- index.push(i);
- return name.push(chunk[1]);
- }
- }
- match(/^(\*?)/);
- while (true) {
- if (!match(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/)) {
- break;
- }
- }
- if ((name.length > 1) && match(/^((?:\+_|\+)?)\s*:/)) {
- parserInput.forget();
-
-
- if (name[0] === '') {
- name.shift();
- index.shift();
- }
- for (k = 0; k < name.length; k++) {
- s = name[k];
- name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?
- new (tree.Keyword)(s) :
- (s.charAt(0) === '@' ?
- new (tree.Variable)("@" + s.slice(2, -1), index[k], fileInfo) :
- new (tree.Property)("$" + s.slice(2, -1), index[k], fileInfo));
- }
- return name;
- }
- parserInput.restore();
- }
- }
- };
- };
- Parser.serializeVars = function (vars) {
- var s = '';
- for (var name_1 in vars) {
- if (Object.hasOwnProperty.call(vars, name_1)) {
- var value = vars[name_1];
- s += ((name_1[0] === '@') ? '' : '@') + name_1 + ": " + value + ((String(value).slice(-1) === ';') ? '' : ';');
- }
- }
- return s;
- };
- function boolean(condition) {
- return condition ? Keyword.True : Keyword.False;
- }
-
- function If(context, condition, trueValue, falseValue) {
- return condition.eval(context) ? trueValue.eval(context)
- : (falseValue ? falseValue.eval(context) : new Anonymous);
- }
- If.evalArgs = false;
- var boolean$1 = { boolean: boolean, 'if': If };
- var colorFunctions;
- function clamp$1(val) {
- return Math.min(1, Math.max(0, val));
- }
- function hsla(origColor, hsl) {
- var color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);
- if (color) {
- if (origColor.value &&
- /^(rgb|hsl)/.test(origColor.value)) {
- color.value = origColor.value;
- }
- else {
- color.value = 'rgb';
- }
- return color;
- }
- }
- function toHSL(color) {
- if (color.toHSL) {
- return color.toHSL();
- }
- else {
- throw new Error('Argument cannot be evaluated to a color');
- }
- }
- function toHSV(color) {
- if (color.toHSV) {
- return color.toHSV();
- }
- else {
- throw new Error('Argument cannot be evaluated to a color');
- }
- }
- function number(n) {
- if (n instanceof Dimension) {
- return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);
- }
- else if (typeof n === 'number') {
- return n;
- }
- else {
- throw {
- type: 'Argument',
- message: 'color functions take numbers as parameters'
- };
- }
- }
- function scaled(n, size) {
- if (n instanceof Dimension && n.unit.is('%')) {
- return parseFloat(n.value * size / 100);
- }
- else {
- return number(n);
- }
- }
- colorFunctions = {
- rgb: function (r, g, b) {
- var color = colorFunctions.rgba(r, g, b, 1.0);
- if (color) {
- color.value = 'rgb';
- return color;
- }
- },
- rgba: function (r, g, b, a) {
- try {
- if (r instanceof Color) {
- if (g) {
- a = number(g);
- }
- else {
- a = r.alpha;
- }
- return new Color(r.rgb, a, 'rgba');
- }
- var rgb = [r, g, b].map(function (c) { return scaled(c, 255); });
- a = number(a);
- return new Color(rgb, a, 'rgba');
- }
- catch (e) { }
- },
- hsl: function (h, s, l) {
- var color = colorFunctions.hsla(h, s, l, 1.0);
- if (color) {
- color.value = 'hsl';
- return color;
- }
- },
- hsla: function (h, s, l, a) {
- try {
- if (h instanceof Color) {
- if (s) {
- a = number(s);
- }
- else {
- a = h.alpha;
- }
- return new Color(h.rgb, a, 'hsla');
- }
- var m1_1;
- var m2_1;
- function hue(h) {
- h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
- if (h * 6 < 1) {
- return m1_1 + (m2_1 - m1_1) * h * 6;
- }
- else if (h * 2 < 1) {
- return m2_1;
- }
- else if (h * 3 < 2) {
- return m1_1 + (m2_1 - m1_1) * (2 / 3 - h) * 6;
- }
- else {
- return m1_1;
- }
- }
- h = (number(h) % 360) / 360;
- s = clamp$1(number(s));
- l = clamp$1(number(l));
- a = clamp$1(number(a));
- m2_1 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
- m1_1 = l * 2 - m2_1;
- var rgb = [
- hue(h + 1 / 3) * 255,
- hue(h) * 255,
- hue(h - 1 / 3) * 255
- ];
- a = number(a);
- return new Color(rgb, a, 'hsla');
- }
- catch (e) { }
- },
- hsv: function (h, s, v) {
- return colorFunctions.hsva(h, s, v, 1.0);
- },
- hsva: function (h, s, v, a) {
- h = ((number(h) % 360) / 360) * 360;
- s = number(s);
- v = number(v);
- a = number(a);
- var i;
- var f;
- i = Math.floor((h / 60) % 6);
- f = (h / 60) - i;
- var vs = [v,
- v * (1 - s),
- v * (1 - f * s),
- v * (1 - (1 - f) * s)];
- var perm = [[0, 3, 1],
- [2, 0, 1],
- [1, 0, 3],
- [1, 2, 0],
- [3, 1, 0],
- [0, 1, 2]];
- return colorFunctions.rgba(vs[perm[i][0]] * 255, vs[perm[i][1]] * 255, vs[perm[i][2]] * 255, a);
- },
- hue: function (color) {
- return new Dimension(toHSL(color).h);
- },
- saturation: function (color) {
- return new Dimension(toHSL(color).s * 100, '%');
- },
- lightness: function (color) {
- return new Dimension(toHSL(color).l * 100, '%');
- },
- hsvhue: function (color) {
- return new Dimension(toHSV(color).h);
- },
- hsvsaturation: function (color) {
- return new Dimension(toHSV(color).s * 100, '%');
- },
- hsvvalue: function (color) {
- return new Dimension(toHSV(color).v * 100, '%');
- },
- red: function (color) {
- return new Dimension(color.rgb[0]);
- },
- green: function (color) {
- return new Dimension(color.rgb[1]);
- },
- blue: function (color) {
- return new Dimension(color.rgb[2]);
- },
- alpha: function (color) {
- return new Dimension(toHSL(color).a);
- },
- luma: function (color) {
- return new Dimension(color.luma() * color.alpha * 100, '%');
- },
- luminance: function (color) {
- var luminance = (0.2126 * color.rgb[0] / 255) +
- (0.7152 * color.rgb[1] / 255) +
- (0.0722 * color.rgb[2] / 255);
- return new Dimension(luminance * color.alpha * 100, '%');
- },
- saturate: function (color, amount, method) {
-
-
- if (!color.rgb) {
- return null;
- }
- var hsl = toHSL(color);
- if (typeof method !== 'undefined' && method.value === 'relative') {
- hsl.s += hsl.s * amount.value / 100;
- }
- else {
- hsl.s += amount.value / 100;
- }
- hsl.s = clamp$1(hsl.s);
- return hsla(color, hsl);
- },
- desaturate: function (color, amount, method) {
- var hsl = toHSL(color);
- if (typeof method !== 'undefined' && method.value === 'relative') {
- hsl.s -= hsl.s * amount.value / 100;
- }
- else {
- hsl.s -= amount.value / 100;
- }
- hsl.s = clamp$1(hsl.s);
- return hsla(color, hsl);
- },
- lighten: function (color, amount, method) {
- var hsl = toHSL(color);
- if (typeof method !== 'undefined' && method.value === 'relative') {
- hsl.l += hsl.l * amount.value / 100;
- }
- else {
- hsl.l += amount.value / 100;
- }
- hsl.l = clamp$1(hsl.l);
- return hsla(color, hsl);
- },
- darken: function (color, amount, method) {
- var hsl = toHSL(color);
- if (typeof method !== 'undefined' && method.value === 'relative') {
- hsl.l -= hsl.l * amount.value / 100;
- }
- else {
- hsl.l -= amount.value / 100;
- }
- hsl.l = clamp$1(hsl.l);
- return hsla(color, hsl);
- },
- fadein: function (color, amount, method) {
- var hsl = toHSL(color);
- if (typeof method !== 'undefined' && method.value === 'relative') {
- hsl.a += hsl.a * amount.value / 100;
- }
- else {
- hsl.a += amount.value / 100;
- }
- hsl.a = clamp$1(hsl.a);
- return hsla(color, hsl);
- },
- fadeout: function (color, amount, method) {
- var hsl = toHSL(color);
- if (typeof method !== 'undefined' && method.value === 'relative') {
- hsl.a -= hsl.a * amount.value / 100;
- }
- else {
- hsl.a -= amount.value / 100;
- }
- hsl.a = clamp$1(hsl.a);
- return hsla(color, hsl);
- },
- fade: function (color, amount) {
- var hsl = toHSL(color);
- hsl.a = amount.value / 100;
- hsl.a = clamp$1(hsl.a);
- return hsla(color, hsl);
- },
- spin: function (color, amount) {
- var hsl = toHSL(color);
- var hue = (hsl.h + amount.value) % 360;
- hsl.h = hue < 0 ? 360 + hue : hue;
- return hsla(color, hsl);
- },
-
-
-
-
- mix: function (color1, color2, weight) {
- if (!weight) {
- weight = new Dimension(50);
- }
- var p = weight.value / 100.0;
- var w = p * 2 - 1;
- var a = toHSL(color1).a - toHSL(color2).a;
- var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
- var w2 = 1 - w1;
- var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
- color1.rgb[1] * w1 + color2.rgb[1] * w2,
- color1.rgb[2] * w1 + color2.rgb[2] * w2];
- var alpha = color1.alpha * p + color2.alpha * (1 - p);
- return new Color(rgb, alpha);
- },
- greyscale: function (color) {
- return colorFunctions.desaturate(color, new Dimension(100));
- },
- contrast: function (color, dark, light, threshold) {
-
-
- if (!color.rgb) {
- return null;
- }
- if (typeof light === 'undefined') {
- light = colorFunctions.rgba(255, 255, 255, 1.0);
- }
- if (typeof dark === 'undefined') {
- dark = colorFunctions.rgba(0, 0, 0, 1.0);
- }
-
- if (dark.luma() > light.luma()) {
- var t = light;
- light = dark;
- dark = t;
- }
- if (typeof threshold === 'undefined') {
- threshold = 0.43;
- }
- else {
- threshold = number(threshold);
- }
- if (color.luma() < threshold) {
- return light;
- }
- else {
- return dark;
- }
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- argb: function (color) {
- return new Anonymous(color.toARGB());
- },
- color: function (c) {
- if ((c instanceof Quoted) &&
- (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {
- var val = c.value.slice(1);
- return new Color(val, undefined, "#" + val);
- }
- if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {
- c.value = undefined;
- return c;
- }
- throw {
- type: 'Argument',
- message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'
- };
- },
- tint: function (color, amount) {
- return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);
- },
- shade: function (color, amount) {
- return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);
- }
- };
- var color = colorFunctions;
-
-
- function colorBlend(mode, color1, color2) {
- var ab = color1.alpha;
- var
- cb;
- var as = color2.alpha;
- var
- cs;
- var ar;
- var cr;
- var r = [];
- ar = as + ab * (1 - as);
- for (var i = 0; i < 3; i++) {
- cb = color1.rgb[i] / 255;
- cs = color2.rgb[i] / 255;
- cr = mode(cb, cs);
- if (ar) {
- cr = (as * cs + ab * (cb -
- as * (cb + cs - cr))) / ar;
- }
- r[i] = cr * 255;
- }
- return new Color(r, ar);
- }
- var colorBlendModeFunctions = {
- multiply: function (cb, cs) {
- return cb * cs;
- },
- screen: function (cb, cs) {
- return cb + cs - cb * cs;
- },
- overlay: function (cb, cs) {
- cb *= 2;
- return (cb <= 1) ?
- colorBlendModeFunctions.multiply(cb, cs) :
- colorBlendModeFunctions.screen(cb - 1, cs);
- },
- softlight: function (cb, cs) {
- var d = 1;
- var e = cb;
- if (cs > 0.5) {
- e = 1;
- d = (cb > 0.25) ? Math.sqrt(cb)
- : ((16 * cb - 12) * cb + 4) * cb;
- }
- return cb - (1 - 2 * cs) * e * (d - cb);
- },
- hardlight: function (cb, cs) {
- return colorBlendModeFunctions.overlay(cs, cb);
- },
- difference: function (cb, cs) {
- return Math.abs(cb - cs);
- },
- exclusion: function (cb, cs) {
- return cb + cs - 2 * cb * cs;
- },
-
- average: function (cb, cs) {
- return (cb + cs) / 2;
- },
- negation: function (cb, cs) {
- return 1 - Math.abs(cb + cs - 1);
- }
- };
- for (var f in colorBlendModeFunctions) {
- if (colorBlendModeFunctions.hasOwnProperty(f)) {
- colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);
- }
- }
- var dataUri = (function (environment) {
- var fallback = function (functionThis, node) { return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); };
- return { 'data-uri': function (mimetypeNode, filePathNode) {
- if (!filePathNode) {
- filePathNode = mimetypeNode;
- mimetypeNode = null;
- }
- var mimetype = mimetypeNode && mimetypeNode.value;
- var filePath = filePathNode.value;
- var currentFileInfo = this.currentFileInfo;
- var currentDirectory = currentFileInfo.rewriteUrls ?
- currentFileInfo.currentDirectory : currentFileInfo.entryPath;
- var fragmentStart = filePath.indexOf('#');
- var fragment = '';
- if (fragmentStart !== -1) {
- fragment = filePath.slice(fragmentStart);
- filePath = filePath.slice(0, fragmentStart);
- }
- var context = clone(this.context);
- context.rawBuffer = true;
- var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);
- if (!fileManager) {
- return fallback(this, filePathNode);
- }
- var useBase64 = false;
-
- if (!mimetypeNode) {
- mimetype = environment.mimeLookup(filePath);
- if (mimetype === 'image/svg+xml') {
- useBase64 = false;
- }
- else {
-
- var charset = environment.charsetLookup(mimetype);
- useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;
- }
- if (useBase64) {
- mimetype += ';base64';
- }
- }
- else {
- useBase64 = /;base64$/.test(mimetype);
- }
- var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);
- if (!fileSync.contents) {
- logger.warn("Skipped data-uri embedding of " + filePath + " because file not found");
- return fallback(this, filePathNode || mimetypeNode);
- }
- var buf = fileSync.contents;
- if (useBase64 && !environment.encodeBase64) {
- return fallback(this, filePathNode);
- }
- buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
- var uri = "data:" + mimetype + "," + buf + fragment;
- return new URL(new Quoted("\"" + uri + "\"", uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
- } };
- });
- var getItemsFromNode = function (node) {
-
-
- var items = Array.isArray(node.value) ?
- node.value : Array(node);
- return items;
- };
- var list = {
- _SELF: function (n) {
- return n;
- },
- extract: function (values, index) {
-
- index = index.value - 1;
- return getItemsFromNode(values)[index];
- },
- length: function (values) {
- return new Dimension(getItemsFromNode(values).length);
- },
-
- range: function (start, end, step) {
- var from;
- var to;
- var stepValue = 1;
- var list = [];
- if (end) {
- to = end;
- from = start.value;
- if (step) {
- stepValue = step.value;
- }
- }
- else {
- from = 1;
- to = start;
- }
- for (var i = from; i <= to.value; i += stepValue) {
- list.push(new Dimension(i, to.unit));
- }
- return new Expression(list);
- },
- each: function (list, rs) {
- var _this = this;
- var rules = [];
- var newRules;
- var iterator;
- var tryEval = function (val) {
- if (val instanceof Node) {
- return val.eval(_this.context);
- }
- return val;
- };
- if (list.value && !(list instanceof Quoted)) {
- if (Array.isArray(list.value)) {
- iterator = list.value.map(tryEval);
- }
- else {
- iterator = [tryEval(list.value)];
- }
- }
- else if (list.ruleset) {
- iterator = tryEval(list.ruleset).rules;
- }
- else if (list.rules) {
- iterator = list.rules.map(tryEval);
- }
- else if (Array.isArray(list)) {
- iterator = list.map(tryEval);
- }
- else {
- iterator = [tryEval(list)];
- }
- var valueName = '@value';
- var keyName = '@key';
- var indexName = '@index';
- if (rs.params) {
- valueName = rs.params[0] && rs.params[0].name;
- keyName = rs.params[1] && rs.params[1].name;
- indexName = rs.params[2] && rs.params[2].name;
- rs = rs.rules;
- }
- else {
- rs = rs.ruleset;
- }
- for (var i = 0; i < iterator.length; i++) {
- var key = void 0;
- var value = void 0;
- var item = iterator[i];
- if (item instanceof Declaration) {
- key = typeof item.name === 'string' ? item.name : item.name[0].value;
- value = item.value;
- }
- else {
- key = new Dimension(i + 1);
- value = item;
- }
- if (item instanceof Comment) {
- continue;
- }
- newRules = rs.rules.slice(0);
- if (valueName) {
- newRules.push(new Declaration(valueName, value, false, false, this.index, this.currentFileInfo));
- }
- if (indexName) {
- newRules.push(new Declaration(indexName, new Dimension(i + 1), false, false, this.index, this.currentFileInfo));
- }
- if (keyName) {
- newRules.push(new Declaration(keyName, key, false, false, this.index, this.currentFileInfo));
- }
- rules.push(new Ruleset([new (Selector)([new Element("", '&')])], newRules, rs.strictImports, rs.visibilityInfo()));
- }
- return new Ruleset([new (Selector)([new Element("", '&')])], rules, rs.strictImports, rs.visibilityInfo()).eval(this.context);
- }
- };
- var MathHelper = function (fn, unit, n) {
- if (!(n instanceof Dimension)) {
- throw { type: 'Argument', message: 'argument must be a number' };
- }
- if (unit == null) {
- unit = n.unit;
- }
- else {
- n = n.unify();
- }
- return new Dimension(fn(parseFloat(n.value)), unit);
- };
- var mathFunctions = {
-
- ceil: null,
- floor: null,
- sqrt: null,
- abs: null,
- tan: '',
- sin: '',
- cos: '',
- atan: 'rad',
- asin: 'rad',
- acos: 'rad'
- };
- for (var f$1 in mathFunctions) {
- if (mathFunctions.hasOwnProperty(f$1)) {
- mathFunctions[f$1] = MathHelper.bind(null, Math[f$1], mathFunctions[f$1]);
- }
- }
- mathFunctions.round = function (n, f) {
- var fraction = typeof f === 'undefined' ? 0 : f.value;
- return MathHelper(function (num) { return num.toFixed(fraction); }, null, n);
- };
- var minMax = function (isMin, args) {
- args = Array.prototype.slice.call(args);
- switch (args.length) {
- case 0: throw { type: 'Argument', message: 'one or more arguments required' };
- }
- var i;
- var j;
- var current;
- var currentUnified;
- var referenceUnified;
- var unit;
- var unitStatic;
- var unitClone;
- var
- order = [];
- var values = {};
-
- for (i = 0; i < args.length; i++) {
- current = args[i];
- if (!(current instanceof Dimension)) {
- if (Array.isArray(args[i].value)) {
- Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));
- }
- continue;
- }
- currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();
- unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
- unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;
- unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;
- j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];
- if (j === undefined) {
- if (unitStatic !== undefined && unit !== unitStatic) {
- throw { type: 'Argument', message: 'incompatible types' };
- }
- values[unit] = order.length;
- order.push(current);
- continue;
- }
- referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();
- if (isMin && currentUnified.value < referenceUnified.value ||
- !isMin && currentUnified.value > referenceUnified.value) {
- order[j] = current;
- }
- }
- if (order.length == 1) {
- return order[0];
- }
- args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');
- return new Anonymous((isMin ? 'min' : 'max') + "(" + args + ")");
- };
- var number$1 = {
- min: function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return minMax(true, args);
- },
- max: function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return minMax(false, args);
- },
- convert: function (val, unit) {
- return val.convertTo(unit.value);
- },
- pi: function () {
- return new Dimension(Math.PI);
- },
- mod: function (a, b) {
- return new Dimension(a.value % b.value, a.unit);
- },
- pow: function (x, y) {
- if (typeof x === 'number' && typeof y === 'number') {
- x = new Dimension(x);
- y = new Dimension(y);
- }
- else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {
- throw { type: 'Argument', message: 'arguments must be numbers' };
- }
- return new Dimension(Math.pow(x.value, y.value), x.unit);
- },
- percentage: function (n) {
- var result = MathHelper(function (num) { return num * 100; }, '%', n);
- return result;
- }
- };
- var string = {
- e: function (str) {
- return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true);
- },
- escape: function (str) {
- return new Anonymous(encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')
- .replace(/\(/g, '%28').replace(/\)/g, '%29'));
- },
- replace: function (string, pattern, replacement, flags) {
- var result = string.value;
- replacement = (replacement.type === 'Quoted') ?
- replacement.value : replacement.toCSS();
- result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);
- return new Quoted(string.quote || '', result, string.escaped);
- },
- '%': function (string /* arg, arg, ... */) {
- var args = Array.prototype.slice.call(arguments, 1);
- var result = string.value;
- var _loop_1 = function (i) {
-
- result = result.replace(/%[sda]/i, function (token) {
- var value = ((args[i].type === 'Quoted') &&
- token.match(/s/i)) ? args[i].value : args[i].toCSS();
- return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
- });
- };
- for (var i = 0; i < args.length; i++) {
- _loop_1(i);
- }
- result = result.replace(/%%/g, '%');
- return new Quoted(string.quote || '', result, string.escaped);
- }
- };
- var svg = (function (environment) {
- return { 'svg-gradient': function (direction) {
- var stops;
- var gradientDirectionSvg;
- var gradientType = 'linear';
- var rectangleDimension = 'x="0" y="0" width="1" height="1"';
- var renderEnv = { compress: false };
- var returner;
- var directionValue = direction.toCSS(renderEnv);
- var i;
- var color;
- var position;
- var positionValue;
- var alpha;
- function throwArgumentDescriptor() {
- throw { type: 'Argument',
- message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +
- ' end_color [end_position] or direction, color list' };
- }
- if (arguments.length == 2) {
- if (arguments[1].value.length < 2) {
- throwArgumentDescriptor();
- }
- stops = arguments[1].value;
- }
- else if (arguments.length < 3) {
- throwArgumentDescriptor();
- }
- else {
- stops = Array.prototype.slice.call(arguments, 1);
- }
- switch (directionValue) {
- case 'to bottom':
- gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"';
- break;
- case 'to right':
- gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"';
- break;
- case 'to bottom right':
- gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"';
- break;
- case 'to top right':
- gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"';
- break;
- case 'ellipse':
- case 'ellipse at center':
- gradientType = 'radial';
- gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"';
- rectangleDimension = 'x="-50" y="-50" width="101" height="101"';
- break;
- default:
- throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' +
- ' \'to bottom right\', \'to top right\' or \'ellipse at center\'' };
- }
- returner = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><" + gradientType + "Gradient id=\"g\" " + gradientDirectionSvg + ">";
- for (i = 0; i < stops.length; i += 1) {
- if (stops[i] instanceof Expression) {
- color = stops[i].value[0];
- position = stops[i].value[1];
- }
- else {
- color = stops[i];
- position = undefined;
- }
- if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) {
- throwArgumentDescriptor();
- }
- positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';
- alpha = color.alpha;
- returner += "<stop offset=\"" + positionValue + "\" stop-color=\"" + color.toRGB() + "\"" + (alpha < 1 ? " stop-opacity=\"" + alpha + "\"" : '') + "/>";
- }
- returner += "</" + gradientType + "Gradient><rect " + rectangleDimension + " fill=\"url(#g)\" /></svg>";
- returner = encodeURIComponent(returner);
- returner = "data:image/svg+xml," + returner;
- return new URL(new Quoted("'" + returner + "'", returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
- } };
- });
- var isa = function (n, Type) { return (n instanceof Type) ? Keyword.True : Keyword.False; };
- var isunit = function (n, unit) {
- if (unit === undefined) {
- throw { type: 'Argument', message: 'missing the required second argument to isunit.' };
- }
- unit = typeof unit.value === 'string' ? unit.value : unit;
- if (typeof unit !== 'string') {
- throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };
- }
- return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;
- };
- var types = {
- isruleset: function (n) {
- return isa(n, DetachedRuleset);
- },
- iscolor: function (n) {
- return isa(n, Color);
- },
- isnumber: function (n) {
- return isa(n, Dimension);
- },
- isstring: function (n) {
- return isa(n, Quoted);
- },
- iskeyword: function (n) {
- return isa(n, Keyword);
- },
- isurl: function (n) {
- return isa(n, URL);
- },
- ispixel: function (n) {
- return isunit(n, 'px');
- },
- ispercentage: function (n) {
- return isunit(n, '%');
- },
- isem: function (n) {
- return isunit(n, 'em');
- },
- isunit: isunit,
- unit: function (val, unit) {
- if (!(val instanceof Dimension)) {
- throw { type: 'Argument', message: "the first argument to unit must be a number" + (val instanceof Operation ? '. Have you forgotten parenthesis?' : '') };
- }
- if (unit) {
- if (unit instanceof Keyword) {
- unit = unit.value;
- }
- else {
- unit = unit.toCSS();
- }
- }
- else {
- unit = '';
- }
- return new Dimension(val.value, unit);
- },
- 'get-unit': function (n) {
- return new Anonymous(n.unit);
- }
- };
- var Functions = (function (environment) {
- var functions = { functionRegistry: functionRegistry, functionCaller: functionCaller };
-
- functionRegistry.addMultiple(boolean$1);
- functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));
- functionRegistry.addMultiple(color);
- functionRegistry.addMultiple(colorBlend);
- functionRegistry.addMultiple(dataUri(environment));
- functionRegistry.addMultiple(list);
- functionRegistry.addMultiple(mathFunctions);
- functionRegistry.addMultiple(number$1);
- functionRegistry.addMultiple(string);
- functionRegistry.addMultiple(svg());
- functionRegistry.addMultiple(types);
- return functions;
- });
- var sourceMapOutput = (function (environment) {
- var SourceMapOutput = (function () {
- function SourceMapOutput(options) {
- this._css = [];
- this._rootNode = options.rootNode;
- this._contentsMap = options.contentsMap;
- this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;
- if (options.sourceMapFilename) {
- this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/');
- }
- this._outputFilename = options.outputFilename;
- this.sourceMapURL = options.sourceMapURL;
- if (options.sourceMapBasepath) {
- this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/');
- }
- if (options.sourceMapRootpath) {
- this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/');
- if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {
- this._sourceMapRootpath += '/';
- }
- }
- else {
- this._sourceMapRootpath = '';
- }
- this._outputSourceFiles = options.outputSourceFiles;
- this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();
- this._lineNumber = 0;
- this._column = 0;
- }
- SourceMapOutput.prototype.removeBasepath = function (path) {
- if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {
- path = path.substring(this._sourceMapBasepath.length);
- if (path.charAt(0) === '\\' || path.charAt(0) === '/') {
- path = path.substring(1);
- }
- }
- return path;
- };
- SourceMapOutput.prototype.normalizeFilename = function (filename) {
- filename = filename.replace(/\\/g, '/');
- filename = this.removeBasepath(filename);
- return (this._sourceMapRootpath || '') + filename;
- };
- SourceMapOutput.prototype.add = function (chunk, fileInfo, index, mapLines) {
-
- if (!chunk) {
- return;
- }
- var lines;
- var sourceLines;
- var columns;
- var sourceColumns;
- var i;
- if (fileInfo && fileInfo.filename) {
- var inputSource = this._contentsMap[fileInfo.filename];
-
- if (this._contentsIgnoredCharsMap[fileInfo.filename]) {
-
- index -= this._contentsIgnoredCharsMap[fileInfo.filename];
- if (index < 0) {
- index = 0;
- }
-
- inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);
- }
-
- if (inputSource === undefined) {
- this._css.push(chunk);
- return;
- }
- inputSource = inputSource.substring(0, index);
- sourceLines = inputSource.split('\n');
- sourceColumns = sourceLines[sourceLines.length - 1];
- }
- lines = chunk.split('\n');
- columns = lines[lines.length - 1];
- if (fileInfo && fileInfo.filename) {
- if (!mapLines) {
- this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column },
- original: { line: sourceLines.length, column: sourceColumns.length },
- source: this.normalizeFilename(fileInfo.filename) });
- }
- else {
- for (i = 0; i < lines.length; i++) {
- this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0 },
- original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0 },
- source: this.normalizeFilename(fileInfo.filename) });
- }
- }
- }
- if (lines.length === 1) {
- this._column += columns.length;
- }
- else {
- this._lineNumber += lines.length - 1;
- this._column = columns.length;
- }
- this._css.push(chunk);
- };
- SourceMapOutput.prototype.isEmpty = function () {
- return this._css.length === 0;
- };
- SourceMapOutput.prototype.toCSS = function (context) {
- this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });
- if (this._outputSourceFiles) {
- for (var filename in this._contentsMap) {
- if (this._contentsMap.hasOwnProperty(filename)) {
- var source = this._contentsMap[filename];
- if (this._contentsIgnoredCharsMap[filename]) {
- source = source.slice(this._contentsIgnoredCharsMap[filename]);
- }
- this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);
- }
- }
- }
- this._rootNode.genCSS(context, this);
- if (this._css.length > 0) {
- var sourceMapURL = void 0;
- var sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());
- if (this.sourceMapURL) {
- sourceMapURL = this.sourceMapURL;
- }
- else if (this._sourceMapFilename) {
- sourceMapURL = this._sourceMapFilename;
- }
- this.sourceMapURL = sourceMapURL;
- this.sourceMap = sourceMapContent;
- }
- return this._css.join('');
- };
- return SourceMapOutput;
- }());
- return SourceMapOutput;
- });
- var sourceMapBuilder = (function (SourceMapOutput, environment) {
- var SourceMapBuilder = (function () {
- function SourceMapBuilder(options) {
- this.options = options;
- }
- SourceMapBuilder.prototype.toCSS = function (rootNode, options, imports) {
- var sourceMapOutput = new SourceMapOutput({
- contentsIgnoredCharsMap: imports.contentsIgnoredChars,
- rootNode: rootNode,
- contentsMap: imports.contents,
- sourceMapFilename: this.options.sourceMapFilename,
- sourceMapURL: this.options.sourceMapURL,
- outputFilename: this.options.sourceMapOutputFilename,
- sourceMapBasepath: this.options.sourceMapBasepath,
- sourceMapRootpath: this.options.sourceMapRootpath,
- outputSourceFiles: this.options.outputSourceFiles,
- sourceMapGenerator: this.options.sourceMapGenerator,
- sourceMapFileInline: this.options.sourceMapFileInline,
- disableSourcemapAnnotation: this.options.disableSourcemapAnnotation
- });
- var css = sourceMapOutput.toCSS(options);
- this.sourceMap = sourceMapOutput.sourceMap;
- this.sourceMapURL = sourceMapOutput.sourceMapURL;
- if (this.options.sourceMapInputFilename) {
- this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);
- }
- if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {
- this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);
- }
- return css + this.getCSSAppendage();
- };
- SourceMapBuilder.prototype.getCSSAppendage = function () {
- var sourceMapURL = this.sourceMapURL;
- if (this.options.sourceMapFileInline) {
- if (this.sourceMap === undefined) {
- return '';
- }
- sourceMapURL = "data:application/json;base64," + environment.encodeBase64(this.sourceMap);
- }
- if (this.options.disableSourcemapAnnotation) {
- return '';
- }
- if (sourceMapURL) {
- return "/*# sourceMappingURL=" + sourceMapURL + " */";
- }
- return '';
- };
- SourceMapBuilder.prototype.getExternalSourceMap = function () {
- return this.sourceMap;
- };
- SourceMapBuilder.prototype.setExternalSourceMap = function (sourceMap) {
- this.sourceMap = sourceMap;
- };
- SourceMapBuilder.prototype.isInline = function () {
- return this.options.sourceMapFileInline;
- };
- SourceMapBuilder.prototype.getSourceMapURL = function () {
- return this.sourceMapURL;
- };
- SourceMapBuilder.prototype.getOutputFilename = function () {
- return this.options.sourceMapOutputFilename;
- };
- SourceMapBuilder.prototype.getInputFilename = function () {
- return this.sourceMapInputFilename;
- };
- return SourceMapBuilder;
- }());
- return SourceMapBuilder;
- });
- var transformTree = (function (root, options) {
- if (options === void 0) { options = {}; }
- var evaldRoot;
- var variables = options.variables;
- var evalEnv = new contexts.Eval(options);
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (typeof variables === 'object' && !Array.isArray(variables)) {
- variables = Object.keys(variables).map(function (k) {
- var value = variables[k];
- if (!(value instanceof tree.Value)) {
- if (!(value instanceof tree.Expression)) {
- value = new tree.Expression([value]);
- }
- value = new tree.Value([value]);
- }
- return new tree.Declaration("@" + k, value, false, null, 0);
- });
- evalEnv.frames = [new tree.Ruleset(null, variables)];
- }
- var visitors$1 = [
- new visitors.JoinSelectorVisitor(),
- new visitors.MarkVisibleSelectorsVisitor(true),
- new visitors.ExtendVisitor(),
- new visitors.ToCSSVisitor({ compress: Boolean(options.compress) })
- ];
- var preEvalVisitors = [];
- var v;
- var visitorIterator;
-
- if (options.pluginManager) {
- visitorIterator = options.pluginManager.visitor();
- for (var i = 0; i < 2; i++) {
- visitorIterator.first();
- while ((v = visitorIterator.get())) {
- if (v.isPreEvalVisitor) {
- if (i === 0 || preEvalVisitors.indexOf(v) === -1) {
- preEvalVisitors.push(v);
- v.run(root);
- }
- }
- else {
- if (i === 0 || visitors$1.indexOf(v) === -1) {
- if (v.isPreVisitor) {
- visitors$1.unshift(v);
- }
- else {
- visitors$1.push(v);
- }
- }
- }
- }
- }
- }
- evaldRoot = root.eval(evalEnv);
- for (var i = 0; i < visitors$1.length; i++) {
- visitors$1[i].run(evaldRoot);
- }
-
- if (options.pluginManager) {
- visitorIterator.first();
- while ((v = visitorIterator.get())) {
- if (visitors$1.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {
- v.run(evaldRoot);
- }
- }
- }
- return evaldRoot;
- });
- var parseTree = (function (SourceMapBuilder) {
- var ParseTree = (function () {
- function ParseTree(root, imports) {
- this.root = root;
- this.imports = imports;
- }
- ParseTree.prototype.toCSS = function (options) {
- var evaldRoot;
- var result = {};
- var sourceMapBuilder;
- try {
- evaldRoot = transformTree(this.root, options);
- }
- catch (e) {
- throw new LessError(e, this.imports);
- }
- try {
- var compress = Boolean(options.compress);
- if (compress) {
- logger.warn('The compress option has been deprecated. ' +
- 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');
- }
- var toCSSOptions = {
- compress: compress,
- dumpLineNumbers: options.dumpLineNumbers,
- strictUnits: Boolean(options.strictUnits),
- numPrecision: 8
- };
- if (options.sourceMap) {
- sourceMapBuilder = new SourceMapBuilder(options.sourceMap);
- result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);
- }
- else {
- result.css = evaldRoot.toCSS(toCSSOptions);
- }
- }
- catch (e) {
- throw new LessError(e, this.imports);
- }
- if (options.pluginManager) {
- var postProcessors = options.pluginManager.getPostProcessors();
- for (var i = 0; i < postProcessors.length; i++) {
- result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options: options, imports: this.imports });
- }
- }
- if (options.sourceMap) {
- result.map = sourceMapBuilder.getExternalSourceMap();
- }
- result.imports = [];
- for (var file in this.imports.files) {
- if (this.imports.files.hasOwnProperty(file) && file !== this.imports.rootFilename) {
- result.imports.push(file);
- }
- }
- return result;
- };
- return ParseTree;
- }());
- return ParseTree;
- });
- function importManager (environment) {
-
-
-
-
-
-
-
-
- var ImportManager = (function () {
- function ImportManager(less, context, rootFileInfo) {
- this.less = less;
- this.rootFilename = rootFileInfo.filename;
- this.paths = context.paths || [];
- this.contents = {};
- this.contentsIgnoredChars = {};
- this.mime = context.mime;
- this.error = null;
- this.context = context;
-
- this.queue = [];
- this.files = {};
- }
-
- ImportManager.prototype.push = function (path, tryAppendExtension, currentFileInfo, importOptions, callback) {
- var importManager = this, pluginLoader = this.context.pluginManager.Loader;
- this.queue.push(path);
- var fileParsedFunc = function (e, root, fullPath) {
- importManager.queue.splice(importManager.queue.indexOf(path), 1);
- var importedEqualsRoot = fullPath === importManager.rootFilename;
- if (importOptions.optional && e) {
- callback(null, { rules: [] }, false, null);
- logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional.");
- }
- else {
-
-
-
- if (!importManager.files[fullPath] && !importOptions.inline) {
- importManager.files[fullPath] = { root: root, options: importOptions };
- }
- if (e && !importManager.error) {
- importManager.error = e;
- }
- callback(e, root, importedEqualsRoot, fullPath);
- }
- };
- var newFileInfo = {
- rewriteUrls: this.context.rewriteUrls,
- entryPath: currentFileInfo.entryPath,
- rootpath: currentFileInfo.rootpath,
- rootFilename: currentFileInfo.rootFilename
- };
- var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);
- if (!fileManager) {
- fileParsedFunc({ message: "Could not find a file-manager for " + path });
- return;
- }
- var loadFileCallback = function (loadedFile) {
- var plugin;
- var resolvedFilename = loadedFile.filename;
- var contents = loadedFile.contents.replace(/^\uFEFF/, '');
-
-
-
-
-
-
-
-
- newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);
- if (newFileInfo.rewriteUrls) {
- newFileInfo.rootpath = fileManager.join((importManager.context.rootpath || ''), fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));
- if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {
- newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);
- }
- }
- newFileInfo.filename = resolvedFilename;
- var newEnv = new contexts.Parse(importManager.context);
- newEnv.processImports = false;
- importManager.contents[resolvedFilename] = contents;
- if (currentFileInfo.reference || importOptions.reference) {
- newFileInfo.reference = true;
- }
- if (importOptions.isPlugin) {
- plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);
- if (plugin instanceof LessError) {
- fileParsedFunc(plugin, null, resolvedFilename);
- }
- else {
- fileParsedFunc(null, plugin, resolvedFilename);
- }
- }
- else if (importOptions.inline) {
- fileParsedFunc(null, contents, resolvedFilename);
- }
- else {
-
-
- if (importManager.files[resolvedFilename]
- && !importManager.files[resolvedFilename].options.multiple
- && !importOptions.multiple) {
- fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);
- }
- else {
- new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {
- fileParsedFunc(e, root, resolvedFilename);
- });
- }
- }
- };
- var loadedFile;
- var promise;
- var context = clone(this.context);
- if (tryAppendExtension) {
- context.ext = importOptions.isPlugin ? '.js' : '.less';
- }
- if (importOptions.isPlugin) {
- context.mime = 'application/javascript';
- if (context.syncImport) {
- loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);
- }
- else {
- promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);
- }
- }
- else {
- if (context.syncImport) {
- loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);
- }
- else {
- promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, function (err, loadedFile) {
- if (err) {
- fileParsedFunc(err);
- }
- else {
- loadFileCallback(loadedFile);
- }
- });
- }
- }
- if (loadedFile) {
- if (!loadedFile.filename) {
- fileParsedFunc(loadedFile);
- }
- else {
- loadFileCallback(loadedFile);
- }
- }
- else if (promise) {
- promise.then(loadFileCallback, fileParsedFunc);
- }
- };
- return ImportManager;
- }());
- return ImportManager;
- }
- var Render = (function (environment, ParseTree, ImportManager) {
- var render = function (input, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = copyOptions(this.options, {});
- }
- else {
- options = copyOptions(this.options, options || {});
- }
- if (!callback) {
- var self_1 = this;
- return new Promise(function (resolve, reject) {
- render.call(self_1, input, options, function (err, output) {
- if (err) {
- reject(err);
- }
- else {
- resolve(output);
- }
- });
- });
- }
- else {
- this.parse(input, options, function (err, root, imports, options) {
- if (err) {
- return callback(err);
- }
- var result;
- try {
- var parseTree = new ParseTree(root, imports);
- result = parseTree.toCSS(options);
- }
- catch (err) {
- return callback(err);
- }
- callback(null, result);
- });
- }
- };
- return render;
- });
-
- var PluginManager = (function () {
- function PluginManager(less) {
- this.less = less;
- this.visitors = [];
- this.preProcessors = [];
- this.postProcessors = [];
- this.installedPlugins = [];
- this.fileManagers = [];
- this.iterator = -1;
- this.pluginCache = {};
- this.Loader = new less.PluginLoader(less);
- }
-
- PluginManager.prototype.addPlugins = function (plugins) {
- if (plugins) {
- for (var i = 0; i < plugins.length; i++) {
- this.addPlugin(plugins[i]);
- }
- }
- };
-
- PluginManager.prototype.addPlugin = function (plugin, filename, functionRegistry) {
- this.installedPlugins.push(plugin);
- if (filename) {
- this.pluginCache[filename] = plugin;
- }
- if (plugin.install) {
- plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);
- }
- };
-
- PluginManager.prototype.get = function (filename) {
- return this.pluginCache[filename];
- };
-
- PluginManager.prototype.addVisitor = function (visitor) {
- this.visitors.push(visitor);
- };
-
- PluginManager.prototype.addPreProcessor = function (preProcessor, priority) {
- var indexToInsertAt;
- for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {
- if (this.preProcessors[indexToInsertAt].priority >= priority) {
- break;
- }
- }
- this.preProcessors.splice(indexToInsertAt, 0, { preProcessor: preProcessor, priority: priority });
- };
-
- PluginManager.prototype.addPostProcessor = function (postProcessor, priority) {
- var indexToInsertAt;
- for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {
- if (this.postProcessors[indexToInsertAt].priority >= priority) {
- break;
- }
- }
- this.postProcessors.splice(indexToInsertAt, 0, { postProcessor: postProcessor, priority: priority });
- };
-
- PluginManager.prototype.addFileManager = function (manager) {
- this.fileManagers.push(manager);
- };
-
- PluginManager.prototype.getPreProcessors = function () {
- var preProcessors = [];
- for (var i = 0; i < this.preProcessors.length; i++) {
- preProcessors.push(this.preProcessors[i].preProcessor);
- }
- return preProcessors;
- };
-
- PluginManager.prototype.getPostProcessors = function () {
- var postProcessors = [];
- for (var i = 0; i < this.postProcessors.length; i++) {
- postProcessors.push(this.postProcessors[i].postProcessor);
- }
- return postProcessors;
- };
-
- PluginManager.prototype.getVisitors = function () {
- return this.visitors;
- };
- PluginManager.prototype.visitor = function () {
- var self = this;
- return {
- first: function () {
- self.iterator = -1;
- return self.visitors[self.iterator];
- },
- get: function () {
- self.iterator += 1;
- return self.visitors[self.iterator];
- }
- };
- };
-
- PluginManager.prototype.getFileManagers = function () {
- return this.fileManagers;
- };
- return PluginManager;
- }());
- var pm;
- function PluginManagerFactory(less, newFactory) {
- if (newFactory || !pm) {
- pm = new PluginManager(less);
- }
- return pm;
- }
- var Parse = (function (environment, ParseTree, ImportManager) {
- var parse = function (input, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = copyOptions(this.options, {});
- }
- else {
- options = copyOptions(this.options, options || {});
- }
- if (!callback) {
- var self_1 = this;
- return new Promise(function (resolve, reject) {
- parse.call(self_1, input, options, function (err, output) {
- if (err) {
- reject(err);
- }
- else {
- resolve(output);
- }
- });
- });
- }
- else {
- var context_1;
- var rootFileInfo = void 0;
- var pluginManager_1 = new PluginManagerFactory(this, !options.reUsePluginManager);
- options.pluginManager = pluginManager_1;
- context_1 = new contexts.Parse(options);
- if (options.rootFileInfo) {
- rootFileInfo = options.rootFileInfo;
- }
- else {
- var filename = options.filename || 'input';
- var entryPath = filename.replace(/[^\/\\]*$/, '');
- rootFileInfo = {
- filename: filename,
- rewriteUrls: context_1.rewriteUrls,
- rootpath: context_1.rootpath || '',
- currentDirectory: entryPath,
- entryPath: entryPath,
- rootFilename: filename
- };
-
- if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {
- rootFileInfo.rootpath += '/';
- }
- }
- var imports_1 = new ImportManager(this, context_1, rootFileInfo);
- this.importManager = imports_1;
-
-
- if (options.plugins) {
- options.plugins.forEach(function (plugin) {
- var evalResult;
- var contents;
- if (plugin.fileContent) {
- contents = plugin.fileContent.replace(/^\uFEFF/, '');
- evalResult = pluginManager_1.Loader.evalPlugin(contents, context_1, imports_1, plugin.options, plugin.filename);
- if (evalResult instanceof LessError) {
- return callback(evalResult);
- }
- }
- else {
- pluginManager_1.addPlugin(plugin);
- }
- });
- }
- new Parser(context_1, imports_1, rootFileInfo)
- .parse(input, function (e, root) {
- if (e) {
- return callback(e);
- }
- callback(null, root, imports_1, options);
- }, options);
- }
- };
- return parse;
- });
- var lessRoot = (function (environment$1, fileManagers) {
-
- environment$1 = new environment(environment$1, fileManagers);
- var SourceMapOutput = sourceMapOutput(environment$1);
- var SourceMapBuilder = sourceMapBuilder(SourceMapOutput, environment$1);
- var ParseTree = parseTree(SourceMapBuilder);
- var ImportManager = importManager(environment$1);
- var render = Render(environment$1, ParseTree);
- var parse = Parse(environment$1, ParseTree, ImportManager);
- var functions = Functions(environment$1);
-
- var initial = {
- version: [3, 13, 1],
- data: data,
- tree: tree,
- Environment: environment,
- AbstractFileManager: AbstractFileManager,
- AbstractPluginLoader: AbstractPluginLoader,
- environment: environment$1,
- visitors: visitors,
- Parser: Parser,
- functions: functions,
- contexts: contexts,
- SourceMapOutput: SourceMapOutput,
- SourceMapBuilder: SourceMapBuilder,
- ParseTree: ParseTree,
- ImportManager: ImportManager,
- render: render,
- parse: parse,
- LessError: LessError,
- transformTree: transformTree,
- utils: utils,
- PluginManager: PluginManagerFactory,
- logger: logger
- };
-
- var ctor = function (t) { return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return new (t.bind.apply(t, __spreadArrays([void 0], args)))();
- }; };
- var t;
- var api = Object.create(initial);
- for (var n in initial.tree) {
-
- t = initial.tree[n];
- if (typeof t === 'function') {
- api[n.toLowerCase()] = ctor(t);
- }
- else {
- api[n] = Object.create(null);
- for (var o in t) {
-
- api[n][o.toLowerCase()] = ctor(t[o]);
- }
- }
- }
-
- initial.parse = initial.parse.bind(api);
- initial.render = initial.render.bind(api);
- return api;
- });
-
- var options;
- var logger$1;
- var fileCache = {};
-
- var FileManager = (function (_super) {
- __extends(FileManager, _super);
- function FileManager() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- FileManager.prototype.alwaysMakePathsAbsolute = function () {
- return true;
- };
- FileManager.prototype.join = function (basePath, laterPath) {
- if (!basePath) {
- return laterPath;
- }
- return this.extractUrlParts(laterPath, basePath).path;
- };
- FileManager.prototype.doXHR = function (url, type, callback, errback) {
- var xhr = new XMLHttpRequest();
- var async = options.isFileProtocol ? options.fileAsync : true;
- if (typeof xhr.overrideMimeType === 'function') {
- xhr.overrideMimeType('text/css');
- }
- logger$1.debug("XHR: Getting '" + url + "'");
- xhr.open('GET', url, async);
- xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
- xhr.send(null);
- function handleResponse(xhr, callback, errback) {
- if (xhr.status >= 200 && xhr.status < 300) {
- callback(xhr.responseText, xhr.getResponseHeader('Last-Modified'));
- }
- else if (typeof errback === 'function') {
- errback(xhr.status, url);
- }
- }
- if (options.isFileProtocol && !options.fileAsync) {
- if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {
- callback(xhr.responseText);
- }
- else {
- errback(xhr.status, url);
- }
- }
- else if (async) {
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- handleResponse(xhr, callback, errback);
- }
- };
- }
- else {
- handleResponse(xhr, callback, errback);
- }
- };
- FileManager.prototype.supports = function () {
- return true;
- };
- FileManager.prototype.clearFileCache = function () {
- fileCache = {};
- };
- FileManager.prototype.loadFile = function (filename, currentDirectory, options, environment) {
-
-
- if (currentDirectory && !this.isPathAbsolute(filename)) {
- filename = currentDirectory + filename;
- }
- filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;
- options = options || {};
-
-
- var hrefParts = this.extractUrlParts(filename, window.location.href);
- var href = hrefParts.url;
- var self = this;
- return new Promise(function (resolve, reject) {
- if (options.useFileCache && fileCache[href]) {
- try {
- var lessText = fileCache[href];
- return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() } });
- }
- catch (e) {
- return reject({ filename: href, message: "Error loading file " + href + " error was " + e.message });
- }
- }
- self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {
-
- fileCache[href] = data;
-
- resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } });
- }, function doXHRError(status, url) {
- reject({ type: 'File', message: "'" + url + "' wasn't found (" + status + ")", href: href });
- });
- });
- };
- return FileManager;
- }(AbstractFileManager));
- var FM = (function (opts, log) {
- options = opts;
- logger$1 = log;
- return FileManager;
- });
-
-
- var PluginLoader = (function (_super) {
- __extends(PluginLoader, _super);
- function PluginLoader(less) {
- var _this = _super.call(this) || this;
- _this.less = less;
- return _this;
-
- }
- PluginLoader.prototype.loadPlugin = function (filename, basePath, context, environment, fileManager) {
- return new Promise(function (fulfill, reject) {
- fileManager.loadFile(filename, basePath, context, environment)
- .then(fulfill).catch(reject);
- });
- };
- return PluginLoader;
- }(AbstractPluginLoader));
- var LogListener = (function (less, options) {
- var logLevel_debug = 4;
- var logLevel_info = 3;
- var logLevel_warn = 2;
- var logLevel_error = 1;
-
-
-
-
-
-
- options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);
- if (!options.loggers) {
- options.loggers = [{
- debug: function (msg) {
- if (options.logLevel >= logLevel_debug) {
- console.log(msg);
- }
- },
- info: function (msg) {
- if (options.logLevel >= logLevel_info) {
- console.log(msg);
- }
- },
- warn: function (msg) {
- if (options.logLevel >= logLevel_warn) {
- console.warn(msg);
- }
- },
- error: function (msg) {
- if (options.logLevel >= logLevel_error) {
- console.error(msg);
- }
- }
- }];
- }
- for (var i = 0; i < options.loggers.length; i++) {
- less.logger.addListener(options.loggers[i]);
- }
- });
- var ErrorReporting = (function (window, less, options) {
- function errorHTML(e, rootHref) {
- var id = "less-error-message:" + extractId(rootHref || '');
- var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
- var elem = window.document.createElement('div');
- var timer;
- var content;
- var errors = [];
- var filename = e.filename || rootHref;
- var filenameNoPath = filename.match(/([^\/]+(\?.*)?)$/)[1];
- elem.id = id;
- elem.className = 'less-error-message';
- content = "<h3>" + (e.type || 'Syntax') + "Error: " + (e.message || 'There is an error in your .less file') +
- ("</h3><p>in <a href=\"" + filename + "\">" + filenameNoPath + "</a> ");
- var errorline = function (e, i, classname) {
- if (e.extract[i] !== undefined) {
- errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
- .replace(/\{class\}/, classname)
- .replace(/\{content\}/, e.extract[i]));
- }
- };
- if (e.line) {
- errorline(e, 0, '');
- errorline(e, 1, 'line');
- errorline(e, 2, '');
- content += "on line " + e.line + ", column " + (e.column + 1) + ":</p><ul>" + errors.join('') + "</ul>";
- }
- if (e.stack && (e.extract || options.logLevel >= 4)) {
- content += "<br/>Stack Trace</br />" + e.stack.split('\n').slice(1).join('<br/>');
- }
- elem.innerHTML = content;
-
- browser.createCSS(window.document, [
- '.less-error-message ul, .less-error-message li {',
- 'list-style-type: none;',
- 'margin-right: 15px;',
- 'padding: 4px 0;',
- 'margin: 0;',
- '}',
- '.less-error-message label {',
- 'font-size: 12px;',
- 'margin-right: 15px;',
- 'padding: 4px 0;',
- 'color: #cc7777;',
- '}',
- '.less-error-message pre {',
- 'color: #dd6666;',
- 'padding: 4px 0;',
- 'margin: 0;',
- 'display: inline-block;',
- '}',
- '.less-error-message pre.line {',
- 'color: #ff0000;',
- '}',
- '.less-error-message h3 {',
- 'font-size: 20px;',
- 'font-weight: bold;',
- 'padding: 15px 0 5px 0;',
- 'margin: 0;',
- '}',
- '.less-error-message a {',
- 'color: #10a',
- '}',
- '.less-error-message .error {',
- 'color: red;',
- 'font-weight: bold;',
- 'padding-bottom: 2px;',
- 'border-bottom: 1px dashed red;',
- '}'
- ].join('\n'), { title: 'error-message' });
- elem.style.cssText = [
- 'font-family: Arial, sans-serif',
- 'border: 1px solid #e00',
- 'background-color: #eee',
- 'border-radius: 5px',
- '-webkit-border-radius: 5px',
- '-moz-border-radius: 5px',
- 'color: #e00',
- 'padding: 15px',
- 'margin-bottom: 15px'
- ].join(';');
- if (options.env === 'development') {
- timer = setInterval(function () {
- var document = window.document;
- var body = document.body;
- if (body) {
- if (document.getElementById(id)) {
- body.replaceChild(elem, document.getElementById(id));
- }
- else {
- body.insertBefore(elem, body.firstChild);
- }
- clearInterval(timer);
- }
- }, 10);
- }
- }
- function removeErrorHTML(path) {
- var node = window.document.getElementById("less-error-message:" + extractId(path));
- if (node) {
- node.parentNode.removeChild(node);
- }
- }
- function removeError(path) {
- if (!options.errorReporting || options.errorReporting === 'html') {
- removeErrorHTML(path);
- }
- else if (options.errorReporting === 'console') ;
- else if (typeof options.errorReporting === 'function') {
- options.errorReporting('remove', path);
- }
- }
- function errorConsole(e, rootHref) {
- var template = '{line} {content}';
- var filename = e.filename || rootHref;
- var errors = [];
- var content = (e.type || 'Syntax') + "Error: " + (e.message || 'There is an error in your .less file') + " in " + filename;
- var errorline = function (e, i, classname) {
- if (e.extract[i] !== undefined) {
- errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
- .replace(/\{class\}/, classname)
- .replace(/\{content\}/, e.extract[i]));
- }
- };
- if (e.line) {
- errorline(e, 0, '');
- errorline(e, 1, 'line');
- errorline(e, 2, '');
- content += " on line " + e.line + ", column " + (e.column + 1) + ":\n" + errors.join('\n');
- }
- if (e.stack && (e.extract || options.logLevel >= 4)) {
- content += "\nStack Trace\n" + e.stack;
- }
- less.logger.error(content);
- }
- function error(e, rootHref) {
- if (!options.errorReporting || options.errorReporting === 'html') {
- errorHTML(e, rootHref);
- }
- else if (options.errorReporting === 'console') {
- errorConsole(e, rootHref);
- }
- else if (typeof options.errorReporting === 'function') {
- options.errorReporting('add', e, rootHref);
- }
- }
- return {
- add: error,
- remove: removeError
- };
- });
-
- var Cache = (function (window, options, logger) {
- var cache = null;
- if (options.env !== 'development') {
- try {
- cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;
- }
- catch (_) { }
- }
- return {
- setCSS: function (path, lastModified, modifyVars, styles) {
- if (cache) {
- logger.info("saving " + path + " to cache.");
- try {
- cache.setItem(path, styles);
- cache.setItem(path + ":timestamp", lastModified);
- if (modifyVars) {
- cache.setItem(path + ":vars", JSON.stringify(modifyVars));
- }
- }
- catch (e) {
-
- logger.error("failed to save \"" + path + "\" to local storage for caching.");
- }
- }
- },
- getCSS: function (path, webInfo, modifyVars) {
- var css = cache && cache.getItem(path);
- var timestamp = cache && cache.getItem(path + ":timestamp");
- var vars = cache && cache.getItem(path + ":vars");
- modifyVars = modifyVars || {};
- vars = vars || "{}";
- if (timestamp && webInfo.lastModified &&
- (new Date(webInfo.lastModified).valueOf() ===
- new Date(timestamp).valueOf()) &&
- JSON.stringify(modifyVars) === vars) {
-
- return css;
- }
- }
- };
- });
- var ImageSize = (function () {
- function imageSize() {
- throw {
- type: 'Runtime',
- message: 'Image size functions are not supported in browser version of less'
- };
- }
- var imageFunctions = {
- 'image-size': function (filePathNode) {
- imageSize();
- return -1;
- },
- 'image-width': function (filePathNode) {
- imageSize();
- return -1;
- },
- 'image-height': function (filePathNode) {
- imageSize();
- return -1;
- }
- };
- functionRegistry.addMultiple(imageFunctions);
- });
-
- var root = (function (window, options) {
- var document = window.document;
- var less = lessRoot();
- less.options = options;
- var environment = less.environment;
- var FileManager = FM(options, less.logger);
- var fileManager = new FileManager();
- environment.addFileManager(fileManager);
- less.FileManager = FileManager;
- less.PluginLoader = PluginLoader;
- LogListener(less, options);
- var errors = ErrorReporting(window, less, options);
- var cache = less.cache = options.cache || Cache(window, options, less.logger);
- ImageSize(less.environment);
-
- if (options.functions) {
- less.functions.functionRegistry.addMultiple(options.functions);
- }
- var typePattern = /^text\/(x-)?less$/;
- function clone(obj) {
- var cloned = {};
- for (var prop in obj) {
- if (obj.hasOwnProperty(prop)) {
- cloned[prop] = obj[prop];
- }
- }
- return cloned;
- }
-
- function bind(func, thisArg) {
- var curryArgs = Array.prototype.slice.call(arguments, 2);
- return function () {
- var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));
- return func.apply(thisArg, args);
- };
- }
- function loadStyles(modifyVars) {
- var styles = document.getElementsByTagName('style');
- var style;
- for (var i = 0; i < styles.length; i++) {
- style = styles[i];
- if (style.type.match(typePattern)) {
- var instanceOptions = clone(options);
- instanceOptions.modifyVars = modifyVars;
- var lessText = style.innerHTML || '';
- instanceOptions.filename = document.location.href.replace(/#.*$/, '');
-
-
- less.render(lessText, instanceOptions, bind(function (style, e, result) {
- if (e) {
- errors.add(e, 'inline');
- }
- else {
- style.type = 'text/css';
- if (style.styleSheet) {
- style.styleSheet.cssText = result.css;
- }
- else {
- style.innerHTML = result.css;
- }
- }
- }, null, style));
- }
- }
- }
- function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
- var instanceOptions = clone(options);
- addDataAttr(instanceOptions, sheet);
- instanceOptions.mime = sheet.type;
- if (modifyVars) {
- instanceOptions.modifyVars = modifyVars;
- }
- function loadInitialFileCallback(loadedFile) {
- var data = loadedFile.contents;
- var path = loadedFile.filename;
- var webInfo = loadedFile.webInfo;
- var newFileInfo = {
- currentDirectory: fileManager.getPath(path),
- filename: path,
- rootFilename: path,
- rewriteUrls: instanceOptions.rewriteUrls
- };
- newFileInfo.entryPath = newFileInfo.currentDirectory;
- newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;
- if (webInfo) {
- webInfo.remaining = remaining;
- var css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);
- if (!reload && css) {
- webInfo.local = true;
- callback(null, css, data, sheet, webInfo, path);
- return;
- }
- }
-
- errors.remove(path);
- instanceOptions.rootFileInfo = newFileInfo;
- less.render(data, instanceOptions, function (e, result) {
- if (e) {
- e.href = path;
- callback(e);
- }
- else {
- cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);
- callback(null, result.css, data, sheet, webInfo, path);
- }
- });
- }
- fileManager.loadFile(sheet.href, null, instanceOptions, environment)
- .then(function (loadedFile) {
- loadInitialFileCallback(loadedFile);
- }).catch(function (err) {
- console.log(err);
- callback(err);
- });
- }
- function loadStyleSheets(callback, reload, modifyVars) {
- for (var i = 0; i < less.sheets.length; i++) {
- loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);
- }
- }
- function initRunningMode() {
- if (less.env === 'development') {
- less.watchTimer = setInterval(function () {
- if (less.watchMode) {
- fileManager.clearFileCache();
- loadStyleSheets(function (e, css, _, sheet, webInfo) {
- if (e) {
- errors.add(e, e.href || sheet.href);
- }
- else if (css) {
- browser.createCSS(window.document, css, sheet);
- }
- });
- }
- }, options.poll);
- }
- }
-
-
-
- less.watch = function () {
- if (!less.watchMode) {
- less.env = 'development';
- initRunningMode();
- }
- this.watchMode = true;
- return true;
- };
- less.unwatch = function () { clearInterval(less.watchTimer); this.watchMode = false; return false; };
-
-
-
-
- less.registerStylesheetsImmediately = function () {
- var links = document.getElementsByTagName('link');
- less.sheets = [];
- for (var i = 0; i < links.length; i++) {
- if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
- (links[i].type.match(typePattern)))) {
- less.sheets.push(links[i]);
- }
- }
- };
-
-
-
-
- less.registerStylesheets = function () { return new Promise(function (resolve, reject) {
- less.registerStylesheetsImmediately();
- resolve();
- }); };
-
-
-
-
- less.modifyVars = function (record) { return less.refresh(true, record, false); };
- less.refresh = function (reload, modifyVars, clearFileCache) {
- if ((reload || clearFileCache) && clearFileCache !== false) {
- fileManager.clearFileCache();
- }
- return new Promise(function (resolve, reject) {
- var startTime;
- var endTime;
- var totalMilliseconds;
- var remainingSheets;
- startTime = endTime = new Date();
-
- remainingSheets = less.sheets.length;
- if (remainingSheets === 0) {
- endTime = new Date();
- totalMilliseconds = endTime - startTime;
- less.logger.info('Less has finished and no sheets were loaded.');
- resolve({
- startTime: startTime,
- endTime: endTime,
- totalMilliseconds: totalMilliseconds,
- sheets: less.sheets.length
- });
- }
- else {
-
- loadStyleSheets(function (e, css, _, sheet, webInfo) {
- if (e) {
- errors.add(e, e.href || sheet.href);
- reject(e);
- return;
- }
- if (webInfo.local) {
- less.logger.info("Loading " + sheet.href + " from cache.");
- }
- else {
- less.logger.info("Rendered " + sheet.href + " successfully.");
- }
- browser.createCSS(window.document, css, sheet);
- less.logger.info("CSS for " + sheet.href + " generated in " + (new Date() - endTime) + "ms");
-
- remainingSheets--;
-
- if (remainingSheets === 0) {
- totalMilliseconds = new Date() - startTime;
- less.logger.info("Less has finished. CSS generated in " + totalMilliseconds + "ms");
- resolve({
- startTime: startTime,
- endTime: endTime,
- totalMilliseconds: totalMilliseconds,
- sheets: less.sheets.length
- });
- }
- endTime = new Date();
- }, reload, modifyVars);
- }
- loadStyles(modifyVars);
- });
- };
- less.refreshStyles = loadStyles;
- return less;
- });
-
- var options$1 = defaultOptions();
- if (window.less) {
- for (var key in window.less) {
- if (window.less.hasOwnProperty(key)) {
- options$1[key] = window.less[key];
- }
- }
- }
- addDefaultOptions(window, options$1);
- options$1.plugins = options$1.plugins || [];
- if (window.LESS_PLUGINS) {
- options$1.plugins = options$1.plugins.concat(window.LESS_PLUGINS);
- }
- var less = root(window, options$1);
- window.less = less;
- var css;
- var head;
- var style;
-
- function resolveOrReject(data) {
- if (data.filename) {
- console.warn(data);
- }
- if (!options$1.async) {
- head.removeChild(style);
- }
- }
- if (options$1.onReady) {
- if (/!watch/.test(window.location.hash)) {
- less.watch();
- }
-
- if (!options$1.async) {
- css = 'body { display: none !important }';
- head = document.head || document.getElementsByTagName('head')[0];
- style = document.createElement('style');
- style.type = 'text/css';
- if (style.styleSheet) {
- style.styleSheet.cssText = css;
- }
- else {
- style.appendChild(document.createTextNode(css));
- }
- head.appendChild(style);
- }
- less.registerStylesheetsImmediately();
- less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);
- }
- return less;
- })));
- }),
- (function(module, exports, __webpack_require__) {
- var csstree = __webpack_require__(1);
- var parse = csstree.parse;
- var compress = __webpack_require__(192);
- var generate = csstree.generate;
- function debugOutput(name, options, startTime, data) {
- if (options.debug) {
- console.error('## ' + name + ' done in %d ms\n', Date.now() - startTime);
- }
- return data;
- }
- function createDefaultLogger(level) {
- var lastDebug;
- return function logger(title, ast) {
- var line = title;
- if (ast) {
- line = '[' + ((Date.now() - lastDebug) / 1000).toFixed(3) + 's] ' + line;
- }
- if (level > 1 && ast) {
- var css = generate(ast);
-
- if (level === 2 && css.length > 256) {
- css = css.substr(0, 256) + '...';
- }
- line += '\n ' + css + '\n';
- }
- console.error(line);
- lastDebug = Date.now();
- };
- }
- function copy(obj) {
- var result = {};
- for (var key in obj) {
- result[key] = obj[key];
- }
- return result;
- }
- function buildCompressOptions(options) {
- options = copy(options);
- if (typeof options.logger !== 'function' && options.debug) {
- options.logger = createDefaultLogger(options.debug);
- }
- return options;
- }
- function runHandler(ast, options, handlers) {
- if (!Array.isArray(handlers)) {
- handlers = [handlers];
- }
- handlers.forEach(function(fn) {
- fn(ast, options);
- });
- }
- function minify(context, source, options) {
- options = options || {};
- var filename = options.filename || '<unknown>';
- var result;
-
- var ast = debugOutput('parsing', options, Date.now(),
- parse(source, {
- context: context,
- filename: filename,
- positions: Boolean(options.sourceMap)
- })
- );
-
- if (options.beforeCompress) {
- debugOutput('beforeCompress', options, Date.now(),
- runHandler(ast, options, options.beforeCompress)
- );
- }
-
- var compressResult = debugOutput('compress', options, Date.now(),
- compress(ast, buildCompressOptions(options))
- );
-
- if (options.afterCompress) {
- debugOutput('afterCompress', options, Date.now(),
- runHandler(compressResult, options, options.afterCompress)
- );
- }
-
- if (options.sourceMap) {
- result = debugOutput('generate(sourceMap: true)', options, Date.now(), (function() {
- var tmp = generate(compressResult.ast, { sourceMap: true });
- tmp.map._file = filename;
- tmp.map.setSourceContent(filename, source);
- return tmp;
- })());
- } else {
- result = debugOutput('generate', options, Date.now(), {
- css: generate(compressResult.ast),
- map: null
- });
- }
- return result;
- }
- function minifyStylesheet(source, options) {
- return minify('stylesheet', source, options);
- }
- function minifyBlock(source, options) {
- return minify('declarationList', source, options);
- }
- module.exports = {
- version: __webpack_require__(226).version,
-
- minify: minifyStylesheet,
- minifyBlock: minifyBlock,
-
- compress: compress,
-
- syntax: csstree
- };
- }),
- (function(module, exports, __webpack_require__) {
- function merge() {
- var dest = {};
- for (var i = 0; i < arguments.length; i++) {
- var src = arguments[i];
- for (var key in src) {
- dest[key] = src[key];
- }
- }
- return dest;
- }
- module.exports = __webpack_require__(98).create(
- merge(
- __webpack_require__(125),
- __webpack_require__(167),
- __webpack_require__(191)
- )
- );
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(7);
- var Tokenizer = __webpack_require__(0);
- var Lexer = __webpack_require__(101);
- var grammar = __webpack_require__(109);
- var createParser = __webpack_require__(110);
- var createGenerator = __webpack_require__(112);
- var createConvertor = __webpack_require__(121);
- var createWalker = __webpack_require__(122);
- var clone = __webpack_require__(123);
- var names = __webpack_require__(26);
- var mix = __webpack_require__(124);
- function assign(dest, src) {
- for (var key in src) {
- dest[key] = src[key];
- }
- return dest;
- }
- function createSyntax(config) {
- var parse = createParser(config);
- var walk = createWalker(config);
- var generate = createGenerator(config);
- var convert = createConvertor(walk);
- var syntax = {
- List: List,
- Tokenizer: Tokenizer,
- Lexer: Lexer,
- vendorPrefix: names.vendorPrefix,
- keyword: names.keyword,
- property: names.property,
- isCustomProperty: names.isCustomProperty,
- grammar: grammar,
- lexer: null,
- createLexer: function(config) {
- return new Lexer(config, syntax, syntax.lexer.structure);
- },
- parse: parse,
- walk: walk,
- generate: generate,
- clone: clone,
- fromPlainObject: convert.fromPlainObject,
- toPlainObject: convert.toPlainObject,
- createSyntax: function(config) {
- return createSyntax(mix({}, config));
- },
- fork: function(extension) {
- var base = mix({}, config);
- return createSyntax(
- typeof extension === 'function'
- ? extension(base, assign)
- : mix(base, extension)
- );
- }
- };
- syntax.lexer = new Lexer({
- generic: true,
- types: config.types,
- properties: config.properties,
- node: config.node
- }, syntax);
- return syntax;
- };
- exports.create = function(config) {
- return createSyntax(mix({}, config));
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var CssSyntaxError = __webpack_require__(100);
- var constants = __webpack_require__(24);
- var TYPE = constants.TYPE;
- var NAME = constants.NAME;
- var SYMBOL_TYPE = constants.SYMBOL_TYPE;
- var utils = __webpack_require__(45);
- var firstCharOffset = utils.firstCharOffset;
- var cmpStr = utils.cmpStr;
- var isNumber = utils.isNumber;
- var findWhiteSpaceStart = utils.findWhiteSpaceStart;
- var findWhiteSpaceEnd = utils.findWhiteSpaceEnd;
- var findCommentEnd = utils.findCommentEnd;
- var findStringEnd = utils.findStringEnd;
- var findNumberEnd = utils.findNumberEnd;
- var findIdentifierEnd = utils.findIdentifierEnd;
- var findUrlRawEnd = utils.findUrlRawEnd;
- var NULL = 0;
- var WHITESPACE = TYPE.WhiteSpace;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBER = TYPE.Number;
- var STRING = TYPE.String;
- var COMMENT = TYPE.Comment;
- var PUNCTUATOR = TYPE.Punctuator;
- var CDO = TYPE.CDO;
- var CDC = TYPE.CDC;
- var ATKEYWORD = TYPE.AtKeyword;
- var FUNCTION = TYPE.Function;
- var URL = TYPE.Url;
- var RAW = TYPE.Raw;
- var N = 10;
- var F = 12;
- var R = 13;
- var STAR = TYPE.Asterisk;
- var SLASH = TYPE.Solidus;
- var FULLSTOP = TYPE.FullStop;
- var PLUSSIGN = TYPE.PlusSign;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var GREATERTHANSIGN = TYPE.GreaterThanSign;
- var LESSTHANSIGN = TYPE.LessThanSign;
- var EXCLAMATIONMARK = TYPE.ExclamationMark;
- var COMMERCIALAT = TYPE.CommercialAt;
- var QUOTATIONMARK = TYPE.QuotationMark;
- var APOSTROPHE = TYPE.Apostrophe;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;
- var RIGHTCURLYBRACKET = TYPE.RightCurlyBracket;
- var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
- var RIGHTSQUAREBRACKET = TYPE.RightSquareBracket;
- var MIN_BUFFER_SIZE = 16 * 1024;
- var OFFSET_MASK = 0x00FFFFFF;
- var TYPE_SHIFT = 24;
- var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array;
- function computeLinesAndColumns(tokenizer, source) {
- var sourceLength = source.length;
- var start = firstCharOffset(source);
- var lines = tokenizer.lines;
- var line = tokenizer.startLine;
- var columns = tokenizer.columns;
- var column = tokenizer.startColumn;
- if (lines === null || lines.length < sourceLength + 1) {
- lines = new SafeUint32Array(Math.max(sourceLength + 1024, MIN_BUFFER_SIZE));
- columns = new SafeUint32Array(lines.length);
- }
- for (var i = start; i < sourceLength; i++) {
- var code = source.charCodeAt(i);
- lines[i] = line;
- columns[i] = column++;
- if (code === N || code === R || code === F) {
- if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) {
- i++;
- lines[i] = line;
- columns[i] = column;
- }
- line++;
- column = 1;
- }
- }
- lines[i] = line;
- columns[i] = column;
- tokenizer.linesAnsColumnsComputed = true;
- tokenizer.lines = lines;
- tokenizer.columns = columns;
- }
- function tokenLayout(tokenizer, source, startPos) {
- var sourceLength = source.length;
- var offsetAndType = tokenizer.offsetAndType;
- var balance = tokenizer.balance;
- var tokenCount = 0;
- var prevType = 0;
- var offset = startPos;
- var anchor = 0;
- var balanceCloseCode = 0;
- var balanceStart = 0;
- var balancePrev = 0;
- if (offsetAndType === null || offsetAndType.length < sourceLength + 1) {
- offsetAndType = new SafeUint32Array(sourceLength + 1024);
- balance = new SafeUint32Array(sourceLength + 1024);
- }
- while (offset < sourceLength) {
- var code = source.charCodeAt(offset);
- var type = code < 0x80 ? SYMBOL_TYPE[code] : IDENTIFIER;
- balance[tokenCount] = sourceLength;
- switch (type) {
- case WHITESPACE:
- offset = findWhiteSpaceEnd(source, offset + 1);
- break;
- case PUNCTUATOR:
- switch (code) {
- case balanceCloseCode:
- balancePrev = balanceStart & OFFSET_MASK;
- balanceStart = balance[balancePrev];
- balanceCloseCode = balanceStart >> TYPE_SHIFT;
- balance[tokenCount] = balancePrev;
- balance[balancePrev++] = tokenCount;
- for (; balancePrev < tokenCount; balancePrev++) {
- if (balance[balancePrev] === sourceLength) {
- balance[balancePrev] = tokenCount;
- }
- }
- break;
- case LEFTSQUAREBRACKET:
- balance[tokenCount] = balanceStart;
- balanceCloseCode = RIGHTSQUAREBRACKET;
- balanceStart = (balanceCloseCode << TYPE_SHIFT) | tokenCount;
- break;
- case LEFTCURLYBRACKET:
- balance[tokenCount] = balanceStart;
- balanceCloseCode = RIGHTCURLYBRACKET;
- balanceStart = (balanceCloseCode << TYPE_SHIFT) | tokenCount;
- break;
- case LEFTPARENTHESIS:
- balance[tokenCount] = balanceStart;
- balanceCloseCode = RIGHTPARENTHESIS;
- balanceStart = (balanceCloseCode << TYPE_SHIFT) | tokenCount;
- break;
- }
-
- if (code === STAR && prevType === SLASH) {
- type = COMMENT;
- offset = findCommentEnd(source, offset + 1);
- tokenCount--;
- break;
- }
-
- if (code === FULLSTOP && (prevType === PLUSSIGN || prevType === HYPHENMINUS)) {
- if (offset + 1 < sourceLength && isNumber(source.charCodeAt(offset + 1))) {
- type = NUMBER;
- offset = findNumberEnd(source, offset + 2, false);
- tokenCount--;
- break;
- }
- }
-
- if (code === EXCLAMATIONMARK && prevType === LESSTHANSIGN) {
- if (offset + 2 < sourceLength &&
- source.charCodeAt(offset + 1) === HYPHENMINUS &&
- source.charCodeAt(offset + 2) === HYPHENMINUS) {
- type = CDO;
- offset = offset + 3;
- tokenCount--;
- break;
- }
- }
-
- if (code === HYPHENMINUS && prevType === HYPHENMINUS) {
- if (offset + 1 < sourceLength && source.charCodeAt(offset + 1) === GREATERTHANSIGN) {
- type = CDC;
- offset = offset + 2;
- tokenCount--;
- break;
- }
- }
-
- if (code === LEFTPARENTHESIS && prevType === IDENTIFIER) {
- offset = offset + 1;
- tokenCount--;
- balance[tokenCount] = balance[tokenCount + 1];
- balanceStart--;
-
- if (offset - anchor === 4 && cmpStr(source, anchor, offset, 'url(')) {
-
- anchor = findWhiteSpaceEnd(source, offset);
- code = source.charCodeAt(anchor);
- if (code !== LEFTPARENTHESIS &&
- code !== RIGHTPARENTHESIS &&
- code !== QUOTATIONMARK &&
- code !== APOSTROPHE) {
-
- offsetAndType[tokenCount++] = (URL << TYPE_SHIFT) | offset;
- balance[tokenCount] = sourceLength;
-
- if (anchor !== offset) {
- offsetAndType[tokenCount++] = (WHITESPACE << TYPE_SHIFT) | anchor;
- balance[tokenCount] = sourceLength;
- }
-
- type = RAW;
- offset = findUrlRawEnd(source, anchor);
- } else {
- type = URL;
- }
- } else {
- type = FUNCTION;
- }
- break;
- }
- type = code;
- offset = offset + 1;
- break;
- case NUMBER:
- offset = findNumberEnd(source, offset + 1, prevType !== FULLSTOP);
-
- if (prevType === FULLSTOP ||
- prevType === HYPHENMINUS ||
- prevType === PLUSSIGN) {
- tokenCount--;
- }
- break;
- case STRING:
- offset = findStringEnd(source, offset + 1, code);
- break;
- default:
- anchor = offset;
- offset = findIdentifierEnd(source, offset);
-
- if (prevType === HYPHENMINUS) {
-
- tokenCount--;
-
-
- prevType = tokenCount === 0 ? 0 : offsetAndType[tokenCount - 1] >> TYPE_SHIFT;
- }
- if (prevType === COMMERCIALAT) {
-
- tokenCount--;
- type = ATKEYWORD;
- }
- }
- offsetAndType[tokenCount++] = (type << TYPE_SHIFT) | offset;
- prevType = type;
- }
-
- offsetAndType[tokenCount] = offset;
- balance[tokenCount] = sourceLength;
- balance[sourceLength] = sourceLength;
- while (balanceStart !== 0) {
- balancePrev = balanceStart & OFFSET_MASK;
- balanceStart = balance[balancePrev];
- balance[balancePrev] = sourceLength;
- }
- tokenizer.offsetAndType = offsetAndType;
- tokenizer.tokenCount = tokenCount;
- tokenizer.balance = balance;
- }
- var Tokenizer = function(source, startOffset, startLine, startColumn) {
- this.offsetAndType = null;
- this.balance = null;
- this.lines = null;
- this.columns = null;
- this.setSource(source, startOffset, startLine, startColumn);
- };
- Tokenizer.prototype = {
- setSource: function(source, startOffset, startLine, startColumn) {
- var safeSource = String(source || '');
- var start = firstCharOffset(safeSource);
- this.source = safeSource;
- this.firstCharOffset = start;
- this.startOffset = typeof startOffset === 'undefined' ? 0 : startOffset;
- this.startLine = typeof startLine === 'undefined' ? 1 : startLine;
- this.startColumn = typeof startColumn === 'undefined' ? 1 : startColumn;
- this.linesAnsColumnsComputed = false;
- this.eof = false;
- this.currentToken = -1;
- this.tokenType = 0;
- this.tokenStart = start;
- this.tokenEnd = start;
- tokenLayout(this, safeSource, start);
- this.next();
- },
- lookupType: function(offset) {
- offset += this.currentToken;
- if (offset < this.tokenCount) {
- return this.offsetAndType[offset] >> TYPE_SHIFT;
- }
- return NULL;
- },
- lookupNonWSType: function(offset) {
- offset += this.currentToken;
- for (var type; offset < this.tokenCount; offset++) {
- type = this.offsetAndType[offset] >> TYPE_SHIFT;
- if (type !== WHITESPACE) {
- return type;
- }
- }
- return NULL;
- },
- lookupValue: function(offset, referenceStr) {
- offset += this.currentToken;
- if (offset < this.tokenCount) {
- return cmpStr(
- this.source,
- this.offsetAndType[offset - 1] & OFFSET_MASK,
- this.offsetAndType[offset] & OFFSET_MASK,
- referenceStr
- );
- }
- return false;
- },
- getTokenStart: function(tokenNum) {
- if (tokenNum === this.currentToken) {
- return this.tokenStart;
- }
- if (tokenNum > 0) {
- return tokenNum < this.tokenCount
- ? this.offsetAndType[tokenNum - 1] & OFFSET_MASK
- : this.offsetAndType[this.tokenCount] & OFFSET_MASK;
- }
- return this.firstCharOffset;
- },
- getOffsetExcludeWS: function() {
- if (this.currentToken > 0) {
- if ((this.offsetAndType[this.currentToken - 1] >> TYPE_SHIFT) === WHITESPACE) {
- return this.currentToken > 1
- ? this.offsetAndType[this.currentToken - 2] & OFFSET_MASK
- : this.firstCharOffset;
- }
- }
- return this.tokenStart;
- },
- getRawLength: function(startToken, endTokenType1, endTokenType2, includeTokenType2) {
- var cursor = startToken;
- var balanceEnd;
- loop:
- for (; cursor < this.tokenCount; cursor++) {
- balanceEnd = this.balance[cursor];
-
- if (balanceEnd < startToken) {
- break loop;
- }
-
- switch (this.offsetAndType[cursor] >> TYPE_SHIFT) {
- case endTokenType1:
- break loop;
- case endTokenType2:
- if (includeTokenType2) {
- cursor++;
- }
- break loop;
- default:
-
- if (this.balance[balanceEnd] === cursor) {
- cursor = balanceEnd;
- }
- }
- }
- return cursor - this.currentToken;
- },
- isBalanceEdge: function(pos) {
- var balanceStart = this.balance[this.currentToken];
- return balanceStart < pos;
- },
- getTokenValue: function() {
- return this.source.substring(this.tokenStart, this.tokenEnd);
- },
- substrToCursor: function(start) {
- return this.source.substring(start, this.tokenStart);
- },
- skipWS: function() {
- for (var i = this.currentToken, skipTokenCount = 0; i < this.tokenCount; i++, skipTokenCount++) {
- if ((this.offsetAndType[i] >> TYPE_SHIFT) !== WHITESPACE) {
- break;
- }
- }
- if (skipTokenCount > 0) {
- this.skip(skipTokenCount);
- }
- },
- skipSC: function() {
- while (this.tokenType === WHITESPACE || this.tokenType === COMMENT) {
- this.next();
- }
- },
- skip: function(tokenCount) {
- var next = this.currentToken + tokenCount;
- if (next < this.tokenCount) {
- this.currentToken = next;
- this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
- next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT;
- this.tokenEnd = next & OFFSET_MASK;
- } else {
- this.currentToken = this.tokenCount;
- this.next();
- }
- },
- next: function() {
- var next = this.currentToken + 1;
- if (next < this.tokenCount) {
- this.currentToken = next;
- this.tokenStart = this.tokenEnd;
- next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT;
- this.tokenEnd = next & OFFSET_MASK;
- } else {
- this.currentToken = this.tokenCount;
- this.eof = true;
- this.tokenType = NULL;
- this.tokenStart = this.tokenEnd = this.source.length;
- }
- },
- eat: function(tokenType) {
- if (this.tokenType !== tokenType) {
- var offset = this.tokenStart;
- var message = NAME[tokenType] + ' is expected';
-
- if (tokenType === IDENTIFIER) {
-
- if (this.tokenType === FUNCTION || this.tokenType === URL) {
- offset = this.tokenEnd - 1;
- message += ' but function found';
- }
- } else {
-
-
- if (this.source.charCodeAt(this.tokenStart) === tokenType) {
- offset = offset + 1;
- }
- }
- this.error(message, offset);
- }
- this.next();
- },
- eatNonWS: function(tokenType) {
- this.skipWS();
- this.eat(tokenType);
- },
- consume: function(tokenType) {
- var value = this.getTokenValue();
- this.eat(tokenType);
- return value;
- },
- consumeFunctionName: function() {
- var name = this.source.substring(this.tokenStart, this.tokenEnd - 1);
- this.eat(FUNCTION);
- return name;
- },
- consumeNonWS: function(tokenType) {
- this.skipWS();
- return this.consume(tokenType);
- },
- expectIdentifier: function(name) {
- if (this.tokenType !== IDENTIFIER || cmpStr(this.source, this.tokenStart, this.tokenEnd, name) === false) {
- this.error('Identifier `' + name + '` is expected');
- }
- this.next();
- },
- getLocation: function(offset, filename) {
- if (!this.linesAnsColumnsComputed) {
- computeLinesAndColumns(this, this.source);
- }
- return {
- source: filename,
- offset: this.startOffset + offset,
- line: this.lines[offset],
- column: this.columns[offset]
- };
- },
- getLocationRange: function(start, end, filename) {
- if (!this.linesAnsColumnsComputed) {
- computeLinesAndColumns(this, this.source);
- }
- return {
- source: filename,
- start: {
- offset: this.startOffset + start,
- line: this.lines[start],
- column: this.columns[start]
- },
- end: {
- offset: this.startOffset + end,
- line: this.lines[end],
- column: this.columns[end]
- }
- };
- },
- error: function(message, offset) {
- var location = typeof offset !== 'undefined' && offset < this.source.length
- ? this.getLocation(offset)
- : this.eof
- ? this.getLocation(findWhiteSpaceStart(this.source, this.source.length - 1))
- : this.getLocation(this.tokenStart);
- throw new CssSyntaxError(
- message || 'Unexpected input',
- this.source,
- location.offset,
- location.line,
- location.column
- );
- },
- dump: function() {
- var offset = 0;
- return Array.prototype.slice.call(this.offsetAndType, 0, this.tokenCount).map(function(item, idx) {
- var start = offset;
- var end = item & OFFSET_MASK;
- offset = end;
- return {
- idx: idx,
- type: NAME[item >> TYPE_SHIFT],
- chunk: this.source.substring(start, end),
- balance: this.balance[idx]
- };
- }, this);
- }
- };
- Tokenizer.CssSyntaxError = CssSyntaxError;
- Object.keys(constants).forEach(function(key) {
- Tokenizer[key] = constants[key];
- });
- Object.keys(utils).forEach(function(key) {
- Tokenizer[key] = utils[key];
- });
- new Tokenizer('\n\r\r\n\f<!---->//""\'\'/*\r\n\f*/1a;.\\31\t\+2{url(a);func();+1.2e3 -.4e-5 .6e+7}').getLocation();
- module.exports = Tokenizer;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var createCustomError = __webpack_require__(23);
- var MAX_LINE_LENGTH = 100;
- var OFFSET_CORRECTION = 60;
- var TAB_REPLACEMENT = ' ';
- function sourceFragment(error, extraLines) {
- function processLines(start, end) {
- return lines.slice(start, end).map(function(line, idx) {
- var num = String(start + idx + 1);
- while (num.length < maxNumLength) {
- num = ' ' + num;
- }
- return num + ' |' + line;
- }).join('\n');
- }
- var lines = error.source.split(/\r\n?|\n|\f/);
- var line = error.line;
- var column = error.column;
- var startLine = Math.max(1, line - extraLines) - 1;
- var endLine = Math.min(line + extraLines, lines.length + 1);
- var maxNumLength = Math.max(4, String(endLine).length) + 1;
- var cutLeft = 0;
-
- column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;
- if (column > MAX_LINE_LENGTH) {
- cutLeft = column - OFFSET_CORRECTION + 3;
- column = OFFSET_CORRECTION - 2;
- }
- for (var i = startLine; i <= endLine; i++) {
- if (i >= 0 && i < lines.length) {
- lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
- lines[i] =
- (cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
- lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
- (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
- }
- }
- return [
- processLines(startLine, line),
- new Array(column + maxNumLength + 2).join('-') + '^',
- processLines(line, endLine)
- ].filter(Boolean).join('\n');
- }
- var CssSyntaxError = function(message, source, offset, line, column) {
- var error = createCustomError('CssSyntaxError', message);
- error.source = source;
- error.offset = offset;
- error.line = line;
- error.column = column;
- error.sourceFragment = function(extraLines) {
- return sourceFragment(error, isNaN(extraLines) ? 0 : extraLines);
- };
- Object.defineProperty(error, 'formattedMessage', {
- get: function() {
- return (
- 'Parse error: ' + error.message + '\n' +
- sourceFragment(error, 2)
- );
- }
- });
-
- error.parseError = {
- offset: offset,
- line: line,
- column: column
- };
- return error;
- };
- module.exports = CssSyntaxError;
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var SyntaxReferenceError = __webpack_require__(46).SyntaxReferenceError;
- var MatchError = __webpack_require__(46).MatchError;
- var names = __webpack_require__(26);
- var generic = __webpack_require__(102);
- var parse = __webpack_require__(27);
- var generate = __webpack_require__(25);
- var walk = __webpack_require__(48);
- var astToTokens = __webpack_require__(104);
- var buildMatchGraph = __webpack_require__(49).buildMatchGraph;
- var matchAsTree = __webpack_require__(105).matchAsTree;
- var trace = __webpack_require__(106);
- var search = __webpack_require__(107);
- var getStructureFromConfig = __webpack_require__(108).getStructureFromConfig;
- var cssWideKeywords = buildMatchGraph(parse('inherit | initial | unset'));
- var cssWideKeywordsWithExpression = buildMatchGraph(parse('inherit | initial | unset | <expression>'));
- function dumpMapSyntax(map, syntaxAsAst) {
- var result = {};
- for (var name in map) {
- if (map[name].syntax) {
- result[name] = syntaxAsAst ? map[name].syntax : generate(map[name].syntax);
- }
- }
- return result;
- }
- function valueHasVar(value) {
- var hasVar = false;
- this.syntax.walk(value, function(node) {
- if (node.type === 'Function' && node.name.toLowerCase() === 'var') {
- hasVar = true;
- }
- });
- return hasVar;
- }
- function buildMatchResult(match, error, iterations) {
- return {
- matched: match,
- iterations: iterations,
- error: error,
- getTrace: trace.getTrace,
- isType: trace.isType,
- isProperty: trace.isProperty,
- isKeyword: trace.isKeyword
- };
- }
- function matchSyntax(lexer, syntax, node, useCommon) {
- if (!node) {
- return buildMatchResult(null, new Error('Node is undefined'));
- }
- if (valueHasVar.call(lexer, node)) {
- return buildMatchResult(null, new Error('Matching for a tree with var() is not supported'));
- }
- var tokens = lexer.syntax.generate(node, astToTokens);
- var result;
- if (useCommon) {
- result = matchAsTree(tokens, lexer.valueCommonSyntax, lexer);
- }
- if (!useCommon || !result.match) {
- result = matchAsTree(tokens, syntax.match, lexer);
- if (!result.match) {
- return buildMatchResult(
- null,
- new MatchError(result.reason, lexer, syntax.syntax, node, result),
- result.iterations
- );
- }
- }
- return buildMatchResult(result.match, null, result.iterations);
- }
- var Lexer = function(config, syntax, structure) {
- this.valueCommonSyntax = cssWideKeywords;
- this.syntax = syntax;
- this.generic = false;
- this.properties = {};
- this.types = {};
- this.structure = structure || getStructureFromConfig(config);
- if (config) {
- if (config.generic) {
- this.generic = true;
- for (var name in generic) {
- this.addType_(name, generic[name]);
- }
- }
- if (config.types) {
- for (var name in config.types) {
- this.addType_(name, config.types[name]);
- }
- }
- if (config.properties) {
- for (var name in config.properties) {
- this.addProperty_(name, config.properties[name]);
- }
- }
- }
- };
- Lexer.prototype = {
- structure: {},
- checkStructure: function(ast) {
- function collectWarning(node, message) {
- warns.push({
- node: node,
- message: message
- });
- }
- var structure = this.structure;
- var warns = [];
- this.syntax.walk(ast, function(node) {
- if (structure.hasOwnProperty(node.type)) {
- structure[node.type].check(node, collectWarning);
- } else {
- collectWarning(node, 'Unknown node type `' + node.type + '`');
- }
- });
- return warns.length ? warns : false;
- },
- createDescriptor: function(syntax, type, name) {
- var ref = {
- type: type,
- name: name
- };
- var descriptor = {
- type: type,
- name: name,
- syntax: null,
- match: null
- };
- if (typeof syntax === 'function') {
- descriptor.match = buildMatchGraph(syntax, ref);
- } else {
- if (typeof syntax === 'string') {
-
- Object.defineProperty(descriptor, 'syntax', {
- get: function() {
- Object.defineProperty(descriptor, 'syntax', {
- value: parse(syntax)
- });
- return descriptor.syntax;
- }
- });
- } else {
- descriptor.syntax = syntax;
- }
- Object.defineProperty(descriptor, 'match', {
- get: function() {
- Object.defineProperty(descriptor, 'match', {
- value: buildMatchGraph(descriptor.syntax, ref)
- });
- return descriptor.match;
- }
- });
- }
- return descriptor;
- },
- addProperty_: function(name, syntax) {
- this.properties[name] = this.createDescriptor(syntax, 'Property', name);
- },
- addType_: function(name, syntax) {
- this.types[name] = this.createDescriptor(syntax, 'Type', name);
- if (syntax === generic.expression) {
- this.valueCommonSyntax = cssWideKeywordsWithExpression;
- }
- },
- matchDeclaration: function(node) {
- if (node.type !== 'Declaration') {
- return buildMatchResult(null, new Error('Not a Declaration node'));
- }
- return this.matchProperty(node.property, node.value);
- },
- matchProperty: function(propertyName, value) {
- var property = names.property(propertyName);
-
- if (property.custom) {
- return buildMatchResult(null, new Error('Lexer matching doesn\'t applicable for custom properties'));
- }
- var propertySyntax = property.vendor
- ? this.getProperty(property.name) || this.getProperty(property.basename)
- : this.getProperty(property.name);
- if (!propertySyntax) {
- return buildMatchResult(null, new SyntaxReferenceError('Unknown property', propertyName));
- }
- return matchSyntax(this, propertySyntax, value, true);
- },
- matchType: function(typeName, value) {
- var typeSyntax = this.getType(typeName);
- if (!typeSyntax) {
- return buildMatchResult(null, new SyntaxReferenceError('Unknown type', typeName));
- }
- return matchSyntax(this, typeSyntax, value, false);
- },
- match: function(syntax, value) {
- if (!syntax || !syntax.type) {
- return buildMatchResult(null, new SyntaxReferenceError('Bad syntax'));
- }
- if (!syntax.match) {
- syntax = this.createDescriptor(syntax);
- }
- return matchSyntax(this, syntax, value, false);
- },
- findValueFragments: function(propertyName, value, type, name) {
- return search.matchFragments(this, value, this.matchProperty(propertyName, value), type, name);
- },
- findDeclarationValueFragments: function(declaration, type, name) {
- return search.matchFragments(this, declaration.value, this.matchDeclaration(declaration), type, name);
- },
- findAllFragments: function(ast, type, name) {
- var result = [];
- this.syntax.walk(ast, {
- visit: 'Declaration',
- enter: function(declaration) {
- result.push.apply(result, this.findDeclarationValueFragments(declaration, type, name));
- }.bind(this)
- });
- return result;
- },
- getProperty: function(name) {
- return this.properties.hasOwnProperty(name) ? this.properties[name] : null;
- },
- getType: function(name) {
- return this.types.hasOwnProperty(name) ? this.types[name] : null;
- },
- validate: function() {
- function validate(syntax, name, broken, descriptor) {
- if (broken.hasOwnProperty(name)) {
- return broken[name];
- }
- broken[name] = false;
- if (descriptor.syntax !== null) {
- walk(descriptor.syntax, function(node) {
- if (node.type !== 'Type' && node.type !== 'Property') {
- return;
- }
- var map = node.type === 'Type' ? syntax.types : syntax.properties;
- var brokenMap = node.type === 'Type' ? brokenTypes : brokenProperties;
- if (!map.hasOwnProperty(node.name) || validate(syntax, node.name, brokenMap, map[node.name])) {
- broken[name] = true;
- }
- }, this);
- }
- }
- var brokenTypes = {};
- var brokenProperties = {};
- for (var key in this.types) {
- validate(this, key, brokenTypes, this.types[key]);
- }
- for (var key in this.properties) {
- validate(this, key, brokenProperties, this.properties[key]);
- }
- brokenTypes = Object.keys(brokenTypes).filter(function(name) {
- return brokenTypes[name];
- });
- brokenProperties = Object.keys(brokenProperties).filter(function(name) {
- return brokenProperties[name];
- });
- if (brokenTypes.length || brokenProperties.length) {
- return {
- types: brokenTypes,
- properties: brokenProperties
- };
- }
- return null;
- },
- dump: function(syntaxAsAst) {
- return {
- generic: this.generic,
- types: dumpMapSyntax(this.types, syntaxAsAst),
- properties: dumpMapSyntax(this.properties, syntaxAsAst)
- };
- },
- toString: function() {
- return JSON.stringify(this.dump());
- }
- };
- module.exports = Lexer;
- }),
- (function(module, exports, __webpack_require__) {
- var tokenizerUtils = __webpack_require__(45);
- var findIdentifierEnd = tokenizerUtils.findIdentifierEnd;
- var findNumberEnd = tokenizerUtils.findNumberEnd;
- var findDecimalNumberEnd = tokenizerUtils.findDecimalNumberEnd;
- var isHex = tokenizerUtils.isHex;
- var tokenizerConst = __webpack_require__(24);
- var SYMBOL_TYPE = tokenizerConst.SYMBOL_TYPE;
- var IDENTIFIER = tokenizerConst.TYPE.Identifier;
- var PLUSSIGN = tokenizerConst.TYPE.PlusSign;
- var HYPHENMINUS = tokenizerConst.TYPE.HyphenMinus;
- var NUMBERSIGN = tokenizerConst.TYPE.NumberSign;
- var PERCENTAGE = {
- '%': true
- };
- var LENGTH = {
-
- 'px': true,
- 'mm': true,
- 'cm': true,
- 'in': true,
- 'pt': true,
- 'pc': true,
- 'q': true,
-
- 'em': true,
- 'ex': true,
- 'ch': true,
- 'rem': true,
-
- 'vh': true,
- 'vw': true,
- 'vmin': true,
- 'vmax': true,
- 'vm': true
- };
- var ANGLE = {
- 'deg': true,
- 'grad': true,
- 'rad': true,
- 'turn': true
- };
- var TIME = {
- 's': true,
- 'ms': true
- };
- var FREQUENCY = {
- 'hz': true,
- 'khz': true
- };
- var RESOLUTION = {
- 'dpi': true,
- 'dpcm': true,
- 'dppx': true,
- 'x': true
- };
- var FLEX = {
- 'fr': true
- };
- var DECIBEL = {
- 'db': true
- };
- var SEMITONES = {
- 'st': true
- };
- function consumeFunction(token, addTokenToMatch, getNextToken) {
- var length = 1;
- var cursor;
- do {
- cursor = getNextToken(length++);
- } while (cursor !== null && cursor.node !== token.node);
- if (cursor === null) {
- return false;
- }
- while (true) {
-
- if (addTokenToMatch() === cursor) {
- break;
- }
- }
- return true;
- }
- function calc(token, addTokenToMatch, getNextToken) {
- if (token === null) {
- return false;
- }
- var name = token.value.toLowerCase();
- if (name !== 'calc(' &&
- name !== '-moz-calc(' &&
- name !== '-webkit-calc(') {
- return false;
- }
- return consumeFunction(token, addTokenToMatch, getNextToken);
- }
- function attr(token, addTokenToMatch, getNextToken) {
- if (token === null || token.value.toLowerCase() !== 'attr(') {
- return false;
- }
- return consumeFunction(token, addTokenToMatch, getNextToken);
- }
- function expression(token, addTokenToMatch, getNextToken) {
- if (token === null || token.value.toLowerCase() !== 'expression(') {
- return false;
- }
- return consumeFunction(token, addTokenToMatch, getNextToken);
- }
- function url(token, addTokenToMatch, getNextToken) {
- if (token === null || token.value.toLowerCase() !== 'url(') {
- return false;
- }
- return consumeFunction(token, addTokenToMatch, getNextToken);
- }
- function idSelector(token, addTokenToMatch) {
- if (token === null) {
- return false;
- }
- if (token.value.charCodeAt(0) !== NUMBERSIGN) {
- return false;
- }
- if (consumeIdentifier(token.value, 1) !== token.value.length) {
- return false;
- }
- addTokenToMatch();
- return true;
- }
- function isNumber(str) {
- return /^[-+]?(\d+|\d*\.\d+)([eE][-+]?\d+)?$/.test(str);
- }
- function consumeNumber(str, allowFraction) {
- var code = str.charCodeAt(0);
- return findNumberEnd(str, code === PLUSSIGN || code === HYPHENMINUS ? 1 : 0, allowFraction);
- }
- function consumeIdentifier(str, offset) {
- var code = str.charCodeAt(offset);
- if (code < 0x80 && SYMBOL_TYPE[code] !== IDENTIFIER && code !== HYPHENMINUS) {
- return offset;
- }
- return findIdentifierEnd(str, offset + 1);
- }
- function astNode(type) {
- return function(token, addTokenToMatch) {
- if (token === null || token.node.type !== type) {
- return false;
- }
- addTokenToMatch();
- return true;
- };
- }
- function dimension(type) {
- return function(token, addTokenToMatch, getNextToken) {
- if (calc(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null) {
- return false;
- }
- var numberEnd = consumeNumber(token.value, true);
- if (numberEnd === 0) {
- return false;
- }
- if (type) {
- if (!type.hasOwnProperty(token.value.substr(numberEnd).toLowerCase())) {
- return false;
- }
- } else {
- var unitEnd = consumeIdentifier(token.value, numberEnd);
- if (unitEnd === numberEnd || unitEnd !== token.value.length) {
- return false;
- }
- }
- addTokenToMatch();
- return true;
- };
- }
- function zeroUnitlessDimension(type) {
- var isDimension = dimension(type);
- return function(token, addTokenToMatch, getNextToken) {
- if (isDimension(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null || Number(token.value) !== 0) {
- return false;
- }
- addTokenToMatch();
- return true;
- };
- }
- function number(token, addTokenToMatch, getNextToken) {
- if (calc(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null) {
- return false;
- }
- var numberEnd = consumeNumber(token.value, true);
- if (numberEnd !== token.value.length) {
- return false;
- }
- addTokenToMatch();
- return true;
- }
- function numberZeroOne(token, addTokenToMatch, getNextToken) {
- if (calc(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null || !isNumber(token.value)) {
- return false;
- }
- var value = Number(token.value);
- if (value < 0 || value > 1) {
- return false;
- }
- addTokenToMatch();
- return true;
- }
- function numberOneOrGreater(token, addTokenToMatch, getNextToken) {
- if (calc(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null || !isNumber(token.value)) {
- return false;
- }
- var value = Number(token.value);
- if (value < 1) {
- return false;
- }
- addTokenToMatch();
- return true;
- }
- function integer(token, addTokenToMatch, getNextToken) {
- if (calc(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null) {
- return false;
- }
- var numberEnd = consumeNumber(token.value, false);
- if (numberEnd !== token.value.length) {
- return false;
- }
- addTokenToMatch();
- return true;
- }
- function positiveInteger(token, addTokenToMatch, getNextToken) {
- if (calc(token, addTokenToMatch, getNextToken)) {
- return true;
- }
- if (token === null) {
- return false;
- }
- var numberEnd = findDecimalNumberEnd(token.value, 0);
- if (numberEnd !== token.value.length || token.value.charCodeAt(0) === HYPHENMINUS) {
- return false;
- }
- addTokenToMatch();
- return true;
- }
- function hexColor(token, addTokenToMatch) {
- if (token === null || token.value.charCodeAt(0) !== NUMBERSIGN) {
- return false;
- }
- var length = token.value.length - 1;
-
- if (length !== 3 && length !== 4 && length !== 6 && length !== 8) {
- return false;
- }
- for (var i = 1; i < length; i++) {
- if (!isHex(token.value.charCodeAt(i))) {
- return false;
- }
- }
- addTokenToMatch();
- return true;
- }
- function customIdent(token, addTokenToMatch) {
- if (token === null) {
- return false;
- }
- var identEnd = consumeIdentifier(token.value, 0);
- if (identEnd !== token.value.length) {
- return false;
- }
- var name = token.value.toLowerCase();
-
-
- if (name === 'unset' || name === 'initial' || name === 'inherit') {
- return false;
- }
-
- if (name === 'default') {
- return false;
- }
-
- addTokenToMatch();
- return true;
- }
- module.exports = {
- 'angle': zeroUnitlessDimension(ANGLE),
- 'attr()': attr,
- 'custom-ident': customIdent,
- 'decibel': dimension(DECIBEL),
- 'dimension': dimension(),
- 'frequency': dimension(FREQUENCY),
- 'flex': dimension(FLEX),
- 'hex-color': hexColor,
- 'id-selector': idSelector,
- 'ident': astNode('Identifier'),
- 'integer': integer,
- 'length': zeroUnitlessDimension(LENGTH),
- 'number': number,
- 'number-zero-one': numberZeroOne,
- 'number-one-or-greater': numberOneOrGreater,
- 'percentage': dimension(PERCENTAGE),
- 'positive-integer': positiveInteger,
- 'resolution': dimension(RESOLUTION),
- 'semitones': dimension(SEMITONES),
- 'string': astNode('String'),
- 'time': dimension(TIME),
- 'unicode-range': astNode('UnicodeRange'),
- 'url': url,
-
- 'progid': astNode('Raw'),
- 'expression': expression
- };
- }),
- (function(module, exports, __webpack_require__) {
- var SyntaxParseError = __webpack_require__(47).SyntaxParseError;
- var TAB = 9;
- var N = 10;
- var F = 12;
- var R = 13;
- var SPACE = 32;
- var Tokenizer = function(str) {
- this.str = str;
- this.pos = 0;
- };
- Tokenizer.prototype = {
- charCodeAt: function(pos) {
- return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
- },
- charCode: function() {
- return this.charCodeAt(this.pos);
- },
- nextCharCode: function() {
- return this.charCodeAt(this.pos + 1);
- },
- nextNonWsCode: function(pos) {
- return this.charCodeAt(this.findWsEnd(pos));
- },
- findWsEnd: function(pos) {
- for (; pos < this.str.length; pos++) {
- var code = this.str.charCodeAt(pos);
- if (code !== R && code !== N && code !== F && code !== SPACE && code !== TAB) {
- break;
- }
- }
- return pos;
- },
- substringToPos: function(end) {
- return this.str.substring(this.pos, this.pos = end);
- },
- eat: function(code) {
- if (this.charCode() !== code) {
- this.error('Expect `' + String.fromCharCode(code) + '`');
- }
- this.pos++;
- },
- peek: function() {
- return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
- },
- error: function(message) {
- throw new SyntaxParseError(message, this.str, this.pos);
- }
- };
- module.exports = Tokenizer;
- }),
- (function(module, exports) {
- module.exports = {
- decorator: function(handlers) {
- var curNode = null;
- var prev = null;
- var tokens = [];
- return {
- children: handlers.children,
- node: function(node) {
- var tmp = curNode;
- curNode = node;
- handlers.node.call(this, node);
- curNode = tmp;
- },
- chunk: function(chunk) {
- if (tokens.length > 0) {
- switch (curNode.type) {
- case 'Dimension':
- case 'HexColor':
- case 'IdSelector':
- case 'Percentage':
- if (prev.node === curNode) {
- prev.value += chunk;
- return;
- }
- break;
- case 'Function':
- case 'PseudoClassSelector':
- case 'PseudoElementSelector':
- case 'Url':
- if (chunk === '(') {
- prev.value += chunk;
- return;
- }
- break;
- case 'Atrule':
- if (prev.node === curNode && prev.value === '@') {
- prev.value += chunk;
- return;
- }
- break;
- }
- }
- tokens.push(prev = {
- value: chunk,
- node: curNode
- });
- },
- result: function() {
- return tokens;
- }
- };
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var matchGraph = __webpack_require__(49);
- var MATCH = matchGraph.MATCH;
- var MISMATCH = matchGraph.MISMATCH;
- var DISALLOW_EMPTY = matchGraph.DISALLOW_EMPTY;
- var TOKEN = 1;
- var OPEN_SYNTAX = 2;
- var CLOSE_SYNTAX = 3;
- var EXIT_REASON_MATCH = 'Match';
- var EXIT_REASON_MISMATCH = 'Mismatch';
- var EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';
- var ITERATION_LIMIT = 10000;
- var totalIterationCount = 0;
- function mapList(list, fn) {
- var result = [];
- while (list) {
- result.unshift(fn(list));
- list = list.prev;
- }
- return result;
- }
- function isCommaContextStart(token) {
- if (token === null) {
- return true;
- }
- token = token.value.charAt(token.value.length - 1);
- return (
- token === ',' ||
- token === '(' ||
- token === '[' ||
- token === '/'
- );
- }
- function isCommaContextEnd(token) {
- if (token === null) {
- return true;
- }
- token = token.value.charAt(0);
- return (
- token === ')' ||
- token === ']' ||
- token === '/'
- );
- }
- function internalMatch(tokens, syntax, syntaxes) {
- function moveToNextToken() {
- do {
- tokenCursor++;
- token = tokenCursor < tokens.length ? tokens[tokenCursor] : null;
- } while (token !== null && !/\S/.test(token.value));
- }
- function getNextToken(offset) {
- var nextIndex = tokenCursor + offset;
- return nextIndex < tokens.length ? tokens[nextIndex] : null;
- }
- function pushThenStack(nextSyntax) {
- thenStack = {
- nextSyntax: nextSyntax,
- matchStack: matchStack,
- syntaxStack: syntaxStack,
- prev: thenStack
- };
- }
- function pushElseStack(nextSyntax) {
- elseStack = {
- nextSyntax: nextSyntax,
- matchStack: matchStack,
- syntaxStack: syntaxStack,
- thenStack: thenStack,
- tokenCursor: tokenCursor,
- token: token,
- prev: elseStack
- };
- }
- function addTokenToMatch() {
- matchStack = {
- type: TOKEN,
- syntax: syntax.syntax,
- token: token,
- prev: matchStack
- };
- moveToNextToken();
- if (tokenCursor > longestMatch) {
- longestMatch = tokenCursor;
- }
- return matchStack.token;
- }
- function openSyntax() {
- syntaxStack = {
- syntax: syntax,
- prev: syntaxStack
- };
- matchStack = {
- type: OPEN_SYNTAX,
- syntax: syntax.syntax,
- token: matchStack.token,
- prev: matchStack
- };
- }
- function closeSyntax() {
- if (matchStack.type === OPEN_SYNTAX) {
- matchStack = matchStack.prev;
- } else {
- matchStack = {
- type: CLOSE_SYNTAX,
- syntax: syntaxStack.syntax,
- token: matchStack.token,
- prev: matchStack
- };
- }
- syntaxStack = syntaxStack.prev;
- }
- var syntaxStack = null;
- var thenStack = null;
- var elseStack = null;
- var iterationCount = 0;
- var exitReason = EXIT_REASON_MATCH;
- var matchStack = { type: 'Stub', syntax: null, token: null, tokenCursor: -1, prev: null };
- var longestMatch = 0;
- var tokenCursor = -1;
- var token = null;
- moveToNextToken();
- while (true) {
-
-
-
-
-
-
-
-
-
-
-
-
- if (++iterationCount === ITERATION_LIMIT) {
- console.warn('[csstree-match] BREAK after ' + ITERATION_LIMIT + ' iterations');
- exitReason = EXIT_REASON_ITERATION_LIMIT;
- break;
- }
- if (syntax === MATCH) {
- if (thenStack === null) {
-
- if (token !== null) {
-
- if (tokenCursor !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
- syntax = MISMATCH;
- continue;
- }
- }
-
- exitReason = EXIT_REASON_MATCH;
- break;
- }
-
- syntax = thenStack.nextSyntax;
-
- if (syntax === DISALLOW_EMPTY) {
- if (thenStack.matchStack.token === matchStack.token) {
- syntax = MISMATCH;
- continue;
- } else {
- syntax = MATCH;
- }
- }
-
- while (syntaxStack !== null && thenStack.syntaxStack !== syntaxStack) {
- closeSyntax();
- }
-
- thenStack = thenStack.prev;
- continue;
- }
- if (syntax === MISMATCH) {
- if (elseStack === null) {
-
- exitReason = EXIT_REASON_MISMATCH;
- break;
- }
-
- syntax = elseStack.nextSyntax;
-
- thenStack = elseStack.thenStack;
- syntaxStack = elseStack.syntaxStack;
- matchStack = elseStack.matchStack;
- tokenCursor = elseStack.tokenCursor;
- token = elseStack.token;
-
- elseStack = elseStack.prev;
- continue;
- }
- switch (syntax.type) {
- case 'MatchGraph':
- syntax = syntax.match;
- break;
- case 'If':
-
-
- if (syntax.else !== MISMATCH) {
- pushElseStack(syntax.else);
- }
- if (syntax.then !== MATCH) {
- pushThenStack(syntax.then);
- }
- syntax = syntax.match;
- break;
- case 'MatchOnce':
- syntax = {
- type: 'MatchOnceBuffer',
- terms: syntax.terms,
- all: syntax.all,
- matchStack: matchStack,
- index: 0,
- mask: 0
- };
- break;
- case 'MatchOnceBuffer':
- if (syntax.index === syntax.terms.length) {
-
- if (syntax.matchStack === matchStack) {
-
- if (syntax.mask === 0 || syntax.all) {
- syntax = MISMATCH;
- break;
- }
-
- syntax = MATCH;
- break;
- } else {
-
- syntax.index = 0;
- syntax.matchStack = matchStack;
- }
- }
- for (; syntax.index < syntax.terms.length; syntax.index++) {
- if ((syntax.mask & (1 << syntax.index)) === 0) {
-
-
- pushElseStack(syntax);
- pushThenStack({
- type: 'AddMatchOnce',
- buffer: syntax
- });
-
- syntax = syntax.terms[syntax.index++];
- break;
- }
- }
- break;
- case 'AddMatchOnce':
- syntax = syntax.buffer;
- var newMask = syntax.mask | (1 << (syntax.index - 1));
-
- if (newMask === (1 << syntax.terms.length) - 1) {
- syntax = MATCH;
- continue;
- }
- syntax = {
- type: 'MatchOnceBuffer',
- terms: syntax.terms,
- all: syntax.all,
- matchStack: syntax.matchStack,
- index: syntax.index,
- mask: newMask
- };
- break;
- case 'Enum':
- var name = token !== null ? token.value.toLowerCase() : '';
-
- if (name.indexOf('\\') !== -1) {
- name = name.replace(/\\[09].*$/, '');
- }
- if (hasOwnProperty.call(syntax.map, name)) {
- syntax = syntax.map[name];
- } else {
- syntax = MISMATCH;
- }
- break;
- case 'Generic':
- syntax = syntax.fn(token, addTokenToMatch, getNextToken) ? MATCH : MISMATCH;
- break;
- case 'Type':
- case 'Property':
- openSyntax();
- var syntaxDict = syntax.type === 'Type' ? 'types' : 'properties';
- if (hasOwnProperty.call(syntaxes, syntaxDict) && syntaxes[syntaxDict][syntax.name]) {
- syntax = syntaxes[syntaxDict][syntax.name].match;
- } else {
- syntax = undefined;
- }
- if (!syntax) {
- throw new Error(
- 'Bad syntax reference: ' +
- (syntaxStack.syntax.type === 'Type'
- ? '<' + syntaxStack.syntax.name + '>'
- : '<\'' + syntaxStack.syntax.name + '\'>')
- );
- }
- break;
- case 'Keyword':
- var name = syntax.name;
- if (token !== null) {
- var keywordName = token.value;
-
- if (keywordName.indexOf('\\') !== -1) {
- keywordName = keywordName.replace(/\\[09].*$/, '');
- }
- if (keywordName.toLowerCase() === name) {
- addTokenToMatch();
- syntax = MATCH;
- break;
- }
- }
- syntax = MISMATCH;
- break;
- case 'AtKeyword':
- case 'Function':
- if (token !== null && token.value.toLowerCase() === syntax.name) {
- addTokenToMatch();
- syntax = MATCH;
- break;
- }
- syntax = MISMATCH;
- break;
- case 'Token':
- if (token !== null && token.value === syntax.value) {
- addTokenToMatch();
- syntax = MATCH;
- break;
- }
- syntax = MISMATCH;
- break;
- case 'Comma':
- if (token !== null && token.value === ',') {
- if (isCommaContextStart(matchStack.token)) {
- syntax = MISMATCH;
- } else {
- addTokenToMatch();
- syntax = isCommaContextEnd(token) ? MISMATCH : MATCH;
- }
- } else {
- syntax = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH : MISMATCH;
- }
- break;
-
-
- default:
- throw new Error('Unknown node type: ' + syntax.type);
- }
- }
- totalIterationCount += iterationCount;
- if (exitReason === EXIT_REASON_MATCH) {
- while (syntaxStack !== null) {
- closeSyntax();
- }
- } else {
- matchStack = null;
- }
- return {
- tokens: tokens,
- reason: exitReason,
- iterations: iterationCount,
- match: matchStack,
- longestMatch: longestMatch
- };
- }
- function matchAsList(tokens, matchGraph, syntaxes) {
- var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
- if (matchResult.match !== null) {
- matchResult.match = mapList(matchResult.match, function(item) {
- if (item.type === OPEN_SYNTAX || item.type === CLOSE_SYNTAX) {
- return { type: item.type, syntax: item.syntax };
- }
- return {
- syntax: item.syntax,
- token: item.token && item.token.value,
- node: item.token && item.token.node
- };
- }).slice(1);
- }
- return matchResult;
- }
- function matchAsTree(tokens, matchGraph, syntaxes) {
- var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
- if (matchResult.match === null) {
- return matchResult;
- }
- var cursor = matchResult.match;
- var host = matchResult.match = {
- syntax: matchGraph.syntax || null,
- match: []
- };
- var stack = [host];
-
- var prev = null;
- var next = null;
- while (cursor !== null) {
- next = cursor.prev;
- cursor.prev = prev;
- prev = cursor;
- cursor = next;
- }
-
- cursor = prev.prev;
-
- while (cursor !== null && cursor.syntax !== null) {
- var entry = cursor;
- switch (entry.type) {
- case OPEN_SYNTAX:
- host.match.push(host = {
- syntax: entry.syntax,
- match: []
- });
- stack.push(host);
- break;
- case CLOSE_SYNTAX:
- stack.pop();
- host = stack[stack.length - 1];
- break;
- default:
- host.match.push({
- syntax: entry.syntax || null,
- token: entry.token.value,
- node: entry.token.node
- });
- }
- cursor = cursor.prev;
- }
- return matchResult;
- }
- module.exports = {
- matchAsList: matchAsList,
- matchAsTree: matchAsTree,
- getTotalIterationCount: function() {
- return totalIterationCount;
- }
- };
- }),
- (function(module, exports) {
- function getTrace(node) {
- function shouldPutToTrace(syntax) {
- if (syntax === null) {
- return false;
- }
- return (
- syntax.type === 'Type' ||
- syntax.type === 'Property' ||
- syntax.type === 'Keyword'
- );
- }
- function hasMatch(matchNode) {
- if (Array.isArray(matchNode.match)) {
-
- for (var i = 0; i < matchNode.match.length; i++) {
- if (hasMatch(matchNode.match[i])) {
- if (shouldPutToTrace(matchNode.syntax)) {
- result.unshift(matchNode.syntax);
- }
- return true;
- }
- }
- } else if (matchNode.node === node) {
- result = shouldPutToTrace(matchNode.syntax)
- ? [matchNode.syntax]
- : [];
- return true;
- }
- return false;
- }
- var result = null;
- if (this.matched !== null) {
- hasMatch(this.matched);
- }
- return result;
- }
- function testNode(match, node, fn) {
- var trace = getTrace.call(match, node);
- if (trace === null) {
- return false;
- }
- return trace.some(fn);
- }
- function isType(node, type) {
- return testNode(this, node, function(matchNode) {
- return matchNode.type === 'Type' && matchNode.name === type;
- });
- }
- function isProperty(node, property) {
- return testNode(this, node, function(matchNode) {
- return matchNode.type === 'Property' && matchNode.name === property;
- });
- }
- function isKeyword(node) {
- return testNode(this, node, function(matchNode) {
- return matchNode.type === 'Keyword';
- });
- }
- module.exports = {
- getTrace: getTrace,
- isType: isType,
- isProperty: isProperty,
- isKeyword: isKeyword
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(7);
- function getFirstMatchNode(matchNode) {
- if ('node' in matchNode) {
- return matchNode.node;
- }
- return getFirstMatchNode(matchNode.match[0]);
- }
- function getLastMatchNode(matchNode) {
- if ('node' in matchNode) {
- return matchNode.node;
- }
- return getLastMatchNode(matchNode.match[matchNode.match.length - 1]);
- }
- function matchFragments(lexer, ast, match, type, name) {
- function findFragments(matchNode) {
- if (matchNode.syntax !== null &&
- matchNode.syntax.type === type &&
- matchNode.syntax.name === name) {
- var start = getFirstMatchNode(matchNode);
- var end = getLastMatchNode(matchNode);
- lexer.syntax.walk(ast, function(node, item, list) {
- if (node === start) {
- var nodes = new List();
- do {
- nodes.appendData(item.data);
- if (item.data === end) {
- break;
- }
- item = item.next;
- } while (item !== null);
- fragments.push({
- parent: list,
- nodes: nodes
- });
- }
- });
- }
- if (Array.isArray(matchNode.match)) {
- matchNode.match.forEach(findFragments);
- }
- }
- var fragments = [];
- if (match.matched !== null) {
- findFragments(match.matched);
- }
- return fragments;
- }
- module.exports = {
- matchFragments: matchFragments
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(7);
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function isValidNumber(value) {
-
- return (
- typeof value === 'number' &&
- isFinite(value) &&
- Math.floor(value) === value &&
- value >= 0
- );
- }
- function isValidLocation(loc) {
- return (
- Boolean(loc) &&
- isValidNumber(loc.offset) &&
- isValidNumber(loc.line) &&
- isValidNumber(loc.column)
- );
- }
- function createNodeStructureChecker(type, fields) {
- return function checkNode(node, warn) {
- if (!node || node.constructor !== Object) {
- return warn(node, 'Type of node should be an Object');
- }
- for (var key in node) {
- var valid = true;
- if (hasOwnProperty.call(node, key) === false) {
- continue;
- }
- if (key === 'type') {
- if (node.type !== type) {
- warn(node, 'Wrong node type `' + node.type + '`, expected `' + type + '`');
- }
- } else if (key === 'loc') {
- if (node.loc === null) {
- continue;
- } else if (node.loc && node.loc.constructor === Object) {
- if (typeof node.loc.source !== 'string') {
- key += '.source';
- } else if (!isValidLocation(node.loc.start)) {
- key += '.start';
- } else if (!isValidLocation(node.loc.end)) {
- key += '.end';
- } else {
- continue;
- }
- }
- valid = false;
- } else if (fields.hasOwnProperty(key)) {
- for (var i = 0, valid = false; !valid && i < fields[key].length; i++) {
- var fieldType = fields[key][i];
- switch (fieldType) {
- case String:
- valid = typeof node[key] === 'string';
- break;
- case Boolean:
- valid = typeof node[key] === 'boolean';
- break;
- case null:
- valid = node[key] === null;
- break;
- default:
- if (typeof fieldType === 'string') {
- valid = node[key] && node[key].type === fieldType;
- } else if (Array.isArray(fieldType)) {
- valid = node[key] instanceof List;
- }
- }
- }
- } else {
- warn(node, 'Unknown field `' + key + '` for ' + type + ' node type');
- }
- if (!valid) {
- warn(node, 'Bad value for `' + type + '.' + key + '`');
- }
- }
- for (var key in fields) {
- if (hasOwnProperty.call(fields, key) &&
- hasOwnProperty.call(node, key) === false) {
- warn(node, 'Field `' + type + '.' + key + '` is missed');
- }
- }
- };
- }
- function processStructure(name, nodeType) {
- var structure = nodeType.structure;
- var fields = {
- type: String,
- loc: true
- };
- var docs = {
- type: '"' + name + '"'
- };
- for (var key in structure) {
- if (hasOwnProperty.call(structure, key) === false) {
- continue;
- }
- var docsTypes = [];
- var fieldTypes = fields[key] = Array.isArray(structure[key])
- ? structure[key].slice()
- : [structure[key]];
- for (var i = 0; i < fieldTypes.length; i++) {
- var fieldType = fieldTypes[i];
- if (fieldType === String || fieldType === Boolean) {
- docsTypes.push(fieldType.name);
- } else if (fieldType === null) {
- docsTypes.push('null');
- } else if (typeof fieldType === 'string') {
- docsTypes.push('<' + fieldType + '>');
- } else if (Array.isArray(fieldType)) {
- docsTypes.push('List');
- } else {
- throw new Error('Wrong value `' + fieldType + '` in `' + name + '.' + key + '` structure definition');
- }
- }
- docs[key] = docsTypes.join(' | ');
- }
- return {
- docs: docs,
- check: createNodeStructureChecker(name, fields)
- };
- }
- module.exports = {
- getStructureFromConfig: function(config) {
- var structure = {};
- if (config.node) {
- for (var name in config.node) {
- if (hasOwnProperty.call(config.node, name)) {
- var nodeType = config.node[name];
- if (nodeType.structure) {
- structure[name] = processStructure(name, nodeType);
- } else {
- throw new Error('Missed `structure` field in `' + name + '` node type definition');
- }
- }
- }
- }
- return structure;
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- SyntaxParseError: __webpack_require__(47).SyntaxParseError,
- parse: __webpack_require__(27),
- generate: __webpack_require__(25),
- walk: __webpack_require__(48)
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var Tokenizer = __webpack_require__(0);
- var List = __webpack_require__(7);
- var sequence = __webpack_require__(111);
- var noop = function() {};
- function createParseContext(name) {
- return function() {
- return this[name]();
- };
- }
- function processConfig(config) {
- var parserConfig = {
- context: {},
- scope: {},
- atrule: {},
- pseudo: {}
- };
- if (config.parseContext) {
- for (var name in config.parseContext) {
- switch (typeof config.parseContext[name]) {
- case 'function':
- parserConfig.context[name] = config.parseContext[name];
- break;
- case 'string':
- parserConfig.context[name] = createParseContext(config.parseContext[name]);
- break;
- }
- }
- }
- if (config.scope) {
- for (var name in config.scope) {
- parserConfig.scope[name] = config.scope[name];
- }
- }
- if (config.atrule) {
- for (var name in config.atrule) {
- var atrule = config.atrule[name];
- if (atrule.parse) {
- parserConfig.atrule[name] = atrule.parse;
- }
- }
- }
- if (config.pseudo) {
- for (var name in config.pseudo) {
- var pseudo = config.pseudo[name];
- if (pseudo.parse) {
- parserConfig.pseudo[name] = pseudo.parse;
- }
- }
- }
- if (config.node) {
- for (var name in config.node) {
- parserConfig[name] = config.node[name].parse;
- }
- }
- return parserConfig;
- }
- module.exports = function createParser(config) {
- var parser = {
- scanner: new Tokenizer(),
- filename: '<unknown>',
- needPositions: false,
- onParseError: noop,
- onParseErrorThrow: false,
- parseAtrulePrelude: true,
- parseRulePrelude: true,
- parseValue: true,
- parseCustomProperty: false,
- readSequence: sequence,
- createList: function() {
- return new List();
- },
- createSingleNodeList: function(node) {
- return new List().appendData(node);
- },
- getFirstListNode: function(list) {
- return list && list.first();
- },
- getLastListNode: function(list) {
- return list.last();
- },
- parseWithFallback: function(consumer, fallback) {
- var startToken = this.scanner.currentToken;
- try {
- return consumer.call(this);
- } catch (e) {
- if (this.onParseErrorThrow) {
- throw e;
- }
- var fallbackNode = fallback.call(this, startToken);
- this.onParseErrorThrow = true;
- this.onParseError(e, fallbackNode);
- this.onParseErrorThrow = false;
- return fallbackNode;
- }
- },
- getLocation: function(start, end) {
- if (this.needPositions) {
- return this.scanner.getLocationRange(
- start,
- end,
- this.filename
- );
- }
- return null;
- },
- getLocationFromList: function(list) {
- if (this.needPositions) {
- var head = this.getFirstListNode(list);
- var tail = this.getLastListNode(list);
- return this.scanner.getLocationRange(
- head !== null ? head.loc.start.offset - this.scanner.startOffset : this.scanner.tokenStart,
- tail !== null ? tail.loc.end.offset - this.scanner.startOffset : this.scanner.tokenStart,
- this.filename
- );
- }
- return null;
- }
- };
- config = processConfig(config || {});
- for (var key in config) {
- parser[key] = config[key];
- }
- return function(source, options) {
- options = options || {};
- var context = options.context || 'default';
- var ast;
- parser.scanner.setSource(source, options.offset, options.line, options.column);
- parser.filename = options.filename || '<unknown>';
- parser.needPositions = Boolean(options.positions);
- parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop;
- parser.onParseErrorThrow = false;
- parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
- parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
- parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
- parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;
- if (!parser.context.hasOwnProperty(context)) {
- throw new Error('Unknown context `' + context + '`');
- }
- ast = parser.context[context].call(parser, options);
- if (!parser.scanner.eof) {
- parser.scanner.error();
- }
- return ast;
- };
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var WHITESPACE = TYPE.WhiteSpace;
- var COMMENT = TYPE.Comment;
- module.exports = function readSequence(recognizer) {
- var children = this.createList();
- var child = null;
- var context = {
- recognizer: recognizer,
- space: null,
- ignoreWS: false,
- ignoreWSAfter: false
- };
- this.scanner.skipSC();
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case COMMENT:
- this.scanner.next();
- continue;
- case WHITESPACE:
- if (context.ignoreWS) {
- this.scanner.next();
- } else {
- context.space = this.WhiteSpace();
- }
- continue;
- }
- child = recognizer.getNode.call(this, context);
- if (child === undefined) {
- break;
- }
- if (context.space !== null) {
- children.push(context.space);
- context.space = null;
- }
- children.push(child);
- if (context.ignoreWSAfter) {
- context.ignoreWSAfter = false;
- context.ignoreWS = true;
- } else {
- context.ignoreWS = false;
- }
- }
- return children;
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var sourceMap = __webpack_require__(113);
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function processChildren(node, delimeter) {
- var list = node.children;
- var prev = null;
- if (typeof delimeter !== 'function') {
- list.forEach(this.node, this);
- } else {
- list.forEach(function(node) {
- if (prev !== null) {
- delimeter.call(this, prev);
- }
- this.node(node);
- prev = node;
- }, this);
- }
- }
- module.exports = function createGenerator(config) {
- function processNode(node) {
- if (hasOwnProperty.call(types, node.type)) {
- types[node.type].call(this, node);
- } else {
- throw new Error('Unknown node type: ' + node.type);
- }
- }
- var types = {};
- if (config.node) {
- for (var name in config.node) {
- types[name] = config.node[name].generate;
- }
- }
- return function(node, options) {
- var buffer = '';
- var handlers = {
- children: processChildren,
- node: processNode,
- chunk: function(chunk) {
- buffer += chunk;
- },
- result: function() {
- return buffer;
- }
- };
- if (options) {
- if (typeof options.decorator === 'function') {
- handlers = options.decorator(handlers);
- }
- if (options.sourceMap) {
- handlers = sourceMap(handlers);
- }
- }
- handlers.node(node);
- return handlers.result();
- };
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var SourceMapGenerator = __webpack_require__(114).SourceMapGenerator;
- var trackNodes = {
- Atrule: true,
- Selector: true,
- Declaration: true
- };
- module.exports = function generateSourceMap(handlers) {
- var map = new SourceMapGenerator();
- var line = 1;
- var column = 0;
- var generated = {
- line: 1,
- column: 0
- };
- var original = {
- line: 0,
- column: 0
- };
- var sourceMappingActive = false;
- var activatedGenerated = {
- line: 1,
- column: 0
- };
- var activatedMapping = {
- generated: activatedGenerated
- };
- var handlersNode = handlers.node;
- handlers.node = function(node) {
- if (node.loc && node.loc.start && trackNodes.hasOwnProperty(node.type)) {
- var nodeLine = node.loc.start.line;
- var nodeColumn = node.loc.start.column - 1;
- if (original.line !== nodeLine ||
- original.column !== nodeColumn) {
- original.line = nodeLine;
- original.column = nodeColumn;
- generated.line = line;
- generated.column = column;
- if (sourceMappingActive) {
- sourceMappingActive = false;
- if (generated.line !== activatedGenerated.line ||
- generated.column !== activatedGenerated.column) {
- map.addMapping(activatedMapping);
- }
- }
- sourceMappingActive = true;
- map.addMapping({
- source: node.loc.source,
- original: original,
- generated: generated
- });
- }
- }
- handlersNode.call(this, node);
- if (sourceMappingActive && trackNodes.hasOwnProperty(node.type)) {
- activatedGenerated.line = line;
- activatedGenerated.column = column;
- }
- };
- var handlersChunk = handlers.chunk;
- handlers.chunk = function(chunk) {
- for (var i = 0; i < chunk.length; i++) {
- if (chunk.charCodeAt(i) === 10) {
- line++;
- column = 0;
- } else {
- column++;
- }
- }
- handlersChunk(chunk);
- };
- var handlersResult = handlers.result;
- handlers.result = function() {
- if (sourceMappingActive) {
- map.addMapping(activatedMapping);
- }
- return {
- css: handlersResult(),
- map: map
- };
- };
- return handlers;
- };
- }),
- (function(module, exports, __webpack_require__) {
- exports.SourceMapGenerator = __webpack_require__(50).SourceMapGenerator;
- exports.SourceMapConsumer = __webpack_require__(117).SourceMapConsumer;
- exports.SourceNode = __webpack_require__(120).SourceNode;
- }),
- (function(module, exports) {
- var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
- exports.encode = function (number) {
- if (0 <= number && number < intToCharMap.length) {
- return intToCharMap[number];
- }
- throw new TypeError("Must be between 0 and 63: " + number);
- };
- exports.decode = function (charCode) {
- var bigA = 65;
- var bigZ = 90;
- var littleA = 97;
- var littleZ = 122;
- var zero = 48;
- var nine = 57;
- var plus = 43;
- var slash = 47;
- var littleOffset = 26;
- var numberOffset = 52;
-
- if (bigA <= charCode && charCode <= bigZ) {
- return (charCode - bigA);
- }
-
- if (littleA <= charCode && charCode <= littleZ) {
- return (charCode - littleA + littleOffset);
- }
-
- if (zero <= charCode && charCode <= nine) {
- return (charCode - zero + numberOffset);
- }
-
- if (charCode == plus) {
- return 62;
- }
-
- if (charCode == slash) {
- return 63;
- }
-
- return -1;
- };
- }),
- (function(module, exports, __webpack_require__) {
- var util = __webpack_require__(9);
- function generatedPositionAfter(mappingA, mappingB) {
-
- var lineA = mappingA.generatedLine;
- var lineB = mappingB.generatedLine;
- var columnA = mappingA.generatedColumn;
- var columnB = mappingB.generatedColumn;
- return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
- }
- function MappingList() {
- this._array = [];
- this._sorted = true;
-
- this._last = {generatedLine: -1, generatedColumn: 0};
- }
- MappingList.prototype.unsortedForEach =
- function MappingList_forEach(aCallback, aThisArg) {
- this._array.forEach(aCallback, aThisArg);
- };
- MappingList.prototype.add = function MappingList_add(aMapping) {
- if (generatedPositionAfter(this._last, aMapping)) {
- this._last = aMapping;
- this._array.push(aMapping);
- } else {
- this._sorted = false;
- this._array.push(aMapping);
- }
- };
- MappingList.prototype.toArray = function MappingList_toArray() {
- if (!this._sorted) {
- this._array.sort(util.compareByGeneratedPositionsInflated);
- this._sorted = true;
- }
- return this._array;
- };
- exports.MappingList = MappingList;
- }),
- (function(module, exports, __webpack_require__) {
- var util = __webpack_require__(9);
- var binarySearch = __webpack_require__(118);
- var ArraySet = __webpack_require__(52).ArraySet;
- var base64VLQ = __webpack_require__(51);
- var quickSort = __webpack_require__(119).quickSort;
- function SourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
- return sourceMap.sections != null
- ? new IndexedSourceMapConsumer(sourceMap)
- : new BasicSourceMapConsumer(sourceMap);
- }
- SourceMapConsumer.fromSourceMap = function(aSourceMap) {
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
- }
- SourceMapConsumer.prototype._version = 3;
- SourceMapConsumer.prototype.__generatedMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
- get: function () {
- if (!this.__generatedMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__generatedMappings;
- }
- });
- SourceMapConsumer.prototype.__originalMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
- get: function () {
- if (!this.__originalMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__originalMappings;
- }
- });
- SourceMapConsumer.prototype._charIsMappingSeparator =
- function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
- var c = aStr.charAt(index);
- return c === ";" || c === ",";
- };
- SourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- throw new Error("Subclasses must implement _parseMappings");
- };
- SourceMapConsumer.GENERATED_ORDER = 1;
- SourceMapConsumer.ORIGINAL_ORDER = 2;
- SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
- SourceMapConsumer.LEAST_UPPER_BOUND = 2;
- SourceMapConsumer.prototype.eachMapping =
- function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
- var context = aContext || null;
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
- var mappings;
- switch (order) {
- case SourceMapConsumer.GENERATED_ORDER:
- mappings = this._generatedMappings;
- break;
- case SourceMapConsumer.ORIGINAL_ORDER:
- mappings = this._originalMappings;
- break;
- default:
- throw new Error("Unknown order of iteration.");
- }
- var sourceRoot = this.sourceRoot;
- mappings.map(function (mapping) {
- var source = mapping.source === null ? null : this._sources.at(mapping.source);
- if (source != null && sourceRoot != null) {
- source = util.join(sourceRoot, source);
- }
- return {
- source: source,
- generatedLine: mapping.generatedLine,
- generatedColumn: mapping.generatedColumn,
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: mapping.name === null ? null : this._names.at(mapping.name)
- };
- }, this).forEach(aCallback, context);
- };
- SourceMapConsumer.prototype.allGeneratedPositionsFor =
- function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
- var line = util.getArg(aArgs, 'line');
-
-
-
-
- var needle = {
- source: util.getArg(aArgs, 'source'),
- originalLine: line,
- originalColumn: util.getArg(aArgs, 'column', 0)
- };
- if (this.sourceRoot != null) {
- needle.source = util.relative(this.sourceRoot, needle.source);
- }
- if (!this._sources.has(needle.source)) {
- return [];
- }
- needle.source = this._sources.indexOf(needle.source);
- var mappings = [];
- var index = this._findMapping(needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions,
- binarySearch.LEAST_UPPER_BOUND);
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (aArgs.column === undefined) {
- var originalLine = mapping.originalLine;
-
-
-
-
- while (mapping && mapping.originalLine === originalLine) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- } else {
- var originalColumn = mapping.originalColumn;
-
-
-
-
- while (mapping &&
- mapping.originalLine === line &&
- mapping.originalColumn == originalColumn) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- }
- }
- return mappings;
- };
- exports.SourceMapConsumer = SourceMapConsumer;
- function BasicSourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
- var version = util.getArg(sourceMap, 'version');
- var sources = util.getArg(sourceMap, 'sources');
-
-
- var names = util.getArg(sourceMap, 'names', []);
- var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
- var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
- var mappings = util.getArg(sourceMap, 'mappings');
- var file = util.getArg(sourceMap, 'file', null);
-
-
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- sources = sources
- .map(String)
-
-
-
- .map(util.normalize)
-
-
-
-
- .map(function (source) {
- return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
- ? util.relative(sourceRoot, source)
- : source;
- });
-
-
-
-
- this._names = ArraySet.fromArray(names.map(String), true);
- this._sources = ArraySet.fromArray(sources, true);
- this.sourceRoot = sourceRoot;
- this.sourcesContent = sourcesContent;
- this._mappings = mappings;
- this.file = file;
- }
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
- BasicSourceMapConsumer.fromSourceMap =
- function SourceMapConsumer_fromSourceMap(aSourceMap) {
- var smc = Object.create(BasicSourceMapConsumer.prototype);
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
- smc.sourceRoot = aSourceMap._sourceRoot;
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
- smc.sourceRoot);
- smc.file = aSourceMap._file;
-
-
-
-
- var generatedMappings = aSourceMap._mappings.toArray().slice();
- var destGeneratedMappings = smc.__generatedMappings = [];
- var destOriginalMappings = smc.__originalMappings = [];
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
- var srcMapping = generatedMappings[i];
- var destMapping = new Mapping;
- destMapping.generatedLine = srcMapping.generatedLine;
- destMapping.generatedColumn = srcMapping.generatedColumn;
- if (srcMapping.source) {
- destMapping.source = sources.indexOf(srcMapping.source);
- destMapping.originalLine = srcMapping.originalLine;
- destMapping.originalColumn = srcMapping.originalColumn;
- if (srcMapping.name) {
- destMapping.name = names.indexOf(srcMapping.name);
- }
- destOriginalMappings.push(destMapping);
- }
- destGeneratedMappings.push(destMapping);
- }
- quickSort(smc.__originalMappings, util.compareByOriginalPositions);
- return smc;
- };
- BasicSourceMapConsumer.prototype._version = 3;
- Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
- get: function () {
- return this._sources.toArray().map(function (s) {
- return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
- }, this);
- }
- });
- function Mapping() {
- this.generatedLine = 0;
- this.generatedColumn = 0;
- this.source = null;
- this.originalLine = null;
- this.originalColumn = null;
- this.name = null;
- }
- BasicSourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- var generatedLine = 1;
- var previousGeneratedColumn = 0;
- var previousOriginalLine = 0;
- var previousOriginalColumn = 0;
- var previousSource = 0;
- var previousName = 0;
- var length = aStr.length;
- var index = 0;
- var cachedSegments = {};
- var temp = {};
- var originalMappings = [];
- var generatedMappings = [];
- var mapping, str, segment, end, value;
- while (index < length) {
- if (aStr.charAt(index) === ';') {
- generatedLine++;
- index++;
- previousGeneratedColumn = 0;
- }
- else if (aStr.charAt(index) === ',') {
- index++;
- }
- else {
- mapping = new Mapping();
- mapping.generatedLine = generatedLine;
-
-
-
-
-
- for (end = index; end < length; end++) {
- if (this._charIsMappingSeparator(aStr, end)) {
- break;
- }
- }
- str = aStr.slice(index, end);
- segment = cachedSegments[str];
- if (segment) {
- index += str.length;
- } else {
- segment = [];
- while (index < end) {
- base64VLQ.decode(aStr, index, temp);
- value = temp.value;
- index = temp.rest;
- segment.push(value);
- }
- if (segment.length === 2) {
- throw new Error('Found a source, but no line and column');
- }
- if (segment.length === 3) {
- throw new Error('Found a source and line, but no column');
- }
- cachedSegments[str] = segment;
- }
-
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
- previousGeneratedColumn = mapping.generatedColumn;
- if (segment.length > 1) {
-
- mapping.source = previousSource + segment[1];
- previousSource += segment[1];
-
- mapping.originalLine = previousOriginalLine + segment[2];
- previousOriginalLine = mapping.originalLine;
-
- mapping.originalLine += 1;
-
- mapping.originalColumn = previousOriginalColumn + segment[3];
- previousOriginalColumn = mapping.originalColumn;
- if (segment.length > 4) {
-
- mapping.name = previousName + segment[4];
- previousName += segment[4];
- }
- }
- generatedMappings.push(mapping);
- if (typeof mapping.originalLine === 'number') {
- originalMappings.push(mapping);
- }
- }
- }
- quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
- this.__generatedMappings = generatedMappings;
- quickSort(originalMappings, util.compareByOriginalPositions);
- this.__originalMappings = originalMappings;
- };
- BasicSourceMapConsumer.prototype._findMapping =
- function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
- aColumnName, aComparator, aBias) {
-
-
-
-
- if (aNeedle[aLineName] <= 0) {
- throw new TypeError('Line must be greater than or equal to 1, got '
- + aNeedle[aLineName]);
- }
- if (aNeedle[aColumnName] < 0) {
- throw new TypeError('Column must be greater than or equal to 0, got '
- + aNeedle[aColumnName]);
- }
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
- };
- BasicSourceMapConsumer.prototype.computeColumnSpans =
- function SourceMapConsumer_computeColumnSpans() {
- for (var index = 0; index < this._generatedMappings.length; ++index) {
- var mapping = this._generatedMappings[index];
-
-
-
-
- if (index + 1 < this._generatedMappings.length) {
- var nextMapping = this._generatedMappings[index + 1];
- if (mapping.generatedLine === nextMapping.generatedLine) {
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
- continue;
- }
- }
-
- mapping.lastGeneratedColumn = Infinity;
- }
- };
- BasicSourceMapConsumer.prototype.originalPositionFor =
- function SourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
- var index = this._findMapping(
- needle,
- this._generatedMappings,
- "generatedLine",
- "generatedColumn",
- util.compareByGeneratedPositionsDeflated,
- util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
- );
- if (index >= 0) {
- var mapping = this._generatedMappings[index];
- if (mapping.generatedLine === needle.generatedLine) {
- var source = util.getArg(mapping, 'source', null);
- if (source !== null) {
- source = this._sources.at(source);
- if (this.sourceRoot != null) {
- source = util.join(this.sourceRoot, source);
- }
- }
- var name = util.getArg(mapping, 'name', null);
- if (name !== null) {
- name = this._names.at(name);
- }
- return {
- source: source,
- line: util.getArg(mapping, 'originalLine', null),
- column: util.getArg(mapping, 'originalColumn', null),
- name: name
- };
- }
- }
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- };
- BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
- function BasicSourceMapConsumer_hasContentsOfAllSources() {
- if (!this.sourcesContent) {
- return false;
- }
- return this.sourcesContent.length >= this._sources.size() &&
- !this.sourcesContent.some(function (sc) { return sc == null; });
- };
- BasicSourceMapConsumer.prototype.sourceContentFor =
- function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- if (!this.sourcesContent) {
- return null;
- }
- if (this.sourceRoot != null) {
- aSource = util.relative(this.sourceRoot, aSource);
- }
- if (this._sources.has(aSource)) {
- return this.sourcesContent[this._sources.indexOf(aSource)];
- }
- var url;
- if (this.sourceRoot != null
- && (url = util.urlParse(this.sourceRoot))) {
-
-
-
-
- var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
- if (url.scheme == "file"
- && this._sources.has(fileUriAbsPath)) {
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
- }
- if ((!url.path || url.path == "/")
- && this._sources.has("/" + aSource)) {
- return this.sourcesContent[this._sources.indexOf("/" + aSource)];
- }
- }
-
-
-
-
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- }
- };
- BasicSourceMapConsumer.prototype.generatedPositionFor =
- function SourceMapConsumer_generatedPositionFor(aArgs) {
- var source = util.getArg(aArgs, 'source');
- if (this.sourceRoot != null) {
- source = util.relative(this.sourceRoot, source);
- }
- if (!this._sources.has(source)) {
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- }
- source = this._sources.indexOf(source);
- var needle = {
- source: source,
- originalLine: util.getArg(aArgs, 'line'),
- originalColumn: util.getArg(aArgs, 'column')
- };
- var index = this._findMapping(
- needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions,
- util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
- );
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (mapping.source === needle.source) {
- return {
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- };
- }
- }
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- };
- exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
- function IndexedSourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
- var version = util.getArg(sourceMap, 'version');
- var sections = util.getArg(sourceMap, 'sections');
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- this._sources = new ArraySet();
- this._names = new ArraySet();
- var lastOffset = {
- line: -1,
- column: 0
- };
- this._sections = sections.map(function (s) {
- if (s.url) {
-
-
- throw new Error('Support for url field in sections not implemented.');
- }
- var offset = util.getArg(s, 'offset');
- var offsetLine = util.getArg(offset, 'line');
- var offsetColumn = util.getArg(offset, 'column');
- if (offsetLine < lastOffset.line ||
- (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
- throw new Error('Section offsets must be ordered and non-overlapping.');
- }
- lastOffset = offset;
- return {
- generatedOffset: {
-
-
- generatedLine: offsetLine + 1,
- generatedColumn: offsetColumn + 1
- },
- consumer: new SourceMapConsumer(util.getArg(s, 'map'))
- }
- });
- }
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
- IndexedSourceMapConsumer.prototype._version = 3;
- Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
- get: function () {
- var sources = [];
- for (var i = 0; i < this._sections.length; i++) {
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
- sources.push(this._sections[i].consumer.sources[j]);
- }
- }
- return sources;
- }
- });
- IndexedSourceMapConsumer.prototype.originalPositionFor =
- function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
-
-
- var sectionIndex = binarySearch.search(needle, this._sections,
- function(needle, section) {
- var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
- if (cmp) {
- return cmp;
- }
- return (needle.generatedColumn -
- section.generatedOffset.generatedColumn);
- });
- var section = this._sections[sectionIndex];
- if (!section) {
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- }
- return section.consumer.originalPositionFor({
- line: needle.generatedLine -
- (section.generatedOffset.generatedLine - 1),
- column: needle.generatedColumn -
- (section.generatedOffset.generatedLine === needle.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- bias: aArgs.bias
- });
- };
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
- function IndexedSourceMapConsumer_hasContentsOfAllSources() {
- return this._sections.every(function (s) {
- return s.consumer.hasContentsOfAllSources();
- });
- };
- IndexedSourceMapConsumer.prototype.sourceContentFor =
- function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var content = section.consumer.sourceContentFor(aSource, true);
- if (content) {
- return content;
- }
- }
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- }
- };
- IndexedSourceMapConsumer.prototype.generatedPositionFor =
- function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
-
-
- if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
- continue;
- }
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
- if (generatedPosition) {
- var ret = {
- line: generatedPosition.line +
- (section.generatedOffset.generatedLine - 1),
- column: generatedPosition.column +
- (section.generatedOffset.generatedLine === generatedPosition.line
- ? section.generatedOffset.generatedColumn - 1
- : 0)
- };
- return ret;
- }
- }
- return {
- line: null,
- column: null
- };
- };
- IndexedSourceMapConsumer.prototype._parseMappings =
- function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- this.__generatedMappings = [];
- this.__originalMappings = [];
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var sectionMappings = section.consumer._generatedMappings;
- for (var j = 0; j < sectionMappings.length; j++) {
- var mapping = sectionMappings[j];
- var source = section.consumer._sources.at(mapping.source);
- if (section.consumer.sourceRoot !== null) {
- source = util.join(section.consumer.sourceRoot, source);
- }
- this._sources.add(source);
- source = this._sources.indexOf(source);
- var name = section.consumer._names.at(mapping.name);
- this._names.add(name);
- name = this._names.indexOf(name);
-
-
-
-
- var adjustedMapping = {
- source: source,
- generatedLine: mapping.generatedLine +
- (section.generatedOffset.generatedLine - 1),
- generatedColumn: mapping.generatedColumn +
- (section.generatedOffset.generatedLine === mapping.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: name
- };
- this.__generatedMappings.push(adjustedMapping);
- if (typeof adjustedMapping.originalLine === 'number') {
- this.__originalMappings.push(adjustedMapping);
- }
- }
- }
- quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
- quickSort(this.__originalMappings, util.compareByOriginalPositions);
- };
- exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
- }),
- (function(module, exports) {
- exports.GREATEST_LOWER_BOUND = 1;
- exports.LEAST_UPPER_BOUND = 2;
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
-
-
-
-
-
-
-
-
-
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
- if (cmp === 0) {
-
- return mid;
- }
- else if (cmp > 0) {
-
- if (aHigh - mid > 1) {
-
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
- }
-
-
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return aHigh < aHaystack.length ? aHigh : -1;
- } else {
- return mid;
- }
- }
- else {
-
- if (mid - aLow > 1) {
-
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
- }
-
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return mid;
- } else {
- return aLow < 0 ? -1 : aLow;
- }
- }
- }
- exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
- if (aHaystack.length === 0) {
- return -1;
- }
- var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
- aCompare, aBias || exports.GREATEST_LOWER_BOUND);
- if (index < 0) {
- return -1;
- }
-
-
-
- while (index - 1 >= 0) {
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
- break;
- }
- --index;
- }
- return index;
- };
- }),
- (function(module, exports) {
- function swap(ary, x, y) {
- var temp = ary[x];
- ary[x] = ary[y];
- ary[y] = temp;
- }
- function randomIntInRange(low, high) {
- return Math.round(low + (Math.random() * (high - low)));
- }
- function doQuickSort(ary, comparator, p, r) {
-
-
-
- if (p < r) {
-
-
-
-
-
-
-
-
-
-
- var pivotIndex = randomIntInRange(p, r);
- var i = p - 1;
- swap(ary, pivotIndex, r);
- var pivot = ary[r];
-
-
-
-
-
-
- for (var j = p; j < r; j++) {
- if (comparator(ary[j], pivot) <= 0) {
- i += 1;
- swap(ary, i, j);
- }
- }
- swap(ary, i + 1, j);
- var q = i + 1;
-
- doQuickSort(ary, comparator, p, q - 1);
- doQuickSort(ary, comparator, q + 1, r);
- }
- }
- exports.quickSort = function (ary, comparator) {
- doQuickSort(ary, comparator, 0, ary.length - 1);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var SourceMapGenerator = __webpack_require__(50).SourceMapGenerator;
- var util = __webpack_require__(9);
- var REGEX_NEWLINE = /(\r?\n)/;
- var NEWLINE_CODE = 10;
- var isSourceNode = "$$$isSourceNode$$$";
- function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
- this.children = [];
- this.sourceContents = {};
- this.line = aLine == null ? null : aLine;
- this.column = aColumn == null ? null : aColumn;
- this.source = aSource == null ? null : aSource;
- this.name = aName == null ? null : aName;
- this[isSourceNode] = true;
- if (aChunks != null) this.add(aChunks);
- }
- SourceNode.fromStringWithSourceMap =
- function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
-
-
- var node = new SourceNode();
-
-
-
-
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
- var remainingLinesIndex = 0;
- var shiftNextLine = function() {
- var lineContents = getNextLine();
-
- var newLine = getNextLine() || "";
- return lineContents + newLine;
- function getNextLine() {
- return remainingLinesIndex < remainingLines.length ?
- remainingLines[remainingLinesIndex++] : undefined;
- }
- };
-
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
-
-
-
- var lastMapping = null;
- aSourceMapConsumer.eachMapping(function (mapping) {
- if (lastMapping !== null) {
-
-
- if (lastGeneratedLine < mapping.generatedLine) {
-
- addMappingWithCode(lastMapping, shiftNextLine());
- lastGeneratedLine++;
- lastGeneratedColumn = 0;
-
- } else {
-
-
-
- var nextLine = remainingLines[remainingLinesIndex];
- var code = nextLine.substr(0, mapping.generatedColumn -
- lastGeneratedColumn);
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
- lastGeneratedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- addMappingWithCode(lastMapping, code);
-
- lastMapping = mapping;
- return;
- }
- }
-
-
-
- while (lastGeneratedLine < mapping.generatedLine) {
- node.add(shiftNextLine());
- lastGeneratedLine++;
- }
- if (lastGeneratedColumn < mapping.generatedColumn) {
- var nextLine = remainingLines[remainingLinesIndex];
- node.add(nextLine.substr(0, mapping.generatedColumn));
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- }
- lastMapping = mapping;
- }, this);
-
- if (remainingLinesIndex < remainingLines.length) {
- if (lastMapping) {
-
- addMappingWithCode(lastMapping, shiftNextLine());
- }
-
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
- }
-
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aRelativePath != null) {
- sourceFile = util.join(aRelativePath, sourceFile);
- }
- node.setSourceContent(sourceFile, content);
- }
- });
- return node;
- function addMappingWithCode(mapping, code) {
- if (mapping === null || mapping.source === undefined) {
- node.add(code);
- } else {
- var source = aRelativePath
- ? util.join(aRelativePath, mapping.source)
- : mapping.source;
- node.add(new SourceNode(mapping.originalLine,
- mapping.originalColumn,
- source,
- code,
- mapping.name));
- }
- }
- };
- SourceNode.prototype.add = function SourceNode_add(aChunk) {
- if (Array.isArray(aChunk)) {
- aChunk.forEach(function (chunk) {
- this.add(chunk);
- }, this);
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- if (aChunk) {
- this.children.push(aChunk);
- }
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
- SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
- if (Array.isArray(aChunk)) {
- for (var i = aChunk.length-1; i >= 0; i--) {
- this.prepend(aChunk[i]);
- }
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- this.children.unshift(aChunk);
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
- SourceNode.prototype.walk = function SourceNode_walk(aFn) {
- var chunk;
- for (var i = 0, len = this.children.length; i < len; i++) {
- chunk = this.children[i];
- if (chunk[isSourceNode]) {
- chunk.walk(aFn);
- }
- else {
- if (chunk !== '') {
- aFn(chunk, { source: this.source,
- line: this.line,
- column: this.column,
- name: this.name });
- }
- }
- }
- };
- SourceNode.prototype.join = function SourceNode_join(aSep) {
- var newChildren;
- var i;
- var len = this.children.length;
- if (len > 0) {
- newChildren = [];
- for (i = 0; i < len-1; i++) {
- newChildren.push(this.children[i]);
- newChildren.push(aSep);
- }
- newChildren.push(this.children[i]);
- this.children = newChildren;
- }
- return this;
- };
- SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
- var lastChild = this.children[this.children.length - 1];
- if (lastChild[isSourceNode]) {
- lastChild.replaceRight(aPattern, aReplacement);
- }
- else if (typeof lastChild === 'string') {
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
- }
- else {
- this.children.push(''.replace(aPattern, aReplacement));
- }
- return this;
- };
- SourceNode.prototype.setSourceContent =
- function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
- };
- SourceNode.prototype.walkSourceContents =
- function SourceNode_walkSourceContents(aFn) {
- for (var i = 0, len = this.children.length; i < len; i++) {
- if (this.children[i][isSourceNode]) {
- this.children[i].walkSourceContents(aFn);
- }
- }
- var sources = Object.keys(this.sourceContents);
- for (var i = 0, len = sources.length; i < len; i++) {
- aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
- }
- };
- SourceNode.prototype.toString = function SourceNode_toString() {
- var str = "";
- this.walk(function (chunk) {
- str += chunk;
- });
- return str;
- };
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
- var generated = {
- code: "",
- line: 1,
- column: 0
- };
- var map = new SourceMapGenerator(aArgs);
- var sourceMappingActive = false;
- var lastOriginalSource = null;
- var lastOriginalLine = null;
- var lastOriginalColumn = null;
- var lastOriginalName = null;
- this.walk(function (chunk, original) {
- generated.code += chunk;
- if (original.source !== null
- && original.line !== null
- && original.column !== null) {
- if(lastOriginalSource !== original.source
- || lastOriginalLine !== original.line
- || lastOriginalColumn !== original.column
- || lastOriginalName !== original.name) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- lastOriginalSource = original.source;
- lastOriginalLine = original.line;
- lastOriginalColumn = original.column;
- lastOriginalName = original.name;
- sourceMappingActive = true;
- } else if (sourceMappingActive) {
- map.addMapping({
- generated: {
- line: generated.line,
- column: generated.column
- }
- });
- lastOriginalSource = null;
- sourceMappingActive = false;
- }
- for (var idx = 0, length = chunk.length; idx < length; idx++) {
- if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
- generated.line++;
- generated.column = 0;
-
- if (idx + 1 === length) {
- lastOriginalSource = null;
- sourceMappingActive = false;
- } else if (sourceMappingActive) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- } else {
- generated.column++;
- }
- }
- });
- this.walkSourceContents(function (sourceFile, sourceContent) {
- map.setSourceContent(sourceFile, sourceContent);
- });
- return { code: generated.code, map: map };
- };
- exports.SourceNode = SourceNode;
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(7);
- module.exports = function createConvertors(walk) {
- return {
- fromPlainObject: function(ast) {
- walk(ast, {
- enter: function(node) {
- if (node.children && node.children instanceof List === false) {
- node.children = new List().fromArray(node.children);
- }
- }
- });
- return ast;
- },
- toPlainObject: function(ast) {
- walk(ast, {
- leave: function(node) {
- if (node.children && node.children instanceof List) {
- node.children = node.children.toArray();
- }
- }
- });
- return ast;
- }
- };
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var noop = function() {};
- function ensureFunction(value) {
- return typeof value === 'function' ? value : noop;
- }
- function invokeForType(fn, type) {
- return function(node, item, list) {
- if (node.type === type) {
- fn.call(this, node, item, list);
- }
- };
- }
- function getWalkersFromStructure(name, nodeType) {
- var structure = nodeType.structure;
- var walkers = [];
- for (var key in structure) {
- if (hasOwnProperty.call(structure, key) === false) {
- continue;
- }
- var fieldTypes = structure[key];
- var walker = {
- name: key,
- type: false,
- nullable: false
- };
- if (!Array.isArray(structure[key])) {
- fieldTypes = [structure[key]];
- }
- for (var i = 0; i < fieldTypes.length; i++) {
- var fieldType = fieldTypes[i];
- if (fieldType === null) {
- walker.nullable = true;
- } else if (typeof fieldType === 'string') {
- walker.type = 'node';
- } else if (Array.isArray(fieldType)) {
- walker.type = 'list';
- }
- }
- if (walker.type) {
- walkers.push(walker);
- }
- }
- if (walkers.length) {
- return {
- context: nodeType.walkContext,
- fields: walkers
- };
- }
- return null;
- }
- function getTypesFromConfig(config) {
- var types = {};
- for (var name in config.node) {
- if (hasOwnProperty.call(config.node, name)) {
- var nodeType = config.node[name];
- if (!nodeType.structure) {
- throw new Error('Missed `structure` field in `' + name + '` node type definition');
- }
- types[name] = getWalkersFromStructure(name, nodeType);
- }
- }
- return types;
- }
- function createTypeIterator(config, reverse) {
- var fields = reverse ? config.fields.slice().reverse() : config.fields;
- var body = fields.map(function(field) {
- var ref = 'node.' + field.name;
- var line;
- if (field.type === 'list') {
- line = reverse
- ? ref + '.forEachRight(walk);'
- : ref + '.forEach(walk);';
- } else {
- line = 'walk(' + ref + ');';
- }
- if (field.nullable) {
- line = 'if (' + ref + ') {\n ' + line + '}';
- }
- return line;
- });
- if (config.context) {
- body = [].concat(
- 'var old = context.' + config.context + ';',
- 'context.' + config.context + ' = node;',
- body,
- 'context.' + config.context + ' = old;'
- );
- }
- return new Function('node', 'context', 'walk', body.join('\n'));
- }
- function createFastTraveralMap(iterators) {
- return {
- Atrule: {
- StyleSheet: iterators.StyleSheet,
- Atrule: iterators.Atrule,
- Rule: iterators.Rule,
- Block: iterators.Block
- },
- Rule: {
- StyleSheet: iterators.StyleSheet,
- Atrule: iterators.Atrule,
- Rule: iterators.Rule,
- Block: iterators.Block
- },
- Declaration: {
- StyleSheet: iterators.StyleSheet,
- Atrule: iterators.Atrule,
- Rule: iterators.Rule,
- Block: iterators.Block
- }
- };
- }
- module.exports = function createWalker(config) {
- var types = getTypesFromConfig(config);
- var iteratorsNatural = {};
- var iteratorsReverse = {};
- for (var name in types) {
- if (hasOwnProperty.call(types, name) && types[name] !== null) {
- iteratorsNatural[name] = createTypeIterator(types[name], false);
- iteratorsReverse[name] = createTypeIterator(types[name], true);
- }
- }
- var fastTraversalIteratorsNatural = createFastTraveralMap(iteratorsNatural);
- var fastTraversalIteratorsReverse = createFastTraveralMap(iteratorsReverse);
- return function walk(root, options) {
- function walkNode(node, item, list) {
- enter.call(context, node, item, list);
- if (iterators.hasOwnProperty(node.type)) {
- iterators[node.type](node, context, walkNode);
- }
- leave.call(context, node, item, list);
- }
- var enter = noop;
- var leave = noop;
- var iterators = iteratorsNatural;
- var context = {
- root: root,
- stylesheet: null,
- atrule: null,
- atrulePrelude: null,
- rule: null,
- selector: null,
- block: null,
- declaration: null,
- function: null
- };
- if (typeof options === 'function') {
- enter = options;
- } else if (options) {
- enter = ensureFunction(options.enter);
- leave = ensureFunction(options.leave);
- if (options.reverse) {
- iterators = iteratorsReverse;
- }
- if (options.visit) {
- if (fastTraversalIteratorsNatural.hasOwnProperty(options.visit)) {
- iterators = options.reverse
- ? fastTraversalIteratorsReverse[options.visit]
- : fastTraversalIteratorsNatural[options.visit];
- } else if (!types.hasOwnProperty(options.visit)) {
- throw new Error('Bad value `' + options.visit + '` for `visit` option (should be: ' + Object.keys(types).join(', ') + ')');
- }
- enter = invokeForType(enter, options.visit);
- leave = invokeForType(leave, options.visit);
- }
- }
- if (enter === noop && leave === noop) {
- throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
- }
-
- if (options.reverse) {
- var tmp = enter;
- enter = leave;
- leave = tmp;
- }
- walkNode(root);
- };
- };
- }),
- (function(module, exports, __webpack_require__) {
- "use strict";
- var List = __webpack_require__(7);
- module.exports = function clone(node) {
- var result = {};
- for (var key in node) {
- var value = node[key];
- if (value) {
- if (Array.isArray(value) || value instanceof List) {
- value = value.map(clone);
- } else if (value.constructor === Object) {
- value = clone(value);
- }
- }
- result[key] = value;
- }
- return result;
- };
- }),
- (function(module, exports) {
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var shape = {
- generic: true,
- types: {},
- properties: {},
- parseContext: {},
- scope: {},
- atrule: ['parse'],
- pseudo: ['parse'],
- node: ['name', 'structure', 'parse', 'generate', 'walkContext']
- };
- function isObject(value) {
- return value && value.constructor === Object;
- }
- function copy(value) {
- if (isObject(value)) {
- var res = {};
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- res[key] = value[key];
- }
- }
- return res;
- } else {
- return value;
- }
- }
- function extend(dest, src) {
- for (var key in src) {
- if (hasOwnProperty.call(src, key)) {
- if (isObject(dest[key])) {
- extend(dest[key], copy(src[key]));
- } else {
- dest[key] = copy(src[key]);
- }
- }
- }
- }
- function mix(dest, src, shape) {
- for (var key in shape) {
- if (hasOwnProperty.call(shape, key) === false) {
- continue;
- }
- if (shape[key] === true) {
- if (key in src) {
- if (hasOwnProperty.call(src, key)) {
- dest[key] = copy(src[key]);
- }
- }
- } else if (shape[key]) {
- if (isObject(shape[key])) {
- var res = {};
- extend(res, dest[key]);
- extend(res, src[key]);
- dest[key] = res;
- } else if (Array.isArray(shape[key])) {
- var res = {};
- var innerShape = shape[key].reduce(function(s, k) {
- s[k] = true;
- return s;
- }, {});
- for (var name in dest[key]) {
- if (hasOwnProperty.call(dest[key], name)) {
- res[name] = {};
- if (dest[key] && dest[key][name]) {
- mix(res[name], dest[key][name], innerShape);
- }
- }
- }
- for (var name in src[key]) {
- if (hasOwnProperty.call(src[key], name)) {
- if (!res[name]) {
- res[name] = {};
- }
- if (src[key] && src[key][name]) {
- mix(res[name], src[key][name], innerShape);
- }
- }
- }
- dest[key] = res;
- }
- }
- }
- return dest;
- }
- module.exports = function(dest, src) {
- return mix(dest, src, shape);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var data = __webpack_require__(126);
- module.exports = {
- generic: true,
- types: data.types,
- properties: data.properties,
- node: __webpack_require__(28)
- };
- }),
- (function(module) {
- module.exports = JSON.parse("{\"generic\":true,\"types\":{\"absolute-size\":\"xx-small | x-small | small | medium | large | x-large | xx-large\",\"alpha-value\":\"<number> | <percentage>\",\"angle-percentage\":\"<angle> | <percentage>\",\"animateable-feature\":\"scroll-position | contents | <custom-ident>\",\"attachment\":\"scroll | fixed | local\",\"auto-repeat\":\"repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )\",\"auto-track-list\":\"[ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? <auto-repeat> [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?\",\"baseline-position\":\"[ first | last ]? baseline\",\"basic-shape\":\"<inset()> | <circle()> | <ellipse()> | <polygon()>\",\"bg-image\":\"none | <image>\",\"bg-layer\":\"<bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <box> || <box>\",\"bg-position\":\"[ [ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] | [ center | [ left | right ] <length-percentage>? ] && [ center | [ top | bottom ] <length-percentage>? ] ]\",\"bg-size\":\"[ <length-percentage> | auto ]{1,2} | cover | contain\",\"blur()\":\"blur( <length> )\",\"blend-mode\":\"normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity\",\"box\":\"border-box | padding-box | content-box\",\"br-style\":\"none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset\",\"br-width\":\"<length> | thin | medium | thick\",\"brightness()\":\"brightness( <number-percentage> )\",\"calc()\":\"calc( <calc-sum> )\",\"calc-sum\":\"<calc-product> [ [ '+' | '-' ] <calc-product> ]*\",\"calc-product\":\"<calc-value> [ '*' <calc-value> | '/' <number> ]*\",\"calc-value\":\"<number> | <dimension> | <percentage> | ( <calc-sum> )\",\"cf-final-image\":\"<image> | <color>\",\"cf-mixing-image\":\"<percentage>? && <image>\",\"circle()\":\"circle( [ <shape-radius> ]? [ at <position> ]? )\",\"clip-source\":\"<url>\",\"color\":\"<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>\",\"color-stop\":\"<color> <length-percentage>?\",\"color-stop-list\":\"<color-stop>#{2,}\",\"common-lig-values\":\"[ common-ligatures | no-common-ligatures ]\",\"composite-style\":\"clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor\",\"compositing-operator\":\"add | subtract | intersect | exclude\",\"contextual-alt-values\":\"[ contextual | no-contextual ]\",\"content-distribution\":\"space-between | space-around | space-evenly | stretch\",\"content-list\":\"[ <string> | contents | <url> | <quote> | <attr()> | counter( <ident> , <'list-style-type'>? ) ]+\",\"content-position\":\"center | start | end | flex-start | flex-end\",\"content-replacement\":\"<image>\",\"contrast()\":\"contrast( [ <number-percentage> ] )\",\"counter-style\":\"<counter-style-name> | symbols( )\",\"counter-style-name\":\"<custom-ident>\",\"cross-fade()\":\"cross-fade( <cf-mixing-image> , <cf-final-image>? )\",\"cubic-bezier-timing-function\":\"ease | ease-in | ease-out | ease-in-out | cubic-bezier( <number> , <number> , <number> , <number> )\",\"deprecated-system-color\":\"ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonFace | ButtonHighlight | ButtonShadow | ButtonText | CaptionText | GrayText | Highlight | HighlightText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText\",\"discretionary-lig-values\":\"[ discretionary-ligatures | no-discretionary-ligatures ]\",\"display-box\":\"contents | none\",\"display-inside\":\"flow | flow-root | table | flex | grid | subgrid | ruby\",\"display-internal\":\"table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | ruby-base | ruby-text | ruby-base-container | ruby-text-container\",\"display-legacy\":\"inline-block | inline-list-item | inline-table | inline-flex | inline-grid\",\"display-listitem\":\"<display-outside>? && [ flow | flow-root ]? && list-item\",\"display-outside\":\"block | inline | run-in\",\"drop-shadow()\":\"drop-shadow( <length>{2,3} <color>? )\",\"east-asian-variant-values\":\"[ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]\",\"east-asian-width-values\":\"[ full-width | proportional-width ]\",\"element()\":\"element( <id-selector> )\",\"ellipse()\":\"ellipse( [ <shape-radius>{2} ]? [ at <position> ]? )\",\"ending-shape\":\"circle | ellipse\",\"explicit-track-list\":\"[ <line-names>? <track-size> ]+ <line-names>?\",\"family-name\":\"<string> | <custom-ident>+\",\"feature-tag-value\":\"<string> [ <integer> | on | off ]?\",\"feature-value-name\":\"<custom-ident>\",\"fill-rule\":\"nonzero | evenodd\",\"filter-function\":\"<blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <saturate()> | <sepia()>\",\"filter-function-list\":\"[ <filter-function> | <url> ]+\",\"final-bg-layer\":\"<'background-color'> || <bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <box> || <box>\",\"fit-content()\":\"fit-content( [ <length> | <percentage> ] )\",\"fixed-breadth\":\"<length-percentage>\",\"fixed-repeat\":\"repeat( [ <positive-integer> ] , [ <line-names>? <fixed-size> ]+ <line-names>? )\",\"fixed-size\":\"<fixed-breadth> | minmax( <fixed-breadth> , <track-breadth> ) | minmax( <inflexible-breadth> , <fixed-breadth> )\",\"font-variant-css21\":\"[ normal | small-caps ]\",\"frames-timing-function\":\"frames( <integer> )\",\"frequency-percentage\":\"<frequency> | <percentage>\",\"generic-family\":\"serif | sans-serif | cursive | fantasy | monospace | -apple-system\",\"generic-name\":\"serif | sans-serif | cursive | fantasy | monospace\",\"geometry-box\":\"<shape-box> | fill-box | stroke-box | view-box\",\"gradient\":\"<-legacy-gradient> | <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()>\",\"grayscale()\":\"grayscale( <number-percentage> )\",\"grid-line\":\"auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> || <custom-ident> ] ]\",\"historical-lig-values\":\"[ historical-ligatures | no-historical-ligatures ]\",\"hsl()\":\"hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )\",\"hsla()\":\"hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )\",\"hue\":\"<number> | <angle>\",\"hue-rotate()\":\"hue-rotate( <angle> )\",\"image\":\"<url> | <image()> | <image-set()> | <element()> | <cross-fade()> | <gradient>\",\"image()\":\"image( [ [ <image> | <string> ]? , <color>? ]! )\",\"image-set()\":\"image-set( <image-set-option># )\",\"image-set-option\":\"[ <image> | <string> ] <resolution>\",\"inflexible-breadth\":\"<length> | <percentage> | min-content | max-content | auto\",\"inset()\":\"inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )\",\"invert()\":\"invert( <number-percentage> )\",\"keyframes-name\":\"<custom-ident> | <string>\",\"keyframe-selector\":\"from | to | <percentage>\",\"leader()\":\"leader( <leader-type> )\",\"leader-type\":\"dotted | solid | space | <string>\",\"length-percentage\":\"<length> | <percentage>\",\"line-names\":\"'[' <custom-ident>* ']'\",\"line-name-list\":\"[ <line-names> | <name-repeat> ]+\",\"linear-gradient()\":\"linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )\",\"mask-layer\":\"<mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator> || <masking-mode>\",\"mask-position\":\"[ <length-percentage> | left | center | right ] [ <length-percentage> | top | center | bottom ]?\",\"mask-reference\":\"none | <image> | <mask-source>\",\"mask-source\":\"<url>\",\"masking-mode\":\"alpha | luminance | match-source\",\"matrix()\":\"matrix( <number> [, <number> ]{5} )\",\"matrix3d()\":\"matrix3d( <number> [, <number> ]{15} )\",\"media-type\":\"<ident>\",\"mf-boolean\":\"<mf-name>\",\"mf-name\":\"<ident>\",\"minmax()\":\"minmax( [ <length> | <percentage> | <flex> | min-content | max-content | auto ] , [ <length> | <percentage> | <flex> | min-content | max-content | auto ] )\",\"named-color\":\"transparent | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen | <-non-standard-color>\",\"namespace-prefix\":\"<ident>\",\"number-percentage\":\"<number> | <percentage>\",\"numeric-figure-values\":\"[ lining-nums | oldstyle-nums ]\",\"numeric-fraction-values\":\"[ diagonal-fractions | stacked-fractions ]\",\"numeric-spacing-values\":\"[ proportional-nums | tabular-nums ]\",\"opacity()\":\"opacity( [ <number-percentage> ] )\",\"overflow-position\":\"unsafe | safe\",\"outline-radius\":\"<border-radius>\",\"perspective()\":\"perspective( <length> )\",\"polygon()\":\"polygon( <fill-rule>? , [ <length-percentage> <length-percentage> ]# )\",\"position\":\"[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]\",\"quote\":\"open-quote | close-quote | no-open-quote | no-close-quote\",\"radial-gradient()\":\"radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )\",\"relative-size\":\"larger | smaller\",\"repeat-style\":\"repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}\",\"repeating-linear-gradient()\":\"repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )\",\"repeating-radial-gradient()\":\"repeating-radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )\",\"rgb()\":\"rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )\",\"rgba()\":\"rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )\",\"rotate()\":\"rotate( <angle> )\",\"rotate3d()\":\"rotate3d( <number> , <number> , <number> , <angle> )\",\"rotateX()\":\"rotateX( <angle> )\",\"rotateY()\":\"rotateY( <angle> )\",\"rotateZ()\":\"rotateZ( <angle> )\",\"saturate()\":\"saturate( <number-percentage> )\",\"scale()\":\"scale( <number> [, <number> ]? )\",\"scale3d()\":\"scale3d( <number> , <number> , <number> )\",\"scaleX()\":\"scaleX( <number> )\",\"scaleY()\":\"scaleY( <number> )\",\"scaleZ()\":\"scaleZ( <number> )\",\"self-position\":\"center | start | end | self-start | self-end | flex-start | flex-end\",\"shape-radius\":\"<length-percentage> | closest-side | farthest-side\",\"skew()\":\"skew( <angle> [, <angle> ]? )\",\"skewX()\":\"skewX( <angle> )\",\"skewY()\":\"skewY( <angle> )\",\"sepia()\":\"sepia( <number-percentage> )\",\"shadow\":\"inset? && <length>{2,4} && <color>?\",\"shadow-t\":\"[ <length>{2,3} && <color>? ]\",\"shape\":\"rect( [ [ <top> , <right> , <bottom> , <left> ] | [ <top> <right> <bottom> <left> ] ] )\",\"shape-box\":\"<box> | margin-box\",\"side-or-corner\":\"[ left | right ] || [ top | bottom ]\",\"single-animation\":\"<time> || <single-timing-function> || <time> || <single-animation-iteration-count> || <single-animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ]\",\"single-animation-direction\":\"normal | reverse | alternate | alternate-reverse\",\"single-animation-fill-mode\":\"none | forwards | backwards | both\",\"single-animation-iteration-count\":\"infinite | <number>\",\"single-animation-play-state\":\"running | paused\",\"single-timing-function\":\"linear | <cubic-bezier-timing-function> | <step-timing-function> | <frames-timing-function>\",\"single-transition\":\"<single-transition-timing-function> || [ none | <single-transition-property> ] || <time> || <time>\",\"single-transition-timing-function\":\"<single-timing-function>\",\"single-transition-property\":\"all | <custom-ident>\",\"size\":\"closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}\",\"step-timing-function\":\"step-start | step-end | steps( <integer> [, [ start | end ] ]? )\",\"symbol\":\"<string> | <image> | <custom-ident>\",\"target\":\"<target-counter()> | <target-counters()> | <target-text()>\",\"target-counter()\":\"target-counter( [ <string> | <url> ] , <custom-ident> , <counter-style>? )\",\"target-counters()\":\"target-counters( [ <string> | <url> ] , <custom-ident> , <string> , <counter-style>? )\",\"target-text()\":\"target-text( [ <string> | <url> ] , [ content | before | after | first-letter ]? )\",\"time-percentage\":\"<time> | <percentage>\",\"track-breadth\":\"<length-percentage> | <flex> | min-content | max-content | auto\",\"track-list\":\"[ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?\",\"track-repeat\":\"repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )\",\"track-size\":\"<track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )\",\"transform-function\":\"<matrix()> | <translate()> | <translateX()> | <translateY()> | <scale()> | <scaleX()> | <scaleY()> | <rotate()> | <skew()> | <skewX()> | <skewY()> | <matrix3d()> | <translate3d()> | <translateZ()> | <scale3d()> | <scaleZ()> | <rotate3d()> | <rotateX()> | <rotateY()> | <rotateZ()> | <perspective()>\",\"transform-list\":\"<transform-function>+\",\"translate()\":\"translate( <length-percentage> [, <length-percentage> ]? )\",\"translate3d()\":\"translate3d( <length-percentage> , <length-percentage> , <length> )\",\"translateX()\":\"translateX( <length-percentage> )\",\"translateY()\":\"translateY( <length-percentage> )\",\"translateZ()\":\"translateZ( <length> )\",\"type-or-unit\":\"string | integer | color | url | integer | number | length | angle | time | frequency | em | ex | px | rem | vw | vh | vmin | vmax | mm | q | cm | in | pt | pc | deg | grad | rad | ms | s | Hz | kHz | %\",\"viewport-length\":\"auto | <length-percentage>\",\"-legacy-gradient\":\"<-webkit-gradient()> | <-legacy-linear-gradient> | <-legacy-repeating-linear-gradient> | <-legacy-radial-gradient> | <-legacy-repeating-radial-gradient>\",\"-legacy-linear-gradient\":\"-moz-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-linear-gradient( <-legacy-linear-gradient-arguments> )\",\"-legacy-repeating-linear-gradient\":\"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )\",\"-legacy-linear-gradient-arguments\":\"[ <angle> | <side-or-corner> ]? , <color-stop-list>\",\"-legacy-radial-gradient\":\"-moz-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-radial-gradient( <-legacy-radial-gradient-arguments> )\",\"-legacy-repeating-radial-gradient\":\"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )\",\"-legacy-radial-gradient-arguments\":\"[ <position> , ]? [ [ [ <-legacy-radial-gradient-shape> || <-legacy-radial-gradient-size> ] | [ <length> | <percentage> ]{2} ] , ]? <color-stop-list>\",\"-legacy-radial-gradient-size\":\"closest-side | closest-corner | farthest-side | farthest-corner | contain | cover\",\"-legacy-radial-gradient-shape\":\"circle | ellipse\",\"-non-standard-font\":\"-apple-system-body | -apple-system-headline | -apple-system-subheadline | -apple-system-caption1 | -apple-system-caption2 | -apple-system-footnote | -apple-system-short-body | -apple-system-short-headline | -apple-system-short-subheadline | -apple-system-short-caption1 | -apple-system-short-footnote | -apple-system-tall-body\",\"-non-standard-color\":\"-moz-ButtonDefault | -moz-ButtonHoverFace | -moz-ButtonHoverText | -moz-CellHighlight | -moz-CellHighlightText | -moz-Combobox | -moz-ComboboxText | -moz-Dialog | -moz-DialogText | -moz-dragtargetzone | -moz-EvenTreeRow | -moz-Field | -moz-FieldText | -moz-html-CellHighlight | -moz-html-CellHighlightText | -moz-mac-accentdarkestshadow | -moz-mac-accentdarkshadow | -moz-mac-accentface | -moz-mac-accentlightesthighlight | -moz-mac-accentlightshadow | -moz-mac-accentregularhighlight | -moz-mac-accentregularshadow | -moz-mac-chrome-active | -moz-mac-chrome-inactive | -moz-mac-focusring | -moz-mac-menuselect | -moz-mac-menushadow | -moz-mac-menutextselect | -moz-MenuHover | -moz-MenuHoverText | -moz-MenuBarText | -moz-MenuBarHoverText | -moz-nativehyperlinktext | -moz-OddTreeRow | -moz-win-communicationstext | -moz-win-mediatext | -moz-activehyperlinktext | -moz-default-background-color | -moz-default-color | -moz-hyperlinktext | -moz-visitedhyperlinktext | -webkit-activelink | -webkit-focus-ring-color | -webkit-link | -webkit-text\",\"-non-standard-image-rendering\":\"optimize-contrast | -moz-crisp-edges | -o-crisp-edges | -webkit-optimize-contrast\",\"-non-standard-overflow\":\"-moz-scrollbars-none | -moz-scrollbars-horizontal | -moz-scrollbars-vertical | -moz-hidden-unscrollable\",\"-non-standard-width\":\"min-intrinsic | intrinsic | -moz-min-content | -moz-max-content | -webkit-min-content | -webkit-max-content\",\"-non-standard-word-break\":\"break-word\",\"-webkit-gradient()\":\"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point> | , <-webkit-gradient-radius> , <-webkit-gradient-point> ] [, <-webkit-gradient-radius> ]? [, <-webkit-gradient-color-stop> ]* )\",\"-webkit-gradient-color-stop\":\"from( <color> ) | color-stop( [ <number-zero-one> | <percentage> ] , <color> ) | to( <color> )\",\"-webkit-gradient-point\":\"[ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]\",\"-webkit-gradient-radius\":\"<length> | <percentage>\",\"-webkit-gradient-type\":\"linear | radial\",\"-webkit-mask-box-repeat\":\"repeat | stretch | round\",\"-webkit-mask-clip-style\":\"border | border-box | padding | padding-box | content | content-box | text\",\"-ms-filter\":\"[ <progid> | FlipH | FlipV ]+\",\"age\":\"child | young | old\",\"border-radius\":\"<length-percentage>{1,2}\",\"bottom\":\"<length> | auto\",\"generic-voice\":\"[ <age>? <gender> <integer>? ]\",\"gender\":\"male | female | neutral\",\"left\":\"<length> | auto\",\"mask-image\":\"<mask-reference>#\",\"name-repeat\":\"repeat( [ <positive-integer> | auto-fill ] , <line-names>+ )\",\"paint\":\"none | currentColor | <color> | <url> [ none | currentColor | <color> ]?\",\"path()\":\"path( <string> )\",\"right\":\"<length> | auto\",\"svg-length\":\"<percentage> | <length> | <number>\",\"svg-writing-mode\":\"lr-tb | rl-tb | tb-rl | lr | rl | tb\",\"top\":\"<length> | auto\",\"x\":\"<number>\",\"y\":\"<number>\"},\"properties\":{\"-ms-accelerator\":\"false | true\",\"-ms-block-progression\":\"tb | rl | bt | lr\",\"-ms-content-zoom-chaining\":\"none | chained\",\"-ms-content-zooming\":\"none | zoom\",\"-ms-content-zoom-limit\":\"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>\",\"-ms-content-zoom-limit-max\":\"<percentage>\",\"-ms-content-zoom-limit-min\":\"<percentage>\",\"-ms-content-zoom-snap\":\"<'-ms-content-zoom-snap-type'> || <'-ms-content-zoom-snap-points'>\",\"-ms-content-zoom-snap-points\":\"snapInterval( <percentage> , <percentage> ) | snapList( <percentage># )\",\"-ms-content-zoom-snap-type\":\"none | proximity | mandatory\",\"-ms-filter\":\"<string>\",\"-ms-flow-from\":\"[ none | <custom-ident> ]#\",\"-ms-flow-into\":\"[ none | <custom-ident> ]#\",\"-ms-high-contrast-adjust\":\"auto | none\",\"-ms-hyphenate-limit-chars\":\"auto | <integer>{1,3}\",\"-ms-hyphenate-limit-lines\":\"no-limit | <integer>\",\"-ms-hyphenate-limit-zone\":\"<percentage> | <length>\",\"-ms-ime-align\":\"auto | after\",\"-ms-overflow-style\":\"auto | none | scrollbar | -ms-autohiding-scrollbar\",\"-ms-scrollbar-3dlight-color\":\"<color>\",\"-ms-scrollbar-arrow-color\":\"<color>\",\"-ms-scrollbar-base-color\":\"<color>\",\"-ms-scrollbar-darkshadow-color\":\"<color>\",\"-ms-scrollbar-face-color\":\"<color>\",\"-ms-scrollbar-highlight-color\":\"<color>\",\"-ms-scrollbar-shadow-color\":\"<color>\",\"-ms-scrollbar-track-color\":\"<color>\",\"-ms-scroll-chaining\":\"chained | none\",\"-ms-scroll-limit\":\"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>\",\"-ms-scroll-limit-x-max\":\"auto | <length>\",\"-ms-scroll-limit-x-min\":\"<length>\",\"-ms-scroll-limit-y-max\":\"auto | <length>\",\"-ms-scroll-limit-y-min\":\"<length>\",\"-ms-scroll-rails\":\"none | railed\",\"-ms-scroll-snap-points-x\":\"snapInterval( <length-percentage> , <length-percentage> ) | snapList( <length-percentage># )\",\"-ms-scroll-snap-points-y\":\"snapInterval( <length-percentage> , <length-percentage> ) | snapList( <length-percentage># )\",\"-ms-scroll-snap-type\":\"none | proximity | mandatory\",\"-ms-scroll-snap-x\":\"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>\",\"-ms-scroll-snap-y\":\"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>\",\"-ms-scroll-translation\":\"none | vertical-to-horizontal\",\"-ms-text-autospace\":\"none | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space\",\"-ms-touch-select\":\"grippers | none\",\"-ms-user-select\":\"none | element | text\",\"-ms-wrap-flow\":\"auto | both | start | end | maximum | clear\",\"-ms-wrap-margin\":\"<length>\",\"-ms-wrap-through\":\"wrap | none\",\"-moz-appearance\":\"none | button | button-arrow-down | button-arrow-next | button-arrow-previous | button-arrow-up | button-bevel | button-focus | caret | checkbox | checkbox-container | checkbox-label | checkmenuitem | dualbutton | groupbox | listbox | listitem | menuarrow | menubar | menucheckbox | menuimage | menuitem | menuitemtext | menulist | menulist-button | menulist-text | menulist-textfield | menupopup | menuradio | menuseparator | meterbar | meterchunk | progressbar | progressbar-vertical | progresschunk | progresschunk-vertical | radio | radio-container | radio-label | radiomenuitem | range | range-thumb | resizer | resizerpanel | scale-horizontal | scalethumbend | scalethumb-horizontal | scalethumbstart | scalethumbtick | scalethumb-vertical | scale-vertical | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | separator | sheet | spinner | spinner-downbutton | spinner-textfield | spinner-upbutton | splitter | statusbar | statusbarpanel | tab | tabpanel | tabpanels | tab-scroll-arrow-back | tab-scroll-arrow-forward | textfield | textfield-multiline | toolbar | toolbarbutton | toolbarbutton-dropdown | toolbargripper | toolbox | tooltip | treeheader | treeheadercell | treeheadersortarrow | treeitem | treeline | treetwisty | treetwistyopen | treeview | -moz-mac-unified-toolbar | -moz-win-borderless-glass | -moz-win-browsertabbar-toolbox | -moz-win-communicationstext | -moz-win-communications-toolbox | -moz-win-exclude-glass | -moz-win-glass | -moz-win-mediatext | -moz-win-media-toolbox | -moz-window-button-box | -moz-window-button-box-maximized | -moz-window-button-close | -moz-window-button-maximize | -moz-window-button-minimize | -moz-window-button-restore | -moz-window-frame-bottom | -moz-window-frame-left | -moz-window-frame-right | -moz-window-titlebar | -moz-window-titlebar-maximized\",\"-moz-binding\":\"<url> | none\",\"-moz-border-bottom-colors\":\"<color>+ | none\",\"-moz-border-left-colors\":\"<color>+ | none\",\"-moz-border-right-colors\":\"<color>+ | none\",\"-moz-border-top-colors\":\"<color>+ | none\",\"-moz-context-properties\":\"none | [ fill | fill-opacity | stroke | stroke-opacity ]#\",\"-moz-float-edge\":\"border-box | content-box | margin-box | padding-box\",\"-moz-force-broken-image-icon\":\"<integer>\",\"-moz-image-region\":\"<shape> | auto\",\"-moz-orient\":\"inline | block | horizontal | vertical\",\"-moz-outline-radius\":\"<outline-radius>{1,4} [ / <outline-radius>{1,4} ]?\",\"-moz-outline-radius-bottomleft\":\"<outline-radius>\",\"-moz-outline-radius-bottomright\":\"<outline-radius>\",\"-moz-outline-radius-topleft\":\"<outline-radius>\",\"-moz-outline-radius-topright\":\"<outline-radius>\",\"-moz-stack-sizing\":\"ignore | stretch-to-fit\",\"-moz-text-blink\":\"none | blink\",\"-moz-user-focus\":\"ignore | normal | select-after | select-before | select-menu | select-same | select-all | none\",\"-moz-user-input\":\"auto | none | enabled | disabled\",\"-moz-user-modify\":\"read-only | read-write | write-only\",\"-moz-window-dragging\":\"drag | no-drag\",\"-moz-window-shadow\":\"default | menu | tooltip | sheet | none\",\"-webkit-appearance\":\"none | button | button-bevel | caps-lock-indicator | caret | checkbox | default-button | listbox | listitem | media-fullscreen-button | media-mute-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | push-button | radio | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbargripper-horizontal | scrollbargripper-vertical | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield\",\"-webkit-border-before\":\"<'border-width'> || <'border-style'> || <'color'>\",\"-webkit-border-before-color\":\"<'color'>\",\"-webkit-border-before-style\":\"<'border-style'>\",\"-webkit-border-before-width\":\"<'border-width'>\",\"-webkit-box-reflect\":\"[ above | below | right | left ]? <length>? <image>?\",\"-webkit-mask\":\"[ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <box> | border | padding | content | text ] || [ <box> | border | padding | content ] ]#\",\"-webkit-mask-attachment\":\"<attachment>#\",\"-webkit-mask-clip\":\"<-webkit-mask-clip-style> [, <-webkit-mask-clip-style> ]*\",\"-webkit-mask-composite\":\"<composite-style>#\",\"-webkit-mask-image\":\"<mask-reference>#\",\"-webkit-mask-origin\":\"[ <box> | border | padding | content ]#\",\"-webkit-mask-position\":\"<position>#\",\"-webkit-mask-position-x\":\"[ <length-percentage> | left | center | right ]#\",\"-webkit-mask-position-y\":\"[ <length-percentage> | top | center | bottom ]#\",\"-webkit-mask-repeat\":\"<repeat-style>#\",\"-webkit-mask-repeat-x\":\"repeat | no-repeat | space | round\",\"-webkit-mask-repeat-y\":\"repeat | no-repeat | space | round\",\"-webkit-mask-size\":\"<bg-size>#\",\"-webkit-overflow-scrolling\":\"auto | touch\",\"-webkit-tap-highlight-color\":\"<color>\",\"-webkit-text-fill-color\":\"<color>\",\"-webkit-text-stroke\":\"<length> || <color>\",\"-webkit-text-stroke-color\":\"<color>\",\"-webkit-text-stroke-width\":\"<length>\",\"-webkit-touch-callout\":\"default | none\",\"-webkit-user-modify\":\"read-only | read-write | read-write-plaintext-only\",\"align-content\":\"normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>\",\"align-items\":\"normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]\",\"align-self\":\"auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>\",\"all\":\"initial | inherit | unset | revert\",\"animation\":\"<single-animation>#\",\"animation-delay\":\"<time>#\",\"animation-direction\":\"<single-animation-direction>#\",\"animation-duration\":\"<time>#\",\"animation-fill-mode\":\"<single-animation-fill-mode>#\",\"animation-iteration-count\":\"<single-animation-iteration-count>#\",\"animation-name\":\"[ none | <keyframes-name> ]#\",\"animation-play-state\":\"<single-animation-play-state>#\",\"animation-timing-function\":\"<single-timing-function>#\",\"appearance\":\"auto | none\",\"azimuth\":\"<angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards\",\"backdrop-filter\":\"none | <filter-function-list>\",\"backface-visibility\":\"visible | hidden\",\"background\":\"[ <bg-layer> , ]* <final-bg-layer>\",\"background-attachment\":\"<attachment>#\",\"background-blend-mode\":\"<blend-mode>#\",\"background-clip\":\"<box>#\",\"background-color\":\"<color>\",\"background-image\":\"<bg-image>#\",\"background-origin\":\"<box>#\",\"background-position\":\"<bg-position>#\",\"background-position-x\":\"[ center | [ left | right | x-start | x-end ]? <length-percentage>? ]#\",\"background-position-y\":\"[ center | [ top | bottom | y-start | y-end ]? <length-percentage>? ]#\",\"background-repeat\":\"<repeat-style>#\",\"background-size\":\"<bg-size>#\",\"block-overflow\":\"clip | ellipsis | <string>\",\"block-size\":\"<'width'>\",\"border\":\"<br-width> || <br-style> || <color>\",\"border-block-end\":\"<'border-width'> || <'border-style'> || <'color'>\",\"border-block-end-color\":\"<'color'>\",\"border-block-end-style\":\"<'border-style'>\",\"border-block-end-width\":\"<'border-width'>\",\"border-block-start\":\"<'border-width'> || <'border-style'> || <'color'>\",\"border-block-start-color\":\"<'color'>\",\"border-block-start-style\":\"<'border-style'>\",\"border-block-start-width\":\"<'border-width'>\",\"border-bottom\":\"<br-width> || <br-style> || <color>\",\"border-bottom-color\":\"<color>\",\"border-bottom-left-radius\":\"<length-percentage>{1,2}\",\"border-bottom-right-radius\":\"<length-percentage>{1,2}\",\"border-bottom-style\":\"<br-style>\",\"border-bottom-width\":\"<br-width>\",\"border-collapse\":\"collapse | separate\",\"border-color\":\"<color>{1,4}\",\"border-image\":\"<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>\",\"border-image-outset\":\"[ <length> | <number> ]{1,4}\",\"border-image-repeat\":\"[ stretch | repeat | round | space ]{1,2}\",\"border-image-slice\":\"<number-percentage>{1,4} && fill?\",\"border-image-source\":\"none | <image>\",\"border-image-width\":\"[ <length-percentage> | <number> | auto ]{1,4}\",\"border-inline-end\":\"<'border-width'> || <'border-style'> || <'color'>\",\"border-inline-end-color\":\"<'color'>\",\"border-inline-end-style\":\"<'border-style'>\",\"border-inline-end-width\":\"<'border-width'>\",\"border-inline-start\":\"<'border-width'> || <'border-style'> || <'color'>\",\"border-inline-start-color\":\"<'color'>\",\"border-inline-start-style\":\"<'border-style'>\",\"border-inline-start-width\":\"<'border-width'>\",\"border-left\":\"<br-width> || <br-style> || <color>\",\"border-left-color\":\"<color>\",\"border-left-style\":\"<br-style>\",\"border-left-width\":\"<br-width>\",\"border-radius\":\"<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?\",\"border-right\":\"<br-width> || <br-style> || <color>\",\"border-right-color\":\"<color>\",\"border-right-style\":\"<br-style>\",\"border-right-width\":\"<br-width>\",\"border-spacing\":\"<length> <length>?\",\"border-style\":\"<br-style>{1,4}\",\"border-top\":\"<br-width> || <br-style> || <color>\",\"border-top-color\":\"<color>\",\"border-top-left-radius\":\"<length-percentage>{1,2}\",\"border-top-right-radius\":\"<length-percentage>{1,2}\",\"border-top-style\":\"<br-style>\",\"border-top-width\":\"<br-width>\",\"border-width\":\"<br-width>{1,4}\",\"bottom\":\"<length> | <percentage> | auto\",\"box-align\":\"start | center | end | baseline | stretch\",\"box-decoration-break\":\"slice | clone\",\"box-direction\":\"normal | reverse | inherit\",\"box-flex\":\"<number>\",\"box-flex-group\":\"<integer>\",\"box-lines\":\"single | multiple\",\"box-ordinal-group\":\"<integer>\",\"box-orient\":\"horizontal | vertical | inline-axis | block-axis | inherit\",\"box-pack\":\"start | center | end | justify\",\"box-shadow\":\"none | <shadow>#\",\"box-sizing\":\"content-box | border-box\",\"break-after\":\"auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region\",\"break-before\":\"auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region\",\"break-inside\":\"auto | avoid | avoid-page | avoid-column | avoid-region\",\"caption-side\":\"top | bottom | block-start | block-end | inline-start | inline-end\",\"caret-color\":\"auto | <color>\",\"clear\":\"none | left | right | both | inline-start | inline-end\",\"clip\":\"<shape> | auto\",\"clip-path\":\"<clip-source> | [ <basic-shape> || <geometry-box> ] | none\",\"color\":\"<color>\",\"color-adjust\":\"economy | exact\",\"column-count\":\"<integer> | auto\",\"column-fill\":\"auto | balance | balance-all\",\"column-gap\":\"normal | <length-percentage>\",\"column-rule\":\"<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>\",\"column-rule-color\":\"<color>\",\"column-rule-style\":\"<'border-style'>\",\"column-rule-width\":\"<'border-width'>\",\"column-span\":\"none | all\",\"column-width\":\"<length> | auto\",\"columns\":\"<'column-width'> || <'column-count'>\",\"contain\":\"none | strict | content | [ size || layout || style || paint ]\",\"content\":\"normal | none | [ <content-replacement> | <content-list> ] [ / <string> ]?\",\"counter-increment\":\"[ <custom-ident> <integer>? ]+ | none\",\"counter-reset\":\"[ <custom-ident> <integer>? ]+ | none\",\"cursor\":\"[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing | hand | -webkit-grab | -webkit-grabbing | -webkit-zoom-in | -webkit-zoom-out | -moz-grab | -moz-grabbing | -moz-zoom-in | -moz-zoom-out ] ]\",\"direction\":\"ltr | rtl\",\"display\":\"none | inline | block | list-item | inline-list-item | inline-block | inline-table | table | table-cell | table-column | table-column-group | table-footer-group | table-header-group | table-row | table-row-group | flex | inline-flex | grid | inline-grid | run-in | ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container | contents | -ms-flexbox | -ms-inline-flexbox | -ms-grid | -ms-inline-grid | -webkit-flex | -webkit-inline-flex | -webkit-box | -webkit-inline-box | -moz-inline-stack | -moz-box | -moz-inline-box\",\"empty-cells\":\"show | hide\",\"filter\":\"none | <filter-function-list> | <-ms-filter>\",\"flex\":\"none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]\",\"flex-basis\":\"content | <'width'>\",\"flex-direction\":\"row | row-reverse | column | column-reverse\",\"flex-flow\":\"<'flex-direction'> || <'flex-wrap'>\",\"flex-grow\":\"<number>\",\"flex-shrink\":\"<number>\",\"flex-wrap\":\"nowrap | wrap | wrap-reverse\",\"float\":\"left | right | none | inline-start | inline-end\",\"font\":\"[ [ <'font-style'> || <font-variant-css21> || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | <-non-standard-font>\",\"font-family\":\"[ <family-name> | <generic-family> ]#\",\"font-feature-settings\":\"normal | <feature-tag-value>#\",\"font-kerning\":\"auto | normal | none\",\"font-language-override\":\"normal | <string>\",\"font-optical-sizing\":\"auto | none\",\"font-variation-settings\":\"normal | [ <string> <number> ]#\",\"font-size\":\"<absolute-size> | <relative-size> | <length-percentage>\",\"font-size-adjust\":\"none | <number>\",\"font-stretch\":\"normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded\",\"font-style\":\"normal | italic | oblique\",\"font-synthesis\":\"none | [ weight || style ]\",\"font-variant\":\"normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]\",\"font-variant-alternates\":\"normal | [ stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) ]\",\"font-variant-caps\":\"normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps\",\"font-variant-east-asian\":\"normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]\",\"font-variant-ligatures\":\"normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]\",\"font-variant-numeric\":\"normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]\",\"font-variant-position\":\"normal | sub | super\",\"font-weight\":\"normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900\",\"gap\":\"<'row-gap'> <'column-gap'>?\",\"grid\":\"<'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? | [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>\",\"grid-area\":\"<grid-line> [ / <grid-line> ]{0,3}\",\"grid-auto-columns\":\"<track-size>+\",\"grid-auto-flow\":\"[ row | column ] || dense\",\"grid-auto-rows\":\"<track-size>+\",\"grid-column\":\"<grid-line> [ / <grid-line> ]?\",\"grid-column-end\":\"<grid-line>\",\"grid-column-gap\":\"<length-percentage>\",\"grid-column-start\":\"<grid-line>\",\"grid-gap\":\"<'grid-row-gap'> <'grid-column-gap'>?\",\"grid-row\":\"<grid-line> [ / <grid-line> ]?\",\"grid-row-end\":\"<grid-line>\",\"grid-row-gap\":\"<length-percentage>\",\"grid-row-start\":\"<grid-line>\",\"grid-template\":\"none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?\",\"grid-template-areas\":\"none | <string>+\",\"grid-template-columns\":\"none | <track-list> | <auto-track-list>\",\"grid-template-rows\":\"none | <track-list> | <auto-track-list>\",\"hanging-punctuation\":\"none | [ first || [ force-end | allow-end ] || last ]\",\"height\":\"[ <length> | <percentage> ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto\",\"hyphens\":\"none | manual | auto\",\"image-orientation\":\"from-image | <angle> | [ <angle>? flip ]\",\"image-rendering\":\"auto | crisp-edges | pixelated | optimizeSpeed | optimizeQuality | <-non-standard-image-rendering>\",\"image-resolution\":\"[ from-image || <resolution> ] && snap?\",\"ime-mode\":\"auto | normal | active | inactive | disabled\",\"initial-letter\":\"normal | [ <number> <integer>? ]\",\"initial-letter-align\":\"[ auto | alphabetic | hanging | ideographic ]\",\"inline-size\":\"<'width'>\",\"isolation\":\"auto | isolate\",\"justify-content\":\"normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]\",\"justify-items\":\"normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]\",\"justify-self\":\"auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]\",\"left\":\"<length> | <percentage> | auto\",\"letter-spacing\":\"normal | <length-percentage>\",\"line-break\":\"auto | loose | normal | strict\",\"line-clamp\":\"none | <integer>\",\"line-height\":\"normal | <number> | <length> | <percentage>\",\"line-height-step\":\"none | <length>\",\"list-style\":\"<'list-style-type'> || <'list-style-position'> || <'list-style-image'>\",\"list-style-image\":\"<url> | none\",\"list-style-position\":\"inside | outside\",\"list-style-type\":\"<counter-style> | <string> | none\",\"margin\":\"[ <length> | <percentage> | auto ]{1,4}\",\"margin-block-end\":\"<'margin-left'>\",\"margin-block-start\":\"<'margin-left'>\",\"margin-bottom\":\"<length> | <percentage> | auto\",\"margin-inline-end\":\"<'margin-left'>\",\"margin-inline-start\":\"<'margin-left'>\",\"margin-left\":\"<length> | <percentage> | auto\",\"margin-right\":\"<length> | <percentage> | auto\",\"margin-top\":\"<length> | <percentage> | auto\",\"mask\":\"<mask-layer>#\",\"mask-border\":\"<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>\",\"mask-border-mode\":\"luminance | alpha\",\"mask-border-outset\":\"[ <length> | <number> ]{1,4}\",\"mask-border-repeat\":\"[ stretch | repeat | round | space ]{1,2}\",\"mask-border-slice\":\"<number-percentage>{1,4} fill?\",\"mask-border-source\":\"none | <image>\",\"mask-border-width\":\"[ <length-percentage> | <number> | auto ]{1,4}\",\"mask-clip\":\"[ <geometry-box> | no-clip ]#\",\"mask-composite\":\"<compositing-operator>#\",\"mask-image\":\"<mask-reference>#\",\"mask-mode\":\"<masking-mode>#\",\"mask-origin\":\"<geometry-box>#\",\"mask-position\":\"<position>#\",\"mask-repeat\":\"<repeat-style>#\",\"mask-size\":\"<bg-size>#\",\"mask-type\":\"luminance | alpha\",\"max-block-size\":\"<'max-width'>\",\"max-height\":\"<length> | <percentage> | none | max-content | min-content | fit-content | fill-available\",\"max-inline-size\":\"<'max-width'>\",\"max-lines\":\"none | <integer>\",\"max-width\":\"<length> | <percentage> | none | max-content | min-content | fit-content | fill-available | <-non-standard-width>\",\"min-block-size\":\"<'min-width'>\",\"min-height\":\"<length> | <percentage> | auto | max-content | min-content | fit-content | fill-available\",\"min-inline-size\":\"<'min-width'>\",\"min-width\":\"<length> | <percentage> | auto | max-content | min-content | fit-content | fill-available | <-non-standard-width>\",\"mix-blend-mode\":\"<blend-mode>\",\"object-fit\":\"fill | contain | cover | none | scale-down\",\"object-position\":\"<position>\",\"offset\":\"[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?\",\"offset-anchor\":\"auto | <position>\",\"offset-block-end\":\"<'left'>\",\"offset-block-start\":\"<'left'>\",\"offset-inline-end\":\"<'left'>\",\"offset-inline-start\":\"<'left'>\",\"offset-distance\":\"<length-percentage>\",\"offset-path\":\"none | ray( [ <angle> && <size>? && contain? ] ) | <path()> | <url> | [ <basic-shape> || <geometry-box> ]\",\"offset-position\":\"auto | <position>\",\"offset-rotate\":\"[ auto | reverse ] || <angle>\",\"opacity\":\"<number-zero-one>\",\"order\":\"<integer>\",\"orphans\":\"<integer>\",\"outline\":\"[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]\",\"outline-color\":\"<color> | invert\",\"outline-offset\":\"<length>\",\"outline-style\":\"auto | <br-style>\",\"outline-width\":\"<br-width>\",\"overflow\":\"visible | hidden | scroll | auto | <-non-standard-overflow>\",\"overflow-anchor\":\"auto | none\",\"overflow-block\":\"<'overflow'>\",\"overflow-clip-box\":\"padding-box | content-box\",\"overflow-inline\":\"<'overflow'>\",\"overflow-wrap\":\"normal | break-word\",\"overflow-x\":\"visible | hidden | clip | scroll | auto\",\"overflow-y\":\"visible | hidden | clip | scroll | auto\",\"overscroll-behavior\":\"[ contain | none | auto ]{1,2}\",\"overscroll-behavior-x\":\"contain | none | auto\",\"overscroll-behavior-y\":\"contain | none | auto\",\"padding\":\"[ <length> | <percentage> ]{1,4}\",\"padding-block-end\":\"<'padding-left'>\",\"padding-block-start\":\"<'padding-left'>\",\"padding-bottom\":\"<length> | <percentage>\",\"padding-inline-end\":\"<'padding-left'>\",\"padding-inline-start\":\"<'padding-left'>\",\"padding-left\":\"<length> | <percentage>\",\"padding-right\":\"<length> | <percentage>\",\"padding-top\":\"<length> | <percentage>\",\"page-break-after\":\"auto | always | avoid | left | right | recto | verso\",\"page-break-before\":\"auto | always | avoid | left | right | recto | verso\",\"page-break-inside\":\"auto | avoid\",\"paint-order\":\"normal | [ fill || stroke || markers ]\",\"perspective\":\"none | <length>\",\"perspective-origin\":\"<position>\",\"place-content\":\"<'align-content'> <'justify-content'>?\",\"pointer-events\":\"auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit\",\"position\":\"static | relative | absolute | sticky | fixed | -webkit-sticky\",\"quotes\":\"none | [ <string> <string> ]+\",\"resize\":\"none | both | horizontal | vertical\",\"right\":\"<length> | <percentage> | auto\",\"rotate\":\"none | [ x | y | z | <number>{3} ]? && <angle>\",\"row-gap\":\"normal | <length-percentage>\",\"ruby-align\":\"start | center | space-between | space-around\",\"ruby-merge\":\"separate | collapse | auto\",\"ruby-position\":\"over | under | inter-character\",\"scale\":\"none | <number>{1,3}\",\"scroll-behavior\":\"auto | smooth\",\"scroll-snap-coordinate\":\"none | <position>#\",\"scroll-snap-destination\":\"<position>\",\"scroll-snap-points-x\":\"none | repeat( <length-percentage> )\",\"scroll-snap-points-y\":\"none | repeat( <length-percentage> )\",\"scroll-snap-type\":\"none | mandatory | proximity\",\"scroll-snap-type-x\":\"none | mandatory | proximity\",\"scroll-snap-type-y\":\"none | mandatory | proximity\",\"shape-image-threshold\":\"<number>\",\"shape-margin\":\"<length-percentage>\",\"shape-outside\":\"none | <shape-box> || <basic-shape> | <image>\",\"tab-size\":\"<integer> | <length>\",\"table-layout\":\"auto | fixed\",\"text-align\":\"start | end | left | right | center | justify | match-parent\",\"text-align-last\":\"auto | start | end | left | right | center | justify\",\"text-combine-upright\":\"none | all | [ digits <integer>? ]\",\"text-decoration\":\"<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'>\",\"text-decoration-color\":\"<color>\",\"text-decoration-line\":\"none | [ underline || overline || line-through || blink ]\",\"text-decoration-skip\":\"none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]\",\"text-decoration-skip-ink\":\"auto | none\",\"text-decoration-style\":\"solid | double | dotted | dashed | wavy\",\"text-emphasis\":\"<'text-emphasis-style'> || <'text-emphasis-color'>\",\"text-emphasis-color\":\"<color>\",\"text-emphasis-position\":\"[ over | under ] && [ right | left ]\",\"text-emphasis-style\":\"none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>\",\"text-indent\":\"<length-percentage> && hanging? && each-line?\",\"text-justify\":\"auto | inter-character | inter-word | none\",\"text-orientation\":\"mixed | upright | sideways\",\"text-overflow\":\"[ clip | ellipsis | <string> ]{1,2}\",\"text-rendering\":\"auto | optimizeSpeed | optimizeLegibility | geometricPrecision\",\"text-shadow\":\"none | <shadow-t>#\",\"text-size-adjust\":\"none | auto | <percentage>\",\"text-transform\":\"none | capitalize | uppercase | lowercase | full-width\",\"text-underline-position\":\"auto | [ under || [ left | right ] ]\",\"top\":\"<length> | <percentage> | auto\",\"touch-action\":\"auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation\",\"transform\":\"none | <transform-list>\",\"transform-box\":\"border-box | fill-box | view-box\",\"transform-origin\":\"[ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>? | [ <length-percentage> | left | center | right | top | bottom ]\",\"transform-style\":\"flat | preserve-3d\",\"transition\":\"<single-transition>#\",\"transition-delay\":\"<time>#\",\"transition-duration\":\"<time>#\",\"transition-property\":\"none | <single-transition-property>#\",\"transition-timing-function\":\"<single-transition-timing-function>#\",\"translate\":\"none | <length-percentage> [ <length-percentage> <length>? ]?\",\"unicode-bidi\":\"normal | embed | isolate | bidi-override | isolate-override | plaintext | -moz-isolate | -moz-isolate-override | -moz-plaintext | -webkit-isolate\",\"user-select\":\"auto | text | none | contain | all\",\"vertical-align\":\"baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>\",\"visibility\":\"visible | hidden | collapse\",\"white-space\":\"normal | pre | nowrap | pre-wrap | pre-line\",\"widows\":\"<integer>\",\"width\":\"[ <length> | <percentage> ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto\",\"will-change\":\"auto | <animateable-feature>#\",\"word-break\":\"normal | break-all | keep-all | <-non-standard-word-break>\",\"word-spacing\":\"normal | <length-percentage>\",\"word-wrap\":\"normal | break-word\",\"writing-mode\":\"horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr | <svg-writing-mode>\",\"z-index\":\"auto | <integer>\",\"zoom\":\"normal | reset | <number> | <percentage>\",\"-moz-background-clip\":\"padding | border\",\"-moz-border-radius-bottomleft\":\"<'border-bottom-left-radius'>\",\"-moz-border-radius-bottomright\":\"<'border-bottom-right-radius'>\",\"-moz-border-radius-topleft\":\"<'border-top-left-radius'>\",\"-moz-border-radius-topright\":\"<'border-bottom-right-radius'>\",\"-moz-osx-font-smoothing\":\"auto | grayscale\",\"-moz-user-select\":\"none | text | all | -moz-none\",\"-ms-flex-align\":\"start | end | center | baseline | stretch\",\"-ms-flex-item-align\":\"auto | start | end | center | baseline | stretch\",\"-ms-flex-line-pack\":\"start | end | center | justify | distribute | stretch\",\"-ms-flex-negative\":\"<'flex-shrink'>\",\"-ms-flex-pack\":\"start | end | center | justify | distribute\",\"-ms-flex-order\":\"<integer>\",\"-ms-flex-positive\":\"<'flex-grow'>\",\"-ms-flex-preferred-size\":\"<'flex-basis'>\",\"-ms-interpolation-mode\":\"nearest-neighbor | bicubic\",\"-ms-grid-column-align\":\"start | end | center | stretch\",\"-ms-grid-row-align\":\"start | end | center | stretch\",\"-webkit-background-clip\":\"[ <box> | border | padding | content | text ]#\",\"-webkit-column-break-after\":\"always | auto | avoid\",\"-webkit-column-break-before\":\"always | auto | avoid\",\"-webkit-column-break-inside\":\"always | auto | avoid\",\"-webkit-font-smoothing\":\"auto | none | antialiased | subpixel-antialiased\",\"-webkit-line-clamp\":\"<positive-integer>\",\"-webkit-mask-box-image\":\"[ <url> | <gradient> | none ] [ <length-percentage>{4} <-webkit-mask-box-repeat>{2} ]?\",\"-webkit-print-color-adjust\":\"economy | exact\",\"-webkit-text-security\":\"none | circle | disc | square\",\"-webkit-user-drag\":\"none | element | auto\",\"-webkit-user-select\":\"auto | none | text | all\",\"alignment-baseline\":\"auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical\",\"baseline-shift\":\"baseline | sub | super | <svg-length>\",\"behavior\":\"<url>+\",\"clip-rule\":\"nonzero | evenodd\",\"cue\":\"<'cue-before'> <'cue-after'>?\",\"cue-after\":\"<url> <decibel>? | none\",\"cue-before\":\"<url> <decibel>? | none\",\"dominant-baseline\":\"auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge\",\"fill\":\"<paint>\",\"fill-opacity\":\"<number-zero-one>\",\"fill-rule\":\"nonzero | evenodd\",\"glyph-orientation-horizontal\":\"<angle>\",\"glyph-orientation-vertical\":\"<angle>\",\"kerning\":\"auto | <svg-length>\",\"marker\":\"none | <url>\",\"marker-end\":\"none | <url>\",\"marker-mid\":\"none | <url>\",\"marker-start\":\"none | <url>\",\"pause\":\"<'pause-before'> <'pause-after'>?\",\"pause-after\":\"<time> | none | x-weak | weak | medium | strong | x-strong\",\"pause-before\":\"<time> | none | x-weak | weak | medium | strong | x-strong\",\"rest\":\"<'rest-before'> <'rest-after'>?\",\"rest-after\":\"<time> | none | x-weak | weak | medium | strong | x-strong\",\"rest-before\":\"<time> | none | x-weak | weak | medium | strong | x-strong\",\"shape-rendering\":\"auto | optimizeSpeed | crispEdges | geometricPrecision\",\"src\":\"[ <url> [ format( <string># ) ]? | local( <family-name> ) ]#\",\"speak\":\"auto | none | normal\",\"speak-as\":\"normal | spell-out || digits || [ literal-punctuation | no-punctuation ]\",\"stroke\":\"<paint>\",\"stroke-dasharray\":\"none | [ <svg-length>+ ]#\",\"stroke-dashoffset\":\"<svg-length>\",\"stroke-linecap\":\"butt | round | square\",\"stroke-linejoin\":\"miter | round | bevel\",\"stroke-miterlimit\":\"<number-one-or-greater>\",\"stroke-opacity\":\"<number-zero-one>\",\"stroke-width\":\"<svg-length>\",\"text-anchor\":\"start | middle | end\",\"unicode-range\":\"<unicode-range>#\",\"voice-balance\":\"<number> | left | center | right | leftwards | rightwards\",\"voice-duration\":\"auto | <time>\",\"voice-family\":\"[ [ <family-name> | <generic-voice> ] , ]* [ <family-name> | <generic-voice> ] | preserve\",\"voice-pitch\":\"<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]\",\"voice-range\":\"<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]\",\"voice-rate\":\"[ normal | x-slow | slow | medium | fast | x-fast ] || <percentage>\",\"voice-stress\":\"normal | strong | moderate | none | reduced\",\"voice-volume\":\"silent | [ [ x-soft | soft | medium | loud | x-loud ] || <decibel> ]\"}}");
- }),
- (function(module, exports, __webpack_require__) {
- var cmpChar = __webpack_require__(0).cmpChar;
- var isNumber = __webpack_require__(0).isNumber;
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBER = TYPE.Number;
- var PLUSSIGN = TYPE.PlusSign;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var N = 110;
- var DISALLOW_SIGN = true;
- var ALLOW_SIGN = false;
- function checkTokenIsInteger(scanner, disallowSign) {
- var pos = scanner.tokenStart;
- if (scanner.source.charCodeAt(pos) === PLUSSIGN ||
- scanner.source.charCodeAt(pos) === HYPHENMINUS) {
- if (disallowSign) {
- scanner.error();
- }
- pos++;
- }
- for (; pos < scanner.tokenEnd; pos++) {
- if (!isNumber(scanner.source.charCodeAt(pos))) {
- scanner.error('Unexpected input', pos);
- }
- }
- }
- module.exports = {
- name: 'AnPlusB',
- structure: {
- a: [String, null],
- b: [String, null]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var end = start;
- var prefix = '';
- var a = null;
- var b = null;
- if (this.scanner.tokenType === NUMBER ||
- this.scanner.tokenType === PLUSSIGN) {
- checkTokenIsInteger(this.scanner, ALLOW_SIGN);
- prefix = this.scanner.getTokenValue();
- this.scanner.next();
- end = this.scanner.tokenStart;
- }
- if (this.scanner.tokenType === IDENTIFIER) {
- var bStart = this.scanner.tokenStart;
- if (cmpChar(this.scanner.source, bStart, HYPHENMINUS)) {
- if (prefix === '') {
- prefix = '-';
- bStart++;
- } else {
- this.scanner.error('Unexpected hyphen minus');
- }
- }
- if (!cmpChar(this.scanner.source, bStart, N)) {
- this.scanner.error();
- }
- a = prefix === '' ? '1' :
- prefix === '+' ? '+1' :
- prefix === '-' ? '-1' :
- prefix;
- var len = this.scanner.tokenEnd - bStart;
- if (len > 1) {
-
- if (this.scanner.source.charCodeAt(bStart + 1) !== HYPHENMINUS) {
- this.scanner.error('Unexpected input', bStart + 1);
- }
- if (len > 2) {
-
- this.scanner.tokenStart = bStart + 2;
- } else {
-
- this.scanner.next();
- this.scanner.skipSC();
- }
- checkTokenIsInteger(this.scanner, DISALLOW_SIGN);
- b = '-' + this.scanner.getTokenValue();
- this.scanner.next();
- end = this.scanner.tokenStart;
- } else {
- prefix = '';
- this.scanner.next();
- end = this.scanner.tokenStart;
- this.scanner.skipSC();
- if (this.scanner.tokenType === HYPHENMINUS ||
- this.scanner.tokenType === PLUSSIGN) {
- prefix = this.scanner.getTokenValue();
- this.scanner.next();
- this.scanner.skipSC();
- }
- if (this.scanner.tokenType === NUMBER) {
- checkTokenIsInteger(this.scanner, prefix !== '');
- if (!isNumber(this.scanner.source.charCodeAt(this.scanner.tokenStart))) {
- prefix = this.scanner.source.charAt(this.scanner.tokenStart);
- this.scanner.tokenStart++;
- }
- if (prefix === '') {
-
- this.scanner.error();
- } else if (prefix === '+') {
-
- prefix = '';
- }
- b = prefix + this.scanner.getTokenValue();
- this.scanner.next();
- end = this.scanner.tokenStart;
- } else {
- if (prefix) {
- this.scanner.eat(NUMBER);
- }
- }
- }
- } else {
- if (prefix === '' || prefix === '+') {
- this.scanner.error(
- 'Number or identifier is expected',
- this.scanner.tokenStart + (
- this.scanner.tokenType === PLUSSIGN ||
- this.scanner.tokenType === HYPHENMINUS
- )
- );
- }
- b = prefix;
- }
- return {
- type: 'AnPlusB',
- loc: this.getLocation(start, end),
- a: a,
- b: b
- };
- },
- generate: function(node) {
- var a = node.a !== null && node.a !== undefined;
- var b = node.b !== null && node.b !== undefined;
- if (a) {
- this.chunk(
- node.a === '+1' ? '+n' :
- node.a === '1' ? 'n' :
- node.a === '-1' ? '-n' :
- node.a + 'n'
- );
- if (b) {
- b = String(node.b);
- if (b.charAt(0) === '-' || b.charAt(0) === '+') {
- this.chunk(b.charAt(0));
- this.chunk(b.substr(1));
- } else {
- this.chunk('+');
- this.chunk(b);
- }
- }
- } else {
- this.chunk(String(node.b));
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var ATKEYWORD = TYPE.AtKeyword;
- var SEMICOLON = TYPE.Semicolon;
- var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;
- var RIGHTCURLYBRACKET = TYPE.RightCurlyBracket;
- function consumeRaw(startToken) {
- return this.Raw(startToken, SEMICOLON, LEFTCURLYBRACKET, false, true);
- }
- function isDeclarationBlockAtrule() {
- for (var offset = 1, type; type = this.scanner.lookupType(offset); offset++) {
- if (type === RIGHTCURLYBRACKET) {
- return true;
- }
- if (type === LEFTCURLYBRACKET ||
- type === ATKEYWORD) {
- return false;
- }
- }
- return false;
- }
- module.exports = {
- name: 'Atrule',
- structure: {
- name: String,
- prelude: ['AtrulePrelude', 'Raw', null],
- block: ['Block', null]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var name;
- var nameLowerCase;
- var prelude = null;
- var block = null;
- this.scanner.eat(ATKEYWORD);
- name = this.scanner.substrToCursor(start + 1);
- nameLowerCase = name.toLowerCase();
- this.scanner.skipSC();
-
- if (this.scanner.eof === false &&
- this.scanner.tokenType !== LEFTCURLYBRACKET &&
- this.scanner.tokenType !== SEMICOLON) {
- if (this.parseAtrulePrelude) {
- prelude = this.parseWithFallback(this.AtrulePrelude.bind(this, name), consumeRaw);
-
- if (prelude.type === 'AtrulePrelude' && prelude.children.head === null) {
- prelude = null;
- }
- } else {
- prelude = consumeRaw.call(this, this.scanner.currentToken);
- }
- this.scanner.skipSC();
- }
- switch (this.scanner.tokenType) {
- case SEMICOLON:
- this.scanner.next();
- break;
- case LEFTCURLYBRACKET:
- if (this.atrule.hasOwnProperty(nameLowerCase) &&
- typeof this.atrule[nameLowerCase].block === 'function') {
- block = this.atrule[nameLowerCase].block.call(this);
- } else {
-
- block = this.Block(isDeclarationBlockAtrule.call(this));
- }
- break;
- }
- return {
- type: 'Atrule',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: name,
- prelude: prelude,
- block: block
- };
- },
- generate: function(node) {
- this.chunk('@');
- this.chunk(node.name);
- if (node.prelude !== null) {
- this.chunk(' ');
- this.node(node.prelude);
- }
- if (node.block) {
- this.node(node.block);
- } else {
- this.chunk(';');
- }
- },
- walkContext: 'atrule'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var SEMICOLON = TYPE.Semicolon;
- var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;
- module.exports = {
- name: 'AtrulePrelude',
- structure: {
- children: [[]]
- },
- parse: function(name) {
- var children = null;
- if (name !== null) {
- name = name.toLowerCase();
- }
- this.scanner.skipSC();
- if (this.atrule.hasOwnProperty(name) &&
- typeof this.atrule[name].prelude === 'function') {
-
- children = this.atrule[name].prelude.call(this);
- } else {
-
- children = this.readSequence(this.scope.AtrulePrelude);
- }
- this.scanner.skipSC();
- if (this.scanner.eof !== true &&
- this.scanner.tokenType !== LEFTCURLYBRACKET &&
- this.scanner.tokenType !== SEMICOLON) {
- this.scanner.error('Semicolon or block is expected');
- }
- if (children === null) {
- children = this.createList();
- }
- return {
- type: 'AtrulePrelude',
- loc: this.getLocationFromList(children),
- children: children
- };
- },
- generate: function(node) {
- this.children(node);
- },
- walkContext: 'atrulePrelude'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var STRING = TYPE.String;
- var DOLLARSIGN = TYPE.DollarSign;
- var ASTERISK = TYPE.Asterisk;
- var COLON = TYPE.Colon;
- var EQUALSSIGN = TYPE.EqualsSign;
- var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
- var RIGHTSQUAREBRACKET = TYPE.RightSquareBracket;
- var CIRCUMFLEXACCENT = TYPE.CircumflexAccent;
- var VERTICALLINE = TYPE.VerticalLine;
- var TILDE = TYPE.Tilde;
- function getAttributeName() {
- if (this.scanner.eof) {
- this.scanner.error('Unexpected end of input');
- }
- var start = this.scanner.tokenStart;
- var expectIdentifier = false;
- var checkColon = true;
- if (this.scanner.tokenType === ASTERISK) {
- expectIdentifier = true;
- checkColon = false;
- this.scanner.next();
- } else if (this.scanner.tokenType !== VERTICALLINE) {
- this.scanner.eat(IDENTIFIER);
- }
- if (this.scanner.tokenType === VERTICALLINE) {
- if (this.scanner.lookupType(1) !== EQUALSSIGN) {
- this.scanner.next();
- this.scanner.eat(IDENTIFIER);
- } else if (expectIdentifier) {
- this.scanner.error('Identifier is expected', this.scanner.tokenEnd);
- }
- } else if (expectIdentifier) {
- this.scanner.error('Vertical line is expected');
- }
- if (checkColon && this.scanner.tokenType === COLON) {
- this.scanner.next();
- this.scanner.eat(IDENTIFIER);
- }
- return {
- type: 'Identifier',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: this.scanner.substrToCursor(start)
- };
- }
- function getOperator() {
- var start = this.scanner.tokenStart;
- var tokenType = this.scanner.tokenType;
- if (tokenType !== EQUALSSIGN &&
- tokenType !== TILDE &&
- tokenType !== CIRCUMFLEXACCENT &&
- tokenType !== DOLLARSIGN &&
- tokenType !== ASTERISK &&
- tokenType !== VERTICALLINE
- ) {
- this.scanner.error('Attribute selector (=, ~=, ^=, $=, *=, |=) is expected');
- }
- if (tokenType === EQUALSSIGN) {
- this.scanner.next();
- } else {
- this.scanner.next();
- this.scanner.eat(EQUALSSIGN);
- }
- return this.scanner.substrToCursor(start);
- }
- module.exports = {
- name: 'AttributeSelector',
- structure: {
- name: 'Identifier',
- matcher: [String, null],
- value: ['String', 'Identifier', null],
- flags: [String, null]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var name;
- var matcher = null;
- var value = null;
- var flags = null;
- this.scanner.eat(LEFTSQUAREBRACKET);
- this.scanner.skipSC();
- name = getAttributeName.call(this);
- this.scanner.skipSC();
- if (this.scanner.tokenType !== RIGHTSQUAREBRACKET) {
-
- if (this.scanner.tokenType !== IDENTIFIER) {
- matcher = getOperator.call(this);
- this.scanner.skipSC();
- value = this.scanner.tokenType === STRING
- ? this.String()
- : this.Identifier();
- this.scanner.skipSC();
- }
-
- if (this.scanner.tokenType === IDENTIFIER) {
- flags = this.scanner.getTokenValue();
- this.scanner.next();
- this.scanner.skipSC();
- }
- }
- this.scanner.eat(RIGHTSQUAREBRACKET);
- return {
- type: 'AttributeSelector',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: name,
- matcher: matcher,
- value: value,
- flags: flags
- };
- },
- generate: function(node) {
- var flagsPrefix = ' ';
- this.chunk('[');
- this.node(node.name);
- if (node.matcher !== null) {
- this.chunk(node.matcher);
- if (node.value !== null) {
- this.node(node.value);
-
- if (node.value.type === 'String') {
- flagsPrefix = '';
- }
- }
- }
- if (node.flags !== null) {
- this.chunk(flagsPrefix);
- this.chunk(node.flags);
- }
- this.chunk(']');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var WHITESPACE = TYPE.WhiteSpace;
- var COMMENT = TYPE.Comment;
- var SEMICOLON = TYPE.Semicolon;
- var ATKEYWORD = TYPE.AtKeyword;
- var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;
- var RIGHTCURLYBRACKET = TYPE.RightCurlyBracket;
- function consumeRaw(startToken) {
- return this.Raw(startToken, 0, 0, false, true);
- }
- function consumeRule() {
- return this.parseWithFallback(this.Rule, consumeRaw);
- }
- function consumeRawDeclaration(startToken) {
- return this.Raw(startToken, 0, SEMICOLON, true, true);
- }
- function consumeDeclaration() {
- if (this.scanner.tokenType === SEMICOLON) {
- return consumeRawDeclaration.call(this, this.scanner.currentToken);
- }
- var node = this.parseWithFallback(this.Declaration, consumeRawDeclaration);
- if (this.scanner.tokenType === SEMICOLON) {
- this.scanner.next();
- }
- return node;
- }
- module.exports = {
- name: 'Block',
- structure: {
- children: [[
- 'Atrule',
- 'Rule',
- 'Declaration'
- ]]
- },
- parse: function(isDeclaration) {
- var consumer = isDeclaration ? consumeDeclaration : consumeRule;
- var start = this.scanner.tokenStart;
- var children = this.createList();
- this.scanner.eat(LEFTCURLYBRACKET);
- scan:
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case RIGHTCURLYBRACKET:
- break scan;
- case WHITESPACE:
- case COMMENT:
- this.scanner.next();
- break;
- case ATKEYWORD:
- children.push(this.parseWithFallback(this.Atrule, consumeRaw));
- break;
- default:
- children.push(consumer.call(this));
- }
- }
- if (!this.scanner.eof) {
- this.scanner.eat(RIGHTCURLYBRACKET);
- }
- return {
- type: 'Block',
- loc: this.getLocation(start, this.scanner.tokenStart),
- children: children
- };
- },
- generate: function(node) {
- this.chunk('{');
- this.children(node, function(prev) {
- if (prev.type === 'Declaration') {
- this.chunk(';');
- }
- });
- this.chunk('}');
- },
- walkContext: 'block'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
- var RIGHTSQUAREBRACKET = TYPE.RightSquareBracket;
- module.exports = {
- name: 'Brackets',
- structure: {
- children: [[]]
- },
- parse: function(readSequence, recognizer) {
- var start = this.scanner.tokenStart;
- var children = null;
- this.scanner.eat(LEFTSQUAREBRACKET);
- children = readSequence.call(this, recognizer);
- if (!this.scanner.eof) {
- this.scanner.eat(RIGHTSQUAREBRACKET);
- }
- return {
- type: 'Brackets',
- loc: this.getLocation(start, this.scanner.tokenStart),
- children: children
- };
- },
- generate: function(node) {
- this.chunk('[');
- this.children(node);
- this.chunk(']');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var CDC = __webpack_require__(0).TYPE.CDC;
- module.exports = {
- name: 'CDC',
- structure: [],
- parse: function() {
- var start = this.scanner.tokenStart;
- this.scanner.eat(CDC);
- return {
- type: 'CDC',
- loc: this.getLocation(start, this.scanner.tokenStart)
- };
- },
- generate: function() {
- this.chunk('-->');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var CDO = __webpack_require__(0).TYPE.CDO;
- module.exports = {
- name: 'CDO',
- structure: [],
- parse: function() {
- var start = this.scanner.tokenStart;
- this.scanner.eat(CDO);
- return {
- type: 'CDO',
- loc: this.getLocation(start, this.scanner.tokenStart)
- };
- },
- generate: function() {
- this.chunk('<!--');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var FULLSTOP = TYPE.FullStop;
- module.exports = {
- name: 'ClassSelector',
- structure: {
- name: String
- },
- parse: function() {
- this.scanner.eat(FULLSTOP);
- return {
- type: 'ClassSelector',
- loc: this.getLocation(this.scanner.tokenStart - 1, this.scanner.tokenEnd),
- name: this.scanner.consume(IDENTIFIER)
- };
- },
- generate: function(node) {
- this.chunk('.');
- this.chunk(node.name);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var PLUSSIGN = TYPE.PlusSign;
- var SOLIDUS = TYPE.Solidus;
- var GREATERTHANSIGN = TYPE.GreaterThanSign;
- var TILDE = TYPE.Tilde;
- module.exports = {
- name: 'Combinator',
- structure: {
- name: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- switch (this.scanner.tokenType) {
- case GREATERTHANSIGN:
- case PLUSSIGN:
- case TILDE:
- this.scanner.next();
- break;
- case SOLIDUS:
- this.scanner.next();
- this.scanner.expectIdentifier('deep');
- this.scanner.eat(SOLIDUS);
- break;
- default:
- this.scanner.error('Combinator is expected');
- }
- return {
- type: 'Combinator',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: this.scanner.substrToCursor(start)
- };
- },
- generate: function(node) {
- this.chunk(node.name);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var ASTERISK = TYPE.Asterisk;
- var SOLIDUS = TYPE.Solidus;
- module.exports = {
- name: 'Comment',
- structure: {
- value: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var end = this.scanner.tokenEnd;
- if ((end - start + 2) >= 2 &&
- this.scanner.source.charCodeAt(end - 2) === ASTERISK &&
- this.scanner.source.charCodeAt(end - 1) === SOLIDUS) {
- end -= 2;
- }
- this.scanner.next();
- return {
- type: 'Comment',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: this.scanner.source.substring(start + 2, end)
- };
- },
- generate: function(node) {
- this.chunk('/*');
- this.chunk(node.value);
- this.chunk('*/');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var isCustomProperty = __webpack_require__(26).isCustomProperty;
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var COLON = TYPE.Colon;
- var EXCLAMATIONMARK = TYPE.ExclamationMark;
- var SOLIDUS = TYPE.Solidus;
- var ASTERISK = TYPE.Asterisk;
- var DOLLARSIGN = TYPE.DollarSign;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var SEMICOLON = TYPE.Semicolon;
- var PLUSSIGN = TYPE.PlusSign;
- var NUMBERSIGN = TYPE.NumberSign;
- function consumeValueRaw(startToken) {
- return this.Raw(startToken, EXCLAMATIONMARK, SEMICOLON, false, true);
- }
- function consumeCustomPropertyRaw(startToken) {
- return this.Raw(startToken, EXCLAMATIONMARK, SEMICOLON, false, false);
- }
- function consumeValue() {
- var startValueToken = this.scanner.currentToken;
- var value = this.Value();
- if (value.type !== 'Raw' &&
- this.scanner.eof === false &&
- this.scanner.tokenType !== SEMICOLON &&
- this.scanner.tokenType !== EXCLAMATIONMARK &&
- this.scanner.isBalanceEdge(startValueToken) === false) {
- this.scanner.error();
- }
- return value;
- }
- module.exports = {
- name: 'Declaration',
- structure: {
- important: [Boolean, String],
- property: String,
- value: ['Value', 'Raw']
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var startToken = this.scanner.currentToken;
- var property = readProperty.call(this);
- var customProperty = isCustomProperty(property);
- var parseValue = customProperty ? this.parseCustomProperty : this.parseValue;
- var consumeRaw = customProperty ? consumeCustomPropertyRaw : consumeValueRaw;
- var important = false;
- var value;
- this.scanner.skipSC();
- this.scanner.eat(COLON);
- if (!customProperty) {
- this.scanner.skipSC();
- }
- if (parseValue) {
- value = this.parseWithFallback(consumeValue, consumeRaw);
- } else {
- value = consumeRaw.call(this, this.scanner.currentToken);
- }
- if (this.scanner.tokenType === EXCLAMATIONMARK) {
- important = getImportant(this.scanner);
- this.scanner.skipSC();
- }
-
-
- if (this.scanner.eof === false &&
- this.scanner.tokenType !== SEMICOLON &&
- this.scanner.isBalanceEdge(startToken) === false) {
- this.scanner.error();
- }
- return {
- type: 'Declaration',
- loc: this.getLocation(start, this.scanner.tokenStart),
- important: important,
- property: property,
- value: value
- };
- },
- generate: function(node) {
- this.chunk(node.property);
- this.chunk(':');
- this.node(node.value);
- if (node.important) {
- this.chunk(node.important === true ? '!important' : '!' + node.important);
- }
- },
- walkContext: 'declaration'
- };
- function readProperty() {
- var start = this.scanner.tokenStart;
- var prefix = 0;
-
- switch (this.scanner.tokenType) {
- case ASTERISK:
- case DOLLARSIGN:
- case PLUSSIGN:
- case NUMBERSIGN:
- prefix = 1;
- break;
-
- case SOLIDUS:
- prefix = this.scanner.lookupType(1) === SOLIDUS ? 2 : 1;
- break;
- }
- if (this.scanner.lookupType(prefix) === HYPHENMINUS) {
- prefix++;
- }
- if (prefix) {
- this.scanner.skip(prefix);
- }
- this.scanner.eat(IDENTIFIER);
- return this.scanner.substrToCursor(start);
- }
- function getImportant(scanner) {
- scanner.eat(EXCLAMATIONMARK);
- scanner.skipSC();
- var important = scanner.consume(IDENTIFIER);
-
-
- return important === 'important' ? true : important;
- }
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var WHITESPACE = TYPE.WhiteSpace;
- var COMMENT = TYPE.Comment;
- var SEMICOLON = TYPE.Semicolon;
- function consumeRaw(startToken) {
- return this.Raw(startToken, 0, SEMICOLON, true, true);
- }
- module.exports = {
- name: 'DeclarationList',
- structure: {
- children: [[
- 'Declaration'
- ]]
- },
- parse: function() {
- var children = this.createList();
- scan:
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case WHITESPACE:
- case COMMENT:
- case SEMICOLON:
- this.scanner.next();
- break;
- default:
- children.push(this.parseWithFallback(this.Declaration, consumeRaw));
- }
- }
- return {
- type: 'DeclarationList',
- loc: this.getLocationFromList(children),
- children: children
- };
- },
- generate: function(node) {
- this.children(node, function(prev) {
- if (prev.type === 'Declaration') {
- this.chunk(';');
- }
- });
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var NUMBER = __webpack_require__(0).TYPE.Number;
- function readUnit(scanner) {
- var unit = scanner.getTokenValue();
- var backSlashPos = unit.indexOf('\\');
- if (backSlashPos > 0) {
-
- scanner.tokenStart += backSlashPos;
-
- return unit.substring(0, backSlashPos);
- }
-
- scanner.next();
- return unit;
- }
- module.exports = {
- name: 'Dimension',
- structure: {
- value: String,
- unit: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var value = this.scanner.consume(NUMBER);
- var unit = readUnit(this.scanner);
- return {
- type: 'Dimension',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: value,
- unit: unit
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- this.chunk(node.unit);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- module.exports = {
- name: 'Function',
- structure: {
- name: String,
- children: [[]]
- },
- parse: function(readSequence, recognizer) {
- var start = this.scanner.tokenStart;
- var name = this.scanner.consumeFunctionName();
- var nameLowerCase = name.toLowerCase();
- var children;
- children = recognizer.hasOwnProperty(nameLowerCase)
- ? recognizer[nameLowerCase].call(this, recognizer)
- : readSequence.call(this, recognizer);
- if (!this.scanner.eof) {
- this.scanner.eat(RIGHTPARENTHESIS);
- }
- return {
- type: 'Function',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: name,
- children: children
- };
- },
- generate: function(node) {
- this.chunk(node.name);
- this.chunk('(');
- this.children(node);
- this.chunk(')');
- },
- walkContext: 'function'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var isHex = __webpack_require__(0).isHex;
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBER = TYPE.Number;
- var NUMBERSIGN = TYPE.NumberSign;
- function consumeHexSequence(scanner, required) {
- if (!isHex(scanner.source.charCodeAt(scanner.tokenStart))) {
- if (required) {
- scanner.error('Unexpected input', scanner.tokenStart);
- } else {
- return;
- }
- }
- for (var pos = scanner.tokenStart + 1; pos < scanner.tokenEnd; pos++) {
- var code = scanner.source.charCodeAt(pos);
-
- if (!isHex(code)) {
-
- scanner.tokenStart = pos;
- return;
- }
- }
-
- scanner.next();
- }
- module.exports = {
- name: 'HexColor',
- structure: {
- value: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- this.scanner.eat(NUMBERSIGN);
- scan:
- switch (this.scanner.tokenType) {
- case NUMBER:
- consumeHexSequence(this.scanner, true);
-
-
- if (this.scanner.tokenType === IDENTIFIER) {
- consumeHexSequence(this.scanner, false);
- }
- break;
- case IDENTIFIER:
- consumeHexSequence(this.scanner, true);
- break;
- default:
- this.scanner.error('Number or identifier is expected');
- }
- return {
- type: 'HexColor',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: this.scanner.substrToCursor(start + 1)
- };
- },
- generate: function(node) {
- this.chunk('#');
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- module.exports = {
- name: 'Identifier',
- structure: {
- name: String
- },
- parse: function() {
- return {
- type: 'Identifier',
- loc: this.getLocation(this.scanner.tokenStart, this.scanner.tokenEnd),
- name: this.scanner.consume(IDENTIFIER)
- };
- },
- generate: function(node) {
- this.chunk(node.name);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBERSIGN = TYPE.NumberSign;
- module.exports = {
- name: 'IdSelector',
- structure: {
- name: String
- },
- parse: function() {
- this.scanner.eat(NUMBERSIGN);
- return {
- type: 'IdSelector',
- loc: this.getLocation(this.scanner.tokenStart - 1, this.scanner.tokenEnd),
- name: this.scanner.consume(IDENTIFIER)
- };
- },
- generate: function(node) {
- this.chunk('#');
- this.chunk(node.name);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBER = TYPE.Number;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- var COLON = TYPE.Colon;
- var SOLIDUS = TYPE.Solidus;
- module.exports = {
- name: 'MediaFeature',
- structure: {
- name: String,
- value: ['Identifier', 'Number', 'Dimension', 'Ratio', null]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var name;
- var value = null;
- this.scanner.eat(LEFTPARENTHESIS);
- this.scanner.skipSC();
- name = this.scanner.consume(IDENTIFIER);
- this.scanner.skipSC();
- if (this.scanner.tokenType !== RIGHTPARENTHESIS) {
- this.scanner.eat(COLON);
- this.scanner.skipSC();
- switch (this.scanner.tokenType) {
- case NUMBER:
- if (this.scanner.lookupType(1) === IDENTIFIER) {
- value = this.Dimension();
- } else if (this.scanner.lookupNonWSType(1) === SOLIDUS) {
- value = this.Ratio();
- } else {
- value = this.Number();
- }
- break;
- case IDENTIFIER:
- value = this.Identifier();
- break;
- default:
- this.scanner.error('Number, dimension, ratio or identifier is expected');
- }
- this.scanner.skipSC();
- }
- this.scanner.eat(RIGHTPARENTHESIS);
- return {
- type: 'MediaFeature',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: name,
- value: value
- };
- },
- generate: function(node) {
- this.chunk('(');
- this.chunk(node.name);
- if (node.value !== null) {
- this.chunk(':');
- this.node(node.value);
- }
- this.chunk(')');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var WHITESPACE = TYPE.WhiteSpace;
- var COMMENT = TYPE.Comment;
- var IDENTIFIER = TYPE.Identifier;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- module.exports = {
- name: 'MediaQuery',
- structure: {
- children: [[
- 'Identifier',
- 'MediaFeature',
- 'WhiteSpace'
- ]]
- },
- parse: function() {
- this.scanner.skipSC();
- var children = this.createList();
- var child = null;
- var space = null;
- scan:
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case COMMENT:
- this.scanner.next();
- continue;
- case WHITESPACE:
- space = this.WhiteSpace();
- continue;
- case IDENTIFIER:
- child = this.Identifier();
- break;
- case LEFTPARENTHESIS:
- child = this.MediaFeature();
- break;
- default:
- break scan;
- }
- if (space !== null) {
- children.push(space);
- space = null;
- }
- children.push(child);
- }
- if (child === null) {
- this.scanner.error('Identifier or parenthesis is expected');
- }
- return {
- type: 'MediaQuery',
- loc: this.getLocationFromList(children),
- children: children
- };
- },
- generate: function(node) {
- this.children(node);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var COMMA = __webpack_require__(0).TYPE.Comma;
- module.exports = {
- name: 'MediaQueryList',
- structure: {
- children: [[
- 'MediaQuery'
- ]]
- },
- parse: function(relative) {
- var children = this.createList();
- this.scanner.skipSC();
- while (!this.scanner.eof) {
- children.push(this.MediaQuery(relative));
- if (this.scanner.tokenType !== COMMA) {
- break;
- }
- this.scanner.next();
- }
- return {
- type: 'MediaQueryList',
- loc: this.getLocationFromList(children),
- children: children
- };
- },
- generate: function(node) {
- this.children(node, function() {
- this.chunk(',');
- });
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- name: 'Nth',
- structure: {
- nth: ['AnPlusB', 'Identifier'],
- selector: ['SelectorList', null]
- },
- parse: function(allowOfClause) {
- this.scanner.skipSC();
- var start = this.scanner.tokenStart;
- var end = start;
- var selector = null;
- var query;
- if (this.scanner.lookupValue(0, 'odd') || this.scanner.lookupValue(0, 'even')) {
- query = this.Identifier();
- } else {
- query = this.AnPlusB();
- }
- this.scanner.skipSC();
- if (allowOfClause && this.scanner.lookupValue(0, 'of')) {
- this.scanner.next();
- selector = this.SelectorList();
- if (this.needPositions) {
- end = this.getLastListNode(selector.children).loc.end.offset;
- }
- } else {
- if (this.needPositions) {
- end = query.loc.end.offset;
- }
- }
- return {
- type: 'Nth',
- loc: this.getLocation(start, end),
- nth: query,
- selector: selector
- };
- },
- generate: function(node) {
- this.node(node.nth);
- if (node.selector !== null) {
- this.chunk(' of ');
- this.node(node.selector);
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var NUMBER = __webpack_require__(0).TYPE.Number;
- module.exports = {
- name: 'Number',
- structure: {
- value: String
- },
- parse: function() {
- return {
- type: 'Number',
- loc: this.getLocation(this.scanner.tokenStart, this.scanner.tokenEnd),
- value: this.scanner.consume(NUMBER)
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- name: 'Operator',
- structure: {
- value: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- this.scanner.next();
- return {
- type: 'Operator',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: this.scanner.substrToCursor(start)
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- module.exports = {
- name: 'Parentheses',
- structure: {
- children: [[]]
- },
- parse: function(readSequence, recognizer) {
- var start = this.scanner.tokenStart;
- var children = null;
- this.scanner.eat(LEFTPARENTHESIS);
- children = readSequence.call(this, recognizer);
- if (!this.scanner.eof) {
- this.scanner.eat(RIGHTPARENTHESIS);
- }
- return {
- type: 'Parentheses',
- loc: this.getLocation(start, this.scanner.tokenStart),
- children: children
- };
- },
- generate: function(node) {
- this.chunk('(');
- this.children(node);
- this.chunk(')');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var NUMBER = TYPE.Number;
- var PERCENTSIGN = TYPE.PercentSign;
- module.exports = {
- name: 'Percentage',
- structure: {
- value: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var number = this.scanner.consume(NUMBER);
- this.scanner.eat(PERCENTSIGN);
- return {
- type: 'Percentage',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: number
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- this.chunk('%');
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var FUNCTION = TYPE.Function;
- var COLON = TYPE.Colon;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- module.exports = {
- name: 'PseudoClassSelector',
- structure: {
- name: String,
- children: [['Raw'], null]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var children = null;
- var name;
- var nameLowerCase;
- this.scanner.eat(COLON);
- if (this.scanner.tokenType === FUNCTION) {
- name = this.scanner.consumeFunctionName();
- nameLowerCase = name.toLowerCase();
- if (this.pseudo.hasOwnProperty(nameLowerCase)) {
- this.scanner.skipSC();
- children = this.pseudo[nameLowerCase].call(this);
- this.scanner.skipSC();
- } else {
- children = this.createList();
- children.push(
- this.Raw(this.scanner.currentToken, 0, 0, false, false)
- );
- }
- this.scanner.eat(RIGHTPARENTHESIS);
- } else {
- name = this.scanner.consume(IDENTIFIER);
- }
- return {
- type: 'PseudoClassSelector',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: name,
- children: children
- };
- },
- generate: function(node) {
- this.chunk(':');
- this.chunk(node.name);
- if (node.children !== null) {
- this.chunk('(');
- this.children(node);
- this.chunk(')');
- }
- },
- walkContext: 'function'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var FUNCTION = TYPE.Function;
- var COLON = TYPE.Colon;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- module.exports = {
- name: 'PseudoElementSelector',
- structure: {
- name: String,
- children: [['Raw'], null]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var children = null;
- var name;
- var nameLowerCase;
- this.scanner.eat(COLON);
- this.scanner.eat(COLON);
- if (this.scanner.tokenType === FUNCTION) {
- name = this.scanner.consumeFunctionName();
- nameLowerCase = name.toLowerCase();
- if (this.pseudo.hasOwnProperty(nameLowerCase)) {
- this.scanner.skipSC();
- children = this.pseudo[nameLowerCase].call(this);
- this.scanner.skipSC();
- } else {
- children = this.createList();
- children.push(
- this.Raw(this.scanner.currentToken, 0, 0, false, false)
- );
- }
- this.scanner.eat(RIGHTPARENTHESIS);
- } else {
- name = this.scanner.consume(IDENTIFIER);
- }
- return {
- type: 'PseudoElementSelector',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: name,
- children: children
- };
- },
- generate: function(node) {
- this.chunk('::');
- this.chunk(node.name);
- if (node.children !== null) {
- this.chunk('(');
- this.children(node);
- this.chunk(')');
- }
- },
- walkContext: 'function'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var isNumber = __webpack_require__(0).isNumber;
- var TYPE = __webpack_require__(0).TYPE;
- var NUMBER = TYPE.Number;
- var SOLIDUS = TYPE.Solidus;
- var FULLSTOP = TYPE.FullStop;
- function consumeNumber(scanner) {
- var value = scanner.consumeNonWS(NUMBER);
- for (var i = 0; i < value.length; i++) {
- var code = value.charCodeAt(i);
- if (!isNumber(code) && code !== FULLSTOP) {
- scanner.error('Unsigned number is expected', scanner.tokenStart - value.length + i);
- }
- }
- if (Number(value) === 0) {
- scanner.error('Zero number is not allowed', scanner.tokenStart - value.length);
- }
- return value;
- }
- module.exports = {
- name: 'Ratio',
- structure: {
- left: String,
- right: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var left = consumeNumber(this.scanner);
- var right;
- this.scanner.eatNonWS(SOLIDUS);
- right = consumeNumber(this.scanner);
- return {
- type: 'Ratio',
- loc: this.getLocation(start, this.scanner.tokenStart),
- left: left,
- right: right
- };
- },
- generate: function(node) {
- this.chunk(node.left);
- this.chunk('/');
- this.chunk(node.right);
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- name: 'Raw',
- structure: {
- value: String
- },
- parse: function(startToken, endTokenType1, endTokenType2, includeTokenType2, excludeWhiteSpace) {
- var startOffset = this.scanner.getTokenStart(startToken);
- var endOffset;
- this.scanner.skip(
- this.scanner.getRawLength(
- startToken,
- endTokenType1,
- endTokenType2,
- includeTokenType2
- )
- );
- if (excludeWhiteSpace && this.scanner.tokenStart > startOffset) {
- endOffset = this.scanner.getOffsetExcludeWS();
- } else {
- endOffset = this.scanner.tokenStart;
- }
- return {
- type: 'Raw',
- loc: this.getLocation(startOffset, endOffset),
- value: this.scanner.source.substring(startOffset, endOffset)
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;
- function consumeRaw(startToken) {
- return this.Raw(startToken, LEFTCURLYBRACKET, 0, false, true);
- }
- function consumePrelude() {
- var prelude = this.SelectorList();
- if (prelude.type !== 'Raw' &&
- this.scanner.eof === false &&
- this.scanner.tokenType !== LEFTCURLYBRACKET) {
- this.scanner.error();
- }
- return prelude;
- }
- module.exports = {
- name: 'Rule',
- structure: {
- prelude: ['SelectorList', 'Raw'],
- block: ['Block']
- },
- parse: function() {
- var startToken = this.scanner.currentToken;
- var startOffset = this.scanner.tokenStart;
- var prelude;
- var block;
- if (this.parseRulePrelude) {
- prelude = this.parseWithFallback(consumePrelude, consumeRaw);
- } else {
- prelude = consumeRaw.call(this, startToken);
- }
- block = this.Block(true);
- return {
- type: 'Rule',
- loc: this.getLocation(startOffset, this.scanner.tokenStart),
- prelude: prelude,
- block: block
- };
- },
- generate: function(node) {
- this.node(node.prelude);
- this.node(node.block);
- },
- walkContext: 'rule'
- };
- }),
- (function(module, exports) {
- module.exports = {
- name: 'Selector',
- structure: {
- children: [[
- 'TypeSelector',
- 'IdSelector',
- 'ClassSelector',
- 'AttributeSelector',
- 'PseudoClassSelector',
- 'PseudoElementSelector',
- 'Combinator',
- 'WhiteSpace'
- ]]
- },
- parse: function() {
- var children = this.readSequence(this.scope.Selector);
-
- if (this.getFirstListNode(children) === null) {
- this.scanner.error('Selector is expected');
- }
- return {
- type: 'Selector',
- loc: this.getLocationFromList(children),
- children: children
- };
- },
- generate: function(node) {
- this.children(node);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var COMMA = TYPE.Comma;
- module.exports = {
- name: 'SelectorList',
- structure: {
- children: [[
- 'Selector',
- 'Raw'
- ]]
- },
- parse: function() {
- var children = this.createList();
- while (!this.scanner.eof) {
- children.push(this.Selector());
- if (this.scanner.tokenType === COMMA) {
- this.scanner.next();
- continue;
- }
- break;
- }
- return {
- type: 'SelectorList',
- loc: this.getLocationFromList(children),
- children: children
- };
- },
- generate: function(node) {
- this.children(node, function() {
- this.chunk(',');
- });
- },
- walkContext: 'selector'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var STRING = __webpack_require__(0).TYPE.String;
- module.exports = {
- name: 'String',
- structure: {
- value: String
- },
- parse: function() {
- return {
- type: 'String',
- loc: this.getLocation(this.scanner.tokenStart, this.scanner.tokenEnd),
- value: this.scanner.consume(STRING)
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var WHITESPACE = TYPE.WhiteSpace;
- var COMMENT = TYPE.Comment;
- var EXCLAMATIONMARK = TYPE.ExclamationMark;
- var ATKEYWORD = TYPE.AtKeyword;
- var CDO = TYPE.CDO;
- var CDC = TYPE.CDC;
- function consumeRaw(startToken) {
- return this.Raw(startToken, 0, 0, false, false);
- }
- module.exports = {
- name: 'StyleSheet',
- structure: {
- children: [[
- 'Comment',
- 'CDO',
- 'CDC',
- 'Atrule',
- 'Rule',
- 'Raw'
- ]]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var children = this.createList();
- var child;
- scan:
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case WHITESPACE:
- this.scanner.next();
- continue;
- case COMMENT:
-
- if (this.scanner.source.charCodeAt(this.scanner.tokenStart + 2) !== EXCLAMATIONMARK) {
- this.scanner.next();
- continue;
- }
- child = this.Comment();
- break;
- case CDO:
- child = this.CDO();
- break;
- case CDC:
- child = this.CDC();
- break;
-
-
-
- case ATKEYWORD:
- child = this.parseWithFallback(this.Atrule, consumeRaw);
- break;
-
- default:
- child = this.parseWithFallback(this.Rule, consumeRaw);
- }
- children.push(child);
- }
- return {
- type: 'StyleSheet',
- loc: this.getLocation(start, this.scanner.tokenStart),
- children: children
- };
- },
- generate: function(node) {
- this.children(node);
- },
- walkContext: 'stylesheet'
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var ASTERISK = TYPE.Asterisk;
- var VERTICALLINE = TYPE.VerticalLine;
- function eatIdentifierOrAsterisk() {
- if (this.scanner.tokenType !== IDENTIFIER &&
- this.scanner.tokenType !== ASTERISK) {
- this.scanner.error('Identifier or asterisk is expected');
- }
- this.scanner.next();
- }
- module.exports = {
- name: 'TypeSelector',
- structure: {
- name: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- if (this.scanner.tokenType === VERTICALLINE) {
- this.scanner.next();
- eatIdentifierOrAsterisk.call(this);
- } else {
- eatIdentifierOrAsterisk.call(this);
- if (this.scanner.tokenType === VERTICALLINE) {
- this.scanner.next();
- eatIdentifierOrAsterisk.call(this);
- }
- }
- return {
- type: 'TypeSelector',
- loc: this.getLocation(start, this.scanner.tokenStart),
- name: this.scanner.substrToCursor(start)
- };
- },
- generate: function(node) {
- this.chunk(node.name);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var isHex = __webpack_require__(0).isHex;
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBER = TYPE.Number;
- var PLUSSIGN = TYPE.PlusSign;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var FULLSTOP = TYPE.FullStop;
- var QUESTIONMARK = TYPE.QuestionMark;
- function scanUnicodeNumber(scanner) {
- for (var pos = scanner.tokenStart + 1; pos < scanner.tokenEnd; pos++) {
- var code = scanner.source.charCodeAt(pos);
-
- if (code === FULLSTOP || code === PLUSSIGN) {
-
- scanner.tokenStart = pos;
- return false;
- }
- }
- return true;
- }
- function scanUnicodeRange(scanner) {
- var hexStart = scanner.tokenStart + 1;
- var hexLength = 0;
- scan: {
- if (scanner.tokenType === NUMBER) {
- if (scanner.source.charCodeAt(scanner.tokenStart) !== FULLSTOP && scanUnicodeNumber(scanner)) {
- scanner.next();
- } else if (scanner.source.charCodeAt(scanner.tokenStart) !== HYPHENMINUS) {
- break scan;
- }
- } else {
- scanner.next();
- }
- if (scanner.tokenType === HYPHENMINUS) {
- scanner.next();
- }
- if (scanner.tokenType === NUMBER) {
- scanner.next();
- }
- if (scanner.tokenType === IDENTIFIER) {
- scanner.next();
- }
- if (scanner.tokenStart === hexStart) {
- scanner.error('Unexpected input', hexStart);
- }
- }
-
-
- for (var i = hexStart, wasHyphenMinus = false; i < scanner.tokenStart; i++) {
- var code = scanner.source.charCodeAt(i);
- if (isHex(code) === false && (code !== HYPHENMINUS || wasHyphenMinus)) {
- scanner.error('Unexpected input', i);
- }
- if (code === HYPHENMINUS) {
-
- if (hexLength === 0) {
- scanner.error('Unexpected input', i);
- }
- wasHyphenMinus = true;
- hexLength = 0;
- } else {
- hexLength++;
-
- if (hexLength > 6) {
- scanner.error('Too long hex sequence', i);
- }
- }
- }
-
- if (hexLength === 0) {
- scanner.error('Unexpected input', i - 1);
- }
-
- if (!wasHyphenMinus) {
-
- for (; hexLength < 6 && !scanner.eof; scanner.next()) {
- if (scanner.tokenType !== QUESTIONMARK) {
- break;
- }
- hexLength++;
- }
- }
- }
- module.exports = {
- name: 'UnicodeRange',
- structure: {
- value: String
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- this.scanner.next();
- scanUnicodeRange(this.scanner);
- return {
- type: 'UnicodeRange',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: this.scanner.substrToCursor(start)
- };
- },
- generate: function(node) {
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var STRING = TYPE.String;
- var URL = TYPE.Url;
- var RAW = TYPE.Raw;
- var RIGHTPARENTHESIS = TYPE.RightParenthesis;
- module.exports = {
- name: 'Url',
- structure: {
- value: ['String', 'Raw']
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var value;
- this.scanner.eat(URL);
- this.scanner.skipSC();
- switch (this.scanner.tokenType) {
- case STRING:
- value = this.String();
- break;
- case RAW:
- value = this.Raw(this.scanner.currentToken, 0, RAW, true, false);
- break;
- default:
- this.scanner.error('String or Raw is expected');
- }
- this.scanner.skipSC();
- this.scanner.eat(RIGHTPARENTHESIS);
- return {
- type: 'Url',
- loc: this.getLocation(start, this.scanner.tokenStart),
- value: value
- };
- },
- generate: function(node) {
- this.chunk('url');
- this.chunk('(');
- this.node(node.value);
- this.chunk(')');
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- name: 'Value',
- structure: {
- children: [[]]
- },
- parse: function() {
- var start = this.scanner.tokenStart;
- var children = this.readSequence(this.scope.Value);
- return {
- type: 'Value',
- loc: this.getLocation(start, this.scanner.tokenStart),
- children: children
- };
- },
- generate: function(node) {
- this.children(node);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var WHITESPACE = __webpack_require__(0).TYPE.WhiteSpace;
- var SPACE = Object.freeze({
- type: 'WhiteSpace',
- loc: null,
- value: ' '
- });
- module.exports = {
- name: 'WhiteSpace',
- structure: {
- value: String
- },
- parse: function() {
- this.scanner.eat(WHITESPACE);
- return SPACE;
-
-
-
-
-
- },
- generate: function(node) {
- this.chunk(node.value);
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- parseContext: {
- default: 'StyleSheet',
- stylesheet: 'StyleSheet',
- atrule: 'Atrule',
- atrulePrelude: function(options) {
- return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
- },
- mediaQueryList: 'MediaQueryList',
- mediaQuery: 'MediaQuery',
- rule: 'Rule',
- selectorList: 'SelectorList',
- selector: 'Selector',
- block: function() {
- return this.Block(true);
- },
- declarationList: 'DeclarationList',
- declaration: 'Declaration',
- value: 'Value'
- },
- scope: __webpack_require__(168),
- atrule: __webpack_require__(174),
- pseudo: __webpack_require__(180),
- node: __webpack_require__(28)
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- AtrulePrelude: __webpack_require__(169),
- Selector: __webpack_require__(170),
- Value: __webpack_require__(171)
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- getNode: __webpack_require__(53)
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var NUMBER = TYPE.Number;
- var NUMBERSIGN = TYPE.NumberSign;
- var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
- var PLUSSIGN = TYPE.PlusSign;
- var SOLIDUS = TYPE.Solidus;
- var ASTERISK = TYPE.Asterisk;
- var FULLSTOP = TYPE.FullStop;
- var COLON = TYPE.Colon;
- var GREATERTHANSIGN = TYPE.GreaterThanSign;
- var VERTICALLINE = TYPE.VerticalLine;
- var TILDE = TYPE.Tilde;
- function getNode(context) {
- switch (this.scanner.tokenType) {
- case PLUSSIGN:
- case GREATERTHANSIGN:
- case TILDE:
- context.space = null;
- context.ignoreWSAfter = true;
- return this.Combinator();
- case SOLIDUS:
- return this.Combinator();
- case FULLSTOP:
- return this.ClassSelector();
- case LEFTSQUAREBRACKET:
- return this.AttributeSelector();
- case NUMBERSIGN:
- return this.IdSelector();
- case COLON:
- if (this.scanner.lookupType(1) === COLON) {
- return this.PseudoElementSelector();
- } else {
- return this.PseudoClassSelector();
- }
- case IDENTIFIER:
- case ASTERISK:
- case VERTICALLINE:
- return this.TypeSelector();
- case NUMBER:
- return this.Percentage();
- }
- };
- module.exports = {
- getNode: getNode
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- getNode: __webpack_require__(53),
- '-moz-element': __webpack_require__(54),
- 'element': __webpack_require__(54),
- 'expression': __webpack_require__(172),
- 'var': __webpack_require__(173)
- };
- }),
- (function(module, exports) {
- module.exports = function() {
- return this.createSingleNodeList(
- this.Raw(this.scanner.currentToken, 0, 0, false, false)
- );
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var IDENTIFIER = TYPE.Identifier;
- var COMMA = TYPE.Comma;
- var SEMICOLON = TYPE.Semicolon;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var EXCLAMATIONMARK = TYPE.ExclamationMark;
- module.exports = function() {
- var children = this.createList();
- this.scanner.skipSC();
- var identStart = this.scanner.tokenStart;
- this.scanner.eat(HYPHENMINUS);
- if (this.scanner.source.charCodeAt(this.scanner.tokenStart) !== HYPHENMINUS) {
- this.scanner.error('HyphenMinus is expected');
- }
- this.scanner.eat(IDENTIFIER);
- children.push({
- type: 'Identifier',
- loc: this.getLocation(identStart, this.scanner.tokenStart),
- name: this.scanner.substrToCursor(identStart)
- });
- this.scanner.skipSC();
- if (this.scanner.tokenType === COMMA) {
- children.push(this.Operator());
- children.push(this.parseCustomProperty
- ? this.Value(null)
- : this.Raw(this.scanner.currentToken, EXCLAMATIONMARK, SEMICOLON, false, false)
- );
- }
- return children;
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- 'font-face': __webpack_require__(175),
- 'import': __webpack_require__(176),
- 'media': __webpack_require__(177),
- 'page': __webpack_require__(178),
- 'supports': __webpack_require__(179)
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: {
- prelude: null,
- block: function() {
- return this.Block(true);
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var STRING = TYPE.String;
- var IDENTIFIER = TYPE.Identifier;
- var URL = TYPE.Url;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- module.exports = {
- parse: {
- prelude: function() {
- var children = this.createList();
- this.scanner.skipSC();
- switch (this.scanner.tokenType) {
- case STRING:
- children.push(this.String());
- break;
- case URL:
- children.push(this.Url());
- break;
- default:
- this.scanner.error('String or url() is expected');
- }
- if (this.scanner.lookupNonWSType(0) === IDENTIFIER ||
- this.scanner.lookupNonWSType(0) === LEFTPARENTHESIS) {
- children.push(this.WhiteSpace());
- children.push(this.MediaQueryList());
- }
- return children;
- },
- block: null
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: {
- prelude: function() {
- return this.createSingleNodeList(
- this.MediaQueryList()
- );
- },
- block: function() {
- return this.Block(false);
- }
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: {
- prelude: function() {
- return this.createSingleNodeList(
- this.SelectorList()
- );
- },
- block: function() {
- return this.Block(true);
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var TYPE = __webpack_require__(0).TYPE;
- var WHITESPACE = TYPE.WhiteSpace;
- var COMMENT = TYPE.Comment;
- var IDENTIFIER = TYPE.Identifier;
- var FUNCTION = TYPE.Function;
- var LEFTPARENTHESIS = TYPE.LeftParenthesis;
- var HYPHENMINUS = TYPE.HyphenMinus;
- var COLON = TYPE.Colon;
- function consumeRaw() {
- return this.createSingleNodeList(
- this.Raw(this.scanner.currentToken, 0, 0, false, false)
- );
- }
- function parentheses() {
- var index = 0;
- this.scanner.skipSC();
-
- if (this.scanner.tokenType === IDENTIFIER) {
- index = 1;
- } else if (this.scanner.tokenType === HYPHENMINUS &&
- this.scanner.lookupType(1) === IDENTIFIER) {
- index = 2;
- }
- if (index !== 0 && this.scanner.lookupNonWSType(index) === COLON) {
- return this.createSingleNodeList(
- this.Declaration()
- );
- }
- return readSequence.call(this);
- }
- function readSequence() {
- var children = this.createList();
- var space = null;
- var child;
- this.scanner.skipSC();
- scan:
- while (!this.scanner.eof) {
- switch (this.scanner.tokenType) {
- case WHITESPACE:
- space = this.WhiteSpace();
- continue;
- case COMMENT:
- this.scanner.next();
- continue;
- case FUNCTION:
- child = this.Function(consumeRaw, this.scope.AtrulePrelude);
- break;
- case IDENTIFIER:
- child = this.Identifier();
- break;
- case LEFTPARENTHESIS:
- child = this.Parentheses(parentheses, this.scope.AtrulePrelude);
- break;
- default:
- break scan;
- }
- if (space !== null) {
- children.push(space);
- space = null;
- }
- children.push(child);
- }
- return children;
- }
- module.exports = {
- parse: {
- prelude: function() {
- var children = readSequence.call(this);
- if (this.getFirstListNode(children) === null) {
- this.scanner.error('Condition is expected');
- }
- return children;
- },
- block: function() {
- return this.Block(false);
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- 'dir': __webpack_require__(181),
- 'has': __webpack_require__(182),
- 'lang': __webpack_require__(183),
- 'matches': __webpack_require__(184),
- 'not': __webpack_require__(185),
- 'nth-child': __webpack_require__(186),
- 'nth-last-child': __webpack_require__(187),
- 'nth-last-of-type': __webpack_require__(188),
- 'nth-of-type': __webpack_require__(189),
- 'slotted': __webpack_require__(190)
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: function() {
- return this.createSingleNodeList(
- this.Identifier()
- );
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: function() {
- return this.createSingleNodeList(
- this.SelectorList()
- );
- }
- };
- }),
- (function(module, exports) {
- module.exports = {
- parse: function() {
- return this.createSingleNodeList(
- this.Identifier()
- );
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(55);
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(55);
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(56);
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(56);
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(57);
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(57);
- }),
- (function(module, exports) {
- module.exports = {
- parse: function compoundSelector() {
- return this.createSingleNodeList(
- this.Selector()
- );
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- module.exports = {
- node: __webpack_require__(28)
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(1).List;
- var clone = __webpack_require__(1).clone;
- var usageUtils = __webpack_require__(193);
- var clean = __webpack_require__(194);
- var replace = __webpack_require__(202);
- var restructure = __webpack_require__(214);
- var walk = __webpack_require__(1).walk;
- function readChunk(children, specialComments) {
- var buffer = new List();
- var nonSpaceTokenInBuffer = false;
- var protectedComment;
- children.nextUntil(children.head, function(node, item, list) {
- if (node.type === 'Comment') {
- if (!specialComments || node.value.charAt(0) !== '!') {
- list.remove(item);
- return;
- }
- if (nonSpaceTokenInBuffer || protectedComment) {
- return true;
- }
- list.remove(item);
- protectedComment = node;
- return;
- }
- if (node.type !== 'WhiteSpace') {
- nonSpaceTokenInBuffer = true;
- }
- buffer.insert(list.remove(item));
- });
- return {
- comment: protectedComment,
- stylesheet: {
- type: 'StyleSheet',
- loc: null,
- children: buffer
- }
- };
- }
- function compressChunk(ast, firstAtrulesAllowed, num, options) {
- options.logger('Compress block #' + num, null, true);
- var seed = 1;
- if (ast.type === 'StyleSheet') {
- ast.firstAtrulesAllowed = firstAtrulesAllowed;
- ast.id = seed++;
- }
- walk(ast, {
- visit: 'Atrule',
- enter: function markScopes(node) {
- if (node.block !== null) {
- node.block.id = seed++;
- }
- }
- });
- options.logger('init', ast);
-
- clean(ast, options);
- options.logger('clean', ast);
-
- replace(ast, options);
- options.logger('replace', ast);
-
- if (options.restructuring) {
- restructure(ast, options);
- }
- return ast;
- }
- function getCommentsOption(options) {
- var comments = 'comments' in options ? options.comments : 'exclamation';
- if (typeof comments === 'boolean') {
- comments = comments ? 'exclamation' : false;
- } else if (comments !== 'exclamation' && comments !== 'first-exclamation') {
- comments = false;
- }
- return comments;
- }
- function getRestructureOption(options) {
- return 'restructure' in options ? options.restructure :
- 'restructuring' in options ? options.restructuring :
- true;
- }
- function wrapBlock(block) {
- return new List().appendData({
- type: 'Rule',
- loc: null,
- prelude: {
- type: 'SelectorList',
- loc: null,
- children: new List().appendData({
- type: 'Selector',
- loc: null,
- children: new List().appendData({
- type: 'TypeSelector',
- loc: null,
- name: 'x'
- })
- })
- },
- block: block
- });
- }
- module.exports = function compress(ast, options) {
- ast = ast || { type: 'StyleSheet', loc: null, children: new List() };
- options = options || {};
- var compressOptions = {
- logger: typeof options.logger === 'function' ? options.logger : function() {},
- restructuring: getRestructureOption(options),
- forceMediaMerge: Boolean(options.forceMediaMerge),
- usage: options.usage ? usageUtils.buildIndex(options.usage) : false
- };
- var specialComments = getCommentsOption(options);
- var firstAtrulesAllowed = true;
- var input;
- var output = new List();
- var chunk;
- var chunkNum = 1;
- var chunkChildren;
- if (options.clone) {
- ast = clone(ast);
- }
- if (ast.type === 'StyleSheet') {
- input = ast.children;
- ast.children = output;
- } else {
- input = wrapBlock(ast);
- }
- do {
- chunk = readChunk(input, Boolean(specialComments));
- compressChunk(chunk.stylesheet, firstAtrulesAllowed, chunkNum++, compressOptions);
- chunkChildren = chunk.stylesheet.children;
- if (chunk.comment) {
-
- if (!output.isEmpty()) {
- output.insert(List.createItem({
- type: 'Raw',
- value: '\n'
- }));
- }
- output.insert(List.createItem(chunk.comment));
-
- if (!chunkChildren.isEmpty()) {
- output.insert(List.createItem({
- type: 'Raw',
- value: '\n'
- }));
- }
- }
- if (firstAtrulesAllowed && !chunkChildren.isEmpty()) {
- var lastRule = chunkChildren.last();
- if (lastRule.type !== 'Atrule' ||
- (lastRule.name !== 'import' && lastRule.name !== 'charset')) {
- firstAtrulesAllowed = false;
- }
- }
- if (specialComments !== 'exclamation') {
- specialComments = false;
- }
- output.appendList(chunkChildren);
- } while (!input.isEmpty());
- return {
- ast: ast
- };
- };
- }),
- (function(module, exports) {
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function buildMap(list, caseInsensitive) {
- var map = Object.create(null);
- if (!Array.isArray(list)) {
- return null;
- }
- for (var i = 0; i < list.length; i++) {
- var name = list[i];
- if (caseInsensitive) {
- name = name.toLowerCase();
- }
- map[name] = true;
- }
- return map;
- }
- function buildList(data) {
- if (!data) {
- return null;
- }
- var tags = buildMap(data.tags, true);
- var ids = buildMap(data.ids);
- var classes = buildMap(data.classes);
- if (tags === null &&
- ids === null &&
- classes === null) {
- return null;
- }
- return {
- tags: tags,
- ids: ids,
- classes: classes
- };
- }
- function buildIndex(data) {
- var scopes = false;
- if (data.scopes && Array.isArray(data.scopes)) {
- scopes = Object.create(null);
- for (var i = 0; i < data.scopes.length; i++) {
- var list = data.scopes[i];
- if (!list || !Array.isArray(list)) {
- throw new Error('Wrong usage format');
- }
- for (var j = 0; j < list.length; j++) {
- var name = list[j];
- if (hasOwnProperty.call(scopes, name)) {
- throw new Error('Class can\'t be used for several scopes: ' + name);
- }
- scopes[name] = i + 1;
- }
- }
- }
- return {
- whitelist: buildList(data),
- blacklist: buildList(data.blacklist),
- scopes: scopes
- };
- }
- module.exports = {
- buildIndex: buildIndex
- };
- }),
- (function(module, exports, __webpack_require__) {
- var walk = __webpack_require__(1).walk;
- var handlers = {
- Atrule: __webpack_require__(195),
- Rule: __webpack_require__(196),
- Declaration: __webpack_require__(197),
- TypeSelector: __webpack_require__(198),
- Comment: __webpack_require__(199),
- Operator: __webpack_require__(200),
- WhiteSpace: __webpack_require__(201)
- };
- module.exports = function(ast, options) {
- walk(ast, {
- leave: function(node, item, list) {
- if (handlers.hasOwnProperty(node.type)) {
- handlers[node.type].call(this, node, item, list, options);
- }
- }
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var resolveKeyword = __webpack_require__(1).keyword;
- module.exports = function cleanAtrule(node, item, list) {
- if (node.block) {
-
- if (this.stylesheet !== null) {
- this.stylesheet.firstAtrulesAllowed = false;
- }
- if (node.block.children.isEmpty()) {
- list.remove(item);
- return;
- }
- }
- switch (node.name) {
- case 'charset':
- if (!node.prelude || node.prelude.children.isEmpty()) {
- list.remove(item);
- return;
- }
-
- if (item.prev) {
- list.remove(item);
- return;
- }
- break;
- case 'import':
- if (this.stylesheet === null || !this.stylesheet.firstAtrulesAllowed) {
- list.remove(item);
- return;
- }
-
-
- list.prevUntil(item.prev, function(rule) {
- if (rule.type === 'Atrule') {
- if (rule.name === 'import' || rule.name === 'charset') {
- return;
- }
- }
- this.root.firstAtrulesAllowed = false;
- list.remove(item);
- return true;
- }, this);
- break;
- default:
- var name = resolveKeyword(node.name).basename;
- if (name === 'keyframes' ||
- name === 'media' ||
- name === 'supports') {
-
- if (!node.prelude || node.prelude.children.isEmpty()) {
- list.remove(item);
- }
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var walk = __webpack_require__(1).walk;
- function cleanUnused(selectorList, usageData) {
- selectorList.children.each(function(selector, item, list) {
- var shouldRemove = false;
- walk(selector, function(node) {
-
- if (this.selector === null || this.selector === selectorList) {
- switch (node.type) {
- case 'SelectorList':
-
-
- if (this['function'] === null || this['function'].name.toLowerCase() !== 'not') {
- if (cleanUnused(node, usageData)) {
- shouldRemove = true;
- }
- }
- break;
- case 'ClassSelector':
- if (usageData.whitelist !== null &&
- usageData.whitelist.classes !== null &&
- !hasOwnProperty.call(usageData.whitelist.classes, node.name)) {
- shouldRemove = true;
- }
- if (usageData.blacklist !== null &&
- usageData.blacklist.classes !== null &&
- hasOwnProperty.call(usageData.blacklist.classes, node.name)) {
- shouldRemove = true;
- }
- break;
- case 'IdSelector':
- if (usageData.whitelist !== null &&
- usageData.whitelist.ids !== null &&
- !hasOwnProperty.call(usageData.whitelist.ids, node.name)) {
- shouldRemove = true;
- }
- if (usageData.blacklist !== null &&
- usageData.blacklist.ids !== null &&
- hasOwnProperty.call(usageData.blacklist.ids, node.name)) {
- shouldRemove = true;
- }
- break;
- case 'TypeSelector':
-
-
- if (node.name.charAt(node.name.length - 1) !== '*') {
- if (usageData.whitelist !== null &&
- usageData.whitelist.tags !== null &&
- !hasOwnProperty.call(usageData.whitelist.tags, node.name.toLowerCase())) {
- shouldRemove = true;
- }
- if (usageData.blacklist !== null &&
- usageData.blacklist.tags !== null &&
- hasOwnProperty.call(usageData.blacklist.tags, node.name.toLowerCase())) {
- shouldRemove = true;
- }
- }
- break;
- }
- }
- });
- if (shouldRemove) {
- list.remove(item);
- }
- });
- return selectorList.children.isEmpty();
- }
- module.exports = function cleanRuleset(node, item, list, options) {
- var usageData = options.usage;
- if (usageData && (usageData.whitelist !== null || usageData.blacklist !== null)) {
- cleanUnused(node.prelude, usageData);
- }
- if (node.prelude.children.isEmpty() ||
- node.block.children.isEmpty()) {
- list.remove(item);
- }
- };
- }),
- (function(module, exports) {
- module.exports = function cleanDeclartion(node, item, list) {
- if (node.value.children && node.value.children.isEmpty()) {
- list.remove(item);
- }
- };
- }),
- (function(module, exports) {
- module.exports = function cleanType(node, item, list) {
- var name = item.data.name;
-
- if (name !== '*') {
- return;
- }
-
- var nextType = item.next && item.next.data.type;
- if (nextType === 'IdSelector' ||
- nextType === 'ClassSelector' ||
- nextType === 'AttributeSelector' ||
- nextType === 'PseudoClassSelector' ||
- nextType === 'PseudoElementSelector') {
- list.remove(item);
- }
- };
- }),
- (function(module, exports) {
- module.exports = function cleanComment(data, item, list) {
- list.remove(item);
- };
- }),
- (function(module, exports) {
- module.exports = function cleanWhitespace(node, item, list) {
- if (node.value === '+' || node.value === '-') {
- return;
- }
- if (item.prev !== null && item.prev.data.type === 'WhiteSpace') {
- list.remove(item.prev);
- }
- if (item.next !== null && item.next.data.type === 'WhiteSpace') {
- list.remove(item.next);
- }
- };
- }),
- (function(module, exports) {
- module.exports = function cleanWhitespace(node, item, list) {
-
- if (item.next === null || item.prev === null) {
- list.remove(item);
- return;
- }
-
- if (item.prev.data.type === 'WhiteSpace') {
- list.remove(item);
- return;
- }
- if ((this.stylesheet !== null && this.stylesheet.children === list) ||
- (this.block !== null && this.block.children === list)) {
- list.remove(item);
- return;
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var walk = __webpack_require__(1).walk;
- var handlers = {
- Atrule: __webpack_require__(203),
- AttributeSelector: __webpack_require__(205),
- Value: __webpack_require__(206),
- Dimension: __webpack_require__(210),
- Percentage: __webpack_require__(211),
- Number: __webpack_require__(11),
- String: __webpack_require__(212),
- Url: __webpack_require__(213),
- HexColor: __webpack_require__(29).compressHex,
- Identifier: __webpack_require__(29).compressIdent,
- Function: __webpack_require__(29).compressFunction
- };
- module.exports = function(ast) {
- walk(ast, {
- leave: function(node, item, list) {
- if (handlers.hasOwnProperty(node.type)) {
- handlers[node.type].call(this, node, item, list);
- }
- }
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var resolveKeyword = __webpack_require__(1).keyword;
- var compressKeyframes = __webpack_require__(204);
- module.exports = function(node) {
-
- if (resolveKeyword(node.name).basename === 'keyframes') {
- compressKeyframes(node);
- }
- };
- }),
- (function(module, exports) {
- module.exports = function(node) {
- node.block.children.each(function(rule) {
- rule.prelude.children.each(function(simpleselector) {
- simpleselector.children.each(function(data, item) {
- if (data.type === 'Percentage' && data.value === '100') {
- item.data = {
- type: 'TypeSelector',
- loc: data.loc,
- name: 'to'
- };
- } else if (data.type === 'TypeSelector' && data.name === 'from') {
- item.data = {
- type: 'Percentage',
- loc: data.loc,
- value: '0'
- };
- }
- });
- });
- });
- };
- }),
- (function(module, exports) {
- var escapesRx = /\\([0-9A-Fa-f]{1,6})(\r\n|[ \t\n\f\r])?|\\./g;
- var blockUnquoteRx = /^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;
- function canUnquote(value) {
- if (value === '' || value === '-') {
- return;
- }
-
- value = value.replace(escapesRx, 'a');
- return !blockUnquoteRx.test(value);
- }
- module.exports = function(node) {
- var attrValue = node.value;
- if (!attrValue || attrValue.type !== 'String') {
- return;
- }
- var unquotedValue = attrValue.value.replace(/^(.)(.*)\1$/, '$2');
- if (canUnquote(unquotedValue)) {
- node.value = {
- type: 'Identifier',
- loc: attrValue.loc,
- name: unquotedValue
- };
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var resolveName = __webpack_require__(1).property;
- var handlers = {
- 'font': __webpack_require__(207),
- 'font-weight': __webpack_require__(208),
- 'background': __webpack_require__(209),
- 'border': __webpack_require__(58),
- 'outline': __webpack_require__(58)
- };
- module.exports = function compressValue(node) {
- if (!this.declaration) {
- return;
- }
- var property = resolveName(this.declaration.property);
- if (handlers.hasOwnProperty(property.basename)) {
- handlers[property.basename](node);
- }
- };
- }),
- (function(module, exports) {
- module.exports = function compressFont(node) {
- var list = node.children;
- list.eachRight(function(node, item) {
- if (node.type === 'Identifier') {
- if (node.name === 'bold') {
- item.data = {
- type: 'Number',
- loc: node.loc,
- value: '700'
- };
- } else if (node.name === 'normal') {
- var prev = item.prev;
- if (prev && prev.data.type === 'Operator' && prev.data.value === '/') {
- this.remove(prev);
- }
- this.remove(item);
- } else if (node.name === 'medium') {
- var next = item.next;
- if (!next || next.data.type !== 'Operator') {
- this.remove(item);
- }
- }
- }
- });
-
- list.each(function(node, item) {
- if (node.type === 'WhiteSpace') {
- if (!item.prev || !item.next || item.next.data.type === 'WhiteSpace') {
- this.remove(item);
- }
- }
- });
- if (list.isEmpty()) {
- list.insert(list.createItem({
- type: 'Identifier',
- name: 'normal'
- }));
- }
- };
- }),
- (function(module, exports) {
- module.exports = function compressFontWeight(node) {
- var value = node.children.head.data;
- if (value.type === 'Identifier') {
- switch (value.name) {
- case 'normal':
- node.children.head.data = {
- type: 'Number',
- loc: value.loc,
- value: '400'
- };
- break;
- case 'bold':
- node.children.head.data = {
- type: 'Number',
- loc: value.loc,
- value: '700'
- };
- break;
- }
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(1).List;
- module.exports = function compressBackground(node) {
- function lastType() {
- if (buffer.length) {
- return buffer[buffer.length - 1].type;
- }
- }
- function flush() {
- if (lastType() === 'WhiteSpace') {
- buffer.pop();
- }
- if (!buffer.length) {
- buffer.unshift(
- {
- type: 'Number',
- loc: null,
- value: '0'
- },
- {
- type: 'WhiteSpace',
- value: ' '
- },
- {
- type: 'Number',
- loc: null,
- value: '0'
- }
- );
- }
- newValue.push.apply(newValue, buffer);
- buffer = [];
- }
- var newValue = [];
- var buffer = [];
- node.children.each(function(node) {
- if (node.type === 'Operator' && node.value === ',') {
- flush();
- newValue.push(node);
- return;
- }
-
- if (node.type === 'Identifier') {
- if (node.name === 'transparent' ||
- node.name === 'none' ||
- node.name === 'repeat' ||
- node.name === 'scroll') {
- return;
- }
- }
-
- if (node.type === 'WhiteSpace' && (!buffer.length || lastType() === 'WhiteSpace')) {
- return;
- }
- buffer.push(node);
- });
- flush();
- node.children = new List().fromArray(newValue);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var packNumber = __webpack_require__(11).pack;
- var LENGTH_UNIT = {
-
- 'px': true,
- 'mm': true,
- 'cm': true,
- 'in': true,
- 'pt': true,
- 'pc': true,
-
- 'em': true,
- 'ex': true,
- 'ch': true,
- 'rem': true,
-
- 'vh': true,
- 'vw': true,
- 'vmin': true,
- 'vmax': true,
- 'vm': true
- };
- module.exports = function compressDimension(node, item) {
- var value = packNumber(node.value, item);
- node.value = value;
- if (value === '0' && this.declaration !== null && this.atrulePrelude === null) {
- var unit = node.unit.toLowerCase();
-
- if (!LENGTH_UNIT.hasOwnProperty(unit)) {
- return;
- }
-
-
- if (this.declaration.property === '-ms-flex' ||
- this.declaration.property === 'flex') {
- return;
- }
-
- if (this['function'] && this['function'].name === 'calc') {
- return;
- }
- item.data = {
- type: 'Number',
- loc: node.loc,
- value: value
- };
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var packNumber = __webpack_require__(11).pack;
- var PERCENTAGE_LENGTH_PROPERTY = {
- 'margin': true,
- 'margin-top': true,
- 'margin-left': true,
- 'margin-bottom': true,
- 'margin-right': true,
- 'padding': true,
- 'padding-top': true,
- 'padding-left': true,
- 'padding-bottom': true,
- 'padding-right': true,
- 'top': true,
- 'left': true,
- 'bottom': true,
- 'right': true,
- 'background-position': true,
- 'background-position-x': true,
- 'background-position-y': true,
- 'background-size': true,
- 'border': true,
- 'border-width': true,
- 'border-top-width': true,
- 'border-left-width': true,
- 'border-bottom-width': true,
- 'border-right-width': true,
- 'border-image-width': true,
- 'border-radius': true,
- 'border-bottom-left-radius': true,
- 'border-bottom-right-radius': true,
- 'border-top-left-radius': true,
- 'border-top-right-radius': true
- };
- module.exports = function compressPercentage(node, item) {
- var value = packNumber(node.value, item);
- var property = this.declaration !== null ? this.declaration.property : null;
- node.value = value;
- if (property !== null && PERCENTAGE_LENGTH_PROPERTY.hasOwnProperty(property)) {
- if (value === '0') {
- item.data = {
- type: 'Number',
- loc: node.loc,
- value: value
- };
- }
- }
- };
- }),
- (function(module, exports) {
- module.exports = function(node) {
- var value = node.value;
-
-
-
-
-
- value = value.replace(/\\(\r\n|\r|\n|\f)/g, '');
- node.value = value;
- };
- }),
- (function(module, exports) {
- var UNICODE = '\\\\[0-9a-f]{1,6}(\\r\\n|[ \\n\\r\\t\\f])?';
- var ESCAPE = '(' + UNICODE + '|\\\\[^\\n\\r\\f0-9a-fA-F])';
- var NONPRINTABLE = '\u0000\u0008\u000b\u000e-\u001f\u007f';
- var SAFE_URL = new RegExp('^(' + ESCAPE + '|[^\"\'\\(\\)\\\\\\s' + NONPRINTABLE + '])*$', 'i');
- module.exports = function(node) {
- var value = node.value;
- if (value.type !== 'String') {
- return;
- }
- var quote = value.value[0];
- var url = value.value.substr(1, value.value.length - 2);
-
- url = url.replace(/\\\\/g, '/');
-
-
- if (SAFE_URL.test(url)) {
- node.value = {
- type: 'Raw',
- loc: node.value.loc,
- value: url
- };
- } else {
-
-
-
- node.value.value = url.indexOf('"') === -1 ? '"' + url + '"' : quote + url + quote;
- }
- };
- }),
- (function(module, exports, __webpack_require__) {
- var prepare = __webpack_require__(215);
- var mergeAtrule = __webpack_require__(219);
- var initialMergeRuleset = __webpack_require__(220);
- var disjoinRuleset = __webpack_require__(221);
- var restructShorthand = __webpack_require__(222);
- var restructBlock = __webpack_require__(223);
- var mergeRuleset = __webpack_require__(224);
- var restructRuleset = __webpack_require__(225);
- module.exports = function(ast, options) {
-
- var indexer = prepare(ast, options);
- options.logger('prepare', ast);
- mergeAtrule(ast, options);
- options.logger('mergeAtrule', ast);
- initialMergeRuleset(ast);
- options.logger('initialMergeRuleset', ast);
- disjoinRuleset(ast);
- options.logger('disjoinRuleset', ast);
- restructShorthand(ast, indexer);
- options.logger('restructShorthand', ast);
- restructBlock(ast);
- options.logger('restructBlock', ast);
- mergeRuleset(ast);
- options.logger('mergeRuleset', ast);
- restructRuleset(ast);
- options.logger('restructRuleset', ast);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var resolveKeyword = __webpack_require__(1).keyword;
- var walk = __webpack_require__(1).walk;
- var generate = __webpack_require__(1).generate;
- var createDeclarationIndexer = __webpack_require__(216);
- var processSelector = __webpack_require__(217);
- module.exports = function prepare(ast, options) {
- var markDeclaration = createDeclarationIndexer();
- walk(ast, {
- visit: 'Rule',
- enter: function processRule(node) {
- node.block.children.each(markDeclaration);
- processSelector(node, options.usage);
- }
- });
- walk(ast, {
- visit: 'Atrule',
- enter: function(node) {
- if (node.prelude) {
- node.prelude.id = null;
- node.prelude.id = generate(node.prelude);
- }
-
-
- if (resolveKeyword(node.name).basename === 'keyframes') {
- node.block.avoidRulesMerge = true;
- node.block.children.each(function(rule) {
- rule.prelude.children.each(function(simpleselector) {
- simpleselector.compareMarker = simpleselector.id;
- });
- });
- }
- }
- });
- return {
- declaration: markDeclaration
- };
- };
- }),
- (function(module, exports, __webpack_require__) {
- var generate = __webpack_require__(1).generate;
- function Index() {
- this.seed = 0;
- this.map = Object.create(null);
- }
- Index.prototype.resolve = function(str) {
- var index = this.map[str];
- if (!index) {
- index = ++this.seed;
- this.map[str] = index;
- }
- return index;
- };
- module.exports = function createDeclarationIndexer() {
- var ids = new Index();
- return function markDeclaration(node) {
- var id = generate(node);
- node.id = ids.resolve(id);
- node.length = id.length;
- node.fingerprint = null;
- return node;
- };
- };
- }),
- (function(module, exports, __webpack_require__) {
- var generate = __webpack_require__(1).generate;
- var specificity = __webpack_require__(218);
- var nonFreezePseudoElements = {
- 'first-letter': true,
- 'first-line': true,
- 'after': true,
- 'before': true
- };
- var nonFreezePseudoClasses = {
- 'link': true,
- 'visited': true,
- 'hover': true,
- 'active': true,
- 'first-letter': true,
- 'first-line': true,
- 'after': true,
- 'before': true
- };
- module.exports = function freeze(node, usageData) {
- var pseudos = Object.create(null);
- var hasPseudo = false;
- node.prelude.children.each(function(simpleSelector) {
- var tagName = '*';
- var scope = 0;
- simpleSelector.children.each(function(node) {
- switch (node.type) {
- case 'ClassSelector':
- if (usageData && usageData.scopes) {
- var classScope = usageData.scopes[node.name] || 0;
- if (scope !== 0 && classScope !== scope) {
- throw new Error('Selector can\'t has classes from different scopes: ' + generate(simpleSelector));
- }
- scope = classScope;
- }
- break;
- case 'PseudoClassSelector':
- var name = node.name.toLowerCase();
- if (!nonFreezePseudoClasses.hasOwnProperty(name)) {
- pseudos[name] = true;
- hasPseudo = true;
- }
- break;
- case 'PseudoElementSelector':
- var name = node.name.toLowerCase();
- if (!nonFreezePseudoElements.hasOwnProperty(name)) {
- pseudos[name] = true;
- hasPseudo = true;
- }
- break;
- case 'TypeSelector':
- tagName = node.name.toLowerCase();
- break;
- case 'AttributeSelector':
- if (node.flags) {
- pseudos['[' + node.flags.toLowerCase() + ']'] = true;
- hasPseudo = true;
- }
- break;
- case 'WhiteSpace':
- case 'Combinator':
- tagName = '*';
- break;
- }
- });
- simpleSelector.compareMarker = specificity(simpleSelector).toString();
- simpleSelector.id = null;
- simpleSelector.id = generate(simpleSelector);
- if (scope) {
- simpleSelector.compareMarker += ':' + scope;
- }
- if (tagName !== '*') {
- simpleSelector.compareMarker += ',' + tagName;
- }
- });
-
- node.pseudoSignature = hasPseudo && Object.keys(pseudos).sort().join(',');
- };
- }),
- (function(module, exports) {
- module.exports = function specificity(simpleSelector) {
- var A = 0;
- var B = 0;
- var C = 0;
- simpleSelector.children.each(function walk(node) {
- switch (node.type) {
- case 'SelectorList':
- case 'Selector':
- node.children.each(walk);
- break;
- case 'IdSelector':
- A++;
- break;
- case 'ClassSelector':
- case 'AttributeSelector':
- B++;
- break;
- case 'PseudoClassSelector':
- switch (node.name.toLowerCase()) {
- case 'not':
- node.children.each(walk);
- break;
- case 'before':
- case 'after':
- case 'first-line':
- case 'first-letter':
- C++;
- break;
-
- default:
- B++;
- }
- break;
- case 'PseudoElementSelector':
- C++;
- break;
- case 'TypeSelector':
-
- if (node.name.charAt(node.name.length - 1) !== '*') {
- C++;
- }
- break;
- }
- });
- return [A, B, C];
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(1).List;
- var resolveKeyword = __webpack_require__(1).keyword;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var walk = __webpack_require__(1).walk;
- function addRuleToMap(map, item, list, single) {
- var node = item.data;
- var name = resolveKeyword(node.name).basename;
- var id = node.name.toLowerCase() + '/' + (node.prelude ? node.prelude.id : null);
- if (!hasOwnProperty.call(map, name)) {
- map[name] = Object.create(null);
- }
- if (single) {
- delete map[name][id];
- }
- if (!hasOwnProperty.call(map[name], id)) {
- map[name][id] = new List();
- }
- map[name][id].append(list.remove(item));
- }
- function relocateAtrules(ast, options) {
- var collected = Object.create(null);
- var topInjectPoint = null;
- ast.children.each(function(node, item, list) {
- if (node.type === 'Atrule') {
- var name = resolveKeyword(node.name).basename;
- switch (name) {
- case 'keyframes':
- addRuleToMap(collected, item, list, true);
- return;
- case 'media':
- if (options.forceMediaMerge) {
- addRuleToMap(collected, item, list, false);
- return;
- }
- break;
- }
- if (topInjectPoint === null &&
- name !== 'charset' &&
- name !== 'import') {
- topInjectPoint = item;
- }
- } else {
- if (topInjectPoint === null) {
- topInjectPoint = item;
- }
- }
- });
- for (var atrule in collected) {
- for (var id in collected[atrule]) {
- ast.children.insertList(
- collected[atrule][id],
- atrule === 'media' ? null : topInjectPoint
- );
- }
- }
- };
- function isMediaRule(node) {
- return node.type === 'Atrule' && node.name === 'media';
- }
- function processAtrule(node, item, list) {
- if (!isMediaRule(node)) {
- return;
- }
- var prev = item.prev && item.prev.data;
- if (!prev || !isMediaRule(prev)) {
- return;
- }
-
- if (node.prelude &&
- prev.prelude &&
- node.prelude.id === prev.prelude.id) {
- prev.block.children.appendList(node.block.children);
- list.remove(item);
-
-
-
-
-
- }
- }
- module.exports = function rejoinAtrule(ast, options) {
- relocateAtrules(ast, options);
- walk(ast, {
- visit: 'Atrule',
- reverse: true,
- enter: processAtrule
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var walk = __webpack_require__(1).walk;
- var utils = __webpack_require__(30);
- function processRule(node, item, list) {
- var selectors = node.prelude.children;
- var declarations = node.block.children;
- list.prevUntil(item.prev, function(prev) {
-
- if (prev.type !== 'Rule') {
- return utils.unsafeToSkipNode.call(selectors, prev);
- }
- var prevSelectors = prev.prelude.children;
- var prevDeclarations = prev.block.children;
-
- if (node.pseudoSignature === prev.pseudoSignature) {
-
- if (utils.isEqualSelectors(prevSelectors, selectors)) {
- prevDeclarations.appendList(declarations);
- list.remove(item);
- return true;
- }
-
- if (utils.isEqualDeclarations(declarations, prevDeclarations)) {
- utils.addSelectors(prevSelectors, selectors);
- list.remove(item);
- return true;
- }
- }
-
- return utils.hasSimilarSelectors(selectors, prevSelectors);
- });
- }
- module.exports = function initialMergeRule(ast) {
- walk(ast, {
- visit: 'Rule',
- enter: processRule
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(1).List;
- var walk = __webpack_require__(1).walk;
- function processRule(node, item, list) {
- var selectors = node.prelude.children;
-
-
-
-
-
-
- while (selectors.head !== selectors.tail) {
- var newSelectors = new List();
- newSelectors.insert(selectors.remove(selectors.head));
- list.insert(list.createItem({
- type: 'Rule',
- loc: node.loc,
- prelude: {
- type: 'SelectorList',
- loc: node.prelude.loc,
- children: newSelectors
- },
- block: {
- type: 'Block',
- loc: node.block.loc,
- children: node.block.children.copy()
- },
- pseudoSignature: node.pseudoSignature
- }), item);
- }
- }
- module.exports = function disjoinRule(ast) {
- walk(ast, {
- visit: 'Rule',
- reverse: true,
- enter: processRule
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(1).List;
- var generate = __webpack_require__(1).generate;
- var walk = __webpack_require__(1).walk;
- var REPLACE = 1;
- var REMOVE = 2;
- var TOP = 0;
- var RIGHT = 1;
- var BOTTOM = 2;
- var LEFT = 3;
- var SIDES = ['top', 'right', 'bottom', 'left'];
- var SIDE = {
- 'margin-top': 'top',
- 'margin-right': 'right',
- 'margin-bottom': 'bottom',
- 'margin-left': 'left',
- 'padding-top': 'top',
- 'padding-right': 'right',
- 'padding-bottom': 'bottom',
- 'padding-left': 'left',
- 'border-top-color': 'top',
- 'border-right-color': 'right',
- 'border-bottom-color': 'bottom',
- 'border-left-color': 'left',
- 'border-top-width': 'top',
- 'border-right-width': 'right',
- 'border-bottom-width': 'bottom',
- 'border-left-width': 'left',
- 'border-top-style': 'top',
- 'border-right-style': 'right',
- 'border-bottom-style': 'bottom',
- 'border-left-style': 'left'
- };
- var MAIN_PROPERTY = {
- 'margin': 'margin',
- 'margin-top': 'margin',
- 'margin-right': 'margin',
- 'margin-bottom': 'margin',
- 'margin-left': 'margin',
- 'padding': 'padding',
- 'padding-top': 'padding',
- 'padding-right': 'padding',
- 'padding-bottom': 'padding',
- 'padding-left': 'padding',
- 'border-color': 'border-color',
- 'border-top-color': 'border-color',
- 'border-right-color': 'border-color',
- 'border-bottom-color': 'border-color',
- 'border-left-color': 'border-color',
- 'border-width': 'border-width',
- 'border-top-width': 'border-width',
- 'border-right-width': 'border-width',
- 'border-bottom-width': 'border-width',
- 'border-left-width': 'border-width',
- 'border-style': 'border-style',
- 'border-top-style': 'border-style',
- 'border-right-style': 'border-style',
- 'border-bottom-style': 'border-style',
- 'border-left-style': 'border-style'
- };
- function TRBL(name) {
- this.name = name;
- this.loc = null;
- this.iehack = undefined;
- this.sides = {
- 'top': null,
- 'right': null,
- 'bottom': null,
- 'left': null
- };
- }
- TRBL.prototype.getValueSequence = function(declaration, count) {
- var values = [];
- var iehack = '';
- var hasBadValues = declaration.value.children.some(function(child) {
- var special = false;
- switch (child.type) {
- case 'Identifier':
- switch (child.name) {
- case '\\0':
- case '\\9':
- iehack = child.name;
- return;
- case 'inherit':
- case 'initial':
- case 'unset':
- case 'revert':
- special = child.name;
- break;
- }
- break;
- case 'Dimension':
- switch (child.unit) {
-
- case 'rem':
-
-
- case 'vw':
- case 'vh':
- case 'vmin':
- case 'vmax':
- case 'vm':
- special = child.unit;
- break;
- }
- break;
- case 'HexColor':
- case 'Number':
- case 'Percentage':
- break;
- case 'Function':
- special = child.name;
- break;
- case 'WhiteSpace':
- return false;
- default:
- return true;
- }
- values.push({
- node: child,
- special: special,
- important: declaration.important
- });
- });
- if (hasBadValues || values.length > count) {
- return false;
- }
- if (typeof this.iehack === 'string' && this.iehack !== iehack) {
- return false;
- }
- this.iehack = iehack;
- return values;
- };
- TRBL.prototype.canOverride = function(side, value) {
- var currentValue = this.sides[side];
- return !currentValue || (value.important && !currentValue.important);
- };
- TRBL.prototype.add = function(name, declaration) {
- function attemptToAdd() {
- var sides = this.sides;
- var side = SIDE[name];
- if (side) {
- if (side in sides === false) {
- return false;
- }
- var values = this.getValueSequence(declaration, 1);
- if (!values || !values.length) {
- return false;
- }
-
- for (var key in sides) {
- if (sides[key] !== null && sides[key].special !== values[0].special) {
- return false;
- }
- }
- if (!this.canOverride(side, values[0])) {
- return true;
- }
- sides[side] = values[0];
- return true;
- } else if (name === this.name) {
- var values = this.getValueSequence(declaration, 4);
- if (!values || !values.length) {
- return false;
- }
- switch (values.length) {
- case 1:
- values[RIGHT] = values[TOP];
- values[BOTTOM] = values[TOP];
- values[LEFT] = values[TOP];
- break;
- case 2:
- values[BOTTOM] = values[TOP];
- values[LEFT] = values[RIGHT];
- break;
- case 3:
- values[LEFT] = values[RIGHT];
- break;
- }
-
- for (var i = 0; i < 4; i++) {
- for (var key in sides) {
- if (sides[key] !== null && sides[key].special !== values[i].special) {
- return false;
- }
- }
- }
- for (var i = 0; i < 4; i++) {
- if (this.canOverride(SIDES[i], values[i])) {
- sides[SIDES[i]] = values[i];
- }
- }
- return true;
- }
- }
- if (!attemptToAdd.call(this)) {
- return false;
- }
-
-
-
-
-
-
-
-
-
- if (!this.loc) {
- this.loc = declaration.loc;
- }
- return true;
- };
- TRBL.prototype.isOkToMinimize = function() {
- var top = this.sides.top;
- var right = this.sides.right;
- var bottom = this.sides.bottom;
- var left = this.sides.left;
- if (top && right && bottom && left) {
- var important =
- top.important +
- right.important +
- bottom.important +
- left.important;
- return important === 0 || important === 4;
- }
- return false;
- };
- TRBL.prototype.getValue = function() {
- var result = new List();
- var sides = this.sides;
- var values = [
- sides.top,
- sides.right,
- sides.bottom,
- sides.left
- ];
- var stringValues = [
- generate(sides.top.node),
- generate(sides.right.node),
- generate(sides.bottom.node),
- generate(sides.left.node)
- ];
- if (stringValues[LEFT] === stringValues[RIGHT]) {
- values.pop();
- if (stringValues[BOTTOM] === stringValues[TOP]) {
- values.pop();
- if (stringValues[RIGHT] === stringValues[TOP]) {
- values.pop();
- }
- }
- }
- for (var i = 0; i < values.length; i++) {
- if (i) {
- result.appendData({ type: 'WhiteSpace', value: ' ' });
- }
- result.appendData(values[i].node);
- }
- if (this.iehack) {
- result.appendData({ type: 'WhiteSpace', value: ' ' });
- result.appendData({
- type: 'Identifier',
- loc: null,
- name: this.iehack
- });
- }
- return {
- type: 'Value',
- loc: null,
- children: result
- };
- };
- TRBL.prototype.getDeclaration = function() {
- return {
- type: 'Declaration',
- loc: this.loc,
- important: this.sides.top.important,
- property: this.name,
- value: this.getValue()
- };
- };
- function processRule(rule, shorts, shortDeclarations, lastShortSelector) {
- var declarations = rule.block.children;
- var selector = rule.prelude.children.first().id;
- rule.block.children.eachRight(function(declaration, item) {
- var property = declaration.property;
- if (!MAIN_PROPERTY.hasOwnProperty(property)) {
- return;
- }
- var key = MAIN_PROPERTY[property];
- var shorthand;
- var operation;
- if (!lastShortSelector || selector === lastShortSelector) {
- if (key in shorts) {
- operation = REMOVE;
- shorthand = shorts[key];
- }
- }
- if (!shorthand || !shorthand.add(property, declaration)) {
- operation = REPLACE;
- shorthand = new TRBL(key);
-
- if (!shorthand.add(property, declaration)) {
- lastShortSelector = null;
- return;
- }
- }
- shorts[key] = shorthand;
- shortDeclarations.push({
- operation: operation,
- block: declarations,
- item: item,
- shorthand: shorthand
- });
- lastShortSelector = selector;
- });
- return lastShortSelector;
- }
- function processShorthands(shortDeclarations, markDeclaration) {
- shortDeclarations.forEach(function(item) {
- var shorthand = item.shorthand;
- if (!shorthand.isOkToMinimize()) {
- return;
- }
- if (item.operation === REPLACE) {
- item.item.data = markDeclaration(shorthand.getDeclaration());
- } else {
- item.block.remove(item.item);
- }
- });
- }
- module.exports = function restructBlock(ast, indexer) {
- var stylesheetMap = {};
- var shortDeclarations = [];
- walk(ast, {
- visit: 'Rule',
- reverse: true,
- enter: function(node) {
- var stylesheet = this.block || this.stylesheet;
- var ruleId = (node.pseudoSignature || '') + '|' + node.prelude.children.first().id;
- var ruleMap;
- var shorts;
- if (!stylesheetMap.hasOwnProperty(stylesheet.id)) {
- ruleMap = {
- lastShortSelector: null
- };
- stylesheetMap[stylesheet.id] = ruleMap;
- } else {
- ruleMap = stylesheetMap[stylesheet.id];
- }
- if (ruleMap.hasOwnProperty(ruleId)) {
- shorts = ruleMap[ruleId];
- } else {
- shorts = {};
- ruleMap[ruleId] = shorts;
- }
- ruleMap.lastShortSelector = processRule.call(this, node, shorts, shortDeclarations, ruleMap.lastShortSelector);
- }
- });
- processShorthands(shortDeclarations, indexer.declaration);
- };
- }),
- (function(module, exports, __webpack_require__) {
- var resolveProperty = __webpack_require__(1).property;
- var resolveKeyword = __webpack_require__(1).keyword;
- var walk = __webpack_require__(1).walk;
- var generate = __webpack_require__(1).generate;
- var fingerprintId = 1;
- var dontRestructure = {
- 'src': 1
- };
- var DONT_MIX_VALUE = {
-
- 'display': /table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,
-
- 'text-align': /^(start|end|match-parent|justify-all)$/i
- };
- var CURSOR_SAFE_VALUE = [
- 'auto', 'crosshair', 'default', 'move', 'text', 'wait', 'help',
- 'n-resize', 'e-resize', 's-resize', 'w-resize',
- 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize',
- 'pointer', 'progress', 'not-allowed', 'no-drop', 'vertical-text', 'all-scroll',
- 'col-resize', 'row-resize'
- ];
- var POSITION_SAFE_VALUE = [
- 'static', 'relative', 'absolute', 'fixed'
- ];
- var NEEDLESS_TABLE = {
- 'border-width': ['border'],
- 'border-style': ['border'],
- 'border-color': ['border'],
- 'border-top': ['border'],
- 'border-right': ['border'],
- 'border-bottom': ['border'],
- 'border-left': ['border'],
- 'border-top-width': ['border-top', 'border-width', 'border'],
- 'border-right-width': ['border-right', 'border-width', 'border'],
- 'border-bottom-width': ['border-bottom', 'border-width', 'border'],
- 'border-left-width': ['border-left', 'border-width', 'border'],
- 'border-top-style': ['border-top', 'border-style', 'border'],
- 'border-right-style': ['border-right', 'border-style', 'border'],
- 'border-bottom-style': ['border-bottom', 'border-style', 'border'],
- 'border-left-style': ['border-left', 'border-style', 'border'],
- 'border-top-color': ['border-top', 'border-color', 'border'],
- 'border-right-color': ['border-right', 'border-color', 'border'],
- 'border-bottom-color': ['border-bottom', 'border-color', 'border'],
- 'border-left-color': ['border-left', 'border-color', 'border'],
- 'margin-top': ['margin'],
- 'margin-right': ['margin'],
- 'margin-bottom': ['margin'],
- 'margin-left': ['margin'],
- 'padding-top': ['padding'],
- 'padding-right': ['padding'],
- 'padding-bottom': ['padding'],
- 'padding-left': ['padding'],
- 'font-style': ['font'],
- 'font-variant': ['font'],
- 'font-weight': ['font'],
- 'font-size': ['font'],
- 'font-family': ['font'],
- 'list-style-type': ['list-style'],
- 'list-style-position': ['list-style'],
- 'list-style-image': ['list-style']
- };
- function getPropertyFingerprint(propertyName, declaration, fingerprints) {
- var realName = resolveProperty(propertyName).basename;
- if (realName === 'background') {
- return propertyName + ':' + generate(declaration.value);
- }
- var declarationId = declaration.id;
- var fingerprint = fingerprints[declarationId];
- if (!fingerprint) {
- switch (declaration.value.type) {
- case 'Value':
- var vendorId = '';
- var iehack = '';
- var special = {};
- var raw = false;
- declaration.value.children.each(function walk(node) {
- switch (node.type) {
- case 'Value':
- case 'Brackets':
- case 'Parentheses':
- node.children.each(walk);
- break;
- case 'Raw':
- raw = true;
- break;
- case 'Identifier':
- var name = node.name;
- if (!vendorId) {
- vendorId = resolveKeyword(name).vendor;
- }
- if (/\\[09]/.test(name)) {
- iehack = RegExp.lastMatch;
- }
- if (realName === 'cursor') {
- if (CURSOR_SAFE_VALUE.indexOf(name) === -1) {
- special[name] = true;
- }
- } else if (realName === 'position') {
- if (POSITION_SAFE_VALUE.indexOf(name) === -1) {
- special[name] = true;
- }
- } else if (DONT_MIX_VALUE.hasOwnProperty(realName)) {
- if (DONT_MIX_VALUE[realName].test(name)) {
- special[name] = true;
- }
- }
- break;
- case 'Function':
- var name = node.name;
- if (!vendorId) {
- vendorId = resolveKeyword(name).vendor;
- }
- if (name === 'rect') {
-
-
-
-
- var hasComma = node.children.some(function(node) {
- return node.type === 'Operator' && node.value === ',';
- });
- if (!hasComma) {
- name = 'rect-backward';
- }
- }
- special[name + '()'] = true;
-
- node.children.each(walk);
- break;
- case 'Dimension':
- var unit = node.unit;
- switch (unit) {
-
- case 'rem':
-
-
- case 'vw':
- case 'vh':
- case 'vmin':
- case 'vmax':
- case 'vm':
- special[unit] = true;
- break;
- }
- break;
- }
- });
- fingerprint = raw
- ? '!' + fingerprintId++
- : '!' + Object.keys(special).sort() + '|' + iehack + vendorId;
- break;
- case 'Raw':
- fingerprint = '!' + declaration.value.value;
- break;
- default:
- fingerprint = generate(declaration.value);
- }
- fingerprints[declarationId] = fingerprint;
- }
- return propertyName + fingerprint;
- }
- function needless(props, declaration, fingerprints) {
- var property = resolveProperty(declaration.property);
- if (NEEDLESS_TABLE.hasOwnProperty(property.basename)) {
- var table = NEEDLESS_TABLE[property.basename];
- for (var i = 0; i < table.length; i++) {
- var ppre = getPropertyFingerprint(property.prefix + table[i], declaration, fingerprints);
- var prev = props.hasOwnProperty(ppre) ? props[ppre] : null;
- if (prev && (!declaration.important || prev.item.data.important)) {
- return prev;
- }
- }
- }
- }
- function processRule(rule, item, list, props, fingerprints) {
- var declarations = rule.block.children;
- declarations.eachRight(function(declaration, declarationItem) {
- var property = declaration.property;
- var fingerprint = getPropertyFingerprint(property, declaration, fingerprints);
- var prev = props[fingerprint];
- if (prev && !dontRestructure.hasOwnProperty(property)) {
- if (declaration.important && !prev.item.data.important) {
- props[fingerprint] = {
- block: declarations,
- item: declarationItem
- };
- prev.block.remove(prev.item);
-
-
-
-
-
- } else {
- declarations.remove(declarationItem);
-
-
-
-
-
- }
- } else {
- var prev = needless(props, declaration, fingerprints);
- if (prev) {
- declarations.remove(declarationItem);
-
-
-
-
-
- } else {
- declaration.fingerprint = fingerprint;
- props[fingerprint] = {
- block: declarations,
- item: declarationItem
- };
- }
- }
- });
- if (declarations.isEmpty()) {
- list.remove(item);
- }
- }
- module.exports = function restructBlock(ast) {
- var stylesheetMap = {};
- var fingerprints = Object.create(null);
- walk(ast, {
- visit: 'Rule',
- reverse: true,
- enter: function(node, item, list) {
- var stylesheet = this.block || this.stylesheet;
- var ruleId = (node.pseudoSignature || '') + '|' + node.prelude.children.first().id;
- var ruleMap;
- var props;
- if (!stylesheetMap.hasOwnProperty(stylesheet.id)) {
- ruleMap = {};
- stylesheetMap[stylesheet.id] = ruleMap;
- } else {
- ruleMap = stylesheetMap[stylesheet.id];
- }
- if (ruleMap.hasOwnProperty(ruleId)) {
- props = ruleMap[ruleId];
- } else {
- props = {};
- ruleMap[ruleId] = props;
- }
- processRule.call(this, node, item, list, props, fingerprints);
- }
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var walk = __webpack_require__(1).walk;
- var utils = __webpack_require__(30);
- function processRule(node, item, list) {
- var selectors = node.prelude.children;
- var declarations = node.block.children;
- var nodeCompareMarker = selectors.first().compareMarker;
- var skippedCompareMarkers = {};
- list.nextUntil(item.next, function(next, nextItem) {
-
- if (next.type !== 'Rule') {
- return utils.unsafeToSkipNode.call(selectors, next);
- }
- if (node.pseudoSignature !== next.pseudoSignature) {
- return true;
- }
- var nextFirstSelector = next.prelude.children.head;
- var nextDeclarations = next.block.children;
- var nextCompareMarker = nextFirstSelector.data.compareMarker;
-
- if (nextCompareMarker in skippedCompareMarkers) {
- return true;
- }
-
- if (selectors.head === selectors.tail) {
- if (selectors.first().id === nextFirstSelector.data.id) {
- declarations.appendList(nextDeclarations);
- list.remove(nextItem);
- return;
- }
- }
-
- if (utils.isEqualDeclarations(declarations, nextDeclarations)) {
- var nextStr = nextFirstSelector.data.id;
- selectors.some(function(data, item) {
- var curStr = data.id;
- if (nextStr < curStr) {
- selectors.insert(nextFirstSelector, item);
- return true;
- }
- if (!item.next) {
- selectors.insert(nextFirstSelector);
- return true;
- }
- });
- list.remove(nextItem);
- return;
- }
-
- if (nextCompareMarker === nodeCompareMarker) {
- return true;
- }
- skippedCompareMarkers[nextCompareMarker] = true;
- });
- }
- module.exports = function mergeRule(ast) {
- walk(ast, {
- visit: 'Rule',
- enter: processRule
- });
- };
- }),
- (function(module, exports, __webpack_require__) {
- var List = __webpack_require__(1).List;
- var walk = __webpack_require__(1).walk;
- var utils = __webpack_require__(30);
- function calcSelectorLength(list) {
- var length = 0;
- list.each(function(data) {
- length += data.id.length + 1;
- });
- return length - 1;
- }
- function calcDeclarationsLength(tokens) {
- var length = 0;
- for (var i = 0; i < tokens.length; i++) {
- length += tokens[i].length;
- }
- return (
- length +
- tokens.length - 1
- );
- }
- function processRule(node, item, list) {
- var avoidRulesMerge = this.block !== null ? this.block.avoidRulesMerge : false;
- var selectors = node.prelude.children;
- var block = node.block;
- var disallowDownMarkers = Object.create(null);
- var allowMergeUp = true;
- var allowMergeDown = true;
- list.prevUntil(item.prev, function(prev, prevItem) {
-
- if (prev.type !== 'Rule') {
- return utils.unsafeToSkipNode.call(selectors, prev);
- }
- var prevSelectors = prev.prelude.children;
- var prevBlock = prev.block;
- if (node.pseudoSignature !== prev.pseudoSignature) {
- return true;
- }
- allowMergeDown = !prevSelectors.some(function(selector) {
- return selector.compareMarker in disallowDownMarkers;
- });
-
- if (!allowMergeDown && !allowMergeUp) {
- return true;
- }
-
- if (allowMergeUp && utils.isEqualSelectors(prevSelectors, selectors)) {
- prevBlock.children.appendList(block.children);
- list.remove(item);
- return true;
- }
-
- var diff = utils.compareDeclarations(block.children, prevBlock.children);
-
- if (diff.eq.length) {
- if (!diff.ne1.length && !diff.ne2.length) {
-
- if (allowMergeDown) {
- utils.addSelectors(selectors, prevSelectors);
- list.remove(prevItem);
- }
- return true;
- } else if (!avoidRulesMerge) {
- if (diff.ne1.length && !diff.ne2.length) {
-
- var selectorLength = calcSelectorLength(selectors);
- var blockLength = calcDeclarationsLength(diff.eq);
- if (allowMergeUp && selectorLength < blockLength) {
- utils.addSelectors(prevSelectors, selectors);
- block.children = new List().fromArray(diff.ne1);
- }
- } else if (!diff.ne1.length && diff.ne2.length) {
-
- var selectorLength = calcSelectorLength(prevSelectors);
- var blockLength = calcDeclarationsLength(diff.eq);
- if (allowMergeDown && selectorLength < blockLength) {
- utils.addSelectors(selectors, prevSelectors);
- prevBlock.children = new List().fromArray(diff.ne2);
- }
- } else {
-
-
- var newSelector = {
- type: 'SelectorList',
- loc: null,
- children: utils.addSelectors(prevSelectors.copy(), selectors)
- };
- var newBlockLength = calcSelectorLength(newSelector.children) + 2;
- var blockLength = calcDeclarationsLength(diff.eq);
-
-
- if (allowMergeDown && blockLength >= newBlockLength) {
- var newRule = {
- type: 'Rule',
- loc: null,
- prelude: newSelector,
- block: {
- type: 'Block',
- loc: null,
- children: new List().fromArray(diff.eq)
- },
- pseudoSignature: node.pseudoSignature
- };
- block.children = new List().fromArray(diff.ne1);
- prevBlock.children = new List().fromArray(diff.ne2.concat(diff.ne2overrided));
- list.insert(list.createItem(newRule), prevItem);
- return true;
- }
- }
- }
- }
- if (allowMergeUp) {
-
-
- allowMergeUp = !prevSelectors.some(function(prevSelector) {
- return selectors.some(function(selector) {
- return selector.compareMarker === prevSelector.compareMarker;
- });
- });
- }
- prevSelectors.each(function(data) {
- disallowDownMarkers[data.compareMarker] = true;
- });
- });
- }
- module.exports = function restructRule(ast) {
- walk(ast, {
- visit: 'Rule',
- reverse: true,
- enter: processRule
- });
- };
- }),
- (function(module) {
- module.exports = JSON.parse("{\"name\":\"csso\",\"version\":\"3.5.1\",\"description\":\"CSS minifier with structural optimisations\",\"keywords\":[\"css\",\"compress\",\"minifier\",\"minify\",\"optimise\",\"optimisation\",\"csstree\"],\"homepage\":\"https://github.com/css/csso\",\"author\":\"Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (https://github.com/afelix)\",\"maintainers\":[{\"name\":\"Roman Dvornov\",\"email\":\"rdvornov@gmail.com\",\"github-username\":\"lahmatiy\"}],\"license\":\"MIT\",\"repository\":\"css/csso\",\"bugs\":{\"url\":\"https://github.com/css/csso/issues\"},\"main\":\"./lib/index\",\"eslintConfig\":{\"env\":{\"node\":true,\"mocha\":true,\"es6\":true},\"rules\":{\"no-duplicate-case\":2,\"no-undef\":2,\"no-unused-vars\":[2,{\"vars\":\"all\",\"args\":\"after-used\"}]}},\"scripts\":{\"test\":\"mocha --reporter dot\",\"codestyle\":\"jscs lib test && eslint lib test\",\"codestyle-and-test\":\"npm run codestyle && npm test\",\"hydrogen\":\"node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/csso --stat -o /dev/null\",\"coverage\":\"istanbul cover _mocha -- -R dot\",\"coveralls\":\"istanbul cover _mocha --report lcovonly -- -R dot && cat ./coverage/lcov.info | coveralls\",\"travis\":\"npm run codestyle-and-test && npm run coveralls\",\"browserify\":\"browserify -t package-json-versionify --standalone csso lib/index.js | uglifyjs --compress --mangle -o dist/csso-browser.js\",\"gh-pages\":\"git clone --depth=1 -b gh-pages https://github.com/css/csso.git .gh-pages && npm run browserify && cp dist/csso-browser.js .gh-pages/ && cd .gh-pages && git commit -am \\\"update\\\" && git push && cd .. && rm -rf .gh-pages\",\"prepublish\":\"npm run browserify\",\"postpublish\":\"npm run gh-pages\"},\"dependencies\":{\"css-tree\":\"1.0.0-alpha.29\"},\"devDependencies\":{\"browserify\":\"^13.0.0\",\"coveralls\":\"^2.11.6\",\"eslint\":\"^2.2.0\",\"istanbul\":\"^0.4.2\",\"jscs\":\"~3.0.7\",\"mocha\":\"^3.5.3\",\"package-json-versionify\":\"^1.0.4\",\"source-map\":\"^0.5.6\",\"uglify-js\":\"^2.6.1\"},\"engines\":{\"node\":\">=0.10.0\"},\"files\":[\"dist/csso-browser.js\",\"lib\",\"HISTORY.md\",\"LICENSE\",\"README.md\"]}");
- }),
- (function(module, exports, __webpack_require__) {
- const path = __webpack_require__(3)
- const _ = __webpack_require__(10)
- const compiler = _.getCompiler()
- const wxmlCache = {}
- const compilerResCache = {}
- module.exports = {
-
- getWxml(componentPath, config) {
- let wxml = wxmlCache[componentPath]
- if (wxml) return wxml
- if (config.compiler === 'official') {
-
- if (!compiler) {
- wxml = _.readFile(`${componentPath}.wxml`)
- if (typeof wxml !== 'function') {
-
- throw new Error('not support official compiler, please use simulate compiler')
- }
- } else {
- let gwx
- if (compilerResCache[config.rootPath]) {
- gwx = compilerResCache[config.rootPath]
- } else {
- const compileString = compiler.wxmlToJs(config.rootPath, config.compilerOptions)
-
- const compileFunc = new Function(compileString)
- gwx = compileFunc()
- compilerResCache[config.rootPath] = gwx
- }
- let relativeWxmlPath = `${path.relative(config.rootPath, componentPath)}.wxml`
- relativeWxmlPath = relativeWxmlPath.replace(/\\/g, '/')
-
- wxml = gwx(relativeWxmlPath)
- }
- } else {
-
- wxml = _.readFile(`${componentPath}.wxml`)
- }
-
- wxmlCache[componentPath] = wxml
- return wxml
- }
- }
- }),
- (function(module, exports, __webpack_require__) {
- (function(global) {const _ = __webpack_require__(10)
- class Touch {
- constructor(options = {}) {
- this.clientX = 0
- this.clientY = 0
- this.identifier = 0
- this.pageX = 0
- this.pageY = 0
- this.screenX = 0
- this.screenY = 0
- this.target = null
- Object.keys(options).forEach(key => {
- this[key] = options[key]
- })
- }
- }
- module.exports = function() {
- if (_.getEnv() === 'nodejs') {
- try {
- global.Touch = window.Touch = Touch
- } catch (err) {
-
- }
- }
- }
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports, __webpack_require__) {
- (function(global) {const jComponent = __webpack_require__(31)
- const api = __webpack_require__(230)
- const officialTagList = [
- 'view', 'scroll-view', 'swiper', 'movable-view', 'cover-view', 'cover-view',
- 'icon', 'text', 'rich-text', 'progress',
- 'button', 'checkbox', 'form', 'input', 'label', 'picker', 'picker', 'picker-view', 'radio', 'slider', 'switch', 'textarea',
- 'navigator', 'function-page-navigator',
- 'audio', 'image', 'video', 'camera', 'live-player', 'live-pusher',
- 'map',
- 'canvas',
- 'open-data', 'web-view', 'ad'
- ]
- module.exports = function() {
-
- officialTagList.forEach(name => {
- jComponent.register({
- id: name,
- tagName: `wx-${name}`,
- template: '<slot/>',
- })
- })
-
- if (typeof global.wx === 'object') global.wx = Object.assign(api, global.wx)
- else global.wx = api
- }
- }.call(this, __webpack_require__(2)))
- }),
- (function(module, exports, __webpack_require__) {
- const Animation = __webpack_require__(231)
- const MapContext = __webpack_require__(232)
- const UpdateManager = __webpack_require__(233)
- const dataApi = __webpack_require__(234)
- const openApi = __webpack_require__(235)
- const _ = __webpack_require__(12)
- let nextTickQueue = []
- let nextTickTimer = null
- module.exports = {
- request: _.mockAsync('request'),
- uploadFile: _.mockAsync('uploadFile'),
- downloadFile: _.mockAsync('downloadFile'),
- connectSocket: _.mockAsync('connectSocket'),
- onSocketOpen: _.mockAsync('onSocketOpen'),
- onSocketError: _.mockAsync('onSocketError'),
- sendSocketMessage: _.mockAsync('sendSocketMessage'),
- onSocketMessage: _.mockAsync('onSocketMessage'),
- closeSocket: _.mockAsync('closeSocket'),
- onSocketClose: _.mockAsync('onSocketClose'),
- chooseImage: _.mockAsync('chooseImage'),
- previewImage: _.mockAsync('previewImage'),
- getImageInfo: _.mockAsync('getImageInfo'),
- saveImageToPhotosAlbum: _.mockAsync('saveImageToPhotosAlbum'),
- startRecord: _.mockAsync('startRecord'),
- stopRecord: _.mockAsync('stopRecord'),
- getRecorderManager: _.mockAsync('getRecorderManager'),
- playVoice: _.mockAsync('playVoice'),
- pauseVoice: _.mockAsync('pauseVoice'),
- stopVoice: _.mockAsync('stopVoice'),
- getBackgroundAudioPlayerState: _.mockAsync('getBackgroundAudioPlayerState'),
- playBackgroundAudio: _.mockAsync('playBackgroundAudio'),
- pauseBackgroundAudio: _.mockAsync('pauseBackgroundAudio'),
- seekBackgroundAudio: _.mockAsync('seekBackgroundAudio'),
- stopBackgroundAudio: _.mockAsync('stopBackgroundAudio'),
- onBackgroundAudioPlay: _.mockAsync('onBackgroundAudioPlay'),
- onBackgroundAudioPause: _.mockAsync('onBackgroundAudioPause'),
- onBackgroundAudioStop: _.mockAsync('onBackgroundAudioStop'),
- getBackgroundAudioManager: _.mockAsync('getBackgroundAudioManager'),
- createAudioContext: _.mockAsync('createAudioContext'),
- createInnerAudioContext: _.mockAsync('createInnerAudioContext'),
- getAvailableAudioSources: _.mockAsync('getAvailableAudioSources'),
- chooseVideo: _.mockAsync('chooseVideo'),
- saveVideoToPhotosAlbum: _.mockAsync('saveVideoToPhotosAlbum'),
- createVideoContext: _.mockAsync('createVideoContext'),
- createCameraContext: _.mockAsync('createCameraContext'),
- createLivePlayerContext: _.mockAsync('createLivePlayerContext'),
- createLivePusherContext: _.mockAsync('createLivePusherContext'),
- loadFontFace: _.mockAsync('loadFontFace'),
- saveFile: _.mockAsync('saveFile'),
- getFileInfo: _.mockAsync('getFileInfo'),
- getSavedFileList: _.mockAsync('getSavedFileList'),
- getSavedFileInfo: _.mockAsync('getSavedFileInfo'),
- removeSavedFile: _.mockAsync('removeSavedFile'),
- openDocument: _.mockAsync('openDocument'),
- onMemoryWarning: _.mockAsync('onMemoryWarning'),
- getNetworkType: _.mockAsync('getNetworkType'),
- onNetworkStatusChange: _.mockAsync('onNetworkStatusChange'),
- onAccelerometerChange: _.mockAsync('onAccelerometerChange'),
- startAccelerometer: _.mockAsync('startAccelerometer'),
- stopAccelerometer: _.mockAsync('stopAccelerometer'),
- onCompassChange: _.mockAsync('onCompassChange'),
- startCompass: _.mockAsync('startCompass'),
- stopCompass: _.mockAsync('stopCompass'),
- makePhoneCall: _.mockAsync('makePhoneCall'),
- scanCode: _.mockAsync('scanCode'),
- setClipboardData: _.mockAsync('setClipboardData'),
- getClipboardData: _.mockAsync('getClipboardData'),
- openBluetoothAdapter: _.mockAsync('openBluetoothAdapter'),
- closeBluetoothAdapter: _.mockAsync('closeBluetoothAdapter'),
- getBluetoothAdapterState: _.mockAsync('getBluetoothAdapterState'),
- onBluetoothAdapterStateChange: _.mockAsync('onBluetoothAdapterStateChange'),
- startBluetoothDevicesDiscovery: _.mockAsync('startBluetoothDevicesDiscovery'),
- stopBluetoothDevicesDiscovery: _.mockAsync('stopBluetoothDevicesDiscovery'),
- getBluetoothDevices: _.mockAsync('getBluetoothDevices'),
- getConnectedBluetoothDevices: _.mockAsync('getConnectedBluetoothDevices'),
- onBluetoothDeviceFound: _.mockAsync('onBluetoothDeviceFound'),
- createBLEConnection: _.mockAsync('createBLEConnection'),
- closeBLEConnection: _.mockAsync('closeBLEConnection'),
- getBLEDeviceServices: _.mockAsync('getBLEDeviceServices'),
- getBLEDeviceCharacteristics: _.mockAsync('getBLEDeviceCharacteristics'),
- readBLECharacteristicValue: _.mockAsync('readBLECharacteristicValue'),
- writeBLECharacteristicValue: _.mockAsync('writeBLECharacteristicValue'),
- notifyBLECharacteristicValueChange: _.mockAsync('notifyBLECharacteristicValueChange'),
- onBLEConnectionStateChange: _.mockAsync('onBLEConnectionStateChange'),
- onBLECharacteristicValueChange: _.mockAsync('onBLECharacteristicValueChange'),
- startBeaconDiscovery: _.mockAsync('startBeaconDiscovery'),
- stopBeaconDiscovery: _.mockAsync('stopBeaconDiscovery'),
- getBeacons: _.mockAsync('getBeacons'),
- onBeaconUpdate: _.mockAsync('onBeaconUpdate'),
- onBeaconServiceChange: _.mockAsync('onBeaconServiceChange'),
- setScreenBrightness: _.mockAsync('setScreenBrightness'),
- getScreenBrightness: _.mockAsync('getScreenBrightness'),
- setKeepScreenOn: _.mockAsync('setKeepScreenOn'),
- onUserCaptureScreen: _.mockAsync('onUserCaptureScreen'),
- vibrateLong: _.mockAsync('vibrateLong'),
- vibrateShort: _.mockAsync('vibrateShort'),
- addPhoneContact: _.mockAsync('addPhoneContact'),
- getHCEState: _.mockAsync('getHCEState'),
- startHCE: _.mockAsync('startHCE'),
- stopHCE: _.mockAsync('stopHCE'),
- onHCEMessage: _.mockAsync('onHCEMessage'),
- sendHCEMessage: _.mockAsync('sendHCEMessage'),
- startWifi: _.mockAsync('startWifi'),
- stopWifi: _.mockAsync('stopWifi'),
- connectWifi: _.mockAsync('connectWifi'),
- getWifiList: _.mockAsync('getWifiList'),
- onGetWifiList: _.mockAsync('onGetWifiList'),
- setWifiList: _.mockAsync('setWifiList'),
- onWifiConnected: _.mockAsync('onWifiConnected'),
- getConnectedWifi: _.mockAsync('getConnectedWifi'),
- showToast: _.mockAsync('showToast'),
- showLoading: _.mockAsync('showLoading'),
- hideToast: _.mockAsync('hideToast'),
- hideLoading: _.mockAsync('hideLoading'),
- showModal: _.mockAsync('showModal'),
- showActionSheet: _.mockAsync('showActionSheet'),
- setNavigationBarTitle: _.mockAsync('setNavigationBarTitle'),
- showNavigationBarLoading: _.mockAsync('showNavigationBarLoading'),
- hideNavigationBarLoading: _.mockAsync('hideNavigationBarLoading'),
- setNavigationBarColor: _.mockAsync('setNavigationBarColor'),
- setTabBarBadge: _.mockAsync('setTabBarBadge'),
- removeTabBarBadge: _.mockAsync('removeTabBarBadge'),
- showTabBarRedDot: _.mockAsync('showTabBarRedDot'),
- hideTabBarRedDot: _.mockAsync('hideTabBarRedDot'),
- setTabBarStyle: _.mockAsync('setTabBarStyle'),
- setTabBarItem: _.mockAsync('setTabBarItem'),
- showTabBar: _.mockAsync('showTabBar'),
- hideTabBar: _.mockAsync('hideTabBar'),
- setBackgroundColor: _.mockAsync('setBackgroundColor'),
- setBackgroundTextStyle: _.mockAsync('setBackgroundTextStyle'),
- setTopBarText: _.mockAsync('setTopBarText'),
- createAnimation(transition = {}) {
- return new Animation(transition)
- },
- pageScrollTo: _.mockAsync('pageScrollTo'),
- createCanvasContext: _.mockAsync('createCanvasContext'),
- createContext: _.mockAsync('createContext'),
- drawCanvas: _.mockAsync('drawCanvas'),
- canvasToTempFilePath: _.mockAsync('canvasToTempFilePath'),
- canvasGetImageData: _.mockAsync('canvasGetImageData'),
- canvasPutImageData: _.mockAsync('canvasPutImageData'),
- startPullDownRefresh: _.mockAsync('startPullDownRefresh'),
- stopPullDownRefresh: _.mockAsync('stopPullDownRefresh'),
- createWorker: _.mockAsync('createWorker'),
-
-
-
-
-
-
-
- ...dataApi,
-
- chooseLocation(options = {}) {
- _.runInAsync(options, {
- errMsg: 'chooseLocation:ok',
- address: '广东省广州市海珠区tit创意园品牌街',
- name: '腾讯微信总部',
- latitude: 23.1001,
- longitude: 113.32456,
- })
- },
- getLocation(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getLocation:ok',
- accuracy: 65,
- altitude: 0,
- latitude: 23.12908,
- longitude: 113.26436,
- speed: -1,
- verticalAccuracy: 65,
- horizontalAccuracy: 65,
- })
- },
- openLocation: _.mockAsync('openLocation'),
-
-
-
- ...openApi,
-
- getUpdateManager() {
- return new UpdateManager()
- },
-
-
-
- reportMonitor: _.mockSync(null),
-
-
-
- canIUse: _.mockSync(true),
-
-
-
- getLogManager: _.mockSync(console),
- setEnableDebug: _.mockSync(null),
-
- getExtConfig(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getExtConfig:ok',
- extConfig: wx.getExtConfigSync(),
- })
- },
- getExtConfigSync() {
- return {}
- },
-
- createMapContext(...args) {
- return new MapContext(...args)
- },
-
- navigateTo: _.mockAsync('navigateTo'),
- redirectTo: _.mockAsync('redirectTo'),
- switchTab: _.mockAsync('switchTab'),
- navigateBack: _.mockAsync('navigateBack'),
- reLaunch: _.mockAsync('reLaunch'),
-
- getShareInfo(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getShareInfo:ok',
- encryptedData: 'CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew==',
- iv: 'r7BXXKkLb8qrSNn05n0qiA==',
- })
- },
- hideShareMenu: _.mockAsync('hideShareMenu'),
- showShareMenu: _.mockAsync('showShareMenu'),
- updateShareMenu: _.mockAsync('updateShareMenu'),
-
- getSystemInfo(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getSystemInfo:ok',
- ...wx.getSystemInfoSync(),
- })
- },
- getSystemInfoSync() {
- return {
- SDKVersion: '2.3.0',
- batteryLevel: 100,
- benchmarkLevel: 1,
- brand: 'devtools',
- fontSizeSetting: 16,
- language: 'zh_CN',
- model: 'iPhone 7 Plus',
- pixelRatio: 3,
- platform: 'devtools',
- screenHeight: 736,
- screenWidth: 414,
- statusBarHeight: 20,
- system: 'iOS 10.0.1',
- version: '6.6.3',
- windowHeight: 672,
- windowWidth: 414,
- }
- },
-
- createSelectorQuery() {
- return {
- in(compInst) {
- return compInst.createSelectorQuery()
- },
- }
- },
- createIntersectionObserver(compInst, options) {
- return compInst.createIntersectionObserver(options)
- },
- nextTick(func) {
- nextTickQueue.push(func)
- if (nextTickTimer) return
- nextTickTimer = setTimeout(() => {
- const funcQueue = nextTickQueue
- nextTickQueue = []
- nextTickTimer = null
- for (const func of funcQueue) {
- if (func) func()
- }
- }, 0)
- },
- }
- }),
- (function(module, exports) {
- class Animation {
- constructor(option = {}) {
- this.actions = []
- this.currentTransform = []
- this.currentStepAnimates = []
- this.option = {
- transition: {
- duration: option.duration !== undefined ? option.duration : 400,
- timingFunction: option.timingFunction !== undefined ? option.timingFunction : 'linear',
- delay: option.delay !== undefined ? option.delay : 0,
- },
- transformOrigin: option.transformOrigin || '50% 50% 0',
- }
- }
- export() {
- const actions = this.actions
- this.actions = []
- return {actions}
- }
- step(option = {}) {
- this.currentStepAnimates.forEach((animate) => {
- if (animate.type !== 'style') {
- this.currentTransform[animate.type] = animate
- } else {
- this.currentTransform[`${animate.type}.${animate.args[0]}`] = animate
- }
- })
- this.actions.push({
- animates: Object.keys(this.currentTransform).reduce((prev, key) => [...prev, this.currentTransform[key]], []),
- option: {
- transformOrigin: option.transformOrigin !== undefined ? option.transformOrigin : this.option.transformOrigin,
- transition: {
- duration: option.duration !== undefined ? option.duration : this.option.transition.duration,
- timingFunction: option.timingFunction !== undefined ? option.timingFunction : this.option.transition.timingFunction,
- delay: option.delay !== undefined ? option.delay : this.option.transition.delay,
- },
- },
- })
- this.currentStepAnimates = []
- return this
- }
- matrix(a = 1, b = 0, c = 0, d = 1, tx = 1, ty = 1) {
- this.currentStepAnimates.push({type: 'matrix', args: [a, b, c, d, tx, ty]})
- return this
- }
- matrix3d(a1 = 1, b1 = 0, c1 = 0, d1 = 0, a2 = 0, b2 = 1, c2 = 0, d2 = 0, a3 = 0, b3 = 0, c3 = 1, d3 = 0, a4 = 0, b4 = 0, c4 = 0, d4 = 1) {
- this.currentStepAnimates.push({type: 'matrix3d', args: [a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4]})
- this.stepping = false
- return this
- }
- rotate(angle = 0) {
- this.currentStepAnimates.push({type: 'rotate', args: [angle]})
- return this
- }
- rotate3d(x = 0, y = 0, z = 0, a = 0) {
- this.currentStepAnimates.push({type: 'rotate3d', args: [x, y, z, a]})
- this.stepping = false
- return this
- }
- rotateX(a = 0) {
- this.currentStepAnimates.push({type: 'rotateX', args: [a]})
- this.stepping = false
- return this
- }
- rotateY(a = 0) {
- this.currentStepAnimates.push({type: 'rotateY', args: [a]})
- this.stepping = false
- return this
- }
- rotateZ(a = 0) {
- this.currentStepAnimates.push({type: 'rotateZ', args: [a]})
- this.stepping = false
- return this
- }
- scale(sx = 1, sy) {
- this.currentStepAnimates.push({type: 'scale', args: [sx, sy !== undefined ? sy : sx]})
- return this
- }
- scale3d(sx = 1, sy = 1, sz = 1) {
- this.currentStepAnimates.push({type: 'scale3d', args: [sx, sy, sz]})
- return this
- }
- scaleX(s = 1) {
- this.currentStepAnimates.push({type: 'scaleX', args: [s]})
- return this
- }
- scaleY(s = 1) {
- this.currentStepAnimates.push({type: 'scaleY', args: [s]})
- return this
- }
- scaleZ(s = 1) {
- this.currentStepAnimates.push({type: 'scaleZ', args: [s]})
- return this
- }
- skew(ax = 0, ay = 0) {
- this.currentStepAnimates.push({type: 'skew', args: [ax, ay]})
- return this
- }
- skewX(a = 0) {
- this.currentStepAnimates.push({type: 'skewX', args: [a]})
- return this
- }
- skewY(a = 0) {
- this.currentStepAnimates.push({type: 'skewY', args: [a]})
- return this
- }
- translate(tx = 0, ty = 0) {
- this.currentStepAnimates.push({type: 'translate', args: [tx, ty]})
- return this
- }
- translate3d(tx = 0, ty = 0, tz = 0) {
- this.currentStepAnimates.push({type: 'translate3d', args: [tx, ty, tz]})
- return this
- }
- translateX(t = 0) {
- this.currentStepAnimates.push({type: 'translateX', args: [t]})
- return this
- }
- translateY(t = 0) {
- this.currentStepAnimates.push({type: 'translateY', args: [t]})
- return this
- }
- translateZ(t = 0) {
- this.currentStepAnimates.push({type: 'translateZ', args: [t]})
- return this
- }
- opacity(value) {
- this.currentStepAnimates.push({type: 'style', args: ['opacity', value]})
- return this
- }
- backgroundColor(value) {
- this.currentStepAnimates.push({type: 'style', args: ['background-color', value]})
- return this
- }
- width(value) {
- this.currentStepAnimates.push({type: 'style', args: ['width', typeof value === 'number' ? value + 'px' : value]})
- return this
- }
- height(value) {
- this.currentStepAnimates.push({type: 'style', args: ['height', typeof value === 'number' ? value + 'px' : value]})
- return this
- }
- left(value) {
- this.currentStepAnimates.push({type: 'style', args: ['left', typeof value === 'number' ? value + 'px' : value]})
- return this
- }
- right(value) {
- this.currentStepAnimates.push({type: 'style', args: ['right', typeof value === 'number' ? value + 'px' : value]})
- return this
- }
- top(value) {
- this.currentStepAnimates.push({type: 'style', args: ['top', typeof value === 'number' ? value + 'px' : value]})
- return this
- }
- bottom(value) {
- this.currentStepAnimates.push({type: 'style', args: ['bottom', typeof value === 'number' ? value + 'px' : value]})
- return this
- }
- }
- module.exports = Animation
- }),
- (function(module, exports, __webpack_require__) {
- const _ = __webpack_require__(12)
- class MapContext {
- constructor(id, parent) {
- this._exparserNode = parent.selectComponent(`#${id}`)
- }
- getCenterLocation(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getMapCenterLocation:ok',
- latitude: 39.92,
- longitude: 116.46,
- })
- }
- getRegion(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getMapRegion:ok',
- northeast: {
- latitude: 39.92493685384383,
- longitude: 116.47287460327148,
- },
- southwest: {
- latitude: 39.91506279020459,
- longitude: 116.44712539672851,
- },
- })
- }
- getScale(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getMapScale:ok',
- scale: 14,
- })
- }
- get includePoints() {
- return _.mockAsync('includePoints')
- }
- get moveToLocation() {
- return _.mockSync(null)
- }
- get translateMarker() {
- return _.mockAsync('translateMarker')
- }
- }
- module.exports = MapContext
- }),
- (function(module, exports) {
- class UpdateManager {
- constructor() {
- this.updateCallback = null
- }
- applyUpdate() {
- setTimeout(() => {
- if (this.updateCallback && typeof this.updateCallback === 'function') {
- this.updateCallback()
- }
- }, 0)
- }
- onCheckForUpdate(callback) {
- setTimeout(() => {
- if (callback && typeof callback === 'function') {
- callback({hasUpdate: true})
- }
- }, 0)
- }
- onUpdateFailed() {}
- onUpdateReady(callback) {
- this.updateCallback = callback
- }
- }
- module.exports = UpdateManager
- }),
- (function(module, exports, __webpack_require__) {
- const _ = __webpack_require__(12)
- module.exports = {
- clearStorage(options) {
- const res = {errMsg: 'clearStorage:ok'}
- try {
- wx.clearStorageSync()
- } catch (err) {
- res.errMsg = `clearStorage:fail ${err.message}`
- }
- _.runInAsync(options, res)
- },
- clearStorageSync() {
- localStorage.clear()
- },
- getStorage(options) {
- const res = {errMsg: 'getStorage:ok'}
- try {
- res.data = wx.getStorageSync(options.key)
- } catch (err) {
- res.errMsg = `getStorage:fail ${err.message}`
- }
- _.runInAsync(options, res)
- },
- getStorageSync(key) {
- const res = localStorage.getItem(key)
- try {
- return JSON.parse(res)
- } catch (err) {
- return res
- }
- },
- getStorageInfo(options) {
- let res = {errMsg: 'getStorageInfo:ok'}
- try {
- const data = wx.getStorageInfoSync()
- res = Object.assign(res, data)
- } catch (err) {
- res.errMsg = `getStorageInfo:fail ${err.message}`
- }
- _.runInAsync(options, res)
- },
- getStorageInfoSync() {
- const length = localStorage.length
- const keys = []
- let currentSize = 0
- for (let i = 0; i < length; i++) {
- const key = localStorage.key(i)
- keys.push(key)
- currentSize += _.getSize(localStorage.getItem(key))
- }
- return {
- keys,
- currentSize,
- limitSize: 1024 * 10,
- }
- },
- removeStorage(options) {
- const res = {errMsg: 'removeStorage:ok'}
- try {
- wx.removeStorageSync(options.key)
- } catch (err) {
- res.errMsg = `removeStorage:fail ${err.message}`
- }
- _.runInAsync(options, res)
- },
- removeStorageSync(key) {
- localStorage.removeItem(key)
- },
- setStorage(options) {
- const res = {errMsg: 'setStorage:ok'}
- try {
- wx.setStorageSync(options.key, options.data)
- } catch (err) {
- res.errMsg = `setStorage:fail ${err.message}`
- }
- _.runInAsync(options, res)
- },
- setStorageSync(key, data) {
- localStorage.setItem(key, JSON.stringify(data))
- },
- }
- }),
- (function(module, exports, __webpack_require__) {
- const _ = __webpack_require__(12)
- module.exports = {
- getAccountInfoSync: _.mockSync({
- miniProgram: {appId: 'wx4f4bc4dec97d474b'},
- }),
- chooseAddress(options = {}) {
- _.runInAsync(options, {
- errMsg: 'chooseAddress:ok',
- cityName: '广州市',
- countyName: '海珠区',
- detailInfo: '新港中路397号',
- nationalCode: '510000',
- postalCode: '510000',
- provinceName: '广东省',
- telNumber: '020-81167888',
- userName: '张三',
- })
- },
- authorize: _.mockAsync('authorize'),
- addCard(options = {}) {
- const cardList = (options.cardList || []).map(item => ({
- code: 'this is a mock code',
- isSuccess: true,
- ...item,
- }))
- _.runInAsync(options, {
- errMsg: 'addCard:ok',
- cardList
- })
- },
- openCard: _.mockAsync('openCard'),
- reportAnalytics: _.mockSync(null),
- chooseInvoice(options = {}) {
- _.runInAsync(options, {
- errMsg: 'chooseInvoice:ok',
- invoiceInfo: {
- cardId: 'pjZ8Yt5crPbAouhFqFf6JFgZv4Lc',
- encryptCode: 'fbdt/fWy1VitQwhbKtSjNeR3BJyfpeJXfZjjGsdCXiM=',
- publisherAppId: 'wx00000000000000',
- },
- })
- },
- chooseInvoiceTitle(options = {}) {
- _.runInAsync(options, {
- errMsg: 'chooseInvoiceTitle:ok',
- bankAccount: '1209 0928 2210 301',
- bankName: '招商银行股份有限公司广州市体育东路支行',
- companyAddress: '广州市海珠区新港中路397号自编72号(商业街F5-1)',
- taxNumber: '91440101327598294H',
- telephone: '020-81167888',
- title: '广州腾讯科技有限公司',
- type: 0,
- })
- },
- checkSession: _.mockAsync('checkSession'),
- login(options = {}) {
- _.runInAsync(options, {
- errMsg: 'login:ok',
- code: '033UAswz1j8Fjb0lT4yz1Wmrwz1UAsw9',
- })
- },
- navigateBackMiniProgram: _.mockAsync('navigateBackMiniProgram'),
- navigateToMiniProgram: _.mockAsync('navigateToMiniProgram'),
- requestPayment: _.mockAsync('requestPayment'),
- getSetting(options = {}) {
- _.runInAsync(options, {
- errMsg: 'getSetting:ok',
- authSetting: {
- 'scope.address': true,
- 'scope.invoice': true,
- 'scope.invoiceTitle': true,
- 'scope.subscribemsg': true,
- },
- })
- },
- openSetting(options = {}) {
- _.runInAsync(options, {
- errMsg: 'openSetting:ok',
- authSetting: {
- 'scope.address': true,
- 'scope.invoice': true,
- 'scope.invoiceTitle': true,
- 'scope.subscribemsg': true,
- },
- })
- },
- checkIsSoterEnrolledInDevice(options = {}) {
- _.runInAsync(options, {
- errMsg: 'checkIsSoterEnrolledInDevice:ok',
- isEnrolled: true,
- })
- },
- checkIsSupportSoterAuthentication(options = {}) {
- _.runInAsync(options, {
- errMsg: 'checkIsSupportSoterAuthentication:ok',
- supportMode: ['fingerPrint'],
- })
- },
- startSoterAuthentication: _.mockAsync('startSoterAuthentication'),
- getUserInfo(options) {
- _.runInAsync(options, {
- errMsg: 'getUserInfo:ok',
- userInfo: {
- nickName: 'Band',
- gender: 1,
- language: 'zh_CN',
- city: 'Guangzhou',
- province: 'Guangdong',
- country: 'CN',
- avatarUrl: 'http://wx.qlogo.cn/mmopen/vi_32/aSKcBBPpibyKNicHNTMM0qJVh8Kjgiak2AHWr8MHM4WgMEm7GFhsf8OYrySdbvAMvTsw3mo8ibKicsnfN5pRjl1p8HQ/0',
- },
- rawData: '{"nickName":"Band","gender":1,"language":"zh_CN","city":"Guangzhou","province":"Guangdong","country":"CN","avatarUrl":"http://wx.qlogo.cn/mmopen/vi_32/1vZvI39NWFQ9XM4LtQpFrQJ1xlgZxx3w7bQxKARol6503Iuswjjn6nIGBiaycAjAtpujxyzYsrztuuICqIM5ibXQ/0"}HyVFkGl5F5OQWJZZaNzBBg==',
- signature: '75e81ceda165f4ffa64f4068af58c64b8f54b88c',
- encryptedData: 'CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew==',
- iv: 'r7BXXKkLb8qrSNn05n0qiA==',
- })
- },
- getWeRunData(options) {
- _.runInAsync(options, {
- errMsg: 'getUserInfo:ok',
- encryptedData: 'XoLUxF76jN/OsfTGUqF/ZqRn+2PtO66lAMg/g0D3bg1L2/Nds8gTQrH7fGmbTgGtUC2R9lbJh7fLEaO9boeCqru1Em2BD/IbfN6lI/nu55himuBvypESz+H9uV7izLP/',
- iv: 'r7BXXKkLb8qrSNn05n0qiA==',
- })
- },
- }
- })
- ]);
|