From de3297109e5fd6c27aa3e3c4ff54d139a1ea6f38 Mon Sep 17 00:00:00 2001 From: SimonLab Date: Tue, 10 Mar 2020 15:10:06 +0100 Subject: [PATCH 1/7] disable capture while timer is created, #15 --- elm.js | 447 ++++++++++++++++++++++++------------------ src/Endpoint.elm | 2 +- src/Pages/Capture.elm | 37 +++- 3 files changed, 285 insertions(+), 201 deletions(-) diff --git a/elm.js b/elm.js index 0a43a5b..571352f 100644 --- a/elm.js +++ b/elm.js @@ -784,11 +784,11 @@ function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.ac.H === region.aq.H) + if (region.ad.K === region.as.K) { - return 'on line ' + region.ac.H; + return 'on line ' + region.ad.K; } - return 'on lines ' + region.ac.H + ' through ' + region.aq.H; + return 'on lines ' + region.ad.K + ' through ' + region.as.K; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.bo, - impl.bM, - impl.bJ, + impl.bq, + impl.bO, + impl.bL, function() { return function() {} } ); }); @@ -2705,8 +2705,8 @@ var _VirtualDom_mapEventRecord = F2(function(func, record) { return { w: func(record.w), - ad: record.ad, - aa: record.aa + ae: record.ae, + ab: record.ab } }); @@ -2975,10 +2975,10 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) var value = result.a; var message = !tag ? value : tag < 3 ? value.a : value.w; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.ad; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.ae; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.aa) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.ab) && event.preventDefault(), eventNode ); var tagger; @@ -3928,11 +3928,11 @@ var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debug return _Platform_initialize( flagDecoder, args, - impl.bo, - impl.bM, - impl.bJ, + impl.bq, + impl.bO, + impl.bL, function(sendToApp, initialModel) { - var view = impl.bN; + var view = impl.bP; /**/ var domNode = args['node']; //*/ @@ -3964,12 +3964,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb return _Platform_initialize( flagDecoder, args, - impl.bo, - impl.bM, - impl.bJ, + impl.bq, + impl.bO, + impl.bL, function(sendToApp, initialModel) { - var divertHrefToApp = impl.ab && impl.ab(sendToApp) - var view = impl.bN; + var divertHrefToApp = impl.ac && impl.ac(sendToApp) + var view = impl.bP; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); @@ -3977,12 +3977,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb { _VirtualDom_divertHrefToApp = divertHrefToApp; var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.ak); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.al); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.a_) && (_VirtualDom_doc.title = title = doc.a_); + (title !== doc.a0) && (_VirtualDom_doc.title = title = doc.a0); }); } ); @@ -4038,12 +4038,12 @@ function _Browser_makeAnimator(model, draw) function _Browser_application(impl) { - var onUrlChange = impl.bz; - var onUrlRequest = impl.bA; + var onUrlChange = impl.bB; + var onUrlRequest = impl.bC; var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; return _Browser_document({ - ab: function(sendToApp) + ac: function(sendToApp) { key.a = sendToApp; _Browser_window.addEventListener('popstate', key); @@ -4059,9 +4059,9 @@ function _Browser_application(impl) var next = $elm$url$Url$fromString(href).a; sendToApp(onUrlRequest( (next - && curr.aK === next.aK - && curr.ax === next.ax - && curr.aH.a === next.aH.a + && curr.aM === next.aM + && curr.az === next.az + && curr.aJ.a === next.aJ.a ) ? $elm$browser$Browser$Internal(next) : $elm$browser$Browser$External(href) @@ -4069,13 +4069,13 @@ function _Browser_application(impl) } }); }, - bo: function(flags) + bq: function(flags) { - return A3(impl.bo, flags, _Browser_getUrl(), key); + return A3(impl.bq, flags, _Browser_getUrl(), key); }, - bN: impl.bN, - bM: impl.bM, - bJ: impl.bJ + bP: impl.bP, + bO: impl.bO, + bL: impl.bL }); } @@ -4141,17 +4141,17 @@ var _Browser_decodeEvent = F2(function(decoder, event) function _Browser_visibilityInfo() { return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { bm: 'hidden', ba: 'visibilitychange' } + ? { bo: 'hidden', bc: 'visibilitychange' } : (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { bm: 'mozHidden', ba: 'mozvisibilitychange' } + ? { bo: 'mozHidden', bc: 'mozvisibilitychange' } : (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { bm: 'msHidden', ba: 'msvisibilitychange' } + ? { bo: 'msHidden', bc: 'msvisibilitychange' } : (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { bm: 'webkitHidden', ba: 'webkitvisibilitychange' } - : { bm: 'hidden', ba: 'visibilitychange' }; + ? { bo: 'webkitHidden', bc: 'webkitvisibilitychange' } + : { bo: 'hidden', bc: 'visibilitychange' }; } @@ -4232,12 +4232,12 @@ var _Browser_call = F2(function(functionName, id) function _Browser_getViewport() { return { - aS: _Browser_getScene(), - a1: { - a3: _Browser_window.pageXOffset, - a4: _Browser_window.pageYOffset, - a2: _Browser_doc.documentElement.clientWidth, - aw: _Browser_doc.documentElement.clientHeight + aU: _Browser_getScene(), + a3: { + a5: _Browser_window.pageXOffset, + a6: _Browser_window.pageYOffset, + a4: _Browser_doc.documentElement.clientWidth, + ay: _Browser_doc.documentElement.clientHeight } }; } @@ -4247,8 +4247,8 @@ function _Browser_getScene() var body = _Browser_doc.body; var elem = _Browser_doc.documentElement; return { - a2: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - aw: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + a4: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + ay: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) }; } @@ -4271,15 +4271,15 @@ function _Browser_getViewportOf(id) return _Browser_withNode(id, function(node) { return { - aS: { - a2: node.scrollWidth, - aw: node.scrollHeight + aU: { + a4: node.scrollWidth, + ay: node.scrollHeight }, - a1: { - a3: node.scrollLeft, - a4: node.scrollTop, - a2: node.clientWidth, - aw: node.clientHeight + a3: { + a5: node.scrollLeft, + a6: node.scrollTop, + a4: node.clientWidth, + ay: node.clientHeight } }; }); @@ -4309,18 +4309,18 @@ function _Browser_getElement(id) var x = _Browser_window.pageXOffset; var y = _Browser_window.pageYOffset; return { - aS: _Browser_getScene(), - a1: { - a3: x, - a4: y, - a2: _Browser_doc.documentElement.clientWidth, - aw: _Browser_doc.documentElement.clientHeight + aU: _Browser_getScene(), + a3: { + a5: x, + a6: y, + a4: _Browser_doc.documentElement.clientWidth, + ay: _Browser_doc.documentElement.clientHeight }, - be: { - a3: x + rect.left, - a4: y + rect.top, - a2: rect.width, - aw: rect.height + bg: { + a5: x + rect.left, + a6: y + rect.top, + a4: rect.width, + ay: rect.height } }; }); @@ -4382,25 +4382,25 @@ var _Http_toTask = F3(function(router, toTask, request) return _Scheduler_binding(function(callback) { function done(response) { - callback(toTask(request.bh.a(response))); + callback(toTask(request.bj.a(response))); } var xhr = new XMLHttpRequest(); xhr.addEventListener('error', function() { done($elm$http$Http$NetworkError_); }); xhr.addEventListener('timeout', function() { done($elm$http$Http$Timeout_); }); - xhr.addEventListener('load', function() { done(_Http_toResponse(request.bh.b, xhr)); }); - $elm$core$Maybe$isJust(request.a$) && _Http_track(router, xhr, request.a$.a); + xhr.addEventListener('load', function() { done(_Http_toResponse(request.bj.b, xhr)); }); + $elm$core$Maybe$isJust(request.a1) && _Http_track(router, xhr, request.a1.a); try { - xhr.open(request.aB, request.ag, true); + xhr.open(request.aD, request.ah, true); } catch (e) { - return done($elm$http$Http$BadUrl_(request.ag)); + return done($elm$http$Http$BadUrl_(request.ah)); } _Http_configureRequest(xhr, request); - request.ak.a && xhr.setRequestHeader('Content-Type', request.ak.a); - xhr.send(request.ak.b); + request.al.a && xhr.setRequestHeader('Content-Type', request.al.a); + xhr.send(request.al.b); return function() { xhr.c = true; xhr.abort(); }; }); @@ -4411,13 +4411,13 @@ var _Http_toTask = F3(function(router, toTask, request) function _Http_configureRequest(xhr, request) { - for (var headers = request.av; headers.b; headers = headers.b) // WHILE_CONS + for (var headers = request.ax; headers.b; headers = headers.b) // WHILE_CONS { xhr.setRequestHeader(headers.a.a, headers.a.b); } - xhr.timeout = request.aZ.a || 0; - xhr.responseType = request.bh.d; - xhr.withCredentials = request.a7; + xhr.timeout = request.a$.a || 0; + xhr.responseType = request.bj.d; + xhr.withCredentials = request.a9; } @@ -4438,10 +4438,10 @@ function _Http_toResponse(toBody, xhr) function _Http_toMetadata(xhr) { return { - ag: xhr.responseURL, - bH: xhr.status, - bI: xhr.statusText, - av: _Http_parseHeaders(xhr.getAllResponseHeaders()) + ah: xhr.responseURL, + bJ: xhr.status, + bK: xhr.statusText, + ax: _Http_parseHeaders(xhr.getAllResponseHeaders()) }; } @@ -4536,15 +4536,15 @@ function _Http_track(router, xhr, tracker) xhr.upload.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Sending({ - bG: event.loaded, - aT: event.total + bI: event.loaded, + aV: event.total })))); }); xhr.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Receiving({ - bD: event.loaded, - aT: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing + bF: event.loaded, + aV: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing })))); }); }var $elm$core$Maybe$Just = function (a) { @@ -5057,7 +5057,7 @@ var $elm$url$Url$Http = 0; var $elm$url$Url$Https = 1; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {as: fragment, ax: host, aF: path, aH: port_, aK: protocol, aL: query}; + return {au: fragment, az: host, aH: path, aJ: port_, aM: protocol, aN: query}; }); var $elm$core$String$contains = _String_contains; var $elm$core$String$length = _String_length; @@ -5344,7 +5344,7 @@ var $author$project$Main$NotFound = function (a) { }; var $author$project$Session$Person = F2( function (email, token) { - return {bf: email, af: token}; + return {bh: email, ag: token}; }); var $author$project$Session$Session = F2( function (a, b) { @@ -5999,9 +5999,9 @@ var $elm$url$Url$Parser$parse = F2( A5( $elm$url$Url$Parser$State, _List_Nil, - $elm$url$Url$Parser$preparePath(url.aF), - $elm$url$Url$Parser$prepareQuery(url.aL), - url.as, + $elm$url$Url$Parser$preparePath(url.aH), + $elm$url$Url$Parser$prepareQuery(url.aN), + url.au, $elm$core$Basics$identity))); }); var $author$project$Route$Auth = function (a) { @@ -6223,7 +6223,7 @@ var $author$project$Main$Session = function (a) { var $elm$core$Platform$Cmd$batch = _Platform_batch; var $author$project$Pages$Auth$Model = F2( function (session, urls) { - return {L: session, ah: urls}; + return {N: session, ai: urls}; }); var $author$project$Pages$Auth$GotAuthUrls = function (a) { return {$: 0, a: a}; @@ -6250,7 +6250,7 @@ var $elm$url$Url$Builder$crossOrigin = F3( }); var $author$project$Endpoint$url = F2( function (path, queryParams) { - return A3($elm$url$Url$Builder$crossOrigin, 'https://dwyl-app-api.herokuapp.com', path, queryParams); + return A3($elm$url$Url$Builder$crossOrigin, 'http://localhost:4000', path, queryParams); }); var $author$project$Endpoint$authUrls = A2( $author$project$Endpoint$url, @@ -6260,7 +6260,7 @@ var $author$project$Endpoint$authUrls = A2( var $elm$json$Json$Decode$list = _Json_decodeList; var $author$project$Pages$Auth$Url = F2( function (url, typeUrl) { - return {a0: typeUrl, ag: url}; + return {a2: typeUrl, ah: url}; }); var $author$project$Pages$Auth$Github = 1; var $author$project$Pages$Auth$Google = 0; @@ -6364,7 +6364,7 @@ var $elm$http$Http$resolve = F2( case 3: var metadata = response.a; return $elm$core$Result$Err( - $elm$http$Http$BadStatus(metadata.bH)); + $elm$http$Http$BadStatus(metadata.bJ)); default: var body = response.b; return A2( @@ -6392,7 +6392,7 @@ var $elm$http$Http$Request = function (a) { }; var $elm$http$Http$State = F2( function (reqs, subs) { - return {aN: reqs, aX: subs}; + return {aP: reqs, aZ: subs}; }); var $elm$http$Http$init = $elm$core$Task$succeed( A2($elm$http$Http$State, $elm$core$Dict$empty, _List_Nil)); @@ -6436,7 +6436,7 @@ var $elm$http$Http$updateReqs = F3( return A2( $elm$core$Task$andThen, function (pid) { - var _v4 = req.a$; + var _v4 = req.a1; if (_v4.$ === 1) { return A3($elm$http$Http$updateReqs, router, otherCmds, reqs); } else { @@ -6466,7 +6466,7 @@ var $elm$http$Http$onEffects = F4( return $elm$core$Task$succeed( A2($elm$http$Http$State, reqs, subs)); }, - A3($elm$http$Http$updateReqs, router, cmds, state.aN)); + A3($elm$http$Http$updateReqs, router, cmds, state.aP)); }); var $elm$core$List$maybeCons = F3( function (f, mx, xs) { @@ -6509,7 +6509,7 @@ var $elm$http$Http$onSelfMsg = F3( A2( $elm$core$List$filterMap, A3($elm$http$Http$maybeSend, router, tracker, progress), - state.aX))); + state.aZ))); }); var $elm$http$Http$Cancel = function (a) { return {$: 0, a: a}; @@ -6523,14 +6523,14 @@ var $elm$http$Http$cmdMap = F2( var r = cmd.a; return $elm$http$Http$Request( { - a7: r.a7, - ak: r.ak, - bh: A2(_Http_mapExpect, func, r.bh), - av: r.av, - aB: r.aB, - aZ: r.aZ, + a9: r.a9, + al: r.al, + bj: A2(_Http_mapExpect, func, r.bj), + ax: r.ax, + aD: r.aD, a$: r.a$, - ag: r.ag + a1: r.a1, + ah: r.ah }); } }); @@ -6553,11 +6553,11 @@ var $elm$http$Http$subscription = _Platform_leaf('Http'); var $elm$http$Http$request = function (r) { return $elm$http$Http$command( $elm$http$Http$Request( - {a7: false, ak: r.ak, bh: r.bh, av: r.av, aB: r.aB, aZ: r.aZ, a$: r.a$, ag: r.ag})); + {a9: false, al: r.al, bj: r.bj, ax: r.ax, aD: r.aD, a$: r.a$, a1: r.a1, ah: r.ah})); }; var $elm$http$Http$get = function (r) { return $elm$http$Http$request( - {ak: $elm$http$Http$emptyBody, bh: r.bh, av: _List_Nil, aB: 'GET', aZ: $elm$core$Maybe$Nothing, a$: $elm$core$Maybe$Nothing, ag: r.ag}); + {al: $elm$http$Http$emptyBody, bj: r.bj, ax: _List_Nil, aD: 'GET', a$: $elm$core$Maybe$Nothing, a1: $elm$core$Maybe$Nothing, ah: r.ah}); }; var $author$project$Endpoint$toString = function (_v0) { var urlEndpoint = _v0; @@ -6565,8 +6565,8 @@ var $author$project$Endpoint$toString = function (_v0) { }; var $author$project$Pages$Auth$getAuthUrls = $elm$http$Http$get( { - bh: A2($elm$http$Http$expectJson, $author$project$Pages$Auth$GotAuthUrls, $author$project$Pages$Auth$authUrlsDecoder), - ag: $author$project$Endpoint$toString($author$project$Endpoint$authUrls) + bj: A2($elm$http$Http$expectJson, $author$project$Pages$Auth$GotAuthUrls, $author$project$Pages$Auth$authUrlsDecoder), + ah: $author$project$Endpoint$toString($author$project$Endpoint$authUrls) }); var $author$project$Pages$Auth$init = function (session) { return _Utils_Tuple2( @@ -6575,7 +6575,7 @@ var $author$project$Pages$Auth$init = function (session) { }; var $author$project$Pages$Capture$Model = F4( function (session, captures, newCapture, error) { - return {U: captures, p: error, I: newCapture, L: session}; + return {I: captures, p: error, E: newCapture, N: session}; }); var $author$project$Pages$Capture$GotCaptures = function (a) { return {$: 1, a: a}; @@ -6585,16 +6585,20 @@ var $author$project$Endpoint$captures = A2( _List_fromArray( ['api', 'capture']), _List_Nil); -var $author$project$Pages$Capture$Capture = F2( - function (text, completed) { - return {V: completed, N: text}; +var $author$project$Pages$Capture$Capture = F4( + function (idCapture, text, completed, disabled) { + return {ao: completed, J: disabled, X: idCapture, P: text}; }); var $elm$json$Json$Decode$bool = _Json_decodeBool; -var $author$project$Pages$Capture$captureDecoder = A3( - $elm$json$Json$Decode$map2, +var $elm$json$Json$Decode$int = _Json_decodeInt; +var $elm$json$Json$Decode$map4 = _Json_map4; +var $author$project$Pages$Capture$captureDecoder = A5( + $elm$json$Json$Decode$map4, $author$project$Pages$Capture$Capture, + A2($elm$json$Json$Decode$field, 'capture_id', $elm$json$Json$Decode$int), A2($elm$json$Json$Decode$field, 'text', $elm$json$Json$Decode$string), - A2($elm$json$Json$Decode$field, 'completed', $elm$json$Json$Decode$bool)); + A2($elm$json$Json$Decode$field, 'completed', $elm$json$Json$Decode$bool), + $elm$json$Json$Decode$succeed(false)); var $author$project$Pages$Capture$capturesDecoder = A2( $elm$json$Json$Decode$field, 'data', @@ -6607,25 +6611,25 @@ var $elm$http$Http$header = $elm$http$Http$Header; var $author$project$Pages$Capture$getCaptures = function (token) { return $elm$http$Http$request( { - ak: $elm$http$Http$emptyBody, - bh: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$GotCaptures, $author$project$Pages$Capture$capturesDecoder), - av: _List_fromArray( + al: $elm$http$Http$emptyBody, + bj: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$GotCaptures, $author$project$Pages$Capture$capturesDecoder), + ax: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - aB: 'GET', - aZ: $elm$core$Maybe$Nothing, + aD: 'GET', a$: $elm$core$Maybe$Nothing, - ag: $author$project$Endpoint$toString($author$project$Endpoint$captures) + a1: $elm$core$Maybe$Nothing, + ah: $author$project$Endpoint$toString($author$project$Endpoint$captures) }); }; -var $author$project$Pages$Capture$initCapture = A2($author$project$Pages$Capture$Capture, '', false); +var $author$project$Pages$Capture$initCapture = A4($author$project$Pages$Capture$Capture, 0, '', false, false); var $author$project$Session$token = function (session) { if (!session.$) { return ''; } else { var person = session.b; - return person.af; + return person.ag; } }; var $author$project$Pages$Capture$init = function (session) { @@ -6640,14 +6644,14 @@ var $author$project$Pages$Home$init = function (session) { }; var $author$project$Pages$Session$Model = F3( function (session, token, error) { - return {p: error, L: session, af: token}; + return {p: error, N: session, ag: token}; }); var $author$project$Pages$Session$GotPersonInfo = function (a) { return {$: 0, a: a}; }; var $author$project$Pages$Session$PersonInfo = F2( function (email, name) { - return {bf: email, bq: name}; + return {bh: email, bs: name}; }); var $author$project$Pages$Session$personDecoder = A2( $elm$json$Json$Decode$field, @@ -6665,16 +6669,16 @@ var $author$project$Endpoint$personInfo = A2( var $author$project$Pages$Session$getPersonInfo = function (token) { return $elm$http$Http$request( { - ak: $elm$http$Http$emptyBody, - bh: A2($elm$http$Http$expectJson, $author$project$Pages$Session$GotPersonInfo, $author$project$Pages$Session$personDecoder), - av: _List_fromArray( + al: $elm$http$Http$emptyBody, + bj: A2($elm$http$Http$expectJson, $author$project$Pages$Session$GotPersonInfo, $author$project$Pages$Session$personDecoder), + ax: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - aB: 'GET', - aZ: $elm$core$Maybe$Nothing, + aD: 'GET', a$: $elm$core$Maybe$Nothing, - ag: $author$project$Endpoint$toString($author$project$Endpoint$personInfo) + a1: $elm$core$Maybe$Nothing, + ah: $author$project$Endpoint$toString($author$project$Endpoint$personInfo) }); }; var $author$project$Pages$Session$init = F2( @@ -6736,16 +6740,16 @@ var $author$project$Route$replaceUrl = F2( $author$project$Route$routeToString(route)); }); var $author$project$Pages$Auth$toSession = function (model) { - return model.L; + return model.N; }; var $author$project$Pages$Capture$toSession = function (model) { - return model.L; + return model.N; }; var $author$project$Pages$Home$toSession = function (model) { return model; }; var $author$project$Pages$Session$toSession = function (model) { - return model.L; + return model.N; }; var $author$project$Main$toSession = function (page) { switch (page.$) { @@ -6900,7 +6904,7 @@ var $author$project$Pages$Auth$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Auth$GotSession, - $author$project$Session$navKey(model.L)); + $author$project$Session$navKey(model.N)); }; var $author$project$Pages$Capture$GotSession = function (a) { return {$: 0, a: a}; @@ -6909,7 +6913,7 @@ var $author$project$Pages$Capture$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Capture$GotSession, - $author$project$Session$navKey(model.L)); + $author$project$Session$navKey(model.N)); }; var $author$project$Pages$Home$GotSession = $elm$core$Basics$identity; var $author$project$Pages$Home$subscriptions = function (model) { @@ -6925,7 +6929,7 @@ var $author$project$Pages$Session$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Session$GotSession, - $author$project$Session$navKey(model.L)); + $author$project$Session$navKey(model.N)); }; var $author$project$Main$subscriptions = function (model) { switch (model.$) { @@ -6987,7 +6991,7 @@ var $elm$url$Url$addPrefixed = F3( }); var $elm$url$Url$toString = function (url) { var http = function () { - var _v0 = url.aK; + var _v0 = url.aM; if (!_v0) { return 'http://'; } else { @@ -6997,17 +7001,17 @@ var $elm$url$Url$toString = function (url) { return A3( $elm$url$Url$addPrefixed, '#', - url.as, + url.au, A3( $elm$url$Url$addPrefixed, '?', - url.aL, + url.aN, _Utils_ap( A2( $elm$url$Url$addPort, - url.aH, - _Utils_ap(http, url.ax)), - url.aF))); + url.aJ, + _Utils_ap(http, url.az)), + url.aH))); }; var $author$project$Pages$Auth$update = F2( function (msg, model) { @@ -7018,7 +7022,7 @@ var $author$project$Pages$Auth$update = F2( return _Utils_Tuple2( _Utils_update( model, - {ah: urls}), + {ai: urls}), $elm$core$Platform$Cmd$none); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); @@ -7028,10 +7032,10 @@ var $author$project$Pages$Auth$update = F2( return _Utils_Tuple2( _Utils_update( model, - {L: session}), + {N: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.L), + $author$project$Session$navKey(model.N), $author$project$Route$Home)); } }); @@ -7058,7 +7062,7 @@ var $author$project$Pages$Capture$captureEncode = function (capture) { [ _Utils_Tuple2( 'text', - $elm$json$Json$Encode$string(capture.N)) + $elm$json$Json$Encode$string(capture.P)) ])); }; var $elm$http$Http$jsonBody = function (value) { @@ -7072,17 +7076,17 @@ var $author$project$Pages$Capture$saveCapture = F2( function (token, capture) { return $elm$http$Http$request( { - ak: $elm$http$Http$jsonBody( + al: $elm$http$Http$jsonBody( $author$project$Pages$Capture$captureEncode(capture)), - bh: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$CaptureSaved, $author$project$Pages$Capture$savedCaptureDecoder), - av: _List_fromArray( + bj: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$CaptureSaved, $author$project$Pages$Capture$savedCaptureDecoder), + ax: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - aB: 'POST', - aZ: $elm$core$Maybe$Nothing, + aD: 'POST', a$: $elm$core$Maybe$Nothing, - ag: $author$project$Endpoint$toString($author$project$Endpoint$captures) + a1: $elm$core$Maybe$Nothing, + ah: $author$project$Endpoint$toString($author$project$Endpoint$captures) }); }); var $author$project$Pages$Capture$update = F2( @@ -7093,10 +7097,10 @@ var $author$project$Pages$Capture$update = F2( return _Utils_Tuple2( _Utils_update( model, - {L: session}), + {N: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.L), + $author$project$Session$navKey(model.N), $author$project$Route$Home)); case 1: var result = msg.a; @@ -7105,7 +7109,7 @@ var $author$project$Pages$Capture$update = F2( return _Utils_Tuple2( _Utils_update( model, - {U: captures, p: ''}), + {I: captures, p: ''}), $elm$core$Platform$Cmd$none); } else { var httpError = result.a; @@ -7146,7 +7150,7 @@ var $author$project$Pages$Capture$update = F2( model, {p: ''}), $author$project$Pages$Capture$getCaptures( - $author$project$Session$token(model.L))); + $author$project$Session$token(model.N))); } else { var httpError = result.a; _v4$2: @@ -7180,21 +7184,39 @@ var $author$project$Pages$Capture$update = F2( } case 3: var text = msg.a; - var newCapture = {V: false, N: text}; + var capture = model.E; + var newCapture = _Utils_update( + capture, + {P: text}); return _Utils_Tuple2( _Utils_update( model, - {I: newCapture}), + {E: newCapture}), $elm$core$Platform$Cmd$none); - default: + case 4: return _Utils_Tuple2( _Utils_update( model, - {I: $author$project$Pages$Capture$initCapture}), + {E: $author$project$Pages$Capture$initCapture}), A2( $author$project$Pages$Capture$saveCapture, - $author$project$Session$token(model.L), - model.I)); + $author$project$Session$token(model.N), + model.E)); + default: + var idCapture = msg.a; + var captures = A2( + $elm$core$List$map, + function (c) { + return _Utils_eq(c.X, idCapture) ? _Utils_update( + c, + {J: true}) : c; + }, + model.I); + return _Utils_Tuple2( + _Utils_update( + model, + {I: captures}), + $elm$core$Platform$Cmd$none); } }); var $author$project$Pages$Home$update = F2( @@ -7213,10 +7235,10 @@ var $author$project$Session$encode = function (person) { [ _Utils_Tuple2( 'email', - $elm$json$Json$Encode$string(person.bf)), + $elm$json$Json$Encode$string(person.bh)), _Utils_Tuple2( 'token', - $elm$json$Json$Encode$string(person.af)) + $elm$json$Json$Encode$string(person.ag)) ])); }; var $author$project$Pages$Session$update = F2( @@ -7225,7 +7247,7 @@ var $author$project$Pages$Session$update = F2( var result = msg.a; if (!result.$) { var person = result.a; - var session = {bf: person.bf, af: model.af}; + var session = {bh: person.bh, ag: model.ag}; return _Utils_Tuple2( model, $author$project$Session$storeSession( @@ -7267,10 +7289,10 @@ var $author$project$Pages$Session$update = F2( return _Utils_Tuple2( _Utils_update( model, - {L: session}), + {N: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.L), + $author$project$Session$navKey(model.N), $author$project$Route$Home)); } }); @@ -7401,11 +7423,11 @@ var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; var $author$project$Page$view = F2( function (toMsg, structure) { return { - ak: A2( + al: A2( $elm$core$List$map, $elm$html$Html$map(toMsg), - structure.an), - a_: structure.a_ + structure.ap), + a0: structure.a0 }; }); var $elm$html$Html$div = _VirtualDom_node('div'); @@ -7413,7 +7435,7 @@ var $author$project$Asset$signinGithub = $author$project$Asset$image('signin-git var $author$project$Asset$signinGoogle = $author$project$Asset$image('signin-google.png'); var $author$project$Pages$Auth$showAuthUrl = function (url) { var imgSrc = function () { - var _v0 = url.a0; + var _v0 = url.a2; if (!_v0) { return $author$project$Asset$src($author$project$Asset$signinGoogle); } else { @@ -7432,7 +7454,7 @@ var $author$project$Pages$Auth$showAuthUrl = function (url) { $elm$html$Html$a, _List_fromArray( [ - $elm$html$Html$Attributes$href(url.ag) + $elm$html$Html$Attributes$href(url.ah) ]), _List_fromArray( [ @@ -7446,7 +7468,7 @@ var $author$project$Pages$Auth$showAuthUrl = function (url) { }; var $author$project$Pages$Auth$view = function (model) { return { - an: _List_fromArray( + ap: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7473,9 +7495,9 @@ var $author$project$Pages$Auth$view = function (model) { function (url) { return $author$project$Pages$Auth$showAuthUrl(url); }, - model.ah)) + model.ai)) ]), - a_: 'Auth' + a0: 'Auth' }; }; var $author$project$Pages$Capture$AddCapture = {$: 4}; @@ -7533,6 +7555,9 @@ var $elm$html$Html$Events$onInput = function (tagger) { A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); }; var $elm$html$Html$p = _VirtualDom_node('p'); +var $author$project$Pages$Capture$StartTimer = function (a) { + return {$: 5, a: a}; +}; var $elm$json$Json$Encode$bool = _Json_wrap; var $elm$html$Html$Attributes$boolProperty = F2( function (key, bool) { @@ -7542,7 +7567,34 @@ var $elm$html$Html$Attributes$boolProperty = F2( $elm$json$Json$Encode$bool(bool)); }); var $elm$html$Html$Attributes$checked = $elm$html$Html$Attributes$boolProperty('checked'); +var $elm$core$List$filter = F2( + function (isGood, list) { + return A3( + $elm$core$List$foldr, + F2( + function (x, xs) { + return isGood(x) ? A2($elm$core$List$cons, x, xs) : xs; + }), + _List_Nil, + list); + }); +var $elm$core$Tuple$second = function (_v0) { + var y = _v0.b; + return y; +}; +var $elm$html$Html$Attributes$classList = function (classes) { + return $elm$html$Html$Attributes$class( + A2( + $elm$core$String$join, + ' ', + A2( + $elm$core$List$map, + $elm$core$Tuple$first, + A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); +}; +var $elm$html$Html$Attributes$disabled = $elm$html$Html$Attributes$boolProperty('disabled'); var $elm$html$Html$label = _VirtualDom_node('label'); +var $elm$core$Basics$not = _Basics_not; var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); var $author$project$Pages$Capture$showCapture = function (capture) { return A2( @@ -7566,17 +7618,26 @@ var $author$project$Pages$Capture$showCapture = function (capture) { _List_fromArray( [ $elm$html$Html$Attributes$type_('checkbox'), - $elm$html$Html$Attributes$checked(capture.V), + $elm$html$Html$Attributes$checked(capture.ao), + $elm$html$Html$Attributes$disabled(capture.J), $elm$html$Html$Attributes$class('mr2') ]), _List_Nil), - $elm$html$Html$text(capture.N) + $elm$html$Html$text(capture.P) ])), A2( $elm$html$Html$button, _List_fromArray( [ - $elm$html$Html$Attributes$class('fr') + $elm$html$Html$Attributes$disabled(capture.J), + $elm$html$Html$Attributes$class('fr'), + $elm$html$Html$Attributes$classList( + _List_fromArray( + [ + _Utils_Tuple2('pointer', !capture.J) + ])), + $elm$html$Html$Events$onClick( + $author$project$Pages$Capture$StartTimer(capture.X)) ]), _List_fromArray( [ @@ -7587,7 +7648,7 @@ var $author$project$Pages$Capture$showCapture = function (capture) { var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); var $author$project$Pages$Capture$view = function (model) { return { - an: _List_fromArray( + ap: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7617,7 +7678,7 @@ var $author$project$Pages$Capture$view = function (model) { $elm$html$Html$text('Dwyl application') ])), function () { - var _v0 = model.L; + var _v0 = model.N; if (!_v0.$) { return A2( $elm$html$Html$a, @@ -7654,7 +7715,7 @@ var $author$project$Pages$Capture$view = function (model) { _List_fromArray( [ $elm$html$Html$Attributes$class('w-80 mr2'), - $elm$html$Html$Attributes$value(model.I.N), + $elm$html$Html$Attributes$value(model.E.P), $elm$html$Html$Events$onInput($author$project$Pages$Capture$UpdateNewCapture) ]), _List_Nil), @@ -7681,7 +7742,7 @@ var $author$project$Pages$Capture$view = function (model) { function (capture) { return $author$project$Pages$Capture$showCapture(capture); }, - model.U)) + model.I)) ])) : A2( $elm$html$Html$p, _List_fromArray( @@ -7696,13 +7757,13 @@ var $author$project$Pages$Capture$view = function (model) { } }() ]), - a_: 'Capture' + a0: 'Capture' }; }; var $elm$html$Html$span = _VirtualDom_node('span'); var $author$project$Pages$Home$view = function (model) { return { - an: _List_fromArray( + ap: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7760,7 +7821,7 @@ var $author$project$Pages$Home$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text('logged in with: ' + person.bf) + $elm$html$Html$text('logged in with: ' + person.bh) ])), A2( $elm$html$Html$a, @@ -7788,12 +7849,12 @@ var $author$project$Pages$Home$view = function (model) { } }() ]), - a_: 'Home' + a0: 'Home' }; }; var $author$project$Pages$Session$view = function (model) { return { - an: _List_fromArray( + ap: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7832,7 +7893,7 @@ var $author$project$Pages$Session$view = function (model) { $elm$html$Html$text(model.p) ])) ]), - a_: 'Auth' + a0: 'Auth' }; }; var $author$project$Main$view = function (model) { @@ -7857,7 +7918,7 @@ var $author$project$Main$view = function (model) { $author$project$Pages$Session$view(sessionModel)); case 3: return { - ak: _List_fromArray( + al: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7887,11 +7948,11 @@ var $author$project$Main$view = function (model) { $elm$html$Html$text('page not found') ])) ]), - a_: 'Not Found' + a0: 'Not Found' }; case 4: return { - ak: _List_fromArray( + al: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7921,7 +7982,7 @@ var $author$project$Main$view = function (model) { $elm$html$Html$text('Logout') ])) ]), - a_: 'Logout' + a0: 'Logout' }; default: var captureModel = model.a; @@ -7932,7 +7993,7 @@ var $author$project$Main$view = function (model) { } }; var $author$project$Main$main = $elm$browser$Browser$application( - {bo: $author$project$Main$init, bz: $author$project$Main$UrlChanged, bA: $author$project$Main$LinkClicked, bJ: $author$project$Main$subscriptions, bM: $author$project$Main$update, bN: $author$project$Main$view}); + {bq: $author$project$Main$init, bB: $author$project$Main$UrlChanged, bC: $author$project$Main$LinkClicked, bL: $author$project$Main$subscriptions, bO: $author$project$Main$update, bP: $author$project$Main$view}); _Platform_export({'Main':{'init':$author$project$Main$main( $elm$json$Json$Decode$oneOf( _List_fromArray( diff --git a/src/Endpoint.elm b/src/Endpoint.elm index 53062c5..518a3a1 100644 --- a/src/Endpoint.elm +++ b/src/Endpoint.elm @@ -20,7 +20,7 @@ url : List String -> List QueryParameter -> Endpoint url path queryParams = -- "https://dwyl-app-api.herokuapp.com" -- "http://localhost:4000" - Url.Builder.crossOrigin "https://dwyl-app-api.herokuapp.com" path queryParams + Url.Builder.crossOrigin "http://localhost:4000" path queryParams |> Endpoint diff --git a/src/Pages/Capture.elm b/src/Pages/Capture.elm index 58121a3..6b02634 100644 --- a/src/Pages/Capture.elm +++ b/src/Pages/Capture.elm @@ -26,14 +26,16 @@ type alias Model = type alias Capture = - { text : String + { idCapture : Int + , text : String , completed : Bool + , disabled : Bool } initCapture : Capture initCapture = - Capture "" False + Capture 0 "" False False init : Session -> ( Model, Cmd Msg ) @@ -51,6 +53,7 @@ type Msg | CaptureSaved (Result Http.Error Capture) | UpdateNewCapture String | AddCapture + | StartTimer Int update : Msg -> Model -> ( Model, Cmd Msg ) @@ -95,8 +98,11 @@ update msg model = UpdateNewCapture text -> let + capture = + model.newCapture + newCapture = - { text = text, completed = False } + { capture | text = text } in ( { model | newCapture = newCapture }, Cmd.none ) @@ -104,6 +110,21 @@ update msg model = AddCapture -> ( { model | newCapture = initCapture }, saveCapture (token model.session) model.newCapture ) + StartTimer idCapture -> + let + captures = + List.map + (\c -> + if c.idCapture == idCapture then + { c | disabled = True } + + else + c + ) + model.captures + in + ( { model | captures = captures }, Cmd.none ) + -- View @@ -193,9 +214,11 @@ savedCaptureDecoder = captureDecoder : JD.Decoder Capture captureDecoder = - JD.map2 Capture + JD.map4 Capture + (JD.field "capture_id" JD.int) (JD.field "text" JD.string) (JD.field "completed" JD.bool) + (JD.succeed False) captureEncode : Capture -> JD.Value @@ -213,8 +236,8 @@ showCapture capture = div [ class "pa2" ] [ label [ class "dib pa2" ] - [ input [ type_ "checkbox", checked capture.completed, class "mr2" ] [] - , text capture.text + [ input [ type_ "checkbox", checked capture.completed, disabled capture.disabled, class "mr2" ] [] + , text <| capture.text ] - , button [ class "fr" ] [ text "Start" ] + , button [ disabled capture.disabled, class "fr", classList [ ( "pointer", not capture.disabled ) ], onClick (StartTimer capture.idCapture) ] [ text "Start" ] ] From ddfe0c84d2704926606960c2df8e9f8f96cfcb46 Mon Sep 17 00:00:00 2001 From: SimonLab Date: Fri, 13 Mar 2020 17:56:45 +0100 Subject: [PATCH 2/7] start and stop timer for a capture --- elm.js | 1572 ++++++++++++++++++++++++----------------- elm.json | 6 +- src/Capture.elm | 97 +++ src/Endpoint.elm | 23 +- src/Pages/Capture.elm | 182 +++-- src/Timer.elm | 32 + 6 files changed, 1189 insertions(+), 723 deletions(-) create mode 100644 src/Capture.elm create mode 100644 src/Timer.elm diff --git a/elm.js b/elm.js index 571352f..3fc29cf 100644 --- a/elm.js +++ b/elm.js @@ -77,7 +77,7 @@ function A9(fun, a, b, c, d, e, f, g, h, i) { 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); } - +console.warn('Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.'); // EQUALITY @@ -113,7 +113,7 @@ function _Utils_eqHelp(x, y, depth, stack) return true; } - /**_UNUSED/ + /**/ if (x.$ === 'Set_elm_builtin') { x = $elm$core$Set$toList(x); @@ -126,7 +126,7 @@ function _Utils_eqHelp(x, y, depth, stack) } //*/ - /**/ + /**_UNUSED/ if (x.$ < 0) { x = $elm$core$Dict$toList(x); @@ -161,7 +161,7 @@ function _Utils_cmp(x, y, ord) return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1; } - /**_UNUSED/ + /**/ if (x instanceof String) { var a = x.valueOf(); @@ -170,10 +170,10 @@ function _Utils_cmp(x, y, ord) } //*/ - /**/ + /**_UNUSED/ if (typeof x.$ === 'undefined') //*/ - /**_UNUSED/ + /**/ if (x.$[0] === '#') //*/ { @@ -203,17 +203,17 @@ var _Utils_compare = F2(function(x, y) // COMMON VALUES -var _Utils_Tuple0 = 0; -var _Utils_Tuple0_UNUSED = { $: '#0' }; +var _Utils_Tuple0_UNUSED = 0; +var _Utils_Tuple0 = { $: '#0' }; -function _Utils_Tuple2(a, b) { return { a: a, b: b }; } -function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } +function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; } +function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; } -function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } -function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } +function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; } +function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } -function _Utils_chr(c) { return c; } -function _Utils_chr_UNUSED(c) { return new String(c); } +function _Utils_chr_UNUSED(c) { return c; } +function _Utils_chr(c) { return new String(c); } // RECORDS @@ -264,11 +264,11 @@ function _Utils_ap(xs, ys) -var _List_Nil = { $: 0 }; -var _List_Nil_UNUSED = { $: '[]' }; +var _List_Nil_UNUSED = { $: 0 }; +var _List_Nil = { $: '[]' }; -function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } -function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } +function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; } +function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; } var _List_cons = F2(_List_Cons); @@ -499,12 +499,12 @@ var _JsArray_appendN = F3(function(n, dest, source) // LOG -var _Debug_log = F2(function(tag, value) +var _Debug_log_UNUSED = F2(function(tag, value) { return value; }); -var _Debug_log_UNUSED = F2(function(tag, value) +var _Debug_log = F2(function(tag, value) { console.log(tag + ': ' + _Debug_toString(value)); return value; @@ -530,12 +530,12 @@ function _Debug_todoCase(moduleName, region, value) // TO STRING -function _Debug_toString(value) +function _Debug_toString_UNUSED(value) { return ''; } -function _Debug_toString_UNUSED(value) +function _Debug_toString(value) { return _Debug_toAnsiString(false, value); } @@ -720,13 +720,13 @@ function _Debug_toHexDigit(n) // CRASH -function _Debug_crash(identifier) +function _Debug_crash_UNUSED(identifier) { throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md'); } -function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) +function _Debug_crash(identifier, fact1, fact2, fact3, fact4) { switch(identifier) { @@ -784,11 +784,11 @@ function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.ad.K === region.as.K) + if (region.start.line === region.end.line) { - return 'on line ' + region.ad.K; + return 'on line ' + region.start.line; } - return 'on lines ' + region.ad.K + ' through ' + region.as.K; + return 'on lines ' + region.start.line + ' through ' + region.end.line; } @@ -1212,7 +1212,7 @@ function _Char_toLocaleLower(char) -/**_UNUSED/ +/**/ function _Json_errorToString(error) { return $elm$json$Json$Decode$errorToString(error); @@ -1616,11 +1616,11 @@ var _Json_encode = F2(function(indentLevel, value) return JSON.stringify(_Json_unwrap(value), null, indentLevel) + ''; }); -function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } -function _Json_unwrap_UNUSED(value) { return value.a; } +function _Json_wrap(value) { return { $: 0, a: value }; } +function _Json_unwrap(value) { return value.a; } -function _Json_wrap(value) { return value; } -function _Json_unwrap(value) { return value; } +function _Json_wrap_UNUSED(value) { return value; } +function _Json_unwrap_UNUSED(value) { return value; } function _Json_emptyArray() { return []; } function _Json_emptyObject() { return {}; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.bq, - impl.bO, - impl.bL, + impl.init, + impl.update, + impl.subscriptions, function() { return function() {} } ); }); @@ -1872,7 +1872,7 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder) { var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined)); - $elm$core$Result$isOk(result) || _Debug_crash(2 /**_UNUSED/, _Json_errorToString(result.a) /**/); + $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/); var managers = {}; result = init(result.a); var model = result.a; @@ -2316,7 +2316,7 @@ function _Platform_setupIncomingPort(name, sendToApp) // -function _Platform_export(exports) +function _Platform_export_UNUSED(exports) { scope['Elm'] ? _Platform_mergeExportsProd(scope['Elm'], exports) @@ -2337,7 +2337,7 @@ function _Platform_mergeExportsProd(obj, exports) } -function _Platform_export_UNUSED(exports) +function _Platform_export(exports) { scope['Elm'] ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports) @@ -2377,10 +2377,10 @@ var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args { // NOTE: this function needs _Platform_export available to work - /**/ + /**_UNUSED/ var node = args['node']; //*/ - /**_UNUSED/ + /**/ var node = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ @@ -2635,24 +2635,24 @@ function _VirtualDom_noInnerHtmlOrFormAction(key) return key == 'innerHTML' || key == 'formAction' ? 'data-' + key : key; } -function _VirtualDom_noJavaScriptUri(value) +function _VirtualDom_noJavaScriptUri_UNUSED(value) { return /^javascript:/i.test(value.replace(/\s/g,'')) ? '' : value; } -function _VirtualDom_noJavaScriptUri_UNUSED(value) +function _VirtualDom_noJavaScriptUri(value) { return /^javascript:/i.test(value.replace(/\s/g,'')) ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")' : value; } -function _VirtualDom_noJavaScriptOrHtmlUri(value) +function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) { return /^\s*(javascript:|data:text\/html)/i.test(value) ? '' : value; } -function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) +function _VirtualDom_noJavaScriptOrHtmlUri(value) { return /^\s*(javascript:|data:text\/html)/i.test(value) ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")' @@ -2704,9 +2704,9 @@ var _VirtualDom_mapEventTuple = F2(function(func, tuple) var _VirtualDom_mapEventRecord = F2(function(func, record) { return { - w: func(record.w), - ae: record.ae, - ab: record.ab + message: func(record.message), + stopPropagation: record.stopPropagation, + preventDefault: record.preventDefault } }); @@ -2974,11 +2974,11 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) // 3 = Custom var value = result.a; - var message = !tag ? value : tag < 3 ? value.a : value.w; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.ae; + var message = !tag ? value : tag < 3 ? value.a : value.message; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.ab) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.preventDefault) && event.preventDefault(), eventNode ); var tagger; @@ -3928,15 +3928,15 @@ var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debug return _Platform_initialize( flagDecoder, args, - impl.bq, - impl.bO, - impl.bL, + impl.init, + impl.update, + impl.subscriptions, function(sendToApp, initialModel) { - var view = impl.bP; - /**/ + var view = impl.view; + /**_UNUSED/ var domNode = args['node']; //*/ - /**_UNUSED/ + /**/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ var currNode = _VirtualDom_virtualize(domNode); @@ -3964,12 +3964,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb return _Platform_initialize( flagDecoder, args, - impl.bq, - impl.bO, - impl.bL, + impl.init, + impl.update, + impl.subscriptions, function(sendToApp, initialModel) { - var divertHrefToApp = impl.ac && impl.ac(sendToApp) - var view = impl.bP; + var divertHrefToApp = impl.setup && impl.setup(sendToApp) + var view = impl.view; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); @@ -3977,12 +3977,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb { _VirtualDom_divertHrefToApp = divertHrefToApp; var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.al); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.body); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.a0) && (_VirtualDom_doc.title = title = doc.a0); + (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); }); } ); @@ -4038,12 +4038,12 @@ function _Browser_makeAnimator(model, draw) function _Browser_application(impl) { - var onUrlChange = impl.bB; - var onUrlRequest = impl.bC; + var onUrlChange = impl.onUrlChange; + var onUrlRequest = impl.onUrlRequest; var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; return _Browser_document({ - ac: function(sendToApp) + setup: function(sendToApp) { key.a = sendToApp; _Browser_window.addEventListener('popstate', key); @@ -4059,9 +4059,9 @@ function _Browser_application(impl) var next = $elm$url$Url$fromString(href).a; sendToApp(onUrlRequest( (next - && curr.aM === next.aM - && curr.az === next.az - && curr.aJ.a === next.aJ.a + && curr.protocol === next.protocol + && curr.host === next.host + && curr.port_.a === next.port_.a ) ? $elm$browser$Browser$Internal(next) : $elm$browser$Browser$External(href) @@ -4069,13 +4069,13 @@ function _Browser_application(impl) } }); }, - bq: function(flags) + init: function(flags) { - return A3(impl.bq, flags, _Browser_getUrl(), key); + return A3(impl.init, flags, _Browser_getUrl(), key); }, - bP: impl.bP, - bO: impl.bO, - bL: impl.bL + view: impl.view, + update: impl.update, + subscriptions: impl.subscriptions }); } @@ -4141,17 +4141,17 @@ var _Browser_decodeEvent = F2(function(decoder, event) function _Browser_visibilityInfo() { return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { bo: 'hidden', bc: 'visibilitychange' } + ? { hidden: 'hidden', change: 'visibilitychange' } : (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { bo: 'mozHidden', bc: 'mozvisibilitychange' } + ? { hidden: 'mozHidden', change: 'mozvisibilitychange' } : (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { bo: 'msHidden', bc: 'msvisibilitychange' } + ? { hidden: 'msHidden', change: 'msvisibilitychange' } : (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { bo: 'webkitHidden', bc: 'webkitvisibilitychange' } - : { bo: 'hidden', bc: 'visibilitychange' }; + ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' } + : { hidden: 'hidden', change: 'visibilitychange' }; } @@ -4232,12 +4232,12 @@ var _Browser_call = F2(function(functionName, id) function _Browser_getViewport() { return { - aU: _Browser_getScene(), - a3: { - a5: _Browser_window.pageXOffset, - a6: _Browser_window.pageYOffset, - a4: _Browser_doc.documentElement.clientWidth, - ay: _Browser_doc.documentElement.clientHeight + scene: _Browser_getScene(), + viewport: { + x: _Browser_window.pageXOffset, + y: _Browser_window.pageYOffset, + width: _Browser_doc.documentElement.clientWidth, + height: _Browser_doc.documentElement.clientHeight } }; } @@ -4247,8 +4247,8 @@ function _Browser_getScene() var body = _Browser_doc.body; var elem = _Browser_doc.documentElement; return { - a4: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - ay: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) }; } @@ -4271,15 +4271,15 @@ function _Browser_getViewportOf(id) return _Browser_withNode(id, function(node) { return { - aU: { - a4: node.scrollWidth, - ay: node.scrollHeight + scene: { + width: node.scrollWidth, + height: node.scrollHeight }, - a3: { - a5: node.scrollLeft, - a6: node.scrollTop, - a4: node.clientWidth, - ay: node.clientHeight + viewport: { + x: node.scrollLeft, + y: node.scrollTop, + width: node.clientWidth, + height: node.clientHeight } }; }); @@ -4309,18 +4309,18 @@ function _Browser_getElement(id) var x = _Browser_window.pageXOffset; var y = _Browser_window.pageYOffset; return { - aU: _Browser_getScene(), - a3: { - a5: x, - a6: y, - a4: _Browser_doc.documentElement.clientWidth, - ay: _Browser_doc.documentElement.clientHeight + scene: _Browser_getScene(), + viewport: { + x: x, + y: y, + width: _Browser_doc.documentElement.clientWidth, + height: _Browser_doc.documentElement.clientHeight }, - bg: { - a5: x + rect.left, - a6: y + rect.top, - a4: rect.width, - ay: rect.height + element: { + x: x + rect.left, + y: y + rect.top, + width: rect.width, + height: rect.height } }; }); @@ -4382,25 +4382,25 @@ var _Http_toTask = F3(function(router, toTask, request) return _Scheduler_binding(function(callback) { function done(response) { - callback(toTask(request.bj.a(response))); + callback(toTask(request.expect.a(response))); } var xhr = new XMLHttpRequest(); xhr.addEventListener('error', function() { done($elm$http$Http$NetworkError_); }); xhr.addEventListener('timeout', function() { done($elm$http$Http$Timeout_); }); - xhr.addEventListener('load', function() { done(_Http_toResponse(request.bj.b, xhr)); }); - $elm$core$Maybe$isJust(request.a1) && _Http_track(router, xhr, request.a1.a); + xhr.addEventListener('load', function() { done(_Http_toResponse(request.expect.b, xhr)); }); + $elm$core$Maybe$isJust(request.tracker) && _Http_track(router, xhr, request.tracker.a); try { - xhr.open(request.aD, request.ah, true); + xhr.open(request.method, request.url, true); } catch (e) { - return done($elm$http$Http$BadUrl_(request.ah)); + return done($elm$http$Http$BadUrl_(request.url)); } _Http_configureRequest(xhr, request); - request.al.a && xhr.setRequestHeader('Content-Type', request.al.a); - xhr.send(request.al.b); + request.body.a && xhr.setRequestHeader('Content-Type', request.body.a); + xhr.send(request.body.b); return function() { xhr.c = true; xhr.abort(); }; }); @@ -4411,13 +4411,13 @@ var _Http_toTask = F3(function(router, toTask, request) function _Http_configureRequest(xhr, request) { - for (var headers = request.ax; headers.b; headers = headers.b) // WHILE_CONS + for (var headers = request.headers; headers.b; headers = headers.b) // WHILE_CONS { xhr.setRequestHeader(headers.a.a, headers.a.b); } - xhr.timeout = request.a$.a || 0; - xhr.responseType = request.bj.d; - xhr.withCredentials = request.a9; + xhr.timeout = request.timeout.a || 0; + xhr.responseType = request.expect.d; + xhr.withCredentials = request.allowCookiesFromOtherDomains; } @@ -4438,10 +4438,10 @@ function _Http_toResponse(toBody, xhr) function _Http_toMetadata(xhr) { return { - ah: xhr.responseURL, - bJ: xhr.status, - bK: xhr.statusText, - ax: _Http_parseHeaders(xhr.getAllResponseHeaders()) + url: xhr.responseURL, + statusCode: xhr.status, + statusText: xhr.statusText, + headers: _Http_parseHeaders(xhr.getAllResponseHeaders()) }; } @@ -4536,36 +4536,36 @@ function _Http_track(router, xhr, tracker) xhr.upload.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Sending({ - bI: event.loaded, - aV: event.total + sent: event.loaded, + size: event.total })))); }); xhr.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Receiving({ - bF: event.loaded, - aV: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing + received: event.loaded, + size: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing })))); }); }var $elm$core$Maybe$Just = function (a) { - return {$: 0, a: a}; + return {$: 'Just', a: a}; }; var $author$project$Main$LinkClicked = function (a) { - return {$: 1, a: a}; + return {$: 'LinkClicked', a: a}; }; -var $elm$core$Maybe$Nothing = {$: 1}; +var $elm$core$Maybe$Nothing = {$: 'Nothing'}; var $author$project$Main$UrlChanged = function (a) { - return {$: 0, a: a}; + return {$: 'UrlChanged', a: a}; }; -var $elm$core$Basics$EQ = 1; -var $elm$core$Basics$GT = 2; -var $elm$core$Basics$LT = 0; +var $elm$core$Basics$EQ = {$: 'EQ'}; +var $elm$core$Basics$GT = {$: 'GT'}; +var $elm$core$Basics$LT = {$: 'LT'}; var $elm$core$List$cons = _List_cons; var $elm$core$Dict$foldr = F3( function (func, acc, t) { foldr: while (true) { - if (t.$ === -2) { + if (t.$ === 'RBEmpty_elm_builtin') { return acc; } else { var key = t.b; @@ -4610,7 +4610,7 @@ var $elm$core$Dict$keys = function (dict) { dict); }; var $elm$core$Set$toList = function (_v0) { - var dict = _v0; + var dict = _v0.a; return $elm$core$Dict$keys(dict); }; var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; @@ -4620,7 +4620,7 @@ var $elm$core$Array$foldr = F3( var tail = _v0.d; var helper = F2( function (node, acc) { - if (!node.$) { + if (node.$ === 'SubTree') { var subTree = node.a; return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); } else { @@ -4638,27 +4638,27 @@ var $elm$core$Array$toList = function (array) { return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); }; var $elm$core$Result$Err = function (a) { - return {$: 1, a: a}; + return {$: 'Err', a: a}; }; var $elm$json$Json$Decode$Failure = F2( function (a, b) { - return {$: 3, a: a, b: b}; + return {$: 'Failure', a: a, b: b}; }); var $elm$json$Json$Decode$Field = F2( function (a, b) { - return {$: 0, a: a, b: b}; + return {$: 'Field', a: a, b: b}; }); var $elm$json$Json$Decode$Index = F2( function (a, b) { - return {$: 1, a: a, b: b}; + return {$: 'Index', a: a, b: b}; }); var $elm$core$Result$Ok = function (a) { - return {$: 0, a: a}; + return {$: 'Ok', a: a}; }; var $elm$json$Json$Decode$OneOf = function (a) { - return {$: 2, a: a}; + return {$: 'OneOf', a: a}; }; -var $elm$core$Basics$False = 1; +var $elm$core$Basics$False = {$: 'False'}; var $elm$core$Basics$add = _Basics_add; var $elm$core$String$all = _String_all; var $elm$core$Basics$and = _Basics_and; @@ -4784,12 +4784,12 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( errorToStringHelp: while (true) { switch (error.$) { - case 0: + case 'Field': var f = error.a; var err = error.b; var isSimple = function () { var _v1 = $elm$core$String$uncons(f); - if (_v1.$ === 1) { + if (_v1.$ === 'Nothing') { return false; } else { var _v2 = _v1.a; @@ -4804,7 +4804,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( error = $temp$error; context = $temp$context; continue errorToStringHelp; - case 1: + case 'Index': var i = error.a; var err = error.b; var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); @@ -4813,7 +4813,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( error = $temp$error; context = $temp$context; continue errorToStringHelp; - case 2: + case 'OneOf': var errors = error.a; if (!errors.b) { return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { @@ -4877,7 +4877,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( var $elm$core$Array$branchFactor = 32; var $elm$core$Array$Array_elm_builtin = F4( function (a, b, c, d) { - return {$: 0, a: a, b: b, c: c, d: d}; + return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d}; }); var $elm$core$Elm$JsArray$empty = _JsArray_empty; var $elm$core$Basics$ceiling = _Basics_ceiling; @@ -4892,7 +4892,7 @@ var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( 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); var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; var $elm$core$Array$Leaf = function (a) { - return {$: 1, a: a}; + return {$: 'Leaf', a: a}; }; var $elm$core$Basics$apL = F2( function (f, x) { @@ -4912,7 +4912,7 @@ var $elm$core$Basics$max = F2( }); var $elm$core$Basics$mul = _Basics_mul; var $elm$core$Array$SubTree = function (a) { - return {$: 0, a: a}; + return {$: 'SubTree', a: a}; }; var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; var $elm$core$Array$compressNodes = F2( @@ -4959,25 +4959,25 @@ var $elm$core$Array$treeFromBuilder = F2( }); var $elm$core$Array$builderToArray = F2( function (reverseNodeList, builder) { - if (!builder.b) { + if (!builder.nodeListSize) { return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.d), + $elm$core$Elm$JsArray$length(builder.tail), $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, - builder.d); + builder.tail); } else { - var treeLen = builder.b * $elm$core$Array$branchFactor; + var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor; var depth = $elm$core$Basics$floor( A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); - var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.e) : builder.e; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.b); + var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList; + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize); return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.d) + treeLen, + $elm$core$Elm$JsArray$length(builder.tail) + treeLen, A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), tree, - builder.d); + builder.tail); } }); var $elm$core$Basics$idiv = _Basics_idiv; @@ -4990,7 +4990,7 @@ var $elm$core$Array$initializeHelp = F5( return A2( $elm$core$Array$builderToArray, false, - {e: nodeList, b: (len / $elm$core$Array$branchFactor) | 0, d: tail}); + {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail}); } else { var leaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); @@ -5020,9 +5020,9 @@ var $elm$core$Array$initialize = F2( return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); } }); -var $elm$core$Basics$True = 0; +var $elm$core$Basics$True = {$: 'True'}; var $elm$core$Result$isOk = function (result) { - if (!result.$) { + if (result.$ === 'Ok') { return true; } else { return false; @@ -5033,31 +5033,33 @@ var $elm$json$Json$Decode$map2 = _Json_map2; var $elm$json$Json$Decode$succeed = _Json_succeed; var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { switch (handler.$) { - case 0: + case 'Normal': return 0; - case 1: + case 'MayStopPropagation': return 1; - case 2: + case 'MayPreventDefault': return 2; default: return 3; } }; var $elm$browser$Browser$External = function (a) { - return {$: 1, a: a}; + return {$: 'External', a: a}; }; var $elm$browser$Browser$Internal = function (a) { - return {$: 0, a: a}; + return {$: 'Internal', a: a}; }; var $elm$core$Basics$identity = function (x) { return x; }; -var $elm$browser$Browser$Dom$NotFound = $elm$core$Basics$identity; -var $elm$url$Url$Http = 0; -var $elm$url$Url$Https = 1; +var $elm$browser$Browser$Dom$NotFound = function (a) { + return {$: 'NotFound', a: a}; +}; +var $elm$url$Url$Http = {$: 'Http'}; +var $elm$url$Url$Https = {$: 'Https'}; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {au: fragment, az: host, aH: path, aJ: port_, aM: protocol, aN: query}; + return {fragment: fragment, host: host, path: path, port_: port_, protocol: protocol, query: query}; }); var $elm$core$String$contains = _String_contains; var $elm$core$String$length = _String_length; @@ -5093,7 +5095,7 @@ var $elm$url$Url$chompBeforePath = F5( var i = _v0.a; var _v1 = $elm$core$String$toInt( A2($elm$core$String$dropLeft, i + 1, str)); - if (_v1.$ === 1) { + if (_v1.$ === 'Nothing') { return $elm$core$Maybe$Nothing; } else { var port_ = _v1; @@ -5176,24 +5178,26 @@ var $elm$core$String$startsWith = _String_startsWith; var $elm$url$Url$fromString = function (str) { return A2($elm$core$String$startsWith, 'http://', str) ? A2( $elm$url$Url$chompAfterProtocol, - 0, + $elm$url$Url$Http, A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( $elm$url$Url$chompAfterProtocol, - 1, + $elm$url$Url$Https, A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); }; var $elm$core$Basics$never = function (_v0) { never: while (true) { - var nvr = _v0; + var nvr = _v0.a; var $temp$_v0 = nvr; _v0 = $temp$_v0; continue never; } }; -var $elm$core$Task$Perform = $elm$core$Basics$identity; +var $elm$core$Task$Perform = function (a) { + return {$: 'Perform', a: a}; +}; var $elm$core$Task$succeed = _Scheduler_succeed; -var $elm$core$Task$init = $elm$core$Task$succeed(0); +var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0); var $elm$core$List$foldrHelper = F4( function (fn, acc, ctr, ls) { if (!ls.b) { @@ -5299,7 +5303,7 @@ var $elm$core$Task$sequence = function (tasks) { var $elm$core$Platform$sendToApp = _Platform_sendToApp; var $elm$core$Task$spawnCmd = F2( function (router, _v0) { - var task = _v0; + var task = _v0.a; return _Scheduler_spawn( A2( $elm$core$Task$andThen, @@ -5311,7 +5315,7 @@ var $elm$core$Task$onEffects = F3( return A2( $elm$core$Task$map, function (_v0) { - return 0; + return _Utils_Tuple0; }, $elm$core$Task$sequence( A2( @@ -5321,34 +5325,36 @@ var $elm$core$Task$onEffects = F3( }); var $elm$core$Task$onSelfMsg = F3( function (_v0, _v1, _v2) { - return $elm$core$Task$succeed(0); + return $elm$core$Task$succeed(_Utils_Tuple0); }); var $elm$core$Task$cmdMap = F2( function (tagger, _v0) { - var task = _v0; - return A2($elm$core$Task$map, tagger, task); + var task = _v0.a; + return $elm$core$Task$Perform( + A2($elm$core$Task$map, tagger, task)); }); _Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); var $elm$core$Task$command = _Platform_leaf('Task'); var $elm$core$Task$perform = F2( function (toMessage, task) { return $elm$core$Task$command( - A2($elm$core$Task$map, toMessage, task)); + $elm$core$Task$Perform( + A2($elm$core$Task$map, toMessage, task))); }); var $elm$browser$Browser$application = _Browser_application; var $author$project$Session$Guest = function (a) { - return {$: 0, a: a}; + return {$: 'Guest', a: a}; }; var $author$project$Main$NotFound = function (a) { - return {$: 3, a: a}; + return {$: 'NotFound', a: a}; }; var $author$project$Session$Person = F2( function (email, token) { - return {bh: email, ag: token}; + return {email: email, token: token}; }); var $author$project$Session$Session = F2( function (a, b) { - return {$: 1, a: a, b: b}; + return {$: 'Session', a: a, b: b}; }); var $elm$json$Json$Decode$decodeString = _Json_runOnString; var $elm$json$Json$Decode$field = _Json_decodeField; @@ -5363,7 +5369,7 @@ var $author$project$Session$decode = F2( A2($elm$json$Json$Decode$field, 'email', $elm$json$Json$Decode$string), A2($elm$json$Json$Decode$field, 'token', $elm$json$Json$Decode$string)), str); - if (!_v0.$) { + if (_v0.$ === 'Ok') { var p = _v0.a; return A2($author$project$Session$Session, key, p); } else { @@ -5372,7 +5378,7 @@ var $author$project$Session$decode = F2( }); var $elm$url$Url$Parser$State = F5( function (visited, unvisited, params, frag, value) { - return {z: frag, A: params, y: unvisited, u: value, C: visited}; + return {frag: frag, params: params, unvisited: unvisited, value: value, visited: visited}; }); var $elm$url$Url$Parser$getFirstMatch = function (states) { getFirstMatch: @@ -5382,12 +5388,12 @@ var $elm$url$Url$Parser$getFirstMatch = function (states) { } else { var state = states.a; var rest = states.b; - var _v1 = state.y; + var _v1 = state.unvisited; if (!_v1.b) { - return $elm$core$Maybe$Just(state.u); + return $elm$core$Maybe$Just(state.value); } else { if ((_v1.a === '') && (!_v1.b.b)) { - return $elm$core$Maybe$Just(state.u); + return $elm$core$Maybe$Just(state.value); } else { var $temp$states = rest; states = $temp$states; @@ -5425,7 +5431,7 @@ var $elm$url$Url$Parser$preparePath = function (path) { }; var $elm$url$Url$Parser$addToParametersHelp = F2( function (value, maybeList) { - if (maybeList.$ === 1) { + if (maybeList.$ === 'Nothing') { return $elm$core$Maybe$Just( _List_fromArray( [value])); @@ -5441,7 +5447,7 @@ var $elm$core$Dict$get = F2( function (targetKey, dict) { get: while (true) { - if (dict.$ === -2) { + if (dict.$ === 'RBEmpty_elm_builtin') { return $elm$core$Maybe$Nothing; } else { var key = dict.b; @@ -5449,14 +5455,14 @@ var $elm$core$Dict$get = F2( var left = dict.d; var right = dict.e; var _v1 = A2($elm$core$Basics$compare, targetKey, key); - switch (_v1) { - case 0: + switch (_v1.$) { + case 'LT': var $temp$targetKey = targetKey, $temp$dict = left; targetKey = $temp$targetKey; dict = $temp$dict; continue get; - case 1: + case 'EQ': return $elm$core$Maybe$Just(value); default: var $temp$targetKey = targetKey, @@ -5468,22 +5474,22 @@ var $elm$core$Dict$get = F2( } } }); -var $elm$core$Dict$Black = 1; +var $elm$core$Dict$Black = {$: 'Black'}; var $elm$core$Dict$RBNode_elm_builtin = F5( function (a, b, c, d, e) { - return {$: -1, a: a, b: b, c: c, d: d, e: e}; + return {$: 'RBNode_elm_builtin', a: a, b: b, c: c, d: d, e: e}; }); -var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; -var $elm$core$Dict$Red = 0; +var $elm$core$Dict$RBEmpty_elm_builtin = {$: 'RBEmpty_elm_builtin'}; +var $elm$core$Dict$Red = {$: 'Red'}; var $elm$core$Dict$balance = F5( function (color, key, value, left, right) { - if ((right.$ === -1) && (!right.a)) { + if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Red')) { var _v1 = right.a; var rK = right.b; var rV = right.c; var rLeft = right.d; var rRight = right.e; - if ((left.$ === -1) && (!left.a)) { + if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { var _v3 = left.a; var lK = left.b; var lV = left.c; @@ -5491,22 +5497,22 @@ var $elm$core$Dict$balance = F5( var lRight = left.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - 0, + $elm$core$Dict$Red, key, value, - A5($elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, color, rK, rV, - A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, left, rLeft), rRight); } } else { - if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) { + if ((((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) && (left.d.$ === 'RBNode_elm_builtin')) && (left.d.a.$ === 'Red')) { var _v5 = left.a; var lK = left.b; var lV = left.c; @@ -5519,11 +5525,11 @@ var $elm$core$Dict$balance = F5( var lRight = left.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - 0, + $elm$core$Dict$Red, lK, lV, - A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), - A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, key, value, lRight, right)); } else { return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); } @@ -5531,8 +5537,8 @@ var $elm$core$Dict$balance = F5( }); var $elm$core$Dict$insertHelp = F3( function (key, value, dict) { - if (dict.$ === -2) { - return A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); + if (dict.$ === 'RBEmpty_elm_builtin') { + return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); } else { var nColor = dict.a; var nKey = dict.b; @@ -5540,8 +5546,8 @@ var $elm$core$Dict$insertHelp = F3( var nLeft = dict.d; var nRight = dict.e; var _v1 = A2($elm$core$Basics$compare, key, nKey); - switch (_v1) { - case 0: + switch (_v1.$) { + case 'LT': return A5( $elm$core$Dict$balance, nColor, @@ -5549,7 +5555,7 @@ var $elm$core$Dict$insertHelp = F3( nValue, A3($elm$core$Dict$insertHelp, key, value, nLeft), nRight); - case 1: + case 'EQ': return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); default: return A5( @@ -5565,13 +5571,13 @@ var $elm$core$Dict$insertHelp = F3( var $elm$core$Dict$insert = F3( function (key, value, dict) { var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); - if ((_v0.$ === -1) && (!_v0.a)) { + if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { var _v1 = _v0.a; var k = _v0.b; var v = _v0.c; var l = _v0.d; var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); + return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); } else { var x = _v0; return x; @@ -5580,7 +5586,7 @@ var $elm$core$Dict$insert = F3( var $elm$core$Dict$getMin = function (dict) { getMin: while (true) { - if ((dict.$ === -1) && (dict.d.$ === -1)) { + if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { var left = dict.d; var $temp$dict = left; dict = $temp$dict; @@ -5591,8 +5597,8 @@ var $elm$core$Dict$getMin = function (dict) { } }; var $elm$core$Dict$moveRedLeft = function (dict) { - if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { - if ((dict.e.d.$ === -1) && (!dict.e.d.a)) { + if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { + if ((dict.e.d.$ === 'RBNode_elm_builtin') && (dict.e.d.a.$ === 'Red')) { var clr = dict.a; var k = dict.b; var v = dict.c; @@ -5615,17 +5621,17 @@ var $elm$core$Dict$moveRedLeft = function (dict) { var rRight = _v2.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - 0, + $elm$core$Dict$Red, rlK, rlV, A5( $elm$core$Dict$RBNode_elm_builtin, - 1, + $elm$core$Dict$Black, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), rlL), - A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rlR, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rlR, rRight)); } else { var clr = dict.a; var k = dict.b; @@ -5642,22 +5648,22 @@ var $elm$core$Dict$moveRedLeft = function (dict) { var rV = _v5.c; var rLeft = _v5.d; var rRight = _v5.e; - if (clr === 1) { + if (clr.$ === 'Black') { return A5( $elm$core$Dict$RBNode_elm_builtin, - 1, + $elm$core$Dict$Black, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, - 1, + $elm$core$Dict$Black, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); } } } else { @@ -5665,8 +5671,8 @@ var $elm$core$Dict$moveRedLeft = function (dict) { } }; var $elm$core$Dict$moveRedRight = function (dict) { - if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { - if ((dict.d.d.$ === -1) && (!dict.d.d.a)) { + if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { + if ((dict.d.d.$ === 'RBNode_elm_builtin') && (dict.d.d.a.$ === 'Red')) { var clr = dict.a; var k = dict.b; var v = dict.c; @@ -5689,17 +5695,17 @@ var $elm$core$Dict$moveRedRight = function (dict) { var rRight = _v4.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - 0, + $elm$core$Dict$Red, lK, lV, - A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), A5( $elm$core$Dict$RBNode_elm_builtin, - 1, + $elm$core$Dict$Black, k, v, lRight, - A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight))); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight))); } else { var clr = dict.a; var k = dict.b; @@ -5716,22 +5722,22 @@ var $elm$core$Dict$moveRedRight = function (dict) { var rV = _v6.c; var rLeft = _v6.d; var rRight = _v6.e; - if (clr === 1) { + if (clr.$ === 'Black') { return A5( $elm$core$Dict$RBNode_elm_builtin, - 1, + $elm$core$Dict$Black, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, - 1, + $elm$core$Dict$Black, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); } } } else { @@ -5740,7 +5746,7 @@ var $elm$core$Dict$moveRedRight = function (dict) { }; var $elm$core$Dict$removeHelpPrepEQGT = F7( function (targetKey, dict, color, key, value, left, right) { - if ((left.$ === -1) && (!left.a)) { + if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { var _v1 = left.a; var lK = left.b; var lV = left.c; @@ -5752,13 +5758,13 @@ var $elm$core$Dict$removeHelpPrepEQGT = F7( lK, lV, lLeft, - A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, lRight, right)); + A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, lRight, right)); } else { _v2$2: while (true) { - if ((right.$ === -1) && (right.a === 1)) { - if (right.d.$ === -1) { - if (right.d.a === 1) { + if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Black')) { + if (right.d.$ === 'RBNode_elm_builtin') { + if (right.d.a.$ === 'Black') { var _v3 = right.a; var _v4 = right.d; var _v5 = _v4.a; @@ -5779,7 +5785,7 @@ var $elm$core$Dict$removeHelpPrepEQGT = F7( } }); var $elm$core$Dict$removeMin = function (dict) { - if ((dict.$ === -1) && (dict.d.$ === -1)) { + if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { var color = dict.a; var key = dict.b; var value = dict.c; @@ -5787,8 +5793,8 @@ var $elm$core$Dict$removeMin = function (dict) { var lColor = left.a; var lLeft = left.d; var right = dict.e; - if (lColor === 1) { - if ((lLeft.$ === -1) && (!lLeft.a)) { + if (lColor.$ === 'Black') { + if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { var _v3 = lLeft.a; return A5( $elm$core$Dict$RBNode_elm_builtin, @@ -5799,7 +5805,7 @@ var $elm$core$Dict$removeMin = function (dict) { right); } else { var _v4 = $elm$core$Dict$moveRedLeft(dict); - if (_v4.$ === -1) { + if (_v4.$ === 'RBNode_elm_builtin') { var nColor = _v4.a; var nKey = _v4.b; var nValue = _v4.c; @@ -5831,7 +5837,7 @@ var $elm$core$Dict$removeMin = function (dict) { }; var $elm$core$Dict$removeHelp = F2( function (targetKey, dict) { - if (dict.$ === -2) { + if (dict.$ === 'RBEmpty_elm_builtin') { return $elm$core$Dict$RBEmpty_elm_builtin; } else { var color = dict.a; @@ -5840,10 +5846,10 @@ var $elm$core$Dict$removeHelp = F2( var left = dict.d; var right = dict.e; if (_Utils_cmp(targetKey, key) < 0) { - if ((left.$ === -1) && (left.a === 1)) { + if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Black')) { var _v4 = left.a; var lLeft = left.d; - if ((lLeft.$ === -1) && (!lLeft.a)) { + if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { var _v6 = lLeft.a; return A5( $elm$core$Dict$RBNode_elm_builtin, @@ -5854,7 +5860,7 @@ var $elm$core$Dict$removeHelp = F2( right); } else { var _v7 = $elm$core$Dict$moveRedLeft(dict); - if (_v7.$ === -1) { + if (_v7.$ === 'RBNode_elm_builtin') { var nColor = _v7.a; var nKey = _v7.b; var nValue = _v7.c; @@ -5890,7 +5896,7 @@ var $elm$core$Dict$removeHelp = F2( }); var $elm$core$Dict$removeHelpEQGT = F2( function (targetKey, dict) { - if (dict.$ === -1) { + if (dict.$ === 'RBNode_elm_builtin') { var color = dict.a; var key = dict.b; var value = dict.c; @@ -5898,7 +5904,7 @@ var $elm$core$Dict$removeHelpEQGT = F2( var right = dict.e; if (_Utils_eq(targetKey, key)) { var _v1 = $elm$core$Dict$getMin(right); - if (_v1.$ === -1) { + if (_v1.$ === 'RBNode_elm_builtin') { var minKey = _v1.b; var minValue = _v1.c; return A5( @@ -5927,13 +5933,13 @@ var $elm$core$Dict$removeHelpEQGT = F2( var $elm$core$Dict$remove = F2( function (key, dict) { var _v0 = A2($elm$core$Dict$removeHelp, key, dict); - if ((_v0.$ === -1) && (!_v0.a)) { + if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { var _v1 = _v0.a; var k = _v0.b; var v = _v0.c; var l = _v0.d; var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); + return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); } else { var x = _v0; return x; @@ -5943,7 +5949,7 @@ var $elm$core$Dict$update = F3( function (targetKey, alter, dictionary) { var _v0 = alter( A2($elm$core$Dict$get, targetKey, dictionary)); - if (!_v0.$) { + if (_v0.$ === 'Just') { var value = _v0.a; return A3($elm$core$Dict$insert, targetKey, value, dictionary); } else { @@ -5958,12 +5964,12 @@ var $elm$url$Url$Parser$addParam = F2( var _v1 = _v0.b; var rawValue = _v1.a; var _v2 = $elm$url$Url$percentDecode(rawKey); - if (_v2.$ === 1) { + if (_v2.$ === 'Nothing') { return dict; } else { var key = _v2.a; var _v3 = $elm$url$Url$percentDecode(rawValue); - if (_v3.$ === 1) { + if (_v3.$ === 'Nothing') { return dict; } else { var value = _v3.a; @@ -5980,7 +5986,7 @@ var $elm$url$Url$Parser$addParam = F2( }); var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; var $elm$url$Url$Parser$prepareQuery = function (maybeQuery) { - if (maybeQuery.$ === 1) { + if (maybeQuery.$ === 'Nothing') { return $elm$core$Dict$empty; } else { var qry = maybeQuery.a; @@ -5993,31 +5999,33 @@ var $elm$url$Url$Parser$prepareQuery = function (maybeQuery) { }; var $elm$url$Url$Parser$parse = F2( function (_v0, url) { - var parser = _v0; + var parser = _v0.a; return $elm$url$Url$Parser$getFirstMatch( parser( A5( $elm$url$Url$Parser$State, _List_Nil, - $elm$url$Url$Parser$preparePath(url.aH), - $elm$url$Url$Parser$prepareQuery(url.aN), - url.au, + $elm$url$Url$Parser$preparePath(url.path), + $elm$url$Url$Parser$prepareQuery(url.query), + url.fragment, $elm$core$Basics$identity))); }); var $author$project$Route$Auth = function (a) { - return {$: 1, a: a}; + return {$: 'Auth', a: a}; +}; +var $author$project$Route$Capture = {$: 'Capture'}; +var $author$project$Route$Home = {$: 'Home'}; +var $author$project$Route$Logout = {$: 'Logout'}; +var $elm$url$Url$Parser$Parser = function (a) { + return {$: 'Parser', a: a}; }; -var $author$project$Route$Capture = {$: 3}; -var $author$project$Route$Home = {$: 0}; -var $author$project$Route$Logout = {$: 2}; -var $elm$url$Url$Parser$Parser = $elm$core$Basics$identity; var $elm$url$Url$Parser$mapState = F2( function (func, _v0) { - var visited = _v0.C; - var unvisited = _v0.y; - var params = _v0.A; - var frag = _v0.z; - var value = _v0.u; + var visited = _v0.visited; + var unvisited = _v0.unvisited; + var params = _v0.params; + var frag = _v0.frag; + var value = _v0.value; return A5( $elm$url$Url$Parser$State, visited, @@ -6028,19 +6036,20 @@ var $elm$url$Url$Parser$mapState = F2( }); var $elm$url$Url$Parser$map = F2( function (subValue, _v0) { - var parseArg = _v0; - return function (_v1) { - var visited = _v1.C; - var unvisited = _v1.y; - var params = _v1.A; - var frag = _v1.z; - var value = _v1.u; - return A2( - $elm$core$List$map, - $elm$url$Url$Parser$mapState(value), - parseArg( - A5($elm$url$Url$Parser$State, visited, unvisited, params, frag, subValue))); - }; + var parseArg = _v0.a; + return $elm$url$Url$Parser$Parser( + function (_v1) { + var visited = _v1.visited; + var unvisited = _v1.unvisited; + var params = _v1.params; + var frag = _v1.frag; + var value = _v1.value; + return A2( + $elm$core$List$map, + $elm$url$Url$Parser$mapState(value), + parseArg( + A5($elm$url$Url$Parser$State, visited, unvisited, params, frag, subValue))); + }); }); var $elm$core$List$append = F2( function (xs, ys) { @@ -6059,47 +6068,50 @@ var $elm$core$List$concatMap = F2( A2($elm$core$List$map, f, list)); }); var $elm$url$Url$Parser$oneOf = function (parsers) { - return function (state) { - return A2( - $elm$core$List$concatMap, - function (_v0) { - var parser = _v0; - return parser(state); - }, - parsers); - }; + return $elm$url$Url$Parser$Parser( + function (state) { + return A2( + $elm$core$List$concatMap, + function (_v0) { + var parser = _v0.a; + return parser(state); + }, + parsers); + }); }; var $elm$url$Url$Parser$query = function (_v0) { - var queryParser = _v0; - return function (_v1) { - var visited = _v1.C; - var unvisited = _v1.y; - var params = _v1.A; - var frag = _v1.z; - var value = _v1.u; - return _List_fromArray( - [ - A5( - $elm$url$Url$Parser$State, - visited, - unvisited, - params, - frag, - value( - queryParser(params))) - ]); - }; + var queryParser = _v0.a; + return $elm$url$Url$Parser$Parser( + function (_v1) { + var visited = _v1.visited; + var unvisited = _v1.unvisited; + var params = _v1.params; + var frag = _v1.frag; + var value = _v1.value; + return _List_fromArray( + [ + A5( + $elm$url$Url$Parser$State, + visited, + unvisited, + params, + frag, + value( + queryParser(params))) + ]); + }); }; var $elm$url$Url$Parser$slash = F2( function (_v0, _v1) { - var parseBefore = _v0; - var parseAfter = _v1; - return function (state) { - return A2( - $elm$core$List$concatMap, - parseAfter, - parseBefore(state)); - }; + var parseBefore = _v0.a; + var parseAfter = _v1.a; + return $elm$url$Url$Parser$Parser( + function (state) { + return A2( + $elm$core$List$concatMap, + parseAfter, + parseBefore(state)); + }); }); var $elm$url$Url$Parser$questionMark = F2( function (parser, queryParser) { @@ -6109,34 +6121,37 @@ var $elm$url$Url$Parser$questionMark = F2( $elm$url$Url$Parser$query(queryParser)); }); var $elm$url$Url$Parser$s = function (str) { - return function (_v0) { - var visited = _v0.C; - var unvisited = _v0.y; - var params = _v0.A; - var frag = _v0.z; - var value = _v0.u; - if (!unvisited.b) { - return _List_Nil; - } else { - var next = unvisited.a; - var rest = unvisited.b; - return _Utils_eq(next, str) ? _List_fromArray( - [ - A5( - $elm$url$Url$Parser$State, - A2($elm$core$List$cons, next, visited), - rest, - params, - frag, - value) - ]) : _List_Nil; - } - }; + return $elm$url$Url$Parser$Parser( + function (_v0) { + var visited = _v0.visited; + var unvisited = _v0.unvisited; + var params = _v0.params; + var frag = _v0.frag; + var value = _v0.value; + if (!unvisited.b) { + return _List_Nil; + } else { + var next = unvisited.a; + var rest = unvisited.b; + return _Utils_eq(next, str) ? _List_fromArray( + [ + A5( + $elm$url$Url$Parser$State, + A2($elm$core$List$cons, next, visited), + rest, + params, + frag, + value) + ]) : _List_Nil; + } + }); +}; +var $elm$url$Url$Parser$Internal$Parser = function (a) { + return {$: 'Parser', a: a}; }; -var $elm$url$Url$Parser$Internal$Parser = $elm$core$Basics$identity; var $elm$core$Maybe$withDefault = F2( function (_default, maybe) { - if (!maybe.$) { + if (maybe.$ === 'Just') { var value = maybe.a; return value; } else { @@ -6145,13 +6160,14 @@ var $elm$core$Maybe$withDefault = F2( }); var $elm$url$Url$Parser$Query$custom = F2( function (key, func) { - return function (dict) { - return func( - A2( - $elm$core$Maybe$withDefault, - _List_Nil, - A2($elm$core$Dict$get, key, dict))); - }; + return $elm$url$Url$Parser$Internal$Parser( + function (dict) { + return func( + A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2($elm$core$Dict$get, key, dict))); + }); }); var $elm$url$Url$Parser$Query$string = function (key) { return A2( @@ -6166,10 +6182,11 @@ var $elm$url$Url$Parser$Query$string = function (key) { } }); }; -var $elm$url$Url$Parser$top = function (state) { - return _List_fromArray( - [state]); -}; +var $elm$url$Url$Parser$top = $elm$url$Url$Parser$Parser( + function (state) { + return _List_fromArray( + [state]); + }); var $author$project$Route$routeParser = $elm$url$Url$Parser$oneOf( _List_fromArray( [ @@ -6194,41 +6211,43 @@ var $author$project$Route$fromUrl = function (url) { return A2($elm$url$Url$Parser$parse, $author$project$Route$routeParser, url); }; var $author$project$Main$Auth = function (a) { - return {$: 1, a: a}; + return {$: 'Auth', a: a}; }; var $author$project$Main$Capture = function (a) { - return {$: 5, a: a}; + return {$: 'Capture', a: a}; }; var $author$project$Main$GotAuthMsg = function (a) { - return {$: 3, a: a}; + return {$: 'GotAuthMsg', a: a}; }; var $author$project$Main$GotCaptureMsg = function (a) { - return {$: 5, a: a}; + return {$: 'GotCaptureMsg', a: a}; }; var $author$project$Main$GotHomeMsg = function (a) { - return {$: 2, a: a}; + return {$: 'GotHomeMsg', a: a}; }; var $author$project$Main$GotPagesSessionMsg = function (a) { - return {$: 4, a: a}; + return {$: 'GotPagesSessionMsg', a: a}; }; var $author$project$Main$Home = function (a) { - return {$: 0, a: a}; + return {$: 'Home', a: a}; }; var $author$project$Main$Logout = function (a) { - return {$: 4, a: a}; + return {$: 'Logout', a: a}; }; var $author$project$Main$Session = function (a) { - return {$: 2, a: a}; + return {$: 'Session', a: a}; }; var $elm$core$Platform$Cmd$batch = _Platform_batch; var $author$project$Pages$Auth$Model = F2( function (session, urls) { - return {N: session, ai: urls}; + return {session: session, urls: urls}; }); var $author$project$Pages$Auth$GotAuthUrls = function (a) { - return {$: 0, a: a}; + return {$: 'GotAuthUrls', a: a}; +}; +var $author$project$Endpoint$Endpoint = function (a) { + return {$: 'Endpoint', a: a}; }; -var $author$project$Endpoint$Endpoint = $elm$core$Basics$identity; var $elm$url$Url$Builder$toQueryPair = function (_v0) { var key = _v0.a; var value = _v0.b; @@ -6250,7 +6269,8 @@ var $elm$url$Url$Builder$crossOrigin = F3( }); var $author$project$Endpoint$url = F2( function (path, queryParams) { - return A3($elm$url$Url$Builder$crossOrigin, 'http://localhost:4000', path, queryParams); + return $author$project$Endpoint$Endpoint( + A3($elm$url$Url$Builder$crossOrigin, 'http://localhost:4000', path, queryParams)); }); var $author$project$Endpoint$authUrls = A2( $author$project$Endpoint$url, @@ -6260,10 +6280,10 @@ var $author$project$Endpoint$authUrls = A2( var $elm$json$Json$Decode$list = _Json_decodeList; var $author$project$Pages$Auth$Url = F2( function (url, typeUrl) { - return {a2: typeUrl, ah: url}; + return {typeUrl: typeUrl, url: url}; }); -var $author$project$Pages$Auth$Github = 1; -var $author$project$Pages$Auth$Google = 0; +var $author$project$Pages$Auth$Github = {$: 'Github'}; +var $author$project$Pages$Auth$Google = {$: 'Google'}; var $elm$json$Json$Decode$andThen = _Json_andThen; var $elm$json$Json$Decode$fail = _Json_fail; var $author$project$Pages$Auth$urlTypeDecoder = A2( @@ -6271,9 +6291,9 @@ var $author$project$Pages$Auth$urlTypeDecoder = A2( function (str) { switch (str) { case 'google': - return $elm$json$Json$Decode$succeed(0); + return $elm$json$Json$Decode$succeed($author$project$Pages$Auth$Google); case 'github': - return $elm$json$Json$Decode$succeed(1); + return $elm$json$Json$Decode$succeed($author$project$Pages$Auth$Github); default: return $elm$json$Json$Decode$fail('unkown type url'); } @@ -6290,25 +6310,25 @@ var $author$project$Pages$Auth$authUrlsDecoder = A2( $elm$json$Json$Decode$list($author$project$Pages$Auth$urlDecoder)); var $elm$http$Http$BadStatus_ = F2( function (a, b) { - return {$: 3, a: a, b: b}; + return {$: 'BadStatus_', a: a, b: b}; }); var $elm$http$Http$BadUrl_ = function (a) { - return {$: 0, a: a}; + return {$: 'BadUrl_', a: a}; }; var $elm$http$Http$GoodStatus_ = F2( function (a, b) { - return {$: 4, a: a, b: b}; + return {$: 'GoodStatus_', a: a, b: b}; }); -var $elm$http$Http$NetworkError_ = {$: 2}; +var $elm$http$Http$NetworkError_ = {$: 'NetworkError_'}; var $elm$http$Http$Receiving = function (a) { - return {$: 1, a: a}; + return {$: 'Receiving', a: a}; }; var $elm$http$Http$Sending = function (a) { - return {$: 0, a: a}; + return {$: 'Sending', a: a}; }; -var $elm$http$Http$Timeout_ = {$: 1}; +var $elm$http$Http$Timeout_ = {$: 'Timeout_'}; var $elm$core$Maybe$isJust = function (maybe) { - if (!maybe.$) { + if (maybe.$ === 'Just') { return true; } else { return false; @@ -6330,7 +6350,7 @@ var $elm$http$Http$expectStringResponse = F2( }); var $elm$core$Result$mapError = F2( function (f, result) { - if (!result.$) { + if (result.$ === 'Ok') { var v = result.a; return $elm$core$Result$Ok(v); } else { @@ -6340,31 +6360,31 @@ var $elm$core$Result$mapError = F2( } }); var $elm$http$Http$BadBody = function (a) { - return {$: 4, a: a}; + return {$: 'BadBody', a: a}; }; var $elm$http$Http$BadStatus = function (a) { - return {$: 3, a: a}; + return {$: 'BadStatus', a: a}; }; var $elm$http$Http$BadUrl = function (a) { - return {$: 0, a: a}; + return {$: 'BadUrl', a: a}; }; -var $elm$http$Http$NetworkError = {$: 2}; -var $elm$http$Http$Timeout = {$: 1}; +var $elm$http$Http$NetworkError = {$: 'NetworkError'}; +var $elm$http$Http$Timeout = {$: 'Timeout'}; var $elm$http$Http$resolve = F2( function (toResult, response) { switch (response.$) { - case 0: + case 'BadUrl_': var url = response.a; return $elm$core$Result$Err( $elm$http$Http$BadUrl(url)); - case 1: + case 'Timeout_': return $elm$core$Result$Err($elm$http$Http$Timeout); - case 2: + case 'NetworkError_': return $elm$core$Result$Err($elm$http$Http$NetworkError); - case 3: + case 'BadStatus_': var metadata = response.a; return $elm$core$Result$Err( - $elm$http$Http$BadStatus(metadata.bJ)); + $elm$http$Http$BadStatus(metadata.statusCode)); default: var body = response.b; return A2( @@ -6388,11 +6408,11 @@ var $elm$http$Http$expectJson = F2( }); var $elm$http$Http$emptyBody = _Http_emptyBody; var $elm$http$Http$Request = function (a) { - return {$: 1, a: a}; + return {$: 'Request', a: a}; }; var $elm$http$Http$State = F2( function (reqs, subs) { - return {aP: reqs, aZ: subs}; + return {reqs: reqs, subs: subs}; }); var $elm$http$Http$init = $elm$core$Task$succeed( A2($elm$http$Http$State, $elm$core$Dict$empty, _List_Nil)); @@ -6407,10 +6427,10 @@ var $elm$http$Http$updateReqs = F3( } else { var cmd = cmds.a; var otherCmds = cmds.b; - if (!cmd.$) { + if (cmd.$ === 'Cancel') { var tracker = cmd.a; var _v2 = A2($elm$core$Dict$get, tracker, reqs); - if (_v2.$ === 1) { + if (_v2.$ === 'Nothing') { var $temp$router = router, $temp$cmds = otherCmds, $temp$reqs = reqs; @@ -6436,8 +6456,8 @@ var $elm$http$Http$updateReqs = F3( return A2( $elm$core$Task$andThen, function (pid) { - var _v4 = req.a1; - if (_v4.$ === 1) { + var _v4 = req.tracker; + if (_v4.$ === 'Nothing') { return A3($elm$http$Http$updateReqs, router, otherCmds, reqs); } else { var tracker = _v4.a; @@ -6466,12 +6486,12 @@ var $elm$http$Http$onEffects = F4( return $elm$core$Task$succeed( A2($elm$http$Http$State, reqs, subs)); }, - A3($elm$http$Http$updateReqs, router, cmds, state.aP)); + A3($elm$http$Http$updateReqs, router, cmds, state.reqs)); }); var $elm$core$List$maybeCons = F3( function (f, mx, xs) { var _v0 = f(mx); - if (!_v0.$) { + if (_v0.$ === 'Just') { var x = _v0.a; return A2($elm$core$List$cons, x, xs); } else { @@ -6509,34 +6529,34 @@ var $elm$http$Http$onSelfMsg = F3( A2( $elm$core$List$filterMap, A3($elm$http$Http$maybeSend, router, tracker, progress), - state.aZ))); + state.subs))); }); var $elm$http$Http$Cancel = function (a) { - return {$: 0, a: a}; + return {$: 'Cancel', a: a}; }; var $elm$http$Http$cmdMap = F2( function (func, cmd) { - if (!cmd.$) { + if (cmd.$ === 'Cancel') { var tracker = cmd.a; return $elm$http$Http$Cancel(tracker); } else { var r = cmd.a; return $elm$http$Http$Request( { - a9: r.a9, - al: r.al, - bj: A2(_Http_mapExpect, func, r.bj), - ax: r.ax, - aD: r.aD, - a$: r.a$, - a1: r.a1, - ah: r.ah + allowCookiesFromOtherDomains: r.allowCookiesFromOtherDomains, + body: r.body, + expect: A2(_Http_mapExpect, func, r.expect), + headers: r.headers, + method: r.method, + timeout: r.timeout, + tracker: r.tracker, + url: r.url }); } }); var $elm$http$Http$MySub = F2( function (a, b) { - return {$: 0, a: a, b: b}; + return {$: 'MySub', a: a, b: b}; }); var $elm$http$Http$subMap = F2( function (func, _v0) { @@ -6553,20 +6573,20 @@ var $elm$http$Http$subscription = _Platform_leaf('Http'); var $elm$http$Http$request = function (r) { return $elm$http$Http$command( $elm$http$Http$Request( - {a9: false, al: r.al, bj: r.bj, ax: r.ax, aD: r.aD, a$: r.a$, a1: r.a1, ah: r.ah})); + {allowCookiesFromOtherDomains: false, body: r.body, expect: r.expect, headers: r.headers, method: r.method, timeout: r.timeout, tracker: r.tracker, url: r.url})); }; var $elm$http$Http$get = function (r) { return $elm$http$Http$request( - {al: $elm$http$Http$emptyBody, bj: r.bj, ax: _List_Nil, aD: 'GET', a$: $elm$core$Maybe$Nothing, a1: $elm$core$Maybe$Nothing, ah: r.ah}); + {body: $elm$http$Http$emptyBody, expect: r.expect, headers: _List_Nil, method: 'GET', timeout: $elm$core$Maybe$Nothing, tracker: $elm$core$Maybe$Nothing, url: r.url}); }; var $author$project$Endpoint$toString = function (_v0) { - var urlEndpoint = _v0; + var urlEndpoint = _v0.a; return urlEndpoint; }; var $author$project$Pages$Auth$getAuthUrls = $elm$http$Http$get( { - bj: A2($elm$http$Http$expectJson, $author$project$Pages$Auth$GotAuthUrls, $author$project$Pages$Auth$authUrlsDecoder), - ah: $author$project$Endpoint$toString($author$project$Endpoint$authUrls) + expect: A2($elm$http$Http$expectJson, $author$project$Pages$Auth$GotAuthUrls, $author$project$Pages$Auth$authUrlsDecoder), + url: $author$project$Endpoint$toString($author$project$Endpoint$authUrls) }); var $author$project$Pages$Auth$init = function (session) { return _Utils_Tuple2( @@ -6575,66 +6595,129 @@ var $author$project$Pages$Auth$init = function (session) { }; var $author$project$Pages$Capture$Model = F4( function (session, captures, newCapture, error) { - return {I: captures, p: error, E: newCapture, N: session}; + return {captures: captures, error: error, newCapture: newCapture, session: session}; }); var $author$project$Pages$Capture$GotCaptures = function (a) { - return {$: 1, a: a}; + return {$: 'GotCaptures', a: a}; }; var $author$project$Endpoint$captures = A2( $author$project$Endpoint$url, _List_fromArray( ['api', 'capture']), _List_Nil); -var $author$project$Pages$Capture$Capture = F4( - function (idCapture, text, completed, disabled) { - return {ao: completed, J: disabled, X: idCapture, P: text}; +var $author$project$Capture$Capture = F4( + function (idCapture, text, timers, status) { + return {idCapture: idCapture, status: status, text: text, timers: timers}; }); var $elm$json$Json$Decode$bool = _Json_decodeBool; +var $author$project$Capture$Completed = {$: 'Completed'}; +var $author$project$Capture$completedToStatusDecoder = $elm$json$Json$Decode$succeed($author$project$Capture$Completed); +var $author$project$Capture$InProgress = {$: 'InProgress'}; +var $author$project$Capture$ToDo = {$: 'ToDo'}; +var $elm$core$List$head = function (list) { + if (list.b) { + var x = list.a; + var xs = list.b; + return $elm$core$Maybe$Just(x); + } else { + return $elm$core$Maybe$Nothing; + } +}; +var $author$project$Timer$Timer = F4( + function (idTimer, idCapture, startedAt, stoppedAt) { + return {idCapture: idCapture, idTimer: idTimer, startedAt: startedAt, stoppedAt: stoppedAt}; + }); var $elm$json$Json$Decode$int = _Json_decodeInt; var $elm$json$Json$Decode$map4 = _Json_map4; -var $author$project$Pages$Capture$captureDecoder = A5( +var $elm$json$Json$Decode$oneOf = _Json_oneOf; +var $elm$json$Json$Decode$maybe = function (decoder) { + return $elm$json$Json$Decode$oneOf( + _List_fromArray( + [ + A2($elm$json$Json$Decode$map, $elm$core$Maybe$Just, decoder), + $elm$json$Json$Decode$succeed($elm$core$Maybe$Nothing) + ])); +}; +var $author$project$Timer$timerDecoder = A5( $elm$json$Json$Decode$map4, - $author$project$Pages$Capture$Capture, + $author$project$Timer$Timer, + A2($elm$json$Json$Decode$field, 'timer_id', $elm$json$Json$Decode$int), + A2($elm$json$Json$Decode$field, 'capture_id', $elm$json$Json$Decode$int), + A2($elm$json$Json$Decode$field, 'started_at', $elm$json$Json$Decode$string), + $elm$json$Json$Decode$maybe( + A2($elm$json$Json$Decode$field, 'stopped_at', $elm$json$Json$Decode$string))); +var $author$project$Capture$timersToStatusDecoder = A2( + $elm$json$Json$Decode$andThen, + function (timers) { + var _v0 = $elm$core$List$head(timers); + if (_v0.$ === 'Nothing') { + return $elm$json$Json$Decode$succeed($author$project$Capture$ToDo); + } else { + var timer = _v0.a; + var _v1 = timer.stoppedAt; + if (_v1.$ === 'Nothing') { + return $elm$json$Json$Decode$succeed($author$project$Capture$InProgress); + } else { + return $elm$json$Json$Decode$succeed($author$project$Capture$ToDo); + } + } + }, + A2( + $elm$json$Json$Decode$field, + 'timers', + $elm$json$Json$Decode$list($author$project$Timer$timerDecoder))); +var $author$project$Capture$captureStatusDecoder = function (completed) { + return completed ? $author$project$Capture$completedToStatusDecoder : $author$project$Capture$timersToStatusDecoder; +}; +var $author$project$Capture$captureDecoder = A5( + $elm$json$Json$Decode$map4, + $author$project$Capture$Capture, A2($elm$json$Json$Decode$field, 'capture_id', $elm$json$Json$Decode$int), A2($elm$json$Json$Decode$field, 'text', $elm$json$Json$Decode$string), - A2($elm$json$Json$Decode$field, 'completed', $elm$json$Json$Decode$bool), - $elm$json$Json$Decode$succeed(false)); -var $author$project$Pages$Capture$capturesDecoder = A2( + A2( + $elm$json$Json$Decode$field, + 'timers', + $elm$json$Json$Decode$list($author$project$Timer$timerDecoder)), + A2( + $elm$json$Json$Decode$andThen, + $author$project$Capture$captureStatusDecoder, + A2($elm$json$Json$Decode$field, 'completed', $elm$json$Json$Decode$bool))); +var $author$project$Capture$capturesDecoder = A2( $elm$json$Json$Decode$field, 'data', - $elm$json$Json$Decode$list($author$project$Pages$Capture$captureDecoder)); + $elm$json$Json$Decode$list($author$project$Capture$captureDecoder)); var $elm$http$Http$Header = F2( function (a, b) { - return {$: 0, a: a, b: b}; + return {$: 'Header', a: a, b: b}; }); var $elm$http$Http$header = $elm$http$Http$Header; var $author$project$Pages$Capture$getCaptures = function (token) { return $elm$http$Http$request( { - al: $elm$http$Http$emptyBody, - bj: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$GotCaptures, $author$project$Pages$Capture$capturesDecoder), - ax: _List_fromArray( + body: $elm$http$Http$emptyBody, + expect: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$GotCaptures, $author$project$Capture$capturesDecoder), + headers: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - aD: 'GET', - a$: $elm$core$Maybe$Nothing, - a1: $elm$core$Maybe$Nothing, - ah: $author$project$Endpoint$toString($author$project$Endpoint$captures) + method: 'GET', + timeout: $elm$core$Maybe$Nothing, + tracker: $elm$core$Maybe$Nothing, + url: $author$project$Endpoint$toString($author$project$Endpoint$captures) }); }; -var $author$project$Pages$Capture$initCapture = A4($author$project$Pages$Capture$Capture, 0, '', false, false); +var $author$project$Capture$initCapture = {idCapture: 0, status: $author$project$Capture$ToDo, text: '', timers: _List_Nil}; var $author$project$Session$token = function (session) { - if (!session.$) { + if (session.$ === 'Guest') { return ''; } else { var person = session.b; - return person.ag; + return person.token; } }; var $author$project$Pages$Capture$init = function (session) { return _Utils_Tuple2( - A4($author$project$Pages$Capture$Model, session, _List_Nil, $author$project$Pages$Capture$initCapture, ''), + A4($author$project$Pages$Capture$Model, session, _List_Nil, $author$project$Capture$initCapture, ''), $author$project$Pages$Capture$getCaptures( $author$project$Session$token(session))); }; @@ -6644,14 +6727,14 @@ var $author$project$Pages$Home$init = function (session) { }; var $author$project$Pages$Session$Model = F3( function (session, token, error) { - return {p: error, N: session, ag: token}; + return {error: error, session: session, token: token}; }); var $author$project$Pages$Session$GotPersonInfo = function (a) { - return {$: 0, a: a}; + return {$: 'GotPersonInfo', a: a}; }; var $author$project$Pages$Session$PersonInfo = F2( function (email, name) { - return {bh: email, bs: name}; + return {email: email, name: name}; }); var $author$project$Pages$Session$personDecoder = A2( $elm$json$Json$Decode$field, @@ -6669,16 +6752,16 @@ var $author$project$Endpoint$personInfo = A2( var $author$project$Pages$Session$getPersonInfo = function (token) { return $elm$http$Http$request( { - al: $elm$http$Http$emptyBody, - bj: A2($elm$http$Http$expectJson, $author$project$Pages$Session$GotPersonInfo, $author$project$Pages$Session$personDecoder), - ax: _List_fromArray( + body: $elm$http$Http$emptyBody, + expect: A2($elm$http$Http$expectJson, $author$project$Pages$Session$GotPersonInfo, $author$project$Pages$Session$personDecoder), + headers: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - aD: 'GET', - a$: $elm$core$Maybe$Nothing, - a1: $elm$core$Maybe$Nothing, - ah: $author$project$Endpoint$toString($author$project$Endpoint$personInfo) + method: 'GET', + timeout: $elm$core$Maybe$Nothing, + tracker: $elm$core$Maybe$Nothing, + url: $author$project$Endpoint$toString($author$project$Endpoint$personInfo) }); }; var $author$project$Pages$Session$init = F2( @@ -6689,7 +6772,7 @@ var $author$project$Pages$Session$init = F2( }); var $elm$core$Maybe$destruct = F3( function (_default, func, maybe) { - if (!maybe.$) { + if (maybe.$ === 'Just') { var a = maybe.a; return func(a); } else { @@ -6705,7 +6788,7 @@ var $author$project$Session$storeSession = _Platform_outgoingPort( var $author$project$Session$logout = $author$project$Session$storeSession($elm$core$Maybe$Nothing); var $elm$core$Platform$Cmd$map = _Platform_map; var $author$project$Session$navKey = function (session) { - if (!session.$) { + if (session.$ === 'Guest') { var key = session.a; return key; } else { @@ -6716,17 +6799,17 @@ var $author$project$Session$navKey = function (session) { var $elm$browser$Browser$Navigation$replaceUrl = _Browser_replaceUrl; var $author$project$Route$routeToString = function (route) { switch (route.$) { - case 0: + case 'Home': return '/'; - case 1: - if (route.a.$ === 1) { + case 'Auth': + if (route.a.$ === 'Nothing') { var _v1 = route.a; return '/auth'; } else { var jwt = route.a.a; return '/auth?jwt=' + jwt; } - case 2: + case 'Logout': return '/logout'; default: return '/capture'; @@ -6740,32 +6823,32 @@ var $author$project$Route$replaceUrl = F2( $author$project$Route$routeToString(route)); }); var $author$project$Pages$Auth$toSession = function (model) { - return model.N; + return model.session; }; var $author$project$Pages$Capture$toSession = function (model) { - return model.N; + return model.session; }; var $author$project$Pages$Home$toSession = function (model) { return model; }; var $author$project$Pages$Session$toSession = function (model) { - return model.N; + return model.session; }; var $author$project$Main$toSession = function (page) { switch (page.$) { - case 3: + case 'NotFound': var session = page.a; return session; - case 0: + case 'Home': var m = page.a; return $author$project$Pages$Home$toSession(m); - case 1: + case 'Auth': var m = page.a; return $author$project$Pages$Auth$toSession(m); - case 2: + case 'Session': var m = page.a; return $author$project$Pages$Session$toSession(m); - case 4: + case 'Logout': var session = page.a; return session; default: @@ -6776,13 +6859,13 @@ var $author$project$Main$toSession = function (page) { var $author$project$Main$loadRoute = F2( function (maybeRoute, model) { var session = $author$project$Main$toSession(model); - if (maybeRoute.$ === 1) { + if (maybeRoute.$ === 'Nothing') { return _Utils_Tuple2( $author$project$Main$NotFound(session), $elm$core$Platform$Cmd$none); } else { switch (maybeRoute.a.$) { - case 0: + case 'Home': var _v1 = maybeRoute.a; var _v2 = $author$project$Pages$Home$init(session); var subModel = _v2.a; @@ -6790,8 +6873,8 @@ var $author$project$Main$loadRoute = F2( return _Utils_Tuple2( $author$project$Main$Home(subModel), A2($elm$core$Platform$Cmd$map, $author$project$Main$GotHomeMsg, subMsg)); - case 1: - if (maybeRoute.a.a.$ === 1) { + case 'Auth': + if (maybeRoute.a.a.$ === 'Nothing') { var _v3 = maybeRoute.a.a; var _v4 = $author$project$Pages$Auth$init(session); var subModel = _v4.a; @@ -6808,7 +6891,7 @@ var $author$project$Main$loadRoute = F2( $author$project$Main$Session(subModel), A2($elm$core$Platform$Cmd$map, $author$project$Main$GotPagesSessionMsg, subMsg)); } - case 2: + case 'Logout': var _v6 = maybeRoute.a; return _Utils_Tuple2( $author$project$Main$Logout(session), @@ -6835,7 +6918,7 @@ var $author$project$Main$loadRoute = F2( var $author$project$Main$init = F3( function (flags, url, navKey) { var session = function () { - if (flags.$ === 1) { + if (flags.$ === 'Nothing') { return $author$project$Session$Guest(navKey); } else { var str = flags.a; @@ -6848,16 +6931,15 @@ var $author$project$Main$init = F3( $author$project$Main$NotFound(session)); }); var $elm$json$Json$Decode$null = _Json_decodeNull; -var $elm$json$Json$Decode$oneOf = _Json_oneOf; var $elm$core$Platform$Sub$map = _Platform_map; var $elm$core$Platform$Sub$batch = _Platform_batch; var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil); var $author$project$Pages$Auth$GotSession = function (a) { - return {$: 1, a: a}; + return {$: 'GotSession', a: a}; }; var $elm$json$Json$Decode$decodeValue = _Json_run; var $elm$core$Result$toMaybe = function (result) { - if (!result.$) { + if (result.$ === 'Ok') { var v = result.a; return $elm$core$Maybe$Just(v); } else { @@ -6885,7 +6967,7 @@ var $author$project$Session$changePerson = function (toMsg) { }; var $author$project$Session$sessionFromPerson = F2( function (maybePerson, key) { - if (!maybePerson.$) { + if (maybePerson.$ === 'Just') { var person = maybePerson.a; return A2($author$project$Session$Session, key, person); } else { @@ -6904,56 +6986,58 @@ var $author$project$Pages$Auth$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Auth$GotSession, - $author$project$Session$navKey(model.N)); + $author$project$Session$navKey(model.session)); }; var $author$project$Pages$Capture$GotSession = function (a) { - return {$: 0, a: a}; + return {$: 'GotSession', a: a}; }; var $author$project$Pages$Capture$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Capture$GotSession, - $author$project$Session$navKey(model.N)); + $author$project$Session$navKey(model.session)); +}; +var $author$project$Pages$Home$GotSession = function (a) { + return {$: 'GotSession', a: a}; }; -var $author$project$Pages$Home$GotSession = $elm$core$Basics$identity; var $author$project$Pages$Home$subscriptions = function (model) { return A2( $author$project$Session$changeSession, - $elm$core$Basics$identity, + $author$project$Pages$Home$GotSession, $author$project$Session$navKey(model)); }; var $author$project$Pages$Session$GotSession = function (a) { - return {$: 1, a: a}; + return {$: 'GotSession', a: a}; }; var $author$project$Pages$Session$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Session$GotSession, - $author$project$Session$navKey(model.N)); + $author$project$Session$navKey(model.session)); }; var $author$project$Main$subscriptions = function (model) { switch (model.$) { - case 0: + case 'Home': var home = model.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GotHomeMsg, $author$project$Pages$Home$subscriptions(home)); - case 1: + case 'Auth': var authModel = model.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GotAuthMsg, $author$project$Pages$Auth$subscriptions(authModel)); - case 2: + case 'Session': var sessionModel = model.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GotPagesSessionMsg, $author$project$Pages$Session$subscriptions(sessionModel)); - case 3: + case 'NotFound': return $elm$core$Platform$Sub$none; - case 4: + case 'Logout': return $elm$core$Platform$Sub$none; default: var captureModel = model.a; @@ -6971,7 +7055,7 @@ var $author$project$Main$toNavKey = function (model) { }; var $elm$url$Url$addPort = F2( function (maybePort, starter) { - if (maybePort.$ === 1) { + if (maybePort.$ === 'Nothing') { return starter; } else { var port_ = maybePort.a; @@ -6980,7 +7064,7 @@ var $elm$url$Url$addPort = F2( }); var $elm$url$Url$addPrefixed = F3( function (prefix, maybeSegment, starter) { - if (maybeSegment.$ === 1) { + if (maybeSegment.$ === 'Nothing') { return starter; } else { var segment = maybeSegment.a; @@ -6991,8 +7075,8 @@ var $elm$url$Url$addPrefixed = F3( }); var $elm$url$Url$toString = function (url) { var http = function () { - var _v0 = url.aM; - if (!_v0) { + var _v0 = url.protocol; + if (_v0.$ === 'Http') { return 'http://'; } else { return 'https://'; @@ -7001,28 +7085,28 @@ var $elm$url$Url$toString = function (url) { return A3( $elm$url$Url$addPrefixed, '#', - url.au, + url.fragment, A3( $elm$url$Url$addPrefixed, '?', - url.aN, + url.query, _Utils_ap( A2( $elm$url$Url$addPort, - url.aJ, - _Utils_ap(http, url.az)), - url.aH))); + url.port_, + _Utils_ap(http, url.host)), + url.path))); }; var $author$project$Pages$Auth$update = F2( function (msg, model) { - if (!msg.$) { + if (msg.$ === 'GotAuthUrls') { var result = msg.a; - if (!result.$) { + if (result.$ === 'Ok') { var urls = result.a; return _Utils_Tuple2( _Utils_update( model, - {ai: urls}), + {urls: urls}), $elm$core$Platform$Cmd$none); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); @@ -7032,15 +7116,17 @@ var $author$project$Pages$Auth$update = F2( return _Utils_Tuple2( _Utils_update( model, - {N: session}), + {session: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.N), + $author$project$Session$navKey(model.session), $author$project$Route$Home)); } }); +var $author$project$Capture$Disabled = {$: 'Disabled'}; +var $elm$core$Debug$log = _Debug_log; var $author$project$Pages$Capture$CaptureSaved = function (a) { - return {$: 2, a: a}; + return {$: 'CaptureSaved', a: a}; }; var $elm$json$Json$Encode$object = function (pairs) { return _Json_wrap( @@ -7052,17 +7138,17 @@ var $elm$json$Json$Encode$object = function (pairs) { var v = _v0.b; return A3(_Json_addField, k, v, obj); }), - _Json_emptyObject(0), + _Json_emptyObject(_Utils_Tuple0), pairs)); }; var $elm$json$Json$Encode$string = _Json_wrap; -var $author$project$Pages$Capture$captureEncode = function (capture) { +var $author$project$Capture$captureEncode = function (capture) { return $elm$json$Json$Encode$object( _List_fromArray( [ _Utils_Tuple2( 'text', - $elm$json$Json$Encode$string(capture.P)) + $elm$json$Json$Encode$string(capture.text)) ])); }; var $elm$http$Http$jsonBody = function (value) { @@ -7071,157 +7157,298 @@ var $elm$http$Http$jsonBody = function (value) { 'application/json', A2($elm$json$Json$Encode$encode, 0, value)); }; -var $author$project$Pages$Capture$savedCaptureDecoder = A2($elm$json$Json$Decode$field, 'data', $author$project$Pages$Capture$captureDecoder); +var $author$project$Capture$savedCaptureDecoder = A2($elm$json$Json$Decode$field, 'data', $author$project$Capture$captureDecoder); var $author$project$Pages$Capture$saveCapture = F2( function (token, capture) { return $elm$http$Http$request( { - al: $elm$http$Http$jsonBody( - $author$project$Pages$Capture$captureEncode(capture)), - bj: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$CaptureSaved, $author$project$Pages$Capture$savedCaptureDecoder), - ax: _List_fromArray( + body: $elm$http$Http$jsonBody( + $author$project$Capture$captureEncode(capture)), + expect: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$CaptureSaved, $author$project$Capture$savedCaptureDecoder), + headers: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - aD: 'POST', - a$: $elm$core$Maybe$Nothing, - a1: $elm$core$Maybe$Nothing, - ah: $author$project$Endpoint$toString($author$project$Endpoint$captures) + method: 'POST', + timeout: $elm$core$Maybe$Nothing, + tracker: $elm$core$Maybe$Nothing, + url: $author$project$Endpoint$toString($author$project$Endpoint$captures) }); }); +var $author$project$Pages$Capture$TimerUpdated = F2( + function (a, b) { + return {$: 'TimerUpdated', a: a, b: b}; + }); +var $author$project$Endpoint$startTimer = function (idCapture) { + return A2( + $author$project$Endpoint$url, + _List_fromArray( + [ + 'api', + 'capture', + $elm$core$String$fromInt(idCapture), + 'timers' + ]), + _List_Nil); +}; +var $author$project$Timer$timerDataDecoder = A2($elm$json$Json$Decode$field, 'data', $author$project$Timer$timerDecoder); +var $author$project$Pages$Capture$startTimer = F2( + function (token, idCapture) { + return $elm$http$Http$request( + { + body: $elm$http$Http$emptyBody, + expect: A2( + $elm$http$Http$expectJson, + $author$project$Pages$Capture$TimerUpdated($author$project$Capture$InProgress), + $author$project$Timer$timerDataDecoder), + headers: _List_fromArray( + [ + A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) + ]), + method: 'POST', + timeout: $elm$core$Maybe$Nothing, + tracker: $elm$core$Maybe$Nothing, + url: $author$project$Endpoint$toString( + $author$project$Endpoint$startTimer(idCapture)) + }); + }); +var $author$project$Timer$actionTimerEncode = function (action) { + return $elm$json$Json$Encode$object( + _List_fromArray( + [ + _Utils_Tuple2( + 'action', + $elm$json$Json$Encode$string(action)) + ])); +}; +var $author$project$Endpoint$stopTimer = F2( + function (idTimer, idCapture) { + return A2( + $author$project$Endpoint$url, + _List_fromArray( + [ + 'api', + 'capture', + $elm$core$String$fromInt(idCapture), + 'timers', + $elm$core$String$fromInt(idTimer) + ]), + _List_Nil); + }); +var $author$project$Pages$Capture$stopTimer = F3( + function (token, idTimer, idCapture) { + return $elm$http$Http$request( + { + body: $elm$http$Http$jsonBody( + $author$project$Timer$actionTimerEncode('stop')), + expect: A2( + $elm$http$Http$expectJson, + $author$project$Pages$Capture$TimerUpdated($author$project$Capture$ToDo), + $author$project$Timer$timerDataDecoder), + headers: _List_fromArray( + [ + A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) + ]), + method: 'PUT', + timeout: $elm$core$Maybe$Nothing, + tracker: $elm$core$Maybe$Nothing, + url: $author$project$Endpoint$toString( + A2($author$project$Endpoint$stopTimer, idTimer, idCapture)) + }); + }); +var $author$project$Pages$Capture$updateCapture = F3( + function (status, idCapture, listCaptures) { + return A2( + $elm$core$List$map, + function (c) { + return _Utils_eq(idCapture, c.idCapture) ? _Utils_update( + c, + {status: status}) : c; + }, + listCaptures); + }); var $author$project$Pages$Capture$update = F2( function (msg, model) { switch (msg.$) { - case 0: + case 'None': + return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); + case 'GotSession': var session = msg.a; return _Utils_Tuple2( _Utils_update( model, - {N: session}), + {session: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.N), + $author$project$Session$navKey(model.session), $author$project$Route$Home)); - case 1: + case 'GotCaptures': var result = msg.a; - if (!result.$) { + if (result.$ === 'Ok') { var captures = result.a; + var _v2 = A2($elm$core$Debug$log, 'captures', captures); return _Utils_Tuple2( _Utils_update( model, - {I: captures, p: ''}), + {captures: captures, error: ''}), $elm$core$Platform$Cmd$none); } else { var httpError = result.a; - _v2$2: + _v3$2: while (true) { - if (httpError.$ === 3) { + if (httpError.$ === 'BadStatus') { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {p: 'Access not authorised'}), + {error: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {p: 'User information can\'t be retrieved'}), + {error: 'User information can\'t be retrieved'}), $elm$core$Platform$Cmd$none); default: - break _v2$2; + break _v3$2; } } else { - break _v2$2; + break _v3$2; } } return _Utils_Tuple2( _Utils_update( model, - {p: 'Error while getting the captures'}), + {error: 'Error while getting the captures'}), $elm$core$Platform$Cmd$none); } - case 2: + case 'CaptureSaved': var result = msg.a; - if (!result.$) { + if (result.$ === 'Ok') { return _Utils_Tuple2( _Utils_update( model, - {p: ''}), + {error: ''}), $author$project$Pages$Capture$getCaptures( - $author$project$Session$token(model.N))); + $author$project$Session$token(model.session))); } else { var httpError = result.a; - _v4$2: + _v5$2: while (true) { - if (httpError.$ === 3) { + if (httpError.$ === 'BadStatus') { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {p: 'Access not authorised'}), + {error: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {p: 'create capture endpoint not found'}), + {error: 'create capture endpoint not found'}), $elm$core$Platform$Cmd$none); default: - break _v4$2; + break _v5$2; } } else { - break _v4$2; + break _v5$2; } } return _Utils_Tuple2( _Utils_update( model, - {p: 'Error while creating the capture'}), + {error: 'Error while creating the capture'}), $elm$core$Platform$Cmd$none); } - case 3: + case 'UpdateNewCapture': var text = msg.a; - var capture = model.E; + var capture = model.newCapture; var newCapture = _Utils_update( capture, - {P: text}); + {text: text}); return _Utils_Tuple2( _Utils_update( model, - {E: newCapture}), + {newCapture: newCapture}), $elm$core$Platform$Cmd$none); - case 4: + case 'AddCapture': return _Utils_Tuple2( _Utils_update( model, - {E: $author$project$Pages$Capture$initCapture}), + {newCapture: $author$project$Capture$initCapture}), A2( $author$project$Pages$Capture$saveCapture, - $author$project$Session$token(model.N), - model.E)); - default: + $author$project$Session$token(model.session), + model.newCapture)); + case 'StartTimer': var idCapture = msg.a; - var captures = A2( - $elm$core$List$map, - function (c) { - return _Utils_eq(c.X, idCapture) ? _Utils_update( - c, - {J: true}) : c; - }, - model.I); + var captures = A3($author$project$Pages$Capture$updateCapture, $author$project$Capture$Disabled, idCapture, model.captures); return _Utils_Tuple2( _Utils_update( model, - {I: captures}), - $elm$core$Platform$Cmd$none); + {captures: captures}), + A2( + $author$project$Pages$Capture$startTimer, + $author$project$Session$token(model.session), + idCapture)); + case 'StopTimer': + var idTimer = msg.a; + var idCapture = msg.b; + return _Utils_Tuple2( + model, + A3( + $author$project$Pages$Capture$stopTimer, + $author$project$Session$token(model.session), + idTimer, + idCapture)); + default: + var result = msg.b; + if (result.$ === 'Ok') { + return _Utils_Tuple2( + _Utils_update( + model, + {error: ''}), + $author$project$Pages$Capture$getCaptures( + $author$project$Session$token(model.session))); + } else { + var httpError = result.a; + _v7$2: + while (true) { + if (httpError.$ === 'BadStatus') { + switch (httpError.a) { + case 401: + return _Utils_Tuple2( + _Utils_update( + model, + {error: 'Access not authorised'}), + $elm$core$Platform$Cmd$none); + case 404: + return _Utils_Tuple2( + _Utils_update( + model, + {error: 'create timer endpoint not found'}), + $elm$core$Platform$Cmd$none); + default: + break _v7$2; + } + } else { + break _v7$2; + } + } + return _Utils_Tuple2( + _Utils_update( + model, + {error: 'Error while starting the timer'}), + $elm$core$Platform$Cmd$none); + } } }); var $author$project$Pages$Home$update = F2( function (msg, model) { - var session = msg; + var session = msg.a; return _Utils_Tuple2( session, A2( @@ -7235,19 +7462,19 @@ var $author$project$Session$encode = function (person) { [ _Utils_Tuple2( 'email', - $elm$json$Json$Encode$string(person.bh)), + $elm$json$Json$Encode$string(person.email)), _Utils_Tuple2( 'token', - $elm$json$Json$Encode$string(person.ag)) + $elm$json$Json$Encode$string(person.token)) ])); }; var $author$project$Pages$Session$update = F2( function (msg, model) { - if (!msg.$) { + if (msg.$ === 'GotPersonInfo') { var result = msg.a; - if (!result.$) { + if (result.$ === 'Ok') { var person = result.a; - var session = {bh: person.bh, ag: model.ag}; + var session = {email: person.email, token: model.token}; return _Utils_Tuple2( model, $author$project$Session$storeSession( @@ -7257,19 +7484,19 @@ var $author$project$Pages$Session$update = F2( var httpError = result.a; _v2$2: while (true) { - if (httpError.$ === 3) { + if (httpError.$ === 'BadStatus') { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {p: 'Access not authorised'}), + {error: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {p: 'User information can\'t be retrieved'}), + {error: 'User information can\'t be retrieved'}), $elm$core$Platform$Cmd$none); default: break _v2$2; @@ -7281,7 +7508,7 @@ var $author$project$Pages$Session$update = F2( return _Utils_Tuple2( _Utils_update( model, - {p: 'Error on authentication'}), + {error: 'Error on authentication'}), $elm$core$Platform$Cmd$none); } } else { @@ -7289,10 +7516,10 @@ var $author$project$Pages$Session$update = F2( return _Utils_Tuple2( _Utils_update( model, - {N: session}), + {session: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.N), + $author$project$Session$navKey(model.session), $author$project$Route$Home)); } }); @@ -7302,9 +7529,9 @@ var $author$project$Main$update = F2( _v0$6: while (true) { switch (_v0.a.$) { - case 1: + case 'LinkClicked': var link = _v0.a.a; - if (!link.$) { + if (link.$ === 'Internal') { var urlRequested = link.a; return _Utils_Tuple2( model, @@ -7318,14 +7545,14 @@ var $author$project$Main$update = F2( model, $elm$browser$Browser$Navigation$load(href)); } - case 0: + case 'UrlChanged': var url = _v0.a.a; return A2( $author$project$Main$loadRoute, $author$project$Route$fromUrl(url), model); - case 2: - if (!_v0.b.$) { + case 'GotHomeMsg': + if (_v0.b.$ === 'Home') { var homeMsg = _v0.a.a; var homeModel = _v0.b.a; var _v2 = A2($author$project$Pages$Home$update, homeMsg, homeModel); @@ -7337,8 +7564,8 @@ var $author$project$Main$update = F2( } else { break _v0$6; } - case 3: - if (_v0.b.$ === 1) { + case 'GotAuthMsg': + if (_v0.b.$ === 'Auth') { var authMsg = _v0.a.a; var authModel = _v0.b.a; var _v3 = A2($author$project$Pages$Auth$update, authMsg, authModel); @@ -7350,8 +7577,8 @@ var $author$project$Main$update = F2( } else { break _v0$6; } - case 4: - if (_v0.b.$ === 2) { + case 'GotPagesSessionMsg': + if (_v0.b.$ === 'Session') { var sessionMsg = _v0.a.a; var sessionModel = _v0.b.a; var _v4 = A2($author$project$Pages$Session$update, sessionMsg, sessionModel); @@ -7364,7 +7591,7 @@ var $author$project$Main$update = F2( break _v0$6; } default: - if (_v0.b.$ === 5) { + if (_v0.b.$ === 'Capture') { var captureMsg = _v0.a.a; var captureModel = _v0.b.a; var _v5 = A2($author$project$Pages$Capture$update, captureMsg, captureModel); @@ -7401,9 +7628,11 @@ var $author$project$Route$href = function (targetRoute) { $author$project$Route$routeToString(targetRoute)); }; var $elm$html$Html$img = _VirtualDom_node('img'); -var $author$project$Asset$Image = $elm$core$Basics$identity; +var $author$project$Asset$Image = function (a) { + return {$: 'Image', a: a}; +}; var $author$project$Asset$image = function (filename) { - return '/assets/images/' + filename; + return $author$project$Asset$Image('/assets/images/' + filename); }; var $author$project$Asset$logo = $author$project$Asset$image('dwyl.png'); var $elm$html$Html$Attributes$src = function (url) { @@ -7413,7 +7642,7 @@ var $elm$html$Html$Attributes$src = function (url) { _VirtualDom_noJavaScriptOrHtmlUri(url)); }; var $author$project$Asset$src = function (_v0) { - var url = _v0; + var url = _v0.a; return $elm$html$Html$Attributes$src(url); }; var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; @@ -7423,11 +7652,11 @@ var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; var $author$project$Page$view = F2( function (toMsg, structure) { return { - al: A2( + body: A2( $elm$core$List$map, $elm$html$Html$map(toMsg), - structure.ap), - a0: structure.a0 + structure.content), + title: structure.title }; }); var $elm$html$Html$div = _VirtualDom_node('div'); @@ -7435,8 +7664,8 @@ var $author$project$Asset$signinGithub = $author$project$Asset$image('signin-git var $author$project$Asset$signinGoogle = $author$project$Asset$image('signin-google.png'); var $author$project$Pages$Auth$showAuthUrl = function (url) { var imgSrc = function () { - var _v0 = url.a2; - if (!_v0) { + var _v0 = url.typeUrl; + if (_v0.$ === 'Google') { return $author$project$Asset$src($author$project$Asset$signinGoogle); } else { return $author$project$Asset$src($author$project$Asset$signinGithub); @@ -7454,7 +7683,7 @@ var $author$project$Pages$Auth$showAuthUrl = function (url) { $elm$html$Html$a, _List_fromArray( [ - $elm$html$Html$Attributes$href(url.ah) + $elm$html$Html$Attributes$href(url.url) ]), _List_fromArray( [ @@ -7468,7 +7697,7 @@ var $author$project$Pages$Auth$showAuthUrl = function (url) { }; var $author$project$Pages$Auth$view = function (model) { return { - ap: _List_fromArray( + content: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7495,19 +7724,19 @@ var $author$project$Pages$Auth$view = function (model) { function (url) { return $author$project$Pages$Auth$showAuthUrl(url); }, - model.ai)) + model.urls)) ]), - a0: 'Auth' + title: 'Auth' }; }; -var $author$project$Pages$Capture$AddCapture = {$: 4}; +var $author$project$Pages$Capture$AddCapture = {$: 'AddCapture'}; var $author$project$Pages$Capture$UpdateNewCapture = function (a) { - return {$: 3, a: a}; + return {$: 'UpdateNewCapture', a: a}; }; var $elm$html$Html$button = _VirtualDom_node('button'); var $elm$html$Html$input = _VirtualDom_node('input'); var $elm$virtual_dom$VirtualDom$Normal = function (a) { - return {$: 0, a: a}; + return {$: 'Normal', a: a}; }; var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; var $elm$html$Html$Events$on = F2( @@ -7527,7 +7756,7 @@ var $elm$html$Html$Events$alwaysStop = function (x) { return _Utils_Tuple2(x, true); }; var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { - return {$: 1, a: a}; + return {$: 'MayStopPropagation', a: a}; }; var $elm$html$Html$Events$stopPropagationOn = F2( function (event, decoder) { @@ -7555,9 +7784,14 @@ var $elm$html$Html$Events$onInput = function (tagger) { A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); }; var $elm$html$Html$p = _VirtualDom_node('p'); +var $author$project$Pages$Capture$None = {$: 'None'}; var $author$project$Pages$Capture$StartTimer = function (a) { - return {$: 5, a: a}; + return {$: 'StartTimer', a: a}; }; +var $author$project$Pages$Capture$StopTimer = F2( + function (a, b) { + return {$: 'StopTimer', a: a, b: b}; + }); var $elm$json$Json$Encode$bool = _Json_wrap; var $elm$html$Html$Attributes$boolProperty = F2( function (key, bool) { @@ -7567,6 +7801,11 @@ var $elm$html$Html$Attributes$boolProperty = F2( $elm$json$Json$Encode$bool(bool)); }); var $elm$html$Html$Attributes$checked = $elm$html$Html$Attributes$boolProperty('checked'); +var $elm$html$Html$Attributes$disabled = $elm$html$Html$Attributes$boolProperty('disabled'); +var $author$project$Capture$getTimer = function (capture) { + return $elm$core$List$head(capture.timers); +}; +var $elm$html$Html$label = _VirtualDom_node('label'); var $elm$core$List$filter = F2( function (isGood, list) { return A3( @@ -7592,9 +7831,26 @@ var $elm$html$Html$Attributes$classList = function (classes) { $elm$core$Tuple$first, A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); }; -var $elm$html$Html$Attributes$disabled = $elm$html$Html$Attributes$boolProperty('disabled'); -var $elm$html$Html$label = _VirtualDom_node('label'); -var $elm$core$Basics$not = _Basics_not; +var $author$project$Pages$Capture$showTimerButton = F2( + function (textButton, msg) { + return A2( + $elm$html$Html$button, + _List_fromArray( + [ + $elm$html$Html$Attributes$disabled(false), + $elm$html$Html$Attributes$class('fr'), + $elm$html$Html$Attributes$classList( + _List_fromArray( + [ + _Utils_Tuple2('pointer', true) + ])), + $elm$html$Html$Events$onClick(msg) + ]), + _List_fromArray( + [ + $elm$html$Html$text(textButton) + ])); + }); var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); var $author$project$Pages$Capture$showCapture = function (capture) { return A2( @@ -7618,37 +7874,47 @@ var $author$project$Pages$Capture$showCapture = function (capture) { _List_fromArray( [ $elm$html$Html$Attributes$type_('checkbox'), - $elm$html$Html$Attributes$checked(capture.ao), - $elm$html$Html$Attributes$disabled(capture.J), + $elm$html$Html$Attributes$checked(false), + $elm$html$Html$Attributes$disabled(false), $elm$html$Html$Attributes$class('mr2') ]), _List_Nil), - $elm$html$Html$text(capture.P) + $elm$html$Html$text(capture.text) ])), - A2( - $elm$html$Html$button, - _List_fromArray( - [ - $elm$html$Html$Attributes$disabled(capture.J), - $elm$html$Html$Attributes$class('fr'), - $elm$html$Html$Attributes$classList( - _List_fromArray( - [ - _Utils_Tuple2('pointer', !capture.J) - ])), - $elm$html$Html$Events$onClick( - $author$project$Pages$Capture$StartTimer(capture.X)) - ]), - _List_fromArray( - [ - $elm$html$Html$text('Start') - ])) + function () { + var _v0 = capture.status; + switch (_v0.$) { + case 'ToDo': + return A2( + $author$project$Pages$Capture$showTimerButton, + 'start', + $author$project$Pages$Capture$StartTimer(capture.idCapture)); + case 'InProgress': + var timer = $author$project$Capture$getTimer(capture); + if (timer.$ === 'Nothing') { + return A2($author$project$Pages$Capture$showTimerButton, 'Error Timer', $author$project$Pages$Capture$None); + } else { + var t = timer.a; + return A2( + $author$project$Pages$Capture$showTimerButton, + 'stop', + A2($author$project$Pages$Capture$StopTimer, t.idTimer, capture.idCapture)); + } + case 'Disabled': + return A2($author$project$Pages$Capture$showTimerButton, '...', $author$project$Pages$Capture$None); + case 'Completed': + return A2($author$project$Pages$Capture$showTimerButton, 'completed', $author$project$Pages$Capture$None); + default: + var e = _v0.a; + return A2($author$project$Pages$Capture$showTimerButton, e, $author$project$Pages$Capture$None); + } + }() ])); }; var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); var $author$project$Pages$Capture$view = function (model) { return { - ap: _List_fromArray( + content: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7678,8 +7944,8 @@ var $author$project$Pages$Capture$view = function (model) { $elm$html$Html$text('Dwyl application') ])), function () { - var _v0 = model.N; - if (!_v0.$) { + var _v0 = model.session; + if (_v0.$ === 'Guest') { return A2( $elm$html$Html$a, _List_fromArray( @@ -7697,7 +7963,7 @@ var $author$project$Pages$Capture$view = function (model) { _List_Nil, _List_fromArray( [ - $elm$core$String$isEmpty(model.p) ? A2( + $elm$core$String$isEmpty(model.error) ? A2( $elm$html$Html$div, _List_Nil, _List_fromArray( @@ -7715,7 +7981,7 @@ var $author$project$Pages$Capture$view = function (model) { _List_fromArray( [ $elm$html$Html$Attributes$class('w-80 mr2'), - $elm$html$Html$Attributes$value(model.E.P), + $elm$html$Html$Attributes$value(model.newCapture.text), $elm$html$Html$Events$onInput($author$project$Pages$Capture$UpdateNewCapture) ]), _List_Nil), @@ -7742,7 +8008,7 @@ var $author$project$Pages$Capture$view = function (model) { function (capture) { return $author$project$Pages$Capture$showCapture(capture); }, - model.I)) + model.captures)) ])) : A2( $elm$html$Html$p, _List_fromArray( @@ -7751,19 +8017,19 @@ var $author$project$Pages$Capture$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text(model.p) + $elm$html$Html$text(model.error) ])) ])); } }() ]), - a0: 'Capture' + title: 'Capture' }; }; var $elm$html$Html$span = _VirtualDom_node('span'); var $author$project$Pages$Home$view = function (model) { return { - ap: _List_fromArray( + content: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7793,7 +8059,7 @@ var $author$project$Pages$Home$view = function (model) { $elm$html$Html$text('Dwyl application') ])), function () { - if (!model.$) { + if (model.$ === 'Guest') { return A2( $elm$html$Html$a, _List_fromArray( @@ -7821,7 +8087,7 @@ var $author$project$Pages$Home$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text('logged in with: ' + person.bh) + $elm$html$Html$text('logged in with: ' + person.email) ])), A2( $elm$html$Html$a, @@ -7849,12 +8115,12 @@ var $author$project$Pages$Home$view = function (model) { } }() ]), - a0: 'Home' + title: 'Home' }; }; var $author$project$Pages$Session$view = function (model) { return { - ap: _List_fromArray( + content: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7873,7 +8139,7 @@ var $author$project$Pages$Session$view = function (model) { ]), _List_Nil) ])), - $elm$core$String$isEmpty(model.p) ? A2( + $elm$core$String$isEmpty(model.error) ? A2( $elm$html$Html$p, _List_fromArray( [ @@ -7890,35 +8156,35 @@ var $author$project$Pages$Session$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text(model.p) + $elm$html$Html$text(model.error) ])) ]), - a0: 'Auth' + title: 'Auth' }; }; var $author$project$Main$view = function (model) { switch (model.$) { - case 0: + case 'Home': var home = model.a; return A2( $author$project$Page$view, $author$project$Main$GotHomeMsg, $author$project$Pages$Home$view(home)); - case 1: + case 'Auth': var authModel = model.a; return A2( $author$project$Page$view, $author$project$Main$GotAuthMsg, $author$project$Pages$Auth$view(authModel)); - case 2: + case 'Session': var sessionModel = model.a; return A2( $author$project$Page$view, $author$project$Main$GotPagesSessionMsg, $author$project$Pages$Session$view(sessionModel)); - case 3: + case 'NotFound': return { - al: _List_fromArray( + body: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7948,11 +8214,11 @@ var $author$project$Main$view = function (model) { $elm$html$Html$text('page not found') ])) ]), - a0: 'Not Found' + title: 'Not Found' }; - case 4: + case 'Logout': return { - al: _List_fromArray( + body: _List_fromArray( [ A2( $elm$html$Html$a, @@ -7982,7 +8248,7 @@ var $author$project$Main$view = function (model) { $elm$html$Html$text('Logout') ])) ]), - a0: 'Logout' + title: 'Logout' }; default: var captureModel = model.a; @@ -7993,7 +8259,7 @@ var $author$project$Main$view = function (model) { } }; var $author$project$Main$main = $elm$browser$Browser$application( - {bq: $author$project$Main$init, bB: $author$project$Main$UrlChanged, bC: $author$project$Main$LinkClicked, bL: $author$project$Main$subscriptions, bO: $author$project$Main$update, bP: $author$project$Main$view}); + {init: $author$project$Main$init, onUrlChange: $author$project$Main$UrlChanged, onUrlRequest: $author$project$Main$LinkClicked, subscriptions: $author$project$Main$subscriptions, update: $author$project$Main$update, view: $author$project$Main$view}); _Platform_export({'Main':{'init':$author$project$Main$main( $elm$json$Json$Decode$oneOf( _List_fromArray( diff --git a/elm.json b/elm.json index 019388f..248b81e 100644 --- a/elm.json +++ b/elm.json @@ -11,12 +11,14 @@ "elm/html": "1.0.0", "elm/http": "2.0.0", "elm/json": "1.1.3", - "elm/url": "1.0.0" + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "rtfeldman/elm-iso8601-date-strings": "1.1.3" }, "indirect": { "elm/bytes": "1.0.8", "elm/file": "1.0.5", - "elm/time": "1.0.0", + "elm/parser": "1.1.0", "elm/virtual-dom": "1.0.2" } }, diff --git a/src/Capture.elm b/src/Capture.elm new file mode 100644 index 0000000..badd1d5 --- /dev/null +++ b/src/Capture.elm @@ -0,0 +1,97 @@ +module Capture exposing (..) + +import Json.Decode as JD +import Json.Encode as JE +import Timer exposing (..) + + +type alias Capture = + { idCapture : Int + , text : String + , timers : List Timer + , status : CaptureStatus + } + + +type CaptureStatus + = ToDo + | Completed + | InProgress + | Disabled + | Error String + + +initCapture : Capture +initCapture = + { idCapture = 0 + , text = "" + , timers = [] + , status = ToDo + } + + +capturesDecoder : JD.Decoder (List Capture) +capturesDecoder = + JD.field "data" (JD.list captureDecoder) + + +savedCaptureDecoder : JD.Decoder Capture +savedCaptureDecoder = + JD.field "data" captureDecoder + + +captureDecoder : JD.Decoder Capture +captureDecoder = + JD.map4 Capture + (JD.field "capture_id" JD.int) + (JD.field "text" JD.string) + (JD.field "timers" (JD.list timerDecoder)) + (JD.field "completed" JD.bool |> JD.andThen captureStatusDecoder) + + +captureStatusDecoder : Bool -> JD.Decoder CaptureStatus +captureStatusDecoder completed = + if completed then + completedToStatusDecoder + + else + timersToStatusDecoder + + +completedToStatusDecoder : JD.Decoder CaptureStatus +completedToStatusDecoder = + JD.succeed Completed + + +timersToStatusDecoder : JD.Decoder CaptureStatus +timersToStatusDecoder = + JD.field "timers" (JD.list timerDecoder) + |> JD.andThen + (\timers -> + case List.head timers of + Nothing -> + JD.succeed ToDo + + Just timer -> + case timer.stoppedAt of + Nothing -> + JD.succeed InProgress + + _ -> + JD.succeed ToDo + ) + + +captureEncode : Capture -> JD.Value +captureEncode capture = + JE.object + [ ( "text", JE.string capture.text ) ] + + +{-| Return the current timer linked to the capture +As the API returns the list of timer in descending order from +when they were created, the current timer is the head of the list of timers +-} +getTimer : Capture -> Maybe Timer +getTimer capture = + List.head capture.timers diff --git a/src/Endpoint.elm b/src/Endpoint.elm index 518a3a1..79814c3 100644 --- a/src/Endpoint.elm +++ b/src/Endpoint.elm @@ -1,4 +1,4 @@ -module Endpoint exposing (Endpoint, authUrls, captures, personInfo, toString, url) +module Endpoint exposing (Endpoint, authUrls, captures, personInfo, startTimer, stopTimer, toString, url) import Url.Builder exposing (QueryParameter) @@ -38,6 +38,27 @@ personInfo = url [ "api", "person", "info" ] [] + +-- Captures and Timers + + captures : Endpoint captures = url [ "api", "capture" ] [] + + +startTimer : Int -> Endpoint +startTimer idCapture = + url [ "api", "capture", String.fromInt idCapture, "timers" ] [] + + +stopTimer : Int -> Int -> Endpoint +stopTimer idTimer idCapture = + url + [ "api" + , "capture" + , String.fromInt idCapture + , "timers" + , String.fromInt idTimer + ] + [] diff --git a/src/Pages/Capture.elm b/src/Pages/Capture.elm index 6b02634..1aef37b 100644 --- a/src/Pages/Capture.elm +++ b/src/Pages/Capture.elm @@ -1,16 +1,16 @@ module Pages.Capture exposing (Model, Msg(..), init, subscriptions, toSession, update, view) import Asset +import Capture exposing (..) import Endpoint import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http -import Json.Decode as JD -import Json.Encode as JE import Page import Route import Session exposing (..) +import Timer exposing (..) @@ -25,19 +25,6 @@ type alias Model = } -type alias Capture = - { idCapture : Int - , text : String - , completed : Bool - , disabled : Bool - } - - -initCapture : Capture -initCapture = - Capture 0 "" False False - - init : Session -> ( Model, Cmd Msg ) init session = ( Model session [] initCapture "", getCaptures (token session) ) @@ -54,11 +41,17 @@ type Msg | UpdateNewCapture String | AddCapture | StartTimer Int + | StopTimer Int Int + | TimerUpdated CaptureStatus (Result Http.Error Timer) + | None update : Msg -> Model -> ( Model, Cmd Msg ) update msg model = case msg of + None -> + ( model, Cmd.none ) + GotSession session -> ( { model | session = session } , Route.replaceUrl (Session.navKey model.session) Route.Home @@ -67,6 +60,10 @@ update msg model = GotCaptures result -> case result of Ok captures -> + let + _ = + Debug.log "captures" captures + in ( { model | captures = captures, error = "" }, Cmd.none ) Err httpError -> @@ -113,17 +110,28 @@ update msg model = StartTimer idCapture -> let captures = - List.map - (\c -> - if c.idCapture == idCapture then - { c | disabled = True } - - else - c - ) - model.captures + updateCapture Disabled idCapture model.captures in - ( { model | captures = captures }, Cmd.none ) + ( { model | captures = captures }, startTimer (token model.session) idCapture ) + + StopTimer idTimer idCapture -> + ( model, stopTimer (token model.session) idTimer idCapture ) + + TimerUpdated _ result -> + case result of + Ok _ -> + ( { model | error = "" }, getCaptures (token model.session) ) + + Err httpError -> + case httpError of + Http.BadStatus 401 -> + ( { model | error = "Access not authorised" }, Cmd.none ) + + Http.BadStatus 404 -> + ( { model | error = "create timer endpoint not found" }, Cmd.none ) + + _ -> + ( { model | error = "Error while starting the timer" }, Cmd.none ) @@ -172,6 +180,78 @@ subscriptions model = -- captures +startTimer : String -> Int -> Cmd Msg +startTimer token idCapture = + Http.request + { method = "POST" + , headers = [ Http.header "authorization" ("Bearer " ++ token) ] + , url = Endpoint.toString (Endpoint.startTimer idCapture) + , body = Http.emptyBody + , expect = Http.expectJson (TimerUpdated InProgress) timerDataDecoder + , timeout = Nothing + , tracker = Nothing + } + + +stopTimer : String -> Int -> Int -> Cmd Msg +stopTimer token idTimer idCapture = + Http.request + { method = "PUT" + , headers = [ Http.header "authorization" ("Bearer " ++ token) ] + , url = Endpoint.toString (Endpoint.stopTimer idTimer idCapture) + , body = Http.jsonBody <| actionTimerEncode "stop" + , expect = Http.expectJson (TimerUpdated ToDo) timerDataDecoder + , timeout = Nothing + , tracker = Nothing + } + + +showCapture : Capture -> Html Msg +showCapture capture = + div [ class "pa2" ] + [ label + [ class "dib pa2" ] + [ input [ type_ "checkbox", checked False, disabled False, class "mr2" ] [] + , text <| capture.text + ] + , case capture.status of + ToDo -> + showTimerButton "start" (StartTimer capture.idCapture) + + InProgress -> + let + timer = + getTimer capture + in + case timer of + Nothing -> + showTimerButton "Error Timer" None + + Just t -> + showTimerButton "stop" (StopTimer t.idTimer capture.idCapture) + + Disabled -> + showTimerButton "..." None + + Completed -> + showTimerButton "completed" None + + Error e -> + showTimerButton e None + ] + + +showTimerButton : String -> Msg -> Html Msg +showTimerButton textButton msg = + button + [ disabled False + , class "fr" + , classList [ ( "pointer", True ) ] + , onClick msg + ] + [ text textButton ] + + getCaptures : String -> Cmd Msg getCaptures token = Http.request @@ -198,46 +278,14 @@ saveCapture token capture = } +updateCapture : CaptureStatus -> Int -> List Capture -> List Capture +updateCapture status idCapture listCaptures = + List.map + (\c -> + if idCapture == c.idCapture then + { c | status = status } --- captures decoder - - -capturesDecoder : JD.Decoder (List Capture) -capturesDecoder = - JD.field "data" (JD.list captureDecoder) - - -savedCaptureDecoder : JD.Decoder Capture -savedCaptureDecoder = - JD.field "data" captureDecoder - - -captureDecoder : JD.Decoder Capture -captureDecoder = - JD.map4 Capture - (JD.field "capture_id" JD.int) - (JD.field "text" JD.string) - (JD.field "completed" JD.bool) - (JD.succeed False) - - -captureEncode : Capture -> JD.Value -captureEncode capture = - JE.object - [ ( "text", JE.string capture.text ) ] - - - --- show capture - - -showCapture : Capture -> Html Msg -showCapture capture = - div [ class "pa2" ] - [ label - [ class "dib pa2" ] - [ input [ type_ "checkbox", checked capture.completed, disabled capture.disabled, class "mr2" ] [] - , text <| capture.text - ] - , button [ disabled capture.disabled, class "fr", classList [ ( "pointer", not capture.disabled ) ], onClick (StartTimer capture.idCapture) ] [ text "Start" ] - ] + else + c + ) + listCaptures diff --git a/src/Timer.elm b/src/Timer.elm new file mode 100644 index 0000000..9ff88a6 --- /dev/null +++ b/src/Timer.elm @@ -0,0 +1,32 @@ +module Timer exposing (Timer, actionTimerEncode, timerDataDecoder, timerDecoder) + +import Json.Decode as JD +import Json.Encode as JE + + +type alias Timer = + { idTimer : Int + , idCapture : Int + , startedAt : String + , stoppedAt : Maybe String + } + + +timerDataDecoder : JD.Decoder Timer +timerDataDecoder = + JD.field "data" timerDecoder + + +timerDecoder : JD.Decoder Timer +timerDecoder = + JD.map4 Timer + (JD.field "timer_id" JD.int) + (JD.field "capture_id" JD.int) + (JD.field "started_at" JD.string) + (JD.maybe (JD.field "stopped_at" JD.string)) + + +actionTimerEncode : String -> JD.Value +actionTimerEncode action = + JE.object + [ ( "action", JE.string action ) ] From f223115cca993750bba8a45eee5dafda6b5f0eaf Mon Sep 17 00:00:00 2001 From: SimonLab Date: Mon, 16 Mar 2020 13:13:25 +0100 Subject: [PATCH 3/7] decode timer times to Posix with Iso8601 --- elm.js | 920 +++++++++++++++++++++++++++++++++++++++++++++++++- src/Timer.elm | 11 +- 2 files changed, 923 insertions(+), 8 deletions(-) diff --git a/elm.js b/elm.js index 3fc29cf..200b334 100644 --- a/elm.js +++ b/elm.js @@ -4547,7 +4547,137 @@ function _Http_track(router, xhr, tracker) size: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing })))); }); -}var $elm$core$Maybe$Just = function (a) { +} + + + +// STRINGS + + +var _Parser_isSubString = F5(function(smallString, offset, row, col, bigString) +{ + var smallLength = smallString.length; + var isGood = offset + smallLength <= bigString.length; + + for (var i = 0; isGood && i < smallLength; ) + { + var code = bigString.charCodeAt(offset); + isGood = + smallString[i++] === bigString[offset++] + && ( + code === 0x000A /* \n */ + ? ( row++, col=1 ) + : ( col++, (code & 0xF800) === 0xD800 ? smallString[i++] === bigString[offset++] : 1 ) + ) + } + + return _Utils_Tuple3(isGood ? offset : -1, row, col); +}); + + + +// CHARS + + +var _Parser_isSubChar = F3(function(predicate, offset, string) +{ + return ( + string.length <= offset + ? -1 + : + (string.charCodeAt(offset) & 0xF800) === 0xD800 + ? (predicate(_Utils_chr(string.substr(offset, 2))) ? offset + 2 : -1) + : + (predicate(_Utils_chr(string[offset])) + ? ((string[offset] === '\n') ? -2 : (offset + 1)) + : -1 + ) + ); +}); + + +var _Parser_isAsciiCode = F3(function(code, offset, string) +{ + return string.charCodeAt(offset) === code; +}); + + + +// NUMBERS + + +var _Parser_chompBase10 = F2(function(offset, string) +{ + for (; offset < string.length; offset++) + { + var code = string.charCodeAt(offset); + if (code < 0x30 || 0x39 < code) + { + return offset; + } + } + return offset; +}); + + +var _Parser_consumeBase = F3(function(base, offset, string) +{ + for (var total = 0; offset < string.length; offset++) + { + var digit = string.charCodeAt(offset) - 0x30; + if (digit < 0 || base <= digit) break; + total = base * total + digit; + } + return _Utils_Tuple2(offset, total); +}); + + +var _Parser_consumeBase16 = F2(function(offset, string) +{ + for (var total = 0; offset < string.length; offset++) + { + var code = string.charCodeAt(offset); + if (0x30 <= code && code <= 0x39) + { + total = 16 * total + code - 0x30; + } + else if (0x41 <= code && code <= 0x46) + { + total = 16 * total + code - 55; + } + else if (0x61 <= code && code <= 0x66) + { + total = 16 * total + code - 87; + } + else + { + break; + } + } + return _Utils_Tuple2(offset, total); +}); + + + +// FIND STRING + + +var _Parser_findSubString = F5(function(smallString, offset, row, col, bigString) +{ + var newOffset = bigString.indexOf(smallString, offset); + var target = newOffset < 0 ? bigString.length : newOffset + smallString.length; + + while (offset < target) + { + var code = bigString.charCodeAt(offset++); + code === 0x000A /* \n */ + ? ( col=1, row++ ) + : ( col++, (code & 0xF800) === 0xD800 && offset++ ) + } + + return _Utils_Tuple3(newOffset, row, col); +}); +var $elm$core$Maybe$Just = function (a) { return {$: 'Just', a: a}; }; var $author$project$Main$LinkClicked = function (a) { @@ -6627,6 +6757,790 @@ var $author$project$Timer$Timer = F4( function (idTimer, idCapture, startedAt, stoppedAt) { return {idCapture: idCapture, idTimer: idTimer, startedAt: startedAt, stoppedAt: stoppedAt}; }); +var $elm$parser$Parser$deadEndsToString = function (deadEnds) { + return 'TODO deadEndsToString'; +}; +var $elm$parser$Parser$Advanced$Bad = F2( + function (a, b) { + return {$: 'Bad', a: a, b: b}; + }); +var $elm$parser$Parser$Advanced$Good = F3( + function (a, b, c) { + return {$: 'Good', a: a, b: b, c: c}; + }); +var $elm$parser$Parser$Advanced$Parser = function (a) { + return {$: 'Parser', a: a}; +}; +var $elm$parser$Parser$Advanced$andThen = F2( + function (callback, _v0) { + var parseA = _v0.a; + return $elm$parser$Parser$Advanced$Parser( + function (s0) { + var _v1 = parseA(s0); + if (_v1.$ === 'Bad') { + var p = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } else { + var p1 = _v1.a; + var a = _v1.b; + var s1 = _v1.c; + var _v2 = callback(a); + var parseB = _v2.a; + var _v3 = parseB(s1); + if (_v3.$ === 'Bad') { + var p2 = _v3.a; + var x = _v3.b; + return A2($elm$parser$Parser$Advanced$Bad, p1 || p2, x); + } else { + var p2 = _v3.a; + var b = _v3.b; + var s2 = _v3.c; + return A3($elm$parser$Parser$Advanced$Good, p1 || p2, b, s2); + } + } + }); + }); +var $elm$parser$Parser$andThen = $elm$parser$Parser$Advanced$andThen; +var $elm$parser$Parser$ExpectingEnd = {$: 'ExpectingEnd'}; +var $elm$parser$Parser$Advanced$AddRight = F2( + function (a, b) { + return {$: 'AddRight', a: a, b: b}; + }); +var $elm$parser$Parser$Advanced$DeadEnd = F4( + function (row, col, problem, contextStack) { + return {col: col, contextStack: contextStack, problem: problem, row: row}; + }); +var $elm$parser$Parser$Advanced$Empty = {$: 'Empty'}; +var $elm$parser$Parser$Advanced$fromState = F2( + function (s, x) { + return A2( + $elm$parser$Parser$Advanced$AddRight, + $elm$parser$Parser$Advanced$Empty, + A4($elm$parser$Parser$Advanced$DeadEnd, s.row, s.col, x, s.context)); + }); +var $elm$parser$Parser$Advanced$end = function (x) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + return _Utils_eq( + $elm$core$String$length(s.src), + s.offset) ? A3($elm$parser$Parser$Advanced$Good, false, _Utils_Tuple0, s) : A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, x)); + }); +}; +var $elm$parser$Parser$end = $elm$parser$Parser$Advanced$end($elm$parser$Parser$ExpectingEnd); +var $elm$parser$Parser$Advanced$isSubChar = _Parser_isSubChar; +var $elm$core$Basics$negate = function (n) { + return -n; +}; +var $elm$parser$Parser$Advanced$chompWhileHelp = F5( + function (isGood, offset, row, col, s0) { + chompWhileHelp: + while (true) { + var newOffset = A3($elm$parser$Parser$Advanced$isSubChar, isGood, offset, s0.src); + if (_Utils_eq(newOffset, -1)) { + return A3( + $elm$parser$Parser$Advanced$Good, + _Utils_cmp(s0.offset, offset) < 0, + _Utils_Tuple0, + {col: col, context: s0.context, indent: s0.indent, offset: offset, row: row, src: s0.src}); + } else { + if (_Utils_eq(newOffset, -2)) { + var $temp$isGood = isGood, + $temp$offset = offset + 1, + $temp$row = row + 1, + $temp$col = 1, + $temp$s0 = s0; + isGood = $temp$isGood; + offset = $temp$offset; + row = $temp$row; + col = $temp$col; + s0 = $temp$s0; + continue chompWhileHelp; + } else { + var $temp$isGood = isGood, + $temp$offset = newOffset, + $temp$row = row, + $temp$col = col + 1, + $temp$s0 = s0; + isGood = $temp$isGood; + offset = $temp$offset; + row = $temp$row; + col = $temp$col; + s0 = $temp$s0; + continue chompWhileHelp; + } + } + } + }); +var $elm$parser$Parser$Advanced$chompWhile = function (isGood) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + return A5($elm$parser$Parser$Advanced$chompWhileHelp, isGood, s.offset, s.row, s.col, s); + }); +}; +var $elm$parser$Parser$chompWhile = $elm$parser$Parser$Advanced$chompWhile; +var $elm$core$Basics$always = F2( + function (a, _v0) { + return a; + }); +var $elm$parser$Parser$Advanced$mapChompedString = F2( + function (func, _v0) { + var parse = _v0.a; + return $elm$parser$Parser$Advanced$Parser( + function (s0) { + var _v1 = parse(s0); + if (_v1.$ === 'Bad') { + var p = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } else { + var p = _v1.a; + var a = _v1.b; + var s1 = _v1.c; + return A3( + $elm$parser$Parser$Advanced$Good, + p, + A2( + func, + A3($elm$core$String$slice, s0.offset, s1.offset, s0.src), + a), + s1); + } + }); + }); +var $elm$parser$Parser$Advanced$getChompedString = function (parser) { + return A2($elm$parser$Parser$Advanced$mapChompedString, $elm$core$Basics$always, parser); +}; +var $elm$parser$Parser$getChompedString = $elm$parser$Parser$Advanced$getChompedString; +var $elm$parser$Parser$Problem = function (a) { + return {$: 'Problem', a: a}; +}; +var $elm$parser$Parser$Advanced$problem = function (x) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + return A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, x)); + }); +}; +var $elm$parser$Parser$problem = function (msg) { + return $elm$parser$Parser$Advanced$problem( + $elm$parser$Parser$Problem(msg)); +}; +var $elm$core$Basics$round = _Basics_round; +var $elm$parser$Parser$Advanced$succeed = function (a) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + return A3($elm$parser$Parser$Advanced$Good, false, a, s); + }); +}; +var $elm$parser$Parser$succeed = $elm$parser$Parser$Advanced$succeed; +var $elm$core$String$toFloat = _String_toFloat; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$fractionsOfASecondInMs = A2( + $elm$parser$Parser$andThen, + function (str) { + if ($elm$core$String$length(str) <= 9) { + var _v0 = $elm$core$String$toFloat('0.' + str); + if (_v0.$ === 'Just') { + var floatVal = _v0.a; + return $elm$parser$Parser$succeed( + $elm$core$Basics$round(floatVal * 1000)); + } else { + return $elm$parser$Parser$problem('Invalid float: \"' + (str + '\"')); + } + } else { + return $elm$parser$Parser$problem( + 'Expected at most 9 digits, but got ' + $elm$core$String$fromInt( + $elm$core$String$length(str))); + } + }, + $elm$parser$Parser$getChompedString( + $elm$parser$Parser$chompWhile($elm$core$Char$isDigit))); +var $elm$time$Time$Posix = function (a) { + return {$: 'Posix', a: a}; +}; +var $elm$time$Time$millisToPosix = $elm$time$Time$Posix; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$fromParts = F6( + function (monthYearDayMs, hour, minute, second, ms, utcOffsetMinutes) { + return $elm$time$Time$millisToPosix((((monthYearDayMs + (((hour * 60) * 60) * 1000)) + (((minute - utcOffsetMinutes) * 60) * 1000)) + (second * 1000)) + ms); + }); +var $elm$parser$Parser$Advanced$map2 = F3( + function (func, _v0, _v1) { + var parseA = _v0.a; + var parseB = _v1.a; + return $elm$parser$Parser$Advanced$Parser( + function (s0) { + var _v2 = parseA(s0); + if (_v2.$ === 'Bad') { + var p = _v2.a; + var x = _v2.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } else { + var p1 = _v2.a; + var a = _v2.b; + var s1 = _v2.c; + var _v3 = parseB(s1); + if (_v3.$ === 'Bad') { + var p2 = _v3.a; + var x = _v3.b; + return A2($elm$parser$Parser$Advanced$Bad, p1 || p2, x); + } else { + var p2 = _v3.a; + var b = _v3.b; + var s2 = _v3.c; + return A3( + $elm$parser$Parser$Advanced$Good, + p1 || p2, + A2(func, a, b), + s2); + } + } + }); + }); +var $elm$parser$Parser$Advanced$ignorer = F2( + function (keepParser, ignoreParser) { + return A3($elm$parser$Parser$Advanced$map2, $elm$core$Basics$always, keepParser, ignoreParser); + }); +var $elm$parser$Parser$ignorer = $elm$parser$Parser$Advanced$ignorer; +var $elm$parser$Parser$Advanced$keeper = F2( + function (parseFunc, parseArg) { + return A3($elm$parser$Parser$Advanced$map2, $elm$core$Basics$apL, parseFunc, parseArg); + }); +var $elm$parser$Parser$keeper = $elm$parser$Parser$Advanced$keeper; +var $elm$parser$Parser$Advanced$Append = F2( + function (a, b) { + return {$: 'Append', a: a, b: b}; + }); +var $elm$parser$Parser$Advanced$oneOfHelp = F3( + function (s0, bag, parsers) { + oneOfHelp: + while (true) { + if (!parsers.b) { + return A2($elm$parser$Parser$Advanced$Bad, false, bag); + } else { + var parse = parsers.a.a; + var remainingParsers = parsers.b; + var _v1 = parse(s0); + if (_v1.$ === 'Good') { + var step = _v1; + return step; + } else { + var step = _v1; + var p = step.a; + var x = step.b; + if (p) { + return step; + } else { + var $temp$s0 = s0, + $temp$bag = A2($elm$parser$Parser$Advanced$Append, bag, x), + $temp$parsers = remainingParsers; + s0 = $temp$s0; + bag = $temp$bag; + parsers = $temp$parsers; + continue oneOfHelp; + } + } + } + } + }); +var $elm$parser$Parser$Advanced$oneOf = function (parsers) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + return A3($elm$parser$Parser$Advanced$oneOfHelp, s, $elm$parser$Parser$Advanced$Empty, parsers); + }); +}; +var $elm$parser$Parser$oneOf = $elm$parser$Parser$Advanced$oneOf; +var $elm$parser$Parser$Done = function (a) { + return {$: 'Done', a: a}; +}; +var $elm$parser$Parser$Loop = function (a) { + return {$: 'Loop', a: a}; +}; +var $elm$core$String$append = _String_append; +var $elm$parser$Parser$UnexpectedChar = {$: 'UnexpectedChar'}; +var $elm$parser$Parser$Advanced$chompIf = F2( + function (isGood, expecting) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + var newOffset = A3($elm$parser$Parser$Advanced$isSubChar, isGood, s.offset, s.src); + return _Utils_eq(newOffset, -1) ? A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, expecting)) : (_Utils_eq(newOffset, -2) ? A3( + $elm$parser$Parser$Advanced$Good, + true, + _Utils_Tuple0, + {col: 1, context: s.context, indent: s.indent, offset: s.offset + 1, row: s.row + 1, src: s.src}) : A3( + $elm$parser$Parser$Advanced$Good, + true, + _Utils_Tuple0, + {col: s.col + 1, context: s.context, indent: s.indent, offset: newOffset, row: s.row, src: s.src})); + }); + }); +var $elm$parser$Parser$chompIf = function (isGood) { + return A2($elm$parser$Parser$Advanced$chompIf, isGood, $elm$parser$Parser$UnexpectedChar); +}; +var $elm$parser$Parser$Advanced$loopHelp = F4( + function (p, state, callback, s0) { + loopHelp: + while (true) { + var _v0 = callback(state); + var parse = _v0.a; + var _v1 = parse(s0); + if (_v1.$ === 'Good') { + var p1 = _v1.a; + var step = _v1.b; + var s1 = _v1.c; + if (step.$ === 'Loop') { + var newState = step.a; + var $temp$p = p || p1, + $temp$state = newState, + $temp$callback = callback, + $temp$s0 = s1; + p = $temp$p; + state = $temp$state; + callback = $temp$callback; + s0 = $temp$s0; + continue loopHelp; + } else { + var result = step.a; + return A3($elm$parser$Parser$Advanced$Good, p || p1, result, s1); + } + } else { + var p1 = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p || p1, x); + } + } + }); +var $elm$parser$Parser$Advanced$loop = F2( + function (state, callback) { + return $elm$parser$Parser$Advanced$Parser( + function (s) { + return A4($elm$parser$Parser$Advanced$loopHelp, false, state, callback, s); + }); + }); +var $elm$parser$Parser$Advanced$map = F2( + function (func, _v0) { + var parse = _v0.a; + return $elm$parser$Parser$Advanced$Parser( + function (s0) { + var _v1 = parse(s0); + if (_v1.$ === 'Good') { + var p = _v1.a; + var a = _v1.b; + var s1 = _v1.c; + return A3( + $elm$parser$Parser$Advanced$Good, + p, + func(a), + s1); + } else { + var p = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } + }); + }); +var $elm$parser$Parser$map = $elm$parser$Parser$Advanced$map; +var $elm$parser$Parser$Advanced$Done = function (a) { + return {$: 'Done', a: a}; +}; +var $elm$parser$Parser$Advanced$Loop = function (a) { + return {$: 'Loop', a: a}; +}; +var $elm$parser$Parser$toAdvancedStep = function (step) { + if (step.$ === 'Loop') { + var s = step.a; + return $elm$parser$Parser$Advanced$Loop(s); + } else { + var a = step.a; + return $elm$parser$Parser$Advanced$Done(a); + } +}; +var $elm$parser$Parser$loop = F2( + function (state, callback) { + return A2( + $elm$parser$Parser$Advanced$loop, + state, + function (s) { + return A2( + $elm$parser$Parser$map, + $elm$parser$Parser$toAdvancedStep, + callback(s)); + }); + }); +var $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt = function (quantity) { + var helper = function (str) { + if (_Utils_eq( + $elm$core$String$length(str), + quantity)) { + var _v0 = $elm$core$String$toInt(str); + if (_v0.$ === 'Just') { + var intVal = _v0.a; + return A2( + $elm$parser$Parser$map, + $elm$parser$Parser$Done, + $elm$parser$Parser$succeed(intVal)); + } else { + return $elm$parser$Parser$problem('Invalid integer: \"' + (str + '\"')); + } + } else { + return A2( + $elm$parser$Parser$map, + function (nextChar) { + return $elm$parser$Parser$Loop( + A2($elm$core$String$append, str, nextChar)); + }, + $elm$parser$Parser$getChompedString( + $elm$parser$Parser$chompIf($elm$core$Char$isDigit))); + } + }; + return A2($elm$parser$Parser$loop, '', helper); +}; +var $elm$parser$Parser$ExpectingSymbol = function (a) { + return {$: 'ExpectingSymbol', a: a}; +}; +var $elm$parser$Parser$Advanced$Token = F2( + function (a, b) { + return {$: 'Token', a: a, b: b}; + }); +var $elm$parser$Parser$Advanced$isSubString = _Parser_isSubString; +var $elm$core$Basics$not = _Basics_not; +var $elm$parser$Parser$Advanced$token = function (_v0) { + var str = _v0.a; + var expecting = _v0.b; + var progress = !$elm$core$String$isEmpty(str); + return $elm$parser$Parser$Advanced$Parser( + function (s) { + var _v1 = A5($elm$parser$Parser$Advanced$isSubString, str, s.offset, s.row, s.col, s.src); + var newOffset = _v1.a; + var newRow = _v1.b; + var newCol = _v1.c; + return _Utils_eq(newOffset, -1) ? A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, expecting)) : A3( + $elm$parser$Parser$Advanced$Good, + progress, + _Utils_Tuple0, + {col: newCol, context: s.context, indent: s.indent, offset: newOffset, row: newRow, src: s.src}); + }); +}; +var $elm$parser$Parser$Advanced$symbol = $elm$parser$Parser$Advanced$token; +var $elm$parser$Parser$symbol = function (str) { + return $elm$parser$Parser$Advanced$symbol( + A2( + $elm$parser$Parser$Advanced$Token, + str, + $elm$parser$Parser$ExpectingSymbol(str))); +}; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$epochYear = 1970; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay = function (day) { + return $elm$parser$Parser$problem( + 'Invalid day: ' + $elm$core$String$fromInt(day)); +}; +var $elm$core$Basics$modBy = _Basics_modBy; +var $elm$core$Basics$neq = _Utils_notEqual; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$isLeapYear = function (year) { + return (!A2($elm$core$Basics$modBy, 4, year)) && ((!(!A2($elm$core$Basics$modBy, 100, year))) || (!A2($elm$core$Basics$modBy, 400, year))); +}; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$leapYearsBefore = function (y1) { + var y = y1 - 1; + return (((y / 4) | 0) - ((y / 100) | 0)) + ((y / 400) | 0); +}; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$msPerDay = 86400000; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$msPerYear = 31536000000; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$yearMonthDay = function (_v0) { + var year = _v0.a; + var month = _v0.b; + var dayInMonth = _v0.c; + if (dayInMonth < 0) { + return $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth); + } else { + var succeedWith = function (extraMs) { + var yearMs = $rtfeldman$elm_iso8601_date_strings$Iso8601$msPerYear * (year - $rtfeldman$elm_iso8601_date_strings$Iso8601$epochYear); + var days = ((month < 3) || (!$rtfeldman$elm_iso8601_date_strings$Iso8601$isLeapYear(year))) ? (dayInMonth - 1) : dayInMonth; + var dayMs = $rtfeldman$elm_iso8601_date_strings$Iso8601$msPerDay * (days + ($rtfeldman$elm_iso8601_date_strings$Iso8601$leapYearsBefore(year) - $rtfeldman$elm_iso8601_date_strings$Iso8601$leapYearsBefore($rtfeldman$elm_iso8601_date_strings$Iso8601$epochYear))); + return $elm$parser$Parser$succeed((extraMs + yearMs) + dayMs); + }; + switch (month) { + case 1: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(0); + case 2: + return ((dayInMonth > 29) || ((dayInMonth === 29) && (!$rtfeldman$elm_iso8601_date_strings$Iso8601$isLeapYear(year)))) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(2678400000); + case 3: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(5097600000); + case 4: + return (dayInMonth > 30) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(7776000000); + case 5: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(10368000000); + case 6: + return (dayInMonth > 30) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(13046400000); + case 7: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(15638400000); + case 8: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(18316800000); + case 9: + return (dayInMonth > 30) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(20995200000); + case 10: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(23587200000); + case 11: + return (dayInMonth > 30) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(26265600000); + case 12: + return (dayInMonth > 31) ? $rtfeldman$elm_iso8601_date_strings$Iso8601$invalidDay(dayInMonth) : succeedWith(28857600000); + default: + return $elm$parser$Parser$problem( + 'Invalid month: \"' + ($elm$core$String$fromInt(month) + '\"')); + } + } +}; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$monthYearDayInMs = A2( + $elm$parser$Parser$andThen, + $rtfeldman$elm_iso8601_date_strings$Iso8601$yearMonthDay, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + $elm$parser$Parser$succeed( + F3( + function (year, month, day) { + return _Utils_Tuple3(year, month, day); + })), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(4)), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$symbol('-')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2) + ]))), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$symbol('-')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2) + ])))); +var $rtfeldman$elm_iso8601_date_strings$Iso8601$utcOffsetInMinutes = function () { + var utcOffsetMinutesFromParts = F3( + function (multiplier, hours, minutes) { + return (multiplier * (hours * 60)) + minutes; + }); + return A2( + $elm$parser$Parser$keeper, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$map, + function (_v0) { + return 0; + }, + $elm$parser$Parser$symbol('Z')), + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + $elm$parser$Parser$succeed(utcOffsetMinutesFromParts), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$map, + function (_v1) { + return 1; + }, + $elm$parser$Parser$symbol('+')), + A2( + $elm$parser$Parser$map, + function (_v2) { + return -1; + }, + $elm$parser$Parser$symbol('-')) + ]))), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$symbol(':')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2), + $elm$parser$Parser$succeed(0) + ]))), + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed(0), + $elm$parser$Parser$end) + ]))); +}(); +var $rtfeldman$elm_iso8601_date_strings$Iso8601$iso8601 = A2( + $elm$parser$Parser$andThen, + function (datePart) { + return $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed( + $rtfeldman$elm_iso8601_date_strings$Iso8601$fromParts(datePart)), + $elm$parser$Parser$symbol('T')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$symbol(':')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2) + ]))), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$symbol(':')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2)), + $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt(2) + ]))), + $elm$parser$Parser$oneOf( + _List_fromArray( + [ + A2( + $elm$parser$Parser$keeper, + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed($elm$core$Basics$identity), + $elm$parser$Parser$symbol('.')), + $rtfeldman$elm_iso8601_date_strings$Iso8601$fractionsOfASecondInMs), + $elm$parser$Parser$succeed(0) + ]))), + A2($elm$parser$Parser$ignorer, $rtfeldman$elm_iso8601_date_strings$Iso8601$utcOffsetInMinutes, $elm$parser$Parser$end)), + A2( + $elm$parser$Parser$ignorer, + $elm$parser$Parser$succeed( + A6($rtfeldman$elm_iso8601_date_strings$Iso8601$fromParts, datePart, 0, 0, 0, 0, 0)), + $elm$parser$Parser$end) + ])); + }, + $rtfeldman$elm_iso8601_date_strings$Iso8601$monthYearDayInMs); +var $elm$parser$Parser$DeadEnd = F3( + function (row, col, problem) { + return {col: col, problem: problem, row: row}; + }); +var $elm$parser$Parser$problemToDeadEnd = function (p) { + return A3($elm$parser$Parser$DeadEnd, p.row, p.col, p.problem); +}; +var $elm$parser$Parser$Advanced$bagToList = F2( + function (bag, list) { + bagToList: + while (true) { + switch (bag.$) { + case 'Empty': + return list; + case 'AddRight': + var bag1 = bag.a; + var x = bag.b; + var $temp$bag = bag1, + $temp$list = A2($elm$core$List$cons, x, list); + bag = $temp$bag; + list = $temp$list; + continue bagToList; + default: + var bag1 = bag.a; + var bag2 = bag.b; + var $temp$bag = bag1, + $temp$list = A2($elm$parser$Parser$Advanced$bagToList, bag2, list); + bag = $temp$bag; + list = $temp$list; + continue bagToList; + } + } + }); +var $elm$parser$Parser$Advanced$run = F2( + function (_v0, src) { + var parse = _v0.a; + var _v1 = parse( + {col: 1, context: _List_Nil, indent: 1, offset: 0, row: 1, src: src}); + if (_v1.$ === 'Good') { + var value = _v1.b; + return $elm$core$Result$Ok(value); + } else { + var bag = _v1.b; + return $elm$core$Result$Err( + A2($elm$parser$Parser$Advanced$bagToList, bag, _List_Nil)); + } + }); +var $elm$parser$Parser$run = F2( + function (parser, source) { + var _v0 = A2($elm$parser$Parser$Advanced$run, parser, source); + if (_v0.$ === 'Ok') { + var a = _v0.a; + return $elm$core$Result$Ok(a); + } else { + var problems = _v0.a; + return $elm$core$Result$Err( + A2($elm$core$List$map, $elm$parser$Parser$problemToDeadEnd, problems)); + } + }); +var $rtfeldman$elm_iso8601_date_strings$Iso8601$toTime = function (str) { + return A2($elm$parser$Parser$run, $rtfeldman$elm_iso8601_date_strings$Iso8601$iso8601, str); +}; +var $rtfeldman$elm_iso8601_date_strings$Iso8601$decoder = A2( + $elm$json$Json$Decode$andThen, + function (str) { + var _v0 = $rtfeldman$elm_iso8601_date_strings$Iso8601$toTime(str); + if (_v0.$ === 'Err') { + var deadEnds = _v0.a; + return $elm$json$Json$Decode$fail( + $elm$parser$Parser$deadEndsToString(deadEnds)); + } else { + var time = _v0.a; + return $elm$json$Json$Decode$succeed(time); + } + }, + $elm$json$Json$Decode$string); var $elm$json$Json$Decode$int = _Json_decodeInt; var $elm$json$Json$Decode$map4 = _Json_map4; var $elm$json$Json$Decode$oneOf = _Json_oneOf; @@ -6643,9 +7557,9 @@ var $author$project$Timer$timerDecoder = A5( $author$project$Timer$Timer, A2($elm$json$Json$Decode$field, 'timer_id', $elm$json$Json$Decode$int), A2($elm$json$Json$Decode$field, 'capture_id', $elm$json$Json$Decode$int), - A2($elm$json$Json$Decode$field, 'started_at', $elm$json$Json$Decode$string), + A2($elm$json$Json$Decode$field, 'started_at', $rtfeldman$elm_iso8601_date_strings$Iso8601$decoder), $elm$json$Json$Decode$maybe( - A2($elm$json$Json$Decode$field, 'stopped_at', $elm$json$Json$Decode$string))); + A2($elm$json$Json$Decode$field, 'stopped_at', $rtfeldman$elm_iso8601_date_strings$Iso8601$decoder))); var $author$project$Capture$timersToStatusDecoder = A2( $elm$json$Json$Decode$andThen, function (timers) { diff --git a/src/Timer.elm b/src/Timer.elm index 9ff88a6..ad48e26 100644 --- a/src/Timer.elm +++ b/src/Timer.elm @@ -2,13 +2,14 @@ module Timer exposing (Timer, actionTimerEncode, timerDataDecoder, timerDecoder) import Json.Decode as JD import Json.Encode as JE - +import Time +import Iso8601 type alias Timer = { idTimer : Int , idCapture : Int - , startedAt : String - , stoppedAt : Maybe String + , startedAt : Time.Posix + , stoppedAt : Maybe Time.Posix } @@ -22,8 +23,8 @@ timerDecoder = JD.map4 Timer (JD.field "timer_id" JD.int) (JD.field "capture_id" JD.int) - (JD.field "started_at" JD.string) - (JD.maybe (JD.field "stopped_at" JD.string)) + (JD.field "started_at" Iso8601.decoder) + (JD.maybe (JD.field "stopped_at" Iso8601.decoder)) actionTimerEncode : String -> JD.Value From b75a8312c40c330eec5952185ec46f7d611813f1 Mon Sep 17 00:00:00 2001 From: SimonLab Date: Fri, 20 Mar 2020 12:00:21 +0000 Subject: [PATCH 4/7] display current time when capture in progress --- elm.js | 2424 +++++++++++++++++++++++++---------------- src/Capture.elm | 11 +- src/Pages/Capture.elm | 117 +- src/Timer.elm | 64 +- 4 files changed, 1655 insertions(+), 961 deletions(-) diff --git a/elm.js b/elm.js index 200b334..7a9702c 100644 --- a/elm.js +++ b/elm.js @@ -77,7 +77,7 @@ function A9(fun, a, b, c, d, e, f, g, h, i) { 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); } -console.warn('Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.'); + // EQUALITY @@ -113,7 +113,7 @@ function _Utils_eqHelp(x, y, depth, stack) return true; } - /**/ + /**_UNUSED/ if (x.$ === 'Set_elm_builtin') { x = $elm$core$Set$toList(x); @@ -126,7 +126,7 @@ function _Utils_eqHelp(x, y, depth, stack) } //*/ - /**_UNUSED/ + /**/ if (x.$ < 0) { x = $elm$core$Dict$toList(x); @@ -161,7 +161,7 @@ function _Utils_cmp(x, y, ord) return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1; } - /**/ + /**_UNUSED/ if (x instanceof String) { var a = x.valueOf(); @@ -170,10 +170,10 @@ function _Utils_cmp(x, y, ord) } //*/ - /**_UNUSED/ + /**/ if (typeof x.$ === 'undefined') //*/ - /**/ + /**_UNUSED/ if (x.$[0] === '#') //*/ { @@ -203,17 +203,17 @@ var _Utils_compare = F2(function(x, y) // COMMON VALUES -var _Utils_Tuple0_UNUSED = 0; -var _Utils_Tuple0 = { $: '#0' }; +var _Utils_Tuple0 = 0; +var _Utils_Tuple0_UNUSED = { $: '#0' }; -function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; } -function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; } +function _Utils_Tuple2(a, b) { return { a: a, b: b }; } +function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } -function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; } -function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } +function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } +function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } -function _Utils_chr_UNUSED(c) { return c; } -function _Utils_chr(c) { return new String(c); } +function _Utils_chr(c) { return c; } +function _Utils_chr_UNUSED(c) { return new String(c); } // RECORDS @@ -264,11 +264,11 @@ function _Utils_ap(xs, ys) -var _List_Nil_UNUSED = { $: 0 }; -var _List_Nil = { $: '[]' }; +var _List_Nil = { $: 0 }; +var _List_Nil_UNUSED = { $: '[]' }; -function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; } -function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; } +function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } +function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } var _List_cons = F2(_List_Cons); @@ -499,12 +499,12 @@ var _JsArray_appendN = F3(function(n, dest, source) // LOG -var _Debug_log_UNUSED = F2(function(tag, value) +var _Debug_log = F2(function(tag, value) { return value; }); -var _Debug_log = F2(function(tag, value) +var _Debug_log_UNUSED = F2(function(tag, value) { console.log(tag + ': ' + _Debug_toString(value)); return value; @@ -530,12 +530,12 @@ function _Debug_todoCase(moduleName, region, value) // TO STRING -function _Debug_toString_UNUSED(value) +function _Debug_toString(value) { return ''; } -function _Debug_toString(value) +function _Debug_toString_UNUSED(value) { return _Debug_toAnsiString(false, value); } @@ -720,13 +720,13 @@ function _Debug_toHexDigit(n) // CRASH -function _Debug_crash_UNUSED(identifier) +function _Debug_crash(identifier) { throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md'); } -function _Debug_crash(identifier, fact1, fact2, fact3, fact4) +function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) { switch(identifier) { @@ -784,11 +784,11 @@ function _Debug_crash(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.start.line === region.end.line) + if (region.aj.O === region.aB.O) { - return 'on line ' + region.start.line; + return 'on line ' + region.aj.O; } - return 'on lines ' + region.start.line + ' through ' + region.end.line; + return 'on lines ' + region.aj.O + ' through ' + region.aB.O; } @@ -1212,7 +1212,7 @@ function _Char_toLocaleLower(char) -/**/ +/**_UNUSED/ function _Json_errorToString(error) { return $elm$json$Json$Decode$errorToString(error); @@ -1616,11 +1616,11 @@ var _Json_encode = F2(function(indentLevel, value) return JSON.stringify(_Json_unwrap(value), null, indentLevel) + ''; }); -function _Json_wrap(value) { return { $: 0, a: value }; } -function _Json_unwrap(value) { return value.a; } +function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } +function _Json_unwrap_UNUSED(value) { return value.a; } -function _Json_wrap_UNUSED(value) { return value; } -function _Json_unwrap_UNUSED(value) { return value; } +function _Json_wrap(value) { return value; } +function _Json_unwrap(value) { return value; } function _Json_emptyArray() { return []; } function _Json_emptyObject() { return {}; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.bM, + impl.cb, + impl.b8, function() { return function() {} } ); }); @@ -1872,7 +1872,7 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder) { var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined)); - $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/); + $elm$core$Result$isOk(result) || _Debug_crash(2 /**_UNUSED/, _Json_errorToString(result.a) /**/); var managers = {}; result = init(result.a); var model = result.a; @@ -2316,7 +2316,7 @@ function _Platform_setupIncomingPort(name, sendToApp) // -function _Platform_export_UNUSED(exports) +function _Platform_export(exports) { scope['Elm'] ? _Platform_mergeExportsProd(scope['Elm'], exports) @@ -2337,7 +2337,7 @@ function _Platform_mergeExportsProd(obj, exports) } -function _Platform_export(exports) +function _Platform_export_UNUSED(exports) { scope['Elm'] ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports) @@ -2377,10 +2377,10 @@ var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args { // NOTE: this function needs _Platform_export available to work - /**_UNUSED/ + /**/ var node = args['node']; //*/ - /**/ + /**_UNUSED/ var node = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ @@ -2635,24 +2635,24 @@ function _VirtualDom_noInnerHtmlOrFormAction(key) return key == 'innerHTML' || key == 'formAction' ? 'data-' + key : key; } -function _VirtualDom_noJavaScriptUri_UNUSED(value) +function _VirtualDom_noJavaScriptUri(value) { return /^javascript:/i.test(value.replace(/\s/g,'')) ? '' : value; } -function _VirtualDom_noJavaScriptUri(value) +function _VirtualDom_noJavaScriptUri_UNUSED(value) { return /^javascript:/i.test(value.replace(/\s/g,'')) ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")' : value; } -function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) +function _VirtualDom_noJavaScriptOrHtmlUri(value) { return /^\s*(javascript:|data:text\/html)/i.test(value) ? '' : value; } -function _VirtualDom_noJavaScriptOrHtmlUri(value) +function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) { return /^\s*(javascript:|data:text\/html)/i.test(value) ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")' @@ -2704,9 +2704,9 @@ var _VirtualDom_mapEventTuple = F2(function(func, tuple) var _VirtualDom_mapEventRecord = F2(function(func, record) { return { - message: func(record.message), - stopPropagation: record.stopPropagation, - preventDefault: record.preventDefault + A: func(record.A), + ak: record.ak, + ah: record.ah } }); @@ -2974,11 +2974,11 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) // 3 = Custom var value = result.a; - var message = !tag ? value : tag < 3 ? value.a : value.message; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation; + var message = !tag ? value : tag < 3 ? value.a : value.A; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.ak; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.preventDefault) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.ah) && event.preventDefault(), eventNode ); var tagger; @@ -3928,15 +3928,15 @@ var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debug return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.bM, + impl.cb, + impl.b8, function(sendToApp, initialModel) { - var view = impl.view; - /**_UNUSED/ + var view = impl.cc; + /**/ var domNode = args['node']; //*/ - /**/ + /**_UNUSED/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ var currNode = _VirtualDom_virtualize(domNode); @@ -3964,12 +3964,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.bM, + impl.cb, + impl.b8, function(sendToApp, initialModel) { - var divertHrefToApp = impl.setup && impl.setup(sendToApp) - var view = impl.view; + var divertHrefToApp = impl.ai && impl.ai(sendToApp) + var view = impl.cc; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); @@ -3977,12 +3977,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb { _VirtualDom_divertHrefToApp = divertHrefToApp; var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.body); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.au); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); + (title !== doc.bk) && (_VirtualDom_doc.title = title = doc.bk); }); } ); @@ -4038,12 +4038,12 @@ function _Browser_makeAnimator(model, draw) function _Browser_application(impl) { - var onUrlChange = impl.onUrlChange; - var onUrlRequest = impl.onUrlRequest; + var onUrlChange = impl.bY; + var onUrlRequest = impl.bZ; var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; return _Browser_document({ - setup: function(sendToApp) + ai: function(sendToApp) { key.a = sendToApp; _Browser_window.addEventListener('popstate', key); @@ -4059,9 +4059,9 @@ function _Browser_application(impl) var next = $elm$url$Url$fromString(href).a; sendToApp(onUrlRequest( (next - && curr.protocol === next.protocol - && curr.host === next.host - && curr.port_.a === next.port_.a + && curr.a$ === next.a$ + && curr.aK === next.aK + && curr.aX.a === next.aX.a ) ? $elm$browser$Browser$Internal(next) : $elm$browser$Browser$External(href) @@ -4069,13 +4069,13 @@ function _Browser_application(impl) } }); }, - init: function(flags) + bM: function(flags) { - return A3(impl.init, flags, _Browser_getUrl(), key); + return A3(impl.bM, flags, _Browser_getUrl(), key); }, - view: impl.view, - update: impl.update, - subscriptions: impl.subscriptions + cc: impl.cc, + cb: impl.cb, + b8: impl.b8 }); } @@ -4141,17 +4141,17 @@ var _Browser_decodeEvent = F2(function(decoder, event) function _Browser_visibilityInfo() { return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { hidden: 'hidden', change: 'visibilitychange' } + ? { bJ: 'hidden', bw: 'visibilitychange' } : (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { hidden: 'mozHidden', change: 'mozvisibilitychange' } + ? { bJ: 'mozHidden', bw: 'mozvisibilitychange' } : (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { hidden: 'msHidden', change: 'msvisibilitychange' } + ? { bJ: 'msHidden', bw: 'msvisibilitychange' } : (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' } - : { hidden: 'hidden', change: 'visibilitychange' }; + ? { bJ: 'webkitHidden', bw: 'webkitvisibilitychange' } + : { bJ: 'hidden', bw: 'visibilitychange' }; } @@ -4232,12 +4232,12 @@ var _Browser_call = F2(function(functionName, id) function _Browser_getViewport() { return { - scene: _Browser_getScene(), - viewport: { - x: _Browser_window.pageXOffset, - y: _Browser_window.pageYOffset, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight + a9: _Browser_getScene(), + bn: { + bp: _Browser_window.pageXOffset, + bq: _Browser_window.pageYOffset, + bo: _Browser_doc.documentElement.clientWidth, + aI: _Browser_doc.documentElement.clientHeight } }; } @@ -4247,8 +4247,8 @@ function _Browser_getScene() var body = _Browser_doc.body; var elem = _Browser_doc.documentElement; return { - width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + bo: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + aI: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) }; } @@ -4271,15 +4271,15 @@ function _Browser_getViewportOf(id) return _Browser_withNode(id, function(node) { return { - scene: { - width: node.scrollWidth, - height: node.scrollHeight + a9: { + bo: node.scrollWidth, + aI: node.scrollHeight }, - viewport: { - x: node.scrollLeft, - y: node.scrollTop, - width: node.clientWidth, - height: node.clientHeight + bn: { + bp: node.scrollLeft, + bq: node.scrollTop, + bo: node.clientWidth, + aI: node.clientHeight } }; }); @@ -4309,18 +4309,18 @@ function _Browser_getElement(id) var x = _Browser_window.pageXOffset; var y = _Browser_window.pageYOffset; return { - scene: _Browser_getScene(), - viewport: { - x: x, - y: y, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight + a9: _Browser_getScene(), + bn: { + bp: x, + bq: y, + bo: _Browser_doc.documentElement.clientWidth, + aI: _Browser_doc.documentElement.clientHeight }, - element: { - x: x + rect.left, - y: y + rect.top, - width: rect.width, - height: rect.height + bB: { + bp: x + rect.left, + bq: y + rect.top, + bo: rect.width, + aI: rect.height } }; }); @@ -4382,25 +4382,25 @@ var _Http_toTask = F3(function(router, toTask, request) return _Scheduler_binding(function(callback) { function done(response) { - callback(toTask(request.expect.a(response))); + callback(toTask(request.bE.a(response))); } var xhr = new XMLHttpRequest(); xhr.addEventListener('error', function() { done($elm$http$Http$NetworkError_); }); xhr.addEventListener('timeout', function() { done($elm$http$Http$Timeout_); }); - xhr.addEventListener('load', function() { done(_Http_toResponse(request.expect.b, xhr)); }); - $elm$core$Maybe$isJust(request.tracker) && _Http_track(router, xhr, request.tracker.a); + xhr.addEventListener('load', function() { done(_Http_toResponse(request.bE.b, xhr)); }); + $elm$core$Maybe$isJust(request.ac) && _Http_track(router, xhr, request.ac.a); try { - xhr.open(request.method, request.url, true); + xhr.open(request.Y, request.ao, true); } catch (e) { - return done($elm$http$Http$BadUrl_(request.url)); + return done($elm$http$Http$BadUrl_(request.ao)); } _Http_configureRequest(xhr, request); - request.body.a && xhr.setRequestHeader('Content-Type', request.body.a); - xhr.send(request.body.b); + request.au.a && xhr.setRequestHeader('Content-Type', request.au.a); + xhr.send(request.au.b); return function() { xhr.c = true; xhr.abort(); }; }); @@ -4411,13 +4411,13 @@ var _Http_toTask = F3(function(router, toTask, request) function _Http_configureRequest(xhr, request) { - for (var headers = request.headers; headers.b; headers = headers.b) // WHILE_CONS + for (var headers = request.W; headers.b; headers = headers.b) // WHILE_CONS { xhr.setRequestHeader(headers.a.a, headers.a.b); } - xhr.timeout = request.timeout.a || 0; - xhr.responseType = request.expect.d; - xhr.withCredentials = request.allowCookiesFromOtherDomains; + xhr.timeout = request.ab.a || 0; + xhr.responseType = request.bE.d; + xhr.withCredentials = request.bt; } @@ -4438,10 +4438,10 @@ function _Http_toResponse(toBody, xhr) function _Http_toMetadata(xhr) { return { - url: xhr.responseURL, - statusCode: xhr.status, - statusText: xhr.statusText, - headers: _Http_parseHeaders(xhr.getAllResponseHeaders()) + ao: xhr.responseURL, + b5: xhr.status, + b6: xhr.statusText, + W: _Http_parseHeaders(xhr.getAllResponseHeaders()) }; } @@ -4536,15 +4536,15 @@ function _Http_track(router, xhr, tracker) xhr.upload.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Sending({ - sent: event.loaded, - size: event.total + b3: event.loaded, + bb: event.total })))); }); xhr.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Receiving({ - received: event.loaded, - size: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing + b0: event.loaded, + bb: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing })))); }); } @@ -4677,25 +4677,108 @@ var _Parser_findSubString = F5(function(smallString, offset, row, col, bigString return _Utils_Tuple3(newOffset, row, col); }); + + + +function _Time_now(millisToPosix) +{ + return _Scheduler_binding(function(callback) + { + callback(_Scheduler_succeed(millisToPosix(Date.now()))); + }); +} + +var _Time_setInterval = F2(function(interval, task) +{ + return _Scheduler_binding(function(callback) + { + var id = setInterval(function() { _Scheduler_rawSpawn(task); }, interval); + return function() { clearInterval(id); }; + }); +}); + +function _Time_here() +{ + return _Scheduler_binding(function(callback) + { + callback(_Scheduler_succeed( + A2($elm$time$Time$customZone, -(new Date().getTimezoneOffset()), _List_Nil) + )); + }); +} + + +function _Time_getZoneName() +{ + return _Scheduler_binding(function(callback) + { + try + { + var name = $elm$time$Time$Name(Intl.DateTimeFormat().resolvedOptions().timeZone); + } + catch (e) + { + var name = $elm$time$Time$Offset(new Date().getTimezoneOffset()); + } + callback(_Scheduler_succeed(name)); + }); +} + + + +var _Bitwise_and = F2(function(a, b) +{ + return a & b; +}); + +var _Bitwise_or = F2(function(a, b) +{ + return a | b; +}); + +var _Bitwise_xor = F2(function(a, b) +{ + return a ^ b; +}); + +function _Bitwise_complement(a) +{ + return ~a; +}; + +var _Bitwise_shiftLeftBy = F2(function(offset, a) +{ + return a << offset; +}); + +var _Bitwise_shiftRightBy = F2(function(offset, a) +{ + return a >> offset; +}); + +var _Bitwise_shiftRightZfBy = F2(function(offset, a) +{ + return a >>> offset; +}); var $elm$core$Maybe$Just = function (a) { - return {$: 'Just', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$LinkClicked = function (a) { - return {$: 'LinkClicked', a: a}; + return {$: 1, a: a}; }; -var $elm$core$Maybe$Nothing = {$: 'Nothing'}; +var $elm$core$Maybe$Nothing = {$: 1}; var $author$project$Main$UrlChanged = function (a) { - return {$: 'UrlChanged', a: a}; + return {$: 0, a: a}; }; -var $elm$core$Basics$EQ = {$: 'EQ'}; -var $elm$core$Basics$GT = {$: 'GT'}; -var $elm$core$Basics$LT = {$: 'LT'}; +var $elm$core$Basics$EQ = 1; +var $elm$core$Basics$GT = 2; +var $elm$core$Basics$LT = 0; var $elm$core$List$cons = _List_cons; var $elm$core$Dict$foldr = F3( function (func, acc, t) { foldr: while (true) { - if (t.$ === 'RBEmpty_elm_builtin') { + if (t.$ === -2) { return acc; } else { var key = t.b; @@ -4740,7 +4823,7 @@ var $elm$core$Dict$keys = function (dict) { dict); }; var $elm$core$Set$toList = function (_v0) { - var dict = _v0.a; + var dict = _v0; return $elm$core$Dict$keys(dict); }; var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; @@ -4750,7 +4833,7 @@ var $elm$core$Array$foldr = F3( var tail = _v0.d; var helper = F2( function (node, acc) { - if (node.$ === 'SubTree') { + if (!node.$) { var subTree = node.a; return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); } else { @@ -4768,27 +4851,27 @@ var $elm$core$Array$toList = function (array) { return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); }; var $elm$core$Result$Err = function (a) { - return {$: 'Err', a: a}; + return {$: 1, a: a}; }; var $elm$json$Json$Decode$Failure = F2( function (a, b) { - return {$: 'Failure', a: a, b: b}; + return {$: 3, a: a, b: b}; }); var $elm$json$Json$Decode$Field = F2( function (a, b) { - return {$: 'Field', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $elm$json$Json$Decode$Index = F2( function (a, b) { - return {$: 'Index', a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $elm$core$Result$Ok = function (a) { - return {$: 'Ok', a: a}; + return {$: 0, a: a}; }; var $elm$json$Json$Decode$OneOf = function (a) { - return {$: 'OneOf', a: a}; + return {$: 2, a: a}; }; -var $elm$core$Basics$False = {$: 'False'}; +var $elm$core$Basics$False = 1; var $elm$core$Basics$add = _Basics_add; var $elm$core$String$all = _String_all; var $elm$core$Basics$and = _Basics_and; @@ -4914,12 +4997,12 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( errorToStringHelp: while (true) { switch (error.$) { - case 'Field': + case 0: var f = error.a; var err = error.b; var isSimple = function () { var _v1 = $elm$core$String$uncons(f); - if (_v1.$ === 'Nothing') { + if (_v1.$ === 1) { return false; } else { var _v2 = _v1.a; @@ -4934,7 +5017,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( error = $temp$error; context = $temp$context; continue errorToStringHelp; - case 'Index': + case 1: var i = error.a; var err = error.b; var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); @@ -4943,7 +5026,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( error = $temp$error; context = $temp$context; continue errorToStringHelp; - case 'OneOf': + case 2: var errors = error.a; if (!errors.b) { return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { @@ -5007,7 +5090,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( var $elm$core$Array$branchFactor = 32; var $elm$core$Array$Array_elm_builtin = F4( function (a, b, c, d) { - return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d}; + return {$: 0, a: a, b: b, c: c, d: d}; }); var $elm$core$Elm$JsArray$empty = _JsArray_empty; var $elm$core$Basics$ceiling = _Basics_ceiling; @@ -5022,7 +5105,7 @@ var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( 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); var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; var $elm$core$Array$Leaf = function (a) { - return {$: 'Leaf', a: a}; + return {$: 1, a: a}; }; var $elm$core$Basics$apL = F2( function (f, x) { @@ -5042,7 +5125,7 @@ var $elm$core$Basics$max = F2( }); var $elm$core$Basics$mul = _Basics_mul; var $elm$core$Array$SubTree = function (a) { - return {$: 'SubTree', a: a}; + return {$: 0, a: a}; }; var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; var $elm$core$Array$compressNodes = F2( @@ -5089,25 +5172,25 @@ var $elm$core$Array$treeFromBuilder = F2( }); var $elm$core$Array$builderToArray = F2( function (reverseNodeList, builder) { - if (!builder.nodeListSize) { + if (!builder.f) { return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail), + $elm$core$Elm$JsArray$length(builder.h), $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, - builder.tail); + builder.h); } else { - var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor; + var treeLen = builder.f * $elm$core$Array$branchFactor; var depth = $elm$core$Basics$floor( A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); - var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize); + var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.i) : builder.i; + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.f); return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail) + treeLen, + $elm$core$Elm$JsArray$length(builder.h) + treeLen, A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), tree, - builder.tail); + builder.h); } }); var $elm$core$Basics$idiv = _Basics_idiv; @@ -5120,7 +5203,7 @@ var $elm$core$Array$initializeHelp = F5( return A2( $elm$core$Array$builderToArray, false, - {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail}); + {i: nodeList, f: (len / $elm$core$Array$branchFactor) | 0, h: tail}); } else { var leaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); @@ -5150,9 +5233,9 @@ var $elm$core$Array$initialize = F2( return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); } }); -var $elm$core$Basics$True = {$: 'True'}; +var $elm$core$Basics$True = 0; var $elm$core$Result$isOk = function (result) { - if (result.$ === 'Ok') { + if (!result.$) { return true; } else { return false; @@ -5163,33 +5246,31 @@ var $elm$json$Json$Decode$map2 = _Json_map2; var $elm$json$Json$Decode$succeed = _Json_succeed; var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { switch (handler.$) { - case 'Normal': + case 0: return 0; - case 'MayStopPropagation': + case 1: return 1; - case 'MayPreventDefault': + case 2: return 2; default: return 3; } }; var $elm$browser$Browser$External = function (a) { - return {$: 'External', a: a}; + return {$: 1, a: a}; }; var $elm$browser$Browser$Internal = function (a) { - return {$: 'Internal', a: a}; + return {$: 0, a: a}; }; var $elm$core$Basics$identity = function (x) { return x; }; -var $elm$browser$Browser$Dom$NotFound = function (a) { - return {$: 'NotFound', a: a}; -}; -var $elm$url$Url$Http = {$: 'Http'}; -var $elm$url$Url$Https = {$: 'Https'}; +var $elm$browser$Browser$Dom$NotFound = $elm$core$Basics$identity; +var $elm$url$Url$Http = 0; +var $elm$url$Url$Https = 1; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {fragment: fragment, host: host, path: path, port_: port_, protocol: protocol, query: query}; + return {aF: fragment, aK: host, aV: path, aX: port_, a$: protocol, a0: query}; }); var $elm$core$String$contains = _String_contains; var $elm$core$String$length = _String_length; @@ -5225,7 +5306,7 @@ var $elm$url$Url$chompBeforePath = F5( var i = _v0.a; var _v1 = $elm$core$String$toInt( A2($elm$core$String$dropLeft, i + 1, str)); - if (_v1.$ === 'Nothing') { + if (_v1.$ === 1) { return $elm$core$Maybe$Nothing; } else { var port_ = _v1; @@ -5308,26 +5389,24 @@ var $elm$core$String$startsWith = _String_startsWith; var $elm$url$Url$fromString = function (str) { return A2($elm$core$String$startsWith, 'http://', str) ? A2( $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Http, + 0, A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Https, + 1, A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); }; var $elm$core$Basics$never = function (_v0) { never: while (true) { - var nvr = _v0.a; + var nvr = _v0; var $temp$_v0 = nvr; _v0 = $temp$_v0; continue never; } }; -var $elm$core$Task$Perform = function (a) { - return {$: 'Perform', a: a}; -}; +var $elm$core$Task$Perform = $elm$core$Basics$identity; var $elm$core$Task$succeed = _Scheduler_succeed; -var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0); +var $elm$core$Task$init = $elm$core$Task$succeed(0); var $elm$core$List$foldrHelper = F4( function (fn, acc, ctr, ls) { if (!ls.b) { @@ -5433,7 +5512,7 @@ var $elm$core$Task$sequence = function (tasks) { var $elm$core$Platform$sendToApp = _Platform_sendToApp; var $elm$core$Task$spawnCmd = F2( function (router, _v0) { - var task = _v0.a; + var task = _v0; return _Scheduler_spawn( A2( $elm$core$Task$andThen, @@ -5445,7 +5524,7 @@ var $elm$core$Task$onEffects = F3( return A2( $elm$core$Task$map, function (_v0) { - return _Utils_Tuple0; + return 0; }, $elm$core$Task$sequence( A2( @@ -5455,36 +5534,34 @@ var $elm$core$Task$onEffects = F3( }); var $elm$core$Task$onSelfMsg = F3( function (_v0, _v1, _v2) { - return $elm$core$Task$succeed(_Utils_Tuple0); + return $elm$core$Task$succeed(0); }); var $elm$core$Task$cmdMap = F2( function (tagger, _v0) { - var task = _v0.a; - return $elm$core$Task$Perform( - A2($elm$core$Task$map, tagger, task)); + var task = _v0; + return A2($elm$core$Task$map, tagger, task); }); _Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); var $elm$core$Task$command = _Platform_leaf('Task'); var $elm$core$Task$perform = F2( function (toMessage, task) { return $elm$core$Task$command( - $elm$core$Task$Perform( - A2($elm$core$Task$map, toMessage, task))); + A2($elm$core$Task$map, toMessage, task)); }); var $elm$browser$Browser$application = _Browser_application; var $author$project$Session$Guest = function (a) { - return {$: 'Guest', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$NotFound = function (a) { - return {$: 'NotFound', a: a}; + return {$: 3, a: a}; }; var $author$project$Session$Person = F2( function (email, token) { - return {email: email, token: token}; + return {bC: email, an: token}; }); var $author$project$Session$Session = F2( function (a, b) { - return {$: 'Session', a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $elm$json$Json$Decode$decodeString = _Json_runOnString; var $elm$json$Json$Decode$field = _Json_decodeField; @@ -5499,7 +5576,7 @@ var $author$project$Session$decode = F2( A2($elm$json$Json$Decode$field, 'email', $elm$json$Json$Decode$string), A2($elm$json$Json$Decode$field, 'token', $elm$json$Json$Decode$string)), str); - if (_v0.$ === 'Ok') { + if (!_v0.$) { var p = _v0.a; return A2($author$project$Session$Session, key, p); } else { @@ -5508,7 +5585,7 @@ var $author$project$Session$decode = F2( }); var $elm$url$Url$Parser$State = F5( function (visited, unvisited, params, frag, value) { - return {frag: frag, params: params, unvisited: unvisited, value: value, visited: visited}; + return {D: frag, F: params, C: unvisited, y: value, I: visited}; }); var $elm$url$Url$Parser$getFirstMatch = function (states) { getFirstMatch: @@ -5518,12 +5595,12 @@ var $elm$url$Url$Parser$getFirstMatch = function (states) { } else { var state = states.a; var rest = states.b; - var _v1 = state.unvisited; + var _v1 = state.C; if (!_v1.b) { - return $elm$core$Maybe$Just(state.value); + return $elm$core$Maybe$Just(state.y); } else { if ((_v1.a === '') && (!_v1.b.b)) { - return $elm$core$Maybe$Just(state.value); + return $elm$core$Maybe$Just(state.y); } else { var $temp$states = rest; states = $temp$states; @@ -5561,7 +5638,7 @@ var $elm$url$Url$Parser$preparePath = function (path) { }; var $elm$url$Url$Parser$addToParametersHelp = F2( function (value, maybeList) { - if (maybeList.$ === 'Nothing') { + if (maybeList.$ === 1) { return $elm$core$Maybe$Just( _List_fromArray( [value])); @@ -5577,7 +5654,7 @@ var $elm$core$Dict$get = F2( function (targetKey, dict) { get: while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { + if (dict.$ === -2) { return $elm$core$Maybe$Nothing; } else { var key = dict.b; @@ -5585,14 +5662,14 @@ var $elm$core$Dict$get = F2( var left = dict.d; var right = dict.e; var _v1 = A2($elm$core$Basics$compare, targetKey, key); - switch (_v1.$) { - case 'LT': + switch (_v1) { + case 0: var $temp$targetKey = targetKey, $temp$dict = left; targetKey = $temp$targetKey; dict = $temp$dict; continue get; - case 'EQ': + case 1: return $elm$core$Maybe$Just(value); default: var $temp$targetKey = targetKey, @@ -5604,22 +5681,22 @@ var $elm$core$Dict$get = F2( } } }); -var $elm$core$Dict$Black = {$: 'Black'}; +var $elm$core$Dict$Black = 1; var $elm$core$Dict$RBNode_elm_builtin = F5( function (a, b, c, d, e) { - return {$: 'RBNode_elm_builtin', a: a, b: b, c: c, d: d, e: e}; + return {$: -1, a: a, b: b, c: c, d: d, e: e}; }); -var $elm$core$Dict$RBEmpty_elm_builtin = {$: 'RBEmpty_elm_builtin'}; -var $elm$core$Dict$Red = {$: 'Red'}; +var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; +var $elm$core$Dict$Red = 0; var $elm$core$Dict$balance = F5( function (color, key, value, left, right) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Red')) { + if ((right.$ === -1) && (!right.a)) { var _v1 = right.a; var rK = right.b; var rV = right.c; var rLeft = right.d; var rRight = right.e; - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { + if ((left.$ === -1) && (!left.a)) { var _v3 = left.a; var lK = left.b; var lV = left.c; @@ -5627,22 +5704,22 @@ var $elm$core$Dict$balance = F5( var lRight = left.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, key, value, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, color, rK, rV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, left, rLeft), + A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft), rRight); } } else { - if ((((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) && (left.d.$ === 'RBNode_elm_builtin')) && (left.d.a.$ === 'Red')) { + if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) { var _v5 = left.a; var lK = left.b; var lV = left.c; @@ -5655,11 +5732,11 @@ var $elm$core$Dict$balance = F5( var lRight = left.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, lK, lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, key, value, lRight, right)); + A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right)); } else { return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); } @@ -5667,8 +5744,8 @@ var $elm$core$Dict$balance = F5( }); var $elm$core$Dict$insertHelp = F3( function (key, value, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); + if (dict.$ === -2) { + return A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); } else { var nColor = dict.a; var nKey = dict.b; @@ -5676,8 +5753,8 @@ var $elm$core$Dict$insertHelp = F3( var nLeft = dict.d; var nRight = dict.e; var _v1 = A2($elm$core$Basics$compare, key, nKey); - switch (_v1.$) { - case 'LT': + switch (_v1) { + case 0: return A5( $elm$core$Dict$balance, nColor, @@ -5685,7 +5762,7 @@ var $elm$core$Dict$insertHelp = F3( nValue, A3($elm$core$Dict$insertHelp, key, value, nLeft), nRight); - case 'EQ': + case 1: return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); default: return A5( @@ -5701,13 +5778,13 @@ var $elm$core$Dict$insertHelp = F3( var $elm$core$Dict$insert = F3( function (key, value, dict) { var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { + if ((_v0.$ === -1) && (!_v0.a)) { var _v1 = _v0.a; var k = _v0.b; var v = _v0.c; var l = _v0.d; var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); + return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); } else { var x = _v0; return x; @@ -5716,7 +5793,7 @@ var $elm$core$Dict$insert = F3( var $elm$core$Dict$getMin = function (dict) { getMin: while (true) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { + if ((dict.$ === -1) && (dict.d.$ === -1)) { var left = dict.d; var $temp$dict = left; dict = $temp$dict; @@ -5727,8 +5804,8 @@ var $elm$core$Dict$getMin = function (dict) { } }; var $elm$core$Dict$moveRedLeft = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.e.d.$ === 'RBNode_elm_builtin') && (dict.e.d.a.$ === 'Red')) { + if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { + if ((dict.e.d.$ === -1) && (!dict.e.d.a)) { var clr = dict.a; var k = dict.b; var v = dict.c; @@ -5751,17 +5828,17 @@ var $elm$core$Dict$moveRedLeft = function (dict) { var rRight = _v2.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, rlK, rlV, A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), rlL), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rlR, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rlR, rRight)); } else { var clr = dict.a; var k = dict.b; @@ -5778,22 +5855,22 @@ var $elm$core$Dict$moveRedLeft = function (dict) { var rV = _v5.c; var rLeft = _v5.d; var rRight = _v5.e; - if (clr.$ === 'Black') { + if (clr === 1) { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } } } else { @@ -5801,8 +5878,8 @@ var $elm$core$Dict$moveRedLeft = function (dict) { } }; var $elm$core$Dict$moveRedRight = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.d.d.$ === 'RBNode_elm_builtin') && (dict.d.d.a.$ === 'Red')) { + if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { + if ((dict.d.d.$ === -1) && (!dict.d.d.a)) { var clr = dict.a; var k = dict.b; var v = dict.c; @@ -5825,17 +5902,17 @@ var $elm$core$Dict$moveRedRight = function (dict) { var rRight = _v4.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, lK, lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, lRight, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight))); + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight))); } else { var clr = dict.a; var k = dict.b; @@ -5852,22 +5929,22 @@ var $elm$core$Dict$moveRedRight = function (dict) { var rV = _v6.c; var rLeft = _v6.d; var rRight = _v6.e; - if (clr.$ === 'Black') { + if (clr === 1) { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } } } else { @@ -5876,7 +5953,7 @@ var $elm$core$Dict$moveRedRight = function (dict) { }; var $elm$core$Dict$removeHelpPrepEQGT = F7( function (targetKey, dict, color, key, value, left, right) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { + if ((left.$ === -1) && (!left.a)) { var _v1 = left.a; var lK = left.b; var lV = left.c; @@ -5888,13 +5965,13 @@ var $elm$core$Dict$removeHelpPrepEQGT = F7( lK, lV, lLeft, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, lRight, right)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, lRight, right)); } else { _v2$2: while (true) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Black')) { - if (right.d.$ === 'RBNode_elm_builtin') { - if (right.d.a.$ === 'Black') { + if ((right.$ === -1) && (right.a === 1)) { + if (right.d.$ === -1) { + if (right.d.a === 1) { var _v3 = right.a; var _v4 = right.d; var _v5 = _v4.a; @@ -5915,7 +5992,7 @@ var $elm$core$Dict$removeHelpPrepEQGT = F7( } }); var $elm$core$Dict$removeMin = function (dict) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { + if ((dict.$ === -1) && (dict.d.$ === -1)) { var color = dict.a; var key = dict.b; var value = dict.c; @@ -5923,8 +6000,8 @@ var $elm$core$Dict$removeMin = function (dict) { var lColor = left.a; var lLeft = left.d; var right = dict.e; - if (lColor.$ === 'Black') { - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { + if (lColor === 1) { + if ((lLeft.$ === -1) && (!lLeft.a)) { var _v3 = lLeft.a; return A5( $elm$core$Dict$RBNode_elm_builtin, @@ -5935,7 +6012,7 @@ var $elm$core$Dict$removeMin = function (dict) { right); } else { var _v4 = $elm$core$Dict$moveRedLeft(dict); - if (_v4.$ === 'RBNode_elm_builtin') { + if (_v4.$ === -1) { var nColor = _v4.a; var nKey = _v4.b; var nValue = _v4.c; @@ -5967,7 +6044,7 @@ var $elm$core$Dict$removeMin = function (dict) { }; var $elm$core$Dict$removeHelp = F2( function (targetKey, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { + if (dict.$ === -2) { return $elm$core$Dict$RBEmpty_elm_builtin; } else { var color = dict.a; @@ -5976,10 +6053,10 @@ var $elm$core$Dict$removeHelp = F2( var left = dict.d; var right = dict.e; if (_Utils_cmp(targetKey, key) < 0) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Black')) { + if ((left.$ === -1) && (left.a === 1)) { var _v4 = left.a; var lLeft = left.d; - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { + if ((lLeft.$ === -1) && (!lLeft.a)) { var _v6 = lLeft.a; return A5( $elm$core$Dict$RBNode_elm_builtin, @@ -5990,7 +6067,7 @@ var $elm$core$Dict$removeHelp = F2( right); } else { var _v7 = $elm$core$Dict$moveRedLeft(dict); - if (_v7.$ === 'RBNode_elm_builtin') { + if (_v7.$ === -1) { var nColor = _v7.a; var nKey = _v7.b; var nValue = _v7.c; @@ -6026,7 +6103,7 @@ var $elm$core$Dict$removeHelp = F2( }); var $elm$core$Dict$removeHelpEQGT = F2( function (targetKey, dict) { - if (dict.$ === 'RBNode_elm_builtin') { + if (dict.$ === -1) { var color = dict.a; var key = dict.b; var value = dict.c; @@ -6034,7 +6111,7 @@ var $elm$core$Dict$removeHelpEQGT = F2( var right = dict.e; if (_Utils_eq(targetKey, key)) { var _v1 = $elm$core$Dict$getMin(right); - if (_v1.$ === 'RBNode_elm_builtin') { + if (_v1.$ === -1) { var minKey = _v1.b; var minValue = _v1.c; return A5( @@ -6063,13 +6140,13 @@ var $elm$core$Dict$removeHelpEQGT = F2( var $elm$core$Dict$remove = F2( function (key, dict) { var _v0 = A2($elm$core$Dict$removeHelp, key, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { + if ((_v0.$ === -1) && (!_v0.a)) { var _v1 = _v0.a; var k = _v0.b; var v = _v0.c; var l = _v0.d; var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); + return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); } else { var x = _v0; return x; @@ -6079,7 +6156,7 @@ var $elm$core$Dict$update = F3( function (targetKey, alter, dictionary) { var _v0 = alter( A2($elm$core$Dict$get, targetKey, dictionary)); - if (_v0.$ === 'Just') { + if (!_v0.$) { var value = _v0.a; return A3($elm$core$Dict$insert, targetKey, value, dictionary); } else { @@ -6094,12 +6171,12 @@ var $elm$url$Url$Parser$addParam = F2( var _v1 = _v0.b; var rawValue = _v1.a; var _v2 = $elm$url$Url$percentDecode(rawKey); - if (_v2.$ === 'Nothing') { + if (_v2.$ === 1) { return dict; } else { var key = _v2.a; var _v3 = $elm$url$Url$percentDecode(rawValue); - if (_v3.$ === 'Nothing') { + if (_v3.$ === 1) { return dict; } else { var value = _v3.a; @@ -6116,7 +6193,7 @@ var $elm$url$Url$Parser$addParam = F2( }); var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; var $elm$url$Url$Parser$prepareQuery = function (maybeQuery) { - if (maybeQuery.$ === 'Nothing') { + if (maybeQuery.$ === 1) { return $elm$core$Dict$empty; } else { var qry = maybeQuery.a; @@ -6129,33 +6206,31 @@ var $elm$url$Url$Parser$prepareQuery = function (maybeQuery) { }; var $elm$url$Url$Parser$parse = F2( function (_v0, url) { - var parser = _v0.a; + var parser = _v0; return $elm$url$Url$Parser$getFirstMatch( parser( A5( $elm$url$Url$Parser$State, _List_Nil, - $elm$url$Url$Parser$preparePath(url.path), - $elm$url$Url$Parser$prepareQuery(url.query), - url.fragment, + $elm$url$Url$Parser$preparePath(url.aV), + $elm$url$Url$Parser$prepareQuery(url.a0), + url.aF, $elm$core$Basics$identity))); }); var $author$project$Route$Auth = function (a) { - return {$: 'Auth', a: a}; -}; -var $author$project$Route$Capture = {$: 'Capture'}; -var $author$project$Route$Home = {$: 'Home'}; -var $author$project$Route$Logout = {$: 'Logout'}; -var $elm$url$Url$Parser$Parser = function (a) { - return {$: 'Parser', a: a}; + return {$: 1, a: a}; }; +var $author$project$Route$Capture = {$: 3}; +var $author$project$Route$Home = {$: 0}; +var $author$project$Route$Logout = {$: 2}; +var $elm$url$Url$Parser$Parser = $elm$core$Basics$identity; var $elm$url$Url$Parser$mapState = F2( function (func, _v0) { - var visited = _v0.visited; - var unvisited = _v0.unvisited; - var params = _v0.params; - var frag = _v0.frag; - var value = _v0.value; + var visited = _v0.I; + var unvisited = _v0.C; + var params = _v0.F; + var frag = _v0.D; + var value = _v0.y; return A5( $elm$url$Url$Parser$State, visited, @@ -6166,20 +6241,19 @@ var $elm$url$Url$Parser$mapState = F2( }); var $elm$url$Url$Parser$map = F2( function (subValue, _v0) { - var parseArg = _v0.a; - return $elm$url$Url$Parser$Parser( - function (_v1) { - var visited = _v1.visited; - var unvisited = _v1.unvisited; - var params = _v1.params; - var frag = _v1.frag; - var value = _v1.value; - return A2( - $elm$core$List$map, - $elm$url$Url$Parser$mapState(value), - parseArg( - A5($elm$url$Url$Parser$State, visited, unvisited, params, frag, subValue))); - }); + var parseArg = _v0; + return function (_v1) { + var visited = _v1.I; + var unvisited = _v1.C; + var params = _v1.F; + var frag = _v1.D; + var value = _v1.y; + return A2( + $elm$core$List$map, + $elm$url$Url$Parser$mapState(value), + parseArg( + A5($elm$url$Url$Parser$State, visited, unvisited, params, frag, subValue))); + }; }); var $elm$core$List$append = F2( function (xs, ys) { @@ -6198,50 +6272,47 @@ var $elm$core$List$concatMap = F2( A2($elm$core$List$map, f, list)); }); var $elm$url$Url$Parser$oneOf = function (parsers) { - return $elm$url$Url$Parser$Parser( - function (state) { - return A2( - $elm$core$List$concatMap, - function (_v0) { - var parser = _v0.a; - return parser(state); - }, - parsers); - }); + return function (state) { + return A2( + $elm$core$List$concatMap, + function (_v0) { + var parser = _v0; + return parser(state); + }, + parsers); + }; }; var $elm$url$Url$Parser$query = function (_v0) { - var queryParser = _v0.a; - return $elm$url$Url$Parser$Parser( - function (_v1) { - var visited = _v1.visited; - var unvisited = _v1.unvisited; - var params = _v1.params; - var frag = _v1.frag; - var value = _v1.value; - return _List_fromArray( - [ - A5( - $elm$url$Url$Parser$State, - visited, - unvisited, - params, - frag, - value( - queryParser(params))) - ]); - }); + var queryParser = _v0; + return function (_v1) { + var visited = _v1.I; + var unvisited = _v1.C; + var params = _v1.F; + var frag = _v1.D; + var value = _v1.y; + return _List_fromArray( + [ + A5( + $elm$url$Url$Parser$State, + visited, + unvisited, + params, + frag, + value( + queryParser(params))) + ]); + }; }; var $elm$url$Url$Parser$slash = F2( function (_v0, _v1) { - var parseBefore = _v0.a; - var parseAfter = _v1.a; - return $elm$url$Url$Parser$Parser( - function (state) { - return A2( - $elm$core$List$concatMap, - parseAfter, - parseBefore(state)); - }); + var parseBefore = _v0; + var parseAfter = _v1; + return function (state) { + return A2( + $elm$core$List$concatMap, + parseAfter, + parseBefore(state)); + }; }); var $elm$url$Url$Parser$questionMark = F2( function (parser, queryParser) { @@ -6251,37 +6322,34 @@ var $elm$url$Url$Parser$questionMark = F2( $elm$url$Url$Parser$query(queryParser)); }); var $elm$url$Url$Parser$s = function (str) { - return $elm$url$Url$Parser$Parser( - function (_v0) { - var visited = _v0.visited; - var unvisited = _v0.unvisited; - var params = _v0.params; - var frag = _v0.frag; - var value = _v0.value; - if (!unvisited.b) { - return _List_Nil; - } else { - var next = unvisited.a; - var rest = unvisited.b; - return _Utils_eq(next, str) ? _List_fromArray( - [ - A5( - $elm$url$Url$Parser$State, - A2($elm$core$List$cons, next, visited), - rest, - params, - frag, - value) - ]) : _List_Nil; - } - }); -}; -var $elm$url$Url$Parser$Internal$Parser = function (a) { - return {$: 'Parser', a: a}; + return function (_v0) { + var visited = _v0.I; + var unvisited = _v0.C; + var params = _v0.F; + var frag = _v0.D; + var value = _v0.y; + if (!unvisited.b) { + return _List_Nil; + } else { + var next = unvisited.a; + var rest = unvisited.b; + return _Utils_eq(next, str) ? _List_fromArray( + [ + A5( + $elm$url$Url$Parser$State, + A2($elm$core$List$cons, next, visited), + rest, + params, + frag, + value) + ]) : _List_Nil; + } + }; }; +var $elm$url$Url$Parser$Internal$Parser = $elm$core$Basics$identity; var $elm$core$Maybe$withDefault = F2( function (_default, maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { var value = maybe.a; return value; } else { @@ -6290,14 +6358,13 @@ var $elm$core$Maybe$withDefault = F2( }); var $elm$url$Url$Parser$Query$custom = F2( function (key, func) { - return $elm$url$Url$Parser$Internal$Parser( - function (dict) { - return func( - A2( - $elm$core$Maybe$withDefault, - _List_Nil, - A2($elm$core$Dict$get, key, dict))); - }); + return function (dict) { + return func( + A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2($elm$core$Dict$get, key, dict))); + }; }); var $elm$url$Url$Parser$Query$string = function (key) { return A2( @@ -6312,11 +6379,10 @@ var $elm$url$Url$Parser$Query$string = function (key) { } }); }; -var $elm$url$Url$Parser$top = $elm$url$Url$Parser$Parser( - function (state) { - return _List_fromArray( - [state]); - }); +var $elm$url$Url$Parser$top = function (state) { + return _List_fromArray( + [state]); +}; var $author$project$Route$routeParser = $elm$url$Url$Parser$oneOf( _List_fromArray( [ @@ -6341,43 +6407,41 @@ var $author$project$Route$fromUrl = function (url) { return A2($elm$url$Url$Parser$parse, $author$project$Route$routeParser, url); }; var $author$project$Main$Auth = function (a) { - return {$: 'Auth', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$Capture = function (a) { - return {$: 'Capture', a: a}; + return {$: 5, a: a}; }; var $author$project$Main$GotAuthMsg = function (a) { - return {$: 'GotAuthMsg', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$GotCaptureMsg = function (a) { - return {$: 'GotCaptureMsg', a: a}; + return {$: 5, a: a}; }; var $author$project$Main$GotHomeMsg = function (a) { - return {$: 'GotHomeMsg', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$GotPagesSessionMsg = function (a) { - return {$: 'GotPagesSessionMsg', a: a}; + return {$: 4, a: a}; }; var $author$project$Main$Home = function (a) { - return {$: 'Home', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$Logout = function (a) { - return {$: 'Logout', a: a}; + return {$: 4, a: a}; }; var $author$project$Main$Session = function (a) { - return {$: 'Session', a: a}; + return {$: 2, a: a}; }; var $elm$core$Platform$Cmd$batch = _Platform_batch; var $author$project$Pages$Auth$Model = F2( function (session, urls) { - return {session: session, urls: urls}; + return {R: session, ap: urls}; }); var $author$project$Pages$Auth$GotAuthUrls = function (a) { - return {$: 'GotAuthUrls', a: a}; -}; -var $author$project$Endpoint$Endpoint = function (a) { - return {$: 'Endpoint', a: a}; + return {$: 0, a: a}; }; +var $author$project$Endpoint$Endpoint = $elm$core$Basics$identity; var $elm$url$Url$Builder$toQueryPair = function (_v0) { var key = _v0.a; var value = _v0.b; @@ -6399,8 +6463,7 @@ var $elm$url$Url$Builder$crossOrigin = F3( }); var $author$project$Endpoint$url = F2( function (path, queryParams) { - return $author$project$Endpoint$Endpoint( - A3($elm$url$Url$Builder$crossOrigin, 'http://localhost:4000', path, queryParams)); + return A3($elm$url$Url$Builder$crossOrigin, 'http://localhost:4000', path, queryParams); }); var $author$project$Endpoint$authUrls = A2( $author$project$Endpoint$url, @@ -6410,10 +6473,10 @@ var $author$project$Endpoint$authUrls = A2( var $elm$json$Json$Decode$list = _Json_decodeList; var $author$project$Pages$Auth$Url = F2( function (url, typeUrl) { - return {typeUrl: typeUrl, url: url}; + return {bm: typeUrl, ao: url}; }); -var $author$project$Pages$Auth$Github = {$: 'Github'}; -var $author$project$Pages$Auth$Google = {$: 'Google'}; +var $author$project$Pages$Auth$Github = 1; +var $author$project$Pages$Auth$Google = 0; var $elm$json$Json$Decode$andThen = _Json_andThen; var $elm$json$Json$Decode$fail = _Json_fail; var $author$project$Pages$Auth$urlTypeDecoder = A2( @@ -6421,9 +6484,9 @@ var $author$project$Pages$Auth$urlTypeDecoder = A2( function (str) { switch (str) { case 'google': - return $elm$json$Json$Decode$succeed($author$project$Pages$Auth$Google); + return $elm$json$Json$Decode$succeed(0); case 'github': - return $elm$json$Json$Decode$succeed($author$project$Pages$Auth$Github); + return $elm$json$Json$Decode$succeed(1); default: return $elm$json$Json$Decode$fail('unkown type url'); } @@ -6440,25 +6503,25 @@ var $author$project$Pages$Auth$authUrlsDecoder = A2( $elm$json$Json$Decode$list($author$project$Pages$Auth$urlDecoder)); var $elm$http$Http$BadStatus_ = F2( function (a, b) { - return {$: 'BadStatus_', a: a, b: b}; + return {$: 3, a: a, b: b}; }); var $elm$http$Http$BadUrl_ = function (a) { - return {$: 'BadUrl_', a: a}; + return {$: 0, a: a}; }; var $elm$http$Http$GoodStatus_ = F2( function (a, b) { - return {$: 'GoodStatus_', a: a, b: b}; + return {$: 4, a: a, b: b}; }); -var $elm$http$Http$NetworkError_ = {$: 'NetworkError_'}; +var $elm$http$Http$NetworkError_ = {$: 2}; var $elm$http$Http$Receiving = function (a) { - return {$: 'Receiving', a: a}; + return {$: 1, a: a}; }; var $elm$http$Http$Sending = function (a) { - return {$: 'Sending', a: a}; + return {$: 0, a: a}; }; -var $elm$http$Http$Timeout_ = {$: 'Timeout_'}; +var $elm$http$Http$Timeout_ = {$: 1}; var $elm$core$Maybe$isJust = function (maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { return true; } else { return false; @@ -6480,7 +6543,7 @@ var $elm$http$Http$expectStringResponse = F2( }); var $elm$core$Result$mapError = F2( function (f, result) { - if (result.$ === 'Ok') { + if (!result.$) { var v = result.a; return $elm$core$Result$Ok(v); } else { @@ -6490,31 +6553,31 @@ var $elm$core$Result$mapError = F2( } }); var $elm$http$Http$BadBody = function (a) { - return {$: 'BadBody', a: a}; + return {$: 4, a: a}; }; var $elm$http$Http$BadStatus = function (a) { - return {$: 'BadStatus', a: a}; + return {$: 3, a: a}; }; var $elm$http$Http$BadUrl = function (a) { - return {$: 'BadUrl', a: a}; + return {$: 0, a: a}; }; -var $elm$http$Http$NetworkError = {$: 'NetworkError'}; -var $elm$http$Http$Timeout = {$: 'Timeout'}; +var $elm$http$Http$NetworkError = {$: 2}; +var $elm$http$Http$Timeout = {$: 1}; var $elm$http$Http$resolve = F2( function (toResult, response) { switch (response.$) { - case 'BadUrl_': + case 0: var url = response.a; return $elm$core$Result$Err( $elm$http$Http$BadUrl(url)); - case 'Timeout_': + case 1: return $elm$core$Result$Err($elm$http$Http$Timeout); - case 'NetworkError_': + case 2: return $elm$core$Result$Err($elm$http$Http$NetworkError); - case 'BadStatus_': + case 3: var metadata = response.a; return $elm$core$Result$Err( - $elm$http$Http$BadStatus(metadata.statusCode)); + $elm$http$Http$BadStatus(metadata.b5)); default: var body = response.b; return A2( @@ -6538,11 +6601,11 @@ var $elm$http$Http$expectJson = F2( }); var $elm$http$Http$emptyBody = _Http_emptyBody; var $elm$http$Http$Request = function (a) { - return {$: 'Request', a: a}; + return {$: 1, a: a}; }; var $elm$http$Http$State = F2( function (reqs, subs) { - return {reqs: reqs, subs: subs}; + return {a2: reqs, bh: subs}; }); var $elm$http$Http$init = $elm$core$Task$succeed( A2($elm$http$Http$State, $elm$core$Dict$empty, _List_Nil)); @@ -6557,10 +6620,10 @@ var $elm$http$Http$updateReqs = F3( } else { var cmd = cmds.a; var otherCmds = cmds.b; - if (cmd.$ === 'Cancel') { + if (!cmd.$) { var tracker = cmd.a; var _v2 = A2($elm$core$Dict$get, tracker, reqs); - if (_v2.$ === 'Nothing') { + if (_v2.$ === 1) { var $temp$router = router, $temp$cmds = otherCmds, $temp$reqs = reqs; @@ -6586,8 +6649,8 @@ var $elm$http$Http$updateReqs = F3( return A2( $elm$core$Task$andThen, function (pid) { - var _v4 = req.tracker; - if (_v4.$ === 'Nothing') { + var _v4 = req.ac; + if (_v4.$ === 1) { return A3($elm$http$Http$updateReqs, router, otherCmds, reqs); } else { var tracker = _v4.a; @@ -6616,12 +6679,12 @@ var $elm$http$Http$onEffects = F4( return $elm$core$Task$succeed( A2($elm$http$Http$State, reqs, subs)); }, - A3($elm$http$Http$updateReqs, router, cmds, state.reqs)); + A3($elm$http$Http$updateReqs, router, cmds, state.a2)); }); var $elm$core$List$maybeCons = F3( function (f, mx, xs) { var _v0 = f(mx); - if (_v0.$ === 'Just') { + if (!_v0.$) { var x = _v0.a; return A2($elm$core$List$cons, x, xs); } else { @@ -6659,34 +6722,34 @@ var $elm$http$Http$onSelfMsg = F3( A2( $elm$core$List$filterMap, A3($elm$http$Http$maybeSend, router, tracker, progress), - state.subs))); + state.bh))); }); var $elm$http$Http$Cancel = function (a) { - return {$: 'Cancel', a: a}; + return {$: 0, a: a}; }; var $elm$http$Http$cmdMap = F2( function (func, cmd) { - if (cmd.$ === 'Cancel') { + if (!cmd.$) { var tracker = cmd.a; return $elm$http$Http$Cancel(tracker); } else { var r = cmd.a; return $elm$http$Http$Request( { - allowCookiesFromOtherDomains: r.allowCookiesFromOtherDomains, - body: r.body, - expect: A2(_Http_mapExpect, func, r.expect), - headers: r.headers, - method: r.method, - timeout: r.timeout, - tracker: r.tracker, - url: r.url + bt: r.bt, + au: r.au, + bE: A2(_Http_mapExpect, func, r.bE), + W: r.W, + Y: r.Y, + ab: r.ab, + ac: r.ac, + ao: r.ao }); } }); var $elm$http$Http$MySub = F2( function (a, b) { - return {$: 'MySub', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $elm$http$Http$subMap = F2( function (func, _v0) { @@ -6703,32 +6766,31 @@ var $elm$http$Http$subscription = _Platform_leaf('Http'); var $elm$http$Http$request = function (r) { return $elm$http$Http$command( $elm$http$Http$Request( - {allowCookiesFromOtherDomains: false, body: r.body, expect: r.expect, headers: r.headers, method: r.method, timeout: r.timeout, tracker: r.tracker, url: r.url})); + {bt: false, au: r.au, bE: r.bE, W: r.W, Y: r.Y, ab: r.ab, ac: r.ac, ao: r.ao})); }; var $elm$http$Http$get = function (r) { return $elm$http$Http$request( - {body: $elm$http$Http$emptyBody, expect: r.expect, headers: _List_Nil, method: 'GET', timeout: $elm$core$Maybe$Nothing, tracker: $elm$core$Maybe$Nothing, url: r.url}); + {au: $elm$http$Http$emptyBody, bE: r.bE, W: _List_Nil, Y: 'GET', ab: $elm$core$Maybe$Nothing, ac: $elm$core$Maybe$Nothing, ao: r.ao}); }; var $author$project$Endpoint$toString = function (_v0) { - var urlEndpoint = _v0.a; + var urlEndpoint = _v0; return urlEndpoint; }; var $author$project$Pages$Auth$getAuthUrls = $elm$http$Http$get( { - expect: A2($elm$http$Http$expectJson, $author$project$Pages$Auth$GotAuthUrls, $author$project$Pages$Auth$authUrlsDecoder), - url: $author$project$Endpoint$toString($author$project$Endpoint$authUrls) + bE: A2($elm$http$Http$expectJson, $author$project$Pages$Auth$GotAuthUrls, $author$project$Pages$Auth$authUrlsDecoder), + ao: $author$project$Endpoint$toString($author$project$Endpoint$authUrls) }); var $author$project$Pages$Auth$init = function (session) { return _Utils_Tuple2( A2($author$project$Pages$Auth$Model, session, _List_Nil), $author$project$Pages$Auth$getAuthUrls); }; -var $author$project$Pages$Capture$Model = F4( - function (session, captures, newCapture, error) { - return {captures: captures, error: error, newCapture: newCapture, session: session}; - }); +var $author$project$Pages$Capture$AdjustTimeZone = function (a) { + return {$: 9, a: a}; +}; var $author$project$Pages$Capture$GotCaptures = function (a) { - return {$: 'GotCaptures', a: a}; + return {$: 1, a: a}; }; var $author$project$Endpoint$captures = A2( $author$project$Endpoint$url, @@ -6737,13 +6799,13 @@ var $author$project$Endpoint$captures = A2( _List_Nil); var $author$project$Capture$Capture = F4( function (idCapture, text, timers, status) { - return {idCapture: idCapture, status: status, text: text, timers: timers}; + return {aL: idCapture, be: status, am: text, bj: timers}; }); var $elm$json$Json$Decode$bool = _Json_decodeBool; -var $author$project$Capture$Completed = {$: 'Completed'}; +var $author$project$Capture$Completed = {$: 1}; var $author$project$Capture$completedToStatusDecoder = $elm$json$Json$Decode$succeed($author$project$Capture$Completed); -var $author$project$Capture$InProgress = {$: 'InProgress'}; -var $author$project$Capture$ToDo = {$: 'ToDo'}; +var $author$project$Capture$InProgress = {$: 2}; +var $author$project$Capture$ToDo = {$: 0}; var $elm$core$List$head = function (list) { if (list.b) { var x = list.a; @@ -6755,80 +6817,76 @@ var $elm$core$List$head = function (list) { }; var $author$project$Timer$Timer = F4( function (idTimer, idCapture, startedAt, stoppedAt) { - return {idCapture: idCapture, idTimer: idTimer, startedAt: startedAt, stoppedAt: stoppedAt}; + return {aL: idCapture, bK: idTimer, b4: startedAt, b7: stoppedAt}; }); var $elm$parser$Parser$deadEndsToString = function (deadEnds) { return 'TODO deadEndsToString'; }; var $elm$parser$Parser$Advanced$Bad = F2( function (a, b) { - return {$: 'Bad', a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $elm$parser$Parser$Advanced$Good = F3( function (a, b, c) { - return {$: 'Good', a: a, b: b, c: c}; + return {$: 0, a: a, b: b, c: c}; }); -var $elm$parser$Parser$Advanced$Parser = function (a) { - return {$: 'Parser', a: a}; -}; +var $elm$parser$Parser$Advanced$Parser = $elm$core$Basics$identity; var $elm$parser$Parser$Advanced$andThen = F2( function (callback, _v0) { - var parseA = _v0.a; - return $elm$parser$Parser$Advanced$Parser( - function (s0) { - var _v1 = parseA(s0); - if (_v1.$ === 'Bad') { - var p = _v1.a; - var x = _v1.b; - return A2($elm$parser$Parser$Advanced$Bad, p, x); + var parseA = _v0; + return function (s0) { + var _v1 = parseA(s0); + if (_v1.$ === 1) { + var p = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } else { + var p1 = _v1.a; + var a = _v1.b; + var s1 = _v1.c; + var _v2 = callback(a); + var parseB = _v2; + var _v3 = parseB(s1); + if (_v3.$ === 1) { + var p2 = _v3.a; + var x = _v3.b; + return A2($elm$parser$Parser$Advanced$Bad, p1 || p2, x); } else { - var p1 = _v1.a; - var a = _v1.b; - var s1 = _v1.c; - var _v2 = callback(a); - var parseB = _v2.a; - var _v3 = parseB(s1); - if (_v3.$ === 'Bad') { - var p2 = _v3.a; - var x = _v3.b; - return A2($elm$parser$Parser$Advanced$Bad, p1 || p2, x); - } else { - var p2 = _v3.a; - var b = _v3.b; - var s2 = _v3.c; - return A3($elm$parser$Parser$Advanced$Good, p1 || p2, b, s2); - } + var p2 = _v3.a; + var b = _v3.b; + var s2 = _v3.c; + return A3($elm$parser$Parser$Advanced$Good, p1 || p2, b, s2); } - }); + } + }; }); var $elm$parser$Parser$andThen = $elm$parser$Parser$Advanced$andThen; -var $elm$parser$Parser$ExpectingEnd = {$: 'ExpectingEnd'}; +var $elm$parser$Parser$ExpectingEnd = {$: 10}; var $elm$parser$Parser$Advanced$AddRight = F2( function (a, b) { - return {$: 'AddRight', a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $elm$parser$Parser$Advanced$DeadEnd = F4( function (row, col, problem, contextStack) { - return {col: col, contextStack: contextStack, problem: problem, row: row}; + return {ax: col, by: contextStack, aY: problem, a6: row}; }); -var $elm$parser$Parser$Advanced$Empty = {$: 'Empty'}; +var $elm$parser$Parser$Advanced$Empty = {$: 0}; var $elm$parser$Parser$Advanced$fromState = F2( function (s, x) { return A2( $elm$parser$Parser$Advanced$AddRight, $elm$parser$Parser$Advanced$Empty, - A4($elm$parser$Parser$Advanced$DeadEnd, s.row, s.col, x, s.context)); + A4($elm$parser$Parser$Advanced$DeadEnd, s.a6, s.ax, x, s.c)); }); var $elm$parser$Parser$Advanced$end = function (x) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - return _Utils_eq( - $elm$core$String$length(s.src), - s.offset) ? A3($elm$parser$Parser$Advanced$Good, false, _Utils_Tuple0, s) : A2( - $elm$parser$Parser$Advanced$Bad, - false, - A2($elm$parser$Parser$Advanced$fromState, s, x)); - }); + return function (s) { + return _Utils_eq( + $elm$core$String$length(s.a), + s.b) ? A3($elm$parser$Parser$Advanced$Good, false, 0, s) : A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, x)); + }; }; var $elm$parser$Parser$end = $elm$parser$Parser$Advanced$end($elm$parser$Parser$ExpectingEnd); var $elm$parser$Parser$Advanced$isSubChar = _Parser_isSubChar; @@ -6839,13 +6897,13 @@ var $elm$parser$Parser$Advanced$chompWhileHelp = F5( function (isGood, offset, row, col, s0) { chompWhileHelp: while (true) { - var newOffset = A3($elm$parser$Parser$Advanced$isSubChar, isGood, offset, s0.src); + var newOffset = A3($elm$parser$Parser$Advanced$isSubChar, isGood, offset, s0.a); if (_Utils_eq(newOffset, -1)) { return A3( $elm$parser$Parser$Advanced$Good, - _Utils_cmp(s0.offset, offset) < 0, - _Utils_Tuple0, - {col: col, context: s0.context, indent: s0.indent, offset: offset, row: row, src: s0.src}); + _Utils_cmp(s0.b, offset) < 0, + 0, + {ax: col, c: s0.c, d: s0.d, b: offset, a6: row, a: s0.a}); } else { if (_Utils_eq(newOffset, -2)) { var $temp$isGood = isGood, @@ -6876,10 +6934,9 @@ var $elm$parser$Parser$Advanced$chompWhileHelp = F5( } }); var $elm$parser$Parser$Advanced$chompWhile = function (isGood) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - return A5($elm$parser$Parser$Advanced$chompWhileHelp, isGood, s.offset, s.row, s.col, s); - }); + return function (s) { + return A5($elm$parser$Parser$Advanced$chompWhileHelp, isGood, s.b, s.a6, s.ax, s); + }; }; var $elm$parser$Parser$chompWhile = $elm$parser$Parser$Advanced$chompWhile; var $elm$core$Basics$always = F2( @@ -6888,44 +6945,42 @@ var $elm$core$Basics$always = F2( }); var $elm$parser$Parser$Advanced$mapChompedString = F2( function (func, _v0) { - var parse = _v0.a; - return $elm$parser$Parser$Advanced$Parser( - function (s0) { - var _v1 = parse(s0); - if (_v1.$ === 'Bad') { - var p = _v1.a; - var x = _v1.b; - return A2($elm$parser$Parser$Advanced$Bad, p, x); - } else { - var p = _v1.a; - var a = _v1.b; - var s1 = _v1.c; - return A3( - $elm$parser$Parser$Advanced$Good, - p, - A2( - func, - A3($elm$core$String$slice, s0.offset, s1.offset, s0.src), - a), - s1); - } - }); + var parse = _v0; + return function (s0) { + var _v1 = parse(s0); + if (_v1.$ === 1) { + var p = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } else { + var p = _v1.a; + var a = _v1.b; + var s1 = _v1.c; + return A3( + $elm$parser$Parser$Advanced$Good, + p, + A2( + func, + A3($elm$core$String$slice, s0.b, s1.b, s0.a), + a), + s1); + } + }; }); var $elm$parser$Parser$Advanced$getChompedString = function (parser) { return A2($elm$parser$Parser$Advanced$mapChompedString, $elm$core$Basics$always, parser); }; var $elm$parser$Parser$getChompedString = $elm$parser$Parser$Advanced$getChompedString; var $elm$parser$Parser$Problem = function (a) { - return {$: 'Problem', a: a}; + return {$: 12, a: a}; }; var $elm$parser$Parser$Advanced$problem = function (x) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - return A2( - $elm$parser$Parser$Advanced$Bad, - false, - A2($elm$parser$Parser$Advanced$fromState, s, x)); - }); + return function (s) { + return A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, x)); + }; }; var $elm$parser$Parser$problem = function (msg) { return $elm$parser$Parser$Advanced$problem( @@ -6933,10 +6988,9 @@ var $elm$parser$Parser$problem = function (msg) { }; var $elm$core$Basics$round = _Basics_round; var $elm$parser$Parser$Advanced$succeed = function (a) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - return A3($elm$parser$Parser$Advanced$Good, false, a, s); - }); + return function (s) { + return A3($elm$parser$Parser$Advanced$Good, false, a, s); + }; }; var $elm$parser$Parser$succeed = $elm$parser$Parser$Advanced$succeed; var $elm$core$String$toFloat = _String_toFloat; @@ -6945,7 +6999,7 @@ var $rtfeldman$elm_iso8601_date_strings$Iso8601$fractionsOfASecondInMs = A2( function (str) { if ($elm$core$String$length(str) <= 9) { var _v0 = $elm$core$String$toFloat('0.' + str); - if (_v0.$ === 'Just') { + if (!_v0.$) { var floatVal = _v0.a; return $elm$parser$Parser$succeed( $elm$core$Basics$round(floatVal * 1000)); @@ -6960,46 +7014,43 @@ var $rtfeldman$elm_iso8601_date_strings$Iso8601$fractionsOfASecondInMs = A2( }, $elm$parser$Parser$getChompedString( $elm$parser$Parser$chompWhile($elm$core$Char$isDigit))); -var $elm$time$Time$Posix = function (a) { - return {$: 'Posix', a: a}; -}; -var $elm$time$Time$millisToPosix = $elm$time$Time$Posix; +var $elm$time$Time$Posix = $elm$core$Basics$identity; +var $elm$time$Time$millisToPosix = $elm$core$Basics$identity; var $rtfeldman$elm_iso8601_date_strings$Iso8601$fromParts = F6( function (monthYearDayMs, hour, minute, second, ms, utcOffsetMinutes) { return $elm$time$Time$millisToPosix((((monthYearDayMs + (((hour * 60) * 60) * 1000)) + (((minute - utcOffsetMinutes) * 60) * 1000)) + (second * 1000)) + ms); }); var $elm$parser$Parser$Advanced$map2 = F3( function (func, _v0, _v1) { - var parseA = _v0.a; - var parseB = _v1.a; - return $elm$parser$Parser$Advanced$Parser( - function (s0) { - var _v2 = parseA(s0); - if (_v2.$ === 'Bad') { - var p = _v2.a; - var x = _v2.b; - return A2($elm$parser$Parser$Advanced$Bad, p, x); + var parseA = _v0; + var parseB = _v1; + return function (s0) { + var _v2 = parseA(s0); + if (_v2.$ === 1) { + var p = _v2.a; + var x = _v2.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } else { + var p1 = _v2.a; + var a = _v2.b; + var s1 = _v2.c; + var _v3 = parseB(s1); + if (_v3.$ === 1) { + var p2 = _v3.a; + var x = _v3.b; + return A2($elm$parser$Parser$Advanced$Bad, p1 || p2, x); } else { - var p1 = _v2.a; - var a = _v2.b; - var s1 = _v2.c; - var _v3 = parseB(s1); - if (_v3.$ === 'Bad') { - var p2 = _v3.a; - var x = _v3.b; - return A2($elm$parser$Parser$Advanced$Bad, p1 || p2, x); - } else { - var p2 = _v3.a; - var b = _v3.b; - var s2 = _v3.c; - return A3( - $elm$parser$Parser$Advanced$Good, - p1 || p2, - A2(func, a, b), - s2); - } + var p2 = _v3.a; + var b = _v3.b; + var s2 = _v3.c; + return A3( + $elm$parser$Parser$Advanced$Good, + p1 || p2, + A2(func, a, b), + s2); } - }); + } + }; }); var $elm$parser$Parser$Advanced$ignorer = F2( function (keepParser, ignoreParser) { @@ -7013,7 +7064,7 @@ var $elm$parser$Parser$Advanced$keeper = F2( var $elm$parser$Parser$keeper = $elm$parser$Parser$Advanced$keeper; var $elm$parser$Parser$Advanced$Append = F2( function (a, b) { - return {$: 'Append', a: a, b: b}; + return {$: 2, a: a, b: b}; }); var $elm$parser$Parser$Advanced$oneOfHelp = F3( function (s0, bag, parsers) { @@ -7022,10 +7073,10 @@ var $elm$parser$Parser$Advanced$oneOfHelp = F3( if (!parsers.b) { return A2($elm$parser$Parser$Advanced$Bad, false, bag); } else { - var parse = parsers.a.a; + var parse = parsers.a; var remainingParsers = parsers.b; var _v1 = parse(s0); - if (_v1.$ === 'Good') { + if (!_v1.$) { var step = _v1; return step; } else { @@ -7048,38 +7099,36 @@ var $elm$parser$Parser$Advanced$oneOfHelp = F3( } }); var $elm$parser$Parser$Advanced$oneOf = function (parsers) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - return A3($elm$parser$Parser$Advanced$oneOfHelp, s, $elm$parser$Parser$Advanced$Empty, parsers); - }); + return function (s) { + return A3($elm$parser$Parser$Advanced$oneOfHelp, s, $elm$parser$Parser$Advanced$Empty, parsers); + }; }; var $elm$parser$Parser$oneOf = $elm$parser$Parser$Advanced$oneOf; var $elm$parser$Parser$Done = function (a) { - return {$: 'Done', a: a}; + return {$: 1, a: a}; }; var $elm$parser$Parser$Loop = function (a) { - return {$: 'Loop', a: a}; + return {$: 0, a: a}; }; var $elm$core$String$append = _String_append; -var $elm$parser$Parser$UnexpectedChar = {$: 'UnexpectedChar'}; +var $elm$parser$Parser$UnexpectedChar = {$: 11}; var $elm$parser$Parser$Advanced$chompIf = F2( function (isGood, expecting) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - var newOffset = A3($elm$parser$Parser$Advanced$isSubChar, isGood, s.offset, s.src); - return _Utils_eq(newOffset, -1) ? A2( - $elm$parser$Parser$Advanced$Bad, - false, - A2($elm$parser$Parser$Advanced$fromState, s, expecting)) : (_Utils_eq(newOffset, -2) ? A3( - $elm$parser$Parser$Advanced$Good, - true, - _Utils_Tuple0, - {col: 1, context: s.context, indent: s.indent, offset: s.offset + 1, row: s.row + 1, src: s.src}) : A3( - $elm$parser$Parser$Advanced$Good, - true, - _Utils_Tuple0, - {col: s.col + 1, context: s.context, indent: s.indent, offset: newOffset, row: s.row, src: s.src})); - }); + return function (s) { + var newOffset = A3($elm$parser$Parser$Advanced$isSubChar, isGood, s.b, s.a); + return _Utils_eq(newOffset, -1) ? A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, expecting)) : (_Utils_eq(newOffset, -2) ? A3( + $elm$parser$Parser$Advanced$Good, + true, + 0, + {ax: 1, c: s.c, d: s.d, b: s.b + 1, a6: s.a6 + 1, a: s.a}) : A3( + $elm$parser$Parser$Advanced$Good, + true, + 0, + {ax: s.ax + 1, c: s.c, d: s.d, b: newOffset, a6: s.a6, a: s.a})); + }; }); var $elm$parser$Parser$chompIf = function (isGood) { return A2($elm$parser$Parser$Advanced$chompIf, isGood, $elm$parser$Parser$UnexpectedChar); @@ -7089,13 +7138,13 @@ var $elm$parser$Parser$Advanced$loopHelp = F4( loopHelp: while (true) { var _v0 = callback(state); - var parse = _v0.a; + var parse = _v0; var _v1 = parse(s0); - if (_v1.$ === 'Good') { + if (!_v1.$) { var p1 = _v1.a; var step = _v1.b; var s1 = _v1.c; - if (step.$ === 'Loop') { + if (!step.$) { var newState = step.a; var $temp$p = p || p1, $temp$state = newState, @@ -7119,42 +7168,40 @@ var $elm$parser$Parser$Advanced$loopHelp = F4( }); var $elm$parser$Parser$Advanced$loop = F2( function (state, callback) { - return $elm$parser$Parser$Advanced$Parser( - function (s) { - return A4($elm$parser$Parser$Advanced$loopHelp, false, state, callback, s); - }); + return function (s) { + return A4($elm$parser$Parser$Advanced$loopHelp, false, state, callback, s); + }; }); var $elm$parser$Parser$Advanced$map = F2( function (func, _v0) { - var parse = _v0.a; - return $elm$parser$Parser$Advanced$Parser( - function (s0) { - var _v1 = parse(s0); - if (_v1.$ === 'Good') { - var p = _v1.a; - var a = _v1.b; - var s1 = _v1.c; - return A3( - $elm$parser$Parser$Advanced$Good, - p, - func(a), - s1); - } else { - var p = _v1.a; - var x = _v1.b; - return A2($elm$parser$Parser$Advanced$Bad, p, x); - } - }); + var parse = _v0; + return function (s0) { + var _v1 = parse(s0); + if (!_v1.$) { + var p = _v1.a; + var a = _v1.b; + var s1 = _v1.c; + return A3( + $elm$parser$Parser$Advanced$Good, + p, + func(a), + s1); + } else { + var p = _v1.a; + var x = _v1.b; + return A2($elm$parser$Parser$Advanced$Bad, p, x); + } + }; }); var $elm$parser$Parser$map = $elm$parser$Parser$Advanced$map; var $elm$parser$Parser$Advanced$Done = function (a) { - return {$: 'Done', a: a}; + return {$: 1, a: a}; }; var $elm$parser$Parser$Advanced$Loop = function (a) { - return {$: 'Loop', a: a}; + return {$: 0, a: a}; }; var $elm$parser$Parser$toAdvancedStep = function (step) { - if (step.$ === 'Loop') { + if (!step.$) { var s = step.a; return $elm$parser$Parser$Advanced$Loop(s); } else { @@ -7180,7 +7227,7 @@ var $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt = function (quantity) $elm$core$String$length(str), quantity)) { var _v0 = $elm$core$String$toInt(str); - if (_v0.$ === 'Just') { + if (!_v0.$) { var intVal = _v0.a; return A2( $elm$parser$Parser$map, @@ -7203,11 +7250,11 @@ var $rtfeldman$elm_iso8601_date_strings$Iso8601$paddedInt = function (quantity) return A2($elm$parser$Parser$loop, '', helper); }; var $elm$parser$Parser$ExpectingSymbol = function (a) { - return {$: 'ExpectingSymbol', a: a}; + return {$: 8, a: a}; }; var $elm$parser$Parser$Advanced$Token = F2( function (a, b) { - return {$: 'Token', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $elm$parser$Parser$Advanced$isSubString = _Parser_isSubString; var $elm$core$Basics$not = _Basics_not; @@ -7215,21 +7262,20 @@ var $elm$parser$Parser$Advanced$token = function (_v0) { var str = _v0.a; var expecting = _v0.b; var progress = !$elm$core$String$isEmpty(str); - return $elm$parser$Parser$Advanced$Parser( - function (s) { - var _v1 = A5($elm$parser$Parser$Advanced$isSubString, str, s.offset, s.row, s.col, s.src); - var newOffset = _v1.a; - var newRow = _v1.b; - var newCol = _v1.c; - return _Utils_eq(newOffset, -1) ? A2( - $elm$parser$Parser$Advanced$Bad, - false, - A2($elm$parser$Parser$Advanced$fromState, s, expecting)) : A3( - $elm$parser$Parser$Advanced$Good, - progress, - _Utils_Tuple0, - {col: newCol, context: s.context, indent: s.indent, offset: newOffset, row: newRow, src: s.src}); - }); + return function (s) { + var _v1 = A5($elm$parser$Parser$Advanced$isSubString, str, s.b, s.a6, s.ax, s.a); + var newOffset = _v1.a; + var newRow = _v1.b; + var newCol = _v1.c; + return _Utils_eq(newOffset, -1) ? A2( + $elm$parser$Parser$Advanced$Bad, + false, + A2($elm$parser$Parser$Advanced$fromState, s, expecting)) : A3( + $elm$parser$Parser$Advanced$Good, + progress, + 0, + {ax: newCol, c: s.c, d: s.d, b: newOffset, a6: newRow, a: s.a}); + }; }; var $elm$parser$Parser$Advanced$symbol = $elm$parser$Parser$Advanced$token; var $elm$parser$Parser$symbol = function (str) { @@ -7467,19 +7513,19 @@ var $rtfeldman$elm_iso8601_date_strings$Iso8601$iso8601 = A2( $rtfeldman$elm_iso8601_date_strings$Iso8601$monthYearDayInMs); var $elm$parser$Parser$DeadEnd = F3( function (row, col, problem) { - return {col: col, problem: problem, row: row}; + return {ax: col, aY: problem, a6: row}; }); var $elm$parser$Parser$problemToDeadEnd = function (p) { - return A3($elm$parser$Parser$DeadEnd, p.row, p.col, p.problem); + return A3($elm$parser$Parser$DeadEnd, p.a6, p.ax, p.aY); }; var $elm$parser$Parser$Advanced$bagToList = F2( function (bag, list) { bagToList: while (true) { switch (bag.$) { - case 'Empty': + case 0: return list; - case 'AddRight': + case 1: var bag1 = bag.a; var x = bag.b; var $temp$bag = bag1, @@ -7500,10 +7546,10 @@ var $elm$parser$Parser$Advanced$bagToList = F2( }); var $elm$parser$Parser$Advanced$run = F2( function (_v0, src) { - var parse = _v0.a; + var parse = _v0; var _v1 = parse( - {col: 1, context: _List_Nil, indent: 1, offset: 0, row: 1, src: src}); - if (_v1.$ === 'Good') { + {ax: 1, c: _List_Nil, d: 1, b: 0, a6: 1, a: src}); + if (!_v1.$) { var value = _v1.b; return $elm$core$Result$Ok(value); } else { @@ -7515,7 +7561,7 @@ var $elm$parser$Parser$Advanced$run = F2( var $elm$parser$Parser$run = F2( function (parser, source) { var _v0 = A2($elm$parser$Parser$Advanced$run, parser, source); - if (_v0.$ === 'Ok') { + if (!_v0.$) { var a = _v0.a; return $elm$core$Result$Ok(a); } else { @@ -7531,7 +7577,7 @@ var $rtfeldman$elm_iso8601_date_strings$Iso8601$decoder = A2( $elm$json$Json$Decode$andThen, function (str) { var _v0 = $rtfeldman$elm_iso8601_date_strings$Iso8601$toTime(str); - if (_v0.$ === 'Err') { + if (_v0.$ === 1) { var deadEnds = _v0.a; return $elm$json$Json$Decode$fail( $elm$parser$Parser$deadEndsToString(deadEnds)); @@ -7564,12 +7610,12 @@ var $author$project$Capture$timersToStatusDecoder = A2( $elm$json$Json$Decode$andThen, function (timers) { var _v0 = $elm$core$List$head(timers); - if (_v0.$ === 'Nothing') { + if (_v0.$ === 1) { return $elm$json$Json$Decode$succeed($author$project$Capture$ToDo); } else { var timer = _v0.a; - var _v1 = timer.stoppedAt; - if (_v1.$ === 'Nothing') { + var _v1 = timer.b7; + if (_v1.$ === 1) { return $elm$json$Json$Decode$succeed($author$project$Capture$InProgress); } else { return $elm$json$Json$Decode$succeed($author$project$Capture$ToDo); @@ -7602,38 +7648,68 @@ var $author$project$Capture$capturesDecoder = A2( $elm$json$Json$Decode$list($author$project$Capture$captureDecoder)); var $elm$http$Http$Header = F2( function (a, b) { - return {$: 'Header', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $elm$http$Http$header = $elm$http$Http$Header; var $author$project$Pages$Capture$getCaptures = function (token) { return $elm$http$Http$request( { - body: $elm$http$Http$emptyBody, - expect: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$GotCaptures, $author$project$Capture$capturesDecoder), - headers: _List_fromArray( + au: $elm$http$Http$emptyBody, + bE: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$GotCaptures, $author$project$Capture$capturesDecoder), + W: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - method: 'GET', - timeout: $elm$core$Maybe$Nothing, - tracker: $elm$core$Maybe$Nothing, - url: $author$project$Endpoint$toString($author$project$Endpoint$captures) + Y: 'GET', + ab: $elm$core$Maybe$Nothing, + ac: $elm$core$Maybe$Nothing, + ao: $author$project$Endpoint$toString($author$project$Endpoint$captures) }); }; -var $author$project$Capture$initCapture = {idCapture: 0, status: $author$project$Capture$ToDo, text: '', timers: _List_Nil}; +var $elm$time$Time$Name = function (a) { + return {$: 0, a: a}; +}; +var $elm$time$Time$Offset = function (a) { + return {$: 1, a: a}; +}; +var $elm$time$Time$Zone = F2( + function (a, b) { + return {$: 0, a: a, b: b}; + }); +var $elm$time$Time$customZone = $elm$time$Time$Zone; +var $elm$time$Time$here = _Time_here(0); +var $author$project$Capture$initCapture = {aL: 0, be: $author$project$Capture$ToDo, am: '', bj: _List_Nil}; +var $elm$time$Time$utc = A2($elm$time$Time$Zone, 0, _List_Nil); +var $author$project$Pages$Capture$initModel = function (session) { + return { + J: _List_Nil, + k: '', + E: $author$project$Capture$initCapture, + R: session, + H: { + _: $elm$time$Time$millisToPosix(0), + aq: $elm$time$Time$utc + } + }; +}; var $author$project$Session$token = function (session) { - if (session.$ === 'Guest') { + if (!session.$) { return ''; } else { var person = session.b; - return person.token; + return person.an; } }; var $author$project$Pages$Capture$init = function (session) { return _Utils_Tuple2( - A4($author$project$Pages$Capture$Model, session, _List_Nil, $author$project$Capture$initCapture, ''), - $author$project$Pages$Capture$getCaptures( - $author$project$Session$token(session))); + $author$project$Pages$Capture$initModel(session), + $elm$core$Platform$Cmd$batch( + _List_fromArray( + [ + $author$project$Pages$Capture$getCaptures( + $author$project$Session$token(session)), + A2($elm$core$Task$perform, $author$project$Pages$Capture$AdjustTimeZone, $elm$time$Time$here) + ]))); }; var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); var $author$project$Pages$Home$init = function (session) { @@ -7641,14 +7717,14 @@ var $author$project$Pages$Home$init = function (session) { }; var $author$project$Pages$Session$Model = F3( function (session, token, error) { - return {error: error, session: session, token: token}; + return {k: error, R: session, an: token}; }); var $author$project$Pages$Session$GotPersonInfo = function (a) { - return {$: 'GotPersonInfo', a: a}; + return {$: 0, a: a}; }; var $author$project$Pages$Session$PersonInfo = F2( function (email, name) { - return {email: email, name: name}; + return {bC: email, bP: name}; }); var $author$project$Pages$Session$personDecoder = A2( $elm$json$Json$Decode$field, @@ -7666,16 +7742,16 @@ var $author$project$Endpoint$personInfo = A2( var $author$project$Pages$Session$getPersonInfo = function (token) { return $elm$http$Http$request( { - body: $elm$http$Http$emptyBody, - expect: A2($elm$http$Http$expectJson, $author$project$Pages$Session$GotPersonInfo, $author$project$Pages$Session$personDecoder), - headers: _List_fromArray( + au: $elm$http$Http$emptyBody, + bE: A2($elm$http$Http$expectJson, $author$project$Pages$Session$GotPersonInfo, $author$project$Pages$Session$personDecoder), + W: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - method: 'GET', - timeout: $elm$core$Maybe$Nothing, - tracker: $elm$core$Maybe$Nothing, - url: $author$project$Endpoint$toString($author$project$Endpoint$personInfo) + Y: 'GET', + ab: $elm$core$Maybe$Nothing, + ac: $elm$core$Maybe$Nothing, + ao: $author$project$Endpoint$toString($author$project$Endpoint$personInfo) }); }; var $author$project$Pages$Session$init = F2( @@ -7686,7 +7762,7 @@ var $author$project$Pages$Session$init = F2( }); var $elm$core$Maybe$destruct = F3( function (_default, func, maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { var a = maybe.a; return func(a); } else { @@ -7702,7 +7778,7 @@ var $author$project$Session$storeSession = _Platform_outgoingPort( var $author$project$Session$logout = $author$project$Session$storeSession($elm$core$Maybe$Nothing); var $elm$core$Platform$Cmd$map = _Platform_map; var $author$project$Session$navKey = function (session) { - if (session.$ === 'Guest') { + if (!session.$) { var key = session.a; return key; } else { @@ -7713,17 +7789,17 @@ var $author$project$Session$navKey = function (session) { var $elm$browser$Browser$Navigation$replaceUrl = _Browser_replaceUrl; var $author$project$Route$routeToString = function (route) { switch (route.$) { - case 'Home': + case 0: return '/'; - case 'Auth': - if (route.a.$ === 'Nothing') { + case 1: + if (route.a.$ === 1) { var _v1 = route.a; return '/auth'; } else { var jwt = route.a.a; return '/auth?jwt=' + jwt; } - case 'Logout': + case 2: return '/logout'; default: return '/capture'; @@ -7737,32 +7813,32 @@ var $author$project$Route$replaceUrl = F2( $author$project$Route$routeToString(route)); }); var $author$project$Pages$Auth$toSession = function (model) { - return model.session; + return model.R; }; var $author$project$Pages$Capture$toSession = function (model) { - return model.session; + return model.R; }; var $author$project$Pages$Home$toSession = function (model) { return model; }; var $author$project$Pages$Session$toSession = function (model) { - return model.session; + return model.R; }; var $author$project$Main$toSession = function (page) { switch (page.$) { - case 'NotFound': + case 3: var session = page.a; return session; - case 'Home': + case 0: var m = page.a; return $author$project$Pages$Home$toSession(m); - case 'Auth': + case 1: var m = page.a; return $author$project$Pages$Auth$toSession(m); - case 'Session': + case 2: var m = page.a; return $author$project$Pages$Session$toSession(m); - case 'Logout': + case 4: var session = page.a; return session; default: @@ -7773,13 +7849,13 @@ var $author$project$Main$toSession = function (page) { var $author$project$Main$loadRoute = F2( function (maybeRoute, model) { var session = $author$project$Main$toSession(model); - if (maybeRoute.$ === 'Nothing') { + if (maybeRoute.$ === 1) { return _Utils_Tuple2( $author$project$Main$NotFound(session), $elm$core$Platform$Cmd$none); } else { switch (maybeRoute.a.$) { - case 'Home': + case 0: var _v1 = maybeRoute.a; var _v2 = $author$project$Pages$Home$init(session); var subModel = _v2.a; @@ -7787,8 +7863,8 @@ var $author$project$Main$loadRoute = F2( return _Utils_Tuple2( $author$project$Main$Home(subModel), A2($elm$core$Platform$Cmd$map, $author$project$Main$GotHomeMsg, subMsg)); - case 'Auth': - if (maybeRoute.a.a.$ === 'Nothing') { + case 1: + if (maybeRoute.a.a.$ === 1) { var _v3 = maybeRoute.a.a; var _v4 = $author$project$Pages$Auth$init(session); var subModel = _v4.a; @@ -7805,7 +7881,7 @@ var $author$project$Main$loadRoute = F2( $author$project$Main$Session(subModel), A2($elm$core$Platform$Cmd$map, $author$project$Main$GotPagesSessionMsg, subMsg)); } - case 'Logout': + case 2: var _v6 = maybeRoute.a; return _Utils_Tuple2( $author$project$Main$Logout(session), @@ -7832,7 +7908,7 @@ var $author$project$Main$loadRoute = F2( var $author$project$Main$init = F3( function (flags, url, navKey) { var session = function () { - if (flags.$ === 'Nothing') { + if (flags.$ === 1) { return $author$project$Session$Guest(navKey); } else { var str = flags.a; @@ -7849,11 +7925,11 @@ var $elm$core$Platform$Sub$map = _Platform_map; var $elm$core$Platform$Sub$batch = _Platform_batch; var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil); var $author$project$Pages$Auth$GotSession = function (a) { - return {$: 'GotSession', a: a}; + return {$: 1, a: a}; }; var $elm$json$Json$Decode$decodeValue = _Json_run; var $elm$core$Result$toMaybe = function (result) { - if (result.$ === 'Ok') { + if (!result.$) { var v = result.a; return $elm$core$Maybe$Just(v); } else { @@ -7881,7 +7957,7 @@ var $author$project$Session$changePerson = function (toMsg) { }; var $author$project$Session$sessionFromPerson = F2( function (maybePerson, key) { - if (maybePerson.$ === 'Just') { + if (!maybePerson.$) { var person = maybePerson.a; return A2($author$project$Session$Session, key, person); } else { @@ -7900,58 +7976,319 @@ var $author$project$Pages$Auth$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Auth$GotSession, - $author$project$Session$navKey(model.session)); + $author$project$Session$navKey(model.R)); }; var $author$project$Pages$Capture$GotSession = function (a) { - return {$: 'GotSession', a: a}; + return {$: 0, a: a}; }; -var $author$project$Pages$Capture$subscriptions = function (model) { - return A2( - $author$project$Session$changeSession, - $author$project$Pages$Capture$GotSession, - $author$project$Session$navKey(model.session)); +var $author$project$Pages$Capture$Tick = function (a) { + return {$: 10, a: a}; }; -var $author$project$Pages$Home$GotSession = function (a) { - return {$: 'GotSession', a: a}; +var $elm$time$Time$Every = F2( + function (a, b) { + return {$: 0, a: a, b: b}; + }); +var $elm$time$Time$State = F2( + function (taggers, processes) { + return {a_: processes, bi: taggers}; + }); +var $elm$time$Time$init = $elm$core$Task$succeed( + A2($elm$time$Time$State, $elm$core$Dict$empty, $elm$core$Dict$empty)); +var $elm$time$Time$addMySub = F2( + function (_v0, state) { + var interval = _v0.a; + var tagger = _v0.b; + var _v1 = A2($elm$core$Dict$get, interval, state); + if (_v1.$ === 1) { + return A3( + $elm$core$Dict$insert, + interval, + _List_fromArray( + [tagger]), + state); + } else { + var taggers = _v1.a; + return A3( + $elm$core$Dict$insert, + interval, + A2($elm$core$List$cons, tagger, taggers), + state); + } + }); +var $elm$core$Dict$foldl = F3( + function (func, acc, dict) { + foldl: + while (true) { + if (dict.$ === -2) { + return acc; + } else { + var key = dict.b; + var value = dict.c; + var left = dict.d; + var right = dict.e; + var $temp$func = func, + $temp$acc = A3( + func, + key, + value, + A3($elm$core$Dict$foldl, func, acc, left)), + $temp$dict = right; + func = $temp$func; + acc = $temp$acc; + dict = $temp$dict; + continue foldl; + } + } + }); +var $elm$core$Dict$merge = F6( + function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) { + var stepState = F3( + function (rKey, rValue, _v0) { + stepState: + while (true) { + var list = _v0.a; + var result = _v0.b; + if (!list.b) { + return _Utils_Tuple2( + list, + A3(rightStep, rKey, rValue, result)); + } else { + var _v2 = list.a; + var lKey = _v2.a; + var lValue = _v2.b; + var rest = list.b; + if (_Utils_cmp(lKey, rKey) < 0) { + var $temp$rKey = rKey, + $temp$rValue = rValue, + $temp$_v0 = _Utils_Tuple2( + rest, + A3(leftStep, lKey, lValue, result)); + rKey = $temp$rKey; + rValue = $temp$rValue; + _v0 = $temp$_v0; + continue stepState; + } else { + if (_Utils_cmp(lKey, rKey) > 0) { + return _Utils_Tuple2( + list, + A3(rightStep, rKey, rValue, result)); + } else { + return _Utils_Tuple2( + rest, + A4(bothStep, lKey, lValue, rValue, result)); + } + } + } + } + }); + var _v3 = A3( + $elm$core$Dict$foldl, + stepState, + _Utils_Tuple2( + $elm$core$Dict$toList(leftDict), + initialResult), + rightDict); + var leftovers = _v3.a; + var intermediateResult = _v3.b; + return A3( + $elm$core$List$foldl, + F2( + function (_v4, result) { + var k = _v4.a; + var v = _v4.b; + return A3(leftStep, k, v, result); + }), + intermediateResult, + leftovers); + }); +var $elm$time$Time$setInterval = _Time_setInterval; +var $elm$time$Time$spawnHelp = F3( + function (router, intervals, processes) { + if (!intervals.b) { + return $elm$core$Task$succeed(processes); + } else { + var interval = intervals.a; + var rest = intervals.b; + var spawnTimer = $elm$core$Process$spawn( + A2( + $elm$time$Time$setInterval, + interval, + A2($elm$core$Platform$sendToSelf, router, interval))); + var spawnRest = function (id) { + return A3( + $elm$time$Time$spawnHelp, + router, + rest, + A3($elm$core$Dict$insert, interval, id, processes)); + }; + return A2($elm$core$Task$andThen, spawnRest, spawnTimer); + } + }); +var $elm$time$Time$onEffects = F3( + function (router, subs, _v0) { + var processes = _v0.a_; + var rightStep = F3( + function (_v6, id, _v7) { + var spawns = _v7.a; + var existing = _v7.b; + var kills = _v7.c; + return _Utils_Tuple3( + spawns, + existing, + A2( + $elm$core$Task$andThen, + function (_v5) { + return kills; + }, + $elm$core$Process$kill(id))); + }); + var newTaggers = A3($elm$core$List$foldl, $elm$time$Time$addMySub, $elm$core$Dict$empty, subs); + var leftStep = F3( + function (interval, taggers, _v4) { + var spawns = _v4.a; + var existing = _v4.b; + var kills = _v4.c; + return _Utils_Tuple3( + A2($elm$core$List$cons, interval, spawns), + existing, + kills); + }); + var bothStep = F4( + function (interval, taggers, id, _v3) { + var spawns = _v3.a; + var existing = _v3.b; + var kills = _v3.c; + return _Utils_Tuple3( + spawns, + A3($elm$core$Dict$insert, interval, id, existing), + kills); + }); + var _v1 = A6( + $elm$core$Dict$merge, + leftStep, + bothStep, + rightStep, + newTaggers, + processes, + _Utils_Tuple3( + _List_Nil, + $elm$core$Dict$empty, + $elm$core$Task$succeed(0))); + var spawnList = _v1.a; + var existingDict = _v1.b; + var killTask = _v1.c; + return A2( + $elm$core$Task$andThen, + function (newProcesses) { + return $elm$core$Task$succeed( + A2($elm$time$Time$State, newTaggers, newProcesses)); + }, + A2( + $elm$core$Task$andThen, + function (_v2) { + return A3($elm$time$Time$spawnHelp, router, spawnList, existingDict); + }, + killTask)); + }); +var $elm$time$Time$now = _Time_now($elm$time$Time$millisToPosix); +var $elm$time$Time$onSelfMsg = F3( + function (router, interval, state) { + var _v0 = A2($elm$core$Dict$get, interval, state.bi); + if (_v0.$ === 1) { + return $elm$core$Task$succeed(state); + } else { + var taggers = _v0.a; + var tellTaggers = function (time) { + return $elm$core$Task$sequence( + A2( + $elm$core$List$map, + function (tagger) { + return A2( + $elm$core$Platform$sendToApp, + router, + tagger(time)); + }, + taggers)); + }; + return A2( + $elm$core$Task$andThen, + function (_v1) { + return $elm$core$Task$succeed(state); + }, + A2($elm$core$Task$andThen, tellTaggers, $elm$time$Time$now)); + } + }); +var $elm$core$Basics$composeL = F3( + function (g, f, x) { + return g( + f(x)); + }); +var $elm$time$Time$subMap = F2( + function (f, _v0) { + var interval = _v0.a; + var tagger = _v0.b; + return A2( + $elm$time$Time$Every, + interval, + A2($elm$core$Basics$composeL, f, tagger)); + }); +_Platform_effectManagers['Time'] = _Platform_createManager($elm$time$Time$init, $elm$time$Time$onEffects, $elm$time$Time$onSelfMsg, 0, $elm$time$Time$subMap); +var $elm$time$Time$subscription = _Platform_leaf('Time'); +var $elm$time$Time$every = F2( + function (interval, tagger) { + return $elm$time$Time$subscription( + A2($elm$time$Time$Every, interval, tagger)); + }); +var $author$project$Pages$Capture$subscriptions = function (model) { + return $elm$core$Platform$Sub$batch( + _List_fromArray( + [ + A2($elm$time$Time$every, 1000, $author$project$Pages$Capture$Tick), + A2( + $author$project$Session$changeSession, + $author$project$Pages$Capture$GotSession, + $author$project$Session$navKey(model.R)) + ])); }; +var $author$project$Pages$Home$GotSession = $elm$core$Basics$identity; var $author$project$Pages$Home$subscriptions = function (model) { return A2( $author$project$Session$changeSession, - $author$project$Pages$Home$GotSession, + $elm$core$Basics$identity, $author$project$Session$navKey(model)); }; var $author$project$Pages$Session$GotSession = function (a) { - return {$: 'GotSession', a: a}; + return {$: 1, a: a}; }; var $author$project$Pages$Session$subscriptions = function (model) { return A2( $author$project$Session$changeSession, $author$project$Pages$Session$GotSession, - $author$project$Session$navKey(model.session)); + $author$project$Session$navKey(model.R)); }; var $author$project$Main$subscriptions = function (model) { switch (model.$) { - case 'Home': + case 0: var home = model.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GotHomeMsg, $author$project$Pages$Home$subscriptions(home)); - case 'Auth': + case 1: var authModel = model.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GotAuthMsg, $author$project$Pages$Auth$subscriptions(authModel)); - case 'Session': + case 2: var sessionModel = model.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GotPagesSessionMsg, $author$project$Pages$Session$subscriptions(sessionModel)); - case 'NotFound': + case 3: return $elm$core$Platform$Sub$none; - case 'Logout': + case 4: return $elm$core$Platform$Sub$none; default: var captureModel = model.a; @@ -7969,7 +8306,7 @@ var $author$project$Main$toNavKey = function (model) { }; var $elm$url$Url$addPort = F2( function (maybePort, starter) { - if (maybePort.$ === 'Nothing') { + if (maybePort.$ === 1) { return starter; } else { var port_ = maybePort.a; @@ -7978,7 +8315,7 @@ var $elm$url$Url$addPort = F2( }); var $elm$url$Url$addPrefixed = F3( function (prefix, maybeSegment, starter) { - if (maybeSegment.$ === 'Nothing') { + if (maybeSegment.$ === 1) { return starter; } else { var segment = maybeSegment.a; @@ -7989,8 +8326,8 @@ var $elm$url$Url$addPrefixed = F3( }); var $elm$url$Url$toString = function (url) { var http = function () { - var _v0 = url.protocol; - if (_v0.$ === 'Http') { + var _v0 = url.a$; + if (!_v0) { return 'http://'; } else { return 'https://'; @@ -7999,28 +8336,28 @@ var $elm$url$Url$toString = function (url) { return A3( $elm$url$Url$addPrefixed, '#', - url.fragment, + url.aF, A3( $elm$url$Url$addPrefixed, '?', - url.query, + url.a0, _Utils_ap( A2( $elm$url$Url$addPort, - url.port_, - _Utils_ap(http, url.host)), - url.path))); + url.aX, + _Utils_ap(http, url.aK)), + url.aV))); }; var $author$project$Pages$Auth$update = F2( function (msg, model) { - if (msg.$ === 'GotAuthUrls') { + if (!msg.$) { var result = msg.a; - if (result.$ === 'Ok') { + if (!result.$) { var urls = result.a; return _Utils_Tuple2( _Utils_update( model, - {urls: urls}), + {ap: urls}), $elm$core$Platform$Cmd$none); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); @@ -8030,17 +8367,16 @@ var $author$project$Pages$Auth$update = F2( return _Utils_Tuple2( _Utils_update( model, - {session: session}), + {R: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.session), + $author$project$Session$navKey(model.R), $author$project$Route$Home)); } }); -var $author$project$Capture$Disabled = {$: 'Disabled'}; -var $elm$core$Debug$log = _Debug_log; +var $author$project$Capture$Disabled = {$: 3}; var $author$project$Pages$Capture$CaptureSaved = function (a) { - return {$: 'CaptureSaved', a: a}; + return {$: 2, a: a}; }; var $elm$json$Json$Encode$object = function (pairs) { return _Json_wrap( @@ -8052,7 +8388,7 @@ var $elm$json$Json$Encode$object = function (pairs) { var v = _v0.b; return A3(_Json_addField, k, v, obj); }), - _Json_emptyObject(_Utils_Tuple0), + _Json_emptyObject(0), pairs)); }; var $elm$json$Json$Encode$string = _Json_wrap; @@ -8062,7 +8398,7 @@ var $author$project$Capture$captureEncode = function (capture) { [ _Utils_Tuple2( 'text', - $elm$json$Json$Encode$string(capture.text)) + $elm$json$Json$Encode$string(capture.am)) ])); }; var $elm$http$Http$jsonBody = function (value) { @@ -8076,22 +8412,22 @@ var $author$project$Pages$Capture$saveCapture = F2( function (token, capture) { return $elm$http$Http$request( { - body: $elm$http$Http$jsonBody( + au: $elm$http$Http$jsonBody( $author$project$Capture$captureEncode(capture)), - expect: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$CaptureSaved, $author$project$Capture$savedCaptureDecoder), - headers: _List_fromArray( + bE: A2($elm$http$Http$expectJson, $author$project$Pages$Capture$CaptureSaved, $author$project$Capture$savedCaptureDecoder), + W: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - method: 'POST', - timeout: $elm$core$Maybe$Nothing, - tracker: $elm$core$Maybe$Nothing, - url: $author$project$Endpoint$toString($author$project$Endpoint$captures) + Y: 'POST', + ab: $elm$core$Maybe$Nothing, + ac: $elm$core$Maybe$Nothing, + ao: $author$project$Endpoint$toString($author$project$Endpoint$captures) }); }); var $author$project$Pages$Capture$TimerUpdated = F2( function (a, b) { - return {$: 'TimerUpdated', a: a, b: b}; + return {$: 7, a: a, b: b}; }); var $author$project$Endpoint$startTimer = function (idCapture) { return A2( @@ -8110,19 +8446,19 @@ var $author$project$Pages$Capture$startTimer = F2( function (token, idCapture) { return $elm$http$Http$request( { - body: $elm$http$Http$emptyBody, - expect: A2( + au: $elm$http$Http$emptyBody, + bE: A2( $elm$http$Http$expectJson, $author$project$Pages$Capture$TimerUpdated($author$project$Capture$InProgress), $author$project$Timer$timerDataDecoder), - headers: _List_fromArray( + W: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - method: 'POST', - timeout: $elm$core$Maybe$Nothing, - tracker: $elm$core$Maybe$Nothing, - url: $author$project$Endpoint$toString( + Y: 'POST', + ab: $elm$core$Maybe$Nothing, + ac: $elm$core$Maybe$Nothing, + ao: $author$project$Endpoint$toString( $author$project$Endpoint$startTimer(idCapture)) }); }); @@ -8153,20 +8489,20 @@ var $author$project$Pages$Capture$stopTimer = F3( function (token, idTimer, idCapture) { return $elm$http$Http$request( { - body: $elm$http$Http$jsonBody( + au: $elm$http$Http$jsonBody( $author$project$Timer$actionTimerEncode('stop')), - expect: A2( + bE: A2( $elm$http$Http$expectJson, $author$project$Pages$Capture$TimerUpdated($author$project$Capture$ToDo), $author$project$Timer$timerDataDecoder), - headers: _List_fromArray( + W: _List_fromArray( [ A2($elm$http$Http$header, 'authorization', 'Bearer ' + token) ]), - method: 'PUT', - timeout: $elm$core$Maybe$Nothing, - tracker: $elm$core$Maybe$Nothing, - url: $author$project$Endpoint$toString( + Y: 'PUT', + ab: $elm$core$Maybe$Nothing, + ac: $elm$core$Maybe$Nothing, + ao: $author$project$Endpoint$toString( A2($author$project$Endpoint$stopTimer, idTimer, idCapture)) }); }); @@ -8175,194 +8511,216 @@ var $author$project$Pages$Capture$updateCapture = F3( return A2( $elm$core$List$map, function (c) { - return _Utils_eq(idCapture, c.idCapture) ? _Utils_update( + return _Utils_eq(idCapture, c.aL) ? _Utils_update( c, - {status: status}) : c; + {be: status}) : c; }, listCaptures); }); var $author$project$Pages$Capture$update = F2( function (msg, model) { switch (msg.$) { - case 'None': + case 8: return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'GotSession': + case 9: + var zone = msg.a; + var timer = model.H; + var newTimer = _Utils_update( + timer, + {aq: zone}); + return _Utils_Tuple2( + _Utils_update( + model, + {H: newTimer}), + $elm$core$Platform$Cmd$none); + case 10: + var posix = msg.a; + var timer = model.H; + var newTimer = _Utils_update( + timer, + {_: posix}); + return _Utils_Tuple2( + _Utils_update( + model, + {H: newTimer}), + $elm$core$Platform$Cmd$none); + case 0: var session = msg.a; return _Utils_Tuple2( _Utils_update( model, - {session: session}), + {R: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.session), + $author$project$Session$navKey(model.R), $author$project$Route$Home)); - case 'GotCaptures': + case 1: var result = msg.a; - if (result.$ === 'Ok') { + if (!result.$) { var captures = result.a; - var _v2 = A2($elm$core$Debug$log, 'captures', captures); return _Utils_Tuple2( _Utils_update( model, - {captures: captures, error: ''}), + {J: captures, k: ''}), $elm$core$Platform$Cmd$none); } else { var httpError = result.a; - _v3$2: + _v2$2: while (true) { - if (httpError.$ === 'BadStatus') { + if (httpError.$ === 3) { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {error: 'Access not authorised'}), + {k: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {error: 'User information can\'t be retrieved'}), + {k: 'User information can\'t be retrieved'}), $elm$core$Platform$Cmd$none); default: - break _v3$2; + break _v2$2; } } else { - break _v3$2; + break _v2$2; } } return _Utils_Tuple2( _Utils_update( model, - {error: 'Error while getting the captures'}), + {k: 'Error while getting the captures'}), $elm$core$Platform$Cmd$none); } - case 'CaptureSaved': + case 2: var result = msg.a; - if (result.$ === 'Ok') { + if (!result.$) { return _Utils_Tuple2( _Utils_update( model, - {error: ''}), + {k: ''}), $author$project$Pages$Capture$getCaptures( - $author$project$Session$token(model.session))); + $author$project$Session$token(model.R))); } else { var httpError = result.a; - _v5$2: + _v4$2: while (true) { - if (httpError.$ === 'BadStatus') { + if (httpError.$ === 3) { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {error: 'Access not authorised'}), + {k: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {error: 'create capture endpoint not found'}), + {k: 'create capture endpoint not found'}), $elm$core$Platform$Cmd$none); default: - break _v5$2; + break _v4$2; } } else { - break _v5$2; + break _v4$2; } } return _Utils_Tuple2( _Utils_update( model, - {error: 'Error while creating the capture'}), + {k: 'Error while creating the capture'}), $elm$core$Platform$Cmd$none); } - case 'UpdateNewCapture': + case 3: var text = msg.a; - var capture = model.newCapture; + var capture = model.E; var newCapture = _Utils_update( capture, - {text: text}); + {am: text}); return _Utils_Tuple2( _Utils_update( model, - {newCapture: newCapture}), + {E: newCapture}), $elm$core$Platform$Cmd$none); - case 'AddCapture': + case 4: return _Utils_Tuple2( _Utils_update( model, - {newCapture: $author$project$Capture$initCapture}), + {E: $author$project$Capture$initCapture}), A2( $author$project$Pages$Capture$saveCapture, - $author$project$Session$token(model.session), - model.newCapture)); - case 'StartTimer': + $author$project$Session$token(model.R), + model.E)); + case 5: var idCapture = msg.a; - var captures = A3($author$project$Pages$Capture$updateCapture, $author$project$Capture$Disabled, idCapture, model.captures); + var captures = A3($author$project$Pages$Capture$updateCapture, $author$project$Capture$Disabled, idCapture, model.J); return _Utils_Tuple2( _Utils_update( model, - {captures: captures}), + {J: captures}), A2( $author$project$Pages$Capture$startTimer, - $author$project$Session$token(model.session), + $author$project$Session$token(model.R), idCapture)); - case 'StopTimer': + case 6: var idTimer = msg.a; var idCapture = msg.b; return _Utils_Tuple2( model, A3( $author$project$Pages$Capture$stopTimer, - $author$project$Session$token(model.session), + $author$project$Session$token(model.R), idTimer, idCapture)); default: + var s = msg.a; var result = msg.b; - if (result.$ === 'Ok') { + if (!result.$) { return _Utils_Tuple2( _Utils_update( model, - {error: ''}), + {k: ''}), $author$project$Pages$Capture$getCaptures( - $author$project$Session$token(model.session))); + $author$project$Session$token(model.R))); } else { var httpError = result.a; - _v7$2: + _v6$2: while (true) { - if (httpError.$ === 'BadStatus') { + if (httpError.$ === 3) { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {error: 'Access not authorised'}), + {k: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {error: 'create timer endpoint not found'}), + {k: 'create timer endpoint not found'}), $elm$core$Platform$Cmd$none); default: - break _v7$2; + break _v6$2; } } else { - break _v7$2; + break _v6$2; } } return _Utils_Tuple2( _Utils_update( model, - {error: 'Error while starting the timer'}), + {k: 'Error while starting the timer'}), $elm$core$Platform$Cmd$none); } } }); var $author$project$Pages$Home$update = F2( function (msg, model) { - var session = msg.a; + var session = msg; return _Utils_Tuple2( session, A2( @@ -8376,19 +8734,19 @@ var $author$project$Session$encode = function (person) { [ _Utils_Tuple2( 'email', - $elm$json$Json$Encode$string(person.email)), + $elm$json$Json$Encode$string(person.bC)), _Utils_Tuple2( 'token', - $elm$json$Json$Encode$string(person.token)) + $elm$json$Json$Encode$string(person.an)) ])); }; var $author$project$Pages$Session$update = F2( function (msg, model) { - if (msg.$ === 'GotPersonInfo') { + if (!msg.$) { var result = msg.a; - if (result.$ === 'Ok') { + if (!result.$) { var person = result.a; - var session = {email: person.email, token: model.token}; + var session = {bC: person.bC, an: model.an}; return _Utils_Tuple2( model, $author$project$Session$storeSession( @@ -8398,19 +8756,19 @@ var $author$project$Pages$Session$update = F2( var httpError = result.a; _v2$2: while (true) { - if (httpError.$ === 'BadStatus') { + if (httpError.$ === 3) { switch (httpError.a) { case 401: return _Utils_Tuple2( _Utils_update( model, - {error: 'Access not authorised'}), + {k: 'Access not authorised'}), $elm$core$Platform$Cmd$none); case 404: return _Utils_Tuple2( _Utils_update( model, - {error: 'User information can\'t be retrieved'}), + {k: 'User information can\'t be retrieved'}), $elm$core$Platform$Cmd$none); default: break _v2$2; @@ -8422,7 +8780,7 @@ var $author$project$Pages$Session$update = F2( return _Utils_Tuple2( _Utils_update( model, - {error: 'Error on authentication'}), + {k: 'Error on authentication'}), $elm$core$Platform$Cmd$none); } } else { @@ -8430,10 +8788,10 @@ var $author$project$Pages$Session$update = F2( return _Utils_Tuple2( _Utils_update( model, - {session: session}), + {R: session}), A2( $author$project$Route$replaceUrl, - $author$project$Session$navKey(model.session), + $author$project$Session$navKey(model.R), $author$project$Route$Home)); } }); @@ -8443,9 +8801,9 @@ var $author$project$Main$update = F2( _v0$6: while (true) { switch (_v0.a.$) { - case 'LinkClicked': + case 1: var link = _v0.a.a; - if (link.$ === 'Internal') { + if (!link.$) { var urlRequested = link.a; return _Utils_Tuple2( model, @@ -8459,14 +8817,14 @@ var $author$project$Main$update = F2( model, $elm$browser$Browser$Navigation$load(href)); } - case 'UrlChanged': + case 0: var url = _v0.a.a; return A2( $author$project$Main$loadRoute, $author$project$Route$fromUrl(url), model); - case 'GotHomeMsg': - if (_v0.b.$ === 'Home') { + case 2: + if (!_v0.b.$) { var homeMsg = _v0.a.a; var homeModel = _v0.b.a; var _v2 = A2($author$project$Pages$Home$update, homeMsg, homeModel); @@ -8478,8 +8836,8 @@ var $author$project$Main$update = F2( } else { break _v0$6; } - case 'GotAuthMsg': - if (_v0.b.$ === 'Auth') { + case 3: + if (_v0.b.$ === 1) { var authMsg = _v0.a.a; var authModel = _v0.b.a; var _v3 = A2($author$project$Pages$Auth$update, authMsg, authModel); @@ -8491,8 +8849,8 @@ var $author$project$Main$update = F2( } else { break _v0$6; } - case 'GotPagesSessionMsg': - if (_v0.b.$ === 'Session') { + case 4: + if (_v0.b.$ === 2) { var sessionMsg = _v0.a.a; var sessionModel = _v0.b.a; var _v4 = A2($author$project$Pages$Session$update, sessionMsg, sessionModel); @@ -8505,7 +8863,7 @@ var $author$project$Main$update = F2( break _v0$6; } default: - if (_v0.b.$ === 'Capture') { + if (_v0.b.$ === 5) { var captureMsg = _v0.a.a; var captureModel = _v0.b.a; var _v5 = A2($author$project$Pages$Capture$update, captureMsg, captureModel); @@ -8542,11 +8900,9 @@ var $author$project$Route$href = function (targetRoute) { $author$project$Route$routeToString(targetRoute)); }; var $elm$html$Html$img = _VirtualDom_node('img'); -var $author$project$Asset$Image = function (a) { - return {$: 'Image', a: a}; -}; +var $author$project$Asset$Image = $elm$core$Basics$identity; var $author$project$Asset$image = function (filename) { - return $author$project$Asset$Image('/assets/images/' + filename); + return '/assets/images/' + filename; }; var $author$project$Asset$logo = $author$project$Asset$image('dwyl.png'); var $elm$html$Html$Attributes$src = function (url) { @@ -8556,7 +8912,7 @@ var $elm$html$Html$Attributes$src = function (url) { _VirtualDom_noJavaScriptOrHtmlUri(url)); }; var $author$project$Asset$src = function (_v0) { - var url = _v0.a; + var url = _v0; return $elm$html$Html$Attributes$src(url); }; var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; @@ -8566,11 +8922,11 @@ var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; var $author$project$Page$view = F2( function (toMsg, structure) { return { - body: A2( + au: A2( $elm$core$List$map, $elm$html$Html$map(toMsg), - structure.content), - title: structure.title + structure.ay), + bk: structure.bk }; }); var $elm$html$Html$div = _VirtualDom_node('div'); @@ -8578,8 +8934,8 @@ var $author$project$Asset$signinGithub = $author$project$Asset$image('signin-git var $author$project$Asset$signinGoogle = $author$project$Asset$image('signin-google.png'); var $author$project$Pages$Auth$showAuthUrl = function (url) { var imgSrc = function () { - var _v0 = url.typeUrl; - if (_v0.$ === 'Google') { + var _v0 = url.bm; + if (!_v0) { return $author$project$Asset$src($author$project$Asset$signinGoogle); } else { return $author$project$Asset$src($author$project$Asset$signinGithub); @@ -8597,7 +8953,7 @@ var $author$project$Pages$Auth$showAuthUrl = function (url) { $elm$html$Html$a, _List_fromArray( [ - $elm$html$Html$Attributes$href(url.url) + $elm$html$Html$Attributes$href(url.ao) ]), _List_fromArray( [ @@ -8611,7 +8967,7 @@ var $author$project$Pages$Auth$showAuthUrl = function (url) { }; var $author$project$Pages$Auth$view = function (model) { return { - content: _List_fromArray( + ay: _List_fromArray( [ A2( $elm$html$Html$a, @@ -8638,19 +8994,19 @@ var $author$project$Pages$Auth$view = function (model) { function (url) { return $author$project$Pages$Auth$showAuthUrl(url); }, - model.urls)) + model.ap)) ]), - title: 'Auth' + bk: 'Auth' }; }; -var $author$project$Pages$Capture$AddCapture = {$: 'AddCapture'}; +var $author$project$Pages$Capture$AddCapture = {$: 4}; var $author$project$Pages$Capture$UpdateNewCapture = function (a) { - return {$: 'UpdateNewCapture', a: a}; + return {$: 3, a: a}; }; var $elm$html$Html$button = _VirtualDom_node('button'); var $elm$html$Html$input = _VirtualDom_node('input'); var $elm$virtual_dom$VirtualDom$Normal = function (a) { - return {$: 'Normal', a: a}; + return {$: 0, a: a}; }; var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; var $elm$html$Html$Events$on = F2( @@ -8670,7 +9026,7 @@ var $elm$html$Html$Events$alwaysStop = function (x) { return _Utils_Tuple2(x, true); }; var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { - return {$: 'MayStopPropagation', a: a}; + return {$: 1, a: a}; }; var $elm$html$Html$Events$stopPropagationOn = F2( function (event, decoder) { @@ -8698,13 +9054,13 @@ var $elm$html$Html$Events$onInput = function (tagger) { A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); }; var $elm$html$Html$p = _VirtualDom_node('p'); -var $author$project$Pages$Capture$None = {$: 'None'}; +var $author$project$Pages$Capture$None = {$: 8}; var $author$project$Pages$Capture$StartTimer = function (a) { - return {$: 'StartTimer', a: a}; + return {$: 5, a: a}; }; var $author$project$Pages$Capture$StopTimer = F2( function (a, b) { - return {$: 'StopTimer', a: a, b: b}; + return {$: 6, a: a, b: b}; }); var $elm$json$Json$Encode$bool = _Json_wrap; var $elm$html$Html$Attributes$boolProperty = F2( @@ -8716,10 +9072,186 @@ var $elm$html$Html$Attributes$boolProperty = F2( }); var $elm$html$Html$Attributes$checked = $elm$html$Html$Attributes$boolProperty('checked'); var $elm$html$Html$Attributes$disabled = $elm$html$Html$Attributes$boolProperty('disabled'); -var $author$project$Capture$getTimer = function (capture) { - return $elm$core$List$head(capture.timers); +var $author$project$Capture$getCurrentTimer = function (timers) { + return $elm$core$List$head(timers); }; var $elm$html$Html$label = _VirtualDom_node('label'); +var $elm$core$Maybe$andThen = F2( + function (callback, maybeValue) { + if (!maybeValue.$) { + var value = maybeValue.a; + return callback(value); + } else { + return $elm$core$Maybe$Nothing; + } + }); +var $elm$core$List$tail = function (list) { + if (list.b) { + var x = list.a; + var xs = list.b; + return $elm$core$Maybe$Just(xs); + } else { + return $elm$core$Maybe$Nothing; + } +}; +var $author$project$Capture$getPreviousTimer = function (timers) { + return $elm$core$List$tail(timers); +}; +var $elm$core$Maybe$map = F2( + function (f, maybe) { + if (!maybe.$) { + var value = maybe.a; + return $elm$core$Maybe$Just( + f(value)); + } else { + return $elm$core$Maybe$Nothing; + } + }); +var $elm$core$Maybe$map2 = F3( + function (func, ma, mb) { + if (ma.$ === 1) { + return $elm$core$Maybe$Nothing; + } else { + var a = ma.a; + if (mb.$ === 1) { + return $elm$core$Maybe$Nothing; + } else { + var b = mb.a; + return $elm$core$Maybe$Just( + A2(func, a, b)); + } + } + }); +var $elm$core$String$cons = _String_cons; +var $elm$core$String$fromChar = function (_char) { + return A2($elm$core$String$cons, _char, ''); +}; +var $elm$core$Bitwise$and = _Bitwise_and; +var $elm$core$Bitwise$shiftRightBy = _Bitwise_shiftRightBy; +var $elm$core$String$repeatHelp = F3( + function (n, chunk, result) { + return (n <= 0) ? result : A3( + $elm$core$String$repeatHelp, + n >> 1, + _Utils_ap(chunk, chunk), + (!(n & 1)) ? result : _Utils_ap(result, chunk)); + }); +var $elm$core$String$repeat = F2( + function (n, chunk) { + return A3($elm$core$String$repeatHelp, n, chunk, ''); + }); +var $elm$core$String$padLeft = F3( + function (n, _char, string) { + return _Utils_ap( + A2( + $elm$core$String$repeat, + n - $elm$core$String$length(string), + $elm$core$String$fromChar(_char)), + string); + }); +var $author$project$Timer$formatTime = A2( + $elm$core$Basics$composeL, + A2($elm$core$String$padLeft, 2, '0'), + $elm$core$String$fromInt); +var $author$project$Timer$millisToHMS = function (millis) { + var second = $author$project$Timer$formatTime( + A2($elm$core$Basics$modBy, 60, (millis / 1000) | 0)); + var minute = $author$project$Timer$formatTime( + A2($elm$core$Basics$modBy, 60, (millis / (1000 * 60)) | 0)); + var hour = $author$project$Timer$formatTime( + A2($elm$core$Basics$modBy, 24, (millis / ((1000 * 60) * 60)) | 0)); + return _Utils_Tuple3(hour, minute, second); +}; +var $elm$time$Time$posixToMillis = function (_v0) { + var millis = _v0; + return millis; +}; +var $author$project$Timer$timerToMillis = function (timer) { + return A3( + $elm$core$Maybe$map2, + F2( + function (p1, p2) { + return $elm$time$Time$posixToMillis(p1) - $elm$time$Time$posixToMillis(p2); + }), + timer.b7, + $elm$core$Maybe$Just(timer.b4)); +}; +var $author$project$Timer$timersToMillis = function (timers) { + var millis = A2($elm$core$List$map, $author$project$Timer$timerToMillis, timers); + return A3( + $elm$core$List$foldl, + F2( + function (a, b) { + return A3($elm$core$Maybe$map2, $elm$core$Basics$add, a, b); + }), + $elm$core$Maybe$Just(0), + millis); +}; +var $author$project$Pages$Capture$showTime = F3( + function (status, clock, timers) { + if (status.$ === 2) { + var nowToMillis = $elm$time$Time$posixToMillis(clock._); + var maybeStartedAtMillis = A2( + $elm$core$Maybe$map, + function (t) { + return $elm$time$Time$posixToMillis(t.b4); + }, + $author$project$Capture$getCurrentTimer(timers)); + var maybePreviousTimersMillis = A2( + $elm$core$Maybe$andThen, + $author$project$Timer$timersToMillis, + $author$project$Capture$getPreviousTimer(timers)); + var maybeNowMillis = A2( + $elm$core$Maybe$map, + $elm$core$Basics$sub(nowToMillis), + maybeStartedAtMillis); + var allTimes = A3($elm$core$Maybe$map2, $elm$core$Basics$add, maybeNowMillis, maybePreviousTimersMillis); + var _v1 = function () { + if (allTimes.$ === 1) { + return _Utils_Tuple3('', '', ''); + } else { + var t = allTimes.a; + return $author$project$Timer$millisToHMS(t); + } + }(); + var hour = _v1.a; + var minute = _v1.b; + var second = _v1.c; + return A2( + $elm$html$Html$p, + _List_fromArray( + [ + $elm$html$Html$Attributes$class('tc') + ]), + _List_fromArray( + [ + $elm$html$Html$text(hour + (':' + (minute + (':' + second)))) + ])); + } else { + var _v3 = function () { + var _v4 = $author$project$Timer$timersToMillis(timers); + if (_v4.$ === 1) { + return _Utils_Tuple3('', '', ''); + } else { + var t = _v4.a; + return $author$project$Timer$millisToHMS(t); + } + }(); + var hour = _v3.a; + var minute = _v3.b; + var second = _v3.c; + return A2( + $elm$html$Html$p, + _List_fromArray( + [ + $elm$html$Html$Attributes$class('tc') + ]), + _List_fromArray( + [ + $elm$html$Html$text(hour + (':' + (minute + (':' + second)))) + ])); + } + }); var $elm$core$List$filter = F2( function (isGood, list) { return A3( @@ -8766,69 +9298,71 @@ var $author$project$Pages$Capture$showTimerButton = F2( ])); }); var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); -var $author$project$Pages$Capture$showCapture = function (capture) { - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('pa2') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$label, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('dib pa2') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$input, - _List_fromArray( - [ - $elm$html$Html$Attributes$type_('checkbox'), - $elm$html$Html$Attributes$checked(false), - $elm$html$Html$Attributes$disabled(false), - $elm$html$Html$Attributes$class('mr2') - ]), - _List_Nil), - $elm$html$Html$text(capture.text) - ])), - function () { - var _v0 = capture.status; - switch (_v0.$) { - case 'ToDo': - return A2( - $author$project$Pages$Capture$showTimerButton, - 'start', - $author$project$Pages$Capture$StartTimer(capture.idCapture)); - case 'InProgress': - var timer = $author$project$Capture$getTimer(capture); - if (timer.$ === 'Nothing') { - return A2($author$project$Pages$Capture$showTimerButton, 'Error Timer', $author$project$Pages$Capture$None); - } else { - var t = timer.a; +var $author$project$Pages$Capture$showCapture = F2( + function (clock, capture) { + return A2( + $elm$html$Html$div, + _List_fromArray( + [ + $elm$html$Html$Attributes$class('pa2') + ]), + _List_fromArray( + [ + A2( + $elm$html$Html$label, + _List_fromArray( + [ + $elm$html$Html$Attributes$class('dib pa2') + ]), + _List_fromArray( + [ + A2( + $elm$html$Html$input, + _List_fromArray( + [ + $elm$html$Html$Attributes$type_('checkbox'), + $elm$html$Html$Attributes$checked(false), + $elm$html$Html$Attributes$disabled(false), + $elm$html$Html$Attributes$class('mr2') + ]), + _List_Nil), + $elm$html$Html$text(capture.am) + ])), + function () { + var _v0 = capture.be; + switch (_v0.$) { + case 0: return A2( $author$project$Pages$Capture$showTimerButton, - 'stop', - A2($author$project$Pages$Capture$StopTimer, t.idTimer, capture.idCapture)); - } - case 'Disabled': - return A2($author$project$Pages$Capture$showTimerButton, '...', $author$project$Pages$Capture$None); - case 'Completed': - return A2($author$project$Pages$Capture$showTimerButton, 'completed', $author$project$Pages$Capture$None); - default: - var e = _v0.a; - return A2($author$project$Pages$Capture$showTimerButton, e, $author$project$Pages$Capture$None); - } - }() - ])); -}; + 'start', + $author$project$Pages$Capture$StartTimer(capture.aL)); + case 2: + var timer = $author$project$Capture$getCurrentTimer(capture.bj); + if (timer.$ === 1) { + return A2($author$project$Pages$Capture$showTimerButton, 'Error Timer', $author$project$Pages$Capture$None); + } else { + var t = timer.a; + return A2( + $author$project$Pages$Capture$showTimerButton, + 'stop', + A2($author$project$Pages$Capture$StopTimer, t.bK, capture.aL)); + } + case 3: + return A2($author$project$Pages$Capture$showTimerButton, '...', $author$project$Pages$Capture$None); + case 1: + return A2($author$project$Pages$Capture$showTimerButton, 'completed', $author$project$Pages$Capture$None); + default: + var e = _v0.a; + return A2($author$project$Pages$Capture$showTimerButton, e, $author$project$Pages$Capture$None); + } + }(), + A3($author$project$Pages$Capture$showTime, capture.be, clock, capture.bj) + ])); + }); var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); var $author$project$Pages$Capture$view = function (model) { return { - content: _List_fromArray( + ay: _List_fromArray( [ A2( $elm$html$Html$a, @@ -8858,8 +9392,8 @@ var $author$project$Pages$Capture$view = function (model) { $elm$html$Html$text('Dwyl application') ])), function () { - var _v0 = model.session; - if (_v0.$ === 'Guest') { + var _v0 = model.R; + if (!_v0.$) { return A2( $elm$html$Html$a, _List_fromArray( @@ -8877,7 +9411,7 @@ var $author$project$Pages$Capture$view = function (model) { _List_Nil, _List_fromArray( [ - $elm$core$String$isEmpty(model.error) ? A2( + $elm$core$String$isEmpty(model.k) ? A2( $elm$html$Html$div, _List_Nil, _List_fromArray( @@ -8895,7 +9429,7 @@ var $author$project$Pages$Capture$view = function (model) { _List_fromArray( [ $elm$html$Html$Attributes$class('w-80 mr2'), - $elm$html$Html$Attributes$value(model.newCapture.text), + $elm$html$Html$Attributes$value(model.E.am), $elm$html$Html$Events$onInput($author$project$Pages$Capture$UpdateNewCapture) ]), _List_Nil), @@ -8920,9 +9454,9 @@ var $author$project$Pages$Capture$view = function (model) { A2( $elm$core$List$map, function (capture) { - return $author$project$Pages$Capture$showCapture(capture); + return A2($author$project$Pages$Capture$showCapture, model.H, capture); }, - model.captures)) + model.J)) ])) : A2( $elm$html$Html$p, _List_fromArray( @@ -8931,19 +9465,19 @@ var $author$project$Pages$Capture$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text(model.error) + $elm$html$Html$text(model.k) ])) ])); } }() ]), - title: 'Capture' + bk: 'Capture' }; }; var $elm$html$Html$span = _VirtualDom_node('span'); var $author$project$Pages$Home$view = function (model) { return { - content: _List_fromArray( + ay: _List_fromArray( [ A2( $elm$html$Html$a, @@ -8973,7 +9507,7 @@ var $author$project$Pages$Home$view = function (model) { $elm$html$Html$text('Dwyl application') ])), function () { - if (model.$ === 'Guest') { + if (!model.$) { return A2( $elm$html$Html$a, _List_fromArray( @@ -9001,7 +9535,7 @@ var $author$project$Pages$Home$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text('logged in with: ' + person.email) + $elm$html$Html$text('logged in with: ' + person.bC) ])), A2( $elm$html$Html$a, @@ -9029,12 +9563,12 @@ var $author$project$Pages$Home$view = function (model) { } }() ]), - title: 'Home' + bk: 'Home' }; }; var $author$project$Pages$Session$view = function (model) { return { - content: _List_fromArray( + ay: _List_fromArray( [ A2( $elm$html$Html$a, @@ -9053,7 +9587,7 @@ var $author$project$Pages$Session$view = function (model) { ]), _List_Nil) ])), - $elm$core$String$isEmpty(model.error) ? A2( + $elm$core$String$isEmpty(model.k) ? A2( $elm$html$Html$p, _List_fromArray( [ @@ -9070,35 +9604,35 @@ var $author$project$Pages$Session$view = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text(model.error) + $elm$html$Html$text(model.k) ])) ]), - title: 'Auth' + bk: 'Auth' }; }; var $author$project$Main$view = function (model) { switch (model.$) { - case 'Home': + case 0: var home = model.a; return A2( $author$project$Page$view, $author$project$Main$GotHomeMsg, $author$project$Pages$Home$view(home)); - case 'Auth': + case 1: var authModel = model.a; return A2( $author$project$Page$view, $author$project$Main$GotAuthMsg, $author$project$Pages$Auth$view(authModel)); - case 'Session': + case 2: var sessionModel = model.a; return A2( $author$project$Page$view, $author$project$Main$GotPagesSessionMsg, $author$project$Pages$Session$view(sessionModel)); - case 'NotFound': + case 3: return { - body: _List_fromArray( + au: _List_fromArray( [ A2( $elm$html$Html$a, @@ -9128,11 +9662,11 @@ var $author$project$Main$view = function (model) { $elm$html$Html$text('page not found') ])) ]), - title: 'Not Found' + bk: 'Not Found' }; - case 'Logout': + case 4: return { - body: _List_fromArray( + au: _List_fromArray( [ A2( $elm$html$Html$a, @@ -9162,7 +9696,7 @@ var $author$project$Main$view = function (model) { $elm$html$Html$text('Logout') ])) ]), - title: 'Logout' + bk: 'Logout' }; default: var captureModel = model.a; @@ -9173,7 +9707,7 @@ var $author$project$Main$view = function (model) { } }; var $author$project$Main$main = $elm$browser$Browser$application( - {init: $author$project$Main$init, onUrlChange: $author$project$Main$UrlChanged, onUrlRequest: $author$project$Main$LinkClicked, subscriptions: $author$project$Main$subscriptions, update: $author$project$Main$update, view: $author$project$Main$view}); + {bM: $author$project$Main$init, bY: $author$project$Main$UrlChanged, bZ: $author$project$Main$LinkClicked, b8: $author$project$Main$subscriptions, cb: $author$project$Main$update, cc: $author$project$Main$view}); _Platform_export({'Main':{'init':$author$project$Main$main( $elm$json$Json$Decode$oneOf( _List_fromArray( diff --git a/src/Capture.elm b/src/Capture.elm index badd1d5..d773d23 100644 --- a/src/Capture.elm +++ b/src/Capture.elm @@ -92,6 +92,11 @@ captureEncode capture = As the API returns the list of timer in descending order from when they were created, the current timer is the head of the list of timers -} -getTimer : Capture -> Maybe Timer -getTimer capture = - List.head capture.timers +getCurrentTimer : List Timer -> Maybe Timer +getCurrentTimer timers = + List.head timers + + +getPreviousTimer : List Timer -> Maybe (List Timer) +getPreviousTimer timers = + List.tail timers diff --git a/src/Pages/Capture.elm b/src/Pages/Capture.elm index 1aef37b..c127bb6 100644 --- a/src/Pages/Capture.elm +++ b/src/Pages/Capture.elm @@ -10,6 +10,8 @@ import Http import Page import Route import Session exposing (..) +import Task +import Time import Timer exposing (..) @@ -21,13 +23,38 @@ type alias Model = { session : Session , captures : List Capture , newCapture : Capture + , timer : Clock , error : String } +type alias Clock = + { zone : Time.Zone + , posix : Time.Posix + } + + +initModel : Session -> Model +initModel session = + { session = session + , captures = [] + , newCapture = initCapture + , timer = + { zone = Time.utc + , posix = Time.millisToPosix 0 + } + , error = "" + } + + init : Session -> ( Model, Cmd Msg ) init session = - ( Model session [] initCapture "", getCaptures (token session) ) + ( initModel session + , Cmd.batch + [ getCaptures (token session) + , Task.perform AdjustTimeZone Time.here + ] + ) @@ -44,6 +71,8 @@ type Msg | StopTimer Int Int | TimerUpdated CaptureStatus (Result Http.Error Timer) | None + | AdjustTimeZone Time.Zone + | Tick Time.Posix update : Msg -> Model -> ( Model, Cmd Msg ) @@ -52,6 +81,26 @@ update msg model = None -> ( model, Cmd.none ) + AdjustTimeZone zone -> + let + timer = + model.timer + + newTimer = + { timer | zone = zone } + in + ( { model | timer = newTimer }, Cmd.none ) + + Tick posix -> + let + timer = + model.timer + + newTimer = + { timer | posix = posix } + in + ( { model | timer = newTimer }, Cmd.none ) + GotSession session -> ( { model | session = session } , Route.replaceUrl (Session.navKey model.session) Route.Home @@ -60,10 +109,6 @@ update msg model = GotCaptures result -> case result of Ok captures -> - let - _ = - Debug.log "captures" captures - in ( { model | captures = captures, error = "" }, Cmd.none ) Err httpError -> @@ -117,7 +162,7 @@ update msg model = StopTimer idTimer idCapture -> ( model, stopTimer (token model.session) idTimer idCapture ) - TimerUpdated _ result -> + TimerUpdated s result -> case result of Ok _ -> ( { model | error = "" }, getCaptures (token model.session) ) @@ -144,6 +189,8 @@ view model = , content = [ a [ Route.href Route.Home ] [ img [ Asset.src Asset.logo, class "center db pt2" ] [] ] , h1 [ class "tc" ] [ text "Dwyl application" ] + + -- , showTime model.timer , case model.session of Session.Guest _ -> a [ Route.href Route.Home, class "tc db" ] [ text "Not logged in yet!" ] @@ -156,7 +203,7 @@ view model = [ input [ class "w-80 mr2", value model.newCapture.text, onInput UpdateNewCapture ] [] , button [ class "pointer", onClick AddCapture ] [ text "Add Capture" ] ] - , div [ class "w-50 center" ] <| List.map (\capture -> showCapture capture) model.captures + , div [ class "w-50 center" ] <| List.map (\capture -> showCapture model.timer capture) model.captures ] else @@ -173,7 +220,10 @@ toSession model = subscriptions : Model -> Sub Msg subscriptions model = - Session.changeSession GotSession (Session.navKey model.session) + Sub.batch + [ Time.every 1000 Tick + , Session.changeSession GotSession (Session.navKey model.session) + ] @@ -206,8 +256,8 @@ stopTimer token idTimer idCapture = } -showCapture : Capture -> Html Msg -showCapture capture = +showCapture : Clock -> Capture -> Html Msg +showCapture clock capture = div [ class "pa2" ] [ label [ class "dib pa2" ] @@ -221,7 +271,7 @@ showCapture capture = InProgress -> let timer = - getTimer capture + getCurrentTimer capture.timers in case timer of Nothing -> @@ -238,6 +288,7 @@ showCapture capture = Error e -> showTimerButton e None + , showTime capture.status clock capture.timers ] @@ -252,6 +303,50 @@ showTimerButton textButton msg = [ text textButton ] +showTime : CaptureStatus -> Clock -> List Timer -> Html Msg +showTime status clock timers = + case status of + InProgress -> + let + maybeStartedAtMillis = + Maybe.map (\t -> Time.posixToMillis t.startedAt) (getCurrentTimer timers) + + nowToMillis = + Time.posixToMillis clock.posix + + maybeNowMillis = + Maybe.map ((-) nowToMillis) maybeStartedAtMillis + + maybePreviousTimersMillis = + getPreviousTimer timers + |> Maybe.andThen timersToMillis + + allTimes = + Maybe.map2 (+) maybeNowMillis maybePreviousTimersMillis + + ( hour, minute, second ) = + case allTimes of + Nothing -> + ( "", "", "" ) + + Just t -> + millisToHMS t + in + p [ class "tc" ] [ text (hour ++ ":" ++ minute ++ ":" ++ second) ] + + _ -> + let + ( hour, minute, second ) = + case timersToMillis timers of + Nothing -> + ( "", "", "" ) + + Just t -> + millisToHMS t + in + p [ class "tc" ] [ text (hour ++ ":" ++ minute ++ ":" ++ second) ] + + getCaptures : String -> Cmd Msg getCaptures token = Http.request diff --git a/src/Timer.elm b/src/Timer.elm index ad48e26..eb80ebe 100644 --- a/src/Timer.elm +++ b/src/Timer.elm @@ -1,9 +1,10 @@ -module Timer exposing (Timer, actionTimerEncode, timerDataDecoder, timerDecoder) +module Timer exposing (Timer, actionTimerEncode, millisToHMS, timerDataDecoder, timerDecoder, timerToMillis, timersToMillis) +import Iso8601 import Json.Decode as JD import Json.Encode as JE import Time -import Iso8601 + type alias Timer = { idTimer : Int @@ -31,3 +32,62 @@ actionTimerEncode : String -> JD.Value actionTimerEncode action = JE.object [ ( "action", JE.string action ) ] + + + +{- Calculate number of millisecond between startedAt and stoppedAt + The returned value is of type Maybe. + Nothing is returned if the stoppedAt value is not defined yet, ie Nothing. +-} + +startedAtToMillis : Timer -> Int +startedAtToMillis timer = + Time.posixToMillis timer.startedAt + +timerToMillis : Timer -> Maybe Int +timerToMillis timer = + Maybe.map2 + (\p1 p2 -> Time.posixToMillis p1 - Time.posixToMillis p2) + timer.stoppedAt + (Just timer.startedAt) + + + +{- Sum all the timers in milliseconds. + Returns Nothing if one of the timer is still running + otherwise Just the timing +-} + + +timersToMillis : List Timer -> Maybe Int +timersToMillis timers = + let + millis = + List.map timerToMillis timers + in + List.foldl (\a b -> Maybe.map2 (+) a b) (Just 0) millis + +millisToHMS : Int -> ( String, String, String ) +millisToHMS millis = + let + hour = + formatTime <| modBy 24 (millis // (1000 * 60 * 60)) + + minute = + formatTime <| modBy 60 (millis // (1000 * 60)) + + second = + formatTime <| modBy 60 (millis // 1000) + in + ( hour, minute, second ) + + + +{- Format an integer to a string by prepending '0' + if the string length < 2 +-} + + +formatTime : Int -> String +formatTime = + String.padLeft 2 '0' << String.fromInt From eeb34828bd9e7882c10f10d9e0bc1c6d71af8bf0 Mon Sep 17 00:00:00 2001 From: SimonLab Date: Fri, 20 Mar 2020 12:03:23 +0000 Subject: [PATCH 5/7] format elm files --- src/Capture.elm | 2 +- src/Timer.elm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Capture.elm b/src/Capture.elm index d773d23..e272537 100644 --- a/src/Capture.elm +++ b/src/Capture.elm @@ -1,4 +1,4 @@ -module Capture exposing (..) +module Capture exposing (Capture, CaptureStatus(..), captureDecoder, captureEncode, captureStatusDecoder, capturesDecoder, completedToStatusDecoder, getCurrentTimer, getPreviousTimer, initCapture, savedCaptureDecoder, timersToStatusDecoder) import Json.Decode as JD import Json.Encode as JE diff --git a/src/Timer.elm b/src/Timer.elm index eb80ebe..4e4e647 100644 --- a/src/Timer.elm +++ b/src/Timer.elm @@ -40,10 +40,12 @@ actionTimerEncode action = Nothing is returned if the stoppedAt value is not defined yet, ie Nothing. -} + startedAtToMillis : Timer -> Int startedAtToMillis timer = Time.posixToMillis timer.startedAt + timerToMillis : Timer -> Maybe Int timerToMillis timer = Maybe.map2 @@ -67,6 +69,7 @@ timersToMillis timers = in List.foldl (\a b -> Maybe.map2 (+) a b) (Just 0) millis + millisToHMS : Int -> ( String, String, String ) millisToHMS millis = let From e9ef95e558880a026bea25725b4848334df21e1e Mon Sep 17 00:00:00 2001 From: SimonLab Date: Fri, 20 Mar 2020 12:09:04 +0000 Subject: [PATCH 6/7] use heroku api endpoint --- elm.js | 2 +- src/Endpoint.elm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elm.js b/elm.js index 7a9702c..f42f7a3 100644 --- a/elm.js +++ b/elm.js @@ -6463,7 +6463,7 @@ var $elm$url$Url$Builder$crossOrigin = F3( }); var $author$project$Endpoint$url = F2( function (path, queryParams) { - return A3($elm$url$Url$Builder$crossOrigin, 'http://localhost:4000', path, queryParams); + return A3($elm$url$Url$Builder$crossOrigin, 'https://dwyl-app-api.herokuapp.com', path, queryParams); }); var $author$project$Endpoint$authUrls = A2( $author$project$Endpoint$url, diff --git a/src/Endpoint.elm b/src/Endpoint.elm index 79814c3..b008b32 100644 --- a/src/Endpoint.elm +++ b/src/Endpoint.elm @@ -20,7 +20,7 @@ url : List String -> List QueryParameter -> Endpoint url path queryParams = -- "https://dwyl-app-api.herokuapp.com" -- "http://localhost:4000" - Url.Builder.crossOrigin "http://localhost:4000" path queryParams + Url.Builder.crossOrigin "https://dwyl-app-api.herokuapp.com" path queryParams |> Endpoint From 872edac77b4f1dfc582844b92bb45a1ce4f42beb Mon Sep 17 00:00:00 2001 From: SimonLab Date: Fri, 20 Mar 2020 12:10:34 +0000 Subject: [PATCH 7/7] remove unused function --- src/Timer.elm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Timer.elm b/src/Timer.elm index 4e4e647..ece5845 100644 --- a/src/Timer.elm +++ b/src/Timer.elm @@ -41,11 +41,6 @@ actionTimerEncode action = -} -startedAtToMillis : Timer -> Int -startedAtToMillis timer = - Time.posixToMillis timer.startedAt - - timerToMillis : Timer -> Maybe Int timerToMillis timer = Maybe.map2