| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661 |
- /*! For license information please see timeline.js.LICENSE.txt */
- var TL;
- ( () => {
- var t = {
- 838: function(t) {
- t.exports = function() {
- "use strict";
- const {entries: t, setPrototypeOf: e, isFrozen: i, getPrototypeOf: a, getOwnPropertyDescriptor: s} = Object;
- let {freeze: n, seal: o, create: r} = Object
- , {apply: l, construct: h} = "undefined" != typeof Reflect && Reflect;
- n || (n = function(t) {
- return t
- }
- ),
- o || (o = function(t) {
- return t
- }
- ),
- l || (l = function(t, e, i) {
- return t.apply(e, i)
- }
- ),
- h || (h = function(t, e) {
- return new t(...e)
- }
- );
- const d = x(Array.prototype.forEach)
- , c = x(Array.prototype.pop)
- , u = x(Array.prototype.push)
- , m = x(String.prototype.toLowerCase)
- , _ = x(String.prototype.toString)
- , p = x(String.prototype.match)
- , f = x(String.prototype.replace)
- , g = x(String.prototype.indexOf)
- , v = x(String.prototype.trim)
- , y = x(Object.prototype.hasOwnProperty)
- , b = x(RegExp.prototype.test)
- , w = (k = TypeError,
- function() {
- for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)
- e[i] = arguments[i];
- return h(k, e)
- }
- );
- var k;
- function x(t) {
- return function(e) {
- for (var i = arguments.length, a = new Array(i > 1 ? i - 1 : 0), s = 1; s < i; s++)
- a[s - 1] = arguments[s];
- return l(t, e, a)
- }
- }
- function T(t, a) {
- let s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : m;
- e && e(t, null);
- let n = a.length;
- for (; n--; ) {
- let e = a[n];
- if ("string" == typeof e) {
- const t = s(e);
- t !== e && (i(a) || (a[n] = t),
- e = t)
- }
- t[e] = !0
- }
- return t
- }
- function M(t) {
- for (let e = 0; e < t.length; e++)
- y(t, e) || (t[e] = null);
- return t
- }
- function E(e) {
- const i = r(null);
- for (const [a,s] of t(e))
- y(e, a) && (Array.isArray(s) ? i[a] = M(s) : s && "object" == typeof s && s.constructor === Object ? i[a] = E(s) : i[a] = s);
- return i
- }
- function L(t, e) {
- for (; null !== t; ) {
- const i = s(t, e);
- if (i) {
- if (i.get)
- return x(i.get);
- if ("function" == typeof i.value)
- return x(i.value)
- }
- t = a(t)
- }
- return function() {
- return null
- }
- }
- const D = n(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"])
- , S = n(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"])
- , N = n(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"])
- , A = n(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"])
- , C = n(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"])
- , I = n(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"])
- , O = n(["#text"])
- , R = n(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"])
- , j = n(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"])
- , P = n(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"])
- , z = n(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"])
- , H = o(/\{\{[\w\W]*|[\w\W]*\}\}/gm)
- , F = o(/<%[\w\W]*|[\w\W]*%>/gm)
- , q = o(/\${[\w\W]*}/gm)
- , $ = o(/^data-[\-\w.\u00B7-\uFFFF]/)
- , U = o(/^aria-[\-\w]+$/)
- , B = o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i)
- , W = o(/^(?:\w+script|data):/i)
- , G = o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g)
- , Y = o(/^html$/i)
- , Z = o(/^[a-z][.\w]*(-[.\w]+)+$/i);
- var V = Object.freeze({
- __proto__: null,
- MUSTACHE_EXPR: H,
- ERB_EXPR: F,
- TMPLIT_EXPR: q,
- DATA_ATTR: $,
- ARIA_ATTR: U,
- IS_ALLOWED_URI: B,
- IS_SCRIPT_OR_DATA: W,
- ATTR_WHITESPACE: G,
- DOCTYPE_NAME: Y,
- CUSTOM_ELEMENT: Z
- });
- const X = 1
- , J = 3
- , K = 7
- , Q = 8
- , tt = 9
- , et = function() {
- return "undefined" == typeof window ? null : window
- };
- return function e() {
- let i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : et();
- const a = t => e(t);
- if (a.version = "3.1.7",
- a.removed = [],
- !i || !i.document || i.document.nodeType !== tt)
- return a.isSupported = !1,
- a;
- let {document: s} = i;
- const o = s
- , l = o.currentScript
- , {DocumentFragment: h, HTMLTemplateElement: k, Node: x, Element: M, NodeFilter: H, NamedNodeMap: F=i.NamedNodeMap || i.MozNamedAttrMap, HTMLFormElement: q, DOMParser: $, trustedTypes: U} = i
- , W = M.prototype
- , G = L(W, "cloneNode")
- , Z = L(W, "remove")
- , it = L(W, "nextSibling")
- , at = L(W, "childNodes")
- , st = L(W, "parentNode");
- if ("function" == typeof k) {
- const t = s.createElement("template");
- t.content && t.content.ownerDocument && (s = t.content.ownerDocument)
- }
- let nt, ot = "";
- const {implementation: rt, createNodeIterator: lt, createDocumentFragment: ht, getElementsByTagName: dt} = s
- , {importNode: ct} = o;
- let ut = {};
- a.isSupported = "function" == typeof t && "function" == typeof st && rt && void 0 !== rt.createHTMLDocument;
- const {MUSTACHE_EXPR: mt, ERB_EXPR: _t, TMPLIT_EXPR: pt, DATA_ATTR: ft, ARIA_ATTR: gt, IS_SCRIPT_OR_DATA: vt, ATTR_WHITESPACE: yt, CUSTOM_ELEMENT: bt} = V;
- let {IS_ALLOWED_URI: wt} = V
- , kt = null;
- const xt = T({}, [...D, ...S, ...N, ...C, ...O]);
- let Tt = null;
- const Mt = T({}, [...R, ...j, ...P, ...z]);
- let Et = Object.seal(r(null, {
- tagNameCheck: {
- writable: !0,
- configurable: !1,
- enumerable: !0,
- value: null
- },
- attributeNameCheck: {
- writable: !0,
- configurable: !1,
- enumerable: !0,
- value: null
- },
- allowCustomizedBuiltInElements: {
- writable: !0,
- configurable: !1,
- enumerable: !0,
- value: !1
- }
- }))
- , Lt = null
- , Dt = null
- , St = !0
- , Nt = !0
- , At = !1
- , Ct = !0
- , It = !1
- , Ot = !0
- , Rt = !1
- , jt = !1
- , Pt = !1
- , zt = !1
- , Ht = !1
- , Ft = !1
- , qt = !0
- , $t = !1
- , Ut = !0
- , Bt = !1
- , Wt = {}
- , Gt = null;
- const Yt = T({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
- let Zt = null;
- const Vt = T({}, ["audio", "video", "img", "source", "image", "track"]);
- let Xt = null;
- const Jt = T({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"])
- , Kt = "http://www.w3.org/1998/Math/MathML"
- , Qt = "http://www.w3.org/2000/svg"
- , te = "http://www.w3.org/1999/xhtml";
- let ee = te
- , ie = !1
- , ae = null;
- const se = T({}, [Kt, Qt, te], _);
- let ne = null;
- const oe = ["application/xhtml+xml", "text/html"];
- let re = null
- , le = null;
- const he = s.createElement("form")
- , de = function(t) {
- return t instanceof RegExp || t instanceof Function
- }
- , ce = function() {
- let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- if (!le || le !== t) {
- if (t && "object" == typeof t || (t = {}),
- t = E(t),
- ne = -1 === oe.indexOf(t.PARSER_MEDIA_TYPE) ? "text/html" : t.PARSER_MEDIA_TYPE,
- re = "application/xhtml+xml" === ne ? _ : m,
- kt = y(t, "ALLOWED_TAGS") ? T({}, t.ALLOWED_TAGS, re) : xt,
- Tt = y(t, "ALLOWED_ATTR") ? T({}, t.ALLOWED_ATTR, re) : Mt,
- ae = y(t, "ALLOWED_NAMESPACES") ? T({}, t.ALLOWED_NAMESPACES, _) : se,
- Xt = y(t, "ADD_URI_SAFE_ATTR") ? T(E(Jt), t.ADD_URI_SAFE_ATTR, re) : Jt,
- Zt = y(t, "ADD_DATA_URI_TAGS") ? T(E(Vt), t.ADD_DATA_URI_TAGS, re) : Vt,
- Gt = y(t, "FORBID_CONTENTS") ? T({}, t.FORBID_CONTENTS, re) : Yt,
- Lt = y(t, "FORBID_TAGS") ? T({}, t.FORBID_TAGS, re) : {},
- Dt = y(t, "FORBID_ATTR") ? T({}, t.FORBID_ATTR, re) : {},
- Wt = !!y(t, "USE_PROFILES") && t.USE_PROFILES,
- St = !1 !== t.ALLOW_ARIA_ATTR,
- Nt = !1 !== t.ALLOW_DATA_ATTR,
- At = t.ALLOW_UNKNOWN_PROTOCOLS || !1,
- Ct = !1 !== t.ALLOW_SELF_CLOSE_IN_ATTR,
- It = t.SAFE_FOR_TEMPLATES || !1,
- Ot = !1 !== t.SAFE_FOR_XML,
- Rt = t.WHOLE_DOCUMENT || !1,
- zt = t.RETURN_DOM || !1,
- Ht = t.RETURN_DOM_FRAGMENT || !1,
- Ft = t.RETURN_TRUSTED_TYPE || !1,
- Pt = t.FORCE_BODY || !1,
- qt = !1 !== t.SANITIZE_DOM,
- $t = t.SANITIZE_NAMED_PROPS || !1,
- Ut = !1 !== t.KEEP_CONTENT,
- Bt = t.IN_PLACE || !1,
- wt = t.ALLOWED_URI_REGEXP || B,
- ee = t.NAMESPACE || te,
- Et = t.CUSTOM_ELEMENT_HANDLING || {},
- t.CUSTOM_ELEMENT_HANDLING && de(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Et.tagNameCheck = t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
- t.CUSTOM_ELEMENT_HANDLING && de(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Et.attributeNameCheck = t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),
- t.CUSTOM_ELEMENT_HANDLING && "boolean" == typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (Et.allowCustomizedBuiltInElements = t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),
- It && (Nt = !1),
- Ht && (zt = !0),
- Wt && (kt = T({}, O),
- Tt = [],
- !0 === Wt.html && (T(kt, D),
- T(Tt, R)),
- !0 === Wt.svg && (T(kt, S),
- T(Tt, j),
- T(Tt, z)),
- !0 === Wt.svgFilters && (T(kt, N),
- T(Tt, j),
- T(Tt, z)),
- !0 === Wt.mathMl && (T(kt, C),
- T(Tt, P),
- T(Tt, z))),
- t.ADD_TAGS && (kt === xt && (kt = E(kt)),
- T(kt, t.ADD_TAGS, re)),
- t.ADD_ATTR && (Tt === Mt && (Tt = E(Tt)),
- T(Tt, t.ADD_ATTR, re)),
- t.ADD_URI_SAFE_ATTR && T(Xt, t.ADD_URI_SAFE_ATTR, re),
- t.FORBID_CONTENTS && (Gt === Yt && (Gt = E(Gt)),
- T(Gt, t.FORBID_CONTENTS, re)),
- Ut && (kt["#text"] = !0),
- Rt && T(kt, ["html", "head", "body"]),
- kt.table && (T(kt, ["tbody"]),
- delete Lt.tbody),
- t.TRUSTED_TYPES_POLICY) {
- if ("function" != typeof t.TRUSTED_TYPES_POLICY.createHTML)
- throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
- if ("function" != typeof t.TRUSTED_TYPES_POLICY.createScriptURL)
- throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
- nt = t.TRUSTED_TYPES_POLICY,
- ot = nt.createHTML("")
- } else
- void 0 === nt && (nt = function(t, e) {
- if ("object" != typeof t || "function" != typeof t.createPolicy)
- return null;
- let i = null;
- const a = "data-tt-policy-suffix";
- e && e.hasAttribute(a) && (i = e.getAttribute(a));
- const s = "dompurify" + (i ? "#" + i : "");
- try {
- return t.createPolicy(s, {
- createHTML: t => t,
- createScriptURL: t => t
- })
- } catch (t) {
- return console.warn("TrustedTypes policy " + s + " could not be created."),
- null
- }
- }(U, l)),
- null !== nt && "string" == typeof ot && (ot = nt.createHTML(""));
- n && n(t),
- le = t
- }
- }
- , ue = T({}, ["mi", "mo", "mn", "ms", "mtext"])
- , me = T({}, ["annotation-xml"])
- , _e = T({}, ["title", "style", "font", "a", "script"])
- , pe = T({}, [...S, ...N, ...A])
- , fe = T({}, [...C, ...I])
- , ge = function(t) {
- u(a.removed, {
- element: t
- });
- try {
- st(t).removeChild(t)
- } catch (e) {
- Z(t)
- }
- }
- , ve = function(t, e) {
- try {
- u(a.removed, {
- attribute: e.getAttributeNode(t),
- from: e
- })
- } catch (t) {
- u(a.removed, {
- attribute: null,
- from: e
- })
- }
- if (e.removeAttribute(t),
- "is" === t && !Tt[t])
- if (zt || Ht)
- try {
- ge(e)
- } catch (t) {}
- else
- try {
- e.setAttribute(t, "")
- } catch (t) {}
- }
- , ye = function(t) {
- let e = null
- , i = null;
- if (Pt)
- t = "<remove></remove>" + t;
- else {
- const e = p(t, /^[\r\n\t ]+/);
- i = e && e[0]
- }
- "application/xhtml+xml" === ne && ee === te && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
- const a = nt ? nt.createHTML(t) : t;
- if (ee === te)
- try {
- e = (new $).parseFromString(a, ne)
- } catch (t) {}
- if (!e || !e.documentElement) {
- e = rt.createDocument(ee, "template", null);
- try {
- e.documentElement.innerHTML = ie ? ot : a
- } catch (t) {}
- }
- const n = e.body || e.documentElement;
- return t && i && n.insertBefore(s.createTextNode(i), n.childNodes[0] || null),
- ee === te ? dt.call(e, Rt ? "html" : "body")[0] : Rt ? e.documentElement : n
- }
- , be = function(t) {
- return lt.call(t.ownerDocument || t, t, H.SHOW_ELEMENT | H.SHOW_COMMENT | H.SHOW_TEXT | H.SHOW_PROCESSING_INSTRUCTION | H.SHOW_CDATA_SECTION, null)
- }
- , we = function(t) {
- return t instanceof q && ("string" != typeof t.nodeName || "string" != typeof t.textContent || "function" != typeof t.removeChild || !(t.attributes instanceof F) || "function" != typeof t.removeAttribute || "function" != typeof t.setAttribute || "string" != typeof t.namespaceURI || "function" != typeof t.insertBefore || "function" != typeof t.hasChildNodes)
- }
- , ke = function(t) {
- return "function" == typeof x && t instanceof x
- }
- , xe = function(t, e, i) {
- ut[t] && d(ut[t], (t => {
- t.call(a, e, i, le)
- }
- ))
- }
- , Te = function(t) {
- let e = null;
- if (xe("beforeSanitizeElements", t, null),
- we(t))
- return ge(t),
- !0;
- const i = re(t.nodeName);
- if (xe("uponSanitizeElement", t, {
- tagName: i,
- allowedTags: kt
- }),
- t.hasChildNodes() && !ke(t.firstElementChild) && b(/<[/\w]/g, t.innerHTML) && b(/<[/\w]/g, t.textContent))
- return ge(t),
- !0;
- if (t.nodeType === K)
- return ge(t),
- !0;
- if (Ot && t.nodeType === Q && b(/<[/\w]/g, t.data))
- return ge(t),
- !0;
- if (!kt[i] || Lt[i]) {
- if (!Lt[i] && Ee(i)) {
- if (Et.tagNameCheck instanceof RegExp && b(Et.tagNameCheck, i))
- return !1;
- if (Et.tagNameCheck instanceof Function && Et.tagNameCheck(i))
- return !1
- }
- if (Ut && !Gt[i]) {
- const e = st(t) || t.parentNode
- , i = at(t) || t.childNodes;
- if (i && e)
- for (let a = i.length - 1; a >= 0; --a) {
- const s = G(i[a], !0);
- s.__removalCount = (t.__removalCount || 0) + 1,
- e.insertBefore(s, it(t))
- }
- }
- return ge(t),
- !0
- }
- return t instanceof M && !function(t) {
- let e = st(t);
- e && e.tagName || (e = {
- namespaceURI: ee,
- tagName: "template"
- });
- const i = m(t.tagName)
- , a = m(e.tagName);
- return !!ae[t.namespaceURI] && (t.namespaceURI === Qt ? e.namespaceURI === te ? "svg" === i : e.namespaceURI === Kt ? "svg" === i && ("annotation-xml" === a || ue[a]) : Boolean(pe[i]) : t.namespaceURI === Kt ? e.namespaceURI === te ? "math" === i : e.namespaceURI === Qt ? "math" === i && me[a] : Boolean(fe[i]) : t.namespaceURI === te ? !(e.namespaceURI === Qt && !me[a]) && !(e.namespaceURI === Kt && !ue[a]) && !fe[i] && (_e[i] || !pe[i]) : !("application/xhtml+xml" !== ne || !ae[t.namespaceURI]))
- }(t) ? (ge(t),
- !0) : "noscript" !== i && "noembed" !== i && "noframes" !== i || !b(/<\/no(script|embed|frames)/i, t.innerHTML) ? (It && t.nodeType === J && (e = t.textContent,
- d([mt, _t, pt], (t => {
- e = f(e, t, " ")
- }
- )),
- t.textContent !== e && (u(a.removed, {
- element: t.cloneNode()
- }),
- t.textContent = e)),
- xe("afterSanitizeElements", t, null),
- !1) : (ge(t),
- !0)
- }
- , Me = function(t, e, i) {
- if (qt && ("id" === e || "name" === e) && (i in s || i in he))
- return !1;
- if (Nt && !Dt[e] && b(ft, e))
- ;
- else if (St && b(gt, e))
- ;
- else if (!Tt[e] || Dt[e]) {
- if (!(Ee(t) && (Et.tagNameCheck instanceof RegExp && b(Et.tagNameCheck, t) || Et.tagNameCheck instanceof Function && Et.tagNameCheck(t)) && (Et.attributeNameCheck instanceof RegExp && b(Et.attributeNameCheck, e) || Et.attributeNameCheck instanceof Function && Et.attributeNameCheck(e)) || "is" === e && Et.allowCustomizedBuiltInElements && (Et.tagNameCheck instanceof RegExp && b(Et.tagNameCheck, i) || Et.tagNameCheck instanceof Function && Et.tagNameCheck(i))))
- return !1
- } else if (Xt[e])
- ;
- else if (b(wt, f(i, yt, "")))
- ;
- else if ("src" !== e && "xlink:href" !== e && "href" !== e || "script" === t || 0 !== g(i, "data:") || !Zt[t])
- if (At && !b(vt, f(i, yt, "")))
- ;
- else if (i)
- return !1;
- return !0
- }
- , Ee = function(t) {
- return "annotation-xml" !== t && p(t, bt)
- }
- , Le = function(t) {
- xe("beforeSanitizeAttributes", t, null);
- const {attributes: e} = t;
- if (!e)
- return;
- const i = {
- attrName: "",
- attrValue: "",
- keepAttr: !0,
- allowedAttributes: Tt
- };
- let s = e.length;
- for (; s--; ) {
- const n = e[s]
- , {name: o, namespaceURI: r, value: l} = n
- , h = re(o);
- let u = "value" === o ? l : v(l);
- if (i.attrName = h,
- i.attrValue = u,
- i.keepAttr = !0,
- i.forceKeepAttr = void 0,
- xe("uponSanitizeAttribute", t, i),
- u = i.attrValue,
- i.forceKeepAttr)
- continue;
- if (ve(o, t),
- !i.keepAttr)
- continue;
- if (!Ct && b(/\/>/i, u)) {
- ve(o, t);
- continue
- }
- It && d([mt, _t, pt], (t => {
- u = f(u, t, " ")
- }
- ));
- const m = re(t.nodeName);
- if (Me(m, h, u))
- if (!$t || "id" !== h && "name" !== h || (ve(o, t),
- u = "user-content-" + u),
- Ot && b(/((--!?|])>)|<\/(style|title)/i, u))
- ve(o, t);
- else {
- if (nt && "object" == typeof U && "function" == typeof U.getAttributeType)
- if (r)
- ;
- else
- switch (U.getAttributeType(m, h)) {
- case "TrustedHTML":
- u = nt.createHTML(u);
- break;
- case "TrustedScriptURL":
- u = nt.createScriptURL(u)
- }
- try {
- r ? t.setAttributeNS(r, o, u) : t.setAttribute(o, u),
- we(t) ? ge(t) : c(a.removed)
- } catch (t) {}
- }
- }
- xe("afterSanitizeAttributes", t, null)
- }
- , De = function t(e) {
- let i = null;
- const a = be(e);
- for (xe("beforeSanitizeShadowDOM", e, null); i = a.nextNode(); )
- xe("uponSanitizeShadowNode", i, null),
- Te(i) || (i.content instanceof h && t(i.content),
- Le(i));
- xe("afterSanitizeShadowDOM", e, null)
- };
- return a.sanitize = function(t) {
- let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
- , i = null
- , s = null
- , n = null
- , r = null;
- if (ie = !t,
- ie && (t = "\x3c!--\x3e"),
- "string" != typeof t && !ke(t)) {
- if ("function" != typeof t.toString)
- throw w("toString is not a function");
- if ("string" != typeof (t = t.toString()))
- throw w("dirty is not a string, aborting")
- }
- if (!a.isSupported)
- return t;
- if (jt || ce(e),
- a.removed = [],
- "string" == typeof t && (Bt = !1),
- Bt) {
- if (t.nodeName) {
- const e = re(t.nodeName);
- if (!kt[e] || Lt[e])
- throw w("root node is forbidden and cannot be sanitized in-place")
- }
- } else if (t instanceof x)
- i = ye("\x3c!----\x3e"),
- s = i.ownerDocument.importNode(t, !0),
- s.nodeType === X && "BODY" === s.nodeName || "HTML" === s.nodeName ? i = s : i.appendChild(s);
- else {
- if (!zt && !It && !Rt && -1 === t.indexOf("<"))
- return nt && Ft ? nt.createHTML(t) : t;
- if (i = ye(t),
- !i)
- return zt ? null : Ft ? ot : ""
- }
- i && Pt && ge(i.firstChild);
- const l = be(Bt ? t : i);
- for (; n = l.nextNode(); )
- Te(n) || (n.content instanceof h && De(n.content),
- Le(n));
- if (Bt)
- return t;
- if (zt) {
- if (Ht)
- for (r = ht.call(i.ownerDocument); i.firstChild; )
- r.appendChild(i.firstChild);
- else
- r = i;
- return (Tt.shadowroot || Tt.shadowrootmode) && (r = ct.call(o, r, !0)),
- r
- }
- let c = Rt ? i.outerHTML : i.innerHTML;
- return Rt && kt["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && b(Y, i.ownerDocument.doctype.name) && (c = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + c),
- It && d([mt, _t, pt], (t => {
- c = f(c, t, " ")
- }
- )),
- nt && Ft ? nt.createHTML(c) : c
- }
- ,
- a.setConfig = function() {
- ce(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}),
- jt = !0
- }
- ,
- a.clearConfig = function() {
- le = null,
- jt = !1
- }
- ,
- a.isValidAttribute = function(t, e, i) {
- le || ce({});
- const a = re(t)
- , s = re(e);
- return Me(a, s, i)
- }
- ,
- a.addHook = function(t, e) {
- "function" == typeof e && (ut[t] = ut[t] || [],
- u(ut[t], e))
- }
- ,
- a.removeHook = function(t) {
- if (ut[t])
- return c(ut[t])
- }
- ,
- a.removeHooks = function(t) {
- ut[t] && (ut[t] = [])
- }
- ,
- a.removeAllHooks = function() {
- ut = {}
- }
- ,
- a
- }()
- }()
- },
- 142: () => {
- var t = function() {
- function t(t, e) {
- for (var i = 0; i < e.length; i++) {
- var a = e[i];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- "value"in a && (a.writable = !0),
- Object.defineProperty(t, a.key, a)
- }
- }
- return function(e, i, a) {
- return i && t(e.prototype, i),
- a && t(e, a),
- e
- }
- }();
- function e(t, e) {
- if (!(t instanceof e))
- throw new TypeError("Cannot call a class as a function")
- }
- !function() {
- if ("undefined" != typeof window) {
- var i = Array.prototype.slice
- , a = Element.prototype.matches || Element.prototype.msMatchesSelector
- , s = ["a[href]", "area[href]", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", "button:not([disabled])", "details", "summary", "iframe", "object", "embed", "[contenteditable]"].join(",")
- , n = function() {
- function n(t, i) {
- e(this, n),
- this._inertManager = i,
- this._rootElement = t,
- this._managedNodes = new Set,
- this._rootElement.hasAttribute("aria-hidden") ? this._savedAriaHidden = this._rootElement.getAttribute("aria-hidden") : this._savedAriaHidden = null,
- this._rootElement.setAttribute("aria-hidden", "true"),
- this._makeSubtreeUnfocusable(this._rootElement),
- this._observer = new MutationObserver(this._onMutation.bind(this)),
- this._observer.observe(this._rootElement, {
- attributes: !0,
- childList: !0,
- subtree: !0
- })
- }
- return t(n, [{
- key: "destructor",
- value: function() {
- this._observer.disconnect(),
- this._rootElement && (null !== this._savedAriaHidden ? this._rootElement.setAttribute("aria-hidden", this._savedAriaHidden) : this._rootElement.removeAttribute("aria-hidden")),
- this._managedNodes.forEach((function(t) {
- this._unmanageNode(t.node)
- }
- ), this),
- this._observer = null,
- this._rootElement = null,
- this._managedNodes = null,
- this._inertManager = null
- }
- }, {
- key: "_makeSubtreeUnfocusable",
- value: function(t) {
- var e = this;
- h(t, (function(t) {
- return e._visitNode(t)
- }
- ));
- var i = document.activeElement;
- if (!document.body.contains(t)) {
- for (var a = t, s = void 0; a; ) {
- if (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- s = a;
- break
- }
- a = a.parentNode
- }
- s && (i = s.activeElement)
- }
- t.contains(i) && (i.blur(),
- i === document.activeElement && document.body.focus())
- }
- }, {
- key: "_visitNode",
- value: function(t) {
- if (t.nodeType === Node.ELEMENT_NODE) {
- var e = t;
- e !== this._rootElement && e.hasAttribute("inert") && this._adoptInertRoot(e),
- (a.call(e, s) || e.hasAttribute("tabindex")) && this._manageNode(e)
- }
- }
- }, {
- key: "_manageNode",
- value: function(t) {
- var e = this._inertManager.register(t, this);
- this._managedNodes.add(e)
- }
- }, {
- key: "_unmanageNode",
- value: function(t) {
- var e = this._inertManager.deregister(t, this);
- e && this._managedNodes.delete(e)
- }
- }, {
- key: "_unmanageSubtree",
- value: function(t) {
- var e = this;
- h(t, (function(t) {
- return e._unmanageNode(t)
- }
- ))
- }
- }, {
- key: "_adoptInertRoot",
- value: function(t) {
- var e = this._inertManager.getInertRoot(t);
- e || (this._inertManager.setInert(t, !0),
- e = this._inertManager.getInertRoot(t)),
- e.managedNodes.forEach((function(t) {
- this._manageNode(t.node)
- }
- ), this)
- }
- }, {
- key: "_onMutation",
- value: function(t, e) {
- t.forEach((function(t) {
- var e = t.target;
- if ("childList" === t.type)
- i.call(t.addedNodes).forEach((function(t) {
- this._makeSubtreeUnfocusable(t)
- }
- ), this),
- i.call(t.removedNodes).forEach((function(t) {
- this._unmanageSubtree(t)
- }
- ), this);
- else if ("attributes" === t.type)
- if ("tabindex" === t.attributeName)
- this._manageNode(e);
- else if (e !== this._rootElement && "inert" === t.attributeName && e.hasAttribute("inert")) {
- this._adoptInertRoot(e);
- var a = this._inertManager.getInertRoot(e);
- this._managedNodes.forEach((function(t) {
- e.contains(t.node) && a._manageNode(t.node)
- }
- ))
- }
- }
- ), this)
- }
- }, {
- key: "managedNodes",
- get: function() {
- return new Set(this._managedNodes)
- }
- }, {
- key: "hasSavedAriaHidden",
- get: function() {
- return null !== this._savedAriaHidden
- }
- }, {
- key: "savedAriaHidden",
- set: function(t) {
- this._savedAriaHidden = t
- },
- get: function() {
- return this._savedAriaHidden
- }
- }]),
- n
- }()
- , o = function() {
- function i(t, a) {
- e(this, i),
- this._node = t,
- this._overrodeFocusMethod = !1,
- this._inertRoots = new Set([a]),
- this._savedTabIndex = null,
- this._destroyed = !1,
- this.ensureUntabbable()
- }
- return t(i, [{
- key: "destructor",
- value: function() {
- if (this._throwIfDestroyed(),
- this._node && this._node.nodeType === Node.ELEMENT_NODE) {
- var t = this._node;
- null !== this._savedTabIndex ? t.setAttribute("tabindex", this._savedTabIndex) : t.removeAttribute("tabindex"),
- this._overrodeFocusMethod && delete t.focus
- }
- this._node = null,
- this._inertRoots = null,
- this._destroyed = !0
- }
- }, {
- key: "_throwIfDestroyed",
- value: function() {
- if (this.destroyed)
- throw new Error("Trying to access destroyed InertNode")
- }
- }, {
- key: "ensureUntabbable",
- value: function() {
- if (this.node.nodeType === Node.ELEMENT_NODE) {
- var t = this.node;
- if (a.call(t, s)) {
- if (-1 === t.tabIndex && this.hasSavedTabIndex)
- return;
- t.hasAttribute("tabindex") && (this._savedTabIndex = t.tabIndex),
- t.setAttribute("tabindex", "-1"),
- t.nodeType === Node.ELEMENT_NODE && (t.focus = function() {}
- ,
- this._overrodeFocusMethod = !0)
- } else
- t.hasAttribute("tabindex") && (this._savedTabIndex = t.tabIndex,
- t.removeAttribute("tabindex"))
- }
- }
- }, {
- key: "addInertRoot",
- value: function(t) {
- this._throwIfDestroyed(),
- this._inertRoots.add(t)
- }
- }, {
- key: "removeInertRoot",
- value: function(t) {
- this._throwIfDestroyed(),
- this._inertRoots.delete(t),
- 0 === this._inertRoots.size && this.destructor()
- }
- }, {
- key: "destroyed",
- get: function() {
- return this._destroyed
- }
- }, {
- key: "hasSavedTabIndex",
- get: function() {
- return null !== this._savedTabIndex
- }
- }, {
- key: "node",
- get: function() {
- return this._throwIfDestroyed(),
- this._node
- }
- }, {
- key: "savedTabIndex",
- set: function(t) {
- this._throwIfDestroyed(),
- this._savedTabIndex = t
- },
- get: function() {
- return this._throwIfDestroyed(),
- this._savedTabIndex
- }
- }]),
- i
- }()
- , r = function() {
- function s(t) {
- if (e(this, s),
- !t)
- throw new Error("Missing required argument; InertManager needs to wrap a document.");
- this._document = t,
- this._managedNodes = new Map,
- this._inertRoots = new Map,
- this._observer = new MutationObserver(this._watchForInert.bind(this)),
- d(t.head || t.body || t.documentElement),
- "loading" === t.readyState ? t.addEventListener("DOMContentLoaded", this._onDocumentLoaded.bind(this)) : this._onDocumentLoaded()
- }
- return t(s, [{
- key: "setInert",
- value: function(t, e) {
- if (e) {
- if (this._inertRoots.has(t))
- return;
- var i = new n(t,this);
- if (t.setAttribute("inert", ""),
- this._inertRoots.set(t, i),
- !this._document.body.contains(t))
- for (var a = t.parentNode; a; )
- 11 === a.nodeType && d(a),
- a = a.parentNode
- } else {
- if (!this._inertRoots.has(t))
- return;
- this._inertRoots.get(t).destructor(),
- this._inertRoots.delete(t),
- t.removeAttribute("inert")
- }
- }
- }, {
- key: "getInertRoot",
- value: function(t) {
- return this._inertRoots.get(t)
- }
- }, {
- key: "register",
- value: function(t, e) {
- var i = this._managedNodes.get(t);
- return void 0 !== i ? i.addInertRoot(e) : i = new o(t,e),
- this._managedNodes.set(t, i),
- i
- }
- }, {
- key: "deregister",
- value: function(t, e) {
- var i = this._managedNodes.get(t);
- return i ? (i.removeInertRoot(e),
- i.destroyed && this._managedNodes.delete(t),
- i) : null
- }
- }, {
- key: "_onDocumentLoaded",
- value: function() {
- i.call(this._document.querySelectorAll("[inert]")).forEach((function(t) {
- this.setInert(t, !0)
- }
- ), this),
- this._observer.observe(this._document.body || this._document.documentElement, {
- attributes: !0,
- subtree: !0,
- childList: !0
- })
- }
- }, {
- key: "_watchForInert",
- value: function(t, e) {
- var s = this;
- t.forEach((function(t) {
- switch (t.type) {
- case "childList":
- i.call(t.addedNodes).forEach((function(t) {
- if (t.nodeType === Node.ELEMENT_NODE) {
- var e = i.call(t.querySelectorAll("[inert]"));
- a.call(t, "[inert]") && e.unshift(t),
- e.forEach((function(t) {
- this.setInert(t, !0)
- }
- ), s)
- }
- }
- ), s);
- break;
- case "attributes":
- if ("inert" !== t.attributeName)
- return;
- var e = t.target
- , n = e.hasAttribute("inert");
- s.setInert(e, n)
- }
- }
- ), this)
- }
- }]),
- s
- }();
- if (!HTMLElement.prototype.hasOwnProperty("inert")) {
- var l = new r(document);
- Object.defineProperty(HTMLElement.prototype, "inert", {
- enumerable: !0,
- get: function() {
- return this.hasAttribute("inert")
- },
- set: function(t) {
- l.setInert(this, t)
- }
- })
- }
- }
- function h(t, e, i) {
- if (t.nodeType == Node.ELEMENT_NODE) {
- var a = t;
- e && e(a);
- var s = a.shadowRoot;
- if (s)
- return void h(s, e, s);
- if ("content" == a.localName) {
- for (var n = a, o = n.getDistributedNodes ? n.getDistributedNodes() : [], r = 0; r < o.length; r++)
- h(o[r], e, i);
- return
- }
- if ("slot" == a.localName) {
- for (var l = a, d = l.assignedNodes ? l.assignedNodes({
- flatten: !0
- }) : [], c = 0; c < d.length; c++)
- h(d[c], e, i);
- return
- }
- }
- for (var u = t.firstChild; null != u; )
- h(u, e, i),
- u = u.nextSibling
- }
- function d(t) {
- if (!t.querySelector("style#inert-style, link#inert-style")) {
- var e = document.createElement("style");
- e.setAttribute("id", "inert-style"),
- e.textContent = "\n[inert] {\n pointer-events: none;\n cursor: default;\n}\n\n[inert], [inert] * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n",
- t.appendChild(e)
- }
- }
- }()
- }
- }
- , e = {};
- function i(a) {
- var s = e[a];
- if (void 0 !== s)
- return s.exports;
- var n = e[a] = {
- exports: {}
- };
- return t[a].call(n.exports, n, n.exports, i),
- n.exports
- }
- i.n = t => {
- var e = t && t.__esModule ? () => t.default : () => t;
- return i.d(e, {
- a: e
- }),
- e
- }
- ,
- i.d = (t, e) => {
- for (var a in e)
- i.o(e, a) && !i.o(t, a) && Object.defineProperty(t, a, {
- enumerable: !0,
- get: e[a]
- })
- }
- ,
- i.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e),
- i.r = t => {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
- value: "Module"
- }),
- Object.defineProperty(t, "__esModule", {
- value: !0
- })
- }
- ;
- var a = {};
- ( () => {
- "use strict";
- i.r(a),
- i.d(a, {
- Timeline: () => Xe,
- exportJSON: () => Je,
- lookupMediaType: () => qe,
- parseGoogleSpreadsheetURL: () => Kt
- });
- const t = navigator ? navigator.userAgent.toLowerCase() : "no-user-agent-specified"
- , e = document ? document.documentElement : null
- , s = !!t && -1 !== t.indexOf("phantom")
- , o = window && "ActiveXObject"in window
- , r = (Boolean(o && t.match(/MSIE 9/i)),
- o && document && document.addEventListener,
- -1 !== t.indexOf("webkit"))
- , l = (t.indexOf("android"),
- -1 !== t.search("android [23]"))
- , h = !!window && void 0 !== window.orientation
- , d = !(!navigator || !window) && navigator.msPointerEnabled && navigator.msMaxTouchPoints && !window.PointerEvent
- , c = navigator && window ? window.PointerEvent && navigator.pointerEnabled && navigator.maxTouchPoints : d
- , u = !!window && window.opera
- , m = (t.indexOf("gecko"),
- -1 !== t.indexOf("gecko") && !r && !u && !o)
- , _ = (t.indexOf("chrome"),
- -1 !== t.indexOf("edge/"));
- !!e && o && e.style,
- !!window && "WebKitCSSMatrix"in window && new window.WebKitCSSMatrix,
- !!e && e.style,
- !!e && e.style;
- window && window.L_DISABLE_3D,
- h && window.opera;
- let p = !!window && "devicePixelRatio"in window && window.devicePixelRatio > 1;
- if (!p && window && "matchMedia"in window) {
- let t = window.matchMedia("(min-resolution:144dpi)");
- p = t && t.matches
- }
- const f = window && !window.L_NO_TOUCH && !s && (c || "ontouchstart"in window || window.DocumentTouch && document instanceof window.DocumentTouch);
- function g(t) {
- return "string" == typeof t ? document.getElementById(t) : t
- }
- function v(t, e, i) {
- var a = document.createElement(t);
- return a.className = e,
- i && i.appendChild(a),
- a
- }
- function y(t, e) {
- var i = v("button", t, e);
- return i.type = "button",
- i
- }
- function b(t) {
- for (var e = {
- x: 0,
- y: 0
- }; t && !isNaN(t.offsetLeft) && !isNaN(t.offsetTop); )
- e.x += t.offsetLeft,
- e.y += t.offsetTop,
- t = t.offsetParent;
- return e
- }
- function w(t) {
- for (var e = document.documentElement.style, i = 0; i < t.length; i++)
- if (t[i]in e)
- return t[i];
- return !1
- }
- w(["transition", "webkitTransition", "OTransition", "MozTransition", "msTransition"]),
- w(["transformProperty", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]);
- class x extends Error {
- constructor(t, e) {
- super(),
- this.name = "TLError",
- this.message = t || "error",
- this.message_key = this.message,
- this.detail = e || ""
- }
- }
- const T = {
- aliceblue: "#f0f8ff",
- antiquewhite: "#faebd7",
- aqua: "#00ffff",
- aquamarine: "#7fffd4",
- azure: "#f0ffff",
- beige: "#f5f5dc",
- bisque: "#ffe4c4",
- black: "#000000",
- blanchedalmond: "#ffebcd",
- blue: "#0000ff",
- blueviolet: "#8a2be2",
- brown: "#a52a2a",
- burlywood: "#deb887",
- cadetblue: "#5f9ea0",
- chartreuse: "#7fff00",
- chocolate: "#d2691e",
- coral: "#ff7f50",
- cornflowerblue: "#6495ed",
- cornsilk: "#fff8dc",
- crimson: "#dc143c",
- cyan: "#00ffff",
- darkblue: "#00008b",
- darkcyan: "#008b8b",
- darkgoldenrod: "#b8860b",
- darkgray: "#a9a9a9",
- darkgreen: "#006400",
- darkkhaki: "#bdb76b",
- darkmagenta: "#8b008b",
- darkolivegreen: "#556b2f",
- darkorange: "#ff8c00",
- darkorchid: "#9932cc",
- darkred: "#8b0000",
- darksalmon: "#e9967a",
- darkseagreen: "#8fbc8f",
- darkslateblue: "#483d8b",
- darkslategray: "#2f4f4f",
- darkturquoise: "#00ced1",
- darkviolet: "#9400d3",
- deeppink: "#ff1493",
- deepskyblue: "#00bfff",
- dimgray: "#696969",
- dodgerblue: "#1e90ff",
- firebrick: "#b22222",
- floralwhite: "#fffaf0",
- forestgreen: "#228b22",
- fuchsia: "#ff00ff",
- gainsboro: "#dcdcdc",
- ghostwhite: "#f8f8ff",
- gold: "#ffd700",
- goldenrod: "#daa520",
- gray: "#808080",
- green: "#008000",
- greenyellow: "#adff2f",
- honeydew: "#f0fff0",
- hotpink: "#ff69b4",
- indianred: "#cd5c5c",
- indigo: "#4b0082",
- ivory: "#fffff0",
- khaki: "#f0e68c",
- lavender: "#e6e6fa",
- lavenderblush: "#fff0f5",
- lawngreen: "#7cfc00",
- lemonchiffon: "#fffacd",
- lightblue: "#add8e6",
- lightcoral: "#f08080",
- lightcyan: "#e0ffff",
- lightgoldenrodyellow: "#fafad2",
- lightgray: "#d3d3d3",
- lightgreen: "#90ee90",
- lightpink: "#ffb6c1",
- lightsalmon: "#ffa07a",
- lightseagreen: "#20b2aa",
- lightskyblue: "#87cefa",
- lightslategray: "#778899",
- lightsteelblue: "#b0c4de",
- lightyellow: "#ffffe0",
- lime: "#00ff00",
- limegreen: "#32cd32",
- linen: "#faf0e6",
- magenta: "#ff00ff",
- maroon: "#800000",
- mediumaquamarine: "#66cdaa",
- mediumblue: "#0000cd",
- mediumorchid: "#ba55d3",
- mediumpurple: "#9370db",
- mediumseagreen: "#3cb371",
- mediumslateblue: "#7b68ee",
- mediumspringgreen: "#00fa9a",
- mediumturquoise: "#48d1cc",
- mediumvioletred: "#c71585",
- midnightblue: "#191970",
- mintcream: "#f5fffa",
- mistyrose: "#ffe4e1",
- moccasin: "#ffe4b5",
- navajowhite: "#ffdead",
- navy: "#000080",
- oldlace: "#fdf5e6",
- olive: "#808000",
- olivedrab: "#6b8e23",
- orange: "#ffa500",
- orangered: "#ff4500",
- orchid: "#da70d6",
- palegoldenrod: "#eee8aa",
- palegreen: "#98fb98",
- paleturquoise: "#afeeee",
- palevioletred: "#db7093",
- papayawhip: "#ffefd5",
- peachpuff: "#ffdab9",
- peru: "#cd853f",
- pink: "#ffc0cb",
- plum: "#dda0dd",
- powderblue: "#b0e0e6",
- purple: "#800080",
- rebeccapurple: "#663399",
- red: "#ff0000",
- rosybrown: "#bc8f8f",
- royalblue: "#4169e1",
- saddlebrown: "#8b4513",
- salmon: "#fa8072",
- sandybrown: "#f4a460",
- seagreen: "#2e8b57",
- seashell: "#fff5ee",
- sienna: "#a0522d",
- silver: "#c0c0c0",
- skyblue: "#87ceeb",
- slateblue: "#6a5acd",
- slategray: "#708090",
- snow: "#fffafa",
- springgreen: "#00ff7f",
- steelblue: "#4682b4",
- tan: "#d2b48c",
- teal: "#008080",
- thistle: "#d8bfd8",
- tomato: "#ff6347",
- turquoise: "#40e0d0",
- violet: "#ee82ee",
- wheat: "#f5deb3",
- white: "#ffffff",
- whitesmoke: "#f5f5f5",
- yellow: "#ffff00",
- yellowgreen: "#9acd32"
- };
- function M(t) {
- T[t.toLowerCase()] && (t = T[t.toLowerCase()]),
- t = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (function(t, e, i, a) {
- return e + e + i + i + a + a
- }
- ));
- var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
- return e ? {
- r: parseInt(e[1], 16),
- g: parseInt(e[2], 16),
- b: parseInt(e[3], 16)
- } : null
- }
- function E(t, e) {
- var i;
- for (i in e)
- Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
- return t
- }
- function L(t) {
- for (var e = Array.prototype.slice.call(arguments, 1), i = 0, a = e.length; i < a; i++)
- E(t, e[i] || {});
- return t
- }
- const D = [];
- function S(t) {
- D.forEach((e => {
- try {
- e(t)
- } catch (t) {
- console && console.log && console.log("Error handling trace", t)
- }
- }
- ))
- }
- function N(t, e) {
- for (t = String(t),
- e = e || 2; t.length < e; )
- t = "0" + t;
- return t
- }
- const A = (C = 0,
- I = "_tl_id",
- function(t) {
- return t[I] = t[I] || ++C,
- t[I]
- }
- );
- var C, I;
- function O(t) {
- return t && "function" == typeof t.replace ? t.replace(/^\s+|\s+$/g, "") : ""
- }
- function R(t, ...e) {
- for (let a of e)
- for (var i of Object.getOwnPropertyNames(a.prototype))
- t.prototype[i] = a.prototype[i]
- }
- function j(t) {
- t = (t = O(t)).toLowerCase();
- for (var e = 0; e < 31; e++)
- t = t.replace(new RegExp("ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;".charAt(e),"g"), "aaaaaeeeeeiiiiooooouuuunc------".charAt(e));
- return (t = t.replace(/[^a-z0-9 -]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-")).replace(/^([0-9])/, "_$1")
- }
- function P(t, e) {
- var i = function(t) {
- for (var e = "", i = 0; i < t; i++)
- e += "abcdefghijklmnopqurstuvwxyz".substr(Math.floor(32 * Math.random()), 1);
- return e
- };
- return e ? e + "-" + i(t) : "tl-" + i(t)
- }
- function z(t) {
- return t == parseFloat(t) ? !(t % 2) : void 0
- }
- function H(t, e, i, a) {
- for (var s = a || 0, n = 0; n < e.length; n++)
- e[n].data[i] == t && (s = n);
- return s
- }
- function F(t) {
- return t ? t = (t = t.replace(/<a\b[^>]*>/i, "")).replace(/<\/a>/i, "") : t
- }
- function q(t) {
- if (!t) return t;
- t = DOMPurify.sanitize(t, { ALLOWED_TAGS: [] });
- return t.replace(/"/g, "'");
- }
- function $(t, e, i) {
- var a = function(t, e, i) {
- return i || (i = ""),
- e && e.length > 30 && (e = e.substring(0, 30) + "…"),
- i + "<a class='tl-makelink' href='" + t + "' onclick='void(0)'>" + e + "</a>"
- };
- return t.replace(/\b(?:https?|ftp):\/\/([a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|])/gim, (function(t, e, i, s) {
- if (i > 0) {
- var n = s[i - 1];
- if ('"' == n || "'" == n || "=" == n)
- return t
- }
- return a(t, e)
- }
- )).replace(/(^|[^\/>])(www\.[\S]+(\b|$))/gim, (function(t, e, i, s, n) {
- return a("http://" + i, i, e)
- }
- )).replace(/([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)/gim, (function(t, e, i, s) {
- return a("mailto:" + e, e)
- }
- ))
- }
- function U(t) {
- return t.replace(/(.*)www.dropbox.com\/(.*)/, "$1dl\.dropboxusercontent.com/$2")
- }
- const B = t => {
- var e = {
- w: 0,
- h: 0
- };
- return t.w > t.h && t.h > 0 ? (e.h = t.h,
- e.w = t.h) : (e.w = t.w,
- e.h = t.w),
- e
- }
- , W = t => null !== t.w && "" !== t.w ? Math.round(t.w / 16 * 9) : null !== t.h && "" !== t.h ? Math.round(t.h / 9 * 16) : 0;
- let G = (Z = (Y = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ").length,
- {
- encode: function(t) {
- if ("number" != typeof t || t !== parseInt(t))
- throw '"encode" only accepts integers.';
- for (var e = ""; t; ) {
- var i = t % Z;
- t = Math.floor(t / Z),
- e = Y[i].toString() + e
- }
- return e
- },
- decode: function(t) {
- if ("string" != typeof t)
- throw '"decode" only accepts strings.';
- for (var e = 0; t; ) {
- var i = Y.indexOf(t[0]);
- if (i < 0)
- throw '"decode" can\'t find "' + t[0] + '" in the alphabet: "' + Y + '"';
- var a = t.length - 1;
- e += i * Math.pow(Z, a),
- t = t.substring(1)
- }
- return e
- }
- });
- var Y, Z;
- function V(t) {
- if ("string" == typeof t) {
- let a = t.match(/^\s*(\d+h)?(\d+m)?(\d+s)?\s*/i);
- if (a) {
- var e = parseInt(a[1]) || 0
- , i = parseInt(a[2]) || 0;
- return (parseInt(a[3]) || 0) + 60 * i + 60 * e * 60
- }
- } else if ("number" == typeof t)
- return t;
- return 0
- }
- function X(t) {
- return (new DOMParser).parseFromString(t, "text/html").body.textContent || ""
- }
- const J = [.42, 0, 1, 1];
- function K(t) {}
- function Q(t) {
- return new K(J).get(t)
- }
- function tt(t) {
- return 1 == t ? 1 : 1 - Math.pow(2, -10 * t)
- }
- function et(t) {
- return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t
- }
- let it = function() {};
- it.extend = function(t) {
- var e = function() {
- this.initialize && this.initialize.apply(this, arguments)
- }
- , i = function() {};
- i.prototype = this.prototype;
- var a = new i;
- for (var s in a.constructor = e,
- e.prototype = a,
- e.superclass = this.prototype,
- this)
- this.hasOwnProperty(s) && "prototype" !== s && "superclass" !== s && (e[s] = this[s]);
- return t.statics && (L(e, t.statics),
- delete t.statics),
- t.includes && (L.apply(null, [a].concat(t.includes)),
- delete t.includes),
- t.options && a.options && (t.options = L({}, a.options, t.options)),
- L(a, t),
- e.extend = it.extend,
- e.include = function(t) {
- L(this.prototype, t)
- }
- ,
- e
- }
- ;
- class at {
- on(t, e, i) {
- if (!e)
- throw new x("No callback function provided");
- var a = this._tl_events = this._tl_events || {};
- return a[t] = a[t] || [],
- a[t].push({
- action: e,
- context: i || this
- }),
- this
- }
- addEventListener(t, e, i) {
- return this.on(t, e, i)
- }
- hasEventListeners(t) {
- var e = "_tl_events";
- return e in this && t in this[e] && this[e][t].length > 0
- }
- removeEventListener(t, e, i) {
- if (!this.hasEventListeners(t))
- return this;
- for (var a = 0, s = this._tl_events, n = s[t].length; a < n; a++)
- if (s[t][a].action === e && (!i || s[t][a].context === i))
- return s[t].splice(a, 1),
- this;
- return this
- }
- off(t, e, i) {
- return this.removeEventListener(t, e, i)
- }
- fire(t, e) {
- if (!this.hasEventListeners(t))
- return this;
- for (var i = E({
- type: t,
- target: this
- }, e), a = this._tl_events[t].slice(), s = 0, n = a.length; s < n; s++)
- a[s].action ? a[s].action.call(a[s].context || this, i) : S(`no action defined for ${t} listener`);
- return this
- }
- }
- function st(t, e) {
- return nt(t, e)
- }
- const nt = function() {
- var t = document
- , e = window
- , i = e.performance
- , a = i && (i.now || i.webkitNow || i.msNow || i.mozNow)
- , s = a ? function() {
- return a.call(i)
- }
- : function() {
- return +new Date
- }
- , n = t.documentElement
- , o = !1
- , r = 1e3
- , l = /^rgb\(|#/
- , h = /^([+\-])=([\d\.]+)/
- , d = /^(?:[\+\-]=?)?\d+(?:\.\d+)?(%|in|cm|mm|em|ex|pt|pc|px)$/
- , c = /rotate\(((?:[+\-]=)?([\-\d\.]+))deg\)/
- , u = /scale\(((?:[+\-]=)?([\d\.]+))\)/
- , m = /skew\(((?:[+\-]=)?([\-\d\.]+))deg, ?((?:[+\-]=)?([\-\d\.]+))deg\)/
- , _ = /translate\(((?:[+\-]=)?([\-\d\.]+))px, ?((?:[+\-]=)?([\-\d\.]+))px\)/
- , p = {
- lineHeight: 1,
- zoom: 1,
- zIndex: 1,
- opacity: 1,
- transform: 1
- }
- , f = function() {
- var e, i = t.createElement("a").style, a = ["webkitTransform", "MozTransform", "OTransform", "msTransform", "Transform"];
- for (e = 0; e < a.length; e++)
- if (a[e]in i)
- return a[e]
- }()
- , g = void 0 !== t.createElement("a").style.opacity
- , v = t.defaultView && t.defaultView.getComputedStyle ? function(e, i) {
- i = M(i = "transform" == i ? f : i);
- var a = null
- , s = t.defaultView.getComputedStyle(e, "");
- return s && (a = s[i]),
- e.style[i] || a
- }
- : n.currentStyle ? function(t, e) {
- if ("opacity" == (e = M(e))) {
- var i = 100;
- try {
- i = t.filters["DXImageTransform.Microsoft.Alpha"].opacity
- } catch (e) {
- try {
- i = t.filters("alpha").opacity
- } catch (t) {}
- }
- return i / 100
- }
- var a = t.currentStyle ? t.currentStyle[e] : null;
- return t.style[e] || a
- }
- : function(t, e) {
- return t.style[M(e)]
- }
- , y = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || e.oRequestAnimationFrame || function(t) {
- e.setTimeout((function() {
- t(+new Date)
- }
- ), 17)
- }
- , b = [];
- function w(t) {
- var e, i = b.length;
- for (a && t > 1e12 && (t = s()),
- o && (t = s()),
- e = i; e--; )
- b[e](t);
- b.length && y(w)
- }
- function k(t, e) {
- var i, a = {};
- return (i = t.match(c)) && (a.rotate = A(i[1], e ? e.rotate : null)),
- (i = t.match(u)) && (a.scale = A(i[1], e ? e.scale : null)),
- (i = t.match(m)) && (a.skewx = A(i[1], e ? e.skewx : null),
- a.skewy = A(i[3], e ? e.skewy : null)),
- (i = t.match(_)) && (a.translatex = A(i[1], e ? e.translatex : null),
- a.translatey = A(i[3], e ? e.translatey : null)),
- a
- }
- function x(t) {
- var e = "";
- return "rotate"in t && (e += "rotate(" + t.rotate + "deg) "),
- "scale"in t && (e += "scale(" + t.scale + ") "),
- "translatex"in t && (e += "translate(" + t.translatex + "px," + t.translatey + "px) "),
- "skewx"in t && (e += "skew(" + t.skewx + "deg," + t.skewy + "deg)"),
- e
- }
- function T(t) {
- var e, i, a, s = t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
- return (s ? (e = s[1],
- i = s[2],
- a = s[3],
- "#" + (1 << 24 | e << 16 | i << 8 | a).toString(16).slice(1)) : t).replace(/#(\w)(\w)(\w)$/, "#$1$1$2$2$3$3")
- }
- function M(t) {
- return t.replace(/-(.)/g, (function(t, e) {
- return e.toUpperCase()
- }
- ))
- }
- function E(t) {
- return "function" == typeof t
- }
- function L(t) {
- return Math.sin(t * Math.PI / 2)
- }
- function D(t, e, i, a, n, o) {
- a = E(a) ? a : C.easings[a] || L;
- var l, h = t || r, d = this, c = o - n, u = s(), m = 0, _ = 0;
- return l = function t(s) {
- var r = s - u;
- if (r > h || m)
- return o = isFinite(o) ? o : 1,
- m ? _ && e(o) : e(o),
- function(t) {
- var e, i = function(t, e, i) {
- if (Array.prototype.indexOf)
- return t.indexOf(e);
- for (i = 0; i < t.length; ++i)
- if (t[i] === e)
- return i
- }(b, t);
- i >= 0 && (e = b.slice(i + 1),
- b.length = i,
- b = b.concat(e))
- }(t),
- i && i.apply(d);
- isFinite(o) ? e(c * a(r / h) + n) : e(a(r / h))
- }
- ,
- 1 === b.push(l) && y(w),
- {
- stop: function(t) {
- m = 1,
- _ = t,
- t || (i = null)
- }
- }
- }
- function S(t, e) {
- var i, a, s = t.length, n = [];
- for (i = 0; i < s; ++i)
- n[i] = [t[i][0], t[i][1]];
- for (a = 1; a < s; ++a)
- for (i = 0; i < s - a; ++i)
- n[i][0] = (1 - e) * n[i][0] + e * n[parseInt(i + 1, 10)][0],
- n[i][1] = (1 - e) * n[i][1] + e * n[parseInt(i + 1, 10)][1];
- return [n[0][0], n[0][1]]
- }
- function N(t, e, i, a, s, n, o) {
- if ("transform" == s) {
- for (var l in o = {},
- i[n][s])
- o[l] = l in a[n][s] ? Math.round(((a[n][s][l] - i[n][s][l]) * t + i[n][s][l]) * r) / r : i[n][s][l];
- return o
- }
- return "string" == typeof i[n][s] ? function(t, e, i) {
- var a, s, n, o, r = [];
- for (a = 0; a < 6; a++)
- n = Math.min(15, parseInt(e.charAt(a), 16)),
- o = Math.min(15, parseInt(i.charAt(a), 16)),
- s = (s = Math.floor((o - n) * t + n)) > 15 ? 15 : s < 0 ? 0 : s,
- r[a] = s.toString(16);
- return "#" + r.join("")
- }(t, i[n][s], a[n][s]) : (o = Math.round(((a[n][s] - i[n][s]) * t + i[n][s]) * r) / r,
- s in p || (o += e[n][s] || "px"),
- o)
- }
- function A(t, e, i, a, s) {
- return (i = h.exec(t)) ? (s = parseFloat(i[2])) && e + ("+" == i[1] ? 1 : -1) * s : parseFloat(t)
- }
- function C(t, e) {
- var i, a, s, n = t ? n = isFinite(t.length) ? t : [t] : [], o = e.complete, r = e.duration, h = e.easing, c = e.bezier, u = [], m = [], _ = [], p = [];
- for (c && (a = e.left,
- s = e.top,
- delete e.right,
- delete e.bottom,
- delete e.left,
- delete e.top),
- i = n.length; i--; ) {
- if (u[i] = {},
- m[i] = {},
- _[i] = {},
- c) {
- var y = v(n[i], "left")
- , b = v(n[i], "top")
- , w = [A(E(a) ? a(n[i]) : a || 0, parseFloat(y)), A(E(s) ? s(n[i]) : s || 0, parseFloat(b))];
- p[i] = E(c) ? c(n[i], w) : c,
- p[i].push(w),
- p[i].unshift([parseInt(y, 10), parseInt(b, 10)])
- }
- for (var L in e) {
- switch (L) {
- case "complete":
- case "duration":
- case "easing":
- case "bezier":
- continue
- }
- var C, I = v(n[i], L), O = E(e[L]) ? e[L](n[i]) : e[L];
- "string" != typeof O || !l.test(O) || l.test(I) ? (u[i][L] = "transform" == L ? k(I) : "string" == typeof O && l.test(O) ? T(I).slice(1) : parseFloat(I),
- m[i][L] = "transform" == L ? k(O, u[i][L]) : "string" == typeof O && "#" == O.charAt(0) ? T(O).slice(1) : A(O, parseFloat(I)),
- "string" == typeof O && (C = O.match(d)) && (_[i][L] = C[1])) : delete e[L]
- }
- }
- return D.apply(n, [r, function(t, a, s) {
- for (i = n.length; i--; )
- for (var o in c && (s = S(p[i], t),
- n[i].style.left = s[0] + "px",
- n[i].style.top = s[1] + "px"),
- e)
- a = N(t, _, u, m, o, i),
- "transform" == o ? n[i].style[f] = x(a) : "opacity" != o || g ? n[i].style[M(o)] = a : n[i].style.filter = "alpha(opacity=" + 100 * a + ")"
- }
- , o, h])
- }
- return y((function(t) {
- o = t > 1e12 != s() > 1e12
- }
- )),
- C.tween = D,
- C.getStyle = v,
- C.bezier = S,
- C.transform = f,
- C.parseTransform = k,
- C.formatTransform = x,
- C.easings = {},
- C
- }();
- class ot {
- show(t) {
- t || (this._el.container.style.display = "block")
- }
- hide(t) {
- this._el.container.style.display = "none"
- }
- addTo(t) {
- t.appendChild(this._el.container),
- this.onAdd()
- }
- removeFrom(t) {
- t.removeChild(this._el.container),
- this.onRemove()
- }
- animatePosition(t, e) {
- var i = {
- duration: this.options.duration,
- easing: this.options.ease
- };
- for (var a in t)
- t.hasOwnProperty(a) && (i[a] = t[a] + "px");
- this.animator && this.animator.stop(),
- this.animator = st(e, i)
- }
- onLoaded() {
- this.fire("loaded", this.data)
- }
- onAdd() {
- this.fire("added", this.data)
- }
- onRemove() {
- this.fire("removed", this.data)
- }
- setPosition(t, e) {
- for (var i in t)
- t.hasOwnProperty(i) && (e ? e.style[i] = t[i] + "px" : this._el.container.style[i] = t[i] + "px")
- }
- getPosition() {
- return b(this._el.container)
- }
- }
- class rt {
- constructor(t, e, i) {
- this._el = {
- drag: t,
- move: t
- },
- this.mousedrag = {
- down: "mousedown",
- up: "mouseup",
- leave: "mouseleave",
- move: "mousemove"
- },
- this.touchdrag = {
- down: "touchstart",
- up: "touchend",
- leave: "mouseleave",
- move: "touchmove"
- },
- i && (this._el.move = i),
- this.options = {
- enable: {
- x: !0,
- y: !0
- },
- constraint: {
- top: !1,
- bottom: !1,
- left: !1,
- right: !1
- },
- momentum_multiplier: 2e3,
- duration: 1e3,
- ease: et
- },
- this.animator = null,
- this.dragevent = this.mousedrag,
- f && (this.dragevent = this.touchdrag),
- this.data = {
- sliding: !1,
- direction: "none",
- pagex: {
- start: 0,
- end: 0
- },
- pagey: {
- start: 0,
- end: 0
- },
- pos: {
- start: {
- x: 0,
- y: 0
- },
- end: {
- x: 0,
- y: 0
- }
- },
- new_pos: {
- x: 0,
- y: 0
- },
- new_pos_parent: {
- x: 0,
- y: 0
- },
- time: {
- start: 0,
- end: 0
- },
- touch: !1
- },
- E(this.options, e)
- }
- enable(t) {
- this.data.pos.start = 0,
- this._el.move.style.left = this.data.pos.start.x + "px",
- this._el.move.style.top = this.data.pos.start.y + "px",
- this._el.move.style.position = "absolute"
- }
- disable() {
- ht.removeListener(this._el.drag, this.dragevent.down, this._onDragStart, this),
- ht.removeListener(this._el.drag, this.dragevent.up, this._onDragEnd, this)
- }
- stopMomentum() {
- this.animator && this.animator.stop()
- }
- updateConstraint(t) {
- this.options.constraint = t
- }
- _onDragStart(t) {
- f ? t.originalEvent ? (this.data.pagex.start = t.originalEvent.touches[0].screenX,
- this.data.pagey.start = t.originalEvent.touches[0].screenY) : (this.data.pagex.start = t.targetTouches[0].screenX,
- this.data.pagey.start = t.targetTouches[0].screenY) : (this.data.pagex.start = t.pageX,
- this.data.pagey.start = t.pageY),
- this.options.enable.x && (this._el.move.style.left = this.data.pagex.start - this._el.move.offsetWidth / 2 + "px"),
- this.options.enable.y && (this._el.move.style.top = this.data.pagey.start - this._el.move.offsetHeight / 2 + "px"),
- this.data.pos.start = b(this._el.drag),
- this.data.time.start = (new Date).getTime(),
- this.fire("dragstart", this.data),
- ht.addListener(this._el.drag, this.dragevent.move, this._onDragMove, this),
- ht.addListener(this._el.drag, this.dragevent.leave, this._onDragEnd, this)
- }
- _onDragEnd(t) {
- this.data.sliding = !1,
- ht.removeListener(this._el.drag, this.dragevent.move, this._onDragMove, this),
- ht.removeListener(this._el.drag, this.dragevent.leave, this._onDragEnd, this),
- this.fire("dragend", this.data),
- this._momentum()
- }
- _onDragMove(t) {
- t.preventDefault(),
- this.data.sliding = !0,
- f ? t.originalEvent ? (this.data.pagex.end = t.originalEvent.touches[0].screenX,
- this.data.pagey.end = t.originalEvent.touches[0].screenY) : (this.data.pagex.end = t.targetTouches[0].screenX,
- this.data.pagey.end = t.targetTouches[0].screenY) : (this.data.pagex.end = t.pageX,
- this.data.pagey.end = t.pageY),
- this.data.pos.end = b(this._el.drag),
- this.data.new_pos.x = -(this.data.pagex.start - this.data.pagex.end - this.data.pos.start.x),
- this.data.new_pos.y = -(this.data.pagey.start - this.data.pagey.end - this.data.pos.start.y),
- this.options.enable.x && (this._el.move.style.left = this.data.new_pos.x + "px"),
- this.options.enable.y && (this._el.move.style.top = this.data.new_pos.y + "px"),
- this.fire("dragmove", this.data)
- }
- _momentum() {
- var t = {
- x: 0,
- y: 0,
- time: 0
- }
- , e = {
- x: 0,
- y: 0,
- time: 0
- }
- , i = !1;
- t.time = 10 * ((new Date).getTime() - this.data.time.start),
- e.time = 10 * ((new Date).getTime() - this.data.time.start),
- e.x = this.options.momentum_multiplier * (Math.abs(this.data.pagex.end) - Math.abs(this.data.pagex.start)),
- e.y = this.options.momentum_multiplier * (Math.abs(this.data.pagey.end) - Math.abs(this.data.pagey.start)),
- t.x = Math.round(e.x / e.time),
- t.y = Math.round(e.y / e.time),
- this.data.new_pos.x = Math.min(this.data.pos.end.x + t.x),
- this.data.new_pos.y = Math.min(this.data.pos.end.y + t.y),
- this.options.enable.x ? this.data.new_pos.x < 0 && (this.data.new_pos.x = 0) : this.data.new_pos.x = this.data.pos.start.x,
- this.options.enable.y ? this.data.new_pos.y < 0 && (this.data.new_pos.y = 0) : this.data.new_pos.y = this.data.pos.start.y,
- e.time < 3e3 && (i = !0),
- Math.abs(e.x) > 1e4 && (this.data.direction = "left",
- e.x > 0 && (this.data.direction = "right")),
- Math.abs(e.y) > 1e4 && (this.data.direction = "up",
- e.y > 0 && (this.data.direction = "down")),
- this._animateMomentum(),
- i && this.fire("swipe_" + this.data.direction, this.data)
- }
- _animateMomentum() {
- var t = {
- x: this.data.new_pos.x,
- y: this.data.new_pos.y
- }
- , e = {
- duration: this.options.duration,
- easing: tt
- };
- this.options.enable.y && ((this.options.constraint.top || this.options.constraint.bottom) && (t.y > this.options.constraint.bottom ? t.y = this.options.constraint.bottom : t.y < this.options.constraint.top && (t.y = this.options.constraint.top)),
- e.top = Math.floor(t.y) + "px"),
- this.options.enable.x && ((this.options.constraint.left || this.options.constraint.right) && (t.x > this.options.constraint.left ? t.x = this.options.constraint.left : t.x < this.options.constraint.right && (t.x = this.options.constraint.right)),
- e.left = Math.floor(t.x) + "px"),
- this.animator = st(this._el.move, e),
- this.fire("momentum", this.data)
- }
- }
- R(at);
- var lt, ht = {
- addListener: function(t, e, i, a) {
- var s = A(i)
- , n = "_tl_" + e + s;
- if (!t[n]) {
- var o = function(e) {
- return i.call(a || t, e || ht._getEvent())
- };
- if (f && "dblclick" === e && this.addDoubleTapListener)
- this.addDoubleTapListener(t, o, s);
- else if ("addEventListener"in t)
- if ("mousewheel" === e)
- t.addEventListener("DOMMouseScroll", o, !1),
- t.addEventListener(e, o, !1);
- else if ("mouseenter" === e || "mouseleave" === e) {
- var r = o
- , l = "mouseenter" === e ? "mouseover" : "mouseout";
- o = function(e) {
- if (ht._checkMouse(t, e))
- return r(e)
- }
- ,
- t.addEventListener(l, o, !1)
- } else
- t.addEventListener(e, o, !1);
- else
- "attachEvent"in t && t.attachEvent("on" + e, o);
- t[n] = o
- }
- },
- removeListener: function(t, e, i) {
- var a = A(i)
- , s = "_tl_" + e + a
- , n = t[s];
- n && (f && "dblclick" === e && this.removeDoubleTapListener ? this.removeDoubleTapListener(t, a) : "removeEventListener"in t ? "mousewheel" === e ? (t.removeEventListener("DOMMouseScroll", n, !1),
- t.removeEventListener(e, n, !1)) : "mouseenter" === e || "mouseleave" === e ? t.removeEventListener("mouseenter" === e ? "mouseover" : "mouseout", n, !1) : t.removeEventListener(e, n, !1) : "detachEvent"in t && t.detachEvent("on" + e, n),
- t[s] = null)
- },
- _checkMouse: function(t, e) {
- var i = e.relatedTarget;
- if (!i)
- return !0;
- try {
- for (; i && i !== t; )
- i = i.parentNode
- } catch (t) {
- return !1
- }
- return i !== t
- },
- _getEvent: function() {
- var t = window.event;
- if (!t)
- for (var e = arguments.callee.caller; e && (!(t = e.arguments[0]) || window.Event !== t.constructor); )
- e = e.caller;
- return t
- },
- stopPropagation: function(t) {
- t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0
- },
- disableClickPropagation: function(t) {
- ht.addListener(t, rt.START, ht.stopPropagation),
- ht.addListener(t, "click", ht.stopPropagation),
- ht.addListener(t, "dblclick", ht.stopPropagation)
- },
- preventDefault: function(t) {
- t.preventDefault ? t.preventDefault() : t.returnValue = !1
- },
- stop: function(t) {
- ht.preventDefault(t),
- ht.stopPropagation(t)
- },
- getWheelDelta: function(t) {
- var e = 0;
- return t.wheelDelta && (e = t.wheelDelta / 120),
- t.detail && (e = -t.detail / 3),
- e
- }
- }, dt = function() {
- var t, e, i, a, s, n, o = [], r = o.slice, l = o.filter, h = window.document, d = {}, c = {}, u = {
- "column-count": 1,
- columns: 1,
- "font-weight": 1,
- "line-height": 1,
- opacity: 1,
- "z-index": 1,
- zoom: 1
- }, m = /^\s*<(\w+|!)[^>]*>/, _ = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, p = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, f = /^(?:body|html)$/i, g = /([A-Z])/g, v = ["val", "css", "html", "text", "data", "width", "height", "offset"], y = h.createElement("table"), b = h.createElement("tr"), w = {
- tr: h.createElement("tbody"),
- tbody: y,
- thead: y,
- tfoot: y,
- td: b,
- th: b,
- "*": h.createElement("div")
- }, k = /complete|loaded|interactive/, x = /^[\w-]*$/, T = {}, M = T.toString, E = {}, L = h.createElement("div"), D = {
- tabindex: "tabIndex",
- readonly: "readOnly",
- for: "htmlFor",
- class: "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- }, S = Array.isArray || function(t) {
- return t instanceof Array
- }
- ;
- function N(t) {
- return null == t ? String(t) : T[M.call(t)] || "object"
- }
- function A(t) {
- return "function" == N(t)
- }
- function C(t) {
- return null != t && t == t.window
- }
- function I(t) {
- return null != t && t.nodeType == t.DOCUMENT_NODE
- }
- function O(t) {
- return "object" == N(t)
- }
- function R(t) {
- return O(t) && !C(t) && Object.getPrototypeOf(t) == Object.prototype
- }
- function j(t) {
- return "number" == typeof t.length
- }
- function P(t) {
- return t.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase()
- }
- function z(t) {
- return t in c ? c[t] : c[t] = new RegExp("(^|\\s)" + t + "(\\s|$)")
- }
- function H(t, e) {
- return "number" != typeof e || u[P(t)] ? e : e + "px"
- }
- function F(t) {
- return "children"in t ? r.call(t.children) : i.map(t.childNodes, (function(t) {
- if (1 == t.nodeType)
- return t
- }
- ))
- }
- function q(i, a, s) {
- for (e in a)
- s && (R(a[e]) || S(a[e])) ? (R(a[e]) && !R(i[e]) && (i[e] = {}),
- S(a[e]) && !S(i[e]) && (i[e] = []),
- q(i[e], a[e], s)) : a[e] !== t && (i[e] = a[e])
- }
- function $(t, e) {
- return null == e ? i(t) : i(t).filter(e)
- }
- function U(t, e, i, a) {
- return A(e) ? e.call(t, i, a) : e
- }
- function B(t, e, i) {
- null == i ? t.removeAttribute(e) : t.setAttribute(e, i)
- }
- function W(e, i) {
- var a = e.className
- , s = a && a.baseVal !== t;
- if (i === t)
- return s ? a.baseVal : a;
- s ? a.baseVal = i : e.className = i
- }
- function G(t) {
- var e;
- try {
- return t ? "true" == t || "false" != t && ("null" == t ? null : /^0/.test(t) || isNaN(e = Number(t)) ? /^[\[\{]/.test(t) ? i.parseJSON(t) : t : e) : t
- } catch (e) {
- return t
- }
- }
- function Y(t, e) {
- for (var i in e(t),
- t.childNodes)
- Y(t.childNodes[i], e)
- }
- return E.matches = function(t, e) {
- if (!e || !t || 1 !== t.nodeType)
- return !1;
- var i = t.webkitMatchesSelector || t.mozMatchesSelector || t.oMatchesSelector || t.matchesSelector;
- if (i)
- return i.call(t, e);
- var a, s = t.parentNode, n = !s;
- return n && (s = L).appendChild(t),
- a = ~E.qsa(s, e).indexOf(t),
- n && L.removeChild(t),
- a
- }
- ,
- s = function(t) {
- return t.replace(/-+(.)?/g, (function(t, e) {
- return e ? e.toUpperCase() : ""
- }
- ))
- }
- ,
- n = function(t) {
- return l.call(t, (function(e, i) {
- return t.indexOf(e) == i
- }
- ))
- }
- ,
- E.fragment = function(e, a, s) {
- var n, o, l;
- return _.test(e) && (n = i(h.createElement(RegExp.$1))),
- n || (e.replace && (e = e.replace(p, (match, p1, p2) => p2 ? `<${p2}></${p2}>` : match)),
- a === t && (a = m.test(e) && RegExp.$1),
- a in w || (a = "*"),
- (l = w[a]).innerHTML = "" + e,
- n = i.each(r.call(l.childNodes), (function() {
- l.removeChild(this)
- }
- ))),
- R(s) && (o = i(n),
- i.each(s, (function(t, e) {
- v.indexOf(t) > -1 ? o[t](e) : o.attr(t, e)
- }
- ))),
- n
- }
- ,
- E.Z = function(t, e) {
- return (t = t || []).__proto__ = i.fn,
- t.selector = e || "",
- t
- }
- ,
- E.isZ = function(t) {
- return t instanceof E.Z
- }
- ,
- E.init = function(e, a) {
- var s, n;
- if (!e)
- return E.Z();
- if ("string" == typeof e)
- if ("<" == (e = e.trim())[0] && m.test(e))
- s = E.fragment(e, RegExp.$1, a),
- e = null;
- else {
- if (a !== t)
- return i(a).find(e);
- s = E.qsa(h, e)
- }
- else {
- if (A(e))
- return i(h).ready(e);
- if (E.isZ(e))
- return e;
- if (S(e))
- n = e,
- s = l.call(n, (function(t) {
- return null != t
- }
- ));
- else if (O(e))
- s = [e],
- e = null;
- else if (m.test(e))
- s = E.fragment(e.trim(), RegExp.$1, a),
- e = null;
- else {
- if (a !== t)
- return i(a).find(e);
- s = E.qsa(h, e)
- }
- }
- return E.Z(s, e)
- }
- ,
- (i = function(t, e) {
- return E.init(t, e)
- }
- ).extend = function(t) {
- var e, i = r.call(arguments, 1);
- return "boolean" == typeof t && (e = t,
- t = i.shift()),
- i.forEach((function(i) {
- q(t, i, e)
- }
- )),
- t
- }
- ,
- E.qsa = function(t, e) {
- var i, a = "#" == e[0], s = !a && "." == e[0], n = a || s ? e.slice(1) : e, o = x.test(n);
- return I(t) && o && a ? (i = t.getElementById(n)) ? [i] : [] : 1 !== t.nodeType && 9 !== t.nodeType ? [] : r.call(o && !a ? s ? t.getElementsByClassName(n) : t.getElementsByTagName(e) : t.querySelectorAll(e))
- }
- ,
- i.contains = function(t, e) {
- return t !== e && t.contains(e)
- }
- ,
- i.type = N,
- i.isFunction = A,
- i.isWindow = C,
- i.isArray = S,
- i.isPlainObject = R,
- i.isEmptyObject = function(t) {
- var e;
- for (e in t)
- return !1;
- return !0
- }
- ,
- i.inArray = function(t, e, i) {
- return o.indexOf.call(e, t, i)
- }
- ,
- i.camelCase = s,
- i.trim = function(t) {
- return null == t ? "" : String.prototype.trim.call(t)
- }
- ,
- i.uuid = 0,
- i.support = {},
- i.expr = {},
- i.map = function(t, e) {
- var a, s, n, o, r = [];
- if (j(t))
- for (s = 0; s < t.length; s++)
- null != (a = e(t[s], s)) && r.push(a);
- else
- for (n in t)
- null != (a = e(t[n], n)) && r.push(a);
- return (o = r).length > 0 ? i.fn.concat.apply([], o) : o
- }
- ,
- i.each = function(t, e) {
- var i, a;
- if (j(t)) {
- for (i = 0; i < t.length; i++)
- if (!1 === e.call(t[i], i, t[i]))
- return t
- } else
- for (a in t)
- if (!1 === e.call(t[a], a, t[a]))
- return t;
- return t
- }
- ,
- i.grep = function(t, e) {
- return l.call(t, e)
- }
- ,
- window.JSON && (i.parseJSON = JSON.parse),
- i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), (function(t, e) {
- T["[object " + e + "]"] = e.toLowerCase()
- }
- )),
- i.fn = {
- forEach: o.forEach,
- reduce: o.reduce,
- push: o.push,
- sort: o.sort,
- indexOf: o.indexOf,
- concat: o.concat,
- map: function(t) {
- return i(i.map(this, (function(e, i) {
- return t.call(e, i, e)
- }
- )))
- },
- slice: function() {
- return i(r.apply(this, arguments))
- },
- ready: function(t) {
- return k.test(h.readyState) && h.body ? t(i) : h.addEventListener("DOMContentLoaded", (function() {
- t(i)
- }
- ), !1),
- this
- },
- get: function(e) {
- return e === t ? r.call(this) : this[e >= 0 ? e : e + this.length]
- },
- toArray: function() {
- return this.get()
- },
- size: function() {
- return this.length
- },
- remove: function() {
- return this.each((function() {
- null != this.parentNode && this.parentNode.removeChild(this)
- }
- ))
- },
- each: function(t) {
- return o.every.call(this, (function(e, i) {
- return !1 !== t.call(e, i, e)
- }
- )),
- this
- },
- filter: function(t) {
- return A(t) ? this.not(this.not(t)) : i(l.call(this, (function(e) {
- return E.matches(e, t)
- }
- )))
- },
- add: function(t, e) {
- return i(n(this.concat(i(t, e))))
- },
- is: function(t) {
- return this.length > 0 && E.matches(this[0], t)
- },
- not: function(e) {
- var a = [];
- if (A(e) && e.call !== t)
- this.each((function(t) {
- e.call(this, t) || a.push(this)
- }
- ));
- else {
- var s = "string" == typeof e ? this.filter(e) : j(e) && A(e.item) ? r.call(e) : i(e);
- this.forEach((function(t) {
- s.indexOf(t) < 0 && a.push(t)
- }
- ))
- }
- return i(a)
- },
- has: function(t) {
- return this.filter((function() {
- return O(t) ? i.contains(this, t) : i(this).find(t).size()
- }
- ))
- },
- eq: function(t) {
- return -1 === t ? this.slice(t) : this.slice(t, +t + 1)
- },
- first: function() {
- var t = this[0];
- return t && !O(t) ? t : i(t)
- },
- last: function() {
- var t = this[this.length - 1];
- return t && !O(t) ? t : i(t)
- },
- find: function(t) {
- var e = this;
- return "object" == typeof t ? i(t).filter((function() {
- var t = this;
- return o.some.call(e, (function(e) {
- return i.contains(e, t)
- }
- ))
- }
- )) : 1 == this.length ? i(E.qsa(this[0], t)) : this.map((function() {
- return E.qsa(this, t)
- }
- ))
- },
- closest: function(t, e) {
- var a = this[0]
- , s = !1;
- for ("object" == typeof t && (s = i(t)); a && !(s ? s.indexOf(a) >= 0 : E.matches(a, t)); )
- a = a !== e && !I(a) && a.parentNode;
- return i(a)
- },
- parents: function(t) {
- for (var e = [], a = this; a.length > 0; )
- a = i.map(a, (function(t) {
- if ((t = t.parentNode) && !I(t) && e.indexOf(t) < 0)
- return e.push(t),
- t
- }
- ));
- return $(e, t)
- },
- parent: function(t) {
- return $(n(this.pluck("parentNode")), t)
- },
- children: function(t) {
- return $(this.map((function() {
- return F(this)
- }
- )), t)
- },
- contents: function() {
- return this.map((function() {
- return r.call(this.childNodes)
- }
- ))
- },
- siblings: function(t) {
- return $(this.map((function(t, e) {
- return l.call(F(e.parentNode), (function(t) {
- return t !== e
- }
- ))
- }
- )), t)
- },
- empty: function() {
- return this.each((function() {
- this.innerHTML = ""
- }
- ))
- },
- pluck: function(t) {
- return i.map(this, (function(e) {
- return e[t]
- }
- ))
- },
- show: function() {
- return this.each((function() {
- var t, e, i;
- "none" == this.style.display && (this.style.display = ""),
- "none" == getComputedStyle(this, "").getPropertyValue("display") && (this.style.display = (t = this.nodeName,
- d[t] || (e = h.createElement(t),
- h.body.appendChild(e),
- i = getComputedStyle(e, "").getPropertyValue("display"),
- e.parentNode.removeChild(e),
- "none" == i && (i = "block"),
- d[t] = i),
- d[t]))
- }
- ))
- },
- replaceWith: function(t) {
- return this.before(t).remove()
- },
- wrap: function(t) {
- var e = A(t);
- if (this[0] && !e)
- var a = i(t).get(0)
- , s = a.parentNode || this.length > 1;
- return this.each((function(n) {
- i(this).wrapAll(e ? t.call(this, n) : s ? a.cloneNode(!0) : a)
- }
- ))
- },
- wrapAll: function(t) {
- if (this[0]) {
- var e;
- for (i(this[0]).before(t = i(t)); (e = t.children()).length; )
- t = e.first();
- i(t).append(this)
- }
- return this
- },
- wrapInner: function(t) {
- var e = A(t);
- return this.each((function(a) {
- var s = i(this)
- , n = s.contents()
- , o = e ? t.call(this, a) : t;
- n.length ? n.wrapAll(o) : s.append(o)
- }
- ))
- },
- unwrap: function() {
- return this.parent().each((function() {
- i(this).replaceWith(i(this).children())
- }
- )),
- this
- },
- clone: function() {
- return this.map((function() {
- return this.cloneNode(!0)
- }
- ))
- },
- hide: function() {
- return this.css("display", "none")
- },
- toggle: function(e) {
- return this.each((function() {
- var a = i(this);
- (e === t ? "none" == a.css("display") : e) ? a.show() : a.hide()
- }
- ))
- },
- prev: function(t) {
- return i(this.pluck("previousElementSibling")).filter(t || "*")
- },
- next: function(t) {
- return i(this.pluck("nextElementSibling")).filter(t || "*")
- },
- html: function(t) {
- return 0 === arguments.length ? this.length > 0 ? this[0].innerHTML : null : this.each((function(e) {
- var a = this.innerHTML;
- i(this).empty().append(U(this, t, e, a))
- }
- ))
- },
- text: function(e) {
- return 0 === arguments.length ? this.length > 0 ? this[0].textContent : null : this.each((function() {
- this.textContent = e === t ? "" : "" + e
- }
- ))
- },
- attr: function(i, a) {
- var s;
- return "string" == typeof i && a === t ? 0 == this.length || 1 !== this[0].nodeType ? t : "value" == i && "INPUT" == this[0].nodeName ? this.val() : !(s = this[0].getAttribute(i)) && i in this[0] ? this[0][i] : s : this.each((function(t) {
- if (1 === this.nodeType)
- if (O(i))
- for (e in i)
- B(this, e, i[e]);
- else
- B(this, i, U(this, a, t, this.getAttribute(i)))
- }
- ))
- },
- removeAttr: function(t) {
- return this.each((function() {
- 1 === this.nodeType && B(this, t)
- }
- ))
- },
- prop: function(e, i) {
- return e = D[e] || e,
- i === t ? this[0] && this[0][e] : this.each((function(t) {
- this[e] = U(this, i, t, this[e])
- }
- ))
- },
- data: function(e, i) {
- var a = this.attr("data-" + e.replace(g, "-$1").toLowerCase(), i);
- return null !== a ? G(a) : t
- },
- val: function(t) {
- return 0 === arguments.length ? this[0] && (this[0].multiple ? i(this[0]).find("option").filter((function() {
- return this.selected
- }
- )).pluck("value") : this[0].value) : this.each((function(e) {
- this.value = U(this, t, e, this.value)
- }
- ))
- },
- offset: function(t) {
- if (t)
- return this.each((function(e) {
- var a = i(this)
- , s = U(this, t, e, a.offset())
- , n = a.offsetParent().offset()
- , o = {
- top: s.top - n.top,
- left: s.left - n.left
- };
- "static" == a.css("position") && (o.position = "relative"),
- a.css(o)
- }
- ));
- if (0 == this.length)
- return null;
- var e = this[0].getBoundingClientRect();
- return {
- left: e.left + window.pageXOffset,
- top: e.top + window.pageYOffset,
- width: Math.round(e.width),
- height: Math.round(e.height)
- }
- },
- css: function(t, a) {
- if (arguments.length < 2) {
- var n = this[0]
- , o = getComputedStyle(n, "");
- if (!n)
- return;
- if ("string" == typeof t)
- return n.style[s(t)] || o.getPropertyValue(t);
- if (S(t)) {
- var r = {};
- return i.each(S(t) ? t : [t], (function(t, e) {
- r[e] = n.style[s(e)] || o.getPropertyValue(e)
- }
- )),
- r
- }
- }
- var l = "";
- if ("string" == N(t))
- a || 0 === a ? l = P(t) + ":" + H(t, a) : this.each((function() {
- this.style.removeProperty(P(t))
- }
- ));
- else
- for (e in t)
- t[e] || 0 === t[e] ? l += P(e) + ":" + H(e, t[e]) + ";" : this.each((function() {
- this.style.removeProperty(P(e))
- }
- ));
- return this.each((function() {
- this.style.cssText += ";" + l
- }
- ))
- },
- index: function(t) {
- return t ? this.indexOf(i(t)[0]) : this.parent().children().indexOf(this[0])
- },
- hasClass: function(t) {
- return !!t && o.some.call(this, (function(t) {
- return this.test(W(t))
- }
- ), z(t))
- },
- addClass: function(t) {
- return t ? this.each((function(e) {
- a = [];
- var s = W(this);
- U(this, t, e, s).split(/\s+/g).forEach((function(t) {
- i(this).hasClass(t) || a.push(t)
- }
- ), this),
- a.length && W(this, s + (s ? " " : "") + a.join(" "))
- }
- )) : this
- },
- removeClass: function(e) {
- return this.each((function(i) {
- if (e === t)
- return W(this, "");
- a = W(this),
- U(this, e, i, a).split(/\s+/g).forEach((function(t) {
- a = a.replace(z(t), " ")
- }
- )),
- W(this, a.trim())
- }
- ))
- },
- toggleClass: function(e, a) {
- return e ? this.each((function(s) {
- var n = i(this);
- U(this, e, s, W(this)).split(/\s+/g).forEach((function(e) {
- (a === t ? !n.hasClass(e) : a) ? n.addClass(e) : n.removeClass(e)
- }
- ))
- }
- )) : this
- },
- scrollTop: function(e) {
- if (this.length) {
- var i = "scrollTop"in this[0];
- return e === t ? i ? this[0].scrollTop : this[0].pageYOffset : this.each(i ? function() {
- this.scrollTop = e
- }
- : function() {
- this.scrollTo(this.scrollX, e)
- }
- )
- }
- },
- scrollLeft: function(e) {
- if (this.length) {
- var i = "scrollLeft"in this[0];
- return e === t ? i ? this[0].scrollLeft : this[0].pageXOffset : this.each(i ? function() {
- this.scrollLeft = e
- }
- : function() {
- this.scrollTo(e, this.scrollY)
- }
- )
- }
- },
- position: function() {
- if (this.length) {
- var t = this[0]
- , e = this.offsetParent()
- , a = this.offset()
- , s = f.test(e[0].nodeName) ? {
- top: 0,
- left: 0
- } : e.offset();
- return a.top -= parseFloat(i(t).css("margin-top")) || 0,
- a.left -= parseFloat(i(t).css("margin-left")) || 0,
- s.top += parseFloat(i(e[0]).css("border-top-width")) || 0,
- s.left += parseFloat(i(e[0]).css("border-left-width")) || 0,
- {
- top: a.top - s.top,
- left: a.left - s.left
- }
- }
- },
- offsetParent: function() {
- return this.map((function() {
- for (var t = this.offsetParent || h.body; t && !f.test(t.nodeName) && "static" == i(t).css("position"); )
- t = t.offsetParent;
- return t
- }
- ))
- }
- },
- i.fn.detach = i.fn.remove,
- ["width", "height"].forEach((function(e) {
- var a = e.replace(/./, (function(t) {
- return t[0].toUpperCase()
- }
- ));
- i.fn[e] = function(s) {
- var n, o = this[0];
- return s === t ? C(o) ? o["inner" + a] : I(o) ? o.documentElement["scroll" + a] : (n = this.offset()) && n[e] : this.each((function(t) {
- (o = i(this)).css(e, U(this, s, t, o[e]()))
- }
- ))
- }
- }
- )),
- ["after", "prepend", "before", "append"].forEach((function(t, e) {
- var a = e % 2;
- i.fn[t] = function() {
- var t, s, n = i.map(arguments, (function(e) {
- return "object" == (t = N(e)) || "array" == t || null == e ? e : E.fragment(e)
- }
- )), o = this.length > 1;
- return n.length < 1 ? this : this.each((function(t, r) {
- s = a ? r : r.parentNode,
- r = 0 == e ? r.nextSibling : 1 == e ? r.firstChild : 2 == e ? r : null,
- n.forEach((function(t) {
- if (o)
- t = t.cloneNode(!0);
- else if (!s)
- return i(t).remove();
- Y(s.insertBefore(t, r), (function(t) {
- null == t.nodeName || "SCRIPT" !== t.nodeName.toUpperCase() || t.type && "text/javascript" !== t.type || t.src || window.eval.call(window, t.innerHTML)
- }
- ))
- }
- ))
- }
- ))
- }
- ,
- i.fn[a ? t + "To" : "insert" + (e ? "Before" : "After")] = function(e) {
- return i(e)[t](this),
- this
- }
- }
- )),
- E.Z.prototype = i.fn,
- E.uniq = n,
- E.deserializeValue = G,
- i.zepto = E,
- i
- }();
- window.Zepto = dt,
- void 0 === window.$ && (window.$ = dt),
- function(t) {
- t.zepto.qsa;
- var e, i = 1, a = Array.prototype.slice, s = t.isFunction, n = function(t) {
- return "string" == typeof t
- }, o = {}, r = {}, l = "onfocusin"in window, h = {
- focus: "focusin",
- blur: "focusout"
- }, d = {
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- };
- function c(t) {
- return t._zid || (t._zid = i++)
- }
- function u(t, e, i, a) {
- if ((e = m(e)).ns)
- var s = (n = e.ns,
- new RegExp("(?:^| )" + n.replace(" ", " .* ?") + "(?: |$)"));
- var n;
- return (o[c(t)] || []).filter((function(t) {
- return t && (!e.e || t.e == e.e) && (!e.ns || s.test(t.ns)) && (!i || c(t.fn) === c(i)) && (!a || t.sel == a)
- }
- ))
- }
- function m(t) {
- var e = ("" + t).split(".");
- return {
- e: e[0],
- ns: e.slice(1).sort().join(" ")
- }
- }
- function _(t, e) {
- return t.del && !l && t.e in h || !!e
- }
- function p(t) {
- return d[t] || l && h[t] || t
- }
- function f(i, a, s, n, r, l, h) {
- var u = c(i)
- , f = o[u] || (o[u] = []);
- a.split(/\s/).forEach((function(a) {
- if ("ready" == a)
- return t(document).ready(s);
- var o = m(a);
- o.fn = s,
- o.sel = r,
- o.e in d && (s = function(e) {
- var i = e.relatedTarget;
- if (!i || i !== this && !t.contains(this, i))
- return o.fn.apply(this, arguments)
- }
- ),
- o.del = l;
- var c = l || s;
- o.proxy = function(t) {
- if (!(t = k(t)).isImmediatePropagationStopped()) {
- t.data = n;
- var a = c.apply(i, t._args == e ? [t] : [t].concat(t._args));
- return !1 === a && (t.preventDefault(),
- t.stopPropagation()),
- a
- }
- }
- ,
- o.i = f.length,
- f.push(o),
- "addEventListener"in i && i.addEventListener(p(o.e), o.proxy, _(o, h))
- }
- ))
- }
- function g(t, e, i, a, s) {
- var n = c(t);
- (e || "").split(/\s/).forEach((function(e) {
- u(t, e, i, a).forEach((function(e) {
- delete o[n][e.i],
- "removeEventListener"in t && t.removeEventListener(p(e.e), e.proxy, _(e, s))
- }
- ))
- }
- ))
- }
- r.click = r.mousedown = r.mouseup = r.mousemove = "MouseEvents",
- t.event = {
- add: f,
- remove: g
- },
- t.proxy = function(e, i) {
- if (s(e)) {
- var a = function() {
- return e.apply(i, arguments)
- };
- return a._zid = c(e),
- a
- }
- if (n(i))
- return t.proxy(e[i], e);
- throw new TypeError("expected function")
- }
- ,
- t.fn.bind = function(t, e, i) {
- return this.on(t, e, i)
- }
- ,
- t.fn.unbind = function(t, e) {
- return this.off(t, e)
- }
- ,
- t.fn.one = function(t, e, i, a) {
- return this.on(t, e, i, a, 1)
- }
- ;
- var v = function() {
- return !0
- }
- , y = function() {
- return !1
- }
- , b = /^([A-Z]|returnValue$|layer[XY]$)/
- , w = {
- preventDefault: "isDefaultPrevented",
- stopImmediatePropagation: "isImmediatePropagationStopped",
- stopPropagation: "isPropagationStopped"
- };
- function k(i, a) {
- return !a && i.isDefaultPrevented || (a || (a = i),
- t.each(w, (function(t, e) {
- var s = a[t];
- i[t] = function() {
- return this[e] = v,
- s && s.apply(a, arguments)
- }
- ,
- i[e] = y
- }
- )),
- (a.defaultPrevented !== e ? a.defaultPrevented : "returnValue"in a ? !1 === a.returnValue : a.getPreventDefault && a.getPreventDefault()) && (i.isDefaultPrevented = v)),
- i
- }
- function x(t) {
- var i, a = {
- originalEvent: t
- };
- for (i in t)
- b.test(i) || t[i] === e || (a[i] = t[i]);
- return k(a, t)
- }
- t.fn.delegate = function(t, e, i) {
- return this.on(e, t, i)
- }
- ,
- t.fn.undelegate = function(t, e, i) {
- return this.off(e, t, i)
- }
- ,
- t.fn.live = function(e, i) {
- return t(document.body).delegate(this.selector, e, i),
- this
- }
- ,
- t.fn.die = function(e, i) {
- return t(document.body).undelegate(this.selector, e, i),
- this
- }
- ,
- t.fn.on = function(i, o, r, l, h) {
- var d, c, u = this;
- return i && !n(i) ? (t.each(i, (function(t, e) {
- u.on(t, o, r, e, h)
- }
- )),
- u) : (n(o) || s(l) || !1 === l || (l = r,
- r = o,
- o = e),
- (s(r) || !1 === r) && (l = r,
- r = e),
- !1 === l && (l = y),
- u.each((function(e, s) {
- h && (d = function(t) {
- return g(s, t.type, l),
- l.apply(this, arguments)
- }
- ),
- o && (c = function(e) {
- var i, n = t(e.target).closest(o, s).get(0);
- if (n && n !== s)
- return i = t.extend(x(e), {
- currentTarget: n,
- liveFired: s
- }),
- (d || l).apply(n, [i].concat(a.call(arguments, 1)))
- }
- ),
- f(s, i, l, r, o, c || d)
- }
- )))
- }
- ,
- t.fn.off = function(i, a, o) {
- var r = this;
- return i && !n(i) ? (t.each(i, (function(t, e) {
- r.off(t, a, e)
- }
- )),
- r) : (n(a) || s(o) || !1 === o || (o = a,
- a = e),
- !1 === o && (o = y),
- r.each((function() {
- g(this, i, o, a)
- }
- )))
- }
- ,
- t.fn.trigger = function(e, i) {
- return (e = n(e) || t.isPlainObject(e) ? t.Event(e) : k(e))._args = i,
- this.each((function() {
- "dispatchEvent"in this ? this.dispatchEvent(e) : t(this).triggerHandler(e, i)
- }
- ))
- }
- ,
- t.fn.triggerHandler = function(e, i) {
- var a, s;
- return this.each((function(o, r) {
- (a = x(n(e) ? t.Event(e) : e))._args = i,
- a.target = r,
- t.each(u(r, e.type || e), (function(t, e) {
- if (s = e.proxy(a),
- a.isImmediatePropagationStopped())
- return !1
- }
- ))
- }
- )),
- s
- }
- ,
- "focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach((function(e) {
- t.fn[e] = function(t) {
- return t ? this.bind(e, t) : this.trigger(e)
- }
- }
- )),
- ["focus", "blur"].forEach((function(e) {
- t.fn[e] = function(t) {
- return t ? this.bind(e, t) : this.each((function() {
- try {
- this[e]()
- } catch (t) {}
- }
- )),
- this
- }
- }
- )),
- t.Event = function(t, e) {
- n(t) || (t = (e = t).type);
- var i = document.createEvent(r[t] || "Events")
- , a = !0;
- if (e)
- for (var s in e)
- "bubbles" == s ? a = !!e[s] : i[s] = e[s];
- return i.initEvent(t, a, !0),
- k(i)
- }
- }(dt),
- function(t) {
- var e, i, a = 0, s = window.document, n = /<script\b[^<]*(?:(?!<\/script\b)[^<]*)*<\/script\b[^>]*>/gi, o = /^(?:text|application)\/javascript/i, r = /^(?:text|application)\/xml/i, l = "application/json", h = "text/html", d = /^\s*$/;
- function c(e, i, a, n) {
- if (e.global)
- return function(e, i, a) {
- var s = t.Event(i);
- return t(e).trigger(s, a),
- !s.isDefaultPrevented()
- }(i || s, a, n)
- }
- function u(t, e) {
- var i = e.context;
- if (!1 === e.beforeSend.call(i, t, e) || !1 === c(e, i, "ajaxBeforeSend", [t, e]))
- return !1;
- c(e, i, "ajaxSend", [t, e])
- }
- function m(t, e, i, a) {
- var s = i.context
- , n = "success";
- i.success.call(s, t, n, e),
- a && a.resolveWith(s, [t, n, e]),
- c(i, s, "ajaxSuccess", [e, i, t]),
- p(n, e, i)
- }
- function _(t, e, i, a, s) {
- var n = a.context;
- a.error.call(n, i, e, t),
- s && s.rejectWith(n, [i, e, t]),
- c(a, n, "ajaxError", [i, a, t || e]),
- p(e, i, a)
- }
- function p(e, i, a) {
- var s = a.context;
- a.complete.call(s, i, e),
- c(a, s, "ajaxComplete", [i, a]),
- function(e) {
- e.global && !--t.active && c(e, null, "ajaxStop")
- }(a)
- }
- function f() {}
- function g(t, e) {
- return "" == e ? t : (t + "&" + e).replace(/[&?]{1,2}/, "?")
- }
- function v(e, i, a, s) {
- var n = !t.isFunction(i);
- return {
- url: e,
- data: n ? i : void 0,
- success: n ? t.isFunction(a) ? a : void 0 : i,
- dataType: n && s || a
- }
- }
- t.active = 0,
- t.ajaxJSONP = function(e, i) {
- if (!("type"in e))
- return t.ajax(e);
- var n, o, r = e.jsonpCallback, l = (t.isFunction(r) ? r() : r) || "jsonp" + ++a, h = s.createElement("script"), d = window[l], c = function(e) {
- t(h).triggerHandler("error", e || "abort")
- }, p = {
- abort: c
- };
- return i && i.promise(p),
- t(h).on("load error", (function(a, s) {
- clearTimeout(o),
- t(h).off().remove(),
- "error" != a.type && n ? m(n[0], p, e, i) : _(null, s || "error", p, e, i),
- window[l] = d,
- n && t.isFunction(d) && d(n[0]),
- d = n = void 0
- }
- )),
- !1 === u(p, e) ? (c("abort"),
- p) : (window[l] = function() {
- n = arguments
- }
- ,
- h.src = e.url.replace(/\?(.+)=\?/, "?$1=" + l),
- s.head.appendChild(h),
- e.timeout > 0 && (o = setTimeout((function() {
- c("timeout")
- }
- ), e.timeout)),
- p)
- }
- ,
- t.ajaxSettings = {
- type: "GET",
- beforeSend: f,
- success: f,
- error: f,
- complete: f,
- context: null,
- global: !0,
- xhr: function() {
- return new window.XMLHttpRequest
- },
- accepts: {
- script: "text/javascript, application/javascript, application/x-javascript",
- json: l,
- xml: "application/xml, text/xml",
- html: h,
- text: "text/plain"
- },
- crossDomain: !1,
- timeout: 0,
- processData: !0,
- cache: !0
- },
- t.ajax = function(a) {
- var s = t.extend({}, a || {})
- , n = t.Deferred && t.Deferred();
- for (e in t.ajaxSettings)
- void 0 === s[e] && (s[e] = t.ajaxSettings[e]);
- !function(e) {
- e.global && 0 == t.active++ && c(e, null, "ajaxStart")
- }(s),
- s.crossDomain || (s.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(s.url) && RegExp.$2 != window.location.host),
- s.url || (s.url = window.location.toString()),
- function(e) {
- e.processData && e.data && "string" != t.type(e.data) && (e.data = t.param(e.data, e.traditional)),
- !e.data || e.type && "GET" != e.type.toUpperCase() || (e.url = g(e.url, e.data),
- e.data = void 0)
- }(s),
- !1 === s.cache && (s.url = g(s.url, "_=" + Date.now()));
- var p = s.dataType
- , v = /\?.+=\?/.test(s.url);
- if ("jsonp" == p || v)
- return v || (s.url = g(s.url, s.jsonp ? s.jsonp + "=?" : !1 === s.jsonp ? "" : "callback=?")),
- t.ajaxJSONP(s, n);
- var y, b = s.accepts[p], w = {}, k = function(t, e) {
- w[t.toLowerCase()] = [t, e]
- }, x = /^([\w-]+:)\/\//.test(s.url) ? RegExp.$1 : window.location.protocol, T = s.xhr(), M = T.setRequestHeader;
- if (n && n.promise(T),
- s.crossDomain || k("X-Requested-With", "XMLHttpRequest"),
- k("Accept", b || "*/*"),
- (b = s.mimeType || b) && (b.indexOf(",") > -1 && (b = b.split(",", 2)[0]),
- T.overrideMimeType && T.overrideMimeType(b)),
- (s.contentType || !1 !== s.contentType && s.data && "GET" != s.type.toUpperCase()) && k("Content-Type", s.contentType || "application/x-www-form-urlencoded"),
- s.headers)
- for (i in s.headers)
- k(i, s.headers[i]);
- if (T.setRequestHeader = k,
- T.onreadystatechange = function() {
- if (4 == T.readyState) {
- T.onreadystatechange = f,
- clearTimeout(y);
- var e, i = !1;
- if (T.status >= 200 && T.status < 300 || 304 == T.status || 0 == T.status && "file:" == x) {
- p = p || function(t) {
- return t && (t = t.split(";", 2)[0]),
- t && (t == h ? "html" : t == l ? "json" : o.test(t) ? "script" : r.test(t) && "xml") || "text"
- }(s.mimeType || T.getResponseHeader("content-type")),
- e = T.responseText;
- try {
- "script" == p ? (0,
- eval)(e) : "xml" == p ? e = T.responseXML : "json" == p && (e = d.test(e) ? null : t.parseJSON(e))
- } catch (t) {
- i = t
- }
- i ? _(i, "parsererror", T, s, n) : m(e, T, s, n)
- } else
- _(T.statusText || null, T.status ? "error" : "abort", T, s, n)
- }
- }
- ,
- !1 === u(T, s))
- return T.abort(),
- _(null, "abort", T, s, n),
- T;
- if (s.xhrFields)
- for (i in s.xhrFields)
- T[i] = s.xhrFields[i];
- var E = !("async"in s) || s.async;
- for (i in T.open(s.type, s.url, E, s.username, s.password),
- w)
- M.apply(T, w[i]);
- return s.timeout > 0 && (y = setTimeout((function() {
- T.onreadystatechange = f,
- T.abort(),
- _(null, "timeout", T, s, n)
- }
- ), s.timeout)),
- T.send(s.data ? s.data : null),
- T
- }
- ,
- t.get = function(e, i, a, s) {
- return t.ajax(v.apply(null, arguments))
- }
- ,
- t.post = function(e, i, a, s) {
- var n = v.apply(null, arguments);
- return n.type = "POST",
- t.ajax(n)
- }
- ,
- t.getJSON = function(e, i, a) {
- var s = v.apply(null, arguments);
- return s.dataType = "json",
- t.ajax(s)
- }
- ,
- t.fetchJSON = function(t) {
- var e = new XMLHttpRequest;
- return new Promise((function(i, a) {
- e.onreadystatechange = function() {
- try {
- if (4 !== e.readyState)
- return;
- if (e.status >= 200 && e.status < 300) {
- var s = JSON.parse(e.responseText);
- i(s)
- } else
- a({
- status: e.status,
- statusText: e.statusText
- })
- } catch (e) {
- a({
- status: 400,
- statusText: `Error fetching JSON from ${t}: ${e}`
- })
- }
- }
- ,
- e.open("GET", t, !0),
- e.send()
- }
- ))
- }
- ,
- t.fn.load = function(e, i, a) {
- if (!this.length)
- return this;
- var s, o = this, r = e.split(/\s/), l = v(e, i, a), h = l.success;
- return r.length > 1 && (l.url = r[0],
- s = r[1]),
- l.success = function(e) {
- var safeHTML = DOMPurify.sanitize(e);
- o.html(s
- ? t("<div>").html(safeHTML).find(s)
- : safeHTML);
- h && h.apply(o, arguments);
- }
- ,
- t.ajax(l),
- this
- }
- ;
- var y = encodeURIComponent;
- function b(e, i, a, s) {
- var n, o = t.isArray(i), r = t.isPlainObject(i);
- t.each(i, (function(i, l) {
- n = t.type(l),
- s && (i = a ? s : s + "[" + (r || "object" == n || "array" == n ? i : "") + "]"),
- !s && o ? e.add(l.name, l.value) : "array" == n || !a && "object" == n ? b(e, l, a, i) : e.add(i, l)
- }
- ))
- }
- t.param = function(t, e) {
- var i = [];
- return i.add = function(t, e) {
- this.push(y(t) + "=" + y(e))
- }
- ,
- b(i, t, e),
- i.join("&").replace(/%20/g, "+")
- }
- }(dt),
- (lt = dt).fn.serializeArray = function() {
- var t, e = [];
- return lt([].slice.call(this.get(0).elements)).each((function() {
- var i = (t = lt(this)).attr("type");
- "fieldset" != this.nodeName.toLowerCase() && !this.disabled && "submit" != i && "reset" != i && "button" != i && ("radio" != i && "checkbox" != i || this.checked) && e.push({
- name: t.attr("name"),
- value: t.val()
- })
- }
- )),
- e
- }
- ,
- lt.fn.serialize = function() {
- var t = [];
- return this.serializeArray().forEach((function(e) {
- t.push(encodeURIComponent(e.name) + "=" + encodeURIComponent(e.value))
- }
- )),
- t.join("&")
- }
- ,
- lt.fn.submit = function(t) {
- if (t)
- this.bind("submit", t);
- else if (this.length) {
- var e = lt.Event("submit");
- this.eq(0).trigger(e),
- e.isDefaultPrevented() || this.get(0).submit()
- }
- return this
- }
- ,
- function(t) {
- "__proto__"in {} || t.extend(t.zepto, {
- Z: function(e, i) {
- return e = e || [],
- t.extend(e, t.fn),
- e.selector = i || "",
- e.__Z = !0,
- e
- },
- isZ: function(e) {
- return "array" === t.type(e) && "__Z"in e
- }
- });
- try {
- getComputedStyle(void 0)
- } catch (t) {
- var e = getComputedStyle;
- window.getComputedStyle = function(t, i) {
- try {
- return e(t, i)
- } catch (t) {
- return null
- }
- }
- }
- }(dt);
- const ct = dt.getJSON
- , ut = dt.ajax
- , mt = dt.fetchJSON
- , _t = [["millisecond", 1, function(t) {}
- ], ["second", 1e3, function(t) {
- t.setMilliseconds(0)
- }
- ], ["minute", 6e4, function(t) {
- t.setSeconds(0)
- }
- ], ["hour", 36e5, function(t) {
- t.setMinutes(0)
- }
- ], ["day", 864e5, function(t) {
- t.setHours(0)
- }
- ], ["month", 2592e6, function(t) {
- t.setDate(1)
- }
- ], ["year", 31536e6, function(t) {
- t.setMonth(0)
- }
- ], ["decade", 31536e7, function(t) {
- var e = t.getFullYear();
- t.setFullYear(e - e % 10)
- }
- ], ["century", 31536e8, function(t) {
- var e = t.getFullYear();
- t.setFullYear(e - e % 100)
- }
- ], ["millennium", 31536e9, function(t) {
- var e = t.getFullYear();
- t.setFullYear(e - e % 1e3)
- }
- ]]
- , pt = ["millisecond", "second", "minute", "hour", "day", "month", "year"]
- , ft = /^([\+-]?\d+?)(-\d{2}?)?(-\d{2}?)?$/
- , gt = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/
- , vt = {
- base: {
- millisecond: "time_short",
- second: "time",
- minute: "time_no_seconds_small_date",
- hour: "time_no_seconds_small_date",
- day: "full",
- month: "month",
- year: "year",
- decade: "year",
- century: "year",
- millennium: "year",
- age: "fallback",
- epoch: "fallback",
- era: "fallback",
- eon: "fallback",
- eon2: "fallback"
- },
- short: {
- millisecond: "time_short",
- second: "time_short",
- minute: "time_no_seconds_short",
- hour: "time_no_minutes_short",
- day: "full_short",
- month: "month_short",
- year: "year",
- decade: "year",
- century: "year",
- millennium: "year",
- age: "fallback",
- epoch: "fallback",
- era: "fallback",
- eon: "fallback",
- eon2: "fallback"
- }
- }
- , yt = it.extend({
- initialize: function(t, e, i) {
- "number" == typeof t ? this.data = {
- format: "yyyy mmmm",
- date_obj: new Date(t)
- } : Date == t.constructor ? this.data = {
- format: "yyyy mmmm",
- date_obj: t
- } : (this.data = JSON.parse(JSON.stringify(t)),
- this._createDateObj()),
- t.format && !e && (e = t.format),
- this._setFormat(e, i)
- },
- setDateFormat: function(t) {
- this.data.format = t
- },
- getDisplayDate: function(t, e) {
- if (this.data.display_date)
- return this.data.display_date;
- t || (t = Nt.fallback),
- t.constructor != Nt && (S("First argument to getDisplayDate must be type Language"),
- t = Nt.fallback);
- var i = e || this.data.format;
- return t.formatDate(this.data.date_obj, i)
- },
- getMillisecond: function() {
- return this.getTime()
- },
- getTime: function() {
- return this.data.date_obj.getTime()
- },
- isBefore: function(t) {
- if (!this.data.date_obj.constructor == t.data.date_obj.constructor)
- throw new x("date_compare_err");
- return "isBefore"in this.data.date_obj ? this.data.date_obj.isBefore(t.data.date_obj) : this.data.date_obj < t.data.date_obj
- },
- isAfter: function(t) {
- if (!this.data.date_obj.constructor == t.data.date_obj.constructor)
- throw new x("date_compare_err");
- return "isAfter"in this.data.date_obj ? this.data.date_obj.isAfter(t.data.date_obj) : this.data.date_obj > t.data.date_obj
- },
- floor: function(t) {
- for (var e = new Date(this.data.date_obj.getTime()), i = 0; i < _t.length; i++)
- if (_t[i][2](e),
- _t[i][0] == t)
- return new yt(e);
- throw new x("invalid_scale_err",t)
- },
- _getDateData: function() {
- var t = {
- year: 0,
- month: 1,
- day: 1,
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0
- };
- for (var e in E(t, this.data),
- pt) {
- if (!O(t[pt[e]]).match(/^-?\d*$/))
- throw new x("invalid_date_err",pt[e] + " = '" + t[pt[e]] + "'");
- var i = parseInt(t[pt[e]]);
- isNaN(i) && (i = 4 == e || 5 == e ? 1 : 0),
- t[pt[e]] = i
- }
- return t.month > 0 && t.month <= 12 && (t.month = t.month - 1),
- t
- },
- _createDateObj: function() {
- var t = this._getDateData();
- this.data.date_obj = new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond),
- this.data.date_obj.getFullYear() != t.year && this.data.date_obj.setFullYear(t.year)
- },
- findBestFormat: function(t) {
- for (var e = pt, i = 0; i < e.length; i++)
- if (this.data[e[i]])
- return t ? t in vt || (t = "short") : t = "base",
- vt[t][e[i]];
- return ""
- },
- _setFormat: function(t, e) {
- t ? this.data.format = t : this.data.format || (this.data.format = this.findBestFormat()),
- e ? this.data.format_short = e : this.data.format_short || (this.data.format_short = this.findBestFormat(!0))
- },
- getFullYear: function() {
- return this.data.date_obj.getFullYear()
- }
- });
- function bt(t) {
- if (t.match(ft)) {
- var e = t.match(ft).slice(1)
- , i = {
- year: e[0].replace("+", "")
- };
- return e[1] && (i.month = e[1].replace("-", "")),
- e[2] && (i.day = e[2].replace("-", "")),
- i
- }
- if (t.match(gt))
- return cls.parseISODate(t);
- if (t.match(/^\-?\d+$/))
- return {
- year: t
- };
- var a = {};
- if (t.match(/\d+\/\d+\/\d+/)) {
- var s = t.match(/\d+\/\d+\/\d+/)[0];
- t = O(t.replace(s, ""));
- var n = s.split("/");
- a.month = n[0],
- a.day = n[1],
- a.year = n[2]
- }
- if (t.match(/\d+\/\d+/) && (s = t.match(/\d+\/\d+/)[0],
- t = O(t.replace(s, "")),
- n = s.split("/"),
- a.month = n[0],
- a.year = n[1]),
- t.match(":")) {
- var o = t.split(":");
- if (a.hour = o[0],
- a.minute = o[1],
- o[2]) {
- let t = o[2].split(".");
- a.second = t[0],
- a.millisecond = t[1]
- }
- }
- return a
- }
- const wt = it.extend({
- initialize: function(t) {
- if (this.year = parseInt(t),
- isNaN(this.year))
- throw new x("invalid_year_err",t)
- },
- isBefore: function(t) {
- return this.year < t.year
- },
- isAfter: function(t) {
- return this.year > t.year
- },
- getTime: function() {
- return this.year
- }
- })
- , kt = 1e6
- , xt = 10 * kt
- , Tt = 10 * xt
- , Mt = 10 * Tt;
- function Et(t) {
- return function(e) {
- var i = e.getTime();
- return new wt(Math.floor(i / t) * t)
- }
- }
- const Lt = [["year", 1, new Et(1)], ["decade", 10, new Et(10)], ["century", 100, new Et(100)], ["millennium", 1e3, new Et(1e3)], ["age", kt, new Et(kt)], ["epoch", xt, new Et(xt)], ["era", Tt, new Et(Tt)], ["eon", Mt, new Et(Mt)]]
- , Dt = yt.extend({
- initialize: function(t, e, i) {
- wt == t.constructor ? this.data = {
- date_obj: t
- } : (this.data = JSON.parse(JSON.stringify(t)),
- this._createDateObj()),
- t.format && !e && (e = t.format),
- this._setFormat(e, i)
- },
- _createDateObj: function() {
- var t = this._getDateData();
- this.data.date_obj = new wt(t.year)
- },
- floor: function(t) {
- for (var e = 0; e < Lt.length; e++)
- if (Lt[e][0] == t) {
- var i = Lt[e][2](this.data.date_obj);
- return new Dt(i)
- }
- throw new x("invalid_scale_err",t)
- },
- getFullYear: function() {
- return this.data.date_obj.getTime()
- }
- })
- , St = new RegExp(/\$\{(.+?)\}/g);
- class Nt {
- constructor(t, e) {
- for (let t in It.en)
- this[t] = It.en[t];
- if (t && "string" == typeof t && "en" != t) {
- var i = t;
- if (!(i in It)) {
- console.log(`Expected language ${i} to be cached. Did you call the constructor directly?`);
- var a = At(i, e);
- mt(a).then((t => {
- It[i] = t
- }
- )).catch((t => {
- console.log(`Error loading language [${a}] ${t.statusText} [${t.status}]`)
- }
- ))
- }
- E(this, It[i])
- }
- }
- mergeData(t) {
- for (k in It.en)
- t[k] && ("object" == typeof this[k] ? E(t[k], this[k]) : this[k] = t[k])
- }
- formatBigYear(t, e) {
- var i = t.year
- , a = this.bigdateformats[e] || this.bigdateformats.fallback;
- if (a) {
- for (var s = 0; s < a.length; s++) {
- var n = a[s];
- if (Math.abs(i / n[0]) > 1)
- return Ct(Math.abs(i / n[0]), n[1])
- }
- return i.toString()
- }
- return S("Language file dateformats missing cosmological. Falling back."),
- Ct(i, e)
- }
- _(t, e) {
- let i = this.messages[t] || Nt.fallback.messages[t] || t;
- if (i.match(St)) {
- if (!e)
- throw new x("template_message_without_context");
- for (let t of i.matchAll(St)) {
- if (!(t[1]in e))
- throw new x("template_message_without_context");
- i = i.replace(t[0], e[t[1]])
- }
- }
- return i
- }
- formatDate(t, e) {
- return t.constructor == Date ? this.formatJSDate(t, e) : t.constructor == wt ? this.formatBigYear(t, e) : t.data && t.data.date_obj ? this.formatDate(t.data.date_obj, e) : (S("Unfamiliar date presented for formatting"),
- t.toString())
- }
- formatJSDate(t, e) {
- var i = this
- , a = function(t, e) {
- var a = i.period_labels[t];
- return a && (t = e < 12 ? a[0] : a[1]),
- "<span class='tl-timeaxis-timesuffix'>" + t + "</span>"
- };
- e || (e = "full");
- var s = this.dateformats[e] || Nt.fallback.dateformats[e];
- s || (s = e);
- var n = "get"
- , o = t[n + "Date"]()
- , r = t[n + "Day"]()
- , l = t[n + "Month"]()
- , h = t[n + "FullYear"]()
- , d = t[n + "Hours"]()
- , c = t[n + "Minutes"]()
- , u = t[n + "Seconds"]()
- , m = t[n + "Milliseconds"]()
- , _ = t.getTimezoneOffset()
- , p = {
- d: o,
- dd: N(o),
- ddd: this.date.day_abbr[r],
- dddd: this.date.day[r],
- m: l + 1,
- mm: N(l + 1),
- mmm: this.date.month_abbr[l],
- mmmm: this.date.month[l],
- yy: String(h).slice(2),
- yyyy: h < 0 && this.has_negative_year_modifier() ? Math.abs(h) : h,
- h: d % 12 || 12,
- hh: N(d % 12 || 12),
- H: d,
- HH: N(d),
- M: c,
- MM: N(c),
- s: u,
- ss: N(u),
- l: N(m, 3),
- L: N(m > 99 ? Math.round(m / 10) : m),
- t: a("t", d),
- tt: a("tt", d),
- T: a("T", d),
- TT: a("TT", d),
- Z: (String(t).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g) || [""]).pop().replace(/[^-+\dA-Z]/g, ""),
- o: (_ > 0 ? "-" : "+") + N(100 * Math.floor(Math.abs(_) / 60) + Math.abs(_) % 60, 4),
- S: ["th", "st", "nd", "rd"][o % 10 > 3 ? 0 : (o % 100 - o % 10 != 10) * o % 10]
- }
- , f = s.replace(Nt.DATE_FORMAT_TOKENS, (function(t) {
- return t in p ? p[t] : t.slice(1, t.length - 1)
- }
- ));
- return this._applyEra(f, h)
- }
- has_negative_year_modifier() {
- return Boolean(this.era_labels.negative_year.prefix || this.era_labels.negative_year.suffix)
- }
- _applyEra(t, e) {
- var i = e < 0 ? this.era_labels.negative_year : this.era_labels.positive_year
- , a = "";
- return i.prefix && (a += "<span>" + i.prefix + "</span> "),
- a += t,
- i.suffix && (a += " <span>" + i.suffix + "</span>"),
- a
- }
- }
- function At(t, e) {
- if (/\.json$/.test(t))
- var i = t;
- else {
- var a = "/locale/" + t + ".json";
- /\/$/.test(e) && (a = a.substr(1)),
- i = e + a
- }
- return i
- }
- function Ct(t, e) {
- if (e.match(/%(\.(\d+))?f/)) {
- var i = e.match(/%(\.(\d+))?f/)
- , a = i[0];
- return i[2] && (t = t.toFixed(i[2])),
- e.replace(a, t)
- }
- return e
- }
- Nt.fallback = {
- messages: {}
- },
- Nt.DATE_FORMAT_TOKENS = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g;
- var It = {
- en: {
- name: "English (built-in)",
- lang: "en",
- api: {
- wikipedia: "en"
- },
- messages: {
- loading: "Loading",
- wikipedia: "From Wikipedia, the free encyclopedia",
- error: "Error",
- return_to_title: "Return to Title",
- go_to_end: "Go to the last slide",
- loading_content: "Loading Content",
- loading_timeline: "Loading Timeline... ",
- swipe_to_navigate: "Swipe to Navigate<br><span class='tl-button'>OK</span>",
- zoom_in: "Zoom in",
- zoom_out: "Zoom out",
- unknown_read_err: "An unexpected error occurred trying to read your spreadsheet data",
- invalid_url_err: "Unable to read Timeline data. Make sure your URL is for a Google Spreadsheet or a Timeline JSON file.",
- network_err: "Unable to read your Google Spreadsheet. Make sure you have published it to the web.",
- missing_start_date_err: "Missing start_date",
- invalid_start_time_without_date: "Invalid configuration: time cannot be used without date.",
- invalid_end_time_without_date: "Invalid configuration: end time cannot be used without end date.",
- date_compare_err: "Can't compare timeline date objects on different scales",
- invalid_scale_err: "Invalid scale",
- invalid_date_err: "Invalid date: month, day and year must be numbers.",
- invalid_separator_error: "Invalid time: misuse of : or . as separator.",
- invalid_hour_err: "Invalid time (hour)",
- invalid_minute_err: "Invalid time (minute)",
- invalid_second_err: "Invalid time (second)",
- invalid_fractional_err: "Invalid time (fractional seconds)",
- invalid_second_fractional_err: "Invalid time (seconds and fractional seconds)",
- invalid_year_err: "Invalid year",
- flickr_notfound_err: "Photo not found or private",
- flickr_invalidurl_err: "Invalid Flickr URL",
- imgur_invalidurl_err: "Invalid Imgur URL",
- twitter_load_err: "Unable to load Tweet",
- twitterembed_invalidurl_err: "Invalid Twitter Embed url",
- wikipedia_load_err: "Unable to load Wikipedia entry",
- wikipedia_image_load_err: "Unable to load Wikipedia image data",
- spotify_invalid_url: "Invalid Spotify URL",
- invalid_rgb_err: "Invalid RGB argument",
- time_scale_scale_err: "Don't know how to get date from time for scale",
- axis_helper_no_options_err: "Axis helper must be configured with options",
- axis_helper_scale_err: "No AxisHelper available for scale",
- invalid_integer_option: "Invalid option value—must be a whole number.",
- instagram_bad_request: "Invalid or private Instagram URL",
- template_message_without_context: "Required variables not provided for template translation message",
- aria_label_timeline: "Timeline",
- aria_label_timeline_navigation: "Timeline navigation",
- aria_label_timeline_content: "Timeline content",
- aria_label_zoomin: "Show less than ${start} to ${end}",
- aria_label_zoomout: "Show more than ${start} to ${end}"
- },
- date: {
- month: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
- month_abbr: ["Jan.", "Feb.", "March", "April", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."],
- day: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
- day_abbr: ["Sun.", "Mon.", "Tues.", "Wed.", "Thurs.", "Fri.", "Sat."]
- },
- era_labels: {
- positive_year: {
- prefix: "",
- suffix: ""
- },
- negative_year: {
- prefix: "",
- suffix: "BCE"
- }
- },
- period_labels: {
- t: ["a", "p"],
- tt: ["am", "pm"],
- T: ["A", "P"],
- TT: ["AM", "PM"]
- },
- dateformats: {
- year: "yyyy",
- month_short: "mmm",
- month: "mmmm yyyy",
- full_short: "mmm d",
- full: "mmmm d',' yyyy",
- time: "h:MM:ss TT' <small>'mmmm d',' yyyy'</small>'",
- time_short: "h:MM:ss TT",
- time_no_seconds_short: "h:MM TT",
- time_no_minutes_short: "h TT",
- time_no_seconds_small_date: "h:MM TT' <small>'mmmm d',' yyyy'</small>'",
- time_milliseconds: "l",
- full_long: "mmm d',' yyyy 'at' h:MM TT",
- full_long_small_date: "h:MM TT' <small>mmm d',' yyyy'</small>'"
- },
- bigdateformats: {
- fallback: [[1e9, "%.2f billion years ago"], [1e6, "%.1f million years ago"], [1e3, "%.1f thousand years ago"], [1, "%f years ago"]],
- compact: [[1e9, "%.2f bya"], [1e6, "%.1f mya"], [1e3, "%.1f kya"], [1, "%f years ago"]],
- verbose: [[1e9, "%.2f billion years ago"], [1e6, "%.1f million years ago"], [1e3, "%.1f thousand years ago"], [1, "%f years ago"]]
- }
- }
- };
- let Ot = new Nt;
- Nt.fallback = Ot;
- class Rt {
- setLanguage(t) {
- this.language = t
- }
- getLanguage() {
- if (this.language) {
- if ("object" == typeof this.language)
- return this.language;
- S("I18NMixins.getLanguage: this.language should be object, but is " + typeof this.language)
- }
- return Ot
- }
- _(t, e) {
- return this.getLanguage()._(t, e)
- }
- }
- class jt {
- constructor(t, e, i) {
- i && this.setLanguage(i),
- this._el = {
- parent: {},
- container: {},
- message_container: {},
- loading_icon: {},
- message: {}
- },
- this.options = {
- width: 600,
- height: 600,
- message_class: "tl-message",
- message_icon_class: "tl-loading-icon"
- },
- this.container = t,
- E(this.options, e),
- this._el.container = v("div", this.options.message_class),
- t && (t.appendChild(this._el.container),
- this._el.parent = t),
- this.animator = {},
- this._initLayout(),
- this._initEvents()
- }
- updateMessage(t) {
- this._el.message.innerHTML = t || this._("loading"),
- !this._el.parent.atributes && this.container.attributes && (this.container.appendChild(this._el.container),
- this._el.parent = this.container)
- }
- updateDisplay(t, e) {}
- _onMouseClick() {
- this.fire("clicked", this.options)
- }
- _onRemove() {
- this._el.parent = {}
- }
- _initLayout() {
- this._el.message_container = v("div", "tl-message-container", this._el.container),
- this._el.loading_icon = v("div", this.options.message_icon_class, this._el.message_container),
- this._el.message = v("div", "tl-message-content", this._el.message_container),
- this.updateMessage()
- }
- _initEvents() {
- ht.addListener(this._el.container, "click", this._onMouseClick, this),
- ht.addListener(this, "removed", this._onRemove, this)
- }
- }
- function Pt(t, e) {
- e = e || "start_date",
- t.sort((function(t, i) {
- return t[e].isBefore(i[e]) ? -1 : t[e].isAfter(i[e]) ? 1 : 0
- }
- ))
- }
- function zt(t) {
- var e = {
- hour: null,
- minute: null,
- second: null,
- millisecond: null
- }
- , i = null
- , a = t.match(/(\s*[AaPp]\.?[Mm]\.?\s*)$/);
- a && (i = O(a[0]),
- t = O(t.substring(0, t.lastIndexOf(i))));
- var s = []
- , n = t.match(/^\s*(\d{1,2})(\d{2})\s*$/);
- if (n ? s = n.slice(1) : 1 == (s = t.split(":")).length && (s = t.split(".")),
- s.length > 4)
- throw new x("invalid_separator_error");
- let o = s[0];
- if (e.hour = parseInt(o),
- i && "p" == i.toLowerCase()[0] && 12 != e.hour ? e.hour += 12 : i && "a" == i.toLowerCase()[0] && 12 == e.hour && (e.hour = 0),
- isNaN(e.hour) || e.hour < 0 || e.hour > 23)
- throw new x("invalid_hour_err",o);
- if (s.length > 1) {
- let t = s[1];
- if (e.minute = parseInt(t),
- isNaN(e.minute))
- throw new x("invalid_minute_err",t)
- }
- if (s.length > 2) {
- var r = s[2].split(/[\.,]/);
- if ((s = r.concat(s.slice(3))).length > 2)
- throw new x("invalid_second_fractional_err");
- if (e.second = parseInt(s[0]),
- isNaN(e.second))
- throw new x("invalid_second_err",s[0]);
- if (2 == s.length) {
- var l = parseInt(s[1]);
- if (isNaN(l))
- throw new x("invalid_fractional_err",s[1]);
- e.millisecond = 100 * l
- }
- }
- return e
- }
- R(jt, Rt, at, ot);
- const Ht = new RegExp("(^-?\\d+$|^$)");
- function Ft(t) {
- try {
- return Object.keys(t).forEach((e => {
- let i = t[e];
- if (i && i.match && !i.match(Ht))
- throw `invalid value ${i} for ${e}`
- }
- )),
- !0
- } catch (t) {
- return !1
- }
- }
- const qt = {
- human: yt,
- cosmological: Dt
- };
- var $t = i(838)
- , Ut = i.n($t);
- const Bt = {
- text: ["headline", "text"],
- media: ["caption", "credit"]
- }
- , Wt = {
- start_date: ["display_date"],
- end_date: ["display_date"],
- slide: ["display_date", "group"],
- date: ["display_date"]
- };
- function Gt(t, e, i) {
- Object.keys(i).forEach((a => {
- var s = "slide" == a ? t : t[a];
- s && i[a].forEach((t => {
- void 0 !== s[t] && (s[t] = e(s[t]))
- }
- ))
- }
- ))
- }
- function Yt(t) {
- return Ut().sanitize(t, {
- ADD_TAGS: ["iframe"],
- ADD_ATTR: ["frameborder", "target"]
- })
- }
- Ut().addHook("afterSanitizeAttributes", (function(t) {
- if ("A" == t.nodeName && "href"in t) {
- "target"in t.attributes || t.setAttribute("target", "_blank");
- let e = t.attributes.rel;
- e ? -1 == e.value.indexOf("noopener") && t.setAttribute("rel", `noopener ${e.value}`) : t.setAttribute("rel", "noopener")
- }
- }
- ));
- class Zt {
- constructor(t) {
- if (this.title = "",
- this.scale = "",
- this.events = [],
- this.eras = [],
- this.event_dict = {},
- this.messages = {
- errors: [],
- warnings: []
- },
- "object" == typeof t && t.events) {
- if (this.scale = t.scale,
- this.events = [],
- this._ensureValidScale(t.events),
- t.title) {
- var e = this._assignID(t.title);
- this._tidyFields(t.title),
- this.title = t.title,
- this.event_dict[e] = this.title
- }
- for (var i = 0; i < t.events.length; i++)
- try {
- this.addEvent(t.events[i], !0)
- } catch (t) {
- this.logError(t)
- }
- t.eras && t.eras.forEach(( (t, e) => {
- try {
- this.addEra(t)
- } catch (t) {
- this.logError("Era " + e + ": " + t)
- }
- }
- )),
- Pt(this.events),
- Pt(this.eras)
- }
- }
- logError(t) {
- S(`logError: ${t}`),
- this.messages.errors.push(t)
- }
- getErrors(t) {
- return t ? this.messages.errors.join(t) : this.messages.errors
- }
- validate() {
- void 0 !== this.events && void 0 !== this.events.length && 0 != this.events.length || this.logError("Timeline configuration has no events.");
- for (var t = 0; t < this.eras.length; t++) {
- var e;
- void 0 !== this.eras[t].start_date && void 0 !== this.eras[t].end_date || (e = this.eras[t].headline ? this.eras[t].headline : "era " + (t + 1),
- this.logError("All eras must have start and end dates. [" + e + "]"))
- }
- }
- isValid() {
- return 0 == this.messages.errors.length
- }
- addEvent(t, e) {
- var i = this._assignID(t);
- return void 0 === t.start_date ? (S("Missing start date, skipping event"),
- console.log(t),
- null) : (this._processDates(t),
- this._tidyFields(t),
- this.events.push(t),
- this.event_dict[i] = t,
- e || Pt(this.events),
- i)
- }
- addEra(t) {
- var e = this._assignID(t);
- if (void 0 === t.start_date)
- throw new x("missing_start_date_err",e);
- this._processDates(t),
- this._tidyFields(t),
- this.eras.push({
- start_date: t.start_date,
- end_date: t.end_date,
- headline: t.text.headline
- })
- }
- _assignID(t) {
- var e = t.unique_id;
- return O(e) || (e = t.text ? j(t.text.headline) : null),
- t.unique_id = function(t, e) {
- if (e || (e = P(6)),
- !(e in t))
- return e;
- var i = e.match(/^(.+)(-\d+)?$/)[1]
- , a = [];
- for (let e in t)
- e.match(/^(.+?)(-\d+)?$/)[1] == i && a.push(e);
- e = i + "-" + (a.length + 1);
- for (var s = a.length; -1 != a.indexOf(e); s++)
- e = i + "-" + s;
- return e
- }(this.event_dict, e),
- t.unique_id
- }
- _makeUniqueIdentifiers(t, e) {
- for (var i = [t], a = 0; a < e.length; a++)
- O(e[a].unique_id) && (e[a].unique_id = j(e[a].unique_id),
- -1 == i.indexOf(e[a].unique_id) ? i.push(e[a].unique_id) : e[a].unique_id = "");
- if (i.length != e.length + 1)
- for (a = 0; a < e.length; a++)
- if (!e[a].unique_id) {
- var s = e[a].text ? j(e[a].text.headline) : null;
- s || (s = P(6)),
- -1 != i.indexOf(s) && (s = s + "-" + a),
- i.push(s),
- e[a].unique_id = s
- }
- }
- _ensureValidScale(t) {
- if (!this.scale) {
- this.scale = "human";
- for (var e = 0; e < t.length; e++) {
- if ("cosmological" == t[e].scale) {
- this.scale = "cosmological";
- break
- }
- if (t[e].start_date && void 0 !== t[e].start_date.year) {
- var i = new Dt(t[e].start_date).data.date_obj.year;
- if (i < -271820 || i > 275759) {
- this.scale = "cosmological";
- break
- }
- }
- }
- S(`Determining scale dynamically: ${this.scale}`)
- }
- qt[this.scale] || this.logError("Don't know how to process dates on scale " + this.scale)
- }
- _processDates(t) {
- var e = qt[this.scale];
- if (!(t.start_date instanceof e)) {
- var i = t.start_date;
- if (t.start_date = new e(i),
- void 0 !== t.end_date && !(t.end_date instanceof e)) {
- var a = t.end_date
- , s = !0;
- for (let t in i)
- s = s && i[t] == a[t];
- s ? (S("End date same as start date is redundant; dropping end date"),
- delete t.end_date) : t.end_date = new e(a)
- }
- }
- }
- getEarliestDate() {
- var t = this.events[0].start_date;
- return this.eras && this.eras.length > 0 && this.eras[0].start_date.isBefore(t) ? this.eras[0].start_date : t
- }
- getLatestDate() {
- for (var t = [], e = 0; e < this.events.length; e++)
- this.events[e].end_date ? t.push({
- date: this.events[e].end_date
- }) : t.push({
- date: this.events[e].start_date
- });
- for (e = 0; e < this.eras.length; e++)
- this.eras[e].end_date ? t.push({
- date: this.eras[e].end_date
- }) : t.push({
- date: this.eras[e].start_date
- });
- return Pt(t, "date"),
- t.slice(-1)[0].date
- }
- _tidyFields(t) {
- function e(t, e, i) {
- i || (i = ""),
- t.hasOwnProperty(e) || (t[e] = i)
- }
- t.group && (t.group = O(t.group)),
- t.text || (t.text = {}),
- e(t.text, "text"),
- e(t.text, "headline"),
- Gt(t, Yt, Bt),
- Gt(t, X, Wt)
- }
- }
- function Vt(t, e) {
- return !0 !== (e = e || {}).noHeaderRow && t.length > 0 ? {
- fields: t[0].map(( (t, e) => t && t.trim ? t.trim() : `untitled${e}`)),
- records: t.slice(1)
- } : {
- records: t
- }
- }
- function Xt(t, e) {
- (!e || e && !e.lineterminator) && (t = function(t, e) {
- return e && !e.lineterminator ? t.replace(/(\r\n|\n|\r)/gm, "\n") : t
- }(t, e));
- var i = function(t) {
- var e = {
- delimiter: ",",
- doublequote: !0,
- lineterminator: "\n",
- quotechar: '"',
- skipinitialspace: !0,
- skipinitialrows: 0
- };
- for (var i in t)
- "trim" === i ? e.skipinitialspace = t.trim : e[i.toLowerCase()] = t[i];
- return e
- }(e);
- t = function(t, e) {
- return null == t ? "" : (e = e || "\n",
- t.charAt(t.length - e.length) !== e ? t : t.substring(0, t.length - e.length))
- }(t, i.lineterminator);
- var a, s, n = "", o = !1, r = !1, l = "", h = [], d = [];
- for (s = function(t) {
- return !0 !== r && ("" === t ? t = null : !0 === i.skipinitialspace && (t = t.trim())),
- t
- }
- ,
- a = 0; a < t.length; a += 1)
- n = t.charAt(a),
- !1 !== o || n !== i.delimiter && n !== i.lineterminator ? n !== i.quotechar ? l += n : o ? t.charAt(a + 1) === i.quotechar ? (l += i.quotechar,
- a += 1) : o = !1 : (o = !0,
- r = !0) : (l = s(l),
- h.push(l),
- n === i.lineterminator && (d.push(h),
- h = []),
- l = "",
- r = !1);
- return l = s(l),
- h.push(l),
- d.push(h),
- i.skipinitialrows && (d = d.slice(i.skipinitialrows)),
- d
- }
- function Jt(t) {
- if (t)
- return t.replace(/[\s,]+/g, "")
- }
- function Kt(t) {
- let e = {
- key: null,
- worksheet: 0
- };
- var i = /\bkey=([-_A-Za-z0-9]+)&?/i
- , a = /docs\.google.com\/spreadsheets(.*?)\/d\//;
- if (t.match(i))
- e.key = t.match(i)[1];
- else if (t.match(a)) {
- var s = t.search(a) + t.match(a)[0].length
- , n = t.substr(s);
- e.key = n.split("/")[0],
- t.match(/\?gid=(\d+)/) && (e.worksheet = t.match(/\?gid=(\d+)/)[1])
- } else
- t.match(/^\b[-_A-Za-z0-9]+$/) && (e.key = t);
- return e.key ? e : null
- }
- async function Qt(t, e) {
- let i = [];
- t = function(t) {
- if ((t = t.trim()).match(/^[a-zA-Z0-9-_]+$/))
- return `https://docs.google.com/spreadsheets/d/${t}/pub?output=csv`;
- if (t.startsWith("https://docs.google.com/spreadsheets/")) {
- if (t.match(/\/pub\?output=csv$/))
- return t;
- let e = new URL(t)
- , i = new URLSearchParams(e.search);
- i.set("output", "csv"),
- i.get("gid") && i.set("single", "true"),
- e.search = `?${i.toString()}`;
- let a = e.pathname.substr(0, e.pathname.lastIndexOf("/"));
- return e.pathname = `${a}/pub`,
- e.toString()
- }
- throw new x("invalid_url_err",t)
- }(t),
- await async function(t) {
- return new Promise(( (e, i) => {
- if (t.data) {
- var a = Vt(Xt(t.data, t), t);
- a.useMemoryStore = !0,
- e(a)
- } else
- t.url && window.fetch(t.url, {
- mode: "cors"
- }).then((function(t) {
- if (200 == t.status)
- return t.text ? t.text() : t;
- "application/json" == t.headers.get("content-type") ? t.text().then((t => {
- i(JSON.parse(t))
- }
- )) : i({
- status_code: t.status,
- message: `Error fetching CSV: [${t.status} ${t.statusText}]`
- })
- }
- )).then((function(i) {
- if (i) {
- var a = function(t, e) {
- let i = Vt(Xt(t, e))
- , a = [];
- return i.records.forEach((t => {
- let e = {};
- i.fields.forEach(( (i, a) => e[i] = t[a])),
- a.push(e)
- }
- )),
- a
- }(i, t);
- a.useMemoryStore = !0,
- e(a)
- }
- }
- )).catch((t => {
- i({
- status_code: 500,
- message: `Error fetching CSV: ${t}`
- })
- }
- ))
- }
- ))
- }({
- url: `${e}${t}`
- }).then((t => {
- i = t
- }
- )).catch((t => {
- if ("response_not_csv" == t.proxy_err_code)
- throw new x("Timeline could not read the data for your timeline. Make sure you have published it to the web.");
- let e = "undefined error";
- throw e = Array.isArray(t.message) ? t.message.join("<br>") : String(t.message),
- new x(e)
- }
- ));
- let a = {
- events: [],
- errors: [],
- warnings: [],
- eras: []
- };
- return i.forEach(( (t, e) => {
- try {
- if (!function(t) {
- var e = [];
- if (Object.keys)
- e = Object.keys(t);
- else
- for (var i in t)
- Object.prototype.hasOwnProperty.call(t, i) && e.push(i);
- for (var a = 0; a < e.length; a++) {
- var s = e[a];
- if (null != t[s] && "string" != typeof t[s])
- return !1;
- if (0 != O(t[s]).length)
- return !1
- }
- return !0
- }(t)) {
- let e = function(t) {
- let e = {};
- Object.keys(t).forEach((i => {
- e[i] = O(t[i])
- }
- ));
- var i, a = {
- media: {
- caption: e["Media Caption"] || "",
- credit: e["Media Credit"] || "",
- url: e.Media || "",
- thumbnail: e["Media Thumbnail"] || "",
- alt: e["Alt Text"] || ""
- },
- text: {
- headline: e.Headline || "",
- text: e.Text || ""
- },
- display_date: e["Display Date"] || "",
- group: e.Group || e.Tag || "",
- background: (i = e.Background,
- "string" != typeof i ? "" : i.match(/^(https?:)?\/\/?/) ? {
- url: i
- } : {
- color: i
- }),
- type: e.Type || ""
- };
- if (Object.keys(e).includes("Start Date") || Object.keys(e).includes("End Date"))
- e["Start Date"] && (a.start_date = bt(e["Start Date"])),
- e["End Date"] && (a.end_date = bt(e["End Date"]));
- else {
- if (e.Year && (a.start_date = {
- year: Jt(e.Year),
- month: Jt(e.Month) || "",
- day: Jt(e.Day) || ""
- }),
- e["End Year"] && (a.end_date = {
- year: Jt(e["End Year"]) || "",
- month: Jt(e["End Month"]) || "",
- day: Jt(e["End Day"]) || ""
- }),
- e.Time) {
- if (!a.start_date)
- throw new x("invalid_start_time_without_date");
- E(a.start_date, zt(e.Time))
- }
- if (e["End Time"]) {
- if (!a.end_date)
- throw new x("invalid_end_time_without_date");
- E(a.end_date, zt(e["End Time"]))
- }
- if (a.start_date && !Ft(a.start_date))
- throw new x("invalid_date_err");
- if (a.end_date && !Ft(a.end_date))
- throw new x("invalid_date_err")
- }
- return a
- }(t);
- !function(t, e) {
- var i = "event";
- void 0 !== t.type && (i = t.type,
- delete t.type),
- "title" == i ? e.title ? (e.warnings.push("Multiple title slides detected."),
- e.events.push(t)) : e.title = t : "era" == i ? e.eras.push(t) : e.events.push(t)
- }(e, a)
- }
- } catch (i) {
- if (i.constructor == x)
- a.errors.push(i);
- else {
- i.message && (i = i.message);
- let s = t.Headline || e;
- a.errors.push(i + `[${s}]`)
- }
- }
- }
- )),
- a
- }
- async function te(t, e) {
- if (!e.sheets_proxy)
- throw new x("Proxy option must be set to read data from Google");
- var i = await Qt(t, e.sheets_proxy);
- if (i)
- return i
- }
- class ee {
- constructor(t) {
- if (!t)
- throw new x("axis_helper_no_options_err");
- this.scale = t.scale,
- this.minor = t.minor,
- this.major = t.major
- }
- getPixelsPerTick(t) {
- return t * this.minor.factor
- }
- getMajorTicks(t) {
- return this._getTicks(t, this.major)
- }
- getMinorTicks(t) {
- return this._getTicks(t, this.minor)
- }
- _getTicks(t, e) {
- for (var i = t._scaled_padding * e.factor, a = t._earliest - i, s = t._latest + i, n = [], o = a; o < s; o += e.factor)
- n.push(t.getDateFromTime(o).floor(e.name));
- return {
- name: e.name,
- ticks: n
- }
- }
- }
- var ie = {}
- , ae = function(t, e) {
- ie[t] = [];
- for (var i = 0; i < e.length - 1; i++) {
- var a = e[i]
- , s = e[i + 1];
- ie[t].push(new ee({
- scale: a[3],
- minor: {
- name: a[0],
- factor: a[1]
- },
- major: {
- name: s[0],
- factor: s[1]
- }
- }))
- }
- };
- ae("human", _t),
- ae("cosmological", Lt);
- const se = {
- millisecond: "time_milliseconds",
- second: "time_short",
- minute: "time_no_seconds_short",
- hour: "time_no_minutes_short",
- day: "full_short",
- month: "month_short",
- year: "year",
- decade: "year",
- century: "year",
- millennium: "year",
- age: "compact",
- epoch: "compact",
- era: "compact",
- eon: "compact",
- eon2: "compact"
- };
- class ne {
- constructor(t, e) {
- var i = t.events;
- this._scale = t.scale,
- e = E({
- display_width: 500,
- screen_multiplier: 3,
- max_rows: null
- }, e),
- this._display_width = e.display_width,
- this._screen_multiplier = e.screen_multiplier,
- this._pixel_width = this._screen_multiplier * this._display_width,
- this._group_labels = void 0,
- this._positions = [],
- this._pixels_per_milli = 0,
- this._earliest = t.getEarliestDate().getTime(),
- this._latest = t.getLatestDate().getTime(),
- this._span_in_millis = this._latest - this._earliest,
- this._span_in_millis <= 0 && (this._span_in_millis = this._computeDefaultSpan(t)),
- this._average = this._span_in_millis / i.length,
- this._pixels_per_milli = this.getPixelWidth() / this._span_in_millis,
- this._axis_helper = function(t, e) {
- "number" != typeof e && (e = 100);
- var i = t.getScale()
- , a = ie[i];
- if (!a)
- throw new x("axis_helper_scale_err",i);
- for (var s = null, n = 0; n < a.length; n++) {
- var o = a[n]
- , r = o.getPixelsPerTick(t._pixels_per_milli);
- if (r > e)
- return null == s || Math.abs(e - r) < Math.abs(e - r) ? o : s;
- s = o
- }
- return a[a.length - 1]
- }(this),
- this._scaled_padding = 1 / this.getPixelsPerTick() * (this._display_width / 2),
- this._computePositionInfo(i, e.max_rows)
- }
- _computeDefaultSpan(t) {
- if ("human" == t.scale) {
- for (var e = {}, i = 0; i < t.events.length; i++) {
- var a = t.events[i].start_date.findBestFormat();
- e[a] = e[a] ? e[a] + 1 : 1
- }
- for (i = _t.length - 1; i >= 0; i--)
- if (e.hasOwnProperty(_t[i][0])) {
- var s = _t[_t.length - 1];
- return _t[i + 1] && (s = _t[i + 1]),
- s[1]
- }
- return 31536e6
- }
- return 2e5
- }
- getGroupLabels() {
- return this._group_labels || []
- }
- getScale() {
- return this._scale
- }
- getNumberOfRows() {
- return this._number_of_rows
- }
- getPixelWidth() {
- return this._pixel_width
- }
- getPosition(t) {
- return (t - this._earliest) * this._pixels_per_milli
- }
- getPositionInfo(t) {
- return this._positions[t]
- }
- getPixelsPerTick() {
- return this._axis_helper.getPixelsPerTick(this._pixels_per_milli)
- }
- getTicks() {
- return {
- major: this._axis_helper.getMajorTicks(this),
- minor: this._axis_helper.getMinorTicks(this)
- }
- }
- getDateFromTime(t) {
- if ("human" == this._scale)
- return new yt(t);
- if ("cosmological" == this._scale)
- return new Dt(new wt(t));
- throw new x("time_scale_scale_err",this._scale)
- }
- getMajorScale() {
- return this._axis_helper.major.name
- }
- getMinorScale() {
- return this._axis_helper.minor.name
- }
- _assessGroups(t) {
- for (var e = [], i = !1, a = 0; a < t.length; a++)
- t[a].group && (e.indexOf(t[a].group) < 0 ? e.push(t[a].group) : i = !0);
- return e.length && i && e.push(""),
- e
- }
- _computeRowInfo(t, e) {
- for (var i = [], a = 0, s = 0; s < t.length; s++) {
- var n = t[s]
- , o = [];
- delete n.row;
- for (var r = 0; r < i.length; r++)
- if (o.push(i[r].end - n.start),
- o[r] <= 0) {
- n.row = r,
- i[r] = n;
- break
- }
- if (void 0 === n.row)
- if (null === e)
- n.row = i.length,
- i.push(n);
- else if (e > 0)
- n.row = i.length,
- i.push(n),
- e--;
- else {
- var l = Math.min.apply(null, o)
- , h = o.indexOf(l);
- n.row = h,
- n.end > i[h].end && (i[h] = n),
- a++
- }
- }
- return {
- n_rows: i.length,
- n_overlaps: a
- }
- }
- _computePositionInfo(t, e, i) {
- i = i || 100;
- for (var a = [], s = !1, n = 0; n < t.length; n++) {
- var o = {
- start: this.getPosition(t[n].start_date.getTime())
- };
- if (this._positions.push(o),
- void 0 !== t[n].end_date) {
- var r = this.getPosition(t[n].end_date.getTime());
- o.width = r - o.start,
- o.width > i ? o.end = o.start + o.width : o.end = o.start + i
- } else
- o.width = i,
- o.end = o.start + i;
- t[n].group ? a.indexOf(t[n].group) < 0 && a.push(t[n].group) : s = !0
- }
- if (a.length) {
- s && a.push("");
- var l = [];
- for (n = 0; n < a.length; n++)
- l[n] = {
- label: a[n],
- idx: n,
- positions: [],
- n_rows: 1,
- n_overlaps: 0
- };
- for (n = 0; n < this._positions.length; n++) {
- (o = this._positions[n]).group = a.indexOf(t[n].group || ""),
- o.row = 0;
- for (var h = (u = l[o.group]).positions.length - 1; h >= 0; h--)
- u.positions[h].end > o.start && u.n_overlaps++;
- u.positions.push(o)
- }
- for (var d = a.length; ; ) {
- var c = Math.max(0, e - d);
- if (!c)
- break;
- if (l.sort((function(t, e) {
- return t.n_overlaps > e.n_overlaps ? -1 : t.n_overlaps < e.n_overlaps ? 1 : t.idx - e.idx
- }
- )),
- !l[0].n_overlaps)
- break;
- for (d = 0,
- n = 0; n < l.length; n++) {
- var u;
- if ((u = l[n]).n_overlaps && c) {
- var m = this._computeRowInfo(u.positions, u.n_rows + 1);
- u.n_rows = m.n_rows,
- u.n_overlaps = m.n_overlaps,
- c--
- }
- d += u.n_rows
- }
- }
- this._number_of_rows = d,
- this._group_labels = [],
- l.sort((function(t, e) {
- return t.idx - e.idx
- }
- )),
- n = 0;
- for (var _ = 0; n < l.length; n++) {
- for (this._group_labels.push({
- label: l[n].label,
- rows: l[n].n_rows
- }),
- h = 0; h < l[n].positions.length; h++)
- (o = l[n].positions[h]).row += _;
- _ += l[n].n_rows
- }
- } else {
- var p = this._computeRowInfo(this._positions, e);
- this._number_of_rows = p.n_rows
- }
- }
- getAxisTickDateFormat(t) {
- return "cosmological" == this._scale ? "compact" : se[t]
- }
- }
- class oe {
- constructor(t) {
- this._el = {
- parent: {},
- container: {},
- message: {}
- },
- this.options = {
- width: 600,
- height: 600
- },
- this.data = {
- label: "",
- rows: 1
- },
- this._el.container = v("div", "tl-timegroup"),
- E(this.data, t),
- this.animator = {},
- this._initLayout(),
- this._initEvents()
- }
- updateDisplay(t, e) {}
- setRowPosition(t, e) {
- this.options.height = e * this.data.rows,
- this.setPosition({
- top: t
- }),
- this._el.container.style.height = this.options.height + "px"
- }
- setAlternateRowColor(t, e) {
- var i = "tl-timegroup";
- t && (i += " tl-timegroup-alternate"),
- e && (i += " tl-timegroup-hidden"),
- this._el.container.className = i
- }
- _onMouseClick() {
- this.fire("clicked", this.options)
- }
- _initLayout() {
- this._el.message = v("div", "tl-timegroup-message", this._el.container),
- this._el.message.innerHTML = this.data.label
- }
- _initEvents() {
- ht.addListener(this._el.container, "click", this._onMouseClick, this)
- }
- _updateDisplay(t, e, i) {}
- }
- R(oe, at, ot);
- class re {
- constructor(t, e, i, a) {
- this.start_date = t,
- this.end_date = e,
- this.headline = i,
- this._el = {
- container: {},
- background: {},
- content_container: {},
- content: {},
- text: {}
- },
- this._text = {},
- this._state = {
- loaded: !1
- },
- this.options = {
- duration: 1e3,
- ease: Q,
- width: 600,
- height: 600,
- marker_width_min: 100
- },
- this.active = !1,
- this.animator = {},
- this.has_end_date = !1,
- E(this.options, a),
- this._initLayout(),
- this._initEvents()
- }
- show() {}
- hide() {}
- setActive(t) {}
- addTo(t) {
- t.appendChild(this._el.container)
- }
- removeFrom(t) {
- t.removeChild(this._el.container)
- }
- updateDisplay(t, e) {
- this._updateDisplay(t, e)
- }
- getLeft() {
- return this._el.container.style.left.slice(0, -2)
- }
- getTime() {
- return this.start_date.getTime()
- }
- getEndTime() {
- return !!this.end_date && this.end_date.getTime()
- }
- setHeight(t) {
- var e = 1;
- this._el.content_container.style.height = t + "px",
- this._el.content.className = "tl-timeera-content",
- r ? ((e = Math.floor(t / 14)) < 1 && (e = 1),
- this._text.className = "tl-headline",
- this._text.style.webkitLineClamp = e) : (e = t / 12,
- this._text.className = e > 1 ? "tl-headline tl-headline-fadeout" : "tl-headline",
- this._text.style.height = 12 * e + "px")
- }
- setWidth(t) {
- this.end_date && (this._el.container.style.width = t + "px",
- t > this.options.marker_width_min ? (this._el.content_container.style.width = t + "px",
- this._el.content_container.className = "tl-timeera-content-container tl-timeera-content-container-long") : (this._el.content_container.style.width = this.options.marker_width_min + "px",
- this._el.content_container.className = "tl-timeera-content-container"))
- }
- setClass(t) {
- this._el.container.className = t
- }
- setRowPosition(t, e) {
- this.setPosition({
- top: t
- }),
- e < 56 && this._el.content_container.remove("tl-timeera-content-container-small")
- }
- setColor(t) {
- this._el.container.className = "tl-timeera tl-timeera-color" + t
- }
- _initLayout() {
- this._el.container = v("div", "tl-timeera"),
- this.end_date && (this.has_end_date = !0,
- this._el.container.className = "tl-timeera tl-timeera-with-end"),
- this._el.content_container = v("div", "tl-timeera-content-container", this._el.container),
- this._el.background = v("div", "tl-timeera-background", this._el.content_container),
- this._el.content = v("div", "tl-timeera-content", this._el.content_container),
- this._el.text = v("div", "tl-timeera-text", this._el.content),
- this._text = v("h2", "tl-headline", this._el.text),
- this.headline && "" != this.headline && (this._text.innerHTML = F(this.headline)),
- this.onLoaded()
- }
- _initEvents() {}
- _updateDisplay(t, e, i) {
- t && (this.options.width = t),
- e && (this.options.height = e)
- }
- }
- R(re, at, ot);
- class le {
- constructor(t, e, i) {
- i && this.setLanguage(i),
- this._el = {
- container: {},
- content_container: {},
- major: {},
- minor: {}
- },
- this._text = {},
- this._state = {
- loaded: !1
- },
- this.data = {},
- this.options = {
- duration: 1e3,
- ease: Q,
- width: 600,
- height: 600
- },
- this.active = !1,
- this.animator = {},
- this.axis_helper = {},
- this.minor_ticks = [],
- this.major_ticks = [],
- this._el.container = "object" == typeof t ? t : g(t),
- E(this.options, e),
- this._initLayout(),
- this._initEvents()
- }
- show() {}
- hide() {}
- addTo(t) {
- t.appendChild(this._el.container)
- }
- removeFrom(t) {
- t.removeChild(this._el.container)
- }
- updateDisplay(t, e) {
- this._updateDisplay(t, e)
- }
- getLeft() {
- return this._el.container.style.left.slice(0, -2)
- }
- drawTicks(t, e) {
- var i = t.getTicks();
- this._el.major.className = "tl-timeaxis-major",
- this._el.minor.className = "tl-timeaxis-minor",
- this._el.major.style.opacity = 0,
- this._el.minor.style.opacity = 0,
- this.major_ticks = this._createTickElements(i.major.ticks, this._el.major, t.getAxisTickDateFormat(i.major.name)),
- this.minor_ticks = this._createTickElements(i.minor.ticks, this._el.minor, t.getAxisTickDateFormat(i.minor.name), i.major.ticks),
- this.positionTicks(t, e, !0),
- this._el.major.className = "tl-timeaxis-major tl-animate-opacity tl-timeaxis-animate-opacity",
- this._el.minor.className = "tl-timeaxis-minor tl-animate-opacity tl-timeaxis-animate-opacity",
- this._el.major.style.opacity = 1,
- this._el.minor.style.opacity = 1
- }
- _createTickElements(t, e, i, a) {
- e.innerHTML = "";
- var s = {};
- if (s[new Date(-1,13,-30).getTime()] = !0,
- a)
- for (var n = 0; n < a.length; n++)
- s[a[n].getTime()] = !0;
- var o = [];
- for (n = 0; n < t.length; n++) {
- var r = t[n];
- if (!(r.getTime()in s)) {
- var l = v("div", "tl-timeaxis-tick", e)
- , h = v("span", "tl-timeaxis-tick-text tl-animate-opacity", l);
- let t = r.getDisplayDate(this.getLanguage(), i);
- h.innerHTML = t,
- o.push({
- tick: l,
- tick_text: h,
- display_date: t,
- date: r
- })
- }
- }
- return o
- }
- positionTicks(t, e, i) {
- i ? (this._el.major.className = "tl-timeaxis-major",
- this._el.minor.className = "tl-timeaxis-minor") : (this._el.major.className = "tl-timeaxis-major tl-timeaxis-animate",
- this._el.minor.className = "tl-timeaxis-minor tl-timeaxis-animate"),
- this._positionTickArray(this.major_ticks, t, e),
- this._positionTickArray(this.minor_ticks, t, e)
- }
- _positionTickArray(t, e, i) {
- if (t[1] && t[0]) {
- var a = 1;
- e.getPosition(t[1].date.getMillisecond()) - e.getPosition(t[0].date.getMillisecond()) < i && (a = Math.round(i / e.getPixelsPerTick()));
- for (var s = 1, n = 0; n < t.length; n++) {
- var o = t[n];
- o.tick.style.left = e.getPosition(o.date.getMillisecond()) + "px",
- o.tick_text.innerHTML = o.display_date,
- a > 1 ? s >= a ? (s = 1,
- o.tick_text.style.opacity = 1,
- o.tick.className = "tl-timeaxis-tick") : (s++,
- o.tick_text.style.opacity = 0,
- o.tick.className = "tl-timeaxis-tick tl-timeaxis-tick-hidden") : (o.tick_text.style.opacity = 1,
- o.tick.className = "tl-timeaxis-tick")
- }
- }
- }
- getVisibleTicks() {
- return {
- major: this._getVisibleTickArray(this.major_ticks),
- minor: this._getVisibleTickArray(this.minor_ticks)
- }
- }
- _getVisibleTickArray(t) {
- return t.filter(( ({tick: t}) => function(t) {
- const e = t.getBoundingClientRect();
- return e.left >= 0 && e.right <= (window.innerWidth || document.documentElement.clientWidth)
- }(t)))
- }
- _initLayout() {
- this._el.content_container = v("div", "tl-timeaxis-content-container", this._el.container),
- this._el.major = v("div", "tl-timeaxis-major", this._el.content_container),
- this._el.minor = v("div", "tl-timeaxis-minor", this._el.content_container),
- this.onLoaded()
- }
- _initEvents() {}
- _updateDisplay(t, e, i) {
- t && (this.options.width = t),
- e && (this.options.height = e)
- }
- }
- R(le, at, ot, Rt);
- class he {
- constructor(t, e, i) {
- this._el = {
- container: {},
- content_container: {},
- content: {},
- headline_container: {},
- headline: {},
- date: {}
- },
- this.options = {
- title: !1
- },
- this.data = {
- unique_id: "",
- headline: "headline",
- text: "text"
- },
- function(t, e) {
- t.data = L({}, t.data, e),
- "" === t.data.unique_id && (t.data.unique_id = P(6))
- }(this, t),
- E(this.options, e),
- this._el.container = v("div", "tl-text"),
- this._el.container.id = this.data.unique_id,
- this._initLayout(),
- i && i.appendChild(this._el.container)
- }
- show() {}
- hide() {}
- addTo(t) {
- t.appendChild(this._el.container)
- }
- removeFrom(t) {
- t.removeChild(this._el.container)
- }
- headlineHeight() {
- return this._el.headline.offsetHeight + 40
- }
- addDateText(t) {
- this._el.date.innerHTML = t
- }
- onLoaded() {
- this.fire("loaded", this.data)
- }
- onAdd() {
- this.fire("added", this.data)
- }
- onRemove() {
- this.fire("removed", this.data)
- }
- _initLayout() {
- if (this._el.content_container = v("div", "tl-text-content-container", this._el.container),
- this._el.headline_container = v("div", "tl-text-headline-container", this._el.content_container),
- "" != this.data.headline) {
- var t = "tl-headline";
- this.options.title && (t = "tl-headline tl-headline-title"),
- this._el.headline = v("h2", t, this._el.headline_container),
- this._el.headline.innerHTML = this.data.headline
- }
- if (this._el.date = v("h3", "tl-headline-date", this._el.headline_container),
- "" != this.data.text) {
- var e = "";
- e += (i = 1 == this.options.autolink ? $(this.data.text) : this.data.text).match(/<p>[\s\S]*?<\/p>/) ? i : "<p>" + i + "</p>",
- this._el.content = v("div", "tl-text-content", this._el.content_container),
- this._el.content.innerHTML = e
- }
- var i;
- this.onLoaded()
- }
- }
- R(he, at);
- class de {
- constructor(t, e, i) {
- i && this.setLanguage(i),
- this._el = {
- container: {},
- content_container: {},
- content: {},
- content_item: {},
- content_link: {},
- caption: null,
- credit: null,
- parent: {},
- link: null
- },
- this.player = null,
- this.timer = null,
- this.load_timer = null,
- this.message = null,
- this.media_id = null,
- this._state = {
- loaded: !1,
- show_meta: !1,
- media_loaded: !1
- },
- this.data = {
- unique_id: null,
- url: null,
- credit: null,
- caption: null,
- credit_alternate: null,
- caption_alternate: null,
- link: null,
- link_target: null
- },
- this.options = {
- api_key_flickr: "bd3a7c45ddd52f3101825d41563a6125",
- api_key_googlemaps: "AIzaSyB9dW8e_iRrATFa8g24qB6BDBGdkrLDZYI",
- api_key_embedly: "",
- credit_height: 0,
- caption_height: 0,
- background: 0
- },
- this.animator = {},
- E(this.options, e),
- E(this.data, t),
- this.options.background || (this._el.container = v("div", "tl-media"),
- this.data.unique_id && (this._el.container.id = this.data.unique_id),
- this._initLayout())
- }
- loadMedia() {
- var t = this;
- if (!this._state.loaded)
- try {
- this.load_timer = setTimeout((function() {
- t.loadingMessage(),
- t._loadMedia(),
- t._updateDisplay()
- }
- ), 1200)
- } catch (t) {
- S("Error loading media for ", this._media),
- S(t)
- }
- }
- _updateMessage(t) {
- this.message && this.message.updateMessage(t)
- }
- loadingMessage() {
- this._updateMessage(this._("loading") + " " + this.options.media_name)
- }
- errorMessage(t) {
- t = t ? this._("error") + ": " + t : this._("error"),
- this._updateMessage(t)
- }
- updateMediaDisplay(t) {
- this._state.loaded && !this.options.background && (this._el.content_item.style.maxHeight = h ? this.options.height / 2 + "px" : this.options.height - this.options.credit_height - this.options.caption_height - 30 + "px",
- this._el.container.style.maxWidth = this.options.width + "px",
- m && (this._el.content_item.offsetWidth,
- this._el.content_item.offsetHeight),
- this._updateMediaDisplay(t),
- this._state.media_loaded && (this._el.credit && (this._el.credit.style.width = this._el.content_item.offsetWidth + "px"),
- this._el.caption && (this._el.caption.style.width = this._el.content_item.offsetWidth + "px")))
- }
- _loadMedia() {
- this.onLoaded()
- }
- _updateMediaDisplay(t) {
- m && (this._el.content_item.style.maxWidth = this.options.width + "px",
- this._el.content_item.style.width = "auto")
- }
- _getMeta() {}
- _getImageURL(t, e) {
- return ""
- }
- show() {}
- hide() {}
- addTo(t) {
- t.appendChild(this._el.container),
- this.onAdd()
- }
- removeFrom(t) {
- t.removeChild(this._el.container),
- this.onRemove()
- }
- getImageURL(t, e) {
- return this._getImageURL(t, e)
- }
- updateDisplay(t, e, i) {
- this._updateDisplay(t, e, i)
- }
- stopMedia() {
- try {
- this._stopMedia()
- } catch (t) {
- S(`stopMedia() exception: ${t}`)
- }
- }
- loadErrorDisplay(t) {
- try {
- this._el.content.removeChild(this._el.content_item)
- } catch (t) {}
- this._el.content_item = v("div", "tl-media-item tl-media-loaderror", this._el.content),
- this._el.content_item.innerHTML = "<div class='tl-icon-" + this.options.media_type + "'></div><p>" + t + "</p>",
- this.onLoaded(!0)
- }
- onLoaded(t) {
- this._state.loaded = !0,
- this.fire("loaded", this.data),
- this.message && this.message.hide(),
- t || this.options.background || this.showMeta(),
- this.updateDisplay()
- }
- onMediaLoaded(t) {
- this._state.media_loaded = !0,
- this.fire("media_loaded", this.data),
- this._el.credit && (this._el.credit.style.width = this._el.content_item.offsetWidth + "px"),
- this._el.caption && (this._el.caption.style.width = this._el.content_item.offsetWidth + "px")
- }
- showMeta(t, e) {
- this._state.show_meta = !0,
- this.data.credit && "" != this.data.credit && (this._el.credit = v("div", "tl-credit", this._el.content_container),
- this._el.credit.innerHTML = 1 == this.options.autolink ? $(this.data.credit) : this.data.credit,
- this.options.credit_height = this._el.credit.offsetHeight),
- this.data.caption && "" != this.data.caption && (this._el.caption = v("div", "tl-caption", this._el.content_container),
- this._el.caption.innerHTML = 1 == this.options.autolink ? $(this.data.caption) : this.data.caption,
- this.options.caption_height = this._el.caption.offsetHeight),
- this.data.caption && this.data.credit || this.getMeta()
- }
- getMeta() {
- this._getMeta()
- }
- updateMeta() {
- !this.data.credit && this.data.credit_alternate && (this._el.credit = v("div", "tl-credit", this._el.content_container),
- this._el.credit.innerHTML = this.data.credit_alternate,
- this.options.credit_height = this._el.credit.offsetHeight),
- !this.data.caption && this.data.caption_alternate && (this._el.caption = v("div", "tl-caption", this._el.content_container),
- this._el.caption.innerHTML = this.data.caption_alternate,
- this.options.caption_height = this._el.caption.offsetHeight),
- this.updateDisplay()
- }
- onAdd() {
- this.fire("added", this.data)
- }
- onRemove() {
- this.fire("removed", this.data)
- }
- _initLayout() {
- this.message = new jt(this._el.container,this.options,this.getLanguage()),
- this._el.content_container = v("div", "tl-media-content-container", this._el.container),
- this.data.link && "" != this.data.link ? (this._el.link = v("a", "tl-media-link", this._el.content_container),
- this._el.link.href = this.data.link,
- this.data.link_target && "" != this.data.link_target ? this._el.link.target = this.data.link_target : this._el.link.target = "_blank",
- "_blank" == this._el.link.target && this._el.link.setAttribute("rel", "noopener"),
- this._el.content = v("div", "tl-media-content", this._el.link)) : this._el.content = v("div", "tl-media-content", this._el.content_container)
- }
- _updateDisplay(t, e, i) {
- t && (this.options.width = t),
- e && (this.options.height = e),
- i && (this.options.layout = i),
- this._el.credit && (this.options.credit_height = this._el.credit.offsetHeight),
- this._el.caption && (this.options.caption_height = this._el.caption.offsetHeight + 5),
- this.updateMediaDisplay(this.options.layout)
- }
- domCreate(...t) {
- return v(...t)
- }
- _stopMedia() {}
- }
- R(de, at, Rt);
- class ce extends de {
- _loadMedia() {
- this.loadingMessage(),
- this.options.background || this.createMedia(),
- this.onLoaded()
- }
- createMedia() {
- var t = this
- , e = "tl-media-item tl-media-image tl-media-shadow";
- (this.data.url.match(/.png(\?.*)?$/) || this.data.url.match(/.svg(\?.*)?$/)) && (e = "tl-media-item tl-media-image"),
- this._el.content_item = this.domCreate("img", e, this._el.content),
- this.data.alt ? this._el.content_item.alt = this.data.alt : this.data.caption && (this._el.content_item.alt = q(this.data.caption)),
- this.data.title ? this._el.content_item.title = this.data.title : this.data.caption && (this._el.content_item.title = q(this.data.caption)),
- this._el.content_item.addEventListener("load", (function(e) {
- t.onMediaLoaded()
- }
- )),
- this._el.content_item.src = this.getImageURL()
- }
- getImageURL(t, e) {
- return U(this.data.url)
- }
- _updateMediaDisplay(t) {
- m && (this._el.content_item.style.width = "auto")
- }
- }
- function ue(t, e, i, a) {
- _e.js(t, e, i, a)
- }
- function me(t, e, i, a) {
- _e.css(t, e, i, a)
- }
- let _e = new class {
- constructor(t) {
- this.doc = t,
- this.pending = {},
- this.queue = {
- css: [],
- js: []
- },
- this.styleSheets = t.styleSheets,
- this.env = this.getEnv(),
- this.head = this.doc.head || this.doc.getElementsByTagName("head")[0],
- this.pollCount = 0
- }
- createNode(t, e) {
- var i, a = this.doc.createElement(t);
- for (i in e)
- e.hasOwnProperty(i) && a.setAttribute(i, e[i]);
- return a
- }
- finish(t) {
- var e, i, a = this.pending[t];
- a && (e = a.callback,
- (i = a.urls).shift(),
- this.pollCount = 0,
- i.length || (e && e.call(a.context, a.obj),
- this.pending[t] = null,
- this.queue[t].length && this.load(t)))
- }
- getEnv() {
- var t = navigator.userAgent
- , e = {
- async: !0 === this.doc.createElement("script").async
- };
- return (e.webkit = /AppleWebKit\//.test(t)) || (e.ie = /MSIE/.test(t)) || (e.opera = /Opera/.test(t)) || (e.gecko = /Gecko\//.test(t)) || (e.unknown = !0),
- e
- }
- load(t, e, i, a, s) {
- var n, o, r, l, h, d, c = function() {
- this.finish(t)
- }
- .bind(this), u = "css" === t, m = [];
- if (e)
- if (e = "string" == typeof e ? [e] : e.concat(),
- u || this.env.async || this.env.gecko || this.env.opera)
- this.queue[t].push({
- urls: e,
- callback: i,
- obj: a,
- context: s
- });
- else
- for (n = 0,
- o = e.length; n < o; ++n)
- this.queue[t].push({
- urls: [e[n]],
- callback: n === o - 1 ? i : null,
- obj: a,
- context: s
- });
- if (!this.pending[t] && (l = this.pending[t] = this.queue[t].shift())) {
- for (n = 0,
- o = (h = l.urls).length; n < o; ++n)
- d = h[n],
- u ? r = this.env.gecko ? this.createNode("style") : this.createNode("link", {
- href: d,
- rel: "stylesheet"
- }) : (r = this.createNode("script", {
- src: d
- })).async = !1,
- r.className = "lazyload",
- r.setAttribute("charset", "utf-8"),
- this.env.ie && !u ? r.onreadystatechange = function() {
- /loaded|complete/.test(r.readyState) && (r.onreadystatechange = null,
- c())
- }
- : u && (this.env.gecko || this.env.webkit) ? this.env.webkit ? (l.urls[n] = r.href,
- this.pollWebKit()) : (r.innerHTML = '@import "' + d + '";',
- this.pollGecko(r)) : r.onload = r.onerror = c,
- m.push(r);
- for (n = 0,
- o = m.length; n < o; ++n)
- this.head.appendChild(m[n])
- }
- }
- pollGecko(t) {
- var e;
- try {
- e = !!t.sheet.cssRules
- } catch (a) {
- if (this.pollCount += 1,
- this.pollCount < 200) {
- var i = this;
- setTimeout((function() {
- i.pollGecko(t)
- }
- ), 50)
- } else
- e && this.finish("css");
- return
- }
- this.finish("css")
- }
- pollWebKit() {
- var t, e = this.pending.css;
- if (e) {
- for (t = this.styleSheets.length; --t >= 0; )
- if (this.styleSheets[t].href === e.urls[0]) {
- this.finish("css");
- break
- }
- this.pollCount += 1,
- e && (this.pollCount < 200 ? setTimeout(this.pollWebKit.bind(this), 50) : this.finish("css"))
- }
- }
- css(t, e, i, a) {
- this.load("css", t, e, i, a)
- }
- js(t, e, i, a) {
- this.load("js", t, e, i, a)
- }
- }
- (document);
- function qe(t, e) {
- return !1
- }
- class $e {
- constructor(t, e) {
- this._el = {
- container: {},
- content_container: {},
- media_container: {},
- timespan: {},
- line_left: {},
- line_right: {},
- content: {},
- text: {},
- media: {}
- },
- this._text = {},
- this._state = {
- loaded: !1
- },
- this.data = {
- unique_id: "",
- background: null,
- date: {
- year: 0,
- month: 0,
- day: 0,
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0,
- thumbnail: "",
- format: ""
- },
- text: {
- headline: "",
- text: ""
- },
- media: null
- },
- this.options = {
- duration: 1e3,
- ease: Q,
- width: 600,
- height: 600,
- marker_width_min: 100
- },
- this.active = !1,
- this.animator = {},
- this.has_end_date = !1,
- this.ariaLabel = "",
- E(this.options, e),
- E(this.data, t),
- this._initLayout(),
- this._initEvents()
- }
- show() {}
- hide() {}
- setActive(t) {
- this.active = t,
- this.active && this.has_end_date ? this._el.container.className = "tl-timemarker tl-timemarker-with-end tl-timemarker-active" : this.active ? this._el.container.className = "tl-timemarker tl-timemarker-active" : this.has_end_date ? this._el.container.className = "tl-timemarker tl-timemarker-with-end" : this._el.container.className = "tl-timemarker",
- this._el.container.ariaLabel = this.ariaLabel,
- this.active ? this._el.container.ariaLabel += ", shown" : this._el.container.ariaLabel += ", press space to show"
- }
- setFocus(t={
- preventScroll: !0
- }) {
- this._el.container.focus(t)
- }
- addTo(t) {
- t.appendChild(this._el.container)
- }
- removeFrom(t) {
- t.removeChild(this._el.container)
- }
- updateDisplay(t, e) {
- this._updateDisplay(t, e)
- }
- loadMedia() {
- this._media && !this._state.loaded && (this._media.loadMedia(),
- this._state.loaded = !0)
- }
- stopMedia() {
- this._media && this._state.loaded && this._media.stopMedia()
- }
- getLeft() {
- return this._el.container.style.left.slice(0, -2)
- }
- getTime() {
- return this.data.start_date.getTime()
- }
- getEndTime() {
- return !!this.data.end_date && this.data.end_date.getTime()
- }
- setHeight(t) {
- var e = 1;
- this._el.content_container.style.height = t + "px",
- this._el.timespan_content.style.height = t + "px",
- this._el.content.className = t <= 30 ? "tl-timemarker-content tl-timemarker-content-small" : "tl-timemarker-content",
- t <= 56 ? this._el.content_container.classList.add("tl-timemarker-content-container-small") : this._el.content_container.classList.remove("tl-timemarker-content-container-small"),
- r ? ((e = Math.floor(t / 14)) < 1 && (e = 1),
- this._text.className = "tl-headline",
- this._text.style.webkitLineClamp = e) : (e = t / 12,
- this._text.className = e > 1 ? "tl-headline tl-headline-fadeout" : "tl-headline",
- this._text.style.height = 12 * e + "px")
- }
- setWidth(t) {
- this.data.end_date && (this._el.container.style.width = t + "px",
- t > this.options.marker_width_min ? (this._el.content_container.style.width = t + "px",
- this._el.content_container.className = "tl-timemarker-content-container tl-timemarker-content-container-long") : (this._el.content_container.style.width = this.options.marker_width_min + "px",
- this._el.content_container.className = "tl-timemarker-content-container"))
- }
- setClass(t) {
- this._el.container.className = t
- }
- setRowPosition(t, e) {
- this.setPosition({
- top: t
- }),
- this._el.timespan.style.height = e + "px"
- }
- getFormattedDate() {
- if (O(this.data.display_date).length > 0)
- return this.data.display_date;
- let t = "";
- return this.data.end_date && (t = " to " + this.data.end_date.getDisplayDate(this.getLanguage())),
- this.data.start_date && (t = (t ? "from " : "") + this.data.start_date.getDisplayDate(this.getLanguage()) + t),
- t
- }
- _onMarkerClick(t) {
- this.fire("markerclick", {
- unique_id: this.data.unique_id
- })
- }
- _onMarkerKeydown(t) {
- /Space|Enter/.test(t.code) && this.fire("markerclick", {
- unique_id: this.data.unique_id
- })
- }
- _onMarkerBlur(t) {
- this.fire("markerblur", {
- unique_id: this.data.unique_id
- })
- }
- _initLayout() {
- if (this._el.container = v("div", "tl-timemarker"),
- this._el.container.setAttribute("tabindex", "-1"),
- this.data.unique_id && (this._el.container.id = this.data.unique_id + "-marker"),
- this.data.end_date && (this.has_end_date = !0,
- this._el.container.className = "tl-timemarker tl-timemarker-with-end"),
- this._el.timespan = v("div", "tl-timemarker-timespan", this._el.container),
- this._el.timespan_content = v("div", "tl-timemarker-timespan-content", this._el.timespan),
- this._el.content_container = v("div", "tl-timemarker-content-container", this._el.container),
- this._el.content = v("div", "tl-timemarker-content", this._el.content_container),
- this._el.line_left = v("div", "tl-timemarker-line-left", this._el.timespan),
- this._el.line_right = v("div", "tl-timemarker-line-right", this._el.timespan),
- this.data.media) {
- this._el.media_container = v("div", "tl-timemarker-media-container", this._el.content);
- var t = {
- url: this.data.media.thumbnail
- }
- , e = this.data.media.thumbnail ? qe(t, !0) : null;
- if (e) {
- var i = new e.cls(t);
- i.on("loaded", function() {
- this._el.media = v("img", "tl-timemarker-media", this._el.media_container),
- this._el.media.src = i.getImageURL()
- }
- .bind(this)),
- i.loadMedia()
- } else {
- var a = qe(this.data.media).type;
- this._el.media = v("span", "tl-icon-" + a, this._el.media_container)
- }
- }
- this._el.text = v("div", "tl-timemarker-text", this._el.content),
- this._text = v("h2", "tl-headline", this._el.text),
- this.data.text.headline && "" != this.data.text.headline ? this._text.innerHTML = F(this.data.text.headline) : this.data.text.text && "" != this.data.text.text ? this._text.innerHTML = F(this.data.text.text) : this.data.media && this.data.media.caption && "" != this.data.media.caption && (this._text.innerHTML = F(this.data.media.caption));
- const s = this.getFormattedDate();
- this.ariaLabel = `${this._text.innerHTML}, ${s}`,
- this.onLoaded()
- }
- _initEvents() {
- ht.addListener(this._el.container, "click", this._onMarkerClick, this),
- ht.addListener(this._el.container, "keydown", this._onMarkerKeydown, this),
- ht.addListener(this._el.container, "blur", this._onMarkerBlur, this)
- }
- _updateDisplay(t, e, i) {
- t && (this.options.width = t),
- e && (this.options.height = e)
- }
- }
- R($e, Rt, at, ot);
- class Ue {
- constructor(t, e, i) {
- this._el = {
- drag: t,
- move: t
- },
- this.mousedrag = {
- down: "mousedown",
- up: "mouseup",
- leave: "mouseleave",
- move: "mousemove"
- },
- this.touchdrag = {
- down: "touchstart",
- up: "touchend",
- leave: "mouseleave",
- move: "touchmove"
- },
- e && (this._el.move = e),
- this.options = {
- snap: !1,
- enable: {
- x: !0,
- y: !0
- },
- constraint: {
- top: !1,
- bottom: !1,
- left: 0,
- right: !1
- },
- momentum_multiplier: 2e3,
- duration: 1e3,
- ease: et
- },
- this.animator = null,
- this.dragevent = this.mousedrag,
- f && (this.dragevent = this.touchdrag),
- this.data = {
- sliding: !1,
- direction: "none",
- pagex: {
- start: 0,
- end: 0
- },
- pagey: {
- start: 0,
- end: 0
- },
- pos: {
- start: {
- x: 0,
- y: 0
- },
- end: {
- x: 0,
- y: 0
- }
- },
- new_pos: {
- x: 0,
- y: 0
- },
- new_pos_parent: {
- x: 0,
- y: 0
- },
- time: {
- start: 0,
- end: 0
- },
- touch: !1
- },
- E(this.options, i)
- }
- enable(t) {
- ht.addListener(this._el.drag, this.dragevent.down, this._onDragStart, this),
- ht.addListener(this._el.drag, this.dragevent.up, this._onDragEnd, this),
- this.data.pos.start = 0,
- this._el.move.style.left = this.data.pos.start.x + "px",
- this._el.move.style.top = this.data.pos.start.y + "px",
- this._el.move.style.position = "absolute"
- }
- disable() {
- ht.removeListener(this._el.drag, this.dragevent.down, this._onDragStart, this),
- ht.removeListener(this._el.drag, this.dragevent.up, this._onDragEnd, this)
- }
- stopMomentum() {
- this.animator && this.animator.stop()
- }
- updateConstraint(t) {
- this.options.constraint = t
- }
- _onDragStart(t) {
- this.animator && this.animator.stop(),
- f ? t.originalEvent ? (this.data.pagex.start = t.originalEvent.touches[0].screenX,
- this.data.pagey.start = t.originalEvent.touches[0].screenY) : (this.data.pagex.start = t.targetTouches[0].screenX,
- this.data.pagey.start = t.targetTouches[0].screenY) : (this.data.pagex.start = t.pageX,
- this.data.pagey.start = t.pageY),
- this.options.enable.x,
- this.options.enable.y,
- this.data.pos.start = {
- x: this._el.move.offsetLeft,
- y: this._el.move.offsetTop
- },
- this.data.time.start = (new Date).getTime(),
- this.fire("dragstart", this.data),
- ht.addListener(this._el.drag, this.dragevent.move, this._onDragMove, this),
- ht.addListener(this._el.drag, this.dragevent.leave, this._onDragEnd, this)
- }
- _onDragEnd(t) {
- this.data.sliding = !1,
- ht.removeListener(this._el.drag, this.dragevent.move, this._onDragMove, this),
- ht.removeListener(this._el.drag, this.dragevent.leave, this._onDragEnd, this),
- this.fire("dragend", this.data),
- this._momentum()
- }
- _onDragMove(t) {
- var e = {
- x: 0,
- y: 0
- };
- this.data.sliding = !0,
- f ? t.originalEvent ? (this.data.pagex.end = t.originalEvent.touches[0].screenX,
- this.data.pagey.end = t.originalEvent.touches[0].screenY) : (this.data.pagex.end = t.targetTouches[0].screenX,
- this.data.pagey.end = t.targetTouches[0].screenY) : (this.data.pagex.end = t.pageX,
- this.data.pagey.end = t.pageY),
- e.x = this.data.pagex.start - this.data.pagex.end,
- e.y = this.data.pagey.start - this.data.pagey.end,
- this.data.pos.end = {
- x: this._el.drag.offsetLeft,
- y: this._el.drag.offsetTop
- },
- this.data.new_pos.x = -(e.x - this.data.pos.start.x),
- this.data.new_pos.y = -(e.y - this.data.pos.start.y),
- this.options.enable.x && Math.abs(e.x) > Math.abs(e.y) && (t.preventDefault(),
- this._el.move.style.left = this.data.new_pos.x + "px"),
- this.options.enable.y && Math.abs(e.y) > Math.abs(e.y) && (t.preventDefault(),
- this._el.move.style.top = this.data.new_pos.y + "px"),
- this.fire("dragmove", this.data)
- }
- _momentum() {
- var t = {
- x: 0,
- y: 0,
- time: 0
- }
- , e = {
- x: 0,
- y: 0,
- time: 0
- }
- , i = {
- x: !1,
- y: !1
- }
- , a = !1;
- this.data.direction = null,
- t.time = 10 * ((new Date).getTime() - this.data.time.start),
- e.time = 10 * ((new Date).getTime() - this.data.time.start),
- e.x = this.options.momentum_multiplier * (Math.abs(this.data.pagex.end) - Math.abs(this.data.pagex.start)),
- e.y = this.options.momentum_multiplier * (Math.abs(this.data.pagey.end) - Math.abs(this.data.pagey.start)),
- t.x = Math.round(e.x / e.time),
- t.y = Math.round(e.y / e.time),
- this.data.new_pos.x = Math.min(this.data.new_pos.x + t.x),
- this.data.new_pos.y = Math.min(this.data.new_pos.y + t.y),
- this.options.enable.x ? this.options.constraint.left && this.data.new_pos.x > this.options.constraint.left && (this.data.new_pos.x = this.options.constraint.left) : this.data.new_pos.x = this.data.pos.start.x,
- this.options.enable.y ? this.data.new_pos.y < 0 && (this.data.new_pos.y = 0) : this.data.new_pos.y = this.data.pos.start.y,
- e.time < 2e3 && (a = !0),
- this.options.enable.x && this.options.enable.y ? Math.abs(e.x) > Math.abs(e.y) ? i.x = !0 : i.y = !0 : this.options.enable.x ? Math.abs(e.x) > Math.abs(e.y) && (i.x = !0) : Math.abs(e.y) > Math.abs(e.x) && (i.y = !0),
- i.x && (Math.abs(e.x) > this._el.drag.offsetWidth / 2 && (a = !0),
- Math.abs(e.x) > 1e4 && (this.data.direction = "left",
- e.x > 0 && (this.data.direction = "right"))),
- i.y && (Math.abs(e.y) > this._el.drag.offsetHeight / 2 && (a = !0),
- Math.abs(e.y) > 1e4 && (this.data.direction = "up",
- e.y > 0 && (this.data.direction = "down"))),
- e.time < 1e3 || this._animateMomentum(),
- a && this.data.direction ? this.fire("swipe_" + this.data.direction, this.data) : this.data.direction ? this.fire("swipe_nodirection", this.data) : this.options.snap && (this.animator.stop(),
- this.animator = st(this._el.move, {
- top: this.data.pos.start.y,
- left: this.data.pos.start.x,
- duration: this.options.duration,
- easing: tt
- }))
- }
- _animateMomentum() {
- var t = {
- x: this.data.new_pos.x,
- y: this.data.new_pos.y
- }
- , e = {
- duration: this.options.duration,
- easing: tt
- };
- this.options.enable.y && ((this.options.constraint.top || this.options.constraint.bottom) && (t.y > this.options.constraint.bottom ? t.y = this.options.constraint.bottom : t.y < this.options.constraint.top && (t.y = this.options.constraint.top)),
- e.top = Math.floor(t.y) + "px"),
- this.options.enable.x && (this.options.constraint.left && t.x >= this.options.constraint.left && (t.x = this.options.constraint.left),
- this.options.constraint.right && t.x < this.options.constraint.right && (t.x = this.options.constraint.right),
- e.left = Math.floor(t.x) + "px"),
- this.animator = st(this._el.move, e),
- this.fire("momentum", this.data)
- }
- }
- R(Ue, at);
- class Be {
- constructor(t, e, i, a) {
- this.language = a,
- this._el = {
- parent: {},
- container: {},
- slider: {},
- slider_background: {},
- line: {},
- marker_container_mask: {},
- marker_container: {},
- marker_item_container: {},
- timeaxis: {},
- timeaxis_background: {}
- },
- this.collapsed = !1,
- this._el.container = "object" == typeof t ? t : g(t),
- this._el.container.setAttribute("tabindex", "0"),
- this._el.container.setAttribute("role", "application"),
- this._el.container.setAttribute("aria-label", this._("aria_label_timeline_navigation")),
- this._el.container.setAttribute("aria-description", 'Navigate between markers with arrow keys. Press "Home" for the first and "End" for the last markers'),
- this.config = e,
- this.options = {
- width: 600,
- height: 600,
- duration: 1e3,
- ease: et,
- has_groups: !1,
- optimal_tick_width: 50,
- scale_factor: 2,
- marker_padding: 5,
- timenav_height_min: 150,
- marker_height_min: 30,
- marker_width_min: 100,
- zoom_sequence: [.5, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
- },
- this.animator = null,
- this.ready = !1,
- this._markers = [],
- this._eras = [],
- this.has_eras = !1,
- this._groups = [],
- this._calculated_row_height = 100,
- this.current_id = "",
- this.current_focused_id = "",
- this.timescale = {},
- this.timeaxis = {},
- this.max_rows = 6,
- this.animate_css = !1,
- this._swipable,
- E(this.options, i)
- }
- init() {
- this._initLayout(),
- this._initEvents(),
- this._initData(),
- this.updateDisplay(),
- this._onLoaded()
- }
- positionMarkers(t) {
- for (var e = 0; e < this._markers.length; e++) {
- var i = this.timescale.getPositionInfo(e);
- t ? this._markers[e].setClass("tl-timemarker tl-timemarker-fast") : this._markers[e].setClass("tl-timemarker"),
- this._markers[e].setPosition({
- left: i.start
- }),
- this._markers[e].setWidth(i.width)
- }
- }
- updateDisplay(t, e, i) {
- let a = !1;
- t && (0 == this.options.width && t > 0 && (a = !0),
- this.options.width = t),
- e && e != this.options.height && (this.options.height = e,
- this.timescale = this._getTimeScale()),
- this._assignRowsToMarkers(),
- this._el.slider_background.style.width = this.timescale.getPixelWidth() + this.options.width + "px",
- this._el.slider_background.style.left = -this.options.width / 2 + "px",
- this._el.slider.style.width = this.timescale.getPixelWidth() + this.options.width + "px",
- this._swipable.updateConstraint({
- top: !1,
- bottom: !1,
- left: this.options.width / 2,
- right: -(this.timescale.getPixelWidth() - this.options.width / 2)
- }),
- a && this._drawTimeline(),
- this.goToId(this.current_id, !0)
- }
- _getTimeScale() {
- var t = 0;
- try {
- t = parseInt(this.options.marker_height_min)
- } catch (e) {
- S("Invalid value for marker_height_min option."),
- t = 30
- }
- return 0 == t && (S("marker_height_min option must not be zero."),
- t = 30),
- this.max_rows = Math.round((this.options.height - this._el.timeaxis_background.offsetHeight - this.options.marker_padding) / t),
- this.max_rows < 1 && (this.max_rows = 1),
- new ne(this.config,{
- display_width: this._el.container.offsetWidth,
- screen_multiplier: this.options.scale_factor,
- max_rows: this.max_rows
- })
- }
- _updateTimeScale(t) {
- this.options.scale_factor = t,
- this._updateDrawTimeline()
- }
- zoomIn() {
- var t = function(t, e) {
- for (var i = 0; i < t.length; i++)
- if (e < t[i])
- return t[i];
- return e
- }(this.options.zoom_sequence, this.options.scale_factor);
- this.setZoomFactor(t)
- }
- zoomOut() {
- var t = function(t, e) {
- for (var i = t.length - 1; i >= 0; i--)
- if (e > t[i])
- return t[i];
- return e
- }(this.options.zoom_sequence, this.options.scale_factor);
- this.setZoomFactor(t)
- }
- setZoom(t) {
- var e = this.options.zoom_sequence[t];
- "number" == typeof e ? this.setZoomFactor(e) : console.warn("Invalid zoom level. Please use an index number between 0 and " + (this.options.zoom_sequence.length - 1))
- }
- setZoomFactor(t) {
- t <= this.options.zoom_sequence[0] ? this.fire("zoomtoggle", {
- zoom: "out",
- show: !1
- }) : this.fire("zoomtoggle", {
- zoom: "out",
- show: !0
- }),
- t >= this.options.zoom_sequence[this.options.zoom_sequence.length - 1] ? this.fire("zoomtoggle", {
- zoom: "in",
- show: !1
- }) : this.fire("zoomtoggle", {
- zoom: "in",
- show: !0
- }),
- 0 == t && (console.warn("Zoom factor must be greater than zero. Using 0.1"),
- t = .1),
- this.options.scale_factor = t,
- this.goToId(this.current_id, !this._updateDrawTimeline(!0), !0)
- }
- _createGroups() {
- this._groups = [];
- var t = this.timescale.getGroupLabels();
- if (t) {
- this.options.has_groups = !0;
- for (var e = 0; e < t.length; e++)
- this._createGroup(t[e])
- }
- }
- _createGroup(t) {
- var e = new oe(t);
- this._addGroup(e),
- this._groups.push(e)
- }
- _addGroup(t) {
- t.addTo(this._el.container)
- }
- _positionGroups() {
- if (this.options.has_groups)
- for (var t = this.options.height - this._el.timeaxis_background.offsetHeight, e = Math.floor(t / this.timescale.getNumberOfRows() - this.options.marker_padding), i = (this.timescale.getGroupLabels(),
- 0), a = 0; i < this._groups.length; i++) {
- var s = Math.floor(a * (e + this.options.marker_padding))
- , n = !1;
- s > t - this.options.marker_padding && (n = !0),
- this._groups[i].setRowPosition(s, this._calculated_row_height + this.options.marker_padding / 2),
- this._groups[i].setAlternateRowColor(z(i), n),
- a += this._groups[i].data.rows
- }
- }
- _addMarker(t) {
- t.addTo(this._el.marker_item_container),
- t.on("markerclick", this._onMarkerClick, this),
- t.on("added", this._onMarkerAdded, this)
- }
- _createMarker(t, e) {
- var i = new $e(t,this.options);
- this._addMarker(i),
- e < 0 ? this._markers.push(i) : this._markers.splice(e, 0, i)
- }
- _createMarkers(t) {
- for (var e = 0; e < t.length; e++)
- this._createMarker(t[e], -1)
- }
- _removeMarker(t) {
- t.removeFrom(this._el.marker_item_container)
- }
- _destroyMarker(t) {
- this._removeMarker(this._markers[t]),
- this._markers.splice(t, 1)
- }
- _calculateMarkerHeight(t) {
- return t / this.timescale.getNumberOfRows() - this.options.marker_padding
- }
- _calculateRowHeight(t) {
- return t / this.timescale.getNumberOfRows()
- }
- _calculateAvailableHeight() {
- return this.options.height - this._el.timeaxis_background.offsetHeight - this.options.marker_padding
- }
- _calculateMinimumTimeNavHeight() {
- return this.timescale.getNumberOfRows() * this.options.marker_height_min + this._el.timeaxis_background.offsetHeight + this.options.marker_padding
- }
- getMinimumHeight() {
- return this._calculateMinimumTimeNavHeight()
- }
- _assignRowsToMarkers() {
- var t = this._calculateAvailableHeight()
- , e = this._calculateMarkerHeight(t);
- this._positionGroups(),
- this._calculated_row_height = this._calculateRowHeight(t);
- for (var i = 0; i < this._markers.length; i++) {
- this._markers[i].setHeight(e);
- var a = this.timescale.getPositionInfo(i).row
- , s = Math.floor(a * (e + this.options.marker_padding)) + this.options.marker_padding
- , n = t - s + this.options.marker_padding;
- this._markers[i].setRowPosition(s, n)
- }
- }
- _resetMarkersActive() {
- for (var t = 0; t < this._markers.length; t++)
- this._markers[t].setActive(!1)
- }
- _resetMarkersBlurListeners() {
- for (var t = 0; t < this._markers.length; t++)
- this._markers[t].off("markerblur", this._onMarkerBlur, this)
- }
- _findMarkerIndex(t) {
- var e = -1;
- return ("string" == typeof t || t instanceof String) && (e = H(t, this._markers, "unique_id", e)),
- e
- }
- _createEras(t) {
- for (var e = 0; e < t.length; e++) {
- var i = t[e]
- , a = new re(i.start_date,i.end_date,i.headline,this.options);
- this._eras.push(a),
- a.addTo(this._el.marker_item_container),
- a.on("added", this._onEraAdded, this)
- }
- }
- _positionEras(t) {
- for (var e = 0, i = 0; i < this._eras.length; i++) {
- var a = {
- start: 0,
- end: 0,
- width: 0
- };
- a.start = this.timescale.getPosition(this._eras[i].start_date.getTime()),
- a.end = this.timescale.getPosition(this._eras[i].end_date.getTime()),
- a.width = a.end - a.start,
- t ? this._eras[i].setClass("tl-timeera tl-timeera-fast") : this._eras[i].setClass("tl-timeera"),
- this._eras[i].setPosition({
- left: a.start
- }),
- this._eras[i].setWidth(a.width),
- ++e > 5 && (e = 0),
- this._eras[i].setColor(e)
- }
- }
- createMarker(t, e) {
- this._createMarker(t, e)
- }
- createMarkers(t) {
- this._createMarkers(t)
- }
- destroyMarker(t) {
- this._destroyMarker(t)
- }
- destroyMarkerId(t) {
- this.destroyMarker(this._findMarkerIndex(t))
- }
- goTo(t, e, i) {
- var a = this.options.ease
- , s = this.options.duration
- , n = t < 0 ? 0 : t;
- this._resetMarkersActive(),
- t >= 0 && t < this._markers.length && this._markers[t].setActive(!0),
- this.animateMovement(n, e, i, s, a),
- t >= 0 && t < this._markers.length ? this.current_id = this.current_focused_id = this._markers[t].data.unique_id : this.current_id = this.current_focused_id = "",
- this._setLabelWithCurrentMarker()
- }
- goToId(t, e, i) {
- this.goTo(this._findMarkerIndex(t), e, i)
- }
- focusOn(t, e, i) {
- const a = this.options.ease
- , s = this.options.duration
- , n = t < 0 ? 0 : t;
- this.animateMovement(n, e, i, s, a),
- this._resetMarkersBlurListeners(),
- t >= 0 && t < this._markers.length && (this._markers[t].setFocus(),
- this.current_focused_id = this._markers[t].data.unique_id,
- this._markers[t].on("markerblur", this._onMarkerBlur, this))
- }
- focusNext() {
- const t = this._findMarkerIndex(this.current_focused_id);
- t + 1 < this._markers.length ? this.focusOn(t + 1) : this.focusOn(t)
- }
- focusPrevious() {
- const t = this._findMarkerIndex(this.current_focused_id);
- t - 1 >= 0 ? this.focusOn(t - 1) : this.focusOn(t)
- }
- animateMovement(t, e, i, a, s) {
- this.animator && this.animator.stop(),
- e ? (this._el.slider.className = "tl-timenav-slider",
- this._el.slider.style.left = -this._markers[t].getLeft() + this.options.width / 2 + "px") : i ? (this._el.slider.className = "tl-timenav-slider tl-timenav-slider-animate",
- this.animate_css = !0,
- this._el.slider.style.left = -this._markers[t].getLeft() + this.options.width / 2 + "px") : (this._el.slider.className = "tl-timenav-slider",
- this.animator = st(this._el.slider, {
- left: -this._markers[t].getLeft() + this.options.width / 2 + "px",
- duration: a,
- easing: s
- })),
- t >= 0 && t < this._markers.length ? this.current_id = this._markers[t].data.unique_id : this.current_id = "",
- this._dispatchVisibleTicksChange()
- }
- goToId(t, e, i) {
- this.goTo(this._findMarkerIndex(t), e, i)
- }
- _dispatchVisibleTicksChange() {
- this.ticks_change_timeout && (clearTimeout(this.ticks_change_timeout),
- this.ticks_change_timeout = null),
- this.ticks_change_timeout = setTimeout(( () => {
- const t = this.timeaxis.getVisibleTicks();
- this.fire("visible_ticks_change", {
- visible_ticks: t
- })
- }
- ), this.options.duration)
- }
- _onLoaded() {
- this.ready = !0,
- this.fire("loaded", this.config)
- }
- _onMarkerAdded(t) {
- this.fire("dateAdded", this.config)
- }
- _onEraAdded(t) {
- this.fire("eraAdded", this.config)
- }
- _onMarkerRemoved(t) {
- this.fire("dateRemoved", this.config)
- }
- _onMarkerClick(t) {
- this.goToId(t.unique_id),
- this.fire("change", {
- unique_id: t.unique_id
- })
- }
- _onMarkerBlur(t) {
- this.current_focused_id !== this.current_id && this.focusOn(this._findMarkerIndex(this.current_id))
- }
- _onMouseScroll(t) {
- var e = 0
- , i = 0
- , a = {
- right: -(this.timescale.getPixelWidth() - this.options.width / 2),
- left: this.options.width / 2
- };
- t || (t = window.event),
- t.originalEvent && (t = t.originalEvent),
- void 0 !== t.wheelDeltaX && (e = t.wheelDeltaY / 6,
- e = Math.abs(t.wheelDeltaX) > Math.abs(t.wheelDeltaY) ? t.wheelDeltaX / 6 : 0),
- e && (t.preventDefault && t.preventDefault(),
- t.returnValue = !1),
- (i = parseInt(this._el.slider.style.left.replace("px", "")) + e) > a.left ? i = a.left : i < a.right && (i = a.right),
- this.animate_css && (this._el.slider.className = "tl-timenav-slider",
- this.animate_css = !1),
- this._el.slider.style.left = i + "px"
- }
- _onDragMove(t) {
- this.animate_css && (this._el.slider.className = "tl-timenav-slider",
- this.animate_css = !1)
- }
- _onKeydown(t) {
- switch (ht.stopPropagation(t),
- t.key) {
- case "ArrowUp":
- case "ArrowRight":
- this.focusNext();
- break;
- case "ArrowDown":
- case "ArrowLeft":
- this.focusPrevious();
- break;
- case "Home":
- this.focusOn(0);
- break;
- case "End":
- this.focusOn(this._markers.length - 1)
- }
- }
- _drawTimeline(t) {
- this.timescale = this._getTimeScale(),
- this.timeaxis.drawTicks(this.timescale, this.options.optimal_tick_width),
- this.positionMarkers(t),
- this._assignRowsToMarkers(),
- this._createGroups(),
- this._positionGroups(),
- this.has_eras && this._positionEras(t)
- }
- _updateDrawTimeline(t) {
- var e = !1;
- if (t) {
- var i = new ne(this.config,{
- display_width: this._el.container.offsetWidth,
- screen_multiplier: this.options.scale_factor,
- max_rows: this.max_rows
- });
- this.timescale.getMajorScale() == i.getMajorScale() && this.timescale.getMinorScale() == i.getMinorScale() && (e = !0)
- } else
- e = !0;
- return e ? (this.timescale = this._getTimeScale(),
- this.timeaxis.positionTicks(this.timescale, this.options.optimal_tick_width),
- this.positionMarkers(),
- this._assignRowsToMarkers(),
- this._positionGroups(),
- this.has_eras && this._positionEras(),
- this.updateDisplay()) : this._drawTimeline(!0),
- e
- }
- _setLabelWithCurrentMarker() {
- const t = this._markers[this._findMarkerIndex(this.current_focused_id)]
- , e = t && t.ariaLabel ? `, ${t.ariaLabel}, shown` : "";
- this._el.container.setAttribute("aria-label", `Timeline navigation ${e}`)
- }
- _initLayout() {
- this._el.line = v("div", "tl-timenav-line", this._el.container),
- this._el.slider = v("div", "tl-timenav-slider", this._el.container),
- this._el.slider_background = v("div", "tl-timenav-slider-background", this._el.slider),
- this._el.marker_container_mask = v("div", "tl-timenav-container-mask", this._el.slider),
- this._el.marker_container = v("div", "tl-timenav-container", this._el.marker_container_mask),
- this._el.marker_item_container = v("div", "tl-timenav-item-container", this._el.marker_container),
- this._el.timeaxis = v("div", "tl-timeaxis", this._el.slider),
- this._el.timeaxis_background = v("div", "tl-timeaxis-background", this._el.container),
- this.timeaxis = new le(this._el.timeaxis,this.options,this.language),
- this._swipable = new Ue(this._el.slider_background,this._el.slider,{
- enable: {
- x: !0,
- y: !1
- },
- constraint: {
- top: !1,
- bottom: !1,
- left: this.options.width / 2,
- right: !1
- },
- snap: !1
- }),
- this._swipable.enable()
- }
- _initEvents() {
- this._swipable.on("dragmove", this._onDragMove, this),
- ht.addListener(this._el.container, "mousewheel", this._onMouseScroll, this),
- ht.addListener(this._el.container, "DOMMouseScroll", this._onMouseScroll, this),
- ht.addListener(this._el.container, "keydown", this._onKeydown, this)
- }
- _initData() {
- this._createMarkers(this.config.events),
- this.config.eras && this.config.eras.length > 0 && (this.has_eras = !0,
- this._createEras(this.config.eras)),
- this._drawTimeline()
- }
- }
- R(Be, at, ot, Rt),
- i(142);
- class We {
- constructor(t, e, i, a) {
- a && this.setLanguage(a),
- this._el = {
- container: {},
- scroll_container: {},
- background: {},
- content_container: {},
- content: {}
- },
- this._media = null,
- this._mediaclass = {},
- this._text = {},
- this._background_media = null,
- this._state = {
- loaded: !1
- },
- this.has = {
- headline: !1,
- text: !1,
- media: !1,
- title: !1,
- background: {
- image: !1,
- color: !1,
- color_value: ""
- }
- },
- this.has.title = i,
- this.data = {
- unique_id: null,
- background: null,
- start_date: null,
- end_date: null,
- location: null,
- text: null,
- media: null,
- autolink: !0
- },
- this.options = {
- duration: 1e3,
- slide_padding_lr: 40,
- ease: Q,
- width: 600,
- height: 600,
- skinny_size: 650,
- media_name: ""
- },
- this.active = !1,
- this.animator = {},
- E(this.options, e),
- E(this.data, t),
- this._initLayout(),
- this._initEvents()
- }
- show() {
- this.animator = st(this._el.slider_container, {
- left: -this._el.container.offsetWidth * n + "px",
- duration: this.options.duration,
- easing: this.options.ease
- })
- }
- hide() {}
- setActive(t) {
- this.active = t,
- this.active ? (this.data.background && this.fire("background_change", this.has.background),
- this._setInteractive(!0),
- this.loadMedia()) : (this.stopMedia(),
- this._setInteractive(!1))
- }
- addTo(t) {
- t.appendChild(this._el.container)
- }
- removeFrom(t) {
- t.removeChild(this._el.container)
- }
- updateDisplay(t, e, i) {
- var a, s = this.options.slide_padding_lr, n = this.options.slide_padding_lr;
- this.options.width = t || this._el.container.offsetWidth,
- a = this.options.width - 2 * this.options.slide_padding_lr,
- h && this.options.width <= this.options.skinny_size ? (s = 0,
- n = 0,
- a = this.options.width) : "landscape" == i || this.options.width <= this.options.skinny_size && (s = 50,
- n = 50,
- a = this.options.width - s - n),
- this._el.content.style.paddingLeft = s + "px",
- this._el.content.style.paddingRight = n + "px",
- this._el.content.style.width = a + "px",
- this.options.height = e || this._el.container.offsetHeight,
- this._media && (!this.has.text && this.has.headline ? this._media.updateDisplay(a, this.options.height - this._text.headlineHeight(), i) : this.has.text || this.has.headline ? this.options.width <= this.options.skinny_size ? this._media.updateDisplay(a, this.options.height, i) : this._media.updateDisplay(a / 2, this.options.height, i) : this._media.updateDisplay(a, this.options.height, i)),
- this._updateBackgroundDisplay()
- }
- loadMedia() {
- var t = this;
- this._media && !this._state.loaded && (this._media.loadMedia(),
- this._state.loaded = !0),
- this._background_media && !this._background_media._state.loaded && (this._background_media.on("loaded", (function() {
- t._updateBackgroundDisplay()
- }
- )),
- this._background_media.loadMedia())
- }
- stopMedia() {
- this._media && this._state.loaded && this._media.stopMedia()
- }
- getBackground() {
- return this.has.background
- }
- scrollToTop() {
- this._el.container.scrollTop = 0
- }
- getFormattedDate() {
- if (O(this.data.display_date).length > 0)
- return this.data.display_date;
- var t = "";
- return this.has.title || (this.data.end_date && (t = " — " + this.data.end_date.getDisplayDate(this.getLanguage())),
- this.data.start_date && (t = this.data.start_date.getDisplayDate(this.getLanguage()) + t)),
- t
- }
- _initLayout() {
- if (this._el.container = v("div", "tl-slide"),
- this.has.title && (this._el.container.className = "tl-slide tl-slide-titleslide"),
- this.data.unique_id && (this._el.container.id = this.data.unique_id),
- this._el.scroll_container = v("div", "tl-slide-scrollable-container", this._el.container),
- this._el.content_container = v("div", "tl-slide-content-container", this._el.scroll_container),
- this._el.content = v("div", "tl-slide-content", this._el.content_container),
- this._el.background = v("div", "tl-slide-background", this._el.container),
- this.data.background) {
- if (this.data.background.url) {
- var t = qe(this.data.background, !0);
- t && (this._background_media = new t.cls(this.data.background,{
- background: 1
- }),
- this.has.background.image = !0,
- this._el.container.className += " tl-full-image-background",
- this.has.background.color_value = "#000",
- this._el.background.style.display = "block"),
- this.data.background.alt && (this._el.background.setAttribute("role", "img"),
- this._el.background.setAttribute("aria-label", this.data.background.alt))
- }
- this.data.background.color && (this.has.background.color = !0,
- this._el.container.className += " tl-full-color-background",
- this.has.background.color_value = this.data.background.color),
- this.data.background.text_background && (this._el.container.className += " tl-text-background")
- }
- this.data.media && this.data.media.url && "" != this.data.media.url && (this.has.media = !0),
- this.data.text && this.data.text.text && (this.has.text = !0),
- this.data.text && this.data.text.headline && (this.has.headline = !0),
- this.has.media && (this.data.media.mediatype = qe(this.data.media),
- this.options.media_name = this.data.media.mediatype.name,
- this.options.media_type = this.data.media.mediatype.type,
- this.options.autolink = this.data.autolink,
- this._media = new this.data.media.mediatype.cls(this.data.media,this.options,this.getLanguage())),
- (this.has.text || this.has.headline) && (this._text = new he(this.data.text,{
- title: this.has.title,
- language: this.getLanguage(),
- autolink: this.data.autolink
- }),
- this._text.addDateText(this.getFormattedDate())),
- this.has.text || this.has.headline || !this.has.media ? this.has.headline && this.has.media && !this.has.text ? (this._el.container.classList.add("tl-slide-media-only"),
- this._text.addTo(this._el.content),
- this._media.addTo(this._el.content)) : this.has.text && this.has.media ? (this._text.addTo(this._el.content),
- this._media.addTo(this._el.content)) : (this.has.text || this.has.headline) && (this._el.container.classList.add("tl-slide-text-only"),
- this._text.addTo(this._el.content)) : (this._el.container.classList.add("tl-slide-media-only"),
- this._media.addTo(this._el.content)),
- this.onLoaded()
- }
- _initEvents() {}
- _updateBackgroundDisplay() {
- this._background_media && this._background_media._state.loaded && (this._el.background.style.backgroundImage = "url('" + this._background_media.getImageURL(this.options.width, this.options.height) + "')")
- }
- _setInteractive(t) {
- t ? this._el.container.removeAttribute("inert") : this._el.container.setAttribute("inert", !0)
- }
- }
- R(We, Rt, at, ot);
- class Ge {
- constructor(t, e, i) {
- this._el = {
- container: {},
- content_container: {},
- icon: {},
- title: {},
- description: {}
- },
- this.mediatype = {},
- this.data = {
- title: "Navigation",
- description: "Description",
- date: "Date"
- },
- this.options = {
- direction: "previous"
- },
- this.animator = null,
- E(this.options, e),
- E(this.data, t),
- this._el.container = y("tl-slidenav-" + this.options.direction),
- h && this._el.container.setAttribute("ontouchstart", " "),
- this._initLayout(),
- this._initEvents(),
- i && i.appendChild(this._el.container)
- }
- update(t) {
- var e = {
- title: "",
- description: "",
- date: t.getFormattedDate()
- };
- t.data.text && t.data.text.headline && (e.title = t.data.text.headline),
- this._update(e)
- }
- setColor(t) {
- this._el.content_container.className = t ? "tl-slidenav-content-container tl-slidenav-inverted" : "tl-slidenav-content-container"
- }
- _onMouseClick() {
- this.fire("clicked", this.options)
- }
- _update(t) {
- this.data = E(this.data, t);
- const e = F(this.data.title);
- this._el.title.innerHTML = e;
- const i = F(this.data.date);
- this._el.description.innerHTML = i,
- this._el.container.setAttribute("aria-label", `${this.options.direction}, ${e}, ${i}`)
- }
- _initLayout() {
- this._el.content_container = v("div", "tl-slidenav-content-container", this._el.container),
- this._el.icon = v("div", "tl-slidenav-icon", this._el.content_container),
- this._el.title = v("div", "tl-slidenav-title", this._el.content_container),
- this._el.description = v("div", "tl-slidenav-description", this._el.content_container),
- this._el.icon.innerHTML = " ",
- this._update()
- }
- _initEvents() {
- ht.addListener(this._el.container, "click", this._onMouseClick, this)
- }
- }
- R(Ge, ot, at);
- class Ye {
- constructor(t, e, i, a) {
- a && this.setLanguage(a),
- this._el = {
- container: {},
- background: {},
- slider_container_mask: {},
- slider_container: {},
- slider_item_container: {}
- },
- this._nav = {},
- this._nav.previous = {},
- this._nav.next = {},
- this.slide_spacing = 0,
- this._slides = [],
- this._swipable,
- this.preloadTimer,
- this._message,
- this.current_id = "",
- this.data = {},
- this.options = {
- id: "",
- layout: "portrait",
- width: 600,
- height: 600,
- default_bg_color: {
- r: 255,
- g: 255,
- b: 255
- },
- slide_padding_lr: 40,
- start_at_slide: 1,
- slide_default_fade: "0%",
- duration: 1e3,
- ease: et,
- dragging: !0,
- trackResize: !0
- },
- "object" == typeof t ? (this._el.container = t,
- this.options.id = P(6, "tl")) : (this.options.id = t,
- this._el.container = g(t)),
- this._el.container.id || (this._el.container.id = this.options.id),
- this.animator = null,
- E(this.options, i),
- E(this.data, e)
- }
- init() {
- this._initLayout(),
- this._initEvents(),
- this._initData(),
- this.updateDisplay(),
- this.goTo(this.options.start_at_slide),
- this._onLoaded()
- }
- _addSlide(t) {
- t.addTo(this._el.slider_item_container),
- t.on("added", this._onSlideAdded, this),
- t.on("background_change", this._onBackgroundChange, this)
- }
- _createSlide(t, e, i) {
- var a = new We(t,this.options,e,this.getLanguage());
- this._addSlide(a),
- i < 0 ? this._slides.push(a) : this._slides.splice(i, 0, a)
- }
- _createSlides(t) {
- for (var e = 0; e < t.length; e++)
- "" == t[e].unique_id && (t[e].unique_id = P(6, "tl-slide")),
- this._createSlide(t[e], !1, -1)
- }
- _removeSlide(t) {
- t.removeFrom(this._el.slider_item_container),
- t.off("added", this._onSlideRemoved, this),
- t.off("background_change", this._onBackgroundChange)
- }
- _destroySlide(t) {
- this._removeSlide(this._slides[t]),
- this._slides.splice(t, 1)
- }
- _findSlideIndex(t) {
- var e = t;
- return ("string" == typeof t || t instanceof String) && (e = H(t, this._slides, "unique_id")),
- e
- }
- updateDisplay(t, e, i, a) {
- var s, n;
- n = void 0 === a ? this.options.layout : a,
- this.options.layout = n,
- this.options.width = t || this._el.container.offsetWidth,
- this.options.height = e || this._el.container.offsetHeight,
- this.slide_spacing = 2 * this.options.width,
- s = this.options.height / 2,
- this._nav.next.setPosition({
- top: s
- }),
- this._nav.previous.setPosition({
- top: s
- });
- for (var o = 0; o < this._slides.length; o++)
- this._slides[o].updateDisplay(this.options.width, this.options.height, n),
- this._slides[o].setPosition({
- left: this.slide_spacing * o,
- top: 0
- });
- this.goToId(this.current_id, !0, !0)
- }
- createSlide(t, e) {
- this._createSlide(t, !1, e)
- }
- createSlides(t) {
- this._createSlides(t)
- }
- destroySlide(t) {
- this._destroySlide(t)
- }
- destroySlideId(t) {
- this.destroySlide(this._findSlideIndex(t))
- }
- goTo(t, e, i) {
- t = parseInt(t),
- isNaN(t) && (t = 0);
- var a = this;
- this.changeBackground({
- color_value: "",
- image: !1
- }),
- this.preloadTimer && clearTimeout(this.preloadTimer);
- for (var s = 0; s < this._slides.length; s++)
- this._slides[s].setActive(!1);
- t < this._slides.length && t >= 0 && (this.current_id = this._slides[t].data.unique_id,
- this.animator && this.animator.stop(),
- this._swipable && this._swipable.stopMomentum(),
- e ? (this._el.slider_container.style.left = -this.slide_spacing * t + "px",
- this._onSlideChange(i)) : this.animator = st(this._el.slider_container, {
- left: -this.slide_spacing * t + "px",
- duration: this.options.duration,
- easing: this.options.ease,
- complete: this._onSlideChange(i)
- }),
- this._slides[t].setActive(!0),
- this._slides[t + 1] ? (this.showNav(this._nav.next, !0),
- this._nav.next.update(this._slides[t + 1])) : this.showNav(this._nav.next, !1),
- this._slides[t - 1] ? (this.showNav(this._nav.previous, !0),
- this._nav.previous.update(this._slides[t - 1])) : this.showNav(this._nav.previous, !1),
- this.preloadTimer = setTimeout((function() {
- a.preloadSlides(t)
- }
- ), this.options.duration))
- }
- goToId(t, e, i) {
- this.goTo(this._findSlideIndex(t), e, i)
- }
- preloadSlides(t) {
- this._slides[t + 1] && (this._slides[t + 1].loadMedia(),
- this._slides[t + 1].scrollToTop()),
- this._slides[t + 2] && (this._slides[t + 2].loadMedia(),
- this._slides[t + 2].scrollToTop()),
- this._slides[t - 1] && (this._slides[t - 1].loadMedia(),
- this._slides[t - 1].scrollToTop()),
- this._slides[t - 2] && (this._slides[t - 2].loadMedia(),
- this._slides[t - 2].scrollToTop())
- }
- next() {
- var t = this._findSlideIndex(this.current_id);
- t + 1 < this._slides.length ? this.goTo(t + 1) : this.goTo(t)
- }
- previous() {
- var t = this._findSlideIndex(this.current_id);
- t - 1 >= 0 ? this.goTo(t - 1) : this.goTo(t)
- }
- showNav(t, e) {
- this.options.width <= 500 && h ? t.hide() : e ? t.show() : t.hide()
- }
- changeBackground(t) {
- var e = {
- r: 256,
- g: 256,
- b: 256
- };
- t.color_value && "" != t.color_value ? (e = M(t.color_value)) || (S("Invalid color value " + t.color_value),
- e = this.options.default_bg_color) : (e = this.options.default_bg_color,
- t.color_value = "rgb(" + e.r + " , " + e.g + ", " + e.b + ")"),
- e.r,
- e.g,
- e.b,
- this._el.background.style.backgroundImage = "none",
- t.color_value ? this._el.background.style.backgroundColor = t.color_value : this._el.background.style.backgroundColor = "transparent",
- e.r < 255 || e.g < 255 || e.b < 255 || t.image ? (this._nav.next.setColor(!0),
- this._nav.previous.setColor(!0)) : (this._nav.next.setColor(!1),
- this._nav.previous.setColor(!1))
- }
- _updateDrawSlides() {
- for (var t = this.options.layout, e = 0; e < this._slides.length; e++)
- this._slides[e].updateDisplay(this.options.width, this.options.height, t),
- this._slides[e].setPosition({
- left: this.slide_spacing * e,
- top: 0
- });
- this.goToId(this.current_id, !0, !1)
- }
- _initLayout() {
- this._el.container.classList.add("tl-storyslider"),
- this._nav.previous = new Ge({
- title: "Previous",
- description: "description"
- },{
- direction: "previous"
- },this._el.container),
- this._nav.next = new Ge({
- title: "Next",
- description: "description"
- },{
- direction: "next"
- },this._el.container),
- this._el.slider_container_mask = v("div", "tl-slider-container-mask", this._el.container),
- this._el.background = v("div", "tl-slider-background tl-animate", this._el.container),
- this._el.slider_container = v("div", "tl-slider-container tlanimate", this._el.slider_container_mask),
- this._el.slider_item_container = v("div", "tl-slider-item-container", this._el.slider_container),
- this._el.slider_container.setAttribute("aria-live", "polite"),
- this.options.width = this._el.container.offsetWidth,
- this.options.height = this._el.container.offsetHeight,
- this._el.slider_container.style.left = "0px",
- f && (this._swipable = new Ue(this._el.slider_container_mask,this._el.slider_container,{
- enable: {
- x: !0,
- y: !1
- },
- snap: !0
- }),
- this._swipable.enable(),
- this._message = new jt(this._el.container,{
- message_class: "tl-message-full",
- message_icon_class: "tl-icon-swipe-left"
- },this.getLanguage()),
- this._message.updateMessage(this._("swipe_to_navigate")),
- this._message.addTo(this._el.container))
- }
- _initEvents() {
- this._nav.next.on("clicked", this._onNavigation, this),
- this._nav.previous.on("clicked", this._onNavigation, this),
- this._message && this._message.on("clicked", this._onMessageClick, this),
- this._swipable && (this._swipable.on("swipe_left", this._onNavigation, this),
- this._swipable.on("swipe_right", this._onNavigation, this),
- this._swipable.on("swipe_nodirection", this._onSwipeNoDirection, this))
- }
- _initData() {
- this.data.title && this._createSlide(this.data.title, !0, -1),
- this._createSlides(this.data.events)
- }
- _onBackgroundChange(t) {
- var e = this._findSlideIndex(this.current_id)
- , i = this._slides[e].getBackground();
- this.changeBackground(t),
- this.fire("colorchange", i)
- }
- _onMessageClick(t) {
- this._message.hide()
- }
- _onSwipeNoDirection(t) {
- this.goToId(this.current_id)
- }
- _onNavigation(t) {
- "next" == t.direction || "left" == t.direction ? this.next() : "previous" != t.direction && "right" != t.direction || this.previous(),
- this.fire("nav_" + t.direction, this.data)
- }
- _onSlideAdded(t) {
- S("slideadded"),
- this.fire("slideAdded", this.data)
- }
- _onSlideRemoved(t) {
- this.fire("slideRemoved", this.data)
- }
- _onSlideChange(t) {
- t || this.fire("change", {
- unique_id: this.current_id
- })
- }
- _onMouseClick(t) {}
- _fireMouseEvent(t) {
- if (this._loaded) {
- var e = t.type;
- e = "mouseenter" === e ? "mouseover" : "mouseleave" === e ? "mouseout" : e,
- this.hasEventListeners(e) && ("contextmenu" === e && ht.preventDefault(t),
- this.fire(e, {
- latlng: "something",
- layerPoint: "something else"
- }))
- }
- }
- _onLoaded() {
- this.fire("loaded", this.data)
- }
- }
- R(Ye, Rt, at);
- class Ze {
- constructor(t, e, i, a) {
- this._el = {
- parent: {},
- container: {},
- button_forwardtoend: {},
- button_backtostart: {},
- button_zoomin: {},
- button_zoomout: {},
- arrow: {},
- line: {},
- coverbar: {},
- grip: {}
- },
- this.collapsed = !1,
- this._el.container = "object" == typeof t ? t : g(t),
- e && (this._el.parent = e),
- this.data = {
- visible_ticks_dates: {}
- },
- this.options = {
- width: 600,
- height: 600,
- duration: 1e3,
- ease: et,
- menubar_default_y: 0
- },
- this.animator = {},
- this.setLanguage(a),
- E(this.options, i),
- this._initLayout(),
- this._initEvents()
- }
- show(t) {
- this.options.duration
- }
- hide(t) {}
- toogleZoomIn(t) {
- t ? this._el.button_zoomin.removeAttribute("disabled") : this._el.button_zoomin.setAttribute("disabled", !0)
- }
- toogleZoomOut(t) {
- t ? this._el.button_zoomout.removeAttribute("disabled") : this._el.button_zoomout.setAttribute("disabled", !0)
- }
- changeVisibleTicks(t) {
- const e = t.minor;
- if (!e.length)
- return void (this.data.visible_ticks_dates = {});
- const i = e[0].date.getFullYear()
- , a = e[e.length - 1].date.getFullYear();
- this.data.visible_ticks_dates = {
- start: i,
- end: a
- },
- this._updateZoomAriaLabels()
- }
- setSticky(t) {
- this.options.menubar_default_y = t
- }
- setColor(t) {
- this._el.container.className = t ? "tl-menubar tl-menubar-inverted" : "tl-menubar"
- }
- updateDisplay(t, e, i, a) {
- this._updateDisplay(t, e, i, a)
- }
- _onButtonZoomIn(t) {
- this.fire("zoom_in", t)
- }
- _onButtonZoomOut(t) {
- this.fire("zoom_out", t)
- }
- _onButtonForwardToEnd(t) {
- this.fire("forward_to_end", t)
- }
- _onButtonBackToStart(t) {
- this.fire("back_to_start", t)
- }
- _initLayout() {
- this._el.button_zoomin = y("tl-menubar-button", this._el.container),
- this._el.button_zoomout = y("tl-menubar-button", this._el.container),
- this._el.button_forwardtoend = y("tl-menubar-button", this._el.container),
- this._el.button_backtostart = y("tl-menubar-button", this._el.container),
- h && this._el.container.setAttribute("ontouchstart", " "),
- this._el.button_backtostart.innerHTML = "<span class='tl-icon-goback'></span>",
- this._el.button_backtostart.setAttribute("aria-label", this._("return_to_title")),
- this._el.button_forwardtoend.innerHTML = "<span class='tl-icon-goend'></span>",
- this._el.button_forwardtoend.setAttribute("aria-label", this._("go_to_end")),
- this._el.button_zoomin.innerHTML = "<span class='tl-icon-zoom-in'></span>",
- this._el.button_zoomin.setAttribute("aria-label", this._("zoom_in")),
- this._el.button_zoomout.innerHTML = "<span class='tl-icon-zoom-out'></span>",
- this._el.button_zoomout.setAttribute("aria-label", this._("zoom_out"))
- }
- _initEvents() {
- ht.addListener(this._el.button_forwardtoend, "click", this._onButtonForwardToEnd, this),
- ht.addListener(this._el.button_backtostart, "click", this._onButtonBackToStart, this),
- ht.addListener(this._el.button_zoomin, "click", this._onButtonZoomIn, this),
- ht.addListener(this._el.button_zoomout, "click", this._onButtonZoomOut, this)
- }
- _updateDisplay(t, e, i) {
- t && (this.options.width = t),
- e && (this.options.height = e)
- }
- _updateZoomAriaLabels() {
- 0 == Object.keys(this.data.visible_ticks_dates).length ? (this._el.button_zoomin.setAttribute("aria-description", ""),
- this._el.button_zoomout.setAttribute("aria-description", "")) : (this._el.button_zoomin.setAttribute("aria-description", this._("aria_label_zoomin", this.data.visible_ticks_dates)),
- this._el.button_zoomout.setAttribute("aria-description", this._("aria_label_zoomout", this.data.visible_ticks_dates)))
- }
- }
- R(Ze, ot, at, Rt);
- let Ve = null;
- if (document) {
- let t = document.getElementsByTagName("script");
- t && t.length > 0 && (Ve = t[t.length - 1].src)
- }
- class Xe {
- constructor(t, e, i) {
- if (i || (i = {}),
- this.ready = !1,
- this._el = {
- container: g(t),
- storyslider: {},
- timenav: {},
- menubar: {}
- },
- i.lang && !i.language && (i.language = i.lang),
- this.language = Ot,
- this._storyslider = {},
- this._timenav = {},
- this._menubar = {},
- this._loaded = {
- storyslider: !1,
- timenav: !1
- },
- this.config = null,
- this.options = {
- script_path: "https://cdn.knightlab.com/libs/timeline3/latest/js/",
- height: this._el.container.offsetHeight,
- width: this._el.container.offsetWidth,
- debug: !1,
- font: "default",
- is_embed: !1,
- is_full_embed: !1,
- hash_bookmark: !1,
- default_bg_color: {
- r: 255,
- g: 255,
- b: 255
- },
- scale_factor: 2,
- layout: "landscape",
- timenav_position: "bottom",
- optimal_tick_width: 60,
- base_class: "tl-timeline",
- timenav_height: null,
- timenav_height_percentage: 25,
- timenav_mobile_height_percentage: 40,
- timenav_height_min: 175,
- marker_height_min: 30,
- marker_width_min: 100,
- marker_padding: 5,
- start_at_slide: 0,
- start_at_end: !1,
- menubar_height: 0,
- skinny_size: 650,
- medium_size: 800,
- use_bc: !1,
- duration: 1e3,
- ease: et,
- dragging: !0,
- trackResize: !0,
- map_type: "stamen:toner-lite",
- slide_padding_lr: 100,
- slide_default_fade: "0%",
- zoom_sequence: [.5, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89],
- language: "en",
- ga_measurement_id: null,
- ga_property_id: null,
- track_events: ["back_to_start", "nav_next", "nav_previous", "zoom_in", "zoom_out"],
- theme: null,
- sheets_proxy: "https://sheets-proxy.knightlab.com/proxy/",
- soundcite: !1
- },
- this.animator_timenav = null,
- this.animator_storyslider = null,
- this.animator_menubar = null,
- this.message = new jt(this._el.container,{
- message_class: "tl-message-full"
- }),
- "string" == typeof i.default_bg_color) {
- var a = M(i.default_bg_color);
- a ? i.default_bg_color = a : (delete i.default_bg_color,
- S("Invalid default background color. Ignoring."))
- }
- var s, n;
- E(this.options, i),
- this.options.script_path || (this.options.script_path = this.determineScriptPath()),
- i.soundcite && this.on("ready", ( () => {
- S("Loading Soundcite resources "),
- me("https://cdn.knightlab.com/libs/soundcite/latest/css/player.css"),
- ue("https://cdn.knightlab.com/libs/soundcite/latest/js/soundcite.min.js")
- }
- )),
- this._loadStyles(),
- document.addEventListener("keydown", (s = this,
- function(t) {
- if (s.config) {
- var e = t.key
- , i = s._getSlideIndex(self.current_id)
- , a = s.config.events.length - 1
- , n = s.config.title ? a + 1 : a;
- "ArrowLeft" == e ? 0 != i && s.goToPrev() : "ArrowRight" == e && i != n && s.goToNext()
- }
- }
- )),
- window.addEventListener("resize", function(t) {
- this.updateDisplay()
- }
- .bind(this)),
- this.options.debug && (n = console.log,
- D.push(n)),
- this._el.container.classList.add("tl-timeline"),
- this._el.container.setAttribute("tabindex", "0"),
- this._el.container.setAttribute("role", "region"),
- this._el.container.setAttribute("aria-label", this._("aria_label_timeline")),
- this.options.is_embed && this._el.container.classList.add("tl-timeline-embed"),
- this.options.is_full_embed && this._el.container.classList.add("tl-timeline-full-embed"),
- this._loadLanguage(e)
- }
- _loadStyles() {
- let t = null
- , e = null;
- if (this.options.font && (0 == this.options.font.indexOf("http") || this.options.font.match(/\.css$/)))
- t = this.options.font;
- else if (this.options.font) {
- let e = "../css/fonts/font." + this.options.font.toLowerCase() + ".css";
- t = new URL(e,this.options.script_path).toString()
- }
- if (t && me(t),
- this.options.theme && (0 == this.options.theme.indexOf("http") || this.options.theme.match(/\.css$/)))
- e = this.options.theme;
- else if (this.options.theme) {
- let t = "../css/themes/timeline.theme." + this.options.theme.toLowerCase() + ".css";
- e = new URL(t,this.options.script_path).toString()
- }
- e && me(e)
- }
- _loadLanguage(t) {
- try {
- var e = this.options.language
- , i = this.options.script_path;
- (async function(t, e) {
- var i = At(t, e);
- try {
- if (!It[t]) {
- let e = await mt(i);
- It[t] = e
- }
- return new Nt(t,e)
- } catch (t) {
- return console.log(`Error loading language [${i}] ${t.statusText}`),
- null
- }
- }
- )(e, i).then((i => {
- i ? (this.language = i,
- this.message.setLanguage(this.language),
- this.showMessage(this._("loading_timeline"))) : this.showMessage(`Error loading ${e}`),
- this._initData(t)
- }
- ))
- } catch (t) {
- this.showMessage(this._translateError(t))
- }
- }
- _initData(t) {
- "string" == typeof t ? async function(t, e) {
- let i = null
- , a = {};
- if (a = e,
- i = e.callback,
- "function" == typeof a.callback && (i = a.callback),
- !i)
- throw new x("Second argument to makeConfig must be either a function or an object which includes a 'callback' property with a 'function' type value");
- var s, n;
- if (Kt(t)) {
- try {
- n = await te(t, a)
- } catch (t) {
- return s = new Zt,
- "NetworkError" == t.name ? s.logError(new x("network_err")) : "TLError" == t.name ? s.logError(t) : s.logError(new x("unknown_read_err",t.name)),
- void i(s)
- }
- if (s = new Zt(n),
- n.errors)
- for (var o = 0; o < n.errors.length; o++)
- s.logError(n.errors[o]);
- i(s)
- } else
- ut({
- url: t,
- dataType: "json",
- success: function(t) {
- try {
- s = new Zt(t)
- } catch (t) {
- (s = new Zt).logError(t)
- }
- i(s)
- },
- error: function(t, e, a) {
- s = new Zt,
- a = "parsererror" == e ? new x("invalid_url_err") : new x("unknown_read_err",e),
- s.logError(a),
- i(s)
- }
- })
- }(t, {
- callback: function(t) {
- this.setConfig(t)
- }
- .bind(this),
- sheets_proxy: this.options.sheets_proxy
- }) : Zt == t.constructor ? this.setConfig(t) : this.setConfig(new Zt(t))
- }
- _translateError(t) {
- return t.hasOwnProperty("stack") && S(t.stack),
- t.message_key ? this._(t.message_key) + (t.detail ? " [" + t.detail + "]" : "") : t
- }
- showMessage(t) {
- this.message ? this.message.updateMessage(t) : (S("No message display available."),
- S(t))
- }
- determineScriptPath() {
- let t = null;
- if (Ve)
- t = Ve;
- else {
- let e = document.getElementById("timeline-script-tag");
- e && (t = e.src)
- }
- if (!t) {
- let e = document.getElementsByTagName("script");
- for (let i = e.length - 1; i >= 0; i--)
- if (e[i].src) {
- t = e[i].src;
- break
- }
- }
- return t ? t.substr(0, t.lastIndexOf("/") + 1) : ""
- }
- setConfig(t) {
- if (this.config = t,
- this.config.isValid() && (this.config.validate(),
- this._validateOptions()),
- this.config.isValid())
- try {
- "loading" === document.readyState ? document.addEventListener("DOMContentLoaded", this._onDataLoaded.bind(this)) : this._onDataLoaded()
- } catch (t) {
- this.showMessage("<strong>" + this._("error") + ":</strong> " + this._translateError(t))
- }
- else {
- for (var e = [], i = 0, a = this.config.getErrors(); i < a.length; i++)
- e.push(this._translateError(a[i]));
- this.showMessage("<strong>" + this._("error") + ":</strong> " + e.join("<br>"))
- }
- }
- _onDataLoaded() {
- this.fire("dataloaded"),
- this._initLayout(),
- this._initEvents(),
- this._initAnalytics(),
- this.message && this.message.hide(),
- new IntersectionObserver(( (t, e) => {
- t.reduce(( (t, e) => t || e.isIntersecting), !1) && this.updateDisplay()
- }
- ).bind(this)).observe(this._el.container),
- this.ready = !0,
- this.fire("ready")
- }
- _initLayout() {
- this.message.removeFrom(this._el.container),
- this._el.container.innerHTML = "",
- "top" == this.options.timenav_position ? (this._el.timenav = v("div", "tl-timenav", this._el.container),
- this._el.menubar = v("div", "tl-menubar", this._el.container),
- this._el.storyslider = v("div", "tl-storyslider", this._el.container)) : (this._el.storyslider = v("div", "tl-storyslider", this._el.container),
- this._el.timenav = v("div", "tl-timenav", this._el.container),
- this._el.menubar = v("div", "tl-menubar", this._el.container)),
- this._el.attribution = v("div", "tl-attribution", this._el.container),
- this._el.attribution.innerHTML = "<a href='https://timeline.knightlab.com' target='_blank' rel='noopener'><span class='tl-knightlab-logo'></span>TimelineJS</a>",
- this.options.width = this._el.container.offsetWidth,
- this.options.height = this._el.container.offsetHeight,
- this.options.timenav_height = this._calculateTimeNavHeight(this.options.timenav_height),
- this._timenav = new Be(this._el.timenav,this.config,this.options,this.language),
- this._timenav.on("loaded", this._onTimeNavLoaded, this),
- this._timenav.options.height = this.options.timenav_height,
- this._timenav.init(),
- this.options.initial_zoom && this.setZoom(this.options.initial_zoom),
- this._storyslider = new Ye(this._el.storyslider,this.config,this.options,this.language),
- this._el.storyslider.setAttribute("role", "group"),
- this._el.storyslider.setAttribute("aria-label", this._("aria_label_timeline_content")),
- this._storyslider.on("loaded", this._onStorySliderLoaded, this),
- this._storyslider.init(),
- this._menubar = new Ze(this._el.menubar,this._el.container,this.options,this.getLanguage()),
- "portrait" == this.options.layout ? this.options.storyslider_height = this.options.height - this.options.timenav_height - 1 : this.options.storyslider_height = this.options.height - 1,
- this._updateDisplay()
- }
- _initEvents() {
- this._timenav.on("change", this._onTimeNavChange, this),
- this._timenav.on("zoomtoggle", this._onZoomToggle, this),
- this._timenav.on("visible_ticks_change", this._onVisibleTicksChange, this),
- this._storyslider.on("change", this._onSlideChange, this),
- this._storyslider.on("colorchange", this._onColorChange, this),
- this._storyslider.on("nav_next", this._onStorySliderNext, this),
- this._storyslider.on("nav_previous", this._onStorySliderPrevious, this),
- this._menubar.on("zoom_in", this._onZoomIn, this),
- this._menubar.on("zoom_out", this._onZoomOut, this),
- this._menubar.on("forward_to_end", this._onForwardToEnd, this),
- this._menubar.on("back_to_start", this._onBackToStart, this)
- }
- _onColorChange(t) {
- this.fire("color_change", {
- unique_id: this.current_id
- }, this)
- }
- _onSlideChange(t) {
- this.current_id != t.unique_id && (this.current_id = t.unique_id,
- this._timenav.goToId(this.current_id),
- this._onChange(t))
- }
- _onTimeNavChange(t) {
- this.current_id != t.unique_id && (this.current_id = t.unique_id,
- this._storyslider.goToId(this.current_id),
- this._onChange(t))
- }
- _onZoomToggle(t) {
- "in" == t.zoom ? this._menubar.toogleZoomIn(t.show) : "out" == t.zoom && this._menubar.toogleZoomOut(t.show)
- }
- _onChange(t) {
- this.fire("change", {
- unique_id: this.current_id
- }, this),
- this.options.hash_bookmark && this.current_id && this._updateHashBookmark(this.current_id)
- }
- _onVisibleTicksChange(t) {
- this._menubar.changeVisibleTicks(t.visible_ticks)
- }
- _onForwardToEnd(t) {
- this.goToEnd(),
- this.fire("forward_to_end", {
- unique_id: this.current_id
- }, this)
- }
- _onBackToStart(t) {
- this.goToStart(),
- this.fire("back_to_start", {
- unique_id: this.current_id
- }, this)
- }
- _onZoomIn(t) {
- this._timenav.zoomIn(),
- this.fire("zoom_in", {
- zoom_level: this._timenav.options.scale_factor
- }, this)
- }
- _onZoomOut(t) {
- this._timenav.zoomOut(),
- this.fire("zoom_out", {
- zoom_level: this._timenav.options.scale_factor
- }, this)
- }
- _onTimeNavLoaded() {
- this._loaded.timenav = !0,
- this._onLoaded()
- }
- _onStorySliderLoaded() {
- this._loaded.storyslider = !0,
- this._onLoaded()
- }
- _onStorySliderNext(t) {
- this.fire("nav_next", t)
- }
- _onStorySliderPrevious(t) {
- this.fire("nav_previous", t)
- }
- _updateDisplay(t, e, i) {
- var a, s, n = this.options.duration, o = this.options.base_class;
- i && (n = i),
- this.options.width = this._el.container.offsetWidth,
- this.options.height = this._el.container.offsetHeight,
- this.options.width <= this.options.skinny_size ? (o += " tl-skinny",
- this.options.layout = "portrait") : this.options.width <= this.options.medium_size ? (o += " tl-medium",
- this.options.layout = "landscape") : this.options.layout = "landscape",
- f && (this.options.layout = (a = "portrait",
- window.innerWidth > window.innerHeight && (a = "landscape"),
- Math.abs(window.orientation),
- a)),
- h ? (o += " tl-mobile",
- this.options.timenav_height = this._calculateTimeNavHeight(t, this.options.timenav_mobile_height_percentage)) : this.options.timenav_height = this._calculateTimeNavHeight(t),
- "portrait" == this.options.layout ? o += " tl-layout-portrait" : o += " tl-layout-landscape",
- this.options.storyslider_height = this.options.height - this.options.timenav_height,
- s = "top" == this.options.timenav_position ? Math.ceil(this.options.timenav_height) / 2 - this._el.menubar.offsetHeight / 2 - 19.5 : Math.round(this.options.storyslider_height + 1 + Math.ceil(this.options.timenav_height) / 2 - this._el.menubar.offsetHeight / 2 - 17.5),
- e ? (this._el.timenav.style.height = Math.ceil(this.options.timenav_height) + "px",
- this.animator_storyslider && this.animator_storyslider.stop(),
- this.animator_storyslider = st(this._el.storyslider, {
- height: this.options.storyslider_height + "px",
- duration: n / 2,
- easing: tt
- }),
- this.animator_menubar && this.animator_menubar.stop(),
- this.animator_menubar = st(this._el.menubar, {
- top: s + "px",
- duration: n / 2,
- easing: tt
- })) : (this._el.timenav.style.height = Math.ceil(this.options.timenav_height) + "px",
- this._el.storyslider.style.height = this.options.storyslider_height + "px",
- this._el.menubar.style.top = s + "px"),
- this.message && this.message.updateDisplay(this.options.width, this.options.height),
- this._timenav.updateDisplay(this.options.width, this.options.timenav_height, e),
- this._storyslider.updateDisplay(this.options.width, this.options.storyslider_height, e, this.options.layout),
- "rtl" == this.language.direction && (o += " tl-rtl"),
- this._el.container.className = o
- }
- _calculateTimeNavHeight(t, e) {
- var i = 0;
- return (this.options.timenav_height_percentage || e) && (i = e ? Math.round(this.options.height / 100 * e) : Math.round(this.options.height / 100 * this.options.timenav_height_percentage)),
- this._timenav.ready && this.options.timenav_height_min < this._timenav.getMinimumHeight() && (this.options.timenav_height_min = this._timenav.getMinimumHeight()),
- i < this.options.timenav_height_min && (i = this.options.timenav_height_min),
- i - 2 * this.options.marker_padding
- }
- _validateOptions() {
- for (var t = ["timenav_height", "timenav_height_min", "marker_height_min", "marker_width_min", "marker_padding", "start_at_slide", "slide_padding_lr"], e = 0; e < t.length; e++) {
- var i = t[e]
- , a = this.options[i];
- let s = !0;
- "number" == typeof a ? s = a == parseInt(a) : "string" == typeof a && (s = a.match(/^\s*(\-?\d+)?\s*$/)),
- s || this.config.logError({
- message_key: "invalid_integer_option",
- detail: i
- })
- }
- }
- _getSlideIndex(t) {
- if (this.config) {
- if (this.config.title && this.config.title.unique_id == t)
- return 0;
- for (var e = 0; e < this.config.events.length; e++)
- if (t == this.config.events[e].unique_id)
- return this.config.title ? e + 1 : e
- }
- return -1
- }
- _getEventIndex(t) {
- for (var e = 0; e < this.config.events.length; e++)
- if (t == this.config.events[e].unique_id)
- return e;
- return -1
- }
- _onLoaded() {
- if (this._loaded.storyslider && this._loaded.timenav && (this.fire("loaded", this.config),
- null != (t = this.options.start_at_end) && (1 == t || "true" == String(t).toLowerCase() || 1 == Number(t)) || this.options.start_at_slide > this.config.events.length ? this.goToEnd() : this.goTo(this.options.start_at_slide),
- this.options.hash_bookmark)) {
- "" != window.location.hash ? this.goToId(window.location.hash.replace("#event-", "")) : this._updateHashBookmark(this.current_id);
- let t = this;
- window.addEventListener("hashchange", (function() {
- 0 == window.location.hash.indexOf("#event-") && t.goToId(window.location.hash.replace("#event-", ""))
- }
- ), !1)
- }
- var t
- }
- _updateHashBookmark(t) {
- if (t) {
- var e = "#event-" + t.toString();
- window.history.replaceState(null, "Browsing TimelineJS", e),
- this.fire("hash_updated", {
- unique_id: this.current_id,
- hashbookmark: "#event-" + t.toString()
- }, this)
- }
- }
- zoomIn() {
- this._timenav.zoomIn()
- }
- zoomOut() {
- this._timenav.zoomOut()
- }
- setZoom(t) {
- this._timenav.setZoom(t)
- }
- goToId(t) {
- this.current_id != t && (this.current_id = t,
- this._timenav.goToId(this.current_id),
- this._storyslider.goToId(this.current_id, !1, !0),
- this.fire("change", {
- unique_id: this.current_id
- }, this))
- }
- goTo(t) {
- if (!(t < 0))
- try {
- this.config.title ? 0 === t ? this.goToId(this.config.title.unique_id) : this.goToId(this.config.events[t - 1].unique_id) : this.goToId(this.config.events[t].unique_id)
- } catch {
- return
- }
- }
- goToStart() {
- this.goTo(0)
- }
- goToEnd() {
- var t = this.config.events.length - 1;
- this.goTo(this.config.title ? t + 1 : t)
- }
- goToPrev() {
- this.goTo(this._getSlideIndex(this.current_id) - 1),
- this.focusContainer()
- }
- goToNext() {
- this.goTo(this._getSlideIndex(this.current_id) + 1),
- this.focusContainer()
- }
- add(t) {
- var e = this.config.addEvent(t)
- , i = this._getEventIndex(e)
- , a = this.config.events[i];
- this._storyslider.createSlide(a, this.config.title ? i + 1 : i),
- this._storyslider._updateDrawSlides(),
- this._timenav.createMarker(a, i),
- this._timenav._updateDrawTimeline(!1),
- this.fire("added", {
- unique_id: e
- })
- }
- remove(t) {
- if (t >= 0 && t < this.config.events.length) {
- this.config.events[t].unique_id == this.current_id && (t < this.config.events.length - 1 ? this.goTo(t + 1) : this.goTo(t - 1));
- var e = this.config.events.splice(t, 1);
- delete this.config.event_dict[e[0].unique_id],
- this._storyslider.destroySlide(this.config.title ? t + 1 : t),
- this._storyslider._updateDrawSlides(),
- this._timenav.destroyMarker(t),
- this._timenav._updateDrawTimeline(!1),
- this.fire("removed", {
- unique_id: e[0].unique_id
- })
- }
- }
- removeId(t) {
- this.remove(this._getEventIndex(t))
- }
- getData(t) {
- if (this.config.title) {
- if (0 == t)
- return this.config.title;
- if (t > 0 && t <= this.config.events.length)
- return this.config.events[t - 1]
- } else if (t >= 0 && t < this.config.events.length)
- return this.config.events[t];
- return null
- }
- getDataById(t) {
- return this.getData(this._getSlideIndex(t))
- }
- getSlide(t) {
- return t >= 0 && t < this._storyslider._slides.length ? this._storyslider._slides[t] : null
- }
- getSlideById(t) {
- return this.getSlide(this._getSlideIndex(t))
- }
- getCurrentSlide() {
- return this.getSlideById(this.current_id)
- }
- updateDisplay() {
- this.ready ? this._updateDisplay() : S("updateDisplay called but timeline is not in ready state")
- }
- focusContainer() {
- this._el.container.focus()
- }
- _initGoogleAnalytics(t) {
- return -1;
- }
- _initAnalytics() {
- let t = this.options.ga_measurement_id || this.options.ga_property_id || null;
- if (t) {
- this._initGoogleAnalytics(t);
- var e = this.options.track_events;
- for (let t = 0; t < e.length; t++) {
- var i = e[t];
- this.addEventListener(i, (function(t) {
- gtag("event", t.type)
- }
- ))
- }
- }
- }
- }
- async function Je(t, e) {
- return -1;
- }
- R(Xe, Rt, at)
- }
- )(),
- TL = a
- }
- )();
|