main.js 356 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822
  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 (n.tag == 'img') {
  2980. // record the href attribute for cross reference
  2981. n.attrs = {
  2982. 'src':nodes[i].attributes.src.value,
  2983. 'alt':nodes[i].attributes.alt.value
  2984. };
  2985. }
  2986. if(nodes[i].childNodes.length){
  2987. // again parse node's childs
  2988. n.childs = parseTextDom(nodes[i].childNodes);
  2989. }
  2990. }else if (nodes[i].textContent.length > 1){
  2991. // if node has no localName it is probably a #text node
  2992. // we record it if it's not empty
  2993. n.tag='#text';
  2994. n.text=nodes[i].textContent;
  2995. }
  2996. // add the node to the list if it has a tag
  2997. if(typeof n.tag != "undefined")
  2998. list.push(n);
  2999. }
  3000. return list;
  3001. }
  3002. // recusive fucntion to generate mithril object from information recorded with parseTextDom()
  3003. function populateTextDom(n,i){
  3004. // console.log('populateTextDom : '+i,n);
  3005. return n.tag == "#text"
  3006. ? m.trust(n.text)
  3007. : m(
  3008. n.tag != 'a' ? n.tag : _Link,
  3009. typeof n.attrs != "undefined" ? n.attrs : {},
  3010. typeof n.childs != "undefined"
  3011. ? n.childs.map(populateTextDom)
  3012. : typeof n.text != "undefined"
  3013. ? m.trust(n.text)
  3014. : null
  3015. );
  3016. }
  3017. var _Text = {
  3018. id:null,
  3019. text:"",
  3020. texthtml:"",
  3021. textdom:null,
  3022. textchilds:[],
  3023. parsetext: function(){
  3024. // console.log('parsetext', this);
  3025. // !! we need to convert markdown to html here because parseTextDom() is recursive through nodes tree
  3026. // convert markdown to html
  3027. this.texthtml = markdown.render(this.text)
  3028. // TODO: fixe number link text disapear [3](1d3) ( in 104d )
  3029. // TODO: fixe parenthèse disparait _(par les Défin. [test 3](1d3) et [test 5](1d5))_ ( in 104d )
  3030. // parse html string to virtual dom
  3031. this.textdom = new DOMParser().parseFromString(this.texthtml, "text/html");
  3032. // get the text nodes (avoid html document extra)
  3033. this.textchilds = parseTextDom(this.textdom.getElementsByTagName('body')[0].childNodes);
  3034. if(this.id == "115sc"){
  3035. console.log(this.textchilds);
  3036. }
  3037. },
  3038. oninit: function(vn){
  3039. this.id = vn.attrs.id;
  3040. this.text = vn.attrs.text || "";
  3041. this.parsetext();
  3042. },
  3043. onbeforeupdate: function(vn,old){
  3044. this.text = vn.attrs.text;
  3045. this.parsetext();
  3046. },
  3047. view: function(vn){
  3048. // console.log('_Text :: view : '+vn.attrs.slug, vn);
  3049. return m('div',
  3050. {'class':'text'},
  3051. // loop through childNodes list generated by parseTextDom() in init
  3052. this.textchilds.map(populateTextDom)
  3053. ); // /m.div.text
  3054. } // view:
  3055. }
  3056. // ______
  3057. // / _/ /____ ____ ___
  3058. // / // __/ _ \/ __ `__ \
  3059. // _/ // /_/ __/ / / / / /
  3060. // /___/\__/\___/_/ /_/ /_/
  3061. var _Item = {
  3062. id:null,
  3063. part:null,
  3064. type:null,
  3065. nested:false,
  3066. oninit: function(vn){
  3067. // console.log('vn.attrs', vn.attrs);
  3068. this.id = vn.attrs.id;
  3069. this.type = vn.attrs.type;
  3070. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3071. this.text = vn.attrs.text;
  3072. this.nested = vn.attrs.nested || false;
  3073. },
  3074. onbeforeupdate: function(vn, old){
  3075. this.nested = vn.attrs.nested || false;
  3076. this.type = vn.attrs.type;
  3077. this.text = vn.attrs.text;
  3078. },
  3079. view: function(vn){
  3080. return m("section", {
  3081. 'id':this.id,
  3082. 'class':'item'+(this.nested ? ' nested':'')
  3083. },
  3084. [
  3085. // create title node
  3086. m("h3", {
  3087. // 'ref':vn.attrs.href,
  3088. onclick: function(e){
  3089. vn.state.active = vn.state.active ? 0 : 1;
  3090. }
  3091. }, this.type),
  3092. // create text node
  3093. m(_Text, {'text':this.text, 'id':this.id})
  3094. ]
  3095. )
  3096. }
  3097. };
  3098. // ______
  3099. // / ____/___ ____ ____ ________
  3100. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3101. // / /___/ / / / /_/ / / / / /__/ __/
  3102. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3103. var _Enonce = {
  3104. partid:null,
  3105. id:null,
  3106. title:null,
  3107. text:null,
  3108. nested:false,
  3109. childs:[],
  3110. oninit:function(vn){
  3111. // // console.log('Enonce on init', vn);
  3112. this.partid = vn.attrs.partid;
  3113. this.id = vn.attrs.id;
  3114. this.title = vn.attrs.title || "";
  3115. this.text = vn.attrs.text;
  3116. this.childs = vn.attrs.childs || [];
  3117. this.nested = vn.attrs.nested || false;
  3118. },
  3119. onbeforeupdate:function(vn, old) {
  3120. // console.log(vn.attrs.childs);
  3121. this.title = vn.attrs.title || "";
  3122. this.text = vn.attrs.text;
  3123. this.childs = vn.attrs.childs || [];
  3124. this.nested = vn.attrs.nested || false;
  3125. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3126. },
  3127. view: function(vn){
  3128. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3129. return m("section", {
  3130. 'id' :this.id,
  3131. 'class' :'enonce'+(this.nested ? ' nested':'')
  3132. },
  3133. [
  3134. // create title node
  3135. m("h2", {}, m.trust(markdown.renderInline(this.title))),
  3136. // create text node
  3137. m(_Text, {'text':this.text, 'id':this.id}),
  3138. // addd children
  3139. this.childs.map(function(c){
  3140. return m(_Item, c)
  3141. })
  3142. ])
  3143. }
  3144. }
  3145. // ____ __
  3146. // / __ \____ ______/ /_
  3147. // / /_/ / __ `/ ___/ __/
  3148. // / ____/ /_/ / / / /_
  3149. // /_/ \__,_/_/ \__/
  3150. var _Part = {
  3151. oninit: function(vn){
  3152. this.id = vn.attrs.id;
  3153. this.title = vn.attrs.title || '';
  3154. this.enonces = vn.attrs.enonces;
  3155. },
  3156. onbeforeupdate: function(vn, old){
  3157. // console.log('_Part, onbeforeupdate old',old);
  3158. this.title = vn.attrs.title || '';
  3159. this.enonces = vn.attrs.enonces;
  3160. },
  3161. view: function(vn){
  3162. // console.log(vn.attrs.enonces);
  3163. return m("section", {
  3164. 'id' :this.id,
  3165. 'class' :'part'
  3166. },
  3167. [
  3168. // create title node
  3169. m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
  3170. // create text node
  3171. this.enonces.map(function(e){
  3172. // console.log(e.type);
  3173. // var title = e.title || '';
  3174. switch (e.type) {
  3175. case "title":
  3176. // handle titles
  3177. // console.log('title');
  3178. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3179. break;
  3180. case "filet":
  3181. // handle filets
  3182. // console.log('filet');
  3183. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3184. break;
  3185. default:
  3186. // or build structure
  3187. return m(_Enonce, Object.assign({"partid":this.id},e));
  3188. }
  3189. })
  3190. ]
  3191. )
  3192. }
  3193. }
  3194. // ____ __ _
  3195. // / _/___ / / (_)___ ___
  3196. // / // __ \/ / / / __ \/ _ \
  3197. // _/ // / / / /___/ / / / / __/
  3198. // /___/_/ /_/_____/_/_/ /_/\___/
  3199. module.exports = {
  3200. // oninit : function(vn){
  3201. // this.lang = vn.attrs.lang;
  3202. // },
  3203. oncreate: function(vn){
  3204. document.body.classList.add('inline');
  3205. _Ui.init();
  3206. },
  3207. view: function(vn){
  3208. console.log('_Inline view', vn.attrs.lang);
  3209. return [
  3210. m(_Header),
  3211. m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){
  3212. // console.log("MAP _dbs", p);
  3213. return m(_Part,p);
  3214. })
  3215. ),
  3216. m(_Footer)
  3217. ]
  3218. }
  3219. }
  3220. /***/ }),
  3221. /* 22 */
  3222. /***/ (function(module, exports, __webpack_require__) {
  3223. var m = __webpack_require__(1);
  3224. // https://github.com/markdown-it/markdown-it
  3225. var markdown = __webpack_require__(10)()
  3226. .use(__webpack_require__(9));
  3227. var _dbs = __webpack_require__(2);
  3228. var _Header = __webpack_require__(8);
  3229. var _Footer = __webpack_require__(7);
  3230. var _Ui = __webpack_require__(23);
  3231. // ____ __
  3232. // / __ \____ / /_
  3233. // / / / / __ \/ __/
  3234. // / /_/ / /_/ / /_
  3235. // /_____/\____/\__/
  3236. var _Dot = {
  3237. id:null,
  3238. type:'',
  3239. text:'',
  3240. summary:'',
  3241. active:true,
  3242. opened:false,
  3243. links:null,
  3244. parents:[],
  3245. lang:_dbs.lang,
  3246. setuptext:function(vn){
  3247. // console.log('setuptext', vn);
  3248. // construct text
  3249. this.text = vn.attrs.text || '';
  3250. this.rendered_text = markdown.render(this.text);
  3251. // construct summary
  3252. // TODO: summary needs more work (strip tags, markdown render)
  3253. this.summary = this.text.match('([^ ]*[ ]{0,1}){1,6}')[0];
  3254. this.summary = this.summary.trim().replace(/_([^_]+)$/g, "_$1_");
  3255. this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
  3256. this.summary = markdown.renderInline(this.summary) + "&nbsp;…";
  3257. },
  3258. oninit: function(vn){
  3259. this.id = vn.attrs.id;
  3260. this.type = vn.attrs.type;
  3261. this.setuptext(vn);
  3262. if(typeof vn.attrs.active !== 'undefined')
  3263. this.active = vn.attrs.active;
  3264. // links
  3265. this.links = _dbs.data_strct[this.id];
  3266. // console.log(this.links);
  3267. // parents memorize where do we come from to avoid duplicates and looping nav
  3268. if(vn.attrs.parents){
  3269. this.parents = this.parents.concat(vn.attrs.parents);
  3270. // console.log('_Dot init '+this.id+' parents :',this.parents);
  3271. }
  3272. },
  3273. oncreate: function(vn){
  3274. if(this.active){
  3275. vn.dom.classList.remove('disabled');
  3276. }else{
  3277. vn.dom.classList.add('disabled');
  3278. }
  3279. },
  3280. onbeforeupdate: function(vn){
  3281. // console.log('onbeforeupdate');
  3282. if(this.lang != _dbs.lang){
  3283. this.lang = _dbs.lang;
  3284. this.setuptext(vn);
  3285. }
  3286. },
  3287. view: function(vn){
  3288. if (this.active && this.opened) {
  3289. // full view of dot with linked dots
  3290. // console.log('_Dot view '+this.id+' parents :',this.parents);
  3291. var dot_content = [
  3292. // links to
  3293. this.links.to.length
  3294. ? m('nav', {'class':'links to'}, this.links.to.map(function(id){
  3295. // console.log(id);
  3296. if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
  3297. return m(_Dot, {
  3298. "id":id,
  3299. 'text':_dbs.data_byid[_dbs.lang][id].text,
  3300. 'type':'',
  3301. // passe the memory of crossed dots plus the current one
  3302. 'parents':vn.state.parents.concat([vn.state.id]),
  3303. // activate link only if not in parents (already went through it)
  3304. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  3305. });
  3306. }
  3307. })
  3308. )
  3309. : null,
  3310. // id
  3311. m('span', {'class':'id'}, this.id), // this.type+' '+
  3312. // bullet
  3313. m('span', {'class':'bullet'}, m.trust('&#9899;')),
  3314. // full text
  3315. m('section', {
  3316. 'class':'text',
  3317. onmouseover: function(e){
  3318. e.preventDefault();
  3319. if(e.target.nodeName == "A" ){
  3320. // console.log("over e.target", e.target);
  3321. // console.log('over vn', vn);
  3322. var id = e.target.getAttribute("href");
  3323. // add highlight class
  3324. vn.dom.querySelector('nav.links>div[uid="'+id+'"]').classList.add('highlight');
  3325. }else{
  3326. // remove all hilight class
  3327. for (link of vn.dom.querySelectorAll('nav.links>div.dot')) {
  3328. link.classList.remove('highlight');
  3329. }
  3330. }
  3331. },
  3332. onclick:function(e){
  3333. e.preventDefault();
  3334. if(e.target.nodeName == "A" ){
  3335. // console.log("over e.target", e.target);
  3336. // console.log('over vn', vn);
  3337. var id = e.target.getAttribute("href");
  3338. // add highlight class
  3339. vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
  3340. }
  3341. }
  3342. }, m.trust(this.rendered_text)),
  3343. // links from
  3344. this.links.from.length
  3345. ? m('nav', {'class':'links from'}, this.links.from.map(function(id){
  3346. // retrun a dot
  3347. return m(_Dot, {
  3348. "id":id,
  3349. 'text':_dbs.data_byid[_dbs.lang][id].text,
  3350. 'type':'',
  3351. // passe the memory of crossed dots plus the current one
  3352. 'parents':vn.state.parents.concat([vn.state.id]),
  3353. // activate link only if not in parents (already went through it)
  3354. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  3355. });
  3356. })
  3357. )
  3358. : null
  3359. ];
  3360. }else{
  3361. // preview dot
  3362. var dot_content = [
  3363. m('span', {'class':'id'}, this.id), // this.type+' '+
  3364. m('span', {'class':'bullet'}, m.trust('&#8226;')),
  3365. m('p', {
  3366. 'class':'summary',
  3367. onclick:function(e){
  3368. // TODO: animate openening (text and links separatly)
  3369. vn.state.opened = true;
  3370. }
  3371. }, m.trust(this.summary))
  3372. ];
  3373. }
  3374. return m('div',{
  3375. 'uid':this.id,
  3376. 'class':'dot'
  3377. },
  3378. dot_content
  3379. );
  3380. },
  3381. onupdate: function(vn){
  3382. // console.log('_Dot : onupdate', vn);
  3383. if(this.active){
  3384. if (this.opened){
  3385. vn.dom.classList.add('opened');
  3386. if(this.links.to.length)
  3387. vn.dom.classList.add('to-links');
  3388. if(this.links.from.length)
  3389. vn.dom.classList.add('from-links');
  3390. }else{
  3391. vn.dom.classList.remove('opened');
  3392. }
  3393. }
  3394. }
  3395. }
  3396. /*
  3397. down vote
  3398. Here's full list of black dotlikes from unicode
  3399. ● - &#9679; - Black Circle
  3400. ⏺ - &#9210; - Black Circle for Record
  3401. ⚫ - &#9899; - Medium Black Circle
  3402. ⬤ - &#11044; - Black Large Circle
  3403. ⧭ - &#10733; - Black Circle with Down Arrow
  3404. 🞄 - &#128900; - Black Slightly Small Circle
  3405. • - &#8226; - Bullet
  3406. ∙ - &#8729; - Bullet Operator
  3407. ⋅ - &#8901; - Dot Operator
  3408. 🌑 - &#127761; - New Moon Symbol
  3409. */
  3410. // _______ _ __ __
  3411. // / ___/ / (_) /__/ /
  3412. // / /__/ _ \/ / / _ /
  3413. // \___/_//_/_/_/\_,_/
  3414. var _Child = {
  3415. id:null,
  3416. part:null,
  3417. type:null,
  3418. // nested:false,
  3419. text:'',
  3420. oninit: function(vn){
  3421. // console.log('vn.attrs', vn.attrs);
  3422. this.id = vn.attrs.id;
  3423. this.type = vn.attrs.type;
  3424. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3425. this.text = vn.attrs.text;
  3426. // this.nested = vn.attrs.nested || false;
  3427. },
  3428. onbeforeupdate: function(vn, old){
  3429. // this.nested = vn.attrs.nested || false;
  3430. this.type = vn.attrs.type;
  3431. this.text = vn.attrs.text;
  3432. },
  3433. view: function(vn){
  3434. return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type});
  3435. }
  3436. };
  3437. // ______
  3438. // / ____/___ ____ ____ ________
  3439. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3440. // / /___/ / / / /_/ / / / / /__/ __/
  3441. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3442. var _Enonce = {
  3443. partid:null,
  3444. id:null,
  3445. title:null,
  3446. text:null,
  3447. // nested:false,
  3448. childs:[],
  3449. oninit:function(vn){
  3450. // // console.log('Enonce on init', vn);
  3451. this.partid = vn.attrs.partid;
  3452. this.id = vn.attrs.id;
  3453. this.title = vn.attrs.title || "";
  3454. this.text = vn.attrs.text;
  3455. this.childs = vn.attrs.childs || [];
  3456. // this.nested = vn.attrs.nested || false;
  3457. },
  3458. onbeforeupdate:function(vn, old) {
  3459. // console.log(vn.attrs.childs);
  3460. this.title = vn.attrs.title || "";
  3461. this.text = vn.attrs.text;
  3462. this.childs = vn.attrs.childs || [];
  3463. // this.nested = vn.attrs.nested || false;
  3464. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3465. },
  3466. view: function(vn){
  3467. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3468. return [
  3469. // create dot
  3470. m(_Dot, {"id":this.id, 'text':this.text,'type':this.title}),
  3471. // addd children
  3472. this.childs.map(function(c){
  3473. return m(_Child, c);
  3474. })
  3475. ]
  3476. }
  3477. }
  3478. // ____ __
  3479. // / __ \____ ______/ /_
  3480. // / /_/ / __ `/ ___/ __/
  3481. // / ____/ /_/ / / / /_
  3482. // /_/ \__,_/_/ \__/
  3483. var _Part = {
  3484. oninit: function(vn){
  3485. this.id = vn.attrs.id;
  3486. this.title = vn.attrs.title || "";
  3487. this.enonces = vn.attrs.enonces;
  3488. },
  3489. onbeforeupdate: function(vn, old){
  3490. // console.log('_Part, onbeforeupdate old',old);
  3491. this.title = vn.attrs.title || "";
  3492. this.enonces = vn.attrs.enonces;
  3493. },
  3494. view: function(vn){
  3495. // console.log(vn.attrs.enonces);
  3496. return m("section", {
  3497. 'id' :this.id,
  3498. 'class' :'part'
  3499. },
  3500. [
  3501. // create title node
  3502. m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
  3503. // create text node
  3504. this.enonces.map(function(e){
  3505. // console.log(e.text);
  3506. // return m(_Enonce, Object.assign({"partid":this.id},e))
  3507. switch (e.type) {
  3508. case "title":
  3509. // handle titles
  3510. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3511. break;
  3512. case "filet":
  3513. // handle filets
  3514. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3515. break;
  3516. default:
  3517. // or build structure
  3518. return m(_Enonce, Object.assign({"partid":this.id},e));
  3519. }
  3520. })
  3521. ]
  3522. )
  3523. }
  3524. }
  3525. // ______
  3526. // /_ __/_______ ___
  3527. // / / / ___/ _ \/ _ \
  3528. // / / / / / __/ __/
  3529. // /_/ /_/ \___/\___/
  3530. module.exports = {
  3531. // oninit : function(vn){
  3532. // this.lang = vn.attrs.lang;
  3533. // },
  3534. oncreate: function(vn){
  3535. document.body.classList.add('tree');
  3536. _Ui.init();
  3537. },
  3538. view: function(vn){
  3539. console.log('_Tree view', vn.attrs.lang);
  3540. return [
  3541. m(_Header),
  3542. m('main', {id:"content", 'class':'tree'}, _dbs.data[vn.attrs.lang].map(function(p){
  3543. return m(_Part,p);
  3544. })
  3545. ),
  3546. m(_Footer)
  3547. ];
  3548. }
  3549. }
  3550. // function(){
  3551. // switch(_dbs.lang){
  3552. // case 'fr':
  3553. // return "Hello dots !";
  3554. // break;
  3555. // case 'bra':
  3556. // return '"Hola dots !"'
  3557. // break;
  3558. // }
  3559. // }
  3560. /***/ }),
  3561. /* 23 */
  3562. /***/ (function(module, exports) {
  3563. /**
  3564. * @Author: Bachir Soussi Chiadmi <bach>
  3565. * @Date: 12-09-2017
  3566. * @Email: bachir@figureslibres.io
  3567. * @Last modified by: bach
  3568. * @Last modified time: 12-09-2017
  3569. * @License: GPL-V3
  3570. */
  3571. // var $ = require('jquery');
  3572. // https://plainjs.com
  3573. // jQuery(document).ready(function($) {
  3574. // console.log('Hello Jquery');
  3575. // var $window;
  3576. var init = function(){
  3577. console.log('UI init');
  3578. // $window = $(window);
  3579. // _____ __ _ __ __ _ __ __
  3580. // / ___// /_(_)____/ /____ __ / /_(_) /_/ /__
  3581. // \__ \/ __/ / ___/ //_/ / / / / __/ / __/ / _ \
  3582. // ___/ / /_/ / /__/ ,< / /_/ / / /_/ / /_/ / __/
  3583. // /____/\__/_/\___/_/|_|\__, / \__/_/\__/_/\___/
  3584. // /____/
  3585. // https://codepen.io/chrissp26/pen/gBrdo?editors=0010
  3586. // var header_height = $('header').height();
  3587. var header_height = document.getElementsByTagName('header')[0].clientHeight;
  3588. console.log(header_height);
  3589. // var $sticky_clone_wrapper = $('<div>').addClass('sticky-clone-wrapper').appendTo('body');
  3590. var sticky_clone_wrapper = document.createElement('div');
  3591. sticky_clone_wrapper.classList.add('sticky-clone-wrapper');
  3592. document.body.append(sticky_clone_wrapper);
  3593. //
  3594. // var $stickies = $('h1.part-title').addClass('sticky').each(function(i){
  3595. // var $sticky = $(this);
  3596. // $sticky
  3597. // .data('originalPosition', $sticky.offset().top)
  3598. // .data('originalHeight', $sticky.outerHeight());
  3599. // });
  3600. var stickies = new Array();
  3601. Array.from(document.querySelectorAll('h1.part-title')).forEach(function(e){
  3602. // console.log('sticky', e);
  3603. e._part = e.getAttribute('part');
  3604. stickies.push(e)
  3605. });
  3606. console.log('stickies', stickies);
  3607. //
  3608. // var OnScroll = function(event){
  3609. // var $last_sticky;
  3610. // $stickies.each(function(i){
  3611. // var $sticky = $(this);
  3612. // var pos = $sticky.data('originalPosition');
  3613. // if(pos < $window.scrollTop()+header_height){
  3614. //
  3615. // }
  3616. // // if(i == 1){
  3617. // // console.log(pos +" | "+$window.scrollTop());
  3618. // // }
  3619. // // if(pos < $window.scrollTop()+header_height){
  3620. // // if(!$sticky.is('.sticked')){
  3621. // // $sticky.addClass('sticked').clone().appendTo($sticky_clone_wrapper.empty());
  3622. // // }
  3623. // // }else{
  3624. // // if($sticky.is('.sticked')){
  3625. // // $sticky.removeClass('sticked');
  3626. // // $('.part-title[part="'+$sticky.attr('part')+'"]', $sticky_clone_wrapper).remove();
  3627. // // }
  3628. // // }
  3629. // });
  3630. // };
  3631. var last_sticky = "", sticked_sticky, clone;
  3632. var OnScroll = function(event){
  3633. // console.log('on scrool', event);
  3634. sticked_sticky = false;
  3635. for (var i = stickies.length-1; i >= 0; i--) {
  3636. if(stickies[i].getBoundingClientRect().top < header_height){
  3637. sticked_sticky = stickies[i];
  3638. break;
  3639. }
  3640. }
  3641. if (sticked_sticky) {
  3642. // console.log('sticked_sticky', sticked_sticky._part);
  3643. if(last_sticky !== sticked_sticky._part){
  3644. // console.log('new sticky', last_sticky);
  3645. // fill sticky_clone_wrapper
  3646. clone = sticked_sticky.cloneNode(true);
  3647. sticky_clone_wrapper.innerHTML = '';
  3648. sticky_clone_wrapper.appendChild(clone);
  3649. last_sticky = sticked_sticky._part;
  3650. }
  3651. }else{
  3652. // empty sticky_clone_wrapper
  3653. sticky_clone_wrapper.innerHTML = '';
  3654. }
  3655. };
  3656. //
  3657. // $window.on('scroll', OnScroll);
  3658. // console.log('window', window);
  3659. window.onscroll = OnScroll;
  3660. }
  3661. // });
  3662. module.exports = {
  3663. init : init
  3664. }
  3665. /***/ }),
  3666. /* 24 */
  3667. /***/ (function(module, exports) {
  3668. module.exports = {
  3669. "Aacute": "Á",
  3670. "aacute": "á",
  3671. "Abreve": "Ă",
  3672. "abreve": "ă",
  3673. "ac": "∾",
  3674. "acd": "∿",
  3675. "acE": "∾̳",
  3676. "Acirc": "Â",
  3677. "acirc": "â",
  3678. "acute": "´",
  3679. "Acy": "А",
  3680. "acy": "а",
  3681. "AElig": "Æ",
  3682. "aelig": "æ",
  3683. "af": "⁡",
  3684. "Afr": "𝔄",
  3685. "afr": "𝔞",
  3686. "Agrave": "À",
  3687. "agrave": "à",
  3688. "alefsym": "ℵ",
  3689. "aleph": "ℵ",
  3690. "Alpha": "Α",
  3691. "alpha": "α",
  3692. "Amacr": "Ā",
  3693. "amacr": "ā",
  3694. "amalg": "⨿",
  3695. "amp": "&",
  3696. "AMP": "&",
  3697. "andand": "⩕",
  3698. "And": "⩓",
  3699. "and": "∧",
  3700. "andd": "⩜",
  3701. "andslope": "⩘",
  3702. "andv": "⩚",
  3703. "ang": "∠",
  3704. "ange": "⦤",
  3705. "angle": "∠",
  3706. "angmsdaa": "⦨",
  3707. "angmsdab": "⦩",
  3708. "angmsdac": "⦪",
  3709. "angmsdad": "⦫",
  3710. "angmsdae": "⦬",
  3711. "angmsdaf": "⦭",
  3712. "angmsdag": "⦮",
  3713. "angmsdah": "⦯",
  3714. "angmsd": "∡",
  3715. "angrt": "∟",
  3716. "angrtvb": "⊾",
  3717. "angrtvbd": "⦝",
  3718. "angsph": "∢",
  3719. "angst": "Å",
  3720. "angzarr": "⍼",
  3721. "Aogon": "Ą",
  3722. "aogon": "ą",
  3723. "Aopf": "𝔸",
  3724. "aopf": "𝕒",
  3725. "apacir": "⩯",
  3726. "ap": "≈",
  3727. "apE": "⩰",
  3728. "ape": "≊",
  3729. "apid": "≋",
  3730. "apos": "'",
  3731. "ApplyFunction": "⁡",
  3732. "approx": "≈",
  3733. "approxeq": "≊",
  3734. "Aring": "Å",
  3735. "aring": "å",
  3736. "Ascr": "𝒜",
  3737. "ascr": "𝒶",
  3738. "Assign": "≔",
  3739. "ast": "*",
  3740. "asymp": "≈",
  3741. "asympeq": "≍",
  3742. "Atilde": "Ã",
  3743. "atilde": "ã",
  3744. "Auml": "Ä",
  3745. "auml": "ä",
  3746. "awconint": "∳",
  3747. "awint": "⨑",
  3748. "backcong": "≌",
  3749. "backepsilon": "϶",
  3750. "backprime": "‵",
  3751. "backsim": "∽",
  3752. "backsimeq": "⋍",
  3753. "Backslash": "∖",
  3754. "Barv": "⫧",
  3755. "barvee": "⊽",
  3756. "barwed": "⌅",
  3757. "Barwed": "⌆",
  3758. "barwedge": "⌅",
  3759. "bbrk": "⎵",
  3760. "bbrktbrk": "⎶",
  3761. "bcong": "≌",
  3762. "Bcy": "Б",
  3763. "bcy": "б",
  3764. "bdquo": "„",
  3765. "becaus": "∵",
  3766. "because": "∵",
  3767. "Because": "∵",
  3768. "bemptyv": "⦰",
  3769. "bepsi": "϶",
  3770. "bernou": "ℬ",
  3771. "Bernoullis": "ℬ",
  3772. "Beta": "Β",
  3773. "beta": "β",
  3774. "beth": "ℶ",
  3775. "between": "≬",
  3776. "Bfr": "𝔅",
  3777. "bfr": "𝔟",
  3778. "bigcap": "⋂",
  3779. "bigcirc": "◯",
  3780. "bigcup": "⋃",
  3781. "bigodot": "⨀",
  3782. "bigoplus": "⨁",
  3783. "bigotimes": "⨂",
  3784. "bigsqcup": "⨆",
  3785. "bigstar": "★",
  3786. "bigtriangledown": "▽",
  3787. "bigtriangleup": "△",
  3788. "biguplus": "⨄",
  3789. "bigvee": "⋁",
  3790. "bigwedge": "⋀",
  3791. "bkarow": "⤍",
  3792. "blacklozenge": "⧫",
  3793. "blacksquare": "▪",
  3794. "blacktriangle": "▴",
  3795. "blacktriangledown": "▾",
  3796. "blacktriangleleft": "◂",
  3797. "blacktriangleright": "▸",
  3798. "blank": "␣",
  3799. "blk12": "▒",
  3800. "blk14": "░",
  3801. "blk34": "▓",
  3802. "block": "█",
  3803. "bne": "=⃥",
  3804. "bnequiv": "≡⃥",
  3805. "bNot": "⫭",
  3806. "bnot": "⌐",
  3807. "Bopf": "𝔹",
  3808. "bopf": "𝕓",
  3809. "bot": "⊥",
  3810. "bottom": "⊥",
  3811. "bowtie": "⋈",
  3812. "boxbox": "⧉",
  3813. "boxdl": "┐",
  3814. "boxdL": "╕",
  3815. "boxDl": "╖",
  3816. "boxDL": "╗",
  3817. "boxdr": "┌",
  3818. "boxdR": "╒",
  3819. "boxDr": "╓",
  3820. "boxDR": "╔",
  3821. "boxh": "─",
  3822. "boxH": "═",
  3823. "boxhd": "┬",
  3824. "boxHd": "╤",
  3825. "boxhD": "╥",
  3826. "boxHD": "╦",
  3827. "boxhu": "┴",
  3828. "boxHu": "╧",
  3829. "boxhU": "╨",
  3830. "boxHU": "╩",
  3831. "boxminus": "⊟",
  3832. "boxplus": "⊞",
  3833. "boxtimes": "⊠",
  3834. "boxul": "┘",
  3835. "boxuL": "╛",
  3836. "boxUl": "╜",
  3837. "boxUL": "╝",
  3838. "boxur": "└",
  3839. "boxuR": "╘",
  3840. "boxUr": "╙",
  3841. "boxUR": "╚",
  3842. "boxv": "│",
  3843. "boxV": "║",
  3844. "boxvh": "┼",
  3845. "boxvH": "╪",
  3846. "boxVh": "╫",
  3847. "boxVH": "╬",
  3848. "boxvl": "┤",
  3849. "boxvL": "╡",
  3850. "boxVl": "╢",
  3851. "boxVL": "╣",
  3852. "boxvr": "├",
  3853. "boxvR": "╞",
  3854. "boxVr": "╟",
  3855. "boxVR": "╠",
  3856. "bprime": "‵",
  3857. "breve": "˘",
  3858. "Breve": "˘",
  3859. "brvbar": "¦",
  3860. "bscr": "𝒷",
  3861. "Bscr": "ℬ",
  3862. "bsemi": "⁏",
  3863. "bsim": "∽",
  3864. "bsime": "⋍",
  3865. "bsolb": "⧅",
  3866. "bsol": "\\",
  3867. "bsolhsub": "⟈",
  3868. "bull": "•",
  3869. "bullet": "•",
  3870. "bump": "≎",
  3871. "bumpE": "⪮",
  3872. "bumpe": "≏",
  3873. "Bumpeq": "≎",
  3874. "bumpeq": "≏",
  3875. "Cacute": "Ć",
  3876. "cacute": "ć",
  3877. "capand": "⩄",
  3878. "capbrcup": "⩉",
  3879. "capcap": "⩋",
  3880. "cap": "∩",
  3881. "Cap": "⋒",
  3882. "capcup": "⩇",
  3883. "capdot": "⩀",
  3884. "CapitalDifferentialD": "ⅅ",
  3885. "caps": "∩︀",
  3886. "caret": "⁁",
  3887. "caron": "ˇ",
  3888. "Cayleys": "ℭ",
  3889. "ccaps": "⩍",
  3890. "Ccaron": "Č",
  3891. "ccaron": "č",
  3892. "Ccedil": "Ç",
  3893. "ccedil": "ç",
  3894. "Ccirc": "Ĉ",
  3895. "ccirc": "ĉ",
  3896. "Cconint": "∰",
  3897. "ccups": "⩌",
  3898. "ccupssm": "⩐",
  3899. "Cdot": "Ċ",
  3900. "cdot": "ċ",
  3901. "cedil": "¸",
  3902. "Cedilla": "¸",
  3903. "cemptyv": "⦲",
  3904. "cent": "¢",
  3905. "centerdot": "·",
  3906. "CenterDot": "·",
  3907. "cfr": "𝔠",
  3908. "Cfr": "ℭ",
  3909. "CHcy": "Ч",
  3910. "chcy": "ч",
  3911. "check": "✓",
  3912. "checkmark": "✓",
  3913. "Chi": "Χ",
  3914. "chi": "χ",
  3915. "circ": "ˆ",
  3916. "circeq": "≗",
  3917. "circlearrowleft": "↺",
  3918. "circlearrowright": "↻",
  3919. "circledast": "⊛",
  3920. "circledcirc": "⊚",
  3921. "circleddash": "⊝",
  3922. "CircleDot": "⊙",
  3923. "circledR": "®",
  3924. "circledS": "Ⓢ",
  3925. "CircleMinus": "⊖",
  3926. "CirclePlus": "⊕",
  3927. "CircleTimes": "⊗",
  3928. "cir": "○",
  3929. "cirE": "⧃",
  3930. "cire": "≗",
  3931. "cirfnint": "⨐",
  3932. "cirmid": "⫯",
  3933. "cirscir": "⧂",
  3934. "ClockwiseContourIntegral": "∲",
  3935. "CloseCurlyDoubleQuote": "”",
  3936. "CloseCurlyQuote": "’",
  3937. "clubs": "♣",
  3938. "clubsuit": "♣",
  3939. "colon": ":",
  3940. "Colon": "∷",
  3941. "Colone": "⩴",
  3942. "colone": "≔",
  3943. "coloneq": "≔",
  3944. "comma": ",",
  3945. "commat": "@",
  3946. "comp": "∁",
  3947. "compfn": "∘",
  3948. "complement": "∁",
  3949. "complexes": "ℂ",
  3950. "cong": "≅",
  3951. "congdot": "⩭",
  3952. "Congruent": "≡",
  3953. "conint": "∮",
  3954. "Conint": "∯",
  3955. "ContourIntegral": "∮",
  3956. "copf": "𝕔",
  3957. "Copf": "ℂ",
  3958. "coprod": "∐",
  3959. "Coproduct": "∐",
  3960. "copy": "©",
  3961. "COPY": "©",
  3962. "copysr": "℗",
  3963. "CounterClockwiseContourIntegral": "∳",
  3964. "crarr": "↵",
  3965. "cross": "✗",
  3966. "Cross": "⨯",
  3967. "Cscr": "𝒞",
  3968. "cscr": "𝒸",
  3969. "csub": "⫏",
  3970. "csube": "⫑",
  3971. "csup": "⫐",
  3972. "csupe": "⫒",
  3973. "ctdot": "⋯",
  3974. "cudarrl": "⤸",
  3975. "cudarrr": "⤵",
  3976. "cuepr": "⋞",
  3977. "cuesc": "⋟",
  3978. "cularr": "↶",
  3979. "cularrp": "⤽",
  3980. "cupbrcap": "⩈",
  3981. "cupcap": "⩆",
  3982. "CupCap": "≍",
  3983. "cup": "∪",
  3984. "Cup": "⋓",
  3985. "cupcup": "⩊",
  3986. "cupdot": "⊍",
  3987. "cupor": "⩅",
  3988. "cups": "∪︀",
  3989. "curarr": "↷",
  3990. "curarrm": "⤼",
  3991. "curlyeqprec": "⋞",
  3992. "curlyeqsucc": "⋟",
  3993. "curlyvee": "⋎",
  3994. "curlywedge": "⋏",
  3995. "curren": "¤",
  3996. "curvearrowleft": "↶",
  3997. "curvearrowright": "↷",
  3998. "cuvee": "⋎",
  3999. "cuwed": "⋏",
  4000. "cwconint": "∲",
  4001. "cwint": "∱",
  4002. "cylcty": "⌭",
  4003. "dagger": "†",
  4004. "Dagger": "‡",
  4005. "daleth": "ℸ",
  4006. "darr": "↓",
  4007. "Darr": "↡",
  4008. "dArr": "⇓",
  4009. "dash": "‐",
  4010. "Dashv": "⫤",
  4011. "dashv": "⊣",
  4012. "dbkarow": "⤏",
  4013. "dblac": "˝",
  4014. "Dcaron": "Ď",
  4015. "dcaron": "ď",
  4016. "Dcy": "Д",
  4017. "dcy": "д",
  4018. "ddagger": "‡",
  4019. "ddarr": "⇊",
  4020. "DD": "ⅅ",
  4021. "dd": "ⅆ",
  4022. "DDotrahd": "⤑",
  4023. "ddotseq": "⩷",
  4024. "deg": "°",
  4025. "Del": "∇",
  4026. "Delta": "Δ",
  4027. "delta": "δ",
  4028. "demptyv": "⦱",
  4029. "dfisht": "⥿",
  4030. "Dfr": "𝔇",
  4031. "dfr": "𝔡",
  4032. "dHar": "⥥",
  4033. "dharl": "⇃",
  4034. "dharr": "⇂",
  4035. "DiacriticalAcute": "´",
  4036. "DiacriticalDot": "˙",
  4037. "DiacriticalDoubleAcute": "˝",
  4038. "DiacriticalGrave": "`",
  4039. "DiacriticalTilde": "˜",
  4040. "diam": "⋄",
  4041. "diamond": "⋄",
  4042. "Diamond": "⋄",
  4043. "diamondsuit": "♦",
  4044. "diams": "♦",
  4045. "die": "¨",
  4046. "DifferentialD": "ⅆ",
  4047. "digamma": "ϝ",
  4048. "disin": "⋲",
  4049. "div": "÷",
  4050. "divide": "÷",
  4051. "divideontimes": "⋇",
  4052. "divonx": "⋇",
  4053. "DJcy": "Ђ",
  4054. "djcy": "ђ",
  4055. "dlcorn": "⌞",
  4056. "dlcrop": "⌍",
  4057. "dollar": "$",
  4058. "Dopf": "𝔻",
  4059. "dopf": "𝕕",
  4060. "Dot": "¨",
  4061. "dot": "˙",
  4062. "DotDot": "⃜",
  4063. "doteq": "≐",
  4064. "doteqdot": "≑",
  4065. "DotEqual": "≐",
  4066. "dotminus": "∸",
  4067. "dotplus": "∔",
  4068. "dotsquare": "⊡",
  4069. "doublebarwedge": "⌆",
  4070. "DoubleContourIntegral": "∯",
  4071. "DoubleDot": "¨",
  4072. "DoubleDownArrow": "⇓",
  4073. "DoubleLeftArrow": "⇐",
  4074. "DoubleLeftRightArrow": "⇔",
  4075. "DoubleLeftTee": "⫤",
  4076. "DoubleLongLeftArrow": "⟸",
  4077. "DoubleLongLeftRightArrow": "⟺",
  4078. "DoubleLongRightArrow": "⟹",
  4079. "DoubleRightArrow": "⇒",
  4080. "DoubleRightTee": "⊨",
  4081. "DoubleUpArrow": "⇑",
  4082. "DoubleUpDownArrow": "⇕",
  4083. "DoubleVerticalBar": "∥",
  4084. "DownArrowBar": "⤓",
  4085. "downarrow": "↓",
  4086. "DownArrow": "↓",
  4087. "Downarrow": "⇓",
  4088. "DownArrowUpArrow": "⇵",
  4089. "DownBreve": "̑",
  4090. "downdownarrows": "⇊",
  4091. "downharpoonleft": "⇃",
  4092. "downharpoonright": "⇂",
  4093. "DownLeftRightVector": "⥐",
  4094. "DownLeftTeeVector": "⥞",
  4095. "DownLeftVectorBar": "⥖",
  4096. "DownLeftVector": "↽",
  4097. "DownRightTeeVector": "⥟",
  4098. "DownRightVectorBar": "⥗",
  4099. "DownRightVector": "⇁",
  4100. "DownTeeArrow": "↧",
  4101. "DownTee": "⊤",
  4102. "drbkarow": "⤐",
  4103. "drcorn": "⌟",
  4104. "drcrop": "⌌",
  4105. "Dscr": "𝒟",
  4106. "dscr": "𝒹",
  4107. "DScy": "Ѕ",
  4108. "dscy": "ѕ",
  4109. "dsol": "⧶",
  4110. "Dstrok": "Đ",
  4111. "dstrok": "đ",
  4112. "dtdot": "⋱",
  4113. "dtri": "▿",
  4114. "dtrif": "▾",
  4115. "duarr": "⇵",
  4116. "duhar": "⥯",
  4117. "dwangle": "⦦",
  4118. "DZcy": "Џ",
  4119. "dzcy": "џ",
  4120. "dzigrarr": "⟿",
  4121. "Eacute": "É",
  4122. "eacute": "é",
  4123. "easter": "⩮",
  4124. "Ecaron": "Ě",
  4125. "ecaron": "ě",
  4126. "Ecirc": "Ê",
  4127. "ecirc": "ê",
  4128. "ecir": "≖",
  4129. "ecolon": "≕",
  4130. "Ecy": "Э",
  4131. "ecy": "э",
  4132. "eDDot": "⩷",
  4133. "Edot": "Ė",
  4134. "edot": "ė",
  4135. "eDot": "≑",
  4136. "ee": "ⅇ",
  4137. "efDot": "≒",
  4138. "Efr": "𝔈",
  4139. "efr": "𝔢",
  4140. "eg": "⪚",
  4141. "Egrave": "È",
  4142. "egrave": "è",
  4143. "egs": "⪖",
  4144. "egsdot": "⪘",
  4145. "el": "⪙",
  4146. "Element": "∈",
  4147. "elinters": "⏧",
  4148. "ell": "ℓ",
  4149. "els": "⪕",
  4150. "elsdot": "⪗",
  4151. "Emacr": "Ē",
  4152. "emacr": "ē",
  4153. "empty": "∅",
  4154. "emptyset": "∅",
  4155. "EmptySmallSquare": "◻",
  4156. "emptyv": "∅",
  4157. "EmptyVerySmallSquare": "▫",
  4158. "emsp13": " ",
  4159. "emsp14": " ",
  4160. "emsp": " ",
  4161. "ENG": "Ŋ",
  4162. "eng": "ŋ",
  4163. "ensp": " ",
  4164. "Eogon": "Ę",
  4165. "eogon": "ę",
  4166. "Eopf": "𝔼",
  4167. "eopf": "𝕖",
  4168. "epar": "⋕",
  4169. "eparsl": "⧣",
  4170. "eplus": "⩱",
  4171. "epsi": "ε",
  4172. "Epsilon": "Ε",
  4173. "epsilon": "ε",
  4174. "epsiv": "ϵ",
  4175. "eqcirc": "≖",
  4176. "eqcolon": "≕",
  4177. "eqsim": "≂",
  4178. "eqslantgtr": "⪖",
  4179. "eqslantless": "⪕",
  4180. "Equal": "⩵",
  4181. "equals": "=",
  4182. "EqualTilde": "≂",
  4183. "equest": "≟",
  4184. "Equilibrium": "⇌",
  4185. "equiv": "≡",
  4186. "equivDD": "⩸",
  4187. "eqvparsl": "⧥",
  4188. "erarr": "⥱",
  4189. "erDot": "≓",
  4190. "escr": "ℯ",
  4191. "Escr": "ℰ",
  4192. "esdot": "≐",
  4193. "Esim": "⩳",
  4194. "esim": "≂",
  4195. "Eta": "Η",
  4196. "eta": "η",
  4197. "ETH": "Ð",
  4198. "eth": "ð",
  4199. "Euml": "Ë",
  4200. "euml": "ë",
  4201. "euro": "€",
  4202. "excl": "!",
  4203. "exist": "∃",
  4204. "Exists": "∃",
  4205. "expectation": "ℰ",
  4206. "exponentiale": "ⅇ",
  4207. "ExponentialE": "ⅇ",
  4208. "fallingdotseq": "≒",
  4209. "Fcy": "Ф",
  4210. "fcy": "ф",
  4211. "female": "♀",
  4212. "ffilig": "ffi",
  4213. "fflig": "ff",
  4214. "ffllig": "ffl",
  4215. "Ffr": "𝔉",
  4216. "ffr": "𝔣",
  4217. "filig": "fi",
  4218. "FilledSmallSquare": "◼",
  4219. "FilledVerySmallSquare": "▪",
  4220. "fjlig": "fj",
  4221. "flat": "♭",
  4222. "fllig": "fl",
  4223. "fltns": "▱",
  4224. "fnof": "ƒ",
  4225. "Fopf": "𝔽",
  4226. "fopf": "𝕗",
  4227. "forall": "∀",
  4228. "ForAll": "∀",
  4229. "fork": "⋔",
  4230. "forkv": "⫙",
  4231. "Fouriertrf": "ℱ",
  4232. "fpartint": "⨍",
  4233. "frac12": "½",
  4234. "frac13": "⅓",
  4235. "frac14": "¼",
  4236. "frac15": "⅕",
  4237. "frac16": "⅙",
  4238. "frac18": "⅛",
  4239. "frac23": "⅔",
  4240. "frac25": "⅖",
  4241. "frac34": "¾",
  4242. "frac35": "⅗",
  4243. "frac38": "⅜",
  4244. "frac45": "⅘",
  4245. "frac56": "⅚",
  4246. "frac58": "⅝",
  4247. "frac78": "⅞",
  4248. "frasl": "⁄",
  4249. "frown": "⌢",
  4250. "fscr": "𝒻",
  4251. "Fscr": "ℱ",
  4252. "gacute": "ǵ",
  4253. "Gamma": "Γ",
  4254. "gamma": "γ",
  4255. "Gammad": "Ϝ",
  4256. "gammad": "ϝ",
  4257. "gap": "⪆",
  4258. "Gbreve": "Ğ",
  4259. "gbreve": "ğ",
  4260. "Gcedil": "Ģ",
  4261. "Gcirc": "Ĝ",
  4262. "gcirc": "ĝ",
  4263. "Gcy": "Г",
  4264. "gcy": "г",
  4265. "Gdot": "Ġ",
  4266. "gdot": "ġ",
  4267. "ge": "≥",
  4268. "gE": "≧",
  4269. "gEl": "⪌",
  4270. "gel": "⋛",
  4271. "geq": "≥",
  4272. "geqq": "≧",
  4273. "geqslant": "⩾",
  4274. "gescc": "⪩",
  4275. "ges": "⩾",
  4276. "gesdot": "⪀",
  4277. "gesdoto": "⪂",
  4278. "gesdotol": "⪄",
  4279. "gesl": "⋛︀",
  4280. "gesles": "⪔",
  4281. "Gfr": "𝔊",
  4282. "gfr": "𝔤",
  4283. "gg": "≫",
  4284. "Gg": "⋙",
  4285. "ggg": "⋙",
  4286. "gimel": "ℷ",
  4287. "GJcy": "Ѓ",
  4288. "gjcy": "ѓ",
  4289. "gla": "⪥",
  4290. "gl": "≷",
  4291. "glE": "⪒",
  4292. "glj": "⪤",
  4293. "gnap": "⪊",
  4294. "gnapprox": "⪊",
  4295. "gne": "⪈",
  4296. "gnE": "≩",
  4297. "gneq": "⪈",
  4298. "gneqq": "≩",
  4299. "gnsim": "⋧",
  4300. "Gopf": "𝔾",
  4301. "gopf": "𝕘",
  4302. "grave": "`",
  4303. "GreaterEqual": "≥",
  4304. "GreaterEqualLess": "⋛",
  4305. "GreaterFullEqual": "≧",
  4306. "GreaterGreater": "⪢",
  4307. "GreaterLess": "≷",
  4308. "GreaterSlantEqual": "⩾",
  4309. "GreaterTilde": "≳",
  4310. "Gscr": "𝒢",
  4311. "gscr": "ℊ",
  4312. "gsim": "≳",
  4313. "gsime": "⪎",
  4314. "gsiml": "⪐",
  4315. "gtcc": "⪧",
  4316. "gtcir": "⩺",
  4317. "gt": ">",
  4318. "GT": ">",
  4319. "Gt": "≫",
  4320. "gtdot": "⋗",
  4321. "gtlPar": "⦕",
  4322. "gtquest": "⩼",
  4323. "gtrapprox": "⪆",
  4324. "gtrarr": "⥸",
  4325. "gtrdot": "⋗",
  4326. "gtreqless": "⋛",
  4327. "gtreqqless": "⪌",
  4328. "gtrless": "≷",
  4329. "gtrsim": "≳",
  4330. "gvertneqq": "≩︀",
  4331. "gvnE": "≩︀",
  4332. "Hacek": "ˇ",
  4333. "hairsp": " ",
  4334. "half": "½",
  4335. "hamilt": "ℋ",
  4336. "HARDcy": "Ъ",
  4337. "hardcy": "ъ",
  4338. "harrcir": "⥈",
  4339. "harr": "↔",
  4340. "hArr": "⇔",
  4341. "harrw": "↭",
  4342. "Hat": "^",
  4343. "hbar": "ℏ",
  4344. "Hcirc": "Ĥ",
  4345. "hcirc": "ĥ",
  4346. "hearts": "♥",
  4347. "heartsuit": "♥",
  4348. "hellip": "…",
  4349. "hercon": "⊹",
  4350. "hfr": "𝔥",
  4351. "Hfr": "ℌ",
  4352. "HilbertSpace": "ℋ",
  4353. "hksearow": "⤥",
  4354. "hkswarow": "⤦",
  4355. "hoarr": "⇿",
  4356. "homtht": "∻",
  4357. "hookleftarrow": "↩",
  4358. "hookrightarrow": "↪",
  4359. "hopf": "𝕙",
  4360. "Hopf": "ℍ",
  4361. "horbar": "―",
  4362. "HorizontalLine": "─",
  4363. "hscr": "𝒽",
  4364. "Hscr": "ℋ",
  4365. "hslash": "ℏ",
  4366. "Hstrok": "Ħ",
  4367. "hstrok": "ħ",
  4368. "HumpDownHump": "≎",
  4369. "HumpEqual": "≏",
  4370. "hybull": "⁃",
  4371. "hyphen": "‐",
  4372. "Iacute": "Í",
  4373. "iacute": "í",
  4374. "ic": "⁣",
  4375. "Icirc": "Î",
  4376. "icirc": "î",
  4377. "Icy": "И",
  4378. "icy": "и",
  4379. "Idot": "İ",
  4380. "IEcy": "Е",
  4381. "iecy": "е",
  4382. "iexcl": "¡",
  4383. "iff": "⇔",
  4384. "ifr": "𝔦",
  4385. "Ifr": "ℑ",
  4386. "Igrave": "Ì",
  4387. "igrave": "ì",
  4388. "ii": "ⅈ",
  4389. "iiiint": "⨌",
  4390. "iiint": "∭",
  4391. "iinfin": "⧜",
  4392. "iiota": "℩",
  4393. "IJlig": "IJ",
  4394. "ijlig": "ij",
  4395. "Imacr": "Ī",
  4396. "imacr": "ī",
  4397. "image": "ℑ",
  4398. "ImaginaryI": "ⅈ",
  4399. "imagline": "ℐ",
  4400. "imagpart": "ℑ",
  4401. "imath": "ı",
  4402. "Im": "ℑ",
  4403. "imof": "⊷",
  4404. "imped": "Ƶ",
  4405. "Implies": "⇒",
  4406. "incare": "℅",
  4407. "in": "∈",
  4408. "infin": "∞",
  4409. "infintie": "⧝",
  4410. "inodot": "ı",
  4411. "intcal": "⊺",
  4412. "int": "∫",
  4413. "Int": "∬",
  4414. "integers": "ℤ",
  4415. "Integral": "∫",
  4416. "intercal": "⊺",
  4417. "Intersection": "⋂",
  4418. "intlarhk": "⨗",
  4419. "intprod": "⨼",
  4420. "InvisibleComma": "⁣",
  4421. "InvisibleTimes": "⁢",
  4422. "IOcy": "Ё",
  4423. "iocy": "ё",
  4424. "Iogon": "Į",
  4425. "iogon": "į",
  4426. "Iopf": "𝕀",
  4427. "iopf": "𝕚",
  4428. "Iota": "Ι",
  4429. "iota": "ι",
  4430. "iprod": "⨼",
  4431. "iquest": "¿",
  4432. "iscr": "𝒾",
  4433. "Iscr": "ℐ",
  4434. "isin": "∈",
  4435. "isindot": "⋵",
  4436. "isinE": "⋹",
  4437. "isins": "⋴",
  4438. "isinsv": "⋳",
  4439. "isinv": "∈",
  4440. "it": "⁢",
  4441. "Itilde": "Ĩ",
  4442. "itilde": "ĩ",
  4443. "Iukcy": "І",
  4444. "iukcy": "і",
  4445. "Iuml": "Ï",
  4446. "iuml": "ï",
  4447. "Jcirc": "Ĵ",
  4448. "jcirc": "ĵ",
  4449. "Jcy": "Й",
  4450. "jcy": "й",
  4451. "Jfr": "𝔍",
  4452. "jfr": "𝔧",
  4453. "jmath": "ȷ",
  4454. "Jopf": "𝕁",
  4455. "jopf": "𝕛",
  4456. "Jscr": "𝒥",
  4457. "jscr": "𝒿",
  4458. "Jsercy": "Ј",
  4459. "jsercy": "ј",
  4460. "Jukcy": "Є",
  4461. "jukcy": "є",
  4462. "Kappa": "Κ",
  4463. "kappa": "κ",
  4464. "kappav": "ϰ",
  4465. "Kcedil": "Ķ",
  4466. "kcedil": "ķ",
  4467. "Kcy": "К",
  4468. "kcy": "к",
  4469. "Kfr": "𝔎",
  4470. "kfr": "𝔨",
  4471. "kgreen": "ĸ",
  4472. "KHcy": "Х",
  4473. "khcy": "х",
  4474. "KJcy": "Ќ",
  4475. "kjcy": "ќ",
  4476. "Kopf": "𝕂",
  4477. "kopf": "𝕜",
  4478. "Kscr": "𝒦",
  4479. "kscr": "𝓀",
  4480. "lAarr": "⇚",
  4481. "Lacute": "Ĺ",
  4482. "lacute": "ĺ",
  4483. "laemptyv": "⦴",
  4484. "lagran": "ℒ",
  4485. "Lambda": "Λ",
  4486. "lambda": "λ",
  4487. "lang": "⟨",
  4488. "Lang": "⟪",
  4489. "langd": "⦑",
  4490. "langle": "⟨",
  4491. "lap": "⪅",
  4492. "Laplacetrf": "ℒ",
  4493. "laquo": "«",
  4494. "larrb": "⇤",
  4495. "larrbfs": "⤟",
  4496. "larr": "←",
  4497. "Larr": "↞",
  4498. "lArr": "⇐",
  4499. "larrfs": "⤝",
  4500. "larrhk": "↩",
  4501. "larrlp": "↫",
  4502. "larrpl": "⤹",
  4503. "larrsim": "⥳",
  4504. "larrtl": "↢",
  4505. "latail": "⤙",
  4506. "lAtail": "⤛",
  4507. "lat": "⪫",
  4508. "late": "⪭",
  4509. "lates": "⪭︀",
  4510. "lbarr": "⤌",
  4511. "lBarr": "⤎",
  4512. "lbbrk": "❲",
  4513. "lbrace": "{",
  4514. "lbrack": "[",
  4515. "lbrke": "⦋",
  4516. "lbrksld": "⦏",
  4517. "lbrkslu": "⦍",
  4518. "Lcaron": "Ľ",
  4519. "lcaron": "ľ",
  4520. "Lcedil": "Ļ",
  4521. "lcedil": "ļ",
  4522. "lceil": "⌈",
  4523. "lcub": "{",
  4524. "Lcy": "Л",
  4525. "lcy": "л",
  4526. "ldca": "⤶",
  4527. "ldquo": "“",
  4528. "ldquor": "„",
  4529. "ldrdhar": "⥧",
  4530. "ldrushar": "⥋",
  4531. "ldsh": "↲",
  4532. "le": "≤",
  4533. "lE": "≦",
  4534. "LeftAngleBracket": "⟨",
  4535. "LeftArrowBar": "⇤",
  4536. "leftarrow": "←",
  4537. "LeftArrow": "←",
  4538. "Leftarrow": "⇐",
  4539. "LeftArrowRightArrow": "⇆",
  4540. "leftarrowtail": "↢",
  4541. "LeftCeiling": "⌈",
  4542. "LeftDoubleBracket": "⟦",
  4543. "LeftDownTeeVector": "⥡",
  4544. "LeftDownVectorBar": "⥙",
  4545. "LeftDownVector": "⇃",
  4546. "LeftFloor": "⌊",
  4547. "leftharpoondown": "↽",
  4548. "leftharpoonup": "↼",
  4549. "leftleftarrows": "⇇",
  4550. "leftrightarrow": "↔",
  4551. "LeftRightArrow": "↔",
  4552. "Leftrightarrow": "⇔",
  4553. "leftrightarrows": "⇆",
  4554. "leftrightharpoons": "⇋",
  4555. "leftrightsquigarrow": "↭",
  4556. "LeftRightVector": "⥎",
  4557. "LeftTeeArrow": "↤",
  4558. "LeftTee": "⊣",
  4559. "LeftTeeVector": "⥚",
  4560. "leftthreetimes": "⋋",
  4561. "LeftTriangleBar": "⧏",
  4562. "LeftTriangle": "⊲",
  4563. "LeftTriangleEqual": "⊴",
  4564. "LeftUpDownVector": "⥑",
  4565. "LeftUpTeeVector": "⥠",
  4566. "LeftUpVectorBar": "⥘",
  4567. "LeftUpVector": "↿",
  4568. "LeftVectorBar": "⥒",
  4569. "LeftVector": "↼",
  4570. "lEg": "⪋",
  4571. "leg": "⋚",
  4572. "leq": "≤",
  4573. "leqq": "≦",
  4574. "leqslant": "⩽",
  4575. "lescc": "⪨",
  4576. "les": "⩽",
  4577. "lesdot": "⩿",
  4578. "lesdoto": "⪁",
  4579. "lesdotor": "⪃",
  4580. "lesg": "⋚︀",
  4581. "lesges": "⪓",
  4582. "lessapprox": "⪅",
  4583. "lessdot": "⋖",
  4584. "lesseqgtr": "⋚",
  4585. "lesseqqgtr": "⪋",
  4586. "LessEqualGreater": "⋚",
  4587. "LessFullEqual": "≦",
  4588. "LessGreater": "≶",
  4589. "lessgtr": "≶",
  4590. "LessLess": "⪡",
  4591. "lesssim": "≲",
  4592. "LessSlantEqual": "⩽",
  4593. "LessTilde": "≲",
  4594. "lfisht": "⥼",
  4595. "lfloor": "⌊",
  4596. "Lfr": "𝔏",
  4597. "lfr": "𝔩",
  4598. "lg": "≶",
  4599. "lgE": "⪑",
  4600. "lHar": "⥢",
  4601. "lhard": "↽",
  4602. "lharu": "↼",
  4603. "lharul": "⥪",
  4604. "lhblk": "▄",
  4605. "LJcy": "Љ",
  4606. "ljcy": "љ",
  4607. "llarr": "⇇",
  4608. "ll": "≪",
  4609. "Ll": "⋘",
  4610. "llcorner": "⌞",
  4611. "Lleftarrow": "⇚",
  4612. "llhard": "⥫",
  4613. "lltri": "◺",
  4614. "Lmidot": "Ŀ",
  4615. "lmidot": "ŀ",
  4616. "lmoustache": "⎰",
  4617. "lmoust": "⎰",
  4618. "lnap": "⪉",
  4619. "lnapprox": "⪉",
  4620. "lne": "⪇",
  4621. "lnE": "≨",
  4622. "lneq": "⪇",
  4623. "lneqq": "≨",
  4624. "lnsim": "⋦",
  4625. "loang": "⟬",
  4626. "loarr": "⇽",
  4627. "lobrk": "⟦",
  4628. "longleftarrow": "⟵",
  4629. "LongLeftArrow": "⟵",
  4630. "Longleftarrow": "⟸",
  4631. "longleftrightarrow": "⟷",
  4632. "LongLeftRightArrow": "⟷",
  4633. "Longleftrightarrow": "⟺",
  4634. "longmapsto": "⟼",
  4635. "longrightarrow": "⟶",
  4636. "LongRightArrow": "⟶",
  4637. "Longrightarrow": "⟹",
  4638. "looparrowleft": "↫",
  4639. "looparrowright": "↬",
  4640. "lopar": "⦅",
  4641. "Lopf": "𝕃",
  4642. "lopf": "𝕝",
  4643. "loplus": "⨭",
  4644. "lotimes": "⨴",
  4645. "lowast": "∗",
  4646. "lowbar": "_",
  4647. "LowerLeftArrow": "↙",
  4648. "LowerRightArrow": "↘",
  4649. "loz": "◊",
  4650. "lozenge": "◊",
  4651. "lozf": "⧫",
  4652. "lpar": "(",
  4653. "lparlt": "⦓",
  4654. "lrarr": "⇆",
  4655. "lrcorner": "⌟",
  4656. "lrhar": "⇋",
  4657. "lrhard": "⥭",
  4658. "lrm": "‎",
  4659. "lrtri": "⊿",
  4660. "lsaquo": "‹",
  4661. "lscr": "𝓁",
  4662. "Lscr": "ℒ",
  4663. "lsh": "↰",
  4664. "Lsh": "↰",
  4665. "lsim": "≲",
  4666. "lsime": "⪍",
  4667. "lsimg": "⪏",
  4668. "lsqb": "[",
  4669. "lsquo": "‘",
  4670. "lsquor": "‚",
  4671. "Lstrok": "Ł",
  4672. "lstrok": "ł",
  4673. "ltcc": "⪦",
  4674. "ltcir": "⩹",
  4675. "lt": "<",
  4676. "LT": "<",
  4677. "Lt": "≪",
  4678. "ltdot": "⋖",
  4679. "lthree": "⋋",
  4680. "ltimes": "⋉",
  4681. "ltlarr": "⥶",
  4682. "ltquest": "⩻",
  4683. "ltri": "◃",
  4684. "ltrie": "⊴",
  4685. "ltrif": "◂",
  4686. "ltrPar": "⦖",
  4687. "lurdshar": "⥊",
  4688. "luruhar": "⥦",
  4689. "lvertneqq": "≨︀",
  4690. "lvnE": "≨︀",
  4691. "macr": "¯",
  4692. "male": "♂",
  4693. "malt": "✠",
  4694. "maltese": "✠",
  4695. "Map": "⤅",
  4696. "map": "↦",
  4697. "mapsto": "↦",
  4698. "mapstodown": "↧",
  4699. "mapstoleft": "↤",
  4700. "mapstoup": "↥",
  4701. "marker": "▮",
  4702. "mcomma": "⨩",
  4703. "Mcy": "М",
  4704. "mcy": "м",
  4705. "mdash": "—",
  4706. "mDDot": "∺",
  4707. "measuredangle": "∡",
  4708. "MediumSpace": " ",
  4709. "Mellintrf": "ℳ",
  4710. "Mfr": "𝔐",
  4711. "mfr": "𝔪",
  4712. "mho": "℧",
  4713. "micro": "µ",
  4714. "midast": "*",
  4715. "midcir": "⫰",
  4716. "mid": "∣",
  4717. "middot": "·",
  4718. "minusb": "⊟",
  4719. "minus": "−",
  4720. "minusd": "∸",
  4721. "minusdu": "⨪",
  4722. "MinusPlus": "∓",
  4723. "mlcp": "⫛",
  4724. "mldr": "…",
  4725. "mnplus": "∓",
  4726. "models": "⊧",
  4727. "Mopf": "𝕄",
  4728. "mopf": "𝕞",
  4729. "mp": "∓",
  4730. "mscr": "𝓂",
  4731. "Mscr": "ℳ",
  4732. "mstpos": "∾",
  4733. "Mu": "Μ",
  4734. "mu": "μ",
  4735. "multimap": "⊸",
  4736. "mumap": "⊸",
  4737. "nabla": "∇",
  4738. "Nacute": "Ń",
  4739. "nacute": "ń",
  4740. "nang": "∠⃒",
  4741. "nap": "≉",
  4742. "napE": "⩰̸",
  4743. "napid": "≋̸",
  4744. "napos": "ʼn",
  4745. "napprox": "≉",
  4746. "natural": "♮",
  4747. "naturals": "ℕ",
  4748. "natur": "♮",
  4749. "nbsp": " ",
  4750. "nbump": "≎̸",
  4751. "nbumpe": "≏̸",
  4752. "ncap": "⩃",
  4753. "Ncaron": "Ň",
  4754. "ncaron": "ň",
  4755. "Ncedil": "Ņ",
  4756. "ncedil": "ņ",
  4757. "ncong": "≇",
  4758. "ncongdot": "⩭̸",
  4759. "ncup": "⩂",
  4760. "Ncy": "Н",
  4761. "ncy": "н",
  4762. "ndash": "–",
  4763. "nearhk": "⤤",
  4764. "nearr": "↗",
  4765. "neArr": "⇗",
  4766. "nearrow": "↗",
  4767. "ne": "≠",
  4768. "nedot": "≐̸",
  4769. "NegativeMediumSpace": "​",
  4770. "NegativeThickSpace": "​",
  4771. "NegativeThinSpace": "​",
  4772. "NegativeVeryThinSpace": "​",
  4773. "nequiv": "≢",
  4774. "nesear": "⤨",
  4775. "nesim": "≂̸",
  4776. "NestedGreaterGreater": "≫",
  4777. "NestedLessLess": "≪",
  4778. "NewLine": "\n",
  4779. "nexist": "∄",
  4780. "nexists": "∄",
  4781. "Nfr": "𝔑",
  4782. "nfr": "𝔫",
  4783. "ngE": "≧̸",
  4784. "nge": "≱",
  4785. "ngeq": "≱",
  4786. "ngeqq": "≧̸",
  4787. "ngeqslant": "⩾̸",
  4788. "nges": "⩾̸",
  4789. "nGg": "⋙̸",
  4790. "ngsim": "≵",
  4791. "nGt": "≫⃒",
  4792. "ngt": "≯",
  4793. "ngtr": "≯",
  4794. "nGtv": "≫̸",
  4795. "nharr": "↮",
  4796. "nhArr": "⇎",
  4797. "nhpar": "⫲",
  4798. "ni": "∋",
  4799. "nis": "⋼",
  4800. "nisd": "⋺",
  4801. "niv": "∋",
  4802. "NJcy": "Њ",
  4803. "njcy": "њ",
  4804. "nlarr": "↚",
  4805. "nlArr": "⇍",
  4806. "nldr": "‥",
  4807. "nlE": "≦̸",
  4808. "nle": "≰",
  4809. "nleftarrow": "↚",
  4810. "nLeftarrow": "⇍",
  4811. "nleftrightarrow": "↮",
  4812. "nLeftrightarrow": "⇎",
  4813. "nleq": "≰",
  4814. "nleqq": "≦̸",
  4815. "nleqslant": "⩽̸",
  4816. "nles": "⩽̸",
  4817. "nless": "≮",
  4818. "nLl": "⋘̸",
  4819. "nlsim": "≴",
  4820. "nLt": "≪⃒",
  4821. "nlt": "≮",
  4822. "nltri": "⋪",
  4823. "nltrie": "⋬",
  4824. "nLtv": "≪̸",
  4825. "nmid": "∤",
  4826. "NoBreak": "⁠",
  4827. "NonBreakingSpace": " ",
  4828. "nopf": "𝕟",
  4829. "Nopf": "ℕ",
  4830. "Not": "⫬",
  4831. "not": "¬",
  4832. "NotCongruent": "≢",
  4833. "NotCupCap": "≭",
  4834. "NotDoubleVerticalBar": "∦",
  4835. "NotElement": "∉",
  4836. "NotEqual": "≠",
  4837. "NotEqualTilde": "≂̸",
  4838. "NotExists": "∄",
  4839. "NotGreater": "≯",
  4840. "NotGreaterEqual": "≱",
  4841. "NotGreaterFullEqual": "≧̸",
  4842. "NotGreaterGreater": "≫̸",
  4843. "NotGreaterLess": "≹",
  4844. "NotGreaterSlantEqual": "⩾̸",
  4845. "NotGreaterTilde": "≵",
  4846. "NotHumpDownHump": "≎̸",
  4847. "NotHumpEqual": "≏̸",
  4848. "notin": "∉",
  4849. "notindot": "⋵̸",
  4850. "notinE": "⋹̸",
  4851. "notinva": "∉",
  4852. "notinvb": "⋷",
  4853. "notinvc": "⋶",
  4854. "NotLeftTriangleBar": "⧏̸",
  4855. "NotLeftTriangle": "⋪",
  4856. "NotLeftTriangleEqual": "⋬",
  4857. "NotLess": "≮",
  4858. "NotLessEqual": "≰",
  4859. "NotLessGreater": "≸",
  4860. "NotLessLess": "≪̸",
  4861. "NotLessSlantEqual": "⩽̸",
  4862. "NotLessTilde": "≴",
  4863. "NotNestedGreaterGreater": "⪢̸",
  4864. "NotNestedLessLess": "⪡̸",
  4865. "notni": "∌",
  4866. "notniva": "∌",
  4867. "notnivb": "⋾",
  4868. "notnivc": "⋽",
  4869. "NotPrecedes": "⊀",
  4870. "NotPrecedesEqual": "⪯̸",
  4871. "NotPrecedesSlantEqual": "⋠",
  4872. "NotReverseElement": "∌",
  4873. "NotRightTriangleBar": "⧐̸",
  4874. "NotRightTriangle": "⋫",
  4875. "NotRightTriangleEqual": "⋭",
  4876. "NotSquareSubset": "⊏̸",
  4877. "NotSquareSubsetEqual": "⋢",
  4878. "NotSquareSuperset": "⊐̸",
  4879. "NotSquareSupersetEqual": "⋣",
  4880. "NotSubset": "⊂⃒",
  4881. "NotSubsetEqual": "⊈",
  4882. "NotSucceeds": "⊁",
  4883. "NotSucceedsEqual": "⪰̸",
  4884. "NotSucceedsSlantEqual": "⋡",
  4885. "NotSucceedsTilde": "≿̸",
  4886. "NotSuperset": "⊃⃒",
  4887. "NotSupersetEqual": "⊉",
  4888. "NotTilde": "≁",
  4889. "NotTildeEqual": "≄",
  4890. "NotTildeFullEqual": "≇",
  4891. "NotTildeTilde": "≉",
  4892. "NotVerticalBar": "∤",
  4893. "nparallel": "∦",
  4894. "npar": "∦",
  4895. "nparsl": "⫽⃥",
  4896. "npart": "∂̸",
  4897. "npolint": "⨔",
  4898. "npr": "⊀",
  4899. "nprcue": "⋠",
  4900. "nprec": "⊀",
  4901. "npreceq": "⪯̸",
  4902. "npre": "⪯̸",
  4903. "nrarrc": "⤳̸",
  4904. "nrarr": "↛",
  4905. "nrArr": "⇏",
  4906. "nrarrw": "↝̸",
  4907. "nrightarrow": "↛",
  4908. "nRightarrow": "⇏",
  4909. "nrtri": "⋫",
  4910. "nrtrie": "⋭",
  4911. "nsc": "⊁",
  4912. "nsccue": "⋡",
  4913. "nsce": "⪰̸",
  4914. "Nscr": "𝒩",
  4915. "nscr": "𝓃",
  4916. "nshortmid": "∤",
  4917. "nshortparallel": "∦",
  4918. "nsim": "≁",
  4919. "nsime": "≄",
  4920. "nsimeq": "≄",
  4921. "nsmid": "∤",
  4922. "nspar": "∦",
  4923. "nsqsube": "⋢",
  4924. "nsqsupe": "⋣",
  4925. "nsub": "⊄",
  4926. "nsubE": "⫅̸",
  4927. "nsube": "⊈",
  4928. "nsubset": "⊂⃒",
  4929. "nsubseteq": "⊈",
  4930. "nsubseteqq": "⫅̸",
  4931. "nsucc": "⊁",
  4932. "nsucceq": "⪰̸",
  4933. "nsup": "⊅",
  4934. "nsupE": "⫆̸",
  4935. "nsupe": "⊉",
  4936. "nsupset": "⊃⃒",
  4937. "nsupseteq": "⊉",
  4938. "nsupseteqq": "⫆̸",
  4939. "ntgl": "≹",
  4940. "Ntilde": "Ñ",
  4941. "ntilde": "ñ",
  4942. "ntlg": "≸",
  4943. "ntriangleleft": "⋪",
  4944. "ntrianglelefteq": "⋬",
  4945. "ntriangleright": "⋫",
  4946. "ntrianglerighteq": "⋭",
  4947. "Nu": "Ν",
  4948. "nu": "ν",
  4949. "num": "#",
  4950. "numero": "№",
  4951. "numsp": " ",
  4952. "nvap": "≍⃒",
  4953. "nvdash": "⊬",
  4954. "nvDash": "⊭",
  4955. "nVdash": "⊮",
  4956. "nVDash": "⊯",
  4957. "nvge": "≥⃒",
  4958. "nvgt": ">⃒",
  4959. "nvHarr": "⤄",
  4960. "nvinfin": "⧞",
  4961. "nvlArr": "⤂",
  4962. "nvle": "≤⃒",
  4963. "nvlt": "<⃒",
  4964. "nvltrie": "⊴⃒",
  4965. "nvrArr": "⤃",
  4966. "nvrtrie": "⊵⃒",
  4967. "nvsim": "∼⃒",
  4968. "nwarhk": "⤣",
  4969. "nwarr": "↖",
  4970. "nwArr": "⇖",
  4971. "nwarrow": "↖",
  4972. "nwnear": "⤧",
  4973. "Oacute": "Ó",
  4974. "oacute": "ó",
  4975. "oast": "⊛",
  4976. "Ocirc": "Ô",
  4977. "ocirc": "ô",
  4978. "ocir": "⊚",
  4979. "Ocy": "О",
  4980. "ocy": "о",
  4981. "odash": "⊝",
  4982. "Odblac": "Ő",
  4983. "odblac": "ő",
  4984. "odiv": "⨸",
  4985. "odot": "⊙",
  4986. "odsold": "⦼",
  4987. "OElig": "Œ",
  4988. "oelig": "œ",
  4989. "ofcir": "⦿",
  4990. "Ofr": "𝔒",
  4991. "ofr": "𝔬",
  4992. "ogon": "˛",
  4993. "Ograve": "Ò",
  4994. "ograve": "ò",
  4995. "ogt": "⧁",
  4996. "ohbar": "⦵",
  4997. "ohm": "Ω",
  4998. "oint": "∮",
  4999. "olarr": "↺",
  5000. "olcir": "⦾",
  5001. "olcross": "⦻",
  5002. "oline": "‾",
  5003. "olt": "⧀",
  5004. "Omacr": "Ō",
  5005. "omacr": "ō",
  5006. "Omega": "Ω",
  5007. "omega": "ω",
  5008. "Omicron": "Ο",
  5009. "omicron": "ο",
  5010. "omid": "⦶",
  5011. "ominus": "⊖",
  5012. "Oopf": "𝕆",
  5013. "oopf": "𝕠",
  5014. "opar": "⦷",
  5015. "OpenCurlyDoubleQuote": "“",
  5016. "OpenCurlyQuote": "‘",
  5017. "operp": "⦹",
  5018. "oplus": "⊕",
  5019. "orarr": "↻",
  5020. "Or": "⩔",
  5021. "or": "∨",
  5022. "ord": "⩝",
  5023. "order": "ℴ",
  5024. "orderof": "ℴ",
  5025. "ordf": "ª",
  5026. "ordm": "º",
  5027. "origof": "⊶",
  5028. "oror": "⩖",
  5029. "orslope": "⩗",
  5030. "orv": "⩛",
  5031. "oS": "Ⓢ",
  5032. "Oscr": "𝒪",
  5033. "oscr": "ℴ",
  5034. "Oslash": "Ø",
  5035. "oslash": "ø",
  5036. "osol": "⊘",
  5037. "Otilde": "Õ",
  5038. "otilde": "õ",
  5039. "otimesas": "⨶",
  5040. "Otimes": "⨷",
  5041. "otimes": "⊗",
  5042. "Ouml": "Ö",
  5043. "ouml": "ö",
  5044. "ovbar": "⌽",
  5045. "OverBar": "‾",
  5046. "OverBrace": "⏞",
  5047. "OverBracket": "⎴",
  5048. "OverParenthesis": "⏜",
  5049. "para": "¶",
  5050. "parallel": "∥",
  5051. "par": "∥",
  5052. "parsim": "⫳",
  5053. "parsl": "⫽",
  5054. "part": "∂",
  5055. "PartialD": "∂",
  5056. "Pcy": "П",
  5057. "pcy": "п",
  5058. "percnt": "%",
  5059. "period": ".",
  5060. "permil": "‰",
  5061. "perp": "⊥",
  5062. "pertenk": "‱",
  5063. "Pfr": "𝔓",
  5064. "pfr": "𝔭",
  5065. "Phi": "Φ",
  5066. "phi": "φ",
  5067. "phiv": "ϕ",
  5068. "phmmat": "ℳ",
  5069. "phone": "☎",
  5070. "Pi": "Π",
  5071. "pi": "π",
  5072. "pitchfork": "⋔",
  5073. "piv": "ϖ",
  5074. "planck": "ℏ",
  5075. "planckh": "ℎ",
  5076. "plankv": "ℏ",
  5077. "plusacir": "⨣",
  5078. "plusb": "⊞",
  5079. "pluscir": "⨢",
  5080. "plus": "+",
  5081. "plusdo": "∔",
  5082. "plusdu": "⨥",
  5083. "pluse": "⩲",
  5084. "PlusMinus": "±",
  5085. "plusmn": "±",
  5086. "plussim": "⨦",
  5087. "plustwo": "⨧",
  5088. "pm": "±",
  5089. "Poincareplane": "ℌ",
  5090. "pointint": "⨕",
  5091. "popf": "𝕡",
  5092. "Popf": "ℙ",
  5093. "pound": "£",
  5094. "prap": "⪷",
  5095. "Pr": "⪻",
  5096. "pr": "≺",
  5097. "prcue": "≼",
  5098. "precapprox": "⪷",
  5099. "prec": "≺",
  5100. "preccurlyeq": "≼",
  5101. "Precedes": "≺",
  5102. "PrecedesEqual": "⪯",
  5103. "PrecedesSlantEqual": "≼",
  5104. "PrecedesTilde": "≾",
  5105. "preceq": "⪯",
  5106. "precnapprox": "⪹",
  5107. "precneqq": "⪵",
  5108. "precnsim": "⋨",
  5109. "pre": "⪯",
  5110. "prE": "⪳",
  5111. "precsim": "≾",
  5112. "prime": "′",
  5113. "Prime": "″",
  5114. "primes": "ℙ",
  5115. "prnap": "⪹",
  5116. "prnE": "⪵",
  5117. "prnsim": "⋨",
  5118. "prod": "∏",
  5119. "Product": "∏",
  5120. "profalar": "⌮",
  5121. "profline": "⌒",
  5122. "profsurf": "⌓",
  5123. "prop": "∝",
  5124. "Proportional": "∝",
  5125. "Proportion": "∷",
  5126. "propto": "∝",
  5127. "prsim": "≾",
  5128. "prurel": "⊰",
  5129. "Pscr": "𝒫",
  5130. "pscr": "𝓅",
  5131. "Psi": "Ψ",
  5132. "psi": "ψ",
  5133. "puncsp": " ",
  5134. "Qfr": "𝔔",
  5135. "qfr": "𝔮",
  5136. "qint": "⨌",
  5137. "qopf": "𝕢",
  5138. "Qopf": "ℚ",
  5139. "qprime": "⁗",
  5140. "Qscr": "𝒬",
  5141. "qscr": "𝓆",
  5142. "quaternions": "ℍ",
  5143. "quatint": "⨖",
  5144. "quest": "?",
  5145. "questeq": "≟",
  5146. "quot": "\"",
  5147. "QUOT": "\"",
  5148. "rAarr": "⇛",
  5149. "race": "∽̱",
  5150. "Racute": "Ŕ",
  5151. "racute": "ŕ",
  5152. "radic": "√",
  5153. "raemptyv": "⦳",
  5154. "rang": "⟩",
  5155. "Rang": "⟫",
  5156. "rangd": "⦒",
  5157. "range": "⦥",
  5158. "rangle": "⟩",
  5159. "raquo": "»",
  5160. "rarrap": "⥵",
  5161. "rarrb": "⇥",
  5162. "rarrbfs": "⤠",
  5163. "rarrc": "⤳",
  5164. "rarr": "→",
  5165. "Rarr": "↠",
  5166. "rArr": "⇒",
  5167. "rarrfs": "⤞",
  5168. "rarrhk": "↪",
  5169. "rarrlp": "↬",
  5170. "rarrpl": "⥅",
  5171. "rarrsim": "⥴",
  5172. "Rarrtl": "⤖",
  5173. "rarrtl": "↣",
  5174. "rarrw": "↝",
  5175. "ratail": "⤚",
  5176. "rAtail": "⤜",
  5177. "ratio": "∶",
  5178. "rationals": "ℚ",
  5179. "rbarr": "⤍",
  5180. "rBarr": "⤏",
  5181. "RBarr": "⤐",
  5182. "rbbrk": "❳",
  5183. "rbrace": "}",
  5184. "rbrack": "]",
  5185. "rbrke": "⦌",
  5186. "rbrksld": "⦎",
  5187. "rbrkslu": "⦐",
  5188. "Rcaron": "Ř",
  5189. "rcaron": "ř",
  5190. "Rcedil": "Ŗ",
  5191. "rcedil": "ŗ",
  5192. "rceil": "⌉",
  5193. "rcub": "}",
  5194. "Rcy": "Р",
  5195. "rcy": "р",
  5196. "rdca": "⤷",
  5197. "rdldhar": "⥩",
  5198. "rdquo": "”",
  5199. "rdquor": "”",
  5200. "rdsh": "↳",
  5201. "real": "ℜ",
  5202. "realine": "ℛ",
  5203. "realpart": "ℜ",
  5204. "reals": "ℝ",
  5205. "Re": "ℜ",
  5206. "rect": "▭",
  5207. "reg": "®",
  5208. "REG": "®",
  5209. "ReverseElement": "∋",
  5210. "ReverseEquilibrium": "⇋",
  5211. "ReverseUpEquilibrium": "⥯",
  5212. "rfisht": "⥽",
  5213. "rfloor": "⌋",
  5214. "rfr": "𝔯",
  5215. "Rfr": "ℜ",
  5216. "rHar": "⥤",
  5217. "rhard": "⇁",
  5218. "rharu": "⇀",
  5219. "rharul": "⥬",
  5220. "Rho": "Ρ",
  5221. "rho": "ρ",
  5222. "rhov": "ϱ",
  5223. "RightAngleBracket": "⟩",
  5224. "RightArrowBar": "⇥",
  5225. "rightarrow": "→",
  5226. "RightArrow": "→",
  5227. "Rightarrow": "⇒",
  5228. "RightArrowLeftArrow": "⇄",
  5229. "rightarrowtail": "↣",
  5230. "RightCeiling": "⌉",
  5231. "RightDoubleBracket": "⟧",
  5232. "RightDownTeeVector": "⥝",
  5233. "RightDownVectorBar": "⥕",
  5234. "RightDownVector": "⇂",
  5235. "RightFloor": "⌋",
  5236. "rightharpoondown": "⇁",
  5237. "rightharpoonup": "⇀",
  5238. "rightleftarrows": "⇄",
  5239. "rightleftharpoons": "⇌",
  5240. "rightrightarrows": "⇉",
  5241. "rightsquigarrow": "↝",
  5242. "RightTeeArrow": "↦",
  5243. "RightTee": "⊢",
  5244. "RightTeeVector": "⥛",
  5245. "rightthreetimes": "⋌",
  5246. "RightTriangleBar": "⧐",
  5247. "RightTriangle": "⊳",
  5248. "RightTriangleEqual": "⊵",
  5249. "RightUpDownVector": "⥏",
  5250. "RightUpTeeVector": "⥜",
  5251. "RightUpVectorBar": "⥔",
  5252. "RightUpVector": "↾",
  5253. "RightVectorBar": "⥓",
  5254. "RightVector": "⇀",
  5255. "ring": "˚",
  5256. "risingdotseq": "≓",
  5257. "rlarr": "⇄",
  5258. "rlhar": "⇌",
  5259. "rlm": "‏",
  5260. "rmoustache": "⎱",
  5261. "rmoust": "⎱",
  5262. "rnmid": "⫮",
  5263. "roang": "⟭",
  5264. "roarr": "⇾",
  5265. "robrk": "⟧",
  5266. "ropar": "⦆",
  5267. "ropf": "𝕣",
  5268. "Ropf": "ℝ",
  5269. "roplus": "⨮",
  5270. "rotimes": "⨵",
  5271. "RoundImplies": "⥰",
  5272. "rpar": ")",
  5273. "rpargt": "⦔",
  5274. "rppolint": "⨒",
  5275. "rrarr": "⇉",
  5276. "Rrightarrow": "⇛",
  5277. "rsaquo": "›",
  5278. "rscr": "𝓇",
  5279. "Rscr": "ℛ",
  5280. "rsh": "↱",
  5281. "Rsh": "↱",
  5282. "rsqb": "]",
  5283. "rsquo": "’",
  5284. "rsquor": "’",
  5285. "rthree": "⋌",
  5286. "rtimes": "⋊",
  5287. "rtri": "▹",
  5288. "rtrie": "⊵",
  5289. "rtrif": "▸",
  5290. "rtriltri": "⧎",
  5291. "RuleDelayed": "⧴",
  5292. "ruluhar": "⥨",
  5293. "rx": "℞",
  5294. "Sacute": "Ś",
  5295. "sacute": "ś",
  5296. "sbquo": "‚",
  5297. "scap": "⪸",
  5298. "Scaron": "Š",
  5299. "scaron": "š",
  5300. "Sc": "⪼",
  5301. "sc": "≻",
  5302. "sccue": "≽",
  5303. "sce": "⪰",
  5304. "scE": "⪴",
  5305. "Scedil": "Ş",
  5306. "scedil": "ş",
  5307. "Scirc": "Ŝ",
  5308. "scirc": "ŝ",
  5309. "scnap": "⪺",
  5310. "scnE": "⪶",
  5311. "scnsim": "⋩",
  5312. "scpolint": "⨓",
  5313. "scsim": "≿",
  5314. "Scy": "С",
  5315. "scy": "с",
  5316. "sdotb": "⊡",
  5317. "sdot": "⋅",
  5318. "sdote": "⩦",
  5319. "searhk": "⤥",
  5320. "searr": "↘",
  5321. "seArr": "⇘",
  5322. "searrow": "↘",
  5323. "sect": "§",
  5324. "semi": ";",
  5325. "seswar": "⤩",
  5326. "setminus": "∖",
  5327. "setmn": "∖",
  5328. "sext": "✶",
  5329. "Sfr": "𝔖",
  5330. "sfr": "𝔰",
  5331. "sfrown": "⌢",
  5332. "sharp": "♯",
  5333. "SHCHcy": "Щ",
  5334. "shchcy": "щ",
  5335. "SHcy": "Ш",
  5336. "shcy": "ш",
  5337. "ShortDownArrow": "↓",
  5338. "ShortLeftArrow": "←",
  5339. "shortmid": "∣",
  5340. "shortparallel": "∥",
  5341. "ShortRightArrow": "→",
  5342. "ShortUpArrow": "↑",
  5343. "shy": "­",
  5344. "Sigma": "Σ",
  5345. "sigma": "σ",
  5346. "sigmaf": "ς",
  5347. "sigmav": "ς",
  5348. "sim": "∼",
  5349. "simdot": "⩪",
  5350. "sime": "≃",
  5351. "simeq": "≃",
  5352. "simg": "⪞",
  5353. "simgE": "⪠",
  5354. "siml": "⪝",
  5355. "simlE": "⪟",
  5356. "simne": "≆",
  5357. "simplus": "⨤",
  5358. "simrarr": "⥲",
  5359. "slarr": "←",
  5360. "SmallCircle": "∘",
  5361. "smallsetminus": "∖",
  5362. "smashp": "⨳",
  5363. "smeparsl": "⧤",
  5364. "smid": "∣",
  5365. "smile": "⌣",
  5366. "smt": "⪪",
  5367. "smte": "⪬",
  5368. "smtes": "⪬︀",
  5369. "SOFTcy": "Ь",
  5370. "softcy": "ь",
  5371. "solbar": "⌿",
  5372. "solb": "⧄",
  5373. "sol": "/",
  5374. "Sopf": "𝕊",
  5375. "sopf": "𝕤",
  5376. "spades": "♠",
  5377. "spadesuit": "♠",
  5378. "spar": "∥",
  5379. "sqcap": "⊓",
  5380. "sqcaps": "⊓︀",
  5381. "sqcup": "⊔",
  5382. "sqcups": "⊔︀",
  5383. "Sqrt": "√",
  5384. "sqsub": "⊏",
  5385. "sqsube": "⊑",
  5386. "sqsubset": "⊏",
  5387. "sqsubseteq": "⊑",
  5388. "sqsup": "⊐",
  5389. "sqsupe": "⊒",
  5390. "sqsupset": "⊐",
  5391. "sqsupseteq": "⊒",
  5392. "square": "□",
  5393. "Square": "□",
  5394. "SquareIntersection": "⊓",
  5395. "SquareSubset": "⊏",
  5396. "SquareSubsetEqual": "⊑",
  5397. "SquareSuperset": "⊐",
  5398. "SquareSupersetEqual": "⊒",
  5399. "SquareUnion": "⊔",
  5400. "squarf": "▪",
  5401. "squ": "□",
  5402. "squf": "▪",
  5403. "srarr": "→",
  5404. "Sscr": "𝒮",
  5405. "sscr": "𝓈",
  5406. "ssetmn": "∖",
  5407. "ssmile": "⌣",
  5408. "sstarf": "⋆",
  5409. "Star": "⋆",
  5410. "star": "☆",
  5411. "starf": "★",
  5412. "straightepsilon": "ϵ",
  5413. "straightphi": "ϕ",
  5414. "strns": "¯",
  5415. "sub": "⊂",
  5416. "Sub": "⋐",
  5417. "subdot": "⪽",
  5418. "subE": "⫅",
  5419. "sube": "⊆",
  5420. "subedot": "⫃",
  5421. "submult": "⫁",
  5422. "subnE": "⫋",
  5423. "subne": "⊊",
  5424. "subplus": "⪿",
  5425. "subrarr": "⥹",
  5426. "subset": "⊂",
  5427. "Subset": "⋐",
  5428. "subseteq": "⊆",
  5429. "subseteqq": "⫅",
  5430. "SubsetEqual": "⊆",
  5431. "subsetneq": "⊊",
  5432. "subsetneqq": "⫋",
  5433. "subsim": "⫇",
  5434. "subsub": "⫕",
  5435. "subsup": "⫓",
  5436. "succapprox": "⪸",
  5437. "succ": "≻",
  5438. "succcurlyeq": "≽",
  5439. "Succeeds": "≻",
  5440. "SucceedsEqual": "⪰",
  5441. "SucceedsSlantEqual": "≽",
  5442. "SucceedsTilde": "≿",
  5443. "succeq": "⪰",
  5444. "succnapprox": "⪺",
  5445. "succneqq": "⪶",
  5446. "succnsim": "⋩",
  5447. "succsim": "≿",
  5448. "SuchThat": "∋",
  5449. "sum": "∑",
  5450. "Sum": "∑",
  5451. "sung": "♪",
  5452. "sup1": "¹",
  5453. "sup2": "²",
  5454. "sup3": "³",
  5455. "sup": "⊃",
  5456. "Sup": "⋑",
  5457. "supdot": "⪾",
  5458. "supdsub": "⫘",
  5459. "supE": "⫆",
  5460. "supe": "⊇",
  5461. "supedot": "⫄",
  5462. "Superset": "⊃",
  5463. "SupersetEqual": "⊇",
  5464. "suphsol": "⟉",
  5465. "suphsub": "⫗",
  5466. "suplarr": "⥻",
  5467. "supmult": "⫂",
  5468. "supnE": "⫌",
  5469. "supne": "⊋",
  5470. "supplus": "⫀",
  5471. "supset": "⊃",
  5472. "Supset": "⋑",
  5473. "supseteq": "⊇",
  5474. "supseteqq": "⫆",
  5475. "supsetneq": "⊋",
  5476. "supsetneqq": "⫌",
  5477. "supsim": "⫈",
  5478. "supsub": "⫔",
  5479. "supsup": "⫖",
  5480. "swarhk": "⤦",
  5481. "swarr": "↙",
  5482. "swArr": "⇙",
  5483. "swarrow": "↙",
  5484. "swnwar": "⤪",
  5485. "szlig": "ß",
  5486. "Tab": "\t",
  5487. "target": "⌖",
  5488. "Tau": "Τ",
  5489. "tau": "τ",
  5490. "tbrk": "⎴",
  5491. "Tcaron": "Ť",
  5492. "tcaron": "ť",
  5493. "Tcedil": "Ţ",
  5494. "tcedil": "ţ",
  5495. "Tcy": "Т",
  5496. "tcy": "т",
  5497. "tdot": "⃛",
  5498. "telrec": "⌕",
  5499. "Tfr": "𝔗",
  5500. "tfr": "𝔱",
  5501. "there4": "∴",
  5502. "therefore": "∴",
  5503. "Therefore": "∴",
  5504. "Theta": "Θ",
  5505. "theta": "θ",
  5506. "thetasym": "ϑ",
  5507. "thetav": "ϑ",
  5508. "thickapprox": "≈",
  5509. "thicksim": "∼",
  5510. "ThickSpace": "  ",
  5511. "ThinSpace": " ",
  5512. "thinsp": " ",
  5513. "thkap": "≈",
  5514. "thksim": "∼",
  5515. "THORN": "Þ",
  5516. "thorn": "þ",
  5517. "tilde": "˜",
  5518. "Tilde": "∼",
  5519. "TildeEqual": "≃",
  5520. "TildeFullEqual": "≅",
  5521. "TildeTilde": "≈",
  5522. "timesbar": "⨱",
  5523. "timesb": "⊠",
  5524. "times": "×",
  5525. "timesd": "⨰",
  5526. "tint": "∭",
  5527. "toea": "⤨",
  5528. "topbot": "⌶",
  5529. "topcir": "⫱",
  5530. "top": "⊤",
  5531. "Topf": "𝕋",
  5532. "topf": "𝕥",
  5533. "topfork": "⫚",
  5534. "tosa": "⤩",
  5535. "tprime": "‴",
  5536. "trade": "™",
  5537. "TRADE": "™",
  5538. "triangle": "▵",
  5539. "triangledown": "▿",
  5540. "triangleleft": "◃",
  5541. "trianglelefteq": "⊴",
  5542. "triangleq": "≜",
  5543. "triangleright": "▹",
  5544. "trianglerighteq": "⊵",
  5545. "tridot": "◬",
  5546. "trie": "≜",
  5547. "triminus": "⨺",
  5548. "TripleDot": "⃛",
  5549. "triplus": "⨹",
  5550. "trisb": "⧍",
  5551. "tritime": "⨻",
  5552. "trpezium": "⏢",
  5553. "Tscr": "𝒯",
  5554. "tscr": "𝓉",
  5555. "TScy": "Ц",
  5556. "tscy": "ц",
  5557. "TSHcy": "Ћ",
  5558. "tshcy": "ћ",
  5559. "Tstrok": "Ŧ",
  5560. "tstrok": "ŧ",
  5561. "twixt": "≬",
  5562. "twoheadleftarrow": "↞",
  5563. "twoheadrightarrow": "↠",
  5564. "Uacute": "Ú",
  5565. "uacute": "ú",
  5566. "uarr": "↑",
  5567. "Uarr": "↟",
  5568. "uArr": "⇑",
  5569. "Uarrocir": "⥉",
  5570. "Ubrcy": "Ў",
  5571. "ubrcy": "ў",
  5572. "Ubreve": "Ŭ",
  5573. "ubreve": "ŭ",
  5574. "Ucirc": "Û",
  5575. "ucirc": "û",
  5576. "Ucy": "У",
  5577. "ucy": "у",
  5578. "udarr": "⇅",
  5579. "Udblac": "Ű",
  5580. "udblac": "ű",
  5581. "udhar": "⥮",
  5582. "ufisht": "⥾",
  5583. "Ufr": "𝔘",
  5584. "ufr": "𝔲",
  5585. "Ugrave": "Ù",
  5586. "ugrave": "ù",
  5587. "uHar": "⥣",
  5588. "uharl": "↿",
  5589. "uharr": "↾",
  5590. "uhblk": "▀",
  5591. "ulcorn": "⌜",
  5592. "ulcorner": "⌜",
  5593. "ulcrop": "⌏",
  5594. "ultri": "◸",
  5595. "Umacr": "Ū",
  5596. "umacr": "ū",
  5597. "uml": "¨",
  5598. "UnderBar": "_",
  5599. "UnderBrace": "⏟",
  5600. "UnderBracket": "⎵",
  5601. "UnderParenthesis": "⏝",
  5602. "Union": "⋃",
  5603. "UnionPlus": "⊎",
  5604. "Uogon": "Ų",
  5605. "uogon": "ų",
  5606. "Uopf": "𝕌",
  5607. "uopf": "𝕦",
  5608. "UpArrowBar": "⤒",
  5609. "uparrow": "↑",
  5610. "UpArrow": "↑",
  5611. "Uparrow": "⇑",
  5612. "UpArrowDownArrow": "⇅",
  5613. "updownarrow": "↕",
  5614. "UpDownArrow": "↕",
  5615. "Updownarrow": "⇕",
  5616. "UpEquilibrium": "⥮",
  5617. "upharpoonleft": "↿",
  5618. "upharpoonright": "↾",
  5619. "uplus": "⊎",
  5620. "UpperLeftArrow": "↖",
  5621. "UpperRightArrow": "↗",
  5622. "upsi": "υ",
  5623. "Upsi": "ϒ",
  5624. "upsih": "ϒ",
  5625. "Upsilon": "Υ",
  5626. "upsilon": "υ",
  5627. "UpTeeArrow": "↥",
  5628. "UpTee": "⊥",
  5629. "upuparrows": "⇈",
  5630. "urcorn": "⌝",
  5631. "urcorner": "⌝",
  5632. "urcrop": "⌎",
  5633. "Uring": "Ů",
  5634. "uring": "ů",
  5635. "urtri": "◹",
  5636. "Uscr": "𝒰",
  5637. "uscr": "𝓊",
  5638. "utdot": "⋰",
  5639. "Utilde": "Ũ",
  5640. "utilde": "ũ",
  5641. "utri": "▵",
  5642. "utrif": "▴",
  5643. "uuarr": "⇈",
  5644. "Uuml": "Ü",
  5645. "uuml": "ü",
  5646. "uwangle": "⦧",
  5647. "vangrt": "⦜",
  5648. "varepsilon": "ϵ",
  5649. "varkappa": "ϰ",
  5650. "varnothing": "∅",
  5651. "varphi": "ϕ",
  5652. "varpi": "ϖ",
  5653. "varpropto": "∝",
  5654. "varr": "↕",
  5655. "vArr": "⇕",
  5656. "varrho": "ϱ",
  5657. "varsigma": "ς",
  5658. "varsubsetneq": "⊊︀",
  5659. "varsubsetneqq": "⫋︀",
  5660. "varsupsetneq": "⊋︀",
  5661. "varsupsetneqq": "⫌︀",
  5662. "vartheta": "ϑ",
  5663. "vartriangleleft": "⊲",
  5664. "vartriangleright": "⊳",
  5665. "vBar": "⫨",
  5666. "Vbar": "⫫",
  5667. "vBarv": "⫩",
  5668. "Vcy": "В",
  5669. "vcy": "в",
  5670. "vdash": "⊢",
  5671. "vDash": "⊨",
  5672. "Vdash": "⊩",
  5673. "VDash": "⊫",
  5674. "Vdashl": "⫦",
  5675. "veebar": "⊻",
  5676. "vee": "∨",
  5677. "Vee": "⋁",
  5678. "veeeq": "≚",
  5679. "vellip": "⋮",
  5680. "verbar": "|",
  5681. "Verbar": "‖",
  5682. "vert": "|",
  5683. "Vert": "‖",
  5684. "VerticalBar": "∣",
  5685. "VerticalLine": "|",
  5686. "VerticalSeparator": "❘",
  5687. "VerticalTilde": "≀",
  5688. "VeryThinSpace": " ",
  5689. "Vfr": "𝔙",
  5690. "vfr": "𝔳",
  5691. "vltri": "⊲",
  5692. "vnsub": "⊂⃒",
  5693. "vnsup": "⊃⃒",
  5694. "Vopf": "𝕍",
  5695. "vopf": "𝕧",
  5696. "vprop": "∝",
  5697. "vrtri": "⊳",
  5698. "Vscr": "𝒱",
  5699. "vscr": "𝓋",
  5700. "vsubnE": "⫋︀",
  5701. "vsubne": "⊊︀",
  5702. "vsupnE": "⫌︀",
  5703. "vsupne": "⊋︀",
  5704. "Vvdash": "⊪",
  5705. "vzigzag": "⦚",
  5706. "Wcirc": "Ŵ",
  5707. "wcirc": "ŵ",
  5708. "wedbar": "⩟",
  5709. "wedge": "∧",
  5710. "Wedge": "⋀",
  5711. "wedgeq": "≙",
  5712. "weierp": "℘",
  5713. "Wfr": "𝔚",
  5714. "wfr": "𝔴",
  5715. "Wopf": "𝕎",
  5716. "wopf": "𝕨",
  5717. "wp": "℘",
  5718. "wr": "≀",
  5719. "wreath": "≀",
  5720. "Wscr": "𝒲",
  5721. "wscr": "𝓌",
  5722. "xcap": "⋂",
  5723. "xcirc": "◯",
  5724. "xcup": "⋃",
  5725. "xdtri": "▽",
  5726. "Xfr": "𝔛",
  5727. "xfr": "𝔵",
  5728. "xharr": "⟷",
  5729. "xhArr": "⟺",
  5730. "Xi": "Ξ",
  5731. "xi": "ξ",
  5732. "xlarr": "⟵",
  5733. "xlArr": "⟸",
  5734. "xmap": "⟼",
  5735. "xnis": "⋻",
  5736. "xodot": "⨀",
  5737. "Xopf": "𝕏",
  5738. "xopf": "𝕩",
  5739. "xoplus": "⨁",
  5740. "xotime": "⨂",
  5741. "xrarr": "⟶",
  5742. "xrArr": "⟹",
  5743. "Xscr": "𝒳",
  5744. "xscr": "𝓍",
  5745. "xsqcup": "⨆",
  5746. "xuplus": "⨄",
  5747. "xutri": "△",
  5748. "xvee": "⋁",
  5749. "xwedge": "⋀",
  5750. "Yacute": "Ý",
  5751. "yacute": "ý",
  5752. "YAcy": "Я",
  5753. "yacy": "я",
  5754. "Ycirc": "Ŷ",
  5755. "ycirc": "ŷ",
  5756. "Ycy": "Ы",
  5757. "ycy": "ы",
  5758. "yen": "¥",
  5759. "Yfr": "𝔜",
  5760. "yfr": "𝔶",
  5761. "YIcy": "Ї",
  5762. "yicy": "ї",
  5763. "Yopf": "𝕐",
  5764. "yopf": "𝕪",
  5765. "Yscr": "𝒴",
  5766. "yscr": "𝓎",
  5767. "YUcy": "Ю",
  5768. "yucy": "ю",
  5769. "yuml": "ÿ",
  5770. "Yuml": "Ÿ",
  5771. "Zacute": "Ź",
  5772. "zacute": "ź",
  5773. "Zcaron": "Ž",
  5774. "zcaron": "ž",
  5775. "Zcy": "З",
  5776. "zcy": "з",
  5777. "Zdot": "Ż",
  5778. "zdot": "ż",
  5779. "zeetrf": "ℨ",
  5780. "ZeroWidthSpace": "​",
  5781. "Zeta": "Ζ",
  5782. "zeta": "ζ",
  5783. "zfr": "𝔷",
  5784. "Zfr": "ℨ",
  5785. "ZHcy": "Ж",
  5786. "zhcy": "ж",
  5787. "zigrarr": "⇝",
  5788. "zopf": "𝕫",
  5789. "Zopf": "ℤ",
  5790. "Zscr": "𝒵",
  5791. "zscr": "𝓏",
  5792. "zwj": "‍",
  5793. "zwnj": "‌"
  5794. };
  5795. /***/ }),
  5796. /* 25 */
  5797. /***/ (function(module, exports) {
  5798. // removed by extract-text-webpack-plugin
  5799. /***/ }),
  5800. /* 26 */
  5801. /***/ (function(module, exports) {
  5802. // removed by extract-text-webpack-plugin
  5803. /***/ }),
  5804. /* 27 */
  5805. /***/ (function(module, exports) {
  5806. // removed by extract-text-webpack-plugin
  5807. /***/ }),
  5808. /* 28 */
  5809. /***/ (function(module, exports) {
  5810. // removed by extract-text-webpack-plugin
  5811. /***/ }),
  5812. /* 29 */,
  5813. /* 30 */
  5814. /***/ (function(module, exports, __webpack_require__) {
  5815. "use strict";
  5816. ////////////////////////////////////////////////////////////////////////////////
  5817. // Helpers
  5818. // Merge objects
  5819. //
  5820. function assign(obj /*from1, from2, from3, ...*/) {
  5821. var sources = Array.prototype.slice.call(arguments, 1);
  5822. sources.forEach(function (source) {
  5823. if (!source) { return; }
  5824. Object.keys(source).forEach(function (key) {
  5825. obj[key] = source[key];
  5826. });
  5827. });
  5828. return obj;
  5829. }
  5830. function _class(obj) { return Object.prototype.toString.call(obj); }
  5831. function isString(obj) { return _class(obj) === '[object String]'; }
  5832. function isObject(obj) { return _class(obj) === '[object Object]'; }
  5833. function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
  5834. function isFunction(obj) { return _class(obj) === '[object Function]'; }
  5835. function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
  5836. ////////////////////////////////////////////////////////////////////////////////
  5837. var defaultOptions = {
  5838. fuzzyLink: true,
  5839. fuzzyEmail: true,
  5840. fuzzyIP: false
  5841. };
  5842. function isOptionsObj(obj) {
  5843. return Object.keys(obj || {}).reduce(function (acc, k) {
  5844. return acc || defaultOptions.hasOwnProperty(k);
  5845. }, false);
  5846. }
  5847. var defaultSchemas = {
  5848. 'http:': {
  5849. validate: function (text, pos, self) {
  5850. var tail = text.slice(pos);
  5851. if (!self.re.http) {
  5852. // compile lazily, because "host"-containing variables can change on tlds update.
  5853. self.re.http = new RegExp(
  5854. '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
  5855. );
  5856. }
  5857. if (self.re.http.test(tail)) {
  5858. return tail.match(self.re.http)[0].length;
  5859. }
  5860. return 0;
  5861. }
  5862. },
  5863. 'https:': 'http:',
  5864. 'ftp:': 'http:',
  5865. '//': {
  5866. validate: function (text, pos, self) {
  5867. var tail = text.slice(pos);
  5868. if (!self.re.no_http) {
  5869. // compile lazily, because "host"-containing variables can change on tlds update.
  5870. self.re.no_http = new RegExp(
  5871. '^' +
  5872. self.re.src_auth +
  5873. // Don't allow single-level domains, because of false positives like '//test'
  5874. // with code comments
  5875. '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
  5876. self.re.src_port +
  5877. self.re.src_host_terminator +
  5878. self.re.src_path,
  5879. 'i'
  5880. );
  5881. }
  5882. if (self.re.no_http.test(tail)) {
  5883. // should not be `://` & `///`, that protects from errors in protocol name
  5884. if (pos >= 3 && text[pos - 3] === ':') { return 0; }
  5885. if (pos >= 3 && text[pos - 3] === '/') { return 0; }
  5886. return tail.match(self.re.no_http)[0].length;
  5887. }
  5888. return 0;
  5889. }
  5890. },
  5891. 'mailto:': {
  5892. validate: function (text, pos, self) {
  5893. var tail = text.slice(pos);
  5894. if (!self.re.mailto) {
  5895. self.re.mailto = new RegExp(
  5896. '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
  5897. );
  5898. }
  5899. if (self.re.mailto.test(tail)) {
  5900. return tail.match(self.re.mailto)[0].length;
  5901. }
  5902. return 0;
  5903. }
  5904. }
  5905. };
  5906. /*eslint-disable max-len*/
  5907. // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
  5908. 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]';
  5909. // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
  5910. var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
  5911. /*eslint-enable max-len*/
  5912. ////////////////////////////////////////////////////////////////////////////////
  5913. function resetScanCache(self) {
  5914. self.__index__ = -1;
  5915. self.__text_cache__ = '';
  5916. }
  5917. function createValidator(re) {
  5918. return function (text, pos) {
  5919. var tail = text.slice(pos);
  5920. if (re.test(tail)) {
  5921. return tail.match(re)[0].length;
  5922. }
  5923. return 0;
  5924. };
  5925. }
  5926. function createNormalizer() {
  5927. return function (match, self) {
  5928. self.normalize(match);
  5929. };
  5930. }
  5931. // Schemas compiler. Build regexps.
  5932. //
  5933. function compile(self) {
  5934. // Load & clone RE patterns.
  5935. var re = self.re = __webpack_require__(31)(self.__opts__);
  5936. // Define dynamic patterns
  5937. var tlds = self.__tlds__.slice();
  5938. self.onCompile();
  5939. if (!self.__tlds_replaced__) {
  5940. tlds.push(tlds_2ch_src_re);
  5941. }
  5942. tlds.push(re.src_xn);
  5943. re.src_tlds = tlds.join('|');
  5944. function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
  5945. re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
  5946. re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
  5947. re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
  5948. re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
  5949. //
  5950. // Compile each schema
  5951. //
  5952. var aliases = [];
  5953. self.__compiled__ = {}; // Reset compiled data
  5954. function schemaError(name, val) {
  5955. throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
  5956. }
  5957. Object.keys(self.__schemas__).forEach(function (name) {
  5958. var val = self.__schemas__[name];
  5959. // skip disabled methods
  5960. if (val === null) { return; }
  5961. var compiled = { validate: null, link: null };
  5962. self.__compiled__[name] = compiled;
  5963. if (isObject(val)) {
  5964. if (isRegExp(val.validate)) {
  5965. compiled.validate = createValidator(val.validate);
  5966. } else if (isFunction(val.validate)) {
  5967. compiled.validate = val.validate;
  5968. } else {
  5969. schemaError(name, val);
  5970. }
  5971. if (isFunction(val.normalize)) {
  5972. compiled.normalize = val.normalize;
  5973. } else if (!val.normalize) {
  5974. compiled.normalize = createNormalizer();
  5975. } else {
  5976. schemaError(name, val);
  5977. }
  5978. return;
  5979. }
  5980. if (isString(val)) {
  5981. aliases.push(name);
  5982. return;
  5983. }
  5984. schemaError(name, val);
  5985. });
  5986. //
  5987. // Compile postponed aliases
  5988. //
  5989. aliases.forEach(function (alias) {
  5990. if (!self.__compiled__[self.__schemas__[alias]]) {
  5991. // Silently fail on missed schemas to avoid errons on disable.
  5992. // schemaError(alias, self.__schemas__[alias]);
  5993. return;
  5994. }
  5995. self.__compiled__[alias].validate =
  5996. self.__compiled__[self.__schemas__[alias]].validate;
  5997. self.__compiled__[alias].normalize =
  5998. self.__compiled__[self.__schemas__[alias]].normalize;
  5999. });
  6000. //
  6001. // Fake record for guessed links
  6002. //
  6003. self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
  6004. //
  6005. // Build schema condition
  6006. //
  6007. var slist = Object.keys(self.__compiled__)
  6008. .filter(function (name) {
  6009. // Filter disabled & fake schemas
  6010. return name.length > 0 && self.__compiled__[name];
  6011. })
  6012. .map(escapeRE)
  6013. .join('|');
  6014. // (?!_) cause 1.5x slowdown
  6015. self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
  6016. self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
  6017. self.re.pretest = RegExp(
  6018. '(' + self.re.schema_test.source + ')|' +
  6019. '(' + self.re.host_fuzzy_test.source + ')|' +
  6020. '@',
  6021. 'i');
  6022. //
  6023. // Cleanup
  6024. //
  6025. resetScanCache(self);
  6026. }
  6027. /**
  6028. * class Match
  6029. *
  6030. * Match result. Single element of array, returned by [[LinkifyIt#match]]
  6031. **/
  6032. function Match(self, shift) {
  6033. var start = self.__index__,
  6034. end = self.__last_index__,
  6035. text = self.__text_cache__.slice(start, end);
  6036. /**
  6037. * Match#schema -> String
  6038. *
  6039. * Prefix (protocol) for matched string.
  6040. **/
  6041. this.schema = self.__schema__.toLowerCase();
  6042. /**
  6043. * Match#index -> Number
  6044. *
  6045. * First position of matched string.
  6046. **/
  6047. this.index = start + shift;
  6048. /**
  6049. * Match#lastIndex -> Number
  6050. *
  6051. * Next position after matched string.
  6052. **/
  6053. this.lastIndex = end + shift;
  6054. /**
  6055. * Match#raw -> String
  6056. *
  6057. * Matched string.
  6058. **/
  6059. this.raw = text;
  6060. /**
  6061. * Match#text -> String
  6062. *
  6063. * Notmalized text of matched string.
  6064. **/
  6065. this.text = text;
  6066. /**
  6067. * Match#url -> String
  6068. *
  6069. * Normalized url of matched string.
  6070. **/
  6071. this.url = text;
  6072. }
  6073. function createMatch(self, shift) {
  6074. var match = new Match(self, shift);
  6075. self.__compiled__[match.schema].normalize(match, self);
  6076. return match;
  6077. }
  6078. /**
  6079. * class LinkifyIt
  6080. **/
  6081. /**
  6082. * new LinkifyIt(schemas, options)
  6083. * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
  6084. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  6085. *
  6086. * Creates new linkifier instance with optional additional schemas.
  6087. * Can be called without `new` keyword for convenience.
  6088. *
  6089. * By default understands:
  6090. *
  6091. * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
  6092. * - "fuzzy" links and emails (example.com, foo@bar.com).
  6093. *
  6094. * `schemas` is an object, where each key/value describes protocol/rule:
  6095. *
  6096. * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
  6097. * for example). `linkify-it` makes shure that prefix is not preceeded with
  6098. * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
  6099. * - __value__ - rule to check tail after link prefix
  6100. * - _String_ - just alias to existing rule
  6101. * - _Object_
  6102. * - _validate_ - validator function (should return matched length on success),
  6103. * or `RegExp`.
  6104. * - _normalize_ - optional function to normalize text & url of matched result
  6105. * (for example, for @twitter mentions).
  6106. *
  6107. * `options`:
  6108. *
  6109. * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
  6110. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
  6111. * like version numbers. Default `false`.
  6112. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
  6113. *
  6114. **/
  6115. function LinkifyIt(schemas, options) {
  6116. if (!(this instanceof LinkifyIt)) {
  6117. return new LinkifyIt(schemas, options);
  6118. }
  6119. if (!options) {
  6120. if (isOptionsObj(schemas)) {
  6121. options = schemas;
  6122. schemas = {};
  6123. }
  6124. }
  6125. this.__opts__ = assign({}, defaultOptions, options);
  6126. // Cache last tested result. Used to skip repeating steps on next `match` call.
  6127. this.__index__ = -1;
  6128. this.__last_index__ = -1; // Next scan position
  6129. this.__schema__ = '';
  6130. this.__text_cache__ = '';
  6131. this.__schemas__ = assign({}, defaultSchemas, schemas);
  6132. this.__compiled__ = {};
  6133. this.__tlds__ = tlds_default;
  6134. this.__tlds_replaced__ = false;
  6135. this.re = {};
  6136. compile(this);
  6137. }
  6138. /** chainable
  6139. * LinkifyIt#add(schema, definition)
  6140. * - schema (String): rule name (fixed pattern prefix)
  6141. * - definition (String|RegExp|Object): schema definition
  6142. *
  6143. * Add new rule definition. See constructor description for details.
  6144. **/
  6145. LinkifyIt.prototype.add = function add(schema, definition) {
  6146. this.__schemas__[schema] = definition;
  6147. compile(this);
  6148. return this;
  6149. };
  6150. /** chainable
  6151. * LinkifyIt#set(options)
  6152. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  6153. *
  6154. * Set recognition options for links without schema.
  6155. **/
  6156. LinkifyIt.prototype.set = function set(options) {
  6157. this.__opts__ = assign(this.__opts__, options);
  6158. return this;
  6159. };
  6160. /**
  6161. * LinkifyIt#test(text) -> Boolean
  6162. *
  6163. * Searches linkifiable pattern and returns `true` on success or `false` on fail.
  6164. **/
  6165. LinkifyIt.prototype.test = function test(text) {
  6166. // Reset scan cache
  6167. this.__text_cache__ = text;
  6168. this.__index__ = -1;
  6169. if (!text.length) { return false; }
  6170. var m, ml, me, len, shift, next, re, tld_pos, at_pos;
  6171. // try to scan for link with schema - that's the most simple rule
  6172. if (this.re.schema_test.test(text)) {
  6173. re = this.re.schema_search;
  6174. re.lastIndex = 0;
  6175. while ((m = re.exec(text)) !== null) {
  6176. len = this.testSchemaAt(text, m[2], re.lastIndex);
  6177. if (len) {
  6178. this.__schema__ = m[2];
  6179. this.__index__ = m.index + m[1].length;
  6180. this.__last_index__ = m.index + m[0].length + len;
  6181. break;
  6182. }
  6183. }
  6184. }
  6185. if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
  6186. // guess schemaless links
  6187. tld_pos = text.search(this.re.host_fuzzy_test);
  6188. if (tld_pos >= 0) {
  6189. // if tld is located after found link - no need to check fuzzy pattern
  6190. if (this.__index__ < 0 || tld_pos < this.__index__) {
  6191. if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
  6192. shift = ml.index + ml[1].length;
  6193. if (this.__index__ < 0 || shift < this.__index__) {
  6194. this.__schema__ = '';
  6195. this.__index__ = shift;
  6196. this.__last_index__ = ml.index + ml[0].length;
  6197. }
  6198. }
  6199. }
  6200. }
  6201. }
  6202. if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
  6203. // guess schemaless emails
  6204. at_pos = text.indexOf('@');
  6205. if (at_pos >= 0) {
  6206. // We can't skip this check, because this cases are possible:
  6207. // 192.168.1.1@gmail.com, my.in@example.com
  6208. if ((me = text.match(this.re.email_fuzzy)) !== null) {
  6209. shift = me.index + me[1].length;
  6210. next = me.index + me[0].length;
  6211. if (this.__index__ < 0 || shift < this.__index__ ||
  6212. (shift === this.__index__ && next > this.__last_index__)) {
  6213. this.__schema__ = 'mailto:';
  6214. this.__index__ = shift;
  6215. this.__last_index__ = next;
  6216. }
  6217. }
  6218. }
  6219. }
  6220. return this.__index__ >= 0;
  6221. };
  6222. /**
  6223. * LinkifyIt#pretest(text) -> Boolean
  6224. *
  6225. * Very quick check, that can give false positives. Returns true if link MAY BE
  6226. * can exists. Can be used for speed optimization, when you need to check that
  6227. * link NOT exists.
  6228. **/
  6229. LinkifyIt.prototype.pretest = function pretest(text) {
  6230. return this.re.pretest.test(text);
  6231. };
  6232. /**
  6233. * LinkifyIt#testSchemaAt(text, name, position) -> Number
  6234. * - text (String): text to scan
  6235. * - name (String): rule (schema) name
  6236. * - position (Number): text offset to check from
  6237. *
  6238. * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
  6239. * at given position. Returns length of found pattern (0 on fail).
  6240. **/
  6241. LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
  6242. // If not supported schema check requested - terminate
  6243. if (!this.__compiled__[schema.toLowerCase()]) {
  6244. return 0;
  6245. }
  6246. return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
  6247. };
  6248. /**
  6249. * LinkifyIt#match(text) -> Array|null
  6250. *
  6251. * Returns array of found link descriptions or `null` on fail. We strongly
  6252. * recommend to use [[LinkifyIt#test]] first, for best speed.
  6253. *
  6254. * ##### Result match description
  6255. *
  6256. * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
  6257. * protocol-neutral links.
  6258. * - __index__ - offset of matched text
  6259. * - __lastIndex__ - index of next char after mathch end
  6260. * - __raw__ - matched text
  6261. * - __text__ - normalized text
  6262. * - __url__ - link, generated from matched text
  6263. **/
  6264. LinkifyIt.prototype.match = function match(text) {
  6265. var shift = 0, result = [];
  6266. // Try to take previous element from cache, if .test() called before
  6267. if (this.__index__ >= 0 && this.__text_cache__ === text) {
  6268. result.push(createMatch(this, shift));
  6269. shift = this.__last_index__;
  6270. }
  6271. // Cut head if cache was used
  6272. var tail = shift ? text.slice(shift) : text;
  6273. // Scan string until end reached
  6274. while (this.test(tail)) {
  6275. result.push(createMatch(this, shift));
  6276. tail = tail.slice(this.__last_index__);
  6277. shift += this.__last_index__;
  6278. }
  6279. if (result.length) {
  6280. return result;
  6281. }
  6282. return null;
  6283. };
  6284. /** chainable
  6285. * LinkifyIt#tlds(list [, keepOld]) -> this
  6286. * - list (Array): list of tlds
  6287. * - keepOld (Boolean): merge with current list if `true` (`false` by default)
  6288. *
  6289. * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
  6290. * to avoid false positives. By default this algorythm used:
  6291. *
  6292. * - hostname with any 2-letter root zones are ok.
  6293. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
  6294. * are ok.
  6295. * - encoded (`xn--...`) root zones are ok.
  6296. *
  6297. * If list is replaced, then exact match for 2-chars root zones will be checked.
  6298. **/
  6299. LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
  6300. list = Array.isArray(list) ? list : [ list ];
  6301. if (!keepOld) {
  6302. this.__tlds__ = list.slice();
  6303. this.__tlds_replaced__ = true;
  6304. compile(this);
  6305. return this;
  6306. }
  6307. this.__tlds__ = this.__tlds__.concat(list)
  6308. .sort()
  6309. .filter(function (el, idx, arr) {
  6310. return el !== arr[idx - 1];
  6311. })
  6312. .reverse();
  6313. compile(this);
  6314. return this;
  6315. };
  6316. /**
  6317. * LinkifyIt#normalize(match)
  6318. *
  6319. * Default normalizer (if schema does not define it's own).
  6320. **/
  6321. LinkifyIt.prototype.normalize = function normalize(match) {
  6322. // Do minimal possible changes by default. Need to collect feedback prior
  6323. // to move forward https://github.com/markdown-it/linkify-it/issues/1
  6324. if (!match.schema) { match.url = 'http://' + match.url; }
  6325. if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
  6326. match.url = 'mailto:' + match.url;
  6327. }
  6328. };
  6329. /**
  6330. * LinkifyIt#onCompile()
  6331. *
  6332. * Override to modify basic RegExp-s.
  6333. **/
  6334. LinkifyIt.prototype.onCompile = function onCompile() {
  6335. };
  6336. module.exports = LinkifyIt;
  6337. /***/ }),
  6338. /* 31 */
  6339. /***/ (function(module, exports, __webpack_require__) {
  6340. "use strict";
  6341. module.exports = function (opts) {
  6342. var re = {};
  6343. // Use direct extract instead of `regenerate` to reduse browserified size
  6344. re.src_Any = __webpack_require__(18).source;
  6345. re.src_Cc = __webpack_require__(16).source;
  6346. re.src_Z = __webpack_require__(17).source;
  6347. re.src_P = __webpack_require__(5).source;
  6348. // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
  6349. re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
  6350. // \p{\Z\Cc} (white spaces + control)
  6351. re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
  6352. // Experimental. List of chars, completely prohibited in links
  6353. // because can separate it from other part of text
  6354. var text_separators = '[><\uff5c]';
  6355. // All possible word characters (everything without punctuation, spaces & controls)
  6356. // Defined via punctuation & spaces to save space
  6357. // Should be something like \p{\L\N\S\M} (\w but without `_`)
  6358. re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
  6359. // The same as abothe but without [0-9]
  6360. // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
  6361. ////////////////////////////////////////////////////////////////////////////////
  6362. re.src_ip4 =
  6363. '(?:(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]?)';
  6364. // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
  6365. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
  6366. re.src_port =
  6367. '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
  6368. re.src_host_terminator =
  6369. '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
  6370. re.src_path =
  6371. '(?:' +
  6372. '[/?#]' +
  6373. '(?:' +
  6374. '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
  6375. '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
  6376. '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
  6377. '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
  6378. '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
  6379. "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
  6380. "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
  6381. '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
  6382. // - english
  6383. // - percent-encoded
  6384. // - parts of file path
  6385. // until more examples found.
  6386. '\\.(?!' + re.src_ZCc + '|[.]).|' +
  6387. (opts && opts['---'] ?
  6388. '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
  6389. :
  6390. '\\-+|'
  6391. ) +
  6392. '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
  6393. '\\!(?!' + re.src_ZCc + '|[!]).|' +
  6394. '\\?(?!' + re.src_ZCc + '|[?]).' +
  6395. ')+' +
  6396. '|\\/' +
  6397. ')?';
  6398. re.src_email_name =
  6399. '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
  6400. re.src_xn =
  6401. 'xn--[a-z0-9\\-]{1,59}';
  6402. // More to read about domain names
  6403. // http://serverfault.com/questions/638260/
  6404. re.src_domain_root =
  6405. // Allow letters & digits (http://test1)
  6406. '(?:' +
  6407. re.src_xn +
  6408. '|' +
  6409. re.src_pseudo_letter + '{1,63}' +
  6410. ')';
  6411. re.src_domain =
  6412. '(?:' +
  6413. re.src_xn +
  6414. '|' +
  6415. '(?:' + re.src_pseudo_letter + ')' +
  6416. '|' +
  6417. // don't allow `--` in domain names, because:
  6418. // - that can conflict with markdown &mdash; / &ndash;
  6419. // - nobody use those anyway
  6420. '(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
  6421. ')';
  6422. re.src_host =
  6423. '(?:' +
  6424. // Don't need IP check, because digits are already allowed in normal domain names
  6425. // src_ip4 +
  6426. // '|' +
  6427. '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
  6428. ')';
  6429. re.tpl_host_fuzzy =
  6430. '(?:' +
  6431. re.src_ip4 +
  6432. '|' +
  6433. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
  6434. ')';
  6435. re.tpl_host_no_ip_fuzzy =
  6436. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
  6437. re.src_host_strict =
  6438. re.src_host + re.src_host_terminator;
  6439. re.tpl_host_fuzzy_strict =
  6440. re.tpl_host_fuzzy + re.src_host_terminator;
  6441. re.src_host_port_strict =
  6442. re.src_host + re.src_port + re.src_host_terminator;
  6443. re.tpl_host_port_fuzzy_strict =
  6444. re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  6445. re.tpl_host_port_no_ip_fuzzy_strict =
  6446. re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  6447. ////////////////////////////////////////////////////////////////////////////////
  6448. // Main rules
  6449. // Rude test fuzzy links by host, for quick deny
  6450. re.tpl_host_fuzzy_test =
  6451. 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
  6452. re.tpl_email_fuzzy =
  6453. '(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
  6454. re.tpl_link_fuzzy =
  6455. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6456. // but can start with > (markdown blockquote)
  6457. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6458. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
  6459. re.tpl_link_no_ip_fuzzy =
  6460. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6461. // but can start with > (markdown blockquote)
  6462. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6463. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
  6464. return re;
  6465. };
  6466. /***/ }),
  6467. /* 32 */
  6468. /***/ (function(module, exports, __webpack_require__) {
  6469. "use strict";
  6470. // List of valid html blocks names, accorting to commonmark spec
  6471. // http://jgm.github.io/CommonMark/spec.html#html-blocks
  6472. module.exports = [
  6473. 'address',
  6474. 'article',
  6475. 'aside',
  6476. 'base',
  6477. 'basefont',
  6478. 'blockquote',
  6479. 'body',
  6480. 'caption',
  6481. 'center',
  6482. 'col',
  6483. 'colgroup',
  6484. 'dd',
  6485. 'details',
  6486. 'dialog',
  6487. 'dir',
  6488. 'div',
  6489. 'dl',
  6490. 'dt',
  6491. 'fieldset',
  6492. 'figcaption',
  6493. 'figure',
  6494. 'footer',
  6495. 'form',
  6496. 'frame',
  6497. 'frameset',
  6498. 'h1',
  6499. 'h2',
  6500. 'h3',
  6501. 'h4',
  6502. 'h5',
  6503. 'h6',
  6504. 'head',
  6505. 'header',
  6506. 'hr',
  6507. 'html',
  6508. 'iframe',
  6509. 'legend',
  6510. 'li',
  6511. 'link',
  6512. 'main',
  6513. 'menu',
  6514. 'menuitem',
  6515. 'meta',
  6516. 'nav',
  6517. 'noframes',
  6518. 'ol',
  6519. 'optgroup',
  6520. 'option',
  6521. 'p',
  6522. 'param',
  6523. 'pre',
  6524. 'section',
  6525. 'source',
  6526. 'title',
  6527. 'summary',
  6528. 'table',
  6529. 'tbody',
  6530. 'td',
  6531. 'tfoot',
  6532. 'th',
  6533. 'thead',
  6534. 'title',
  6535. 'tr',
  6536. 'track',
  6537. 'ul'
  6538. ];
  6539. /***/ }),
  6540. /* 33 */
  6541. /***/ (function(module, exports, __webpack_require__) {
  6542. "use strict";
  6543. // Just a shortcut for bulk export
  6544. exports.parseLinkLabel = __webpack_require__(35);
  6545. exports.parseLinkDestination = __webpack_require__(34);
  6546. exports.parseLinkTitle = __webpack_require__(36);
  6547. /***/ }),
  6548. /* 34 */
  6549. /***/ (function(module, exports, __webpack_require__) {
  6550. "use strict";
  6551. // Parse link destination
  6552. //
  6553. var isSpace = __webpack_require__(0).isSpace;
  6554. var unescapeAll = __webpack_require__(0).unescapeAll;
  6555. module.exports = function parseLinkDestination(str, pos, max) {
  6556. var code, level,
  6557. lines = 0,
  6558. start = pos,
  6559. result = {
  6560. ok: false,
  6561. pos: 0,
  6562. lines: 0,
  6563. str: ''
  6564. };
  6565. if (str.charCodeAt(pos) === 0x3C /* < */) {
  6566. pos++;
  6567. while (pos < max) {
  6568. code = str.charCodeAt(pos);
  6569. if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
  6570. if (code === 0x3E /* > */) {
  6571. result.pos = pos + 1;
  6572. result.str = unescapeAll(str.slice(start + 1, pos));
  6573. result.ok = true;
  6574. return result;
  6575. }
  6576. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6577. pos += 2;
  6578. continue;
  6579. }
  6580. pos++;
  6581. }
  6582. // no closing '>'
  6583. return result;
  6584. }
  6585. // this should be ... } else { ... branch
  6586. level = 0;
  6587. while (pos < max) {
  6588. code = str.charCodeAt(pos);
  6589. if (code === 0x20) { break; }
  6590. // ascii control characters
  6591. if (code < 0x20 || code === 0x7F) { break; }
  6592. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6593. pos += 2;
  6594. continue;
  6595. }
  6596. if (code === 0x28 /* ( */) {
  6597. level++;
  6598. if (level > 1) { break; }
  6599. }
  6600. if (code === 0x29 /* ) */) {
  6601. level--;
  6602. if (level < 0) { break; }
  6603. }
  6604. pos++;
  6605. }
  6606. if (start === pos) { return result; }
  6607. result.str = unescapeAll(str.slice(start, pos));
  6608. result.lines = lines;
  6609. result.pos = pos;
  6610. result.ok = true;
  6611. return result;
  6612. };
  6613. /***/ }),
  6614. /* 35 */
  6615. /***/ (function(module, exports, __webpack_require__) {
  6616. "use strict";
  6617. // Parse link label
  6618. //
  6619. // this function assumes that first character ("[") already matches;
  6620. // returns the end of the label
  6621. //
  6622. module.exports = function parseLinkLabel(state, start, disableNested) {
  6623. var level, found, marker, prevPos,
  6624. labelEnd = -1,
  6625. max = state.posMax,
  6626. oldPos = state.pos;
  6627. state.pos = start + 1;
  6628. level = 1;
  6629. while (state.pos < max) {
  6630. marker = state.src.charCodeAt(state.pos);
  6631. if (marker === 0x5D /* ] */) {
  6632. level--;
  6633. if (level === 0) {
  6634. found = true;
  6635. break;
  6636. }
  6637. }
  6638. prevPos = state.pos;
  6639. state.md.inline.skipToken(state);
  6640. if (marker === 0x5B /* [ */) {
  6641. if (prevPos === state.pos - 1) {
  6642. // increase level if we find text `[`, which is not a part of any token
  6643. level++;
  6644. } else if (disableNested) {
  6645. state.pos = oldPos;
  6646. return -1;
  6647. }
  6648. }
  6649. }
  6650. if (found) {
  6651. labelEnd = state.pos;
  6652. }
  6653. // restore old state
  6654. state.pos = oldPos;
  6655. return labelEnd;
  6656. };
  6657. /***/ }),
  6658. /* 36 */
  6659. /***/ (function(module, exports, __webpack_require__) {
  6660. "use strict";
  6661. // Parse link title
  6662. //
  6663. var unescapeAll = __webpack_require__(0).unescapeAll;
  6664. module.exports = function parseLinkTitle(str, pos, max) {
  6665. var code,
  6666. marker,
  6667. lines = 0,
  6668. start = pos,
  6669. result = {
  6670. ok: false,
  6671. pos: 0,
  6672. lines: 0,
  6673. str: ''
  6674. };
  6675. if (pos >= max) { return result; }
  6676. marker = str.charCodeAt(pos);
  6677. if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
  6678. pos++;
  6679. // if opening marker is "(", switch it to closing marker ")"
  6680. if (marker === 0x28) { marker = 0x29; }
  6681. while (pos < max) {
  6682. code = str.charCodeAt(pos);
  6683. if (code === marker) {
  6684. result.pos = pos + 1;
  6685. result.lines = lines;
  6686. result.str = unescapeAll(str.slice(start + 1, pos));
  6687. result.ok = true;
  6688. return result;
  6689. } else if (code === 0x0A) {
  6690. lines++;
  6691. } else if (code === 0x5C /* \ */ && pos + 1 < max) {
  6692. pos++;
  6693. if (str.charCodeAt(pos) === 0x0A) {
  6694. lines++;
  6695. }
  6696. }
  6697. pos++;
  6698. }
  6699. return result;
  6700. };
  6701. /***/ }),
  6702. /* 37 */
  6703. /***/ (function(module, exports, __webpack_require__) {
  6704. "use strict";
  6705. // Main parser class
  6706. var utils = __webpack_require__(0);
  6707. var helpers = __webpack_require__(33);
  6708. var Renderer = __webpack_require__(44);
  6709. var ParserCore = __webpack_require__(39);
  6710. var ParserBlock = __webpack_require__(38);
  6711. var ParserInline = __webpack_require__(40);
  6712. var LinkifyIt = __webpack_require__(30);
  6713. var mdurl = __webpack_require__(15);
  6714. var punycode = __webpack_require__(81);
  6715. var config = {
  6716. 'default': __webpack_require__(42),
  6717. zero: __webpack_require__(43),
  6718. commonmark: __webpack_require__(41)
  6719. };
  6720. ////////////////////////////////////////////////////////////////////////////////
  6721. //
  6722. // This validator can prohibit more than really needed to prevent XSS. It's a
  6723. // tradeoff to keep code simple and to be secure by default.
  6724. //
  6725. // If you need different setup - override validator method as you wish. Or
  6726. // replace it with dummy function and use external sanitizer.
  6727. //
  6728. var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
  6729. var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
  6730. function validateLink(url) {
  6731. // url should be normalized at this point, and existing entities are decoded
  6732. var str = url.trim().toLowerCase();
  6733. return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
  6734. }
  6735. ////////////////////////////////////////////////////////////////////////////////
  6736. var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
  6737. function normalizeLink(url) {
  6738. var parsed = mdurl.parse(url, true);
  6739. if (parsed.hostname) {
  6740. // Encode hostnames in urls like:
  6741. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6742. //
  6743. // We don't encode unknown schemas, because it's likely that we encode
  6744. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6745. //
  6746. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6747. try {
  6748. parsed.hostname = punycode.toASCII(parsed.hostname);
  6749. } catch (er) { /**/ }
  6750. }
  6751. }
  6752. return mdurl.encode(mdurl.format(parsed));
  6753. }
  6754. function normalizeLinkText(url) {
  6755. var parsed = mdurl.parse(url, true);
  6756. if (parsed.hostname) {
  6757. // Encode hostnames in urls like:
  6758. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6759. //
  6760. // We don't encode unknown schemas, because it's likely that we encode
  6761. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6762. //
  6763. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6764. try {
  6765. parsed.hostname = punycode.toUnicode(parsed.hostname);
  6766. } catch (er) { /**/ }
  6767. }
  6768. }
  6769. return mdurl.decode(mdurl.format(parsed));
  6770. }
  6771. /**
  6772. * class MarkdownIt
  6773. *
  6774. * Main parser/renderer class.
  6775. *
  6776. * ##### Usage
  6777. *
  6778. * ```javascript
  6779. * // node.js, "classic" way:
  6780. * var MarkdownIt = require('markdown-it'),
  6781. * md = new MarkdownIt();
  6782. * var result = md.render('# markdown-it rulezz!');
  6783. *
  6784. * // node.js, the same, but with sugar:
  6785. * var md = require('markdown-it')();
  6786. * var result = md.render('# markdown-it rulezz!');
  6787. *
  6788. * // browser without AMD, added to "window" on script load
  6789. * // Note, there are no dash.
  6790. * var md = window.markdownit();
  6791. * var result = md.render('# markdown-it rulezz!');
  6792. * ```
  6793. *
  6794. * Single line rendering, without paragraph wrap:
  6795. *
  6796. * ```javascript
  6797. * var md = require('markdown-it')();
  6798. * var result = md.renderInline('__markdown-it__ rulezz!');
  6799. * ```
  6800. **/
  6801. /**
  6802. * new MarkdownIt([presetName, options])
  6803. * - presetName (String): optional, `commonmark` / `zero`
  6804. * - options (Object)
  6805. *
  6806. * Creates parser instanse with given config. Can be called without `new`.
  6807. *
  6808. * ##### presetName
  6809. *
  6810. * MarkdownIt provides named presets as a convenience to quickly
  6811. * enable/disable active syntax rules and options for common use cases.
  6812. *
  6813. * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
  6814. * configures parser to strict [CommonMark](http://commonmark.org/) mode.
  6815. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
  6816. * similar to GFM, used when no preset name given. Enables all available rules,
  6817. * but still without html, typographer & autolinker.
  6818. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
  6819. * all rules disabled. Useful to quickly setup your config via `.enable()`.
  6820. * For example, when you need only `bold` and `italic` markup and nothing else.
  6821. *
  6822. * ##### options:
  6823. *
  6824. * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
  6825. * That's not safe! You may need external sanitizer to protect output from XSS.
  6826. * It's better to extend features via plugins, instead of enabling HTML.
  6827. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
  6828. * (`<br />`). This is needed only for full CommonMark compatibility. In real
  6829. * world you will need HTML output.
  6830. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
  6831. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
  6832. * Can be useful for external highlighters.
  6833. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
  6834. * - __typographer__ - `false`. Set `true` to enable [some language-neutral
  6835. * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
  6836. * quotes beautification (smartquotes).
  6837. * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
  6838. * pairs, when typographer enabled and smartquotes on. For example, you can
  6839. * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
  6840. * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
  6841. * - __highlight__ - `null`. Highlighter function for fenced code blocks.
  6842. * Highlighter `function (str, lang)` should return escaped HTML. It can also
  6843. * return empty string if the source was not changed and should be escaped
  6844. * externaly. If result starts with <pre... internal wrapper is skipped.
  6845. *
  6846. * ##### Example
  6847. *
  6848. * ```javascript
  6849. * // commonmark mode
  6850. * var md = require('markdown-it')('commonmark');
  6851. *
  6852. * // default mode
  6853. * var md = require('markdown-it')();
  6854. *
  6855. * // enable everything
  6856. * var md = require('markdown-it')({
  6857. * html: true,
  6858. * linkify: true,
  6859. * typographer: true
  6860. * });
  6861. * ```
  6862. *
  6863. * ##### Syntax highlighting
  6864. *
  6865. * ```js
  6866. * var hljs = require('highlight.js') // https://highlightjs.org/
  6867. *
  6868. * var md = require('markdown-it')({
  6869. * highlight: function (str, lang) {
  6870. * if (lang && hljs.getLanguage(lang)) {
  6871. * try {
  6872. * return hljs.highlight(lang, str, true).value;
  6873. * } catch (__) {}
  6874. * }
  6875. *
  6876. * return ''; // use external default escaping
  6877. * }
  6878. * });
  6879. * ```
  6880. *
  6881. * Or with full wrapper override (if you need assign class to `<pre>`):
  6882. *
  6883. * ```javascript
  6884. * var hljs = require('highlight.js') // https://highlightjs.org/
  6885. *
  6886. * // Actual default values
  6887. * var md = require('markdown-it')({
  6888. * highlight: function (str, lang) {
  6889. * if (lang && hljs.getLanguage(lang)) {
  6890. * try {
  6891. * return '<pre class="hljs"><code>' +
  6892. * hljs.highlight(lang, str, true).value +
  6893. * '</code></pre>';
  6894. * } catch (__) {}
  6895. * }
  6896. *
  6897. * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
  6898. * }
  6899. * });
  6900. * ```
  6901. *
  6902. **/
  6903. function MarkdownIt(presetName, options) {
  6904. if (!(this instanceof MarkdownIt)) {
  6905. return new MarkdownIt(presetName, options);
  6906. }
  6907. if (!options) {
  6908. if (!utils.isString(presetName)) {
  6909. options = presetName || {};
  6910. presetName = 'default';
  6911. }
  6912. }
  6913. /**
  6914. * MarkdownIt#inline -> ParserInline
  6915. *
  6916. * Instance of [[ParserInline]]. You may need it to add new rules when
  6917. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6918. * [[MarkdownIt.enable]].
  6919. **/
  6920. this.inline = new ParserInline();
  6921. /**
  6922. * MarkdownIt#block -> ParserBlock
  6923. *
  6924. * Instance of [[ParserBlock]]. You may need it to add new rules when
  6925. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6926. * [[MarkdownIt.enable]].
  6927. **/
  6928. this.block = new ParserBlock();
  6929. /**
  6930. * MarkdownIt#core -> Core
  6931. *
  6932. * Instance of [[Core]] chain executor. You may need it to add new rules when
  6933. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6934. * [[MarkdownIt.enable]].
  6935. **/
  6936. this.core = new ParserCore();
  6937. /**
  6938. * MarkdownIt#renderer -> Renderer
  6939. *
  6940. * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
  6941. * rules for new token types, generated by plugins.
  6942. *
  6943. * ##### Example
  6944. *
  6945. * ```javascript
  6946. * var md = require('markdown-it')();
  6947. *
  6948. * function myToken(tokens, idx, options, env, self) {
  6949. * //...
  6950. * return result;
  6951. * };
  6952. *
  6953. * md.renderer.rules['my_token'] = myToken
  6954. * ```
  6955. *
  6956. * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
  6957. **/
  6958. this.renderer = new Renderer();
  6959. /**
  6960. * MarkdownIt#linkify -> LinkifyIt
  6961. *
  6962. * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
  6963. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
  6964. * rule.
  6965. **/
  6966. this.linkify = new LinkifyIt();
  6967. /**
  6968. * MarkdownIt#validateLink(url) -> Boolean
  6969. *
  6970. * Link validation function. CommonMark allows too much in links. By default
  6971. * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
  6972. * except some embedded image types.
  6973. *
  6974. * You can change this behaviour:
  6975. *
  6976. * ```javascript
  6977. * var md = require('markdown-it')();
  6978. * // enable everything
  6979. * md.validateLink = function () { return true; }
  6980. * ```
  6981. **/
  6982. this.validateLink = validateLink;
  6983. /**
  6984. * MarkdownIt#normalizeLink(url) -> String
  6985. *
  6986. * Function used to encode link url to a machine-readable format,
  6987. * which includes url-encoding, punycode, etc.
  6988. **/
  6989. this.normalizeLink = normalizeLink;
  6990. /**
  6991. * MarkdownIt#normalizeLinkText(url) -> String
  6992. *
  6993. * Function used to decode link url to a human-readable format`
  6994. **/
  6995. this.normalizeLinkText = normalizeLinkText;
  6996. // Expose utils & helpers for easy acces from plugins
  6997. /**
  6998. * MarkdownIt#utils -> utils
  6999. *
  7000. * Assorted utility functions, useful to write plugins. See details
  7001. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
  7002. **/
  7003. this.utils = utils;
  7004. /**
  7005. * MarkdownIt#helpers -> helpers
  7006. *
  7007. * Link components parser functions, useful to write plugins. See details
  7008. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
  7009. **/
  7010. this.helpers = utils.assign({}, helpers);
  7011. this.options = {};
  7012. this.configure(presetName);
  7013. if (options) { this.set(options); }
  7014. }
  7015. /** chainable
  7016. * MarkdownIt.set(options)
  7017. *
  7018. * Set parser options (in the same format as in constructor). Probably, you
  7019. * will never need it, but you can change options after constructor call.
  7020. *
  7021. * ##### Example
  7022. *
  7023. * ```javascript
  7024. * var md = require('markdown-it')()
  7025. * .set({ html: true, breaks: true })
  7026. * .set({ typographer, true });
  7027. * ```
  7028. *
  7029. * __Note:__ To achieve the best possible performance, don't modify a
  7030. * `markdown-it` instance options on the fly. If you need multiple configurations
  7031. * it's best to create multiple instances and initialize each with separate
  7032. * config.
  7033. **/
  7034. MarkdownIt.prototype.set = function (options) {
  7035. utils.assign(this.options, options);
  7036. return this;
  7037. };
  7038. /** chainable, internal
  7039. * MarkdownIt.configure(presets)
  7040. *
  7041. * Batch load of all options and compenent settings. This is internal method,
  7042. * and you probably will not need it. But if you with - see available presets
  7043. * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
  7044. *
  7045. * We strongly recommend to use presets instead of direct config loads. That
  7046. * will give better compatibility with next versions.
  7047. **/
  7048. MarkdownIt.prototype.configure = function (presets) {
  7049. var self = this, presetName;
  7050. if (utils.isString(presets)) {
  7051. presetName = presets;
  7052. presets = config[presetName];
  7053. if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
  7054. }
  7055. if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
  7056. if (presets.options) { self.set(presets.options); }
  7057. if (presets.components) {
  7058. Object.keys(presets.components).forEach(function (name) {
  7059. if (presets.components[name].rules) {
  7060. self[name].ruler.enableOnly(presets.components[name].rules);
  7061. }
  7062. if (presets.components[name].rules2) {
  7063. self[name].ruler2.enableOnly(presets.components[name].rules2);
  7064. }
  7065. });
  7066. }
  7067. return this;
  7068. };
  7069. /** chainable
  7070. * MarkdownIt.enable(list, ignoreInvalid)
  7071. * - list (String|Array): rule name or list of rule names to enable
  7072. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  7073. *
  7074. * Enable list or rules. It will automatically find appropriate components,
  7075. * containing rules with given names. If rule not found, and `ignoreInvalid`
  7076. * not set - throws exception.
  7077. *
  7078. * ##### Example
  7079. *
  7080. * ```javascript
  7081. * var md = require('markdown-it')()
  7082. * .enable(['sub', 'sup'])
  7083. * .disable('smartquotes');
  7084. * ```
  7085. **/
  7086. MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
  7087. var result = [];
  7088. if (!Array.isArray(list)) { list = [ list ]; }
  7089. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  7090. result = result.concat(this[chain].ruler.enable(list, true));
  7091. }, this);
  7092. result = result.concat(this.inline.ruler2.enable(list, true));
  7093. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  7094. if (missed.length && !ignoreInvalid) {
  7095. throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
  7096. }
  7097. return this;
  7098. };
  7099. /** chainable
  7100. * MarkdownIt.disable(list, ignoreInvalid)
  7101. * - list (String|Array): rule name or list of rule names to disable.
  7102. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  7103. *
  7104. * The same as [[MarkdownIt.enable]], but turn specified rules off.
  7105. **/
  7106. MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
  7107. var result = [];
  7108. if (!Array.isArray(list)) { list = [ list ]; }
  7109. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  7110. result = result.concat(this[chain].ruler.disable(list, true));
  7111. }, this);
  7112. result = result.concat(this.inline.ruler2.disable(list, true));
  7113. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  7114. if (missed.length && !ignoreInvalid) {
  7115. throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
  7116. }
  7117. return this;
  7118. };
  7119. /** chainable
  7120. * MarkdownIt.use(plugin, params)
  7121. *
  7122. * Load specified plugin with given params into current parser instance.
  7123. * It's just a sugar to call `plugin(md, params)` with curring.
  7124. *
  7125. * ##### Example
  7126. *
  7127. * ```javascript
  7128. * var iterator = require('markdown-it-for-inline');
  7129. * var md = require('markdown-it')()
  7130. * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
  7131. * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
  7132. * });
  7133. * ```
  7134. **/
  7135. MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
  7136. var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
  7137. plugin.apply(plugin, args);
  7138. return this;
  7139. };
  7140. /** internal
  7141. * MarkdownIt.parse(src, env) -> Array
  7142. * - src (String): source string
  7143. * - env (Object): environment sandbox
  7144. *
  7145. * Parse input string and returns list of block tokens (special token type
  7146. * "inline" will contain list of inline tokens). You should not call this
  7147. * method directly, until you write custom renderer (for example, to produce
  7148. * AST).
  7149. *
  7150. * `env` is used to pass data between "distributed" rules and return additional
  7151. * metadata like reference info, needed for the renderer. It also can be used to
  7152. * inject data in specific cases. Usually, you will be ok to pass `{}`,
  7153. * and then pass updated object to renderer.
  7154. **/
  7155. MarkdownIt.prototype.parse = function (src, env) {
  7156. if (typeof src !== 'string') {
  7157. throw new Error('Input data should be a String');
  7158. }
  7159. var state = new this.core.State(src, this, env);
  7160. this.core.process(state);
  7161. return state.tokens;
  7162. };
  7163. /**
  7164. * MarkdownIt.render(src [, env]) -> String
  7165. * - src (String): source string
  7166. * - env (Object): environment sandbox
  7167. *
  7168. * Render markdown string into html. It does all magic for you :).
  7169. *
  7170. * `env` can be used to inject additional metadata (`{}` by default).
  7171. * But you will not need it with high probability. See also comment
  7172. * in [[MarkdownIt.parse]].
  7173. **/
  7174. MarkdownIt.prototype.render = function (src, env) {
  7175. env = env || {};
  7176. return this.renderer.render(this.parse(src, env), this.options, env);
  7177. };
  7178. /** internal
  7179. * MarkdownIt.parseInline(src, env) -> Array
  7180. * - src (String): source string
  7181. * - env (Object): environment sandbox
  7182. *
  7183. * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
  7184. * block tokens list with the single `inline` element, containing parsed inline
  7185. * tokens in `children` property. Also updates `env` object.
  7186. **/
  7187. MarkdownIt.prototype.parseInline = function (src, env) {
  7188. var state = new this.core.State(src, this, env);
  7189. state.inlineMode = true;
  7190. this.core.process(state);
  7191. return state.tokens;
  7192. };
  7193. /**
  7194. * MarkdownIt.renderInline(src [, env]) -> String
  7195. * - src (String): source string
  7196. * - env (Object): environment sandbox
  7197. *
  7198. * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
  7199. * will NOT be wrapped into `<p>` tags.
  7200. **/
  7201. MarkdownIt.prototype.renderInline = function (src, env) {
  7202. env = env || {};
  7203. return this.renderer.render(this.parseInline(src, env), this.options, env);
  7204. };
  7205. module.exports = MarkdownIt;
  7206. /***/ }),
  7207. /* 38 */
  7208. /***/ (function(module, exports, __webpack_require__) {
  7209. "use strict";
  7210. /** internal
  7211. * class ParserBlock
  7212. *
  7213. * Block-level tokenizer.
  7214. **/
  7215. var Ruler = __webpack_require__(3);
  7216. var _rules = [
  7217. // First 2 params - rule name & source. Secondary array - list of rules,
  7218. // which can be terminated by this one.
  7219. [ 'table', __webpack_require__(56), [ 'paragraph', 'reference' ] ],
  7220. [ 'code', __webpack_require__(46) ],
  7221. [ 'fence', __webpack_require__(47), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  7222. [ 'blockquote', __webpack_require__(45), [ 'paragraph', 'reference', 'list' ] ],
  7223. [ 'hr', __webpack_require__(49), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  7224. [ 'list', __webpack_require__(52), [ 'paragraph', 'reference', 'blockquote' ] ],
  7225. [ 'reference', __webpack_require__(54) ],
  7226. [ 'heading', __webpack_require__(48), [ 'paragraph', 'reference', 'blockquote' ] ],
  7227. [ 'lheading', __webpack_require__(51) ],
  7228. [ 'html_block', __webpack_require__(50), [ 'paragraph', 'reference', 'blockquote' ] ],
  7229. [ 'paragraph', __webpack_require__(53) ]
  7230. ];
  7231. /**
  7232. * new ParserBlock()
  7233. **/
  7234. function ParserBlock() {
  7235. /**
  7236. * ParserBlock#ruler -> Ruler
  7237. *
  7238. * [[Ruler]] instance. Keep configuration of block rules.
  7239. **/
  7240. this.ruler = new Ruler();
  7241. for (var i = 0; i < _rules.length; i++) {
  7242. this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
  7243. }
  7244. }
  7245. // Generate tokens for input range
  7246. //
  7247. ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
  7248. var ok, i,
  7249. rules = this.ruler.getRules(''),
  7250. len = rules.length,
  7251. line = startLine,
  7252. hasEmptyLines = false,
  7253. maxNesting = state.md.options.maxNesting;
  7254. while (line < endLine) {
  7255. state.line = line = state.skipEmptyLines(line);
  7256. if (line >= endLine) { break; }
  7257. // Termination condition for nested calls.
  7258. // Nested calls currently used for blockquotes & lists
  7259. if (state.sCount[line] < state.blkIndent) { break; }
  7260. // If nesting level exceeded - skip tail to the end. That's not ordinary
  7261. // situation and we should not care about content.
  7262. if (state.level >= maxNesting) {
  7263. state.line = endLine;
  7264. break;
  7265. }
  7266. // Try all possible rules.
  7267. // On success, rule should:
  7268. //
  7269. // - update `state.line`
  7270. // - update `state.tokens`
  7271. // - return true
  7272. for (i = 0; i < len; i++) {
  7273. ok = rules[i](state, line, endLine, false);
  7274. if (ok) { break; }
  7275. }
  7276. // set state.tight iff we had an empty line before current tag
  7277. // i.e. latest empty line should not count
  7278. state.tight = !hasEmptyLines;
  7279. // paragraph might "eat" one newline after it in nested lists
  7280. if (state.isEmpty(state.line - 1)) {
  7281. hasEmptyLines = true;
  7282. }
  7283. line = state.line;
  7284. if (line < endLine && state.isEmpty(line)) {
  7285. hasEmptyLines = true;
  7286. line++;
  7287. state.line = line;
  7288. }
  7289. }
  7290. };
  7291. /**
  7292. * ParserBlock.parse(str, md, env, outTokens)
  7293. *
  7294. * Process input string and push block tokens into `outTokens`
  7295. **/
  7296. ParserBlock.prototype.parse = function (src, md, env, outTokens) {
  7297. var state;
  7298. if (!src) { return; }
  7299. state = new this.State(src, md, env, outTokens);
  7300. this.tokenize(state, state.line, state.lineMax);
  7301. };
  7302. ParserBlock.prototype.State = __webpack_require__(55);
  7303. module.exports = ParserBlock;
  7304. /***/ }),
  7305. /* 39 */
  7306. /***/ (function(module, exports, __webpack_require__) {
  7307. "use strict";
  7308. /** internal
  7309. * class Core
  7310. *
  7311. * Top-level rules executor. Glues block/inline parsers and does intermediate
  7312. * transformations.
  7313. **/
  7314. var Ruler = __webpack_require__(3);
  7315. var _rules = [
  7316. [ 'normalize', __webpack_require__(60) ],
  7317. [ 'block', __webpack_require__(57) ],
  7318. [ 'inline', __webpack_require__(58) ],
  7319. [ 'linkify', __webpack_require__(59) ],
  7320. [ 'replacements', __webpack_require__(61) ],
  7321. [ 'smartquotes', __webpack_require__(62) ]
  7322. ];
  7323. /**
  7324. * new Core()
  7325. **/
  7326. function Core() {
  7327. /**
  7328. * Core#ruler -> Ruler
  7329. *
  7330. * [[Ruler]] instance. Keep configuration of core rules.
  7331. **/
  7332. this.ruler = new Ruler();
  7333. for (var i = 0; i < _rules.length; i++) {
  7334. this.ruler.push(_rules[i][0], _rules[i][1]);
  7335. }
  7336. }
  7337. /**
  7338. * Core.process(state)
  7339. *
  7340. * Executes core chain rules.
  7341. **/
  7342. Core.prototype.process = function (state) {
  7343. var i, l, rules;
  7344. rules = this.ruler.getRules('');
  7345. for (i = 0, l = rules.length; i < l; i++) {
  7346. rules[i](state);
  7347. }
  7348. };
  7349. Core.prototype.State = __webpack_require__(63);
  7350. module.exports = Core;
  7351. /***/ }),
  7352. /* 40 */
  7353. /***/ (function(module, exports, __webpack_require__) {
  7354. "use strict";
  7355. /** internal
  7356. * class ParserInline
  7357. *
  7358. * Tokenizes paragraph content.
  7359. **/
  7360. var Ruler = __webpack_require__(3);
  7361. ////////////////////////////////////////////////////////////////////////////////
  7362. // Parser rules
  7363. var _rules = [
  7364. [ 'text', __webpack_require__(74) ],
  7365. [ 'newline', __webpack_require__(72) ],
  7366. [ 'escape', __webpack_require__(68) ],
  7367. [ 'backticks', __webpack_require__(65) ],
  7368. [ 'strikethrough', __webpack_require__(14).tokenize ],
  7369. [ 'emphasis', __webpack_require__(13).tokenize ],
  7370. [ 'link', __webpack_require__(71) ],
  7371. [ 'image', __webpack_require__(70) ],
  7372. [ 'autolink', __webpack_require__(64) ],
  7373. [ 'html_inline', __webpack_require__(69) ],
  7374. [ 'entity', __webpack_require__(67) ]
  7375. ];
  7376. var _rules2 = [
  7377. [ 'balance_pairs', __webpack_require__(66) ],
  7378. [ 'strikethrough', __webpack_require__(14).postProcess ],
  7379. [ 'emphasis', __webpack_require__(13).postProcess ],
  7380. [ 'text_collapse', __webpack_require__(75) ]
  7381. ];
  7382. /**
  7383. * new ParserInline()
  7384. **/
  7385. function ParserInline() {
  7386. var i;
  7387. /**
  7388. * ParserInline#ruler -> Ruler
  7389. *
  7390. * [[Ruler]] instance. Keep configuration of inline rules.
  7391. **/
  7392. this.ruler = new Ruler();
  7393. for (i = 0; i < _rules.length; i++) {
  7394. this.ruler.push(_rules[i][0], _rules[i][1]);
  7395. }
  7396. /**
  7397. * ParserInline#ruler2 -> Ruler
  7398. *
  7399. * [[Ruler]] instance. Second ruler used for post-processing
  7400. * (e.g. in emphasis-like rules).
  7401. **/
  7402. this.ruler2 = new Ruler();
  7403. for (i = 0; i < _rules2.length; i++) {
  7404. this.ruler2.push(_rules2[i][0], _rules2[i][1]);
  7405. }
  7406. }
  7407. // Skip single token by running all rules in validation mode;
  7408. // returns `true` if any rule reported success
  7409. //
  7410. ParserInline.prototype.skipToken = function (state) {
  7411. var ok, i, pos = state.pos,
  7412. rules = this.ruler.getRules(''),
  7413. len = rules.length,
  7414. maxNesting = state.md.options.maxNesting,
  7415. cache = state.cache;
  7416. if (typeof cache[pos] !== 'undefined') {
  7417. state.pos = cache[pos];
  7418. return;
  7419. }
  7420. if (state.level < maxNesting) {
  7421. for (i = 0; i < len; i++) {
  7422. // Increment state.level and decrement it later to limit recursion.
  7423. // It's harmless to do here, because no tokens are created. But ideally,
  7424. // we'd need a separate private state variable for this purpose.
  7425. //
  7426. state.level++;
  7427. ok = rules[i](state, true);
  7428. state.level--;
  7429. if (ok) { break; }
  7430. }
  7431. } else {
  7432. // Too much nesting, just skip until the end of the paragraph.
  7433. //
  7434. // NOTE: this will cause links to behave incorrectly in the following case,
  7435. // when an amount of `[` is exactly equal to `maxNesting + 1`:
  7436. //
  7437. // [[[[[[[[[[[[[[[[[[[[[foo]()
  7438. //
  7439. // TODO: remove this workaround when CM standard will allow nested links
  7440. // (we can replace it by preventing links from being parsed in
  7441. // validation mode)
  7442. //
  7443. state.pos = state.posMax;
  7444. }
  7445. if (!ok) { state.pos++; }
  7446. cache[pos] = state.pos;
  7447. };
  7448. // Generate tokens for input range
  7449. //
  7450. ParserInline.prototype.tokenize = function (state) {
  7451. var ok, i,
  7452. rules = this.ruler.getRules(''),
  7453. len = rules.length,
  7454. end = state.posMax,
  7455. maxNesting = state.md.options.maxNesting;
  7456. while (state.pos < end) {
  7457. // Try all possible rules.
  7458. // On success, rule should:
  7459. //
  7460. // - update `state.pos`
  7461. // - update `state.tokens`
  7462. // - return true
  7463. if (state.level < maxNesting) {
  7464. for (i = 0; i < len; i++) {
  7465. ok = rules[i](state, false);
  7466. if (ok) { break; }
  7467. }
  7468. }
  7469. if (ok) {
  7470. if (state.pos >= end) { break; }
  7471. continue;
  7472. }
  7473. state.pending += state.src[state.pos++];
  7474. }
  7475. if (state.pending) {
  7476. state.pushPending();
  7477. }
  7478. };
  7479. /**
  7480. * ParserInline.parse(str, md, env, outTokens)
  7481. *
  7482. * Process input string and push inline tokens into `outTokens`
  7483. **/
  7484. ParserInline.prototype.parse = function (str, md, env, outTokens) {
  7485. var i, rules, len;
  7486. var state = new this.State(str, md, env, outTokens);
  7487. this.tokenize(state);
  7488. rules = this.ruler2.getRules('');
  7489. len = rules.length;
  7490. for (i = 0; i < len; i++) {
  7491. rules[i](state);
  7492. }
  7493. };
  7494. ParserInline.prototype.State = __webpack_require__(73);
  7495. module.exports = ParserInline;
  7496. /***/ }),
  7497. /* 41 */
  7498. /***/ (function(module, exports, __webpack_require__) {
  7499. "use strict";
  7500. // Commonmark default options
  7501. module.exports = {
  7502. options: {
  7503. html: true, // Enable HTML tags in source
  7504. xhtmlOut: true, // Use '/' to close single tags (<br />)
  7505. breaks: false, // Convert '\n' in paragraphs into <br>
  7506. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7507. linkify: false, // autoconvert URL-like texts to links
  7508. // Enable some language-neutral replacements + quotes beautification
  7509. typographer: false,
  7510. // Double + single quotes replacement pairs, when typographer enabled,
  7511. // and smartquotes on. Could be either a String or an Array.
  7512. //
  7513. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7514. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7515. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7516. // Highlighter function. Should return escaped HTML,
  7517. // or '' if the source string is not changed and should be escaped externaly.
  7518. // If result starts with <pre... internal wrapper is skipped.
  7519. //
  7520. // function (/*str, lang*/) { return ''; }
  7521. //
  7522. highlight: null,
  7523. maxNesting: 20 // Internal protection, recursion limit
  7524. },
  7525. components: {
  7526. core: {
  7527. rules: [
  7528. 'normalize',
  7529. 'block',
  7530. 'inline'
  7531. ]
  7532. },
  7533. block: {
  7534. rules: [
  7535. 'blockquote',
  7536. 'code',
  7537. 'fence',
  7538. 'heading',
  7539. 'hr',
  7540. 'html_block',
  7541. 'lheading',
  7542. 'list',
  7543. 'reference',
  7544. 'paragraph'
  7545. ]
  7546. },
  7547. inline: {
  7548. rules: [
  7549. 'autolink',
  7550. 'backticks',
  7551. 'emphasis',
  7552. 'entity',
  7553. 'escape',
  7554. 'html_inline',
  7555. 'image',
  7556. 'link',
  7557. 'newline',
  7558. 'text'
  7559. ],
  7560. rules2: [
  7561. 'balance_pairs',
  7562. 'emphasis',
  7563. 'text_collapse'
  7564. ]
  7565. }
  7566. }
  7567. };
  7568. /***/ }),
  7569. /* 42 */
  7570. /***/ (function(module, exports, __webpack_require__) {
  7571. "use strict";
  7572. // markdown-it default options
  7573. module.exports = {
  7574. options: {
  7575. html: false, // Enable HTML tags in source
  7576. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7577. breaks: false, // Convert '\n' in paragraphs into <br>
  7578. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7579. linkify: false, // autoconvert URL-like texts to links
  7580. // Enable some language-neutral replacements + quotes beautification
  7581. typographer: false,
  7582. // Double + single quotes replacement pairs, when typographer enabled,
  7583. // and smartquotes on. Could be either a String or an Array.
  7584. //
  7585. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7586. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7587. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7588. // Highlighter function. Should return escaped HTML,
  7589. // or '' if the source string is not changed and should be escaped externaly.
  7590. // If result starts with <pre... internal wrapper is skipped.
  7591. //
  7592. // function (/*str, lang*/) { return ''; }
  7593. //
  7594. highlight: null,
  7595. maxNesting: 100 // Internal protection, recursion limit
  7596. },
  7597. components: {
  7598. core: {},
  7599. block: {},
  7600. inline: {}
  7601. }
  7602. };
  7603. /***/ }),
  7604. /* 43 */
  7605. /***/ (function(module, exports, __webpack_require__) {
  7606. "use strict";
  7607. // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
  7608. // modes. For example, to parse bold/italic only.
  7609. module.exports = {
  7610. options: {
  7611. html: false, // Enable HTML tags in source
  7612. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7613. breaks: false, // Convert '\n' in paragraphs into <br>
  7614. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7615. linkify: false, // autoconvert URL-like texts to links
  7616. // Enable some language-neutral replacements + quotes beautification
  7617. typographer: false,
  7618. // Double + single quotes replacement pairs, when typographer enabled,
  7619. // and smartquotes on. Could be either a String or an Array.
  7620. //
  7621. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7622. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7623. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7624. // Highlighter function. Should return escaped HTML,
  7625. // or '' if the source string is not changed and should be escaped externaly.
  7626. // If result starts with <pre... internal wrapper is skipped.
  7627. //
  7628. // function (/*str, lang*/) { return ''; }
  7629. //
  7630. highlight: null,
  7631. maxNesting: 20 // Internal protection, recursion limit
  7632. },
  7633. components: {
  7634. core: {
  7635. rules: [
  7636. 'normalize',
  7637. 'block',
  7638. 'inline'
  7639. ]
  7640. },
  7641. block: {
  7642. rules: [
  7643. 'paragraph'
  7644. ]
  7645. },
  7646. inline: {
  7647. rules: [
  7648. 'text'
  7649. ],
  7650. rules2: [
  7651. 'balance_pairs',
  7652. 'text_collapse'
  7653. ]
  7654. }
  7655. }
  7656. };
  7657. /***/ }),
  7658. /* 44 */
  7659. /***/ (function(module, exports, __webpack_require__) {
  7660. "use strict";
  7661. /**
  7662. * class Renderer
  7663. *
  7664. * Generates HTML from parsed token stream. Each instance has independent
  7665. * copy of rules. Those can be rewritten with ease. Also, you can add new
  7666. * rules if you create plugin and adds new token types.
  7667. **/
  7668. var assign = __webpack_require__(0).assign;
  7669. var unescapeAll = __webpack_require__(0).unescapeAll;
  7670. var escapeHtml = __webpack_require__(0).escapeHtml;
  7671. ////////////////////////////////////////////////////////////////////////////////
  7672. var default_rules = {};
  7673. default_rules.code_inline = function (tokens, idx, options, env, slf) {
  7674. var token = tokens[idx];
  7675. return '<code' + slf.renderAttrs(token) + '>' +
  7676. escapeHtml(tokens[idx].content) +
  7677. '</code>';
  7678. };
  7679. default_rules.code_block = function (tokens, idx, options, env, slf) {
  7680. var token = tokens[idx];
  7681. return '<pre' + slf.renderAttrs(token) + '><code>' +
  7682. escapeHtml(tokens[idx].content) +
  7683. '</code></pre>\n';
  7684. };
  7685. default_rules.fence = function (tokens, idx, options, env, slf) {
  7686. var token = tokens[idx],
  7687. info = token.info ? unescapeAll(token.info).trim() : '',
  7688. langName = '',
  7689. highlighted, i, tmpAttrs, tmpToken;
  7690. if (info) {
  7691. langName = info.split(/\s+/g)[0];
  7692. }
  7693. if (options.highlight) {
  7694. highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
  7695. } else {
  7696. highlighted = escapeHtml(token.content);
  7697. }
  7698. if (highlighted.indexOf('<pre') === 0) {
  7699. return highlighted + '\n';
  7700. }
  7701. // If language exists, inject class gently, without mudofying original token.
  7702. // May be, one day we will add .clone() for token and simplify this part, but
  7703. // now we prefer to keep things local.
  7704. if (info) {
  7705. i = token.attrIndex('class');
  7706. tmpAttrs = token.attrs ? token.attrs.slice() : [];
  7707. if (i < 0) {
  7708. tmpAttrs.push([ 'class', options.langPrefix + langName ]);
  7709. } else {
  7710. tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
  7711. }
  7712. // Fake token just to render attributes
  7713. tmpToken = {
  7714. attrs: tmpAttrs
  7715. };
  7716. return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
  7717. + highlighted
  7718. + '</code></pre>\n';
  7719. }
  7720. return '<pre><code' + slf.renderAttrs(token) + '>'
  7721. + highlighted
  7722. + '</code></pre>\n';
  7723. };
  7724. default_rules.image = function (tokens, idx, options, env, slf) {
  7725. var token = tokens[idx];
  7726. // "alt" attr MUST be set, even if empty. Because it's mandatory and
  7727. // should be placed on proper position for tests.
  7728. //
  7729. // Replace content with actual value
  7730. token.attrs[token.attrIndex('alt')][1] =
  7731. slf.renderInlineAsText(token.children, options, env);
  7732. return slf.renderToken(tokens, idx, options);
  7733. };
  7734. default_rules.hardbreak = function (tokens, idx, options /*, env */) {
  7735. return options.xhtmlOut ? '<br />\n' : '<br>\n';
  7736. };
  7737. default_rules.softbreak = function (tokens, idx, options /*, env */) {
  7738. return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
  7739. };
  7740. default_rules.text = function (tokens, idx /*, options, env */) {
  7741. return escapeHtml(tokens[idx].content);
  7742. };
  7743. default_rules.html_block = function (tokens, idx /*, options, env */) {
  7744. return tokens[idx].content;
  7745. };
  7746. default_rules.html_inline = function (tokens, idx /*, options, env */) {
  7747. return tokens[idx].content;
  7748. };
  7749. /**
  7750. * new Renderer()
  7751. *
  7752. * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
  7753. **/
  7754. function Renderer() {
  7755. /**
  7756. * Renderer#rules -> Object
  7757. *
  7758. * Contains render rules for tokens. Can be updated and extended.
  7759. *
  7760. * ##### Example
  7761. *
  7762. * ```javascript
  7763. * var md = require('markdown-it')();
  7764. *
  7765. * md.renderer.rules.strong_open = function () { return '<b>'; };
  7766. * md.renderer.rules.strong_close = function () { return '</b>'; };
  7767. *
  7768. * var result = md.renderInline(...);
  7769. * ```
  7770. *
  7771. * Each rule is called as independed static function with fixed signature:
  7772. *
  7773. * ```javascript
  7774. * function my_token_render(tokens, idx, options, env, renderer) {
  7775. * // ...
  7776. * return renderedHTML;
  7777. * }
  7778. * ```
  7779. *
  7780. * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
  7781. * for more details and examples.
  7782. **/
  7783. this.rules = assign({}, default_rules);
  7784. }
  7785. /**
  7786. * Renderer.renderAttrs(token) -> String
  7787. *
  7788. * Render token attributes to string.
  7789. **/
  7790. Renderer.prototype.renderAttrs = function renderAttrs(token) {
  7791. var i, l, result;
  7792. if (!token.attrs) { return ''; }
  7793. result = '';
  7794. for (i = 0, l = token.attrs.length; i < l; i++) {
  7795. result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
  7796. }
  7797. return result;
  7798. };
  7799. /**
  7800. * Renderer.renderToken(tokens, idx, options) -> String
  7801. * - tokens (Array): list of tokens
  7802. * - idx (Numbed): token index to render
  7803. * - options (Object): params of parser instance
  7804. *
  7805. * Default token renderer. Can be overriden by custom function
  7806. * in [[Renderer#rules]].
  7807. **/
  7808. Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
  7809. var nextToken,
  7810. result = '',
  7811. needLf = false,
  7812. token = tokens[idx];
  7813. // Tight list paragraphs
  7814. if (token.hidden) {
  7815. return '';
  7816. }
  7817. // Insert a newline between hidden paragraph and subsequent opening
  7818. // block-level tag.
  7819. //
  7820. // For example, here we should insert a newline before blockquote:
  7821. // - a
  7822. // >
  7823. //
  7824. if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
  7825. result += '\n';
  7826. }
  7827. // Add token name, e.g. `<img`
  7828. result += (token.nesting === -1 ? '</' : '<') + token.tag;
  7829. // Encode attributes, e.g. `<img src="foo"`
  7830. result += this.renderAttrs(token);
  7831. // Add a slash for self-closing tags, e.g. `<img src="foo" /`
  7832. if (token.nesting === 0 && options.xhtmlOut) {
  7833. result += ' /';
  7834. }
  7835. // Check if we need to add a newline after this tag
  7836. if (token.block) {
  7837. needLf = true;
  7838. if (token.nesting === 1) {
  7839. if (idx + 1 < tokens.length) {
  7840. nextToken = tokens[idx + 1];
  7841. if (nextToken.type === 'inline' || nextToken.hidden) {
  7842. // Block-level tag containing an inline tag.
  7843. //
  7844. needLf = false;
  7845. } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
  7846. // Opening tag + closing tag of the same type. E.g. `<li></li>`.
  7847. //
  7848. needLf = false;
  7849. }
  7850. }
  7851. }
  7852. }
  7853. result += needLf ? '>\n' : '>';
  7854. return result;
  7855. };
  7856. /**
  7857. * Renderer.renderInline(tokens, options, env) -> String
  7858. * - tokens (Array): list on block tokens to renter
  7859. * - options (Object): params of parser instance
  7860. * - env (Object): additional data from parsed input (references, for example)
  7861. *
  7862. * The same as [[Renderer.render]], but for single token of `inline` type.
  7863. **/
  7864. Renderer.prototype.renderInline = function (tokens, options, env) {
  7865. var type,
  7866. result = '',
  7867. rules = this.rules;
  7868. for (var i = 0, len = tokens.length; i < len; i++) {
  7869. type = tokens[i].type;
  7870. if (typeof rules[type] !== 'undefined') {
  7871. result += rules[type](tokens, i, options, env, this);
  7872. } else {
  7873. result += this.renderToken(tokens, i, options);
  7874. }
  7875. }
  7876. return result;
  7877. };
  7878. /** internal
  7879. * Renderer.renderInlineAsText(tokens, options, env) -> String
  7880. * - tokens (Array): list on block tokens to renter
  7881. * - options (Object): params of parser instance
  7882. * - env (Object): additional data from parsed input (references, for example)
  7883. *
  7884. * Special kludge for image `alt` attributes to conform CommonMark spec.
  7885. * Don't try to use it! Spec requires to show `alt` content with stripped markup,
  7886. * instead of simple escaping.
  7887. **/
  7888. Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
  7889. var result = '';
  7890. for (var i = 0, len = tokens.length; i < len; i++) {
  7891. if (tokens[i].type === 'text') {
  7892. result += tokens[i].content;
  7893. } else if (tokens[i].type === 'image') {
  7894. result += this.renderInlineAsText(tokens[i].children, options, env);
  7895. }
  7896. }
  7897. return result;
  7898. };
  7899. /**
  7900. * Renderer.render(tokens, options, env) -> String
  7901. * - tokens (Array): list on block tokens to renter
  7902. * - options (Object): params of parser instance
  7903. * - env (Object): additional data from parsed input (references, for example)
  7904. *
  7905. * Takes token stream and generates HTML. Probably, you will never need to call
  7906. * this method directly.
  7907. **/
  7908. Renderer.prototype.render = function (tokens, options, env) {
  7909. var i, len, type,
  7910. result = '',
  7911. rules = this.rules;
  7912. for (i = 0, len = tokens.length; i < len; i++) {
  7913. type = tokens[i].type;
  7914. if (type === 'inline') {
  7915. result += this.renderInline(tokens[i].children, options, env);
  7916. } else if (typeof rules[type] !== 'undefined') {
  7917. result += rules[tokens[i].type](tokens, i, options, env, this);
  7918. } else {
  7919. result += this.renderToken(tokens, i, options, env);
  7920. }
  7921. }
  7922. return result;
  7923. };
  7924. module.exports = Renderer;
  7925. /***/ }),
  7926. /* 45 */
  7927. /***/ (function(module, exports, __webpack_require__) {
  7928. "use strict";
  7929. // Block quotes
  7930. var isSpace = __webpack_require__(0).isSpace;
  7931. module.exports = function blockquote(state, startLine, endLine, silent) {
  7932. var adjustTab,
  7933. ch,
  7934. i,
  7935. initial,
  7936. isOutdented,
  7937. l,
  7938. lastLineEmpty,
  7939. lines,
  7940. nextLine,
  7941. offset,
  7942. oldBMarks,
  7943. oldBSCount,
  7944. oldIndent,
  7945. oldParentType,
  7946. oldSCount,
  7947. oldTShift,
  7948. spaceAfterMarker,
  7949. terminate,
  7950. terminatorRules,
  7951. token,
  7952. oldLineMax = state.lineMax,
  7953. pos = state.bMarks[startLine] + state.tShift[startLine],
  7954. max = state.eMarks[startLine];
  7955. // if it's indented more than 3 spaces, it should be a code block
  7956. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7957. // check the block quote marker
  7958. if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
  7959. // we know that it's going to be a valid blockquote,
  7960. // so no point trying to find the end of it in silent mode
  7961. if (silent) { return true; }
  7962. // skip spaces after ">" and re-calculate offset
  7963. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  7964. // skip one optional space after '>'
  7965. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7966. // ' > test '
  7967. // ^ -- position start of line here:
  7968. pos++;
  7969. initial++;
  7970. offset++;
  7971. adjustTab = false;
  7972. spaceAfterMarker = true;
  7973. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7974. spaceAfterMarker = true;
  7975. if ((state.bsCount[startLine] + offset) % 4 === 3) {
  7976. // ' >\t test '
  7977. // ^ -- position start of line here (tab has width===1)
  7978. pos++;
  7979. initial++;
  7980. offset++;
  7981. adjustTab = false;
  7982. } else {
  7983. // ' >\t test '
  7984. // ^ -- position start of line here + shift bsCount slightly
  7985. // to make extra space appear
  7986. adjustTab = true;
  7987. }
  7988. } else {
  7989. spaceAfterMarker = false;
  7990. }
  7991. oldBMarks = [ state.bMarks[startLine] ];
  7992. state.bMarks[startLine] = pos;
  7993. while (pos < max) {
  7994. ch = state.src.charCodeAt(pos);
  7995. if (isSpace(ch)) {
  7996. if (ch === 0x09) {
  7997. offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
  7998. } else {
  7999. offset++;
  8000. }
  8001. } else {
  8002. break;
  8003. }
  8004. pos++;
  8005. }
  8006. oldBSCount = [ state.bsCount[startLine] ];
  8007. state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
  8008. lastLineEmpty = pos >= max;
  8009. oldSCount = [ state.sCount[startLine] ];
  8010. state.sCount[startLine] = offset - initial;
  8011. oldTShift = [ state.tShift[startLine] ];
  8012. state.tShift[startLine] = pos - state.bMarks[startLine];
  8013. terminatorRules = state.md.block.ruler.getRules('blockquote');
  8014. oldParentType = state.parentType;
  8015. state.parentType = 'blockquote';
  8016. // Search the end of the block
  8017. //
  8018. // Block ends with either:
  8019. // 1. an empty line outside:
  8020. // ```
  8021. // > test
  8022. //
  8023. // ```
  8024. // 2. an empty line inside:
  8025. // ```
  8026. // >
  8027. // test
  8028. // ```
  8029. // 3. another tag:
  8030. // ```
  8031. // > test
  8032. // - - -
  8033. // ```
  8034. for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
  8035. // check if it's outdented, i.e. it's inside list item and indented
  8036. // less than said list item:
  8037. //
  8038. // ```
  8039. // 1. anything
  8040. // > current blockquote
  8041. // 2. checking this line
  8042. // ```
  8043. isOutdented = state.sCount[nextLine] < state.blkIndent;
  8044. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8045. max = state.eMarks[nextLine];
  8046. if (pos >= max) {
  8047. // Case 1: line is not inside the blockquote, and this line is empty.
  8048. break;
  8049. }
  8050. if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
  8051. // This line is inside the blockquote.
  8052. // skip spaces after ">" and re-calculate offset
  8053. initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
  8054. // skip one optional space after '>'
  8055. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  8056. // ' > test '
  8057. // ^ -- position start of line here:
  8058. pos++;
  8059. initial++;
  8060. offset++;
  8061. adjustTab = false;
  8062. spaceAfterMarker = true;
  8063. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  8064. spaceAfterMarker = true;
  8065. if ((state.bsCount[nextLine] + offset) % 4 === 3) {
  8066. // ' >\t test '
  8067. // ^ -- position start of line here (tab has width===1)
  8068. pos++;
  8069. initial++;
  8070. offset++;
  8071. adjustTab = false;
  8072. } else {
  8073. // ' >\t test '
  8074. // ^ -- position start of line here + shift bsCount slightly
  8075. // to make extra space appear
  8076. adjustTab = true;
  8077. }
  8078. } else {
  8079. spaceAfterMarker = false;
  8080. }
  8081. oldBMarks.push(state.bMarks[nextLine]);
  8082. state.bMarks[nextLine] = pos;
  8083. while (pos < max) {
  8084. ch = state.src.charCodeAt(pos);
  8085. if (isSpace(ch)) {
  8086. if (ch === 0x09) {
  8087. offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
  8088. } else {
  8089. offset++;
  8090. }
  8091. } else {
  8092. break;
  8093. }
  8094. pos++;
  8095. }
  8096. lastLineEmpty = pos >= max;
  8097. oldBSCount.push(state.bsCount[nextLine]);
  8098. state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
  8099. oldSCount.push(state.sCount[nextLine]);
  8100. state.sCount[nextLine] = offset - initial;
  8101. oldTShift.push(state.tShift[nextLine]);
  8102. state.tShift[nextLine] = pos - state.bMarks[nextLine];
  8103. continue;
  8104. }
  8105. // Case 2: line is not inside the blockquote, and the last line was empty.
  8106. if (lastLineEmpty) { break; }
  8107. // Case 3: another tag found.
  8108. terminate = false;
  8109. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8110. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8111. terminate = true;
  8112. break;
  8113. }
  8114. }
  8115. if (terminate) {
  8116. // Quirk to enforce "hard termination mode" for paragraphs;
  8117. // normally if you call `tokenize(state, startLine, nextLine)`,
  8118. // paragraphs will look below nextLine for paragraph continuation,
  8119. // but if blockquote is terminated by another tag, they shouldn't
  8120. state.lineMax = nextLine;
  8121. if (state.blkIndent !== 0) {
  8122. // state.blkIndent was non-zero, we now set it to zero,
  8123. // so we need to re-calculate all offsets to appear as
  8124. // if indent wasn't changed
  8125. oldBMarks.push(state.bMarks[nextLine]);
  8126. oldBSCount.push(state.bsCount[nextLine]);
  8127. oldTShift.push(state.tShift[nextLine]);
  8128. oldSCount.push(state.sCount[nextLine]);
  8129. state.sCount[nextLine] -= state.blkIndent;
  8130. }
  8131. break;
  8132. }
  8133. if (isOutdented) break;
  8134. oldBMarks.push(state.bMarks[nextLine]);
  8135. oldBSCount.push(state.bsCount[nextLine]);
  8136. oldTShift.push(state.tShift[nextLine]);
  8137. oldSCount.push(state.sCount[nextLine]);
  8138. // A negative indentation means that this is a paragraph continuation
  8139. //
  8140. state.sCount[nextLine] = -1;
  8141. }
  8142. oldIndent = state.blkIndent;
  8143. state.blkIndent = 0;
  8144. token = state.push('blockquote_open', 'blockquote', 1);
  8145. token.markup = '>';
  8146. token.map = lines = [ startLine, 0 ];
  8147. state.md.block.tokenize(state, startLine, nextLine);
  8148. token = state.push('blockquote_close', 'blockquote', -1);
  8149. token.markup = '>';
  8150. state.lineMax = oldLineMax;
  8151. state.parentType = oldParentType;
  8152. lines[1] = state.line;
  8153. // Restore original tShift; this might not be necessary since the parser
  8154. // has already been here, but just to make sure we can do that.
  8155. for (i = 0; i < oldTShift.length; i++) {
  8156. state.bMarks[i + startLine] = oldBMarks[i];
  8157. state.tShift[i + startLine] = oldTShift[i];
  8158. state.sCount[i + startLine] = oldSCount[i];
  8159. state.bsCount[i + startLine] = oldBSCount[i];
  8160. }
  8161. state.blkIndent = oldIndent;
  8162. return true;
  8163. };
  8164. /***/ }),
  8165. /* 46 */
  8166. /***/ (function(module, exports, __webpack_require__) {
  8167. "use strict";
  8168. // Code block (4 spaces padded)
  8169. module.exports = function code(state, startLine, endLine/*, silent*/) {
  8170. var nextLine, last, token;
  8171. if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
  8172. last = nextLine = startLine + 1;
  8173. while (nextLine < endLine) {
  8174. if (state.isEmpty(nextLine)) {
  8175. nextLine++;
  8176. continue;
  8177. }
  8178. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  8179. nextLine++;
  8180. last = nextLine;
  8181. continue;
  8182. }
  8183. break;
  8184. }
  8185. state.line = last;
  8186. token = state.push('code_block', 'code', 0);
  8187. token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
  8188. token.map = [ startLine, state.line ];
  8189. return true;
  8190. };
  8191. /***/ }),
  8192. /* 47 */
  8193. /***/ (function(module, exports, __webpack_require__) {
  8194. "use strict";
  8195. // fences (``` lang, ~~~ lang)
  8196. module.exports = function fence(state, startLine, endLine, silent) {
  8197. var marker, len, params, nextLine, mem, token, markup,
  8198. haveEndMarker = false,
  8199. pos = state.bMarks[startLine] + state.tShift[startLine],
  8200. max = state.eMarks[startLine];
  8201. // if it's indented more than 3 spaces, it should be a code block
  8202. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8203. if (pos + 3 > max) { return false; }
  8204. marker = state.src.charCodeAt(pos);
  8205. if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
  8206. return false;
  8207. }
  8208. // scan marker length
  8209. mem = pos;
  8210. pos = state.skipChars(pos, marker);
  8211. len = pos - mem;
  8212. if (len < 3) { return false; }
  8213. markup = state.src.slice(mem, pos);
  8214. params = state.src.slice(pos, max);
  8215. if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; }
  8216. // Since start is found, we can report success here in validation mode
  8217. if (silent) { return true; }
  8218. // search end of block
  8219. nextLine = startLine;
  8220. for (;;) {
  8221. nextLine++;
  8222. if (nextLine >= endLine) {
  8223. // unclosed block should be autoclosed by end of document.
  8224. // also block seems to be autoclosed by end of parent
  8225. break;
  8226. }
  8227. pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
  8228. max = state.eMarks[nextLine];
  8229. if (pos < max && state.sCount[nextLine] < state.blkIndent) {
  8230. // non-empty line with negative indent should stop the list:
  8231. // - ```
  8232. // test
  8233. break;
  8234. }
  8235. if (state.src.charCodeAt(pos) !== marker) { continue; }
  8236. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  8237. // closing fence should be indented less than 4 spaces
  8238. continue;
  8239. }
  8240. pos = state.skipChars(pos, marker);
  8241. // closing code fence must be at least as long as the opening one
  8242. if (pos - mem < len) { continue; }
  8243. // make sure tail has spaces only
  8244. pos = state.skipSpaces(pos);
  8245. if (pos < max) { continue; }
  8246. haveEndMarker = true;
  8247. // found!
  8248. break;
  8249. }
  8250. // If a fence has heading spaces, they should be removed from its inner block
  8251. len = state.sCount[startLine];
  8252. state.line = nextLine + (haveEndMarker ? 1 : 0);
  8253. token = state.push('fence', 'code', 0);
  8254. token.info = params;
  8255. token.content = state.getLines(startLine + 1, nextLine, len, true);
  8256. token.markup = markup;
  8257. token.map = [ startLine, state.line ];
  8258. return true;
  8259. };
  8260. /***/ }),
  8261. /* 48 */
  8262. /***/ (function(module, exports, __webpack_require__) {
  8263. "use strict";
  8264. // heading (#, ##, ...)
  8265. var isSpace = __webpack_require__(0).isSpace;
  8266. module.exports = function heading(state, startLine, endLine, silent) {
  8267. var ch, level, tmp, token,
  8268. pos = state.bMarks[startLine] + state.tShift[startLine],
  8269. max = state.eMarks[startLine];
  8270. // if it's indented more than 3 spaces, it should be a code block
  8271. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8272. ch = state.src.charCodeAt(pos);
  8273. if (ch !== 0x23/* # */ || pos >= max) { return false; }
  8274. // count heading level
  8275. level = 1;
  8276. ch = state.src.charCodeAt(++pos);
  8277. while (ch === 0x23/* # */ && pos < max && level <= 6) {
  8278. level++;
  8279. ch = state.src.charCodeAt(++pos);
  8280. }
  8281. if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
  8282. if (silent) { return true; }
  8283. // Let's cut tails like ' ### ' from the end of string
  8284. max = state.skipSpacesBack(max, pos);
  8285. tmp = state.skipCharsBack(max, 0x23, pos); // #
  8286. if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
  8287. max = tmp;
  8288. }
  8289. state.line = startLine + 1;
  8290. token = state.push('heading_open', 'h' + String(level), 1);
  8291. token.markup = '########'.slice(0, level);
  8292. token.map = [ startLine, state.line ];
  8293. token = state.push('inline', '', 0);
  8294. token.content = state.src.slice(pos, max).trim();
  8295. token.map = [ startLine, state.line ];
  8296. token.children = [];
  8297. token = state.push('heading_close', 'h' + String(level), -1);
  8298. token.markup = '########'.slice(0, level);
  8299. return true;
  8300. };
  8301. /***/ }),
  8302. /* 49 */
  8303. /***/ (function(module, exports, __webpack_require__) {
  8304. "use strict";
  8305. // Horizontal rule
  8306. var isSpace = __webpack_require__(0).isSpace;
  8307. module.exports = function hr(state, startLine, endLine, silent) {
  8308. var marker, cnt, ch, token,
  8309. pos = state.bMarks[startLine] + state.tShift[startLine],
  8310. max = state.eMarks[startLine];
  8311. // if it's indented more than 3 spaces, it should be a code block
  8312. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8313. marker = state.src.charCodeAt(pos++);
  8314. // Check hr marker
  8315. if (marker !== 0x2A/* * */ &&
  8316. marker !== 0x2D/* - */ &&
  8317. marker !== 0x5F/* _ */) {
  8318. return false;
  8319. }
  8320. // markers can be mixed with spaces, but there should be at least 3 of them
  8321. cnt = 1;
  8322. while (pos < max) {
  8323. ch = state.src.charCodeAt(pos++);
  8324. if (ch !== marker && !isSpace(ch)) { return false; }
  8325. if (ch === marker) { cnt++; }
  8326. }
  8327. if (cnt < 3) { return false; }
  8328. if (silent) { return true; }
  8329. state.line = startLine + 1;
  8330. token = state.push('hr', 'hr', 0);
  8331. token.map = [ startLine, state.line ];
  8332. token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  8333. return true;
  8334. };
  8335. /***/ }),
  8336. /* 50 */
  8337. /***/ (function(module, exports, __webpack_require__) {
  8338. "use strict";
  8339. // HTML block
  8340. var block_names = __webpack_require__(32);
  8341. var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(12).HTML_OPEN_CLOSE_TAG_RE;
  8342. // An array of opening and corresponding closing sequences for html tags,
  8343. // last argument defines whether it can terminate a paragraph or not
  8344. //
  8345. var HTML_SEQUENCES = [
  8346. [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
  8347. [ /^<!--/, /-->/, true ],
  8348. [ /^<\?/, /\?>/, true ],
  8349. [ /^<![A-Z]/, />/, true ],
  8350. [ /^<!\[CDATA\[/, /\]\]>/, true ],
  8351. [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
  8352. [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
  8353. ];
  8354. module.exports = function html_block(state, startLine, endLine, silent) {
  8355. var i, nextLine, token, lineText,
  8356. pos = state.bMarks[startLine] + state.tShift[startLine],
  8357. max = state.eMarks[startLine];
  8358. // if it's indented more than 3 spaces, it should be a code block
  8359. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8360. if (!state.md.options.html) { return false; }
  8361. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  8362. lineText = state.src.slice(pos, max);
  8363. for (i = 0; i < HTML_SEQUENCES.length; i++) {
  8364. if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
  8365. }
  8366. if (i === HTML_SEQUENCES.length) { return false; }
  8367. if (silent) {
  8368. // true if this sequence can be a terminator, false otherwise
  8369. return HTML_SEQUENCES[i][2];
  8370. }
  8371. nextLine = startLine + 1;
  8372. // If we are here - we detected HTML block.
  8373. // Let's roll down till block end.
  8374. if (!HTML_SEQUENCES[i][1].test(lineText)) {
  8375. for (; nextLine < endLine; nextLine++) {
  8376. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8377. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8378. max = state.eMarks[nextLine];
  8379. lineText = state.src.slice(pos, max);
  8380. if (HTML_SEQUENCES[i][1].test(lineText)) {
  8381. if (lineText.length !== 0) { nextLine++; }
  8382. break;
  8383. }
  8384. }
  8385. }
  8386. state.line = nextLine;
  8387. token = state.push('html_block', '', 0);
  8388. token.map = [ startLine, nextLine ];
  8389. token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  8390. return true;
  8391. };
  8392. /***/ }),
  8393. /* 51 */
  8394. /***/ (function(module, exports, __webpack_require__) {
  8395. "use strict";
  8396. // lheading (---, ===)
  8397. module.exports = function lheading(state, startLine, endLine/*, silent*/) {
  8398. var content, terminate, i, l, token, pos, max, level, marker,
  8399. nextLine = startLine + 1, oldParentType,
  8400. terminatorRules = state.md.block.ruler.getRules('paragraph');
  8401. // if it's indented more than 3 spaces, it should be a code block
  8402. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8403. oldParentType = state.parentType;
  8404. state.parentType = 'paragraph'; // use paragraph to match terminatorRules
  8405. // jump line-by-line until empty one or EOF
  8406. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8407. // this would be a code block normally, but after paragraph
  8408. // it's considered a lazy continuation regardless of what's there
  8409. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8410. //
  8411. // Check for underline in setext header
  8412. //
  8413. if (state.sCount[nextLine] >= state.blkIndent) {
  8414. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8415. max = state.eMarks[nextLine];
  8416. if (pos < max) {
  8417. marker = state.src.charCodeAt(pos);
  8418. if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
  8419. pos = state.skipChars(pos, marker);
  8420. pos = state.skipSpaces(pos);
  8421. if (pos >= max) {
  8422. level = (marker === 0x3D/* = */ ? 1 : 2);
  8423. break;
  8424. }
  8425. }
  8426. }
  8427. }
  8428. // quirk for blockquotes, this line should already be checked by that rule
  8429. if (state.sCount[nextLine] < 0) { continue; }
  8430. // Some tags can terminate paragraph without empty line.
  8431. terminate = false;
  8432. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8433. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8434. terminate = true;
  8435. break;
  8436. }
  8437. }
  8438. if (terminate) { break; }
  8439. }
  8440. if (!level) {
  8441. // Didn't find valid underline
  8442. return false;
  8443. }
  8444. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8445. state.line = nextLine + 1;
  8446. token = state.push('heading_open', 'h' + String(level), 1);
  8447. token.markup = String.fromCharCode(marker);
  8448. token.map = [ startLine, state.line ];
  8449. token = state.push('inline', '', 0);
  8450. token.content = content;
  8451. token.map = [ startLine, state.line - 1 ];
  8452. token.children = [];
  8453. token = state.push('heading_close', 'h' + String(level), -1);
  8454. token.markup = String.fromCharCode(marker);
  8455. state.parentType = oldParentType;
  8456. return true;
  8457. };
  8458. /***/ }),
  8459. /* 52 */
  8460. /***/ (function(module, exports, __webpack_require__) {
  8461. "use strict";
  8462. // Lists
  8463. var isSpace = __webpack_require__(0).isSpace;
  8464. // Search `[-+*][\n ]`, returns next pos arter marker on success
  8465. // or -1 on fail.
  8466. function skipBulletListMarker(state, startLine) {
  8467. var marker, pos, max, ch;
  8468. pos = state.bMarks[startLine] + state.tShift[startLine];
  8469. max = state.eMarks[startLine];
  8470. marker = state.src.charCodeAt(pos++);
  8471. // Check bullet
  8472. if (marker !== 0x2A/* * */ &&
  8473. marker !== 0x2D/* - */ &&
  8474. marker !== 0x2B/* + */) {
  8475. return -1;
  8476. }
  8477. if (pos < max) {
  8478. ch = state.src.charCodeAt(pos);
  8479. if (!isSpace(ch)) {
  8480. // " -test " - is not a list item
  8481. return -1;
  8482. }
  8483. }
  8484. return pos;
  8485. }
  8486. // Search `\d+[.)][\n ]`, returns next pos arter marker on success
  8487. // or -1 on fail.
  8488. function skipOrderedListMarker(state, startLine) {
  8489. var ch,
  8490. start = state.bMarks[startLine] + state.tShift[startLine],
  8491. pos = start,
  8492. max = state.eMarks[startLine];
  8493. // List marker should have at least 2 chars (digit + dot)
  8494. if (pos + 1 >= max) { return -1; }
  8495. ch = state.src.charCodeAt(pos++);
  8496. if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
  8497. for (;;) {
  8498. // EOL -> fail
  8499. if (pos >= max) { return -1; }
  8500. ch = state.src.charCodeAt(pos++);
  8501. if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
  8502. // List marker should have no more than 9 digits
  8503. // (prevents integer overflow in browsers)
  8504. if (pos - start >= 10) { return -1; }
  8505. continue;
  8506. }
  8507. // found valid marker
  8508. if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
  8509. break;
  8510. }
  8511. return -1;
  8512. }
  8513. if (pos < max) {
  8514. ch = state.src.charCodeAt(pos);
  8515. if (!isSpace(ch)) {
  8516. // " 1.test " - is not a list item
  8517. return -1;
  8518. }
  8519. }
  8520. return pos;
  8521. }
  8522. function markTightParagraphs(state, idx) {
  8523. var i, l,
  8524. level = state.level + 2;
  8525. for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
  8526. if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
  8527. state.tokens[i + 2].hidden = true;
  8528. state.tokens[i].hidden = true;
  8529. i += 2;
  8530. }
  8531. }
  8532. }
  8533. module.exports = function list(state, startLine, endLine, silent) {
  8534. var ch,
  8535. contentStart,
  8536. i,
  8537. indent,
  8538. indentAfterMarker,
  8539. initial,
  8540. isOrdered,
  8541. itemLines,
  8542. l,
  8543. listLines,
  8544. listTokIdx,
  8545. markerCharCode,
  8546. markerValue,
  8547. max,
  8548. nextLine,
  8549. offset,
  8550. oldIndent,
  8551. oldLIndent,
  8552. oldParentType,
  8553. oldTShift,
  8554. oldTight,
  8555. pos,
  8556. posAfterMarker,
  8557. prevEmptyEnd,
  8558. start,
  8559. terminate,
  8560. terminatorRules,
  8561. token,
  8562. isTerminatingParagraph = false,
  8563. tight = true;
  8564. // if it's indented more than 3 spaces, it should be a code block
  8565. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8566. // limit conditions when list can interrupt
  8567. // a paragraph (validation mode only)
  8568. if (silent && state.parentType === 'paragraph') {
  8569. // Next list item should still terminate previous list item;
  8570. //
  8571. // This code can fail if plugins use blkIndent as well as lists,
  8572. // but I hope the spec gets fixed long before that happens.
  8573. //
  8574. if (state.tShift[startLine] >= state.blkIndent) {
  8575. isTerminatingParagraph = true;
  8576. }
  8577. }
  8578. // Detect list type and position after marker
  8579. if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
  8580. isOrdered = true;
  8581. start = state.bMarks[startLine] + state.tShift[startLine];
  8582. markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
  8583. // If we're starting a new ordered list right after
  8584. // a paragraph, it should start with 1.
  8585. if (isTerminatingParagraph && markerValue !== 1) return false;
  8586. } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
  8587. isOrdered = false;
  8588. } else {
  8589. return false;
  8590. }
  8591. // If we're starting a new unordered list right after
  8592. // a paragraph, first line should not be empty.
  8593. if (isTerminatingParagraph) {
  8594. if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
  8595. }
  8596. // We should terminate list on style change. Remember first one to compare.
  8597. markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  8598. // For validation mode we can terminate immediately
  8599. if (silent) { return true; }
  8600. // Start list
  8601. listTokIdx = state.tokens.length;
  8602. if (isOrdered) {
  8603. token = state.push('ordered_list_open', 'ol', 1);
  8604. if (markerValue !== 1) {
  8605. token.attrs = [ [ 'start', markerValue ] ];
  8606. }
  8607. } else {
  8608. token = state.push('bullet_list_open', 'ul', 1);
  8609. }
  8610. token.map = listLines = [ startLine, 0 ];
  8611. token.markup = String.fromCharCode(markerCharCode);
  8612. //
  8613. // Iterate list items
  8614. //
  8615. nextLine = startLine;
  8616. prevEmptyEnd = false;
  8617. terminatorRules = state.md.block.ruler.getRules('list');
  8618. oldParentType = state.parentType;
  8619. state.parentType = 'list';
  8620. while (nextLine < endLine) {
  8621. pos = posAfterMarker;
  8622. max = state.eMarks[nextLine];
  8623. initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
  8624. while (pos < max) {
  8625. ch = state.src.charCodeAt(pos);
  8626. if (isSpace(ch)) {
  8627. if (ch === 0x09) {
  8628. offset += 4 - (offset + state.bsCount[nextLine]) % 4;
  8629. } else {
  8630. offset++;
  8631. }
  8632. } else {
  8633. break;
  8634. }
  8635. pos++;
  8636. }
  8637. contentStart = pos;
  8638. if (contentStart >= max) {
  8639. // trimming space in "- \n 3" case, indent is 1 here
  8640. indentAfterMarker = 1;
  8641. } else {
  8642. indentAfterMarker = offset - initial;
  8643. }
  8644. // If we have more than 4 spaces, the indent is 1
  8645. // (the rest is just indented code block)
  8646. if (indentAfterMarker > 4) { indentAfterMarker = 1; }
  8647. // " - test"
  8648. // ^^^^^ - calculating total length of this thing
  8649. indent = initial + indentAfterMarker;
  8650. // Run subparser & write tokens
  8651. token = state.push('list_item_open', 'li', 1);
  8652. token.markup = String.fromCharCode(markerCharCode);
  8653. token.map = itemLines = [ startLine, 0 ];
  8654. oldIndent = state.blkIndent;
  8655. oldTight = state.tight;
  8656. oldTShift = state.tShift[startLine];
  8657. oldLIndent = state.sCount[startLine];
  8658. state.blkIndent = indent;
  8659. state.tight = true;
  8660. state.tShift[startLine] = contentStart - state.bMarks[startLine];
  8661. state.sCount[startLine] = offset;
  8662. if (contentStart >= max && state.isEmpty(startLine + 1)) {
  8663. // workaround for this case
  8664. // (list item is empty, list terminates before "foo"):
  8665. // ~~~~~~~~
  8666. // -
  8667. //
  8668. // foo
  8669. // ~~~~~~~~
  8670. state.line = Math.min(state.line + 2, endLine);
  8671. } else {
  8672. state.md.block.tokenize(state, startLine, endLine, true);
  8673. }
  8674. // If any of list item is tight, mark list as tight
  8675. if (!state.tight || prevEmptyEnd) {
  8676. tight = false;
  8677. }
  8678. // Item become loose if finish with empty line,
  8679. // but we should filter last element, because it means list finish
  8680. prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
  8681. state.blkIndent = oldIndent;
  8682. state.tShift[startLine] = oldTShift;
  8683. state.sCount[startLine] = oldLIndent;
  8684. state.tight = oldTight;
  8685. token = state.push('list_item_close', 'li', -1);
  8686. token.markup = String.fromCharCode(markerCharCode);
  8687. nextLine = startLine = state.line;
  8688. itemLines[1] = nextLine;
  8689. contentStart = state.bMarks[startLine];
  8690. if (nextLine >= endLine) { break; }
  8691. //
  8692. // Try to check if list is terminated or continued.
  8693. //
  8694. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8695. // fail if terminating block found
  8696. terminate = false;
  8697. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8698. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8699. terminate = true;
  8700. break;
  8701. }
  8702. }
  8703. if (terminate) { break; }
  8704. // fail if list has another type
  8705. if (isOrdered) {
  8706. posAfterMarker = skipOrderedListMarker(state, nextLine);
  8707. if (posAfterMarker < 0) { break; }
  8708. } else {
  8709. posAfterMarker = skipBulletListMarker(state, nextLine);
  8710. if (posAfterMarker < 0) { break; }
  8711. }
  8712. if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
  8713. }
  8714. // Finilize list
  8715. if (isOrdered) {
  8716. token = state.push('ordered_list_close', 'ol', -1);
  8717. } else {
  8718. token = state.push('bullet_list_close', 'ul', -1);
  8719. }
  8720. token.markup = String.fromCharCode(markerCharCode);
  8721. listLines[1] = nextLine;
  8722. state.line = nextLine;
  8723. state.parentType = oldParentType;
  8724. // mark paragraphs tight if needed
  8725. if (tight) {
  8726. markTightParagraphs(state, listTokIdx);
  8727. }
  8728. return true;
  8729. };
  8730. /***/ }),
  8731. /* 53 */
  8732. /***/ (function(module, exports, __webpack_require__) {
  8733. "use strict";
  8734. // Paragraph
  8735. module.exports = function paragraph(state, startLine/*, endLine*/) {
  8736. var content, terminate, i, l, token, oldParentType,
  8737. nextLine = startLine + 1,
  8738. terminatorRules = state.md.block.ruler.getRules('paragraph'),
  8739. endLine = state.lineMax;
  8740. oldParentType = state.parentType;
  8741. state.parentType = 'paragraph';
  8742. // jump line-by-line until empty one or EOF
  8743. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8744. // this would be a code block normally, but after paragraph
  8745. // it's considered a lazy continuation regardless of what's there
  8746. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8747. // quirk for blockquotes, this line should already be checked by that rule
  8748. if (state.sCount[nextLine] < 0) { continue; }
  8749. // Some tags can terminate paragraph without empty line.
  8750. terminate = false;
  8751. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8752. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8753. terminate = true;
  8754. break;
  8755. }
  8756. }
  8757. if (terminate) { break; }
  8758. }
  8759. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8760. state.line = nextLine;
  8761. token = state.push('paragraph_open', 'p', 1);
  8762. token.map = [ startLine, state.line ];
  8763. token = state.push('inline', '', 0);
  8764. token.content = content;
  8765. token.map = [ startLine, state.line ];
  8766. token.children = [];
  8767. token = state.push('paragraph_close', 'p', -1);
  8768. state.parentType = oldParentType;
  8769. return true;
  8770. };
  8771. /***/ }),
  8772. /* 54 */
  8773. /***/ (function(module, exports, __webpack_require__) {
  8774. "use strict";
  8775. var normalizeReference = __webpack_require__(0).normalizeReference;
  8776. var isSpace = __webpack_require__(0).isSpace;
  8777. module.exports = function reference(state, startLine, _endLine, silent) {
  8778. var ch,
  8779. destEndPos,
  8780. destEndLineNo,
  8781. endLine,
  8782. href,
  8783. i,
  8784. l,
  8785. label,
  8786. labelEnd,
  8787. oldParentType,
  8788. res,
  8789. start,
  8790. str,
  8791. terminate,
  8792. terminatorRules,
  8793. title,
  8794. lines = 0,
  8795. pos = state.bMarks[startLine] + state.tShift[startLine],
  8796. max = state.eMarks[startLine],
  8797. nextLine = startLine + 1;
  8798. // if it's indented more than 3 spaces, it should be a code block
  8799. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8800. if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
  8801. // Simple check to quickly interrupt scan on [link](url) at the start of line.
  8802. // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
  8803. while (++pos < max) {
  8804. if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
  8805. state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
  8806. if (pos + 1 === max) { return false; }
  8807. if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
  8808. break;
  8809. }
  8810. }
  8811. endLine = state.lineMax;
  8812. // jump line-by-line until empty one or EOF
  8813. terminatorRules = state.md.block.ruler.getRules('reference');
  8814. oldParentType = state.parentType;
  8815. state.parentType = 'reference';
  8816. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8817. // this would be a code block normally, but after paragraph
  8818. // it's considered a lazy continuation regardless of what's there
  8819. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8820. // quirk for blockquotes, this line should already be checked by that rule
  8821. if (state.sCount[nextLine] < 0) { continue; }
  8822. // Some tags can terminate paragraph without empty line.
  8823. terminate = false;
  8824. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8825. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8826. terminate = true;
  8827. break;
  8828. }
  8829. }
  8830. if (terminate) { break; }
  8831. }
  8832. str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8833. max = str.length;
  8834. for (pos = 1; pos < max; pos++) {
  8835. ch = str.charCodeAt(pos);
  8836. if (ch === 0x5B /* [ */) {
  8837. return false;
  8838. } else if (ch === 0x5D /* ] */) {
  8839. labelEnd = pos;
  8840. break;
  8841. } else if (ch === 0x0A /* \n */) {
  8842. lines++;
  8843. } else if (ch === 0x5C /* \ */) {
  8844. pos++;
  8845. if (pos < max && str.charCodeAt(pos) === 0x0A) {
  8846. lines++;
  8847. }
  8848. }
  8849. }
  8850. if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
  8851. // [label]: destination 'title'
  8852. // ^^^ skip optional whitespace here
  8853. for (pos = labelEnd + 2; pos < max; pos++) {
  8854. ch = str.charCodeAt(pos);
  8855. if (ch === 0x0A) {
  8856. lines++;
  8857. } else if (isSpace(ch)) {
  8858. /*eslint no-empty:0*/
  8859. } else {
  8860. break;
  8861. }
  8862. }
  8863. // [label]: destination 'title'
  8864. // ^^^^^^^^^^^ parse this
  8865. res = state.md.helpers.parseLinkDestination(str, pos, max);
  8866. if (!res.ok) { return false; }
  8867. href = state.md.normalizeLink(res.str);
  8868. if (!state.md.validateLink(href)) { return false; }
  8869. pos = res.pos;
  8870. lines += res.lines;
  8871. // save cursor state, we could require to rollback later
  8872. destEndPos = pos;
  8873. destEndLineNo = lines;
  8874. // [label]: destination 'title'
  8875. // ^^^ skipping those spaces
  8876. start = pos;
  8877. for (; pos < max; pos++) {
  8878. ch = str.charCodeAt(pos);
  8879. if (ch === 0x0A) {
  8880. lines++;
  8881. } else if (isSpace(ch)) {
  8882. /*eslint no-empty:0*/
  8883. } else {
  8884. break;
  8885. }
  8886. }
  8887. // [label]: destination 'title'
  8888. // ^^^^^^^ parse this
  8889. res = state.md.helpers.parseLinkTitle(str, pos, max);
  8890. if (pos < max && start !== pos && res.ok) {
  8891. title = res.str;
  8892. pos = res.pos;
  8893. lines += res.lines;
  8894. } else {
  8895. title = '';
  8896. pos = destEndPos;
  8897. lines = destEndLineNo;
  8898. }
  8899. // skip trailing spaces until the rest of the line
  8900. while (pos < max) {
  8901. ch = str.charCodeAt(pos);
  8902. if (!isSpace(ch)) { break; }
  8903. pos++;
  8904. }
  8905. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8906. if (title) {
  8907. // garbage at the end of the line after title,
  8908. // but it could still be a valid reference if we roll back
  8909. title = '';
  8910. pos = destEndPos;
  8911. lines = destEndLineNo;
  8912. while (pos < max) {
  8913. ch = str.charCodeAt(pos);
  8914. if (!isSpace(ch)) { break; }
  8915. pos++;
  8916. }
  8917. }
  8918. }
  8919. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8920. // garbage at the end of the line
  8921. return false;
  8922. }
  8923. label = normalizeReference(str.slice(1, labelEnd));
  8924. if (!label) {
  8925. // CommonMark 0.20 disallows empty labels
  8926. return false;
  8927. }
  8928. // Reference can not terminate anything. This check is for safety only.
  8929. /*istanbul ignore if*/
  8930. if (silent) { return true; }
  8931. if (typeof state.env.references === 'undefined') {
  8932. state.env.references = {};
  8933. }
  8934. if (typeof state.env.references[label] === 'undefined') {
  8935. state.env.references[label] = { title: title, href: href };
  8936. }
  8937. state.parentType = oldParentType;
  8938. state.line = startLine + lines + 1;
  8939. return true;
  8940. };
  8941. /***/ }),
  8942. /* 55 */
  8943. /***/ (function(module, exports, __webpack_require__) {
  8944. "use strict";
  8945. // Parser state class
  8946. var Token = __webpack_require__(4);
  8947. var isSpace = __webpack_require__(0).isSpace;
  8948. function StateBlock(src, md, env, tokens) {
  8949. var ch, s, start, pos, len, indent, offset, indent_found;
  8950. this.src = src;
  8951. // link to parser instance
  8952. this.md = md;
  8953. this.env = env;
  8954. //
  8955. // Internal state vartiables
  8956. //
  8957. this.tokens = tokens;
  8958. this.bMarks = []; // line begin offsets for fast jumps
  8959. this.eMarks = []; // line end offsets for fast jumps
  8960. this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
  8961. this.sCount = []; // indents for each line (tabs expanded)
  8962. // An amount of virtual spaces (tabs expanded) between beginning
  8963. // of each line (bMarks) and real beginning of that line.
  8964. //
  8965. // It exists only as a hack because blockquotes override bMarks
  8966. // losing information in the process.
  8967. //
  8968. // It's used only when expanding tabs, you can think about it as
  8969. // an initial tab length, e.g. bsCount=21 applied to string `\t123`
  8970. // means first tab should be expanded to 4-21%4 === 3 spaces.
  8971. //
  8972. this.bsCount = [];
  8973. // block parser variables
  8974. this.blkIndent = 0; // required block content indent
  8975. // (for example, if we are in list)
  8976. this.line = 0; // line index in src
  8977. this.lineMax = 0; // lines count
  8978. this.tight = false; // loose/tight mode for lists
  8979. this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
  8980. // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
  8981. // used in lists to determine if they interrupt a paragraph
  8982. this.parentType = 'root';
  8983. this.level = 0;
  8984. // renderer
  8985. this.result = '';
  8986. // Create caches
  8987. // Generate markers.
  8988. s = this.src;
  8989. indent_found = false;
  8990. for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
  8991. ch = s.charCodeAt(pos);
  8992. if (!indent_found) {
  8993. if (isSpace(ch)) {
  8994. indent++;
  8995. if (ch === 0x09) {
  8996. offset += 4 - offset % 4;
  8997. } else {
  8998. offset++;
  8999. }
  9000. continue;
  9001. } else {
  9002. indent_found = true;
  9003. }
  9004. }
  9005. if (ch === 0x0A || pos === len - 1) {
  9006. if (ch !== 0x0A) { pos++; }
  9007. this.bMarks.push(start);
  9008. this.eMarks.push(pos);
  9009. this.tShift.push(indent);
  9010. this.sCount.push(offset);
  9011. this.bsCount.push(0);
  9012. indent_found = false;
  9013. indent = 0;
  9014. offset = 0;
  9015. start = pos + 1;
  9016. }
  9017. }
  9018. // Push fake entry to simplify cache bounds checks
  9019. this.bMarks.push(s.length);
  9020. this.eMarks.push(s.length);
  9021. this.tShift.push(0);
  9022. this.sCount.push(0);
  9023. this.bsCount.push(0);
  9024. this.lineMax = this.bMarks.length - 1; // don't count last fake line
  9025. }
  9026. // Push new token to "stream".
  9027. //
  9028. StateBlock.prototype.push = function (type, tag, nesting) {
  9029. var token = new Token(type, tag, nesting);
  9030. token.block = true;
  9031. if (nesting < 0) { this.level--; }
  9032. token.level = this.level;
  9033. if (nesting > 0) { this.level++; }
  9034. this.tokens.push(token);
  9035. return token;
  9036. };
  9037. StateBlock.prototype.isEmpty = function isEmpty(line) {
  9038. return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
  9039. };
  9040. StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
  9041. for (var max = this.lineMax; from < max; from++) {
  9042. if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
  9043. break;
  9044. }
  9045. }
  9046. return from;
  9047. };
  9048. // Skip spaces from given position.
  9049. StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
  9050. var ch;
  9051. for (var max = this.src.length; pos < max; pos++) {
  9052. ch = this.src.charCodeAt(pos);
  9053. if (!isSpace(ch)) { break; }
  9054. }
  9055. return pos;
  9056. };
  9057. // Skip spaces from given position in reverse.
  9058. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
  9059. if (pos <= min) { return pos; }
  9060. while (pos > min) {
  9061. if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
  9062. }
  9063. return pos;
  9064. };
  9065. // Skip char codes from given position
  9066. StateBlock.prototype.skipChars = function skipChars(pos, code) {
  9067. for (var max = this.src.length; pos < max; pos++) {
  9068. if (this.src.charCodeAt(pos) !== code) { break; }
  9069. }
  9070. return pos;
  9071. };
  9072. // Skip char codes reverse from given position - 1
  9073. StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
  9074. if (pos <= min) { return pos; }
  9075. while (pos > min) {
  9076. if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
  9077. }
  9078. return pos;
  9079. };
  9080. // cut lines range from source.
  9081. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
  9082. var i, lineIndent, ch, first, last, queue, lineStart,
  9083. line = begin;
  9084. if (begin >= end) {
  9085. return '';
  9086. }
  9087. queue = new Array(end - begin);
  9088. for (i = 0; line < end; line++, i++) {
  9089. lineIndent = 0;
  9090. lineStart = first = this.bMarks[line];
  9091. if (line + 1 < end || keepLastLF) {
  9092. // No need for bounds check because we have fake entry on tail.
  9093. last = this.eMarks[line] + 1;
  9094. } else {
  9095. last = this.eMarks[line];
  9096. }
  9097. while (first < last && lineIndent < indent) {
  9098. ch = this.src.charCodeAt(first);
  9099. if (isSpace(ch)) {
  9100. if (ch === 0x09) {
  9101. lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
  9102. } else {
  9103. lineIndent++;
  9104. }
  9105. } else if (first - lineStart < this.tShift[line]) {
  9106. // patched tShift masked characters to look like spaces (blockquotes, list markers)
  9107. lineIndent++;
  9108. } else {
  9109. break;
  9110. }
  9111. first++;
  9112. }
  9113. if (lineIndent > indent) {
  9114. // partially expanding tabs in code blocks, e.g '\t\tfoobar'
  9115. // with indent=2 becomes ' \tfoobar'
  9116. queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
  9117. } else {
  9118. queue[i] = this.src.slice(first, last);
  9119. }
  9120. }
  9121. return queue.join('');
  9122. };
  9123. // re-export Token class to use in block rules
  9124. StateBlock.prototype.Token = Token;
  9125. module.exports = StateBlock;
  9126. /***/ }),
  9127. /* 56 */
  9128. /***/ (function(module, exports, __webpack_require__) {
  9129. "use strict";
  9130. // GFM table, non-standard
  9131. var isSpace = __webpack_require__(0).isSpace;
  9132. function getLine(state, line) {
  9133. var pos = state.bMarks[line] + state.blkIndent,
  9134. max = state.eMarks[line];
  9135. return state.src.substr(pos, max - pos);
  9136. }
  9137. function escapedSplit(str) {
  9138. var result = [],
  9139. pos = 0,
  9140. max = str.length,
  9141. ch,
  9142. escapes = 0,
  9143. lastPos = 0,
  9144. backTicked = false,
  9145. lastBackTick = 0;
  9146. ch = str.charCodeAt(pos);
  9147. while (pos < max) {
  9148. if (ch === 0x60/* ` */) {
  9149. if (backTicked) {
  9150. // make \` close code sequence, but not open it;
  9151. // the reason is: `\` is correct code block
  9152. backTicked = false;
  9153. lastBackTick = pos;
  9154. } else if (escapes % 2 === 0) {
  9155. backTicked = true;
  9156. lastBackTick = pos;
  9157. }
  9158. } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
  9159. result.push(str.substring(lastPos, pos));
  9160. lastPos = pos + 1;
  9161. }
  9162. if (ch === 0x5c/* \ */) {
  9163. escapes++;
  9164. } else {
  9165. escapes = 0;
  9166. }
  9167. pos++;
  9168. // If there was an un-closed backtick, go back to just after
  9169. // the last backtick, but as if it was a normal character
  9170. if (pos === max && backTicked) {
  9171. backTicked = false;
  9172. pos = lastBackTick + 1;
  9173. }
  9174. ch = str.charCodeAt(pos);
  9175. }
  9176. result.push(str.substring(lastPos));
  9177. return result;
  9178. }
  9179. module.exports = function table(state, startLine, endLine, silent) {
  9180. var ch, lineText, pos, i, nextLine, columns, columnCount, token,
  9181. aligns, t, tableLines, tbodyLines;
  9182. // should have at least two lines
  9183. if (startLine + 2 > endLine) { return false; }
  9184. nextLine = startLine + 1;
  9185. if (state.sCount[nextLine] < state.blkIndent) { return false; }
  9186. // if it's indented more than 3 spaces, it should be a code block
  9187. if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
  9188. // first character of the second line should be '|', '-', ':',
  9189. // and no other characters are allowed but spaces;
  9190. // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
  9191. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  9192. if (pos >= state.eMarks[nextLine]) { return false; }
  9193. ch = state.src.charCodeAt(pos++);
  9194. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
  9195. while (pos < state.eMarks[nextLine]) {
  9196. ch = state.src.charCodeAt(pos);
  9197. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
  9198. pos++;
  9199. }
  9200. lineText = getLine(state, startLine + 1);
  9201. columns = lineText.split('|');
  9202. aligns = [];
  9203. for (i = 0; i < columns.length; i++) {
  9204. t = columns[i].trim();
  9205. if (!t) {
  9206. // allow empty columns before and after table, but not in between columns;
  9207. // e.g. allow ` |---| `, disallow ` ---||--- `
  9208. if (i === 0 || i === columns.length - 1) {
  9209. continue;
  9210. } else {
  9211. return false;
  9212. }
  9213. }
  9214. if (!/^:?-+:?$/.test(t)) { return false; }
  9215. if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
  9216. aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
  9217. } else if (t.charCodeAt(0) === 0x3A/* : */) {
  9218. aligns.push('left');
  9219. } else {
  9220. aligns.push('');
  9221. }
  9222. }
  9223. lineText = getLine(state, startLine).trim();
  9224. if (lineText.indexOf('|') === -1) { return false; }
  9225. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  9226. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9227. // header row will define an amount of columns in the entire table,
  9228. // and align row shouldn't be smaller than that (the rest of the rows can)
  9229. columnCount = columns.length;
  9230. if (columnCount > aligns.length) { return false; }
  9231. if (silent) { return true; }
  9232. token = state.push('table_open', 'table', 1);
  9233. token.map = tableLines = [ startLine, 0 ];
  9234. token = state.push('thead_open', 'thead', 1);
  9235. token.map = [ startLine, startLine + 1 ];
  9236. token = state.push('tr_open', 'tr', 1);
  9237. token.map = [ startLine, startLine + 1 ];
  9238. for (i = 0; i < columns.length; i++) {
  9239. token = state.push('th_open', 'th', 1);
  9240. token.map = [ startLine, startLine + 1 ];
  9241. if (aligns[i]) {
  9242. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9243. }
  9244. token = state.push('inline', '', 0);
  9245. token.content = columns[i].trim();
  9246. token.map = [ startLine, startLine + 1 ];
  9247. token.children = [];
  9248. token = state.push('th_close', 'th', -1);
  9249. }
  9250. token = state.push('tr_close', 'tr', -1);
  9251. token = state.push('thead_close', 'thead', -1);
  9252. token = state.push('tbody_open', 'tbody', 1);
  9253. token.map = tbodyLines = [ startLine + 2, 0 ];
  9254. for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
  9255. if (state.sCount[nextLine] < state.blkIndent) { break; }
  9256. lineText = getLine(state, nextLine).trim();
  9257. if (lineText.indexOf('|') === -1) { break; }
  9258. if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
  9259. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9260. token = state.push('tr_open', 'tr', 1);
  9261. for (i = 0; i < columnCount; i++) {
  9262. token = state.push('td_open', 'td', 1);
  9263. if (aligns[i]) {
  9264. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9265. }
  9266. token = state.push('inline', '', 0);
  9267. token.content = columns[i] ? columns[i].trim() : '';
  9268. token.children = [];
  9269. token = state.push('td_close', 'td', -1);
  9270. }
  9271. token = state.push('tr_close', 'tr', -1);
  9272. }
  9273. token = state.push('tbody_close', 'tbody', -1);
  9274. token = state.push('table_close', 'table', -1);
  9275. tableLines[1] = tbodyLines[1] = nextLine;
  9276. state.line = nextLine;
  9277. return true;
  9278. };
  9279. /***/ }),
  9280. /* 57 */
  9281. /***/ (function(module, exports, __webpack_require__) {
  9282. "use strict";
  9283. module.exports = function block(state) {
  9284. var token;
  9285. if (state.inlineMode) {
  9286. token = new state.Token('inline', '', 0);
  9287. token.content = state.src;
  9288. token.map = [ 0, 1 ];
  9289. token.children = [];
  9290. state.tokens.push(token);
  9291. } else {
  9292. state.md.block.parse(state.src, state.md, state.env, state.tokens);
  9293. }
  9294. };
  9295. /***/ }),
  9296. /* 58 */
  9297. /***/ (function(module, exports, __webpack_require__) {
  9298. "use strict";
  9299. module.exports = function inline(state) {
  9300. var tokens = state.tokens, tok, i, l;
  9301. // Parse inlines
  9302. for (i = 0, l = tokens.length; i < l; i++) {
  9303. tok = tokens[i];
  9304. if (tok.type === 'inline') {
  9305. state.md.inline.parse(tok.content, state.md, state.env, tok.children);
  9306. }
  9307. }
  9308. };
  9309. /***/ }),
  9310. /* 59 */
  9311. /***/ (function(module, exports, __webpack_require__) {
  9312. "use strict";
  9313. // Replace link-like texts with link nodes.
  9314. //
  9315. // Currently restricted by `md.validateLink()` to http/https/ftp
  9316. //
  9317. var arrayReplaceAt = __webpack_require__(0).arrayReplaceAt;
  9318. function isLinkOpen(str) {
  9319. return /^<a[>\s]/i.test(str);
  9320. }
  9321. function isLinkClose(str) {
  9322. return /^<\/a\s*>/i.test(str);
  9323. }
  9324. module.exports = function linkify(state) {
  9325. var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
  9326. level, htmlLinkLevel, url, fullUrl, urlText,
  9327. blockTokens = state.tokens,
  9328. links;
  9329. if (!state.md.options.linkify) { return; }
  9330. for (j = 0, l = blockTokens.length; j < l; j++) {
  9331. if (blockTokens[j].type !== 'inline' ||
  9332. !state.md.linkify.pretest(blockTokens[j].content)) {
  9333. continue;
  9334. }
  9335. tokens = blockTokens[j].children;
  9336. htmlLinkLevel = 0;
  9337. // We scan from the end, to keep position when new tags added.
  9338. // Use reversed logic in links start/end match
  9339. for (i = tokens.length - 1; i >= 0; i--) {
  9340. currentToken = tokens[i];
  9341. // Skip content of markdown links
  9342. if (currentToken.type === 'link_close') {
  9343. i--;
  9344. while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
  9345. i--;
  9346. }
  9347. continue;
  9348. }
  9349. // Skip content of html tag links
  9350. if (currentToken.type === 'html_inline') {
  9351. if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
  9352. htmlLinkLevel--;
  9353. }
  9354. if (isLinkClose(currentToken.content)) {
  9355. htmlLinkLevel++;
  9356. }
  9357. }
  9358. if (htmlLinkLevel > 0) { continue; }
  9359. if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
  9360. text = currentToken.content;
  9361. links = state.md.linkify.match(text);
  9362. // Now split string to nodes
  9363. nodes = [];
  9364. level = currentToken.level;
  9365. lastPos = 0;
  9366. for (ln = 0; ln < links.length; ln++) {
  9367. url = links[ln].url;
  9368. fullUrl = state.md.normalizeLink(url);
  9369. if (!state.md.validateLink(fullUrl)) { continue; }
  9370. urlText = links[ln].text;
  9371. // Linkifier might send raw hostnames like "example.com", where url
  9372. // starts with domain name. So we prepend http:// in those cases,
  9373. // and remove it afterwards.
  9374. //
  9375. if (!links[ln].schema) {
  9376. urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
  9377. } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
  9378. urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
  9379. } else {
  9380. urlText = state.md.normalizeLinkText(urlText);
  9381. }
  9382. pos = links[ln].index;
  9383. if (pos > lastPos) {
  9384. token = new state.Token('text', '', 0);
  9385. token.content = text.slice(lastPos, pos);
  9386. token.level = level;
  9387. nodes.push(token);
  9388. }
  9389. token = new state.Token('link_open', 'a', 1);
  9390. token.attrs = [ [ 'href', fullUrl ] ];
  9391. token.level = level++;
  9392. token.markup = 'linkify';
  9393. token.info = 'auto';
  9394. nodes.push(token);
  9395. token = new state.Token('text', '', 0);
  9396. token.content = urlText;
  9397. token.level = level;
  9398. nodes.push(token);
  9399. token = new state.Token('link_close', 'a', -1);
  9400. token.level = --level;
  9401. token.markup = 'linkify';
  9402. token.info = 'auto';
  9403. nodes.push(token);
  9404. lastPos = links[ln].lastIndex;
  9405. }
  9406. if (lastPos < text.length) {
  9407. token = new state.Token('text', '', 0);
  9408. token.content = text.slice(lastPos);
  9409. token.level = level;
  9410. nodes.push(token);
  9411. }
  9412. // replace current node
  9413. blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
  9414. }
  9415. }
  9416. }
  9417. };
  9418. /***/ }),
  9419. /* 60 */
  9420. /***/ (function(module, exports, __webpack_require__) {
  9421. "use strict";
  9422. // Normalize input string
  9423. var NEWLINES_RE = /\r[\n\u0085]?|[\u2424\u2028\u0085]/g;
  9424. var NULL_RE = /\u0000/g;
  9425. module.exports = function inline(state) {
  9426. var str;
  9427. // Normalize newlines
  9428. str = state.src.replace(NEWLINES_RE, '\n');
  9429. // Replace NULL characters
  9430. str = str.replace(NULL_RE, '\uFFFD');
  9431. state.src = str;
  9432. };
  9433. /***/ }),
  9434. /* 61 */
  9435. /***/ (function(module, exports, __webpack_require__) {
  9436. "use strict";
  9437. // Simple typographyc replacements
  9438. //
  9439. // (c) (C) → ©
  9440. // (tm) (TM) → ™
  9441. // (r) (R) → ®
  9442. // +- → ±
  9443. // (p) (P) -> §
  9444. // ... → … (also ?.... → ?.., !.... → !..)
  9445. // ???????? → ???, !!!!! → !!!, `,,` → `,`
  9446. // -- → &ndash;, --- → &mdash;
  9447. //
  9448. // TODO:
  9449. // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
  9450. // - miltiplication 2 x 4 -> 2 × 4
  9451. var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
  9452. // Workaround for phantomjs - need regex without /g flag,
  9453. // or root check will fail every second time
  9454. var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
  9455. var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
  9456. var SCOPED_ABBR = {
  9457. c: '©',
  9458. r: '®',
  9459. p: '§',
  9460. tm: '™'
  9461. };
  9462. function replaceFn(match, name) {
  9463. return SCOPED_ABBR[name.toLowerCase()];
  9464. }
  9465. function replace_scoped(inlineTokens) {
  9466. var i, token, inside_autolink = 0;
  9467. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9468. token = inlineTokens[i];
  9469. if (token.type === 'text' && !inside_autolink) {
  9470. token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
  9471. }
  9472. if (token.type === 'link_open' && token.info === 'auto') {
  9473. inside_autolink--;
  9474. }
  9475. if (token.type === 'link_close' && token.info === 'auto') {
  9476. inside_autolink++;
  9477. }
  9478. }
  9479. }
  9480. function replace_rare(inlineTokens) {
  9481. var i, token, inside_autolink = 0;
  9482. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9483. token = inlineTokens[i];
  9484. if (token.type === 'text' && !inside_autolink) {
  9485. if (RARE_RE.test(token.content)) {
  9486. token.content = token.content
  9487. .replace(/\+-/g, '±')
  9488. // .., ..., ....... -> …
  9489. // but ?..... & !..... -> ?.. & !..
  9490. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
  9491. .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
  9492. // em-dash
  9493. .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
  9494. // en-dash
  9495. .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
  9496. .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
  9497. }
  9498. }
  9499. if (token.type === 'link_open' && token.info === 'auto') {
  9500. inside_autolink--;
  9501. }
  9502. if (token.type === 'link_close' && token.info === 'auto') {
  9503. inside_autolink++;
  9504. }
  9505. }
  9506. }
  9507. module.exports = function replace(state) {
  9508. var blkIdx;
  9509. if (!state.md.options.typographer) { return; }
  9510. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9511. if (state.tokens[blkIdx].type !== 'inline') { continue; }
  9512. if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
  9513. replace_scoped(state.tokens[blkIdx].children);
  9514. }
  9515. if (RARE_RE.test(state.tokens[blkIdx].content)) {
  9516. replace_rare(state.tokens[blkIdx].children);
  9517. }
  9518. }
  9519. };
  9520. /***/ }),
  9521. /* 62 */
  9522. /***/ (function(module, exports, __webpack_require__) {
  9523. "use strict";
  9524. // Convert straight quotation marks to typographic ones
  9525. //
  9526. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9527. var isPunctChar = __webpack_require__(0).isPunctChar;
  9528. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9529. var QUOTE_TEST_RE = /['"]/;
  9530. var QUOTE_RE = /['"]/g;
  9531. var APOSTROPHE = '\u2019'; /* ’ */
  9532. function replaceAt(str, index, ch) {
  9533. return str.substr(0, index) + ch + str.substr(index + 1);
  9534. }
  9535. function process_inlines(tokens, state) {
  9536. var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
  9537. isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
  9538. canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
  9539. stack = [];
  9540. for (i = 0; i < tokens.length; i++) {
  9541. token = tokens[i];
  9542. thisLevel = tokens[i].level;
  9543. for (j = stack.length - 1; j >= 0; j--) {
  9544. if (stack[j].level <= thisLevel) { break; }
  9545. }
  9546. stack.length = j + 1;
  9547. if (token.type !== 'text') { continue; }
  9548. text = token.content;
  9549. pos = 0;
  9550. max = text.length;
  9551. /*eslint no-labels:0,block-scoped-var:0*/
  9552. OUTER:
  9553. while (pos < max) {
  9554. QUOTE_RE.lastIndex = pos;
  9555. t = QUOTE_RE.exec(text);
  9556. if (!t) { break; }
  9557. canOpen = canClose = true;
  9558. pos = t.index + 1;
  9559. isSingle = (t[0] === "'");
  9560. // Find previous character,
  9561. // default to space if it's the beginning of the line
  9562. //
  9563. lastChar = 0x20;
  9564. if (t.index - 1 >= 0) {
  9565. lastChar = text.charCodeAt(t.index - 1);
  9566. } else {
  9567. for (j = i - 1; j >= 0; j--) {
  9568. if (tokens[j].type !== 'text') { continue; }
  9569. lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
  9570. break;
  9571. }
  9572. }
  9573. // Find next character,
  9574. // default to space if it's the end of the line
  9575. //
  9576. nextChar = 0x20;
  9577. if (pos < max) {
  9578. nextChar = text.charCodeAt(pos);
  9579. } else {
  9580. for (j = i + 1; j < tokens.length; j++) {
  9581. if (tokens[j].type !== 'text') { continue; }
  9582. nextChar = tokens[j].content.charCodeAt(0);
  9583. break;
  9584. }
  9585. }
  9586. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  9587. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  9588. isLastWhiteSpace = isWhiteSpace(lastChar);
  9589. isNextWhiteSpace = isWhiteSpace(nextChar);
  9590. if (isNextWhiteSpace) {
  9591. canOpen = false;
  9592. } else if (isNextPunctChar) {
  9593. if (!(isLastWhiteSpace || isLastPunctChar)) {
  9594. canOpen = false;
  9595. }
  9596. }
  9597. if (isLastWhiteSpace) {
  9598. canClose = false;
  9599. } else if (isLastPunctChar) {
  9600. if (!(isNextWhiteSpace || isNextPunctChar)) {
  9601. canClose = false;
  9602. }
  9603. }
  9604. if (nextChar === 0x22 /* " */ && t[0] === '"') {
  9605. if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
  9606. // special case: 1"" - count first quote as an inch
  9607. canClose = canOpen = false;
  9608. }
  9609. }
  9610. if (canOpen && canClose) {
  9611. // treat this as the middle of the word
  9612. canOpen = false;
  9613. canClose = isNextPunctChar;
  9614. }
  9615. if (!canOpen && !canClose) {
  9616. // middle of word
  9617. if (isSingle) {
  9618. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9619. }
  9620. continue;
  9621. }
  9622. if (canClose) {
  9623. // this could be a closing quote, rewind the stack to get a match
  9624. for (j = stack.length - 1; j >= 0; j--) {
  9625. item = stack[j];
  9626. if (stack[j].level < thisLevel) { break; }
  9627. if (item.single === isSingle && stack[j].level === thisLevel) {
  9628. item = stack[j];
  9629. if (isSingle) {
  9630. openQuote = state.md.options.quotes[2];
  9631. closeQuote = state.md.options.quotes[3];
  9632. } else {
  9633. openQuote = state.md.options.quotes[0];
  9634. closeQuote = state.md.options.quotes[1];
  9635. }
  9636. // replace token.content *before* tokens[item.token].content,
  9637. // because, if they are pointing at the same token, replaceAt
  9638. // could mess up indices when quote length != 1
  9639. token.content = replaceAt(token.content, t.index, closeQuote);
  9640. tokens[item.token].content = replaceAt(
  9641. tokens[item.token].content, item.pos, openQuote);
  9642. pos += closeQuote.length - 1;
  9643. if (item.token === i) { pos += openQuote.length - 1; }
  9644. text = token.content;
  9645. max = text.length;
  9646. stack.length = j;
  9647. continue OUTER;
  9648. }
  9649. }
  9650. }
  9651. if (canOpen) {
  9652. stack.push({
  9653. token: i,
  9654. pos: t.index,
  9655. single: isSingle,
  9656. level: thisLevel
  9657. });
  9658. } else if (canClose && isSingle) {
  9659. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9660. }
  9661. }
  9662. }
  9663. }
  9664. module.exports = function smartquotes(state) {
  9665. /*eslint max-depth:0*/
  9666. var blkIdx;
  9667. if (!state.md.options.typographer) { return; }
  9668. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9669. if (state.tokens[blkIdx].type !== 'inline' ||
  9670. !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
  9671. continue;
  9672. }
  9673. process_inlines(state.tokens[blkIdx].children, state);
  9674. }
  9675. };
  9676. /***/ }),
  9677. /* 63 */
  9678. /***/ (function(module, exports, __webpack_require__) {
  9679. "use strict";
  9680. // Core state object
  9681. //
  9682. var Token = __webpack_require__(4);
  9683. function StateCore(src, md, env) {
  9684. this.src = src;
  9685. this.env = env;
  9686. this.tokens = [];
  9687. this.inlineMode = false;
  9688. this.md = md; // link to parser instance
  9689. }
  9690. // re-export Token class to use in core rules
  9691. StateCore.prototype.Token = Token;
  9692. module.exports = StateCore;
  9693. /***/ }),
  9694. /* 64 */
  9695. /***/ (function(module, exports, __webpack_require__) {
  9696. "use strict";
  9697. // Process autolinks '<protocol:...>'
  9698. /*eslint max-len:0*/
  9699. 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])?)*)>/;
  9700. var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
  9701. module.exports = function autolink(state, silent) {
  9702. var tail, linkMatch, emailMatch, url, fullUrl, token,
  9703. pos = state.pos;
  9704. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  9705. tail = state.src.slice(pos);
  9706. if (tail.indexOf('>') < 0) { return false; }
  9707. if (AUTOLINK_RE.test(tail)) {
  9708. linkMatch = tail.match(AUTOLINK_RE);
  9709. url = linkMatch[0].slice(1, -1);
  9710. fullUrl = state.md.normalizeLink(url);
  9711. if (!state.md.validateLink(fullUrl)) { return false; }
  9712. if (!silent) {
  9713. token = state.push('link_open', 'a', 1);
  9714. token.attrs = [ [ 'href', fullUrl ] ];
  9715. token.markup = 'autolink';
  9716. token.info = 'auto';
  9717. token = state.push('text', '', 0);
  9718. token.content = state.md.normalizeLinkText(url);
  9719. token = state.push('link_close', 'a', -1);
  9720. token.markup = 'autolink';
  9721. token.info = 'auto';
  9722. }
  9723. state.pos += linkMatch[0].length;
  9724. return true;
  9725. }
  9726. if (EMAIL_RE.test(tail)) {
  9727. emailMatch = tail.match(EMAIL_RE);
  9728. url = emailMatch[0].slice(1, -1);
  9729. fullUrl = state.md.normalizeLink('mailto:' + url);
  9730. if (!state.md.validateLink(fullUrl)) { return false; }
  9731. if (!silent) {
  9732. token = state.push('link_open', 'a', 1);
  9733. token.attrs = [ [ 'href', fullUrl ] ];
  9734. token.markup = 'autolink';
  9735. token.info = 'auto';
  9736. token = state.push('text', '', 0);
  9737. token.content = state.md.normalizeLinkText(url);
  9738. token = state.push('link_close', 'a', -1);
  9739. token.markup = 'autolink';
  9740. token.info = 'auto';
  9741. }
  9742. state.pos += emailMatch[0].length;
  9743. return true;
  9744. }
  9745. return false;
  9746. };
  9747. /***/ }),
  9748. /* 65 */
  9749. /***/ (function(module, exports, __webpack_require__) {
  9750. "use strict";
  9751. // Parse backticks
  9752. module.exports = function backtick(state, silent) {
  9753. var start, max, marker, matchStart, matchEnd, token,
  9754. pos = state.pos,
  9755. ch = state.src.charCodeAt(pos);
  9756. if (ch !== 0x60/* ` */) { return false; }
  9757. start = pos;
  9758. pos++;
  9759. max = state.posMax;
  9760. while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
  9761. marker = state.src.slice(start, pos);
  9762. matchStart = matchEnd = pos;
  9763. while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
  9764. matchEnd = matchStart + 1;
  9765. while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
  9766. if (matchEnd - matchStart === marker.length) {
  9767. if (!silent) {
  9768. token = state.push('code_inline', 'code', 0);
  9769. token.markup = marker;
  9770. token.content = state.src.slice(pos, matchStart)
  9771. .replace(/[ \n]+/g, ' ')
  9772. .trim();
  9773. }
  9774. state.pos = matchEnd;
  9775. return true;
  9776. }
  9777. }
  9778. if (!silent) { state.pending += marker; }
  9779. state.pos += marker.length;
  9780. return true;
  9781. };
  9782. /***/ }),
  9783. /* 66 */
  9784. /***/ (function(module, exports, __webpack_require__) {
  9785. "use strict";
  9786. // For each opening emphasis-like marker find a matching closing one
  9787. //
  9788. module.exports = function link_pairs(state) {
  9789. var i, j, lastDelim, currDelim,
  9790. delimiters = state.delimiters,
  9791. max = state.delimiters.length;
  9792. for (i = 0; i < max; i++) {
  9793. lastDelim = delimiters[i];
  9794. if (!lastDelim.close) { continue; }
  9795. j = i - lastDelim.jump - 1;
  9796. while (j >= 0) {
  9797. currDelim = delimiters[j];
  9798. if (currDelim.open &&
  9799. currDelim.marker === lastDelim.marker &&
  9800. currDelim.end < 0 &&
  9801. currDelim.level === lastDelim.level) {
  9802. // typeofs are for backward compatibility with plugins
  9803. var odd_match = (currDelim.close || lastDelim.open) &&
  9804. typeof currDelim.length !== 'undefined' &&
  9805. typeof lastDelim.length !== 'undefined' &&
  9806. (currDelim.length + lastDelim.length) % 3 === 0;
  9807. if (!odd_match) {
  9808. lastDelim.jump = i - j;
  9809. lastDelim.open = false;
  9810. currDelim.end = i;
  9811. currDelim.jump = 0;
  9812. break;
  9813. }
  9814. }
  9815. j -= currDelim.jump + 1;
  9816. }
  9817. }
  9818. };
  9819. /***/ }),
  9820. /* 67 */
  9821. /***/ (function(module, exports, __webpack_require__) {
  9822. "use strict";
  9823. // Process html entity - &#123;, &#xAF;, &quot;, ...
  9824. var entities = __webpack_require__(11);
  9825. var has = __webpack_require__(0).has;
  9826. var isValidEntityCode = __webpack_require__(0).isValidEntityCode;
  9827. var fromCodePoint = __webpack_require__(0).fromCodePoint;
  9828. var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
  9829. var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
  9830. module.exports = function entity(state, silent) {
  9831. var ch, code, match, pos = state.pos, max = state.posMax;
  9832. if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
  9833. if (pos + 1 < max) {
  9834. ch = state.src.charCodeAt(pos + 1);
  9835. if (ch === 0x23 /* # */) {
  9836. match = state.src.slice(pos).match(DIGITAL_RE);
  9837. if (match) {
  9838. if (!silent) {
  9839. code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
  9840. state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
  9841. }
  9842. state.pos += match[0].length;
  9843. return true;
  9844. }
  9845. } else {
  9846. match = state.src.slice(pos).match(NAMED_RE);
  9847. if (match) {
  9848. if (has(entities, match[1])) {
  9849. if (!silent) { state.pending += entities[match[1]]; }
  9850. state.pos += match[0].length;
  9851. return true;
  9852. }
  9853. }
  9854. }
  9855. }
  9856. if (!silent) { state.pending += '&'; }
  9857. state.pos++;
  9858. return true;
  9859. };
  9860. /***/ }),
  9861. /* 68 */
  9862. /***/ (function(module, exports, __webpack_require__) {
  9863. "use strict";
  9864. // Proceess escaped chars and hardbreaks
  9865. var isSpace = __webpack_require__(0).isSpace;
  9866. var ESCAPED = [];
  9867. for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
  9868. '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
  9869. .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
  9870. module.exports = function escape(state, silent) {
  9871. var ch, pos = state.pos, max = state.posMax;
  9872. if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
  9873. pos++;
  9874. if (pos < max) {
  9875. ch = state.src.charCodeAt(pos);
  9876. if (ch < 256 && ESCAPED[ch] !== 0) {
  9877. if (!silent) { state.pending += state.src[pos]; }
  9878. state.pos += 2;
  9879. return true;
  9880. }
  9881. if (ch === 0x0A) {
  9882. if (!silent) {
  9883. state.push('hardbreak', 'br', 0);
  9884. }
  9885. pos++;
  9886. // skip leading whitespaces from next line
  9887. while (pos < max) {
  9888. ch = state.src.charCodeAt(pos);
  9889. if (!isSpace(ch)) { break; }
  9890. pos++;
  9891. }
  9892. state.pos = pos;
  9893. return true;
  9894. }
  9895. }
  9896. if (!silent) { state.pending += '\\'; }
  9897. state.pos++;
  9898. return true;
  9899. };
  9900. /***/ }),
  9901. /* 69 */
  9902. /***/ (function(module, exports, __webpack_require__) {
  9903. "use strict";
  9904. // Process html tags
  9905. var HTML_TAG_RE = __webpack_require__(12).HTML_TAG_RE;
  9906. function isLetter(ch) {
  9907. /*eslint no-bitwise:0*/
  9908. var lc = ch | 0x20; // to lower case
  9909. return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  9910. }
  9911. module.exports = function html_inline(state, silent) {
  9912. var ch, match, max, token,
  9913. pos = state.pos;
  9914. if (!state.md.options.html) { return false; }
  9915. // Check start
  9916. max = state.posMax;
  9917. if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
  9918. pos + 2 >= max) {
  9919. return false;
  9920. }
  9921. // Quick fail on second char
  9922. ch = state.src.charCodeAt(pos + 1);
  9923. if (ch !== 0x21/* ! */ &&
  9924. ch !== 0x3F/* ? */ &&
  9925. ch !== 0x2F/* / */ &&
  9926. !isLetter(ch)) {
  9927. return false;
  9928. }
  9929. match = state.src.slice(pos).match(HTML_TAG_RE);
  9930. if (!match) { return false; }
  9931. if (!silent) {
  9932. token = state.push('html_inline', '', 0);
  9933. token.content = state.src.slice(pos, pos + match[0].length);
  9934. }
  9935. state.pos += match[0].length;
  9936. return true;
  9937. };
  9938. /***/ }),
  9939. /* 70 */
  9940. /***/ (function(module, exports, __webpack_require__) {
  9941. "use strict";
  9942. // Process ![image](<src> "title")
  9943. var normalizeReference = __webpack_require__(0).normalizeReference;
  9944. var isSpace = __webpack_require__(0).isSpace;
  9945. module.exports = function image(state, silent) {
  9946. var attrs,
  9947. code,
  9948. content,
  9949. label,
  9950. labelEnd,
  9951. labelStart,
  9952. pos,
  9953. ref,
  9954. res,
  9955. title,
  9956. token,
  9957. tokens,
  9958. start,
  9959. href = '',
  9960. oldPos = state.pos,
  9961. max = state.posMax;
  9962. if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
  9963. if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
  9964. labelStart = state.pos + 2;
  9965. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  9966. // parser failed to find ']', so it's not a valid link
  9967. if (labelEnd < 0) { return false; }
  9968. pos = labelEnd + 1;
  9969. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9970. //
  9971. // Inline link
  9972. //
  9973. // [link]( <href> "title" )
  9974. // ^^ skipping these spaces
  9975. pos++;
  9976. for (; pos < max; pos++) {
  9977. code = state.src.charCodeAt(pos);
  9978. if (!isSpace(code) && code !== 0x0A) { break; }
  9979. }
  9980. if (pos >= max) { return false; }
  9981. // [link]( <href> "title" )
  9982. // ^^^^^^ parsing link destination
  9983. start = pos;
  9984. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9985. if (res.ok) {
  9986. href = state.md.normalizeLink(res.str);
  9987. if (state.md.validateLink(href)) {
  9988. pos = res.pos;
  9989. } else {
  9990. href = '';
  9991. }
  9992. }
  9993. // [link]( <href> "title" )
  9994. // ^^ skipping these spaces
  9995. start = pos;
  9996. for (; pos < max; pos++) {
  9997. code = state.src.charCodeAt(pos);
  9998. if (!isSpace(code) && code !== 0x0A) { break; }
  9999. }
  10000. // [link]( <href> "title" )
  10001. // ^^^^^^^ parsing link title
  10002. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  10003. if (pos < max && start !== pos && res.ok) {
  10004. title = res.str;
  10005. pos = res.pos;
  10006. // [link]( <href> "title" )
  10007. // ^^ skipping these spaces
  10008. for (; pos < max; pos++) {
  10009. code = state.src.charCodeAt(pos);
  10010. if (!isSpace(code) && code !== 0x0A) { break; }
  10011. }
  10012. } else {
  10013. title = '';
  10014. }
  10015. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  10016. state.pos = oldPos;
  10017. return false;
  10018. }
  10019. pos++;
  10020. } else {
  10021. //
  10022. // Link reference
  10023. //
  10024. if (typeof state.env.references === 'undefined') { return false; }
  10025. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  10026. start = pos + 1;
  10027. pos = state.md.helpers.parseLinkLabel(state, pos);
  10028. if (pos >= 0) {
  10029. label = state.src.slice(start, pos++);
  10030. } else {
  10031. pos = labelEnd + 1;
  10032. }
  10033. } else {
  10034. pos = labelEnd + 1;
  10035. }
  10036. // covers label === '' and label === undefined
  10037. // (collapsed reference link and shortcut reference link respectively)
  10038. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  10039. ref = state.env.references[normalizeReference(label)];
  10040. if (!ref) {
  10041. state.pos = oldPos;
  10042. return false;
  10043. }
  10044. href = ref.href;
  10045. title = ref.title;
  10046. }
  10047. //
  10048. // We found the end of the link, and know for a fact it's a valid link;
  10049. // so all that's left to do is to call tokenizer.
  10050. //
  10051. if (!silent) {
  10052. content = state.src.slice(labelStart, labelEnd);
  10053. state.md.inline.parse(
  10054. content,
  10055. state.md,
  10056. state.env,
  10057. tokens = []
  10058. );
  10059. token = state.push('image', 'img', 0);
  10060. token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
  10061. token.children = tokens;
  10062. token.content = content;
  10063. if (title) {
  10064. attrs.push([ 'title', title ]);
  10065. }
  10066. }
  10067. state.pos = pos;
  10068. state.posMax = max;
  10069. return true;
  10070. };
  10071. /***/ }),
  10072. /* 71 */
  10073. /***/ (function(module, exports, __webpack_require__) {
  10074. "use strict";
  10075. // Process [link](<to> "stuff")
  10076. var normalizeReference = __webpack_require__(0).normalizeReference;
  10077. var isSpace = __webpack_require__(0).isSpace;
  10078. module.exports = function link(state, silent) {
  10079. var attrs,
  10080. code,
  10081. label,
  10082. labelEnd,
  10083. labelStart,
  10084. pos,
  10085. res,
  10086. ref,
  10087. title,
  10088. token,
  10089. href = '',
  10090. oldPos = state.pos,
  10091. max = state.posMax,
  10092. start = state.pos,
  10093. parseReference = true;
  10094. if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
  10095. labelStart = state.pos + 1;
  10096. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  10097. // parser failed to find ']', so it's not a valid link
  10098. if (labelEnd < 0) { return false; }
  10099. pos = labelEnd + 1;
  10100. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  10101. //
  10102. // Inline link
  10103. //
  10104. // might have found a valid shortcut link, disable reference parsing
  10105. parseReference = false;
  10106. // [link]( <href> "title" )
  10107. // ^^ skipping these spaces
  10108. pos++;
  10109. for (; pos < max; pos++) {
  10110. code = state.src.charCodeAt(pos);
  10111. if (!isSpace(code) && code !== 0x0A) { break; }
  10112. }
  10113. if (pos >= max) { return false; }
  10114. // [link]( <href> "title" )
  10115. // ^^^^^^ parsing link destination
  10116. start = pos;
  10117. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  10118. if (res.ok) {
  10119. href = state.md.normalizeLink(res.str);
  10120. if (state.md.validateLink(href)) {
  10121. pos = res.pos;
  10122. } else {
  10123. href = '';
  10124. }
  10125. }
  10126. // [link]( <href> "title" )
  10127. // ^^ skipping these spaces
  10128. start = pos;
  10129. for (; pos < max; pos++) {
  10130. code = state.src.charCodeAt(pos);
  10131. if (!isSpace(code) && code !== 0x0A) { break; }
  10132. }
  10133. // [link]( <href> "title" )
  10134. // ^^^^^^^ parsing link title
  10135. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  10136. if (pos < max && start !== pos && res.ok) {
  10137. title = res.str;
  10138. pos = res.pos;
  10139. // [link]( <href> "title" )
  10140. // ^^ skipping these spaces
  10141. for (; pos < max; pos++) {
  10142. code = state.src.charCodeAt(pos);
  10143. if (!isSpace(code) && code !== 0x0A) { break; }
  10144. }
  10145. } else {
  10146. title = '';
  10147. }
  10148. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  10149. // parsing a valid shortcut link failed, fallback to reference
  10150. parseReference = true;
  10151. }
  10152. pos++;
  10153. }
  10154. if (parseReference) {
  10155. //
  10156. // Link reference
  10157. //
  10158. if (typeof state.env.references === 'undefined') { return false; }
  10159. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  10160. start = pos + 1;
  10161. pos = state.md.helpers.parseLinkLabel(state, pos);
  10162. if (pos >= 0) {
  10163. label = state.src.slice(start, pos++);
  10164. } else {
  10165. pos = labelEnd + 1;
  10166. }
  10167. } else {
  10168. pos = labelEnd + 1;
  10169. }
  10170. // covers label === '' and label === undefined
  10171. // (collapsed reference link and shortcut reference link respectively)
  10172. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  10173. ref = state.env.references[normalizeReference(label)];
  10174. if (!ref) {
  10175. state.pos = oldPos;
  10176. return false;
  10177. }
  10178. href = ref.href;
  10179. title = ref.title;
  10180. }
  10181. //
  10182. // We found the end of the link, and know for a fact it's a valid link;
  10183. // so all that's left to do is to call tokenizer.
  10184. //
  10185. if (!silent) {
  10186. state.pos = labelStart;
  10187. state.posMax = labelEnd;
  10188. token = state.push('link_open', 'a', 1);
  10189. token.attrs = attrs = [ [ 'href', href ] ];
  10190. if (title) {
  10191. attrs.push([ 'title', title ]);
  10192. }
  10193. state.md.inline.tokenize(state);
  10194. token = state.push('link_close', 'a', -1);
  10195. }
  10196. state.pos = pos;
  10197. state.posMax = max;
  10198. return true;
  10199. };
  10200. /***/ }),
  10201. /* 72 */
  10202. /***/ (function(module, exports, __webpack_require__) {
  10203. "use strict";
  10204. // Proceess '\n'
  10205. var isSpace = __webpack_require__(0).isSpace;
  10206. module.exports = function newline(state, silent) {
  10207. var pmax, max, pos = state.pos;
  10208. if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
  10209. pmax = state.pending.length - 1;
  10210. max = state.posMax;
  10211. // ' \n' -> hardbreak
  10212. // Lookup in pending chars is bad practice! Don't copy to other rules!
  10213. // Pending string is stored in concat mode, indexed lookups will cause
  10214. // convertion to flat mode.
  10215. if (!silent) {
  10216. if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
  10217. if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
  10218. state.pending = state.pending.replace(/ +$/, '');
  10219. state.push('hardbreak', 'br', 0);
  10220. } else {
  10221. state.pending = state.pending.slice(0, -1);
  10222. state.push('softbreak', 'br', 0);
  10223. }
  10224. } else {
  10225. state.push('softbreak', 'br', 0);
  10226. }
  10227. }
  10228. pos++;
  10229. // skip heading spaces for next line
  10230. while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
  10231. state.pos = pos;
  10232. return true;
  10233. };
  10234. /***/ }),
  10235. /* 73 */
  10236. /***/ (function(module, exports, __webpack_require__) {
  10237. "use strict";
  10238. // Inline parser state
  10239. var Token = __webpack_require__(4);
  10240. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  10241. var isPunctChar = __webpack_require__(0).isPunctChar;
  10242. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  10243. function StateInline(src, md, env, outTokens) {
  10244. this.src = src;
  10245. this.env = env;
  10246. this.md = md;
  10247. this.tokens = outTokens;
  10248. this.pos = 0;
  10249. this.posMax = this.src.length;
  10250. this.level = 0;
  10251. this.pending = '';
  10252. this.pendingLevel = 0;
  10253. this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
  10254. // optimization of pairs parse (emphasis, strikes).
  10255. this.delimiters = []; // Emphasis-like delimiters
  10256. }
  10257. // Flush pending text
  10258. //
  10259. StateInline.prototype.pushPending = function () {
  10260. var token = new Token('text', '', 0);
  10261. token.content = this.pending;
  10262. token.level = this.pendingLevel;
  10263. this.tokens.push(token);
  10264. this.pending = '';
  10265. return token;
  10266. };
  10267. // Push new token to "stream".
  10268. // If pending text exists - flush it as text token
  10269. //
  10270. StateInline.prototype.push = function (type, tag, nesting) {
  10271. if (this.pending) {
  10272. this.pushPending();
  10273. }
  10274. var token = new Token(type, tag, nesting);
  10275. if (nesting < 0) { this.level--; }
  10276. token.level = this.level;
  10277. if (nesting > 0) { this.level++; }
  10278. this.pendingLevel = this.level;
  10279. this.tokens.push(token);
  10280. return token;
  10281. };
  10282. // Scan a sequence of emphasis-like markers, and determine whether
  10283. // it can start an emphasis sequence or end an emphasis sequence.
  10284. //
  10285. // - start - position to scan from (it should point at a valid marker);
  10286. // - canSplitWord - determine if these markers can be found inside a word
  10287. //
  10288. StateInline.prototype.scanDelims = function (start, canSplitWord) {
  10289. var pos = start, lastChar, nextChar, count, can_open, can_close,
  10290. isLastWhiteSpace, isLastPunctChar,
  10291. isNextWhiteSpace, isNextPunctChar,
  10292. left_flanking = true,
  10293. right_flanking = true,
  10294. max = this.posMax,
  10295. marker = this.src.charCodeAt(start);
  10296. // treat beginning of the line as a whitespace
  10297. lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
  10298. while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
  10299. count = pos - start;
  10300. // treat end of the line as a whitespace
  10301. nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
  10302. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  10303. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  10304. isLastWhiteSpace = isWhiteSpace(lastChar);
  10305. isNextWhiteSpace = isWhiteSpace(nextChar);
  10306. if (isNextWhiteSpace) {
  10307. left_flanking = false;
  10308. } else if (isNextPunctChar) {
  10309. if (!(isLastWhiteSpace || isLastPunctChar)) {
  10310. left_flanking = false;
  10311. }
  10312. }
  10313. if (isLastWhiteSpace) {
  10314. right_flanking = false;
  10315. } else if (isLastPunctChar) {
  10316. if (!(isNextWhiteSpace || isNextPunctChar)) {
  10317. right_flanking = false;
  10318. }
  10319. }
  10320. if (!canSplitWord) {
  10321. can_open = left_flanking && (!right_flanking || isLastPunctChar);
  10322. can_close = right_flanking && (!left_flanking || isNextPunctChar);
  10323. } else {
  10324. can_open = left_flanking;
  10325. can_close = right_flanking;
  10326. }
  10327. return {
  10328. can_open: can_open,
  10329. can_close: can_close,
  10330. length: count
  10331. };
  10332. };
  10333. // re-export Token class to use in block rules
  10334. StateInline.prototype.Token = Token;
  10335. module.exports = StateInline;
  10336. /***/ }),
  10337. /* 74 */
  10338. /***/ (function(module, exports, __webpack_require__) {
  10339. "use strict";
  10340. // Skip text characters for text token, place those to pending buffer
  10341. // and increment current pos
  10342. // Rule to skip pure text
  10343. // '{}$%@~+=:' reserved for extentions
  10344. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  10345. // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
  10346. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  10347. function isTerminatorChar(ch) {
  10348. switch (ch) {
  10349. case 0x0A/* \n */:
  10350. case 0x21/* ! */:
  10351. case 0x23/* # */:
  10352. case 0x24/* $ */:
  10353. case 0x25/* % */:
  10354. case 0x26/* & */:
  10355. case 0x2A/* * */:
  10356. case 0x2B/* + */:
  10357. case 0x2D/* - */:
  10358. case 0x3A/* : */:
  10359. case 0x3C/* < */:
  10360. case 0x3D/* = */:
  10361. case 0x3E/* > */:
  10362. case 0x40/* @ */:
  10363. case 0x5B/* [ */:
  10364. case 0x5C/* \ */:
  10365. case 0x5D/* ] */:
  10366. case 0x5E/* ^ */:
  10367. case 0x5F/* _ */:
  10368. case 0x60/* ` */:
  10369. case 0x7B/* { */:
  10370. case 0x7D/* } */:
  10371. case 0x7E/* ~ */:
  10372. return true;
  10373. default:
  10374. return false;
  10375. }
  10376. }
  10377. module.exports = function text(state, silent) {
  10378. var pos = state.pos;
  10379. while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
  10380. pos++;
  10381. }
  10382. if (pos === state.pos) { return false; }
  10383. if (!silent) { state.pending += state.src.slice(state.pos, pos); }
  10384. state.pos = pos;
  10385. return true;
  10386. };
  10387. // Alternative implementation, for memory.
  10388. //
  10389. // It costs 10% of performance, but allows extend terminators list, if place it
  10390. // to `ParcerInline` property. Probably, will switch to it sometime, such
  10391. // flexibility required.
  10392. /*
  10393. var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
  10394. module.exports = function text(state, silent) {
  10395. var pos = state.pos,
  10396. idx = state.src.slice(pos).search(TERMINATOR_RE);
  10397. // first char is terminator -> empty text
  10398. if (idx === 0) { return false; }
  10399. // no terminator -> text till end of string
  10400. if (idx < 0) {
  10401. if (!silent) { state.pending += state.src.slice(pos); }
  10402. state.pos = state.src.length;
  10403. return true;
  10404. }
  10405. if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
  10406. state.pos += idx;
  10407. return true;
  10408. };*/
  10409. /***/ }),
  10410. /* 75 */
  10411. /***/ (function(module, exports, __webpack_require__) {
  10412. "use strict";
  10413. // Merge adjacent text nodes into one, and re-calculate all token levels
  10414. //
  10415. module.exports = function text_collapse(state) {
  10416. var curr, last,
  10417. level = 0,
  10418. tokens = state.tokens,
  10419. max = state.tokens.length;
  10420. for (curr = last = 0; curr < max; curr++) {
  10421. // re-calculate levels
  10422. level += tokens[curr].nesting;
  10423. tokens[curr].level = level;
  10424. if (tokens[curr].type === 'text' &&
  10425. curr + 1 < max &&
  10426. tokens[curr + 1].type === 'text') {
  10427. // collapse two adjacent text nodes
  10428. tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
  10429. } else {
  10430. if (curr !== last) { tokens[last] = tokens[curr]; }
  10431. last++;
  10432. }
  10433. }
  10434. if (curr !== last) {
  10435. tokens.length = last;
  10436. }
  10437. };
  10438. /***/ }),
  10439. /* 76 */
  10440. /***/ (function(module, exports, __webpack_require__) {
  10441. "use strict";
  10442. /* eslint-disable no-bitwise */
  10443. var decodeCache = {};
  10444. function getDecodeCache(exclude) {
  10445. var i, ch, cache = decodeCache[exclude];
  10446. if (cache) { return cache; }
  10447. cache = decodeCache[exclude] = [];
  10448. for (i = 0; i < 128; i++) {
  10449. ch = String.fromCharCode(i);
  10450. cache.push(ch);
  10451. }
  10452. for (i = 0; i < exclude.length; i++) {
  10453. ch = exclude.charCodeAt(i);
  10454. cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
  10455. }
  10456. return cache;
  10457. }
  10458. // Decode percent-encoded string.
  10459. //
  10460. function decode(string, exclude) {
  10461. var cache;
  10462. if (typeof exclude !== 'string') {
  10463. exclude = decode.defaultChars;
  10464. }
  10465. cache = getDecodeCache(exclude);
  10466. return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
  10467. var i, l, b1, b2, b3, b4, chr,
  10468. result = '';
  10469. for (i = 0, l = seq.length; i < l; i += 3) {
  10470. b1 = parseInt(seq.slice(i + 1, i + 3), 16);
  10471. if (b1 < 0x80) {
  10472. result += cache[b1];
  10473. continue;
  10474. }
  10475. if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
  10476. // 110xxxxx 10xxxxxx
  10477. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10478. if ((b2 & 0xC0) === 0x80) {
  10479. chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
  10480. if (chr < 0x80) {
  10481. result += '\ufffd\ufffd';
  10482. } else {
  10483. result += String.fromCharCode(chr);
  10484. }
  10485. i += 3;
  10486. continue;
  10487. }
  10488. }
  10489. if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
  10490. // 1110xxxx 10xxxxxx 10xxxxxx
  10491. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10492. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10493. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  10494. chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
  10495. if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
  10496. result += '\ufffd\ufffd\ufffd';
  10497. } else {
  10498. result += String.fromCharCode(chr);
  10499. }
  10500. i += 6;
  10501. continue;
  10502. }
  10503. }
  10504. if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
  10505. // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
  10506. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10507. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10508. b4 = parseInt(seq.slice(i + 10, i + 12), 16);
  10509. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
  10510. chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
  10511. if (chr < 0x10000 || chr > 0x10FFFF) {
  10512. result += '\ufffd\ufffd\ufffd\ufffd';
  10513. } else {
  10514. chr -= 0x10000;
  10515. result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
  10516. }
  10517. i += 9;
  10518. continue;
  10519. }
  10520. }
  10521. result += '\ufffd';
  10522. }
  10523. return result;
  10524. });
  10525. }
  10526. decode.defaultChars = ';/?:@&=+$,#';
  10527. decode.componentChars = '';
  10528. module.exports = decode;
  10529. /***/ }),
  10530. /* 77 */
  10531. /***/ (function(module, exports, __webpack_require__) {
  10532. "use strict";
  10533. var encodeCache = {};
  10534. // Create a lookup array where anything but characters in `chars` string
  10535. // and alphanumeric chars is percent-encoded.
  10536. //
  10537. function getEncodeCache(exclude) {
  10538. var i, ch, cache = encodeCache[exclude];
  10539. if (cache) { return cache; }
  10540. cache = encodeCache[exclude] = [];
  10541. for (i = 0; i < 128; i++) {
  10542. ch = String.fromCharCode(i);
  10543. if (/^[0-9a-z]$/i.test(ch)) {
  10544. // always allow unencoded alphanumeric characters
  10545. cache.push(ch);
  10546. } else {
  10547. cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
  10548. }
  10549. }
  10550. for (i = 0; i < exclude.length; i++) {
  10551. cache[exclude.charCodeAt(i)] = exclude[i];
  10552. }
  10553. return cache;
  10554. }
  10555. // Encode unsafe characters with percent-encoding, skipping already
  10556. // encoded sequences.
  10557. //
  10558. // - string - string to encode
  10559. // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
  10560. // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
  10561. //
  10562. function encode(string, exclude, keepEscaped) {
  10563. var i, l, code, nextCode, cache,
  10564. result = '';
  10565. if (typeof exclude !== 'string') {
  10566. // encode(string, keepEscaped)
  10567. keepEscaped = exclude;
  10568. exclude = encode.defaultChars;
  10569. }
  10570. if (typeof keepEscaped === 'undefined') {
  10571. keepEscaped = true;
  10572. }
  10573. cache = getEncodeCache(exclude);
  10574. for (i = 0, l = string.length; i < l; i++) {
  10575. code = string.charCodeAt(i);
  10576. if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
  10577. if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
  10578. result += string.slice(i, i + 3);
  10579. i += 2;
  10580. continue;
  10581. }
  10582. }
  10583. if (code < 128) {
  10584. result += cache[code];
  10585. continue;
  10586. }
  10587. if (code >= 0xD800 && code <= 0xDFFF) {
  10588. if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
  10589. nextCode = string.charCodeAt(i + 1);
  10590. if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
  10591. result += encodeURIComponent(string[i] + string[i + 1]);
  10592. i++;
  10593. continue;
  10594. }
  10595. }
  10596. result += '%EF%BF%BD';
  10597. continue;
  10598. }
  10599. result += encodeURIComponent(string[i]);
  10600. }
  10601. return result;
  10602. }
  10603. encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
  10604. encode.componentChars = "-_.!~*'()";
  10605. module.exports = encode;
  10606. /***/ }),
  10607. /* 78 */
  10608. /***/ (function(module, exports, __webpack_require__) {
  10609. "use strict";
  10610. module.exports = function format(url) {
  10611. var result = '';
  10612. result += url.protocol || '';
  10613. result += url.slashes ? '//' : '';
  10614. result += url.auth ? url.auth + '@' : '';
  10615. if (url.hostname && url.hostname.indexOf(':') !== -1) {
  10616. // ipv6 address
  10617. result += '[' + url.hostname + ']';
  10618. } else {
  10619. result += url.hostname || '';
  10620. }
  10621. result += url.port ? ':' + url.port : '';
  10622. result += url.pathname || '';
  10623. result += url.search || '';
  10624. result += url.hash || '';
  10625. return result;
  10626. };
  10627. /***/ }),
  10628. /* 79 */
  10629. /***/ (function(module, exports, __webpack_require__) {
  10630. "use strict";
  10631. // Copyright Joyent, Inc. and other Node contributors.
  10632. //
  10633. // Permission is hereby granted, free of charge, to any person obtaining a
  10634. // copy of this software and associated documentation files (the
  10635. // "Software"), to deal in the Software without restriction, including
  10636. // without limitation the rights to use, copy, modify, merge, publish,
  10637. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10638. // persons to whom the Software is furnished to do so, subject to the
  10639. // following conditions:
  10640. //
  10641. // The above copyright notice and this permission notice shall be included
  10642. // in all copies or substantial portions of the Software.
  10643. //
  10644. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10645. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10646. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10647. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10648. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10649. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10650. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10651. //
  10652. // Changes from joyent/node:
  10653. //
  10654. // 1. No leading slash in paths,
  10655. // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
  10656. //
  10657. // 2. Backslashes are not replaced with slashes,
  10658. // so `http:\\example.org\` is treated like a relative path
  10659. //
  10660. // 3. Trailing colon is treated like a part of the path,
  10661. // i.e. in `http://example.org:foo` pathname is `:foo`
  10662. //
  10663. // 4. Nothing is URL-encoded in the resulting object,
  10664. // (in joyent/node some chars in auth and paths are encoded)
  10665. //
  10666. // 5. `url.parse()` does not have `parseQueryString` argument
  10667. //
  10668. // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
  10669. // which can be constructed using other parts of the url.
  10670. //
  10671. function Url() {
  10672. this.protocol = null;
  10673. this.slashes = null;
  10674. this.auth = null;
  10675. this.port = null;
  10676. this.hostname = null;
  10677. this.hash = null;
  10678. this.search = null;
  10679. this.pathname = null;
  10680. }
  10681. // Reference: RFC 3986, RFC 1808, RFC 2396
  10682. // define these here so at least they only have to be
  10683. // compiled once on the first module load.
  10684. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  10685. portPattern = /:[0-9]*$/,
  10686. // Special case for a simple path URL
  10687. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  10688. // RFC 2396: characters reserved for delimiting URLs.
  10689. // We actually just auto-escape these.
  10690. delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
  10691. // RFC 2396: characters not allowed for various reasons.
  10692. unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
  10693. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  10694. autoEscape = [ '\'' ].concat(unwise),
  10695. // Characters that are never ever allowed in a hostname.
  10696. // Note that any invalid chars are also handled, but these
  10697. // are the ones that are *expected* to be seen, so we fast-path
  10698. // them.
  10699. nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
  10700. hostEndingChars = [ '/', '?', '#' ],
  10701. hostnameMaxLen = 255,
  10702. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  10703. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  10704. // protocols that can allow "unsafe" and "unwise" chars.
  10705. /* eslint-disable no-script-url */
  10706. // protocols that never have a hostname.
  10707. hostlessProtocol = {
  10708. 'javascript': true,
  10709. 'javascript:': true
  10710. },
  10711. // protocols that always contain a // bit.
  10712. slashedProtocol = {
  10713. 'http': true,
  10714. 'https': true,
  10715. 'ftp': true,
  10716. 'gopher': true,
  10717. 'file': true,
  10718. 'http:': true,
  10719. 'https:': true,
  10720. 'ftp:': true,
  10721. 'gopher:': true,
  10722. 'file:': true
  10723. };
  10724. /* eslint-enable no-script-url */
  10725. function urlParse(url, slashesDenoteHost) {
  10726. if (url && url instanceof Url) { return url; }
  10727. var u = new Url();
  10728. u.parse(url, slashesDenoteHost);
  10729. return u;
  10730. }
  10731. Url.prototype.parse = function(url, slashesDenoteHost) {
  10732. var i, l, lowerProto, hec, slashes,
  10733. rest = url;
  10734. // trim before proceeding.
  10735. // This is to support parse stuff like " http://foo.com \n"
  10736. rest = rest.trim();
  10737. if (!slashesDenoteHost && url.split('#').length === 1) {
  10738. // Try fast path regexp
  10739. var simplePath = simplePathPattern.exec(rest);
  10740. if (simplePath) {
  10741. this.pathname = simplePath[1];
  10742. if (simplePath[2]) {
  10743. this.search = simplePath[2];
  10744. }
  10745. return this;
  10746. }
  10747. }
  10748. var proto = protocolPattern.exec(rest);
  10749. if (proto) {
  10750. proto = proto[0];
  10751. lowerProto = proto.toLowerCase();
  10752. this.protocol = proto;
  10753. rest = rest.substr(proto.length);
  10754. }
  10755. // figure out if it's got a host
  10756. // user@server is *always* interpreted as a hostname, and url
  10757. // resolution will treat //foo/bar as host=foo,path=bar because that's
  10758. // how the browser resolves relative URLs.
  10759. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  10760. slashes = rest.substr(0, 2) === '//';
  10761. if (slashes && !(proto && hostlessProtocol[proto])) {
  10762. rest = rest.substr(2);
  10763. this.slashes = true;
  10764. }
  10765. }
  10766. if (!hostlessProtocol[proto] &&
  10767. (slashes || (proto && !slashedProtocol[proto]))) {
  10768. // there's a hostname.
  10769. // the first instance of /, ?, ;, or # ends the host.
  10770. //
  10771. // If there is an @ in the hostname, then non-host chars *are* allowed
  10772. // to the left of the last @ sign, unless some host-ending character
  10773. // comes *before* the @-sign.
  10774. // URLs are obnoxious.
  10775. //
  10776. // ex:
  10777. // http://a@b@c/ => user:a@b host:c
  10778. // http://a@b?@c => user:a host:c path:/?@c
  10779. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  10780. // Review our test case against browsers more comprehensively.
  10781. // find the first instance of any hostEndingChars
  10782. var hostEnd = -1;
  10783. for (i = 0; i < hostEndingChars.length; i++) {
  10784. hec = rest.indexOf(hostEndingChars[i]);
  10785. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10786. hostEnd = hec;
  10787. }
  10788. }
  10789. // at this point, either we have an explicit point where the
  10790. // auth portion cannot go past, or the last @ char is the decider.
  10791. var auth, atSign;
  10792. if (hostEnd === -1) {
  10793. // atSign can be anywhere.
  10794. atSign = rest.lastIndexOf('@');
  10795. } else {
  10796. // atSign must be in auth portion.
  10797. // http://a@b/c@d => host:b auth:a path:/c@d
  10798. atSign = rest.lastIndexOf('@', hostEnd);
  10799. }
  10800. // Now we have a portion which is definitely the auth.
  10801. // Pull that off.
  10802. if (atSign !== -1) {
  10803. auth = rest.slice(0, atSign);
  10804. rest = rest.slice(atSign + 1);
  10805. this.auth = auth;
  10806. }
  10807. // the host is the remaining to the left of the first non-host char
  10808. hostEnd = -1;
  10809. for (i = 0; i < nonHostChars.length; i++) {
  10810. hec = rest.indexOf(nonHostChars[i]);
  10811. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10812. hostEnd = hec;
  10813. }
  10814. }
  10815. // if we still have not hit it, then the entire thing is a host.
  10816. if (hostEnd === -1) {
  10817. hostEnd = rest.length;
  10818. }
  10819. if (rest[hostEnd - 1] === ':') { hostEnd--; }
  10820. var host = rest.slice(0, hostEnd);
  10821. rest = rest.slice(hostEnd);
  10822. // pull out port.
  10823. this.parseHost(host);
  10824. // we've indicated that there is a hostname,
  10825. // so even if it's empty, it has to be present.
  10826. this.hostname = this.hostname || '';
  10827. // if hostname begins with [ and ends with ]
  10828. // assume that it's an IPv6 address.
  10829. var ipv6Hostname = this.hostname[0] === '[' &&
  10830. this.hostname[this.hostname.length - 1] === ']';
  10831. // validate a little.
  10832. if (!ipv6Hostname) {
  10833. var hostparts = this.hostname.split(/\./);
  10834. for (i = 0, l = hostparts.length; i < l; i++) {
  10835. var part = hostparts[i];
  10836. if (!part) { continue; }
  10837. if (!part.match(hostnamePartPattern)) {
  10838. var newpart = '';
  10839. for (var j = 0, k = part.length; j < k; j++) {
  10840. if (part.charCodeAt(j) > 127) {
  10841. // we replace non-ASCII char with a temporary placeholder
  10842. // we need this to make sure size of hostname is not
  10843. // broken by replacing non-ASCII by nothing
  10844. newpart += 'x';
  10845. } else {
  10846. newpart += part[j];
  10847. }
  10848. }
  10849. // we test again with ASCII char only
  10850. if (!newpart.match(hostnamePartPattern)) {
  10851. var validParts = hostparts.slice(0, i);
  10852. var notHost = hostparts.slice(i + 1);
  10853. var bit = part.match(hostnamePartStart);
  10854. if (bit) {
  10855. validParts.push(bit[1]);
  10856. notHost.unshift(bit[2]);
  10857. }
  10858. if (notHost.length) {
  10859. rest = notHost.join('.') + rest;
  10860. }
  10861. this.hostname = validParts.join('.');
  10862. break;
  10863. }
  10864. }
  10865. }
  10866. }
  10867. if (this.hostname.length > hostnameMaxLen) {
  10868. this.hostname = '';
  10869. }
  10870. // strip [ and ] from the hostname
  10871. // the host field still retains them, though
  10872. if (ipv6Hostname) {
  10873. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  10874. }
  10875. }
  10876. // chop off from the tail first.
  10877. var hash = rest.indexOf('#');
  10878. if (hash !== -1) {
  10879. // got a fragment string.
  10880. this.hash = rest.substr(hash);
  10881. rest = rest.slice(0, hash);
  10882. }
  10883. var qm = rest.indexOf('?');
  10884. if (qm !== -1) {
  10885. this.search = rest.substr(qm);
  10886. rest = rest.slice(0, qm);
  10887. }
  10888. if (rest) { this.pathname = rest; }
  10889. if (slashedProtocol[lowerProto] &&
  10890. this.hostname && !this.pathname) {
  10891. this.pathname = '';
  10892. }
  10893. return this;
  10894. };
  10895. Url.prototype.parseHost = function(host) {
  10896. var port = portPattern.exec(host);
  10897. if (port) {
  10898. port = port[0];
  10899. if (port !== ':') {
  10900. this.port = port.substr(1);
  10901. }
  10902. host = host.substr(0, host.length - port.length);
  10903. }
  10904. if (host) { this.hostname = host; }
  10905. };
  10906. module.exports = urlParse;
  10907. /***/ }),
  10908. /* 80 */
  10909. /***/ (function(module, exports) {
  10910. // shim for using process in browser
  10911. var process = module.exports = {};
  10912. // cached from whatever global is present so that test runners that stub it
  10913. // don't break things. But we need to wrap it in a try catch in case it is
  10914. // wrapped in strict mode code which doesn't define any globals. It's inside a
  10915. // function because try/catches deoptimize in certain engines.
  10916. var cachedSetTimeout;
  10917. var cachedClearTimeout;
  10918. function defaultSetTimout() {
  10919. throw new Error('setTimeout has not been defined');
  10920. }
  10921. function defaultClearTimeout () {
  10922. throw new Error('clearTimeout has not been defined');
  10923. }
  10924. (function () {
  10925. try {
  10926. if (typeof setTimeout === 'function') {
  10927. cachedSetTimeout = setTimeout;
  10928. } else {
  10929. cachedSetTimeout = defaultSetTimout;
  10930. }
  10931. } catch (e) {
  10932. cachedSetTimeout = defaultSetTimout;
  10933. }
  10934. try {
  10935. if (typeof clearTimeout === 'function') {
  10936. cachedClearTimeout = clearTimeout;
  10937. } else {
  10938. cachedClearTimeout = defaultClearTimeout;
  10939. }
  10940. } catch (e) {
  10941. cachedClearTimeout = defaultClearTimeout;
  10942. }
  10943. } ())
  10944. function runTimeout(fun) {
  10945. if (cachedSetTimeout === setTimeout) {
  10946. //normal enviroments in sane situations
  10947. return setTimeout(fun, 0);
  10948. }
  10949. // if setTimeout wasn't available but was latter defined
  10950. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  10951. cachedSetTimeout = setTimeout;
  10952. return setTimeout(fun, 0);
  10953. }
  10954. try {
  10955. // when when somebody has screwed with setTimeout but no I.E. maddness
  10956. return cachedSetTimeout(fun, 0);
  10957. } catch(e){
  10958. try {
  10959. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10960. return cachedSetTimeout.call(null, fun, 0);
  10961. } catch(e){
  10962. // 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
  10963. return cachedSetTimeout.call(this, fun, 0);
  10964. }
  10965. }
  10966. }
  10967. function runClearTimeout(marker) {
  10968. if (cachedClearTimeout === clearTimeout) {
  10969. //normal enviroments in sane situations
  10970. return clearTimeout(marker);
  10971. }
  10972. // if clearTimeout wasn't available but was latter defined
  10973. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  10974. cachedClearTimeout = clearTimeout;
  10975. return clearTimeout(marker);
  10976. }
  10977. try {
  10978. // when when somebody has screwed with setTimeout but no I.E. maddness
  10979. return cachedClearTimeout(marker);
  10980. } catch (e){
  10981. try {
  10982. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10983. return cachedClearTimeout.call(null, marker);
  10984. } catch (e){
  10985. // 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.
  10986. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  10987. return cachedClearTimeout.call(this, marker);
  10988. }
  10989. }
  10990. }
  10991. var queue = [];
  10992. var draining = false;
  10993. var currentQueue;
  10994. var queueIndex = -1;
  10995. function cleanUpNextTick() {
  10996. if (!draining || !currentQueue) {
  10997. return;
  10998. }
  10999. draining = false;
  11000. if (currentQueue.length) {
  11001. queue = currentQueue.concat(queue);
  11002. } else {
  11003. queueIndex = -1;
  11004. }
  11005. if (queue.length) {
  11006. drainQueue();
  11007. }
  11008. }
  11009. function drainQueue() {
  11010. if (draining) {
  11011. return;
  11012. }
  11013. var timeout = runTimeout(cleanUpNextTick);
  11014. draining = true;
  11015. var len = queue.length;
  11016. while(len) {
  11017. currentQueue = queue;
  11018. queue = [];
  11019. while (++queueIndex < len) {
  11020. if (currentQueue) {
  11021. currentQueue[queueIndex].run();
  11022. }
  11023. }
  11024. queueIndex = -1;
  11025. len = queue.length;
  11026. }
  11027. currentQueue = null;
  11028. draining = false;
  11029. runClearTimeout(timeout);
  11030. }
  11031. process.nextTick = function (fun) {
  11032. var args = new Array(arguments.length - 1);
  11033. if (arguments.length > 1) {
  11034. for (var i = 1; i < arguments.length; i++) {
  11035. args[i - 1] = arguments[i];
  11036. }
  11037. }
  11038. queue.push(new Item(fun, args));
  11039. if (queue.length === 1 && !draining) {
  11040. runTimeout(drainQueue);
  11041. }
  11042. };
  11043. // v8 likes predictible objects
  11044. function Item(fun, array) {
  11045. this.fun = fun;
  11046. this.array = array;
  11047. }
  11048. Item.prototype.run = function () {
  11049. this.fun.apply(null, this.array);
  11050. };
  11051. process.title = 'browser';
  11052. process.browser = true;
  11053. process.env = {};
  11054. process.argv = [];
  11055. process.version = ''; // empty string to avoid regexp issues
  11056. process.versions = {};
  11057. function noop() {}
  11058. process.on = noop;
  11059. process.addListener = noop;
  11060. process.once = noop;
  11061. process.off = noop;
  11062. process.removeListener = noop;
  11063. process.removeAllListeners = noop;
  11064. process.emit = noop;
  11065. process.binding = function (name) {
  11066. throw new Error('process.binding is not supported');
  11067. };
  11068. process.cwd = function () { return '/' };
  11069. process.chdir = function (dir) {
  11070. throw new Error('process.chdir is not supported');
  11071. };
  11072. process.umask = function() { return 0; };
  11073. /***/ }),
  11074. /* 81 */
  11075. /***/ (function(module, exports, __webpack_require__) {
  11076. /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  11077. ;(function(root) {
  11078. /** Detect free variables */
  11079. var freeExports = typeof exports == 'object' && exports &&
  11080. !exports.nodeType && exports;
  11081. var freeModule = typeof module == 'object' && module &&
  11082. !module.nodeType && module;
  11083. var freeGlobal = typeof global == 'object' && global;
  11084. if (
  11085. freeGlobal.global === freeGlobal ||
  11086. freeGlobal.window === freeGlobal ||
  11087. freeGlobal.self === freeGlobal
  11088. ) {
  11089. root = freeGlobal;
  11090. }
  11091. /**
  11092. * The `punycode` object.
  11093. * @name punycode
  11094. * @type Object
  11095. */
  11096. var punycode,
  11097. /** Highest positive signed 32-bit float value */
  11098. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  11099. /** Bootstring parameters */
  11100. base = 36,
  11101. tMin = 1,
  11102. tMax = 26,
  11103. skew = 38,
  11104. damp = 700,
  11105. initialBias = 72,
  11106. initialN = 128, // 0x80
  11107. delimiter = '-', // '\x2D'
  11108. /** Regular expressions */
  11109. regexPunycode = /^xn--/,
  11110. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  11111. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  11112. /** Error messages */
  11113. errors = {
  11114. 'overflow': 'Overflow: input needs wider integers to process',
  11115. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  11116. 'invalid-input': 'Invalid input'
  11117. },
  11118. /** Convenience shortcuts */
  11119. baseMinusTMin = base - tMin,
  11120. floor = Math.floor,
  11121. stringFromCharCode = String.fromCharCode,
  11122. /** Temporary variable */
  11123. key;
  11124. /*--------------------------------------------------------------------------*/
  11125. /**
  11126. * A generic error utility function.
  11127. * @private
  11128. * @param {String} type The error type.
  11129. * @returns {Error} Throws a `RangeError` with the applicable error message.
  11130. */
  11131. function error(type) {
  11132. throw new RangeError(errors[type]);
  11133. }
  11134. /**
  11135. * A generic `Array#map` utility function.
  11136. * @private
  11137. * @param {Array} array The array to iterate over.
  11138. * @param {Function} callback The function that gets called for every array
  11139. * item.
  11140. * @returns {Array} A new array of values returned by the callback function.
  11141. */
  11142. function map(array, fn) {
  11143. var length = array.length;
  11144. var result = [];
  11145. while (length--) {
  11146. result[length] = fn(array[length]);
  11147. }
  11148. return result;
  11149. }
  11150. /**
  11151. * A simple `Array#map`-like wrapper to work with domain name strings or email
  11152. * addresses.
  11153. * @private
  11154. * @param {String} domain The domain name or email address.
  11155. * @param {Function} callback The function that gets called for every
  11156. * character.
  11157. * @returns {Array} A new string of characters returned by the callback
  11158. * function.
  11159. */
  11160. function mapDomain(string, fn) {
  11161. var parts = string.split('@');
  11162. var result = '';
  11163. if (parts.length > 1) {
  11164. // In email addresses, only the domain name should be punycoded. Leave
  11165. // the local part (i.e. everything up to `@`) intact.
  11166. result = parts[0] + '@';
  11167. string = parts[1];
  11168. }
  11169. // Avoid `split(regex)` for IE8 compatibility. See #17.
  11170. string = string.replace(regexSeparators, '\x2E');
  11171. var labels = string.split('.');
  11172. var encoded = map(labels, fn).join('.');
  11173. return result + encoded;
  11174. }
  11175. /**
  11176. * Creates an array containing the numeric code points of each Unicode
  11177. * character in the string. While JavaScript uses UCS-2 internally,
  11178. * this function will convert a pair of surrogate halves (each of which
  11179. * UCS-2 exposes as separate characters) into a single code point,
  11180. * matching UTF-16.
  11181. * @see `punycode.ucs2.encode`
  11182. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11183. * @memberOf punycode.ucs2
  11184. * @name decode
  11185. * @param {String} string The Unicode input string (UCS-2).
  11186. * @returns {Array} The new array of code points.
  11187. */
  11188. function ucs2decode(string) {
  11189. var output = [],
  11190. counter = 0,
  11191. length = string.length,
  11192. value,
  11193. extra;
  11194. while (counter < length) {
  11195. value = string.charCodeAt(counter++);
  11196. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  11197. // high surrogate, and there is a next character
  11198. extra = string.charCodeAt(counter++);
  11199. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  11200. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  11201. } else {
  11202. // unmatched surrogate; only append this code unit, in case the next
  11203. // code unit is the high surrogate of a surrogate pair
  11204. output.push(value);
  11205. counter--;
  11206. }
  11207. } else {
  11208. output.push(value);
  11209. }
  11210. }
  11211. return output;
  11212. }
  11213. /**
  11214. * Creates a string based on an array of numeric code points.
  11215. * @see `punycode.ucs2.decode`
  11216. * @memberOf punycode.ucs2
  11217. * @name encode
  11218. * @param {Array} codePoints The array of numeric code points.
  11219. * @returns {String} The new Unicode string (UCS-2).
  11220. */
  11221. function ucs2encode(array) {
  11222. return map(array, function(value) {
  11223. var output = '';
  11224. if (value > 0xFFFF) {
  11225. value -= 0x10000;
  11226. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  11227. value = 0xDC00 | value & 0x3FF;
  11228. }
  11229. output += stringFromCharCode(value);
  11230. return output;
  11231. }).join('');
  11232. }
  11233. /**
  11234. * Converts a basic code point into a digit/integer.
  11235. * @see `digitToBasic()`
  11236. * @private
  11237. * @param {Number} codePoint The basic numeric code point value.
  11238. * @returns {Number} The numeric value of a basic code point (for use in
  11239. * representing integers) in the range `0` to `base - 1`, or `base` if
  11240. * the code point does not represent a value.
  11241. */
  11242. function basicToDigit(codePoint) {
  11243. if (codePoint - 48 < 10) {
  11244. return codePoint - 22;
  11245. }
  11246. if (codePoint - 65 < 26) {
  11247. return codePoint - 65;
  11248. }
  11249. if (codePoint - 97 < 26) {
  11250. return codePoint - 97;
  11251. }
  11252. return base;
  11253. }
  11254. /**
  11255. * Converts a digit/integer into a basic code point.
  11256. * @see `basicToDigit()`
  11257. * @private
  11258. * @param {Number} digit The numeric value of a basic code point.
  11259. * @returns {Number} The basic code point whose value (when used for
  11260. * representing integers) is `digit`, which needs to be in the range
  11261. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  11262. * used; else, the lowercase form is used. The behavior is undefined
  11263. * if `flag` is non-zero and `digit` has no uppercase form.
  11264. */
  11265. function digitToBasic(digit, flag) {
  11266. // 0..25 map to ASCII a..z or A..Z
  11267. // 26..35 map to ASCII 0..9
  11268. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  11269. }
  11270. /**
  11271. * Bias adaptation function as per section 3.4 of RFC 3492.
  11272. * https://tools.ietf.org/html/rfc3492#section-3.4
  11273. * @private
  11274. */
  11275. function adapt(delta, numPoints, firstTime) {
  11276. var k = 0;
  11277. delta = firstTime ? floor(delta / damp) : delta >> 1;
  11278. delta += floor(delta / numPoints);
  11279. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  11280. delta = floor(delta / baseMinusTMin);
  11281. }
  11282. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  11283. }
  11284. /**
  11285. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  11286. * symbols.
  11287. * @memberOf punycode
  11288. * @param {String} input The Punycode string of ASCII-only symbols.
  11289. * @returns {String} The resulting string of Unicode symbols.
  11290. */
  11291. function decode(input) {
  11292. // Don't use UCS-2
  11293. var output = [],
  11294. inputLength = input.length,
  11295. out,
  11296. i = 0,
  11297. n = initialN,
  11298. bias = initialBias,
  11299. basic,
  11300. j,
  11301. index,
  11302. oldi,
  11303. w,
  11304. k,
  11305. digit,
  11306. t,
  11307. /** Cached calculation results */
  11308. baseMinusT;
  11309. // Handle the basic code points: let `basic` be the number of input code
  11310. // points before the last delimiter, or `0` if there is none, then copy
  11311. // the first basic code points to the output.
  11312. basic = input.lastIndexOf(delimiter);
  11313. if (basic < 0) {
  11314. basic = 0;
  11315. }
  11316. for (j = 0; j < basic; ++j) {
  11317. // if it's not a basic code point
  11318. if (input.charCodeAt(j) >= 0x80) {
  11319. error('not-basic');
  11320. }
  11321. output.push(input.charCodeAt(j));
  11322. }
  11323. // Main decoding loop: start just after the last delimiter if any basic code
  11324. // points were copied; start at the beginning otherwise.
  11325. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  11326. // `index` is the index of the next character to be consumed.
  11327. // Decode a generalized variable-length integer into `delta`,
  11328. // which gets added to `i`. The overflow checking is easier
  11329. // if we increase `i` as we go, then subtract off its starting
  11330. // value at the end to obtain `delta`.
  11331. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  11332. if (index >= inputLength) {
  11333. error('invalid-input');
  11334. }
  11335. digit = basicToDigit(input.charCodeAt(index++));
  11336. if (digit >= base || digit > floor((maxInt - i) / w)) {
  11337. error('overflow');
  11338. }
  11339. i += digit * w;
  11340. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11341. if (digit < t) {
  11342. break;
  11343. }
  11344. baseMinusT = base - t;
  11345. if (w > floor(maxInt / baseMinusT)) {
  11346. error('overflow');
  11347. }
  11348. w *= baseMinusT;
  11349. }
  11350. out = output.length + 1;
  11351. bias = adapt(i - oldi, out, oldi == 0);
  11352. // `i` was supposed to wrap around from `out` to `0`,
  11353. // incrementing `n` each time, so we'll fix that now:
  11354. if (floor(i / out) > maxInt - n) {
  11355. error('overflow');
  11356. }
  11357. n += floor(i / out);
  11358. i %= out;
  11359. // Insert `n` at position `i` of the output
  11360. output.splice(i++, 0, n);
  11361. }
  11362. return ucs2encode(output);
  11363. }
  11364. /**
  11365. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  11366. * Punycode string of ASCII-only symbols.
  11367. * @memberOf punycode
  11368. * @param {String} input The string of Unicode symbols.
  11369. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  11370. */
  11371. function encode(input) {
  11372. var n,
  11373. delta,
  11374. handledCPCount,
  11375. basicLength,
  11376. bias,
  11377. j,
  11378. m,
  11379. q,
  11380. k,
  11381. t,
  11382. currentValue,
  11383. output = [],
  11384. /** `inputLength` will hold the number of code points in `input`. */
  11385. inputLength,
  11386. /** Cached calculation results */
  11387. handledCPCountPlusOne,
  11388. baseMinusT,
  11389. qMinusT;
  11390. // Convert the input in UCS-2 to Unicode
  11391. input = ucs2decode(input);
  11392. // Cache the length
  11393. inputLength = input.length;
  11394. // Initialize the state
  11395. n = initialN;
  11396. delta = 0;
  11397. bias = initialBias;
  11398. // Handle the basic code points
  11399. for (j = 0; j < inputLength; ++j) {
  11400. currentValue = input[j];
  11401. if (currentValue < 0x80) {
  11402. output.push(stringFromCharCode(currentValue));
  11403. }
  11404. }
  11405. handledCPCount = basicLength = output.length;
  11406. // `handledCPCount` is the number of code points that have been handled;
  11407. // `basicLength` is the number of basic code points.
  11408. // Finish the basic string - if it is not empty - with a delimiter
  11409. if (basicLength) {
  11410. output.push(delimiter);
  11411. }
  11412. // Main encoding loop:
  11413. while (handledCPCount < inputLength) {
  11414. // All non-basic code points < n have been handled already. Find the next
  11415. // larger one:
  11416. for (m = maxInt, j = 0; j < inputLength; ++j) {
  11417. currentValue = input[j];
  11418. if (currentValue >= n && currentValue < m) {
  11419. m = currentValue;
  11420. }
  11421. }
  11422. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  11423. // but guard against overflow
  11424. handledCPCountPlusOne = handledCPCount + 1;
  11425. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  11426. error('overflow');
  11427. }
  11428. delta += (m - n) * handledCPCountPlusOne;
  11429. n = m;
  11430. for (j = 0; j < inputLength; ++j) {
  11431. currentValue = input[j];
  11432. if (currentValue < n && ++delta > maxInt) {
  11433. error('overflow');
  11434. }
  11435. if (currentValue == n) {
  11436. // Represent delta as a generalized variable-length integer
  11437. for (q = delta, k = base; /* no condition */; k += base) {
  11438. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11439. if (q < t) {
  11440. break;
  11441. }
  11442. qMinusT = q - t;
  11443. baseMinusT = base - t;
  11444. output.push(
  11445. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  11446. );
  11447. q = floor(qMinusT / baseMinusT);
  11448. }
  11449. output.push(stringFromCharCode(digitToBasic(q, 0)));
  11450. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  11451. delta = 0;
  11452. ++handledCPCount;
  11453. }
  11454. }
  11455. ++delta;
  11456. ++n;
  11457. }
  11458. return output.join('');
  11459. }
  11460. /**
  11461. * Converts a Punycode string representing a domain name or an email address
  11462. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  11463. * it doesn't matter if you call it on a string that has already been
  11464. * converted to Unicode.
  11465. * @memberOf punycode
  11466. * @param {String} input The Punycoded domain name or email address to
  11467. * convert to Unicode.
  11468. * @returns {String} The Unicode representation of the given Punycode
  11469. * string.
  11470. */
  11471. function toUnicode(input) {
  11472. return mapDomain(input, function(string) {
  11473. return regexPunycode.test(string)
  11474. ? decode(string.slice(4).toLowerCase())
  11475. : string;
  11476. });
  11477. }
  11478. /**
  11479. * Converts a Unicode string representing a domain name or an email address to
  11480. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  11481. * i.e. it doesn't matter if you call it with a domain that's already in
  11482. * ASCII.
  11483. * @memberOf punycode
  11484. * @param {String} input The domain name or email address to convert, as a
  11485. * Unicode string.
  11486. * @returns {String} The Punycode representation of the given domain name or
  11487. * email address.
  11488. */
  11489. function toASCII(input) {
  11490. return mapDomain(input, function(string) {
  11491. return regexNonASCII.test(string)
  11492. ? 'xn--' + encode(string)
  11493. : string;
  11494. });
  11495. }
  11496. /*--------------------------------------------------------------------------*/
  11497. /** Define the public API */
  11498. punycode = {
  11499. /**
  11500. * A string representing the current Punycode.js version number.
  11501. * @memberOf punycode
  11502. * @type String
  11503. */
  11504. 'version': '1.4.1',
  11505. /**
  11506. * An object of methods to convert from JavaScript's internal character
  11507. * representation (UCS-2) to Unicode code points, and back.
  11508. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11509. * @memberOf punycode
  11510. * @type Object
  11511. */
  11512. 'ucs2': {
  11513. 'decode': ucs2decode,
  11514. 'encode': ucs2encode
  11515. },
  11516. 'decode': decode,
  11517. 'encode': encode,
  11518. 'toASCII': toASCII,
  11519. 'toUnicode': toUnicode
  11520. };
  11521. /** Expose `punycode` */
  11522. // Some AMD build optimizers, like r.js, check for specific condition patterns
  11523. // like the following:
  11524. if (
  11525. true
  11526. ) {
  11527. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11528. return punycode;
  11529. }.call(exports, __webpack_require__, exports, module),
  11530. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11531. } else if (freeExports && freeModule) {
  11532. if (module.exports == freeExports) {
  11533. // in Node.js, io.js, or RingoJS v0.8.0+
  11534. freeModule.exports = punycode;
  11535. } else {
  11536. // in Narwhal or RingoJS v0.7.0-
  11537. for (key in punycode) {
  11538. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  11539. }
  11540. }
  11541. } else {
  11542. // in Rhino or a web browser
  11543. root.punycode = punycode;
  11544. }
  11545. }(this));
  11546. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module), __webpack_require__(6)))
  11547. /***/ }),
  11548. /* 82 */
  11549. /***/ (function(module, exports, __webpack_require__) {
  11550. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  11551. "use strict";
  11552. if (global.setImmediate) {
  11553. return;
  11554. }
  11555. var nextHandle = 1; // Spec says greater than zero
  11556. var tasksByHandle = {};
  11557. var currentlyRunningATask = false;
  11558. var doc = global.document;
  11559. var registerImmediate;
  11560. function setImmediate(callback) {
  11561. // Callback can either be a function or a string
  11562. if (typeof callback !== "function") {
  11563. callback = new Function("" + callback);
  11564. }
  11565. // Copy function arguments
  11566. var args = new Array(arguments.length - 1);
  11567. for (var i = 0; i < args.length; i++) {
  11568. args[i] = arguments[i + 1];
  11569. }
  11570. // Store and register the task
  11571. var task = { callback: callback, args: args };
  11572. tasksByHandle[nextHandle] = task;
  11573. registerImmediate(nextHandle);
  11574. return nextHandle++;
  11575. }
  11576. function clearImmediate(handle) {
  11577. delete tasksByHandle[handle];
  11578. }
  11579. function run(task) {
  11580. var callback = task.callback;
  11581. var args = task.args;
  11582. switch (args.length) {
  11583. case 0:
  11584. callback();
  11585. break;
  11586. case 1:
  11587. callback(args[0]);
  11588. break;
  11589. case 2:
  11590. callback(args[0], args[1]);
  11591. break;
  11592. case 3:
  11593. callback(args[0], args[1], args[2]);
  11594. break;
  11595. default:
  11596. callback.apply(undefined, args);
  11597. break;
  11598. }
  11599. }
  11600. function runIfPresent(handle) {
  11601. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  11602. // So if we're currently running a task, we'll need to delay this invocation.
  11603. if (currentlyRunningATask) {
  11604. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  11605. // "too much recursion" error.
  11606. setTimeout(runIfPresent, 0, handle);
  11607. } else {
  11608. var task = tasksByHandle[handle];
  11609. if (task) {
  11610. currentlyRunningATask = true;
  11611. try {
  11612. run(task);
  11613. } finally {
  11614. clearImmediate(handle);
  11615. currentlyRunningATask = false;
  11616. }
  11617. }
  11618. }
  11619. }
  11620. function installNextTickImplementation() {
  11621. registerImmediate = function(handle) {
  11622. process.nextTick(function () { runIfPresent(handle); });
  11623. };
  11624. }
  11625. function canUsePostMessage() {
  11626. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  11627. // where `global.postMessage` means something completely different and can't be used for this purpose.
  11628. if (global.postMessage && !global.importScripts) {
  11629. var postMessageIsAsynchronous = true;
  11630. var oldOnMessage = global.onmessage;
  11631. global.onmessage = function() {
  11632. postMessageIsAsynchronous = false;
  11633. };
  11634. global.postMessage("", "*");
  11635. global.onmessage = oldOnMessage;
  11636. return postMessageIsAsynchronous;
  11637. }
  11638. }
  11639. function installPostMessageImplementation() {
  11640. // Installs an event handler on `global` for the `message` event: see
  11641. // * https://developer.mozilla.org/en/DOM/window.postMessage
  11642. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  11643. var messagePrefix = "setImmediate$" + Math.random() + "$";
  11644. var onGlobalMessage = function(event) {
  11645. if (event.source === global &&
  11646. typeof event.data === "string" &&
  11647. event.data.indexOf(messagePrefix) === 0) {
  11648. runIfPresent(+event.data.slice(messagePrefix.length));
  11649. }
  11650. };
  11651. if (global.addEventListener) {
  11652. global.addEventListener("message", onGlobalMessage, false);
  11653. } else {
  11654. global.attachEvent("onmessage", onGlobalMessage);
  11655. }
  11656. registerImmediate = function(handle) {
  11657. global.postMessage(messagePrefix + handle, "*");
  11658. };
  11659. }
  11660. function installMessageChannelImplementation() {
  11661. var channel = new MessageChannel();
  11662. channel.port1.onmessage = function(event) {
  11663. var handle = event.data;
  11664. runIfPresent(handle);
  11665. };
  11666. registerImmediate = function(handle) {
  11667. channel.port2.postMessage(handle);
  11668. };
  11669. }
  11670. function installReadyStateChangeImplementation() {
  11671. var html = doc.documentElement;
  11672. registerImmediate = function(handle) {
  11673. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  11674. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  11675. var script = doc.createElement("script");
  11676. script.onreadystatechange = function () {
  11677. runIfPresent(handle);
  11678. script.onreadystatechange = null;
  11679. html.removeChild(script);
  11680. script = null;
  11681. };
  11682. html.appendChild(script);
  11683. };
  11684. }
  11685. function installSetTimeoutImplementation() {
  11686. registerImmediate = function(handle) {
  11687. setTimeout(runIfPresent, 0, handle);
  11688. };
  11689. }
  11690. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  11691. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  11692. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  11693. // Don't get fooled by e.g. browserify environments.
  11694. if ({}.toString.call(global.process) === "[object process]") {
  11695. // For Node.js before 0.9
  11696. installNextTickImplementation();
  11697. } else if (canUsePostMessage()) {
  11698. // For non-IE10 modern browsers
  11699. installPostMessageImplementation();
  11700. } else if (global.MessageChannel) {
  11701. // For web workers, where supported
  11702. installMessageChannelImplementation();
  11703. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  11704. // For IE 6–8
  11705. installReadyStateChangeImplementation();
  11706. } else {
  11707. // For older browsers
  11708. installSetTimeoutImplementation();
  11709. }
  11710. attachTo.setImmediate = setImmediate;
  11711. attachTo.clearImmediate = clearImmediate;
  11712. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  11713. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(80)))
  11714. /***/ }),
  11715. /* 83 */
  11716. /***/ (function(module, exports, __webpack_require__) {
  11717. var apply = Function.prototype.apply;
  11718. // DOM APIs, for completeness
  11719. exports.setTimeout = function() {
  11720. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  11721. };
  11722. exports.setInterval = function() {
  11723. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  11724. };
  11725. exports.clearTimeout =
  11726. exports.clearInterval = function(timeout) {
  11727. if (timeout) {
  11728. timeout.close();
  11729. }
  11730. };
  11731. function Timeout(id, clearFn) {
  11732. this._id = id;
  11733. this._clearFn = clearFn;
  11734. }
  11735. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  11736. Timeout.prototype.close = function() {
  11737. this._clearFn.call(window, this._id);
  11738. };
  11739. // Does not start the time, just sets up the members needed.
  11740. exports.enroll = function(item, msecs) {
  11741. clearTimeout(item._idleTimeoutId);
  11742. item._idleTimeout = msecs;
  11743. };
  11744. exports.unenroll = function(item) {
  11745. clearTimeout(item._idleTimeoutId);
  11746. item._idleTimeout = -1;
  11747. };
  11748. exports._unrefActive = exports.active = function(item) {
  11749. clearTimeout(item._idleTimeoutId);
  11750. var msecs = item._idleTimeout;
  11751. if (msecs >= 0) {
  11752. item._idleTimeoutId = setTimeout(function onTimeout() {
  11753. if (item._onTimeout)
  11754. item._onTimeout();
  11755. }, msecs);
  11756. }
  11757. };
  11758. // setimmediate attaches itself to the global object
  11759. __webpack_require__(82);
  11760. exports.setImmediate = setImmediate;
  11761. exports.clearImmediate = clearImmediate;
  11762. /***/ }),
  11763. /* 84 */
  11764. /***/ (function(module, exports) {
  11765. 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]/
  11766. /***/ }),
  11767. /* 85 */
  11768. /***/ (function(module, exports, __webpack_require__) {
  11769. "use strict";
  11770. exports.Any = __webpack_require__(18);
  11771. exports.Cc = __webpack_require__(16);
  11772. exports.Cf = __webpack_require__(84);
  11773. exports.P = __webpack_require__(5);
  11774. exports.Z = __webpack_require__(17);
  11775. /***/ }),
  11776. /* 86 */
  11777. /***/ (function(module, exports) {
  11778. module.exports = function(module) {
  11779. if(!module.webpackPolyfill) {
  11780. module.deprecate = function() {};
  11781. module.paths = [];
  11782. // module.parent = undefined by default
  11783. if(!module.children) module.children = [];
  11784. Object.defineProperty(module, "loaded", {
  11785. enumerable: true,
  11786. get: function() {
  11787. return module.l;
  11788. }
  11789. });
  11790. Object.defineProperty(module, "id", {
  11791. enumerable: true,
  11792. get: function() {
  11793. return module.i;
  11794. }
  11795. });
  11796. module.webpackPolyfill = 1;
  11797. }
  11798. return module;
  11799. };
  11800. /***/ }),
  11801. /* 87 */
  11802. /***/ (function(module, exports, __webpack_require__) {
  11803. __webpack_require__(19);
  11804. module.exports = __webpack_require__(20);
  11805. /***/ })
  11806. /******/ ]);
  11807. //# sourceMappingURL=main.js.map