index.html 127 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Main</title>
  6. <style>body { padding: 0; margin: 0; }</style>
  7. </head>
  8. <body>
  9. <pre id="elm"></pre>
  10. <script>
  11. try {
  12. (function(scope){
  13. 'use strict';
  14. function F(arity, fun, wrapper) {
  15. wrapper.a = arity;
  16. wrapper.f = fun;
  17. return wrapper;
  18. }
  19. function F2(fun) {
  20. return F(2, fun, function(a) { return function(b) { return fun(a,b); }; })
  21. }
  22. function F3(fun) {
  23. return F(3, fun, function(a) {
  24. return function(b) { return function(c) { return fun(a, b, c); }; };
  25. });
  26. }
  27. function F4(fun) {
  28. return F(4, fun, function(a) { return function(b) { return function(c) {
  29. return function(d) { return fun(a, b, c, d); }; }; };
  30. });
  31. }
  32. function F5(fun) {
  33. return F(5, fun, function(a) { return function(b) { return function(c) {
  34. return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };
  35. });
  36. }
  37. function F6(fun) {
  38. return F(6, fun, function(a) { return function(b) { return function(c) {
  39. return function(d) { return function(e) { return function(f) {
  40. return fun(a, b, c, d, e, f); }; }; }; }; };
  41. });
  42. }
  43. function F7(fun) {
  44. return F(7, fun, function(a) { return function(b) { return function(c) {
  45. return function(d) { return function(e) { return function(f) {
  46. return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; };
  47. });
  48. }
  49. function F8(fun) {
  50. return F(8, fun, function(a) { return function(b) { return function(c) {
  51. return function(d) { return function(e) { return function(f) {
  52. return function(g) { return function(h) {
  53. return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; };
  54. });
  55. }
  56. function F9(fun) {
  57. return F(9, fun, function(a) { return function(b) { return function(c) {
  58. return function(d) { return function(e) { return function(f) {
  59. return function(g) { return function(h) { return function(i) {
  60. return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; };
  61. });
  62. }
  63. function A2(fun, a, b) {
  64. return fun.a === 2 ? fun.f(a, b) : fun(a)(b);
  65. }
  66. function A3(fun, a, b, c) {
  67. return fun.a === 3 ? fun.f(a, b, c) : fun(a)(b)(c);
  68. }
  69. function A4(fun, a, b, c, d) {
  70. return fun.a === 4 ? fun.f(a, b, c, d) : fun(a)(b)(c)(d);
  71. }
  72. function A5(fun, a, b, c, d, e) {
  73. return fun.a === 5 ? fun.f(a, b, c, d, e) : fun(a)(b)(c)(d)(e);
  74. }
  75. function A6(fun, a, b, c, d, e, f) {
  76. return fun.a === 6 ? fun.f(a, b, c, d, e, f) : fun(a)(b)(c)(d)(e)(f);
  77. }
  78. function A7(fun, a, b, c, d, e, f, g) {
  79. return fun.a === 7 ? fun.f(a, b, c, d, e, f, g) : fun(a)(b)(c)(d)(e)(f)(g);
  80. }
  81. function A8(fun, a, b, c, d, e, f, g, h) {
  82. return fun.a === 8 ? fun.f(a, b, c, d, e, f, g, h) : fun(a)(b)(c)(d)(e)(f)(g)(h);
  83. }
  84. function A9(fun, a, b, c, d, e, f, g, h, i) {
  85. return fun.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i);
  86. }
  87. console.warn('Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.');
  88. // EQUALITY
  89. function _Utils_eq(x, y)
  90. {
  91. for (
  92. var pair, stack = [], isEqual = _Utils_eqHelp(x, y, 0, stack);
  93. isEqual && (pair = stack.pop());
  94. isEqual = _Utils_eqHelp(pair.a, pair.b, 0, stack)
  95. )
  96. {}
  97. return isEqual;
  98. }
  99. function _Utils_eqHelp(x, y, depth, stack)
  100. {
  101. if (x === y)
  102. {
  103. return true;
  104. }
  105. if (typeof x !== 'object' || x === null || y === null)
  106. {
  107. typeof x === 'function' && _Debug_crash(5);
  108. return false;
  109. }
  110. if (depth > 100)
  111. {
  112. stack.push(_Utils_Tuple2(x,y));
  113. return true;
  114. }
  115. /**/
  116. if (x.$ === 'Set_elm_builtin')
  117. {
  118. x = $elm$core$Set$toList(x);
  119. y = $elm$core$Set$toList(y);
  120. }
  121. if (x.$ === 'RBNode_elm_builtin' || x.$ === 'RBEmpty_elm_builtin')
  122. {
  123. x = $elm$core$Dict$toList(x);
  124. y = $elm$core$Dict$toList(y);
  125. }
  126. //*/
  127. /**_UNUSED/
  128. if (x.$ < 0)
  129. {
  130. x = $elm$core$Dict$toList(x);
  131. y = $elm$core$Dict$toList(y);
  132. }
  133. //*/
  134. for (var key in x)
  135. {
  136. if (!_Utils_eqHelp(x[key], y[key], depth + 1, stack))
  137. {
  138. return false;
  139. }
  140. }
  141. return true;
  142. }
  143. var _Utils_equal = F2(_Utils_eq);
  144. var _Utils_notEqual = F2(function(a, b) { return !_Utils_eq(a,b); });
  145. // COMPARISONS
  146. // Code in Generate/JavaScript.hs, Basics.js, and List.js depends on
  147. // the particular integer values assigned to LT, EQ, and GT.
  148. function _Utils_cmp(x, y, ord)
  149. {
  150. if (typeof x !== 'object')
  151. {
  152. return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1;
  153. }
  154. /**/
  155. if (x instanceof String)
  156. {
  157. var a = x.valueOf();
  158. var b = y.valueOf();
  159. return a === b ? 0 : a < b ? -1 : 1;
  160. }
  161. //*/
  162. /**_UNUSED/
  163. if (typeof x.$ === 'undefined')
  164. //*/
  165. /**/
  166. if (x.$[0] === '#')
  167. //*/
  168. {
  169. return (ord = _Utils_cmp(x.a, y.a))
  170. ? ord
  171. : (ord = _Utils_cmp(x.b, y.b))
  172. ? ord
  173. : _Utils_cmp(x.c, y.c);
  174. }
  175. // traverse conses until end of a list or a mismatch
  176. for (; x.b && y.b && !(ord = _Utils_cmp(x.a, y.a)); x = x.b, y = y.b) {} // WHILE_CONSES
  177. return ord || (x.b ? /*GT*/ 1 : y.b ? /*LT*/ -1 : /*EQ*/ 0);
  178. }
  179. var _Utils_lt = F2(function(a, b) { return _Utils_cmp(a, b) < 0; });
  180. var _Utils_le = F2(function(a, b) { return _Utils_cmp(a, b) < 1; });
  181. var _Utils_gt = F2(function(a, b) { return _Utils_cmp(a, b) > 0; });
  182. var _Utils_ge = F2(function(a, b) { return _Utils_cmp(a, b) >= 0; });
  183. var _Utils_compare = F2(function(x, y)
  184. {
  185. var n = _Utils_cmp(x, y);
  186. return n < 0 ? $elm$core$Basics$LT : n ? $elm$core$Basics$GT : $elm$core$Basics$EQ;
  187. });
  188. // COMMON VALUES
  189. var _Utils_Tuple0_UNUSED = 0;
  190. var _Utils_Tuple0 = { $: '#0' };
  191. function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; }
  192. function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; }
  193. function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; }
  194. function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; }
  195. function _Utils_chr_UNUSED(c) { return c; }
  196. function _Utils_chr(c) { return new String(c); }
  197. // RECORDS
  198. function _Utils_update(oldRecord, updatedFields)
  199. {
  200. var newRecord = {};
  201. for (var key in oldRecord)
  202. {
  203. newRecord[key] = oldRecord[key];
  204. }
  205. for (var key in updatedFields)
  206. {
  207. newRecord[key] = updatedFields[key];
  208. }
  209. return newRecord;
  210. }
  211. // APPEND
  212. var _Utils_append = F2(_Utils_ap);
  213. function _Utils_ap(xs, ys)
  214. {
  215. // append Strings
  216. if (typeof xs === 'string')
  217. {
  218. return xs + ys;
  219. }
  220. // append Lists
  221. if (!xs.b)
  222. {
  223. return ys;
  224. }
  225. var root = _List_Cons(xs.a, ys);
  226. xs = xs.b
  227. for (var curr = root; xs.b; xs = xs.b) // WHILE_CONS
  228. {
  229. curr = curr.b = _List_Cons(xs.a, ys);
  230. }
  231. return root;
  232. }
  233. var _List_Nil_UNUSED = { $: 0 };
  234. var _List_Nil = { $: '[]' };
  235. function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; }
  236. function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; }
  237. var _List_cons = F2(_List_Cons);
  238. function _List_fromArray(arr)
  239. {
  240. var out = _List_Nil;
  241. for (var i = arr.length; i--; )
  242. {
  243. out = _List_Cons(arr[i], out);
  244. }
  245. return out;
  246. }
  247. function _List_toArray(xs)
  248. {
  249. for (var out = []; xs.b; xs = xs.b) // WHILE_CONS
  250. {
  251. out.push(xs.a);
  252. }
  253. return out;
  254. }
  255. var _List_map2 = F3(function(f, xs, ys)
  256. {
  257. for (var arr = []; xs.b && ys.b; xs = xs.b, ys = ys.b) // WHILE_CONSES
  258. {
  259. arr.push(A2(f, xs.a, ys.a));
  260. }
  261. return _List_fromArray(arr);
  262. });
  263. var _List_map3 = F4(function(f, xs, ys, zs)
  264. {
  265. for (var arr = []; xs.b && ys.b && zs.b; xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
  266. {
  267. arr.push(A3(f, xs.a, ys.a, zs.a));
  268. }
  269. return _List_fromArray(arr);
  270. });
  271. var _List_map4 = F5(function(f, ws, xs, ys, zs)
  272. {
  273. for (var arr = []; ws.b && xs.b && ys.b && zs.b; ws = ws.b, xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
  274. {
  275. arr.push(A4(f, ws.a, xs.a, ys.a, zs.a));
  276. }
  277. return _List_fromArray(arr);
  278. });
  279. var _List_map5 = F6(function(f, vs, ws, xs, ys, zs)
  280. {
  281. for (var arr = []; vs.b && ws.b && xs.b && ys.b && zs.b; vs = vs.b, ws = ws.b, xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
  282. {
  283. arr.push(A5(f, vs.a, ws.a, xs.a, ys.a, zs.a));
  284. }
  285. return _List_fromArray(arr);
  286. });
  287. var _List_sortBy = F2(function(f, xs)
  288. {
  289. return _List_fromArray(_List_toArray(xs).sort(function(a, b) {
  290. return _Utils_cmp(f(a), f(b));
  291. }));
  292. });
  293. var _List_sortWith = F2(function(f, xs)
  294. {
  295. return _List_fromArray(_List_toArray(xs).sort(function(a, b) {
  296. var ord = A2(f, a, b);
  297. return ord === $elm$core$Basics$EQ ? 0 : ord === $elm$core$Basics$LT ? -1 : 1;
  298. }));
  299. });
  300. var _JsArray_empty = [];
  301. function _JsArray_singleton(value)
  302. {
  303. return [value];
  304. }
  305. function _JsArray_length(array)
  306. {
  307. return array.length;
  308. }
  309. var _JsArray_initialize = F3(function(size, offset, func)
  310. {
  311. var result = new Array(size);
  312. for (var i = 0; i < size; i++)
  313. {
  314. result[i] = func(offset + i);
  315. }
  316. return result;
  317. });
  318. var _JsArray_initializeFromList = F2(function (max, ls)
  319. {
  320. var result = new Array(max);
  321. for (var i = 0; i < max && ls.b; i++)
  322. {
  323. result[i] = ls.a;
  324. ls = ls.b;
  325. }
  326. result.length = i;
  327. return _Utils_Tuple2(result, ls);
  328. });
  329. var _JsArray_unsafeGet = F2(function(index, array)
  330. {
  331. return array[index];
  332. });
  333. var _JsArray_unsafeSet = F3(function(index, value, array)
  334. {
  335. var length = array.length;
  336. var result = new Array(length);
  337. for (var i = 0; i < length; i++)
  338. {
  339. result[i] = array[i];
  340. }
  341. result[index] = value;
  342. return result;
  343. });
  344. var _JsArray_push = F2(function(value, array)
  345. {
  346. var length = array.length;
  347. var result = new Array(length + 1);
  348. for (var i = 0; i < length; i++)
  349. {
  350. result[i] = array[i];
  351. }
  352. result[length] = value;
  353. return result;
  354. });
  355. var _JsArray_foldl = F3(function(func, acc, array)
  356. {
  357. var length = array.length;
  358. for (var i = 0; i < length; i++)
  359. {
  360. acc = A2(func, array[i], acc);
  361. }
  362. return acc;
  363. });
  364. var _JsArray_foldr = F3(function(func, acc, array)
  365. {
  366. for (var i = array.length - 1; i >= 0; i--)
  367. {
  368. acc = A2(func, array[i], acc);
  369. }
  370. return acc;
  371. });
  372. var _JsArray_map = F2(function(func, array)
  373. {
  374. var length = array.length;
  375. var result = new Array(length);
  376. for (var i = 0; i < length; i++)
  377. {
  378. result[i] = func(array[i]);
  379. }
  380. return result;
  381. });
  382. var _JsArray_indexedMap = F3(function(func, offset, array)
  383. {
  384. var length = array.length;
  385. var result = new Array(length);
  386. for (var i = 0; i < length; i++)
  387. {
  388. result[i] = A2(func, offset + i, array[i]);
  389. }
  390. return result;
  391. });
  392. var _JsArray_slice = F3(function(from, to, array)
  393. {
  394. return array.slice(from, to);
  395. });
  396. var _JsArray_appendN = F3(function(n, dest, source)
  397. {
  398. var destLen = dest.length;
  399. var itemsToCopy = n - destLen;
  400. if (itemsToCopy > source.length)
  401. {
  402. itemsToCopy = source.length;
  403. }
  404. var size = destLen + itemsToCopy;
  405. var result = new Array(size);
  406. for (var i = 0; i < destLen; i++)
  407. {
  408. result[i] = dest[i];
  409. }
  410. for (var i = 0; i < itemsToCopy; i++)
  411. {
  412. result[i + destLen] = source[i];
  413. }
  414. return result;
  415. });
  416. // LOG
  417. var _Debug_log_UNUSED = F2(function(tag, value)
  418. {
  419. return value;
  420. });
  421. var _Debug_log = F2(function(tag, value)
  422. {
  423. console.log(tag + ': ' + _Debug_toString(value));
  424. return value;
  425. });
  426. // TODOS
  427. function _Debug_todo(moduleName, region)
  428. {
  429. return function(message) {
  430. _Debug_crash(8, moduleName, region, message);
  431. };
  432. }
  433. function _Debug_todoCase(moduleName, region, value)
  434. {
  435. return function(message) {
  436. _Debug_crash(9, moduleName, region, value, message);
  437. };
  438. }
  439. // TO STRING
  440. function _Debug_toString_UNUSED(value)
  441. {
  442. return '<internals>';
  443. }
  444. function _Debug_toString(value)
  445. {
  446. return _Debug_toAnsiString(false, value);
  447. }
  448. function _Debug_toAnsiString(ansi, value)
  449. {
  450. if (typeof value === 'function')
  451. {
  452. return _Debug_internalColor(ansi, '<function>');
  453. }
  454. if (typeof value === 'boolean')
  455. {
  456. return _Debug_ctorColor(ansi, value ? 'True' : 'False');
  457. }
  458. if (typeof value === 'number')
  459. {
  460. return _Debug_numberColor(ansi, value + '');
  461. }
  462. if (value instanceof String)
  463. {
  464. return _Debug_charColor(ansi, "'" + _Debug_addSlashes(value, true) + "'");
  465. }
  466. if (typeof value === 'string')
  467. {
  468. return _Debug_stringColor(ansi, '"' + _Debug_addSlashes(value, false) + '"');
  469. }
  470. if (typeof value === 'object' && '$' in value)
  471. {
  472. var tag = value.$;
  473. if (typeof tag === 'number')
  474. {
  475. return _Debug_internalColor(ansi, '<internals>');
  476. }
  477. if (tag[0] === '#')
  478. {
  479. var output = [];
  480. for (var k in value)
  481. {
  482. if (k === '$') continue;
  483. output.push(_Debug_toAnsiString(ansi, value[k]));
  484. }
  485. return '(' + output.join(',') + ')';
  486. }
  487. if (tag === 'Set_elm_builtin')
  488. {
  489. return _Debug_ctorColor(ansi, 'Set')
  490. + _Debug_fadeColor(ansi, '.fromList') + ' '
  491. + _Debug_toAnsiString(ansi, $elm$core$Set$toList(value));
  492. }
  493. if (tag === 'RBNode_elm_builtin' || tag === 'RBEmpty_elm_builtin')
  494. {
  495. return _Debug_ctorColor(ansi, 'Dict')
  496. + _Debug_fadeColor(ansi, '.fromList') + ' '
  497. + _Debug_toAnsiString(ansi, $elm$core$Dict$toList(value));
  498. }
  499. if (tag === 'Array_elm_builtin')
  500. {
  501. return _Debug_ctorColor(ansi, 'Array')
  502. + _Debug_fadeColor(ansi, '.fromList') + ' '
  503. + _Debug_toAnsiString(ansi, $elm$core$Array$toList(value));
  504. }
  505. if (tag === '::' || tag === '[]')
  506. {
  507. var output = '[';
  508. value.b && (output += _Debug_toAnsiString(ansi, value.a), value = value.b)
  509. for (; value.b; value = value.b) // WHILE_CONS
  510. {
  511. output += ',' + _Debug_toAnsiString(ansi, value.a);
  512. }
  513. return output + ']';
  514. }
  515. var output = '';
  516. for (var i in value)
  517. {
  518. if (i === '$') continue;
  519. var str = _Debug_toAnsiString(ansi, value[i]);
  520. var c0 = str[0];
  521. var parenless = c0 === '{' || c0 === '(' || c0 === '[' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0;
  522. output += ' ' + (parenless ? str : '(' + str + ')');
  523. }
  524. return _Debug_ctorColor(ansi, tag) + output;
  525. }
  526. if (typeof DataView === 'function' && value instanceof DataView)
  527. {
  528. return _Debug_stringColor(ansi, '<' + value.byteLength + ' bytes>');
  529. }
  530. if (typeof File !== 'undefined' && value instanceof File)
  531. {
  532. return _Debug_internalColor(ansi, '<' + value.name + '>');
  533. }
  534. if (typeof value === 'object')
  535. {
  536. var output = [];
  537. for (var key in value)
  538. {
  539. var field = key[0] === '_' ? key.slice(1) : key;
  540. output.push(_Debug_fadeColor(ansi, field) + ' = ' + _Debug_toAnsiString(ansi, value[key]));
  541. }
  542. if (output.length === 0)
  543. {
  544. return '{}';
  545. }
  546. return '{ ' + output.join(', ') + ' }';
  547. }
  548. return _Debug_internalColor(ansi, '<internals>');
  549. }
  550. function _Debug_addSlashes(str, isChar)
  551. {
  552. var s = str
  553. .replace(/\\/g, '\\\\')
  554. .replace(/\n/g, '\\n')
  555. .replace(/\t/g, '\\t')
  556. .replace(/\r/g, '\\r')
  557. .replace(/\v/g, '\\v')
  558. .replace(/\0/g, '\\0');
  559. if (isChar)
  560. {
  561. return s.replace(/\'/g, '\\\'');
  562. }
  563. else
  564. {
  565. return s.replace(/\"/g, '\\"');
  566. }
  567. }
  568. function _Debug_ctorColor(ansi, string)
  569. {
  570. return ansi ? '\x1b[96m' + string + '\x1b[0m' : string;
  571. }
  572. function _Debug_numberColor(ansi, string)
  573. {
  574. return ansi ? '\x1b[95m' + string + '\x1b[0m' : string;
  575. }
  576. function _Debug_stringColor(ansi, string)
  577. {
  578. return ansi ? '\x1b[93m' + string + '\x1b[0m' : string;
  579. }
  580. function _Debug_charColor(ansi, string)
  581. {
  582. return ansi ? '\x1b[92m' + string + '\x1b[0m' : string;
  583. }
  584. function _Debug_fadeColor(ansi, string)
  585. {
  586. return ansi ? '\x1b[37m' + string + '\x1b[0m' : string;
  587. }
  588. function _Debug_internalColor(ansi, string)
  589. {
  590. return ansi ? '\x1b[36m' + string + '\x1b[0m' : string;
  591. }
  592. function _Debug_toHexDigit(n)
  593. {
  594. return String.fromCharCode(n < 10 ? 48 + n : 55 + n);
  595. }
  596. // CRASH
  597. function _Debug_crash_UNUSED(identifier)
  598. {
  599. throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md');
  600. }
  601. function _Debug_crash(identifier, fact1, fact2, fact3, fact4)
  602. {
  603. switch(identifier)
  604. {
  605. case 0:
  606. throw new Error('What node should I take over? In JavaScript I need something like:\n\n Elm.Main.init({\n node: document.getElementById("elm-node")\n })\n\nYou need to do this with any Browser.sandbox or Browser.element program.');
  607. case 1:
  608. throw new Error('Browser.application programs cannot handle URLs like this:\n\n ' + document.location.href + '\n\nWhat is the root? The root of your file system? Try looking at this program with `elm reactor` or some other server.');
  609. case 2:
  610. var jsonErrorString = fact1;
  611. throw new Error('Problem with the flags given to your Elm program on initialization.\n\n' + jsonErrorString);
  612. case 3:
  613. var portName = fact1;
  614. throw new Error('There can only be one port named `' + portName + '`, but your program has multiple.');
  615. case 4:
  616. var portName = fact1;
  617. var problem = fact2;
  618. throw new Error('Trying to send an unexpected type of value through port `' + portName + '`:\n' + problem);
  619. case 5:
  620. throw new Error('Trying to use `(==)` on functions.\nThere is no way to know if functions are "the same" in the Elm sense.\nRead more about this at https://package.elm-lang.org/packages/elm/core/latest/Basics#== which describes why it is this way and what the better version will look like.');
  621. case 6:
  622. var moduleName = fact1;
  623. throw new Error('Your page is loading multiple Elm scripts with a module named ' + moduleName + '. Maybe a duplicate script is getting loaded accidentally? If not, rename one of them so I know which is which!');
  624. case 8:
  625. var moduleName = fact1;
  626. var region = fact2;
  627. var message = fact3;
  628. throw new Error('TODO in module `' + moduleName + '` ' + _Debug_regionToString(region) + '\n\n' + message);
  629. case 9:
  630. var moduleName = fact1;
  631. var region = fact2;
  632. var value = fact3;
  633. var message = fact4;
  634. throw new Error(
  635. 'TODO in module `' + moduleName + '` from the `case` expression '
  636. + _Debug_regionToString(region) + '\n\nIt received the following value:\n\n '
  637. + _Debug_toString(value).replace('\n', '\n ')
  638. + '\n\nBut the branch that handles it says:\n\n ' + message.replace('\n', '\n ')
  639. );
  640. case 10:
  641. throw new Error('Bug in https://github.com/elm/virtual-dom/issues');
  642. case 11:
  643. throw new Error('Cannot perform mod 0. Division by zero error.');
  644. }
  645. }
  646. function _Debug_regionToString(region)
  647. {
  648. if (region.start.line === region.end.line)
  649. {
  650. return 'on line ' + region.start.line;
  651. }
  652. return 'on lines ' + region.start.line + ' through ' + region.end.line;
  653. }
  654. // MATH
  655. var _Basics_add = F2(function(a, b) { return a + b; });
  656. var _Basics_sub = F2(function(a, b) { return a - b; });
  657. var _Basics_mul = F2(function(a, b) { return a * b; });
  658. var _Basics_fdiv = F2(function(a, b) { return a / b; });
  659. var _Basics_idiv = F2(function(a, b) { return (a / b) | 0; });
  660. var _Basics_pow = F2(Math.pow);
  661. var _Basics_remainderBy = F2(function(b, a) { return a % b; });
  662. // https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf
  663. var _Basics_modBy = F2(function(modulus, x)
  664. {
  665. var answer = x % modulus;
  666. return modulus === 0
  667. ? _Debug_crash(11)
  668. :
  669. ((answer > 0 && modulus < 0) || (answer < 0 && modulus > 0))
  670. ? answer + modulus
  671. : answer;
  672. });
  673. // TRIGONOMETRY
  674. var _Basics_pi = Math.PI;
  675. var _Basics_e = Math.E;
  676. var _Basics_cos = Math.cos;
  677. var _Basics_sin = Math.sin;
  678. var _Basics_tan = Math.tan;
  679. var _Basics_acos = Math.acos;
  680. var _Basics_asin = Math.asin;
  681. var _Basics_atan = Math.atan;
  682. var _Basics_atan2 = F2(Math.atan2);
  683. // MORE MATH
  684. function _Basics_toFloat(x) { return x; }
  685. function _Basics_truncate(n) { return n | 0; }
  686. function _Basics_isInfinite(n) { return n === Infinity || n === -Infinity; }
  687. var _Basics_ceiling = Math.ceil;
  688. var _Basics_floor = Math.floor;
  689. var _Basics_round = Math.round;
  690. var _Basics_sqrt = Math.sqrt;
  691. var _Basics_log = Math.log;
  692. var _Basics_isNaN = isNaN;
  693. // BOOLEANS
  694. function _Basics_not(bool) { return !bool; }
  695. var _Basics_and = F2(function(a, b) { return a && b; });
  696. var _Basics_or = F2(function(a, b) { return a || b; });
  697. var _Basics_xor = F2(function(a, b) { return a !== b; });
  698. var _String_cons = F2(function(chr, str)
  699. {
  700. return chr + str;
  701. });
  702. function _String_uncons(string)
  703. {
  704. var word = string.charCodeAt(0);
  705. return !isNaN(word)
  706. ? $elm$core$Maybe$Just(
  707. 0xD800 <= word && word <= 0xDBFF
  708. ? _Utils_Tuple2(_Utils_chr(string[0] + string[1]), string.slice(2))
  709. : _Utils_Tuple2(_Utils_chr(string[0]), string.slice(1))
  710. )
  711. : $elm$core$Maybe$Nothing;
  712. }
  713. var _String_append = F2(function(a, b)
  714. {
  715. return a + b;
  716. });
  717. function _String_length(str)
  718. {
  719. return str.length;
  720. }
  721. var _String_map = F2(function(func, string)
  722. {
  723. var len = string.length;
  724. var array = new Array(len);
  725. var i = 0;
  726. while (i < len)
  727. {
  728. var word = string.charCodeAt(i);
  729. if (0xD800 <= word && word <= 0xDBFF)
  730. {
  731. array[i] = func(_Utils_chr(string[i] + string[i+1]));
  732. i += 2;
  733. continue;
  734. }
  735. array[i] = func(_Utils_chr(string[i]));
  736. i++;
  737. }
  738. return array.join('');
  739. });
  740. var _String_filter = F2(function(isGood, str)
  741. {
  742. var arr = [];
  743. var len = str.length;
  744. var i = 0;
  745. while (i < len)
  746. {
  747. var char = str[i];
  748. var word = str.charCodeAt(i);
  749. i++;
  750. if (0xD800 <= word && word <= 0xDBFF)
  751. {
  752. char += str[i];
  753. i++;
  754. }
  755. if (isGood(_Utils_chr(char)))
  756. {
  757. arr.push(char);
  758. }
  759. }
  760. return arr.join('');
  761. });
  762. function _String_reverse(str)
  763. {
  764. var len = str.length;
  765. var arr = new Array(len);
  766. var i = 0;
  767. while (i < len)
  768. {
  769. var word = str.charCodeAt(i);
  770. if (0xD800 <= word && word <= 0xDBFF)
  771. {
  772. arr[len - i] = str[i + 1];
  773. i++;
  774. arr[len - i] = str[i - 1];
  775. i++;
  776. }
  777. else
  778. {
  779. arr[len - i] = str[i];
  780. i++;
  781. }
  782. }
  783. return arr.join('');
  784. }
  785. var _String_foldl = F3(function(func, state, string)
  786. {
  787. var len = string.length;
  788. var i = 0;
  789. while (i < len)
  790. {
  791. var char = string[i];
  792. var word = string.charCodeAt(i);
  793. i++;
  794. if (0xD800 <= word && word <= 0xDBFF)
  795. {
  796. char += string[i];
  797. i++;
  798. }
  799. state = A2(func, _Utils_chr(char), state);
  800. }
  801. return state;
  802. });
  803. var _String_foldr = F3(function(func, state, string)
  804. {
  805. var i = string.length;
  806. while (i--)
  807. {
  808. var char = string[i];
  809. var word = string.charCodeAt(i);
  810. if (0xDC00 <= word && word <= 0xDFFF)
  811. {
  812. i--;
  813. char = string[i] + char;
  814. }
  815. state = A2(func, _Utils_chr(char), state);
  816. }
  817. return state;
  818. });
  819. var _String_split = F2(function(sep, str)
  820. {
  821. return str.split(sep);
  822. });
  823. var _String_join = F2(function(sep, strs)
  824. {
  825. return strs.join(sep);
  826. });
  827. var _String_slice = F3(function(start, end, str) {
  828. return str.slice(start, end);
  829. });
  830. function _String_trim(str)
  831. {
  832. return str.trim();
  833. }
  834. function _String_trimLeft(str)
  835. {
  836. return str.replace(/^\s+/, '');
  837. }
  838. function _String_trimRight(str)
  839. {
  840. return str.replace(/\s+$/, '');
  841. }
  842. function _String_words(str)
  843. {
  844. return _List_fromArray(str.trim().split(/\s+/g));
  845. }
  846. function _String_lines(str)
  847. {
  848. return _List_fromArray(str.split(/\r\n|\r|\n/g));
  849. }
  850. function _String_toUpper(str)
  851. {
  852. return str.toUpperCase();
  853. }
  854. function _String_toLower(str)
  855. {
  856. return str.toLowerCase();
  857. }
  858. var _String_any = F2(function(isGood, string)
  859. {
  860. var i = string.length;
  861. while (i--)
  862. {
  863. var char = string[i];
  864. var word = string.charCodeAt(i);
  865. if (0xDC00 <= word && word <= 0xDFFF)
  866. {
  867. i--;
  868. char = string[i] + char;
  869. }
  870. if (isGood(_Utils_chr(char)))
  871. {
  872. return true;
  873. }
  874. }
  875. return false;
  876. });
  877. var _String_all = F2(function(isGood, string)
  878. {
  879. var i = string.length;
  880. while (i--)
  881. {
  882. var char = string[i];
  883. var word = string.charCodeAt(i);
  884. if (0xDC00 <= word && word <= 0xDFFF)
  885. {
  886. i--;
  887. char = string[i] + char;
  888. }
  889. if (!isGood(_Utils_chr(char)))
  890. {
  891. return false;
  892. }
  893. }
  894. return true;
  895. });
  896. var _String_contains = F2(function(sub, str)
  897. {
  898. return str.indexOf(sub) > -1;
  899. });
  900. var _String_startsWith = F2(function(sub, str)
  901. {
  902. return str.indexOf(sub) === 0;
  903. });
  904. var _String_endsWith = F2(function(sub, str)
  905. {
  906. return str.length >= sub.length &&
  907. str.lastIndexOf(sub) === str.length - sub.length;
  908. });
  909. var _String_indexes = F2(function(sub, str)
  910. {
  911. var subLen = sub.length;
  912. if (subLen < 1)
  913. {
  914. return _List_Nil;
  915. }
  916. var i = 0;
  917. var is = [];
  918. while ((i = str.indexOf(sub, i)) > -1)
  919. {
  920. is.push(i);
  921. i = i + subLen;
  922. }
  923. return _List_fromArray(is);
  924. });
  925. // TO STRING
  926. function _String_fromNumber(number)
  927. {
  928. return number + '';
  929. }
  930. // INT CONVERSIONS
  931. function _String_toInt(str)
  932. {
  933. var total = 0;
  934. var code0 = str.charCodeAt(0);
  935. var start = code0 == 0x2B /* + */ || code0 == 0x2D /* - */ ? 1 : 0;
  936. for (var i = start; i < str.length; ++i)
  937. {
  938. var code = str.charCodeAt(i);
  939. if (code < 0x30 || 0x39 < code)
  940. {
  941. return $elm$core$Maybe$Nothing;
  942. }
  943. total = 10 * total + code - 0x30;
  944. }
  945. return i == start
  946. ? $elm$core$Maybe$Nothing
  947. : $elm$core$Maybe$Just(code0 == 0x2D ? -total : total);
  948. }
  949. // FLOAT CONVERSIONS
  950. function _String_toFloat(s)
  951. {
  952. // check if it is a hex, octal, or binary number
  953. if (s.length === 0 || /[\sxbo]/.test(s))
  954. {
  955. return $elm$core$Maybe$Nothing;
  956. }
  957. var n = +s;
  958. // faster isNaN check
  959. return n === n ? $elm$core$Maybe$Just(n) : $elm$core$Maybe$Nothing;
  960. }
  961. function _String_fromList(chars)
  962. {
  963. return _List_toArray(chars).join('');
  964. }
  965. function _Char_toCode(char)
  966. {
  967. var code = char.charCodeAt(0);
  968. if (0xD800 <= code && code <= 0xDBFF)
  969. {
  970. return (code - 0xD800) * 0x400 + char.charCodeAt(1) - 0xDC00 + 0x10000
  971. }
  972. return code;
  973. }
  974. function _Char_fromCode(code)
  975. {
  976. return _Utils_chr(
  977. (code < 0 || 0x10FFFF < code)
  978. ? '\uFFFD'
  979. :
  980. (code <= 0xFFFF)
  981. ? String.fromCharCode(code)
  982. :
  983. (code -= 0x10000,
  984. String.fromCharCode(Math.floor(code / 0x400) + 0xD800, code % 0x400 + 0xDC00)
  985. )
  986. );
  987. }
  988. function _Char_toUpper(char)
  989. {
  990. return _Utils_chr(char.toUpperCase());
  991. }
  992. function _Char_toLower(char)
  993. {
  994. return _Utils_chr(char.toLowerCase());
  995. }
  996. function _Char_toLocaleUpper(char)
  997. {
  998. return _Utils_chr(char.toLocaleUpperCase());
  999. }
  1000. function _Char_toLocaleLower(char)
  1001. {
  1002. return _Utils_chr(char.toLocaleLowerCase());
  1003. }
  1004. /**/
  1005. function _Json_errorToString(error)
  1006. {
  1007. return $elm$json$Json$Decode$errorToString(error);
  1008. }
  1009. //*/
  1010. // CORE DECODERS
  1011. function _Json_succeed(msg)
  1012. {
  1013. return {
  1014. $: 0,
  1015. a: msg
  1016. };
  1017. }
  1018. function _Json_fail(msg)
  1019. {
  1020. return {
  1021. $: 1,
  1022. a: msg
  1023. };
  1024. }
  1025. function _Json_decodePrim(decoder)
  1026. {
  1027. return { $: 2, b: decoder };
  1028. }
  1029. var _Json_decodeInt = _Json_decodePrim(function(value) {
  1030. return (typeof value !== 'number')
  1031. ? _Json_expecting('an INT', value)
  1032. :
  1033. (-2147483647 < value && value < 2147483647 && (value | 0) === value)
  1034. ? $elm$core$Result$Ok(value)
  1035. :
  1036. (isFinite(value) && !(value % 1))
  1037. ? $elm$core$Result$Ok(value)
  1038. : _Json_expecting('an INT', value);
  1039. });
  1040. var _Json_decodeBool = _Json_decodePrim(function(value) {
  1041. return (typeof value === 'boolean')
  1042. ? $elm$core$Result$Ok(value)
  1043. : _Json_expecting('a BOOL', value);
  1044. });
  1045. var _Json_decodeFloat = _Json_decodePrim(function(value) {
  1046. return (typeof value === 'number')
  1047. ? $elm$core$Result$Ok(value)
  1048. : _Json_expecting('a FLOAT', value);
  1049. });
  1050. var _Json_decodeValue = _Json_decodePrim(function(value) {
  1051. return $elm$core$Result$Ok(_Json_wrap(value));
  1052. });
  1053. var _Json_decodeString = _Json_decodePrim(function(value) {
  1054. return (typeof value === 'string')
  1055. ? $elm$core$Result$Ok(value)
  1056. : (value instanceof String)
  1057. ? $elm$core$Result$Ok(value + '')
  1058. : _Json_expecting('a STRING', value);
  1059. });
  1060. function _Json_decodeList(decoder) { return { $: 3, b: decoder }; }
  1061. function _Json_decodeArray(decoder) { return { $: 4, b: decoder }; }
  1062. function _Json_decodeNull(value) { return { $: 5, c: value }; }
  1063. var _Json_decodeField = F2(function(field, decoder)
  1064. {
  1065. return {
  1066. $: 6,
  1067. d: field,
  1068. b: decoder
  1069. };
  1070. });
  1071. var _Json_decodeIndex = F2(function(index, decoder)
  1072. {
  1073. return {
  1074. $: 7,
  1075. e: index,
  1076. b: decoder
  1077. };
  1078. });
  1079. function _Json_decodeKeyValuePairs(decoder)
  1080. {
  1081. return {
  1082. $: 8,
  1083. b: decoder
  1084. };
  1085. }
  1086. function _Json_mapMany(f, decoders)
  1087. {
  1088. return {
  1089. $: 9,
  1090. f: f,
  1091. g: decoders
  1092. };
  1093. }
  1094. var _Json_andThen = F2(function(callback, decoder)
  1095. {
  1096. return {
  1097. $: 10,
  1098. b: decoder,
  1099. h: callback
  1100. };
  1101. });
  1102. function _Json_oneOf(decoders)
  1103. {
  1104. return {
  1105. $: 11,
  1106. g: decoders
  1107. };
  1108. }
  1109. // DECODING OBJECTS
  1110. var _Json_map1 = F2(function(f, d1)
  1111. {
  1112. return _Json_mapMany(f, [d1]);
  1113. });
  1114. var _Json_map2 = F3(function(f, d1, d2)
  1115. {
  1116. return _Json_mapMany(f, [d1, d2]);
  1117. });
  1118. var _Json_map3 = F4(function(f, d1, d2, d3)
  1119. {
  1120. return _Json_mapMany(f, [d1, d2, d3]);
  1121. });
  1122. var _Json_map4 = F5(function(f, d1, d2, d3, d4)
  1123. {
  1124. return _Json_mapMany(f, [d1, d2, d3, d4]);
  1125. });
  1126. var _Json_map5 = F6(function(f, d1, d2, d3, d4, d5)
  1127. {
  1128. return _Json_mapMany(f, [d1, d2, d3, d4, d5]);
  1129. });
  1130. var _Json_map6 = F7(function(f, d1, d2, d3, d4, d5, d6)
  1131. {
  1132. return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6]);
  1133. });
  1134. var _Json_map7 = F8(function(f, d1, d2, d3, d4, d5, d6, d7)
  1135. {
  1136. return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7]);
  1137. });
  1138. var _Json_map8 = F9(function(f, d1, d2, d3, d4, d5, d6, d7, d8)
  1139. {
  1140. return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]);
  1141. });
  1142. // DECODE
  1143. var _Json_runOnString = F2(function(decoder, string)
  1144. {
  1145. try
  1146. {
  1147. var value = JSON.parse(string);
  1148. return _Json_runHelp(decoder, value);
  1149. }
  1150. catch (e)
  1151. {
  1152. return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, 'This is not valid JSON! ' + e.message, _Json_wrap(string)));
  1153. }
  1154. });
  1155. var _Json_run = F2(function(decoder, value)
  1156. {
  1157. return _Json_runHelp(decoder, _Json_unwrap(value));
  1158. });
  1159. function _Json_runHelp(decoder, value)
  1160. {
  1161. switch (decoder.$)
  1162. {
  1163. case 2:
  1164. return decoder.b(value);
  1165. case 5:
  1166. return (value === null)
  1167. ? $elm$core$Result$Ok(decoder.c)
  1168. : _Json_expecting('null', value);
  1169. case 3:
  1170. if (!_Json_isArray(value))
  1171. {
  1172. return _Json_expecting('a LIST', value);
  1173. }
  1174. return _Json_runArrayDecoder(decoder.b, value, _List_fromArray);
  1175. case 4:
  1176. if (!_Json_isArray(value))
  1177. {
  1178. return _Json_expecting('an ARRAY', value);
  1179. }
  1180. return _Json_runArrayDecoder(decoder.b, value, _Json_toElmArray);
  1181. case 6:
  1182. var field = decoder.d;
  1183. if (typeof value !== 'object' || value === null || !(field in value))
  1184. {
  1185. return _Json_expecting('an OBJECT with a field named `' + field + '`', value);
  1186. }
  1187. var result = _Json_runHelp(decoder.b, value[field]);
  1188. return ($elm$core$Result$isOk(result)) ? result : $elm$core$Result$Err(A2($elm$json$Json$Decode$Field, field, result.a));
  1189. case 7:
  1190. var index = decoder.e;
  1191. if (!_Json_isArray(value))
  1192. {
  1193. return _Json_expecting('an ARRAY', value);
  1194. }
  1195. if (index >= value.length)
  1196. {
  1197. return _Json_expecting('a LONGER array. Need index ' + index + ' but only see ' + value.length + ' entries', value);
  1198. }
  1199. var result = _Json_runHelp(decoder.b, value[index]);
  1200. return ($elm$core$Result$isOk(result)) ? result : $elm$core$Result$Err(A2($elm$json$Json$Decode$Index, index, result.a));
  1201. case 8:
  1202. if (typeof value !== 'object' || value === null || _Json_isArray(value))
  1203. {
  1204. return _Json_expecting('an OBJECT', value);
  1205. }
  1206. var keyValuePairs = _List_Nil;
  1207. // TODO test perf of Object.keys and switch when support is good enough
  1208. for (var key in value)
  1209. {
  1210. if (value.hasOwnProperty(key))
  1211. {
  1212. var result = _Json_runHelp(decoder.b, value[key]);
  1213. if (!$elm$core$Result$isOk(result))
  1214. {
  1215. return $elm$core$Result$Err(A2($elm$json$Json$Decode$Field, key, result.a));
  1216. }
  1217. keyValuePairs = _List_Cons(_Utils_Tuple2(key, result.a), keyValuePairs);
  1218. }
  1219. }
  1220. return $elm$core$Result$Ok($elm$core$List$reverse(keyValuePairs));
  1221. case 9:
  1222. var answer = decoder.f;
  1223. var decoders = decoder.g;
  1224. for (var i = 0; i < decoders.length; i++)
  1225. {
  1226. var result = _Json_runHelp(decoders[i], value);
  1227. if (!$elm$core$Result$isOk(result))
  1228. {
  1229. return result;
  1230. }
  1231. answer = answer(result.a);
  1232. }
  1233. return $elm$core$Result$Ok(answer);
  1234. case 10:
  1235. var result = _Json_runHelp(decoder.b, value);
  1236. return (!$elm$core$Result$isOk(result))
  1237. ? result
  1238. : _Json_runHelp(decoder.h(result.a), value);
  1239. case 11:
  1240. var errors = _List_Nil;
  1241. for (var temp = decoder.g; temp.b; temp = temp.b) // WHILE_CONS
  1242. {
  1243. var result = _Json_runHelp(temp.a, value);
  1244. if ($elm$core$Result$isOk(result))
  1245. {
  1246. return result;
  1247. }
  1248. errors = _List_Cons(result.a, errors);
  1249. }
  1250. return $elm$core$Result$Err($elm$json$Json$Decode$OneOf($elm$core$List$reverse(errors)));
  1251. case 1:
  1252. return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, decoder.a, _Json_wrap(value)));
  1253. case 0:
  1254. return $elm$core$Result$Ok(decoder.a);
  1255. }
  1256. }
  1257. function _Json_runArrayDecoder(decoder, value, toElmValue)
  1258. {
  1259. var len = value.length;
  1260. var array = new Array(len);
  1261. for (var i = 0; i < len; i++)
  1262. {
  1263. var result = _Json_runHelp(decoder, value[i]);
  1264. if (!$elm$core$Result$isOk(result))
  1265. {
  1266. return $elm$core$Result$Err(A2($elm$json$Json$Decode$Index, i, result.a));
  1267. }
  1268. array[i] = result.a;
  1269. }
  1270. return $elm$core$Result$Ok(toElmValue(array));
  1271. }
  1272. function _Json_isArray(value)
  1273. {
  1274. return Array.isArray(value) || (typeof FileList !== 'undefined' && value instanceof FileList);
  1275. }
  1276. function _Json_toElmArray(array)
  1277. {
  1278. return A2($elm$core$Array$initialize, array.length, function(i) { return array[i]; });
  1279. }
  1280. function _Json_expecting(type, value)
  1281. {
  1282. return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, 'Expecting ' + type, _Json_wrap(value)));
  1283. }
  1284. // EQUALITY
  1285. function _Json_equality(x, y)
  1286. {
  1287. if (x === y)
  1288. {
  1289. return true;
  1290. }
  1291. if (x.$ !== y.$)
  1292. {
  1293. return false;
  1294. }
  1295. switch (x.$)
  1296. {
  1297. case 0:
  1298. case 1:
  1299. return x.a === y.a;
  1300. case 2:
  1301. return x.b === y.b;
  1302. case 5:
  1303. return x.c === y.c;
  1304. case 3:
  1305. case 4:
  1306. case 8:
  1307. return _Json_equality(x.b, y.b);
  1308. case 6:
  1309. return x.d === y.d && _Json_equality(x.b, y.b);
  1310. case 7:
  1311. return x.e === y.e && _Json_equality(x.b, y.b);
  1312. case 9:
  1313. return x.f === y.f && _Json_listEquality(x.g, y.g);
  1314. case 10:
  1315. return x.h === y.h && _Json_equality(x.b, y.b);
  1316. case 11:
  1317. return _Json_listEquality(x.g, y.g);
  1318. }
  1319. }
  1320. function _Json_listEquality(aDecoders, bDecoders)
  1321. {
  1322. var len = aDecoders.length;
  1323. if (len !== bDecoders.length)
  1324. {
  1325. return false;
  1326. }
  1327. for (var i = 0; i < len; i++)
  1328. {
  1329. if (!_Json_equality(aDecoders[i], bDecoders[i]))
  1330. {
  1331. return false;
  1332. }
  1333. }
  1334. return true;
  1335. }
  1336. // ENCODE
  1337. var _Json_encode = F2(function(indentLevel, value)
  1338. {
  1339. return JSON.stringify(_Json_unwrap(value), null, indentLevel) + '';
  1340. });
  1341. function _Json_wrap(value) { return { $: 0, a: value }; }
  1342. function _Json_unwrap(value) { return value.a; }
  1343. function _Json_wrap_UNUSED(value) { return value; }
  1344. function _Json_unwrap_UNUSED(value) { return value; }
  1345. function _Json_emptyArray() { return []; }
  1346. function _Json_emptyObject() { return {}; }
  1347. var _Json_addField = F3(function(key, value, object)
  1348. {
  1349. object[key] = _Json_unwrap(value);
  1350. return object;
  1351. });
  1352. function _Json_addEntry(func)
  1353. {
  1354. return F2(function(entry, array)
  1355. {
  1356. array.push(_Json_unwrap(func(entry)));
  1357. return array;
  1358. });
  1359. }
  1360. var _Json_encodeNull = _Json_wrap(null);
  1361. // TASKS
  1362. function _Scheduler_succeed(value)
  1363. {
  1364. return {
  1365. $: 0,
  1366. a: value
  1367. };
  1368. }
  1369. function _Scheduler_fail(error)
  1370. {
  1371. return {
  1372. $: 1,
  1373. a: error
  1374. };
  1375. }
  1376. function _Scheduler_binding(callback)
  1377. {
  1378. return {
  1379. $: 2,
  1380. b: callback,
  1381. c: null
  1382. };
  1383. }
  1384. var _Scheduler_andThen = F2(function(callback, task)
  1385. {
  1386. return {
  1387. $: 3,
  1388. b: callback,
  1389. d: task
  1390. };
  1391. });
  1392. var _Scheduler_onError = F2(function(callback, task)
  1393. {
  1394. return {
  1395. $: 4,
  1396. b: callback,
  1397. d: task
  1398. };
  1399. });
  1400. function _Scheduler_receive(callback)
  1401. {
  1402. return {
  1403. $: 5,
  1404. b: callback
  1405. };
  1406. }
  1407. // PROCESSES
  1408. var _Scheduler_guid = 0;
  1409. function _Scheduler_rawSpawn(task)
  1410. {
  1411. var proc = {
  1412. $: 0,
  1413. e: _Scheduler_guid++,
  1414. f: task,
  1415. g: null,
  1416. h: []
  1417. };
  1418. _Scheduler_enqueue(proc);
  1419. return proc;
  1420. }
  1421. function _Scheduler_spawn(task)
  1422. {
  1423. return _Scheduler_binding(function(callback) {
  1424. callback(_Scheduler_succeed(_Scheduler_rawSpawn(task)));
  1425. });
  1426. }
  1427. function _Scheduler_rawSend(proc, msg)
  1428. {
  1429. proc.h.push(msg);
  1430. _Scheduler_enqueue(proc);
  1431. }
  1432. var _Scheduler_send = F2(function(proc, msg)
  1433. {
  1434. return _Scheduler_binding(function(callback) {
  1435. _Scheduler_rawSend(proc, msg);
  1436. callback(_Scheduler_succeed(_Utils_Tuple0));
  1437. });
  1438. });
  1439. function _Scheduler_kill(proc)
  1440. {
  1441. return _Scheduler_binding(function(callback) {
  1442. var task = proc.f;
  1443. if (task.$ === 2 && task.c)
  1444. {
  1445. task.c();
  1446. }
  1447. proc.f = null;
  1448. callback(_Scheduler_succeed(_Utils_Tuple0));
  1449. });
  1450. }
  1451. /* STEP PROCESSES
  1452. type alias Process =
  1453. { $ : tag
  1454. , id : unique_id
  1455. , root : Task
  1456. , stack : null | { $: SUCCEED | FAIL, a: callback, b: stack }
  1457. , mailbox : [msg]
  1458. }
  1459. */
  1460. var _Scheduler_working = false;
  1461. var _Scheduler_queue = [];
  1462. function _Scheduler_enqueue(proc)
  1463. {
  1464. _Scheduler_queue.push(proc);
  1465. if (_Scheduler_working)
  1466. {
  1467. return;
  1468. }
  1469. _Scheduler_working = true;
  1470. while (proc = _Scheduler_queue.shift())
  1471. {
  1472. _Scheduler_step(proc);
  1473. }
  1474. _Scheduler_working = false;
  1475. }
  1476. function _Scheduler_step(proc)
  1477. {
  1478. while (proc.f)
  1479. {
  1480. var rootTag = proc.f.$;
  1481. if (rootTag === 0 || rootTag === 1)
  1482. {
  1483. while (proc.g && proc.g.$ !== rootTag)
  1484. {
  1485. proc.g = proc.g.i;
  1486. }
  1487. if (!proc.g)
  1488. {
  1489. return;
  1490. }
  1491. proc.f = proc.g.b(proc.f.a);
  1492. proc.g = proc.g.i;
  1493. }
  1494. else if (rootTag === 2)
  1495. {
  1496. proc.f.c = proc.f.b(function(newRoot) {
  1497. proc.f = newRoot;
  1498. _Scheduler_enqueue(proc);
  1499. });
  1500. return;
  1501. }
  1502. else if (rootTag === 5)
  1503. {
  1504. if (proc.h.length === 0)
  1505. {
  1506. return;
  1507. }
  1508. proc.f = proc.f.b(proc.h.shift());
  1509. }
  1510. else // if (rootTag === 3 || rootTag === 4)
  1511. {
  1512. proc.g = {
  1513. $: rootTag === 3 ? 0 : 1,
  1514. b: proc.f.b,
  1515. i: proc.g
  1516. };
  1517. proc.f = proc.f.d;
  1518. }
  1519. }
  1520. }
  1521. function _Process_sleep(time)
  1522. {
  1523. return _Scheduler_binding(function(callback) {
  1524. var id = setTimeout(function() {
  1525. callback(_Scheduler_succeed(_Utils_Tuple0));
  1526. }, time);
  1527. return function() { clearTimeout(id); };
  1528. });
  1529. }
  1530. // PROGRAMS
  1531. var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args)
  1532. {
  1533. return _Platform_initialize(
  1534. flagDecoder,
  1535. args,
  1536. impl.init,
  1537. impl.update,
  1538. impl.subscriptions,
  1539. function() { return function() {} }
  1540. );
  1541. });
  1542. // INITIALIZE A PROGRAM
  1543. function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder)
  1544. {
  1545. var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined));
  1546. $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/);
  1547. var managers = {};
  1548. result = init(result.a);
  1549. var model = result.a;
  1550. var stepper = stepperBuilder(sendToApp, model);
  1551. var ports = _Platform_setupEffects(managers, sendToApp);
  1552. function sendToApp(msg, viewMetadata)
  1553. {
  1554. result = A2(update, msg, model);
  1555. stepper(model = result.a, viewMetadata);
  1556. _Platform_enqueueEffects(managers, result.b, subscriptions(model));
  1557. }
  1558. _Platform_enqueueEffects(managers, result.b, subscriptions(model));
  1559. return ports ? { ports: ports } : {};
  1560. }
  1561. // TRACK PRELOADS
  1562. //
  1563. // This is used by code in elm/browser and elm/http
  1564. // to register any HTTP requests that are triggered by init.
  1565. //
  1566. var _Platform_preload;
  1567. function _Platform_registerPreload(url)
  1568. {
  1569. _Platform_preload.add(url);
  1570. }
  1571. // EFFECT MANAGERS
  1572. var _Platform_effectManagers = {};
  1573. function _Platform_setupEffects(managers, sendToApp)
  1574. {
  1575. var ports;
  1576. // setup all necessary effect managers
  1577. for (var key in _Platform_effectManagers)
  1578. {
  1579. var manager = _Platform_effectManagers[key];
  1580. if (manager.a)
  1581. {
  1582. ports = ports || {};
  1583. ports[key] = manager.a(key, sendToApp);
  1584. }
  1585. managers[key] = _Platform_instantiateManager(manager, sendToApp);
  1586. }
  1587. return ports;
  1588. }
  1589. function _Platform_createManager(init, onEffects, onSelfMsg, cmdMap, subMap)
  1590. {
  1591. return {
  1592. b: init,
  1593. c: onEffects,
  1594. d: onSelfMsg,
  1595. e: cmdMap,
  1596. f: subMap
  1597. };
  1598. }
  1599. function _Platform_instantiateManager(info, sendToApp)
  1600. {
  1601. var router = {
  1602. g: sendToApp,
  1603. h: undefined
  1604. };
  1605. var onEffects = info.c;
  1606. var onSelfMsg = info.d;
  1607. var cmdMap = info.e;
  1608. var subMap = info.f;
  1609. function loop(state)
  1610. {
  1611. return A2(_Scheduler_andThen, loop, _Scheduler_receive(function(msg)
  1612. {
  1613. var value = msg.a;
  1614. if (msg.$ === 0)
  1615. {
  1616. return A3(onSelfMsg, router, value, state);
  1617. }
  1618. return cmdMap && subMap
  1619. ? A4(onEffects, router, value.i, value.j, state)
  1620. : A3(onEffects, router, cmdMap ? value.i : value.j, state);
  1621. }));
  1622. }
  1623. return router.h = _Scheduler_rawSpawn(A2(_Scheduler_andThen, loop, info.b));
  1624. }
  1625. // ROUTING
  1626. var _Platform_sendToApp = F2(function(router, msg)
  1627. {
  1628. return _Scheduler_binding(function(callback)
  1629. {
  1630. router.g(msg);
  1631. callback(_Scheduler_succeed(_Utils_Tuple0));
  1632. });
  1633. });
  1634. var _Platform_sendToSelf = F2(function(router, msg)
  1635. {
  1636. return A2(_Scheduler_send, router.h, {
  1637. $: 0,
  1638. a: msg
  1639. });
  1640. });
  1641. // BAGS
  1642. function _Platform_leaf(home)
  1643. {
  1644. return function(value)
  1645. {
  1646. return {
  1647. $: 1,
  1648. k: home,
  1649. l: value
  1650. };
  1651. };
  1652. }
  1653. function _Platform_batch(list)
  1654. {
  1655. return {
  1656. $: 2,
  1657. m: list
  1658. };
  1659. }
  1660. var _Platform_map = F2(function(tagger, bag)
  1661. {
  1662. return {
  1663. $: 3,
  1664. n: tagger,
  1665. o: bag
  1666. }
  1667. });
  1668. // PIPE BAGS INTO EFFECT MANAGERS
  1669. //
  1670. // Effects must be queued!
  1671. //
  1672. // Say your init contains a synchronous command, like Time.now or Time.here
  1673. //
  1674. // - This will produce a batch of effects (FX_1)
  1675. // - The synchronous task triggers the subsequent `update` call
  1676. // - This will produce a batch of effects (FX_2)
  1677. //
  1678. // If we just start dispatching FX_2, subscriptions from FX_2 can be processed
  1679. // before subscriptions from FX_1. No good! Earlier versions of this code had
  1680. // this problem, leading to these reports:
  1681. //
  1682. // https://github.com/elm/core/issues/980
  1683. // https://github.com/elm/core/pull/981
  1684. // https://github.com/elm/compiler/issues/1776
  1685. //
  1686. // The queue is necessary to avoid ordering issues for synchronous commands.
  1687. // Why use true/false here? Why not just check the length of the queue?
  1688. // The goal is to detect "are we currently dispatching effects?" If we
  1689. // are, we need to bail and let the ongoing while loop handle things.
  1690. //
  1691. // Now say the queue has 1 element. When we dequeue the final element,
  1692. // the queue will be empty, but we are still actively dispatching effects.
  1693. // So you could get queue jumping in a really tricky category of cases.
  1694. //
  1695. var _Platform_effectsQueue = [];
  1696. var _Platform_effectsActive = false;
  1697. function _Platform_enqueueEffects(managers, cmdBag, subBag)
  1698. {
  1699. _Platform_effectsQueue.push({ p: managers, q: cmdBag, r: subBag });
  1700. if (_Platform_effectsActive) return;
  1701. _Platform_effectsActive = true;
  1702. for (var fx; fx = _Platform_effectsQueue.shift(); )
  1703. {
  1704. _Platform_dispatchEffects(fx.p, fx.q, fx.r);
  1705. }
  1706. _Platform_effectsActive = false;
  1707. }
  1708. function _Platform_dispatchEffects(managers, cmdBag, subBag)
  1709. {
  1710. var effectsDict = {};
  1711. _Platform_gatherEffects(true, cmdBag, effectsDict, null);
  1712. _Platform_gatherEffects(false, subBag, effectsDict, null);
  1713. for (var home in managers)
  1714. {
  1715. _Scheduler_rawSend(managers[home], {
  1716. $: 'fx',
  1717. a: effectsDict[home] || { i: _List_Nil, j: _List_Nil }
  1718. });
  1719. }
  1720. }
  1721. function _Platform_gatherEffects(isCmd, bag, effectsDict, taggers)
  1722. {
  1723. switch (bag.$)
  1724. {
  1725. case 1:
  1726. var home = bag.k;
  1727. var effect = _Platform_toEffect(isCmd, home, taggers, bag.l);
  1728. effectsDict[home] = _Platform_insert(isCmd, effect, effectsDict[home]);
  1729. return;
  1730. case 2:
  1731. for (var list = bag.m; list.b; list = list.b) // WHILE_CONS
  1732. {
  1733. _Platform_gatherEffects(isCmd, list.a, effectsDict, taggers);
  1734. }
  1735. return;
  1736. case 3:
  1737. _Platform_gatherEffects(isCmd, bag.o, effectsDict, {
  1738. s: bag.n,
  1739. t: taggers
  1740. });
  1741. return;
  1742. }
  1743. }
  1744. function _Platform_toEffect(isCmd, home, taggers, value)
  1745. {
  1746. function applyTaggers(x)
  1747. {
  1748. for (var temp = taggers; temp; temp = temp.t)
  1749. {
  1750. x = temp.s(x);
  1751. }
  1752. return x;
  1753. }
  1754. var map = isCmd
  1755. ? _Platform_effectManagers[home].e
  1756. : _Platform_effectManagers[home].f;
  1757. return A2(map, applyTaggers, value)
  1758. }
  1759. function _Platform_insert(isCmd, newEffect, effects)
  1760. {
  1761. effects = effects || { i: _List_Nil, j: _List_Nil };
  1762. isCmd
  1763. ? (effects.i = _List_Cons(newEffect, effects.i))
  1764. : (effects.j = _List_Cons(newEffect, effects.j));
  1765. return effects;
  1766. }
  1767. // PORTS
  1768. function _Platform_checkPortName(name)
  1769. {
  1770. if (_Platform_effectManagers[name])
  1771. {
  1772. _Debug_crash(3, name)
  1773. }
  1774. }
  1775. // OUTGOING PORTS
  1776. function _Platform_outgoingPort(name, converter)
  1777. {
  1778. _Platform_checkPortName(name);
  1779. _Platform_effectManagers[name] = {
  1780. e: _Platform_outgoingPortMap,
  1781. u: converter,
  1782. a: _Platform_setupOutgoingPort
  1783. };
  1784. return _Platform_leaf(name);
  1785. }
  1786. var _Platform_outgoingPortMap = F2(function(tagger, value) { return value; });
  1787. function _Platform_setupOutgoingPort(name)
  1788. {
  1789. var subs = [];
  1790. var converter = _Platform_effectManagers[name].u;
  1791. // CREATE MANAGER
  1792. var init = _Process_sleep(0);
  1793. _Platform_effectManagers[name].b = init;
  1794. _Platform_effectManagers[name].c = F3(function(router, cmdList, state)
  1795. {
  1796. for ( ; cmdList.b; cmdList = cmdList.b) // WHILE_CONS
  1797. {
  1798. // grab a separate reference to subs in case unsubscribe is called
  1799. var currentSubs = subs;
  1800. var value = _Json_unwrap(converter(cmdList.a));
  1801. for (var i = 0; i < currentSubs.length; i++)
  1802. {
  1803. currentSubs[i](value);
  1804. }
  1805. }
  1806. return init;
  1807. });
  1808. // PUBLIC API
  1809. function subscribe(callback)
  1810. {
  1811. subs.push(callback);
  1812. }
  1813. function unsubscribe(callback)
  1814. {
  1815. // copy subs into a new array in case unsubscribe is called within a
  1816. // subscribed callback
  1817. subs = subs.slice();
  1818. var index = subs.indexOf(callback);
  1819. if (index >= 0)
  1820. {
  1821. subs.splice(index, 1);
  1822. }
  1823. }
  1824. return {
  1825. subscribe: subscribe,
  1826. unsubscribe: unsubscribe
  1827. };
  1828. }
  1829. // INCOMING PORTS
  1830. function _Platform_incomingPort(name, converter)
  1831. {
  1832. _Platform_checkPortName(name);
  1833. _Platform_effectManagers[name] = {
  1834. f: _Platform_incomingPortMap,
  1835. u: converter,
  1836. a: _Platform_setupIncomingPort
  1837. };
  1838. return _Platform_leaf(name);
  1839. }
  1840. var _Platform_incomingPortMap = F2(function(tagger, finalTagger)
  1841. {
  1842. return function(value)
  1843. {
  1844. return tagger(finalTagger(value));
  1845. };
  1846. });
  1847. function _Platform_setupIncomingPort(name, sendToApp)
  1848. {
  1849. var subs = _List_Nil;
  1850. var converter = _Platform_effectManagers[name].u;
  1851. // CREATE MANAGER
  1852. var init = _Scheduler_succeed(null);
  1853. _Platform_effectManagers[name].b = init;
  1854. _Platform_effectManagers[name].c = F3(function(router, subList, state)
  1855. {
  1856. subs = subList;
  1857. return init;
  1858. });
  1859. // PUBLIC API
  1860. function send(incomingValue)
  1861. {
  1862. var result = A2(_Json_run, converter, _Json_wrap(incomingValue));
  1863. $elm$core$Result$isOk(result) || _Debug_crash(4, name, result.a);
  1864. var value = result.a;
  1865. for (var temp = subs; temp.b; temp = temp.b) // WHILE_CONS
  1866. {
  1867. sendToApp(temp.a(value));
  1868. }
  1869. }
  1870. return { send: send };
  1871. }
  1872. // EXPORT ELM MODULES
  1873. //
  1874. // Have DEBUG and PROD versions so that we can (1) give nicer errors in
  1875. // debug mode and (2) not pay for the bits needed for that in prod mode.
  1876. //
  1877. function _Platform_export_UNUSED(exports)
  1878. {
  1879. scope['Elm']
  1880. ? _Platform_mergeExportsProd(scope['Elm'], exports)
  1881. : scope['Elm'] = exports;
  1882. }
  1883. function _Platform_mergeExportsProd(obj, exports)
  1884. {
  1885. for (var name in exports)
  1886. {
  1887. (name in obj)
  1888. ? (name == 'init')
  1889. ? _Debug_crash(6)
  1890. : _Platform_mergeExportsProd(obj[name], exports[name])
  1891. : (obj[name] = exports[name]);
  1892. }
  1893. }
  1894. function _Platform_export(exports)
  1895. {
  1896. scope['Elm']
  1897. ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports)
  1898. : scope['Elm'] = exports;
  1899. }
  1900. function _Platform_mergeExportsDebug(moduleName, obj, exports)
  1901. {
  1902. for (var name in exports)
  1903. {
  1904. (name in obj)
  1905. ? (name == 'init')
  1906. ? _Debug_crash(6, moduleName)
  1907. : _Platform_mergeExportsDebug(moduleName + '.' + name, obj[name], exports[name])
  1908. : (obj[name] = exports[name]);
  1909. }
  1910. }
  1911. // HELPERS
  1912. var _VirtualDom_divertHrefToApp;
  1913. var _VirtualDom_doc = typeof document !== 'undefined' ? document : {};
  1914. function _VirtualDom_appendChild(parent, child)
  1915. {
  1916. parent.appendChild(child);
  1917. }
  1918. var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args)
  1919. {
  1920. // NOTE: this function needs _Platform_export available to work
  1921. /**_UNUSED/
  1922. var node = args['node'];
  1923. //*/
  1924. /**/
  1925. var node = args && args['node'] ? args['node'] : _Debug_crash(0);
  1926. //*/
  1927. node.parentNode.replaceChild(
  1928. _VirtualDom_render(virtualNode, function() {}),
  1929. node
  1930. );
  1931. return {};
  1932. });
  1933. // TEXT
  1934. function _VirtualDom_text(string)
  1935. {
  1936. return {
  1937. $: 0,
  1938. a: string
  1939. };
  1940. }
  1941. // NODE
  1942. var _VirtualDom_nodeNS = F2(function(namespace, tag)
  1943. {
  1944. return F2(function(factList, kidList)
  1945. {
  1946. for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS
  1947. {
  1948. var kid = kidList.a;
  1949. descendantsCount += (kid.b || 0);
  1950. kids.push(kid);
  1951. }
  1952. descendantsCount += kids.length;
  1953. return {
  1954. $: 1,
  1955. c: tag,
  1956. d: _VirtualDom_organizeFacts(factList),
  1957. e: kids,
  1958. f: namespace,
  1959. b: descendantsCount
  1960. };
  1961. });
  1962. });
  1963. var _VirtualDom_node = _VirtualDom_nodeNS(undefined);
  1964. // KEYED NODE
  1965. var _VirtualDom_keyedNodeNS = F2(function(namespace, tag)
  1966. {
  1967. return F2(function(factList, kidList)
  1968. {
  1969. for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS
  1970. {
  1971. var kid = kidList.a;
  1972. descendantsCount += (kid.b.b || 0);
  1973. kids.push(kid);
  1974. }
  1975. descendantsCount += kids.length;
  1976. return {
  1977. $: 2,
  1978. c: tag,
  1979. d: _VirtualDom_organizeFacts(factList),
  1980. e: kids,
  1981. f: namespace,
  1982. b: descendantsCount
  1983. };
  1984. });
  1985. });
  1986. var _VirtualDom_keyedNode = _VirtualDom_keyedNodeNS(undefined);
  1987. // CUSTOM
  1988. function _VirtualDom_custom(factList, model, render, diff)
  1989. {
  1990. return {
  1991. $: 3,
  1992. d: _VirtualDom_organizeFacts(factList),
  1993. g: model,
  1994. h: render,
  1995. i: diff
  1996. };
  1997. }
  1998. // MAP
  1999. var _VirtualDom_map = F2(function(tagger, node)
  2000. {
  2001. return {
  2002. $: 4,
  2003. j: tagger,
  2004. k: node,
  2005. b: 1 + (node.b || 0)
  2006. };
  2007. });
  2008. // LAZY
  2009. function _VirtualDom_thunk(refs, thunk)
  2010. {
  2011. return {
  2012. $: 5,
  2013. l: refs,
  2014. m: thunk,
  2015. k: undefined
  2016. };
  2017. }
  2018. var _VirtualDom_lazy = F2(function(func, a)
  2019. {
  2020. return _VirtualDom_thunk([func, a], function() {
  2021. return func(a);
  2022. });
  2023. });
  2024. var _VirtualDom_lazy2 = F3(function(func, a, b)
  2025. {
  2026. return _VirtualDom_thunk([func, a, b], function() {
  2027. return A2(func, a, b);
  2028. });
  2029. });
  2030. var _VirtualDom_lazy3 = F4(function(func, a, b, c)
  2031. {
  2032. return _VirtualDom_thunk([func, a, b, c], function() {
  2033. return A3(func, a, b, c);
  2034. });
  2035. });
  2036. var _VirtualDom_lazy4 = F5(function(func, a, b, c, d)
  2037. {
  2038. return _VirtualDom_thunk([func, a, b, c, d], function() {
  2039. return A4(func, a, b, c, d);
  2040. });
  2041. });
  2042. var _VirtualDom_lazy5 = F6(function(func, a, b, c, d, e)
  2043. {
  2044. return _VirtualDom_thunk([func, a, b, c, d, e], function() {
  2045. return A5(func, a, b, c, d, e);
  2046. });
  2047. });
  2048. var _VirtualDom_lazy6 = F7(function(func, a, b, c, d, e, f)
  2049. {
  2050. return _VirtualDom_thunk([func, a, b, c, d, e, f], function() {
  2051. return A6(func, a, b, c, d, e, f);
  2052. });
  2053. });
  2054. var _VirtualDom_lazy7 = F8(function(func, a, b, c, d, e, f, g)
  2055. {
  2056. return _VirtualDom_thunk([func, a, b, c, d, e, f, g], function() {
  2057. return A7(func, a, b, c, d, e, f, g);
  2058. });
  2059. });
  2060. var _VirtualDom_lazy8 = F9(function(func, a, b, c, d, e, f, g, h)
  2061. {
  2062. return _VirtualDom_thunk([func, a, b, c, d, e, f, g, h], function() {
  2063. return A8(func, a, b, c, d, e, f, g, h);
  2064. });
  2065. });
  2066. // FACTS
  2067. var _VirtualDom_on = F2(function(key, handler)
  2068. {
  2069. return {
  2070. $: 'a0',
  2071. n: key,
  2072. o: handler
  2073. };
  2074. });
  2075. var _VirtualDom_style = F2(function(key, value)
  2076. {
  2077. return {
  2078. $: 'a1',
  2079. n: key,
  2080. o: value
  2081. };
  2082. });
  2083. var _VirtualDom_property = F2(function(key, value)
  2084. {
  2085. return {
  2086. $: 'a2',
  2087. n: key,
  2088. o: value
  2089. };
  2090. });
  2091. var _VirtualDom_attribute = F2(function(key, value)
  2092. {
  2093. return {
  2094. $: 'a3',
  2095. n: key,
  2096. o: value
  2097. };
  2098. });
  2099. var _VirtualDom_attributeNS = F3(function(namespace, key, value)
  2100. {
  2101. return {
  2102. $: 'a4',
  2103. n: key,
  2104. o: { f: namespace, o: value }
  2105. };
  2106. });
  2107. // XSS ATTACK VECTOR CHECKS
  2108. function _VirtualDom_noScript(tag)
  2109. {
  2110. return tag == 'script' ? 'p' : tag;
  2111. }
  2112. function _VirtualDom_noOnOrFormAction(key)
  2113. {
  2114. return /^(on|formAction$)/i.test(key) ? 'data-' + key : key;
  2115. }
  2116. function _VirtualDom_noInnerHtmlOrFormAction(key)
  2117. {
  2118. return key == 'innerHTML' || key == 'formAction' ? 'data-' + key : key;
  2119. }
  2120. function _VirtualDom_noJavaScriptUri_UNUSED(value)
  2121. {
  2122. return /^javascript:/i.test(value.replace(/\s/g,'')) ? '' : value;
  2123. }
  2124. function _VirtualDom_noJavaScriptUri(value)
  2125. {
  2126. return /^javascript:/i.test(value.replace(/\s/g,''))
  2127. ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'
  2128. : value;
  2129. }
  2130. function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value)
  2131. {
  2132. return /^\s*(javascript:|data:text\/html)/i.test(value) ? '' : value;
  2133. }
  2134. function _VirtualDom_noJavaScriptOrHtmlUri(value)
  2135. {
  2136. return /^\s*(javascript:|data:text\/html)/i.test(value)
  2137. ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'
  2138. : value;
  2139. }
  2140. // MAP FACTS
  2141. var _VirtualDom_mapAttribute = F2(function(func, attr)
  2142. {
  2143. return (attr.$ === 'a0')
  2144. ? A2(_VirtualDom_on, attr.n, _VirtualDom_mapHandler(func, attr.o))
  2145. : attr;
  2146. });
  2147. function _VirtualDom_mapHandler(func, handler)
  2148. {
  2149. var tag = $elm$virtual_dom$VirtualDom$toHandlerInt(handler);
  2150. // 0 = Normal
  2151. // 1 = MayStopPropagation
  2152. // 2 = MayPreventDefault
  2153. // 3 = Custom
  2154. return {
  2155. $: handler.$,
  2156. a:
  2157. !tag
  2158. ? A2($elm$json$Json$Decode$map, func, handler.a)
  2159. :
  2160. A3($elm$json$Json$Decode$map2,
  2161. tag < 3
  2162. ? _VirtualDom_mapEventTuple
  2163. : _VirtualDom_mapEventRecord,
  2164. $elm$json$Json$Decode$succeed(func),
  2165. handler.a
  2166. )
  2167. };
  2168. }
  2169. var _VirtualDom_mapEventTuple = F2(function(func, tuple)
  2170. {
  2171. return _Utils_Tuple2(func(tuple.a), tuple.b);
  2172. });
  2173. var _VirtualDom_mapEventRecord = F2(function(func, record)
  2174. {
  2175. return {
  2176. message: func(record.message),
  2177. stopPropagation: record.stopPropagation,
  2178. preventDefault: record.preventDefault
  2179. }
  2180. });
  2181. // ORGANIZE FACTS
  2182. function _VirtualDom_organizeFacts(factList)
  2183. {
  2184. for (var facts = {}; factList.b; factList = factList.b) // WHILE_CONS
  2185. {
  2186. var entry = factList.a;
  2187. var tag = entry.$;
  2188. var key = entry.n;
  2189. var value = entry.o;
  2190. if (tag === 'a2')
  2191. {
  2192. (key === 'className')
  2193. ? _VirtualDom_addClass(facts, key, _Json_unwrap(value))
  2194. : facts[key] = _Json_unwrap(value);
  2195. continue;
  2196. }
  2197. var subFacts = facts[tag] || (facts[tag] = {});
  2198. (tag === 'a3' && key === 'class')
  2199. ? _VirtualDom_addClass(subFacts, key, value)
  2200. : subFacts[key] = value;
  2201. }
  2202. return facts;
  2203. }
  2204. function _VirtualDom_addClass(object, key, newClass)
  2205. {
  2206. var classes = object[key];
  2207. object[key] = classes ? classes + ' ' + newClass : newClass;
  2208. }
  2209. // RENDER
  2210. function _VirtualDom_render(vNode, eventNode)
  2211. {
  2212. var tag = vNode.$;
  2213. if (tag === 5)
  2214. {
  2215. return _VirtualDom_render(vNode.k || (vNode.k = vNode.m()), eventNode);
  2216. }
  2217. if (tag === 0)
  2218. {
  2219. return _VirtualDom_doc.createTextNode(vNode.a);
  2220. }
  2221. if (tag === 4)
  2222. {
  2223. var subNode = vNode.k;
  2224. var tagger = vNode.j;
  2225. while (subNode.$ === 4)
  2226. {
  2227. typeof tagger !== 'object'
  2228. ? tagger = [tagger, subNode.j]
  2229. : tagger.push(subNode.j);
  2230. subNode = subNode.k;
  2231. }
  2232. var subEventRoot = { j: tagger, p: eventNode };
  2233. var domNode = _VirtualDom_render(subNode, subEventRoot);
  2234. domNode.elm_event_node_ref = subEventRoot;
  2235. return domNode;
  2236. }
  2237. if (tag === 3)
  2238. {
  2239. var domNode = vNode.h(vNode.g);
  2240. _VirtualDom_applyFacts(domNode, eventNode, vNode.d);
  2241. return domNode;
  2242. }
  2243. // at this point `tag` must be 1 or 2
  2244. var domNode = vNode.f
  2245. ? _VirtualDom_doc.createElementNS(vNode.f, vNode.c)
  2246. : _VirtualDom_doc.createElement(vNode.c);
  2247. if (_VirtualDom_divertHrefToApp && vNode.c == 'a')
  2248. {
  2249. domNode.addEventListener('click', _VirtualDom_divertHrefToApp(domNode));
  2250. }
  2251. _VirtualDom_applyFacts(domNode, eventNode, vNode.d);
  2252. for (var kids = vNode.e, i = 0; i < kids.length; i++)
  2253. {
  2254. _VirtualDom_appendChild(domNode, _VirtualDom_render(tag === 1 ? kids[i] : kids[i].b, eventNode));
  2255. }
  2256. return domNode;
  2257. }
  2258. // APPLY FACTS
  2259. function _VirtualDom_applyFacts(domNode, eventNode, facts)
  2260. {
  2261. for (var key in facts)
  2262. {
  2263. var value = facts[key];
  2264. key === 'a1'
  2265. ? _VirtualDom_applyStyles(domNode, value)
  2266. :
  2267. key === 'a0'
  2268. ? _VirtualDom_applyEvents(domNode, eventNode, value)
  2269. :
  2270. key === 'a3'
  2271. ? _VirtualDom_applyAttrs(domNode, value)
  2272. :
  2273. key === 'a4'
  2274. ? _VirtualDom_applyAttrsNS(domNode, value)
  2275. :
  2276. ((key !== 'value' && key !== 'checked') || domNode[key] !== value) && (domNode[key] = value);
  2277. }
  2278. }
  2279. // APPLY STYLES
  2280. function _VirtualDom_applyStyles(domNode, styles)
  2281. {
  2282. var domNodeStyle = domNode.style;
  2283. for (var key in styles)
  2284. {
  2285. domNodeStyle[key] = styles[key];
  2286. }
  2287. }
  2288. // APPLY ATTRS
  2289. function _VirtualDom_applyAttrs(domNode, attrs)
  2290. {
  2291. for (var key in attrs)
  2292. {
  2293. var value = attrs[key];
  2294. typeof value !== 'undefined'
  2295. ? domNode.setAttribute(key, value)
  2296. : domNode.removeAttribute(key);
  2297. }
  2298. }
  2299. // APPLY NAMESPACED ATTRS
  2300. function _VirtualDom_applyAttrsNS(domNode, nsAttrs)
  2301. {
  2302. for (var key in nsAttrs)
  2303. {
  2304. var pair = nsAttrs[key];
  2305. var namespace = pair.f;
  2306. var value = pair.o;
  2307. typeof value !== 'undefined'
  2308. ? domNode.setAttributeNS(namespace, key, value)
  2309. : domNode.removeAttributeNS(namespace, key);
  2310. }
  2311. }
  2312. // APPLY EVENTS
  2313. function _VirtualDom_applyEvents(domNode, eventNode, events)
  2314. {
  2315. var allCallbacks = domNode.elmFs || (domNode.elmFs = {});
  2316. for (var key in events)
  2317. {
  2318. var newHandler = events[key];
  2319. var oldCallback = allCallbacks[key];
  2320. if (!newHandler)
  2321. {
  2322. domNode.removeEventListener(key, oldCallback);
  2323. allCallbacks[key] = undefined;
  2324. continue;
  2325. }
  2326. if (oldCallback)
  2327. {
  2328. var oldHandler = oldCallback.q;
  2329. if (oldHandler.$ === newHandler.$)
  2330. {
  2331. oldCallback.q = newHandler;
  2332. continue;
  2333. }
  2334. domNode.removeEventListener(key, oldCallback);
  2335. }
  2336. oldCallback = _VirtualDom_makeCallback(eventNode, newHandler);
  2337. domNode.addEventListener(key, oldCallback,
  2338. _VirtualDom_passiveSupported
  2339. && { passive: $elm$virtual_dom$VirtualDom$toHandlerInt(newHandler) < 2 }
  2340. );
  2341. allCallbacks[key] = oldCallback;
  2342. }
  2343. }
  2344. // PASSIVE EVENTS
  2345. var _VirtualDom_passiveSupported;
  2346. try
  2347. {
  2348. window.addEventListener('t', null, Object.defineProperty({}, 'passive', {
  2349. get: function() { _VirtualDom_passiveSupported = true; }
  2350. }));
  2351. }
  2352. catch(e) {}
  2353. // EVENT HANDLERS
  2354. function _VirtualDom_makeCallback(eventNode, initialHandler)
  2355. {
  2356. function callback(event)
  2357. {
  2358. var handler = callback.q;
  2359. var result = _Json_runHelp(handler.a, event);
  2360. if (!$elm$core$Result$isOk(result))
  2361. {
  2362. return;
  2363. }
  2364. var tag = $elm$virtual_dom$VirtualDom$toHandlerInt(handler);
  2365. // 0 = Normal
  2366. // 1 = MayStopPropagation
  2367. // 2 = MayPreventDefault
  2368. // 3 = Custom
  2369. var value = result.a;
  2370. var message = !tag ? value : tag < 3 ? value.a : value.message;
  2371. var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation;
  2372. var currentEventNode = (
  2373. stopPropagation && event.stopPropagation(),
  2374. (tag == 2 ? value.b : tag == 3 && value.preventDefault) && event.preventDefault(),
  2375. eventNode
  2376. );
  2377. var tagger;
  2378. var i;
  2379. while (tagger = currentEventNode.j)
  2380. {
  2381. if (typeof tagger == 'function')
  2382. {
  2383. message = tagger(message);
  2384. }
  2385. else
  2386. {
  2387. for (var i = tagger.length; i--; )
  2388. {
  2389. message = tagger[i](message);
  2390. }
  2391. }
  2392. currentEventNode = currentEventNode.p;
  2393. }
  2394. currentEventNode(message, stopPropagation); // stopPropagation implies isSync
  2395. }
  2396. callback.q = initialHandler;
  2397. return callback;
  2398. }
  2399. function _VirtualDom_equalEvents(x, y)
  2400. {
  2401. return x.$ == y.$ && _Json_equality(x.a, y.a);
  2402. }
  2403. // DIFF
  2404. // TODO: Should we do patches like in iOS?
  2405. //
  2406. // type Patch
  2407. // = At Int Patch
  2408. // | Batch (List Patch)
  2409. // | Change ...
  2410. //
  2411. // How could it not be better?
  2412. //
  2413. function _VirtualDom_diff(x, y)
  2414. {
  2415. var patches = [];
  2416. _VirtualDom_diffHelp(x, y, patches, 0);
  2417. return patches;
  2418. }
  2419. function _VirtualDom_pushPatch(patches, type, index, data)
  2420. {
  2421. var patch = {
  2422. $: type,
  2423. r: index,
  2424. s: data,
  2425. t: undefined,
  2426. u: undefined
  2427. };
  2428. patches.push(patch);
  2429. return patch;
  2430. }
  2431. function _VirtualDom_diffHelp(x, y, patches, index)
  2432. {
  2433. if (x === y)
  2434. {
  2435. return;
  2436. }
  2437. var xType = x.$;
  2438. var yType = y.$;
  2439. // Bail if you run into different types of nodes. Implies that the
  2440. // structure has changed significantly and it's not worth a diff.
  2441. if (xType !== yType)
  2442. {
  2443. if (xType === 1 && yType === 2)
  2444. {
  2445. y = _VirtualDom_dekey(y);
  2446. yType = 1;
  2447. }
  2448. else
  2449. {
  2450. _VirtualDom_pushPatch(patches, 0, index, y);
  2451. return;
  2452. }
  2453. }
  2454. // Now we know that both nodes are the same $.
  2455. switch (yType)
  2456. {
  2457. case 5:
  2458. var xRefs = x.l;
  2459. var yRefs = y.l;
  2460. var i = xRefs.length;
  2461. var same = i === yRefs.length;
  2462. while (same && i--)
  2463. {
  2464. same = xRefs[i] === yRefs[i];
  2465. }
  2466. if (same)
  2467. {
  2468. y.k = x.k;
  2469. return;
  2470. }
  2471. y.k = y.m();
  2472. var subPatches = [];
  2473. _VirtualDom_diffHelp(x.k, y.k, subPatches, 0);
  2474. subPatches.length > 0 && _VirtualDom_pushPatch(patches, 1, index, subPatches);
  2475. return;
  2476. case 4:
  2477. // gather nested taggers
  2478. var xTaggers = x.j;
  2479. var yTaggers = y.j;
  2480. var nesting = false;
  2481. var xSubNode = x.k;
  2482. while (xSubNode.$ === 4)
  2483. {
  2484. nesting = true;
  2485. typeof xTaggers !== 'object'
  2486. ? xTaggers = [xTaggers, xSubNode.j]
  2487. : xTaggers.push(xSubNode.j);
  2488. xSubNode = xSubNode.k;
  2489. }
  2490. var ySubNode = y.k;
  2491. while (ySubNode.$ === 4)
  2492. {
  2493. nesting = true;
  2494. typeof yTaggers !== 'object'
  2495. ? yTaggers = [yTaggers, ySubNode.j]
  2496. : yTaggers.push(ySubNode.j);
  2497. ySubNode = ySubNode.k;
  2498. }
  2499. // Just bail if different numbers of taggers. This implies the
  2500. // structure of the virtual DOM has changed.
  2501. if (nesting && xTaggers.length !== yTaggers.length)
  2502. {
  2503. _VirtualDom_pushPatch(patches, 0, index, y);
  2504. return;
  2505. }
  2506. // check if taggers are "the same"
  2507. if (nesting ? !_VirtualDom_pairwiseRefEqual(xTaggers, yTaggers) : xTaggers !== yTaggers)
  2508. {
  2509. _VirtualDom_pushPatch(patches, 2, index, yTaggers);
  2510. }
  2511. // diff everything below the taggers
  2512. _VirtualDom_diffHelp(xSubNode, ySubNode, patches, index + 1);
  2513. return;
  2514. case 0:
  2515. if (x.a !== y.a)
  2516. {
  2517. _VirtualDom_pushPatch(patches, 3, index, y.a);
  2518. }
  2519. return;
  2520. case 1:
  2521. _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKids);
  2522. return;
  2523. case 2:
  2524. _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKeyedKids);
  2525. return;
  2526. case 3:
  2527. if (x.h !== y.h)
  2528. {
  2529. _VirtualDom_pushPatch(patches, 0, index, y);
  2530. return;
  2531. }
  2532. var factsDiff = _VirtualDom_diffFacts(x.d, y.d);
  2533. factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff);
  2534. var patch = y.i(x.g, y.g);
  2535. patch && _VirtualDom_pushPatch(patches, 5, index, patch);
  2536. return;
  2537. }
  2538. }
  2539. // assumes the incoming arrays are the same length
  2540. function _VirtualDom_pairwiseRefEqual(as, bs)
  2541. {
  2542. for (var i = 0; i < as.length; i++)
  2543. {
  2544. if (as[i] !== bs[i])
  2545. {
  2546. return false;
  2547. }
  2548. }
  2549. return true;
  2550. }
  2551. function _VirtualDom_diffNodes(x, y, patches, index, diffKids)
  2552. {
  2553. // Bail if obvious indicators have changed. Implies more serious
  2554. // structural changes such that it's not worth it to diff.
  2555. if (x.c !== y.c || x.f !== y.f)
  2556. {
  2557. _VirtualDom_pushPatch(patches, 0, index, y);
  2558. return;
  2559. }
  2560. var factsDiff = _VirtualDom_diffFacts(x.d, y.d);
  2561. factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff);
  2562. diffKids(x, y, patches, index);
  2563. }
  2564. // DIFF FACTS
  2565. // TODO Instead of creating a new diff object, it's possible to just test if
  2566. // there *is* a diff. During the actual patch, do the diff again and make the
  2567. // modifications directly. This way, there's no new allocations. Worth it?
  2568. function _VirtualDom_diffFacts(x, y, category)
  2569. {
  2570. var diff;
  2571. // look for changes and removals
  2572. for (var xKey in x)
  2573. {
  2574. if (xKey === 'a1' || xKey === 'a0' || xKey === 'a3' || xKey === 'a4')
  2575. {
  2576. var subDiff = _VirtualDom_diffFacts(x[xKey], y[xKey] || {}, xKey);
  2577. if (subDiff)
  2578. {
  2579. diff = diff || {};
  2580. diff[xKey] = subDiff;
  2581. }
  2582. continue;
  2583. }
  2584. // remove if not in the new facts
  2585. if (!(xKey in y))
  2586. {
  2587. diff = diff || {};
  2588. diff[xKey] =
  2589. !category
  2590. ? (typeof x[xKey] === 'string' ? '' : null)
  2591. :
  2592. (category === 'a1')
  2593. ? ''
  2594. :
  2595. (category === 'a0' || category === 'a3')
  2596. ? undefined
  2597. :
  2598. { f: x[xKey].f, o: undefined };
  2599. continue;
  2600. }
  2601. var xValue = x[xKey];
  2602. var yValue = y[xKey];
  2603. // reference equal, so don't worry about it
  2604. if (xValue === yValue && xKey !== 'value' && xKey !== 'checked'
  2605. || category === 'a0' && _VirtualDom_equalEvents(xValue, yValue))
  2606. {
  2607. continue;
  2608. }
  2609. diff = diff || {};
  2610. diff[xKey] = yValue;
  2611. }
  2612. // add new stuff
  2613. for (var yKey in y)
  2614. {
  2615. if (!(yKey in x))
  2616. {
  2617. diff = diff || {};
  2618. diff[yKey] = y[yKey];
  2619. }
  2620. }
  2621. return diff;
  2622. }
  2623. // DIFF KIDS
  2624. function _VirtualDom_diffKids(xParent, yParent, patches, index)
  2625. {
  2626. var xKids = xParent.e;
  2627. var yKids = yParent.e;
  2628. var xLen = xKids.length;
  2629. var yLen = yKids.length;
  2630. // FIGURE OUT IF THERE ARE INSERTS OR REMOVALS
  2631. if (xLen > yLen)
  2632. {
  2633. _VirtualDom_pushPatch(patches, 6, index, {
  2634. v: yLen,
  2635. i: xLen - yLen
  2636. });
  2637. }
  2638. else if (xLen < yLen)
  2639. {
  2640. _VirtualDom_pushPatch(patches, 7, index, {
  2641. v: xLen,
  2642. e: yKids
  2643. });
  2644. }
  2645. // PAIRWISE DIFF EVERYTHING ELSE
  2646. for (var minLen = xLen < yLen ? xLen : yLen, i = 0; i < minLen; i++)
  2647. {
  2648. var xKid = xKids[i];
  2649. _VirtualDom_diffHelp(xKid, yKids[i], patches, ++index);
  2650. index += xKid.b || 0;
  2651. }
  2652. }
  2653. // KEYED DIFF
  2654. function _VirtualDom_diffKeyedKids(xParent, yParent, patches, rootIndex)
  2655. {
  2656. var localPatches = [];
  2657. var changes = {}; // Dict String Entry
  2658. var inserts = []; // Array { index : Int, entry : Entry }
  2659. // type Entry = { tag : String, vnode : VNode, index : Int, data : _ }
  2660. var xKids = xParent.e;
  2661. var yKids = yParent.e;
  2662. var xLen = xKids.length;
  2663. var yLen = yKids.length;
  2664. var xIndex = 0;
  2665. var yIndex = 0;
  2666. var index = rootIndex;
  2667. while (xIndex < xLen && yIndex < yLen)
  2668. {
  2669. var x = xKids[xIndex];
  2670. var y = yKids[yIndex];
  2671. var xKey = x.a;
  2672. var yKey = y.a;
  2673. var xNode = x.b;
  2674. var yNode = y.b;
  2675. var newMatch = undefined;
  2676. var oldMatch = undefined;
  2677. // check if keys match
  2678. if (xKey === yKey)
  2679. {
  2680. index++;
  2681. _VirtualDom_diffHelp(xNode, yNode, localPatches, index);
  2682. index += xNode.b || 0;
  2683. xIndex++;
  2684. yIndex++;
  2685. continue;
  2686. }
  2687. // look ahead 1 to detect insertions and removals.
  2688. var xNext = xKids[xIndex + 1];
  2689. var yNext = yKids[yIndex + 1];
  2690. if (xNext)
  2691. {
  2692. var xNextKey = xNext.a;
  2693. var xNextNode = xNext.b;
  2694. oldMatch = yKey === xNextKey;
  2695. }
  2696. if (yNext)
  2697. {
  2698. var yNextKey = yNext.a;
  2699. var yNextNode = yNext.b;
  2700. newMatch = xKey === yNextKey;
  2701. }
  2702. // swap x and y
  2703. if (newMatch && oldMatch)
  2704. {
  2705. index++;
  2706. _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index);
  2707. _VirtualDom_insertNode(changes, localPatches, xKey, yNode, yIndex, inserts);
  2708. index += xNode.b || 0;
  2709. index++;
  2710. _VirtualDom_removeNode(changes, localPatches, xKey, xNextNode, index);
  2711. index += xNextNode.b || 0;
  2712. xIndex += 2;
  2713. yIndex += 2;
  2714. continue;
  2715. }
  2716. // insert y
  2717. if (newMatch)
  2718. {
  2719. index++;
  2720. _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts);
  2721. _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index);
  2722. index += xNode.b || 0;
  2723. xIndex += 1;
  2724. yIndex += 2;
  2725. continue;
  2726. }
  2727. // remove x
  2728. if (oldMatch)
  2729. {
  2730. index++;
  2731. _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index);
  2732. index += xNode.b || 0;
  2733. index++;
  2734. _VirtualDom_diffHelp(xNextNode, yNode, localPatches, index);
  2735. index += xNextNode.b || 0;
  2736. xIndex += 2;
  2737. yIndex += 1;
  2738. continue;
  2739. }
  2740. // remove x, insert y
  2741. if (xNext && xNextKey === yNextKey)
  2742. {
  2743. index++;
  2744. _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index);
  2745. _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts);
  2746. index += xNode.b || 0;
  2747. index++;
  2748. _VirtualDom_diffHelp(xNextNode, yNextNode, localPatches, index);
  2749. index += xNextNode.b || 0;
  2750. xIndex += 2;
  2751. yIndex += 2;
  2752. continue;
  2753. }
  2754. break;
  2755. }
  2756. // eat up any remaining nodes with removeNode and insertNode
  2757. while (xIndex < xLen)
  2758. {
  2759. index++;
  2760. var x = xKids[xIndex];
  2761. var xNode = x.b;
  2762. _VirtualDom_removeNode(changes, localPatches, x.a, xNode, index);
  2763. index += xNode.b || 0;
  2764. xIndex++;
  2765. }
  2766. while (yIndex < yLen)
  2767. {
  2768. var endInserts = endInserts || [];
  2769. var y = yKids[yIndex];
  2770. _VirtualDom_insertNode(changes, localPatches, y.a, y.b, undefined, endInserts);
  2771. yIndex++;
  2772. }
  2773. if (localPatches.length > 0 || inserts.length > 0 || endInserts)
  2774. {
  2775. _VirtualDom_pushPatch(patches, 8, rootIndex, {
  2776. w: localPatches,
  2777. x: inserts,
  2778. y: endInserts
  2779. });
  2780. }
  2781. }
  2782. // CHANGES FROM KEYED DIFF
  2783. var _VirtualDom_POSTFIX = '_elmW6BL';
  2784. function _VirtualDom_insertNode(changes, localPatches, key, vnode, yIndex, inserts)
  2785. {
  2786. var entry = changes[key];
  2787. // never seen this key before
  2788. if (!entry)
  2789. {
  2790. entry = {
  2791. c: 0,
  2792. z: vnode,
  2793. r: yIndex,
  2794. s: undefined
  2795. };
  2796. inserts.push({ r: yIndex, A: entry });
  2797. changes[key] = entry;
  2798. return;
  2799. }
  2800. // this key was removed earlier, a match!
  2801. if (entry.c === 1)
  2802. {
  2803. inserts.push({ r: yIndex, A: entry });
  2804. entry.c = 2;
  2805. var subPatches = [];
  2806. _VirtualDom_diffHelp(entry.z, vnode, subPatches, entry.r);
  2807. entry.r = yIndex;
  2808. entry.s.s = {
  2809. w: subPatches,
  2810. A: entry
  2811. };
  2812. return;
  2813. }
  2814. // this key has already been inserted or moved, a duplicate!
  2815. _VirtualDom_insertNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, yIndex, inserts);
  2816. }
  2817. function _VirtualDom_removeNode(changes, localPatches, key, vnode, index)
  2818. {
  2819. var entry = changes[key];
  2820. // never seen this key before
  2821. if (!entry)
  2822. {
  2823. var patch = _VirtualDom_pushPatch(localPatches, 9, index, undefined);
  2824. changes[key] = {
  2825. c: 1,
  2826. z: vnode,
  2827. r: index,
  2828. s: patch
  2829. };
  2830. return;
  2831. }
  2832. // this key was inserted earlier, a match!
  2833. if (entry.c === 0)
  2834. {
  2835. entry.c = 2;
  2836. var subPatches = [];
  2837. _VirtualDom_diffHelp(vnode, entry.z, subPatches, index);
  2838. _VirtualDom_pushPatch(localPatches, 9, index, {
  2839. w: subPatches,
  2840. A: entry
  2841. });
  2842. return;
  2843. }
  2844. // this key has already been removed or moved, a duplicate!
  2845. _VirtualDom_removeNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, index);
  2846. }
  2847. // ADD DOM NODES
  2848. //
  2849. // Each DOM node has an "index" assigned in order of traversal. It is important
  2850. // to minimize our crawl over the actual DOM, so these indexes (along with the
  2851. // descendantsCount of virtual nodes) let us skip touching entire subtrees of
  2852. // the DOM if we know there are no patches there.
  2853. function _VirtualDom_addDomNodes(domNode, vNode, patches, eventNode)
  2854. {
  2855. _VirtualDom_addDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.b, eventNode);
  2856. }
  2857. // assumes `patches` is non-empty and indexes increase monotonically.
  2858. function _VirtualDom_addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode)
  2859. {
  2860. var patch = patches[i];
  2861. var index = patch.r;
  2862. while (index === low)
  2863. {
  2864. var patchType = patch.$;
  2865. if (patchType === 1)
  2866. {
  2867. _VirtualDom_addDomNodes(domNode, vNode.k, patch.s, eventNode);
  2868. }
  2869. else if (patchType === 8)
  2870. {
  2871. patch.t = domNode;
  2872. patch.u = eventNode;
  2873. var subPatches = patch.s.w;
  2874. if (subPatches.length > 0)
  2875. {
  2876. _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);
  2877. }
  2878. }
  2879. else if (patchType === 9)
  2880. {
  2881. patch.t = domNode;
  2882. patch.u = eventNode;
  2883. var data = patch.s;
  2884. if (data)
  2885. {
  2886. data.A.s = domNode;
  2887. var subPatches = data.w;
  2888. if (subPatches.length > 0)
  2889. {
  2890. _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);
  2891. }
  2892. }
  2893. }
  2894. else
  2895. {
  2896. patch.t = domNode;
  2897. patch.u = eventNode;
  2898. }
  2899. i++;
  2900. if (!(patch = patches[i]) || (index = patch.r) > high)
  2901. {
  2902. return i;
  2903. }
  2904. }
  2905. var tag = vNode.$;
  2906. if (tag === 4)
  2907. {
  2908. var subNode = vNode.k;
  2909. while (subNode.$ === 4)
  2910. {
  2911. subNode = subNode.k;
  2912. }
  2913. return _VirtualDom_addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, domNode.elm_event_node_ref);
  2914. }
  2915. // tag must be 1 or 2 at this point
  2916. var vKids = vNode.e;
  2917. var childNodes = domNode.childNodes;
  2918. for (var j = 0; j < vKids.length; j++)
  2919. {
  2920. low++;
  2921. var vKid = tag === 1 ? vKids[j] : vKids[j].b;
  2922. var nextLow = low + (vKid.b || 0);
  2923. if (low <= index && index <= nextLow)
  2924. {
  2925. i = _VirtualDom_addDomNodesHelp(childNodes[j], vKid, patches, i, low, nextLow, eventNode);
  2926. if (!(patch = patches[i]) || (index = patch.r) > high)
  2927. {
  2928. return i;
  2929. }
  2930. }
  2931. low = nextLow;
  2932. }
  2933. return i;
  2934. }
  2935. // APPLY PATCHES
  2936. function _VirtualDom_applyPatches(rootDomNode, oldVirtualNode, patches, eventNode)
  2937. {
  2938. if (patches.length === 0)
  2939. {
  2940. return rootDomNode;
  2941. }
  2942. _VirtualDom_addDomNodes(rootDomNode, oldVirtualNode, patches, eventNode);
  2943. return _VirtualDom_applyPatchesHelp(rootDomNode, patches);
  2944. }
  2945. function _VirtualDom_applyPatchesHelp(rootDomNode, patches)
  2946. {
  2947. for (var i = 0; i < patches.length; i++)
  2948. {
  2949. var patch = patches[i];
  2950. var localDomNode = patch.t
  2951. var newNode = _VirtualDom_applyPatch(localDomNode, patch);
  2952. if (localDomNode === rootDomNode)
  2953. {
  2954. rootDomNode = newNode;
  2955. }
  2956. }
  2957. return rootDomNode;
  2958. }
  2959. function _VirtualDom_applyPatch(domNode, patch)
  2960. {
  2961. switch (patch.$)
  2962. {
  2963. case 0:
  2964. return _VirtualDom_applyPatchRedraw(domNode, patch.s, patch.u);
  2965. case 4:
  2966. _VirtualDom_applyFacts(domNode, patch.u, patch.s);
  2967. return domNode;
  2968. case 3:
  2969. domNode.replaceData(0, domNode.length, patch.s);
  2970. return domNode;
  2971. case 1:
  2972. return _VirtualDom_applyPatchesHelp(domNode, patch.s);
  2973. case 2:
  2974. if (domNode.elm_event_node_ref)
  2975. {
  2976. domNode.elm_event_node_ref.j = patch.s;
  2977. }
  2978. else
  2979. {
  2980. domNode.elm_event_node_ref = { j: patch.s, p: patch.u };
  2981. }
  2982. return domNode;
  2983. case 6:
  2984. var data = patch.s;
  2985. for (var i = 0; i < data.i; i++)
  2986. {
  2987. domNode.removeChild(domNode.childNodes[data.v]);
  2988. }
  2989. return domNode;
  2990. case 7:
  2991. var data = patch.s;
  2992. var kids = data.e;
  2993. var i = data.v;
  2994. var theEnd = domNode.childNodes[i];
  2995. for (; i < kids.length; i++)
  2996. {
  2997. domNode.insertBefore(_VirtualDom_render(kids[i], patch.u), theEnd);
  2998. }
  2999. return domNode;
  3000. case 9:
  3001. var data = patch.s;
  3002. if (!data)
  3003. {
  3004. domNode.parentNode.removeChild(domNode);
  3005. return domNode;
  3006. }
  3007. var entry = data.A;
  3008. if (typeof entry.r !== 'undefined')
  3009. {
  3010. domNode.parentNode.removeChild(domNode);
  3011. }
  3012. entry.s = _VirtualDom_applyPatchesHelp(domNode, data.w);
  3013. return domNode;
  3014. case 8:
  3015. return _VirtualDom_applyPatchReorder(domNode, patch);
  3016. case 5:
  3017. return patch.s(domNode);
  3018. default:
  3019. _Debug_crash(10); // 'Ran into an unknown patch!'
  3020. }
  3021. }
  3022. function _VirtualDom_applyPatchRedraw(domNode, vNode, eventNode)
  3023. {
  3024. var parentNode = domNode.parentNode;
  3025. var newNode = _VirtualDom_render(vNode, eventNode);
  3026. if (!newNode.elm_event_node_ref)
  3027. {
  3028. newNode.elm_event_node_ref = domNode.elm_event_node_ref;
  3029. }
  3030. if (parentNode && newNode !== domNode)
  3031. {
  3032. parentNode.replaceChild(newNode, domNode);
  3033. }
  3034. return newNode;
  3035. }
  3036. function _VirtualDom_applyPatchReorder(domNode, patch)
  3037. {
  3038. var data = patch.s;
  3039. // remove end inserts
  3040. var frag = _VirtualDom_applyPatchReorderEndInsertsHelp(data.y, patch);
  3041. // removals
  3042. domNode = _VirtualDom_applyPatchesHelp(domNode, data.w);
  3043. // inserts
  3044. var inserts = data.x;
  3045. for (var i = 0; i < inserts.length; i++)
  3046. {
  3047. var insert = inserts[i];
  3048. var entry = insert.A;
  3049. var node = entry.c === 2
  3050. ? entry.s
  3051. : _VirtualDom_render(entry.z, patch.u);
  3052. domNode.insertBefore(node, domNode.childNodes[insert.r]);
  3053. }
  3054. // add end inserts
  3055. if (frag)
  3056. {
  3057. _VirtualDom_appendChild(domNode, frag);
  3058. }
  3059. return domNode;
  3060. }
  3061. function _VirtualDom_applyPatchReorderEndInsertsHelp(endInserts, patch)
  3062. {
  3063. if (!endInserts)
  3064. {
  3065. return;
  3066. }
  3067. var frag = _VirtualDom_doc.createDocumentFragment();
  3068. for (var i = 0; i < endInserts.length; i++)
  3069. {
  3070. var insert = endInserts[i];
  3071. var entry = insert.A;
  3072. _VirtualDom_appendChild(frag, entry.c === 2
  3073. ? entry.s
  3074. : _VirtualDom_render(entry.z, patch.u)
  3075. );
  3076. }
  3077. return frag;
  3078. }
  3079. function _VirtualDom_virtualize(node)
  3080. {
  3081. // TEXT NODES
  3082. if (node.nodeType === 3)
  3083. {
  3084. return _VirtualDom_text(node.textContent);
  3085. }
  3086. // WEIRD NODES
  3087. if (node.nodeType !== 1)
  3088. {
  3089. return _VirtualDom_text('');
  3090. }
  3091. // ELEMENT NODES
  3092. var attrList = _List_Nil;
  3093. var attrs = node.attributes;
  3094. for (var i = attrs.length; i--; )
  3095. {
  3096. var attr = attrs[i];
  3097. var name = attr.name;
  3098. var value = attr.value;
  3099. attrList = _List_Cons( A2(_VirtualDom_attribute, name, value), attrList );
  3100. }
  3101. var tag = node.tagName.toLowerCase();
  3102. var kidList = _List_Nil;
  3103. var kids = node.childNodes;
  3104. for (var i = kids.length; i--; )
  3105. {
  3106. kidList = _List_Cons(_VirtualDom_virtualize(kids[i]), kidList);
  3107. }
  3108. return A3(_VirtualDom_node, tag, attrList, kidList);
  3109. }
  3110. function _VirtualDom_dekey(keyedNode)
  3111. {
  3112. var keyedKids = keyedNode.e;
  3113. var len = keyedKids.length;
  3114. var kids = new Array(len);
  3115. for (var i = 0; i < len; i++)
  3116. {
  3117. kids[i] = keyedKids[i].b;
  3118. }
  3119. return {
  3120. $: 1,
  3121. c: keyedNode.c,
  3122. d: keyedNode.d,
  3123. e: kids,
  3124. f: keyedNode.f,
  3125. b: keyedNode.b
  3126. };
  3127. }
  3128. // ELEMENT
  3129. var _Debugger_element;
  3130. var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args)
  3131. {
  3132. return _Platform_initialize(
  3133. flagDecoder,
  3134. args,
  3135. impl.init,
  3136. impl.update,
  3137. impl.subscriptions,
  3138. function(sendToApp, initialModel) {
  3139. var view = impl.view;
  3140. /**_UNUSED/
  3141. var domNode = args['node'];
  3142. //*/
  3143. /**/
  3144. var domNode = args && args['node'] ? args['node'] : _Debug_crash(0);
  3145. //*/
  3146. var currNode = _VirtualDom_virtualize(domNode);
  3147. return _Browser_makeAnimator(initialModel, function(model)
  3148. {
  3149. var nextNode = view(model);
  3150. var patches = _VirtualDom_diff(currNode, nextNode);
  3151. domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp);
  3152. currNode = nextNode;
  3153. });
  3154. }
  3155. );
  3156. });
  3157. // DOCUMENT
  3158. var _Debugger_document;
  3159. var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args)
  3160. {
  3161. return _Platform_initialize(
  3162. flagDecoder,
  3163. args,
  3164. impl.init,
  3165. impl.update,
  3166. impl.subscriptions,
  3167. function(sendToApp, initialModel) {
  3168. var divertHrefToApp = impl.setup && impl.setup(sendToApp)
  3169. var view = impl.view;
  3170. var title = _VirtualDom_doc.title;
  3171. var bodyNode = _VirtualDom_doc.body;
  3172. var currNode = _VirtualDom_virtualize(bodyNode);
  3173. return _Browser_makeAnimator(initialModel, function(model)
  3174. {
  3175. _VirtualDom_divertHrefToApp = divertHrefToApp;
  3176. var doc = view(model);
  3177. var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.body);
  3178. var patches = _VirtualDom_diff(currNode, nextNode);
  3179. bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp);
  3180. currNode = nextNode;
  3181. _VirtualDom_divertHrefToApp = 0;
  3182. (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title);
  3183. });
  3184. }
  3185. );
  3186. });
  3187. // ANIMATION
  3188. var _Browser_cancelAnimationFrame =
  3189. typeof cancelAnimationFrame !== 'undefined'
  3190. ? cancelAnimationFrame
  3191. : function(id) { clearTimeout(id); };
  3192. var _Browser_requestAnimationFrame =
  3193. typeof requestAnimationFrame !== 'undefined'
  3194. ? requestAnimationFrame
  3195. : function(callback) { return setTimeout(callback, 1000 / 60); };
  3196. function _Browser_makeAnimator(model, draw)
  3197. {
  3198. draw(model);
  3199. var state = 0;
  3200. function updateIfNeeded()
  3201. {
  3202. state = state === 1
  3203. ? 0
  3204. : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 );
  3205. }
  3206. return function(nextModel, isSync)
  3207. {
  3208. model = nextModel;
  3209. isSync
  3210. ? ( draw(model),
  3211. state === 2 && (state = 1)
  3212. )
  3213. : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded),
  3214. state = 2
  3215. );
  3216. };
  3217. }
  3218. // APPLICATION
  3219. function _Browser_application(impl)
  3220. {
  3221. var onUrlChange = impl.onUrlChange;
  3222. var onUrlRequest = impl.onUrlRequest;
  3223. var key = function() { key.a(onUrlChange(_Browser_getUrl())); };
  3224. return _Browser_document({
  3225. setup: function(sendToApp)
  3226. {
  3227. key.a = sendToApp;
  3228. _Browser_window.addEventListener('popstate', key);
  3229. _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', key);
  3230. return F2(function(domNode, event)
  3231. {
  3232. if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download'))
  3233. {
  3234. event.preventDefault();
  3235. var href = domNode.href;
  3236. var curr = _Browser_getUrl();
  3237. var next = $elm$url$Url$fromString(href).a;
  3238. sendToApp(onUrlRequest(
  3239. (next
  3240. && curr.protocol === next.protocol
  3241. && curr.host === next.host
  3242. && curr.port_.a === next.port_.a
  3243. )
  3244. ? $elm$browser$Browser$Internal(next)
  3245. : $elm$browser$Browser$External(href)
  3246. ));
  3247. }
  3248. });
  3249. },
  3250. init: function(flags)
  3251. {
  3252. return A3(impl.init, flags, _Browser_getUrl(), key);
  3253. },
  3254. view: impl.view,
  3255. update: impl.update,
  3256. subscriptions: impl.subscriptions
  3257. });
  3258. }
  3259. function _Browser_getUrl()
  3260. {
  3261. return $elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1);
  3262. }
  3263. var _Browser_go = F2(function(key, n)
  3264. {
  3265. return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() {
  3266. n && history.go(n);
  3267. key();
  3268. }));
  3269. });
  3270. var _Browser_pushUrl = F2(function(key, url)
  3271. {
  3272. return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() {
  3273. history.pushState({}, '', url);
  3274. key();
  3275. }));
  3276. });
  3277. var _Browser_replaceUrl = F2(function(key, url)
  3278. {
  3279. return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() {
  3280. history.replaceState({}, '', url);
  3281. key();
  3282. }));
  3283. });
  3284. // GLOBAL EVENTS
  3285. var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} };
  3286. var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode;
  3287. var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode;
  3288. var _Browser_on = F3(function(node, eventName, sendToSelf)
  3289. {
  3290. return _Scheduler_spawn(_Scheduler_binding(function(callback)
  3291. {
  3292. function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); }
  3293. node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true });
  3294. return function() { node.removeEventListener(eventName, handler); };
  3295. }));
  3296. });
  3297. var _Browser_decodeEvent = F2(function(decoder, event)
  3298. {
  3299. var result = _Json_runHelp(decoder, event);
  3300. return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing;
  3301. });
  3302. // PAGE VISIBILITY
  3303. function _Browser_visibilityInfo()
  3304. {
  3305. return (typeof _VirtualDom_doc.hidden !== 'undefined')
  3306. ? { hidden: 'hidden', change: 'visibilitychange' }
  3307. :
  3308. (typeof _VirtualDom_doc.mozHidden !== 'undefined')
  3309. ? { hidden: 'mozHidden', change: 'mozvisibilitychange' }
  3310. :
  3311. (typeof _VirtualDom_doc.msHidden !== 'undefined')
  3312. ? { hidden: 'msHidden', change: 'msvisibilitychange' }
  3313. :
  3314. (typeof _VirtualDom_doc.webkitHidden !== 'undefined')
  3315. ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' }
  3316. : { hidden: 'hidden', change: 'visibilitychange' };
  3317. }
  3318. // ANIMATION FRAMES
  3319. function _Browser_rAF()
  3320. {
  3321. return _Scheduler_binding(function(callback)
  3322. {
  3323. var id = _Browser_requestAnimationFrame(function() {
  3324. callback(_Scheduler_succeed(Date.now()));
  3325. });
  3326. return function() {
  3327. _Browser_cancelAnimationFrame(id);
  3328. };
  3329. });
  3330. }
  3331. function _Browser_now()
  3332. {
  3333. return _Scheduler_binding(function(callback)
  3334. {
  3335. callback(_Scheduler_succeed(Date.now()));
  3336. });
  3337. }
  3338. // DOM STUFF
  3339. function _Browser_withNode(id, doStuff)
  3340. {
  3341. return _Scheduler_binding(function(callback)
  3342. {
  3343. _Browser_requestAnimationFrame(function() {
  3344. var node = document.getElementById(id);
  3345. callback(node
  3346. ? _Scheduler_succeed(doStuff(node))
  3347. : _Scheduler_fail($elm$browser$Browser$Dom$NotFound(id))
  3348. );
  3349. });
  3350. });
  3351. }
  3352. function _Browser_withWindow(doStuff)
  3353. {
  3354. return _Scheduler_binding(function(callback)
  3355. {
  3356. _Browser_requestAnimationFrame(function() {
  3357. callback(_Scheduler_succeed(doStuff()));
  3358. });
  3359. });
  3360. }
  3361. // FOCUS and BLUR
  3362. var _Browser_call = F2(function(functionName, id)
  3363. {
  3364. return _Browser_withNode(id, function(node) {
  3365. node[functionName]();
  3366. return _Utils_Tuple0;
  3367. });
  3368. });
  3369. // WINDOW VIEWPORT
  3370. function _Browser_getViewport()
  3371. {
  3372. return {
  3373. scene: _Browser_getScene(),
  3374. viewport: {
  3375. x: _Browser_window.pageXOffset,
  3376. y: _Browser_window.pageYOffset,
  3377. width: _Browser_doc.documentElement.clientWidth,
  3378. height: _Browser_doc.documentElement.clientHeight
  3379. }
  3380. };
  3381. }
  3382. function _Browser_getScene()
  3383. {
  3384. var body = _Browser_doc.body;
  3385. var elem = _Browser_doc.documentElement;
  3386. return {
  3387. width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth),
  3388. height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight)
  3389. };
  3390. }
  3391. var _Browser_setViewport = F2(function(x, y)
  3392. {
  3393. return _Browser_withWindow(function()
  3394. {
  3395. _Browser_window.scroll(x, y);
  3396. return _Utils_Tuple0;
  3397. });
  3398. });
  3399. // ELEMENT VIEWPORT
  3400. function _Browser_getViewportOf(id)
  3401. {
  3402. return _Browser_withNode(id, function(node)
  3403. {
  3404. return {
  3405. scene: {
  3406. width: node.scrollWidth,
  3407. height: node.scrollHeight
  3408. },
  3409. viewport: {
  3410. x: node.scrollLeft,
  3411. y: node.scrollTop,
  3412. width: node.clientWidth,
  3413. height: node.clientHeight
  3414. }
  3415. };
  3416. });
  3417. }
  3418. var _Browser_setViewportOf = F3(function(id, x, y)
  3419. {
  3420. return _Browser_withNode(id, function(node)
  3421. {
  3422. node.scrollLeft = x;
  3423. node.scrollTop = y;
  3424. return _Utils_Tuple0;
  3425. });
  3426. });
  3427. // ELEMENT
  3428. function _Browser_getElement(id)
  3429. {
  3430. return _Browser_withNode(id, function(node)
  3431. {
  3432. var rect = node.getBoundingClientRect();
  3433. var x = _Browser_window.pageXOffset;
  3434. var y = _Browser_window.pageYOffset;
  3435. return {
  3436. scene: _Browser_getScene(),
  3437. viewport: {
  3438. x: x,
  3439. y: y,
  3440. width: _Browser_doc.documentElement.clientWidth,
  3441. height: _Browser_doc.documentElement.clientHeight
  3442. },
  3443. element: {
  3444. x: x + rect.left,
  3445. y: y + rect.top,
  3446. width: rect.width,
  3447. height: rect.height
  3448. }
  3449. };
  3450. });
  3451. }
  3452. // LOAD and RELOAD
  3453. function _Browser_reload(skipCache)
  3454. {
  3455. return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback)
  3456. {
  3457. _VirtualDom_doc.location.reload(skipCache);
  3458. }));
  3459. }
  3460. function _Browser_load(url)
  3461. {
  3462. return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback)
  3463. {
  3464. try
  3465. {
  3466. _Browser_window.location = url;
  3467. }
  3468. catch(err)
  3469. {
  3470. // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here.
  3471. // Other browsers reload the page, so let's be consistent about that.
  3472. _VirtualDom_doc.location.reload(false);
  3473. }
  3474. }));
  3475. }
  3476. var $author$project$Main$init = {
  3477. character: {
  3478. abilities: {cha: 10, con: 10, dex: 10, _int: 10, str: 10, wis: 10},
  3479. name: 'Skadi the Brave'
  3480. },
  3481. name: 'STR',
  3482. val: 10
  3483. };
  3484. var $elm$core$Basics$EQ = {$: 'EQ'};
  3485. var $elm$core$Basics$GT = {$: 'GT'};
  3486. var $elm$core$Basics$LT = {$: 'LT'};
  3487. var $elm$core$List$cons = _List_cons;
  3488. var $elm$core$Dict$foldr = F3(
  3489. function (func, acc, t) {
  3490. foldr:
  3491. while (true) {
  3492. if (t.$ === 'RBEmpty_elm_builtin') {
  3493. return acc;
  3494. } else {
  3495. var key = t.b;
  3496. var value = t.c;
  3497. var left = t.d;
  3498. var right = t.e;
  3499. var $temp$func = func,
  3500. $temp$acc = A3(
  3501. func,
  3502. key,
  3503. value,
  3504. A3($elm$core$Dict$foldr, func, acc, right)),
  3505. $temp$t = left;
  3506. func = $temp$func;
  3507. acc = $temp$acc;
  3508. t = $temp$t;
  3509. continue foldr;
  3510. }
  3511. }
  3512. });
  3513. var $elm$core$Dict$toList = function (dict) {
  3514. return A3(
  3515. $elm$core$Dict$foldr,
  3516. F3(
  3517. function (key, value, list) {
  3518. return A2(
  3519. $elm$core$List$cons,
  3520. _Utils_Tuple2(key, value),
  3521. list);
  3522. }),
  3523. _List_Nil,
  3524. dict);
  3525. };
  3526. var $elm$core$Dict$keys = function (dict) {
  3527. return A3(
  3528. $elm$core$Dict$foldr,
  3529. F3(
  3530. function (key, value, keyList) {
  3531. return A2($elm$core$List$cons, key, keyList);
  3532. }),
  3533. _List_Nil,
  3534. dict);
  3535. };
  3536. var $elm$core$Set$toList = function (_v0) {
  3537. var dict = _v0.a;
  3538. return $elm$core$Dict$keys(dict);
  3539. };
  3540. var $elm$core$Elm$JsArray$foldr = _JsArray_foldr;
  3541. var $elm$core$Array$foldr = F3(
  3542. function (func, baseCase, _v0) {
  3543. var tree = _v0.c;
  3544. var tail = _v0.d;
  3545. var helper = F2(
  3546. function (node, acc) {
  3547. if (node.$ === 'SubTree') {
  3548. var subTree = node.a;
  3549. return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree);
  3550. } else {
  3551. var values = node.a;
  3552. return A3($elm$core$Elm$JsArray$foldr, func, acc, values);
  3553. }
  3554. });
  3555. return A3(
  3556. $elm$core$Elm$JsArray$foldr,
  3557. helper,
  3558. A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail),
  3559. tree);
  3560. });
  3561. var $elm$core$Array$toList = function (array) {
  3562. return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array);
  3563. };
  3564. var $elm$core$Result$Err = function (a) {
  3565. return {$: 'Err', a: a};
  3566. };
  3567. var $elm$json$Json$Decode$Failure = F2(
  3568. function (a, b) {
  3569. return {$: 'Failure', a: a, b: b};
  3570. });
  3571. var $elm$json$Json$Decode$Field = F2(
  3572. function (a, b) {
  3573. return {$: 'Field', a: a, b: b};
  3574. });
  3575. var $elm$json$Json$Decode$Index = F2(
  3576. function (a, b) {
  3577. return {$: 'Index', a: a, b: b};
  3578. });
  3579. var $elm$core$Result$Ok = function (a) {
  3580. return {$: 'Ok', a: a};
  3581. };
  3582. var $elm$json$Json$Decode$OneOf = function (a) {
  3583. return {$: 'OneOf', a: a};
  3584. };
  3585. var $elm$core$Basics$False = {$: 'False'};
  3586. var $elm$core$Basics$add = _Basics_add;
  3587. var $elm$core$Maybe$Just = function (a) {
  3588. return {$: 'Just', a: a};
  3589. };
  3590. var $elm$core$Maybe$Nothing = {$: 'Nothing'};
  3591. var $elm$core$String$all = _String_all;
  3592. var $elm$core$Basics$and = _Basics_and;
  3593. var $elm$core$Basics$append = _Utils_append;
  3594. var $elm$json$Json$Encode$encode = _Json_encode;
  3595. var $elm$core$String$fromInt = _String_fromNumber;
  3596. var $elm$core$String$join = F2(
  3597. function (sep, chunks) {
  3598. return A2(
  3599. _String_join,
  3600. sep,
  3601. _List_toArray(chunks));
  3602. });
  3603. var $elm$core$String$split = F2(
  3604. function (sep, string) {
  3605. return _List_fromArray(
  3606. A2(_String_split, sep, string));
  3607. });
  3608. var $elm$json$Json$Decode$indent = function (str) {
  3609. return A2(
  3610. $elm$core$String$join,
  3611. '\n ',
  3612. A2($elm$core$String$split, '\n', str));
  3613. };
  3614. var $elm$core$List$foldl = F3(
  3615. function (func, acc, list) {
  3616. foldl:
  3617. while (true) {
  3618. if (!list.b) {
  3619. return acc;
  3620. } else {
  3621. var x = list.a;
  3622. var xs = list.b;
  3623. var $temp$func = func,
  3624. $temp$acc = A2(func, x, acc),
  3625. $temp$list = xs;
  3626. func = $temp$func;
  3627. acc = $temp$acc;
  3628. list = $temp$list;
  3629. continue foldl;
  3630. }
  3631. }
  3632. });
  3633. var $elm$core$List$length = function (xs) {
  3634. return A3(
  3635. $elm$core$List$foldl,
  3636. F2(
  3637. function (_v0, i) {
  3638. return i + 1;
  3639. }),
  3640. 0,
  3641. xs);
  3642. };
  3643. var $elm$core$List$map2 = _List_map2;
  3644. var $elm$core$Basics$le = _Utils_le;
  3645. var $elm$core$Basics$sub = _Basics_sub;
  3646. var $elm$core$List$rangeHelp = F3(
  3647. function (lo, hi, list) {
  3648. rangeHelp:
  3649. while (true) {
  3650. if (_Utils_cmp(lo, hi) < 1) {
  3651. var $temp$lo = lo,
  3652. $temp$hi = hi - 1,
  3653. $temp$list = A2($elm$core$List$cons, hi, list);
  3654. lo = $temp$lo;
  3655. hi = $temp$hi;
  3656. list = $temp$list;
  3657. continue rangeHelp;
  3658. } else {
  3659. return list;
  3660. }
  3661. }
  3662. });
  3663. var $elm$core$List$range = F2(
  3664. function (lo, hi) {
  3665. return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil);
  3666. });
  3667. var $elm$core$List$indexedMap = F2(
  3668. function (f, xs) {
  3669. return A3(
  3670. $elm$core$List$map2,
  3671. f,
  3672. A2(
  3673. $elm$core$List$range,
  3674. 0,
  3675. $elm$core$List$length(xs) - 1),
  3676. xs);
  3677. });
  3678. var $elm$core$Char$toCode = _Char_toCode;
  3679. var $elm$core$Char$isLower = function (_char) {
  3680. var code = $elm$core$Char$toCode(_char);
  3681. return (97 <= code) && (code <= 122);
  3682. };
  3683. var $elm$core$Char$isUpper = function (_char) {
  3684. var code = $elm$core$Char$toCode(_char);
  3685. return (code <= 90) && (65 <= code);
  3686. };
  3687. var $elm$core$Basics$or = _Basics_or;
  3688. var $elm$core$Char$isAlpha = function (_char) {
  3689. return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char);
  3690. };
  3691. var $elm$core$Char$isDigit = function (_char) {
  3692. var code = $elm$core$Char$toCode(_char);
  3693. return (code <= 57) && (48 <= code);
  3694. };
  3695. var $elm$core$Char$isAlphaNum = function (_char) {
  3696. return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char));
  3697. };
  3698. var $elm$core$List$reverse = function (list) {
  3699. return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list);
  3700. };
  3701. var $elm$core$String$uncons = _String_uncons;
  3702. var $elm$json$Json$Decode$errorOneOf = F2(
  3703. function (i, error) {
  3704. return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent(
  3705. $elm$json$Json$Decode$errorToString(error))));
  3706. });
  3707. var $elm$json$Json$Decode$errorToString = function (error) {
  3708. return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil);
  3709. };
  3710. var $elm$json$Json$Decode$errorToStringHelp = F2(
  3711. function (error, context) {
  3712. errorToStringHelp:
  3713. while (true) {
  3714. switch (error.$) {
  3715. case 'Field':
  3716. var f = error.a;
  3717. var err = error.b;
  3718. var isSimple = function () {
  3719. var _v1 = $elm$core$String$uncons(f);
  3720. if (_v1.$ === 'Nothing') {
  3721. return false;
  3722. } else {
  3723. var _v2 = _v1.a;
  3724. var _char = _v2.a;
  3725. var rest = _v2.b;
  3726. return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest);
  3727. }
  3728. }();
  3729. var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']'));
  3730. var $temp$error = err,
  3731. $temp$context = A2($elm$core$List$cons, fieldName, context);
  3732. error = $temp$error;
  3733. context = $temp$context;
  3734. continue errorToStringHelp;
  3735. case 'Index':
  3736. var i = error.a;
  3737. var err = error.b;
  3738. var indexName = '[' + ($elm$core$String$fromInt(i) + ']');
  3739. var $temp$error = err,
  3740. $temp$context = A2($elm$core$List$cons, indexName, context);
  3741. error = $temp$error;
  3742. context = $temp$context;
  3743. continue errorToStringHelp;
  3744. case 'OneOf':
  3745. var errors = error.a;
  3746. if (!errors.b) {
  3747. return 'Ran into a Json.Decode.oneOf with no possibilities' + function () {
  3748. if (!context.b) {
  3749. return '!';
  3750. } else {
  3751. return ' at json' + A2(
  3752. $elm$core$String$join,
  3753. '',
  3754. $elm$core$List$reverse(context));
  3755. }
  3756. }();
  3757. } else {
  3758. if (!errors.b.b) {
  3759. var err = errors.a;
  3760. var $temp$error = err,
  3761. $temp$context = context;
  3762. error = $temp$error;
  3763. context = $temp$context;
  3764. continue errorToStringHelp;
  3765. } else {
  3766. var starter = function () {
  3767. if (!context.b) {
  3768. return 'Json.Decode.oneOf';
  3769. } else {
  3770. return 'The Json.Decode.oneOf at json' + A2(
  3771. $elm$core$String$join,
  3772. '',
  3773. $elm$core$List$reverse(context));
  3774. }
  3775. }();
  3776. var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt(
  3777. $elm$core$List$length(errors)) + ' ways:'));
  3778. return A2(
  3779. $elm$core$String$join,
  3780. '\n\n',
  3781. A2(
  3782. $elm$core$List$cons,
  3783. introduction,
  3784. A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors)));
  3785. }
  3786. }
  3787. default:
  3788. var msg = error.a;
  3789. var json = error.b;
  3790. var introduction = function () {
  3791. if (!context.b) {
  3792. return 'Problem with the given value:\n\n';
  3793. } else {
  3794. return 'Problem with the value at json' + (A2(
  3795. $elm$core$String$join,
  3796. '',
  3797. $elm$core$List$reverse(context)) + ':\n\n ');
  3798. }
  3799. }();
  3800. return introduction + ($elm$json$Json$Decode$indent(
  3801. A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg));
  3802. }
  3803. }
  3804. });
  3805. var $elm$core$Array$branchFactor = 32;
  3806. var $elm$core$Array$Array_elm_builtin = F4(
  3807. function (a, b, c, d) {
  3808. return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d};
  3809. });
  3810. var $elm$core$Elm$JsArray$empty = _JsArray_empty;
  3811. var $elm$core$Basics$ceiling = _Basics_ceiling;
  3812. var $elm$core$Basics$fdiv = _Basics_fdiv;
  3813. var $elm$core$Basics$logBase = F2(
  3814. function (base, number) {
  3815. return _Basics_log(number) / _Basics_log(base);
  3816. });
  3817. var $elm$core$Basics$toFloat = _Basics_toFloat;
  3818. var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling(
  3819. A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor));
  3820. var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty);
  3821. var $elm$core$Elm$JsArray$initialize = _JsArray_initialize;
  3822. var $elm$core$Array$Leaf = function (a) {
  3823. return {$: 'Leaf', a: a};
  3824. };
  3825. var $elm$core$Basics$apL = F2(
  3826. function (f, x) {
  3827. return f(x);
  3828. });
  3829. var $elm$core$Basics$apR = F2(
  3830. function (x, f) {
  3831. return f(x);
  3832. });
  3833. var $elm$core$Basics$eq = _Utils_equal;
  3834. var $elm$core$Basics$floor = _Basics_floor;
  3835. var $elm$core$Elm$JsArray$length = _JsArray_length;
  3836. var $elm$core$Basics$gt = _Utils_gt;
  3837. var $elm$core$Basics$max = F2(
  3838. function (x, y) {
  3839. return (_Utils_cmp(x, y) > 0) ? x : y;
  3840. });
  3841. var $elm$core$Basics$mul = _Basics_mul;
  3842. var $elm$core$Array$SubTree = function (a) {
  3843. return {$: 'SubTree', a: a};
  3844. };
  3845. var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList;
  3846. var $elm$core$Array$compressNodes = F2(
  3847. function (nodes, acc) {
  3848. compressNodes:
  3849. while (true) {
  3850. var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes);
  3851. var node = _v0.a;
  3852. var remainingNodes = _v0.b;
  3853. var newAcc = A2(
  3854. $elm$core$List$cons,
  3855. $elm$core$Array$SubTree(node),
  3856. acc);
  3857. if (!remainingNodes.b) {
  3858. return $elm$core$List$reverse(newAcc);
  3859. } else {
  3860. var $temp$nodes = remainingNodes,
  3861. $temp$acc = newAcc;
  3862. nodes = $temp$nodes;
  3863. acc = $temp$acc;
  3864. continue compressNodes;
  3865. }
  3866. }
  3867. });
  3868. var $elm$core$Tuple$first = function (_v0) {
  3869. var x = _v0.a;
  3870. return x;
  3871. };
  3872. var $elm$core$Array$treeFromBuilder = F2(
  3873. function (nodeList, nodeListSize) {
  3874. treeFromBuilder:
  3875. while (true) {
  3876. var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor);
  3877. if (newNodeSize === 1) {
  3878. return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a;
  3879. } else {
  3880. var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil),
  3881. $temp$nodeListSize = newNodeSize;
  3882. nodeList = $temp$nodeList;
  3883. nodeListSize = $temp$nodeListSize;
  3884. continue treeFromBuilder;
  3885. }
  3886. }
  3887. });
  3888. var $elm$core$Array$builderToArray = F2(
  3889. function (reverseNodeList, builder) {
  3890. if (!builder.nodeListSize) {
  3891. return A4(
  3892. $elm$core$Array$Array_elm_builtin,
  3893. $elm$core$Elm$JsArray$length(builder.tail),
  3894. $elm$core$Array$shiftStep,
  3895. $elm$core$Elm$JsArray$empty,
  3896. builder.tail);
  3897. } else {
  3898. var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor;
  3899. var depth = $elm$core$Basics$floor(
  3900. A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1));
  3901. var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList;
  3902. var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize);
  3903. return A4(
  3904. $elm$core$Array$Array_elm_builtin,
  3905. $elm$core$Elm$JsArray$length(builder.tail) + treeLen,
  3906. A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep),
  3907. tree,
  3908. builder.tail);
  3909. }
  3910. });
  3911. var $elm$core$Basics$idiv = _Basics_idiv;
  3912. var $elm$core$Basics$lt = _Utils_lt;
  3913. var $elm$core$Array$initializeHelp = F5(
  3914. function (fn, fromIndex, len, nodeList, tail) {
  3915. initializeHelp:
  3916. while (true) {
  3917. if (fromIndex < 0) {
  3918. return A2(
  3919. $elm$core$Array$builderToArray,
  3920. false,
  3921. {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail});
  3922. } else {
  3923. var leaf = $elm$core$Array$Leaf(
  3924. A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn));
  3925. var $temp$fn = fn,
  3926. $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor,
  3927. $temp$len = len,
  3928. $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList),
  3929. $temp$tail = tail;
  3930. fn = $temp$fn;
  3931. fromIndex = $temp$fromIndex;
  3932. len = $temp$len;
  3933. nodeList = $temp$nodeList;
  3934. tail = $temp$tail;
  3935. continue initializeHelp;
  3936. }
  3937. }
  3938. });
  3939. var $elm$core$Basics$remainderBy = _Basics_remainderBy;
  3940. var $elm$core$Array$initialize = F2(
  3941. function (len, fn) {
  3942. if (len <= 0) {
  3943. return $elm$core$Array$empty;
  3944. } else {
  3945. var tailLen = len % $elm$core$Array$branchFactor;
  3946. var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn);
  3947. var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor;
  3948. return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail);
  3949. }
  3950. });
  3951. var $elm$core$Basics$True = {$: 'True'};
  3952. var $elm$core$Result$isOk = function (result) {
  3953. if (result.$ === 'Ok') {
  3954. return true;
  3955. } else {
  3956. return false;
  3957. }
  3958. };
  3959. var $elm$json$Json$Decode$map = _Json_map1;
  3960. var $elm$json$Json$Decode$map2 = _Json_map2;
  3961. var $elm$json$Json$Decode$succeed = _Json_succeed;
  3962. var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) {
  3963. switch (handler.$) {
  3964. case 'Normal':
  3965. return 0;
  3966. case 'MayStopPropagation':
  3967. return 1;
  3968. case 'MayPreventDefault':
  3969. return 2;
  3970. default:
  3971. return 3;
  3972. }
  3973. };
  3974. var $elm$browser$Browser$External = function (a) {
  3975. return {$: 'External', a: a};
  3976. };
  3977. var $elm$browser$Browser$Internal = function (a) {
  3978. return {$: 'Internal', a: a};
  3979. };
  3980. var $elm$core$Basics$identity = function (x) {
  3981. return x;
  3982. };
  3983. var $elm$browser$Browser$Dom$NotFound = function (a) {
  3984. return {$: 'NotFound', a: a};
  3985. };
  3986. var $elm$url$Url$Http = {$: 'Http'};
  3987. var $elm$url$Url$Https = {$: 'Https'};
  3988. var $elm$url$Url$Url = F6(
  3989. function (protocol, host, port_, path, query, fragment) {
  3990. return {fragment: fragment, host: host, path: path, port_: port_, protocol: protocol, query: query};
  3991. });
  3992. var $elm$core$String$contains = _String_contains;
  3993. var $elm$core$String$length = _String_length;
  3994. var $elm$core$String$slice = _String_slice;
  3995. var $elm$core$String$dropLeft = F2(
  3996. function (n, string) {
  3997. return (n < 1) ? string : A3(
  3998. $elm$core$String$slice,
  3999. n,
  4000. $elm$core$String$length(string),
  4001. string);
  4002. });
  4003. var $elm$core$String$indexes = _String_indexes;
  4004. var $elm$core$String$isEmpty = function (string) {
  4005. return string === '';
  4006. };
  4007. var $elm$core$String$left = F2(
  4008. function (n, string) {
  4009. return (n < 1) ? '' : A3($elm$core$String$slice, 0, n, string);
  4010. });
  4011. var $elm$core$String$toInt = _String_toInt;
  4012. var $elm$url$Url$chompBeforePath = F5(
  4013. function (protocol, path, params, frag, str) {
  4014. if ($elm$core$String$isEmpty(str) || A2($elm$core$String$contains, '@', str)) {
  4015. return $elm$core$Maybe$Nothing;
  4016. } else {
  4017. var _v0 = A2($elm$core$String$indexes, ':', str);
  4018. if (!_v0.b) {
  4019. return $elm$core$Maybe$Just(
  4020. A6($elm$url$Url$Url, protocol, str, $elm$core$Maybe$Nothing, path, params, frag));
  4021. } else {
  4022. if (!_v0.b.b) {
  4023. var i = _v0.a;
  4024. var _v1 = $elm$core$String$toInt(
  4025. A2($elm$core$String$dropLeft, i + 1, str));
  4026. if (_v1.$ === 'Nothing') {
  4027. return $elm$core$Maybe$Nothing;
  4028. } else {
  4029. var port_ = _v1;
  4030. return $elm$core$Maybe$Just(
  4031. A6(
  4032. $elm$url$Url$Url,
  4033. protocol,
  4034. A2($elm$core$String$left, i, str),
  4035. port_,
  4036. path,
  4037. params,
  4038. frag));
  4039. }
  4040. } else {
  4041. return $elm$core$Maybe$Nothing;
  4042. }
  4043. }
  4044. }
  4045. });
  4046. var $elm$url$Url$chompBeforeQuery = F4(
  4047. function (protocol, params, frag, str) {
  4048. if ($elm$core$String$isEmpty(str)) {
  4049. return $elm$core$Maybe$Nothing;
  4050. } else {
  4051. var _v0 = A2($elm$core$String$indexes, '/', str);
  4052. if (!_v0.b) {
  4053. return A5($elm$url$Url$chompBeforePath, protocol, '/', params, frag, str);
  4054. } else {
  4055. var i = _v0.a;
  4056. return A5(
  4057. $elm$url$Url$chompBeforePath,
  4058. protocol,
  4059. A2($elm$core$String$dropLeft, i, str),
  4060. params,
  4061. frag,
  4062. A2($elm$core$String$left, i, str));
  4063. }
  4064. }
  4065. });
  4066. var $elm$url$Url$chompBeforeFragment = F3(
  4067. function (protocol, frag, str) {
  4068. if ($elm$core$String$isEmpty(str)) {
  4069. return $elm$core$Maybe$Nothing;
  4070. } else {
  4071. var _v0 = A2($elm$core$String$indexes, '?', str);
  4072. if (!_v0.b) {
  4073. return A4($elm$url$Url$chompBeforeQuery, protocol, $elm$core$Maybe$Nothing, frag, str);
  4074. } else {
  4075. var i = _v0.a;
  4076. return A4(
  4077. $elm$url$Url$chompBeforeQuery,
  4078. protocol,
  4079. $elm$core$Maybe$Just(
  4080. A2($elm$core$String$dropLeft, i + 1, str)),
  4081. frag,
  4082. A2($elm$core$String$left, i, str));
  4083. }
  4084. }
  4085. });
  4086. var $elm$url$Url$chompAfterProtocol = F2(
  4087. function (protocol, str) {
  4088. if ($elm$core$String$isEmpty(str)) {
  4089. return $elm$core$Maybe$Nothing;
  4090. } else {
  4091. var _v0 = A2($elm$core$String$indexes, '#', str);
  4092. if (!_v0.b) {
  4093. return A3($elm$url$Url$chompBeforeFragment, protocol, $elm$core$Maybe$Nothing, str);
  4094. } else {
  4095. var i = _v0.a;
  4096. return A3(
  4097. $elm$url$Url$chompBeforeFragment,
  4098. protocol,
  4099. $elm$core$Maybe$Just(
  4100. A2($elm$core$String$dropLeft, i + 1, str)),
  4101. A2($elm$core$String$left, i, str));
  4102. }
  4103. }
  4104. });
  4105. var $elm$core$String$startsWith = _String_startsWith;
  4106. var $elm$url$Url$fromString = function (str) {
  4107. return A2($elm$core$String$startsWith, 'http://', str) ? A2(
  4108. $elm$url$Url$chompAfterProtocol,
  4109. $elm$url$Url$Http,
  4110. A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2(
  4111. $elm$url$Url$chompAfterProtocol,
  4112. $elm$url$Url$Https,
  4113. A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing);
  4114. };
  4115. var $elm$core$Basics$never = function (_v0) {
  4116. never:
  4117. while (true) {
  4118. var nvr = _v0.a;
  4119. var $temp$_v0 = nvr;
  4120. _v0 = $temp$_v0;
  4121. continue never;
  4122. }
  4123. };
  4124. var $elm$core$Task$Perform = function (a) {
  4125. return {$: 'Perform', a: a};
  4126. };
  4127. var $elm$core$Task$succeed = _Scheduler_succeed;
  4128. var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0);
  4129. var $elm$core$List$foldrHelper = F4(
  4130. function (fn, acc, ctr, ls) {
  4131. if (!ls.b) {
  4132. return acc;
  4133. } else {
  4134. var a = ls.a;
  4135. var r1 = ls.b;
  4136. if (!r1.b) {
  4137. return A2(fn, a, acc);
  4138. } else {
  4139. var b = r1.a;
  4140. var r2 = r1.b;
  4141. if (!r2.b) {
  4142. return A2(
  4143. fn,
  4144. a,
  4145. A2(fn, b, acc));
  4146. } else {
  4147. var c = r2.a;
  4148. var r3 = r2.b;
  4149. if (!r3.b) {
  4150. return A2(
  4151. fn,
  4152. a,
  4153. A2(
  4154. fn,
  4155. b,
  4156. A2(fn, c, acc)));
  4157. } else {
  4158. var d = r3.a;
  4159. var r4 = r3.b;
  4160. var res = (ctr > 500) ? A3(
  4161. $elm$core$List$foldl,
  4162. fn,
  4163. acc,
  4164. $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4);
  4165. return A2(
  4166. fn,
  4167. a,
  4168. A2(
  4169. fn,
  4170. b,
  4171. A2(
  4172. fn,
  4173. c,
  4174. A2(fn, d, res))));
  4175. }
  4176. }
  4177. }
  4178. }
  4179. });
  4180. var $elm$core$List$foldr = F3(
  4181. function (fn, acc, ls) {
  4182. return A4($elm$core$List$foldrHelper, fn, acc, 0, ls);
  4183. });
  4184. var $elm$core$List$map = F2(
  4185. function (f, xs) {
  4186. return A3(
  4187. $elm$core$List$foldr,
  4188. F2(
  4189. function (x, acc) {
  4190. return A2(
  4191. $elm$core$List$cons,
  4192. f(x),
  4193. acc);
  4194. }),
  4195. _List_Nil,
  4196. xs);
  4197. });
  4198. var $elm$core$Task$andThen = _Scheduler_andThen;
  4199. var $elm$core$Task$map = F2(
  4200. function (func, taskA) {
  4201. return A2(
  4202. $elm$core$Task$andThen,
  4203. function (a) {
  4204. return $elm$core$Task$succeed(
  4205. func(a));
  4206. },
  4207. taskA);
  4208. });
  4209. var $elm$core$Task$map2 = F3(
  4210. function (func, taskA, taskB) {
  4211. return A2(
  4212. $elm$core$Task$andThen,
  4213. function (a) {
  4214. return A2(
  4215. $elm$core$Task$andThen,
  4216. function (b) {
  4217. return $elm$core$Task$succeed(
  4218. A2(func, a, b));
  4219. },
  4220. taskB);
  4221. },
  4222. taskA);
  4223. });
  4224. var $elm$core$Task$sequence = function (tasks) {
  4225. return A3(
  4226. $elm$core$List$foldr,
  4227. $elm$core$Task$map2($elm$core$List$cons),
  4228. $elm$core$Task$succeed(_List_Nil),
  4229. tasks);
  4230. };
  4231. var $elm$core$Platform$sendToApp = _Platform_sendToApp;
  4232. var $elm$core$Task$spawnCmd = F2(
  4233. function (router, _v0) {
  4234. var task = _v0.a;
  4235. return _Scheduler_spawn(
  4236. A2(
  4237. $elm$core$Task$andThen,
  4238. $elm$core$Platform$sendToApp(router),
  4239. task));
  4240. });
  4241. var $elm$core$Task$onEffects = F3(
  4242. function (router, commands, state) {
  4243. return A2(
  4244. $elm$core$Task$map,
  4245. function (_v0) {
  4246. return _Utils_Tuple0;
  4247. },
  4248. $elm$core$Task$sequence(
  4249. A2(
  4250. $elm$core$List$map,
  4251. $elm$core$Task$spawnCmd(router),
  4252. commands)));
  4253. });
  4254. var $elm$core$Task$onSelfMsg = F3(
  4255. function (_v0, _v1, _v2) {
  4256. return $elm$core$Task$succeed(_Utils_Tuple0);
  4257. });
  4258. var $elm$core$Task$cmdMap = F2(
  4259. function (tagger, _v0) {
  4260. var task = _v0.a;
  4261. return $elm$core$Task$Perform(
  4262. A2($elm$core$Task$map, tagger, task));
  4263. });
  4264. _Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap);
  4265. var $elm$core$Task$command = _Platform_leaf('Task');
  4266. var $elm$core$Task$perform = F2(
  4267. function (toMessage, task) {
  4268. return $elm$core$Task$command(
  4269. $elm$core$Task$Perform(
  4270. A2($elm$core$Task$map, toMessage, task)));
  4271. });
  4272. var $elm$core$Platform$Cmd$batch = _Platform_batch;
  4273. var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil);
  4274. var $elm$core$Platform$Sub$batch = _Platform_batch;
  4275. var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil);
  4276. var $elm$browser$Browser$sandbox = function (impl) {
  4277. return _Browser_element(
  4278. {
  4279. init: function (_v0) {
  4280. return _Utils_Tuple2(impl.init, $elm$core$Platform$Cmd$none);
  4281. },
  4282. subscriptions: function (_v1) {
  4283. return $elm$core$Platform$Sub$none;
  4284. },
  4285. update: F2(
  4286. function (msg, model) {
  4287. return _Utils_Tuple2(
  4288. A2(impl.update, msg, model),
  4289. $elm$core$Platform$Cmd$none);
  4290. }),
  4291. view: impl.view
  4292. });
  4293. };
  4294. var $author$project$Model$Strength = {$: 'Strength'};
  4295. var $author$project$Main$changeAbi = F3(
  4296. function (abilities, abi, x) {
  4297. if (abi.$ === 'Strength') {
  4298. return {cha: 10, con: 10, dex: 10, _int: 10, str: abilities.str + x, wis: 10};
  4299. } else {
  4300. return abilities;
  4301. }
  4302. });
  4303. var $author$project$Main$changeAbilities = F2(
  4304. function (model, abilities) {
  4305. return {
  4306. character: {abilities: abilities, name: model.character.name},
  4307. name: model.name,
  4308. val: model.val
  4309. };
  4310. });
  4311. var $author$project$Main$changeVal = F2(
  4312. function (model, x) {
  4313. return {character: model.character, name: model.name, val: model.val + x};
  4314. });
  4315. var $elm$core$Basics$negate = function (n) {
  4316. return -n;
  4317. };
  4318. var $author$project$Main$update = F2(
  4319. function (msg, model) {
  4320. switch (msg.$) {
  4321. case 'Increment':
  4322. return A2($author$project$Main$changeVal, model, 1);
  4323. case 'Decrement':
  4324. return A2($author$project$Main$changeVal, model, -1);
  4325. case 'IncrementStr':
  4326. return A2(
  4327. $author$project$Main$changeAbilities,
  4328. model,
  4329. A3($author$project$Main$changeAbi, model.character.abilities, $author$project$Model$Strength, 1));
  4330. default:
  4331. return A2(
  4332. $author$project$Main$changeAbilities,
  4333. model,
  4334. A3($author$project$Main$changeAbi, model.character.abilities, $author$project$Model$Strength, -1));
  4335. }
  4336. });
  4337. var $author$project$Msg$Decrement = {$: 'Decrement'};
  4338. var $author$project$Msg$DecrementStr = {$: 'DecrementStr'};
  4339. var $author$project$Msg$Increment = {$: 'Increment'};
  4340. var $author$project$Msg$IncrementStr = {$: 'IncrementStr'};
  4341. var $elm$html$Html$button = _VirtualDom_node('button');
  4342. var $elm$html$Html$div = _VirtualDom_node('div');
  4343. var $elm$html$Html$h1 = _VirtualDom_node('h1');
  4344. var $elm$html$Html$h2 = _VirtualDom_node('h2');
  4345. var $elm$html$Html$hr = _VirtualDom_node('hr');
  4346. var $elm$html$Html$li = _VirtualDom_node('li');
  4347. var $elm$virtual_dom$VirtualDom$Normal = function (a) {
  4348. return {$: 'Normal', a: a};
  4349. };
  4350. var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on;
  4351. var $elm$html$Html$Events$on = F2(
  4352. function (event, decoder) {
  4353. return A2(
  4354. $elm$virtual_dom$VirtualDom$on,
  4355. event,
  4356. $elm$virtual_dom$VirtualDom$Normal(decoder));
  4357. });
  4358. var $elm$html$Html$Events$onClick = function (msg) {
  4359. return A2(
  4360. $elm$html$Html$Events$on,
  4361. 'click',
  4362. $elm$json$Json$Decode$succeed(msg));
  4363. };
  4364. var $elm$html$Html$strong = _VirtualDom_node('strong');
  4365. var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text;
  4366. var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text;
  4367. var $elm$html$Html$ul = _VirtualDom_node('ul');
  4368. var $author$project$View$view = function (model) {
  4369. return A2(
  4370. $elm$html$Html$div,
  4371. _List_Nil,
  4372. _List_fromArray(
  4373. [
  4374. A2(
  4375. $elm$html$Html$button,
  4376. _List_fromArray(
  4377. [
  4378. $elm$html$Html$Events$onClick($author$project$Msg$Increment)
  4379. ]),
  4380. _List_fromArray(
  4381. [
  4382. $elm$html$Html$text('+')
  4383. ])),
  4384. A2(
  4385. $elm$html$Html$div,
  4386. _List_Nil,
  4387. _List_fromArray(
  4388. [
  4389. $elm$html$Html$text(
  4390. model.name + (':' + $elm$core$String$fromInt(model.val)))
  4391. ])),
  4392. A2(
  4393. $elm$html$Html$button,
  4394. _List_fromArray(
  4395. [
  4396. $elm$html$Html$Events$onClick($author$project$Msg$Decrement)
  4397. ]),
  4398. _List_fromArray(
  4399. [
  4400. $elm$html$Html$text('-')
  4401. ])),
  4402. A2($elm$html$Html$hr, _List_Nil, _List_Nil),
  4403. A2(
  4404. $elm$html$Html$h1,
  4405. _List_Nil,
  4406. _List_fromArray(
  4407. [
  4408. $elm$html$Html$text('Character Sheet')
  4409. ])),
  4410. A2(
  4411. $elm$html$Html$strong,
  4412. _List_Nil,
  4413. _List_fromArray(
  4414. [
  4415. $elm$html$Html$text(model.character.name)
  4416. ])),
  4417. A2(
  4418. $elm$html$Html$div,
  4419. _List_Nil,
  4420. _List_fromArray(
  4421. [
  4422. A2(
  4423. $elm$html$Html$h2,
  4424. _List_Nil,
  4425. _List_fromArray(
  4426. [
  4427. $elm$html$Html$text('Stats Misc 1')
  4428. ])),
  4429. A2(
  4430. $elm$html$Html$div,
  4431. _List_Nil,
  4432. _List_fromArray(
  4433. [
  4434. $elm$html$Html$text('Class:' + '__')
  4435. ])),
  4436. A2(
  4437. $elm$html$Html$div,
  4438. _List_Nil,
  4439. _List_fromArray(
  4440. [
  4441. $elm$html$Html$text('Level:' + '__')
  4442. ])),
  4443. A2(
  4444. $elm$html$Html$div,
  4445. _List_Nil,
  4446. _List_fromArray(
  4447. [
  4448. $elm$html$Html$text('Race:' + '__')
  4449. ])),
  4450. A2(
  4451. $elm$html$Html$div,
  4452. _List_Nil,
  4453. _List_fromArray(
  4454. [
  4455. $elm$html$Html$text('Alignment:' + '__')
  4456. ])),
  4457. A2(
  4458. $elm$html$Html$div,
  4459. _List_Nil,
  4460. _List_fromArray(
  4461. [
  4462. $elm$html$Html$text('Player:' + '__')
  4463. ])),
  4464. A2(
  4465. $elm$html$Html$div,
  4466. _List_Nil,
  4467. _List_fromArray(
  4468. [
  4469. $elm$html$Html$text('Exp Points:' + '__')
  4470. ])),
  4471. A2(
  4472. $elm$html$Html$div,
  4473. _List_Nil,
  4474. _List_fromArray(
  4475. [
  4476. $elm$html$Html$text('Faction:' + '__')
  4477. ]))
  4478. ])),
  4479. A2(
  4480. $elm$html$Html$div,
  4481. _List_Nil,
  4482. _List_fromArray(
  4483. [
  4484. A2(
  4485. $elm$html$Html$h2,
  4486. _List_Nil,
  4487. _List_fromArray(
  4488. [
  4489. $elm$html$Html$text('Stats Misc 2')
  4490. ])),
  4491. A2(
  4492. $elm$html$Html$div,
  4493. _List_Nil,
  4494. _List_fromArray(
  4495. [
  4496. $elm$html$Html$text('PRO:' + '__')
  4497. ])),
  4498. A2(
  4499. $elm$html$Html$div,
  4500. _List_Nil,
  4501. _List_fromArray(
  4502. [
  4503. $elm$html$Html$text('SPD:' + '__')
  4504. ])),
  4505. A2(
  4506. $elm$html$Html$div,
  4507. _List_Nil,
  4508. _List_fromArray(
  4509. [
  4510. $elm$html$Html$text('INI:' + '__')
  4511. ])),
  4512. A2(
  4513. $elm$html$Html$div,
  4514. _List_Nil,
  4515. _List_fromArray(
  4516. [
  4517. $elm$html$Html$text('AC:' + '__')
  4518. ])),
  4519. A2(
  4520. $elm$html$Html$div,
  4521. _List_Nil,
  4522. _List_fromArray(
  4523. [
  4524. $elm$html$Html$text('HP:' + ('cur' + ('/MAX (tempMAX)' + ' + temp')))
  4525. ])),
  4526. A2(
  4527. $elm$html$Html$div,
  4528. _List_Nil,
  4529. _List_fromArray(
  4530. [
  4531. $elm$html$Html$text('Hit Dice:' + '__')
  4532. ])),
  4533. A2(
  4534. $elm$html$Html$div,
  4535. _List_Nil,
  4536. _List_fromArray(
  4537. [
  4538. $elm$html$Html$text('Death Saves:' + '__')
  4539. ]))
  4540. ])),
  4541. A2(
  4542. $elm$html$Html$div,
  4543. _List_Nil,
  4544. _List_fromArray(
  4545. [
  4546. A2(
  4547. $elm$html$Html$h2,
  4548. _List_Nil,
  4549. _List_fromArray(
  4550. [
  4551. $elm$html$Html$text('Ability Scores')
  4552. ])),
  4553. A2(
  4554. $elm$html$Html$div,
  4555. _List_Nil,
  4556. _List_fromArray(
  4557. [
  4558. A2(
  4559. $elm$html$Html$button,
  4560. _List_fromArray(
  4561. [
  4562. $elm$html$Html$Events$onClick($author$project$Msg$IncrementStr)
  4563. ]),
  4564. _List_fromArray(
  4565. [
  4566. $elm$html$Html$text('+')
  4567. ])),
  4568. A2(
  4569. $elm$html$Html$div,
  4570. _List_Nil,
  4571. _List_fromArray(
  4572. [
  4573. $elm$html$Html$text(
  4574. 'STR:' + $elm$core$String$fromInt(model.character.abilities.str))
  4575. ])),
  4576. A2(
  4577. $elm$html$Html$button,
  4578. _List_fromArray(
  4579. [
  4580. $elm$html$Html$Events$onClick($author$project$Msg$DecrementStr)
  4581. ]),
  4582. _List_fromArray(
  4583. [
  4584. $elm$html$Html$text('-')
  4585. ]))
  4586. ])),
  4587. A2(
  4588. $elm$html$Html$div,
  4589. _List_Nil,
  4590. _List_fromArray(
  4591. [
  4592. A2(
  4593. $elm$html$Html$button,
  4594. _List_fromArray(
  4595. [
  4596. $elm$html$Html$Events$onClick($author$project$Msg$IncrementStr)
  4597. ]),
  4598. _List_fromArray(
  4599. [
  4600. $elm$html$Html$text('+')
  4601. ])),
  4602. A2(
  4603. $elm$html$Html$div,
  4604. _List_Nil,
  4605. _List_fromArray(
  4606. [
  4607. $elm$html$Html$text(
  4608. 'DEX:' + $elm$core$String$fromInt(model.character.abilities.dex))
  4609. ])),
  4610. A2(
  4611. $elm$html$Html$button,
  4612. _List_fromArray(
  4613. [
  4614. $elm$html$Html$Events$onClick($author$project$Msg$DecrementStr)
  4615. ]),
  4616. _List_fromArray(
  4617. [
  4618. $elm$html$Html$text('-')
  4619. ]))
  4620. ])),
  4621. A2(
  4622. $elm$html$Html$div,
  4623. _List_Nil,
  4624. _List_fromArray(
  4625. [
  4626. A2(
  4627. $elm$html$Html$button,
  4628. _List_fromArray(
  4629. [
  4630. $elm$html$Html$Events$onClick($author$project$Msg$IncrementStr)
  4631. ]),
  4632. _List_fromArray(
  4633. [
  4634. $elm$html$Html$text('+')
  4635. ])),
  4636. A2(
  4637. $elm$html$Html$div,
  4638. _List_Nil,
  4639. _List_fromArray(
  4640. [
  4641. $elm$html$Html$text(
  4642. 'CON:' + $elm$core$String$fromInt(model.character.abilities.con))
  4643. ])),
  4644. A2(
  4645. $elm$html$Html$button,
  4646. _List_fromArray(
  4647. [
  4648. $elm$html$Html$Events$onClick($author$project$Msg$DecrementStr)
  4649. ]),
  4650. _List_fromArray(
  4651. [
  4652. $elm$html$Html$text('-')
  4653. ]))
  4654. ])),
  4655. A2(
  4656. $elm$html$Html$div,
  4657. _List_Nil,
  4658. _List_fromArray(
  4659. [
  4660. A2(
  4661. $elm$html$Html$button,
  4662. _List_fromArray(
  4663. [
  4664. $elm$html$Html$Events$onClick($author$project$Msg$IncrementStr)
  4665. ]),
  4666. _List_fromArray(
  4667. [
  4668. $elm$html$Html$text('+')
  4669. ])),
  4670. A2(
  4671. $elm$html$Html$div,
  4672. _List_Nil,
  4673. _List_fromArray(
  4674. [
  4675. $elm$html$Html$text(
  4676. 'INT:' + $elm$core$String$fromInt(model.character.abilities._int))
  4677. ])),
  4678. A2(
  4679. $elm$html$Html$button,
  4680. _List_fromArray(
  4681. [
  4682. $elm$html$Html$Events$onClick($author$project$Msg$DecrementStr)
  4683. ]),
  4684. _List_fromArray(
  4685. [
  4686. $elm$html$Html$text('-')
  4687. ]))
  4688. ])),
  4689. A2(
  4690. $elm$html$Html$div,
  4691. _List_Nil,
  4692. _List_fromArray(
  4693. [
  4694. A2(
  4695. $elm$html$Html$button,
  4696. _List_fromArray(
  4697. [
  4698. $elm$html$Html$Events$onClick($author$project$Msg$IncrementStr)
  4699. ]),
  4700. _List_fromArray(
  4701. [
  4702. $elm$html$Html$text('+')
  4703. ])),
  4704. A2(
  4705. $elm$html$Html$div,
  4706. _List_Nil,
  4707. _List_fromArray(
  4708. [
  4709. $elm$html$Html$text(
  4710. 'WIS:' + $elm$core$String$fromInt(model.character.abilities.wis))
  4711. ])),
  4712. A2(
  4713. $elm$html$Html$button,
  4714. _List_fromArray(
  4715. [
  4716. $elm$html$Html$Events$onClick($author$project$Msg$DecrementStr)
  4717. ]),
  4718. _List_fromArray(
  4719. [
  4720. $elm$html$Html$text('-')
  4721. ]))
  4722. ])),
  4723. A2(
  4724. $elm$html$Html$div,
  4725. _List_Nil,
  4726. _List_fromArray(
  4727. [
  4728. A2(
  4729. $elm$html$Html$button,
  4730. _List_fromArray(
  4731. [
  4732. $elm$html$Html$Events$onClick($author$project$Msg$IncrementStr)
  4733. ]),
  4734. _List_fromArray(
  4735. [
  4736. $elm$html$Html$text('+')
  4737. ])),
  4738. A2(
  4739. $elm$html$Html$div,
  4740. _List_Nil,
  4741. _List_fromArray(
  4742. [
  4743. $elm$html$Html$text(
  4744. 'CHA:' + $elm$core$String$fromInt(model.character.abilities.cha))
  4745. ])),
  4746. A2(
  4747. $elm$html$Html$button,
  4748. _List_fromArray(
  4749. [
  4750. $elm$html$Html$Events$onClick($author$project$Msg$DecrementStr)
  4751. ]),
  4752. _List_fromArray(
  4753. [
  4754. $elm$html$Html$text('-')
  4755. ]))
  4756. ]))
  4757. ])),
  4758. A2(
  4759. $elm$html$Html$div,
  4760. _List_Nil,
  4761. _List_fromArray(
  4762. [
  4763. A2(
  4764. $elm$html$Html$h2,
  4765. _List_Nil,
  4766. _List_fromArray(
  4767. [
  4768. $elm$html$Html$text('Passive Checks')
  4769. ])),
  4770. A2(
  4771. $elm$html$Html$div,
  4772. _List_Nil,
  4773. _List_fromArray(
  4774. [
  4775. A2(
  4776. $elm$html$Html$ul,
  4777. _List_Nil,
  4778. _List_fromArray(
  4779. [
  4780. A2(
  4781. $elm$html$Html$li,
  4782. _List_Nil,
  4783. _List_fromArray(
  4784. [
  4785. $elm$html$Html$text('Perception (WIS)')
  4786. ])),
  4787. A2(
  4788. $elm$html$Html$li,
  4789. _List_Nil,
  4790. _List_fromArray(
  4791. [
  4792. $elm$html$Html$text('Investigation (INT)')
  4793. ])),
  4794. A2(
  4795. $elm$html$Html$li,
  4796. _List_Nil,
  4797. _List_fromArray(
  4798. [
  4799. $elm$html$Html$text('Insight (WIS)')
  4800. ]))
  4801. ]))
  4802. ]))
  4803. ])),
  4804. A2(
  4805. $elm$html$Html$div,
  4806. _List_Nil,
  4807. _List_fromArray(
  4808. [
  4809. A2(
  4810. $elm$html$Html$h2,
  4811. _List_Nil,
  4812. _List_fromArray(
  4813. [
  4814. $elm$html$Html$text('Saving Throws')
  4815. ])),
  4816. A2(
  4817. $elm$html$Html$div,
  4818. _List_Nil,
  4819. _List_fromArray(
  4820. [
  4821. A2(
  4822. $elm$html$Html$ul,
  4823. _List_Nil,
  4824. _List_fromArray(
  4825. [
  4826. A2(
  4827. $elm$html$Html$li,
  4828. _List_Nil,
  4829. _List_fromArray(
  4830. [
  4831. $elm$html$Html$text('STR')
  4832. ])),
  4833. A2(
  4834. $elm$html$Html$li,
  4835. _List_Nil,
  4836. _List_fromArray(
  4837. [
  4838. $elm$html$Html$text('DEX')
  4839. ])),
  4840. A2(
  4841. $elm$html$Html$li,
  4842. _List_Nil,
  4843. _List_fromArray(
  4844. [
  4845. $elm$html$Html$text('CON')
  4846. ])),
  4847. A2(
  4848. $elm$html$Html$li,
  4849. _List_Nil,
  4850. _List_fromArray(
  4851. [
  4852. $elm$html$Html$text('INT')
  4853. ])),
  4854. A2(
  4855. $elm$html$Html$li,
  4856. _List_Nil,
  4857. _List_fromArray(
  4858. [
  4859. $elm$html$Html$text('WIS')
  4860. ])),
  4861. A2(
  4862. $elm$html$Html$li,
  4863. _List_Nil,
  4864. _List_fromArray(
  4865. [
  4866. $elm$html$Html$text('CHA')
  4867. ]))
  4868. ]))
  4869. ]))
  4870. ])),
  4871. A2(
  4872. $elm$html$Html$div,
  4873. _List_Nil,
  4874. _List_fromArray(
  4875. [
  4876. A2(
  4877. $elm$html$Html$h2,
  4878. _List_Nil,
  4879. _List_fromArray(
  4880. [
  4881. $elm$html$Html$text('Skills')
  4882. ])),
  4883. A2(
  4884. $elm$html$Html$div,
  4885. _List_Nil,
  4886. _List_fromArray(
  4887. [
  4888. A2(
  4889. $elm$html$Html$ul,
  4890. _List_Nil,
  4891. _List_fromArray(
  4892. [
  4893. A2(
  4894. $elm$html$Html$li,
  4895. _List_Nil,
  4896. _List_fromArray(
  4897. [
  4898. $elm$html$Html$text('Acrobatics (DEX)')
  4899. ])),
  4900. A2(
  4901. $elm$html$Html$li,
  4902. _List_Nil,
  4903. _List_fromArray(
  4904. [
  4905. $elm$html$Html$text('Animal Hunting (WIS)')
  4906. ])),
  4907. A2(
  4908. $elm$html$Html$li,
  4909. _List_Nil,
  4910. _List_fromArray(
  4911. [
  4912. $elm$html$Html$text('Arcana (INT)')
  4913. ])),
  4914. A2(
  4915. $elm$html$Html$li,
  4916. _List_Nil,
  4917. _List_fromArray(
  4918. [
  4919. $elm$html$Html$text('Athletics (STR)')
  4920. ])),
  4921. A2(
  4922. $elm$html$Html$li,
  4923. _List_Nil,
  4924. _List_fromArray(
  4925. [
  4926. $elm$html$Html$text('Deception (CHA)')
  4927. ])),
  4928. A2(
  4929. $elm$html$Html$li,
  4930. _List_Nil,
  4931. _List_fromArray(
  4932. [
  4933. $elm$html$Html$text('History (INT)')
  4934. ])),
  4935. A2(
  4936. $elm$html$Html$li,
  4937. _List_Nil,
  4938. _List_fromArray(
  4939. [
  4940. $elm$html$Html$text('Insight (WIS)')
  4941. ])),
  4942. A2(
  4943. $elm$html$Html$li,
  4944. _List_Nil,
  4945. _List_fromArray(
  4946. [
  4947. $elm$html$Html$text('Intimidation (CHA)')
  4948. ])),
  4949. A2(
  4950. $elm$html$Html$li,
  4951. _List_Nil,
  4952. _List_fromArray(
  4953. [
  4954. $elm$html$Html$text('Investigation (INT)')
  4955. ])),
  4956. A2(
  4957. $elm$html$Html$li,
  4958. _List_Nil,
  4959. _List_fromArray(
  4960. [
  4961. $elm$html$Html$text('Medicine (WIS)')
  4962. ])),
  4963. A2(
  4964. $elm$html$Html$li,
  4965. _List_Nil,
  4966. _List_fromArray(
  4967. [
  4968. $elm$html$Html$text('Nature (INT)')
  4969. ])),
  4970. A2(
  4971. $elm$html$Html$li,
  4972. _List_Nil,
  4973. _List_fromArray(
  4974. [
  4975. $elm$html$Html$text('Perception (WIS)')
  4976. ])),
  4977. A2(
  4978. $elm$html$Html$li,
  4979. _List_Nil,
  4980. _List_fromArray(
  4981. [
  4982. $elm$html$Html$text('Performance (CHA)')
  4983. ])),
  4984. A2(
  4985. $elm$html$Html$li,
  4986. _List_Nil,
  4987. _List_fromArray(
  4988. [
  4989. $elm$html$Html$text('Persuation (CHA)')
  4990. ])),
  4991. A2(
  4992. $elm$html$Html$li,
  4993. _List_Nil,
  4994. _List_fromArray(
  4995. [
  4996. $elm$html$Html$text('Religion (Int)')
  4997. ])),
  4998. A2(
  4999. $elm$html$Html$li,
  5000. _List_Nil,
  5001. _List_fromArray(
  5002. [
  5003. $elm$html$Html$text('Sleight of Hand (DEX)')
  5004. ])),
  5005. A2(
  5006. $elm$html$Html$li,
  5007. _List_Nil,
  5008. _List_fromArray(
  5009. [
  5010. $elm$html$Html$text('Stealth (DEX)')
  5011. ])),
  5012. A2(
  5013. $elm$html$Html$li,
  5014. _List_Nil,
  5015. _List_fromArray(
  5016. [
  5017. $elm$html$Html$text('Survival (WIS)')
  5018. ]))
  5019. ]))
  5020. ]))
  5021. ])),
  5022. A2(
  5023. $elm$html$Html$div,
  5024. _List_Nil,
  5025. _List_fromArray(
  5026. [
  5027. A2(
  5028. $elm$html$Html$h2,
  5029. _List_Nil,
  5030. _List_fromArray(
  5031. [
  5032. $elm$html$Html$text('Equipment')
  5033. ])),
  5034. A2(
  5035. $elm$html$Html$button,
  5036. _List_Nil,
  5037. _List_fromArray(
  5038. [
  5039. $elm$html$Html$text('+')
  5040. ])),
  5041. A2(
  5042. $elm$html$Html$div,
  5043. _List_Nil,
  5044. _List_fromArray(
  5045. [
  5046. A2(
  5047. $elm$html$Html$ul,
  5048. _List_Nil,
  5049. _List_fromArray(
  5050. [
  5051. A2(
  5052. $elm$html$Html$li,
  5053. _List_Nil,
  5054. _List_fromArray(
  5055. [
  5056. $elm$html$Html$text('Frost Skiis')
  5057. ]))
  5058. ]))
  5059. ]))
  5060. ])),
  5061. A2(
  5062. $elm$html$Html$div,
  5063. _List_Nil,
  5064. _List_fromArray(
  5065. [
  5066. A2(
  5067. $elm$html$Html$h2,
  5068. _List_Nil,
  5069. _List_fromArray(
  5070. [
  5071. $elm$html$Html$text('Attacks/Spells')
  5072. ])),
  5073. A2(
  5074. $elm$html$Html$button,
  5075. _List_Nil,
  5076. _List_fromArray(
  5077. [
  5078. $elm$html$Html$text('+')
  5079. ])),
  5080. A2(
  5081. $elm$html$Html$div,
  5082. _List_Nil,
  5083. _List_fromArray(
  5084. [
  5085. A2(
  5086. $elm$html$Html$ul,
  5087. _List_Nil,
  5088. _List_fromArray(
  5089. [
  5090. A2(
  5091. $elm$html$Html$li,
  5092. _List_Nil,
  5093. _List_fromArray(
  5094. [
  5095. $elm$html$Html$text('Mistletoe')
  5096. ]))
  5097. ]))
  5098. ]))
  5099. ])),
  5100. A2(
  5101. $elm$html$Html$div,
  5102. _List_Nil,
  5103. _List_fromArray(
  5104. [
  5105. A2(
  5106. $elm$html$Html$h2,
  5107. _List_Nil,
  5108. _List_fromArray(
  5109. [
  5110. $elm$html$Html$text('Feats')
  5111. ])),
  5112. A2(
  5113. $elm$html$Html$button,
  5114. _List_Nil,
  5115. _List_fromArray(
  5116. [
  5117. $elm$html$Html$text('+')
  5118. ])),
  5119. A2(
  5120. $elm$html$Html$div,
  5121. _List_Nil,
  5122. _List_fromArray(
  5123. [
  5124. A2(
  5125. $elm$html$Html$ul,
  5126. _List_Nil,
  5127. _List_fromArray(
  5128. [
  5129. A2(
  5130. $elm$html$Html$li,
  5131. _List_Nil,
  5132. _List_fromArray(
  5133. [
  5134. $elm$html$Html$text('Slippery Slope')
  5135. ])),
  5136. A2(
  5137. $elm$html$Html$li,
  5138. _List_Nil,
  5139. _List_fromArray(
  5140. [
  5141. $elm$html$Html$text('Trap Reindeer')
  5142. ])),
  5143. A2(
  5144. $elm$html$Html$li,
  5145. _List_Nil,
  5146. _List_fromArray(
  5147. [
  5148. $elm$html$Html$text('Find Thin Ice')
  5149. ]))
  5150. ]))
  5151. ]))
  5152. ])),
  5153. A2(
  5154. $elm$html$Html$div,
  5155. _List_Nil,
  5156. _List_fromArray(
  5157. [
  5158. A2(
  5159. $elm$html$Html$h2,
  5160. _List_Nil,
  5161. _List_fromArray(
  5162. [
  5163. $elm$html$Html$text('Languages')
  5164. ])),
  5165. A2(
  5166. $elm$html$Html$button,
  5167. _List_Nil,
  5168. _List_fromArray(
  5169. [
  5170. $elm$html$Html$text('+')
  5171. ])),
  5172. A2(
  5173. $elm$html$Html$div,
  5174. _List_Nil,
  5175. _List_fromArray(
  5176. [
  5177. A2(
  5178. $elm$html$Html$ul,
  5179. _List_Nil,
  5180. _List_fromArray(
  5181. [
  5182. A2(
  5183. $elm$html$Html$li,
  5184. _List_Nil,
  5185. _List_fromArray(
  5186. [
  5187. $elm$html$Html$text('Oevdask')
  5188. ])),
  5189. A2(
  5190. $elm$html$Html$li,
  5191. _List_Nil,
  5192. _List_fromArray(
  5193. [
  5194. $elm$html$Html$text('Suomi')
  5195. ]))
  5196. ]))
  5197. ]))
  5198. ])),
  5199. A2(
  5200. $elm$html$Html$div,
  5201. _List_Nil,
  5202. _List_fromArray(
  5203. [
  5204. A2(
  5205. $elm$html$Html$h2,
  5206. _List_Nil,
  5207. _List_fromArray(
  5208. [
  5209. $elm$html$Html$text('Contacts')
  5210. ])),
  5211. A2(
  5212. $elm$html$Html$div,
  5213. _List_Nil,
  5214. _List_fromArray(
  5215. [
  5216. $elm$html$Html$text('Allies, Enemies, Persons of Interest')
  5217. ])),
  5218. A2(
  5219. $elm$html$Html$button,
  5220. _List_Nil,
  5221. _List_fromArray(
  5222. [
  5223. $elm$html$Html$text('+')
  5224. ])),
  5225. A2(
  5226. $elm$html$Html$div,
  5227. _List_Nil,
  5228. _List_fromArray(
  5229. [
  5230. A2(
  5231. $elm$html$Html$ul,
  5232. _List_Nil,
  5233. _List_fromArray(
  5234. [
  5235. A2(
  5236. $elm$html$Html$li,
  5237. _List_Nil,
  5238. _List_fromArray(
  5239. [
  5240. $elm$html$Html$text('Ullur')
  5241. ]))
  5242. ]))
  5243. ]))
  5244. ]))
  5245. ]));
  5246. };
  5247. var $author$project$Main$main = $elm$browser$Browser$sandbox(
  5248. {init: $author$project$Main$init, update: $author$project$Main$update, view: $author$project$View$view});
  5249. _Platform_export({'Main':{'init':$author$project$Main$main(
  5250. $elm$json$Json$Decode$succeed(_Utils_Tuple0))(0)}});}(this));
  5251. var app = Elm.Main.init({ node: document.getElementById("elm") });
  5252. }
  5253. catch (e)
  5254. {
  5255. // display initialization errors (e.g. bad flags, infinite recursion)
  5256. var header = document.createElement("h1");
  5257. header.style.fontFamily = "monospace";
  5258. header.innerText = "Initialization Error";
  5259. var pre = document.getElementById("elm");
  5260. document.body.insertBefore(header, pre);
  5261. pre.innerText = e;
  5262. throw e;
  5263. }
  5264. </script>
  5265. </body>
  5266. </html>