main.js 355 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId])
  10. /******/ return installedModules[moduleId].exports;
  11. /******/
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // identity function for calling harmony imports with the correct context
  37. /******/ __webpack_require__.i = function(value) { return value; };
  38. /******/
  39. /******/ // define getter function for harmony exports
  40. /******/ __webpack_require__.d = function(exports, name, getter) {
  41. /******/ if(!__webpack_require__.o(exports, name)) {
  42. /******/ Object.defineProperty(exports, name, {
  43. /******/ configurable: false,
  44. /******/ enumerable: true,
  45. /******/ get: getter
  46. /******/ });
  47. /******/ }
  48. /******/ };
  49. /******/
  50. /******/ // getDefaultExport function for compatibility with non-harmony modules
  51. /******/ __webpack_require__.n = function(module) {
  52. /******/ var getter = module && module.__esModule ?
  53. /******/ function getDefault() { return module['default']; } :
  54. /******/ function getModuleExports() { return module; };
  55. /******/ __webpack_require__.d(getter, 'a', getter);
  56. /******/ return getter;
  57. /******/ };
  58. /******/
  59. /******/ // Object.prototype.hasOwnProperty.call
  60. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  61. /******/
  62. /******/ // __webpack_public_path__
  63. /******/ __webpack_require__.p = "";
  64. /******/
  65. /******/ // Load entry module and return exports
  66. /******/ return __webpack_require__(__webpack_require__.s = 87);
  67. /******/ })
  68. /************************************************************************/
  69. /******/ ([
  70. /* 0 */
  71. /***/ (function(module, exports, __webpack_require__) {
  72. "use strict";
  73. // Utilities
  74. //
  75. function _class(obj) { return Object.prototype.toString.call(obj); }
  76. function isString(obj) { return _class(obj) === '[object String]'; }
  77. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  78. function has(object, key) {
  79. return _hasOwnProperty.call(object, key);
  80. }
  81. // Merge objects
  82. //
  83. function assign(obj /*from1, from2, from3, ...*/) {
  84. var sources = Array.prototype.slice.call(arguments, 1);
  85. sources.forEach(function (source) {
  86. if (!source) { return; }
  87. if (typeof source !== 'object') {
  88. throw new TypeError(source + 'must be object');
  89. }
  90. Object.keys(source).forEach(function (key) {
  91. obj[key] = source[key];
  92. });
  93. });
  94. return obj;
  95. }
  96. // Remove element from array and put another array at those position.
  97. // Useful for some operations with tokens
  98. function arrayReplaceAt(src, pos, newElements) {
  99. return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
  100. }
  101. ////////////////////////////////////////////////////////////////////////////////
  102. function isValidEntityCode(c) {
  103. /*eslint no-bitwise:0*/
  104. // broken sequence
  105. if (c >= 0xD800 && c <= 0xDFFF) { return false; }
  106. // never used
  107. if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
  108. if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
  109. // control codes
  110. if (c >= 0x00 && c <= 0x08) { return false; }
  111. if (c === 0x0B) { return false; }
  112. if (c >= 0x0E && c <= 0x1F) { return false; }
  113. if (c >= 0x7F && c <= 0x9F) { return false; }
  114. // out of range
  115. if (c > 0x10FFFF) { return false; }
  116. return true;
  117. }
  118. function fromCodePoint(c) {
  119. /*eslint no-bitwise:0*/
  120. if (c > 0xffff) {
  121. c -= 0x10000;
  122. var surrogate1 = 0xd800 + (c >> 10),
  123. surrogate2 = 0xdc00 + (c & 0x3ff);
  124. return String.fromCharCode(surrogate1, surrogate2);
  125. }
  126. return String.fromCharCode(c);
  127. }
  128. var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
  129. var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
  130. var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
  131. var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
  132. var entities = __webpack_require__(11);
  133. function replaceEntityPattern(match, name) {
  134. var code = 0;
  135. if (has(entities, name)) {
  136. return entities[name];
  137. }
  138. if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
  139. code = name[1].toLowerCase() === 'x' ?
  140. parseInt(name.slice(2), 16)
  141. :
  142. parseInt(name.slice(1), 10);
  143. if (isValidEntityCode(code)) {
  144. return fromCodePoint(code);
  145. }
  146. }
  147. return match;
  148. }
  149. /*function replaceEntities(str) {
  150. if (str.indexOf('&') < 0) { return str; }
  151. return str.replace(ENTITY_RE, replaceEntityPattern);
  152. }*/
  153. function unescapeMd(str) {
  154. if (str.indexOf('\\') < 0) { return str; }
  155. return str.replace(UNESCAPE_MD_RE, '$1');
  156. }
  157. function unescapeAll(str) {
  158. if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
  159. return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
  160. if (escaped) { return escaped; }
  161. return replaceEntityPattern(match, entity);
  162. });
  163. }
  164. ////////////////////////////////////////////////////////////////////////////////
  165. var HTML_ESCAPE_TEST_RE = /[&<>"]/;
  166. var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
  167. var HTML_REPLACEMENTS = {
  168. '&': '&amp;',
  169. '<': '&lt;',
  170. '>': '&gt;',
  171. '"': '&quot;'
  172. };
  173. function replaceUnsafeChar(ch) {
  174. return HTML_REPLACEMENTS[ch];
  175. }
  176. function escapeHtml(str) {
  177. if (HTML_ESCAPE_TEST_RE.test(str)) {
  178. return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
  179. }
  180. return str;
  181. }
  182. ////////////////////////////////////////////////////////////////////////////////
  183. var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
  184. function escapeRE(str) {
  185. return str.replace(REGEXP_ESCAPE_RE, '\\$&');
  186. }
  187. ////////////////////////////////////////////////////////////////////////////////
  188. function isSpace(code) {
  189. switch (code) {
  190. case 0x09:
  191. case 0x20:
  192. return true;
  193. }
  194. return false;
  195. }
  196. // Zs (unicode class) || [\t\f\v\r\n]
  197. function isWhiteSpace(code) {
  198. if (code >= 0x2000 && code <= 0x200A) { return true; }
  199. switch (code) {
  200. case 0x09: // \t
  201. case 0x0A: // \n
  202. case 0x0B: // \v
  203. case 0x0C: // \f
  204. case 0x0D: // \r
  205. case 0x20:
  206. case 0xA0:
  207. case 0x1680:
  208. case 0x202F:
  209. case 0x205F:
  210. case 0x3000:
  211. return true;
  212. }
  213. return false;
  214. }
  215. ////////////////////////////////////////////////////////////////////////////////
  216. /*eslint-disable max-len*/
  217. var UNICODE_PUNCT_RE = __webpack_require__(5);
  218. // Currently without astral characters support.
  219. function isPunctChar(ch) {
  220. return UNICODE_PUNCT_RE.test(ch);
  221. }
  222. // Markdown ASCII punctuation characters.
  223. //
  224. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  225. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  226. //
  227. // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
  228. //
  229. function isMdAsciiPunct(ch) {
  230. switch (ch) {
  231. case 0x21/* ! */:
  232. case 0x22/* " */:
  233. case 0x23/* # */:
  234. case 0x24/* $ */:
  235. case 0x25/* % */:
  236. case 0x26/* & */:
  237. case 0x27/* ' */:
  238. case 0x28/* ( */:
  239. case 0x29/* ) */:
  240. case 0x2A/* * */:
  241. case 0x2B/* + */:
  242. case 0x2C/* , */:
  243. case 0x2D/* - */:
  244. case 0x2E/* . */:
  245. case 0x2F/* / */:
  246. case 0x3A/* : */:
  247. case 0x3B/* ; */:
  248. case 0x3C/* < */:
  249. case 0x3D/* = */:
  250. case 0x3E/* > */:
  251. case 0x3F/* ? */:
  252. case 0x40/* @ */:
  253. case 0x5B/* [ */:
  254. case 0x5C/* \ */:
  255. case 0x5D/* ] */:
  256. case 0x5E/* ^ */:
  257. case 0x5F/* _ */:
  258. case 0x60/* ` */:
  259. case 0x7B/* { */:
  260. case 0x7C/* | */:
  261. case 0x7D/* } */:
  262. case 0x7E/* ~ */:
  263. return true;
  264. default:
  265. return false;
  266. }
  267. }
  268. // Hepler to unify [reference labels].
  269. //
  270. function normalizeReference(str) {
  271. // use .toUpperCase() instead of .toLowerCase()
  272. // here to avoid a conflict with Object.prototype
  273. // members (most notably, `__proto__`)
  274. return str.trim().replace(/\s+/g, ' ').toUpperCase();
  275. }
  276. ////////////////////////////////////////////////////////////////////////////////
  277. // Re-export libraries commonly used in both markdown-it and its plugins,
  278. // so plugins won't have to depend on them explicitly, which reduces their
  279. // bundled size (e.g. a browser build).
  280. //
  281. exports.lib = {};
  282. exports.lib.mdurl = __webpack_require__(15);
  283. exports.lib.ucmicro = __webpack_require__(85);
  284. exports.assign = assign;
  285. exports.isString = isString;
  286. exports.has = has;
  287. exports.unescapeMd = unescapeMd;
  288. exports.unescapeAll = unescapeAll;
  289. exports.isValidEntityCode = isValidEntityCode;
  290. exports.fromCodePoint = fromCodePoint;
  291. // exports.replaceEntities = replaceEntities;
  292. exports.escapeHtml = escapeHtml;
  293. exports.arrayReplaceAt = arrayReplaceAt;
  294. exports.isSpace = isSpace;
  295. exports.isWhiteSpace = isWhiteSpace;
  296. exports.isMdAsciiPunct = isMdAsciiPunct;
  297. exports.isPunctChar = isPunctChar;
  298. exports.escapeRE = escapeRE;
  299. exports.normalizeReference = normalizeReference;
  300. /***/ }),
  301. /* 1 */
  302. /***/ (function(module, exports, __webpack_require__) {
  303. /* WEBPACK VAR INJECTION */(function(setImmediate, global) {;(function() {
  304. "use strict"
  305. function Vnode(tag, key, attrs0, children, text, dom) {
  306. return {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}
  307. }
  308. Vnode.normalize = function(node) {
  309. if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)
  310. if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node === false ? "" : node, undefined, undefined)
  311. return node
  312. }
  313. Vnode.normalizeChildren = function normalizeChildren(children) {
  314. for (var i = 0; i < children.length; i++) {
  315. children[i] = Vnode.normalize(children[i])
  316. }
  317. return children
  318. }
  319. var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
  320. var selectorCache = {}
  321. var hasOwn = {}.hasOwnProperty
  322. function compileSelector(selector) {
  323. var match, tag = "div", classes = [], attrs = {}
  324. while (match = selectorParser.exec(selector)) {
  325. var type = match[1], value = match[2]
  326. if (type === "" && value !== "") tag = value
  327. else if (type === "#") attrs.id = value
  328. else if (type === ".") classes.push(value)
  329. else if (match[3][0] === "[") {
  330. var attrValue = match[6]
  331. if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\")
  332. if (match[4] === "class") classes.push(attrValue)
  333. else attrs[match[4]] = attrValue || true
  334. }
  335. }
  336. if (classes.length > 0) attrs.className = classes.join(" ")
  337. return selectorCache[selector] = {tag: tag, attrs: attrs}
  338. }
  339. function execSelector(state, attrs, children) {
  340. var hasAttrs = false, childList, text
  341. var className = attrs.className || attrs.class
  342. for (var key in state.attrs) {
  343. if (hasOwn.call(state.attrs, key)) {
  344. attrs[key] = state.attrs[key]
  345. }
  346. }
  347. if (className !== undefined) {
  348. if (attrs.class !== undefined) {
  349. attrs.class = undefined
  350. attrs.className = className
  351. }
  352. if (state.attrs.className != null) {
  353. attrs.className = state.attrs.className + " " + className
  354. }
  355. }
  356. for (var key in attrs) {
  357. if (hasOwn.call(attrs, key) && key !== "key") {
  358. hasAttrs = true
  359. break
  360. }
  361. }
  362. if (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === "#") {
  363. text = children[0].children
  364. } else {
  365. childList = children
  366. }
  367. return Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)
  368. }
  369. function hyperscript(selector) {
  370. // Because sloppy mode sucks
  371. var attrs = arguments[1], start = 2, children
  372. if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") {
  373. throw Error("The selector must be either a string or a component.");
  374. }
  375. if (typeof selector === "string") {
  376. var cached = selectorCache[selector] || compileSelector(selector)
  377. }
  378. if (attrs == null) {
  379. attrs = {}
  380. } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) {
  381. attrs = {}
  382. start = 1
  383. }
  384. if (arguments.length === start + 1) {
  385. children = arguments[start]
  386. if (!Array.isArray(children)) children = [children]
  387. } else {
  388. children = []
  389. while (start < arguments.length) children.push(arguments[start++])
  390. }
  391. var normalized = Vnode.normalizeChildren(children)
  392. if (typeof selector === "string") {
  393. return execSelector(cached, attrs, normalized)
  394. } else {
  395. return Vnode(selector, attrs.key, attrs, normalized)
  396. }
  397. }
  398. hyperscript.trust = function(html) {
  399. if (html == null) html = ""
  400. return Vnode("<", undefined, undefined, html, undefined, undefined)
  401. }
  402. hyperscript.fragment = function(attrs1, children) {
  403. return Vnode("[", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)
  404. }
  405. var m = hyperscript
  406. /** @constructor */
  407. var PromisePolyfill = function(executor) {
  408. if (!(this instanceof PromisePolyfill)) throw new Error("Promise must be called with `new`")
  409. if (typeof executor !== "function") throw new TypeError("executor must be a function")
  410. var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)
  411. var instance = self._instance = {resolvers: resolvers, rejectors: rejectors}
  412. var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout
  413. function handler(list, shouldAbsorb) {
  414. return function execute(value) {
  415. var then
  416. try {
  417. if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") {
  418. if (value === self) throw new TypeError("Promise can't be resolved w/ itself")
  419. executeOnce(then.bind(value))
  420. }
  421. else {
  422. callAsync(function() {
  423. if (!shouldAbsorb && list.length === 0) console.error("Possible unhandled promise rejection:", value)
  424. for (var i = 0; i < list.length; i++) list[i](value)
  425. resolvers.length = 0, rejectors.length = 0
  426. instance.state = shouldAbsorb
  427. instance.retry = function() {execute(value)}
  428. })
  429. }
  430. }
  431. catch (e) {
  432. rejectCurrent(e)
  433. }
  434. }
  435. }
  436. function executeOnce(then) {
  437. var runs = 0
  438. function run(fn) {
  439. return function(value) {
  440. if (runs++ > 0) return
  441. fn(value)
  442. }
  443. }
  444. var onerror = run(rejectCurrent)
  445. try {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}
  446. }
  447. executeOnce(executor)
  448. }
  449. PromisePolyfill.prototype.then = function(onFulfilled, onRejection) {
  450. var self = this, instance = self._instance
  451. function handle(callback, list, next, state) {
  452. list.push(function(value) {
  453. if (typeof callback !== "function") next(value)
  454. else try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}
  455. })
  456. if (typeof instance.retry === "function" && state === instance.state) instance.retry()
  457. }
  458. var resolveNext, rejectNext
  459. var promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})
  460. handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)
  461. return promise
  462. }
  463. PromisePolyfill.prototype.catch = function(onRejection) {
  464. return this.then(null, onRejection)
  465. }
  466. PromisePolyfill.resolve = function(value) {
  467. if (value instanceof PromisePolyfill) return value
  468. return new PromisePolyfill(function(resolve) {resolve(value)})
  469. }
  470. PromisePolyfill.reject = function(value) {
  471. return new PromisePolyfill(function(resolve, reject) {reject(value)})
  472. }
  473. PromisePolyfill.all = function(list) {
  474. return new PromisePolyfill(function(resolve, reject) {
  475. var total = list.length, count = 0, values = []
  476. if (list.length === 0) resolve([])
  477. else for (var i = 0; i < list.length; i++) {
  478. (function(i) {
  479. function consume(value) {
  480. count++
  481. values[i] = value
  482. if (count === total) resolve(values)
  483. }
  484. if (list[i] != null && (typeof list[i] === "object" || typeof list[i] === "function") && typeof list[i].then === "function") {
  485. list[i].then(consume, reject)
  486. }
  487. else consume(list[i])
  488. })(i)
  489. }
  490. })
  491. }
  492. PromisePolyfill.race = function(list) {
  493. return new PromisePolyfill(function(resolve, reject) {
  494. for (var i = 0; i < list.length; i++) {
  495. list[i].then(resolve, reject)
  496. }
  497. })
  498. }
  499. if (typeof window !== "undefined") {
  500. if (typeof window.Promise === "undefined") window.Promise = PromisePolyfill
  501. var PromisePolyfill = window.Promise
  502. } else if (typeof global !== "undefined") {
  503. if (typeof global.Promise === "undefined") global.Promise = PromisePolyfill
  504. var PromisePolyfill = global.Promise
  505. } else {
  506. }
  507. var buildQueryString = function(object) {
  508. if (Object.prototype.toString.call(object) !== "[object Object]") return ""
  509. var args = []
  510. for (var key0 in object) {
  511. destructure(key0, object[key0])
  512. }
  513. return args.join("&")
  514. function destructure(key0, value) {
  515. if (Array.isArray(value)) {
  516. for (var i = 0; i < value.length; i++) {
  517. destructure(key0 + "[" + i + "]", value[i])
  518. }
  519. }
  520. else if (Object.prototype.toString.call(value) === "[object Object]") {
  521. for (var i in value) {
  522. destructure(key0 + "[" + i + "]", value[i])
  523. }
  524. }
  525. else args.push(encodeURIComponent(key0) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : ""))
  526. }
  527. }
  528. var FILE_PROTOCOL_REGEX = new RegExp("^file://", "i")
  529. var _8 = function($window, Promise) {
  530. var callbackCount = 0
  531. var oncompletion
  532. function setCompletionCallback(callback) {oncompletion = callback}
  533. function finalizer() {
  534. var count = 0
  535. function complete() {if (--count === 0 && typeof oncompletion === "function") oncompletion()}
  536. return function finalize(promise0) {
  537. var then0 = promise0.then
  538. promise0.then = function() {
  539. count++
  540. var next = then0.apply(promise0, arguments)
  541. next.then(complete, function(e) {
  542. complete()
  543. if (count === 0) throw e
  544. })
  545. return finalize(next)
  546. }
  547. return promise0
  548. }
  549. }
  550. function normalize(args, extra) {
  551. if (typeof args === "string") {
  552. var url = args
  553. args = extra || {}
  554. if (args.url == null) args.url = url
  555. }
  556. return args
  557. }
  558. function request(args, extra) {
  559. var finalize = finalizer()
  560. args = normalize(args, extra)
  561. var promise0 = new Promise(function(resolve, reject) {
  562. if (args.method == null) args.method = "GET"
  563. args.method = args.method.toUpperCase()
  564. var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true)
  565. if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify
  566. if (typeof args.deserialize !== "function") args.deserialize = deserialize
  567. if (typeof args.extract !== "function") args.extract = extract
  568. args.url = interpolate(args.url, args.data)
  569. if (useBody) args.data = args.serialize(args.data)
  570. else args.url = assemble(args.url, args.data)
  571. var xhr = new $window.XMLHttpRequest(),
  572. aborted = false,
  573. _abort = xhr.abort
  574. xhr.abort = function abort() {
  575. aborted = true
  576. _abort.call(xhr)
  577. }
  578. xhr.open(args.method, args.url, typeof args.async === "boolean" ? args.async : true, typeof args.user === "string" ? args.user : undefined, typeof args.password === "string" ? args.password : undefined)
  579. if (args.serialize === JSON.stringify && useBody) {
  580. xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8")
  581. }
  582. if (args.deserialize === deserialize) {
  583. xhr.setRequestHeader("Accept", "application/json, text/*")
  584. }
  585. if (args.withCredentials) xhr.withCredentials = args.withCredentials
  586. for (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {
  587. xhr.setRequestHeader(key, args.headers[key])
  588. }
  589. if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr
  590. xhr.onreadystatechange = function() {
  591. // Don't throw errors on xhr.abort().
  592. if(aborted) return
  593. if (xhr.readyState === 4) {
  594. try {
  595. var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))
  596. if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {
  597. resolve(cast(args.type, response))
  598. }
  599. else {
  600. var error = new Error(xhr.responseText)
  601. for (var key in response) error[key] = response[key]
  602. reject(error)
  603. }
  604. }
  605. catch (e) {
  606. reject(e)
  607. }
  608. }
  609. }
  610. if (useBody && (args.data != null)) xhr.send(args.data)
  611. else xhr.send()
  612. })
  613. return args.background === true ? promise0 : finalize(promise0)
  614. }
  615. function jsonp(args, extra) {
  616. var finalize = finalizer()
  617. args = normalize(args, extra)
  618. var promise0 = new Promise(function(resolve, reject) {
  619. var callbackName = args.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + callbackCount++
  620. var script = $window.document.createElement("script")
  621. $window[callbackName] = function(data) {
  622. script.parentNode.removeChild(script)
  623. resolve(cast(args.type, data))
  624. delete $window[callbackName]
  625. }
  626. script.onerror = function() {
  627. script.parentNode.removeChild(script)
  628. reject(new Error("JSONP request failed"))
  629. delete $window[callbackName]
  630. }
  631. if (args.data == null) args.data = {}
  632. args.url = interpolate(args.url, args.data)
  633. args.data[args.callbackKey || "callback"] = callbackName
  634. script.src = assemble(args.url, args.data)
  635. $window.document.documentElement.appendChild(script)
  636. })
  637. return args.background === true? promise0 : finalize(promise0)
  638. }
  639. function interpolate(url, data) {
  640. if (data == null) return url
  641. var tokens = url.match(/:[^\/]+/gi) || []
  642. for (var i = 0; i < tokens.length; i++) {
  643. var key = tokens[i].slice(1)
  644. if (data[key] != null) {
  645. url = url.replace(tokens[i], data[key])
  646. }
  647. }
  648. return url
  649. }
  650. function assemble(url, data) {
  651. var querystring = buildQueryString(data)
  652. if (querystring !== "") {
  653. var prefix = url.indexOf("?") < 0 ? "?" : "&"
  654. url += prefix + querystring
  655. }
  656. return url
  657. }
  658. function deserialize(data) {
  659. try {return data !== "" ? JSON.parse(data) : null}
  660. catch (e) {throw new Error(data)}
  661. }
  662. function extract(xhr) {return xhr.responseText}
  663. function cast(type0, data) {
  664. if (typeof type0 === "function") {
  665. if (Array.isArray(data)) {
  666. for (var i = 0; i < data.length; i++) {
  667. data[i] = new type0(data[i])
  668. }
  669. }
  670. else return new type0(data)
  671. }
  672. return data
  673. }
  674. return {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}
  675. }
  676. var requestService = _8(window, PromisePolyfill)
  677. var coreRenderer = function($window) {
  678. var $doc = $window.document
  679. var $emptyFragment = $doc.createDocumentFragment()
  680. var onevent
  681. function setEventCallback(callback) {return onevent = callback}
  682. //create
  683. function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {
  684. for (var i = start; i < end; i++) {
  685. var vnode = vnodes[i]
  686. if (vnode != null) {
  687. createNode(parent, vnode, hooks, ns, nextSibling)
  688. }
  689. }
  690. }
  691. function createNode(parent, vnode, hooks, ns, nextSibling) {
  692. var tag = vnode.tag
  693. if (typeof tag === "string") {
  694. vnode.state = {}
  695. if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
  696. switch (tag) {
  697. case "#": return createText(parent, vnode, nextSibling)
  698. case "<": return createHTML(parent, vnode, nextSibling)
  699. case "[": return createFragment(parent, vnode, hooks, ns, nextSibling)
  700. default: return createElement(parent, vnode, hooks, ns, nextSibling)
  701. }
  702. }
  703. else return createComponent(parent, vnode, hooks, ns, nextSibling)
  704. }
  705. function createText(parent, vnode, nextSibling) {
  706. vnode.dom = $doc.createTextNode(vnode.children)
  707. insertNode(parent, vnode.dom, nextSibling)
  708. return vnode.dom
  709. }
  710. function createHTML(parent, vnode, nextSibling) {
  711. var match1 = vnode.children.match(/^\s*?<(\w+)/im) || []
  712. var parent1 = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}[match1[1]] || "div"
  713. var temp = $doc.createElement(parent1)
  714. temp.innerHTML = vnode.children
  715. vnode.dom = temp.firstChild
  716. vnode.domSize = temp.childNodes.length
  717. var fragment = $doc.createDocumentFragment()
  718. var child
  719. while (child = temp.firstChild) {
  720. fragment.appendChild(child)
  721. }
  722. insertNode(parent, fragment, nextSibling)
  723. return fragment
  724. }
  725. function createFragment(parent, vnode, hooks, ns, nextSibling) {
  726. var fragment = $doc.createDocumentFragment()
  727. if (vnode.children != null) {
  728. var children = vnode.children
  729. createNodes(fragment, children, 0, children.length, hooks, null, ns)
  730. }
  731. vnode.dom = fragment.firstChild
  732. vnode.domSize = fragment.childNodes.length
  733. insertNode(parent, fragment, nextSibling)
  734. return fragment
  735. }
  736. function createElement(parent, vnode, hooks, ns, nextSibling) {
  737. var tag = vnode.tag
  738. switch (vnode.tag) {
  739. case "svg": ns = "http://www.w3.org/2000/svg"; break
  740. case "math": ns = "http://www.w3.org/1998/Math/MathML"; break
  741. }
  742. var attrs2 = vnode.attrs
  743. var is = attrs2 && attrs2.is
  744. var element = ns ?
  745. is ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :
  746. is ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)
  747. vnode.dom = element
  748. if (attrs2 != null) {
  749. setAttrs(vnode, attrs2, ns)
  750. }
  751. insertNode(parent, element, nextSibling)
  752. if (vnode.attrs != null && vnode.attrs.contenteditable != null) {
  753. setContentEditable(vnode)
  754. }
  755. else {
  756. if (vnode.text != null) {
  757. if (vnode.text !== "") element.textContent = vnode.text
  758. else vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)]
  759. }
  760. if (vnode.children != null) {
  761. var children = vnode.children
  762. createNodes(element, children, 0, children.length, hooks, null, ns)
  763. setLateAttrs(vnode)
  764. }
  765. }
  766. return element
  767. }
  768. function initComponent(vnode, hooks) {
  769. var sentinel
  770. if (typeof vnode.tag.view === "function") {
  771. vnode.state = Object.create(vnode.tag)
  772. sentinel = vnode.state.view
  773. if (sentinel.$$reentrantLock$$ != null) return $emptyFragment
  774. sentinel.$$reentrantLock$$ = true
  775. } else {
  776. vnode.state = void 0
  777. sentinel = vnode.tag
  778. if (sentinel.$$reentrantLock$$ != null) return $emptyFragment
  779. sentinel.$$reentrantLock$$ = true
  780. vnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === "function") ? new vnode.tag(vnode) : vnode.tag(vnode)
  781. }
  782. vnode._state = vnode.state
  783. if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
  784. initLifecycle(vnode._state, vnode, hooks)
  785. vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))
  786. if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument")
  787. sentinel.$$reentrantLock$$ = null
  788. }
  789. function createComponent(parent, vnode, hooks, ns, nextSibling) {
  790. initComponent(vnode, hooks)
  791. if (vnode.instance != null) {
  792. var element = createNode(parent, vnode.instance, hooks, ns, nextSibling)
  793. vnode.dom = vnode.instance.dom
  794. vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0
  795. insertNode(parent, element, nextSibling)
  796. return element
  797. }
  798. else {
  799. vnode.domSize = 0
  800. return $emptyFragment
  801. }
  802. }
  803. //update
  804. function updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {
  805. if (old === vnodes || old == null && vnodes == null) return
  806. else if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, undefined)
  807. else if (vnodes == null) removeNodes(old, 0, old.length, vnodes)
  808. else {
  809. if (old.length === vnodes.length) {
  810. var isUnkeyed = false
  811. for (var i = 0; i < vnodes.length; i++) {
  812. if (vnodes[i] != null && old[i] != null) {
  813. isUnkeyed = vnodes[i].key == null && old[i].key == null
  814. break
  815. }
  816. }
  817. if (isUnkeyed) {
  818. for (var i = 0; i < old.length; i++) {
  819. if (old[i] === vnodes[i]) continue
  820. else if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))
  821. else if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)
  822. else updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)
  823. }
  824. return
  825. }
  826. }
  827. recycling = recycling || isRecyclable(old, vnodes)
  828. if (recycling) {
  829. var pool = old.pool
  830. old = old.concat(old.pool)
  831. }
  832. var oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map
  833. while (oldEnd >= oldStart && end >= start) {
  834. var o = old[oldStart], v = vnodes[start]
  835. if (o === v && !recycling) oldStart++, start++
  836. else if (o == null) oldStart++
  837. else if (v == null) start++
  838. else if (o.key === v.key) {
  839. var shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)
  840. oldStart++, start++
  841. updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)
  842. if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)
  843. }
  844. else {
  845. var o = old[oldEnd]
  846. if (o === v && !recycling) oldEnd--, start++
  847. else if (o == null) oldEnd--
  848. else if (v == null) start++
  849. else if (o.key === v.key) {
  850. var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)
  851. updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)
  852. if (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))
  853. oldEnd--, start++
  854. }
  855. else break
  856. }
  857. }
  858. while (oldEnd >= oldStart && end >= start) {
  859. var o = old[oldEnd], v = vnodes[end]
  860. if (o === v && !recycling) oldEnd--, end--
  861. else if (o == null) oldEnd--
  862. else if (v == null) end--
  863. else if (o.key === v.key) {
  864. var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)
  865. updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)
  866. if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)
  867. if (o.dom != null) nextSibling = o.dom
  868. oldEnd--, end--
  869. }
  870. else {
  871. if (!map) map = getKeyMap(old, oldEnd)
  872. if (v != null) {
  873. var oldIndex = map[v.key]
  874. if (oldIndex != null) {
  875. var movable = old[oldIndex]
  876. var shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)
  877. updateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)
  878. insertNode(parent, toFragment(movable), nextSibling)
  879. old[oldIndex].skip = true
  880. if (movable.dom != null) nextSibling = movable.dom
  881. }
  882. else {
  883. var dom = createNode(parent, v, hooks, undefined, nextSibling)
  884. nextSibling = dom
  885. }
  886. }
  887. end--
  888. }
  889. if (end < start) break
  890. }
  891. createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)
  892. removeNodes(old, oldStart, oldEnd + 1, vnodes)
  893. }
  894. }
  895. function updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {
  896. var oldTag = old.tag, tag = vnode.tag
  897. if (oldTag === tag) {
  898. vnode.state = old.state
  899. vnode._state = old._state
  900. vnode.events = old.events
  901. if (!recycling && shouldNotUpdate(vnode, old)) return
  902. if (typeof oldTag === "string") {
  903. if (vnode.attrs != null) {
  904. if (recycling) {
  905. vnode.state = {}
  906. initLifecycle(vnode.attrs, vnode, hooks)
  907. }
  908. else updateLifecycle(vnode.attrs, vnode, hooks)
  909. }
  910. switch (oldTag) {
  911. case "#": updateText(old, vnode); break
  912. case "<": updateHTML(parent, old, vnode, nextSibling); break
  913. case "[": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break
  914. default: updateElement(old, vnode, recycling, hooks, ns)
  915. }
  916. }
  917. else updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)
  918. }
  919. else {
  920. removeNode(old, null)
  921. createNode(parent, vnode, hooks, ns, nextSibling)
  922. }
  923. }
  924. function updateText(old, vnode) {
  925. if (old.children.toString() !== vnode.children.toString()) {
  926. old.dom.nodeValue = vnode.children
  927. }
  928. vnode.dom = old.dom
  929. }
  930. function updateHTML(parent, old, vnode, nextSibling) {
  931. if (old.children !== vnode.children) {
  932. toFragment(old)
  933. createHTML(parent, vnode, nextSibling)
  934. }
  935. else vnode.dom = old.dom, vnode.domSize = old.domSize
  936. }
  937. function updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {
  938. updateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)
  939. var domSize = 0, children = vnode.children
  940. vnode.dom = null
  941. if (children != null) {
  942. for (var i = 0; i < children.length; i++) {
  943. var child = children[i]
  944. if (child != null && child.dom != null) {
  945. if (vnode.dom == null) vnode.dom = child.dom
  946. domSize += child.domSize || 1
  947. }
  948. }
  949. if (domSize !== 1) vnode.domSize = domSize
  950. }
  951. }
  952. function updateElement(old, vnode, recycling, hooks, ns) {
  953. var element = vnode.dom = old.dom
  954. switch (vnode.tag) {
  955. case "svg": ns = "http://www.w3.org/2000/svg"; break
  956. case "math": ns = "http://www.w3.org/1998/Math/MathML"; break
  957. }
  958. if (vnode.tag === "textarea") {
  959. if (vnode.attrs == null) vnode.attrs = {}
  960. if (vnode.text != null) {
  961. vnode.attrs.value = vnode.text //FIXME handle0 multiple children
  962. vnode.text = undefined
  963. }
  964. }
  965. updateAttrs(vnode, old.attrs, vnode.attrs, ns)
  966. if (vnode.attrs != null && vnode.attrs.contenteditable != null) {
  967. setContentEditable(vnode)
  968. }
  969. else if (old.text != null && vnode.text != null && vnode.text !== "") {
  970. if (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text
  971. }
  972. else {
  973. if (old.text != null) old.children = [Vnode("#", undefined, undefined, old.text, undefined, old.dom.firstChild)]
  974. if (vnode.text != null) vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)]
  975. updateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)
  976. }
  977. }
  978. function updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {
  979. if (recycling) {
  980. initComponent(vnode, hooks)
  981. } else {
  982. vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))
  983. if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument")
  984. if (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)
  985. updateLifecycle(vnode._state, vnode, hooks)
  986. }
  987. if (vnode.instance != null) {
  988. if (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)
  989. else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)
  990. vnode.dom = vnode.instance.dom
  991. vnode.domSize = vnode.instance.domSize
  992. }
  993. else if (old.instance != null) {
  994. removeNode(old.instance, null)
  995. vnode.dom = undefined
  996. vnode.domSize = 0
  997. }
  998. else {
  999. vnode.dom = old.dom
  1000. vnode.domSize = old.domSize
  1001. }
  1002. }
  1003. function isRecyclable(old, vnodes) {
  1004. if (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {
  1005. var oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0
  1006. var poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0
  1007. var vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0
  1008. if (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {
  1009. return true
  1010. }
  1011. }
  1012. return false
  1013. }
  1014. function getKeyMap(vnodes, end) {
  1015. var map = {}, i = 0
  1016. for (var i = 0; i < end; i++) {
  1017. var vnode = vnodes[i]
  1018. if (vnode != null) {
  1019. var key2 = vnode.key
  1020. if (key2 != null) map[key2] = i
  1021. }
  1022. }
  1023. return map
  1024. }
  1025. function toFragment(vnode) {
  1026. var count0 = vnode.domSize
  1027. if (count0 != null || vnode.dom == null) {
  1028. var fragment = $doc.createDocumentFragment()
  1029. if (count0 > 0) {
  1030. var dom = vnode.dom
  1031. while (--count0) fragment.appendChild(dom.nextSibling)
  1032. fragment.insertBefore(dom, fragment.firstChild)
  1033. }
  1034. return fragment
  1035. }
  1036. else return vnode.dom
  1037. }
  1038. function getNextSibling(vnodes, i, nextSibling) {
  1039. for (; i < vnodes.length; i++) {
  1040. if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom
  1041. }
  1042. return nextSibling
  1043. }
  1044. function insertNode(parent, dom, nextSibling) {
  1045. if (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)
  1046. else parent.appendChild(dom)
  1047. }
  1048. function setContentEditable(vnode) {
  1049. var children = vnode.children
  1050. if (children != null && children.length === 1 && children[0].tag === "<") {
  1051. var content = children[0].children
  1052. if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content
  1053. }
  1054. else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted")
  1055. }
  1056. //remove
  1057. function removeNodes(vnodes, start, end, context) {
  1058. for (var i = start; i < end; i++) {
  1059. var vnode = vnodes[i]
  1060. if (vnode != null) {
  1061. if (vnode.skip) vnode.skip = false
  1062. else removeNode(vnode, context)
  1063. }
  1064. }
  1065. }
  1066. function removeNode(vnode, context) {
  1067. var expected = 1, called = 0
  1068. if (vnode.attrs && typeof vnode.attrs.onbeforeremove === "function") {
  1069. var result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)
  1070. if (result != null && typeof result.then === "function") {
  1071. expected++
  1072. result.then(continuation, continuation)
  1073. }
  1074. }
  1075. if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeremove === "function") {
  1076. var result = vnode._state.onbeforeremove.call(vnode.state, vnode)
  1077. if (result != null && typeof result.then === "function") {
  1078. expected++
  1079. result.then(continuation, continuation)
  1080. }
  1081. }
  1082. continuation()
  1083. function continuation() {
  1084. if (++called === expected) {
  1085. onremove(vnode)
  1086. if (vnode.dom) {
  1087. var count0 = vnode.domSize || 1
  1088. if (count0 > 1) {
  1089. var dom = vnode.dom
  1090. while (--count0) {
  1091. removeNodeFromDOM(dom.nextSibling)
  1092. }
  1093. }
  1094. removeNodeFromDOM(vnode.dom)
  1095. if (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === "string") { //TODO test custom elements
  1096. if (!context.pool) context.pool = [vnode]
  1097. else context.pool.push(vnode)
  1098. }
  1099. }
  1100. }
  1101. }
  1102. }
  1103. function removeNodeFromDOM(node) {
  1104. var parent = node.parentNode
  1105. if (parent != null) parent.removeChild(node)
  1106. }
  1107. function onremove(vnode) {
  1108. if (vnode.attrs && typeof vnode.attrs.onremove === "function") vnode.attrs.onremove.call(vnode.state, vnode)
  1109. if (typeof vnode.tag !== "string" && typeof vnode._state.onremove === "function") vnode._state.onremove.call(vnode.state, vnode)
  1110. if (vnode.instance != null) onremove(vnode.instance)
  1111. else {
  1112. var children = vnode.children
  1113. if (Array.isArray(children)) {
  1114. for (var i = 0; i < children.length; i++) {
  1115. var child = children[i]
  1116. if (child != null) onremove(child)
  1117. }
  1118. }
  1119. }
  1120. }
  1121. //attrs2
  1122. function setAttrs(vnode, attrs2, ns) {
  1123. for (var key2 in attrs2) {
  1124. setAttr(vnode, key2, null, attrs2[key2], ns)
  1125. }
  1126. }
  1127. function setAttr(vnode, key2, old, value, ns) {
  1128. var element = vnode.dom
  1129. if (key2 === "key" || key2 === "is" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== "object" || typeof value === "undefined" || isLifecycleMethod(key2)) return
  1130. var nsLastIndex = key2.indexOf(":")
  1131. if (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === "xlink") {
  1132. element.setAttributeNS("http://www.w3.org/1999/xlink", key2.slice(nsLastIndex + 1), value)
  1133. }
  1134. else if (key2[0] === "o" && key2[1] === "n" && typeof value === "function") updateEvent(vnode, key2, value)
  1135. else if (key2 === "style") updateStyle(element, old, value)
  1136. else if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {
  1137. //setting input[value] to same value by typing on focused element moves cursor to end in Chrome
  1138. if (vnode.tag === "input" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
  1139. //setting select[value] to same value while having select open blinks select dropdown in Chrome
  1140. if (vnode.tag === "select" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
  1141. //setting option[value] to same value while having select open blinks select dropdown in Chrome
  1142. if (vnode.tag === "option" && key2 === "value" && vnode.dom.value == value) return
  1143. // If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.
  1144. if (vnode.tag === "input" && key2 === "type") {
  1145. element.setAttribute(key2, value)
  1146. return
  1147. }
  1148. element[key2] = value
  1149. }
  1150. else {
  1151. if (typeof value === "boolean") {
  1152. if (value) element.setAttribute(key2, "")
  1153. else element.removeAttribute(key2)
  1154. }
  1155. else element.setAttribute(key2 === "className" ? "class" : key2, value)
  1156. }
  1157. }
  1158. function setLateAttrs(vnode) {
  1159. var attrs2 = vnode.attrs
  1160. if (vnode.tag === "select" && attrs2 != null) {
  1161. if ("value" in attrs2) setAttr(vnode, "value", null, attrs2.value, undefined)
  1162. if ("selectedIndex" in attrs2) setAttr(vnode, "selectedIndex", null, attrs2.selectedIndex, undefined)
  1163. }
  1164. }
  1165. function updateAttrs(vnode, old, attrs2, ns) {
  1166. if (attrs2 != null) {
  1167. for (var key2 in attrs2) {
  1168. setAttr(vnode, key2, old && old[key2], attrs2[key2], ns)
  1169. }
  1170. }
  1171. if (old != null) {
  1172. for (var key2 in old) {
  1173. if (attrs2 == null || !(key2 in attrs2)) {
  1174. if (key2 === "className") key2 = "class"
  1175. if (key2[0] === "o" && key2[1] === "n" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)
  1176. else if (key2 !== "key") vnode.dom.removeAttribute(key2)
  1177. }
  1178. }
  1179. }
  1180. }
  1181. function isFormAttribute(vnode, attr) {
  1182. return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement
  1183. }
  1184. function isLifecycleMethod(attr) {
  1185. return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate"
  1186. }
  1187. function isAttribute(attr) {
  1188. return attr === "href" || attr === "list" || attr === "form" || attr === "width" || attr === "height"// || attr === "type"
  1189. }
  1190. function isCustomElement(vnode){
  1191. return vnode.attrs.is || vnode.tag.indexOf("-") > -1
  1192. }
  1193. function hasIntegrationMethods(source) {
  1194. return source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)
  1195. }
  1196. //style
  1197. function updateStyle(element, old, style) {
  1198. if (old === style) element.style.cssText = "", old = null
  1199. if (style == null) element.style.cssText = ""
  1200. else if (typeof style === "string") element.style.cssText = style
  1201. else {
  1202. if (typeof old === "string") element.style.cssText = ""
  1203. for (var key2 in style) {
  1204. element.style[key2] = style[key2]
  1205. }
  1206. if (old != null && typeof old !== "string") {
  1207. for (var key2 in old) {
  1208. if (!(key2 in style)) element.style[key2] = ""
  1209. }
  1210. }
  1211. }
  1212. }
  1213. //event
  1214. function updateEvent(vnode, key2, value) {
  1215. var element = vnode.dom
  1216. var callback = typeof onevent !== "function" ? value : function(e) {
  1217. var result = value.call(element, e)
  1218. onevent.call(element, e)
  1219. return result
  1220. }
  1221. if (key2 in element) element[key2] = typeof value === "function" ? callback : null
  1222. else {
  1223. var eventName = key2.slice(2)
  1224. if (vnode.events === undefined) vnode.events = {}
  1225. if (vnode.events[key2] === callback) return
  1226. if (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)
  1227. if (typeof value === "function") {
  1228. vnode.events[key2] = callback
  1229. element.addEventListener(eventName, vnode.events[key2], false)
  1230. }
  1231. }
  1232. }
  1233. //lifecycle
  1234. function initLifecycle(source, vnode, hooks) {
  1235. if (typeof source.oninit === "function") source.oninit.call(vnode.state, vnode)
  1236. if (typeof source.oncreate === "function") hooks.push(source.oncreate.bind(vnode.state, vnode))
  1237. }
  1238. function updateLifecycle(source, vnode, hooks) {
  1239. if (typeof source.onupdate === "function") hooks.push(source.onupdate.bind(vnode.state, vnode))
  1240. }
  1241. function shouldNotUpdate(vnode, old) {
  1242. var forceVnodeUpdate, forceComponentUpdate
  1243. if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === "function") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)
  1244. if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeupdate === "function") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)
  1245. if (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {
  1246. vnode.dom = old.dom
  1247. vnode.domSize = old.domSize
  1248. vnode.instance = old.instance
  1249. return true
  1250. }
  1251. return false
  1252. }
  1253. function render(dom, vnodes) {
  1254. if (!dom) throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.")
  1255. var hooks = []
  1256. var active = $doc.activeElement
  1257. // First time0 rendering into a node clears it out
  1258. if (dom.vnodes == null) dom.textContent = ""
  1259. if (!Array.isArray(vnodes)) vnodes = [vnodes]
  1260. updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, undefined)
  1261. dom.vnodes = vnodes
  1262. for (var i = 0; i < hooks.length; i++) hooks[i]()
  1263. if ($doc.activeElement !== active) active.focus()
  1264. }
  1265. return {render: render, setEventCallback: setEventCallback}
  1266. }
  1267. function throttle(callback) {
  1268. //60fps translates to 16.6ms, round it down since setTimeout requires int
  1269. var time = 16
  1270. var last = 0, pending = null
  1271. var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout
  1272. return function() {
  1273. var now = Date.now()
  1274. if (last === 0 || now - last >= time) {
  1275. last = now
  1276. callback()
  1277. }
  1278. else if (pending === null) {
  1279. pending = timeout(function() {
  1280. pending = null
  1281. callback()
  1282. last = Date.now()
  1283. }, time - (now - last))
  1284. }
  1285. }
  1286. }
  1287. var _11 = function($window) {
  1288. var renderService = coreRenderer($window)
  1289. renderService.setEventCallback(function(e) {
  1290. if (e.redraw !== false) redraw()
  1291. })
  1292. var callbacks = []
  1293. function subscribe(key1, callback) {
  1294. unsubscribe(key1)
  1295. callbacks.push(key1, throttle(callback))
  1296. }
  1297. function unsubscribe(key1) {
  1298. var index = callbacks.indexOf(key1)
  1299. if (index > -1) callbacks.splice(index, 2)
  1300. }
  1301. function redraw() {
  1302. for (var i = 1; i < callbacks.length; i += 2) {
  1303. callbacks[i]()
  1304. }
  1305. }
  1306. return {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}
  1307. }
  1308. var redrawService = _11(window)
  1309. requestService.setCompletionCallback(redrawService.redraw)
  1310. var _16 = function(redrawService0) {
  1311. return function(root, component) {
  1312. if (component === null) {
  1313. redrawService0.render(root, [])
  1314. redrawService0.unsubscribe(root)
  1315. return
  1316. }
  1317. if (component.view == null && typeof component !== "function") throw new Error("m.mount(element, component) expects a component, not a vnode")
  1318. var run0 = function() {
  1319. redrawService0.render(root, Vnode(component))
  1320. }
  1321. redrawService0.subscribe(root, run0)
  1322. redrawService0.redraw()
  1323. }
  1324. }
  1325. m.mount = _16(redrawService)
  1326. var Promise = PromisePolyfill
  1327. var parseQueryString = function(string) {
  1328. if (string === "" || string == null) return {}
  1329. if (string.charAt(0) === "?") string = string.slice(1)
  1330. var entries = string.split("&"), data0 = {}, counters = {}
  1331. for (var i = 0; i < entries.length; i++) {
  1332. var entry = entries[i].split("=")
  1333. var key5 = decodeURIComponent(entry[0])
  1334. var value = entry.length === 2 ? decodeURIComponent(entry[1]) : ""
  1335. if (value === "true") value = true
  1336. else if (value === "false") value = false
  1337. var levels = key5.split(/\]\[?|\[/)
  1338. var cursor = data0
  1339. if (key5.indexOf("[") > -1) levels.pop()
  1340. for (var j = 0; j < levels.length; j++) {
  1341. var level = levels[j], nextLevel = levels[j + 1]
  1342. var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10))
  1343. var isValue = j === levels.length - 1
  1344. if (level === "") {
  1345. var key5 = levels.slice(0, j).join()
  1346. if (counters[key5] == null) counters[key5] = 0
  1347. level = counters[key5]++
  1348. }
  1349. if (cursor[level] == null) {
  1350. cursor[level] = isValue ? value : isNumber ? [] : {}
  1351. }
  1352. cursor = cursor[level]
  1353. }
  1354. }
  1355. return data0
  1356. }
  1357. var coreRouter = function($window) {
  1358. var supportsPushState = typeof $window.history.pushState === "function"
  1359. var callAsync0 = typeof setImmediate === "function" ? setImmediate : setTimeout
  1360. function normalize1(fragment0) {
  1361. var data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)
  1362. if (fragment0 === "pathname" && data[0] !== "/") data = "/" + data
  1363. return data
  1364. }
  1365. var asyncId
  1366. function debounceAsync(callback0) {
  1367. return function() {
  1368. if (asyncId != null) return
  1369. asyncId = callAsync0(function() {
  1370. asyncId = null
  1371. callback0()
  1372. })
  1373. }
  1374. }
  1375. function parsePath(path, queryData, hashData) {
  1376. var queryIndex = path.indexOf("?")
  1377. var hashIndex = path.indexOf("#")
  1378. var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length
  1379. if (queryIndex > -1) {
  1380. var queryEnd = hashIndex > -1 ? hashIndex : path.length
  1381. var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))
  1382. for (var key4 in queryParams) queryData[key4] = queryParams[key4]
  1383. }
  1384. if (hashIndex > -1) {
  1385. var hashParams = parseQueryString(path.slice(hashIndex + 1))
  1386. for (var key4 in hashParams) hashData[key4] = hashParams[key4]
  1387. }
  1388. return path.slice(0, pathEnd)
  1389. }
  1390. var router = {prefix: "#!"}
  1391. router.getPath = function() {
  1392. var type2 = router.prefix.charAt(0)
  1393. switch (type2) {
  1394. case "#": return normalize1("hash").slice(router.prefix.length)
  1395. case "?": return normalize1("search").slice(router.prefix.length) + normalize1("hash")
  1396. default: return normalize1("pathname").slice(router.prefix.length) + normalize1("search") + normalize1("hash")
  1397. }
  1398. }
  1399. router.setPath = function(path, data, options) {
  1400. var queryData = {}, hashData = {}
  1401. path = parsePath(path, queryData, hashData)
  1402. if (data != null) {
  1403. for (var key4 in data) queryData[key4] = data[key4]
  1404. path = path.replace(/:([^\/]+)/g, function(match2, token) {
  1405. delete queryData[token]
  1406. return data[token]
  1407. })
  1408. }
  1409. var query = buildQueryString(queryData)
  1410. if (query) path += "?" + query
  1411. var hash = buildQueryString(hashData)
  1412. if (hash) path += "#" + hash
  1413. if (supportsPushState) {
  1414. var state = options ? options.state : null
  1415. var title = options ? options.title : null
  1416. $window.onpopstate()
  1417. if (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)
  1418. else $window.history.pushState(state, title, router.prefix + path)
  1419. }
  1420. else $window.location.href = router.prefix + path
  1421. }
  1422. router.defineRoutes = function(routes, resolve, reject) {
  1423. function resolveRoute() {
  1424. var path = router.getPath()
  1425. var params = {}
  1426. var pathname = parsePath(path, params, params)
  1427. var state = $window.history.state
  1428. if (state != null) {
  1429. for (var k in state) params[k] = state[k]
  1430. }
  1431. for (var route0 in routes) {
  1432. var matcher = new RegExp("^" + route0.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
  1433. if (matcher.test(pathname)) {
  1434. pathname.replace(matcher, function() {
  1435. var keys = route0.match(/:[^\/]+/g) || []
  1436. var values = [].slice.call(arguments, 1, -2)
  1437. for (var i = 0; i < keys.length; i++) {
  1438. params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i])
  1439. }
  1440. resolve(routes[route0], params, path, route0)
  1441. })
  1442. return
  1443. }
  1444. }
  1445. reject(path, params)
  1446. }
  1447. if (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)
  1448. else if (router.prefix.charAt(0) === "#") $window.onhashchange = resolveRoute
  1449. resolveRoute()
  1450. }
  1451. return router
  1452. }
  1453. var _20 = function($window, redrawService0) {
  1454. var routeService = coreRouter($window)
  1455. var identity = function(v) {return v}
  1456. var render1, component, attrs3, currentPath, lastUpdate
  1457. var route = function(root, defaultRoute, routes) {
  1458. if (root == null) throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined")
  1459. var run1 = function() {
  1460. if (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))
  1461. }
  1462. var bail = function(path) {
  1463. if (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})
  1464. else throw new Error("Could not resolve default route " + defaultRoute)
  1465. }
  1466. routeService.defineRoutes(routes, function(payload, params, path) {
  1467. var update = lastUpdate = function(routeResolver, comp) {
  1468. if (update !== lastUpdate) return
  1469. component = comp != null && (typeof comp.view === "function" || typeof comp === "function")? comp : "div"
  1470. attrs3 = params, currentPath = path, lastUpdate = null
  1471. render1 = (routeResolver.render || identity).bind(routeResolver)
  1472. run1()
  1473. }
  1474. if (payload.view || typeof payload === "function") update({}, payload)
  1475. else {
  1476. if (payload.onmatch) {
  1477. Promise.resolve(payload.onmatch(params, path)).then(function(resolved) {
  1478. update(payload, resolved)
  1479. }, bail)
  1480. }
  1481. else update(payload, "div")
  1482. }
  1483. }, bail)
  1484. redrawService0.subscribe(root, run1)
  1485. }
  1486. route.set = function(path, data, options) {
  1487. if (lastUpdate != null) options = {replace: true}
  1488. lastUpdate = null
  1489. routeService.setPath(path, data, options)
  1490. }
  1491. route.get = function() {return currentPath}
  1492. route.prefix = function(prefix0) {routeService.prefix = prefix0}
  1493. route.link = function(vnode1) {
  1494. vnode1.dom.setAttribute("href", routeService.prefix + vnode1.attrs.href)
  1495. vnode1.dom.onclick = function(e) {
  1496. if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return
  1497. e.preventDefault()
  1498. e.redraw = false
  1499. var href = this.getAttribute("href")
  1500. if (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)
  1501. route.set(href, undefined, undefined)
  1502. }
  1503. }
  1504. route.param = function(key3) {
  1505. if(typeof attrs3 !== "undefined" && typeof key3 !== "undefined") return attrs3[key3]
  1506. return attrs3
  1507. }
  1508. return route
  1509. }
  1510. m.route = _20(window, redrawService)
  1511. m.withAttr = function(attrName, callback1, context) {
  1512. return function(e) {
  1513. callback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))
  1514. }
  1515. }
  1516. var _28 = coreRenderer(window)
  1517. m.render = _28.render
  1518. m.redraw = redrawService.redraw
  1519. m.request = requestService.request
  1520. m.jsonp = requestService.jsonp
  1521. m.parseQueryString = parseQueryString
  1522. m.buildQueryString = buildQueryString
  1523. m.version = "1.1.1"
  1524. m.vnode = Vnode
  1525. if (true) module["exports"] = m
  1526. else window.m = m
  1527. }());
  1528. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(83).setImmediate, __webpack_require__(6)))
  1529. /***/ }),
  1530. /* 2 */
  1531. /***/ (function(module, exports) {
  1532. // _
  1533. // (_)________ ____
  1534. // / / ___/ __ \/ __ \
  1535. // / (__ ) /_/ / / / /
  1536. // __/ /____/\____/_/ /_/
  1537. // /___/
  1538. module.exports = {
  1539. lang:'fr',
  1540. langs:[
  1541. {
  1542. 'lc':'lat',
  1543. 'label':'Latin',
  1544. 'db':'0-LAT-ethicadb.json'},
  1545. {
  1546. 'lc':'fr',
  1547. 'label':'Français (Traduction par Charles Appuhn)',
  1548. 'db':'2-Appuhn-FR-ethicadb.json'
  1549. },
  1550. {
  1551. 'lc':'bra',
  1552. 'label':'Brazilian (Tradução Roberto Brandão)',
  1553. 'db':'ethica-bresilen.json'
  1554. },
  1555. {
  1556. 'lc':'en',
  1557. 'label':'English (Translated by R. H. M. Elwes)',
  1558. 'db':'3-Elwes-EN-ethicadb.json'
  1559. }
  1560. ],
  1561. data:[],
  1562. loaded_dbs:0,
  1563. data_byid:[],
  1564. data_strct:{},
  1565. load: function(callback) {
  1566. // load all dbs, when all loaded call main app callback function
  1567. for (var i = 0; i < this.langs.length; i++) {
  1568. this.loadJSON(this.langs[i].lc, '/assets/jsondb/'+this.langs[i].db, callback)
  1569. }
  1570. },
  1571. loadJSON: function(lc, file, callback){
  1572. var xobj = new XMLHttpRequest();
  1573. xobj.overrideMimeType("application/json");
  1574. // TODO: load and unzip gziped json
  1575. // xobj.setRequestHeader('Accept-Encoding', 'gzip');
  1576. xobj.onreadystatechange = function () {
  1577. // console.log('onreadystatechange', xobj.readyState);
  1578. switch(xobj.readyState){
  1579. case 3:
  1580. console.log('loading');
  1581. break;
  1582. case 4:
  1583. if (xobj.status === 200) {
  1584. this.onJSONLoaded(lc, xobj.responseText, callback);
  1585. } else {
  1586. console.log("Status de la réponse: %d (%s)", xobj.status, xobj.statusText);
  1587. }
  1588. break;
  1589. }
  1590. }.bind(this);
  1591. xobj.open('GET', file, true);
  1592. xobj.send(null);
  1593. },
  1594. onJSONLoaded: function(lc, json, callback){
  1595. console.log('onDBLoaded '+lc);
  1596. this.data[lc] = JSON.parse(json);
  1597. this.loaded_dbs ++;
  1598. //
  1599. if (this.loaded_dbs == this.langs.length) {
  1600. this.parseByID(callback);
  1601. }
  1602. },
  1603. parseByID: function(callback){
  1604. for(l in this.data){
  1605. // console.log('l', l);
  1606. this.data_byid[l] = {};
  1607. for (p in this.data[l]) {
  1608. // console.log(this.data[l][p]);
  1609. for (e in this.data[l][p].enonces) {
  1610. // console.log('e',e);
  1611. this.data_byid[l][this.data[l][p].enonces[e].id] = this.data[l][p].enonces[e];
  1612. for (c in this.data[l][p].enonces[e].childs){
  1613. // console.log(_db[p][e][c]);
  1614. this.data_byid[l][this.data[l][p].enonces[e].childs[c].id] = this.data[l][p].enonces[e].childs[c];
  1615. }
  1616. }
  1617. }
  1618. }
  1619. // console.log('this.data_byid', this.data_byid);
  1620. this.parseStrct(callback);
  1621. },
  1622. parseStrct: function(callback){
  1623. var id, item, obj, links_match, link, tid;
  1624. for (id in this.data_byid[this.langs[0].lc]) {
  1625. item = this.data_byid[this.langs[0].lc][id];
  1626. // console.log(item);
  1627. // skeep titles as they don't have structure data
  1628. if(item.type == "title") continue;
  1629. obj = {
  1630. 'to':[],
  1631. 'from':[],
  1632. };
  1633. // get links
  1634. links_match = item.text.match(/\[[^\]]+\]\([^\)]+\)/g);
  1635. // console.log(links_match);
  1636. // if links exist on text
  1637. if(links_match){
  1638. for(link of links_match){
  1639. // console.log(link);
  1640. // get the target id
  1641. tid = link.match(/\((.+)\)/)[1];
  1642. // avoid duplicates
  1643. if (obj.to.indexOf(tid) == -1)
  1644. obj.to.push(tid);
  1645. // add id to "from" links in target
  1646. // if target exists
  1647. if(typeof this.data_strct[tid] !== 'undefined'){
  1648. // avoid duplicates
  1649. if (this.data_strct[tid].from.indexOf(tid) == -1)
  1650. this.data_strct[tid].from.push(id);
  1651. }else{
  1652. // if targets does not exists, the db has an issue, warn about that
  1653. console.log('!! warning : '+tid+' target id does not exists');
  1654. }
  1655. }
  1656. }
  1657. // add the item links to the main links listings
  1658. this.data_strct[id] = obj;
  1659. }
  1660. // console.log('data_strct',this.data_strct);
  1661. callback();
  1662. }
  1663. }
  1664. /***/ }),
  1665. /* 3 */
  1666. /***/ (function(module, exports, __webpack_require__) {
  1667. "use strict";
  1668. /**
  1669. * class Ruler
  1670. *
  1671. * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
  1672. * [[MarkdownIt#inline]] to manage sequences of functions (rules):
  1673. *
  1674. * - keep rules in defined order
  1675. * - assign the name to each rule
  1676. * - enable/disable rules
  1677. * - add/replace rules
  1678. * - allow assign rules to additional named chains (in the same)
  1679. * - cacheing lists of active rules
  1680. *
  1681. * You will not need use this class directly until write plugins. For simple
  1682. * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
  1683. * [[MarkdownIt.use]].
  1684. **/
  1685. /**
  1686. * new Ruler()
  1687. **/
  1688. function Ruler() {
  1689. // List of added rules. Each element is:
  1690. //
  1691. // {
  1692. // name: XXX,
  1693. // enabled: Boolean,
  1694. // fn: Function(),
  1695. // alt: [ name2, name3 ]
  1696. // }
  1697. //
  1698. this.__rules__ = [];
  1699. // Cached rule chains.
  1700. //
  1701. // First level - chain name, '' for default.
  1702. // Second level - diginal anchor for fast filtering by charcodes.
  1703. //
  1704. this.__cache__ = null;
  1705. }
  1706. ////////////////////////////////////////////////////////////////////////////////
  1707. // Helper methods, should not be used directly
  1708. // Find rule index by name
  1709. //
  1710. Ruler.prototype.__find__ = function (name) {
  1711. for (var i = 0; i < this.__rules__.length; i++) {
  1712. if (this.__rules__[i].name === name) {
  1713. return i;
  1714. }
  1715. }
  1716. return -1;
  1717. };
  1718. // Build rules lookup cache
  1719. //
  1720. Ruler.prototype.__compile__ = function () {
  1721. var self = this;
  1722. var chains = [ '' ];
  1723. // collect unique names
  1724. self.__rules__.forEach(function (rule) {
  1725. if (!rule.enabled) { return; }
  1726. rule.alt.forEach(function (altName) {
  1727. if (chains.indexOf(altName) < 0) {
  1728. chains.push(altName);
  1729. }
  1730. });
  1731. });
  1732. self.__cache__ = {};
  1733. chains.forEach(function (chain) {
  1734. self.__cache__[chain] = [];
  1735. self.__rules__.forEach(function (rule) {
  1736. if (!rule.enabled) { return; }
  1737. if (chain && rule.alt.indexOf(chain) < 0) { return; }
  1738. self.__cache__[chain].push(rule.fn);
  1739. });
  1740. });
  1741. };
  1742. /**
  1743. * Ruler.at(name, fn [, options])
  1744. * - name (String): rule name to replace.
  1745. * - fn (Function): new rule function.
  1746. * - options (Object): new rule options (not mandatory).
  1747. *
  1748. * Replace rule by name with new function & options. Throws error if name not
  1749. * found.
  1750. *
  1751. * ##### Options:
  1752. *
  1753. * - __alt__ - array with names of "alternate" chains.
  1754. *
  1755. * ##### Example
  1756. *
  1757. * Replace existing typorgapher replacement rule with new one:
  1758. *
  1759. * ```javascript
  1760. * var md = require('markdown-it')();
  1761. *
  1762. * md.core.ruler.at('replacements', function replace(state) {
  1763. * //...
  1764. * });
  1765. * ```
  1766. **/
  1767. Ruler.prototype.at = function (name, fn, options) {
  1768. var index = this.__find__(name);
  1769. var opt = options || {};
  1770. if (index === -1) { throw new Error('Parser rule not found: ' + name); }
  1771. this.__rules__[index].fn = fn;
  1772. this.__rules__[index].alt = opt.alt || [];
  1773. this.__cache__ = null;
  1774. };
  1775. /**
  1776. * Ruler.before(beforeName, ruleName, fn [, options])
  1777. * - beforeName (String): new rule will be added before this one.
  1778. * - ruleName (String): name of added rule.
  1779. * - fn (Function): rule function.
  1780. * - options (Object): rule options (not mandatory).
  1781. *
  1782. * Add new rule to chain before one with given name. See also
  1783. * [[Ruler.after]], [[Ruler.push]].
  1784. *
  1785. * ##### Options:
  1786. *
  1787. * - __alt__ - array with names of "alternate" chains.
  1788. *
  1789. * ##### Example
  1790. *
  1791. * ```javascript
  1792. * var md = require('markdown-it')();
  1793. *
  1794. * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
  1795. * //...
  1796. * });
  1797. * ```
  1798. **/
  1799. Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
  1800. var index = this.__find__(beforeName);
  1801. var opt = options || {};
  1802. if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
  1803. this.__rules__.splice(index, 0, {
  1804. name: ruleName,
  1805. enabled: true,
  1806. fn: fn,
  1807. alt: opt.alt || []
  1808. });
  1809. this.__cache__ = null;
  1810. };
  1811. /**
  1812. * Ruler.after(afterName, ruleName, fn [, options])
  1813. * - afterName (String): new rule will be added after this one.
  1814. * - ruleName (String): name of added rule.
  1815. * - fn (Function): rule function.
  1816. * - options (Object): rule options (not mandatory).
  1817. *
  1818. * Add new rule to chain after one with given name. See also
  1819. * [[Ruler.before]], [[Ruler.push]].
  1820. *
  1821. * ##### Options:
  1822. *
  1823. * - __alt__ - array with names of "alternate" chains.
  1824. *
  1825. * ##### Example
  1826. *
  1827. * ```javascript
  1828. * var md = require('markdown-it')();
  1829. *
  1830. * md.inline.ruler.after('text', 'my_rule', function replace(state) {
  1831. * //...
  1832. * });
  1833. * ```
  1834. **/
  1835. Ruler.prototype.after = function (afterName, ruleName, fn, options) {
  1836. var index = this.__find__(afterName);
  1837. var opt = options || {};
  1838. if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
  1839. this.__rules__.splice(index + 1, 0, {
  1840. name: ruleName,
  1841. enabled: true,
  1842. fn: fn,
  1843. alt: opt.alt || []
  1844. });
  1845. this.__cache__ = null;
  1846. };
  1847. /**
  1848. * Ruler.push(ruleName, fn [, options])
  1849. * - ruleName (String): name of added rule.
  1850. * - fn (Function): rule function.
  1851. * - options (Object): rule options (not mandatory).
  1852. *
  1853. * Push new rule to the end of chain. See also
  1854. * [[Ruler.before]], [[Ruler.after]].
  1855. *
  1856. * ##### Options:
  1857. *
  1858. * - __alt__ - array with names of "alternate" chains.
  1859. *
  1860. * ##### Example
  1861. *
  1862. * ```javascript
  1863. * var md = require('markdown-it')();
  1864. *
  1865. * md.core.ruler.push('my_rule', function replace(state) {
  1866. * //...
  1867. * });
  1868. * ```
  1869. **/
  1870. Ruler.prototype.push = function (ruleName, fn, options) {
  1871. var opt = options || {};
  1872. this.__rules__.push({
  1873. name: ruleName,
  1874. enabled: true,
  1875. fn: fn,
  1876. alt: opt.alt || []
  1877. });
  1878. this.__cache__ = null;
  1879. };
  1880. /**
  1881. * Ruler.enable(list [, ignoreInvalid]) -> Array
  1882. * - list (String|Array): list of rule names to enable.
  1883. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1884. *
  1885. * Enable rules with given names. If any rule name not found - throw Error.
  1886. * Errors can be disabled by second param.
  1887. *
  1888. * Returns list of found rule names (if no exception happened).
  1889. *
  1890. * See also [[Ruler.disable]], [[Ruler.enableOnly]].
  1891. **/
  1892. Ruler.prototype.enable = function (list, ignoreInvalid) {
  1893. if (!Array.isArray(list)) { list = [ list ]; }
  1894. var result = [];
  1895. // Search by name and enable
  1896. list.forEach(function (name) {
  1897. var idx = this.__find__(name);
  1898. if (idx < 0) {
  1899. if (ignoreInvalid) { return; }
  1900. throw new Error('Rules manager: invalid rule name ' + name);
  1901. }
  1902. this.__rules__[idx].enabled = true;
  1903. result.push(name);
  1904. }, this);
  1905. this.__cache__ = null;
  1906. return result;
  1907. };
  1908. /**
  1909. * Ruler.enableOnly(list [, ignoreInvalid])
  1910. * - list (String|Array): list of rule names to enable (whitelist).
  1911. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1912. *
  1913. * Enable rules with given names, and disable everything else. If any rule name
  1914. * not found - throw Error. Errors can be disabled by second param.
  1915. *
  1916. * See also [[Ruler.disable]], [[Ruler.enable]].
  1917. **/
  1918. Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
  1919. if (!Array.isArray(list)) { list = [ list ]; }
  1920. this.__rules__.forEach(function (rule) { rule.enabled = false; });
  1921. this.enable(list, ignoreInvalid);
  1922. };
  1923. /**
  1924. * Ruler.disable(list [, ignoreInvalid]) -> Array
  1925. * - list (String|Array): list of rule names to disable.
  1926. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1927. *
  1928. * Disable rules with given names. If any rule name not found - throw Error.
  1929. * Errors can be disabled by second param.
  1930. *
  1931. * Returns list of found rule names (if no exception happened).
  1932. *
  1933. * See also [[Ruler.enable]], [[Ruler.enableOnly]].
  1934. **/
  1935. Ruler.prototype.disable = function (list, ignoreInvalid) {
  1936. if (!Array.isArray(list)) { list = [ list ]; }
  1937. var result = [];
  1938. // Search by name and disable
  1939. list.forEach(function (name) {
  1940. var idx = this.__find__(name);
  1941. if (idx < 0) {
  1942. if (ignoreInvalid) { return; }
  1943. throw new Error('Rules manager: invalid rule name ' + name);
  1944. }
  1945. this.__rules__[idx].enabled = false;
  1946. result.push(name);
  1947. }, this);
  1948. this.__cache__ = null;
  1949. return result;
  1950. };
  1951. /**
  1952. * Ruler.getRules(chainName) -> Array
  1953. *
  1954. * Return array of active functions (rules) for given chain name. It analyzes
  1955. * rules configuration, compiles caches if not exists and returns result.
  1956. *
  1957. * Default chain name is `''` (empty string). It can't be skipped. That's
  1958. * done intentionally, to keep signature monomorphic for high speed.
  1959. **/
  1960. Ruler.prototype.getRules = function (chainName) {
  1961. if (this.__cache__ === null) {
  1962. this.__compile__();
  1963. }
  1964. // Chain can be empty, if rules disabled. But we still have to return Array.
  1965. return this.__cache__[chainName] || [];
  1966. };
  1967. module.exports = Ruler;
  1968. /***/ }),
  1969. /* 4 */
  1970. /***/ (function(module, exports, __webpack_require__) {
  1971. "use strict";
  1972. // Token class
  1973. /**
  1974. * class Token
  1975. **/
  1976. /**
  1977. * new Token(type, tag, nesting)
  1978. *
  1979. * Create new token and fill passed properties.
  1980. **/
  1981. function Token(type, tag, nesting) {
  1982. /**
  1983. * Token#type -> String
  1984. *
  1985. * Type of the token (string, e.g. "paragraph_open")
  1986. **/
  1987. this.type = type;
  1988. /**
  1989. * Token#tag -> String
  1990. *
  1991. * html tag name, e.g. "p"
  1992. **/
  1993. this.tag = tag;
  1994. /**
  1995. * Token#attrs -> Array
  1996. *
  1997. * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
  1998. **/
  1999. this.attrs = null;
  2000. /**
  2001. * Token#map -> Array
  2002. *
  2003. * Source map info. Format: `[ line_begin, line_end ]`
  2004. **/
  2005. this.map = null;
  2006. /**
  2007. * Token#nesting -> Number
  2008. *
  2009. * Level change (number in {-1, 0, 1} set), where:
  2010. *
  2011. * - `1` means the tag is opening
  2012. * - `0` means the tag is self-closing
  2013. * - `-1` means the tag is closing
  2014. **/
  2015. this.nesting = nesting;
  2016. /**
  2017. * Token#level -> Number
  2018. *
  2019. * nesting level, the same as `state.level`
  2020. **/
  2021. this.level = 0;
  2022. /**
  2023. * Token#children -> Array
  2024. *
  2025. * An array of child nodes (inline and img tokens)
  2026. **/
  2027. this.children = null;
  2028. /**
  2029. * Token#content -> String
  2030. *
  2031. * In a case of self-closing tag (code, html, fence, etc.),
  2032. * it has contents of this tag.
  2033. **/
  2034. this.content = '';
  2035. /**
  2036. * Token#markup -> String
  2037. *
  2038. * '*' or '_' for emphasis, fence string for fence, etc.
  2039. **/
  2040. this.markup = '';
  2041. /**
  2042. * Token#info -> String
  2043. *
  2044. * fence infostring
  2045. **/
  2046. this.info = '';
  2047. /**
  2048. * Token#meta -> Object
  2049. *
  2050. * A place for plugins to store an arbitrary data
  2051. **/
  2052. this.meta = null;
  2053. /**
  2054. * Token#block -> Boolean
  2055. *
  2056. * True for block-level tokens, false for inline tokens.
  2057. * Used in renderer to calculate line breaks
  2058. **/
  2059. this.block = false;
  2060. /**
  2061. * Token#hidden -> Boolean
  2062. *
  2063. * If it's true, ignore this element when rendering. Used for tight lists
  2064. * to hide paragraphs.
  2065. **/
  2066. this.hidden = false;
  2067. }
  2068. /**
  2069. * Token.attrIndex(name) -> Number
  2070. *
  2071. * Search attribute index by name.
  2072. **/
  2073. Token.prototype.attrIndex = function attrIndex(name) {
  2074. var attrs, i, len;
  2075. if (!this.attrs) { return -1; }
  2076. attrs = this.attrs;
  2077. for (i = 0, len = attrs.length; i < len; i++) {
  2078. if (attrs[i][0] === name) { return i; }
  2079. }
  2080. return -1;
  2081. };
  2082. /**
  2083. * Token.attrPush(attrData)
  2084. *
  2085. * Add `[ name, value ]` attribute to list. Init attrs if necessary
  2086. **/
  2087. Token.prototype.attrPush = function attrPush(attrData) {
  2088. if (this.attrs) {
  2089. this.attrs.push(attrData);
  2090. } else {
  2091. this.attrs = [ attrData ];
  2092. }
  2093. };
  2094. /**
  2095. * Token.attrSet(name, value)
  2096. *
  2097. * Set `name` attribute to `value`. Override old value if exists.
  2098. **/
  2099. Token.prototype.attrSet = function attrSet(name, value) {
  2100. var idx = this.attrIndex(name),
  2101. attrData = [ name, value ];
  2102. if (idx < 0) {
  2103. this.attrPush(attrData);
  2104. } else {
  2105. this.attrs[idx] = attrData;
  2106. }
  2107. };
  2108. /**
  2109. * Token.attrGet(name)
  2110. *
  2111. * Get the value of attribute `name`, or null if it does not exist.
  2112. **/
  2113. Token.prototype.attrGet = function attrGet(name) {
  2114. var idx = this.attrIndex(name), value = null;
  2115. if (idx >= 0) {
  2116. value = this.attrs[idx][1];
  2117. }
  2118. return value;
  2119. };
  2120. /**
  2121. * Token.attrJoin(name, value)
  2122. *
  2123. * Join value to existing attribute via space. Or create new attribute if not
  2124. * exists. Useful to operate with token classes.
  2125. **/
  2126. Token.prototype.attrJoin = function attrJoin(name, value) {
  2127. var idx = this.attrIndex(name);
  2128. if (idx < 0) {
  2129. this.attrPush([ name, value ]);
  2130. } else {
  2131. this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
  2132. }
  2133. };
  2134. module.exports = Token;
  2135. /***/ }),
  2136. /* 5 */
  2137. /***/ (function(module, exports) {
  2138. module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
  2139. /***/ }),
  2140. /* 6 */
  2141. /***/ (function(module, exports) {
  2142. var g;
  2143. // This works in non-strict mode
  2144. g = (function() {
  2145. return this;
  2146. })();
  2147. try {
  2148. // This works if eval is allowed (see CSP)
  2149. g = g || Function("return this")() || (1,eval)("this");
  2150. } catch(e) {
  2151. // This works if the window reference is available
  2152. if(typeof window === "object")
  2153. g = window;
  2154. }
  2155. // g can still be undefined, but nothing to do about it...
  2156. // We return undefined, instead of nothing here, so it's
  2157. // easier to handle this case. if(!global) { ...}
  2158. module.exports = g;
  2159. /***/ }),
  2160. /* 7 */
  2161. /***/ (function(module, exports, __webpack_require__) {
  2162. var m = __webpack_require__(1);
  2163. // ____ __
  2164. // / __/___ ____ / /____ _____
  2165. // / /_/ __ \/ __ \/ __/ _ \/ ___/
  2166. // / __/ /_/ / /_/ / /_/ __/ /
  2167. // /_/ \____/\____/\__/\___/_/
  2168. module.exports = {
  2169. view: function(vn){
  2170. return m('footer', [
  2171. m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2172. ]);
  2173. }
  2174. }
  2175. /***/ }),
  2176. /* 8 */
  2177. /***/ (function(module, exports, __webpack_require__) {
  2178. var m = __webpack_require__(1);
  2179. var _dbs = __webpack_require__(2);
  2180. var markdown = __webpack_require__(10)()
  2181. .use(__webpack_require__(9));
  2182. // __ __ __
  2183. // / / / /__ ____ _____/ /__ _____
  2184. // / /_/ / _ \/ __ `/ __ / _ \/ ___/
  2185. // / __ / __/ /_/ / /_/ / __/ /
  2186. // /_/ /_/\___/\__,_/\__,_/\___/_/
  2187. module.exports = {
  2188. view: function(vn){
  2189. return m('header', [
  2190. m('h1', 'Ethica'),
  2191. // m('nav', {'id':'parts-nav'}, [
  2192. //
  2193. // ]),
  2194. m('div', {'id':"menus"}, [
  2195. m(_PartsNav),
  2196. m(_RouteMenu),
  2197. m(_LangMenu)
  2198. ])
  2199. ]);
  2200. }
  2201. }
  2202. // ____ __
  2203. // / __ \____ ______/ /______ ____ ___ ___ ____ __ __
  2204. // / /_/ / __ `/ ___/ __/ ___/ / __ `__ \/ _ \/ __ \/ / / /
  2205. // / ____/ /_/ / / / /_(__ ) / / / / / / __/ / / / /_/ /
  2206. // /_/ \__,_/_/ \__/____/ /_/ /_/ /_/\___/_/ /_/\__,_/
  2207. var _PartsNav = {
  2208. view: function(vn){
  2209. var lang = m.route.param('lang');
  2210. console.log('partsmenu', lang);
  2211. return m('nav', {id:'parts-nav'}, [
  2212. // TODO: replaced labels with localized content
  2213. m('h3', 'Parts'),
  2214. m('ul', _dbs.data[lang].map(function(p){
  2215. // console.log("anchors, part", p);
  2216. return m('li', [
  2217. m('a', {'href':'#'+p.id}, m.trust(markdown.renderInline(p.title)))
  2218. ]);
  2219. })
  2220. )
  2221. ]);
  2222. }
  2223. };
  2224. // ____ __
  2225. // / __ \____ __ __/ /____ ____ ___ ___ ____ __ __
  2226. // / /_/ / __ \/ / / / __/ _ \ / __ `__ \/ _ \/ __ \/ / / /
  2227. // / _, _/ /_/ / /_/ / /_/ __/ / / / / / / __/ / / / /_/ /
  2228. // /_/ |_|\____/\__,_/\__/\___/ /_/ /_/ /_/\___/_/ /_/\__,_/
  2229. var _RouteMenu = {
  2230. view: function(){
  2231. var lang = m.route.param('lang');
  2232. var path = m.route.get().match(/^(\/[^\/]+)(\/[^\/|#]+)(.*)$/);
  2233. console.log('Route menu Path', path);
  2234. return m('nav', {id:'routes'}, [
  2235. // TODO: replaced labels with localized content
  2236. m('h3', 'Mode'),
  2237. m('ul', [
  2238. m('li', m('a', {
  2239. 'href':'/'+lang+'/inline'+path[3],
  2240. oncreate : m.route.link,
  2241. onupdate : m.route.link
  2242. }, "inline")),
  2243. m('li', m('a', {
  2244. 'href':'/'+lang+'/tree'+path[3],
  2245. oncreate : m.route.link,
  2246. onupdate : m.route.link
  2247. }, "tree")),
  2248. ])
  2249. ]);
  2250. }
  2251. }
  2252. // __ __ ___
  2253. // / / ____ _____ ____ _/ |/ /__ ____ __ __
  2254. // / / / __ `/ __ \/ __ `/ /|_/ / _ \/ __ \/ / / /
  2255. // / /___/ /_/ / / / / /_/ / / / / __/ / / / /_/ /
  2256. // /_____/\__,_/_/ /_/\__, /_/ /_/\___/_/ /_/\__,_/
  2257. // /____/
  2258. var _LangMenu = {
  2259. view: function(){
  2260. var path = m.route.get().match(/^\/[^\/]+(.+)$/);
  2261. // console.log('Lang menu Path', path);
  2262. // create ul dom
  2263. return m('nav', {id:'languages'}, [
  2264. // TODO: replaced labels with localized content
  2265. m('h3', 'languages'),
  2266. m('ul', _dbs.langs.map(function(lang){
  2267. // create li dom for each lank link
  2268. return m('li',
  2269. // create a dom
  2270. m('a', {
  2271. 'lang':lang.lc,
  2272. 'href':'/'+lang.lc+path[1]
  2273. // onclick:function(e){
  2274. // e.preventDefault();
  2275. // // console.log('click lang', e);
  2276. // var lang = e.target.getAttribute('lang');
  2277. // // console.log(lang);
  2278. // if(lang != _dbs.lang){
  2279. // // change url variable
  2280. // // change db
  2281. // _dbs.lang = lang;
  2282. // // redraw UI
  2283. // // m.redraw();
  2284. // }
  2285. // return false;
  2286. // }
  2287. }, lang.label)
  2288. );
  2289. }))
  2290. ]);
  2291. }
  2292. }
  2293. /***/ }),
  2294. /* 9 */
  2295. /***/ (function(module, exports, __webpack_require__) {
  2296. "use strict";
  2297. // Process footnotes
  2298. //
  2299. ////////////////////////////////////////////////////////////////////////////////
  2300. // Renderer partials
  2301. function render_footnote_anchor_name(tokens, idx, options, env/*, slf*/) {
  2302. var n = Number(tokens[idx].meta.id + 1).toString();
  2303. var prefix = '';
  2304. if (typeof env.docId === 'string') {
  2305. prefix = '-' + env.docId + '-';
  2306. }
  2307. return prefix + n;
  2308. }
  2309. function render_footnote_caption(tokens, idx/*, options, env, slf*/) {
  2310. var n = Number(tokens[idx].meta.id + 1).toString();
  2311. if (tokens[idx].meta.subId > 0) {
  2312. n += ':' + tokens[idx].meta.subId;
  2313. }
  2314. return '[' + n + ']';
  2315. }
  2316. function render_footnote_ref(tokens, idx, options, env, slf) {
  2317. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2318. var caption = slf.rules.footnote_caption(tokens, idx, options, env, slf);
  2319. var refid = id;
  2320. if (tokens[idx].meta.subId > 0) {
  2321. refid += ':' + tokens[idx].meta.subId;
  2322. }
  2323. return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + caption + '</a></sup>';
  2324. }
  2325. function render_footnote_block_open(tokens, idx, options) {
  2326. return (options.xhtmlOut ? '<hr class="footnotes-sep" />\n' : '<hr class="footnotes-sep">\n') +
  2327. '<section class="footnotes">\n' +
  2328. '<ol class="footnotes-list">\n';
  2329. }
  2330. function render_footnote_block_close() {
  2331. return '</ol>\n</section>\n';
  2332. }
  2333. function render_footnote_open(tokens, idx, options, env, slf) {
  2334. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2335. if (tokens[idx].meta.subId > 0) {
  2336. id += ':' + tokens[idx].meta.subId;
  2337. }
  2338. return '<li id="fn' + id + '" class="footnote-item">';
  2339. }
  2340. function render_footnote_close() {
  2341. return '</li>\n';
  2342. }
  2343. function render_footnote_anchor(tokens, idx, options, env, slf) {
  2344. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2345. if (tokens[idx].meta.subId > 0) {
  2346. id += ':' + tokens[idx].meta.subId;
  2347. }
  2348. /* ↩ with escape code to prevent display as Apple Emoji on iOS */
  2349. return ' <a href="#fnref' + id + '" class="footnote-backref">\u21a9\uFE0E</a>';
  2350. }
  2351. module.exports = function footnote_plugin(md) {
  2352. var parseLinkLabel = md.helpers.parseLinkLabel,
  2353. isSpace = md.utils.isSpace;
  2354. md.renderer.rules.footnote_ref = render_footnote_ref;
  2355. md.renderer.rules.footnote_block_open = render_footnote_block_open;
  2356. md.renderer.rules.footnote_block_close = render_footnote_block_close;
  2357. md.renderer.rules.footnote_open = render_footnote_open;
  2358. md.renderer.rules.footnote_close = render_footnote_close;
  2359. md.renderer.rules.footnote_anchor = render_footnote_anchor;
  2360. // helpers (only used in other rules, no tokens are attached to those)
  2361. md.renderer.rules.footnote_caption = render_footnote_caption;
  2362. md.renderer.rules.footnote_anchor_name = render_footnote_anchor_name;
  2363. // Process footnote block definition
  2364. function footnote_def(state, startLine, endLine, silent) {
  2365. var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,
  2366. initial, offset, ch, posAfterColon,
  2367. start = state.bMarks[startLine] + state.tShift[startLine],
  2368. max = state.eMarks[startLine];
  2369. // line should be at least 5 chars - "[^x]:"
  2370. if (start + 4 > max) { return false; }
  2371. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2372. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2373. for (pos = start + 2; pos < max; pos++) {
  2374. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2375. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2376. break;
  2377. }
  2378. }
  2379. if (pos === start + 2) { return false; } // no empty footnote labels
  2380. if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }
  2381. if (silent) { return true; }
  2382. pos++;
  2383. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2384. if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }
  2385. label = state.src.slice(start + 2, pos - 2);
  2386. state.env.footnotes.refs[':' + label] = -1;
  2387. token = new state.Token('footnote_reference_open', '', 1);
  2388. token.meta = { label: label };
  2389. token.level = state.level++;
  2390. state.tokens.push(token);
  2391. oldBMark = state.bMarks[startLine];
  2392. oldTShift = state.tShift[startLine];
  2393. oldSCount = state.sCount[startLine];
  2394. oldParentType = state.parentType;
  2395. posAfterColon = pos;
  2396. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  2397. while (pos < max) {
  2398. ch = state.src.charCodeAt(pos);
  2399. if (isSpace(ch)) {
  2400. if (ch === 0x09) {
  2401. offset += 4 - offset % 4;
  2402. } else {
  2403. offset++;
  2404. }
  2405. } else {
  2406. break;
  2407. }
  2408. pos++;
  2409. }
  2410. state.tShift[startLine] = pos - posAfterColon;
  2411. state.sCount[startLine] = offset - initial;
  2412. state.bMarks[startLine] = posAfterColon;
  2413. state.blkIndent += 4;
  2414. state.parentType = 'footnote';
  2415. if (state.sCount[startLine] < state.blkIndent) {
  2416. state.sCount[startLine] += state.blkIndent;
  2417. }
  2418. state.md.block.tokenize(state, startLine, endLine, true);
  2419. state.parentType = oldParentType;
  2420. state.blkIndent -= 4;
  2421. state.tShift[startLine] = oldTShift;
  2422. state.sCount[startLine] = oldSCount;
  2423. state.bMarks[startLine] = oldBMark;
  2424. token = new state.Token('footnote_reference_close', '', -1);
  2425. token.level = --state.level;
  2426. state.tokens.push(token);
  2427. return true;
  2428. }
  2429. // Process inline footnotes (^[...])
  2430. function footnote_inline(state, silent) {
  2431. var labelStart,
  2432. labelEnd,
  2433. footnoteId,
  2434. token,
  2435. tokens,
  2436. max = state.posMax,
  2437. start = state.pos;
  2438. if (start + 2 >= max) { return false; }
  2439. if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }
  2440. if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }
  2441. labelStart = start + 2;
  2442. labelEnd = parseLinkLabel(state, start + 1);
  2443. // parser failed to find ']', so it's not a valid note
  2444. if (labelEnd < 0) { return false; }
  2445. // We found the end of the link, and know for a fact it's a valid link;
  2446. // so all that's left to do is to call tokenizer.
  2447. //
  2448. if (!silent) {
  2449. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2450. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2451. footnoteId = state.env.footnotes.list.length;
  2452. state.md.inline.parse(
  2453. state.src.slice(labelStart, labelEnd),
  2454. state.md,
  2455. state.env,
  2456. tokens = []
  2457. );
  2458. token = state.push('footnote_ref', '', 0);
  2459. token.meta = { id: footnoteId };
  2460. state.env.footnotes.list[footnoteId] = { tokens: tokens };
  2461. }
  2462. state.pos = labelEnd + 1;
  2463. state.posMax = max;
  2464. return true;
  2465. }
  2466. // Process footnote references ([^...])
  2467. function footnote_ref(state, silent) {
  2468. var label,
  2469. pos,
  2470. footnoteId,
  2471. footnoteSubId,
  2472. token,
  2473. max = state.posMax,
  2474. start = state.pos;
  2475. // should be at least 4 chars - "[^x]"
  2476. if (start + 3 > max) { return false; }
  2477. if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }
  2478. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2479. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2480. for (pos = start + 2; pos < max; pos++) {
  2481. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2482. if (state.src.charCodeAt(pos) === 0x0A) { return false; }
  2483. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2484. break;
  2485. }
  2486. }
  2487. if (pos === start + 2) { return false; } // no empty footnote labels
  2488. if (pos >= max) { return false; }
  2489. pos++;
  2490. label = state.src.slice(start + 2, pos - 1);
  2491. if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }
  2492. if (!silent) {
  2493. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2494. if (state.env.footnotes.refs[':' + label] < 0) {
  2495. footnoteId = state.env.footnotes.list.length;
  2496. state.env.footnotes.list[footnoteId] = { label: label, count: 0 };
  2497. state.env.footnotes.refs[':' + label] = footnoteId;
  2498. } else {
  2499. footnoteId = state.env.footnotes.refs[':' + label];
  2500. }
  2501. footnoteSubId = state.env.footnotes.list[footnoteId].count;
  2502. state.env.footnotes.list[footnoteId].count++;
  2503. token = state.push('footnote_ref', '', 0);
  2504. token.meta = { id: footnoteId, subId: footnoteSubId, label: label };
  2505. }
  2506. state.pos = pos;
  2507. state.posMax = max;
  2508. return true;
  2509. }
  2510. // Glue footnote tokens to end of token stream
  2511. function footnote_tail(state) {
  2512. var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,
  2513. insideRef = false,
  2514. refTokens = {};
  2515. if (!state.env.footnotes) { return; }
  2516. state.tokens = state.tokens.filter(function (tok) {
  2517. if (tok.type === 'footnote_reference_open') {
  2518. insideRef = true;
  2519. current = [];
  2520. currentLabel = tok.meta.label;
  2521. return false;
  2522. }
  2523. if (tok.type === 'footnote_reference_close') {
  2524. insideRef = false;
  2525. // prepend ':' to avoid conflict with Object.prototype members
  2526. refTokens[':' + currentLabel] = current;
  2527. return false;
  2528. }
  2529. if (insideRef) { current.push(tok); }
  2530. return !insideRef;
  2531. });
  2532. if (!state.env.footnotes.list) { return; }
  2533. list = state.env.footnotes.list;
  2534. token = new state.Token('footnote_block_open', '', 1);
  2535. state.tokens.push(token);
  2536. for (i = 0, l = list.length; i < l; i++) {
  2537. token = new state.Token('footnote_open', '', 1);
  2538. token.meta = { id: i, label: list[i].label };
  2539. state.tokens.push(token);
  2540. if (list[i].tokens) {
  2541. tokens = [];
  2542. token = new state.Token('paragraph_open', 'p', 1);
  2543. token.block = true;
  2544. tokens.push(token);
  2545. token = new state.Token('inline', '', 0);
  2546. token.children = list[i].tokens;
  2547. token.content = '';
  2548. tokens.push(token);
  2549. token = new state.Token('paragraph_close', 'p', -1);
  2550. token.block = true;
  2551. tokens.push(token);
  2552. } else if (list[i].label) {
  2553. tokens = refTokens[':' + list[i].label];
  2554. }
  2555. state.tokens = state.tokens.concat(tokens);
  2556. if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {
  2557. lastParagraph = state.tokens.pop();
  2558. } else {
  2559. lastParagraph = null;
  2560. }
  2561. t = list[i].count > 0 ? list[i].count : 1;
  2562. for (j = 0; j < t; j++) {
  2563. token = new state.Token('footnote_anchor', '', 0);
  2564. token.meta = { id: i, subId: j, label: list[i].label };
  2565. state.tokens.push(token);
  2566. }
  2567. if (lastParagraph) {
  2568. state.tokens.push(lastParagraph);
  2569. }
  2570. token = new state.Token('footnote_close', '', -1);
  2571. state.tokens.push(token);
  2572. }
  2573. token = new state.Token('footnote_block_close', '', -1);
  2574. state.tokens.push(token);
  2575. }
  2576. md.block.ruler.before('reference', 'footnote_def', footnote_def, { alt: [ 'paragraph', 'reference' ] });
  2577. md.inline.ruler.after('image', 'footnote_inline', footnote_inline);
  2578. md.inline.ruler.after('footnote_inline', 'footnote_ref', footnote_ref);
  2579. md.core.ruler.after('inline', 'footnote_tail', footnote_tail);
  2580. };
  2581. /***/ }),
  2582. /* 10 */
  2583. /***/ (function(module, exports, __webpack_require__) {
  2584. "use strict";
  2585. module.exports = __webpack_require__(37);
  2586. /***/ }),
  2587. /* 11 */
  2588. /***/ (function(module, exports, __webpack_require__) {
  2589. "use strict";
  2590. // HTML5 entities map: { name -> utf16string }
  2591. //
  2592. /*eslint quotes:0*/
  2593. module.exports = __webpack_require__(24);
  2594. /***/ }),
  2595. /* 12 */
  2596. /***/ (function(module, exports, __webpack_require__) {
  2597. "use strict";
  2598. // Regexps to match html elements
  2599. var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
  2600. var unquoted = '[^"\'=<>`\\x00-\\x20]+';
  2601. var single_quoted = "'[^']*'";
  2602. var double_quoted = '"[^"]*"';
  2603. var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
  2604. var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
  2605. var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
  2606. var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
  2607. var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
  2608. var processing = '<[?].*?[?]>';
  2609. var declaration = '<![A-Z]+\\s+[^>]*>';
  2610. var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
  2611. var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
  2612. '|' + processing + '|' + declaration + '|' + cdata + ')');
  2613. var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
  2614. module.exports.HTML_TAG_RE = HTML_TAG_RE;
  2615. module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
  2616. /***/ }),
  2617. /* 13 */
  2618. /***/ (function(module, exports, __webpack_require__) {
  2619. "use strict";
  2620. // Process *this* and _that_
  2621. //
  2622. // Insert each marker as a separate text token, and add it to delimiter list
  2623. //
  2624. module.exports.tokenize = function emphasis(state, silent) {
  2625. var i, scanned, token,
  2626. start = state.pos,
  2627. marker = state.src.charCodeAt(start);
  2628. if (silent) { return false; }
  2629. if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
  2630. scanned = state.scanDelims(state.pos, marker === 0x2A);
  2631. for (i = 0; i < scanned.length; i++) {
  2632. token = state.push('text', '', 0);
  2633. token.content = String.fromCharCode(marker);
  2634. state.delimiters.push({
  2635. // Char code of the starting marker (number).
  2636. //
  2637. marker: marker,
  2638. // Total length of these series of delimiters.
  2639. //
  2640. length: scanned.length,
  2641. // An amount of characters before this one that's equivalent to
  2642. // current one. In plain English: if this delimiter does not open
  2643. // an emphasis, neither do previous `jump` characters.
  2644. //
  2645. // Used to skip sequences like "*****" in one step, for 1st asterisk
  2646. // value will be 0, for 2nd it's 1 and so on.
  2647. //
  2648. jump: i,
  2649. // A position of the token this delimiter corresponds to.
  2650. //
  2651. token: state.tokens.length - 1,
  2652. // Token level.
  2653. //
  2654. level: state.level,
  2655. // If this delimiter is matched as a valid opener, `end` will be
  2656. // equal to its position, otherwise it's `-1`.
  2657. //
  2658. end: -1,
  2659. // Boolean flags that determine if this delimiter could open or close
  2660. // an emphasis.
  2661. //
  2662. open: scanned.can_open,
  2663. close: scanned.can_close
  2664. });
  2665. }
  2666. state.pos += scanned.length;
  2667. return true;
  2668. };
  2669. // Walk through delimiter list and replace text tokens with tags
  2670. //
  2671. module.exports.postProcess = function emphasis(state) {
  2672. var i,
  2673. startDelim,
  2674. endDelim,
  2675. token,
  2676. ch,
  2677. isStrong,
  2678. delimiters = state.delimiters,
  2679. max = state.delimiters.length;
  2680. for (i = 0; i < max; i++) {
  2681. startDelim = delimiters[i];
  2682. if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
  2683. continue;
  2684. }
  2685. // Process only opening markers
  2686. if (startDelim.end === -1) {
  2687. continue;
  2688. }
  2689. endDelim = delimiters[startDelim.end];
  2690. // If the next delimiter has the same marker and is adjacent to this one,
  2691. // merge those into one strong delimiter.
  2692. //
  2693. // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
  2694. //
  2695. isStrong = i + 1 < max &&
  2696. delimiters[i + 1].end === startDelim.end - 1 &&
  2697. delimiters[i + 1].token === startDelim.token + 1 &&
  2698. delimiters[startDelim.end - 1].token === endDelim.token - 1 &&
  2699. delimiters[i + 1].marker === startDelim.marker;
  2700. ch = String.fromCharCode(startDelim.marker);
  2701. token = state.tokens[startDelim.token];
  2702. token.type = isStrong ? 'strong_open' : 'em_open';
  2703. token.tag = isStrong ? 'strong' : 'em';
  2704. token.nesting = 1;
  2705. token.markup = isStrong ? ch + ch : ch;
  2706. token.content = '';
  2707. token = state.tokens[endDelim.token];
  2708. token.type = isStrong ? 'strong_close' : 'em_close';
  2709. token.tag = isStrong ? 'strong' : 'em';
  2710. token.nesting = -1;
  2711. token.markup = isStrong ? ch + ch : ch;
  2712. token.content = '';
  2713. if (isStrong) {
  2714. state.tokens[delimiters[i + 1].token].content = '';
  2715. state.tokens[delimiters[startDelim.end - 1].token].content = '';
  2716. i++;
  2717. }
  2718. }
  2719. };
  2720. /***/ }),
  2721. /* 14 */
  2722. /***/ (function(module, exports, __webpack_require__) {
  2723. "use strict";
  2724. // ~~strike through~~
  2725. //
  2726. // Insert each marker as a separate text token, and add it to delimiter list
  2727. //
  2728. module.exports.tokenize = function strikethrough(state, silent) {
  2729. var i, scanned, token, len, ch,
  2730. start = state.pos,
  2731. marker = state.src.charCodeAt(start);
  2732. if (silent) { return false; }
  2733. if (marker !== 0x7E/* ~ */) { return false; }
  2734. scanned = state.scanDelims(state.pos, true);
  2735. len = scanned.length;
  2736. ch = String.fromCharCode(marker);
  2737. if (len < 2) { return false; }
  2738. if (len % 2) {
  2739. token = state.push('text', '', 0);
  2740. token.content = ch;
  2741. len--;
  2742. }
  2743. for (i = 0; i < len; i += 2) {
  2744. token = state.push('text', '', 0);
  2745. token.content = ch + ch;
  2746. state.delimiters.push({
  2747. marker: marker,
  2748. jump: i,
  2749. token: state.tokens.length - 1,
  2750. level: state.level,
  2751. end: -1,
  2752. open: scanned.can_open,
  2753. close: scanned.can_close
  2754. });
  2755. }
  2756. state.pos += scanned.length;
  2757. return true;
  2758. };
  2759. // Walk through delimiter list and replace text tokens with tags
  2760. //
  2761. module.exports.postProcess = function strikethrough(state) {
  2762. var i, j,
  2763. startDelim,
  2764. endDelim,
  2765. token,
  2766. loneMarkers = [],
  2767. delimiters = state.delimiters,
  2768. max = state.delimiters.length;
  2769. for (i = 0; i < max; i++) {
  2770. startDelim = delimiters[i];
  2771. if (startDelim.marker !== 0x7E/* ~ */) {
  2772. continue;
  2773. }
  2774. if (startDelim.end === -1) {
  2775. continue;
  2776. }
  2777. endDelim = delimiters[startDelim.end];
  2778. token = state.tokens[startDelim.token];
  2779. token.type = 's_open';
  2780. token.tag = 's';
  2781. token.nesting = 1;
  2782. token.markup = '~~';
  2783. token.content = '';
  2784. token = state.tokens[endDelim.token];
  2785. token.type = 's_close';
  2786. token.tag = 's';
  2787. token.nesting = -1;
  2788. token.markup = '~~';
  2789. token.content = '';
  2790. if (state.tokens[endDelim.token - 1].type === 'text' &&
  2791. state.tokens[endDelim.token - 1].content === '~') {
  2792. loneMarkers.push(endDelim.token - 1);
  2793. }
  2794. }
  2795. // If a marker sequence has an odd number of characters, it's splitted
  2796. // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
  2797. // start of the sequence.
  2798. //
  2799. // So, we have to move all those markers after subsequent s_close tags.
  2800. //
  2801. while (loneMarkers.length) {
  2802. i = loneMarkers.pop();
  2803. j = i + 1;
  2804. while (j < state.tokens.length && state.tokens[j].type === 's_close') {
  2805. j++;
  2806. }
  2807. j--;
  2808. if (i !== j) {
  2809. token = state.tokens[j];
  2810. state.tokens[j] = state.tokens[i];
  2811. state.tokens[i] = token;
  2812. }
  2813. }
  2814. };
  2815. /***/ }),
  2816. /* 15 */
  2817. /***/ (function(module, exports, __webpack_require__) {
  2818. "use strict";
  2819. module.exports.encode = __webpack_require__(77);
  2820. module.exports.decode = __webpack_require__(76);
  2821. module.exports.format = __webpack_require__(78);
  2822. module.exports.parse = __webpack_require__(79);
  2823. /***/ }),
  2824. /* 16 */
  2825. /***/ (function(module, exports) {
  2826. module.exports=/[\0-\x1F\x7F-\x9F]/
  2827. /***/ }),
  2828. /* 17 */
  2829. /***/ (function(module, exports) {
  2830. module.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/
  2831. /***/ }),
  2832. /* 18 */
  2833. /***/ (function(module, exports) {
  2834. module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
  2835. /***/ }),
  2836. /* 19 */
  2837. /***/ (function(module, exports, __webpack_require__) {
  2838. /**
  2839. * @Author: Bachir Soussi Chiadmi <bach>
  2840. * @Date: 16-04-2017
  2841. * @Email: bachir@figureslibres.io
  2842. * @Last modified by: bach
  2843. * @Last modified time: 18-04-2017
  2844. * @License: GPL-V3
  2845. */
  2846. __webpack_require__(28);
  2847. __webpack_require__(25);
  2848. __webpack_require__(26);
  2849. __webpack_require__(27);
  2850. var m = __webpack_require__(1);
  2851. // var marked = require('marked');
  2852. // var _helpers = require('modules/helpers');
  2853. var _dbs = __webpack_require__(2);
  2854. var _Inline = __webpack_require__(21);
  2855. var _Tree = __webpack_require__(22);
  2856. function init(){
  2857. _dbs.load(function(){
  2858. console.log("Init _dbs.data", _dbs.data);
  2859. console.log("Init _dbs.data_byid", _dbs.data_byid);
  2860. console.log("Init _dbs.data_strct", _dbs.data_strct);
  2861. m.route.prefix("");
  2862. m.route(document.body, "/lat/inline", {
  2863. "/:lang/inline": _Inline,
  2864. "/:lang/tree": _Tree,
  2865. });
  2866. });
  2867. };
  2868. // ___
  2869. // / | ____ ____
  2870. // / /| | / __ \/ __ \
  2871. // / ___ |/ /_/ / /_/ /
  2872. // /_/ |_/ .___/ .___/
  2873. // /_/ /_/
  2874. // var _App = {
  2875. // view: function(){
  2876. // console.log('_App view', _lang);
  2877. // return [
  2878. // m('header', [
  2879. // m('h1', 'Ethica'),
  2880. // m('aside', {'id':"menus"}, m(_LangMenu) )
  2881. // ]),
  2882. // m(_Tree),
  2883. // m('footer', [
  2884. // m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2885. // ])
  2886. // ]
  2887. // }
  2888. // }
  2889. // _ _ __
  2890. // (_)___ (_) /_
  2891. // / / __ \/ / __/
  2892. // / / / / / / /_
  2893. // /_/_/ /_/_/\__/
  2894. init()
  2895. /***/ }),
  2896. /* 20 */
  2897. /***/ (function(module, exports) {
  2898. // removed by extract-text-webpack-plugin
  2899. /***/ }),
  2900. /* 21 */
  2901. /***/ (function(module, exports, __webpack_require__) {
  2902. var m = __webpack_require__(1);
  2903. // https://github.com/markdown-it/markdown-it
  2904. var markdown = __webpack_require__(10)()
  2905. .use(__webpack_require__(9));
  2906. var _dbs = __webpack_require__(2);
  2907. var _Header = __webpack_require__(8);
  2908. var _Footer = __webpack_require__(7);
  2909. var _Ui = __webpack_require__(23);
  2910. // __ _ __
  2911. // / / (_)___ / /__
  2912. // / / / / __ \/ //_/
  2913. // / /___/ / / / / ,<
  2914. // /_____/_/_/ /_/_/|_|
  2915. var _Link = {
  2916. tid:"",
  2917. opened:false,
  2918. oninit: function(vn){
  2919. // console.log("INIT LINK : vn", vn);
  2920. // define target id
  2921. this.tid = vn.attrs.href;
  2922. },
  2923. onbeforeupdate: function(vn){
  2924. this.tid = vn.attrs.href;
  2925. },
  2926. view: function(vn){
  2927. this.tid_known = typeof _dbs.data_byid[_dbs.lang][this.tid] === 'undefined' ? false : true;
  2928. if (!this.tid_known) {
  2929. console.log('!! target id '+this.tid+' unkonwn !!');
  2930. }
  2931. if(this.opened && this.tid_known){
  2932. // console.log('this.tid', vn.state);
  2933. return m('div', {'class':'opened-link'},
  2934. [
  2935. m('span', {'class':"link text"}, vn.children),
  2936. typeof _dbs.data_byid[_dbs.lang][this.tid].childs != "undefined"
  2937. ? m(_Enonce, _dbs.data_byid[_dbs.lang][this.tid])
  2938. : m(_Item, _dbs.data_byid[_dbs.lang][this.tid])
  2939. ]
  2940. );
  2941. }else{
  2942. // console.log(vn);
  2943. return m('a', {
  2944. 'class':'link',
  2945. 'href':'#'+this.tid,
  2946. 'rel':this.tid,
  2947. onclick:function(e){
  2948. e.preventDefault();
  2949. console.log('click', this);
  2950. vn.state.opened = true;
  2951. return false;
  2952. }
  2953. }, vn.children); // c'est quoi ce vn.children ?
  2954. }
  2955. }
  2956. }
  2957. // ______ __
  2958. // /_ __/__ _ __/ /_
  2959. // / / / _ \| |/_/ __/
  2960. // / / / __/> </ /_
  2961. // /_/ \___/_/|_|\__/
  2962. // recusive function to record information of all subnodes
  2963. function parseTextDom(nodes){
  2964. var list = [];
  2965. // loop through childNodes
  2966. for (var i = 0; i < nodes.length; i++) {
  2967. var n = {};
  2968. if(typeof nodes[i].localName != "undefined"){
  2969. n.tag=nodes[i].localName;
  2970. if (n.tag == 'p') {
  2971. // replace p by div as we will insert other div in them
  2972. n.tag = 'div';
  2973. n.attrs = {'class':'paragraph'};
  2974. }
  2975. if (n.tag == 'a') {
  2976. // record the href attribute for cross reference
  2977. n.attrs = {'href':nodes[i].attributes.href.value};
  2978. }
  2979. if(nodes[i].childNodes.length){
  2980. // again parse node's childs
  2981. n.childs = parseTextDom(nodes[i].childNodes);
  2982. }
  2983. }else if (nodes[i].textContent.length > 1){
  2984. // if node has no localName it is probably a #text node
  2985. // we record it if it's not empty
  2986. n.tag='#text';
  2987. n.text=nodes[i].textContent;
  2988. }
  2989. // add the node to the list if it has a tag
  2990. if(typeof n.tag != "undefined")
  2991. list.push(n);
  2992. }
  2993. return list;
  2994. }
  2995. // recusive fucntion to generate mithril object from information recorded with parseTextDom()
  2996. function populateTextDom(n,i){
  2997. // console.log('populateTextDom : '+i,n);
  2998. return n.tag == "#text"
  2999. ? m.trust(n.text)
  3000. : m(
  3001. n.tag != 'a' ? n.tag : _Link,
  3002. typeof n.attrs != "undefined" ? n.attrs : {},
  3003. typeof n.childs != "undefined"
  3004. ? n.childs.map(populateTextDom)
  3005. : typeof n.text != "undefined"
  3006. ? m.trust(n.text)
  3007. : null
  3008. );
  3009. }
  3010. var _Text = {
  3011. id:null,
  3012. text:"",
  3013. texthtml:"",
  3014. textdom:null,
  3015. textchilds:[],
  3016. parsetext: function(){
  3017. // console.log('parsetext', this);
  3018. // !! we need to convert markdown to html here because parseTextDom() is recursive through nodes tree
  3019. // convert markdown to html
  3020. this.texthtml = markdown.render(this.text)
  3021. // TODO: fixe number link text disapear [3](1d3) ( in 104d )
  3022. // TODO: fixe parenthèse disparait _(par les Défin. [test 3](1d3) et [test 5](1d5))_ ( in 104d )
  3023. // parse html string to virtual dom
  3024. this.textdom = new DOMParser().parseFromString(this.texthtml, "text/html");
  3025. // get the text nodes (avoid html document extra)
  3026. this.textchilds = parseTextDom(this.textdom.getElementsByTagName('body')[0].childNodes);
  3027. },
  3028. oninit: function(vn){
  3029. this.id = vn.attrs.id;
  3030. this.text = vn.attrs.text || "";
  3031. this.parsetext();
  3032. },
  3033. onbeforeupdate: function(vn,old){
  3034. this.text = vn.attrs.text;
  3035. this.parsetext();
  3036. },
  3037. view: function(vn){
  3038. // console.log('_Text :: view : '+vn.attrs.slug, vn);
  3039. return m('div',
  3040. {'class':'text'},
  3041. // loop through childNodes list generated by parseTextDom() in init
  3042. this.textchilds.map(populateTextDom)
  3043. ); // /m.div.text
  3044. } // view:
  3045. }
  3046. // ______
  3047. // / _/ /____ ____ ___
  3048. // / // __/ _ \/ __ `__ \
  3049. // _/ // /_/ __/ / / / / /
  3050. // /___/\__/\___/_/ /_/ /_/
  3051. var _Item = {
  3052. id:null,
  3053. part:null,
  3054. type:null,
  3055. nested:false,
  3056. oninit: function(vn){
  3057. // console.log('vn.attrs', vn.attrs);
  3058. this.id = vn.attrs.id;
  3059. this.type = vn.attrs.type;
  3060. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3061. this.text = vn.attrs.text;
  3062. this.nested = vn.attrs.nested || false;
  3063. },
  3064. onbeforeupdate: function(vn, old){
  3065. this.nested = vn.attrs.nested || false;
  3066. this.type = vn.attrs.type;
  3067. this.text = vn.attrs.text;
  3068. },
  3069. view: function(vn){
  3070. return m("section", {
  3071. 'id':this.id,
  3072. 'class':'item'+(this.nested ? ' nested':'')
  3073. },
  3074. [
  3075. // create title node
  3076. m("h3", {
  3077. // 'ref':vn.attrs.href,
  3078. onclick: function(e){
  3079. vn.state.active = vn.state.active ? 0 : 1;
  3080. }
  3081. }, this.type),
  3082. // create text node
  3083. m(_Text, {'text':this.text, 'id':this.id})
  3084. ]
  3085. )
  3086. }
  3087. };
  3088. // ______
  3089. // / ____/___ ____ ____ ________
  3090. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3091. // / /___/ / / / /_/ / / / / /__/ __/
  3092. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3093. var _Enonce = {
  3094. partid:null,
  3095. id:null,
  3096. title:null,
  3097. text:null,
  3098. nested:false,
  3099. childs:[],
  3100. oninit:function(vn){
  3101. // // console.log('Enonce on init', vn);
  3102. this.partid = vn.attrs.partid;
  3103. this.id = vn.attrs.id;
  3104. this.title = vn.attrs.title || "";
  3105. this.text = vn.attrs.text;
  3106. this.childs = vn.attrs.childs || [];
  3107. this.nested = vn.attrs.nested || false;
  3108. },
  3109. onbeforeupdate:function(vn, old) {
  3110. // console.log(vn.attrs.childs);
  3111. this.title = vn.attrs.title || "";
  3112. this.text = vn.attrs.text;
  3113. this.childs = vn.attrs.childs || [];
  3114. this.nested = vn.attrs.nested || false;
  3115. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3116. },
  3117. view: function(vn){
  3118. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3119. return m("section", {
  3120. 'id' :this.id,
  3121. 'class' :'enonce'+(this.nested ? ' nested':'')
  3122. },
  3123. [
  3124. // create title node
  3125. m("h2", {}, m.trust(markdown.renderInline(this.title))),
  3126. // create text node
  3127. m(_Text, {'text':this.text, 'id':this.id}),
  3128. // addd children
  3129. this.childs.map(function(c){
  3130. return m(_Item, c)
  3131. })
  3132. ])
  3133. }
  3134. }
  3135. // ____ __
  3136. // / __ \____ ______/ /_
  3137. // / /_/ / __ `/ ___/ __/
  3138. // / ____/ /_/ / / / /_
  3139. // /_/ \__,_/_/ \__/
  3140. var _Part = {
  3141. oninit: function(vn){
  3142. this.id = vn.attrs.id;
  3143. this.title = vn.attrs.title || '';
  3144. this.enonces = vn.attrs.enonces;
  3145. },
  3146. onbeforeupdate: function(vn, old){
  3147. // console.log('_Part, onbeforeupdate old',old);
  3148. this.title = vn.attrs.title || '';
  3149. this.enonces = vn.attrs.enonces;
  3150. },
  3151. view: function(vn){
  3152. // console.log(vn.attrs.enonces);
  3153. return m("section", {
  3154. 'id' :this.id,
  3155. 'class' :'part'
  3156. },
  3157. [
  3158. // create title node
  3159. m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
  3160. // create text node
  3161. this.enonces.map(function(e){
  3162. // console.log(e.type);
  3163. // var title = e.title || '';
  3164. switch (e.type) {
  3165. case "title":
  3166. // handle titles
  3167. // console.log('title');
  3168. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3169. break;
  3170. case "filet":
  3171. // handle filets
  3172. // console.log('filet');
  3173. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3174. break;
  3175. default:
  3176. // or build structure
  3177. return m(_Enonce, Object.assign({"partid":this.id},e));
  3178. }
  3179. })
  3180. ]
  3181. )
  3182. }
  3183. }
  3184. // ____ __ _
  3185. // / _/___ / / (_)___ ___
  3186. // / // __ \/ / / / __ \/ _ \
  3187. // _/ // / / / /___/ / / / / __/
  3188. // /___/_/ /_/_____/_/_/ /_/\___/
  3189. module.exports = {
  3190. // oninit : function(vn){
  3191. // this.lang = vn.attrs.lang;
  3192. // },
  3193. oncreate: function(vn){
  3194. document.body.classList.add('inline');
  3195. _Ui.init();
  3196. },
  3197. view: function(vn){
  3198. console.log('_Inline view', vn.attrs.lang);
  3199. return [
  3200. m(_Header),
  3201. m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){
  3202. // console.log("MAP _dbs", p);
  3203. return m(_Part,p);
  3204. })
  3205. ),
  3206. m(_Footer)
  3207. ]
  3208. }
  3209. }
  3210. /***/ }),
  3211. /* 22 */
  3212. /***/ (function(module, exports, __webpack_require__) {
  3213. var m = __webpack_require__(1);
  3214. // https://github.com/markdown-it/markdown-it
  3215. var markdown = __webpack_require__(10)()
  3216. .use(__webpack_require__(9));
  3217. var _dbs = __webpack_require__(2);
  3218. var _Header = __webpack_require__(8);
  3219. var _Footer = __webpack_require__(7);
  3220. var _Ui = __webpack_require__(23);
  3221. // ____ __
  3222. // / __ \____ / /_
  3223. // / / / / __ \/ __/
  3224. // / /_/ / /_/ / /_
  3225. // /_____/\____/\__/
  3226. var _Dot = {
  3227. id:null,
  3228. type:'',
  3229. text:'',
  3230. summary:'',
  3231. active:true,
  3232. opened:false,
  3233. links:null,
  3234. parents:[],
  3235. lang:_dbs.lang,
  3236. setuptext:function(vn){
  3237. // console.log('setuptext', vn);
  3238. // construct text
  3239. this.text = vn.attrs.text || '';
  3240. this.rendered_text = markdown.render(this.text);
  3241. // construct summary
  3242. // TODO: summary needs more work (strip tags, markdown render)
  3243. this.summary = this.text.match('([^ ]*[ ]{0,1}){1,6}')[0];
  3244. this.summary = this.summary.trim().replace(/_([^_]+)$/g, "_$1_");
  3245. this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
  3246. this.summary = markdown.renderInline(this.summary) + "&nbsp;…";
  3247. },
  3248. oninit: function(vn){
  3249. this.id = vn.attrs.id;
  3250. this.type = vn.attrs.type;
  3251. this.setuptext(vn);
  3252. if(typeof vn.attrs.active !== 'undefined')
  3253. this.active = vn.attrs.active;
  3254. // links
  3255. this.links = _dbs.data_strct[this.id];
  3256. // console.log(this.links);
  3257. // parents memorize where do we come from to avoid duplicates and looping nav
  3258. if(vn.attrs.parents){
  3259. this.parents = this.parents.concat(vn.attrs.parents);
  3260. // console.log('_Dot init '+this.id+' parents :',this.parents);
  3261. }
  3262. },
  3263. oncreate: function(vn){
  3264. if(this.active){
  3265. vn.dom.classList.remove('disabled');
  3266. }else{
  3267. vn.dom.classList.add('disabled');
  3268. }
  3269. },
  3270. onbeforeupdate: function(vn){
  3271. // console.log('onbeforeupdate');
  3272. if(this.lang != _dbs.lang){
  3273. this.lang = _dbs.lang;
  3274. this.setuptext(vn);
  3275. }
  3276. },
  3277. view: function(vn){
  3278. if (this.active && this.opened) {
  3279. // full view of dot with linked dots
  3280. // console.log('_Dot view '+this.id+' parents :',this.parents);
  3281. var dot_content = [
  3282. // links to
  3283. this.links.to.length
  3284. ? m('nav', {'class':'links to'}, this.links.to.map(function(id){
  3285. // console.log(id);
  3286. if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
  3287. return m(_Dot, {
  3288. "id":id,
  3289. 'text':_dbs.data_byid[_dbs.lang][id].text,
  3290. 'type':'',
  3291. // passe the memory of crossed dots plus the current one
  3292. 'parents':vn.state.parents.concat([vn.state.id]),
  3293. // activate link only if not in parents (already went through it)
  3294. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  3295. });
  3296. }
  3297. })
  3298. )
  3299. : null,
  3300. // id
  3301. m('span', {'class':'id'}, this.id), // this.type+' '+
  3302. // bullet
  3303. m('span', {'class':'bullet'}, m.trust('&#9899;')),
  3304. // full text
  3305. m('section', {
  3306. 'class':'text',
  3307. onmouseover: function(e){
  3308. e.preventDefault();
  3309. if(e.target.nodeName == "A" ){
  3310. // console.log("over e.target", e.target);
  3311. // console.log('over vn', vn);
  3312. var id = e.target.getAttribute("href");
  3313. // add highlight class
  3314. vn.dom.querySelector('nav.links>div[uid="'+id+'"]').classList.add('highlight');
  3315. }else{
  3316. // remove all hilight class
  3317. for (link of vn.dom.querySelectorAll('nav.links>div.dot')) {
  3318. link.classList.remove('highlight');
  3319. }
  3320. }
  3321. },
  3322. onclick:function(e){
  3323. e.preventDefault();
  3324. if(e.target.nodeName == "A" ){
  3325. // console.log("over e.target", e.target);
  3326. // console.log('over vn', vn);
  3327. var id = e.target.getAttribute("href");
  3328. // add highlight class
  3329. vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
  3330. }
  3331. }
  3332. }, m.trust(this.rendered_text)),
  3333. // links from
  3334. this.links.from.length
  3335. ? m('nav', {'class':'links from'}, this.links.from.map(function(id){
  3336. // retrun a dot
  3337. return m(_Dot, {
  3338. "id":id,
  3339. 'text':_dbs.data_byid[_dbs.lang][id].text,
  3340. 'type':'',
  3341. // passe the memory of crossed dots plus the current one
  3342. 'parents':vn.state.parents.concat([vn.state.id]),
  3343. // activate link only if not in parents (already went through it)
  3344. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  3345. });
  3346. })
  3347. )
  3348. : null
  3349. ];
  3350. }else{
  3351. // preview dot
  3352. var dot_content = [
  3353. m('span', {'class':'id'}, this.id), // this.type+' '+
  3354. m('span', {'class':'bullet'}, m.trust('&#8226;')),
  3355. m('p', {
  3356. 'class':'summary',
  3357. onclick:function(e){
  3358. // TODO: animate openening (text and links separatly)
  3359. vn.state.opened = true;
  3360. }
  3361. }, m.trust(this.summary))
  3362. ];
  3363. }
  3364. return m('div',{
  3365. 'uid':this.id,
  3366. 'class':'dot'
  3367. },
  3368. dot_content
  3369. );
  3370. },
  3371. onupdate: function(vn){
  3372. // console.log('_Dot : onupdate', vn);
  3373. if(this.active){
  3374. if (this.opened){
  3375. vn.dom.classList.add('opened');
  3376. if(this.links.to.length)
  3377. vn.dom.classList.add('to-links');
  3378. if(this.links.from.length)
  3379. vn.dom.classList.add('from-links');
  3380. }else{
  3381. vn.dom.classList.remove('opened');
  3382. }
  3383. }
  3384. }
  3385. }
  3386. /*
  3387. down vote
  3388. Here's full list of black dotlikes from unicode
  3389. ● - &#9679; - Black Circle
  3390. ⏺ - &#9210; - Black Circle for Record
  3391. ⚫ - &#9899; - Medium Black Circle
  3392. ⬤ - &#11044; - Black Large Circle
  3393. ⧭ - &#10733; - Black Circle with Down Arrow
  3394. 🞄 - &#128900; - Black Slightly Small Circle
  3395. • - &#8226; - Bullet
  3396. ∙ - &#8729; - Bullet Operator
  3397. ⋅ - &#8901; - Dot Operator
  3398. 🌑 - &#127761; - New Moon Symbol
  3399. */
  3400. // _______ _ __ __
  3401. // / ___/ / (_) /__/ /
  3402. // / /__/ _ \/ / / _ /
  3403. // \___/_//_/_/_/\_,_/
  3404. var _Child = {
  3405. id:null,
  3406. part:null,
  3407. type:null,
  3408. // nested:false,
  3409. text:'',
  3410. oninit: function(vn){
  3411. // console.log('vn.attrs', vn.attrs);
  3412. this.id = vn.attrs.id;
  3413. this.type = vn.attrs.type;
  3414. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3415. this.text = vn.attrs.text;
  3416. // this.nested = vn.attrs.nested || false;
  3417. },
  3418. onbeforeupdate: function(vn, old){
  3419. // this.nested = vn.attrs.nested || false;
  3420. this.type = vn.attrs.type;
  3421. this.text = vn.attrs.text;
  3422. },
  3423. view: function(vn){
  3424. return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type});
  3425. }
  3426. };
  3427. // ______
  3428. // / ____/___ ____ ____ ________
  3429. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3430. // / /___/ / / / /_/ / / / / /__/ __/
  3431. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3432. var _Enonce = {
  3433. partid:null,
  3434. id:null,
  3435. title:null,
  3436. text:null,
  3437. // nested:false,
  3438. childs:[],
  3439. oninit:function(vn){
  3440. // // console.log('Enonce on init', vn);
  3441. this.partid = vn.attrs.partid;
  3442. this.id = vn.attrs.id;
  3443. this.title = vn.attrs.title || "";
  3444. this.text = vn.attrs.text;
  3445. this.childs = vn.attrs.childs || [];
  3446. // this.nested = vn.attrs.nested || false;
  3447. },
  3448. onbeforeupdate:function(vn, old) {
  3449. // console.log(vn.attrs.childs);
  3450. this.title = vn.attrs.title || "";
  3451. this.text = vn.attrs.text;
  3452. this.childs = vn.attrs.childs || [];
  3453. // this.nested = vn.attrs.nested || false;
  3454. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3455. },
  3456. view: function(vn){
  3457. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3458. return [
  3459. // create dot
  3460. m(_Dot, {"id":this.id, 'text':this.text,'type':this.title}),
  3461. // addd children
  3462. this.childs.map(function(c){
  3463. return m(_Child, c);
  3464. })
  3465. ]
  3466. }
  3467. }
  3468. // ____ __
  3469. // / __ \____ ______/ /_
  3470. // / /_/ / __ `/ ___/ __/
  3471. // / ____/ /_/ / / / /_
  3472. // /_/ \__,_/_/ \__/
  3473. var _Part = {
  3474. oninit: function(vn){
  3475. this.id = vn.attrs.id;
  3476. this.title = vn.attrs.title || "";
  3477. this.enonces = vn.attrs.enonces;
  3478. },
  3479. onbeforeupdate: function(vn, old){
  3480. // console.log('_Part, onbeforeupdate old',old);
  3481. this.title = vn.attrs.title || "";
  3482. this.enonces = vn.attrs.enonces;
  3483. },
  3484. view: function(vn){
  3485. // console.log(vn.attrs.enonces);
  3486. return m("section", {
  3487. 'id' :this.id,
  3488. 'class' :'part'
  3489. },
  3490. [
  3491. // create title node
  3492. m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
  3493. // create text node
  3494. this.enonces.map(function(e){
  3495. // console.log(e.text);
  3496. // return m(_Enonce, Object.assign({"partid":this.id},e))
  3497. switch (e.type) {
  3498. case "title":
  3499. // handle titles
  3500. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3501. break;
  3502. case "filet":
  3503. // handle filets
  3504. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3505. break;
  3506. default:
  3507. // or build structure
  3508. return m(_Enonce, Object.assign({"partid":this.id},e));
  3509. }
  3510. })
  3511. ]
  3512. )
  3513. }
  3514. }
  3515. // ______
  3516. // /_ __/_______ ___
  3517. // / / / ___/ _ \/ _ \
  3518. // / / / / / __/ __/
  3519. // /_/ /_/ \___/\___/
  3520. module.exports = {
  3521. // oninit : function(vn){
  3522. // this.lang = vn.attrs.lang;
  3523. // },
  3524. oncreate: function(vn){
  3525. document.body.classList.add('tree');
  3526. _Ui.init();
  3527. },
  3528. view: function(vn){
  3529. console.log('_Tree view', vn.attrs.lang);
  3530. return [
  3531. m(_Header),
  3532. m('main', {id:"content", 'class':'tree'}, _dbs.data[vn.attrs.lang].map(function(p){
  3533. return m(_Part,p);
  3534. })
  3535. ),
  3536. m(_Footer)
  3537. ];
  3538. }
  3539. }
  3540. // function(){
  3541. // switch(_dbs.lang){
  3542. // case 'fr':
  3543. // return "Hello dots !";
  3544. // break;
  3545. // case 'bra':
  3546. // return '"Hola dots !"'
  3547. // break;
  3548. // }
  3549. // }
  3550. /***/ }),
  3551. /* 23 */
  3552. /***/ (function(module, exports) {
  3553. /**
  3554. * @Author: Bachir Soussi Chiadmi <bach>
  3555. * @Date: 12-09-2017
  3556. * @Email: bachir@figureslibres.io
  3557. * @Last modified by: bach
  3558. * @Last modified time: 12-09-2017
  3559. * @License: GPL-V3
  3560. */
  3561. // var $ = require('jquery');
  3562. // https://plainjs.com
  3563. // jQuery(document).ready(function($) {
  3564. // console.log('Hello Jquery');
  3565. // var $window;
  3566. var init = function(){
  3567. console.log('UI init');
  3568. // $window = $(window);
  3569. // _____ __ _ __ __ _ __ __
  3570. // / ___// /_(_)____/ /____ __ / /_(_) /_/ /__
  3571. // \__ \/ __/ / ___/ //_/ / / / / __/ / __/ / _ \
  3572. // ___/ / /_/ / /__/ ,< / /_/ / / /_/ / /_/ / __/
  3573. // /____/\__/_/\___/_/|_|\__, / \__/_/\__/_/\___/
  3574. // /____/
  3575. // https://codepen.io/chrissp26/pen/gBrdo?editors=0010
  3576. // var header_height = $('header').height();
  3577. var header_height = document.getElementsByTagName('header')[0].clientHeight;
  3578. console.log(header_height);
  3579. // var $sticky_clone_wrapper = $('<div>').addClass('sticky-clone-wrapper').appendTo('body');
  3580. var sticky_clone_wrapper = document.createElement('div');
  3581. sticky_clone_wrapper.classList.add('sticky-clone-wrapper');
  3582. document.body.append(sticky_clone_wrapper);
  3583. //
  3584. // var $stickies = $('h1.part-title').addClass('sticky').each(function(i){
  3585. // var $sticky = $(this);
  3586. // $sticky
  3587. // .data('originalPosition', $sticky.offset().top)
  3588. // .data('originalHeight', $sticky.outerHeight());
  3589. // });
  3590. var stickies = new Array();
  3591. Array.from(document.querySelectorAll('h1.part-title')).forEach(function(e){
  3592. // console.log('sticky', e);
  3593. e._part = e.getAttribute('part');
  3594. stickies.push(e)
  3595. });
  3596. console.log('stickies', stickies);
  3597. //
  3598. // var OnScroll = function(event){
  3599. // var $last_sticky;
  3600. // $stickies.each(function(i){
  3601. // var $sticky = $(this);
  3602. // var pos = $sticky.data('originalPosition');
  3603. // if(pos < $window.scrollTop()+header_height){
  3604. //
  3605. // }
  3606. // // if(i == 1){
  3607. // // console.log(pos +" | "+$window.scrollTop());
  3608. // // }
  3609. // // if(pos < $window.scrollTop()+header_height){
  3610. // // if(!$sticky.is('.sticked')){
  3611. // // $sticky.addClass('sticked').clone().appendTo($sticky_clone_wrapper.empty());
  3612. // // }
  3613. // // }else{
  3614. // // if($sticky.is('.sticked')){
  3615. // // $sticky.removeClass('sticked');
  3616. // // $('.part-title[part="'+$sticky.attr('part')+'"]', $sticky_clone_wrapper).remove();
  3617. // // }
  3618. // // }
  3619. // });
  3620. // };
  3621. var last_sticky = "", sticked_sticky, clone;
  3622. var OnScroll = function(event){
  3623. // console.log('on scrool', event);
  3624. sticked_sticky = false;
  3625. for (var i = stickies.length-1; i >= 0; i--) {
  3626. if(stickies[i].getBoundingClientRect().top < header_height){
  3627. sticked_sticky = stickies[i];
  3628. break;
  3629. }
  3630. }
  3631. if (sticked_sticky) {
  3632. // console.log('sticked_sticky', sticked_sticky._part);
  3633. if(last_sticky !== sticked_sticky._part){
  3634. // console.log('new sticky', last_sticky);
  3635. // fill sticky_clone_wrapper
  3636. clone = sticked_sticky.cloneNode(true);
  3637. sticky_clone_wrapper.innerHTML = '';
  3638. sticky_clone_wrapper.appendChild(clone);
  3639. last_sticky = sticked_sticky._part;
  3640. }
  3641. }else{
  3642. // empty sticky_clone_wrapper
  3643. sticky_clone_wrapper.innerHTML = '';
  3644. }
  3645. };
  3646. //
  3647. // $window.on('scroll', OnScroll);
  3648. // console.log('window', window);
  3649. window.onscroll = OnScroll;
  3650. }
  3651. // });
  3652. module.exports = {
  3653. init : init
  3654. }
  3655. /***/ }),
  3656. /* 24 */
  3657. /***/ (function(module, exports) {
  3658. module.exports = {
  3659. "Aacute": "Á",
  3660. "aacute": "á",
  3661. "Abreve": "Ă",
  3662. "abreve": "ă",
  3663. "ac": "∾",
  3664. "acd": "∿",
  3665. "acE": "∾̳",
  3666. "Acirc": "Â",
  3667. "acirc": "â",
  3668. "acute": "´",
  3669. "Acy": "А",
  3670. "acy": "а",
  3671. "AElig": "Æ",
  3672. "aelig": "æ",
  3673. "af": "⁡",
  3674. "Afr": "𝔄",
  3675. "afr": "𝔞",
  3676. "Agrave": "À",
  3677. "agrave": "à",
  3678. "alefsym": "ℵ",
  3679. "aleph": "ℵ",
  3680. "Alpha": "Α",
  3681. "alpha": "α",
  3682. "Amacr": "Ā",
  3683. "amacr": "ā",
  3684. "amalg": "⨿",
  3685. "amp": "&",
  3686. "AMP": "&",
  3687. "andand": "⩕",
  3688. "And": "⩓",
  3689. "and": "∧",
  3690. "andd": "⩜",
  3691. "andslope": "⩘",
  3692. "andv": "⩚",
  3693. "ang": "∠",
  3694. "ange": "⦤",
  3695. "angle": "∠",
  3696. "angmsdaa": "⦨",
  3697. "angmsdab": "⦩",
  3698. "angmsdac": "⦪",
  3699. "angmsdad": "⦫",
  3700. "angmsdae": "⦬",
  3701. "angmsdaf": "⦭",
  3702. "angmsdag": "⦮",
  3703. "angmsdah": "⦯",
  3704. "angmsd": "∡",
  3705. "angrt": "∟",
  3706. "angrtvb": "⊾",
  3707. "angrtvbd": "⦝",
  3708. "angsph": "∢",
  3709. "angst": "Å",
  3710. "angzarr": "⍼",
  3711. "Aogon": "Ą",
  3712. "aogon": "ą",
  3713. "Aopf": "𝔸",
  3714. "aopf": "𝕒",
  3715. "apacir": "⩯",
  3716. "ap": "≈",
  3717. "apE": "⩰",
  3718. "ape": "≊",
  3719. "apid": "≋",
  3720. "apos": "'",
  3721. "ApplyFunction": "⁡",
  3722. "approx": "≈",
  3723. "approxeq": "≊",
  3724. "Aring": "Å",
  3725. "aring": "å",
  3726. "Ascr": "𝒜",
  3727. "ascr": "𝒶",
  3728. "Assign": "≔",
  3729. "ast": "*",
  3730. "asymp": "≈",
  3731. "asympeq": "≍",
  3732. "Atilde": "Ã",
  3733. "atilde": "ã",
  3734. "Auml": "Ä",
  3735. "auml": "ä",
  3736. "awconint": "∳",
  3737. "awint": "⨑",
  3738. "backcong": "≌",
  3739. "backepsilon": "϶",
  3740. "backprime": "‵",
  3741. "backsim": "∽",
  3742. "backsimeq": "⋍",
  3743. "Backslash": "∖",
  3744. "Barv": "⫧",
  3745. "barvee": "⊽",
  3746. "barwed": "⌅",
  3747. "Barwed": "⌆",
  3748. "barwedge": "⌅",
  3749. "bbrk": "⎵",
  3750. "bbrktbrk": "⎶",
  3751. "bcong": "≌",
  3752. "Bcy": "Б",
  3753. "bcy": "б",
  3754. "bdquo": "„",
  3755. "becaus": "∵",
  3756. "because": "∵",
  3757. "Because": "∵",
  3758. "bemptyv": "⦰",
  3759. "bepsi": "϶",
  3760. "bernou": "ℬ",
  3761. "Bernoullis": "ℬ",
  3762. "Beta": "Β",
  3763. "beta": "β",
  3764. "beth": "ℶ",
  3765. "between": "≬",
  3766. "Bfr": "𝔅",
  3767. "bfr": "𝔟",
  3768. "bigcap": "⋂",
  3769. "bigcirc": "◯",
  3770. "bigcup": "⋃",
  3771. "bigodot": "⨀",
  3772. "bigoplus": "⨁",
  3773. "bigotimes": "⨂",
  3774. "bigsqcup": "⨆",
  3775. "bigstar": "★",
  3776. "bigtriangledown": "▽",
  3777. "bigtriangleup": "△",
  3778. "biguplus": "⨄",
  3779. "bigvee": "⋁",
  3780. "bigwedge": "⋀",
  3781. "bkarow": "⤍",
  3782. "blacklozenge": "⧫",
  3783. "blacksquare": "▪",
  3784. "blacktriangle": "▴",
  3785. "blacktriangledown": "▾",
  3786. "blacktriangleleft": "◂",
  3787. "blacktriangleright": "▸",
  3788. "blank": "␣",
  3789. "blk12": "▒",
  3790. "blk14": "░",
  3791. "blk34": "▓",
  3792. "block": "█",
  3793. "bne": "=⃥",
  3794. "bnequiv": "≡⃥",
  3795. "bNot": "⫭",
  3796. "bnot": "⌐",
  3797. "Bopf": "𝔹",
  3798. "bopf": "𝕓",
  3799. "bot": "⊥",
  3800. "bottom": "⊥",
  3801. "bowtie": "⋈",
  3802. "boxbox": "⧉",
  3803. "boxdl": "┐",
  3804. "boxdL": "╕",
  3805. "boxDl": "╖",
  3806. "boxDL": "╗",
  3807. "boxdr": "┌",
  3808. "boxdR": "╒",
  3809. "boxDr": "╓",
  3810. "boxDR": "╔",
  3811. "boxh": "─",
  3812. "boxH": "═",
  3813. "boxhd": "┬",
  3814. "boxHd": "╤",
  3815. "boxhD": "╥",
  3816. "boxHD": "╦",
  3817. "boxhu": "┴",
  3818. "boxHu": "╧",
  3819. "boxhU": "╨",
  3820. "boxHU": "╩",
  3821. "boxminus": "⊟",
  3822. "boxplus": "⊞",
  3823. "boxtimes": "⊠",
  3824. "boxul": "┘",
  3825. "boxuL": "╛",
  3826. "boxUl": "╜",
  3827. "boxUL": "╝",
  3828. "boxur": "└",
  3829. "boxuR": "╘",
  3830. "boxUr": "╙",
  3831. "boxUR": "╚",
  3832. "boxv": "│",
  3833. "boxV": "║",
  3834. "boxvh": "┼",
  3835. "boxvH": "╪",
  3836. "boxVh": "╫",
  3837. "boxVH": "╬",
  3838. "boxvl": "┤",
  3839. "boxvL": "╡",
  3840. "boxVl": "╢",
  3841. "boxVL": "╣",
  3842. "boxvr": "├",
  3843. "boxvR": "╞",
  3844. "boxVr": "╟",
  3845. "boxVR": "╠",
  3846. "bprime": "‵",
  3847. "breve": "˘",
  3848. "Breve": "˘",
  3849. "brvbar": "¦",
  3850. "bscr": "𝒷",
  3851. "Bscr": "ℬ",
  3852. "bsemi": "⁏",
  3853. "bsim": "∽",
  3854. "bsime": "⋍",
  3855. "bsolb": "⧅",
  3856. "bsol": "\\",
  3857. "bsolhsub": "⟈",
  3858. "bull": "•",
  3859. "bullet": "•",
  3860. "bump": "≎",
  3861. "bumpE": "⪮",
  3862. "bumpe": "≏",
  3863. "Bumpeq": "≎",
  3864. "bumpeq": "≏",
  3865. "Cacute": "Ć",
  3866. "cacute": "ć",
  3867. "capand": "⩄",
  3868. "capbrcup": "⩉",
  3869. "capcap": "⩋",
  3870. "cap": "∩",
  3871. "Cap": "⋒",
  3872. "capcup": "⩇",
  3873. "capdot": "⩀",
  3874. "CapitalDifferentialD": "ⅅ",
  3875. "caps": "∩︀",
  3876. "caret": "⁁",
  3877. "caron": "ˇ",
  3878. "Cayleys": "ℭ",
  3879. "ccaps": "⩍",
  3880. "Ccaron": "Č",
  3881. "ccaron": "č",
  3882. "Ccedil": "Ç",
  3883. "ccedil": "ç",
  3884. "Ccirc": "Ĉ",
  3885. "ccirc": "ĉ",
  3886. "Cconint": "∰",
  3887. "ccups": "⩌",
  3888. "ccupssm": "⩐",
  3889. "Cdot": "Ċ",
  3890. "cdot": "ċ",
  3891. "cedil": "¸",
  3892. "Cedilla": "¸",
  3893. "cemptyv": "⦲",
  3894. "cent": "¢",
  3895. "centerdot": "·",
  3896. "CenterDot": "·",
  3897. "cfr": "𝔠",
  3898. "Cfr": "ℭ",
  3899. "CHcy": "Ч",
  3900. "chcy": "ч",
  3901. "check": "✓",
  3902. "checkmark": "✓",
  3903. "Chi": "Χ",
  3904. "chi": "χ",
  3905. "circ": "ˆ",
  3906. "circeq": "≗",
  3907. "circlearrowleft": "↺",
  3908. "circlearrowright": "↻",
  3909. "circledast": "⊛",
  3910. "circledcirc": "⊚",
  3911. "circleddash": "⊝",
  3912. "CircleDot": "⊙",
  3913. "circledR": "®",
  3914. "circledS": "Ⓢ",
  3915. "CircleMinus": "⊖",
  3916. "CirclePlus": "⊕",
  3917. "CircleTimes": "⊗",
  3918. "cir": "○",
  3919. "cirE": "⧃",
  3920. "cire": "≗",
  3921. "cirfnint": "⨐",
  3922. "cirmid": "⫯",
  3923. "cirscir": "⧂",
  3924. "ClockwiseContourIntegral": "∲",
  3925. "CloseCurlyDoubleQuote": "”",
  3926. "CloseCurlyQuote": "’",
  3927. "clubs": "♣",
  3928. "clubsuit": "♣",
  3929. "colon": ":",
  3930. "Colon": "∷",
  3931. "Colone": "⩴",
  3932. "colone": "≔",
  3933. "coloneq": "≔",
  3934. "comma": ",",
  3935. "commat": "@",
  3936. "comp": "∁",
  3937. "compfn": "∘",
  3938. "complement": "∁",
  3939. "complexes": "ℂ",
  3940. "cong": "≅",
  3941. "congdot": "⩭",
  3942. "Congruent": "≡",
  3943. "conint": "∮",
  3944. "Conint": "∯",
  3945. "ContourIntegral": "∮",
  3946. "copf": "𝕔",
  3947. "Copf": "ℂ",
  3948. "coprod": "∐",
  3949. "Coproduct": "∐",
  3950. "copy": "©",
  3951. "COPY": "©",
  3952. "copysr": "℗",
  3953. "CounterClockwiseContourIntegral": "∳",
  3954. "crarr": "↵",
  3955. "cross": "✗",
  3956. "Cross": "⨯",
  3957. "Cscr": "𝒞",
  3958. "cscr": "𝒸",
  3959. "csub": "⫏",
  3960. "csube": "⫑",
  3961. "csup": "⫐",
  3962. "csupe": "⫒",
  3963. "ctdot": "⋯",
  3964. "cudarrl": "⤸",
  3965. "cudarrr": "⤵",
  3966. "cuepr": "⋞",
  3967. "cuesc": "⋟",
  3968. "cularr": "↶",
  3969. "cularrp": "⤽",
  3970. "cupbrcap": "⩈",
  3971. "cupcap": "⩆",
  3972. "CupCap": "≍",
  3973. "cup": "∪",
  3974. "Cup": "⋓",
  3975. "cupcup": "⩊",
  3976. "cupdot": "⊍",
  3977. "cupor": "⩅",
  3978. "cups": "∪︀",
  3979. "curarr": "↷",
  3980. "curarrm": "⤼",
  3981. "curlyeqprec": "⋞",
  3982. "curlyeqsucc": "⋟",
  3983. "curlyvee": "⋎",
  3984. "curlywedge": "⋏",
  3985. "curren": "¤",
  3986. "curvearrowleft": "↶",
  3987. "curvearrowright": "↷",
  3988. "cuvee": "⋎",
  3989. "cuwed": "⋏",
  3990. "cwconint": "∲",
  3991. "cwint": "∱",
  3992. "cylcty": "⌭",
  3993. "dagger": "†",
  3994. "Dagger": "‡",
  3995. "daleth": "ℸ",
  3996. "darr": "↓",
  3997. "Darr": "↡",
  3998. "dArr": "⇓",
  3999. "dash": "‐",
  4000. "Dashv": "⫤",
  4001. "dashv": "⊣",
  4002. "dbkarow": "⤏",
  4003. "dblac": "˝",
  4004. "Dcaron": "Ď",
  4005. "dcaron": "ď",
  4006. "Dcy": "Д",
  4007. "dcy": "д",
  4008. "ddagger": "‡",
  4009. "ddarr": "⇊",
  4010. "DD": "ⅅ",
  4011. "dd": "ⅆ",
  4012. "DDotrahd": "⤑",
  4013. "ddotseq": "⩷",
  4014. "deg": "°",
  4015. "Del": "∇",
  4016. "Delta": "Δ",
  4017. "delta": "δ",
  4018. "demptyv": "⦱",
  4019. "dfisht": "⥿",
  4020. "Dfr": "𝔇",
  4021. "dfr": "𝔡",
  4022. "dHar": "⥥",
  4023. "dharl": "⇃",
  4024. "dharr": "⇂",
  4025. "DiacriticalAcute": "´",
  4026. "DiacriticalDot": "˙",
  4027. "DiacriticalDoubleAcute": "˝",
  4028. "DiacriticalGrave": "`",
  4029. "DiacriticalTilde": "˜",
  4030. "diam": "⋄",
  4031. "diamond": "⋄",
  4032. "Diamond": "⋄",
  4033. "diamondsuit": "♦",
  4034. "diams": "♦",
  4035. "die": "¨",
  4036. "DifferentialD": "ⅆ",
  4037. "digamma": "ϝ",
  4038. "disin": "⋲",
  4039. "div": "÷",
  4040. "divide": "÷",
  4041. "divideontimes": "⋇",
  4042. "divonx": "⋇",
  4043. "DJcy": "Ђ",
  4044. "djcy": "ђ",
  4045. "dlcorn": "⌞",
  4046. "dlcrop": "⌍",
  4047. "dollar": "$",
  4048. "Dopf": "𝔻",
  4049. "dopf": "𝕕",
  4050. "Dot": "¨",
  4051. "dot": "˙",
  4052. "DotDot": "⃜",
  4053. "doteq": "≐",
  4054. "doteqdot": "≑",
  4055. "DotEqual": "≐",
  4056. "dotminus": "∸",
  4057. "dotplus": "∔",
  4058. "dotsquare": "⊡",
  4059. "doublebarwedge": "⌆",
  4060. "DoubleContourIntegral": "∯",
  4061. "DoubleDot": "¨",
  4062. "DoubleDownArrow": "⇓",
  4063. "DoubleLeftArrow": "⇐",
  4064. "DoubleLeftRightArrow": "⇔",
  4065. "DoubleLeftTee": "⫤",
  4066. "DoubleLongLeftArrow": "⟸",
  4067. "DoubleLongLeftRightArrow": "⟺",
  4068. "DoubleLongRightArrow": "⟹",
  4069. "DoubleRightArrow": "⇒",
  4070. "DoubleRightTee": "⊨",
  4071. "DoubleUpArrow": "⇑",
  4072. "DoubleUpDownArrow": "⇕",
  4073. "DoubleVerticalBar": "∥",
  4074. "DownArrowBar": "⤓",
  4075. "downarrow": "↓",
  4076. "DownArrow": "↓",
  4077. "Downarrow": "⇓",
  4078. "DownArrowUpArrow": "⇵",
  4079. "DownBreve": "̑",
  4080. "downdownarrows": "⇊",
  4081. "downharpoonleft": "⇃",
  4082. "downharpoonright": "⇂",
  4083. "DownLeftRightVector": "⥐",
  4084. "DownLeftTeeVector": "⥞",
  4085. "DownLeftVectorBar": "⥖",
  4086. "DownLeftVector": "↽",
  4087. "DownRightTeeVector": "⥟",
  4088. "DownRightVectorBar": "⥗",
  4089. "DownRightVector": "⇁",
  4090. "DownTeeArrow": "↧",
  4091. "DownTee": "⊤",
  4092. "drbkarow": "⤐",
  4093. "drcorn": "⌟",
  4094. "drcrop": "⌌",
  4095. "Dscr": "𝒟",
  4096. "dscr": "𝒹",
  4097. "DScy": "Ѕ",
  4098. "dscy": "ѕ",
  4099. "dsol": "⧶",
  4100. "Dstrok": "Đ",
  4101. "dstrok": "đ",
  4102. "dtdot": "⋱",
  4103. "dtri": "▿",
  4104. "dtrif": "▾",
  4105. "duarr": "⇵",
  4106. "duhar": "⥯",
  4107. "dwangle": "⦦",
  4108. "DZcy": "Џ",
  4109. "dzcy": "џ",
  4110. "dzigrarr": "⟿",
  4111. "Eacute": "É",
  4112. "eacute": "é",
  4113. "easter": "⩮",
  4114. "Ecaron": "Ě",
  4115. "ecaron": "ě",
  4116. "Ecirc": "Ê",
  4117. "ecirc": "ê",
  4118. "ecir": "≖",
  4119. "ecolon": "≕",
  4120. "Ecy": "Э",
  4121. "ecy": "э",
  4122. "eDDot": "⩷",
  4123. "Edot": "Ė",
  4124. "edot": "ė",
  4125. "eDot": "≑",
  4126. "ee": "ⅇ",
  4127. "efDot": "≒",
  4128. "Efr": "𝔈",
  4129. "efr": "𝔢",
  4130. "eg": "⪚",
  4131. "Egrave": "È",
  4132. "egrave": "è",
  4133. "egs": "⪖",
  4134. "egsdot": "⪘",
  4135. "el": "⪙",
  4136. "Element": "∈",
  4137. "elinters": "⏧",
  4138. "ell": "ℓ",
  4139. "els": "⪕",
  4140. "elsdot": "⪗",
  4141. "Emacr": "Ē",
  4142. "emacr": "ē",
  4143. "empty": "∅",
  4144. "emptyset": "∅",
  4145. "EmptySmallSquare": "◻",
  4146. "emptyv": "∅",
  4147. "EmptyVerySmallSquare": "▫",
  4148. "emsp13": " ",
  4149. "emsp14": " ",
  4150. "emsp": " ",
  4151. "ENG": "Ŋ",
  4152. "eng": "ŋ",
  4153. "ensp": " ",
  4154. "Eogon": "Ę",
  4155. "eogon": "ę",
  4156. "Eopf": "𝔼",
  4157. "eopf": "𝕖",
  4158. "epar": "⋕",
  4159. "eparsl": "⧣",
  4160. "eplus": "⩱",
  4161. "epsi": "ε",
  4162. "Epsilon": "Ε",
  4163. "epsilon": "ε",
  4164. "epsiv": "ϵ",
  4165. "eqcirc": "≖",
  4166. "eqcolon": "≕",
  4167. "eqsim": "≂",
  4168. "eqslantgtr": "⪖",
  4169. "eqslantless": "⪕",
  4170. "Equal": "⩵",
  4171. "equals": "=",
  4172. "EqualTilde": "≂",
  4173. "equest": "≟",
  4174. "Equilibrium": "⇌",
  4175. "equiv": "≡",
  4176. "equivDD": "⩸",
  4177. "eqvparsl": "⧥",
  4178. "erarr": "⥱",
  4179. "erDot": "≓",
  4180. "escr": "ℯ",
  4181. "Escr": "ℰ",
  4182. "esdot": "≐",
  4183. "Esim": "⩳",
  4184. "esim": "≂",
  4185. "Eta": "Η",
  4186. "eta": "η",
  4187. "ETH": "Ð",
  4188. "eth": "ð",
  4189. "Euml": "Ë",
  4190. "euml": "ë",
  4191. "euro": "€",
  4192. "excl": "!",
  4193. "exist": "∃",
  4194. "Exists": "∃",
  4195. "expectation": "ℰ",
  4196. "exponentiale": "ⅇ",
  4197. "ExponentialE": "ⅇ",
  4198. "fallingdotseq": "≒",
  4199. "Fcy": "Ф",
  4200. "fcy": "ф",
  4201. "female": "♀",
  4202. "ffilig": "ffi",
  4203. "fflig": "ff",
  4204. "ffllig": "ffl",
  4205. "Ffr": "𝔉",
  4206. "ffr": "𝔣",
  4207. "filig": "fi",
  4208. "FilledSmallSquare": "◼",
  4209. "FilledVerySmallSquare": "▪",
  4210. "fjlig": "fj",
  4211. "flat": "♭",
  4212. "fllig": "fl",
  4213. "fltns": "▱",
  4214. "fnof": "ƒ",
  4215. "Fopf": "𝔽",
  4216. "fopf": "𝕗",
  4217. "forall": "∀",
  4218. "ForAll": "∀",
  4219. "fork": "⋔",
  4220. "forkv": "⫙",
  4221. "Fouriertrf": "ℱ",
  4222. "fpartint": "⨍",
  4223. "frac12": "½",
  4224. "frac13": "⅓",
  4225. "frac14": "¼",
  4226. "frac15": "⅕",
  4227. "frac16": "⅙",
  4228. "frac18": "⅛",
  4229. "frac23": "⅔",
  4230. "frac25": "⅖",
  4231. "frac34": "¾",
  4232. "frac35": "⅗",
  4233. "frac38": "⅜",
  4234. "frac45": "⅘",
  4235. "frac56": "⅚",
  4236. "frac58": "⅝",
  4237. "frac78": "⅞",
  4238. "frasl": "⁄",
  4239. "frown": "⌢",
  4240. "fscr": "𝒻",
  4241. "Fscr": "ℱ",
  4242. "gacute": "ǵ",
  4243. "Gamma": "Γ",
  4244. "gamma": "γ",
  4245. "Gammad": "Ϝ",
  4246. "gammad": "ϝ",
  4247. "gap": "⪆",
  4248. "Gbreve": "Ğ",
  4249. "gbreve": "ğ",
  4250. "Gcedil": "Ģ",
  4251. "Gcirc": "Ĝ",
  4252. "gcirc": "ĝ",
  4253. "Gcy": "Г",
  4254. "gcy": "г",
  4255. "Gdot": "Ġ",
  4256. "gdot": "ġ",
  4257. "ge": "≥",
  4258. "gE": "≧",
  4259. "gEl": "⪌",
  4260. "gel": "⋛",
  4261. "geq": "≥",
  4262. "geqq": "≧",
  4263. "geqslant": "⩾",
  4264. "gescc": "⪩",
  4265. "ges": "⩾",
  4266. "gesdot": "⪀",
  4267. "gesdoto": "⪂",
  4268. "gesdotol": "⪄",
  4269. "gesl": "⋛︀",
  4270. "gesles": "⪔",
  4271. "Gfr": "𝔊",
  4272. "gfr": "𝔤",
  4273. "gg": "≫",
  4274. "Gg": "⋙",
  4275. "ggg": "⋙",
  4276. "gimel": "ℷ",
  4277. "GJcy": "Ѓ",
  4278. "gjcy": "ѓ",
  4279. "gla": "⪥",
  4280. "gl": "≷",
  4281. "glE": "⪒",
  4282. "glj": "⪤",
  4283. "gnap": "⪊",
  4284. "gnapprox": "⪊",
  4285. "gne": "⪈",
  4286. "gnE": "≩",
  4287. "gneq": "⪈",
  4288. "gneqq": "≩",
  4289. "gnsim": "⋧",
  4290. "Gopf": "𝔾",
  4291. "gopf": "𝕘",
  4292. "grave": "`",
  4293. "GreaterEqual": "≥",
  4294. "GreaterEqualLess": "⋛",
  4295. "GreaterFullEqual": "≧",
  4296. "GreaterGreater": "⪢",
  4297. "GreaterLess": "≷",
  4298. "GreaterSlantEqual": "⩾",
  4299. "GreaterTilde": "≳",
  4300. "Gscr": "𝒢",
  4301. "gscr": "ℊ",
  4302. "gsim": "≳",
  4303. "gsime": "⪎",
  4304. "gsiml": "⪐",
  4305. "gtcc": "⪧",
  4306. "gtcir": "⩺",
  4307. "gt": ">",
  4308. "GT": ">",
  4309. "Gt": "≫",
  4310. "gtdot": "⋗",
  4311. "gtlPar": "⦕",
  4312. "gtquest": "⩼",
  4313. "gtrapprox": "⪆",
  4314. "gtrarr": "⥸",
  4315. "gtrdot": "⋗",
  4316. "gtreqless": "⋛",
  4317. "gtreqqless": "⪌",
  4318. "gtrless": "≷",
  4319. "gtrsim": "≳",
  4320. "gvertneqq": "≩︀",
  4321. "gvnE": "≩︀",
  4322. "Hacek": "ˇ",
  4323. "hairsp": " ",
  4324. "half": "½",
  4325. "hamilt": "ℋ",
  4326. "HARDcy": "Ъ",
  4327. "hardcy": "ъ",
  4328. "harrcir": "⥈",
  4329. "harr": "↔",
  4330. "hArr": "⇔",
  4331. "harrw": "↭",
  4332. "Hat": "^",
  4333. "hbar": "ℏ",
  4334. "Hcirc": "Ĥ",
  4335. "hcirc": "ĥ",
  4336. "hearts": "♥",
  4337. "heartsuit": "♥",
  4338. "hellip": "…",
  4339. "hercon": "⊹",
  4340. "hfr": "𝔥",
  4341. "Hfr": "ℌ",
  4342. "HilbertSpace": "ℋ",
  4343. "hksearow": "⤥",
  4344. "hkswarow": "⤦",
  4345. "hoarr": "⇿",
  4346. "homtht": "∻",
  4347. "hookleftarrow": "↩",
  4348. "hookrightarrow": "↪",
  4349. "hopf": "𝕙",
  4350. "Hopf": "ℍ",
  4351. "horbar": "―",
  4352. "HorizontalLine": "─",
  4353. "hscr": "𝒽",
  4354. "Hscr": "ℋ",
  4355. "hslash": "ℏ",
  4356. "Hstrok": "Ħ",
  4357. "hstrok": "ħ",
  4358. "HumpDownHump": "≎",
  4359. "HumpEqual": "≏",
  4360. "hybull": "⁃",
  4361. "hyphen": "‐",
  4362. "Iacute": "Í",
  4363. "iacute": "í",
  4364. "ic": "⁣",
  4365. "Icirc": "Î",
  4366. "icirc": "î",
  4367. "Icy": "И",
  4368. "icy": "и",
  4369. "Idot": "İ",
  4370. "IEcy": "Е",
  4371. "iecy": "е",
  4372. "iexcl": "¡",
  4373. "iff": "⇔",
  4374. "ifr": "𝔦",
  4375. "Ifr": "ℑ",
  4376. "Igrave": "Ì",
  4377. "igrave": "ì",
  4378. "ii": "ⅈ",
  4379. "iiiint": "⨌",
  4380. "iiint": "∭",
  4381. "iinfin": "⧜",
  4382. "iiota": "℩",
  4383. "IJlig": "IJ",
  4384. "ijlig": "ij",
  4385. "Imacr": "Ī",
  4386. "imacr": "ī",
  4387. "image": "ℑ",
  4388. "ImaginaryI": "ⅈ",
  4389. "imagline": "ℐ",
  4390. "imagpart": "ℑ",
  4391. "imath": "ı",
  4392. "Im": "ℑ",
  4393. "imof": "⊷",
  4394. "imped": "Ƶ",
  4395. "Implies": "⇒",
  4396. "incare": "℅",
  4397. "in": "∈",
  4398. "infin": "∞",
  4399. "infintie": "⧝",
  4400. "inodot": "ı",
  4401. "intcal": "⊺",
  4402. "int": "∫",
  4403. "Int": "∬",
  4404. "integers": "ℤ",
  4405. "Integral": "∫",
  4406. "intercal": "⊺",
  4407. "Intersection": "⋂",
  4408. "intlarhk": "⨗",
  4409. "intprod": "⨼",
  4410. "InvisibleComma": "⁣",
  4411. "InvisibleTimes": "⁢",
  4412. "IOcy": "Ё",
  4413. "iocy": "ё",
  4414. "Iogon": "Į",
  4415. "iogon": "į",
  4416. "Iopf": "𝕀",
  4417. "iopf": "𝕚",
  4418. "Iota": "Ι",
  4419. "iota": "ι",
  4420. "iprod": "⨼",
  4421. "iquest": "¿",
  4422. "iscr": "𝒾",
  4423. "Iscr": "ℐ",
  4424. "isin": "∈",
  4425. "isindot": "⋵",
  4426. "isinE": "⋹",
  4427. "isins": "⋴",
  4428. "isinsv": "⋳",
  4429. "isinv": "∈",
  4430. "it": "⁢",
  4431. "Itilde": "Ĩ",
  4432. "itilde": "ĩ",
  4433. "Iukcy": "І",
  4434. "iukcy": "і",
  4435. "Iuml": "Ï",
  4436. "iuml": "ï",
  4437. "Jcirc": "Ĵ",
  4438. "jcirc": "ĵ",
  4439. "Jcy": "Й",
  4440. "jcy": "й",
  4441. "Jfr": "𝔍",
  4442. "jfr": "𝔧",
  4443. "jmath": "ȷ",
  4444. "Jopf": "𝕁",
  4445. "jopf": "𝕛",
  4446. "Jscr": "𝒥",
  4447. "jscr": "𝒿",
  4448. "Jsercy": "Ј",
  4449. "jsercy": "ј",
  4450. "Jukcy": "Є",
  4451. "jukcy": "є",
  4452. "Kappa": "Κ",
  4453. "kappa": "κ",
  4454. "kappav": "ϰ",
  4455. "Kcedil": "Ķ",
  4456. "kcedil": "ķ",
  4457. "Kcy": "К",
  4458. "kcy": "к",
  4459. "Kfr": "𝔎",
  4460. "kfr": "𝔨",
  4461. "kgreen": "ĸ",
  4462. "KHcy": "Х",
  4463. "khcy": "х",
  4464. "KJcy": "Ќ",
  4465. "kjcy": "ќ",
  4466. "Kopf": "𝕂",
  4467. "kopf": "𝕜",
  4468. "Kscr": "𝒦",
  4469. "kscr": "𝓀",
  4470. "lAarr": "⇚",
  4471. "Lacute": "Ĺ",
  4472. "lacute": "ĺ",
  4473. "laemptyv": "⦴",
  4474. "lagran": "ℒ",
  4475. "Lambda": "Λ",
  4476. "lambda": "λ",
  4477. "lang": "⟨",
  4478. "Lang": "⟪",
  4479. "langd": "⦑",
  4480. "langle": "⟨",
  4481. "lap": "⪅",
  4482. "Laplacetrf": "ℒ",
  4483. "laquo": "«",
  4484. "larrb": "⇤",
  4485. "larrbfs": "⤟",
  4486. "larr": "←",
  4487. "Larr": "↞",
  4488. "lArr": "⇐",
  4489. "larrfs": "⤝",
  4490. "larrhk": "↩",
  4491. "larrlp": "↫",
  4492. "larrpl": "⤹",
  4493. "larrsim": "⥳",
  4494. "larrtl": "↢",
  4495. "latail": "⤙",
  4496. "lAtail": "⤛",
  4497. "lat": "⪫",
  4498. "late": "⪭",
  4499. "lates": "⪭︀",
  4500. "lbarr": "⤌",
  4501. "lBarr": "⤎",
  4502. "lbbrk": "❲",
  4503. "lbrace": "{",
  4504. "lbrack": "[",
  4505. "lbrke": "⦋",
  4506. "lbrksld": "⦏",
  4507. "lbrkslu": "⦍",
  4508. "Lcaron": "Ľ",
  4509. "lcaron": "ľ",
  4510. "Lcedil": "Ļ",
  4511. "lcedil": "ļ",
  4512. "lceil": "⌈",
  4513. "lcub": "{",
  4514. "Lcy": "Л",
  4515. "lcy": "л",
  4516. "ldca": "⤶",
  4517. "ldquo": "“",
  4518. "ldquor": "„",
  4519. "ldrdhar": "⥧",
  4520. "ldrushar": "⥋",
  4521. "ldsh": "↲",
  4522. "le": "≤",
  4523. "lE": "≦",
  4524. "LeftAngleBracket": "⟨",
  4525. "LeftArrowBar": "⇤",
  4526. "leftarrow": "←",
  4527. "LeftArrow": "←",
  4528. "Leftarrow": "⇐",
  4529. "LeftArrowRightArrow": "⇆",
  4530. "leftarrowtail": "↢",
  4531. "LeftCeiling": "⌈",
  4532. "LeftDoubleBracket": "⟦",
  4533. "LeftDownTeeVector": "⥡",
  4534. "LeftDownVectorBar": "⥙",
  4535. "LeftDownVector": "⇃",
  4536. "LeftFloor": "⌊",
  4537. "leftharpoondown": "↽",
  4538. "leftharpoonup": "↼",
  4539. "leftleftarrows": "⇇",
  4540. "leftrightarrow": "↔",
  4541. "LeftRightArrow": "↔",
  4542. "Leftrightarrow": "⇔",
  4543. "leftrightarrows": "⇆",
  4544. "leftrightharpoons": "⇋",
  4545. "leftrightsquigarrow": "↭",
  4546. "LeftRightVector": "⥎",
  4547. "LeftTeeArrow": "↤",
  4548. "LeftTee": "⊣",
  4549. "LeftTeeVector": "⥚",
  4550. "leftthreetimes": "⋋",
  4551. "LeftTriangleBar": "⧏",
  4552. "LeftTriangle": "⊲",
  4553. "LeftTriangleEqual": "⊴",
  4554. "LeftUpDownVector": "⥑",
  4555. "LeftUpTeeVector": "⥠",
  4556. "LeftUpVectorBar": "⥘",
  4557. "LeftUpVector": "↿",
  4558. "LeftVectorBar": "⥒",
  4559. "LeftVector": "↼",
  4560. "lEg": "⪋",
  4561. "leg": "⋚",
  4562. "leq": "≤",
  4563. "leqq": "≦",
  4564. "leqslant": "⩽",
  4565. "lescc": "⪨",
  4566. "les": "⩽",
  4567. "lesdot": "⩿",
  4568. "lesdoto": "⪁",
  4569. "lesdotor": "⪃",
  4570. "lesg": "⋚︀",
  4571. "lesges": "⪓",
  4572. "lessapprox": "⪅",
  4573. "lessdot": "⋖",
  4574. "lesseqgtr": "⋚",
  4575. "lesseqqgtr": "⪋",
  4576. "LessEqualGreater": "⋚",
  4577. "LessFullEqual": "≦",
  4578. "LessGreater": "≶",
  4579. "lessgtr": "≶",
  4580. "LessLess": "⪡",
  4581. "lesssim": "≲",
  4582. "LessSlantEqual": "⩽",
  4583. "LessTilde": "≲",
  4584. "lfisht": "⥼",
  4585. "lfloor": "⌊",
  4586. "Lfr": "𝔏",
  4587. "lfr": "𝔩",
  4588. "lg": "≶",
  4589. "lgE": "⪑",
  4590. "lHar": "⥢",
  4591. "lhard": "↽",
  4592. "lharu": "↼",
  4593. "lharul": "⥪",
  4594. "lhblk": "▄",
  4595. "LJcy": "Љ",
  4596. "ljcy": "љ",
  4597. "llarr": "⇇",
  4598. "ll": "≪",
  4599. "Ll": "⋘",
  4600. "llcorner": "⌞",
  4601. "Lleftarrow": "⇚",
  4602. "llhard": "⥫",
  4603. "lltri": "◺",
  4604. "Lmidot": "Ŀ",
  4605. "lmidot": "ŀ",
  4606. "lmoustache": "⎰",
  4607. "lmoust": "⎰",
  4608. "lnap": "⪉",
  4609. "lnapprox": "⪉",
  4610. "lne": "⪇",
  4611. "lnE": "≨",
  4612. "lneq": "⪇",
  4613. "lneqq": "≨",
  4614. "lnsim": "⋦",
  4615. "loang": "⟬",
  4616. "loarr": "⇽",
  4617. "lobrk": "⟦",
  4618. "longleftarrow": "⟵",
  4619. "LongLeftArrow": "⟵",
  4620. "Longleftarrow": "⟸",
  4621. "longleftrightarrow": "⟷",
  4622. "LongLeftRightArrow": "⟷",
  4623. "Longleftrightarrow": "⟺",
  4624. "longmapsto": "⟼",
  4625. "longrightarrow": "⟶",
  4626. "LongRightArrow": "⟶",
  4627. "Longrightarrow": "⟹",
  4628. "looparrowleft": "↫",
  4629. "looparrowright": "↬",
  4630. "lopar": "⦅",
  4631. "Lopf": "𝕃",
  4632. "lopf": "𝕝",
  4633. "loplus": "⨭",
  4634. "lotimes": "⨴",
  4635. "lowast": "∗",
  4636. "lowbar": "_",
  4637. "LowerLeftArrow": "↙",
  4638. "LowerRightArrow": "↘",
  4639. "loz": "◊",
  4640. "lozenge": "◊",
  4641. "lozf": "⧫",
  4642. "lpar": "(",
  4643. "lparlt": "⦓",
  4644. "lrarr": "⇆",
  4645. "lrcorner": "⌟",
  4646. "lrhar": "⇋",
  4647. "lrhard": "⥭",
  4648. "lrm": "‎",
  4649. "lrtri": "⊿",
  4650. "lsaquo": "‹",
  4651. "lscr": "𝓁",
  4652. "Lscr": "ℒ",
  4653. "lsh": "↰",
  4654. "Lsh": "↰",
  4655. "lsim": "≲",
  4656. "lsime": "⪍",
  4657. "lsimg": "⪏",
  4658. "lsqb": "[",
  4659. "lsquo": "‘",
  4660. "lsquor": "‚",
  4661. "Lstrok": "Ł",
  4662. "lstrok": "ł",
  4663. "ltcc": "⪦",
  4664. "ltcir": "⩹",
  4665. "lt": "<",
  4666. "LT": "<",
  4667. "Lt": "≪",
  4668. "ltdot": "⋖",
  4669. "lthree": "⋋",
  4670. "ltimes": "⋉",
  4671. "ltlarr": "⥶",
  4672. "ltquest": "⩻",
  4673. "ltri": "◃",
  4674. "ltrie": "⊴",
  4675. "ltrif": "◂",
  4676. "ltrPar": "⦖",
  4677. "lurdshar": "⥊",
  4678. "luruhar": "⥦",
  4679. "lvertneqq": "≨︀",
  4680. "lvnE": "≨︀",
  4681. "macr": "¯",
  4682. "male": "♂",
  4683. "malt": "✠",
  4684. "maltese": "✠",
  4685. "Map": "⤅",
  4686. "map": "↦",
  4687. "mapsto": "↦",
  4688. "mapstodown": "↧",
  4689. "mapstoleft": "↤",
  4690. "mapstoup": "↥",
  4691. "marker": "▮",
  4692. "mcomma": "⨩",
  4693. "Mcy": "М",
  4694. "mcy": "м",
  4695. "mdash": "—",
  4696. "mDDot": "∺",
  4697. "measuredangle": "∡",
  4698. "MediumSpace": " ",
  4699. "Mellintrf": "ℳ",
  4700. "Mfr": "𝔐",
  4701. "mfr": "𝔪",
  4702. "mho": "℧",
  4703. "micro": "µ",
  4704. "midast": "*",
  4705. "midcir": "⫰",
  4706. "mid": "∣",
  4707. "middot": "·",
  4708. "minusb": "⊟",
  4709. "minus": "−",
  4710. "minusd": "∸",
  4711. "minusdu": "⨪",
  4712. "MinusPlus": "∓",
  4713. "mlcp": "⫛",
  4714. "mldr": "…",
  4715. "mnplus": "∓",
  4716. "models": "⊧",
  4717. "Mopf": "𝕄",
  4718. "mopf": "𝕞",
  4719. "mp": "∓",
  4720. "mscr": "𝓂",
  4721. "Mscr": "ℳ",
  4722. "mstpos": "∾",
  4723. "Mu": "Μ",
  4724. "mu": "μ",
  4725. "multimap": "⊸",
  4726. "mumap": "⊸",
  4727. "nabla": "∇",
  4728. "Nacute": "Ń",
  4729. "nacute": "ń",
  4730. "nang": "∠⃒",
  4731. "nap": "≉",
  4732. "napE": "⩰̸",
  4733. "napid": "≋̸",
  4734. "napos": "ʼn",
  4735. "napprox": "≉",
  4736. "natural": "♮",
  4737. "naturals": "ℕ",
  4738. "natur": "♮",
  4739. "nbsp": " ",
  4740. "nbump": "≎̸",
  4741. "nbumpe": "≏̸",
  4742. "ncap": "⩃",
  4743. "Ncaron": "Ň",
  4744. "ncaron": "ň",
  4745. "Ncedil": "Ņ",
  4746. "ncedil": "ņ",
  4747. "ncong": "≇",
  4748. "ncongdot": "⩭̸",
  4749. "ncup": "⩂",
  4750. "Ncy": "Н",
  4751. "ncy": "н",
  4752. "ndash": "–",
  4753. "nearhk": "⤤",
  4754. "nearr": "↗",
  4755. "neArr": "⇗",
  4756. "nearrow": "↗",
  4757. "ne": "≠",
  4758. "nedot": "≐̸",
  4759. "NegativeMediumSpace": "​",
  4760. "NegativeThickSpace": "​",
  4761. "NegativeThinSpace": "​",
  4762. "NegativeVeryThinSpace": "​",
  4763. "nequiv": "≢",
  4764. "nesear": "⤨",
  4765. "nesim": "≂̸",
  4766. "NestedGreaterGreater": "≫",
  4767. "NestedLessLess": "≪",
  4768. "NewLine": "\n",
  4769. "nexist": "∄",
  4770. "nexists": "∄",
  4771. "Nfr": "𝔑",
  4772. "nfr": "𝔫",
  4773. "ngE": "≧̸",
  4774. "nge": "≱",
  4775. "ngeq": "≱",
  4776. "ngeqq": "≧̸",
  4777. "ngeqslant": "⩾̸",
  4778. "nges": "⩾̸",
  4779. "nGg": "⋙̸",
  4780. "ngsim": "≵",
  4781. "nGt": "≫⃒",
  4782. "ngt": "≯",
  4783. "ngtr": "≯",
  4784. "nGtv": "≫̸",
  4785. "nharr": "↮",
  4786. "nhArr": "⇎",
  4787. "nhpar": "⫲",
  4788. "ni": "∋",
  4789. "nis": "⋼",
  4790. "nisd": "⋺",
  4791. "niv": "∋",
  4792. "NJcy": "Њ",
  4793. "njcy": "њ",
  4794. "nlarr": "↚",
  4795. "nlArr": "⇍",
  4796. "nldr": "‥",
  4797. "nlE": "≦̸",
  4798. "nle": "≰",
  4799. "nleftarrow": "↚",
  4800. "nLeftarrow": "⇍",
  4801. "nleftrightarrow": "↮",
  4802. "nLeftrightarrow": "⇎",
  4803. "nleq": "≰",
  4804. "nleqq": "≦̸",
  4805. "nleqslant": "⩽̸",
  4806. "nles": "⩽̸",
  4807. "nless": "≮",
  4808. "nLl": "⋘̸",
  4809. "nlsim": "≴",
  4810. "nLt": "≪⃒",
  4811. "nlt": "≮",
  4812. "nltri": "⋪",
  4813. "nltrie": "⋬",
  4814. "nLtv": "≪̸",
  4815. "nmid": "∤",
  4816. "NoBreak": "⁠",
  4817. "NonBreakingSpace": " ",
  4818. "nopf": "𝕟",
  4819. "Nopf": "ℕ",
  4820. "Not": "⫬",
  4821. "not": "¬",
  4822. "NotCongruent": "≢",
  4823. "NotCupCap": "≭",
  4824. "NotDoubleVerticalBar": "∦",
  4825. "NotElement": "∉",
  4826. "NotEqual": "≠",
  4827. "NotEqualTilde": "≂̸",
  4828. "NotExists": "∄",
  4829. "NotGreater": "≯",
  4830. "NotGreaterEqual": "≱",
  4831. "NotGreaterFullEqual": "≧̸",
  4832. "NotGreaterGreater": "≫̸",
  4833. "NotGreaterLess": "≹",
  4834. "NotGreaterSlantEqual": "⩾̸",
  4835. "NotGreaterTilde": "≵",
  4836. "NotHumpDownHump": "≎̸",
  4837. "NotHumpEqual": "≏̸",
  4838. "notin": "∉",
  4839. "notindot": "⋵̸",
  4840. "notinE": "⋹̸",
  4841. "notinva": "∉",
  4842. "notinvb": "⋷",
  4843. "notinvc": "⋶",
  4844. "NotLeftTriangleBar": "⧏̸",
  4845. "NotLeftTriangle": "⋪",
  4846. "NotLeftTriangleEqual": "⋬",
  4847. "NotLess": "≮",
  4848. "NotLessEqual": "≰",
  4849. "NotLessGreater": "≸",
  4850. "NotLessLess": "≪̸",
  4851. "NotLessSlantEqual": "⩽̸",
  4852. "NotLessTilde": "≴",
  4853. "NotNestedGreaterGreater": "⪢̸",
  4854. "NotNestedLessLess": "⪡̸",
  4855. "notni": "∌",
  4856. "notniva": "∌",
  4857. "notnivb": "⋾",
  4858. "notnivc": "⋽",
  4859. "NotPrecedes": "⊀",
  4860. "NotPrecedesEqual": "⪯̸",
  4861. "NotPrecedesSlantEqual": "⋠",
  4862. "NotReverseElement": "∌",
  4863. "NotRightTriangleBar": "⧐̸",
  4864. "NotRightTriangle": "⋫",
  4865. "NotRightTriangleEqual": "⋭",
  4866. "NotSquareSubset": "⊏̸",
  4867. "NotSquareSubsetEqual": "⋢",
  4868. "NotSquareSuperset": "⊐̸",
  4869. "NotSquareSupersetEqual": "⋣",
  4870. "NotSubset": "⊂⃒",
  4871. "NotSubsetEqual": "⊈",
  4872. "NotSucceeds": "⊁",
  4873. "NotSucceedsEqual": "⪰̸",
  4874. "NotSucceedsSlantEqual": "⋡",
  4875. "NotSucceedsTilde": "≿̸",
  4876. "NotSuperset": "⊃⃒",
  4877. "NotSupersetEqual": "⊉",
  4878. "NotTilde": "≁",
  4879. "NotTildeEqual": "≄",
  4880. "NotTildeFullEqual": "≇",
  4881. "NotTildeTilde": "≉",
  4882. "NotVerticalBar": "∤",
  4883. "nparallel": "∦",
  4884. "npar": "∦",
  4885. "nparsl": "⫽⃥",
  4886. "npart": "∂̸",
  4887. "npolint": "⨔",
  4888. "npr": "⊀",
  4889. "nprcue": "⋠",
  4890. "nprec": "⊀",
  4891. "npreceq": "⪯̸",
  4892. "npre": "⪯̸",
  4893. "nrarrc": "⤳̸",
  4894. "nrarr": "↛",
  4895. "nrArr": "⇏",
  4896. "nrarrw": "↝̸",
  4897. "nrightarrow": "↛",
  4898. "nRightarrow": "⇏",
  4899. "nrtri": "⋫",
  4900. "nrtrie": "⋭",
  4901. "nsc": "⊁",
  4902. "nsccue": "⋡",
  4903. "nsce": "⪰̸",
  4904. "Nscr": "𝒩",
  4905. "nscr": "𝓃",
  4906. "nshortmid": "∤",
  4907. "nshortparallel": "∦",
  4908. "nsim": "≁",
  4909. "nsime": "≄",
  4910. "nsimeq": "≄",
  4911. "nsmid": "∤",
  4912. "nspar": "∦",
  4913. "nsqsube": "⋢",
  4914. "nsqsupe": "⋣",
  4915. "nsub": "⊄",
  4916. "nsubE": "⫅̸",
  4917. "nsube": "⊈",
  4918. "nsubset": "⊂⃒",
  4919. "nsubseteq": "⊈",
  4920. "nsubseteqq": "⫅̸",
  4921. "nsucc": "⊁",
  4922. "nsucceq": "⪰̸",
  4923. "nsup": "⊅",
  4924. "nsupE": "⫆̸",
  4925. "nsupe": "⊉",
  4926. "nsupset": "⊃⃒",
  4927. "nsupseteq": "⊉",
  4928. "nsupseteqq": "⫆̸",
  4929. "ntgl": "≹",
  4930. "Ntilde": "Ñ",
  4931. "ntilde": "ñ",
  4932. "ntlg": "≸",
  4933. "ntriangleleft": "⋪",
  4934. "ntrianglelefteq": "⋬",
  4935. "ntriangleright": "⋫",
  4936. "ntrianglerighteq": "⋭",
  4937. "Nu": "Ν",
  4938. "nu": "ν",
  4939. "num": "#",
  4940. "numero": "№",
  4941. "numsp": " ",
  4942. "nvap": "≍⃒",
  4943. "nvdash": "⊬",
  4944. "nvDash": "⊭",
  4945. "nVdash": "⊮",
  4946. "nVDash": "⊯",
  4947. "nvge": "≥⃒",
  4948. "nvgt": ">⃒",
  4949. "nvHarr": "⤄",
  4950. "nvinfin": "⧞",
  4951. "nvlArr": "⤂",
  4952. "nvle": "≤⃒",
  4953. "nvlt": "<⃒",
  4954. "nvltrie": "⊴⃒",
  4955. "nvrArr": "⤃",
  4956. "nvrtrie": "⊵⃒",
  4957. "nvsim": "∼⃒",
  4958. "nwarhk": "⤣",
  4959. "nwarr": "↖",
  4960. "nwArr": "⇖",
  4961. "nwarrow": "↖",
  4962. "nwnear": "⤧",
  4963. "Oacute": "Ó",
  4964. "oacute": "ó",
  4965. "oast": "⊛",
  4966. "Ocirc": "Ô",
  4967. "ocirc": "ô",
  4968. "ocir": "⊚",
  4969. "Ocy": "О",
  4970. "ocy": "о",
  4971. "odash": "⊝",
  4972. "Odblac": "Ő",
  4973. "odblac": "ő",
  4974. "odiv": "⨸",
  4975. "odot": "⊙",
  4976. "odsold": "⦼",
  4977. "OElig": "Œ",
  4978. "oelig": "œ",
  4979. "ofcir": "⦿",
  4980. "Ofr": "𝔒",
  4981. "ofr": "𝔬",
  4982. "ogon": "˛",
  4983. "Ograve": "Ò",
  4984. "ograve": "ò",
  4985. "ogt": "⧁",
  4986. "ohbar": "⦵",
  4987. "ohm": "Ω",
  4988. "oint": "∮",
  4989. "olarr": "↺",
  4990. "olcir": "⦾",
  4991. "olcross": "⦻",
  4992. "oline": "‾",
  4993. "olt": "⧀",
  4994. "Omacr": "Ō",
  4995. "omacr": "ō",
  4996. "Omega": "Ω",
  4997. "omega": "ω",
  4998. "Omicron": "Ο",
  4999. "omicron": "ο",
  5000. "omid": "⦶",
  5001. "ominus": "⊖",
  5002. "Oopf": "𝕆",
  5003. "oopf": "𝕠",
  5004. "opar": "⦷",
  5005. "OpenCurlyDoubleQuote": "“",
  5006. "OpenCurlyQuote": "‘",
  5007. "operp": "⦹",
  5008. "oplus": "⊕",
  5009. "orarr": "↻",
  5010. "Or": "⩔",
  5011. "or": "∨",
  5012. "ord": "⩝",
  5013. "order": "ℴ",
  5014. "orderof": "ℴ",
  5015. "ordf": "ª",
  5016. "ordm": "º",
  5017. "origof": "⊶",
  5018. "oror": "⩖",
  5019. "orslope": "⩗",
  5020. "orv": "⩛",
  5021. "oS": "Ⓢ",
  5022. "Oscr": "𝒪",
  5023. "oscr": "ℴ",
  5024. "Oslash": "Ø",
  5025. "oslash": "ø",
  5026. "osol": "⊘",
  5027. "Otilde": "Õ",
  5028. "otilde": "õ",
  5029. "otimesas": "⨶",
  5030. "Otimes": "⨷",
  5031. "otimes": "⊗",
  5032. "Ouml": "Ö",
  5033. "ouml": "ö",
  5034. "ovbar": "⌽",
  5035. "OverBar": "‾",
  5036. "OverBrace": "⏞",
  5037. "OverBracket": "⎴",
  5038. "OverParenthesis": "⏜",
  5039. "para": "¶",
  5040. "parallel": "∥",
  5041. "par": "∥",
  5042. "parsim": "⫳",
  5043. "parsl": "⫽",
  5044. "part": "∂",
  5045. "PartialD": "∂",
  5046. "Pcy": "П",
  5047. "pcy": "п",
  5048. "percnt": "%",
  5049. "period": ".",
  5050. "permil": "‰",
  5051. "perp": "⊥",
  5052. "pertenk": "‱",
  5053. "Pfr": "𝔓",
  5054. "pfr": "𝔭",
  5055. "Phi": "Φ",
  5056. "phi": "φ",
  5057. "phiv": "ϕ",
  5058. "phmmat": "ℳ",
  5059. "phone": "☎",
  5060. "Pi": "Π",
  5061. "pi": "π",
  5062. "pitchfork": "⋔",
  5063. "piv": "ϖ",
  5064. "planck": "ℏ",
  5065. "planckh": "ℎ",
  5066. "plankv": "ℏ",
  5067. "plusacir": "⨣",
  5068. "plusb": "⊞",
  5069. "pluscir": "⨢",
  5070. "plus": "+",
  5071. "plusdo": "∔",
  5072. "plusdu": "⨥",
  5073. "pluse": "⩲",
  5074. "PlusMinus": "±",
  5075. "plusmn": "±",
  5076. "plussim": "⨦",
  5077. "plustwo": "⨧",
  5078. "pm": "±",
  5079. "Poincareplane": "ℌ",
  5080. "pointint": "⨕",
  5081. "popf": "𝕡",
  5082. "Popf": "ℙ",
  5083. "pound": "£",
  5084. "prap": "⪷",
  5085. "Pr": "⪻",
  5086. "pr": "≺",
  5087. "prcue": "≼",
  5088. "precapprox": "⪷",
  5089. "prec": "≺",
  5090. "preccurlyeq": "≼",
  5091. "Precedes": "≺",
  5092. "PrecedesEqual": "⪯",
  5093. "PrecedesSlantEqual": "≼",
  5094. "PrecedesTilde": "≾",
  5095. "preceq": "⪯",
  5096. "precnapprox": "⪹",
  5097. "precneqq": "⪵",
  5098. "precnsim": "⋨",
  5099. "pre": "⪯",
  5100. "prE": "⪳",
  5101. "precsim": "≾",
  5102. "prime": "′",
  5103. "Prime": "″",
  5104. "primes": "ℙ",
  5105. "prnap": "⪹",
  5106. "prnE": "⪵",
  5107. "prnsim": "⋨",
  5108. "prod": "∏",
  5109. "Product": "∏",
  5110. "profalar": "⌮",
  5111. "profline": "⌒",
  5112. "profsurf": "⌓",
  5113. "prop": "∝",
  5114. "Proportional": "∝",
  5115. "Proportion": "∷",
  5116. "propto": "∝",
  5117. "prsim": "≾",
  5118. "prurel": "⊰",
  5119. "Pscr": "𝒫",
  5120. "pscr": "𝓅",
  5121. "Psi": "Ψ",
  5122. "psi": "ψ",
  5123. "puncsp": " ",
  5124. "Qfr": "𝔔",
  5125. "qfr": "𝔮",
  5126. "qint": "⨌",
  5127. "qopf": "𝕢",
  5128. "Qopf": "ℚ",
  5129. "qprime": "⁗",
  5130. "Qscr": "𝒬",
  5131. "qscr": "𝓆",
  5132. "quaternions": "ℍ",
  5133. "quatint": "⨖",
  5134. "quest": "?",
  5135. "questeq": "≟",
  5136. "quot": "\"",
  5137. "QUOT": "\"",
  5138. "rAarr": "⇛",
  5139. "race": "∽̱",
  5140. "Racute": "Ŕ",
  5141. "racute": "ŕ",
  5142. "radic": "√",
  5143. "raemptyv": "⦳",
  5144. "rang": "⟩",
  5145. "Rang": "⟫",
  5146. "rangd": "⦒",
  5147. "range": "⦥",
  5148. "rangle": "⟩",
  5149. "raquo": "»",
  5150. "rarrap": "⥵",
  5151. "rarrb": "⇥",
  5152. "rarrbfs": "⤠",
  5153. "rarrc": "⤳",
  5154. "rarr": "→",
  5155. "Rarr": "↠",
  5156. "rArr": "⇒",
  5157. "rarrfs": "⤞",
  5158. "rarrhk": "↪",
  5159. "rarrlp": "↬",
  5160. "rarrpl": "⥅",
  5161. "rarrsim": "⥴",
  5162. "Rarrtl": "⤖",
  5163. "rarrtl": "↣",
  5164. "rarrw": "↝",
  5165. "ratail": "⤚",
  5166. "rAtail": "⤜",
  5167. "ratio": "∶",
  5168. "rationals": "ℚ",
  5169. "rbarr": "⤍",
  5170. "rBarr": "⤏",
  5171. "RBarr": "⤐",
  5172. "rbbrk": "❳",
  5173. "rbrace": "}",
  5174. "rbrack": "]",
  5175. "rbrke": "⦌",
  5176. "rbrksld": "⦎",
  5177. "rbrkslu": "⦐",
  5178. "Rcaron": "Ř",
  5179. "rcaron": "ř",
  5180. "Rcedil": "Ŗ",
  5181. "rcedil": "ŗ",
  5182. "rceil": "⌉",
  5183. "rcub": "}",
  5184. "Rcy": "Р",
  5185. "rcy": "р",
  5186. "rdca": "⤷",
  5187. "rdldhar": "⥩",
  5188. "rdquo": "”",
  5189. "rdquor": "”",
  5190. "rdsh": "↳",
  5191. "real": "ℜ",
  5192. "realine": "ℛ",
  5193. "realpart": "ℜ",
  5194. "reals": "ℝ",
  5195. "Re": "ℜ",
  5196. "rect": "▭",
  5197. "reg": "®",
  5198. "REG": "®",
  5199. "ReverseElement": "∋",
  5200. "ReverseEquilibrium": "⇋",
  5201. "ReverseUpEquilibrium": "⥯",
  5202. "rfisht": "⥽",
  5203. "rfloor": "⌋",
  5204. "rfr": "𝔯",
  5205. "Rfr": "ℜ",
  5206. "rHar": "⥤",
  5207. "rhard": "⇁",
  5208. "rharu": "⇀",
  5209. "rharul": "⥬",
  5210. "Rho": "Ρ",
  5211. "rho": "ρ",
  5212. "rhov": "ϱ",
  5213. "RightAngleBracket": "⟩",
  5214. "RightArrowBar": "⇥",
  5215. "rightarrow": "→",
  5216. "RightArrow": "→",
  5217. "Rightarrow": "⇒",
  5218. "RightArrowLeftArrow": "⇄",
  5219. "rightarrowtail": "↣",
  5220. "RightCeiling": "⌉",
  5221. "RightDoubleBracket": "⟧",
  5222. "RightDownTeeVector": "⥝",
  5223. "RightDownVectorBar": "⥕",
  5224. "RightDownVector": "⇂",
  5225. "RightFloor": "⌋",
  5226. "rightharpoondown": "⇁",
  5227. "rightharpoonup": "⇀",
  5228. "rightleftarrows": "⇄",
  5229. "rightleftharpoons": "⇌",
  5230. "rightrightarrows": "⇉",
  5231. "rightsquigarrow": "↝",
  5232. "RightTeeArrow": "↦",
  5233. "RightTee": "⊢",
  5234. "RightTeeVector": "⥛",
  5235. "rightthreetimes": "⋌",
  5236. "RightTriangleBar": "⧐",
  5237. "RightTriangle": "⊳",
  5238. "RightTriangleEqual": "⊵",
  5239. "RightUpDownVector": "⥏",
  5240. "RightUpTeeVector": "⥜",
  5241. "RightUpVectorBar": "⥔",
  5242. "RightUpVector": "↾",
  5243. "RightVectorBar": "⥓",
  5244. "RightVector": "⇀",
  5245. "ring": "˚",
  5246. "risingdotseq": "≓",
  5247. "rlarr": "⇄",
  5248. "rlhar": "⇌",
  5249. "rlm": "‏",
  5250. "rmoustache": "⎱",
  5251. "rmoust": "⎱",
  5252. "rnmid": "⫮",
  5253. "roang": "⟭",
  5254. "roarr": "⇾",
  5255. "robrk": "⟧",
  5256. "ropar": "⦆",
  5257. "ropf": "𝕣",
  5258. "Ropf": "ℝ",
  5259. "roplus": "⨮",
  5260. "rotimes": "⨵",
  5261. "RoundImplies": "⥰",
  5262. "rpar": ")",
  5263. "rpargt": "⦔",
  5264. "rppolint": "⨒",
  5265. "rrarr": "⇉",
  5266. "Rrightarrow": "⇛",
  5267. "rsaquo": "›",
  5268. "rscr": "𝓇",
  5269. "Rscr": "ℛ",
  5270. "rsh": "↱",
  5271. "Rsh": "↱",
  5272. "rsqb": "]",
  5273. "rsquo": "’",
  5274. "rsquor": "’",
  5275. "rthree": "⋌",
  5276. "rtimes": "⋊",
  5277. "rtri": "▹",
  5278. "rtrie": "⊵",
  5279. "rtrif": "▸",
  5280. "rtriltri": "⧎",
  5281. "RuleDelayed": "⧴",
  5282. "ruluhar": "⥨",
  5283. "rx": "℞",
  5284. "Sacute": "Ś",
  5285. "sacute": "ś",
  5286. "sbquo": "‚",
  5287. "scap": "⪸",
  5288. "Scaron": "Š",
  5289. "scaron": "š",
  5290. "Sc": "⪼",
  5291. "sc": "≻",
  5292. "sccue": "≽",
  5293. "sce": "⪰",
  5294. "scE": "⪴",
  5295. "Scedil": "Ş",
  5296. "scedil": "ş",
  5297. "Scirc": "Ŝ",
  5298. "scirc": "ŝ",
  5299. "scnap": "⪺",
  5300. "scnE": "⪶",
  5301. "scnsim": "⋩",
  5302. "scpolint": "⨓",
  5303. "scsim": "≿",
  5304. "Scy": "С",
  5305. "scy": "с",
  5306. "sdotb": "⊡",
  5307. "sdot": "⋅",
  5308. "sdote": "⩦",
  5309. "searhk": "⤥",
  5310. "searr": "↘",
  5311. "seArr": "⇘",
  5312. "searrow": "↘",
  5313. "sect": "§",
  5314. "semi": ";",
  5315. "seswar": "⤩",
  5316. "setminus": "∖",
  5317. "setmn": "∖",
  5318. "sext": "✶",
  5319. "Sfr": "𝔖",
  5320. "sfr": "𝔰",
  5321. "sfrown": "⌢",
  5322. "sharp": "♯",
  5323. "SHCHcy": "Щ",
  5324. "shchcy": "щ",
  5325. "SHcy": "Ш",
  5326. "shcy": "ш",
  5327. "ShortDownArrow": "↓",
  5328. "ShortLeftArrow": "←",
  5329. "shortmid": "∣",
  5330. "shortparallel": "∥",
  5331. "ShortRightArrow": "→",
  5332. "ShortUpArrow": "↑",
  5333. "shy": "­",
  5334. "Sigma": "Σ",
  5335. "sigma": "σ",
  5336. "sigmaf": "ς",
  5337. "sigmav": "ς",
  5338. "sim": "∼",
  5339. "simdot": "⩪",
  5340. "sime": "≃",
  5341. "simeq": "≃",
  5342. "simg": "⪞",
  5343. "simgE": "⪠",
  5344. "siml": "⪝",
  5345. "simlE": "⪟",
  5346. "simne": "≆",
  5347. "simplus": "⨤",
  5348. "simrarr": "⥲",
  5349. "slarr": "←",
  5350. "SmallCircle": "∘",
  5351. "smallsetminus": "∖",
  5352. "smashp": "⨳",
  5353. "smeparsl": "⧤",
  5354. "smid": "∣",
  5355. "smile": "⌣",
  5356. "smt": "⪪",
  5357. "smte": "⪬",
  5358. "smtes": "⪬︀",
  5359. "SOFTcy": "Ь",
  5360. "softcy": "ь",
  5361. "solbar": "⌿",
  5362. "solb": "⧄",
  5363. "sol": "/",
  5364. "Sopf": "𝕊",
  5365. "sopf": "𝕤",
  5366. "spades": "♠",
  5367. "spadesuit": "♠",
  5368. "spar": "∥",
  5369. "sqcap": "⊓",
  5370. "sqcaps": "⊓︀",
  5371. "sqcup": "⊔",
  5372. "sqcups": "⊔︀",
  5373. "Sqrt": "√",
  5374. "sqsub": "⊏",
  5375. "sqsube": "⊑",
  5376. "sqsubset": "⊏",
  5377. "sqsubseteq": "⊑",
  5378. "sqsup": "⊐",
  5379. "sqsupe": "⊒",
  5380. "sqsupset": "⊐",
  5381. "sqsupseteq": "⊒",
  5382. "square": "□",
  5383. "Square": "□",
  5384. "SquareIntersection": "⊓",
  5385. "SquareSubset": "⊏",
  5386. "SquareSubsetEqual": "⊑",
  5387. "SquareSuperset": "⊐",
  5388. "SquareSupersetEqual": "⊒",
  5389. "SquareUnion": "⊔",
  5390. "squarf": "▪",
  5391. "squ": "□",
  5392. "squf": "▪",
  5393. "srarr": "→",
  5394. "Sscr": "𝒮",
  5395. "sscr": "𝓈",
  5396. "ssetmn": "∖",
  5397. "ssmile": "⌣",
  5398. "sstarf": "⋆",
  5399. "Star": "⋆",
  5400. "star": "☆",
  5401. "starf": "★",
  5402. "straightepsilon": "ϵ",
  5403. "straightphi": "ϕ",
  5404. "strns": "¯",
  5405. "sub": "⊂",
  5406. "Sub": "⋐",
  5407. "subdot": "⪽",
  5408. "subE": "⫅",
  5409. "sube": "⊆",
  5410. "subedot": "⫃",
  5411. "submult": "⫁",
  5412. "subnE": "⫋",
  5413. "subne": "⊊",
  5414. "subplus": "⪿",
  5415. "subrarr": "⥹",
  5416. "subset": "⊂",
  5417. "Subset": "⋐",
  5418. "subseteq": "⊆",
  5419. "subseteqq": "⫅",
  5420. "SubsetEqual": "⊆",
  5421. "subsetneq": "⊊",
  5422. "subsetneqq": "⫋",
  5423. "subsim": "⫇",
  5424. "subsub": "⫕",
  5425. "subsup": "⫓",
  5426. "succapprox": "⪸",
  5427. "succ": "≻",
  5428. "succcurlyeq": "≽",
  5429. "Succeeds": "≻",
  5430. "SucceedsEqual": "⪰",
  5431. "SucceedsSlantEqual": "≽",
  5432. "SucceedsTilde": "≿",
  5433. "succeq": "⪰",
  5434. "succnapprox": "⪺",
  5435. "succneqq": "⪶",
  5436. "succnsim": "⋩",
  5437. "succsim": "≿",
  5438. "SuchThat": "∋",
  5439. "sum": "∑",
  5440. "Sum": "∑",
  5441. "sung": "♪",
  5442. "sup1": "¹",
  5443. "sup2": "²",
  5444. "sup3": "³",
  5445. "sup": "⊃",
  5446. "Sup": "⋑",
  5447. "supdot": "⪾",
  5448. "supdsub": "⫘",
  5449. "supE": "⫆",
  5450. "supe": "⊇",
  5451. "supedot": "⫄",
  5452. "Superset": "⊃",
  5453. "SupersetEqual": "⊇",
  5454. "suphsol": "⟉",
  5455. "suphsub": "⫗",
  5456. "suplarr": "⥻",
  5457. "supmult": "⫂",
  5458. "supnE": "⫌",
  5459. "supne": "⊋",
  5460. "supplus": "⫀",
  5461. "supset": "⊃",
  5462. "Supset": "⋑",
  5463. "supseteq": "⊇",
  5464. "supseteqq": "⫆",
  5465. "supsetneq": "⊋",
  5466. "supsetneqq": "⫌",
  5467. "supsim": "⫈",
  5468. "supsub": "⫔",
  5469. "supsup": "⫖",
  5470. "swarhk": "⤦",
  5471. "swarr": "↙",
  5472. "swArr": "⇙",
  5473. "swarrow": "↙",
  5474. "swnwar": "⤪",
  5475. "szlig": "ß",
  5476. "Tab": "\t",
  5477. "target": "⌖",
  5478. "Tau": "Τ",
  5479. "tau": "τ",
  5480. "tbrk": "⎴",
  5481. "Tcaron": "Ť",
  5482. "tcaron": "ť",
  5483. "Tcedil": "Ţ",
  5484. "tcedil": "ţ",
  5485. "Tcy": "Т",
  5486. "tcy": "т",
  5487. "tdot": "⃛",
  5488. "telrec": "⌕",
  5489. "Tfr": "𝔗",
  5490. "tfr": "𝔱",
  5491. "there4": "∴",
  5492. "therefore": "∴",
  5493. "Therefore": "∴",
  5494. "Theta": "Θ",
  5495. "theta": "θ",
  5496. "thetasym": "ϑ",
  5497. "thetav": "ϑ",
  5498. "thickapprox": "≈",
  5499. "thicksim": "∼",
  5500. "ThickSpace": "  ",
  5501. "ThinSpace": " ",
  5502. "thinsp": " ",
  5503. "thkap": "≈",
  5504. "thksim": "∼",
  5505. "THORN": "Þ",
  5506. "thorn": "þ",
  5507. "tilde": "˜",
  5508. "Tilde": "∼",
  5509. "TildeEqual": "≃",
  5510. "TildeFullEqual": "≅",
  5511. "TildeTilde": "≈",
  5512. "timesbar": "⨱",
  5513. "timesb": "⊠",
  5514. "times": "×",
  5515. "timesd": "⨰",
  5516. "tint": "∭",
  5517. "toea": "⤨",
  5518. "topbot": "⌶",
  5519. "topcir": "⫱",
  5520. "top": "⊤",
  5521. "Topf": "𝕋",
  5522. "topf": "𝕥",
  5523. "topfork": "⫚",
  5524. "tosa": "⤩",
  5525. "tprime": "‴",
  5526. "trade": "™",
  5527. "TRADE": "™",
  5528. "triangle": "▵",
  5529. "triangledown": "▿",
  5530. "triangleleft": "◃",
  5531. "trianglelefteq": "⊴",
  5532. "triangleq": "≜",
  5533. "triangleright": "▹",
  5534. "trianglerighteq": "⊵",
  5535. "tridot": "◬",
  5536. "trie": "≜",
  5537. "triminus": "⨺",
  5538. "TripleDot": "⃛",
  5539. "triplus": "⨹",
  5540. "trisb": "⧍",
  5541. "tritime": "⨻",
  5542. "trpezium": "⏢",
  5543. "Tscr": "𝒯",
  5544. "tscr": "𝓉",
  5545. "TScy": "Ц",
  5546. "tscy": "ц",
  5547. "TSHcy": "Ћ",
  5548. "tshcy": "ћ",
  5549. "Tstrok": "Ŧ",
  5550. "tstrok": "ŧ",
  5551. "twixt": "≬",
  5552. "twoheadleftarrow": "↞",
  5553. "twoheadrightarrow": "↠",
  5554. "Uacute": "Ú",
  5555. "uacute": "ú",
  5556. "uarr": "↑",
  5557. "Uarr": "↟",
  5558. "uArr": "⇑",
  5559. "Uarrocir": "⥉",
  5560. "Ubrcy": "Ў",
  5561. "ubrcy": "ў",
  5562. "Ubreve": "Ŭ",
  5563. "ubreve": "ŭ",
  5564. "Ucirc": "Û",
  5565. "ucirc": "û",
  5566. "Ucy": "У",
  5567. "ucy": "у",
  5568. "udarr": "⇅",
  5569. "Udblac": "Ű",
  5570. "udblac": "ű",
  5571. "udhar": "⥮",
  5572. "ufisht": "⥾",
  5573. "Ufr": "𝔘",
  5574. "ufr": "𝔲",
  5575. "Ugrave": "Ù",
  5576. "ugrave": "ù",
  5577. "uHar": "⥣",
  5578. "uharl": "↿",
  5579. "uharr": "↾",
  5580. "uhblk": "▀",
  5581. "ulcorn": "⌜",
  5582. "ulcorner": "⌜",
  5583. "ulcrop": "⌏",
  5584. "ultri": "◸",
  5585. "Umacr": "Ū",
  5586. "umacr": "ū",
  5587. "uml": "¨",
  5588. "UnderBar": "_",
  5589. "UnderBrace": "⏟",
  5590. "UnderBracket": "⎵",
  5591. "UnderParenthesis": "⏝",
  5592. "Union": "⋃",
  5593. "UnionPlus": "⊎",
  5594. "Uogon": "Ų",
  5595. "uogon": "ų",
  5596. "Uopf": "𝕌",
  5597. "uopf": "𝕦",
  5598. "UpArrowBar": "⤒",
  5599. "uparrow": "↑",
  5600. "UpArrow": "↑",
  5601. "Uparrow": "⇑",
  5602. "UpArrowDownArrow": "⇅",
  5603. "updownarrow": "↕",
  5604. "UpDownArrow": "↕",
  5605. "Updownarrow": "⇕",
  5606. "UpEquilibrium": "⥮",
  5607. "upharpoonleft": "↿",
  5608. "upharpoonright": "↾",
  5609. "uplus": "⊎",
  5610. "UpperLeftArrow": "↖",
  5611. "UpperRightArrow": "↗",
  5612. "upsi": "υ",
  5613. "Upsi": "ϒ",
  5614. "upsih": "ϒ",
  5615. "Upsilon": "Υ",
  5616. "upsilon": "υ",
  5617. "UpTeeArrow": "↥",
  5618. "UpTee": "⊥",
  5619. "upuparrows": "⇈",
  5620. "urcorn": "⌝",
  5621. "urcorner": "⌝",
  5622. "urcrop": "⌎",
  5623. "Uring": "Ů",
  5624. "uring": "ů",
  5625. "urtri": "◹",
  5626. "Uscr": "𝒰",
  5627. "uscr": "𝓊",
  5628. "utdot": "⋰",
  5629. "Utilde": "Ũ",
  5630. "utilde": "ũ",
  5631. "utri": "▵",
  5632. "utrif": "▴",
  5633. "uuarr": "⇈",
  5634. "Uuml": "Ü",
  5635. "uuml": "ü",
  5636. "uwangle": "⦧",
  5637. "vangrt": "⦜",
  5638. "varepsilon": "ϵ",
  5639. "varkappa": "ϰ",
  5640. "varnothing": "∅",
  5641. "varphi": "ϕ",
  5642. "varpi": "ϖ",
  5643. "varpropto": "∝",
  5644. "varr": "↕",
  5645. "vArr": "⇕",
  5646. "varrho": "ϱ",
  5647. "varsigma": "ς",
  5648. "varsubsetneq": "⊊︀",
  5649. "varsubsetneqq": "⫋︀",
  5650. "varsupsetneq": "⊋︀",
  5651. "varsupsetneqq": "⫌︀",
  5652. "vartheta": "ϑ",
  5653. "vartriangleleft": "⊲",
  5654. "vartriangleright": "⊳",
  5655. "vBar": "⫨",
  5656. "Vbar": "⫫",
  5657. "vBarv": "⫩",
  5658. "Vcy": "В",
  5659. "vcy": "в",
  5660. "vdash": "⊢",
  5661. "vDash": "⊨",
  5662. "Vdash": "⊩",
  5663. "VDash": "⊫",
  5664. "Vdashl": "⫦",
  5665. "veebar": "⊻",
  5666. "vee": "∨",
  5667. "Vee": "⋁",
  5668. "veeeq": "≚",
  5669. "vellip": "⋮",
  5670. "verbar": "|",
  5671. "Verbar": "‖",
  5672. "vert": "|",
  5673. "Vert": "‖",
  5674. "VerticalBar": "∣",
  5675. "VerticalLine": "|",
  5676. "VerticalSeparator": "❘",
  5677. "VerticalTilde": "≀",
  5678. "VeryThinSpace": " ",
  5679. "Vfr": "𝔙",
  5680. "vfr": "𝔳",
  5681. "vltri": "⊲",
  5682. "vnsub": "⊂⃒",
  5683. "vnsup": "⊃⃒",
  5684. "Vopf": "𝕍",
  5685. "vopf": "𝕧",
  5686. "vprop": "∝",
  5687. "vrtri": "⊳",
  5688. "Vscr": "𝒱",
  5689. "vscr": "𝓋",
  5690. "vsubnE": "⫋︀",
  5691. "vsubne": "⊊︀",
  5692. "vsupnE": "⫌︀",
  5693. "vsupne": "⊋︀",
  5694. "Vvdash": "⊪",
  5695. "vzigzag": "⦚",
  5696. "Wcirc": "Ŵ",
  5697. "wcirc": "ŵ",
  5698. "wedbar": "⩟",
  5699. "wedge": "∧",
  5700. "Wedge": "⋀",
  5701. "wedgeq": "≙",
  5702. "weierp": "℘",
  5703. "Wfr": "𝔚",
  5704. "wfr": "𝔴",
  5705. "Wopf": "𝕎",
  5706. "wopf": "𝕨",
  5707. "wp": "℘",
  5708. "wr": "≀",
  5709. "wreath": "≀",
  5710. "Wscr": "𝒲",
  5711. "wscr": "𝓌",
  5712. "xcap": "⋂",
  5713. "xcirc": "◯",
  5714. "xcup": "⋃",
  5715. "xdtri": "▽",
  5716. "Xfr": "𝔛",
  5717. "xfr": "𝔵",
  5718. "xharr": "⟷",
  5719. "xhArr": "⟺",
  5720. "Xi": "Ξ",
  5721. "xi": "ξ",
  5722. "xlarr": "⟵",
  5723. "xlArr": "⟸",
  5724. "xmap": "⟼",
  5725. "xnis": "⋻",
  5726. "xodot": "⨀",
  5727. "Xopf": "𝕏",
  5728. "xopf": "𝕩",
  5729. "xoplus": "⨁",
  5730. "xotime": "⨂",
  5731. "xrarr": "⟶",
  5732. "xrArr": "⟹",
  5733. "Xscr": "𝒳",
  5734. "xscr": "𝓍",
  5735. "xsqcup": "⨆",
  5736. "xuplus": "⨄",
  5737. "xutri": "△",
  5738. "xvee": "⋁",
  5739. "xwedge": "⋀",
  5740. "Yacute": "Ý",
  5741. "yacute": "ý",
  5742. "YAcy": "Я",
  5743. "yacy": "я",
  5744. "Ycirc": "Ŷ",
  5745. "ycirc": "ŷ",
  5746. "Ycy": "Ы",
  5747. "ycy": "ы",
  5748. "yen": "¥",
  5749. "Yfr": "𝔜",
  5750. "yfr": "𝔶",
  5751. "YIcy": "Ї",
  5752. "yicy": "ї",
  5753. "Yopf": "𝕐",
  5754. "yopf": "𝕪",
  5755. "Yscr": "𝒴",
  5756. "yscr": "𝓎",
  5757. "YUcy": "Ю",
  5758. "yucy": "ю",
  5759. "yuml": "ÿ",
  5760. "Yuml": "Ÿ",
  5761. "Zacute": "Ź",
  5762. "zacute": "ź",
  5763. "Zcaron": "Ž",
  5764. "zcaron": "ž",
  5765. "Zcy": "З",
  5766. "zcy": "з",
  5767. "Zdot": "Ż",
  5768. "zdot": "ż",
  5769. "zeetrf": "ℨ",
  5770. "ZeroWidthSpace": "​",
  5771. "Zeta": "Ζ",
  5772. "zeta": "ζ",
  5773. "zfr": "𝔷",
  5774. "Zfr": "ℨ",
  5775. "ZHcy": "Ж",
  5776. "zhcy": "ж",
  5777. "zigrarr": "⇝",
  5778. "zopf": "𝕫",
  5779. "Zopf": "ℤ",
  5780. "Zscr": "𝒵",
  5781. "zscr": "𝓏",
  5782. "zwj": "‍",
  5783. "zwnj": "‌"
  5784. };
  5785. /***/ }),
  5786. /* 25 */
  5787. /***/ (function(module, exports) {
  5788. // removed by extract-text-webpack-plugin
  5789. /***/ }),
  5790. /* 26 */
  5791. /***/ (function(module, exports) {
  5792. // removed by extract-text-webpack-plugin
  5793. /***/ }),
  5794. /* 27 */
  5795. /***/ (function(module, exports) {
  5796. // removed by extract-text-webpack-plugin
  5797. /***/ }),
  5798. /* 28 */
  5799. /***/ (function(module, exports) {
  5800. // removed by extract-text-webpack-plugin
  5801. /***/ }),
  5802. /* 29 */,
  5803. /* 30 */
  5804. /***/ (function(module, exports, __webpack_require__) {
  5805. "use strict";
  5806. ////////////////////////////////////////////////////////////////////////////////
  5807. // Helpers
  5808. // Merge objects
  5809. //
  5810. function assign(obj /*from1, from2, from3, ...*/) {
  5811. var sources = Array.prototype.slice.call(arguments, 1);
  5812. sources.forEach(function (source) {
  5813. if (!source) { return; }
  5814. Object.keys(source).forEach(function (key) {
  5815. obj[key] = source[key];
  5816. });
  5817. });
  5818. return obj;
  5819. }
  5820. function _class(obj) { return Object.prototype.toString.call(obj); }
  5821. function isString(obj) { return _class(obj) === '[object String]'; }
  5822. function isObject(obj) { return _class(obj) === '[object Object]'; }
  5823. function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
  5824. function isFunction(obj) { return _class(obj) === '[object Function]'; }
  5825. function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
  5826. ////////////////////////////////////////////////////////////////////////////////
  5827. var defaultOptions = {
  5828. fuzzyLink: true,
  5829. fuzzyEmail: true,
  5830. fuzzyIP: false
  5831. };
  5832. function isOptionsObj(obj) {
  5833. return Object.keys(obj || {}).reduce(function (acc, k) {
  5834. return acc || defaultOptions.hasOwnProperty(k);
  5835. }, false);
  5836. }
  5837. var defaultSchemas = {
  5838. 'http:': {
  5839. validate: function (text, pos, self) {
  5840. var tail = text.slice(pos);
  5841. if (!self.re.http) {
  5842. // compile lazily, because "host"-containing variables can change on tlds update.
  5843. self.re.http = new RegExp(
  5844. '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
  5845. );
  5846. }
  5847. if (self.re.http.test(tail)) {
  5848. return tail.match(self.re.http)[0].length;
  5849. }
  5850. return 0;
  5851. }
  5852. },
  5853. 'https:': 'http:',
  5854. 'ftp:': 'http:',
  5855. '//': {
  5856. validate: function (text, pos, self) {
  5857. var tail = text.slice(pos);
  5858. if (!self.re.no_http) {
  5859. // compile lazily, because "host"-containing variables can change on tlds update.
  5860. self.re.no_http = new RegExp(
  5861. '^' +
  5862. self.re.src_auth +
  5863. // Don't allow single-level domains, because of false positives like '//test'
  5864. // with code comments
  5865. '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
  5866. self.re.src_port +
  5867. self.re.src_host_terminator +
  5868. self.re.src_path,
  5869. 'i'
  5870. );
  5871. }
  5872. if (self.re.no_http.test(tail)) {
  5873. // should not be `://` & `///`, that protects from errors in protocol name
  5874. if (pos >= 3 && text[pos - 3] === ':') { return 0; }
  5875. if (pos >= 3 && text[pos - 3] === '/') { return 0; }
  5876. return tail.match(self.re.no_http)[0].length;
  5877. }
  5878. return 0;
  5879. }
  5880. },
  5881. 'mailto:': {
  5882. validate: function (text, pos, self) {
  5883. var tail = text.slice(pos);
  5884. if (!self.re.mailto) {
  5885. self.re.mailto = new RegExp(
  5886. '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
  5887. );
  5888. }
  5889. if (self.re.mailto.test(tail)) {
  5890. return tail.match(self.re.mailto)[0].length;
  5891. }
  5892. return 0;
  5893. }
  5894. }
  5895. };
  5896. /*eslint-disable max-len*/
  5897. // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
  5898. var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
  5899. // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
  5900. var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
  5901. /*eslint-enable max-len*/
  5902. ////////////////////////////////////////////////////////////////////////////////
  5903. function resetScanCache(self) {
  5904. self.__index__ = -1;
  5905. self.__text_cache__ = '';
  5906. }
  5907. function createValidator(re) {
  5908. return function (text, pos) {
  5909. var tail = text.slice(pos);
  5910. if (re.test(tail)) {
  5911. return tail.match(re)[0].length;
  5912. }
  5913. return 0;
  5914. };
  5915. }
  5916. function createNormalizer() {
  5917. return function (match, self) {
  5918. self.normalize(match);
  5919. };
  5920. }
  5921. // Schemas compiler. Build regexps.
  5922. //
  5923. function compile(self) {
  5924. // Load & clone RE patterns.
  5925. var re = self.re = __webpack_require__(31)(self.__opts__);
  5926. // Define dynamic patterns
  5927. var tlds = self.__tlds__.slice();
  5928. self.onCompile();
  5929. if (!self.__tlds_replaced__) {
  5930. tlds.push(tlds_2ch_src_re);
  5931. }
  5932. tlds.push(re.src_xn);
  5933. re.src_tlds = tlds.join('|');
  5934. function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
  5935. re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
  5936. re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
  5937. re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
  5938. re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
  5939. //
  5940. // Compile each schema
  5941. //
  5942. var aliases = [];
  5943. self.__compiled__ = {}; // Reset compiled data
  5944. function schemaError(name, val) {
  5945. throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
  5946. }
  5947. Object.keys(self.__schemas__).forEach(function (name) {
  5948. var val = self.__schemas__[name];
  5949. // skip disabled methods
  5950. if (val === null) { return; }
  5951. var compiled = { validate: null, link: null };
  5952. self.__compiled__[name] = compiled;
  5953. if (isObject(val)) {
  5954. if (isRegExp(val.validate)) {
  5955. compiled.validate = createValidator(val.validate);
  5956. } else if (isFunction(val.validate)) {
  5957. compiled.validate = val.validate;
  5958. } else {
  5959. schemaError(name, val);
  5960. }
  5961. if (isFunction(val.normalize)) {
  5962. compiled.normalize = val.normalize;
  5963. } else if (!val.normalize) {
  5964. compiled.normalize = createNormalizer();
  5965. } else {
  5966. schemaError(name, val);
  5967. }
  5968. return;
  5969. }
  5970. if (isString(val)) {
  5971. aliases.push(name);
  5972. return;
  5973. }
  5974. schemaError(name, val);
  5975. });
  5976. //
  5977. // Compile postponed aliases
  5978. //
  5979. aliases.forEach(function (alias) {
  5980. if (!self.__compiled__[self.__schemas__[alias]]) {
  5981. // Silently fail on missed schemas to avoid errons on disable.
  5982. // schemaError(alias, self.__schemas__[alias]);
  5983. return;
  5984. }
  5985. self.__compiled__[alias].validate =
  5986. self.__compiled__[self.__schemas__[alias]].validate;
  5987. self.__compiled__[alias].normalize =
  5988. self.__compiled__[self.__schemas__[alias]].normalize;
  5989. });
  5990. //
  5991. // Fake record for guessed links
  5992. //
  5993. self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
  5994. //
  5995. // Build schema condition
  5996. //
  5997. var slist = Object.keys(self.__compiled__)
  5998. .filter(function (name) {
  5999. // Filter disabled & fake schemas
  6000. return name.length > 0 && self.__compiled__[name];
  6001. })
  6002. .map(escapeRE)
  6003. .join('|');
  6004. // (?!_) cause 1.5x slowdown
  6005. self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
  6006. self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
  6007. self.re.pretest = RegExp(
  6008. '(' + self.re.schema_test.source + ')|' +
  6009. '(' + self.re.host_fuzzy_test.source + ')|' +
  6010. '@',
  6011. 'i');
  6012. //
  6013. // Cleanup
  6014. //
  6015. resetScanCache(self);
  6016. }
  6017. /**
  6018. * class Match
  6019. *
  6020. * Match result. Single element of array, returned by [[LinkifyIt#match]]
  6021. **/
  6022. function Match(self, shift) {
  6023. var start = self.__index__,
  6024. end = self.__last_index__,
  6025. text = self.__text_cache__.slice(start, end);
  6026. /**
  6027. * Match#schema -> String
  6028. *
  6029. * Prefix (protocol) for matched string.
  6030. **/
  6031. this.schema = self.__schema__.toLowerCase();
  6032. /**
  6033. * Match#index -> Number
  6034. *
  6035. * First position of matched string.
  6036. **/
  6037. this.index = start + shift;
  6038. /**
  6039. * Match#lastIndex -> Number
  6040. *
  6041. * Next position after matched string.
  6042. **/
  6043. this.lastIndex = end + shift;
  6044. /**
  6045. * Match#raw -> String
  6046. *
  6047. * Matched string.
  6048. **/
  6049. this.raw = text;
  6050. /**
  6051. * Match#text -> String
  6052. *
  6053. * Notmalized text of matched string.
  6054. **/
  6055. this.text = text;
  6056. /**
  6057. * Match#url -> String
  6058. *
  6059. * Normalized url of matched string.
  6060. **/
  6061. this.url = text;
  6062. }
  6063. function createMatch(self, shift) {
  6064. var match = new Match(self, shift);
  6065. self.__compiled__[match.schema].normalize(match, self);
  6066. return match;
  6067. }
  6068. /**
  6069. * class LinkifyIt
  6070. **/
  6071. /**
  6072. * new LinkifyIt(schemas, options)
  6073. * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
  6074. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  6075. *
  6076. * Creates new linkifier instance with optional additional schemas.
  6077. * Can be called without `new` keyword for convenience.
  6078. *
  6079. * By default understands:
  6080. *
  6081. * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
  6082. * - "fuzzy" links and emails (example.com, foo@bar.com).
  6083. *
  6084. * `schemas` is an object, where each key/value describes protocol/rule:
  6085. *
  6086. * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
  6087. * for example). `linkify-it` makes shure that prefix is not preceeded with
  6088. * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
  6089. * - __value__ - rule to check tail after link prefix
  6090. * - _String_ - just alias to existing rule
  6091. * - _Object_
  6092. * - _validate_ - validator function (should return matched length on success),
  6093. * or `RegExp`.
  6094. * - _normalize_ - optional function to normalize text & url of matched result
  6095. * (for example, for @twitter mentions).
  6096. *
  6097. * `options`:
  6098. *
  6099. * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
  6100. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
  6101. * like version numbers. Default `false`.
  6102. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
  6103. *
  6104. **/
  6105. function LinkifyIt(schemas, options) {
  6106. if (!(this instanceof LinkifyIt)) {
  6107. return new LinkifyIt(schemas, options);
  6108. }
  6109. if (!options) {
  6110. if (isOptionsObj(schemas)) {
  6111. options = schemas;
  6112. schemas = {};
  6113. }
  6114. }
  6115. this.__opts__ = assign({}, defaultOptions, options);
  6116. // Cache last tested result. Used to skip repeating steps on next `match` call.
  6117. this.__index__ = -1;
  6118. this.__last_index__ = -1; // Next scan position
  6119. this.__schema__ = '';
  6120. this.__text_cache__ = '';
  6121. this.__schemas__ = assign({}, defaultSchemas, schemas);
  6122. this.__compiled__ = {};
  6123. this.__tlds__ = tlds_default;
  6124. this.__tlds_replaced__ = false;
  6125. this.re = {};
  6126. compile(this);
  6127. }
  6128. /** chainable
  6129. * LinkifyIt#add(schema, definition)
  6130. * - schema (String): rule name (fixed pattern prefix)
  6131. * - definition (String|RegExp|Object): schema definition
  6132. *
  6133. * Add new rule definition. See constructor description for details.
  6134. **/
  6135. LinkifyIt.prototype.add = function add(schema, definition) {
  6136. this.__schemas__[schema] = definition;
  6137. compile(this);
  6138. return this;
  6139. };
  6140. /** chainable
  6141. * LinkifyIt#set(options)
  6142. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  6143. *
  6144. * Set recognition options for links without schema.
  6145. **/
  6146. LinkifyIt.prototype.set = function set(options) {
  6147. this.__opts__ = assign(this.__opts__, options);
  6148. return this;
  6149. };
  6150. /**
  6151. * LinkifyIt#test(text) -> Boolean
  6152. *
  6153. * Searches linkifiable pattern and returns `true` on success or `false` on fail.
  6154. **/
  6155. LinkifyIt.prototype.test = function test(text) {
  6156. // Reset scan cache
  6157. this.__text_cache__ = text;
  6158. this.__index__ = -1;
  6159. if (!text.length) { return false; }
  6160. var m, ml, me, len, shift, next, re, tld_pos, at_pos;
  6161. // try to scan for link with schema - that's the most simple rule
  6162. if (this.re.schema_test.test(text)) {
  6163. re = this.re.schema_search;
  6164. re.lastIndex = 0;
  6165. while ((m = re.exec(text)) !== null) {
  6166. len = this.testSchemaAt(text, m[2], re.lastIndex);
  6167. if (len) {
  6168. this.__schema__ = m[2];
  6169. this.__index__ = m.index + m[1].length;
  6170. this.__last_index__ = m.index + m[0].length + len;
  6171. break;
  6172. }
  6173. }
  6174. }
  6175. if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
  6176. // guess schemaless links
  6177. tld_pos = text.search(this.re.host_fuzzy_test);
  6178. if (tld_pos >= 0) {
  6179. // if tld is located after found link - no need to check fuzzy pattern
  6180. if (this.__index__ < 0 || tld_pos < this.__index__) {
  6181. if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
  6182. shift = ml.index + ml[1].length;
  6183. if (this.__index__ < 0 || shift < this.__index__) {
  6184. this.__schema__ = '';
  6185. this.__index__ = shift;
  6186. this.__last_index__ = ml.index + ml[0].length;
  6187. }
  6188. }
  6189. }
  6190. }
  6191. }
  6192. if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
  6193. // guess schemaless emails
  6194. at_pos = text.indexOf('@');
  6195. if (at_pos >= 0) {
  6196. // We can't skip this check, because this cases are possible:
  6197. // 192.168.1.1@gmail.com, my.in@example.com
  6198. if ((me = text.match(this.re.email_fuzzy)) !== null) {
  6199. shift = me.index + me[1].length;
  6200. next = me.index + me[0].length;
  6201. if (this.__index__ < 0 || shift < this.__index__ ||
  6202. (shift === this.__index__ && next > this.__last_index__)) {
  6203. this.__schema__ = 'mailto:';
  6204. this.__index__ = shift;
  6205. this.__last_index__ = next;
  6206. }
  6207. }
  6208. }
  6209. }
  6210. return this.__index__ >= 0;
  6211. };
  6212. /**
  6213. * LinkifyIt#pretest(text) -> Boolean
  6214. *
  6215. * Very quick check, that can give false positives. Returns true if link MAY BE
  6216. * can exists. Can be used for speed optimization, when you need to check that
  6217. * link NOT exists.
  6218. **/
  6219. LinkifyIt.prototype.pretest = function pretest(text) {
  6220. return this.re.pretest.test(text);
  6221. };
  6222. /**
  6223. * LinkifyIt#testSchemaAt(text, name, position) -> Number
  6224. * - text (String): text to scan
  6225. * - name (String): rule (schema) name
  6226. * - position (Number): text offset to check from
  6227. *
  6228. * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
  6229. * at given position. Returns length of found pattern (0 on fail).
  6230. **/
  6231. LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
  6232. // If not supported schema check requested - terminate
  6233. if (!this.__compiled__[schema.toLowerCase()]) {
  6234. return 0;
  6235. }
  6236. return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
  6237. };
  6238. /**
  6239. * LinkifyIt#match(text) -> Array|null
  6240. *
  6241. * Returns array of found link descriptions or `null` on fail. We strongly
  6242. * recommend to use [[LinkifyIt#test]] first, for best speed.
  6243. *
  6244. * ##### Result match description
  6245. *
  6246. * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
  6247. * protocol-neutral links.
  6248. * - __index__ - offset of matched text
  6249. * - __lastIndex__ - index of next char after mathch end
  6250. * - __raw__ - matched text
  6251. * - __text__ - normalized text
  6252. * - __url__ - link, generated from matched text
  6253. **/
  6254. LinkifyIt.prototype.match = function match(text) {
  6255. var shift = 0, result = [];
  6256. // Try to take previous element from cache, if .test() called before
  6257. if (this.__index__ >= 0 && this.__text_cache__ === text) {
  6258. result.push(createMatch(this, shift));
  6259. shift = this.__last_index__;
  6260. }
  6261. // Cut head if cache was used
  6262. var tail = shift ? text.slice(shift) : text;
  6263. // Scan string until end reached
  6264. while (this.test(tail)) {
  6265. result.push(createMatch(this, shift));
  6266. tail = tail.slice(this.__last_index__);
  6267. shift += this.__last_index__;
  6268. }
  6269. if (result.length) {
  6270. return result;
  6271. }
  6272. return null;
  6273. };
  6274. /** chainable
  6275. * LinkifyIt#tlds(list [, keepOld]) -> this
  6276. * - list (Array): list of tlds
  6277. * - keepOld (Boolean): merge with current list if `true` (`false` by default)
  6278. *
  6279. * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
  6280. * to avoid false positives. By default this algorythm used:
  6281. *
  6282. * - hostname with any 2-letter root zones are ok.
  6283. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
  6284. * are ok.
  6285. * - encoded (`xn--...`) root zones are ok.
  6286. *
  6287. * If list is replaced, then exact match for 2-chars root zones will be checked.
  6288. **/
  6289. LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
  6290. list = Array.isArray(list) ? list : [ list ];
  6291. if (!keepOld) {
  6292. this.__tlds__ = list.slice();
  6293. this.__tlds_replaced__ = true;
  6294. compile(this);
  6295. return this;
  6296. }
  6297. this.__tlds__ = this.__tlds__.concat(list)
  6298. .sort()
  6299. .filter(function (el, idx, arr) {
  6300. return el !== arr[idx - 1];
  6301. })
  6302. .reverse();
  6303. compile(this);
  6304. return this;
  6305. };
  6306. /**
  6307. * LinkifyIt#normalize(match)
  6308. *
  6309. * Default normalizer (if schema does not define it's own).
  6310. **/
  6311. LinkifyIt.prototype.normalize = function normalize(match) {
  6312. // Do minimal possible changes by default. Need to collect feedback prior
  6313. // to move forward https://github.com/markdown-it/linkify-it/issues/1
  6314. if (!match.schema) { match.url = 'http://' + match.url; }
  6315. if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
  6316. match.url = 'mailto:' + match.url;
  6317. }
  6318. };
  6319. /**
  6320. * LinkifyIt#onCompile()
  6321. *
  6322. * Override to modify basic RegExp-s.
  6323. **/
  6324. LinkifyIt.prototype.onCompile = function onCompile() {
  6325. };
  6326. module.exports = LinkifyIt;
  6327. /***/ }),
  6328. /* 31 */
  6329. /***/ (function(module, exports, __webpack_require__) {
  6330. "use strict";
  6331. module.exports = function (opts) {
  6332. var re = {};
  6333. // Use direct extract instead of `regenerate` to reduse browserified size
  6334. re.src_Any = __webpack_require__(18).source;
  6335. re.src_Cc = __webpack_require__(16).source;
  6336. re.src_Z = __webpack_require__(17).source;
  6337. re.src_P = __webpack_require__(5).source;
  6338. // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
  6339. re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
  6340. // \p{\Z\Cc} (white spaces + control)
  6341. re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
  6342. // Experimental. List of chars, completely prohibited in links
  6343. // because can separate it from other part of text
  6344. var text_separators = '[><\uff5c]';
  6345. // All possible word characters (everything without punctuation, spaces & controls)
  6346. // Defined via punctuation & spaces to save space
  6347. // Should be something like \p{\L\N\S\M} (\w but without `_`)
  6348. re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
  6349. // The same as abothe but without [0-9]
  6350. // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
  6351. ////////////////////////////////////////////////////////////////////////////////
  6352. re.src_ip4 =
  6353. '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
  6354. // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
  6355. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
  6356. re.src_port =
  6357. '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
  6358. re.src_host_terminator =
  6359. '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
  6360. re.src_path =
  6361. '(?:' +
  6362. '[/?#]' +
  6363. '(?:' +
  6364. '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
  6365. '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
  6366. '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
  6367. '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
  6368. '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
  6369. "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
  6370. "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
  6371. '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
  6372. // - english
  6373. // - percent-encoded
  6374. // - parts of file path
  6375. // until more examples found.
  6376. '\\.(?!' + re.src_ZCc + '|[.]).|' +
  6377. (opts && opts['---'] ?
  6378. '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
  6379. :
  6380. '\\-+|'
  6381. ) +
  6382. '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
  6383. '\\!(?!' + re.src_ZCc + '|[!]).|' +
  6384. '\\?(?!' + re.src_ZCc + '|[?]).' +
  6385. ')+' +
  6386. '|\\/' +
  6387. ')?';
  6388. re.src_email_name =
  6389. '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
  6390. re.src_xn =
  6391. 'xn--[a-z0-9\\-]{1,59}';
  6392. // More to read about domain names
  6393. // http://serverfault.com/questions/638260/
  6394. re.src_domain_root =
  6395. // Allow letters & digits (http://test1)
  6396. '(?:' +
  6397. re.src_xn +
  6398. '|' +
  6399. re.src_pseudo_letter + '{1,63}' +
  6400. ')';
  6401. re.src_domain =
  6402. '(?:' +
  6403. re.src_xn +
  6404. '|' +
  6405. '(?:' + re.src_pseudo_letter + ')' +
  6406. '|' +
  6407. // don't allow `--` in domain names, because:
  6408. // - that can conflict with markdown &mdash; / &ndash;
  6409. // - nobody use those anyway
  6410. '(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
  6411. ')';
  6412. re.src_host =
  6413. '(?:' +
  6414. // Don't need IP check, because digits are already allowed in normal domain names
  6415. // src_ip4 +
  6416. // '|' +
  6417. '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
  6418. ')';
  6419. re.tpl_host_fuzzy =
  6420. '(?:' +
  6421. re.src_ip4 +
  6422. '|' +
  6423. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
  6424. ')';
  6425. re.tpl_host_no_ip_fuzzy =
  6426. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
  6427. re.src_host_strict =
  6428. re.src_host + re.src_host_terminator;
  6429. re.tpl_host_fuzzy_strict =
  6430. re.tpl_host_fuzzy + re.src_host_terminator;
  6431. re.src_host_port_strict =
  6432. re.src_host + re.src_port + re.src_host_terminator;
  6433. re.tpl_host_port_fuzzy_strict =
  6434. re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  6435. re.tpl_host_port_no_ip_fuzzy_strict =
  6436. re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  6437. ////////////////////////////////////////////////////////////////////////////////
  6438. // Main rules
  6439. // Rude test fuzzy links by host, for quick deny
  6440. re.tpl_host_fuzzy_test =
  6441. 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
  6442. re.tpl_email_fuzzy =
  6443. '(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
  6444. re.tpl_link_fuzzy =
  6445. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6446. // but can start with > (markdown blockquote)
  6447. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6448. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
  6449. re.tpl_link_no_ip_fuzzy =
  6450. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6451. // but can start with > (markdown blockquote)
  6452. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6453. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
  6454. return re;
  6455. };
  6456. /***/ }),
  6457. /* 32 */
  6458. /***/ (function(module, exports, __webpack_require__) {
  6459. "use strict";
  6460. // List of valid html blocks names, accorting to commonmark spec
  6461. // http://jgm.github.io/CommonMark/spec.html#html-blocks
  6462. module.exports = [
  6463. 'address',
  6464. 'article',
  6465. 'aside',
  6466. 'base',
  6467. 'basefont',
  6468. 'blockquote',
  6469. 'body',
  6470. 'caption',
  6471. 'center',
  6472. 'col',
  6473. 'colgroup',
  6474. 'dd',
  6475. 'details',
  6476. 'dialog',
  6477. 'dir',
  6478. 'div',
  6479. 'dl',
  6480. 'dt',
  6481. 'fieldset',
  6482. 'figcaption',
  6483. 'figure',
  6484. 'footer',
  6485. 'form',
  6486. 'frame',
  6487. 'frameset',
  6488. 'h1',
  6489. 'h2',
  6490. 'h3',
  6491. 'h4',
  6492. 'h5',
  6493. 'h6',
  6494. 'head',
  6495. 'header',
  6496. 'hr',
  6497. 'html',
  6498. 'iframe',
  6499. 'legend',
  6500. 'li',
  6501. 'link',
  6502. 'main',
  6503. 'menu',
  6504. 'menuitem',
  6505. 'meta',
  6506. 'nav',
  6507. 'noframes',
  6508. 'ol',
  6509. 'optgroup',
  6510. 'option',
  6511. 'p',
  6512. 'param',
  6513. 'pre',
  6514. 'section',
  6515. 'source',
  6516. 'title',
  6517. 'summary',
  6518. 'table',
  6519. 'tbody',
  6520. 'td',
  6521. 'tfoot',
  6522. 'th',
  6523. 'thead',
  6524. 'title',
  6525. 'tr',
  6526. 'track',
  6527. 'ul'
  6528. ];
  6529. /***/ }),
  6530. /* 33 */
  6531. /***/ (function(module, exports, __webpack_require__) {
  6532. "use strict";
  6533. // Just a shortcut for bulk export
  6534. exports.parseLinkLabel = __webpack_require__(35);
  6535. exports.parseLinkDestination = __webpack_require__(34);
  6536. exports.parseLinkTitle = __webpack_require__(36);
  6537. /***/ }),
  6538. /* 34 */
  6539. /***/ (function(module, exports, __webpack_require__) {
  6540. "use strict";
  6541. // Parse link destination
  6542. //
  6543. var isSpace = __webpack_require__(0).isSpace;
  6544. var unescapeAll = __webpack_require__(0).unescapeAll;
  6545. module.exports = function parseLinkDestination(str, pos, max) {
  6546. var code, level,
  6547. lines = 0,
  6548. start = pos,
  6549. result = {
  6550. ok: false,
  6551. pos: 0,
  6552. lines: 0,
  6553. str: ''
  6554. };
  6555. if (str.charCodeAt(pos) === 0x3C /* < */) {
  6556. pos++;
  6557. while (pos < max) {
  6558. code = str.charCodeAt(pos);
  6559. if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
  6560. if (code === 0x3E /* > */) {
  6561. result.pos = pos + 1;
  6562. result.str = unescapeAll(str.slice(start + 1, pos));
  6563. result.ok = true;
  6564. return result;
  6565. }
  6566. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6567. pos += 2;
  6568. continue;
  6569. }
  6570. pos++;
  6571. }
  6572. // no closing '>'
  6573. return result;
  6574. }
  6575. // this should be ... } else { ... branch
  6576. level = 0;
  6577. while (pos < max) {
  6578. code = str.charCodeAt(pos);
  6579. if (code === 0x20) { break; }
  6580. // ascii control characters
  6581. if (code < 0x20 || code === 0x7F) { break; }
  6582. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6583. pos += 2;
  6584. continue;
  6585. }
  6586. if (code === 0x28 /* ( */) {
  6587. level++;
  6588. if (level > 1) { break; }
  6589. }
  6590. if (code === 0x29 /* ) */) {
  6591. level--;
  6592. if (level < 0) { break; }
  6593. }
  6594. pos++;
  6595. }
  6596. if (start === pos) { return result; }
  6597. result.str = unescapeAll(str.slice(start, pos));
  6598. result.lines = lines;
  6599. result.pos = pos;
  6600. result.ok = true;
  6601. return result;
  6602. };
  6603. /***/ }),
  6604. /* 35 */
  6605. /***/ (function(module, exports, __webpack_require__) {
  6606. "use strict";
  6607. // Parse link label
  6608. //
  6609. // this function assumes that first character ("[") already matches;
  6610. // returns the end of the label
  6611. //
  6612. module.exports = function parseLinkLabel(state, start, disableNested) {
  6613. var level, found, marker, prevPos,
  6614. labelEnd = -1,
  6615. max = state.posMax,
  6616. oldPos = state.pos;
  6617. state.pos = start + 1;
  6618. level = 1;
  6619. while (state.pos < max) {
  6620. marker = state.src.charCodeAt(state.pos);
  6621. if (marker === 0x5D /* ] */) {
  6622. level--;
  6623. if (level === 0) {
  6624. found = true;
  6625. break;
  6626. }
  6627. }
  6628. prevPos = state.pos;
  6629. state.md.inline.skipToken(state);
  6630. if (marker === 0x5B /* [ */) {
  6631. if (prevPos === state.pos - 1) {
  6632. // increase level if we find text `[`, which is not a part of any token
  6633. level++;
  6634. } else if (disableNested) {
  6635. state.pos = oldPos;
  6636. return -1;
  6637. }
  6638. }
  6639. }
  6640. if (found) {
  6641. labelEnd = state.pos;
  6642. }
  6643. // restore old state
  6644. state.pos = oldPos;
  6645. return labelEnd;
  6646. };
  6647. /***/ }),
  6648. /* 36 */
  6649. /***/ (function(module, exports, __webpack_require__) {
  6650. "use strict";
  6651. // Parse link title
  6652. //
  6653. var unescapeAll = __webpack_require__(0).unescapeAll;
  6654. module.exports = function parseLinkTitle(str, pos, max) {
  6655. var code,
  6656. marker,
  6657. lines = 0,
  6658. start = pos,
  6659. result = {
  6660. ok: false,
  6661. pos: 0,
  6662. lines: 0,
  6663. str: ''
  6664. };
  6665. if (pos >= max) { return result; }
  6666. marker = str.charCodeAt(pos);
  6667. if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
  6668. pos++;
  6669. // if opening marker is "(", switch it to closing marker ")"
  6670. if (marker === 0x28) { marker = 0x29; }
  6671. while (pos < max) {
  6672. code = str.charCodeAt(pos);
  6673. if (code === marker) {
  6674. result.pos = pos + 1;
  6675. result.lines = lines;
  6676. result.str = unescapeAll(str.slice(start + 1, pos));
  6677. result.ok = true;
  6678. return result;
  6679. } else if (code === 0x0A) {
  6680. lines++;
  6681. } else if (code === 0x5C /* \ */ && pos + 1 < max) {
  6682. pos++;
  6683. if (str.charCodeAt(pos) === 0x0A) {
  6684. lines++;
  6685. }
  6686. }
  6687. pos++;
  6688. }
  6689. return result;
  6690. };
  6691. /***/ }),
  6692. /* 37 */
  6693. /***/ (function(module, exports, __webpack_require__) {
  6694. "use strict";
  6695. // Main parser class
  6696. var utils = __webpack_require__(0);
  6697. var helpers = __webpack_require__(33);
  6698. var Renderer = __webpack_require__(44);
  6699. var ParserCore = __webpack_require__(39);
  6700. var ParserBlock = __webpack_require__(38);
  6701. var ParserInline = __webpack_require__(40);
  6702. var LinkifyIt = __webpack_require__(30);
  6703. var mdurl = __webpack_require__(15);
  6704. var punycode = __webpack_require__(81);
  6705. var config = {
  6706. 'default': __webpack_require__(42),
  6707. zero: __webpack_require__(43),
  6708. commonmark: __webpack_require__(41)
  6709. };
  6710. ////////////////////////////////////////////////////////////////////////////////
  6711. //
  6712. // This validator can prohibit more than really needed to prevent XSS. It's a
  6713. // tradeoff to keep code simple and to be secure by default.
  6714. //
  6715. // If you need different setup - override validator method as you wish. Or
  6716. // replace it with dummy function and use external sanitizer.
  6717. //
  6718. var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
  6719. var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
  6720. function validateLink(url) {
  6721. // url should be normalized at this point, and existing entities are decoded
  6722. var str = url.trim().toLowerCase();
  6723. return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
  6724. }
  6725. ////////////////////////////////////////////////////////////////////////////////
  6726. var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
  6727. function normalizeLink(url) {
  6728. var parsed = mdurl.parse(url, true);
  6729. if (parsed.hostname) {
  6730. // Encode hostnames in urls like:
  6731. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6732. //
  6733. // We don't encode unknown schemas, because it's likely that we encode
  6734. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6735. //
  6736. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6737. try {
  6738. parsed.hostname = punycode.toASCII(parsed.hostname);
  6739. } catch (er) { /**/ }
  6740. }
  6741. }
  6742. return mdurl.encode(mdurl.format(parsed));
  6743. }
  6744. function normalizeLinkText(url) {
  6745. var parsed = mdurl.parse(url, true);
  6746. if (parsed.hostname) {
  6747. // Encode hostnames in urls like:
  6748. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6749. //
  6750. // We don't encode unknown schemas, because it's likely that we encode
  6751. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6752. //
  6753. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6754. try {
  6755. parsed.hostname = punycode.toUnicode(parsed.hostname);
  6756. } catch (er) { /**/ }
  6757. }
  6758. }
  6759. return mdurl.decode(mdurl.format(parsed));
  6760. }
  6761. /**
  6762. * class MarkdownIt
  6763. *
  6764. * Main parser/renderer class.
  6765. *
  6766. * ##### Usage
  6767. *
  6768. * ```javascript
  6769. * // node.js, "classic" way:
  6770. * var MarkdownIt = require('markdown-it'),
  6771. * md = new MarkdownIt();
  6772. * var result = md.render('# markdown-it rulezz!');
  6773. *
  6774. * // node.js, the same, but with sugar:
  6775. * var md = require('markdown-it')();
  6776. * var result = md.render('# markdown-it rulezz!');
  6777. *
  6778. * // browser without AMD, added to "window" on script load
  6779. * // Note, there are no dash.
  6780. * var md = window.markdownit();
  6781. * var result = md.render('# markdown-it rulezz!');
  6782. * ```
  6783. *
  6784. * Single line rendering, without paragraph wrap:
  6785. *
  6786. * ```javascript
  6787. * var md = require('markdown-it')();
  6788. * var result = md.renderInline('__markdown-it__ rulezz!');
  6789. * ```
  6790. **/
  6791. /**
  6792. * new MarkdownIt([presetName, options])
  6793. * - presetName (String): optional, `commonmark` / `zero`
  6794. * - options (Object)
  6795. *
  6796. * Creates parser instanse with given config. Can be called without `new`.
  6797. *
  6798. * ##### presetName
  6799. *
  6800. * MarkdownIt provides named presets as a convenience to quickly
  6801. * enable/disable active syntax rules and options for common use cases.
  6802. *
  6803. * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
  6804. * configures parser to strict [CommonMark](http://commonmark.org/) mode.
  6805. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
  6806. * similar to GFM, used when no preset name given. Enables all available rules,
  6807. * but still without html, typographer & autolinker.
  6808. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
  6809. * all rules disabled. Useful to quickly setup your config via `.enable()`.
  6810. * For example, when you need only `bold` and `italic` markup and nothing else.
  6811. *
  6812. * ##### options:
  6813. *
  6814. * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
  6815. * That's not safe! You may need external sanitizer to protect output from XSS.
  6816. * It's better to extend features via plugins, instead of enabling HTML.
  6817. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
  6818. * (`<br />`). This is needed only for full CommonMark compatibility. In real
  6819. * world you will need HTML output.
  6820. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
  6821. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
  6822. * Can be useful for external highlighters.
  6823. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
  6824. * - __typographer__ - `false`. Set `true` to enable [some language-neutral
  6825. * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
  6826. * quotes beautification (smartquotes).
  6827. * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
  6828. * pairs, when typographer enabled and smartquotes on. For example, you can
  6829. * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
  6830. * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
  6831. * - __highlight__ - `null`. Highlighter function for fenced code blocks.
  6832. * Highlighter `function (str, lang)` should return escaped HTML. It can also
  6833. * return empty string if the source was not changed and should be escaped
  6834. * externaly. If result starts with <pre... internal wrapper is skipped.
  6835. *
  6836. * ##### Example
  6837. *
  6838. * ```javascript
  6839. * // commonmark mode
  6840. * var md = require('markdown-it')('commonmark');
  6841. *
  6842. * // default mode
  6843. * var md = require('markdown-it')();
  6844. *
  6845. * // enable everything
  6846. * var md = require('markdown-it')({
  6847. * html: true,
  6848. * linkify: true,
  6849. * typographer: true
  6850. * });
  6851. * ```
  6852. *
  6853. * ##### Syntax highlighting
  6854. *
  6855. * ```js
  6856. * var hljs = require('highlight.js') // https://highlightjs.org/
  6857. *
  6858. * var md = require('markdown-it')({
  6859. * highlight: function (str, lang) {
  6860. * if (lang && hljs.getLanguage(lang)) {
  6861. * try {
  6862. * return hljs.highlight(lang, str, true).value;
  6863. * } catch (__) {}
  6864. * }
  6865. *
  6866. * return ''; // use external default escaping
  6867. * }
  6868. * });
  6869. * ```
  6870. *
  6871. * Or with full wrapper override (if you need assign class to `<pre>`):
  6872. *
  6873. * ```javascript
  6874. * var hljs = require('highlight.js') // https://highlightjs.org/
  6875. *
  6876. * // Actual default values
  6877. * var md = require('markdown-it')({
  6878. * highlight: function (str, lang) {
  6879. * if (lang && hljs.getLanguage(lang)) {
  6880. * try {
  6881. * return '<pre class="hljs"><code>' +
  6882. * hljs.highlight(lang, str, true).value +
  6883. * '</code></pre>';
  6884. * } catch (__) {}
  6885. * }
  6886. *
  6887. * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
  6888. * }
  6889. * });
  6890. * ```
  6891. *
  6892. **/
  6893. function MarkdownIt(presetName, options) {
  6894. if (!(this instanceof MarkdownIt)) {
  6895. return new MarkdownIt(presetName, options);
  6896. }
  6897. if (!options) {
  6898. if (!utils.isString(presetName)) {
  6899. options = presetName || {};
  6900. presetName = 'default';
  6901. }
  6902. }
  6903. /**
  6904. * MarkdownIt#inline -> ParserInline
  6905. *
  6906. * Instance of [[ParserInline]]. You may need it to add new rules when
  6907. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6908. * [[MarkdownIt.enable]].
  6909. **/
  6910. this.inline = new ParserInline();
  6911. /**
  6912. * MarkdownIt#block -> ParserBlock
  6913. *
  6914. * Instance of [[ParserBlock]]. You may need it to add new rules when
  6915. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6916. * [[MarkdownIt.enable]].
  6917. **/
  6918. this.block = new ParserBlock();
  6919. /**
  6920. * MarkdownIt#core -> Core
  6921. *
  6922. * Instance of [[Core]] chain executor. You may need it to add new rules when
  6923. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6924. * [[MarkdownIt.enable]].
  6925. **/
  6926. this.core = new ParserCore();
  6927. /**
  6928. * MarkdownIt#renderer -> Renderer
  6929. *
  6930. * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
  6931. * rules for new token types, generated by plugins.
  6932. *
  6933. * ##### Example
  6934. *
  6935. * ```javascript
  6936. * var md = require('markdown-it')();
  6937. *
  6938. * function myToken(tokens, idx, options, env, self) {
  6939. * //...
  6940. * return result;
  6941. * };
  6942. *
  6943. * md.renderer.rules['my_token'] = myToken
  6944. * ```
  6945. *
  6946. * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
  6947. **/
  6948. this.renderer = new Renderer();
  6949. /**
  6950. * MarkdownIt#linkify -> LinkifyIt
  6951. *
  6952. * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
  6953. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
  6954. * rule.
  6955. **/
  6956. this.linkify = new LinkifyIt();
  6957. /**
  6958. * MarkdownIt#validateLink(url) -> Boolean
  6959. *
  6960. * Link validation function. CommonMark allows too much in links. By default
  6961. * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
  6962. * except some embedded image types.
  6963. *
  6964. * You can change this behaviour:
  6965. *
  6966. * ```javascript
  6967. * var md = require('markdown-it')();
  6968. * // enable everything
  6969. * md.validateLink = function () { return true; }
  6970. * ```
  6971. **/
  6972. this.validateLink = validateLink;
  6973. /**
  6974. * MarkdownIt#normalizeLink(url) -> String
  6975. *
  6976. * Function used to encode link url to a machine-readable format,
  6977. * which includes url-encoding, punycode, etc.
  6978. **/
  6979. this.normalizeLink = normalizeLink;
  6980. /**
  6981. * MarkdownIt#normalizeLinkText(url) -> String
  6982. *
  6983. * Function used to decode link url to a human-readable format`
  6984. **/
  6985. this.normalizeLinkText = normalizeLinkText;
  6986. // Expose utils & helpers for easy acces from plugins
  6987. /**
  6988. * MarkdownIt#utils -> utils
  6989. *
  6990. * Assorted utility functions, useful to write plugins. See details
  6991. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
  6992. **/
  6993. this.utils = utils;
  6994. /**
  6995. * MarkdownIt#helpers -> helpers
  6996. *
  6997. * Link components parser functions, useful to write plugins. See details
  6998. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
  6999. **/
  7000. this.helpers = utils.assign({}, helpers);
  7001. this.options = {};
  7002. this.configure(presetName);
  7003. if (options) { this.set(options); }
  7004. }
  7005. /** chainable
  7006. * MarkdownIt.set(options)
  7007. *
  7008. * Set parser options (in the same format as in constructor). Probably, you
  7009. * will never need it, but you can change options after constructor call.
  7010. *
  7011. * ##### Example
  7012. *
  7013. * ```javascript
  7014. * var md = require('markdown-it')()
  7015. * .set({ html: true, breaks: true })
  7016. * .set({ typographer, true });
  7017. * ```
  7018. *
  7019. * __Note:__ To achieve the best possible performance, don't modify a
  7020. * `markdown-it` instance options on the fly. If you need multiple configurations
  7021. * it's best to create multiple instances and initialize each with separate
  7022. * config.
  7023. **/
  7024. MarkdownIt.prototype.set = function (options) {
  7025. utils.assign(this.options, options);
  7026. return this;
  7027. };
  7028. /** chainable, internal
  7029. * MarkdownIt.configure(presets)
  7030. *
  7031. * Batch load of all options and compenent settings. This is internal method,
  7032. * and you probably will not need it. But if you with - see available presets
  7033. * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
  7034. *
  7035. * We strongly recommend to use presets instead of direct config loads. That
  7036. * will give better compatibility with next versions.
  7037. **/
  7038. MarkdownIt.prototype.configure = function (presets) {
  7039. var self = this, presetName;
  7040. if (utils.isString(presets)) {
  7041. presetName = presets;
  7042. presets = config[presetName];
  7043. if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
  7044. }
  7045. if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
  7046. if (presets.options) { self.set(presets.options); }
  7047. if (presets.components) {
  7048. Object.keys(presets.components).forEach(function (name) {
  7049. if (presets.components[name].rules) {
  7050. self[name].ruler.enableOnly(presets.components[name].rules);
  7051. }
  7052. if (presets.components[name].rules2) {
  7053. self[name].ruler2.enableOnly(presets.components[name].rules2);
  7054. }
  7055. });
  7056. }
  7057. return this;
  7058. };
  7059. /** chainable
  7060. * MarkdownIt.enable(list, ignoreInvalid)
  7061. * - list (String|Array): rule name or list of rule names to enable
  7062. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  7063. *
  7064. * Enable list or rules. It will automatically find appropriate components,
  7065. * containing rules with given names. If rule not found, and `ignoreInvalid`
  7066. * not set - throws exception.
  7067. *
  7068. * ##### Example
  7069. *
  7070. * ```javascript
  7071. * var md = require('markdown-it')()
  7072. * .enable(['sub', 'sup'])
  7073. * .disable('smartquotes');
  7074. * ```
  7075. **/
  7076. MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
  7077. var result = [];
  7078. if (!Array.isArray(list)) { list = [ list ]; }
  7079. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  7080. result = result.concat(this[chain].ruler.enable(list, true));
  7081. }, this);
  7082. result = result.concat(this.inline.ruler2.enable(list, true));
  7083. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  7084. if (missed.length && !ignoreInvalid) {
  7085. throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
  7086. }
  7087. return this;
  7088. };
  7089. /** chainable
  7090. * MarkdownIt.disable(list, ignoreInvalid)
  7091. * - list (String|Array): rule name or list of rule names to disable.
  7092. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  7093. *
  7094. * The same as [[MarkdownIt.enable]], but turn specified rules off.
  7095. **/
  7096. MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
  7097. var result = [];
  7098. if (!Array.isArray(list)) { list = [ list ]; }
  7099. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  7100. result = result.concat(this[chain].ruler.disable(list, true));
  7101. }, this);
  7102. result = result.concat(this.inline.ruler2.disable(list, true));
  7103. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  7104. if (missed.length && !ignoreInvalid) {
  7105. throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
  7106. }
  7107. return this;
  7108. };
  7109. /** chainable
  7110. * MarkdownIt.use(plugin, params)
  7111. *
  7112. * Load specified plugin with given params into current parser instance.
  7113. * It's just a sugar to call `plugin(md, params)` with curring.
  7114. *
  7115. * ##### Example
  7116. *
  7117. * ```javascript
  7118. * var iterator = require('markdown-it-for-inline');
  7119. * var md = require('markdown-it')()
  7120. * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
  7121. * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
  7122. * });
  7123. * ```
  7124. **/
  7125. MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
  7126. var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
  7127. plugin.apply(plugin, args);
  7128. return this;
  7129. };
  7130. /** internal
  7131. * MarkdownIt.parse(src, env) -> Array
  7132. * - src (String): source string
  7133. * - env (Object): environment sandbox
  7134. *
  7135. * Parse input string and returns list of block tokens (special token type
  7136. * "inline" will contain list of inline tokens). You should not call this
  7137. * method directly, until you write custom renderer (for example, to produce
  7138. * AST).
  7139. *
  7140. * `env` is used to pass data between "distributed" rules and return additional
  7141. * metadata like reference info, needed for the renderer. It also can be used to
  7142. * inject data in specific cases. Usually, you will be ok to pass `{}`,
  7143. * and then pass updated object to renderer.
  7144. **/
  7145. MarkdownIt.prototype.parse = function (src, env) {
  7146. if (typeof src !== 'string') {
  7147. throw new Error('Input data should be a String');
  7148. }
  7149. var state = new this.core.State(src, this, env);
  7150. this.core.process(state);
  7151. return state.tokens;
  7152. };
  7153. /**
  7154. * MarkdownIt.render(src [, env]) -> String
  7155. * - src (String): source string
  7156. * - env (Object): environment sandbox
  7157. *
  7158. * Render markdown string into html. It does all magic for you :).
  7159. *
  7160. * `env` can be used to inject additional metadata (`{}` by default).
  7161. * But you will not need it with high probability. See also comment
  7162. * in [[MarkdownIt.parse]].
  7163. **/
  7164. MarkdownIt.prototype.render = function (src, env) {
  7165. env = env || {};
  7166. return this.renderer.render(this.parse(src, env), this.options, env);
  7167. };
  7168. /** internal
  7169. * MarkdownIt.parseInline(src, env) -> Array
  7170. * - src (String): source string
  7171. * - env (Object): environment sandbox
  7172. *
  7173. * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
  7174. * block tokens list with the single `inline` element, containing parsed inline
  7175. * tokens in `children` property. Also updates `env` object.
  7176. **/
  7177. MarkdownIt.prototype.parseInline = function (src, env) {
  7178. var state = new this.core.State(src, this, env);
  7179. state.inlineMode = true;
  7180. this.core.process(state);
  7181. return state.tokens;
  7182. };
  7183. /**
  7184. * MarkdownIt.renderInline(src [, env]) -> String
  7185. * - src (String): source string
  7186. * - env (Object): environment sandbox
  7187. *
  7188. * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
  7189. * will NOT be wrapped into `<p>` tags.
  7190. **/
  7191. MarkdownIt.prototype.renderInline = function (src, env) {
  7192. env = env || {};
  7193. return this.renderer.render(this.parseInline(src, env), this.options, env);
  7194. };
  7195. module.exports = MarkdownIt;
  7196. /***/ }),
  7197. /* 38 */
  7198. /***/ (function(module, exports, __webpack_require__) {
  7199. "use strict";
  7200. /** internal
  7201. * class ParserBlock
  7202. *
  7203. * Block-level tokenizer.
  7204. **/
  7205. var Ruler = __webpack_require__(3);
  7206. var _rules = [
  7207. // First 2 params - rule name & source. Secondary array - list of rules,
  7208. // which can be terminated by this one.
  7209. [ 'table', __webpack_require__(56), [ 'paragraph', 'reference' ] ],
  7210. [ 'code', __webpack_require__(46) ],
  7211. [ 'fence', __webpack_require__(47), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  7212. [ 'blockquote', __webpack_require__(45), [ 'paragraph', 'reference', 'list' ] ],
  7213. [ 'hr', __webpack_require__(49), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  7214. [ 'list', __webpack_require__(52), [ 'paragraph', 'reference', 'blockquote' ] ],
  7215. [ 'reference', __webpack_require__(54) ],
  7216. [ 'heading', __webpack_require__(48), [ 'paragraph', 'reference', 'blockquote' ] ],
  7217. [ 'lheading', __webpack_require__(51) ],
  7218. [ 'html_block', __webpack_require__(50), [ 'paragraph', 'reference', 'blockquote' ] ],
  7219. [ 'paragraph', __webpack_require__(53) ]
  7220. ];
  7221. /**
  7222. * new ParserBlock()
  7223. **/
  7224. function ParserBlock() {
  7225. /**
  7226. * ParserBlock#ruler -> Ruler
  7227. *
  7228. * [[Ruler]] instance. Keep configuration of block rules.
  7229. **/
  7230. this.ruler = new Ruler();
  7231. for (var i = 0; i < _rules.length; i++) {
  7232. this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
  7233. }
  7234. }
  7235. // Generate tokens for input range
  7236. //
  7237. ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
  7238. var ok, i,
  7239. rules = this.ruler.getRules(''),
  7240. len = rules.length,
  7241. line = startLine,
  7242. hasEmptyLines = false,
  7243. maxNesting = state.md.options.maxNesting;
  7244. while (line < endLine) {
  7245. state.line = line = state.skipEmptyLines(line);
  7246. if (line >= endLine) { break; }
  7247. // Termination condition for nested calls.
  7248. // Nested calls currently used for blockquotes & lists
  7249. if (state.sCount[line] < state.blkIndent) { break; }
  7250. // If nesting level exceeded - skip tail to the end. That's not ordinary
  7251. // situation and we should not care about content.
  7252. if (state.level >= maxNesting) {
  7253. state.line = endLine;
  7254. break;
  7255. }
  7256. // Try all possible rules.
  7257. // On success, rule should:
  7258. //
  7259. // - update `state.line`
  7260. // - update `state.tokens`
  7261. // - return true
  7262. for (i = 0; i < len; i++) {
  7263. ok = rules[i](state, line, endLine, false);
  7264. if (ok) { break; }
  7265. }
  7266. // set state.tight iff we had an empty line before current tag
  7267. // i.e. latest empty line should not count
  7268. state.tight = !hasEmptyLines;
  7269. // paragraph might "eat" one newline after it in nested lists
  7270. if (state.isEmpty(state.line - 1)) {
  7271. hasEmptyLines = true;
  7272. }
  7273. line = state.line;
  7274. if (line < endLine && state.isEmpty(line)) {
  7275. hasEmptyLines = true;
  7276. line++;
  7277. state.line = line;
  7278. }
  7279. }
  7280. };
  7281. /**
  7282. * ParserBlock.parse(str, md, env, outTokens)
  7283. *
  7284. * Process input string and push block tokens into `outTokens`
  7285. **/
  7286. ParserBlock.prototype.parse = function (src, md, env, outTokens) {
  7287. var state;
  7288. if (!src) { return; }
  7289. state = new this.State(src, md, env, outTokens);
  7290. this.tokenize(state, state.line, state.lineMax);
  7291. };
  7292. ParserBlock.prototype.State = __webpack_require__(55);
  7293. module.exports = ParserBlock;
  7294. /***/ }),
  7295. /* 39 */
  7296. /***/ (function(module, exports, __webpack_require__) {
  7297. "use strict";
  7298. /** internal
  7299. * class Core
  7300. *
  7301. * Top-level rules executor. Glues block/inline parsers and does intermediate
  7302. * transformations.
  7303. **/
  7304. var Ruler = __webpack_require__(3);
  7305. var _rules = [
  7306. [ 'normalize', __webpack_require__(60) ],
  7307. [ 'block', __webpack_require__(57) ],
  7308. [ 'inline', __webpack_require__(58) ],
  7309. [ 'linkify', __webpack_require__(59) ],
  7310. [ 'replacements', __webpack_require__(61) ],
  7311. [ 'smartquotes', __webpack_require__(62) ]
  7312. ];
  7313. /**
  7314. * new Core()
  7315. **/
  7316. function Core() {
  7317. /**
  7318. * Core#ruler -> Ruler
  7319. *
  7320. * [[Ruler]] instance. Keep configuration of core rules.
  7321. **/
  7322. this.ruler = new Ruler();
  7323. for (var i = 0; i < _rules.length; i++) {
  7324. this.ruler.push(_rules[i][0], _rules[i][1]);
  7325. }
  7326. }
  7327. /**
  7328. * Core.process(state)
  7329. *
  7330. * Executes core chain rules.
  7331. **/
  7332. Core.prototype.process = function (state) {
  7333. var i, l, rules;
  7334. rules = this.ruler.getRules('');
  7335. for (i = 0, l = rules.length; i < l; i++) {
  7336. rules[i](state);
  7337. }
  7338. };
  7339. Core.prototype.State = __webpack_require__(63);
  7340. module.exports = Core;
  7341. /***/ }),
  7342. /* 40 */
  7343. /***/ (function(module, exports, __webpack_require__) {
  7344. "use strict";
  7345. /** internal
  7346. * class ParserInline
  7347. *
  7348. * Tokenizes paragraph content.
  7349. **/
  7350. var Ruler = __webpack_require__(3);
  7351. ////////////////////////////////////////////////////////////////////////////////
  7352. // Parser rules
  7353. var _rules = [
  7354. [ 'text', __webpack_require__(74) ],
  7355. [ 'newline', __webpack_require__(72) ],
  7356. [ 'escape', __webpack_require__(68) ],
  7357. [ 'backticks', __webpack_require__(65) ],
  7358. [ 'strikethrough', __webpack_require__(14).tokenize ],
  7359. [ 'emphasis', __webpack_require__(13).tokenize ],
  7360. [ 'link', __webpack_require__(71) ],
  7361. [ 'image', __webpack_require__(70) ],
  7362. [ 'autolink', __webpack_require__(64) ],
  7363. [ 'html_inline', __webpack_require__(69) ],
  7364. [ 'entity', __webpack_require__(67) ]
  7365. ];
  7366. var _rules2 = [
  7367. [ 'balance_pairs', __webpack_require__(66) ],
  7368. [ 'strikethrough', __webpack_require__(14).postProcess ],
  7369. [ 'emphasis', __webpack_require__(13).postProcess ],
  7370. [ 'text_collapse', __webpack_require__(75) ]
  7371. ];
  7372. /**
  7373. * new ParserInline()
  7374. **/
  7375. function ParserInline() {
  7376. var i;
  7377. /**
  7378. * ParserInline#ruler -> Ruler
  7379. *
  7380. * [[Ruler]] instance. Keep configuration of inline rules.
  7381. **/
  7382. this.ruler = new Ruler();
  7383. for (i = 0; i < _rules.length; i++) {
  7384. this.ruler.push(_rules[i][0], _rules[i][1]);
  7385. }
  7386. /**
  7387. * ParserInline#ruler2 -> Ruler
  7388. *
  7389. * [[Ruler]] instance. Second ruler used for post-processing
  7390. * (e.g. in emphasis-like rules).
  7391. **/
  7392. this.ruler2 = new Ruler();
  7393. for (i = 0; i < _rules2.length; i++) {
  7394. this.ruler2.push(_rules2[i][0], _rules2[i][1]);
  7395. }
  7396. }
  7397. // Skip single token by running all rules in validation mode;
  7398. // returns `true` if any rule reported success
  7399. //
  7400. ParserInline.prototype.skipToken = function (state) {
  7401. var ok, i, pos = state.pos,
  7402. rules = this.ruler.getRules(''),
  7403. len = rules.length,
  7404. maxNesting = state.md.options.maxNesting,
  7405. cache = state.cache;
  7406. if (typeof cache[pos] !== 'undefined') {
  7407. state.pos = cache[pos];
  7408. return;
  7409. }
  7410. if (state.level < maxNesting) {
  7411. for (i = 0; i < len; i++) {
  7412. // Increment state.level and decrement it later to limit recursion.
  7413. // It's harmless to do here, because no tokens are created. But ideally,
  7414. // we'd need a separate private state variable for this purpose.
  7415. //
  7416. state.level++;
  7417. ok = rules[i](state, true);
  7418. state.level--;
  7419. if (ok) { break; }
  7420. }
  7421. } else {
  7422. // Too much nesting, just skip until the end of the paragraph.
  7423. //
  7424. // NOTE: this will cause links to behave incorrectly in the following case,
  7425. // when an amount of `[` is exactly equal to `maxNesting + 1`:
  7426. //
  7427. // [[[[[[[[[[[[[[[[[[[[[foo]()
  7428. //
  7429. // TODO: remove this workaround when CM standard will allow nested links
  7430. // (we can replace it by preventing links from being parsed in
  7431. // validation mode)
  7432. //
  7433. state.pos = state.posMax;
  7434. }
  7435. if (!ok) { state.pos++; }
  7436. cache[pos] = state.pos;
  7437. };
  7438. // Generate tokens for input range
  7439. //
  7440. ParserInline.prototype.tokenize = function (state) {
  7441. var ok, i,
  7442. rules = this.ruler.getRules(''),
  7443. len = rules.length,
  7444. end = state.posMax,
  7445. maxNesting = state.md.options.maxNesting;
  7446. while (state.pos < end) {
  7447. // Try all possible rules.
  7448. // On success, rule should:
  7449. //
  7450. // - update `state.pos`
  7451. // - update `state.tokens`
  7452. // - return true
  7453. if (state.level < maxNesting) {
  7454. for (i = 0; i < len; i++) {
  7455. ok = rules[i](state, false);
  7456. if (ok) { break; }
  7457. }
  7458. }
  7459. if (ok) {
  7460. if (state.pos >= end) { break; }
  7461. continue;
  7462. }
  7463. state.pending += state.src[state.pos++];
  7464. }
  7465. if (state.pending) {
  7466. state.pushPending();
  7467. }
  7468. };
  7469. /**
  7470. * ParserInline.parse(str, md, env, outTokens)
  7471. *
  7472. * Process input string and push inline tokens into `outTokens`
  7473. **/
  7474. ParserInline.prototype.parse = function (str, md, env, outTokens) {
  7475. var i, rules, len;
  7476. var state = new this.State(str, md, env, outTokens);
  7477. this.tokenize(state);
  7478. rules = this.ruler2.getRules('');
  7479. len = rules.length;
  7480. for (i = 0; i < len; i++) {
  7481. rules[i](state);
  7482. }
  7483. };
  7484. ParserInline.prototype.State = __webpack_require__(73);
  7485. module.exports = ParserInline;
  7486. /***/ }),
  7487. /* 41 */
  7488. /***/ (function(module, exports, __webpack_require__) {
  7489. "use strict";
  7490. // Commonmark default options
  7491. module.exports = {
  7492. options: {
  7493. html: true, // Enable HTML tags in source
  7494. xhtmlOut: true, // Use '/' to close single tags (<br />)
  7495. breaks: false, // Convert '\n' in paragraphs into <br>
  7496. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7497. linkify: false, // autoconvert URL-like texts to links
  7498. // Enable some language-neutral replacements + quotes beautification
  7499. typographer: false,
  7500. // Double + single quotes replacement pairs, when typographer enabled,
  7501. // and smartquotes on. Could be either a String or an Array.
  7502. //
  7503. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7504. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7505. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7506. // Highlighter function. Should return escaped HTML,
  7507. // or '' if the source string is not changed and should be escaped externaly.
  7508. // If result starts with <pre... internal wrapper is skipped.
  7509. //
  7510. // function (/*str, lang*/) { return ''; }
  7511. //
  7512. highlight: null,
  7513. maxNesting: 20 // Internal protection, recursion limit
  7514. },
  7515. components: {
  7516. core: {
  7517. rules: [
  7518. 'normalize',
  7519. 'block',
  7520. 'inline'
  7521. ]
  7522. },
  7523. block: {
  7524. rules: [
  7525. 'blockquote',
  7526. 'code',
  7527. 'fence',
  7528. 'heading',
  7529. 'hr',
  7530. 'html_block',
  7531. 'lheading',
  7532. 'list',
  7533. 'reference',
  7534. 'paragraph'
  7535. ]
  7536. },
  7537. inline: {
  7538. rules: [
  7539. 'autolink',
  7540. 'backticks',
  7541. 'emphasis',
  7542. 'entity',
  7543. 'escape',
  7544. 'html_inline',
  7545. 'image',
  7546. 'link',
  7547. 'newline',
  7548. 'text'
  7549. ],
  7550. rules2: [
  7551. 'balance_pairs',
  7552. 'emphasis',
  7553. 'text_collapse'
  7554. ]
  7555. }
  7556. }
  7557. };
  7558. /***/ }),
  7559. /* 42 */
  7560. /***/ (function(module, exports, __webpack_require__) {
  7561. "use strict";
  7562. // markdown-it default options
  7563. module.exports = {
  7564. options: {
  7565. html: false, // Enable HTML tags in source
  7566. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7567. breaks: false, // Convert '\n' in paragraphs into <br>
  7568. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7569. linkify: false, // autoconvert URL-like texts to links
  7570. // Enable some language-neutral replacements + quotes beautification
  7571. typographer: false,
  7572. // Double + single quotes replacement pairs, when typographer enabled,
  7573. // and smartquotes on. Could be either a String or an Array.
  7574. //
  7575. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7576. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7577. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7578. // Highlighter function. Should return escaped HTML,
  7579. // or '' if the source string is not changed and should be escaped externaly.
  7580. // If result starts with <pre... internal wrapper is skipped.
  7581. //
  7582. // function (/*str, lang*/) { return ''; }
  7583. //
  7584. highlight: null,
  7585. maxNesting: 100 // Internal protection, recursion limit
  7586. },
  7587. components: {
  7588. core: {},
  7589. block: {},
  7590. inline: {}
  7591. }
  7592. };
  7593. /***/ }),
  7594. /* 43 */
  7595. /***/ (function(module, exports, __webpack_require__) {
  7596. "use strict";
  7597. // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
  7598. // modes. For example, to parse bold/italic only.
  7599. module.exports = {
  7600. options: {
  7601. html: false, // Enable HTML tags in source
  7602. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7603. breaks: false, // Convert '\n' in paragraphs into <br>
  7604. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7605. linkify: false, // autoconvert URL-like texts to links
  7606. // Enable some language-neutral replacements + quotes beautification
  7607. typographer: false,
  7608. // Double + single quotes replacement pairs, when typographer enabled,
  7609. // and smartquotes on. Could be either a String or an Array.
  7610. //
  7611. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7612. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7613. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7614. // Highlighter function. Should return escaped HTML,
  7615. // or '' if the source string is not changed and should be escaped externaly.
  7616. // If result starts with <pre... internal wrapper is skipped.
  7617. //
  7618. // function (/*str, lang*/) { return ''; }
  7619. //
  7620. highlight: null,
  7621. maxNesting: 20 // Internal protection, recursion limit
  7622. },
  7623. components: {
  7624. core: {
  7625. rules: [
  7626. 'normalize',
  7627. 'block',
  7628. 'inline'
  7629. ]
  7630. },
  7631. block: {
  7632. rules: [
  7633. 'paragraph'
  7634. ]
  7635. },
  7636. inline: {
  7637. rules: [
  7638. 'text'
  7639. ],
  7640. rules2: [
  7641. 'balance_pairs',
  7642. 'text_collapse'
  7643. ]
  7644. }
  7645. }
  7646. };
  7647. /***/ }),
  7648. /* 44 */
  7649. /***/ (function(module, exports, __webpack_require__) {
  7650. "use strict";
  7651. /**
  7652. * class Renderer
  7653. *
  7654. * Generates HTML from parsed token stream. Each instance has independent
  7655. * copy of rules. Those can be rewritten with ease. Also, you can add new
  7656. * rules if you create plugin and adds new token types.
  7657. **/
  7658. var assign = __webpack_require__(0).assign;
  7659. var unescapeAll = __webpack_require__(0).unescapeAll;
  7660. var escapeHtml = __webpack_require__(0).escapeHtml;
  7661. ////////////////////////////////////////////////////////////////////////////////
  7662. var default_rules = {};
  7663. default_rules.code_inline = function (tokens, idx, options, env, slf) {
  7664. var token = tokens[idx];
  7665. return '<code' + slf.renderAttrs(token) + '>' +
  7666. escapeHtml(tokens[idx].content) +
  7667. '</code>';
  7668. };
  7669. default_rules.code_block = function (tokens, idx, options, env, slf) {
  7670. var token = tokens[idx];
  7671. return '<pre' + slf.renderAttrs(token) + '><code>' +
  7672. escapeHtml(tokens[idx].content) +
  7673. '</code></pre>\n';
  7674. };
  7675. default_rules.fence = function (tokens, idx, options, env, slf) {
  7676. var token = tokens[idx],
  7677. info = token.info ? unescapeAll(token.info).trim() : '',
  7678. langName = '',
  7679. highlighted, i, tmpAttrs, tmpToken;
  7680. if (info) {
  7681. langName = info.split(/\s+/g)[0];
  7682. }
  7683. if (options.highlight) {
  7684. highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
  7685. } else {
  7686. highlighted = escapeHtml(token.content);
  7687. }
  7688. if (highlighted.indexOf('<pre') === 0) {
  7689. return highlighted + '\n';
  7690. }
  7691. // If language exists, inject class gently, without mudofying original token.
  7692. // May be, one day we will add .clone() for token and simplify this part, but
  7693. // now we prefer to keep things local.
  7694. if (info) {
  7695. i = token.attrIndex('class');
  7696. tmpAttrs = token.attrs ? token.attrs.slice() : [];
  7697. if (i < 0) {
  7698. tmpAttrs.push([ 'class', options.langPrefix + langName ]);
  7699. } else {
  7700. tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
  7701. }
  7702. // Fake token just to render attributes
  7703. tmpToken = {
  7704. attrs: tmpAttrs
  7705. };
  7706. return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
  7707. + highlighted
  7708. + '</code></pre>\n';
  7709. }
  7710. return '<pre><code' + slf.renderAttrs(token) + '>'
  7711. + highlighted
  7712. + '</code></pre>\n';
  7713. };
  7714. default_rules.image = function (tokens, idx, options, env, slf) {
  7715. var token = tokens[idx];
  7716. // "alt" attr MUST be set, even if empty. Because it's mandatory and
  7717. // should be placed on proper position for tests.
  7718. //
  7719. // Replace content with actual value
  7720. token.attrs[token.attrIndex('alt')][1] =
  7721. slf.renderInlineAsText(token.children, options, env);
  7722. return slf.renderToken(tokens, idx, options);
  7723. };
  7724. default_rules.hardbreak = function (tokens, idx, options /*, env */) {
  7725. return options.xhtmlOut ? '<br />\n' : '<br>\n';
  7726. };
  7727. default_rules.softbreak = function (tokens, idx, options /*, env */) {
  7728. return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
  7729. };
  7730. default_rules.text = function (tokens, idx /*, options, env */) {
  7731. return escapeHtml(tokens[idx].content);
  7732. };
  7733. default_rules.html_block = function (tokens, idx /*, options, env */) {
  7734. return tokens[idx].content;
  7735. };
  7736. default_rules.html_inline = function (tokens, idx /*, options, env */) {
  7737. return tokens[idx].content;
  7738. };
  7739. /**
  7740. * new Renderer()
  7741. *
  7742. * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
  7743. **/
  7744. function Renderer() {
  7745. /**
  7746. * Renderer#rules -> Object
  7747. *
  7748. * Contains render rules for tokens. Can be updated and extended.
  7749. *
  7750. * ##### Example
  7751. *
  7752. * ```javascript
  7753. * var md = require('markdown-it')();
  7754. *
  7755. * md.renderer.rules.strong_open = function () { return '<b>'; };
  7756. * md.renderer.rules.strong_close = function () { return '</b>'; };
  7757. *
  7758. * var result = md.renderInline(...);
  7759. * ```
  7760. *
  7761. * Each rule is called as independed static function with fixed signature:
  7762. *
  7763. * ```javascript
  7764. * function my_token_render(tokens, idx, options, env, renderer) {
  7765. * // ...
  7766. * return renderedHTML;
  7767. * }
  7768. * ```
  7769. *
  7770. * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
  7771. * for more details and examples.
  7772. **/
  7773. this.rules = assign({}, default_rules);
  7774. }
  7775. /**
  7776. * Renderer.renderAttrs(token) -> String
  7777. *
  7778. * Render token attributes to string.
  7779. **/
  7780. Renderer.prototype.renderAttrs = function renderAttrs(token) {
  7781. var i, l, result;
  7782. if (!token.attrs) { return ''; }
  7783. result = '';
  7784. for (i = 0, l = token.attrs.length; i < l; i++) {
  7785. result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
  7786. }
  7787. return result;
  7788. };
  7789. /**
  7790. * Renderer.renderToken(tokens, idx, options) -> String
  7791. * - tokens (Array): list of tokens
  7792. * - idx (Numbed): token index to render
  7793. * - options (Object): params of parser instance
  7794. *
  7795. * Default token renderer. Can be overriden by custom function
  7796. * in [[Renderer#rules]].
  7797. **/
  7798. Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
  7799. var nextToken,
  7800. result = '',
  7801. needLf = false,
  7802. token = tokens[idx];
  7803. // Tight list paragraphs
  7804. if (token.hidden) {
  7805. return '';
  7806. }
  7807. // Insert a newline between hidden paragraph and subsequent opening
  7808. // block-level tag.
  7809. //
  7810. // For example, here we should insert a newline before blockquote:
  7811. // - a
  7812. // >
  7813. //
  7814. if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
  7815. result += '\n';
  7816. }
  7817. // Add token name, e.g. `<img`
  7818. result += (token.nesting === -1 ? '</' : '<') + token.tag;
  7819. // Encode attributes, e.g. `<img src="foo"`
  7820. result += this.renderAttrs(token);
  7821. // Add a slash for self-closing tags, e.g. `<img src="foo" /`
  7822. if (token.nesting === 0 && options.xhtmlOut) {
  7823. result += ' /';
  7824. }
  7825. // Check if we need to add a newline after this tag
  7826. if (token.block) {
  7827. needLf = true;
  7828. if (token.nesting === 1) {
  7829. if (idx + 1 < tokens.length) {
  7830. nextToken = tokens[idx + 1];
  7831. if (nextToken.type === 'inline' || nextToken.hidden) {
  7832. // Block-level tag containing an inline tag.
  7833. //
  7834. needLf = false;
  7835. } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
  7836. // Opening tag + closing tag of the same type. E.g. `<li></li>`.
  7837. //
  7838. needLf = false;
  7839. }
  7840. }
  7841. }
  7842. }
  7843. result += needLf ? '>\n' : '>';
  7844. return result;
  7845. };
  7846. /**
  7847. * Renderer.renderInline(tokens, options, env) -> String
  7848. * - tokens (Array): list on block tokens to renter
  7849. * - options (Object): params of parser instance
  7850. * - env (Object): additional data from parsed input (references, for example)
  7851. *
  7852. * The same as [[Renderer.render]], but for single token of `inline` type.
  7853. **/
  7854. Renderer.prototype.renderInline = function (tokens, options, env) {
  7855. var type,
  7856. result = '',
  7857. rules = this.rules;
  7858. for (var i = 0, len = tokens.length; i < len; i++) {
  7859. type = tokens[i].type;
  7860. if (typeof rules[type] !== 'undefined') {
  7861. result += rules[type](tokens, i, options, env, this);
  7862. } else {
  7863. result += this.renderToken(tokens, i, options);
  7864. }
  7865. }
  7866. return result;
  7867. };
  7868. /** internal
  7869. * Renderer.renderInlineAsText(tokens, options, env) -> String
  7870. * - tokens (Array): list on block tokens to renter
  7871. * - options (Object): params of parser instance
  7872. * - env (Object): additional data from parsed input (references, for example)
  7873. *
  7874. * Special kludge for image `alt` attributes to conform CommonMark spec.
  7875. * Don't try to use it! Spec requires to show `alt` content with stripped markup,
  7876. * instead of simple escaping.
  7877. **/
  7878. Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
  7879. var result = '';
  7880. for (var i = 0, len = tokens.length; i < len; i++) {
  7881. if (tokens[i].type === 'text') {
  7882. result += tokens[i].content;
  7883. } else if (tokens[i].type === 'image') {
  7884. result += this.renderInlineAsText(tokens[i].children, options, env);
  7885. }
  7886. }
  7887. return result;
  7888. };
  7889. /**
  7890. * Renderer.render(tokens, options, env) -> String
  7891. * - tokens (Array): list on block tokens to renter
  7892. * - options (Object): params of parser instance
  7893. * - env (Object): additional data from parsed input (references, for example)
  7894. *
  7895. * Takes token stream and generates HTML. Probably, you will never need to call
  7896. * this method directly.
  7897. **/
  7898. Renderer.prototype.render = function (tokens, options, env) {
  7899. var i, len, type,
  7900. result = '',
  7901. rules = this.rules;
  7902. for (i = 0, len = tokens.length; i < len; i++) {
  7903. type = tokens[i].type;
  7904. if (type === 'inline') {
  7905. result += this.renderInline(tokens[i].children, options, env);
  7906. } else if (typeof rules[type] !== 'undefined') {
  7907. result += rules[tokens[i].type](tokens, i, options, env, this);
  7908. } else {
  7909. result += this.renderToken(tokens, i, options, env);
  7910. }
  7911. }
  7912. return result;
  7913. };
  7914. module.exports = Renderer;
  7915. /***/ }),
  7916. /* 45 */
  7917. /***/ (function(module, exports, __webpack_require__) {
  7918. "use strict";
  7919. // Block quotes
  7920. var isSpace = __webpack_require__(0).isSpace;
  7921. module.exports = function blockquote(state, startLine, endLine, silent) {
  7922. var adjustTab,
  7923. ch,
  7924. i,
  7925. initial,
  7926. isOutdented,
  7927. l,
  7928. lastLineEmpty,
  7929. lines,
  7930. nextLine,
  7931. offset,
  7932. oldBMarks,
  7933. oldBSCount,
  7934. oldIndent,
  7935. oldParentType,
  7936. oldSCount,
  7937. oldTShift,
  7938. spaceAfterMarker,
  7939. terminate,
  7940. terminatorRules,
  7941. token,
  7942. oldLineMax = state.lineMax,
  7943. pos = state.bMarks[startLine] + state.tShift[startLine],
  7944. max = state.eMarks[startLine];
  7945. // if it's indented more than 3 spaces, it should be a code block
  7946. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7947. // check the block quote marker
  7948. if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
  7949. // we know that it's going to be a valid blockquote,
  7950. // so no point trying to find the end of it in silent mode
  7951. if (silent) { return true; }
  7952. // skip spaces after ">" and re-calculate offset
  7953. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  7954. // skip one optional space after '>'
  7955. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7956. // ' > test '
  7957. // ^ -- position start of line here:
  7958. pos++;
  7959. initial++;
  7960. offset++;
  7961. adjustTab = false;
  7962. spaceAfterMarker = true;
  7963. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7964. spaceAfterMarker = true;
  7965. if ((state.bsCount[startLine] + offset) % 4 === 3) {
  7966. // ' >\t test '
  7967. // ^ -- position start of line here (tab has width===1)
  7968. pos++;
  7969. initial++;
  7970. offset++;
  7971. adjustTab = false;
  7972. } else {
  7973. // ' >\t test '
  7974. // ^ -- position start of line here + shift bsCount slightly
  7975. // to make extra space appear
  7976. adjustTab = true;
  7977. }
  7978. } else {
  7979. spaceAfterMarker = false;
  7980. }
  7981. oldBMarks = [ state.bMarks[startLine] ];
  7982. state.bMarks[startLine] = pos;
  7983. while (pos < max) {
  7984. ch = state.src.charCodeAt(pos);
  7985. if (isSpace(ch)) {
  7986. if (ch === 0x09) {
  7987. offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
  7988. } else {
  7989. offset++;
  7990. }
  7991. } else {
  7992. break;
  7993. }
  7994. pos++;
  7995. }
  7996. oldBSCount = [ state.bsCount[startLine] ];
  7997. state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
  7998. lastLineEmpty = pos >= max;
  7999. oldSCount = [ state.sCount[startLine] ];
  8000. state.sCount[startLine] = offset - initial;
  8001. oldTShift = [ state.tShift[startLine] ];
  8002. state.tShift[startLine] = pos - state.bMarks[startLine];
  8003. terminatorRules = state.md.block.ruler.getRules('blockquote');
  8004. oldParentType = state.parentType;
  8005. state.parentType = 'blockquote';
  8006. // Search the end of the block
  8007. //
  8008. // Block ends with either:
  8009. // 1. an empty line outside:
  8010. // ```
  8011. // > test
  8012. //
  8013. // ```
  8014. // 2. an empty line inside:
  8015. // ```
  8016. // >
  8017. // test
  8018. // ```
  8019. // 3. another tag:
  8020. // ```
  8021. // > test
  8022. // - - -
  8023. // ```
  8024. for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
  8025. // check if it's outdented, i.e. it's inside list item and indented
  8026. // less than said list item:
  8027. //
  8028. // ```
  8029. // 1. anything
  8030. // > current blockquote
  8031. // 2. checking this line
  8032. // ```
  8033. isOutdented = state.sCount[nextLine] < state.blkIndent;
  8034. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8035. max = state.eMarks[nextLine];
  8036. if (pos >= max) {
  8037. // Case 1: line is not inside the blockquote, and this line is empty.
  8038. break;
  8039. }
  8040. if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
  8041. // This line is inside the blockquote.
  8042. // skip spaces after ">" and re-calculate offset
  8043. initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
  8044. // skip one optional space after '>'
  8045. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  8046. // ' > test '
  8047. // ^ -- position start of line here:
  8048. pos++;
  8049. initial++;
  8050. offset++;
  8051. adjustTab = false;
  8052. spaceAfterMarker = true;
  8053. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  8054. spaceAfterMarker = true;
  8055. if ((state.bsCount[nextLine] + offset) % 4 === 3) {
  8056. // ' >\t test '
  8057. // ^ -- position start of line here (tab has width===1)
  8058. pos++;
  8059. initial++;
  8060. offset++;
  8061. adjustTab = false;
  8062. } else {
  8063. // ' >\t test '
  8064. // ^ -- position start of line here + shift bsCount slightly
  8065. // to make extra space appear
  8066. adjustTab = true;
  8067. }
  8068. } else {
  8069. spaceAfterMarker = false;
  8070. }
  8071. oldBMarks.push(state.bMarks[nextLine]);
  8072. state.bMarks[nextLine] = pos;
  8073. while (pos < max) {
  8074. ch = state.src.charCodeAt(pos);
  8075. if (isSpace(ch)) {
  8076. if (ch === 0x09) {
  8077. offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
  8078. } else {
  8079. offset++;
  8080. }
  8081. } else {
  8082. break;
  8083. }
  8084. pos++;
  8085. }
  8086. lastLineEmpty = pos >= max;
  8087. oldBSCount.push(state.bsCount[nextLine]);
  8088. state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
  8089. oldSCount.push(state.sCount[nextLine]);
  8090. state.sCount[nextLine] = offset - initial;
  8091. oldTShift.push(state.tShift[nextLine]);
  8092. state.tShift[nextLine] = pos - state.bMarks[nextLine];
  8093. continue;
  8094. }
  8095. // Case 2: line is not inside the blockquote, and the last line was empty.
  8096. if (lastLineEmpty) { break; }
  8097. // Case 3: another tag found.
  8098. terminate = false;
  8099. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8100. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8101. terminate = true;
  8102. break;
  8103. }
  8104. }
  8105. if (terminate) {
  8106. // Quirk to enforce "hard termination mode" for paragraphs;
  8107. // normally if you call `tokenize(state, startLine, nextLine)`,
  8108. // paragraphs will look below nextLine for paragraph continuation,
  8109. // but if blockquote is terminated by another tag, they shouldn't
  8110. state.lineMax = nextLine;
  8111. if (state.blkIndent !== 0) {
  8112. // state.blkIndent was non-zero, we now set it to zero,
  8113. // so we need to re-calculate all offsets to appear as
  8114. // if indent wasn't changed
  8115. oldBMarks.push(state.bMarks[nextLine]);
  8116. oldBSCount.push(state.bsCount[nextLine]);
  8117. oldTShift.push(state.tShift[nextLine]);
  8118. oldSCount.push(state.sCount[nextLine]);
  8119. state.sCount[nextLine] -= state.blkIndent;
  8120. }
  8121. break;
  8122. }
  8123. if (isOutdented) break;
  8124. oldBMarks.push(state.bMarks[nextLine]);
  8125. oldBSCount.push(state.bsCount[nextLine]);
  8126. oldTShift.push(state.tShift[nextLine]);
  8127. oldSCount.push(state.sCount[nextLine]);
  8128. // A negative indentation means that this is a paragraph continuation
  8129. //
  8130. state.sCount[nextLine] = -1;
  8131. }
  8132. oldIndent = state.blkIndent;
  8133. state.blkIndent = 0;
  8134. token = state.push('blockquote_open', 'blockquote', 1);
  8135. token.markup = '>';
  8136. token.map = lines = [ startLine, 0 ];
  8137. state.md.block.tokenize(state, startLine, nextLine);
  8138. token = state.push('blockquote_close', 'blockquote', -1);
  8139. token.markup = '>';
  8140. state.lineMax = oldLineMax;
  8141. state.parentType = oldParentType;
  8142. lines[1] = state.line;
  8143. // Restore original tShift; this might not be necessary since the parser
  8144. // has already been here, but just to make sure we can do that.
  8145. for (i = 0; i < oldTShift.length; i++) {
  8146. state.bMarks[i + startLine] = oldBMarks[i];
  8147. state.tShift[i + startLine] = oldTShift[i];
  8148. state.sCount[i + startLine] = oldSCount[i];
  8149. state.bsCount[i + startLine] = oldBSCount[i];
  8150. }
  8151. state.blkIndent = oldIndent;
  8152. return true;
  8153. };
  8154. /***/ }),
  8155. /* 46 */
  8156. /***/ (function(module, exports, __webpack_require__) {
  8157. "use strict";
  8158. // Code block (4 spaces padded)
  8159. module.exports = function code(state, startLine, endLine/*, silent*/) {
  8160. var nextLine, last, token;
  8161. if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
  8162. last = nextLine = startLine + 1;
  8163. while (nextLine < endLine) {
  8164. if (state.isEmpty(nextLine)) {
  8165. nextLine++;
  8166. continue;
  8167. }
  8168. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  8169. nextLine++;
  8170. last = nextLine;
  8171. continue;
  8172. }
  8173. break;
  8174. }
  8175. state.line = last;
  8176. token = state.push('code_block', 'code', 0);
  8177. token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
  8178. token.map = [ startLine, state.line ];
  8179. return true;
  8180. };
  8181. /***/ }),
  8182. /* 47 */
  8183. /***/ (function(module, exports, __webpack_require__) {
  8184. "use strict";
  8185. // fences (``` lang, ~~~ lang)
  8186. module.exports = function fence(state, startLine, endLine, silent) {
  8187. var marker, len, params, nextLine, mem, token, markup,
  8188. haveEndMarker = false,
  8189. pos = state.bMarks[startLine] + state.tShift[startLine],
  8190. max = state.eMarks[startLine];
  8191. // if it's indented more than 3 spaces, it should be a code block
  8192. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8193. if (pos + 3 > max) { return false; }
  8194. marker = state.src.charCodeAt(pos);
  8195. if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
  8196. return false;
  8197. }
  8198. // scan marker length
  8199. mem = pos;
  8200. pos = state.skipChars(pos, marker);
  8201. len = pos - mem;
  8202. if (len < 3) { return false; }
  8203. markup = state.src.slice(mem, pos);
  8204. params = state.src.slice(pos, max);
  8205. if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; }
  8206. // Since start is found, we can report success here in validation mode
  8207. if (silent) { return true; }
  8208. // search end of block
  8209. nextLine = startLine;
  8210. for (;;) {
  8211. nextLine++;
  8212. if (nextLine >= endLine) {
  8213. // unclosed block should be autoclosed by end of document.
  8214. // also block seems to be autoclosed by end of parent
  8215. break;
  8216. }
  8217. pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
  8218. max = state.eMarks[nextLine];
  8219. if (pos < max && state.sCount[nextLine] < state.blkIndent) {
  8220. // non-empty line with negative indent should stop the list:
  8221. // - ```
  8222. // test
  8223. break;
  8224. }
  8225. if (state.src.charCodeAt(pos) !== marker) { continue; }
  8226. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  8227. // closing fence should be indented less than 4 spaces
  8228. continue;
  8229. }
  8230. pos = state.skipChars(pos, marker);
  8231. // closing code fence must be at least as long as the opening one
  8232. if (pos - mem < len) { continue; }
  8233. // make sure tail has spaces only
  8234. pos = state.skipSpaces(pos);
  8235. if (pos < max) { continue; }
  8236. haveEndMarker = true;
  8237. // found!
  8238. break;
  8239. }
  8240. // If a fence has heading spaces, they should be removed from its inner block
  8241. len = state.sCount[startLine];
  8242. state.line = nextLine + (haveEndMarker ? 1 : 0);
  8243. token = state.push('fence', 'code', 0);
  8244. token.info = params;
  8245. token.content = state.getLines(startLine + 1, nextLine, len, true);
  8246. token.markup = markup;
  8247. token.map = [ startLine, state.line ];
  8248. return true;
  8249. };
  8250. /***/ }),
  8251. /* 48 */
  8252. /***/ (function(module, exports, __webpack_require__) {
  8253. "use strict";
  8254. // heading (#, ##, ...)
  8255. var isSpace = __webpack_require__(0).isSpace;
  8256. module.exports = function heading(state, startLine, endLine, silent) {
  8257. var ch, level, tmp, token,
  8258. pos = state.bMarks[startLine] + state.tShift[startLine],
  8259. max = state.eMarks[startLine];
  8260. // if it's indented more than 3 spaces, it should be a code block
  8261. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8262. ch = state.src.charCodeAt(pos);
  8263. if (ch !== 0x23/* # */ || pos >= max) { return false; }
  8264. // count heading level
  8265. level = 1;
  8266. ch = state.src.charCodeAt(++pos);
  8267. while (ch === 0x23/* # */ && pos < max && level <= 6) {
  8268. level++;
  8269. ch = state.src.charCodeAt(++pos);
  8270. }
  8271. if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
  8272. if (silent) { return true; }
  8273. // Let's cut tails like ' ### ' from the end of string
  8274. max = state.skipSpacesBack(max, pos);
  8275. tmp = state.skipCharsBack(max, 0x23, pos); // #
  8276. if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
  8277. max = tmp;
  8278. }
  8279. state.line = startLine + 1;
  8280. token = state.push('heading_open', 'h' + String(level), 1);
  8281. token.markup = '########'.slice(0, level);
  8282. token.map = [ startLine, state.line ];
  8283. token = state.push('inline', '', 0);
  8284. token.content = state.src.slice(pos, max).trim();
  8285. token.map = [ startLine, state.line ];
  8286. token.children = [];
  8287. token = state.push('heading_close', 'h' + String(level), -1);
  8288. token.markup = '########'.slice(0, level);
  8289. return true;
  8290. };
  8291. /***/ }),
  8292. /* 49 */
  8293. /***/ (function(module, exports, __webpack_require__) {
  8294. "use strict";
  8295. // Horizontal rule
  8296. var isSpace = __webpack_require__(0).isSpace;
  8297. module.exports = function hr(state, startLine, endLine, silent) {
  8298. var marker, cnt, ch, token,
  8299. pos = state.bMarks[startLine] + state.tShift[startLine],
  8300. max = state.eMarks[startLine];
  8301. // if it's indented more than 3 spaces, it should be a code block
  8302. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8303. marker = state.src.charCodeAt(pos++);
  8304. // Check hr marker
  8305. if (marker !== 0x2A/* * */ &&
  8306. marker !== 0x2D/* - */ &&
  8307. marker !== 0x5F/* _ */) {
  8308. return false;
  8309. }
  8310. // markers can be mixed with spaces, but there should be at least 3 of them
  8311. cnt = 1;
  8312. while (pos < max) {
  8313. ch = state.src.charCodeAt(pos++);
  8314. if (ch !== marker && !isSpace(ch)) { return false; }
  8315. if (ch === marker) { cnt++; }
  8316. }
  8317. if (cnt < 3) { return false; }
  8318. if (silent) { return true; }
  8319. state.line = startLine + 1;
  8320. token = state.push('hr', 'hr', 0);
  8321. token.map = [ startLine, state.line ];
  8322. token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  8323. return true;
  8324. };
  8325. /***/ }),
  8326. /* 50 */
  8327. /***/ (function(module, exports, __webpack_require__) {
  8328. "use strict";
  8329. // HTML block
  8330. var block_names = __webpack_require__(32);
  8331. var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(12).HTML_OPEN_CLOSE_TAG_RE;
  8332. // An array of opening and corresponding closing sequences for html tags,
  8333. // last argument defines whether it can terminate a paragraph or not
  8334. //
  8335. var HTML_SEQUENCES = [
  8336. [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
  8337. [ /^<!--/, /-->/, true ],
  8338. [ /^<\?/, /\?>/, true ],
  8339. [ /^<![A-Z]/, />/, true ],
  8340. [ /^<!\[CDATA\[/, /\]\]>/, true ],
  8341. [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
  8342. [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
  8343. ];
  8344. module.exports = function html_block(state, startLine, endLine, silent) {
  8345. var i, nextLine, token, lineText,
  8346. pos = state.bMarks[startLine] + state.tShift[startLine],
  8347. max = state.eMarks[startLine];
  8348. // if it's indented more than 3 spaces, it should be a code block
  8349. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8350. if (!state.md.options.html) { return false; }
  8351. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  8352. lineText = state.src.slice(pos, max);
  8353. for (i = 0; i < HTML_SEQUENCES.length; i++) {
  8354. if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
  8355. }
  8356. if (i === HTML_SEQUENCES.length) { return false; }
  8357. if (silent) {
  8358. // true if this sequence can be a terminator, false otherwise
  8359. return HTML_SEQUENCES[i][2];
  8360. }
  8361. nextLine = startLine + 1;
  8362. // If we are here - we detected HTML block.
  8363. // Let's roll down till block end.
  8364. if (!HTML_SEQUENCES[i][1].test(lineText)) {
  8365. for (; nextLine < endLine; nextLine++) {
  8366. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8367. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8368. max = state.eMarks[nextLine];
  8369. lineText = state.src.slice(pos, max);
  8370. if (HTML_SEQUENCES[i][1].test(lineText)) {
  8371. if (lineText.length !== 0) { nextLine++; }
  8372. break;
  8373. }
  8374. }
  8375. }
  8376. state.line = nextLine;
  8377. token = state.push('html_block', '', 0);
  8378. token.map = [ startLine, nextLine ];
  8379. token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  8380. return true;
  8381. };
  8382. /***/ }),
  8383. /* 51 */
  8384. /***/ (function(module, exports, __webpack_require__) {
  8385. "use strict";
  8386. // lheading (---, ===)
  8387. module.exports = function lheading(state, startLine, endLine/*, silent*/) {
  8388. var content, terminate, i, l, token, pos, max, level, marker,
  8389. nextLine = startLine + 1, oldParentType,
  8390. terminatorRules = state.md.block.ruler.getRules('paragraph');
  8391. // if it's indented more than 3 spaces, it should be a code block
  8392. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8393. oldParentType = state.parentType;
  8394. state.parentType = 'paragraph'; // use paragraph to match terminatorRules
  8395. // jump line-by-line until empty one or EOF
  8396. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8397. // this would be a code block normally, but after paragraph
  8398. // it's considered a lazy continuation regardless of what's there
  8399. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8400. //
  8401. // Check for underline in setext header
  8402. //
  8403. if (state.sCount[nextLine] >= state.blkIndent) {
  8404. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8405. max = state.eMarks[nextLine];
  8406. if (pos < max) {
  8407. marker = state.src.charCodeAt(pos);
  8408. if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
  8409. pos = state.skipChars(pos, marker);
  8410. pos = state.skipSpaces(pos);
  8411. if (pos >= max) {
  8412. level = (marker === 0x3D/* = */ ? 1 : 2);
  8413. break;
  8414. }
  8415. }
  8416. }
  8417. }
  8418. // quirk for blockquotes, this line should already be checked by that rule
  8419. if (state.sCount[nextLine] < 0) { continue; }
  8420. // Some tags can terminate paragraph without empty line.
  8421. terminate = false;
  8422. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8423. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8424. terminate = true;
  8425. break;
  8426. }
  8427. }
  8428. if (terminate) { break; }
  8429. }
  8430. if (!level) {
  8431. // Didn't find valid underline
  8432. return false;
  8433. }
  8434. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8435. state.line = nextLine + 1;
  8436. token = state.push('heading_open', 'h' + String(level), 1);
  8437. token.markup = String.fromCharCode(marker);
  8438. token.map = [ startLine, state.line ];
  8439. token = state.push('inline', '', 0);
  8440. token.content = content;
  8441. token.map = [ startLine, state.line - 1 ];
  8442. token.children = [];
  8443. token = state.push('heading_close', 'h' + String(level), -1);
  8444. token.markup = String.fromCharCode(marker);
  8445. state.parentType = oldParentType;
  8446. return true;
  8447. };
  8448. /***/ }),
  8449. /* 52 */
  8450. /***/ (function(module, exports, __webpack_require__) {
  8451. "use strict";
  8452. // Lists
  8453. var isSpace = __webpack_require__(0).isSpace;
  8454. // Search `[-+*][\n ]`, returns next pos arter marker on success
  8455. // or -1 on fail.
  8456. function skipBulletListMarker(state, startLine) {
  8457. var marker, pos, max, ch;
  8458. pos = state.bMarks[startLine] + state.tShift[startLine];
  8459. max = state.eMarks[startLine];
  8460. marker = state.src.charCodeAt(pos++);
  8461. // Check bullet
  8462. if (marker !== 0x2A/* * */ &&
  8463. marker !== 0x2D/* - */ &&
  8464. marker !== 0x2B/* + */) {
  8465. return -1;
  8466. }
  8467. if (pos < max) {
  8468. ch = state.src.charCodeAt(pos);
  8469. if (!isSpace(ch)) {
  8470. // " -test " - is not a list item
  8471. return -1;
  8472. }
  8473. }
  8474. return pos;
  8475. }
  8476. // Search `\d+[.)][\n ]`, returns next pos arter marker on success
  8477. // or -1 on fail.
  8478. function skipOrderedListMarker(state, startLine) {
  8479. var ch,
  8480. start = state.bMarks[startLine] + state.tShift[startLine],
  8481. pos = start,
  8482. max = state.eMarks[startLine];
  8483. // List marker should have at least 2 chars (digit + dot)
  8484. if (pos + 1 >= max) { return -1; }
  8485. ch = state.src.charCodeAt(pos++);
  8486. if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
  8487. for (;;) {
  8488. // EOL -> fail
  8489. if (pos >= max) { return -1; }
  8490. ch = state.src.charCodeAt(pos++);
  8491. if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
  8492. // List marker should have no more than 9 digits
  8493. // (prevents integer overflow in browsers)
  8494. if (pos - start >= 10) { return -1; }
  8495. continue;
  8496. }
  8497. // found valid marker
  8498. if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
  8499. break;
  8500. }
  8501. return -1;
  8502. }
  8503. if (pos < max) {
  8504. ch = state.src.charCodeAt(pos);
  8505. if (!isSpace(ch)) {
  8506. // " 1.test " - is not a list item
  8507. return -1;
  8508. }
  8509. }
  8510. return pos;
  8511. }
  8512. function markTightParagraphs(state, idx) {
  8513. var i, l,
  8514. level = state.level + 2;
  8515. for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
  8516. if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
  8517. state.tokens[i + 2].hidden = true;
  8518. state.tokens[i].hidden = true;
  8519. i += 2;
  8520. }
  8521. }
  8522. }
  8523. module.exports = function list(state, startLine, endLine, silent) {
  8524. var ch,
  8525. contentStart,
  8526. i,
  8527. indent,
  8528. indentAfterMarker,
  8529. initial,
  8530. isOrdered,
  8531. itemLines,
  8532. l,
  8533. listLines,
  8534. listTokIdx,
  8535. markerCharCode,
  8536. markerValue,
  8537. max,
  8538. nextLine,
  8539. offset,
  8540. oldIndent,
  8541. oldLIndent,
  8542. oldParentType,
  8543. oldTShift,
  8544. oldTight,
  8545. pos,
  8546. posAfterMarker,
  8547. prevEmptyEnd,
  8548. start,
  8549. terminate,
  8550. terminatorRules,
  8551. token,
  8552. isTerminatingParagraph = false,
  8553. tight = true;
  8554. // if it's indented more than 3 spaces, it should be a code block
  8555. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8556. // limit conditions when list can interrupt
  8557. // a paragraph (validation mode only)
  8558. if (silent && state.parentType === 'paragraph') {
  8559. // Next list item should still terminate previous list item;
  8560. //
  8561. // This code can fail if plugins use blkIndent as well as lists,
  8562. // but I hope the spec gets fixed long before that happens.
  8563. //
  8564. if (state.tShift[startLine] >= state.blkIndent) {
  8565. isTerminatingParagraph = true;
  8566. }
  8567. }
  8568. // Detect list type and position after marker
  8569. if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
  8570. isOrdered = true;
  8571. start = state.bMarks[startLine] + state.tShift[startLine];
  8572. markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
  8573. // If we're starting a new ordered list right after
  8574. // a paragraph, it should start with 1.
  8575. if (isTerminatingParagraph && markerValue !== 1) return false;
  8576. } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
  8577. isOrdered = false;
  8578. } else {
  8579. return false;
  8580. }
  8581. // If we're starting a new unordered list right after
  8582. // a paragraph, first line should not be empty.
  8583. if (isTerminatingParagraph) {
  8584. if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
  8585. }
  8586. // We should terminate list on style change. Remember first one to compare.
  8587. markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  8588. // For validation mode we can terminate immediately
  8589. if (silent) { return true; }
  8590. // Start list
  8591. listTokIdx = state.tokens.length;
  8592. if (isOrdered) {
  8593. token = state.push('ordered_list_open', 'ol', 1);
  8594. if (markerValue !== 1) {
  8595. token.attrs = [ [ 'start', markerValue ] ];
  8596. }
  8597. } else {
  8598. token = state.push('bullet_list_open', 'ul', 1);
  8599. }
  8600. token.map = listLines = [ startLine, 0 ];
  8601. token.markup = String.fromCharCode(markerCharCode);
  8602. //
  8603. // Iterate list items
  8604. //
  8605. nextLine = startLine;
  8606. prevEmptyEnd = false;
  8607. terminatorRules = state.md.block.ruler.getRules('list');
  8608. oldParentType = state.parentType;
  8609. state.parentType = 'list';
  8610. while (nextLine < endLine) {
  8611. pos = posAfterMarker;
  8612. max = state.eMarks[nextLine];
  8613. initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
  8614. while (pos < max) {
  8615. ch = state.src.charCodeAt(pos);
  8616. if (isSpace(ch)) {
  8617. if (ch === 0x09) {
  8618. offset += 4 - (offset + state.bsCount[nextLine]) % 4;
  8619. } else {
  8620. offset++;
  8621. }
  8622. } else {
  8623. break;
  8624. }
  8625. pos++;
  8626. }
  8627. contentStart = pos;
  8628. if (contentStart >= max) {
  8629. // trimming space in "- \n 3" case, indent is 1 here
  8630. indentAfterMarker = 1;
  8631. } else {
  8632. indentAfterMarker = offset - initial;
  8633. }
  8634. // If we have more than 4 spaces, the indent is 1
  8635. // (the rest is just indented code block)
  8636. if (indentAfterMarker > 4) { indentAfterMarker = 1; }
  8637. // " - test"
  8638. // ^^^^^ - calculating total length of this thing
  8639. indent = initial + indentAfterMarker;
  8640. // Run subparser & write tokens
  8641. token = state.push('list_item_open', 'li', 1);
  8642. token.markup = String.fromCharCode(markerCharCode);
  8643. token.map = itemLines = [ startLine, 0 ];
  8644. oldIndent = state.blkIndent;
  8645. oldTight = state.tight;
  8646. oldTShift = state.tShift[startLine];
  8647. oldLIndent = state.sCount[startLine];
  8648. state.blkIndent = indent;
  8649. state.tight = true;
  8650. state.tShift[startLine] = contentStart - state.bMarks[startLine];
  8651. state.sCount[startLine] = offset;
  8652. if (contentStart >= max && state.isEmpty(startLine + 1)) {
  8653. // workaround for this case
  8654. // (list item is empty, list terminates before "foo"):
  8655. // ~~~~~~~~
  8656. // -
  8657. //
  8658. // foo
  8659. // ~~~~~~~~
  8660. state.line = Math.min(state.line + 2, endLine);
  8661. } else {
  8662. state.md.block.tokenize(state, startLine, endLine, true);
  8663. }
  8664. // If any of list item is tight, mark list as tight
  8665. if (!state.tight || prevEmptyEnd) {
  8666. tight = false;
  8667. }
  8668. // Item become loose if finish with empty line,
  8669. // but we should filter last element, because it means list finish
  8670. prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
  8671. state.blkIndent = oldIndent;
  8672. state.tShift[startLine] = oldTShift;
  8673. state.sCount[startLine] = oldLIndent;
  8674. state.tight = oldTight;
  8675. token = state.push('list_item_close', 'li', -1);
  8676. token.markup = String.fromCharCode(markerCharCode);
  8677. nextLine = startLine = state.line;
  8678. itemLines[1] = nextLine;
  8679. contentStart = state.bMarks[startLine];
  8680. if (nextLine >= endLine) { break; }
  8681. //
  8682. // Try to check if list is terminated or continued.
  8683. //
  8684. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8685. // fail if terminating block found
  8686. terminate = false;
  8687. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8688. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8689. terminate = true;
  8690. break;
  8691. }
  8692. }
  8693. if (terminate) { break; }
  8694. // fail if list has another type
  8695. if (isOrdered) {
  8696. posAfterMarker = skipOrderedListMarker(state, nextLine);
  8697. if (posAfterMarker < 0) { break; }
  8698. } else {
  8699. posAfterMarker = skipBulletListMarker(state, nextLine);
  8700. if (posAfterMarker < 0) { break; }
  8701. }
  8702. if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
  8703. }
  8704. // Finilize list
  8705. if (isOrdered) {
  8706. token = state.push('ordered_list_close', 'ol', -1);
  8707. } else {
  8708. token = state.push('bullet_list_close', 'ul', -1);
  8709. }
  8710. token.markup = String.fromCharCode(markerCharCode);
  8711. listLines[1] = nextLine;
  8712. state.line = nextLine;
  8713. state.parentType = oldParentType;
  8714. // mark paragraphs tight if needed
  8715. if (tight) {
  8716. markTightParagraphs(state, listTokIdx);
  8717. }
  8718. return true;
  8719. };
  8720. /***/ }),
  8721. /* 53 */
  8722. /***/ (function(module, exports, __webpack_require__) {
  8723. "use strict";
  8724. // Paragraph
  8725. module.exports = function paragraph(state, startLine/*, endLine*/) {
  8726. var content, terminate, i, l, token, oldParentType,
  8727. nextLine = startLine + 1,
  8728. terminatorRules = state.md.block.ruler.getRules('paragraph'),
  8729. endLine = state.lineMax;
  8730. oldParentType = state.parentType;
  8731. state.parentType = 'paragraph';
  8732. // jump line-by-line until empty one or EOF
  8733. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8734. // this would be a code block normally, but after paragraph
  8735. // it's considered a lazy continuation regardless of what's there
  8736. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8737. // quirk for blockquotes, this line should already be checked by that rule
  8738. if (state.sCount[nextLine] < 0) { continue; }
  8739. // Some tags can terminate paragraph without empty line.
  8740. terminate = false;
  8741. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8742. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8743. terminate = true;
  8744. break;
  8745. }
  8746. }
  8747. if (terminate) { break; }
  8748. }
  8749. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8750. state.line = nextLine;
  8751. token = state.push('paragraph_open', 'p', 1);
  8752. token.map = [ startLine, state.line ];
  8753. token = state.push('inline', '', 0);
  8754. token.content = content;
  8755. token.map = [ startLine, state.line ];
  8756. token.children = [];
  8757. token = state.push('paragraph_close', 'p', -1);
  8758. state.parentType = oldParentType;
  8759. return true;
  8760. };
  8761. /***/ }),
  8762. /* 54 */
  8763. /***/ (function(module, exports, __webpack_require__) {
  8764. "use strict";
  8765. var normalizeReference = __webpack_require__(0).normalizeReference;
  8766. var isSpace = __webpack_require__(0).isSpace;
  8767. module.exports = function reference(state, startLine, _endLine, silent) {
  8768. var ch,
  8769. destEndPos,
  8770. destEndLineNo,
  8771. endLine,
  8772. href,
  8773. i,
  8774. l,
  8775. label,
  8776. labelEnd,
  8777. oldParentType,
  8778. res,
  8779. start,
  8780. str,
  8781. terminate,
  8782. terminatorRules,
  8783. title,
  8784. lines = 0,
  8785. pos = state.bMarks[startLine] + state.tShift[startLine],
  8786. max = state.eMarks[startLine],
  8787. nextLine = startLine + 1;
  8788. // if it's indented more than 3 spaces, it should be a code block
  8789. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8790. if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
  8791. // Simple check to quickly interrupt scan on [link](url) at the start of line.
  8792. // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
  8793. while (++pos < max) {
  8794. if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
  8795. state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
  8796. if (pos + 1 === max) { return false; }
  8797. if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
  8798. break;
  8799. }
  8800. }
  8801. endLine = state.lineMax;
  8802. // jump line-by-line until empty one or EOF
  8803. terminatorRules = state.md.block.ruler.getRules('reference');
  8804. oldParentType = state.parentType;
  8805. state.parentType = 'reference';
  8806. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8807. // this would be a code block normally, but after paragraph
  8808. // it's considered a lazy continuation regardless of what's there
  8809. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8810. // quirk for blockquotes, this line should already be checked by that rule
  8811. if (state.sCount[nextLine] < 0) { continue; }
  8812. // Some tags can terminate paragraph without empty line.
  8813. terminate = false;
  8814. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8815. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8816. terminate = true;
  8817. break;
  8818. }
  8819. }
  8820. if (terminate) { break; }
  8821. }
  8822. str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8823. max = str.length;
  8824. for (pos = 1; pos < max; pos++) {
  8825. ch = str.charCodeAt(pos);
  8826. if (ch === 0x5B /* [ */) {
  8827. return false;
  8828. } else if (ch === 0x5D /* ] */) {
  8829. labelEnd = pos;
  8830. break;
  8831. } else if (ch === 0x0A /* \n */) {
  8832. lines++;
  8833. } else if (ch === 0x5C /* \ */) {
  8834. pos++;
  8835. if (pos < max && str.charCodeAt(pos) === 0x0A) {
  8836. lines++;
  8837. }
  8838. }
  8839. }
  8840. if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
  8841. // [label]: destination 'title'
  8842. // ^^^ skip optional whitespace here
  8843. for (pos = labelEnd + 2; pos < max; pos++) {
  8844. ch = str.charCodeAt(pos);
  8845. if (ch === 0x0A) {
  8846. lines++;
  8847. } else if (isSpace(ch)) {
  8848. /*eslint no-empty:0*/
  8849. } else {
  8850. break;
  8851. }
  8852. }
  8853. // [label]: destination 'title'
  8854. // ^^^^^^^^^^^ parse this
  8855. res = state.md.helpers.parseLinkDestination(str, pos, max);
  8856. if (!res.ok) { return false; }
  8857. href = state.md.normalizeLink(res.str);
  8858. if (!state.md.validateLink(href)) { return false; }
  8859. pos = res.pos;
  8860. lines += res.lines;
  8861. // save cursor state, we could require to rollback later
  8862. destEndPos = pos;
  8863. destEndLineNo = lines;
  8864. // [label]: destination 'title'
  8865. // ^^^ skipping those spaces
  8866. start = pos;
  8867. for (; pos < max; pos++) {
  8868. ch = str.charCodeAt(pos);
  8869. if (ch === 0x0A) {
  8870. lines++;
  8871. } else if (isSpace(ch)) {
  8872. /*eslint no-empty:0*/
  8873. } else {
  8874. break;
  8875. }
  8876. }
  8877. // [label]: destination 'title'
  8878. // ^^^^^^^ parse this
  8879. res = state.md.helpers.parseLinkTitle(str, pos, max);
  8880. if (pos < max && start !== pos && res.ok) {
  8881. title = res.str;
  8882. pos = res.pos;
  8883. lines += res.lines;
  8884. } else {
  8885. title = '';
  8886. pos = destEndPos;
  8887. lines = destEndLineNo;
  8888. }
  8889. // skip trailing spaces until the rest of the line
  8890. while (pos < max) {
  8891. ch = str.charCodeAt(pos);
  8892. if (!isSpace(ch)) { break; }
  8893. pos++;
  8894. }
  8895. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8896. if (title) {
  8897. // garbage at the end of the line after title,
  8898. // but it could still be a valid reference if we roll back
  8899. title = '';
  8900. pos = destEndPos;
  8901. lines = destEndLineNo;
  8902. while (pos < max) {
  8903. ch = str.charCodeAt(pos);
  8904. if (!isSpace(ch)) { break; }
  8905. pos++;
  8906. }
  8907. }
  8908. }
  8909. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8910. // garbage at the end of the line
  8911. return false;
  8912. }
  8913. label = normalizeReference(str.slice(1, labelEnd));
  8914. if (!label) {
  8915. // CommonMark 0.20 disallows empty labels
  8916. return false;
  8917. }
  8918. // Reference can not terminate anything. This check is for safety only.
  8919. /*istanbul ignore if*/
  8920. if (silent) { return true; }
  8921. if (typeof state.env.references === 'undefined') {
  8922. state.env.references = {};
  8923. }
  8924. if (typeof state.env.references[label] === 'undefined') {
  8925. state.env.references[label] = { title: title, href: href };
  8926. }
  8927. state.parentType = oldParentType;
  8928. state.line = startLine + lines + 1;
  8929. return true;
  8930. };
  8931. /***/ }),
  8932. /* 55 */
  8933. /***/ (function(module, exports, __webpack_require__) {
  8934. "use strict";
  8935. // Parser state class
  8936. var Token = __webpack_require__(4);
  8937. var isSpace = __webpack_require__(0).isSpace;
  8938. function StateBlock(src, md, env, tokens) {
  8939. var ch, s, start, pos, len, indent, offset, indent_found;
  8940. this.src = src;
  8941. // link to parser instance
  8942. this.md = md;
  8943. this.env = env;
  8944. //
  8945. // Internal state vartiables
  8946. //
  8947. this.tokens = tokens;
  8948. this.bMarks = []; // line begin offsets for fast jumps
  8949. this.eMarks = []; // line end offsets for fast jumps
  8950. this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
  8951. this.sCount = []; // indents for each line (tabs expanded)
  8952. // An amount of virtual spaces (tabs expanded) between beginning
  8953. // of each line (bMarks) and real beginning of that line.
  8954. //
  8955. // It exists only as a hack because blockquotes override bMarks
  8956. // losing information in the process.
  8957. //
  8958. // It's used only when expanding tabs, you can think about it as
  8959. // an initial tab length, e.g. bsCount=21 applied to string `\t123`
  8960. // means first tab should be expanded to 4-21%4 === 3 spaces.
  8961. //
  8962. this.bsCount = [];
  8963. // block parser variables
  8964. this.blkIndent = 0; // required block content indent
  8965. // (for example, if we are in list)
  8966. this.line = 0; // line index in src
  8967. this.lineMax = 0; // lines count
  8968. this.tight = false; // loose/tight mode for lists
  8969. this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
  8970. // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
  8971. // used in lists to determine if they interrupt a paragraph
  8972. this.parentType = 'root';
  8973. this.level = 0;
  8974. // renderer
  8975. this.result = '';
  8976. // Create caches
  8977. // Generate markers.
  8978. s = this.src;
  8979. indent_found = false;
  8980. for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
  8981. ch = s.charCodeAt(pos);
  8982. if (!indent_found) {
  8983. if (isSpace(ch)) {
  8984. indent++;
  8985. if (ch === 0x09) {
  8986. offset += 4 - offset % 4;
  8987. } else {
  8988. offset++;
  8989. }
  8990. continue;
  8991. } else {
  8992. indent_found = true;
  8993. }
  8994. }
  8995. if (ch === 0x0A || pos === len - 1) {
  8996. if (ch !== 0x0A) { pos++; }
  8997. this.bMarks.push(start);
  8998. this.eMarks.push(pos);
  8999. this.tShift.push(indent);
  9000. this.sCount.push(offset);
  9001. this.bsCount.push(0);
  9002. indent_found = false;
  9003. indent = 0;
  9004. offset = 0;
  9005. start = pos + 1;
  9006. }
  9007. }
  9008. // Push fake entry to simplify cache bounds checks
  9009. this.bMarks.push(s.length);
  9010. this.eMarks.push(s.length);
  9011. this.tShift.push(0);
  9012. this.sCount.push(0);
  9013. this.bsCount.push(0);
  9014. this.lineMax = this.bMarks.length - 1; // don't count last fake line
  9015. }
  9016. // Push new token to "stream".
  9017. //
  9018. StateBlock.prototype.push = function (type, tag, nesting) {
  9019. var token = new Token(type, tag, nesting);
  9020. token.block = true;
  9021. if (nesting < 0) { this.level--; }
  9022. token.level = this.level;
  9023. if (nesting > 0) { this.level++; }
  9024. this.tokens.push(token);
  9025. return token;
  9026. };
  9027. StateBlock.prototype.isEmpty = function isEmpty(line) {
  9028. return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
  9029. };
  9030. StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
  9031. for (var max = this.lineMax; from < max; from++) {
  9032. if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
  9033. break;
  9034. }
  9035. }
  9036. return from;
  9037. };
  9038. // Skip spaces from given position.
  9039. StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
  9040. var ch;
  9041. for (var max = this.src.length; pos < max; pos++) {
  9042. ch = this.src.charCodeAt(pos);
  9043. if (!isSpace(ch)) { break; }
  9044. }
  9045. return pos;
  9046. };
  9047. // Skip spaces from given position in reverse.
  9048. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
  9049. if (pos <= min) { return pos; }
  9050. while (pos > min) {
  9051. if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
  9052. }
  9053. return pos;
  9054. };
  9055. // Skip char codes from given position
  9056. StateBlock.prototype.skipChars = function skipChars(pos, code) {
  9057. for (var max = this.src.length; pos < max; pos++) {
  9058. if (this.src.charCodeAt(pos) !== code) { break; }
  9059. }
  9060. return pos;
  9061. };
  9062. // Skip char codes reverse from given position - 1
  9063. StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
  9064. if (pos <= min) { return pos; }
  9065. while (pos > min) {
  9066. if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
  9067. }
  9068. return pos;
  9069. };
  9070. // cut lines range from source.
  9071. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
  9072. var i, lineIndent, ch, first, last, queue, lineStart,
  9073. line = begin;
  9074. if (begin >= end) {
  9075. return '';
  9076. }
  9077. queue = new Array(end - begin);
  9078. for (i = 0; line < end; line++, i++) {
  9079. lineIndent = 0;
  9080. lineStart = first = this.bMarks[line];
  9081. if (line + 1 < end || keepLastLF) {
  9082. // No need for bounds check because we have fake entry on tail.
  9083. last = this.eMarks[line] + 1;
  9084. } else {
  9085. last = this.eMarks[line];
  9086. }
  9087. while (first < last && lineIndent < indent) {
  9088. ch = this.src.charCodeAt(first);
  9089. if (isSpace(ch)) {
  9090. if (ch === 0x09) {
  9091. lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
  9092. } else {
  9093. lineIndent++;
  9094. }
  9095. } else if (first - lineStart < this.tShift[line]) {
  9096. // patched tShift masked characters to look like spaces (blockquotes, list markers)
  9097. lineIndent++;
  9098. } else {
  9099. break;
  9100. }
  9101. first++;
  9102. }
  9103. if (lineIndent > indent) {
  9104. // partially expanding tabs in code blocks, e.g '\t\tfoobar'
  9105. // with indent=2 becomes ' \tfoobar'
  9106. queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
  9107. } else {
  9108. queue[i] = this.src.slice(first, last);
  9109. }
  9110. }
  9111. return queue.join('');
  9112. };
  9113. // re-export Token class to use in block rules
  9114. StateBlock.prototype.Token = Token;
  9115. module.exports = StateBlock;
  9116. /***/ }),
  9117. /* 56 */
  9118. /***/ (function(module, exports, __webpack_require__) {
  9119. "use strict";
  9120. // GFM table, non-standard
  9121. var isSpace = __webpack_require__(0).isSpace;
  9122. function getLine(state, line) {
  9123. var pos = state.bMarks[line] + state.blkIndent,
  9124. max = state.eMarks[line];
  9125. return state.src.substr(pos, max - pos);
  9126. }
  9127. function escapedSplit(str) {
  9128. var result = [],
  9129. pos = 0,
  9130. max = str.length,
  9131. ch,
  9132. escapes = 0,
  9133. lastPos = 0,
  9134. backTicked = false,
  9135. lastBackTick = 0;
  9136. ch = str.charCodeAt(pos);
  9137. while (pos < max) {
  9138. if (ch === 0x60/* ` */) {
  9139. if (backTicked) {
  9140. // make \` close code sequence, but not open it;
  9141. // the reason is: `\` is correct code block
  9142. backTicked = false;
  9143. lastBackTick = pos;
  9144. } else if (escapes % 2 === 0) {
  9145. backTicked = true;
  9146. lastBackTick = pos;
  9147. }
  9148. } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
  9149. result.push(str.substring(lastPos, pos));
  9150. lastPos = pos + 1;
  9151. }
  9152. if (ch === 0x5c/* \ */) {
  9153. escapes++;
  9154. } else {
  9155. escapes = 0;
  9156. }
  9157. pos++;
  9158. // If there was an un-closed backtick, go back to just after
  9159. // the last backtick, but as if it was a normal character
  9160. if (pos === max && backTicked) {
  9161. backTicked = false;
  9162. pos = lastBackTick + 1;
  9163. }
  9164. ch = str.charCodeAt(pos);
  9165. }
  9166. result.push(str.substring(lastPos));
  9167. return result;
  9168. }
  9169. module.exports = function table(state, startLine, endLine, silent) {
  9170. var ch, lineText, pos, i, nextLine, columns, columnCount, token,
  9171. aligns, t, tableLines, tbodyLines;
  9172. // should have at least two lines
  9173. if (startLine + 2 > endLine) { return false; }
  9174. nextLine = startLine + 1;
  9175. if (state.sCount[nextLine] < state.blkIndent) { return false; }
  9176. // if it's indented more than 3 spaces, it should be a code block
  9177. if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
  9178. // first character of the second line should be '|', '-', ':',
  9179. // and no other characters are allowed but spaces;
  9180. // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
  9181. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  9182. if (pos >= state.eMarks[nextLine]) { return false; }
  9183. ch = state.src.charCodeAt(pos++);
  9184. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
  9185. while (pos < state.eMarks[nextLine]) {
  9186. ch = state.src.charCodeAt(pos);
  9187. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
  9188. pos++;
  9189. }
  9190. lineText = getLine(state, startLine + 1);
  9191. columns = lineText.split('|');
  9192. aligns = [];
  9193. for (i = 0; i < columns.length; i++) {
  9194. t = columns[i].trim();
  9195. if (!t) {
  9196. // allow empty columns before and after table, but not in between columns;
  9197. // e.g. allow ` |---| `, disallow ` ---||--- `
  9198. if (i === 0 || i === columns.length - 1) {
  9199. continue;
  9200. } else {
  9201. return false;
  9202. }
  9203. }
  9204. if (!/^:?-+:?$/.test(t)) { return false; }
  9205. if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
  9206. aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
  9207. } else if (t.charCodeAt(0) === 0x3A/* : */) {
  9208. aligns.push('left');
  9209. } else {
  9210. aligns.push('');
  9211. }
  9212. }
  9213. lineText = getLine(state, startLine).trim();
  9214. if (lineText.indexOf('|') === -1) { return false; }
  9215. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  9216. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9217. // header row will define an amount of columns in the entire table,
  9218. // and align row shouldn't be smaller than that (the rest of the rows can)
  9219. columnCount = columns.length;
  9220. if (columnCount > aligns.length) { return false; }
  9221. if (silent) { return true; }
  9222. token = state.push('table_open', 'table', 1);
  9223. token.map = tableLines = [ startLine, 0 ];
  9224. token = state.push('thead_open', 'thead', 1);
  9225. token.map = [ startLine, startLine + 1 ];
  9226. token = state.push('tr_open', 'tr', 1);
  9227. token.map = [ startLine, startLine + 1 ];
  9228. for (i = 0; i < columns.length; i++) {
  9229. token = state.push('th_open', 'th', 1);
  9230. token.map = [ startLine, startLine + 1 ];
  9231. if (aligns[i]) {
  9232. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9233. }
  9234. token = state.push('inline', '', 0);
  9235. token.content = columns[i].trim();
  9236. token.map = [ startLine, startLine + 1 ];
  9237. token.children = [];
  9238. token = state.push('th_close', 'th', -1);
  9239. }
  9240. token = state.push('tr_close', 'tr', -1);
  9241. token = state.push('thead_close', 'thead', -1);
  9242. token = state.push('tbody_open', 'tbody', 1);
  9243. token.map = tbodyLines = [ startLine + 2, 0 ];
  9244. for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
  9245. if (state.sCount[nextLine] < state.blkIndent) { break; }
  9246. lineText = getLine(state, nextLine).trim();
  9247. if (lineText.indexOf('|') === -1) { break; }
  9248. if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
  9249. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9250. token = state.push('tr_open', 'tr', 1);
  9251. for (i = 0; i < columnCount; i++) {
  9252. token = state.push('td_open', 'td', 1);
  9253. if (aligns[i]) {
  9254. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9255. }
  9256. token = state.push('inline', '', 0);
  9257. token.content = columns[i] ? columns[i].trim() : '';
  9258. token.children = [];
  9259. token = state.push('td_close', 'td', -1);
  9260. }
  9261. token = state.push('tr_close', 'tr', -1);
  9262. }
  9263. token = state.push('tbody_close', 'tbody', -1);
  9264. token = state.push('table_close', 'table', -1);
  9265. tableLines[1] = tbodyLines[1] = nextLine;
  9266. state.line = nextLine;
  9267. return true;
  9268. };
  9269. /***/ }),
  9270. /* 57 */
  9271. /***/ (function(module, exports, __webpack_require__) {
  9272. "use strict";
  9273. module.exports = function block(state) {
  9274. var token;
  9275. if (state.inlineMode) {
  9276. token = new state.Token('inline', '', 0);
  9277. token.content = state.src;
  9278. token.map = [ 0, 1 ];
  9279. token.children = [];
  9280. state.tokens.push(token);
  9281. } else {
  9282. state.md.block.parse(state.src, state.md, state.env, state.tokens);
  9283. }
  9284. };
  9285. /***/ }),
  9286. /* 58 */
  9287. /***/ (function(module, exports, __webpack_require__) {
  9288. "use strict";
  9289. module.exports = function inline(state) {
  9290. var tokens = state.tokens, tok, i, l;
  9291. // Parse inlines
  9292. for (i = 0, l = tokens.length; i < l; i++) {
  9293. tok = tokens[i];
  9294. if (tok.type === 'inline') {
  9295. state.md.inline.parse(tok.content, state.md, state.env, tok.children);
  9296. }
  9297. }
  9298. };
  9299. /***/ }),
  9300. /* 59 */
  9301. /***/ (function(module, exports, __webpack_require__) {
  9302. "use strict";
  9303. // Replace link-like texts with link nodes.
  9304. //
  9305. // Currently restricted by `md.validateLink()` to http/https/ftp
  9306. //
  9307. var arrayReplaceAt = __webpack_require__(0).arrayReplaceAt;
  9308. function isLinkOpen(str) {
  9309. return /^<a[>\s]/i.test(str);
  9310. }
  9311. function isLinkClose(str) {
  9312. return /^<\/a\s*>/i.test(str);
  9313. }
  9314. module.exports = function linkify(state) {
  9315. var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
  9316. level, htmlLinkLevel, url, fullUrl, urlText,
  9317. blockTokens = state.tokens,
  9318. links;
  9319. if (!state.md.options.linkify) { return; }
  9320. for (j = 0, l = blockTokens.length; j < l; j++) {
  9321. if (blockTokens[j].type !== 'inline' ||
  9322. !state.md.linkify.pretest(blockTokens[j].content)) {
  9323. continue;
  9324. }
  9325. tokens = blockTokens[j].children;
  9326. htmlLinkLevel = 0;
  9327. // We scan from the end, to keep position when new tags added.
  9328. // Use reversed logic in links start/end match
  9329. for (i = tokens.length - 1; i >= 0; i--) {
  9330. currentToken = tokens[i];
  9331. // Skip content of markdown links
  9332. if (currentToken.type === 'link_close') {
  9333. i--;
  9334. while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
  9335. i--;
  9336. }
  9337. continue;
  9338. }
  9339. // Skip content of html tag links
  9340. if (currentToken.type === 'html_inline') {
  9341. if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
  9342. htmlLinkLevel--;
  9343. }
  9344. if (isLinkClose(currentToken.content)) {
  9345. htmlLinkLevel++;
  9346. }
  9347. }
  9348. if (htmlLinkLevel > 0) { continue; }
  9349. if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
  9350. text = currentToken.content;
  9351. links = state.md.linkify.match(text);
  9352. // Now split string to nodes
  9353. nodes = [];
  9354. level = currentToken.level;
  9355. lastPos = 0;
  9356. for (ln = 0; ln < links.length; ln++) {
  9357. url = links[ln].url;
  9358. fullUrl = state.md.normalizeLink(url);
  9359. if (!state.md.validateLink(fullUrl)) { continue; }
  9360. urlText = links[ln].text;
  9361. // Linkifier might send raw hostnames like "example.com", where url
  9362. // starts with domain name. So we prepend http:// in those cases,
  9363. // and remove it afterwards.
  9364. //
  9365. if (!links[ln].schema) {
  9366. urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
  9367. } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
  9368. urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
  9369. } else {
  9370. urlText = state.md.normalizeLinkText(urlText);
  9371. }
  9372. pos = links[ln].index;
  9373. if (pos > lastPos) {
  9374. token = new state.Token('text', '', 0);
  9375. token.content = text.slice(lastPos, pos);
  9376. token.level = level;
  9377. nodes.push(token);
  9378. }
  9379. token = new state.Token('link_open', 'a', 1);
  9380. token.attrs = [ [ 'href', fullUrl ] ];
  9381. token.level = level++;
  9382. token.markup = 'linkify';
  9383. token.info = 'auto';
  9384. nodes.push(token);
  9385. token = new state.Token('text', '', 0);
  9386. token.content = urlText;
  9387. token.level = level;
  9388. nodes.push(token);
  9389. token = new state.Token('link_close', 'a', -1);
  9390. token.level = --level;
  9391. token.markup = 'linkify';
  9392. token.info = 'auto';
  9393. nodes.push(token);
  9394. lastPos = links[ln].lastIndex;
  9395. }
  9396. if (lastPos < text.length) {
  9397. token = new state.Token('text', '', 0);
  9398. token.content = text.slice(lastPos);
  9399. token.level = level;
  9400. nodes.push(token);
  9401. }
  9402. // replace current node
  9403. blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
  9404. }
  9405. }
  9406. }
  9407. };
  9408. /***/ }),
  9409. /* 60 */
  9410. /***/ (function(module, exports, __webpack_require__) {
  9411. "use strict";
  9412. // Normalize input string
  9413. var NEWLINES_RE = /\r[\n\u0085]?|[\u2424\u2028\u0085]/g;
  9414. var NULL_RE = /\u0000/g;
  9415. module.exports = function inline(state) {
  9416. var str;
  9417. // Normalize newlines
  9418. str = state.src.replace(NEWLINES_RE, '\n');
  9419. // Replace NULL characters
  9420. str = str.replace(NULL_RE, '\uFFFD');
  9421. state.src = str;
  9422. };
  9423. /***/ }),
  9424. /* 61 */
  9425. /***/ (function(module, exports, __webpack_require__) {
  9426. "use strict";
  9427. // Simple typographyc replacements
  9428. //
  9429. // (c) (C) → ©
  9430. // (tm) (TM) → ™
  9431. // (r) (R) → ®
  9432. // +- → ±
  9433. // (p) (P) -> §
  9434. // ... → … (also ?.... → ?.., !.... → !..)
  9435. // ???????? → ???, !!!!! → !!!, `,,` → `,`
  9436. // -- → &ndash;, --- → &mdash;
  9437. //
  9438. // TODO:
  9439. // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
  9440. // - miltiplication 2 x 4 -> 2 × 4
  9441. var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
  9442. // Workaround for phantomjs - need regex without /g flag,
  9443. // or root check will fail every second time
  9444. var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
  9445. var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
  9446. var SCOPED_ABBR = {
  9447. c: '©',
  9448. r: '®',
  9449. p: '§',
  9450. tm: '™'
  9451. };
  9452. function replaceFn(match, name) {
  9453. return SCOPED_ABBR[name.toLowerCase()];
  9454. }
  9455. function replace_scoped(inlineTokens) {
  9456. var i, token, inside_autolink = 0;
  9457. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9458. token = inlineTokens[i];
  9459. if (token.type === 'text' && !inside_autolink) {
  9460. token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
  9461. }
  9462. if (token.type === 'link_open' && token.info === 'auto') {
  9463. inside_autolink--;
  9464. }
  9465. if (token.type === 'link_close' && token.info === 'auto') {
  9466. inside_autolink++;
  9467. }
  9468. }
  9469. }
  9470. function replace_rare(inlineTokens) {
  9471. var i, token, inside_autolink = 0;
  9472. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9473. token = inlineTokens[i];
  9474. if (token.type === 'text' && !inside_autolink) {
  9475. if (RARE_RE.test(token.content)) {
  9476. token.content = token.content
  9477. .replace(/\+-/g, '±')
  9478. // .., ..., ....... -> …
  9479. // but ?..... & !..... -> ?.. & !..
  9480. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
  9481. .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
  9482. // em-dash
  9483. .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
  9484. // en-dash
  9485. .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
  9486. .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
  9487. }
  9488. }
  9489. if (token.type === 'link_open' && token.info === 'auto') {
  9490. inside_autolink--;
  9491. }
  9492. if (token.type === 'link_close' && token.info === 'auto') {
  9493. inside_autolink++;
  9494. }
  9495. }
  9496. }
  9497. module.exports = function replace(state) {
  9498. var blkIdx;
  9499. if (!state.md.options.typographer) { return; }
  9500. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9501. if (state.tokens[blkIdx].type !== 'inline') { continue; }
  9502. if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
  9503. replace_scoped(state.tokens[blkIdx].children);
  9504. }
  9505. if (RARE_RE.test(state.tokens[blkIdx].content)) {
  9506. replace_rare(state.tokens[blkIdx].children);
  9507. }
  9508. }
  9509. };
  9510. /***/ }),
  9511. /* 62 */
  9512. /***/ (function(module, exports, __webpack_require__) {
  9513. "use strict";
  9514. // Convert straight quotation marks to typographic ones
  9515. //
  9516. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9517. var isPunctChar = __webpack_require__(0).isPunctChar;
  9518. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9519. var QUOTE_TEST_RE = /['"]/;
  9520. var QUOTE_RE = /['"]/g;
  9521. var APOSTROPHE = '\u2019'; /* ’ */
  9522. function replaceAt(str, index, ch) {
  9523. return str.substr(0, index) + ch + str.substr(index + 1);
  9524. }
  9525. function process_inlines(tokens, state) {
  9526. var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
  9527. isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
  9528. canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
  9529. stack = [];
  9530. for (i = 0; i < tokens.length; i++) {
  9531. token = tokens[i];
  9532. thisLevel = tokens[i].level;
  9533. for (j = stack.length - 1; j >= 0; j--) {
  9534. if (stack[j].level <= thisLevel) { break; }
  9535. }
  9536. stack.length = j + 1;
  9537. if (token.type !== 'text') { continue; }
  9538. text = token.content;
  9539. pos = 0;
  9540. max = text.length;
  9541. /*eslint no-labels:0,block-scoped-var:0*/
  9542. OUTER:
  9543. while (pos < max) {
  9544. QUOTE_RE.lastIndex = pos;
  9545. t = QUOTE_RE.exec(text);
  9546. if (!t) { break; }
  9547. canOpen = canClose = true;
  9548. pos = t.index + 1;
  9549. isSingle = (t[0] === "'");
  9550. // Find previous character,
  9551. // default to space if it's the beginning of the line
  9552. //
  9553. lastChar = 0x20;
  9554. if (t.index - 1 >= 0) {
  9555. lastChar = text.charCodeAt(t.index - 1);
  9556. } else {
  9557. for (j = i - 1; j >= 0; j--) {
  9558. if (tokens[j].type !== 'text') { continue; }
  9559. lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
  9560. break;
  9561. }
  9562. }
  9563. // Find next character,
  9564. // default to space if it's the end of the line
  9565. //
  9566. nextChar = 0x20;
  9567. if (pos < max) {
  9568. nextChar = text.charCodeAt(pos);
  9569. } else {
  9570. for (j = i + 1; j < tokens.length; j++) {
  9571. if (tokens[j].type !== 'text') { continue; }
  9572. nextChar = tokens[j].content.charCodeAt(0);
  9573. break;
  9574. }
  9575. }
  9576. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  9577. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  9578. isLastWhiteSpace = isWhiteSpace(lastChar);
  9579. isNextWhiteSpace = isWhiteSpace(nextChar);
  9580. if (isNextWhiteSpace) {
  9581. canOpen = false;
  9582. } else if (isNextPunctChar) {
  9583. if (!(isLastWhiteSpace || isLastPunctChar)) {
  9584. canOpen = false;
  9585. }
  9586. }
  9587. if (isLastWhiteSpace) {
  9588. canClose = false;
  9589. } else if (isLastPunctChar) {
  9590. if (!(isNextWhiteSpace || isNextPunctChar)) {
  9591. canClose = false;
  9592. }
  9593. }
  9594. if (nextChar === 0x22 /* " */ && t[0] === '"') {
  9595. if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
  9596. // special case: 1"" - count first quote as an inch
  9597. canClose = canOpen = false;
  9598. }
  9599. }
  9600. if (canOpen && canClose) {
  9601. // treat this as the middle of the word
  9602. canOpen = false;
  9603. canClose = isNextPunctChar;
  9604. }
  9605. if (!canOpen && !canClose) {
  9606. // middle of word
  9607. if (isSingle) {
  9608. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9609. }
  9610. continue;
  9611. }
  9612. if (canClose) {
  9613. // this could be a closing quote, rewind the stack to get a match
  9614. for (j = stack.length - 1; j >= 0; j--) {
  9615. item = stack[j];
  9616. if (stack[j].level < thisLevel) { break; }
  9617. if (item.single === isSingle && stack[j].level === thisLevel) {
  9618. item = stack[j];
  9619. if (isSingle) {
  9620. openQuote = state.md.options.quotes[2];
  9621. closeQuote = state.md.options.quotes[3];
  9622. } else {
  9623. openQuote = state.md.options.quotes[0];
  9624. closeQuote = state.md.options.quotes[1];
  9625. }
  9626. // replace token.content *before* tokens[item.token].content,
  9627. // because, if they are pointing at the same token, replaceAt
  9628. // could mess up indices when quote length != 1
  9629. token.content = replaceAt(token.content, t.index, closeQuote);
  9630. tokens[item.token].content = replaceAt(
  9631. tokens[item.token].content, item.pos, openQuote);
  9632. pos += closeQuote.length - 1;
  9633. if (item.token === i) { pos += openQuote.length - 1; }
  9634. text = token.content;
  9635. max = text.length;
  9636. stack.length = j;
  9637. continue OUTER;
  9638. }
  9639. }
  9640. }
  9641. if (canOpen) {
  9642. stack.push({
  9643. token: i,
  9644. pos: t.index,
  9645. single: isSingle,
  9646. level: thisLevel
  9647. });
  9648. } else if (canClose && isSingle) {
  9649. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9650. }
  9651. }
  9652. }
  9653. }
  9654. module.exports = function smartquotes(state) {
  9655. /*eslint max-depth:0*/
  9656. var blkIdx;
  9657. if (!state.md.options.typographer) { return; }
  9658. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9659. if (state.tokens[blkIdx].type !== 'inline' ||
  9660. !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
  9661. continue;
  9662. }
  9663. process_inlines(state.tokens[blkIdx].children, state);
  9664. }
  9665. };
  9666. /***/ }),
  9667. /* 63 */
  9668. /***/ (function(module, exports, __webpack_require__) {
  9669. "use strict";
  9670. // Core state object
  9671. //
  9672. var Token = __webpack_require__(4);
  9673. function StateCore(src, md, env) {
  9674. this.src = src;
  9675. this.env = env;
  9676. this.tokens = [];
  9677. this.inlineMode = false;
  9678. this.md = md; // link to parser instance
  9679. }
  9680. // re-export Token class to use in core rules
  9681. StateCore.prototype.Token = Token;
  9682. module.exports = StateCore;
  9683. /***/ }),
  9684. /* 64 */
  9685. /***/ (function(module, exports, __webpack_require__) {
  9686. "use strict";
  9687. // Process autolinks '<protocol:...>'
  9688. /*eslint max-len:0*/
  9689. var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
  9690. var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
  9691. module.exports = function autolink(state, silent) {
  9692. var tail, linkMatch, emailMatch, url, fullUrl, token,
  9693. pos = state.pos;
  9694. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  9695. tail = state.src.slice(pos);
  9696. if (tail.indexOf('>') < 0) { return false; }
  9697. if (AUTOLINK_RE.test(tail)) {
  9698. linkMatch = tail.match(AUTOLINK_RE);
  9699. url = linkMatch[0].slice(1, -1);
  9700. fullUrl = state.md.normalizeLink(url);
  9701. if (!state.md.validateLink(fullUrl)) { return false; }
  9702. if (!silent) {
  9703. token = state.push('link_open', 'a', 1);
  9704. token.attrs = [ [ 'href', fullUrl ] ];
  9705. token.markup = 'autolink';
  9706. token.info = 'auto';
  9707. token = state.push('text', '', 0);
  9708. token.content = state.md.normalizeLinkText(url);
  9709. token = state.push('link_close', 'a', -1);
  9710. token.markup = 'autolink';
  9711. token.info = 'auto';
  9712. }
  9713. state.pos += linkMatch[0].length;
  9714. return true;
  9715. }
  9716. if (EMAIL_RE.test(tail)) {
  9717. emailMatch = tail.match(EMAIL_RE);
  9718. url = emailMatch[0].slice(1, -1);
  9719. fullUrl = state.md.normalizeLink('mailto:' + url);
  9720. if (!state.md.validateLink(fullUrl)) { return false; }
  9721. if (!silent) {
  9722. token = state.push('link_open', 'a', 1);
  9723. token.attrs = [ [ 'href', fullUrl ] ];
  9724. token.markup = 'autolink';
  9725. token.info = 'auto';
  9726. token = state.push('text', '', 0);
  9727. token.content = state.md.normalizeLinkText(url);
  9728. token = state.push('link_close', 'a', -1);
  9729. token.markup = 'autolink';
  9730. token.info = 'auto';
  9731. }
  9732. state.pos += emailMatch[0].length;
  9733. return true;
  9734. }
  9735. return false;
  9736. };
  9737. /***/ }),
  9738. /* 65 */
  9739. /***/ (function(module, exports, __webpack_require__) {
  9740. "use strict";
  9741. // Parse backticks
  9742. module.exports = function backtick(state, silent) {
  9743. var start, max, marker, matchStart, matchEnd, token,
  9744. pos = state.pos,
  9745. ch = state.src.charCodeAt(pos);
  9746. if (ch !== 0x60/* ` */) { return false; }
  9747. start = pos;
  9748. pos++;
  9749. max = state.posMax;
  9750. while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
  9751. marker = state.src.slice(start, pos);
  9752. matchStart = matchEnd = pos;
  9753. while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
  9754. matchEnd = matchStart + 1;
  9755. while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
  9756. if (matchEnd - matchStart === marker.length) {
  9757. if (!silent) {
  9758. token = state.push('code_inline', 'code', 0);
  9759. token.markup = marker;
  9760. token.content = state.src.slice(pos, matchStart)
  9761. .replace(/[ \n]+/g, ' ')
  9762. .trim();
  9763. }
  9764. state.pos = matchEnd;
  9765. return true;
  9766. }
  9767. }
  9768. if (!silent) { state.pending += marker; }
  9769. state.pos += marker.length;
  9770. return true;
  9771. };
  9772. /***/ }),
  9773. /* 66 */
  9774. /***/ (function(module, exports, __webpack_require__) {
  9775. "use strict";
  9776. // For each opening emphasis-like marker find a matching closing one
  9777. //
  9778. module.exports = function link_pairs(state) {
  9779. var i, j, lastDelim, currDelim,
  9780. delimiters = state.delimiters,
  9781. max = state.delimiters.length;
  9782. for (i = 0; i < max; i++) {
  9783. lastDelim = delimiters[i];
  9784. if (!lastDelim.close) { continue; }
  9785. j = i - lastDelim.jump - 1;
  9786. while (j >= 0) {
  9787. currDelim = delimiters[j];
  9788. if (currDelim.open &&
  9789. currDelim.marker === lastDelim.marker &&
  9790. currDelim.end < 0 &&
  9791. currDelim.level === lastDelim.level) {
  9792. // typeofs are for backward compatibility with plugins
  9793. var odd_match = (currDelim.close || lastDelim.open) &&
  9794. typeof currDelim.length !== 'undefined' &&
  9795. typeof lastDelim.length !== 'undefined' &&
  9796. (currDelim.length + lastDelim.length) % 3 === 0;
  9797. if (!odd_match) {
  9798. lastDelim.jump = i - j;
  9799. lastDelim.open = false;
  9800. currDelim.end = i;
  9801. currDelim.jump = 0;
  9802. break;
  9803. }
  9804. }
  9805. j -= currDelim.jump + 1;
  9806. }
  9807. }
  9808. };
  9809. /***/ }),
  9810. /* 67 */
  9811. /***/ (function(module, exports, __webpack_require__) {
  9812. "use strict";
  9813. // Process html entity - &#123;, &#xAF;, &quot;, ...
  9814. var entities = __webpack_require__(11);
  9815. var has = __webpack_require__(0).has;
  9816. var isValidEntityCode = __webpack_require__(0).isValidEntityCode;
  9817. var fromCodePoint = __webpack_require__(0).fromCodePoint;
  9818. var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
  9819. var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
  9820. module.exports = function entity(state, silent) {
  9821. var ch, code, match, pos = state.pos, max = state.posMax;
  9822. if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
  9823. if (pos + 1 < max) {
  9824. ch = state.src.charCodeAt(pos + 1);
  9825. if (ch === 0x23 /* # */) {
  9826. match = state.src.slice(pos).match(DIGITAL_RE);
  9827. if (match) {
  9828. if (!silent) {
  9829. code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
  9830. state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
  9831. }
  9832. state.pos += match[0].length;
  9833. return true;
  9834. }
  9835. } else {
  9836. match = state.src.slice(pos).match(NAMED_RE);
  9837. if (match) {
  9838. if (has(entities, match[1])) {
  9839. if (!silent) { state.pending += entities[match[1]]; }
  9840. state.pos += match[0].length;
  9841. return true;
  9842. }
  9843. }
  9844. }
  9845. }
  9846. if (!silent) { state.pending += '&'; }
  9847. state.pos++;
  9848. return true;
  9849. };
  9850. /***/ }),
  9851. /* 68 */
  9852. /***/ (function(module, exports, __webpack_require__) {
  9853. "use strict";
  9854. // Proceess escaped chars and hardbreaks
  9855. var isSpace = __webpack_require__(0).isSpace;
  9856. var ESCAPED = [];
  9857. for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
  9858. '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
  9859. .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
  9860. module.exports = function escape(state, silent) {
  9861. var ch, pos = state.pos, max = state.posMax;
  9862. if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
  9863. pos++;
  9864. if (pos < max) {
  9865. ch = state.src.charCodeAt(pos);
  9866. if (ch < 256 && ESCAPED[ch] !== 0) {
  9867. if (!silent) { state.pending += state.src[pos]; }
  9868. state.pos += 2;
  9869. return true;
  9870. }
  9871. if (ch === 0x0A) {
  9872. if (!silent) {
  9873. state.push('hardbreak', 'br', 0);
  9874. }
  9875. pos++;
  9876. // skip leading whitespaces from next line
  9877. while (pos < max) {
  9878. ch = state.src.charCodeAt(pos);
  9879. if (!isSpace(ch)) { break; }
  9880. pos++;
  9881. }
  9882. state.pos = pos;
  9883. return true;
  9884. }
  9885. }
  9886. if (!silent) { state.pending += '\\'; }
  9887. state.pos++;
  9888. return true;
  9889. };
  9890. /***/ }),
  9891. /* 69 */
  9892. /***/ (function(module, exports, __webpack_require__) {
  9893. "use strict";
  9894. // Process html tags
  9895. var HTML_TAG_RE = __webpack_require__(12).HTML_TAG_RE;
  9896. function isLetter(ch) {
  9897. /*eslint no-bitwise:0*/
  9898. var lc = ch | 0x20; // to lower case
  9899. return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  9900. }
  9901. module.exports = function html_inline(state, silent) {
  9902. var ch, match, max, token,
  9903. pos = state.pos;
  9904. if (!state.md.options.html) { return false; }
  9905. // Check start
  9906. max = state.posMax;
  9907. if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
  9908. pos + 2 >= max) {
  9909. return false;
  9910. }
  9911. // Quick fail on second char
  9912. ch = state.src.charCodeAt(pos + 1);
  9913. if (ch !== 0x21/* ! */ &&
  9914. ch !== 0x3F/* ? */ &&
  9915. ch !== 0x2F/* / */ &&
  9916. !isLetter(ch)) {
  9917. return false;
  9918. }
  9919. match = state.src.slice(pos).match(HTML_TAG_RE);
  9920. if (!match) { return false; }
  9921. if (!silent) {
  9922. token = state.push('html_inline', '', 0);
  9923. token.content = state.src.slice(pos, pos + match[0].length);
  9924. }
  9925. state.pos += match[0].length;
  9926. return true;
  9927. };
  9928. /***/ }),
  9929. /* 70 */
  9930. /***/ (function(module, exports, __webpack_require__) {
  9931. "use strict";
  9932. // Process ![image](<src> "title")
  9933. var normalizeReference = __webpack_require__(0).normalizeReference;
  9934. var isSpace = __webpack_require__(0).isSpace;
  9935. module.exports = function image(state, silent) {
  9936. var attrs,
  9937. code,
  9938. content,
  9939. label,
  9940. labelEnd,
  9941. labelStart,
  9942. pos,
  9943. ref,
  9944. res,
  9945. title,
  9946. token,
  9947. tokens,
  9948. start,
  9949. href = '',
  9950. oldPos = state.pos,
  9951. max = state.posMax;
  9952. if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
  9953. if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
  9954. labelStart = state.pos + 2;
  9955. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  9956. // parser failed to find ']', so it's not a valid link
  9957. if (labelEnd < 0) { return false; }
  9958. pos = labelEnd + 1;
  9959. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9960. //
  9961. // Inline link
  9962. //
  9963. // [link]( <href> "title" )
  9964. // ^^ skipping these spaces
  9965. pos++;
  9966. for (; pos < max; pos++) {
  9967. code = state.src.charCodeAt(pos);
  9968. if (!isSpace(code) && code !== 0x0A) { break; }
  9969. }
  9970. if (pos >= max) { return false; }
  9971. // [link]( <href> "title" )
  9972. // ^^^^^^ parsing link destination
  9973. start = pos;
  9974. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9975. if (res.ok) {
  9976. href = state.md.normalizeLink(res.str);
  9977. if (state.md.validateLink(href)) {
  9978. pos = res.pos;
  9979. } else {
  9980. href = '';
  9981. }
  9982. }
  9983. // [link]( <href> "title" )
  9984. // ^^ skipping these spaces
  9985. start = pos;
  9986. for (; pos < max; pos++) {
  9987. code = state.src.charCodeAt(pos);
  9988. if (!isSpace(code) && code !== 0x0A) { break; }
  9989. }
  9990. // [link]( <href> "title" )
  9991. // ^^^^^^^ parsing link title
  9992. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  9993. if (pos < max && start !== pos && res.ok) {
  9994. title = res.str;
  9995. pos = res.pos;
  9996. // [link]( <href> "title" )
  9997. // ^^ skipping these spaces
  9998. for (; pos < max; pos++) {
  9999. code = state.src.charCodeAt(pos);
  10000. if (!isSpace(code) && code !== 0x0A) { break; }
  10001. }
  10002. } else {
  10003. title = '';
  10004. }
  10005. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  10006. state.pos = oldPos;
  10007. return false;
  10008. }
  10009. pos++;
  10010. } else {
  10011. //
  10012. // Link reference
  10013. //
  10014. if (typeof state.env.references === 'undefined') { return false; }
  10015. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  10016. start = pos + 1;
  10017. pos = state.md.helpers.parseLinkLabel(state, pos);
  10018. if (pos >= 0) {
  10019. label = state.src.slice(start, pos++);
  10020. } else {
  10021. pos = labelEnd + 1;
  10022. }
  10023. } else {
  10024. pos = labelEnd + 1;
  10025. }
  10026. // covers label === '' and label === undefined
  10027. // (collapsed reference link and shortcut reference link respectively)
  10028. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  10029. ref = state.env.references[normalizeReference(label)];
  10030. if (!ref) {
  10031. state.pos = oldPos;
  10032. return false;
  10033. }
  10034. href = ref.href;
  10035. title = ref.title;
  10036. }
  10037. //
  10038. // We found the end of the link, and know for a fact it's a valid link;
  10039. // so all that's left to do is to call tokenizer.
  10040. //
  10041. if (!silent) {
  10042. content = state.src.slice(labelStart, labelEnd);
  10043. state.md.inline.parse(
  10044. content,
  10045. state.md,
  10046. state.env,
  10047. tokens = []
  10048. );
  10049. token = state.push('image', 'img', 0);
  10050. token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
  10051. token.children = tokens;
  10052. token.content = content;
  10053. if (title) {
  10054. attrs.push([ 'title', title ]);
  10055. }
  10056. }
  10057. state.pos = pos;
  10058. state.posMax = max;
  10059. return true;
  10060. };
  10061. /***/ }),
  10062. /* 71 */
  10063. /***/ (function(module, exports, __webpack_require__) {
  10064. "use strict";
  10065. // Process [link](<to> "stuff")
  10066. var normalizeReference = __webpack_require__(0).normalizeReference;
  10067. var isSpace = __webpack_require__(0).isSpace;
  10068. module.exports = function link(state, silent) {
  10069. var attrs,
  10070. code,
  10071. label,
  10072. labelEnd,
  10073. labelStart,
  10074. pos,
  10075. res,
  10076. ref,
  10077. title,
  10078. token,
  10079. href = '',
  10080. oldPos = state.pos,
  10081. max = state.posMax,
  10082. start = state.pos,
  10083. parseReference = true;
  10084. if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
  10085. labelStart = state.pos + 1;
  10086. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  10087. // parser failed to find ']', so it's not a valid link
  10088. if (labelEnd < 0) { return false; }
  10089. pos = labelEnd + 1;
  10090. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  10091. //
  10092. // Inline link
  10093. //
  10094. // might have found a valid shortcut link, disable reference parsing
  10095. parseReference = false;
  10096. // [link]( <href> "title" )
  10097. // ^^ skipping these spaces
  10098. pos++;
  10099. for (; pos < max; pos++) {
  10100. code = state.src.charCodeAt(pos);
  10101. if (!isSpace(code) && code !== 0x0A) { break; }
  10102. }
  10103. if (pos >= max) { return false; }
  10104. // [link]( <href> "title" )
  10105. // ^^^^^^ parsing link destination
  10106. start = pos;
  10107. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  10108. if (res.ok) {
  10109. href = state.md.normalizeLink(res.str);
  10110. if (state.md.validateLink(href)) {
  10111. pos = res.pos;
  10112. } else {
  10113. href = '';
  10114. }
  10115. }
  10116. // [link]( <href> "title" )
  10117. // ^^ skipping these spaces
  10118. start = pos;
  10119. for (; pos < max; pos++) {
  10120. code = state.src.charCodeAt(pos);
  10121. if (!isSpace(code) && code !== 0x0A) { break; }
  10122. }
  10123. // [link]( <href> "title" )
  10124. // ^^^^^^^ parsing link title
  10125. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  10126. if (pos < max && start !== pos && res.ok) {
  10127. title = res.str;
  10128. pos = res.pos;
  10129. // [link]( <href> "title" )
  10130. // ^^ skipping these spaces
  10131. for (; pos < max; pos++) {
  10132. code = state.src.charCodeAt(pos);
  10133. if (!isSpace(code) && code !== 0x0A) { break; }
  10134. }
  10135. } else {
  10136. title = '';
  10137. }
  10138. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  10139. // parsing a valid shortcut link failed, fallback to reference
  10140. parseReference = true;
  10141. }
  10142. pos++;
  10143. }
  10144. if (parseReference) {
  10145. //
  10146. // Link reference
  10147. //
  10148. if (typeof state.env.references === 'undefined') { return false; }
  10149. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  10150. start = pos + 1;
  10151. pos = state.md.helpers.parseLinkLabel(state, pos);
  10152. if (pos >= 0) {
  10153. label = state.src.slice(start, pos++);
  10154. } else {
  10155. pos = labelEnd + 1;
  10156. }
  10157. } else {
  10158. pos = labelEnd + 1;
  10159. }
  10160. // covers label === '' and label === undefined
  10161. // (collapsed reference link and shortcut reference link respectively)
  10162. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  10163. ref = state.env.references[normalizeReference(label)];
  10164. if (!ref) {
  10165. state.pos = oldPos;
  10166. return false;
  10167. }
  10168. href = ref.href;
  10169. title = ref.title;
  10170. }
  10171. //
  10172. // We found the end of the link, and know for a fact it's a valid link;
  10173. // so all that's left to do is to call tokenizer.
  10174. //
  10175. if (!silent) {
  10176. state.pos = labelStart;
  10177. state.posMax = labelEnd;
  10178. token = state.push('link_open', 'a', 1);
  10179. token.attrs = attrs = [ [ 'href', href ] ];
  10180. if (title) {
  10181. attrs.push([ 'title', title ]);
  10182. }
  10183. state.md.inline.tokenize(state);
  10184. token = state.push('link_close', 'a', -1);
  10185. }
  10186. state.pos = pos;
  10187. state.posMax = max;
  10188. return true;
  10189. };
  10190. /***/ }),
  10191. /* 72 */
  10192. /***/ (function(module, exports, __webpack_require__) {
  10193. "use strict";
  10194. // Proceess '\n'
  10195. var isSpace = __webpack_require__(0).isSpace;
  10196. module.exports = function newline(state, silent) {
  10197. var pmax, max, pos = state.pos;
  10198. if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
  10199. pmax = state.pending.length - 1;
  10200. max = state.posMax;
  10201. // ' \n' -> hardbreak
  10202. // Lookup in pending chars is bad practice! Don't copy to other rules!
  10203. // Pending string is stored in concat mode, indexed lookups will cause
  10204. // convertion to flat mode.
  10205. if (!silent) {
  10206. if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
  10207. if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
  10208. state.pending = state.pending.replace(/ +$/, '');
  10209. state.push('hardbreak', 'br', 0);
  10210. } else {
  10211. state.pending = state.pending.slice(0, -1);
  10212. state.push('softbreak', 'br', 0);
  10213. }
  10214. } else {
  10215. state.push('softbreak', 'br', 0);
  10216. }
  10217. }
  10218. pos++;
  10219. // skip heading spaces for next line
  10220. while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
  10221. state.pos = pos;
  10222. return true;
  10223. };
  10224. /***/ }),
  10225. /* 73 */
  10226. /***/ (function(module, exports, __webpack_require__) {
  10227. "use strict";
  10228. // Inline parser state
  10229. var Token = __webpack_require__(4);
  10230. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  10231. var isPunctChar = __webpack_require__(0).isPunctChar;
  10232. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  10233. function StateInline(src, md, env, outTokens) {
  10234. this.src = src;
  10235. this.env = env;
  10236. this.md = md;
  10237. this.tokens = outTokens;
  10238. this.pos = 0;
  10239. this.posMax = this.src.length;
  10240. this.level = 0;
  10241. this.pending = '';
  10242. this.pendingLevel = 0;
  10243. this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
  10244. // optimization of pairs parse (emphasis, strikes).
  10245. this.delimiters = []; // Emphasis-like delimiters
  10246. }
  10247. // Flush pending text
  10248. //
  10249. StateInline.prototype.pushPending = function () {
  10250. var token = new Token('text', '', 0);
  10251. token.content = this.pending;
  10252. token.level = this.pendingLevel;
  10253. this.tokens.push(token);
  10254. this.pending = '';
  10255. return token;
  10256. };
  10257. // Push new token to "stream".
  10258. // If pending text exists - flush it as text token
  10259. //
  10260. StateInline.prototype.push = function (type, tag, nesting) {
  10261. if (this.pending) {
  10262. this.pushPending();
  10263. }
  10264. var token = new Token(type, tag, nesting);
  10265. if (nesting < 0) { this.level--; }
  10266. token.level = this.level;
  10267. if (nesting > 0) { this.level++; }
  10268. this.pendingLevel = this.level;
  10269. this.tokens.push(token);
  10270. return token;
  10271. };
  10272. // Scan a sequence of emphasis-like markers, and determine whether
  10273. // it can start an emphasis sequence or end an emphasis sequence.
  10274. //
  10275. // - start - position to scan from (it should point at a valid marker);
  10276. // - canSplitWord - determine if these markers can be found inside a word
  10277. //
  10278. StateInline.prototype.scanDelims = function (start, canSplitWord) {
  10279. var pos = start, lastChar, nextChar, count, can_open, can_close,
  10280. isLastWhiteSpace, isLastPunctChar,
  10281. isNextWhiteSpace, isNextPunctChar,
  10282. left_flanking = true,
  10283. right_flanking = true,
  10284. max = this.posMax,
  10285. marker = this.src.charCodeAt(start);
  10286. // treat beginning of the line as a whitespace
  10287. lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
  10288. while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
  10289. count = pos - start;
  10290. // treat end of the line as a whitespace
  10291. nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
  10292. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  10293. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  10294. isLastWhiteSpace = isWhiteSpace(lastChar);
  10295. isNextWhiteSpace = isWhiteSpace(nextChar);
  10296. if (isNextWhiteSpace) {
  10297. left_flanking = false;
  10298. } else if (isNextPunctChar) {
  10299. if (!(isLastWhiteSpace || isLastPunctChar)) {
  10300. left_flanking = false;
  10301. }
  10302. }
  10303. if (isLastWhiteSpace) {
  10304. right_flanking = false;
  10305. } else if (isLastPunctChar) {
  10306. if (!(isNextWhiteSpace || isNextPunctChar)) {
  10307. right_flanking = false;
  10308. }
  10309. }
  10310. if (!canSplitWord) {
  10311. can_open = left_flanking && (!right_flanking || isLastPunctChar);
  10312. can_close = right_flanking && (!left_flanking || isNextPunctChar);
  10313. } else {
  10314. can_open = left_flanking;
  10315. can_close = right_flanking;
  10316. }
  10317. return {
  10318. can_open: can_open,
  10319. can_close: can_close,
  10320. length: count
  10321. };
  10322. };
  10323. // re-export Token class to use in block rules
  10324. StateInline.prototype.Token = Token;
  10325. module.exports = StateInline;
  10326. /***/ }),
  10327. /* 74 */
  10328. /***/ (function(module, exports, __webpack_require__) {
  10329. "use strict";
  10330. // Skip text characters for text token, place those to pending buffer
  10331. // and increment current pos
  10332. // Rule to skip pure text
  10333. // '{}$%@~+=:' reserved for extentions
  10334. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  10335. // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
  10336. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  10337. function isTerminatorChar(ch) {
  10338. switch (ch) {
  10339. case 0x0A/* \n */:
  10340. case 0x21/* ! */:
  10341. case 0x23/* # */:
  10342. case 0x24/* $ */:
  10343. case 0x25/* % */:
  10344. case 0x26/* & */:
  10345. case 0x2A/* * */:
  10346. case 0x2B/* + */:
  10347. case 0x2D/* - */:
  10348. case 0x3A/* : */:
  10349. case 0x3C/* < */:
  10350. case 0x3D/* = */:
  10351. case 0x3E/* > */:
  10352. case 0x40/* @ */:
  10353. case 0x5B/* [ */:
  10354. case 0x5C/* \ */:
  10355. case 0x5D/* ] */:
  10356. case 0x5E/* ^ */:
  10357. case 0x5F/* _ */:
  10358. case 0x60/* ` */:
  10359. case 0x7B/* { */:
  10360. case 0x7D/* } */:
  10361. case 0x7E/* ~ */:
  10362. return true;
  10363. default:
  10364. return false;
  10365. }
  10366. }
  10367. module.exports = function text(state, silent) {
  10368. var pos = state.pos;
  10369. while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
  10370. pos++;
  10371. }
  10372. if (pos === state.pos) { return false; }
  10373. if (!silent) { state.pending += state.src.slice(state.pos, pos); }
  10374. state.pos = pos;
  10375. return true;
  10376. };
  10377. // Alternative implementation, for memory.
  10378. //
  10379. // It costs 10% of performance, but allows extend terminators list, if place it
  10380. // to `ParcerInline` property. Probably, will switch to it sometime, such
  10381. // flexibility required.
  10382. /*
  10383. var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
  10384. module.exports = function text(state, silent) {
  10385. var pos = state.pos,
  10386. idx = state.src.slice(pos).search(TERMINATOR_RE);
  10387. // first char is terminator -> empty text
  10388. if (idx === 0) { return false; }
  10389. // no terminator -> text till end of string
  10390. if (idx < 0) {
  10391. if (!silent) { state.pending += state.src.slice(pos); }
  10392. state.pos = state.src.length;
  10393. return true;
  10394. }
  10395. if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
  10396. state.pos += idx;
  10397. return true;
  10398. };*/
  10399. /***/ }),
  10400. /* 75 */
  10401. /***/ (function(module, exports, __webpack_require__) {
  10402. "use strict";
  10403. // Merge adjacent text nodes into one, and re-calculate all token levels
  10404. //
  10405. module.exports = function text_collapse(state) {
  10406. var curr, last,
  10407. level = 0,
  10408. tokens = state.tokens,
  10409. max = state.tokens.length;
  10410. for (curr = last = 0; curr < max; curr++) {
  10411. // re-calculate levels
  10412. level += tokens[curr].nesting;
  10413. tokens[curr].level = level;
  10414. if (tokens[curr].type === 'text' &&
  10415. curr + 1 < max &&
  10416. tokens[curr + 1].type === 'text') {
  10417. // collapse two adjacent text nodes
  10418. tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
  10419. } else {
  10420. if (curr !== last) { tokens[last] = tokens[curr]; }
  10421. last++;
  10422. }
  10423. }
  10424. if (curr !== last) {
  10425. tokens.length = last;
  10426. }
  10427. };
  10428. /***/ }),
  10429. /* 76 */
  10430. /***/ (function(module, exports, __webpack_require__) {
  10431. "use strict";
  10432. /* eslint-disable no-bitwise */
  10433. var decodeCache = {};
  10434. function getDecodeCache(exclude) {
  10435. var i, ch, cache = decodeCache[exclude];
  10436. if (cache) { return cache; }
  10437. cache = decodeCache[exclude] = [];
  10438. for (i = 0; i < 128; i++) {
  10439. ch = String.fromCharCode(i);
  10440. cache.push(ch);
  10441. }
  10442. for (i = 0; i < exclude.length; i++) {
  10443. ch = exclude.charCodeAt(i);
  10444. cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
  10445. }
  10446. return cache;
  10447. }
  10448. // Decode percent-encoded string.
  10449. //
  10450. function decode(string, exclude) {
  10451. var cache;
  10452. if (typeof exclude !== 'string') {
  10453. exclude = decode.defaultChars;
  10454. }
  10455. cache = getDecodeCache(exclude);
  10456. return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
  10457. var i, l, b1, b2, b3, b4, chr,
  10458. result = '';
  10459. for (i = 0, l = seq.length; i < l; i += 3) {
  10460. b1 = parseInt(seq.slice(i + 1, i + 3), 16);
  10461. if (b1 < 0x80) {
  10462. result += cache[b1];
  10463. continue;
  10464. }
  10465. if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
  10466. // 110xxxxx 10xxxxxx
  10467. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10468. if ((b2 & 0xC0) === 0x80) {
  10469. chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
  10470. if (chr < 0x80) {
  10471. result += '\ufffd\ufffd';
  10472. } else {
  10473. result += String.fromCharCode(chr);
  10474. }
  10475. i += 3;
  10476. continue;
  10477. }
  10478. }
  10479. if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
  10480. // 1110xxxx 10xxxxxx 10xxxxxx
  10481. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10482. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10483. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  10484. chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
  10485. if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
  10486. result += '\ufffd\ufffd\ufffd';
  10487. } else {
  10488. result += String.fromCharCode(chr);
  10489. }
  10490. i += 6;
  10491. continue;
  10492. }
  10493. }
  10494. if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
  10495. // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
  10496. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10497. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10498. b4 = parseInt(seq.slice(i + 10, i + 12), 16);
  10499. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
  10500. chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
  10501. if (chr < 0x10000 || chr > 0x10FFFF) {
  10502. result += '\ufffd\ufffd\ufffd\ufffd';
  10503. } else {
  10504. chr -= 0x10000;
  10505. result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
  10506. }
  10507. i += 9;
  10508. continue;
  10509. }
  10510. }
  10511. result += '\ufffd';
  10512. }
  10513. return result;
  10514. });
  10515. }
  10516. decode.defaultChars = ';/?:@&=+$,#';
  10517. decode.componentChars = '';
  10518. module.exports = decode;
  10519. /***/ }),
  10520. /* 77 */
  10521. /***/ (function(module, exports, __webpack_require__) {
  10522. "use strict";
  10523. var encodeCache = {};
  10524. // Create a lookup array where anything but characters in `chars` string
  10525. // and alphanumeric chars is percent-encoded.
  10526. //
  10527. function getEncodeCache(exclude) {
  10528. var i, ch, cache = encodeCache[exclude];
  10529. if (cache) { return cache; }
  10530. cache = encodeCache[exclude] = [];
  10531. for (i = 0; i < 128; i++) {
  10532. ch = String.fromCharCode(i);
  10533. if (/^[0-9a-z]$/i.test(ch)) {
  10534. // always allow unencoded alphanumeric characters
  10535. cache.push(ch);
  10536. } else {
  10537. cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
  10538. }
  10539. }
  10540. for (i = 0; i < exclude.length; i++) {
  10541. cache[exclude.charCodeAt(i)] = exclude[i];
  10542. }
  10543. return cache;
  10544. }
  10545. // Encode unsafe characters with percent-encoding, skipping already
  10546. // encoded sequences.
  10547. //
  10548. // - string - string to encode
  10549. // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
  10550. // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
  10551. //
  10552. function encode(string, exclude, keepEscaped) {
  10553. var i, l, code, nextCode, cache,
  10554. result = '';
  10555. if (typeof exclude !== 'string') {
  10556. // encode(string, keepEscaped)
  10557. keepEscaped = exclude;
  10558. exclude = encode.defaultChars;
  10559. }
  10560. if (typeof keepEscaped === 'undefined') {
  10561. keepEscaped = true;
  10562. }
  10563. cache = getEncodeCache(exclude);
  10564. for (i = 0, l = string.length; i < l; i++) {
  10565. code = string.charCodeAt(i);
  10566. if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
  10567. if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
  10568. result += string.slice(i, i + 3);
  10569. i += 2;
  10570. continue;
  10571. }
  10572. }
  10573. if (code < 128) {
  10574. result += cache[code];
  10575. continue;
  10576. }
  10577. if (code >= 0xD800 && code <= 0xDFFF) {
  10578. if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
  10579. nextCode = string.charCodeAt(i + 1);
  10580. if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
  10581. result += encodeURIComponent(string[i] + string[i + 1]);
  10582. i++;
  10583. continue;
  10584. }
  10585. }
  10586. result += '%EF%BF%BD';
  10587. continue;
  10588. }
  10589. result += encodeURIComponent(string[i]);
  10590. }
  10591. return result;
  10592. }
  10593. encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
  10594. encode.componentChars = "-_.!~*'()";
  10595. module.exports = encode;
  10596. /***/ }),
  10597. /* 78 */
  10598. /***/ (function(module, exports, __webpack_require__) {
  10599. "use strict";
  10600. module.exports = function format(url) {
  10601. var result = '';
  10602. result += url.protocol || '';
  10603. result += url.slashes ? '//' : '';
  10604. result += url.auth ? url.auth + '@' : '';
  10605. if (url.hostname && url.hostname.indexOf(':') !== -1) {
  10606. // ipv6 address
  10607. result += '[' + url.hostname + ']';
  10608. } else {
  10609. result += url.hostname || '';
  10610. }
  10611. result += url.port ? ':' + url.port : '';
  10612. result += url.pathname || '';
  10613. result += url.search || '';
  10614. result += url.hash || '';
  10615. return result;
  10616. };
  10617. /***/ }),
  10618. /* 79 */
  10619. /***/ (function(module, exports, __webpack_require__) {
  10620. "use strict";
  10621. // Copyright Joyent, Inc. and other Node contributors.
  10622. //
  10623. // Permission is hereby granted, free of charge, to any person obtaining a
  10624. // copy of this software and associated documentation files (the
  10625. // "Software"), to deal in the Software without restriction, including
  10626. // without limitation the rights to use, copy, modify, merge, publish,
  10627. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10628. // persons to whom the Software is furnished to do so, subject to the
  10629. // following conditions:
  10630. //
  10631. // The above copyright notice and this permission notice shall be included
  10632. // in all copies or substantial portions of the Software.
  10633. //
  10634. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10635. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10636. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10637. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10638. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10639. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10640. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10641. //
  10642. // Changes from joyent/node:
  10643. //
  10644. // 1. No leading slash in paths,
  10645. // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
  10646. //
  10647. // 2. Backslashes are not replaced with slashes,
  10648. // so `http:\\example.org\` is treated like a relative path
  10649. //
  10650. // 3. Trailing colon is treated like a part of the path,
  10651. // i.e. in `http://example.org:foo` pathname is `:foo`
  10652. //
  10653. // 4. Nothing is URL-encoded in the resulting object,
  10654. // (in joyent/node some chars in auth and paths are encoded)
  10655. //
  10656. // 5. `url.parse()` does not have `parseQueryString` argument
  10657. //
  10658. // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
  10659. // which can be constructed using other parts of the url.
  10660. //
  10661. function Url() {
  10662. this.protocol = null;
  10663. this.slashes = null;
  10664. this.auth = null;
  10665. this.port = null;
  10666. this.hostname = null;
  10667. this.hash = null;
  10668. this.search = null;
  10669. this.pathname = null;
  10670. }
  10671. // Reference: RFC 3986, RFC 1808, RFC 2396
  10672. // define these here so at least they only have to be
  10673. // compiled once on the first module load.
  10674. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  10675. portPattern = /:[0-9]*$/,
  10676. // Special case for a simple path URL
  10677. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  10678. // RFC 2396: characters reserved for delimiting URLs.
  10679. // We actually just auto-escape these.
  10680. delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
  10681. // RFC 2396: characters not allowed for various reasons.
  10682. unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
  10683. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  10684. autoEscape = [ '\'' ].concat(unwise),
  10685. // Characters that are never ever allowed in a hostname.
  10686. // Note that any invalid chars are also handled, but these
  10687. // are the ones that are *expected* to be seen, so we fast-path
  10688. // them.
  10689. nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
  10690. hostEndingChars = [ '/', '?', '#' ],
  10691. hostnameMaxLen = 255,
  10692. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  10693. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  10694. // protocols that can allow "unsafe" and "unwise" chars.
  10695. /* eslint-disable no-script-url */
  10696. // protocols that never have a hostname.
  10697. hostlessProtocol = {
  10698. 'javascript': true,
  10699. 'javascript:': true
  10700. },
  10701. // protocols that always contain a // bit.
  10702. slashedProtocol = {
  10703. 'http': true,
  10704. 'https': true,
  10705. 'ftp': true,
  10706. 'gopher': true,
  10707. 'file': true,
  10708. 'http:': true,
  10709. 'https:': true,
  10710. 'ftp:': true,
  10711. 'gopher:': true,
  10712. 'file:': true
  10713. };
  10714. /* eslint-enable no-script-url */
  10715. function urlParse(url, slashesDenoteHost) {
  10716. if (url && url instanceof Url) { return url; }
  10717. var u = new Url();
  10718. u.parse(url, slashesDenoteHost);
  10719. return u;
  10720. }
  10721. Url.prototype.parse = function(url, slashesDenoteHost) {
  10722. var i, l, lowerProto, hec, slashes,
  10723. rest = url;
  10724. // trim before proceeding.
  10725. // This is to support parse stuff like " http://foo.com \n"
  10726. rest = rest.trim();
  10727. if (!slashesDenoteHost && url.split('#').length === 1) {
  10728. // Try fast path regexp
  10729. var simplePath = simplePathPattern.exec(rest);
  10730. if (simplePath) {
  10731. this.pathname = simplePath[1];
  10732. if (simplePath[2]) {
  10733. this.search = simplePath[2];
  10734. }
  10735. return this;
  10736. }
  10737. }
  10738. var proto = protocolPattern.exec(rest);
  10739. if (proto) {
  10740. proto = proto[0];
  10741. lowerProto = proto.toLowerCase();
  10742. this.protocol = proto;
  10743. rest = rest.substr(proto.length);
  10744. }
  10745. // figure out if it's got a host
  10746. // user@server is *always* interpreted as a hostname, and url
  10747. // resolution will treat //foo/bar as host=foo,path=bar because that's
  10748. // how the browser resolves relative URLs.
  10749. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  10750. slashes = rest.substr(0, 2) === '//';
  10751. if (slashes && !(proto && hostlessProtocol[proto])) {
  10752. rest = rest.substr(2);
  10753. this.slashes = true;
  10754. }
  10755. }
  10756. if (!hostlessProtocol[proto] &&
  10757. (slashes || (proto && !slashedProtocol[proto]))) {
  10758. // there's a hostname.
  10759. // the first instance of /, ?, ;, or # ends the host.
  10760. //
  10761. // If there is an @ in the hostname, then non-host chars *are* allowed
  10762. // to the left of the last @ sign, unless some host-ending character
  10763. // comes *before* the @-sign.
  10764. // URLs are obnoxious.
  10765. //
  10766. // ex:
  10767. // http://a@b@c/ => user:a@b host:c
  10768. // http://a@b?@c => user:a host:c path:/?@c
  10769. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  10770. // Review our test case against browsers more comprehensively.
  10771. // find the first instance of any hostEndingChars
  10772. var hostEnd = -1;
  10773. for (i = 0; i < hostEndingChars.length; i++) {
  10774. hec = rest.indexOf(hostEndingChars[i]);
  10775. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10776. hostEnd = hec;
  10777. }
  10778. }
  10779. // at this point, either we have an explicit point where the
  10780. // auth portion cannot go past, or the last @ char is the decider.
  10781. var auth, atSign;
  10782. if (hostEnd === -1) {
  10783. // atSign can be anywhere.
  10784. atSign = rest.lastIndexOf('@');
  10785. } else {
  10786. // atSign must be in auth portion.
  10787. // http://a@b/c@d => host:b auth:a path:/c@d
  10788. atSign = rest.lastIndexOf('@', hostEnd);
  10789. }
  10790. // Now we have a portion which is definitely the auth.
  10791. // Pull that off.
  10792. if (atSign !== -1) {
  10793. auth = rest.slice(0, atSign);
  10794. rest = rest.slice(atSign + 1);
  10795. this.auth = auth;
  10796. }
  10797. // the host is the remaining to the left of the first non-host char
  10798. hostEnd = -1;
  10799. for (i = 0; i < nonHostChars.length; i++) {
  10800. hec = rest.indexOf(nonHostChars[i]);
  10801. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10802. hostEnd = hec;
  10803. }
  10804. }
  10805. // if we still have not hit it, then the entire thing is a host.
  10806. if (hostEnd === -1) {
  10807. hostEnd = rest.length;
  10808. }
  10809. if (rest[hostEnd - 1] === ':') { hostEnd--; }
  10810. var host = rest.slice(0, hostEnd);
  10811. rest = rest.slice(hostEnd);
  10812. // pull out port.
  10813. this.parseHost(host);
  10814. // we've indicated that there is a hostname,
  10815. // so even if it's empty, it has to be present.
  10816. this.hostname = this.hostname || '';
  10817. // if hostname begins with [ and ends with ]
  10818. // assume that it's an IPv6 address.
  10819. var ipv6Hostname = this.hostname[0] === '[' &&
  10820. this.hostname[this.hostname.length - 1] === ']';
  10821. // validate a little.
  10822. if (!ipv6Hostname) {
  10823. var hostparts = this.hostname.split(/\./);
  10824. for (i = 0, l = hostparts.length; i < l; i++) {
  10825. var part = hostparts[i];
  10826. if (!part) { continue; }
  10827. if (!part.match(hostnamePartPattern)) {
  10828. var newpart = '';
  10829. for (var j = 0, k = part.length; j < k; j++) {
  10830. if (part.charCodeAt(j) > 127) {
  10831. // we replace non-ASCII char with a temporary placeholder
  10832. // we need this to make sure size of hostname is not
  10833. // broken by replacing non-ASCII by nothing
  10834. newpart += 'x';
  10835. } else {
  10836. newpart += part[j];
  10837. }
  10838. }
  10839. // we test again with ASCII char only
  10840. if (!newpart.match(hostnamePartPattern)) {
  10841. var validParts = hostparts.slice(0, i);
  10842. var notHost = hostparts.slice(i + 1);
  10843. var bit = part.match(hostnamePartStart);
  10844. if (bit) {
  10845. validParts.push(bit[1]);
  10846. notHost.unshift(bit[2]);
  10847. }
  10848. if (notHost.length) {
  10849. rest = notHost.join('.') + rest;
  10850. }
  10851. this.hostname = validParts.join('.');
  10852. break;
  10853. }
  10854. }
  10855. }
  10856. }
  10857. if (this.hostname.length > hostnameMaxLen) {
  10858. this.hostname = '';
  10859. }
  10860. // strip [ and ] from the hostname
  10861. // the host field still retains them, though
  10862. if (ipv6Hostname) {
  10863. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  10864. }
  10865. }
  10866. // chop off from the tail first.
  10867. var hash = rest.indexOf('#');
  10868. if (hash !== -1) {
  10869. // got a fragment string.
  10870. this.hash = rest.substr(hash);
  10871. rest = rest.slice(0, hash);
  10872. }
  10873. var qm = rest.indexOf('?');
  10874. if (qm !== -1) {
  10875. this.search = rest.substr(qm);
  10876. rest = rest.slice(0, qm);
  10877. }
  10878. if (rest) { this.pathname = rest; }
  10879. if (slashedProtocol[lowerProto] &&
  10880. this.hostname && !this.pathname) {
  10881. this.pathname = '';
  10882. }
  10883. return this;
  10884. };
  10885. Url.prototype.parseHost = function(host) {
  10886. var port = portPattern.exec(host);
  10887. if (port) {
  10888. port = port[0];
  10889. if (port !== ':') {
  10890. this.port = port.substr(1);
  10891. }
  10892. host = host.substr(0, host.length - port.length);
  10893. }
  10894. if (host) { this.hostname = host; }
  10895. };
  10896. module.exports = urlParse;
  10897. /***/ }),
  10898. /* 80 */
  10899. /***/ (function(module, exports) {
  10900. // shim for using process in browser
  10901. var process = module.exports = {};
  10902. // cached from whatever global is present so that test runners that stub it
  10903. // don't break things. But we need to wrap it in a try catch in case it is
  10904. // wrapped in strict mode code which doesn't define any globals. It's inside a
  10905. // function because try/catches deoptimize in certain engines.
  10906. var cachedSetTimeout;
  10907. var cachedClearTimeout;
  10908. function defaultSetTimout() {
  10909. throw new Error('setTimeout has not been defined');
  10910. }
  10911. function defaultClearTimeout () {
  10912. throw new Error('clearTimeout has not been defined');
  10913. }
  10914. (function () {
  10915. try {
  10916. if (typeof setTimeout === 'function') {
  10917. cachedSetTimeout = setTimeout;
  10918. } else {
  10919. cachedSetTimeout = defaultSetTimout;
  10920. }
  10921. } catch (e) {
  10922. cachedSetTimeout = defaultSetTimout;
  10923. }
  10924. try {
  10925. if (typeof clearTimeout === 'function') {
  10926. cachedClearTimeout = clearTimeout;
  10927. } else {
  10928. cachedClearTimeout = defaultClearTimeout;
  10929. }
  10930. } catch (e) {
  10931. cachedClearTimeout = defaultClearTimeout;
  10932. }
  10933. } ())
  10934. function runTimeout(fun) {
  10935. if (cachedSetTimeout === setTimeout) {
  10936. //normal enviroments in sane situations
  10937. return setTimeout(fun, 0);
  10938. }
  10939. // if setTimeout wasn't available but was latter defined
  10940. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  10941. cachedSetTimeout = setTimeout;
  10942. return setTimeout(fun, 0);
  10943. }
  10944. try {
  10945. // when when somebody has screwed with setTimeout but no I.E. maddness
  10946. return cachedSetTimeout(fun, 0);
  10947. } catch(e){
  10948. try {
  10949. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10950. return cachedSetTimeout.call(null, fun, 0);
  10951. } catch(e){
  10952. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  10953. return cachedSetTimeout.call(this, fun, 0);
  10954. }
  10955. }
  10956. }
  10957. function runClearTimeout(marker) {
  10958. if (cachedClearTimeout === clearTimeout) {
  10959. //normal enviroments in sane situations
  10960. return clearTimeout(marker);
  10961. }
  10962. // if clearTimeout wasn't available but was latter defined
  10963. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  10964. cachedClearTimeout = clearTimeout;
  10965. return clearTimeout(marker);
  10966. }
  10967. try {
  10968. // when when somebody has screwed with setTimeout but no I.E. maddness
  10969. return cachedClearTimeout(marker);
  10970. } catch (e){
  10971. try {
  10972. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10973. return cachedClearTimeout.call(null, marker);
  10974. } catch (e){
  10975. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  10976. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  10977. return cachedClearTimeout.call(this, marker);
  10978. }
  10979. }
  10980. }
  10981. var queue = [];
  10982. var draining = false;
  10983. var currentQueue;
  10984. var queueIndex = -1;
  10985. function cleanUpNextTick() {
  10986. if (!draining || !currentQueue) {
  10987. return;
  10988. }
  10989. draining = false;
  10990. if (currentQueue.length) {
  10991. queue = currentQueue.concat(queue);
  10992. } else {
  10993. queueIndex = -1;
  10994. }
  10995. if (queue.length) {
  10996. drainQueue();
  10997. }
  10998. }
  10999. function drainQueue() {
  11000. if (draining) {
  11001. return;
  11002. }
  11003. var timeout = runTimeout(cleanUpNextTick);
  11004. draining = true;
  11005. var len = queue.length;
  11006. while(len) {
  11007. currentQueue = queue;
  11008. queue = [];
  11009. while (++queueIndex < len) {
  11010. if (currentQueue) {
  11011. currentQueue[queueIndex].run();
  11012. }
  11013. }
  11014. queueIndex = -1;
  11015. len = queue.length;
  11016. }
  11017. currentQueue = null;
  11018. draining = false;
  11019. runClearTimeout(timeout);
  11020. }
  11021. process.nextTick = function (fun) {
  11022. var args = new Array(arguments.length - 1);
  11023. if (arguments.length > 1) {
  11024. for (var i = 1; i < arguments.length; i++) {
  11025. args[i - 1] = arguments[i];
  11026. }
  11027. }
  11028. queue.push(new Item(fun, args));
  11029. if (queue.length === 1 && !draining) {
  11030. runTimeout(drainQueue);
  11031. }
  11032. };
  11033. // v8 likes predictible objects
  11034. function Item(fun, array) {
  11035. this.fun = fun;
  11036. this.array = array;
  11037. }
  11038. Item.prototype.run = function () {
  11039. this.fun.apply(null, this.array);
  11040. };
  11041. process.title = 'browser';
  11042. process.browser = true;
  11043. process.env = {};
  11044. process.argv = [];
  11045. process.version = ''; // empty string to avoid regexp issues
  11046. process.versions = {};
  11047. function noop() {}
  11048. process.on = noop;
  11049. process.addListener = noop;
  11050. process.once = noop;
  11051. process.off = noop;
  11052. process.removeListener = noop;
  11053. process.removeAllListeners = noop;
  11054. process.emit = noop;
  11055. process.binding = function (name) {
  11056. throw new Error('process.binding is not supported');
  11057. };
  11058. process.cwd = function () { return '/' };
  11059. process.chdir = function (dir) {
  11060. throw new Error('process.chdir is not supported');
  11061. };
  11062. process.umask = function() { return 0; };
  11063. /***/ }),
  11064. /* 81 */
  11065. /***/ (function(module, exports, __webpack_require__) {
  11066. /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  11067. ;(function(root) {
  11068. /** Detect free variables */
  11069. var freeExports = typeof exports == 'object' && exports &&
  11070. !exports.nodeType && exports;
  11071. var freeModule = typeof module == 'object' && module &&
  11072. !module.nodeType && module;
  11073. var freeGlobal = typeof global == 'object' && global;
  11074. if (
  11075. freeGlobal.global === freeGlobal ||
  11076. freeGlobal.window === freeGlobal ||
  11077. freeGlobal.self === freeGlobal
  11078. ) {
  11079. root = freeGlobal;
  11080. }
  11081. /**
  11082. * The `punycode` object.
  11083. * @name punycode
  11084. * @type Object
  11085. */
  11086. var punycode,
  11087. /** Highest positive signed 32-bit float value */
  11088. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  11089. /** Bootstring parameters */
  11090. base = 36,
  11091. tMin = 1,
  11092. tMax = 26,
  11093. skew = 38,
  11094. damp = 700,
  11095. initialBias = 72,
  11096. initialN = 128, // 0x80
  11097. delimiter = '-', // '\x2D'
  11098. /** Regular expressions */
  11099. regexPunycode = /^xn--/,
  11100. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  11101. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  11102. /** Error messages */
  11103. errors = {
  11104. 'overflow': 'Overflow: input needs wider integers to process',
  11105. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  11106. 'invalid-input': 'Invalid input'
  11107. },
  11108. /** Convenience shortcuts */
  11109. baseMinusTMin = base - tMin,
  11110. floor = Math.floor,
  11111. stringFromCharCode = String.fromCharCode,
  11112. /** Temporary variable */
  11113. key;
  11114. /*--------------------------------------------------------------------------*/
  11115. /**
  11116. * A generic error utility function.
  11117. * @private
  11118. * @param {String} type The error type.
  11119. * @returns {Error} Throws a `RangeError` with the applicable error message.
  11120. */
  11121. function error(type) {
  11122. throw new RangeError(errors[type]);
  11123. }
  11124. /**
  11125. * A generic `Array#map` utility function.
  11126. * @private
  11127. * @param {Array} array The array to iterate over.
  11128. * @param {Function} callback The function that gets called for every array
  11129. * item.
  11130. * @returns {Array} A new array of values returned by the callback function.
  11131. */
  11132. function map(array, fn) {
  11133. var length = array.length;
  11134. var result = [];
  11135. while (length--) {
  11136. result[length] = fn(array[length]);
  11137. }
  11138. return result;
  11139. }
  11140. /**
  11141. * A simple `Array#map`-like wrapper to work with domain name strings or email
  11142. * addresses.
  11143. * @private
  11144. * @param {String} domain The domain name or email address.
  11145. * @param {Function} callback The function that gets called for every
  11146. * character.
  11147. * @returns {Array} A new string of characters returned by the callback
  11148. * function.
  11149. */
  11150. function mapDomain(string, fn) {
  11151. var parts = string.split('@');
  11152. var result = '';
  11153. if (parts.length > 1) {
  11154. // In email addresses, only the domain name should be punycoded. Leave
  11155. // the local part (i.e. everything up to `@`) intact.
  11156. result = parts[0] + '@';
  11157. string = parts[1];
  11158. }
  11159. // Avoid `split(regex)` for IE8 compatibility. See #17.
  11160. string = string.replace(regexSeparators, '\x2E');
  11161. var labels = string.split('.');
  11162. var encoded = map(labels, fn).join('.');
  11163. return result + encoded;
  11164. }
  11165. /**
  11166. * Creates an array containing the numeric code points of each Unicode
  11167. * character in the string. While JavaScript uses UCS-2 internally,
  11168. * this function will convert a pair of surrogate halves (each of which
  11169. * UCS-2 exposes as separate characters) into a single code point,
  11170. * matching UTF-16.
  11171. * @see `punycode.ucs2.encode`
  11172. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11173. * @memberOf punycode.ucs2
  11174. * @name decode
  11175. * @param {String} string The Unicode input string (UCS-2).
  11176. * @returns {Array} The new array of code points.
  11177. */
  11178. function ucs2decode(string) {
  11179. var output = [],
  11180. counter = 0,
  11181. length = string.length,
  11182. value,
  11183. extra;
  11184. while (counter < length) {
  11185. value = string.charCodeAt(counter++);
  11186. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  11187. // high surrogate, and there is a next character
  11188. extra = string.charCodeAt(counter++);
  11189. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  11190. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  11191. } else {
  11192. // unmatched surrogate; only append this code unit, in case the next
  11193. // code unit is the high surrogate of a surrogate pair
  11194. output.push(value);
  11195. counter--;
  11196. }
  11197. } else {
  11198. output.push(value);
  11199. }
  11200. }
  11201. return output;
  11202. }
  11203. /**
  11204. * Creates a string based on an array of numeric code points.
  11205. * @see `punycode.ucs2.decode`
  11206. * @memberOf punycode.ucs2
  11207. * @name encode
  11208. * @param {Array} codePoints The array of numeric code points.
  11209. * @returns {String} The new Unicode string (UCS-2).
  11210. */
  11211. function ucs2encode(array) {
  11212. return map(array, function(value) {
  11213. var output = '';
  11214. if (value > 0xFFFF) {
  11215. value -= 0x10000;
  11216. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  11217. value = 0xDC00 | value & 0x3FF;
  11218. }
  11219. output += stringFromCharCode(value);
  11220. return output;
  11221. }).join('');
  11222. }
  11223. /**
  11224. * Converts a basic code point into a digit/integer.
  11225. * @see `digitToBasic()`
  11226. * @private
  11227. * @param {Number} codePoint The basic numeric code point value.
  11228. * @returns {Number} The numeric value of a basic code point (for use in
  11229. * representing integers) in the range `0` to `base - 1`, or `base` if
  11230. * the code point does not represent a value.
  11231. */
  11232. function basicToDigit(codePoint) {
  11233. if (codePoint - 48 < 10) {
  11234. return codePoint - 22;
  11235. }
  11236. if (codePoint - 65 < 26) {
  11237. return codePoint - 65;
  11238. }
  11239. if (codePoint - 97 < 26) {
  11240. return codePoint - 97;
  11241. }
  11242. return base;
  11243. }
  11244. /**
  11245. * Converts a digit/integer into a basic code point.
  11246. * @see `basicToDigit()`
  11247. * @private
  11248. * @param {Number} digit The numeric value of a basic code point.
  11249. * @returns {Number} The basic code point whose value (when used for
  11250. * representing integers) is `digit`, which needs to be in the range
  11251. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  11252. * used; else, the lowercase form is used. The behavior is undefined
  11253. * if `flag` is non-zero and `digit` has no uppercase form.
  11254. */
  11255. function digitToBasic(digit, flag) {
  11256. // 0..25 map to ASCII a..z or A..Z
  11257. // 26..35 map to ASCII 0..9
  11258. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  11259. }
  11260. /**
  11261. * Bias adaptation function as per section 3.4 of RFC 3492.
  11262. * https://tools.ietf.org/html/rfc3492#section-3.4
  11263. * @private
  11264. */
  11265. function adapt(delta, numPoints, firstTime) {
  11266. var k = 0;
  11267. delta = firstTime ? floor(delta / damp) : delta >> 1;
  11268. delta += floor(delta / numPoints);
  11269. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  11270. delta = floor(delta / baseMinusTMin);
  11271. }
  11272. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  11273. }
  11274. /**
  11275. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  11276. * symbols.
  11277. * @memberOf punycode
  11278. * @param {String} input The Punycode string of ASCII-only symbols.
  11279. * @returns {String} The resulting string of Unicode symbols.
  11280. */
  11281. function decode(input) {
  11282. // Don't use UCS-2
  11283. var output = [],
  11284. inputLength = input.length,
  11285. out,
  11286. i = 0,
  11287. n = initialN,
  11288. bias = initialBias,
  11289. basic,
  11290. j,
  11291. index,
  11292. oldi,
  11293. w,
  11294. k,
  11295. digit,
  11296. t,
  11297. /** Cached calculation results */
  11298. baseMinusT;
  11299. // Handle the basic code points: let `basic` be the number of input code
  11300. // points before the last delimiter, or `0` if there is none, then copy
  11301. // the first basic code points to the output.
  11302. basic = input.lastIndexOf(delimiter);
  11303. if (basic < 0) {
  11304. basic = 0;
  11305. }
  11306. for (j = 0; j < basic; ++j) {
  11307. // if it's not a basic code point
  11308. if (input.charCodeAt(j) >= 0x80) {
  11309. error('not-basic');
  11310. }
  11311. output.push(input.charCodeAt(j));
  11312. }
  11313. // Main decoding loop: start just after the last delimiter if any basic code
  11314. // points were copied; start at the beginning otherwise.
  11315. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  11316. // `index` is the index of the next character to be consumed.
  11317. // Decode a generalized variable-length integer into `delta`,
  11318. // which gets added to `i`. The overflow checking is easier
  11319. // if we increase `i` as we go, then subtract off its starting
  11320. // value at the end to obtain `delta`.
  11321. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  11322. if (index >= inputLength) {
  11323. error('invalid-input');
  11324. }
  11325. digit = basicToDigit(input.charCodeAt(index++));
  11326. if (digit >= base || digit > floor((maxInt - i) / w)) {
  11327. error('overflow');
  11328. }
  11329. i += digit * w;
  11330. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11331. if (digit < t) {
  11332. break;
  11333. }
  11334. baseMinusT = base - t;
  11335. if (w > floor(maxInt / baseMinusT)) {
  11336. error('overflow');
  11337. }
  11338. w *= baseMinusT;
  11339. }
  11340. out = output.length + 1;
  11341. bias = adapt(i - oldi, out, oldi == 0);
  11342. // `i` was supposed to wrap around from `out` to `0`,
  11343. // incrementing `n` each time, so we'll fix that now:
  11344. if (floor(i / out) > maxInt - n) {
  11345. error('overflow');
  11346. }
  11347. n += floor(i / out);
  11348. i %= out;
  11349. // Insert `n` at position `i` of the output
  11350. output.splice(i++, 0, n);
  11351. }
  11352. return ucs2encode(output);
  11353. }
  11354. /**
  11355. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  11356. * Punycode string of ASCII-only symbols.
  11357. * @memberOf punycode
  11358. * @param {String} input The string of Unicode symbols.
  11359. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  11360. */
  11361. function encode(input) {
  11362. var n,
  11363. delta,
  11364. handledCPCount,
  11365. basicLength,
  11366. bias,
  11367. j,
  11368. m,
  11369. q,
  11370. k,
  11371. t,
  11372. currentValue,
  11373. output = [],
  11374. /** `inputLength` will hold the number of code points in `input`. */
  11375. inputLength,
  11376. /** Cached calculation results */
  11377. handledCPCountPlusOne,
  11378. baseMinusT,
  11379. qMinusT;
  11380. // Convert the input in UCS-2 to Unicode
  11381. input = ucs2decode(input);
  11382. // Cache the length
  11383. inputLength = input.length;
  11384. // Initialize the state
  11385. n = initialN;
  11386. delta = 0;
  11387. bias = initialBias;
  11388. // Handle the basic code points
  11389. for (j = 0; j < inputLength; ++j) {
  11390. currentValue = input[j];
  11391. if (currentValue < 0x80) {
  11392. output.push(stringFromCharCode(currentValue));
  11393. }
  11394. }
  11395. handledCPCount = basicLength = output.length;
  11396. // `handledCPCount` is the number of code points that have been handled;
  11397. // `basicLength` is the number of basic code points.
  11398. // Finish the basic string - if it is not empty - with a delimiter
  11399. if (basicLength) {
  11400. output.push(delimiter);
  11401. }
  11402. // Main encoding loop:
  11403. while (handledCPCount < inputLength) {
  11404. // All non-basic code points < n have been handled already. Find the next
  11405. // larger one:
  11406. for (m = maxInt, j = 0; j < inputLength; ++j) {
  11407. currentValue = input[j];
  11408. if (currentValue >= n && currentValue < m) {
  11409. m = currentValue;
  11410. }
  11411. }
  11412. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  11413. // but guard against overflow
  11414. handledCPCountPlusOne = handledCPCount + 1;
  11415. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  11416. error('overflow');
  11417. }
  11418. delta += (m - n) * handledCPCountPlusOne;
  11419. n = m;
  11420. for (j = 0; j < inputLength; ++j) {
  11421. currentValue = input[j];
  11422. if (currentValue < n && ++delta > maxInt) {
  11423. error('overflow');
  11424. }
  11425. if (currentValue == n) {
  11426. // Represent delta as a generalized variable-length integer
  11427. for (q = delta, k = base; /* no condition */; k += base) {
  11428. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11429. if (q < t) {
  11430. break;
  11431. }
  11432. qMinusT = q - t;
  11433. baseMinusT = base - t;
  11434. output.push(
  11435. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  11436. );
  11437. q = floor(qMinusT / baseMinusT);
  11438. }
  11439. output.push(stringFromCharCode(digitToBasic(q, 0)));
  11440. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  11441. delta = 0;
  11442. ++handledCPCount;
  11443. }
  11444. }
  11445. ++delta;
  11446. ++n;
  11447. }
  11448. return output.join('');
  11449. }
  11450. /**
  11451. * Converts a Punycode string representing a domain name or an email address
  11452. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  11453. * it doesn't matter if you call it on a string that has already been
  11454. * converted to Unicode.
  11455. * @memberOf punycode
  11456. * @param {String} input The Punycoded domain name or email address to
  11457. * convert to Unicode.
  11458. * @returns {String} The Unicode representation of the given Punycode
  11459. * string.
  11460. */
  11461. function toUnicode(input) {
  11462. return mapDomain(input, function(string) {
  11463. return regexPunycode.test(string)
  11464. ? decode(string.slice(4).toLowerCase())
  11465. : string;
  11466. });
  11467. }
  11468. /**
  11469. * Converts a Unicode string representing a domain name or an email address to
  11470. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  11471. * i.e. it doesn't matter if you call it with a domain that's already in
  11472. * ASCII.
  11473. * @memberOf punycode
  11474. * @param {String} input The domain name or email address to convert, as a
  11475. * Unicode string.
  11476. * @returns {String} The Punycode representation of the given domain name or
  11477. * email address.
  11478. */
  11479. function toASCII(input) {
  11480. return mapDomain(input, function(string) {
  11481. return regexNonASCII.test(string)
  11482. ? 'xn--' + encode(string)
  11483. : string;
  11484. });
  11485. }
  11486. /*--------------------------------------------------------------------------*/
  11487. /** Define the public API */
  11488. punycode = {
  11489. /**
  11490. * A string representing the current Punycode.js version number.
  11491. * @memberOf punycode
  11492. * @type String
  11493. */
  11494. 'version': '1.4.1',
  11495. /**
  11496. * An object of methods to convert from JavaScript's internal character
  11497. * representation (UCS-2) to Unicode code points, and back.
  11498. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11499. * @memberOf punycode
  11500. * @type Object
  11501. */
  11502. 'ucs2': {
  11503. 'decode': ucs2decode,
  11504. 'encode': ucs2encode
  11505. },
  11506. 'decode': decode,
  11507. 'encode': encode,
  11508. 'toASCII': toASCII,
  11509. 'toUnicode': toUnicode
  11510. };
  11511. /** Expose `punycode` */
  11512. // Some AMD build optimizers, like r.js, check for specific condition patterns
  11513. // like the following:
  11514. if (
  11515. true
  11516. ) {
  11517. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11518. return punycode;
  11519. }.call(exports, __webpack_require__, exports, module),
  11520. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11521. } else if (freeExports && freeModule) {
  11522. if (module.exports == freeExports) {
  11523. // in Node.js, io.js, or RingoJS v0.8.0+
  11524. freeModule.exports = punycode;
  11525. } else {
  11526. // in Narwhal or RingoJS v0.7.0-
  11527. for (key in punycode) {
  11528. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  11529. }
  11530. }
  11531. } else {
  11532. // in Rhino or a web browser
  11533. root.punycode = punycode;
  11534. }
  11535. }(this));
  11536. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module), __webpack_require__(6)))
  11537. /***/ }),
  11538. /* 82 */
  11539. /***/ (function(module, exports, __webpack_require__) {
  11540. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  11541. "use strict";
  11542. if (global.setImmediate) {
  11543. return;
  11544. }
  11545. var nextHandle = 1; // Spec says greater than zero
  11546. var tasksByHandle = {};
  11547. var currentlyRunningATask = false;
  11548. var doc = global.document;
  11549. var registerImmediate;
  11550. function setImmediate(callback) {
  11551. // Callback can either be a function or a string
  11552. if (typeof callback !== "function") {
  11553. callback = new Function("" + callback);
  11554. }
  11555. // Copy function arguments
  11556. var args = new Array(arguments.length - 1);
  11557. for (var i = 0; i < args.length; i++) {
  11558. args[i] = arguments[i + 1];
  11559. }
  11560. // Store and register the task
  11561. var task = { callback: callback, args: args };
  11562. tasksByHandle[nextHandle] = task;
  11563. registerImmediate(nextHandle);
  11564. return nextHandle++;
  11565. }
  11566. function clearImmediate(handle) {
  11567. delete tasksByHandle[handle];
  11568. }
  11569. function run(task) {
  11570. var callback = task.callback;
  11571. var args = task.args;
  11572. switch (args.length) {
  11573. case 0:
  11574. callback();
  11575. break;
  11576. case 1:
  11577. callback(args[0]);
  11578. break;
  11579. case 2:
  11580. callback(args[0], args[1]);
  11581. break;
  11582. case 3:
  11583. callback(args[0], args[1], args[2]);
  11584. break;
  11585. default:
  11586. callback.apply(undefined, args);
  11587. break;
  11588. }
  11589. }
  11590. function runIfPresent(handle) {
  11591. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  11592. // So if we're currently running a task, we'll need to delay this invocation.
  11593. if (currentlyRunningATask) {
  11594. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  11595. // "too much recursion" error.
  11596. setTimeout(runIfPresent, 0, handle);
  11597. } else {
  11598. var task = tasksByHandle[handle];
  11599. if (task) {
  11600. currentlyRunningATask = true;
  11601. try {
  11602. run(task);
  11603. } finally {
  11604. clearImmediate(handle);
  11605. currentlyRunningATask = false;
  11606. }
  11607. }
  11608. }
  11609. }
  11610. function installNextTickImplementation() {
  11611. registerImmediate = function(handle) {
  11612. process.nextTick(function () { runIfPresent(handle); });
  11613. };
  11614. }
  11615. function canUsePostMessage() {
  11616. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  11617. // where `global.postMessage` means something completely different and can't be used for this purpose.
  11618. if (global.postMessage && !global.importScripts) {
  11619. var postMessageIsAsynchronous = true;
  11620. var oldOnMessage = global.onmessage;
  11621. global.onmessage = function() {
  11622. postMessageIsAsynchronous = false;
  11623. };
  11624. global.postMessage("", "*");
  11625. global.onmessage = oldOnMessage;
  11626. return postMessageIsAsynchronous;
  11627. }
  11628. }
  11629. function installPostMessageImplementation() {
  11630. // Installs an event handler on `global` for the `message` event: see
  11631. // * https://developer.mozilla.org/en/DOM/window.postMessage
  11632. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  11633. var messagePrefix = "setImmediate$" + Math.random() + "$";
  11634. var onGlobalMessage = function(event) {
  11635. if (event.source === global &&
  11636. typeof event.data === "string" &&
  11637. event.data.indexOf(messagePrefix) === 0) {
  11638. runIfPresent(+event.data.slice(messagePrefix.length));
  11639. }
  11640. };
  11641. if (global.addEventListener) {
  11642. global.addEventListener("message", onGlobalMessage, false);
  11643. } else {
  11644. global.attachEvent("onmessage", onGlobalMessage);
  11645. }
  11646. registerImmediate = function(handle) {
  11647. global.postMessage(messagePrefix + handle, "*");
  11648. };
  11649. }
  11650. function installMessageChannelImplementation() {
  11651. var channel = new MessageChannel();
  11652. channel.port1.onmessage = function(event) {
  11653. var handle = event.data;
  11654. runIfPresent(handle);
  11655. };
  11656. registerImmediate = function(handle) {
  11657. channel.port2.postMessage(handle);
  11658. };
  11659. }
  11660. function installReadyStateChangeImplementation() {
  11661. var html = doc.documentElement;
  11662. registerImmediate = function(handle) {
  11663. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  11664. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  11665. var script = doc.createElement("script");
  11666. script.onreadystatechange = function () {
  11667. runIfPresent(handle);
  11668. script.onreadystatechange = null;
  11669. html.removeChild(script);
  11670. script = null;
  11671. };
  11672. html.appendChild(script);
  11673. };
  11674. }
  11675. function installSetTimeoutImplementation() {
  11676. registerImmediate = function(handle) {
  11677. setTimeout(runIfPresent, 0, handle);
  11678. };
  11679. }
  11680. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  11681. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  11682. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  11683. // Don't get fooled by e.g. browserify environments.
  11684. if ({}.toString.call(global.process) === "[object process]") {
  11685. // For Node.js before 0.9
  11686. installNextTickImplementation();
  11687. } else if (canUsePostMessage()) {
  11688. // For non-IE10 modern browsers
  11689. installPostMessageImplementation();
  11690. } else if (global.MessageChannel) {
  11691. // For web workers, where supported
  11692. installMessageChannelImplementation();
  11693. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  11694. // For IE 6–8
  11695. installReadyStateChangeImplementation();
  11696. } else {
  11697. // For older browsers
  11698. installSetTimeoutImplementation();
  11699. }
  11700. attachTo.setImmediate = setImmediate;
  11701. attachTo.clearImmediate = clearImmediate;
  11702. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  11703. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(80)))
  11704. /***/ }),
  11705. /* 83 */
  11706. /***/ (function(module, exports, __webpack_require__) {
  11707. var apply = Function.prototype.apply;
  11708. // DOM APIs, for completeness
  11709. exports.setTimeout = function() {
  11710. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  11711. };
  11712. exports.setInterval = function() {
  11713. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  11714. };
  11715. exports.clearTimeout =
  11716. exports.clearInterval = function(timeout) {
  11717. if (timeout) {
  11718. timeout.close();
  11719. }
  11720. };
  11721. function Timeout(id, clearFn) {
  11722. this._id = id;
  11723. this._clearFn = clearFn;
  11724. }
  11725. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  11726. Timeout.prototype.close = function() {
  11727. this._clearFn.call(window, this._id);
  11728. };
  11729. // Does not start the time, just sets up the members needed.
  11730. exports.enroll = function(item, msecs) {
  11731. clearTimeout(item._idleTimeoutId);
  11732. item._idleTimeout = msecs;
  11733. };
  11734. exports.unenroll = function(item) {
  11735. clearTimeout(item._idleTimeoutId);
  11736. item._idleTimeout = -1;
  11737. };
  11738. exports._unrefActive = exports.active = function(item) {
  11739. clearTimeout(item._idleTimeoutId);
  11740. var msecs = item._idleTimeout;
  11741. if (msecs >= 0) {
  11742. item._idleTimeoutId = setTimeout(function onTimeout() {
  11743. if (item._onTimeout)
  11744. item._onTimeout();
  11745. }, msecs);
  11746. }
  11747. };
  11748. // setimmediate attaches itself to the global object
  11749. __webpack_require__(82);
  11750. exports.setImmediate = setImmediate;
  11751. exports.clearImmediate = clearImmediate;
  11752. /***/ }),
  11753. /* 84 */
  11754. /***/ (function(module, exports) {
  11755. module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
  11756. /***/ }),
  11757. /* 85 */
  11758. /***/ (function(module, exports, __webpack_require__) {
  11759. "use strict";
  11760. exports.Any = __webpack_require__(18);
  11761. exports.Cc = __webpack_require__(16);
  11762. exports.Cf = __webpack_require__(84);
  11763. exports.P = __webpack_require__(5);
  11764. exports.Z = __webpack_require__(17);
  11765. /***/ }),
  11766. /* 86 */
  11767. /***/ (function(module, exports) {
  11768. module.exports = function(module) {
  11769. if(!module.webpackPolyfill) {
  11770. module.deprecate = function() {};
  11771. module.paths = [];
  11772. // module.parent = undefined by default
  11773. if(!module.children) module.children = [];
  11774. Object.defineProperty(module, "loaded", {
  11775. enumerable: true,
  11776. get: function() {
  11777. return module.l;
  11778. }
  11779. });
  11780. Object.defineProperty(module, "id", {
  11781. enumerable: true,
  11782. get: function() {
  11783. return module.i;
  11784. }
  11785. });
  11786. module.webpackPolyfill = 1;
  11787. }
  11788. return module;
  11789. };
  11790. /***/ }),
  11791. /* 87 */
  11792. /***/ (function(module, exports, __webpack_require__) {
  11793. __webpack_require__(19);
  11794. module.exports = __webpack_require__(20);
  11795. /***/ })
  11796. /******/ ]);
  11797. //# sourceMappingURL=main.js.map