diff --git a/ui/build/index.html b/ui/build/index.html index 47c6a6c..09e9988 100644 --- a/ui/build/index.html +++ b/ui/build/index.html @@ -1 +1 @@ -Inbucket
\ No newline at end of file +Inbucket
\ No newline at end of file diff --git a/ui/build/service-worker.js b/ui/build/service-worker.js index 480d2a9..62e8dba 100644 --- a/ui/build/service-worker.js +++ b/ui/build/service-worker.js @@ -1 +1 @@ -"use strict";var precacheConfig=[["/index.html","3beb8060f28c17789ca66e2c6616160f"],["/static/css/main.8d438738.css","8d438738f900913d8f787dc7ef9b05f9"],["/static/js/main.d6280c5d.js","55b008360cb9147787b0a8ed62c0783d"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(n=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}}); \ No newline at end of file +"use strict";var precacheConfig=[["/index.html","ed9e929e14fae109b0cd008ba5adb822"],["/static/css/main.8d438738.css","8d438738f900913d8f787dc7ef9b05f9"],["/static/js/main.04b41a91.js","c9dc7ec55e7e303354fc7423a2afaa38"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(n=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}}); \ No newline at end of file diff --git a/ui/build/static/js/main.04b41a91.js b/ui/build/static/js/main.04b41a91.js new file mode 100644 index 0000000..bf6e81c --- /dev/null +++ b/ui/build/static/js/main.04b41a91.js @@ -0,0 +1 @@ +!function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var e={};r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="/",r(r.s=0)}([function(t,r,e){t.exports=e(1)},function(t,r,e){"use strict";function n(){var t=localStorage.session;try{if(t)return JSON.parse(t)}catch(t){console.error(t)}return null}Object.defineProperty(r,"__esModule",{value:!0});var o=e(2),c=(e.n(o),e(3)),u=(e.n(c),e(4)),i=e(5),a=c.Main.embed(document.getElementById("root"),n());Object(i.a)(a),a.ports.storeSession.subscribe(function(t){localStorage.session=JSON.stringify(t)}),window.addEventListener("storage",function(t){t.storageArea===localStorage&&"session"===t.key&&a.ports.onSessionChange.send(n())},!1),a.ports.windowTitle.subscribe(function(t){document.title=t}),Object(u.a)()},function(t,r){},function(t,r){(function(){"use strict";function r(t){function r(r){return function(e){return t(r,e)}}return r.arity=2,r.func=t,r}function e(t){function r(r){return function(e){return function(n){return t(r,e,n)}}}return r.arity=3,r.func=t,r}function n(t){function r(r){return function(e){return function(n){return function(o){return t(r,e,n,o)}}}}return r.arity=4,r.func=t,r}function o(t){function r(r){return function(e){return function(n){return function(o){return function(c){return t(r,e,n,o,c)}}}}}return r.arity=5,r.func=t,r}function c(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return t(r,e,n,o,c,u)}}}}}}return r.arity=6,r.func=t,r}function u(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return t(r,e,n,o,c,u,i)}}}}}}}return r.arity=7,r.func=t,r}function i(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return t(r,e,n,o,c,u,i,a)}}}}}}}}return r.arity=8,r.func=t,r}function a(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return t(r,e,n,o,c,u,i,a,_)}}}}}}}}}return r.arity=9,r.func=t,r}function _(t,r,e){return 2===t.arity?t.func(r,e):t(r)(e)}function s(t,r,e,n){return 3===t.arity?t.func(r,e,n):t(r)(e)(n)}function l(t,r,e,n,o){return 4===t.arity?t.func(r,e,n,o):t(r)(e)(n)(o)}function f(t,r,e,n,o,c){return 5===t.arity?t.func(r,e,n,o,c):t(r)(e)(n)(o)(c)}function d(t,r,e,n,o,c,u){return 6===t.arity?t.func(r,e,n,o,c,u):t(r)(e)(n)(o)(c)(u)}var p=function(){function t(t,r){if(t<0||t>=F(r))throw new Error("Index "+t+" is out of range. Check the length of your array first or use getMaybe or getWithDefault.");return n(t,r)}function n(t,r){for(var e=r.height;e>0;e--){for(var n=t>>5*e;r.lengths[n]<=t;)n++;n>0&&(t-=r.lengths[n-1]),r=r.table[n]}return r.table[t]}function o(t,r,e){return t<0||F(e)<=t?e:c(t,r,e)}function c(t,r,e){if(e=P(e),0===e.height)e.table[t]=r;else{var n=I(t,e);n>0&&(t-=e.lengths[n-1]),e.table[n]=c(t,r,e.table[n])}return e}function u(t,r){return t<=0?Y:i(r,Math.floor(Math.log(t)/Math.log(V)),0,t)}function i(t,r,e,n){if(0===r){for(var o=new Array((n-e)%(V+1)),c=0;c0?a[c-1]:0);return{ctor:"_Array",height:r,table:o,lengths:a}}function a(t){if("[]"===t.ctor)return Y;for(var r=new Array(V),e=[],n=0;"[]"!==t.ctor;)if(r[n]=t._0,t=t._1,++n===V){var o={ctor:"_Array",height:0,table:r};s(o,e),r=new Array(V),n=0}if(n>0){var o={ctor:"_Array",height:0,table:r.splice(0,n)};s(o,e)}for(var c=0;c0&&s(e[c],e);var u=e[e.length-1];return u.height>0&&1===u.table.length?u.table[0]:u}function s(t,r){var e=t.height;if(r.length===e){var n={ctor:"_Array",height:e+1,table:[],lengths:[]};r.push(n)}r[e].table.push(t);var o=F(t);r[e].lengths.length>0&&(o+=r[e].lengths[r[e].lengths.length-1]),r[e].lengths.push(o),r[e].table.length===V&&(s(r[e],r),r[e]={ctor:"_Array",height:e+1,table:[],lengths:[]})}function l(t,r){var e=f(t,r);return null!==e?e:j(r,H(t,r.height))}function f(t,r){if(0===r.height){if(r.table.length=0;e--)t=0===r.height?D.Cons(r.table[e],t):p(t,r.table[e]);return t}function h(t,r){var e={ctor:"_Array",height:r.height,table:new Array(r.table.length)};r.height>0&&(e.lengths=r.lengths);for(var n=0;n0&&(n.lengths=r.lengths);for(var o=0;o0?r.lengths[n-1]:0),r.table[n]);if(0===n)return o;var e={ctor:"_Array",height:r.height,table:r.table.slice(0,n),lengths:r.lengths.slice(0,n)};return o.table.length>0&&(e.table[n]=o,e.lengths[n]=F(o)+(n>0?e.lengths[n-1]:0)),e}function T(t,r){if(0===t)return r;if(0===r.height){var e={ctor:"_Array",height:0};return e.table=r.table.slice(t,r.table.length+1),e}var n=I(t,r),o=T(t-(n>0?r.lengths[n-1]:0),r.table[n]);if(n===r.table.length-1)return o;var e={ctor:"_Array",height:r.height,table:r.table.slice(n,r.table.length+1),lengths:new Array(r.table.length-n)};e.table[0]=o;for(var c=0,u=0;u0){for(var n=F(e[0]),o=0;o0){var c=N(t,r);c>G&&(e=A(e[0],e[1],c))}return j(e[0],e[1])}function x(t,r){if(0===t.height&&0===r.height)return[t,r];if(1!==t.height||1!==r.height)if(t.height===r.height){t=P(t),r=P(r);var e=x(O(t),L(r));M(t,e[1]),S(r,e[0])}else if(t.height>r.height){t=P(t);var e=x(O(t),r);M(t,e[0]),r=z(e[1],e[1].height+1)}else{r=P(r);var e=x(t,L(r)),n=0===e[0].table.length?0:1,o=0===n?1:0;S(r,e[n]),t=z(e[o],e[o].height+1)}if(0===t.table.length||0===r.table.length)return[t,r];var c=N(t,r);return c<=G?[t,r]:A(t,r,c)}function M(t,r){var e=t.table.length-1;t.table[e]=r,t.lengths[e]=F(r),t.lengths[e]+=e>0?t.lengths[e-1]:0}function S(t,r){if(r.table.length>0){t.table[0]=r,t.lengths[0]=F(r);for(var e=F(t.table[0]),n=1;n0&&(e.lengths=new Array(r)),e}function A(t,r,e){for(var n=C(t.height,Math.min(V,t.table.length+r.table.length-e)),o=C(t.height,n.table.length-(t.table.length+r.table.length-e)),c=0;B(t.table,r.table,c).table.length%V==0;)R(n.table,o.table,c,B(t.table,r.table,c)),R(n.lengths,o.lengths,c,B(t.lengths,r.lengths,c)),c++;for(var u=c,i=new C(t.height-1,0),a=0;c-u-(i.table.length>0?1:0)0)for(var l=i.lengths.length,f=l;f0?i.lengths[f-1]:0;a+=s,_.table.length<=s&&(c++,a=0),i.table.length===V&&(E(n,o,u,i),i=C(t.height-1,0),u++)}for(i.table.length>0&&(E(n,o,u,i),u++);c0&&(r.lengths=t.lengths.slice()),r}function F(t){return 0===t.height?t.table.length:t.lengths[t.lengths.length-1]}function I(t,r){for(var e=t>>5*r.height;r.lengths[e]<=t;)e++;return e}function H(t,r){return 0===r?{ctor:"_Array",height:0,table:[t]}:{ctor:"_Array",height:r,table:[H(t,r-1)],lengths:[1]}}function z(t,r){return r===t.height?t:{ctor:"_Array",height:r,table:[z(t,r-1)],lengths:[F(t)]}}function j(t,r){return{ctor:"_Array",height:t.height+1,table:[t,r],lengths:[F(t),F(t)+F(r)]}}function U(t){var r=new Array(F(t));return W(r,0,t),r}function W(t,r,e){for(var n=0;n0?u[i-1]:0);return{ctor:"_Array",height:r,table:c,lengths:u}}var V=32,G=2,Y={ctor:"_Array",height:0,table:[]};return{empty:Y,fromList:a,toList:d,initialize:r(u),append:r(w),push:r(l),slice:e(y),get:r(t),set:e(o),map:r(h),indexedMap:r(v),foldl:e(g),foldr:e(b),length:F,toJSArray:U,fromJSArray:q}}(),h=function(){function t(t,r){return t/r|0}function n(t,r){return t%r}function o(t,r){if(0===r)throw new Error("Cannot perform mod 0. Division by zero error.");var e=t%r,n=0===t?0:r>0?t>=0?e:e+r:-o(-t,-r);return n===r?0:n}function c(t,r){return Math.log(r)/Math.log(t)}function u(t){return-t}function i(t){return t<0?-t:t}function a(t,r){return v.cmp(t,r)<0?t:r}function _(t,r){return v.cmp(t,r)>0?t:r}function s(t,r,e){return v.cmp(e,t)<0?t:v.cmp(e,r)>0?r:e}function l(t,r){return{ctor:k[v.cmp(t,r)+1]}}function f(t,r){return t!==r}function d(t){return!t}function p(t){return t===1/0||t===-1/0}function h(t){return 0|t}function m(t){return t*Math.PI/180}function g(t){return 2*Math.PI*t}function b(t){var r=t._0,e=t._1;return v.Tuple2(r*Math.cos(e),r*Math.sin(e))}function y(t){var r=t._0,e=t._1;return v.Tuple2(Math.sqrt(r*r+e*e),Math.atan2(e,r))}var k=["LT","EQ","GT"];return{div:r(t),rem:r(n),mod:r(o),pi:Math.PI,e:Math.E,cos:Math.cos,sin:Math.sin,tan:Math.tan,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:r(Math.atan2),degrees:m,turns:g,fromPolar:b,toPolar:y,sqrt:Math.sqrt,logBase:r(c),negate:u,abs:i,min:r(a),max:r(_),clamp:e(s),compare:r(l),xor:r(f),not:d,truncate:h,ceiling:Math.ceil,floor:Math.floor,round:Math.round,toFloat:function(t){return t},isNaN:isNaN,isInfinite:p}}(),v=function(){function t(t,r){for(var n,o=[],c=e(t,r,0,o);c&&(n=o.pop());)c=e(n.x,n.y,0,o);return c}function e(t,r,n,o){if(n>100)return o.push({x:t,y:r}),!0;if(t===r)return!0;if("object"!=typeof t){if("function"==typeof t)throw new Error('Trying to use `(==)` on functions. There is no way to know if functions are "the same" in the Elm sense. Read more about this at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#== which describes why it is this way and what the better version will look like.');return!1}if(null===t||null===r)return!1;if(t instanceof Date)return t.getTime()===r.getTime();if(!("ctor"in t)){for(var c in t)if(!e(t[c],r[c],n+1,o))return!1;return!0}if("RBNode_elm_builtin"!==t.ctor&&"RBEmpty_elm_builtin"!==t.ctor||(t=$t(t),r=$t(r)),"Set_elm_builtin"===t.ctor&&(t=_elm_lang$core$Set$toList(t),r=_elm_lang$core$Set$toList(r)),"::"===t.ctor){for(var u=t,i=r;"::"===u.ctor&&"::"===i.ctor;){if(!e(u._0,i._0,n+1,o))return!1;u=u._1,i=i._1}return u.ctor===i.ctor}if("_Array"===t.ctor){var a=p.toJSArray(t),_=p.toJSArray(r);if(a.length!==_.length)return!1;for(var s=0;s=1){if((c=n(t._0,r._0))!==m)return c;if(u>=2){if((c=n(t._1,r._1))!==m)return c;if(u>=3){if((c=n(t._2,r._2))!==m)return c;if(u>=4){if((c=n(t._3,r._3))!==m)return c;if(u>=5){if((c=n(t._4,r._4))!==m)return c;if(u>=6){if((c=n(t._5,r._5))!==m)return c;if(u>=7)throw new Error("Comparison error: cannot compare tuples with more than 6 elements.")}}}}}}return m}throw new Error("Comparison error: comparison is only defined on ints, floats, times, chars, strings, lists of comparable values, and tuples of comparable values.")}function o(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}function c(t){return new String(t)}function u(t){return y++}function i(t,r){var e={};for(var n in t)e[n]=t[n];for(var n in r)e[n]=r[n];return e}function a(t,r){return{ctor:"::",_0:t,_1:r}}function _(t,r){if("string"==typeof t)return t+r;if("[]"===t.ctor)return r;var e=a(t._0,k),n=e;for(t=t._1;"[]"!==t.ctor;)n._1=a(t._0,k),t=t._1,n=n._1;return n._1=r,e}function s(t,r){return function(e){throw new Error("Ran into a `Debug.crash` in module `"+t+"` "+f(r)+"\nThe message provided by the code author is:\n\n "+e)}}function l(t,r,e){return function(n){throw new Error("Ran into a `Debug.crash` in module `"+t+"`\n\nThis was caused by the `case` expression "+f(r)+".\nOne of the branches ended with a crash and the following value got through:\n\n "+d(e)+"\n\nThe message provided by the code author is:\n\n "+n)}}function f(t){return t.start.line==t.end.line?"on line "+t.start.line:"between lines "+t.start.line+" and "+t.end.line}function d(t){var r=typeof t;if("function"===r)return"";if("boolean"===r)return t?"True":"False";if("number"===r)return t+"";if(t instanceof String)return"'"+h(t,!0)+"'";if("string"===r)return'"'+h(t,!1)+'"';if(null===t)return"null";if("object"===r&&"ctor"in t){var e=t.ctor.substring(0,5);if("_Tupl"===e){var n=[];for(var o in t)"ctor"!==o&&n.push(d(t[o]));return"("+n.join(",")+")"}if("_Task"===e)return"";if("_Array"===t.ctor){return"Array.fromList "+d(lt(t))}if(""===t.ctor)return"";if("_Process"===t.ctor)return"";if("::"===t.ctor){var n="["+d(t._0);for(t=t._1;"::"===t.ctor;)n+=","+d(t._0),t=t._1;return n+"]"}if("[]"===t.ctor)return"[]";if("Set_elm_builtin"===t.ctor)return"Set.fromList "+d(_elm_lang$core$Set$toList(t));if("RBNode_elm_builtin"===t.ctor||"RBEmpty_elm_builtin"===t.ctor)return"Dict.fromList "+d($t(t));var n="";for(var c in t)if("ctor"!==c){var u=d(t[c]),i=u[0],a="{"===i||"("===i||"<"===i||'"'===i||u.indexOf(" ")<0;n+=" "+(a?u:"("+u+")")}return t.ctor+n}if("object"===r){if(t instanceof Date)return"<"+t.toString()+">";if(t.elm_web_socket)return"";var n=[];for(var o in t)n.push(o+" = "+d(t[o]));return 0===n.length?"{}":"{ "+n.join(", ")+" }"}return""}function h(t,r){var e=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return r?e.replace(/\'/g,"\\'"):e.replace(/\"/g,'\\"')}var v=-1,m=0,g=1,b={ctor:"_Tuple0"},y=0,k={ctor:"[]"};return{eq:t,cmp:n,Tuple0:b,Tuple2:o,chr:c,update:i,guid:u,append:r(_),crash:s,crashCase:l,toString:d}}(),m=(r(function(t,r){var e=r;return _(t,e._0,e._1)}),e(function(t,r,e){return t({ctor:"_Tuple2",_0:r,_1:e})}),e(function(t,r,e){return _(t,e,r)}),r(function(t,r){return t})),g=function(t){return t},b=b||{};b["<|"]=r(function(t,r){return t(r)});var b=b||{};b["|>"]=r(function(t,r){return r(t)});var b=b||{};b[">>"]=e(function(t,r,e){return r(t(e))});var b=b||{};b["<<"]=e(function(t,r,e){return t(r(e))});var b=b||{};b["++"]=v.append;var y=v.toString,k=h.isInfinite,T=h.isNaN,w=h.toFloat,x=(h.ceiling,h.floor),b=(h.truncate,h.round,h.not,h.xor,b||{});b["||"]=h.or;var b=b||{};b["&&"]=h.and;var M=h.max,S=h.min,N=h.compare,b=b||{};b[">="]=h.ge;var b=b||{};b["<="]=h.le;var b=b||{};b[">"]=h.gt;var b=b||{};b["<"]=h.lt;var b=b||{};b["/="]=h.neq;var b=b||{};b["=="]=h.eq;var B=(h.e,h.pi,h.clamp,h.logBase,h.abs),R=h.negate,b=(h.sqrt,h.atan2,h.atan,h.asin,h.acos,h.tan,h.sin,h.cos,b||{});b["^"]=h.exp;var b=b||{};b["%"]=h.mod;var b=(h.rem,b||{});b["//"]=h.div;var b=b||{};b["/"]=h.floatDiv;var b=b||{};b["*"]=h.mul;var b=b||{};b["-"]=h.sub;var b=b||{};b["+"]=h.add;var E=(h.toPolar,h.fromPolar,h.turns,h.degrees,r(function(t,r){var e=r;return"Just"===e.ctor?e._0:t})),C={ctor:"Nothing"},A=(r(function(t,r){var e=r;return"Just"===e.ctor?t(e._0):C}),function(t){return{ctor:"Just",_0:t}}),O=r(function(t,r){var e=r;return"Just"===e.ctor?A(t(e._0)):C}),L=e(function(t,r,e){var n={ctor:"_Tuple2",_0:r,_1:e};return"_Tuple2"===n.ctor&&"Just"===n._0.ctor&&"Just"===n._1.ctor?A(_(t,n._0._0,n._1._0)):C}),D=(n(function(t,r,e,n){var o={ctor:"_Tuple3",_0:r,_1:e,_2:n};return"_Tuple3"===o.ctor&&"Just"===o._0.ctor&&"Just"===o._1.ctor&&"Just"===o._2.ctor?A(s(t,o._0._0,o._1._0,o._2._0)):C}),o(function(t,r,e,n,o){var c={ctor:"_Tuple4",_0:r,_1:e,_2:n,_3:o};return"_Tuple4"===c.ctor&&"Just"===c._0.ctor&&"Just"===c._1.ctor&&"Just"===c._2.ctor&&"Just"===c._3.ctor?A(l(t,c._0._0,c._1._0,c._2._0,c._3._0)):C}),c(function(t,r,e,n,o,c){var u={ctor:"_Tuple5",_0:r,_1:e,_2:n,_3:o,_4:c};return"_Tuple5"===u.ctor&&"Just"===u._0.ctor&&"Just"===u._1.ctor&&"Just"===u._2.ctor&&"Just"===u._3.ctor&&"Just"===u._4.ctor?A(f(t,u._0._0,u._1._0,u._2._0,u._3._0,u._4._0)):C}),function(){function t(t,r){return{ctor:"::",_0:t,_1:r}}function u(r){for(var e=y,n=r.length;n--;)e=t(r[n],e);return e}function i(t){for(var r=[];"[]"!==t.ctor;)r.push(t._0),t=t._1;return r}function a(t,r,e){for(var n=i(e),o=r,c=n.length;c--;)o=_(t,n[c],o);return o}function d(t,r,e){for(var n=[];"[]"!==r.ctor&&"[]"!==e.ctor;)n.push(_(t,r._0,e._0)),r=r._1,e=e._1;return u(n)}function p(t,r,e,n){for(var o=[];"[]"!==r.ctor&&"[]"!==e.ctor&&"[]"!==n.ctor;)o.push(s(t,r._0,e._0,n._0)),r=r._1,e=e._1,n=n._1;return u(o)}function h(t,r,e,n,o){for(var c=[];"[]"!==r.ctor&&"[]"!==e.ctor&&"[]"!==n.ctor&&"[]"!==o.ctor;)c.push(l(t,r._0,e._0,n._0,o._0)),r=r._1,e=e._1,n=n._1,o=o._1;return u(c)}function m(t,r,e,n,o,c){for(var i=[];"[]"!==r.ctor&&"[]"!==e.ctor&&"[]"!==n.ctor&&"[]"!==o.ctor&&"[]"!==c.ctor;)i.push(f(t,r._0,e._0,n._0,o._0,c._0)),r=r._1,e=e._1,n=n._1,o=o._1,c=c._1;return u(i)}function g(t,r){return u(i(r).sort(function(r,e){return v.cmp(t(r),t(e))}))}function b(t,r){return u(i(r).sort(function(r,e){var n=t(r)(e).ctor;return"EQ"===n?0:"LT"===n?-1:1}))}var y={ctor:"[]"};return{Nil:y,Cons:t,cons:r(t),toArray:i,fromArray:u,foldr:e(a),map2:e(d),map3:n(p),map4:o(h),map5:c(m),sortBy:r(g),sortWith:r(b)}}()),P=(D.sortWith,D.sortBy,r(function(t,r){for(;;){if(v.cmp(t,0)<1)return r;var e=r;if("[]"===e.ctor)return r;var n=t-1,o=e._1;t=n,r=o}}),D.map5,D.map4,D.map3,D.map2),F=r(function(t,r){for(;;){var e=r;if("[]"===e.ctor)return!1;if(t(e._0))return!0;var n=t,o=e._1;t=n,r=o}}),I=(r(function(t,r){return!_(F,function(r){return!t(r)},r)}),D.foldr),H=e(function(t,r,e){for(;;){var n=e;if("[]"===n.ctor)return r;var o=t,c=_(t,n._0,r),u=n._1;t=o,r=c,e=u}}),z=function(t){return s(H,r(function(t,r){return r+1}),0,t)},j=function(t){return s(H,r(function(t,r){return t+r}),0,t)},U=(r(function(t,r){return _(F,function(r){return v.eq(r,t)},r)}),function(t){return"[]"===t.ctor}),W=function(t){var r=t;return"::"===r.ctor?A(r._1):C},q=function(t){var r=t;return"::"===r.ctor?A(r._0):C},J=J||{};J["::"]=D.cons;var V=r(function(t,e){return s(I,r(function(r,e){return{ctor:"::",_0:t(r),_1:e}}),{ctor:"[]"},e)}),G=r(function(t,e){var n=r(function(r,e){return t(r)?{ctor:"::",_0:r,_1:e}:e});return s(I,n,{ctor:"[]"},e)}),Y=e(function(t,r,e){var n=t(r);return"Just"===n.ctor?{ctor:"::",_0:n._0,_1:e}:e}),Q=r(function(t,r){return s(I,Y(t),{ctor:"[]"},r)}),$=function(t){return s(H,r(function(t,r){return{ctor:"::",_0:t,_1:r}}),{ctor:"[]"},t)},K=(e(function(t,e,n){var o=r(function(r,e){var n=e;return"::"===n.ctor?{ctor:"::",_0:_(t,r,n._0),_1:e}:{ctor:"[]"}});return $(s(H,o,{ctor:"::",_0:e,_1:{ctor:"[]"}},n))}),r(function(t,e){return"[]"===e.ctor?t:s(I,r(function(t,r){return{ctor:"::",_0:t,_1:r}}),e,t)})),X=function(t){return s(I,K,{ctor:"[]"},t)},Z=r(function(t,r){return X(_(V,t,r))}),tt=(r(function(t,e){var n=r(function(r,e){var n=e,o=n._0,c=n._1;return t(r)?{ctor:"_Tuple2",_0:{ctor:"::",_0:r,_1:o},_1:c}:{ctor:"_Tuple2",_0:o,_1:{ctor:"::",_0:r,_1:c}}});return s(I,n,{ctor:"_Tuple2",_0:{ctor:"[]"},_1:{ctor:"[]"}},e)}),r(function(t,e){var n=e;if("[]"===n.ctor)return{ctor:"[]"};var o=r(function(r,e){return{ctor:"::",_0:t,_1:{ctor:"::",_0:r,_1:e}}}),c=s(I,o,{ctor:"[]"},n._1);return{ctor:"::",_0:n._0,_1:c}}),e(function(t,r,e){for(;;){if(v.cmp(t,0)<1)return e;var n=r;if("[]"===n.ctor)return e;var o=t-1,c=n._1,u={ctor:"::",_0:n._0,_1:e};t=o,r=c,e=u}})),rt=r(function(t,r){return $(s(tt,t,r,{ctor:"[]"}))}),et=e(function(t,r,e){if(v.cmp(r,0)<1)return{ctor:"[]"};var n={ctor:"_Tuple2",_0:r,_1:e};t:do{r:do{if("_Tuple2"!==n.ctor)break t;if("[]"===n._1.ctor)return e;if("::"!==n._1._1.ctor){if(1===n._0)break r;break t}switch(n._0){case 1:break r;case 2:return{ctor:"::",_0:n._1._0,_1:{ctor:"::",_0:n._1._1._0,_1:{ctor:"[]"}}};case 3:if("::"===n._1._1._1.ctor)return{ctor:"::",_0:n._1._0,_1:{ctor:"::",_0:n._1._1._0,_1:{ctor:"::",_0:n._1._1._1._0,_1:{ctor:"[]"}}}};break t;default:if("::"===n._1._1._1.ctor&&"::"===n._1._1._1._1.ctor){var o=n._1._1._1._0,c=n._1._1._0,u=n._1._0,i=n._1._1._1._1._0,a=n._1._1._1._1._1;return v.cmp(t,1e3)>0?{ctor:"::",_0:u,_1:{ctor:"::",_0:c,_1:{ctor:"::",_0:o,_1:{ctor:"::",_0:i,_1:_(rt,r-4,a)}}}}:{ctor:"::",_0:u,_1:{ctor:"::",_0:c,_1:{ctor:"::",_0:o,_1:{ctor:"::",_0:i,_1:s(et,t+1,r-4,a)}}}}}break t}}while(!1);return{ctor:"::",_0:n._1._0,_1:{ctor:"[]"}}}while(!1);return e}),nt=r(function(t,r){return s(et,0,t,r)}),ot=e(function(t,r,e){for(;;){if(v.cmp(r,0)<1)return t;var n={ctor:"::",_0:e,_1:t},o=r-1,c=e;t=n,r=o,e=c}}),ct=r(function(t,r){return s(ot,{ctor:"[]"},t,r)}),ut=e(function(t,r,e){for(;;){if(!(v.cmp(t,r)<1))return e;var n=t,o=r-1,c={ctor:"::",_0:r,_1:e};t=n,r=o,e=c}}),it=r(function(t,r){return s(ut,t,r,{ctor:"[]"})}),at=r(function(t,r){return s(P,t,_(it,0,z(r)-1),r)}),_t=(p.append,p.length,p.slice,p.set,r(function(t,r){return v.cmp(0,t)<1&&v.cmp(t,p.length(r))<0?A(_(p.get,t,r)):C})),st=(p.push,p.empty,r(function(t,e){var n=r(function(r,e){return t(r)?_(p.push,r,e):e});return s(p.foldl,n,p.empty,e)}),p.foldr,p.foldl,p.indexedMap,p.map,function(t){return s(P,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),_(it,0,p.length(t)-1),p.toList(t))}),lt=p.toList,ft=p.fromList,dt=p.initialize,pt=(r(function(t,r){return _(dt,t,m(r))}),function(){function t(t,r){var e=t+": "+v.toString(r),n=n||{};return n.stdout?n.stdout.write(e):console.log(e),r}function e(t){throw new Error(t)}return{crash:e,log:r(t)}}()),ht=function(){function t(t){return 0===t.length}function n(t,r){return t+r}function o(t){var r=t[0];return r?A(v.Tuple2(v.chr(r),t.slice(1))):C}function c(t,r){return t+r}function u(t){return D.toArray(t).join("")}function i(t){return t.length}function a(t,r){for(var e=r.split(""),n=e.length;n--;)e[n]=t(v.chr(e[n]));return e.join("")}function s(t,r){return r.split("").map(v.chr).filter(t).join("")}function l(t){return t.split("").reverse().join("")}function f(t,r,e){for(var n=e.length,o=0;o0;)1&t&&(e+=r),t>>=1,r+=r;return e}function g(t,r,e){return e.slice(t,r)}function b(t,r){return t<1?"":r.slice(0,t)}function y(t,r){return t<1?"":r.slice(-t)}function k(t,r){return t<1?r:r.slice(t)}function T(t,r){return t<1?r:r.slice(0,-t)}function w(t,r,e){var n=(t-e.length)/2;return m(Math.ceil(n),r)+e+m(0|n,r)}function x(t,r,e){return e+m(t-e.length,r)}function M(t,r,e){return m(t-e.length,r)+e}function S(t){return t.trim()}function N(t){return t.replace(/^\s+/,"")}function B(t){return t.replace(/\s+$/,"")}function R(t){return D.fromArray(t.trim().split(/\s+/g))}function E(t){return D.fromArray(t.split(/\r\n|\r|\n/g))}function O(t){return t.toUpperCase()}function L(t){return t.toLowerCase()}function P(t,r){for(var e=r.length;e--;)if(t(v.chr(r[e])))return!0;return!1}function F(t,r){for(var e=r.length;e--;)if(!t(v.chr(r[e])))return!1;return!0}function I(t,r){return r.indexOf(t)>-1}function H(t,r){return 0===r.indexOf(t)}function z(t,r){return r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length}function j(t,r){var e=t.length;if(e<1)return D.Nil;for(var n=0,o=[];(n=r.indexOf(t,n))>-1;)o.push(n),n+=e;return D.fromArray(o)}function U(t){var r=t.length;if(0===r)return W(t);var e=t[0];if("0"===e&&"x"===t[1]){for(var n=2;n"9"||e<"0"&&"-"!==e&&"+"!==e)return W(t);for(var n=1;n-1&&v.cmp(n,gt(r))<1})),yt=(_(bt,v.chr("A"),v.chr("Z")),_(bt,v.chr("a"),v.chr("z")),_(bt,v.chr("0"),v.chr("9")),_(bt,v.chr("0"),v.chr("7")),function(t){var r=t;return"Ok"===r.ctor?A(r._0):C}),kt=r(function(t,r){var e=r;return"Ok"===e.ctor?e._0:t}),Tt=function(t){return{ctor:"Err",_0:t}},wt=(r(function(t,r){var e=r;return"Ok"===e.ctor?t(e._0):Tt(e._0)}),function(t){return{ctor:"Ok",_0:t}}),xt=r(function(t,r){var e=r;return"Ok"===e.ctor?wt(t(e._0)):Tt(e._0)}),Mt=(e(function(t,r,e){var n={ctor:"_Tuple2",_0:r,_1:e};return"Ok"===n._0.ctor?"Ok"===n._1.ctor?wt(_(t,n._0._0,n._1._0)):Tt(n._1._0):Tt(n._0._0)}),n(function(t,r,e,n){var o={ctor:"_Tuple3",_0:r,_1:e,_2:n};return"Ok"===o._0.ctor?"Ok"===o._1.ctor?"Ok"===o._2.ctor?wt(s(t,o._0._0,o._1._0,o._2._0)):Tt(o._2._0):Tt(o._1._0):Tt(o._0._0)}),o(function(t,r,e,n,o){var c={ctor:"_Tuple4",_0:r,_1:e,_2:n,_3:o};return"Ok"===c._0.ctor?"Ok"===c._1.ctor?"Ok"===c._2.ctor?"Ok"===c._3.ctor?wt(l(t,c._0._0,c._1._0,c._2._0,c._3._0)):Tt(c._3._0):Tt(c._2._0):Tt(c._1._0):Tt(c._0._0)}),c(function(t,r,e,n,o,c){var u={ctor:"_Tuple5",_0:r,_1:e,_2:n,_3:o,_4:c};return"Ok"===u._0.ctor?"Ok"===u._1.ctor?"Ok"===u._2.ctor?"Ok"===u._3.ctor?"Ok"===u._4.ctor?wt(f(t,u._0._0,u._1._0,u._2._0,u._3._0,u._4._0)):Tt(u._4._0):Tt(u._3._0):Tt(u._2._0):Tt(u._1._0):Tt(u._0._0)}),r(function(t,r){var e=r;return"Ok"===e.ctor?wt(e._0):Tt(t(e._0))}),r(function(t,r){var e=r;return"Just"===e.ctor?wt(e._0):Tt(t)}),ht.fromList,ht.toList),St=ht.toFloat,Nt=ht.toInt,Bt=(ht.indexes,ht.indexes,ht.endsWith),Rt=ht.startsWith,Et=ht.contains,Ct=(ht.all,ht.any,ht.toLower),At=ht.toUpper,Ot=(ht.lines,ht.words,ht.trimRight,ht.trimLeft,ht.trim,ht.padRight),Lt=(ht.padLeft,ht.pad,ht.dropRight),Dt=ht.dropLeft,Pt=ht.right,Ft=ht.left,It=ht.slice,Ht=ht.repeat,zt=ht.join,jt=ht.split,Ut=(ht.foldr,ht.foldl,ht.reverse),Wt=(ht.filter,ht.map,ht.length),qt=ht.concat,Jt=(ht.append,ht.uncons),Vt=ht.cons,Gt=function(t){return _(Vt,t,"")},Yt=ht.isEmpty,Qt=e(function(t,r,e){for(;;){var n=e;if("RBEmpty_elm_builtin"===n.ctor)return r;var o=t,c=s(t,n._1,n._2,s(Qt,t,r,n._4)),u=n._3;t=o,r=c,e=u}}),$t=function(t){return s(Qt,e(function(t,r,e){return{ctor:"::",_0:{ctor:"_Tuple2",_0:t,_1:r},_1:e}}),{ctor:"[]"},t)},Kt=e(function(t,r,e){for(;;){var n=e;if("RBEmpty_elm_builtin"===n.ctor)return r;var o=t,c=s(t,n._1,n._2,s(Kt,t,r,n._3)),u=n._4;t=o,r=c,e=u}}),Xt=c(function(t,n,o,c,u,i){var a=e(function(r,e,c){for(;;){var u=c,i=u._1,a=u._0,_=a;if("[]"===_.ctor)return{ctor:"_Tuple2",_0:a,_1:s(o,r,e,i)};var f=_._1,d=_._0._1,p=_._0._0;if(!(v.cmp(p,r)<0))return v.cmp(p,r)>0?{ctor:"_Tuple2",_0:a,_1:s(o,r,e,i)}:{ctor:"_Tuple2",_0:f,_1:l(n,p,d,e,i)};var h=r,m=e,g={ctor:"_Tuple2",_0:f,_1:s(t,p,d,i)};r=h,e=m,c=g}}),_=s(Kt,a,{ctor:"_Tuple2",_0:$t(c),_1:i},u),f=_._0,d=_._1;return s(H,r(function(r,e){var n=r;return s(t,n._0,n._1,e)}),d,f)}),Zt=n(function(t,r,e,n){return pt.crash(qt({ctor:"::",_0:"Internal red-black tree invariant violated, expected ",_1:{ctor:"::",_0:t,_1:{ctor:"::",_0:" and got ",_1:{ctor:"::",_0:y(r),_1:{ctor:"::",_0:"/",_1:{ctor:"::",_0:e,_1:{ctor:"::",_0:"/",_1:{ctor:"::",_0:n,_1:{ctor:"::",_0:"\nPlease report this bug to ",_1:{ctor:"[]"}}}}}}}}}}))}),tr=function(t){var r=t;t:do{if("RBNode_elm_builtin"===r.ctor){if("BBlack"===r._0.ctor)return!0;break t}if("LBBlack"===r._0.ctor)return!0;break t}while(!1);return!1},rr=r(function(t,r){for(;;){var e=r;if("RBEmpty_elm_builtin"===e.ctor)return t;var n=_(rr,t+1,e._4),o=e._3;t=n,r=o}}),er=r(function(t,r){t:for(;;){var e=r;if("RBEmpty_elm_builtin"===e.ctor)return C;var n=_(N,t,e._1);switch(n.ctor){case"LT":var o=t,c=e._3;t=o,r=c;continue t;case"EQ":return A(e._2);default:var u=t,i=e._4;t=u,r=i;continue t}}}),nr=r(function(t,r){return"Just"===_(er,t,r).ctor}),or=e(function(t,r,e){for(;;){var n=e;if("RBEmpty_elm_builtin"===n.ctor)return{ctor:"_Tuple2",_0:t,_1:r};var o=n._1,c=n._2,u=n._4;t=o,r=c,e=u}}),cr={ctor:"NBlack"},ur={ctor:"BBlack"},ir={ctor:"Black"},ar=function(t){var r=t;if("RBNode_elm_builtin"===r.ctor){var e=r._0;return v.eq(e,ir)||v.eq(e,ur)}return!0},_r={ctor:"Red"},sr=function(t){switch(t.ctor){case"Black":return ur;case"Red":return ir;case"NBlack":return _r;default:return pt.crash("Can't make a double black node more black!")}},lr=function(t){switch(t.ctor){case"BBlack":return ir;case"Black":return _r;case"Red":return cr;default:return pt.crash("Can't make a negative black node less black!")}},fr={ctor:"LBBlack"},dr={ctor:"LBlack"},pr=function(t){return{ctor:"RBEmpty_elm_builtin",_0:t}},hr=pr(dr),vr=o(function(t,r,e,n,o){return{ctor:"RBNode_elm_builtin",_0:t,_1:r,_2:e,_3:n,_4:o}}),mr=function(t){var r=t;return"RBNode_elm_builtin"===r.ctor&&"Red"===r._0.ctor?f(vr,ir,r._1,r._2,r._3,r._4):t},gr=function(t){var r=t;return"RBNode_elm_builtin"===r.ctor?f(vr,lr(r._0),r._1,r._2,r._3,r._4):pr(dr)},br=function(t){return function(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return function(s){return f(vr,lr(t),n,o,f(vr,ir,r,e,i,a),f(vr,ir,c,u,_,s))}}}}}}}}}}},yr=function(t){var r=t;return"RBEmpty_elm_builtin"===r.ctor?pr(dr):f(vr,ir,r._1,r._2,r._3,r._4)},kr=function(t){var r=t;return"RBEmpty_elm_builtin"===r.ctor?pt.crash("can't make a Leaf red"):f(vr,_r,r._1,r._2,r._3,r._4)},Tr=function(t){var r=t;t:do{r:do{e:do{n:do{o:do{c:do{u:do{if("RBNode_elm_builtin"!==r.ctor)break t;if("RBNode_elm_builtin"===r._3.ctor)if("RBNode_elm_builtin"===r._4.ctor)switch(r._3._0.ctor){case"Red":switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;break t;case"NBlack":if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;break t;default:if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;break t}case"NBlack":switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t;case"NBlack":if("BBlack"===r._0.ctor){if("RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;if("RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t}break t;default:if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t}default:switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;break t;case"NBlack":if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;break t;default:break t}}else switch(r._3._0.ctor){case"Red":if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;break t;case"NBlack":if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t;default:break t}else{if("RBNode_elm_builtin"!==r._4.ctor)break t;switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;break t;case"NBlack":if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;break t;default:break t}}}while(!1);return br(r._0)(r._3._3._1)(r._3._3._2)(r._3._1)(r._3._2)(r._1)(r._2)(r._3._3._3)(r._3._3._4)(r._3._4)(r._4)}while(!1);return br(r._0)(r._3._1)(r._3._2)(r._3._4._1)(r._3._4._2)(r._1)(r._2)(r._3._3)(r._3._4._3)(r._3._4._4)(r._4)}while(!1);return br(r._0)(r._1)(r._2)(r._4._3._1)(r._4._3._2)(r._4._1)(r._4._2)(r._3)(r._4._3._3)(r._4._3._4)(r._4._4)}while(!1);return br(r._0)(r._1)(r._2)(r._4._1)(r._4._2)(r._4._4._1)(r._4._4._2)(r._3)(r._4._3)(r._4._4._3)(r._4._4._4)}while(!1);return f(vr,ir,r._4._3._1,r._4._3._2,f(vr,ir,r._1,r._2,r._3,r._4._3._3),f(wr,ir,r._4._1,r._4._2,r._4._3._4,kr(r._4._4)))}while(!1);return f(vr,ir,r._3._4._1,r._3._4._2,f(wr,ir,r._3._1,r._3._2,kr(r._3._3),r._3._4._3),f(vr,ir,r._1,r._2,r._3._4._4,r._4))}while(!1);return t},wr=o(function(t,r,e,n,o){var c=f(vr,t,r,e,n,o);return ar(c)?Tr(c):c}),xr=o(function(t,r,e,n,o){return tr(n)||tr(o)?f(wr,sr(t),r,e,gr(n),gr(o)):f(vr,t,r,e,n,o)}),Mr=o(function(t,r,e,n,o){var c=o;return"RBEmpty_elm_builtin"===c.ctor?s(Sr,t,n,o):f(xr,t,r,e,n,f(Mr,c._0,c._1,c._2,c._3,c._4))}),Sr=e(function(t,r,e){var n={ctor:"_Tuple2",_0:r,_1:e};if("RBEmpty_elm_builtin"!==n._0.ctor){if("RBEmpty_elm_builtin"===n._1.ctor){var o=n._1._0,c=n._0._0,u={ctor:"_Tuple3",_0:t,_1:c,_2:o};return"_Tuple3"===u.ctor&&"Black"===u._0.ctor&&"Red"===u._1.ctor&&"LBlack"===u._2.ctor?f(vr,ir,n._0._1,n._0._2,n._0._3,n._0._4):l(Zt,"Black/Red/LBlack",t,y(c),y(o))}var i=n._0._2,a=n._0._4,_=n._0._1,d=f(Mr,n._0._0,_,i,n._0._3,a),p=s(or,_,i,a),h=p._0,v=p._1;return f(xr,t,h,v,d,e)}if("RBEmpty_elm_builtin"!==n._1.ctor){var m=n._1._0,g=n._0._0,b={ctor:"_Tuple3",_0:t,_1:g,_2:m};return"_Tuple3"===b.ctor&&"Black"===b._0.ctor&&"LBlack"===b._1.ctor&&"Red"===b._2.ctor?f(vr,ir,n._1._1,n._1._2,n._1._3,n._1._4):l(Zt,"Black/LBlack/Red",t,y(g),y(m))}switch(t.ctor){case"Red":return pr(dr);case"Black":return pr(fr);default:return pt.crash("cannot have bblack or nblack nodes at this point")}}),Nr=r(function(t,r){var e=r;if("RBEmpty_elm_builtin"===e.ctor)return pr(dr);var n=e._1;return f(vr,e._0,n,_(t,n,e._2),_(Nr,t,e._3),_(Nr,t,e._4))}),Br={ctor:"Same"},Rr={ctor:"Remove"},Er={ctor:"Insert"},Cr=e(function(t,r,e){var n=function(e){var o=e;if("RBEmpty_elm_builtin"===o.ctor){var c=r(C);return"Nothing"===c.ctor?{ctor:"_Tuple2",_0:Br,_1:hr}:{ctor:"_Tuple2",_0:Er,_1:f(vr,_r,t,c._0,hr,hr)}}var u=o._2,i=o._4,a=o._3,l=o._1,d=o._0;switch(_(N,t,l).ctor){case"EQ":var p=r(A(u));return"Nothing"===p.ctor?{ctor:"_Tuple2",_0:Rr,_1:s(Sr,d,a,i)}:{ctor:"_Tuple2",_0:Br,_1:f(vr,d,l,p._0,a,i)};case"LT":var h=n(a),v=h._0,m=h._1;switch(v.ctor){case"Same":return{ctor:"_Tuple2",_0:Br,_1:f(vr,d,l,u,m,i)};case"Insert":return{ctor:"_Tuple2",_0:Er,_1:f(wr,d,l,u,m,i)};default:return{ctor:"_Tuple2",_0:Rr,_1:f(xr,d,l,u,m,i)}}default:var g=n(i),v=g._0,b=g._1;switch(v.ctor){case"Same":return{ctor:"_Tuple2",_0:Br,_1:f(vr,d,l,u,a,b)};case"Insert":return{ctor:"_Tuple2",_0:Er,_1:f(wr,d,l,u,a,b)};default:return{ctor:"_Tuple2",_0:Rr,_1:f(xr,d,l,u,a,b)}}}},o=n(e),c=o._0,u=o._1;switch(c.ctor){case"Same":return u;case"Insert":return mr(u);default:return yr(u)}}),Ar=e(function(t,r,e){return s(Cr,t,m(A(r)),e)}),Or=(r(function(t,r){return s(Ar,t,r,hr)}),r(function(t,r){return s(Kt,Ar,r,t)}),r(function(t,r){var n=e(function(r,e,n){return _(t,r,e)?s(Ar,r,e,n):n});return s(Kt,n,hr,r)})),Lr=(r(function(t,e){return _(Or,r(function(t,r){return _(nr,t,e)}),t)}),r(function(t,r){var n=e(function(r,e,n){var o=n,c=o._1,u=o._0;return _(t,r,e)?{ctor:"_Tuple2",_0:s(Ar,r,e,u),_1:c}:{ctor:"_Tuple2",_0:u,_1:s(Ar,r,e,c)}});return s(Kt,n,{ctor:"_Tuple2",_0:hr,_1:hr},r)}),function(t){return s(H,r(function(t,r){var e=t;return s(Ar,e._0,e._1,r)}),hr,t)}),Dr=r(function(t,r){return s(Cr,t,m(C),r)}),Pr=(r(function(t,r){return s(Kt,e(function(t,r,e){return _(Dr,t,e)}),t,r)}),function(){function t(t){return{ctor:"",tag:"succeed",msg:t}}function _(t){return{ctor:"",tag:"fail",msg:t}}function s(t){return{ctor:"",tag:t}}function l(t,r){return{ctor:"",tag:t,decoder:r}}function f(t){return{ctor:"",tag:"null",value:t}}function d(t,r){return{ctor:"",tag:"field",field:t,decoder:r}}function h(t,r){return{ctor:"",tag:"index",index:t,decoder:r}}function m(t){return{ctor:"",tag:"key-value",decoder:t}}function g(t,r){return{ctor:"",tag:"map-many",func:t,decoders:r}}function b(t,r){return{ctor:"",tag:"andThen",decoder:r,callback:t}}function y(t){return{ctor:"",tag:"oneOf",decoders:t}}function k(t,r){return g(t,[r])}function T(t,r,e){return g(t,[r,e])}function w(t,r,e,n){return g(t,[r,e,n])}function x(t,r,e,n,o){return g(t,[r,e,n,o])}function M(t,r,e,n,o,c){return g(t,[r,e,n,o,c])}function S(t,r,e,n,o,c,u){return g(t,[r,e,n,o,c,u])}function N(t,r,e,n,o,c,u,i){return g(t,[r,e,n,o,c,u,i])}function B(t,r,e,n,o,c,u,i,a){return g(t,[r,e,n,o,c,u,i,a])}function R(t){return{tag:"ok",value:t}}function E(t,r){return{tag:"primitive",type:t,value:r}}function O(t,r){return{tag:"index",index:t,rest:r}}function L(t,r){return{tag:"field",field:t,rest:r}}function O(t,r){return{tag:"index",index:t,rest:r}}function P(t){return{tag:"oneOf",problems:t}}function F(t){return{tag:"fail",msg:t}}function I(t){for(var r="_";t;)switch(t.tag){case"primitive":return"Expecting "+t.type+("_"===r?"":" at "+r)+" but instead got: "+H(t.value);case"index":r+="["+t.index+"]",t=t.rest;break;case"field":r+="."+t.field,t=t.rest;break;case"oneOf":for(var e=t.problems,n=0;n=r.length)return E("a longer array. Need index "+a+" but there are only "+r.length+" entries",r);var o=U(t.decoder,r[a]);return"ok"===o.tag?o:O(a,o);case"key-value":if("object"!=typeof r||null===r||r instanceof Array)return E("an object",r);var _=D.Nil;for(var s in r){var o=U(t.decoder,r[s]);if("ok"!==o.tag)return L(s,o);var l=v.Tuple2(s,o.value);_=D.Cons(l,_)}return R(_);case"map-many":for(var f=t.func,d=t.decoders,n=0;n=0&&c.splice(r,1)}var c=[],u=B[t].converter,i=_e.succeed(null);return B[t].init=i,B[t].onEffects=e(r),{subscribe:n,unsubscribe:o}}function S(t,r){return w(t),B[t]={tag:"sub",subMap:E,converter:r,isForeign:!0},h(t)}function N(t,r){function n(t,r,e){for(var n=o(t,r,e),c=0;c0;){var l=n[_];s[--_]=void 0===l?C:A(l)}o.push({match:n[0],submatches:D.fromArray(s),index:n.index,number:c}),a=r.lastIndex}return r.lastIndex=i,D.fromArray(o)}function a(t,r,e,n){function o(r){if(c++>=t)return r;for(var n=arguments.length-3,o=new Array(n);n>0;){var u=arguments[n];o[--n]=void 0===u?C:A(u)}return e({match:r,submatches:D.fromArray(o),index:arguments[arguments.length-2],number:c})}t="All"===t.ctor?1/0:t._0;var c=0;return n.replace(r,o)}function _(t,r,e){if((t="All"===t.ctor?1/0:t._0)===1/0)return D.fromArray(e.split(r));for(var n,o=e,c=[],u=r.lastIndex,i=r.lastIndex;t--&&(n=r.exec(o));)c.push(o.slice(u,n.index)),u=r.lastIndex;return c.push(o.slice(u)),r.lastIndex=i,D.fromArray(c)}return{regex:c,caseInsensitive:o,escape:t,contains:r(u),find:e(i),replace:n(a),split:e(_)}}(),Se=(Me.split,Me.replace),Ne=(Me.find,Me.contains,Me.caseInsensitive,Me.regex),Be=Me.escape,Re=(n(function(t,r,e,n){return{match:t,submatches:r,index:e,number:n}}),function(t){return{ctor:"AtMost",_0:t}}),Ee=e(function(t,r,e){return _(E,NaN,yt(St(_(t,r,e))))}),Ce=function(t){var r=t,e=r._1,n=r._0;if(v.eq(n,v.chr("9"))){var o=Jt(e);return"Nothing"===o.ctor?"01":_(Vt,v.chr("0"),Ce(o._0))}var c=gt(n);return v.cmp(c,48)>-1&&v.cmp(c,57)<0?_(Vt,mt(c+1),e):"0"},Ae=r(function(t,r){var e=_(F,function(t){return!v.eq(t,v.chr("0"))&&!v.eq(t,v.chr("."))},Mt(r));return _(b["++"],t&&e?"-":"",r)}),Oe=function(t){var r=_(jt,".",t);return"::"===r.ctor?"::"===r._1.ctor?{ctor:"_Tuple2",_0:r._0,_1:r._1._0}:{ctor:"_Tuple2",_0:r._0,_1:"0"}:{ctor:"_Tuple2",_0:"0",_1:"0"}},Le=function(t){var r=_(jt,"e",y(B(t)));if("::"===r.ctor){if("::"===r._1.ctor){var e=r._1._0,n=Oe(r._0),o=n._0,c=n._1,u=_(b["++"],o,c),i=_(E,0,yt(Nt(_(Rt,"+",e)?_(Dt,1,e):e))),a=v.cmp(i,0)<0?_(E,"0",_(O,function(t){var r=t;return _(b["++"],r._0,_(b["++"],".",r._1))},_(O,ce(Gt),Jt(_(b["++"],_(Ht,B(i),"0"),u))))):s(Ot,i+1,v.chr("0"),u);return _(b["++"],v.cmp(t,0)<0?"-":"",a)}return _(b["++"],v.cmp(t,0)<0?"-":"",r._0)}return""},De=e(function(t,e,n){if(k(n)||T(n))return y(n);var o=v.cmp(n,0)<0,c=Oe(Le(B(n))),u=c._0,i=c._1,a=Wt(u)+e,l=_(M,1,a),f=_(b["++"],_(Ht,R(a)+1,"0"),s(Ot,a,v.chr("0"),_(b["++"],u,i))),d=Wt(f),p=_(t,o,s(It,l,d,f)),h=s(It,0,l,f),m=p?Ut(_(E,"1",_(O,Ce,Jt(Ut(h))))):h,g=Wt(m),w=v.eq(m,"0")?m:v.cmp(e,0)<1?_(r(function(t,r){return _(b["++"],t,r)}),m,_(Ht,B(e),"0")):v.cmp(e,Wt(i))<0?_(b["++"],s(It,0,g-e,m),_(b["++"],".",s(It,g-e,g,m))):_(r(function(t,r){return _(b["++"],t,r)}),_(b["++"],u,"."),s(Ot,e,v.chr("0"),i));return _(Ae,o,w)}),Pe=De(r(function(t,r){var e=Jt(r);return"Nothing"!==e.ctor&&("5"===e._0._0.valueOf()?""!==e._0._1||!t:function(r){return v.cmp(r,53)>0&&t||v.cmp(r,53)>-1&&!t}(gt(e._0._0)))})),Fe=(Ee(Pe),De(r(function(t,e){var n=Jt(e);return"Nothing"!==n.ctor&&("_Tuple2"===n._0.ctor&&"0"===n._0._0.valueOf()?_(r(function(t,r){return t&&r}),!t,_(F,r(function(t,r){return!v.eq(t,r)})(v.chr("0")),Mt(n._0._1))):!t)}))),Ie=(Ee(Fe),De(r(function(t,e){var n=Jt(e);return"Nothing"!==n.ctor&&("_Tuple2"===n._0.ctor&&"0"===n._0._0.valueOf()?_(r(function(t,r){return t&&r}),t,_(F,r(function(t,r){return!v.eq(t,r)})(v.chr("0")),Mt(n._0._1))):t)}))),He=r(function(t,r){return v.cmp(r,0)<0?_(Fe,t,r):_(Ie,t,r)}),ze=(Ee(He),r(function(t,r){return v.cmp(r,0)<0?_(Ie,t,r):_(Fe,t,r)})),je=(Ee(ze),Ee(Ie),De(r(function(t,e){return _(r(function(t,r){return v.cmp(t,r)<1}),53,gt(_(E,v.chr("0"),_(O,ie,Jt(e)))))}))),Ue=(Ee(je),Ne("^(\\d+\\.[^0]*)(0+)$")),We=Ne(Be(".")),qe=r(function(t,r){var e=_(Ie,t.decimalPlaces,r),n=l(Se,Re(1),Ue,function(t){var r=t;return _(zt,"",_(V,E(""),_(nt,1,r.submatches)))},e),o=_(Bt,".",n)?_(Lt,1,n):n;return v.eq(t.decimalSeparator,".")?o:l(Se,Re(1),We,function(r){return t.decimalSeparator},o)}),Je={minimumSize:1,abbreviation:"?"},Ve={ctor:"::",_0:{minimumSize:1,abbreviation:"B"},_1:{ctor:"::",_0:{minimumSize:1024,abbreviation:"KiB"},_1:{ctor:"::",_0:{minimumSize:1048576,abbreviation:"MiB"},_1:{ctor:"::",_0:{minimumSize:1073741824,abbreviation:"GiB"},_1:{ctor:"::",_0:{minimumSize:1099511627776,abbreviation:"TiB"},_1:{ctor:"::",_0:{minimumSize:0x4000000000000,abbreviation:"PiB"},_1:{ctor:"[]"}}}}}}},Ge={ctor:"::",_0:{minimumSize:1,abbreviation:"B"},_1:{ctor:"::",_0:{minimumSize:1e3,abbreviation:"kB"},_1:{ctor:"::",_0:{minimumSize:1e6,abbreviation:"MB"},_1:{ctor:"::",_0:{minimumSize:1e9,abbreviation:"GB"},_1:{ctor:"::",_0:{minimumSize:1e12,abbreviation:"TB"},_1:{ctor:"::",_0:{minimumSize:1e15,abbreviation:"PB"},_1:{ctor:"::",_0:{minimumSize:1e18,abbreviation:"EB"},_1:{ctor:"[]"}}}}}}}},Ye=function(t){return"Base10"===t.ctor?Ge:Ve},Qe=r(function(t,r){if(v.eq(r,0))return"0 B";var e=Ye(t.units),n=v.cmp(r,0)<0?{ctor:"_Tuple2",_0:R(r),_1:"-"}:{ctor:"_Tuple2",_0:r,_1:""},o=n._0,c=n._1,u=_(E,Je,q($(_(G,function(t){return v.cmp(o,t.minimumSize)>-1},e)))),i=_(qe,t,w(o)/w(u.minimumSize));return _(b["++"],c,_(b["++"],i,_(b["++"]," ",u.abbreviation)))}),$e=(e(function(t,r,e){return{units:t,decimalPlaces:r,decimalSeparator:e}}),r(function(t,r){return{minimumSize:t,abbreviation:r}}),{ctor:"Base2"}),Ke={ctor:"Base10"},Xe={units:Ke,decimalPlaces:2,decimalSeparator:"."},Ze=Qe(Xe),tn=(Qe(v.update(Xe,{units:$e})),function(){function t(t){var r=new Date(t);return isNaN(r.getTime())?Tt("Unable to parse '"+t+"' as a date. Dates must be in the ISO 8601 format."):wt(r)}var r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return{fromString:t,year:function(t){return t.getFullYear()},month:function(t){return{ctor:e[t.getMonth()]}},day:function(t){return t.getDate()},hour:function(t){return t.getHours()},minute:function(t){return t.getMinutes()},second:function(t){return t.getSeconds()},millisecond:function(t){return t.getMilliseconds()},toTime:function(t){return t.getTime()},fromTime:function(t){return new Date(t)},dayOfWeek:function(t){return{ctor:r[t.getDay()]}}}}()),rn=_e.onError,en=_e.andThen,nn=r(function(t,r){var e=r;return _e.spawn(_(en,ge(t),e._0))}),on=_e.fail,cn=(r(function(t,r){return _(rn,function(r){return on(t(r))},r)}),_e.succeed),un=r(function(t,r){return _(en,function(r){return cn(t(r))},r)}),an=e(function(t,r,e){return _(en,function(r){return _(en,function(e){return cn(_(t,r,e))},e)},r)}),_n=(n(function(t,r,e,n){return _(en,function(r){return _(en,function(e){return _(en,function(n){return cn(s(t,r,e,n))},n)},e)},r)}),o(function(t,r,e,n,o){return _(en,function(r){return _(en,function(e){return _(en,function(n){return _(en,function(o){return cn(l(t,r,e,n,o))},o)},n)},e)},r)}),c(function(t,r,e,n,o,c){return _(en,function(r){return _(en,function(e){return _(en,function(n){return _(en,function(o){return _(en,function(c){return cn(f(t,r,e,n,o,c))},c)},o)},n)},e)},r)}),function(t){var e=t;return"[]"===e.ctor?cn({ctor:"[]"}):s(an,r(function(t,r){return{ctor:"::",_0:t,_1:r}}),e._0,_n(e._1))}),sn=e(function(t,r,e){return _(un,function(t){return{ctor:"_Tuple0"}},_n(_(V,nn(t),r)))}),ln=cn({ctor:"_Tuple0"}),fn=e(function(t,r,e){return cn({ctor:"_Tuple0"})}),dn=ae.leaf("Task"),pn=function(t){return{ctor:"Perform",_0:t}},hn=r(function(t,r){return dn(pn(_(un,t,r)))}),vn=r(function(t,r){return dn(pn(_(rn,function(r){return cn(t(Tt(r)))},_(en,function(r){return cn(t(wt(r)))},r))))}),mn=r(function(t,r){return pn(_(un,t,r._0))});ae.effectManagers.Task={pkg:"elm-lang/core",init:ln,onEffects:sn,onSelfMsg:fn,tag:"cmd",cmdMap:mn};var gn=function(){function t(t,r){return _e.nativeBinding(function(e){var n=setInterval(function(){_e.rawSpawn(r)},t);return function(){clearInterval(n)}})}return{now:_e.nativeBinding(function(t){t(_e.succeed(Date.now()))}),setInterval_:r(t)}}(),bn=gn.setInterval_,yn=e(function(t,r,e){var n=r;if("[]"===n.ctor)return cn(e);var o=n._0,c=function(r){return s(yn,t,n._1,s(Ar,o,r,e))},u=_e.spawn(_(bn,o,_(me,t,o)));return _(en,c,u)}),kn=r(function(t,r){var e=t,n=e._1,o=e._0,c=_(er,o,r);return"Nothing"===c.ctor?s(Ar,o,{ctor:"::",_0:n,_1:{ctor:"[]"}},r):s(Ar,o,{ctor:"::",_0:n,_1:c._0},r)}),Tn=function(t){return t/36e5},wn=function(t){return t/6e4},xn=function(t){return t/1e3},Mn=gn.now,Sn=e(function(t,r,e){var n=_(er,r,e.taggers);if("Nothing"===n.ctor)return cn(e);var o=function(r){return _n(_(V,function(e){return _(ge,t,e(r))},n._0))};return _(en,function(t){return cn(e)},_(en,o,Mn))}),Nn=ae.leaf("Time"),Bn=r(function(t,r){return{taggers:t,processes:r}}),Rn=cn(_(Bn,hr,hr)),En=e(function(t,r,o){var c=o,u=e(function(t,r,e){var n=e;return{ctor:"_Tuple3",_0:n._0,_1:n._1,_2:_(en,function(t){return n._2},_e.kill(r))}}),i=n(function(t,r,e,n){var o=n;return{ctor:"_Tuple3",_0:o._0,_1:s(Ar,t,e,o._1),_2:o._2}}),a=e(function(t,r,e){var n=e;return{ctor:"_Tuple3",_0:{ctor:"::",_0:t,_1:n._0},_1:n._1,_2:n._2}}),l=s(H,kn,hr,r),f=d(Xt,a,i,u,l,c.processes,{ctor:"_Tuple3",_0:{ctor:"[]"},_1:hr,_2:cn({ctor:"_Tuple0"})}),p=f._0,h=f._1,v=f._2;return _(en,function(t){return cn(_(Bn,l,t))},_(en,function(r){return s(yn,t,p,h)},v))}),Cn=r(function(t,r){return{ctor:"Every",_0:t,_1:r}}),An=r(function(t,r){return Nn(_(Cn,t,r))}),On=r(function(t,r){var e=r;return _(Cn,e._0,function(r){return t(e._1(r))})});ae.effectManagers.Time={pkg:"elm-lang/core",init:Rn,onEffects:En,onSelfMsg:Sn,tag:"sub",subMap:On};var Ln,Dn=(tn.millisecond,tn.second),Pn=tn.minute,Fn=tn.hour,In=tn.dayOfWeek,Hn=tn.day,zn=tn.month,jn=tn.year,Un=tn.fromTime,Wn=tn.toTime,qn=tn.fromString,Jn=(_(un,Un,Mn),{ctor:"Sun"}),Vn={ctor:"Sat"},Gn={ctor:"Fri"},Yn={ctor:"Thu"},Qn={ctor:"Wed"},$n={ctor:"Tue"},Kn={ctor:"Mon"},Xn={ctor:"Dec"},Zn={ctor:"Nov"},to={ctor:"Oct"},ro={ctor:"Sep"},eo={ctor:"Aug"},no={ctor:"Jul"},oo={ctor:"Jun"},co={ctor:"May"},uo={ctor:"Apr"},io={ctor:"Mar"},ao={ctor:"Feb"},_o={ctor:"Jan"},so=_e.kill,lo=(_e.sleep,_e.spawn),fo=function(){function t(t){return function(r,e,n){return _e.nativeBinding(function(o){function c(t){var r=_(Vr,e,t);"Ok"===r.ctor&&_e.rawSpawn(n(r._0))}return t.addEventListener(r,c),function(){t.removeEventListener(r,c)}})}}function n(t,r){return _e.nativeBinding(function(e){b(function(){var n=document.getElementById(t);if(null===n)return void e(_e.fail({ctor:"NotFound",_0:t}));e(_e.succeed(r(n)))})})}function o(t){return n(t,function(t){return t.focus(),v.Tuple0})}function c(t){return n(t,function(t){return t.blur(),v.Tuple0})}function u(t){return n(t,function(t){return t.scrollTop})}function i(t,r){return n(t,function(t){return t.scrollTop=r,v.Tuple0})}function a(t){return n(t,function(t){return t.scrollTop=t.scrollHeight,v.Tuple0})}function s(t){return n(t,function(t){return t.scrollLeft})}function l(t,r){return n(t,function(t){return t.scrollLeft=r,v.Tuple0})}function f(t){return n(t,function(t){return t.scrollLeft=t.scrollWidth,v.Tuple0})}function d(t,r){return n(r,function(r){switch(t.ctor){case"Content":return r.scrollWidth;case"VisibleContent":return r.clientWidth;case"VisibleContentWithBorders":return r.offsetWidth;case"VisibleContentWithBordersAndMargins":var e=r.getBoundingClientRect();return e.right-e.left}})}function p(t,r){return n(r,function(r){switch(t.ctor){case"Content":return r.scrollHeight;case"VisibleContent":return r.clientHeight;case"VisibleContentWithBorders":return r.offsetHeight;case"VisibleContentWithBordersAndMargins":var e=r.getBoundingClientRect();return e.bottom-e.top}})}var h={addEventListener:function(){},removeEventListener:function(){}},m=t("undefined"!=typeof document?document:h),g=t("undefined"!=typeof window?window:h),b="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:function(t){t()};return{onDocument:e(m),onWindow:e(g),focus:o,blur:c,getScrollTop:u,setScrollTop:r(i),getScrollLeft:s,setScrollLeft:r(l),toBottom:a,toRight:f,height:r(p),width:r(d)}}(),po=fo.onWindow,ho=(fo.onDocument,function(){function t(t){return{type:"text",text:t}}function o(t){return r(function(r,e){return c(t,r,e)})}function c(t,r,e){for(var n=h(r),o=n.namespace,c=n.facts,u=[],i=0;"[]"!==e.ctor;){var a=e._0;i+=a.descendantsCount||0,u.push(a),e=e._1}return i+=u.length,{type:"node",tag:t,facts:c,children:u,namespace:o,descendantsCount:i}}function u(t,r,e){for(var n=h(r),o=n.namespace,c=n.facts,u=[],i=0;"[]"!==e.ctor;){var a=e._0;i+=a._1.descendantsCount||0,u.push(a),e=e._1}return i+=u.length,{type:"keyed-node",tag:t,facts:c,children:u,namespace:o,descendantsCount:i}}function i(t,r,e){return{type:"custom",facts:h(t).facts,model:r,impl:e}}function a(t,r){return{type:"tagger",tagger:t,node:r,descendantsCount:1+(r.descendantsCount||0)}}function l(t,r,e){return{type:"thunk",func:t,args:r,thunk:e,node:void 0}}function f(t,r){return l(t,[r],function(){return t(r)})}function d(t,r,e){return l(t,[r,e],function(){return _(t,r,e)})}function p(t,r,e,n){return l(t,[r,e,n],function(){return s(t,r,e,n)})}function h(t){for(var r,e={};"[]"!==t.ctor;){var n=t._0,o=n.key;if(o===dt||o===pt||o===ft){var c=e[o]||{};c[n.realKey]=n.value,e[o]=c}else if(o===lt){for(var u=e[o]||{},i=n.value;"[]"!==i.ctor;){var a=i._0;u[a._0]=a._1,i=i._1}e[o]=u}else if("namespace"===o)r=n.value;else if("className"===o){var _=e[o];e[o]=void 0===_?n.value:_+" "+n.value}else e[o]=n.value;t=t._1}return{facts:e,namespace:r}}function m(t){return{key:lt,value:t}}function g(t,r){return{key:t,value:r}}function b(t,r){return{key:dt,realKey:t,value:r}}function y(t,r,e){return{key:pt,realKey:r,value:{value:e,namespace:t}}}function k(t,r,e){return{key:ft,realKey:t,value:{options:r,decoder:e}}}function T(t,r){return(t.options===r.options||t.options.stopPropagation===r.options.stopPropagation&&t.options.preventDefault===r.options.preventDefault)&&Pr.equality(t.decoder,r.decoder)}function w(t,r){return r.key!==ft?r:k(r.realKey,r.value.options,_(Qr,t,r.value.decoder))}function x(t,r){switch(t.type){case"thunk":return t.node||(t.node=t.thunk()),x(t.node,r);case"tagger":for(var e=t.node,n=t.tagger;"tagger"===e.type;)"object"!=typeof n?n=[n,e.tagger]:n.push(e.tagger),e=e.node;var o={tagger:n,parent:r},c=x(e,o);return c.elm_event_node_ref=o,c;case"text":return ht.createTextNode(t.text);case"node":var c=t.namespace?ht.createElementNS(t.namespace,t.tag):ht.createElement(t.tag);M(c,r,t.facts);for(var u=t.children,i=0;i0&&e.push(A("p-thunk",n,s)));case"tagger":for(var l=t.tagger,f=r.tagger,d=!1,p=t.node;"tagger"===p.type;)d=!0,"object"!=typeof l?l=[l,p.tagger]:l.push(p.tagger),p=p.node;for(var h=r.node;"tagger"===h.type;)d=!0,"object"!=typeof f?f=[f,h.tagger]:f.push(h.tagger),h=h.node;return d&&l.length!==f.length?void e.push(A("p-redraw",n,r)):((d?L(l,f):l===f)||e.push(A("p-tagger",n,f)),void O(p,h,e,n+1));case"text":if(t.text!==r.text)return void e.push(A("p-text",n,r.text));return;case"node":if(t.tag!==r.tag||t.namespace!==r.namespace)return void e.push(A("p-redraw",n,r));var v=D(t.facts,r.facts);return void 0!==v&&e.push(A("p-facts",n,v)),void P(t,r,e,n);case"keyed-node":if(t.tag!==r.tag||t.namespace!==r.namespace)return void e.push(A("p-redraw",n,r));var v=D(t.facts,r.facts);return void 0!==v&&e.push(A("p-facts",n,v)),void F(t,r,e,n);case"custom":if(t.impl!==r.impl)return void e.push(A("p-redraw",n,r));var v=D(t.facts,r.facts);void 0!==v&&e.push(A("p-facts",n,v));var m=r.impl.diff(t,r);if(m)return void e.push(A("p-custom",n,m));return}}}function L(t,r){for(var e=0;ei?e.push(A("p-remove-last",n,u-i)):u0||u.length>0||void 0!==E)&&e.push(A("p-reorder",n,{patches:o,inserts:u,endInserts:E}))}function I(t,r,e,n,o,c){var u=t[e];if(void 0===u)return u={tag:"insert",vnode:n,index:o,data:void 0},c.push({index:o,entry:u}),void(t[e]=u);if("remove"===u.tag){c.push({index:o,entry:u}),u.tag="move";var i=[];return O(u.vnode,n,i,u.index),u.index=o,void(u.data.data={patches:i,entry:u})}I(t,r,e+vt,n,o,c)}function H(t,r,e,n,o){var c=t[e];if(void 0===c){var u=A("p-remove",o,void 0);return r.push(u),void(t[e]={tag:"remove",vnode:n,index:o,data:u})}if("insert"===c.tag){c.tag="move";var i=[];O(n,c.vnode,i,o);var u=A("p-remove",o,{patches:i,entry:c});return void r.push(u)}H(t,r,e+vt,n,o)}function z(t,r,e,n){j(t,r,e,0,0,r.descendantsCount,n)}function j(t,r,e,n,o,c,u){for(var i=e[n],a=i.index;a===o;){var _=i.type;if("p-thunk"===_)z(t,r.node,i.data,u);else if("p-reorder"===_){i.domNode=t,i.eventNode=u;var s=i.data.patches;s.length>0&&j(t,r,s,0,o,c,u)}else if("p-remove"===_){i.domNode=t,i.eventNode=u;var l=i.data;if(void 0!==l){l.entry.data=t;var s=l.patches;s.length>0&&j(t,r,s,0,o,c,u)}}else i.domNode=t,i.eventNode=u;if(n++,!(i=e[n])||(a=i.index)>c)return n}switch(r.type){case"tagger":for(var f=r.node;"tagger"===f.type;)f=f.node;return j(t,f,e,n,o+1,c,t.elm_event_node_ref);case"node":for(var d=r.children,p=t.childNodes,h=0;hc))return n;o=m}return n;case"keyed-node":for(var d=r.children,p=t.childNodes,h=0;hc))return n;o=m}return n;case"text":case"thunk":throw new Error("should never traverse `text` or `thunk` nodes like this")}}function U(t,r,e,n){return 0===e.length?t:(z(t,r,e,n),W(t,e))}function W(t,r){for(var e=0;e"),new Error(t)}function Z(t,r,e,n){r.embed=function(r,e){for(;r.lastChild;)r.removeChild(r.lastChild);return ae.initialize(n(t.init,e,r),t.update,t.subscriptions,tt(r,t.view))},r.fullscreen=function(r){return ae.initialize(n(t.init,r,document.body),t.update,t.subscriptions,tt(document.body,t.view))}}function tt(t,r){return function(e,n){var o={tagger:e,parent:void 0},c=r(n),u=x(c,o);return t.appendChild(u),rt(u,r,c,o)}}function rt(t,r,e,n){function o(){switch(u){case"NO_REQUEST":throw new Error("Unexpected draw callback.\nPlease report this to .");case"PENDING_REQUEST":bt(o),u="EXTRA_REQUEST";var e=r(c),a=C(i,e);return t=U(t,i,a,n),void(i=e);case"EXTRA_REQUEST":return void(u="NO_REQUEST")}}var c,u="NO_REQUEST",i=e;return function(t){"NO_REQUEST"===u&&bt(o),u="PENDING_REQUEST",c=t}}function et(t,r,e,n){r.fullscreen=function(r){var o={doc:void 0};return ae.initialize(n(t.init,r,document.body),t.update(nt(o)),t.subscriptions,ot(e,document.body,o,t.view,t.viewIn,t.viewOut))},r.embed=function(r,o){var c={doc:void 0};return ae.initialize(n(t.init,o,r),t.update(nt(c)),t.subscriptions,ot(e,r,c,t.view,t.viewIn,t.viewOut))}}function nt(t){return _e.nativeBinding(function(r){var e=t.doc;if(e){var n=e.getElementsByClassName("debugger-sidebar-messages")[0];n&&(n.scrollTop=n.scrollHeight)}r(_e.succeed(v.Tuple0))})}function ot(t,r,e,n,o,c){return function(u,i){var a={tagger:u,parent:void 0},_={tagger:u,parent:void 0},s=n(i),l=x(s,a);r.appendChild(l);var f=rt(l,n,s,a),d=o(i)._1,p=x(d,_);r.appendChild(p);var h=it(a,p,o),v=rt(p,h,d,_),m=ct(i,c,_,r,t,e);return function(t){f(t),v(t),m(t)}}}function ct(t,r,e,n,o,c){var u,i;return function(t){if(t.isDebuggerOpen){if(!c.doc)return u=r(t),void(i=ut(o,c,u,e));ht=c.doc;var n=r(t),a=C(u,n);i=U(i,u,a,e),u=n,ht=document}}}function ut(t,r,e,n){function o(){r.doc=void 0,i.close()}var c=screen.width-900,u=screen.height-360,i=window.open("","","width=900,height=360,left="+c+",top="+u);ht=i.document,r.doc=ht,ht.title="Debugger - "+t,ht.body.style.margin="0",ht.body.style.padding="0";var a=x(e,n);return ht.body.appendChild(a),ht.addEventListener("keydown",function(t){t.metaKey&&82===t.which&&window.location.reload(),38===t.which&&(n.tagger({ctor:"Up"}),t.preventDefault()),40===t.which&&(n.tagger({ctor:"Down"}),t.preventDefault())}),window.addEventListener("unload",o),i.addEventListener("unload",function(){r.doc=void 0,window.removeEventListener("unload",o),n.tagger({ctor:"Close"})}),ht=document,a}function it(t,r,e){var n,o=st(r),c="Normal",u=t.tagger,i=function(){};return function(r){var a=e(r),_=a._0.ctor;return t.tagger="Normal"===_?u:i,c!==_&&(at("removeEventListener",o,c),at("addEventListener",o,_),"Normal"===c&&(n=document.body.style.overflow,document.body.style.overflow="hidden"),"Normal"===_&&(document.body.style.overflow=n),c=_),a._1}}function at(t,r,e){switch(e){case"Normal":return;case"Pause":return _t(t,r,yt);case"Message":return _t(t,r,kt)}}function _t(t,r,e){for(var n=0;n0){var u=o.substring(0,c),i=o.substring(c+2);r=s(Cr,u,function(t){return A("Just"===t.ctor?i+", "+t._0:i)},r)}}return r}function f(t){return{responseType:"text",responseToResult:t}}function d(t,r){return{responseType:r.responseType,responseToResult:function(e){var n=r.responseToResult(e);return _(xt,t,n)}}}function p(t){for(var r=new FormData;"[]"!==t.ctor;){var e=t._0;r.append(e._0,e._1),t=t._1}return{ctor:"FormDataBody",_0:r}}return{toTask:r(n),expectStringResponse:f,mapExpect:r(d),multipart:p,encodeUri:t,decodeUri:e}}()),Sc=(r(function(t,r){return v.update(r,{expect:_(Mc.mapExpect,t,r.expect)})}),u(function(t,r,e,n,o,c,u){return{method:t,headers:r,url:e,body:n,expect:o,timeout:c,withCredentials:u}}),function(t){return{ctor:"Request",_0:t}}),Nc=r(function(t,r){return{ctor:"StringBody",_0:t,_1:r}}),Bc={ctor:"EmptyBody"},Rc=(r(function(t,r){return{ctor:"Header",_0:t,_1:r}}),Mc.decodeUri),Ec=(Mc.encodeUri,Mc.expectStringResponse),Cc=function(t){return Ec(function(r){return _(Gr,t,r.body)})},Ac=Ec(function(t){return wt(t.body)}),Oc=(Mc.multipart,function(t){return _(Nc,"application/json",_(zr,0,t))}),Lc=Bc,Dc=Sc,Pc=(e(function(t,r,e){return Dc({method:"POST",headers:{ctor:"[]"},url:t,body:r,expect:Cc(e),timeout:C,withCredentials:!1})}),r(function(t,r){return Dc({method:"GET",headers:{ctor:"[]"},url:t,body:Lc,expect:Cc(r),timeout:C,withCredentials:!1})})),Fc=function(t){var r=t;return _(Mc.toTask,r._0,C)},Ic=r(function(t,r){return _(vn,t,Fc(r))}),Hc=(n(function(t,r,e,n){return{url:t,status:r,headers:e,body:n}}),r(function(t,r){return{ctor:"BadPayload",_0:t,_1:r}}),r(function(t,r){return{ctor:"StringPart",_0:t,_1:r}}),function(){function t(t){return _e.nativeBinding(function(r){0!==t&&history.go(t),r(_e.succeed(v.Tuple0))})}function r(t){return _e.nativeBinding(function(r){history.pushState({},"",t),r(_e.succeed(c()))})}function e(t){return _e.nativeBinding(function(r){history.replaceState({},"",t),r(_e.succeed(c()))})}function n(t){return _e.nativeBinding(function(r){document.location.reload(t),r(_e.succeed(v.Tuple0))})}function o(t){return _e.nativeBinding(function(r){try{window.location=t}catch(t){document.location.reload(!1)}r(_e.succeed(v.Tuple0))})}function c(){var t=document.location;return{href:t.href,host:t.host,hostname:t.hostname,protocol:t.protocol,origin:t.origin,port_:t.port,pathname:t.pathname,search:t.search,hash:t.hash,username:t.username,password:t.password}}function u(){return-1!==window.navigator.userAgent.indexOf("Trident")}return{go:t,setLocation:o,reloadPage:n,pushState:r,replaceState:e,getLocation:c,isInternetExplorer11:u}}()),zc=Hc.replaceState,jc=Hc.pushState,Uc=Hc.go,Wc=Hc.reloadPage,qc=Hc.setLocation,Jc=Jc||{};Jc["&>"]=r(function(t,r){return _(en,function(t){return r},t)});var Vc=e(function(t,r,e){var n=function(r){return _(ge,t,r._0(e))};return _(Jc["&>"],_n(_(V,n,r)),cn({ctor:"_Tuple0"}))}),Gc=e(function(t,r,e){var n=e;switch(n.ctor){case"Jump":return Uc(n._0);case"New":return _(en,_(Vc,t,r),jc(n._0));case"Modify":return _(en,_(Vc,t,r),zc(n._0));case"Visit":return qc(n._0);default:return Wc(n._0)}}),Yc=function(t){var r=t;return"Normal"===r.ctor?so(r._0):_(Jc["&>"],so(r._0),so(r._1))},Qc=e(function(t,r,e){return _(Jc["&>"],s(Vc,t,e.subs,r),cn(e))}),$c=ae.leaf("Navigation"),Kc=ae.leaf("Navigation"),Xc=r(function(t,r){return{subs:t,popWatcher:r}}),Zc=cn(_(Xc,{ctor:"[]"},C)),tu=function(t){return{ctor:"Reload",_0:t}},ru=(Kc(tu(!1)),Kc(tu(!0)),function(t){return{ctor:"Visit",_0:t}}),eu=function(t){return{ctor:"Modify",_0:t}},nu=function(t){return{ctor:"New",_0:t}},ou=function(t){return Kc(nu(t))},cu=function(t){return{ctor:"Jump",_0:t}},uu=r(function(t,r){var e=r;switch(e.ctor){case"Jump":return cu(e._0);case"New":return nu(e._0);case"Modify":return eu(e._0);case"Visit":return ru(e._0);default:return tu(e._0)}}),iu=function(t){return{ctor:"Monitor",_0:t}},au=(r(function(t,r){var e=r.init(Hc.getLocation({ctor:"_Tuple0"})),n=function(e){return pe({ctor:"::",_0:$c(iu(t)),_1:{ctor:"::",_0:r.subscriptions(e),_1:{ctor:"[]"}}})};return Bo({init:e,view:r.view,update:r.update,subscriptions:n})}),r(function(t,r){var e=function(t){return _(r.init,t,Hc.getLocation({ctor:"_Tuple0"}))},n=function(e){return pe({ctor:"::",_0:$c(iu(t)),_1:{ctor:"::",_0:r.subscriptions(e),_1:{ctor:"[]"}}})};return No({init:e,view:r.view,update:r.update,subscriptions:n})})),_u=r(function(t,r){var e=r;return iu(function(r){return t(e._0(r))})}),su=r(function(t,r){return{ctor:"InternetExplorer",_0:t,_1:r}}),lu=function(t){return{ctor:"Normal",_0:t}},fu=function(t){var r=function(r){return _(me,t,Hc.getLocation({ctor:"_Tuple0"}))};return Hc.isInternetExplorer11({ctor:"_Tuple0"})?s(an,su,lo(s(po,"popstate",Ur,r)),lo(s(po,"hashchange",Ur,r))):_(un,lu,lo(s(po,"popstate",Ur,r)))},du=n(function(t,r,e,n){var o=n,c=o.popWatcher,u=function(){var r={ctor:"_Tuple2",_0:e,_1:c};t:do{if("[]"===r._0.ctor){if("Just"===r._1.ctor)return _(Jc["&>"],Yc(r._1._0),cn(_(Xc,e,C)));break t}if("Nothing"===r._1.ctor)return _(un,function(t){return _(Xc,e,A(t))},fu(t));break t}while(!1);return cn(_(Xc,e,c))}();return _(Jc["&>"],_n(_(V,_(Gc,t,e),r)),u)});ae.effectManagers.Navigation={pkg:"elm-lang/navigation",init:Zc,onEffects:du,onSelfMsg:Qc,tag:"fx",cmdMap:uu,subMap:_u};var pu=Mo,hu=_(wo,"namespace",Hr("http://www.w3.org/2000/svg")),vu=e(function(t,r,e){return s(So,t,{ctor:"::",_0:hu,_1:r},e)}),mu=vu("svg"),gu=(vu("foreignObject"),vu("animate"),vu("animateColor"),vu("animateMotion"),vu("animateTransform"),vu("mpath"),vu("set"),vu("a"),vu("defs"),vu("g")),bu=(vu("marker"),vu("mask"),vu("pattern"),vu("switch"),vu("symbol"),vu("desc"),vu("metadata"),vu("title"),vu("feBlend"),vu("feColorMatrix"),vu("feComponentTransfer"),vu("feComposite"),vu("feConvolveMatrix"),vu("feDiffuseLighting"),vu("feDisplacementMap"),vu("feFlood"),vu("feFuncA"),vu("feFuncB"),vu("feFuncG"),vu("feFuncR"),vu("feGaussianBlur"),vu("feImage"),vu("feMerge"),vu("feMergeNode"),vu("feMorphology"),vu("feOffset"),vu("feSpecularLighting"),vu("feTile"),vu("feTurbulence"),vu("font"),vu("linearGradient"),vu("radialGradient"),vu("stop"),vu("circle")),yu=(vu("ellipse"),vu("image"),vu("line"),vu("path")),ku=(vu("polygon"),vu("polyline"),vu("rect")),Tu=(vu("use"),vu("feDistantLight"),vu("fePointLight"),vu("feSpotLight"),vu("altGlyph"),vu("altGlyphDef"),vu("altGlyphItem"),vu("glyph"),vu("glyphRef"),vu("textPath"),vu("text")),wu=(vu("tref"),vu("tspan"),vu("clipPath"),vu("colorProfile"),vu("cursor"),vu("filter"),vu("script"),vu("style"),vu("view"),To("writing-mode"),To("word-spacing"),To("visibility"),To("unicode-bidi"),To("text-rendering"),To("text-decoration"),To("text-anchor"),To("stroke")),xu=To("stroke-width"),Mu=(To("stroke-opacity"),To("stroke-miterlimit"),To("stroke-linejoin"),To("stroke-linecap"),To("stroke-dashoffset"),To("stroke-dasharray"),To("stop-opacity"),To("stop-color"),To("shape-rendering"),To("pointer-events"),To("overflow"),To("opacity"),To("mask"),To("marker-start"),To("marker-mid"),To("marker-end"),To("lighting-color"),To("letter-spacing"),To("kerning"),To("image-rendering"),To("glyph-orientation-vertical"),To("glyph-orientation-horizontal"),To("font-weight"),To("font-variant"),To("font-style"),To("font-stretch"),To("font-size"),To("font-size-adjust"),To("font-family"),To("flood-opacity"),To("flood-color"),To("filter"),To("fill")),Su=(To("fill-rule"),To("fill-opacity"),To("enable-background"),To("dominant-baseline"),To("display"),To("direction"),To("cursor"),To("color"),To("color-rendering"),To("color-profile"),To("color-interpolation"),To("color-interpolation-filters"),To("clip"),To("clip-rule"),To("clip-path"),To("baseline-shift"),To("alignment-baseline"),To("zoomAndPan"),To("z"),To("yChannelSelector"),To("y2"),To("y1"),To("y")),Nu=(_(ko,"http://www.w3.org/XML/1998/namespace","xml:space"),_(ko,"http://www.w3.org/XML/1998/namespace","xml:lang"),_(ko,"http://www.w3.org/XML/1998/namespace","xml:base"),_(ko,"http://www.w3.org/1999/xlink","xlink:type"),_(ko,"http://www.w3.org/1999/xlink","xlink:title"),_(ko,"http://www.w3.org/1999/xlink","xlink:show"),_(ko,"http://www.w3.org/1999/xlink","xlink:role"),_(ko,"http://www.w3.org/1999/xlink","xlink:href"),_(ko,"http://www.w3.org/1999/xlink","xlink:arcrole"),_(ko,"http://www.w3.org/1999/xlink","xlink:actuate"),To("xChannelSelector"),To("x2"),To("x1"),To("x-height"),To("x")),Bu=(To("widths"),To("width")),Ru=(To("viewTarget"),To("viewBox")),Eu=(To("vert-origin-y"),To("vert-origin-x"),To("vert-adv-y"),To("version"),To("values"),To("v-mathematical"),To("v-ideographic"),To("v-hanging"),To("v-alphabetic"),To("units-per-em"),To("unicode-range"),To("unicode"),To("underline-thickness"),To("underline-position"),To("u2"),To("u1"),To("type"),To("transform")),Cu=(To("to"),To("title"),To("textLength"),To("targetY"),To("targetX"),To("target"),To("tableValues"),To("systemLanguage"),To("surfaceScale"),To("style"),To("string"),To("strikethrough-thickness"),To("strikethrough-position"),To("stitchTiles"),To("stemv"),To("stemh"),To("stdDeviation"),To("startOffset"),To("spreadMethod"),To("speed"),To("specularExponent"),To("specularConstant"),To("spacing"),To("slope"),To("seed"),To("scale"),To("ry"),To("rx"),To("rotate"),To("result"),To("restart"),To("requiredFeatures"),To("requiredExtensions"),To("repeatDur"),To("repeatCount"),To("rendering-intent"),To("refY"),To("refX"),To("radius"),To("r")),Au=(To("primitiveUnits"),To("preserveAspectRatio"),To("preserveAlpha"),To("pointsAtZ"),To("pointsAtY"),To("pointsAtX"),To("points"),To("point-order"),To("patternUnits"),To("patternTransform"),To("patternContentUnits"),To("pathLength"),To("path"),To("panose-1"),To("overline-thickness"),To("overline-position"),To("origin"),To("orientation"),To("orient"),To("order"),To("operator"),To("offset"),To("numOctaves"),To("name"),To("mode"),To("min"),To("method"),To("media"),To("max"),To("mathematical"),To("maskUnits"),To("maskContentUnits"),To("markerWidth"),To("markerUnits"),To("markerHeight"),To("local"),To("limitingConeAngle"),To("lengthAdjust"),To("lang"),To("keyTimes"),To("keySplines"),To("keyPoints"),To("kernelUnitLength"),To("kernelMatrix"),To("k4"),To("k3"),To("k2"),To("k1"),To("k"),To("intercept"),To("in2"),To("in"),To("ideographic"),To("id"),To("horiz-origin-y"),To("horiz-origin-x"),To("horiz-adv-x"),To("height")),Ou=(To("hanging"),To("gradientUnits"),To("gradientTransform"),To("glyphRef"),To("glyph-name"),To("g2"),To("g1"),To("fy"),To("fx"),To("from"),To("format"),To("filterUnits"),To("filterRes"),To("externalResourcesRequired"),To("exponent"),To("end"),To("elevation"),To("edgeMode"),To("dy"),To("dx"),To("dur"),To("divisor"),To("diffuseConstant"),To("descent"),To("decelerate"),To("d")),Lu=To("cy"),Du=To("cx"),Pu=(To("contentStyleType"),To("contentScriptType"),To("clipPathUnits"),To("class"),To("cap-height"),To("calcMode"),To("by"),To("bias"),To("begin"),To("bbox"),To("baseProfile"),To("baseFrequency"),To("azimuth"),To("autoReverse"),To("attributeType"),To("attributeName"),To("ascent"),To("arabic-form"),To("amplitude"),To("allowReorder"),To("alphabetic"),To("additive"),To("accumulate"),To("accelerate"),To("accent-height"),function(t){var e=_(jt,"=",t);return"::"===e.ctor&&"::"===e._1.ctor&&"[]"===e._1._1.ctor?s(L,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),Rc(e._0),Rc(e._1._0)):C}),Fu=function(t){return Lr(_(Q,Pu,_(jt,"&",_(Dt,1,t))))},Iu=function(t){var r=_(jt,"/",t);return"::"===r.ctor&&""===r._0?r._1:r},Hu=function(t){for(;;){var r=t;if("[]"===r.ctor)return C;var e=r._0,n=e.unvisited;if("[]"===n.ctor)return A(e.value);if(""===n._0&&"[]"===n._1.ctor)return A(e.value);t=r._1}},zu=e(function(t,r,e){return Hu(t._0({visited:{ctor:"[]"},unvisited:Iu(r),params:e,value:g}))}),ju=r(function(t,r){return s(zu,t,_(Dt,1,r.hash),Fu(r.search))}),Uu=(r(function(t,r){return s(zu,t,r.pathname,Fu(r.search))}),r(function(t,r){var e=r;return{visited:e.visited,unvisited:e.unvisited,params:e.params,value:t(e.value)}})),Wu=n(function(t,r,e,n){return{visited:t,unvisited:r,params:e,value:n}}),qu=function(t){return{ctor:"Parser",_0:t}},Ju=function(t){return qu(function(r){var e=r,n=e.unvisited;if("[]"===n.ctor)return{ctor:"[]"};var o=n._0;return v.eq(o,t)?{ctor:"::",_0:l(Wu,{ctor:"::",_0:o,_1:e.visited},n._1,e.params,e.value),_1:{ctor:"[]"}}:{ctor:"[]"}})},Vu=r(function(t,r){return qu(function(t){var e=t,n=e.unvisited;if("[]"===n.ctor)return{ctor:"[]"};var o=n._0,c=r(o);return"Ok"===c.ctor?{ctor:"::",_0:l(Wu,{ctor:"::",_0:o,_1:e.visited},n._1,e.params,e.value(c._0)),_1:{ctor:"[]"}}:{ctor:"[]"}})}),Gu=_(Vu,"STRING",wt),Yu=(_(Vu,"NUMBER",Nt),Yu||{});Yu[""]=r(function(t,r){var e=t,n=r;return qu(function(t){return _(Z,n._0,e._0(t))})});var Qu=r(function(t,r){var e=r;return qu(function(r){var n=r;return _(V,Uu(n.value),e._0({visited:n.visited,unvisited:n.unvisited,params:n.params,value:t}))})}),Yu=(qu(function(t){return{ctor:"::",_0:t,_1:{ctor:"[]"}}}),Yu||{});Yu[""]=r(function(t,r){var e=t,n=r;return qu(function(t){return _(Z,n._0,e._0(t))})});var $u=function(t){return{ctor:"QueryParser",_0:t}},Ku=(r(function(t,r){return $u(function(e){var n=e,o=n.params;return{ctor:"::",_0:l(Wu,n.visited,n.unvisited,o,n.value(r(_(er,t,o)))),_1:{ctor:"[]"}}})}),function(){return _(Wr,function(t){var r=qn(t);return"Ok"===r.ctor?Jr(r._0):qr(r._0)},ne)}()),Xu=function(t){return function(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return function(s){return{mailbox:t,id:r,from:e,to:n,subject:o,date:c,size:u,seen:i,text:a,html:_,attachments:s}}}}}}}}}}}},Zu=e(function(t,r,e){return{id:t,fileName:r,contentType:e}}),ti=s(xe,"content-type",ne,s(xe,"filename",ne,s(xe,"id",ne,be(Zu)))),ri=s(xe,"attachments",te(ti),s(xe,"html",ne,s(xe,"text",ne,s(xe,"seen",ee,s(xe,"size",re,s(xe,"date",Ku,l(Te,"subject",ne,"",s(xe,"to",te(ne),l(Te,"from",ne,"",s(xe,"id",ne,s(xe,"mailbox",ne,be(Xu)))))))))))),ei=i(function(t,r,e,n,o,c,u,i){return{mailbox:t,id:r,from:e,to:n,subject:o,date:c,size:u,seen:i}}),ni=s(xe,"seen",ee,s(xe,"size",re,s(xe,"date",Ku,l(Te,"subject",ne,"",s(xe,"to",te(ne),l(Te,"from",ne,"",s(xe,"id",ne,s(xe,"mailbox",ne,be(ei))))))))),oi=_(Qr,function(t){return _(V,function(t){return _(kt,0,Nt(t))},_(jt,",",t))},ne),ci=function(t){return function(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return function(s){return function(l){return function(f){return function(d){return function(p){return function(h){return function(v){return function(m){return function(g){return function(b){return function(y){return{sysMem:t,heapSize:r,heapUsed:e,heapObjects:n,goRoutines:o,webSockets:c,smtpConnOpen:u,smtpConnTotal:i,smtpConnHist:a,smtpReceivedTotal:_,smtpReceivedHist:s,smtpErrorsTotal:l,smtpErrorsHist:f,smtpWarnsTotal:d,smtpWarnsHist:p,retentionDeletesTotal:h,retentionDeletesHist:v,retainedCount:m,retainedCountHist:g,retainedSize:b,retainedSizeHist:y}}}}}}}}}}}}}}}}}}}}}},ui=s(we,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"SizeHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"RetainedSize",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"RetainedHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"RetainedCurrent",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"DeletesHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"DeletesTotal",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"WarnsHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"WarnsTotal",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ErrorsHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ErrorsTotal",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ReceivedHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ReceivedTotal",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ConnectsHist",_1:{ctor:"[]"}}},oi,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ConnectsTotal",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ConnectsCurrent",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"http",_1:{ctor:"::",_0:"WebSocketConnectsCurrent",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"goroutines",_1:{ctor:"[]"}},re,s(we,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"HeapObjects",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"HeapAlloc",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"HeapSys",_1:{ctor:"[]"}}},re,s(we,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"Sys",_1:{ctor:"[]"}}},re,be(ci)))))))))))))))))))))),ii=r(function(t,e){var n=t;switch(n.ctor){case"None":return e;case"SetFlash":return v.update(e,{flash:n._0});case"ClearFlash":return v.update(e,{flash:""});case"DisableRouting":return v.update(e,{routing:!1});case"EnableRouting":return v.update(e,{routing:!0});default:var o=n._0;if(v.eq(q(e.persistent.recentMailboxes),A(o)))return e;var c=e.persistent,u=_(r(function(t,r){return{ctor:"::",_0:t,_1:r}}),o,_(nt,7,_(G,r(function(t,r){return!v.eq(t,r)})(o),e.persistent.recentMailboxes)));return v.update(e,{persistent:v.update(c,{recentMailboxes:u})})}}),ai=n(function(t,r,e,n){return{host:t,flash:r,routing:e,persistent:n}}),_i=r(function(t,r){return l(ai,t.host,"",!0,r)}),si=function(t){return{recentMailboxes:t}},li=l(Te,"recentMailboxes",te(ne),{ctor:"[]"},be(si)),fi=function(t){return _(kt,{recentMailboxes:{ctor:"[]"}},_(Vr,li,t))},di=function(t){return{ctor:"AddRecent",_0:t}},pi={ctor:"EnableRouting"},hi={ctor:"DisableRouting"},vi={ctor:"ClearFlash"},mi=function(t){return{ctor:"SetFlash",_0:t}},gi={ctor:"None"},bi=gi,yi=function(t){var r=t;switch(r.ctor){case"BadUrl":return _(b["++"],"Bad URL: ",r._0);case"Timeout":return"HTTP timeout";case"NetworkError":return"HTTP Network error";case"BadStatus":return _(b["++"],"Bad HTTP status: ",y(r._0.status.code));default:return _(b["++"],"Bad HTTP payload: ",_(b["++"],r._0,_(b["++"]," (",_(b["++"],y(r._1.status.code),")"))))}},ki=r(function(t,r){return Dc({method:"PATCH",headers:{ctor:"[]"},url:t,body:r,expect:Ec(function(t){return wt({ctor:"_Tuple0"})}),timeout:C,withCredentials:!1})}),Ti=function(t){return Dc({method:"DELETE",headers:{ctor:"[]"},url:t,body:Lc,expect:Ec(function(t){return wt({ctor:"_Tuple0"})}),timeout:C,withCredentials:!1})},wi=ae.outgoingPort("monitorCommand",function(t){return t}),xi=ae.incomingPort("monitorMessage",Ur),Mi=ae.incomingPort("onSessionChange",Ur),Si=ae.outgoingPort("storeSession",function(t){return{recentMailboxes:D.toArray(t.recentMailboxes).map(function(t){return t})}}),Ni=ae.outgoingPort("windowTitle",function(t){return t}),Bi=r(function(t,r){return _(Vo,{ctor:"::",_0:_c("page"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("greeting"),_1:{ctor:"::",_0:_(uc,"innerHTML",Hr(r.greeting)),_1:{ctor:"[]"}}},{ctor:"[]"}),_1:{ctor:"[]"}})}),Ri=function(t){return{greeting:t}},Ei=e(function(t,r,e){var n=r;return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:Ri(n._0._0),_1:le,_2:bi}:{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))}}),Ci=function(t){return{ctor:"GreetingResult",_0:t}},Ai=_(Ic,Ci,function(t){return Dc({method:"GET",headers:{ctor:"[]"},url:t,body:Lc,expect:Ac,timeout:C,withCredentials:!1})}("/serve/greeting")),Oi={ctor:"_Tuple2",_0:Ri(""),_1:se({ctor:"::",_0:Ni("Inbucket"),_1:{ctor:"::",_0:Ai,_1:{ctor:"[]"}}})},Li=function(t){var r=function(){switch(t){case 11:case 12:case 13:return"th";default:switch(_(b["%"],t,10)){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}}();return _(b["++"],y(t),r)},Di=r(function(t,r){var e=y(r),n=t-Wt(e),o=_(zt,"",_(V,function(t){return"0"},_(it,1,n)));return _(b["++"],o,e)}),Pi=function(t){return v.eq(t,0)?12:v.cmp(t,12)<1?t:t-12},Fi=function(t){return v.cmp(Fn(t),11)>0?"pm":"am"},Ii=function(t){return y(jn(t))},Hi=function(t){var r=qn(_(b["++"],y(jn(t)),"-01-01T00:00:00.000Z"));return"Ok"===r.ctor?r._0:t},zi=function(t){switch(In(t).ctor){case"Mon":return"Monday";case"Tue":return"Tuesday";case"Wed":return"Wednesday";case"Thu":return"Thursday";case"Fri":return"Friday";case"Sat":return"Saturday";default:return"Sunday"}},ji=Hn,Ui=function(t){return!!v.eq(_(b["%"],t,4),0)&&(!v.eq(_(b["%"],t,100),0)||!!v.eq(_(b["%"],t,400),0))},Wi=r(function(t,r){switch(r.ctor){case"Jan":return 31;case"Feb":return Ui(t)?29:28;case"Mar":return 31;case"Apr":return 30;case"May":return 31;case"Jun":return 30;case"Jul":case"Aug":return 31;case"Sep":return 30;case"Oct":return 31;case"Nov":return 30;default:return 31}}),qi=function(t){switch(zn(t).ctor){case"Jan":return"January";case"Feb":return"February";case"Mar":return"March";case"Apr":return"April";case"May":return"May";case"Jun":return"June";case"Jul":return"July";case"Aug":return"August";case"Sep":return"September";case"Oct":return"October";case"Nov":return"November";default:return"December"}},Ji={ctor:"::",_0:Jn,_1:{ctor:"::",_0:Kn,_1:{ctor:"::",_0:$n,_1:{ctor:"::",_0:Qn,_1:{ctor:"::",_0:Yn,_1:{ctor:"::",_0:Gn,_1:{ctor:"::",_0:Vn,_1:{ctor:"[]"}}}}}}}},Vi=function(t){return function(t){return t._0}(_(E,{ctor:"_Tuple2",_0:0,_1:Jn},q(_(G,function(r){var e=r;return v.eq(e._1,In(t))},_(at,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),Ji)))))},Gi={ctor:"::",_0:_o,_1:{ctor:"::",_0:ao,_1:{ctor:"::",_0:io,_1:{ctor:"::",_0:uo,_1:{ctor:"::",_0:co,_1:{ctor:"::",_0:oo,_1:{ctor:"::",_0:no,_1:{ctor:"::",_0:eo,_1:{ctor:"::",_0:ro,_1:{ctor:"::",_0:to,_1:{ctor:"::",_0:Zn,_1:{ctor:"::",_0:Xn,_1:{ctor:"[]"}}}}}}}}}}}}},Yi=function(t){return _(E,{ctor:"_Tuple2",_0:0,_1:_o},q(_(G,function(r){var e=r;return v.eq(e._1,zn(t))},_(at,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),Gi))))},Qi=function(t){return _(r(function(t,r){return t+r}),1,function(t){return t._0}(Yi(t)))},$i=function(t){return Qi(t)/4|0},Ki=function(t){var r=_(nt,Qi(t)-1,Gi);return j(_(V,Wi(jn(t)),r))+ji(t)},Xi=function(t){var r=Hi(t),e=Vi(r);return 1+((Ki(t)+e)/7|0)},Zi=r(function(t,e){var n=e;switch(n.ctor){case"MonthNumber":return y(Qi(t));case"MonthSuffix":return Li(Qi(t));case"MonthFixed":return _(Di,2,Qi(t));case"MonthNameFirst":return _(Ft,n._0,qi(t));case"MonthNameFull":return qi(t);case"QuarterNumber":return y(_(r(function(t,r){return t+r}),1,$i(t)));case"QuarterSuffix":return Li(_(r(function(t,r){return t+r}),1,$i(t)));case"DayOfMonthNumber":return y(ji(t));case"DayOfMonthSuffix":return Li(ji(t));case"DayOfMonthFixed":return _(Di,2,ji(t));case"DayOfYearNumber":return y(Ki(t));case"DayOfYearSuffix":return Li(Ki(t));case"DayOfYearFixed":return _(Di,3,Ki(t));case"DayOfWeekNumber":return y(Vi(t));case"DayOfWeekSuffix":return Li(Vi(t));case"DayOfWeekNameFirst":return _(Ft,n._0,zi(t));case"DayOfWeekNameFull":return zi(t);case"WeekOfYearNumber":return y(Xi(t));case"WeekOfYearSuffix":return Li(Xi(t));case"WeekOfYearFixed":return _(Di,2,Xi(t));case"YearNumberLastTwo":return _(Pt,2,Ii(t));case"YearNumber":return Ii(t);case"AmPmUppercase":return At(Fi(t));case"AmPmLowercase":return Ct(Fi(t));case"HourMilitaryNumber":return y(Fn(t));case"HourMilitaryFixed":return _(Di,2,Fn(t));case"HourNumber":return y(Pi(Fn(t)));case"HourFixed":return _(Di,2,Pi(Fn(t)));case"HourMilitaryFromOneNumber":return y(_(r(function(t,r){return t+r}),1,Fn(t)));case"HourMilitaryFromOneFixed":return _(Di,2,_(r(function(t,r){return t+r}),1,Fn(t)));case"MinuteNumber":return y(Pn(t));case"MinuteFixed":return _(Di,2,Pn(t));case"SecondNumber":return y(Dn(t));case"SecondFixed":return _(Di,2,Dn(t));default:return n._0}}),ta=r(function(t,r){return _(zt,"",_(V,Zi(r),t))}),ra=(e(function(t,r,e){return{month:t,day:r,year:e}}),function(t){return{ctor:"Text",_0:t}}),ea=ra,na={ctor:"SecondFixed"},oa=na,ca={ctor:"MinuteFixed"},ua=ca,ia={ctor:"HourNumber"},aa=ia,_a={ctor:"AmPmUppercase"},sa=_a,la={ctor:"YearNumber"},fa=la,da=function(t){return{ctor:"DayOfWeekNameFirst",_0:t}},pa=(da(2),da(3),{ctor:"DayOfMonthFixed"}),ha=pa,va={ctor:"DayOfMonthSuffix"},ma=va,ga={ctor:"MonthNameFull"},ba=ga,ya=function(t){return{ctor:"MonthNameFirst",_0:t}}(3),ka=function(t){return v.cmp(t,2)<0?"in a year":_(b["++"],"in ",_(b["++"],y(t)," years"))},Ta=function(t){return v.cmp(t,2)<0?"in a month":_(b["++"],"in ",_(b["++"],y(t)," months"))},wa=function(t){return v.cmp(t,2)<0?"tomorrow":_(b["++"],"in ",_(b["++"],y(t)," days"))},xa=function(t){return v.cmp(t,2)<0?"in an hour":_(b["++"],"in ",_(b["++"],y(t)," hours"))},Ma=function(t){return v.cmp(t,2)<0?"in a minute":_(b["++"],"in ",_(b["++"],y(t)," minutes"))},Sa=function(t){return v.cmp(t,30)<0?"in a few seconds":_(b["++"],"in ",_(b["++"],y(t)," seconds"))},Na=function(t){return v.cmp(t,2)<0?"last year":_(b["++"],y(t)," years ago")},Ba=function(t){return v.cmp(t,2)<0?"last month":_(b["++"],y(t)," months ago")},Ra=function(t){return v.cmp(t,2)<0?"yesterday":_(b["++"],y(t)," days ago")},Ea=function(t){return v.cmp(t,2)<0?"an hour ago":_(b["++"],y(t)," hours ago")},Ca=function(t){return v.cmp(t,2)<0?"a minute ago":_(b["++"],y(t)," minutes ago")},Aa=function(t){return v.cmp(t,30)<0?"just now":_(b["++"],y(t)," seconds ago")},Oa=r(function(t,r){return v.cmp(wn(t),1)<0?r.seconds(x(xn(t))):v.cmp(Tn(t),1)<0?r.minutes(x(wn(t))):v.cmp(Tn(t),24)<0?r.hours(x(Tn(t)/1)):v.cmp(Tn(t),720)<0?r.days(x(Tn(t)/24)):v.cmp(Tn(t),8760)<0?r.months(x(Tn(t)/24/12)):r.years(x(Tn(t)/24/365))}),La=function(t){return xn(Wn(t))},Da={someSecondsAgo:Aa,someMinutesAgo:Ca,someHoursAgo:Ea,someDaysAgo:Ra,someMonthsAgo:Ba,someYearsAgo:Na,inSomeSeconds:Sa,inSomeMinutes:Ma,inSomeHours:xa,inSomeDays:wa,inSomeMonths:Ta,inSomeYears:ka},Pa=c(function(t,r,e,n,o,c){return{seconds:t,minutes:r,hours:e,days:n,months:o,years:c}}),Fa=e(function(t,r,e){var n=La(e)-La(r),o=1e3*B(n);return _(Oa,o,v.cmp(n,0)<0?d(Pa,t.someSecondsAgo,t.someMinutesAgo,t.someHoursAgo,t.someDaysAgo,t.someMonthsAgo,t.someYearsAgo):d(Pa,t.inSomeSeconds,t.inSomeMinutes,t.inSomeHours,t.inSomeDays,t.inSomeMonths,t.inSomeYears))}),Ia=Fa(Da),Ha=function(t){var r=function(){var r=t;switch(r.ctor){case"Unknown":case"Home":return{ctor:"[]"};case"Mailbox":return{ctor:"::",_0:"m",_1:{ctor:"::",_0:r._0,_1:{ctor:"[]"}}};case"Message":return{ctor:"::",_0:"m",_1:{ctor:"::",_0:r._0,_1:{ctor:"::",_0:r._1,_1:{ctor:"[]"}}}};case"Monitor":return{ctor:"::",_0:"monitor",_1:{ctor:"[]"}};default:return{ctor:"::",_0:"status",_1:{ctor:"[]"}}}}();return _(b["++"],"/#/",_(zt,"/",r))},za=function(t){return dc(Ha(t))},ja=function(t){return ou(Ha(t))},Ua={ctor:"Status"},Wa={ctor:"Monitor"},qa=r(function(t,r){return{ctor:"Message",_0:t,_1:r}}),Ja=function(t){return{ctor:"Mailbox",_0:t}},Va={ctor:"Home"},Ga=function(t){return qu(function(r){return _(Z,function(t){return t._0(r)},t)})}({ctor:"::",_0:_(Qu,Va,Ju("")),_1:{ctor:"::",_0:_(Qu,qa,_(Yu[""],Ju("m"),_(Yu[""],Gu,Gu))),_1:{ctor:"::",_0:_(Qu,Ja,_(Yu[""],Ju("m"),Gu)),_1:{ctor:"::",_0:_(Qu,Wa,Ju("monitor")),_1:{ctor:"::",_0:_(Qu,Ua,Ju("status")),_1:{ctor:"[]"}}}}}}),Ya=function(t){return{ctor:"Unknown",_0:t}},Qa=function(t){if(Yt(t.hash))return Va;var r=_(ju,Ga,t);return"Nothing"===r.ctor?Ya(t.hash):r._0},$a=function(t){return v.eq(t.searchFilter,"")?t.headers:_(G,function(r){return _(Et,t.searchFilter,Ct(r.subject))||_(Et,t.searchFilter,Ct(r.from))},t.headers)},Ka=function(t){return Eo(_(ta,{ctor:"::",_0:ba,_1:{ctor:"::",_0:ea(" "),_1:{ctor:"::",_0:ma,_1:{ctor:"::",_0:ea(", "),_1:{ctor:"::",_0:fa,_1:{ctor:"::",_0:ea(" "),_1:{ctor:"::",_0:aa,_1:{ctor:"::",_0:ea(":"),_1:{ctor:"::",_0:ua,_1:{ctor:"::",_0:ea(":"),_1:{ctor:"::",_0:oa,_1:{ctor:"::",_0:ea(" "),_1:{ctor:"::",_0:sa,_1:{ctor:"[]"}}}}}}}}}}}}}},t))},Xa=r(function(t,r){return Eo(_(Ia,t.now,r))}),Za=r(function(t,r){var e=_(b["++"],t,_(b["++"],r.id,_(b["++"],"/",r.fileName)));return _(Zo,{ctor:"[]"},{ctor:"::",_0:_(tc,{ctor:"[]"},{ctor:"::",_0:_(Go,{ctor:"::",_0:dc(e),_1:{ctor:"::",_0:pc("_blank"),_1:{ctor:"[]"}}},{ctor:"::",_0:Eo(r.fileName),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Eo(_(b["++"]," (",_(b["++"],r.contentType,") "))),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_(tc,{ctor:"[]"},{ctor:"::",_0:_(Go,{ctor:"::",_0:dc(e),_1:{ctor:"::",_0:hc(r.fileName),_1:{ctor:"::",_0:ac("button"),_1:{ctor:"[]"}}}},{ctor:"::",_0:Eo("Download"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}})}),t_=function(t){var r=_(b["++"],"/serve/m/attach/",_(b["++"],t.mailbox,_(b["++"],"/",_(b["++"],t.id,"/"))));return U(t.attachments)?_(Vo,{ctor:"[]"},{ctor:"[]"}):_($o,{ctor:"::",_0:ac("attachments well"),_1:{ctor:"[]"}},_(V,Za(r),t.attachments))},r_=e(function(t,r,e){return{headers:t,selected:r,searchFilter:e}}),e_=r(function(t,r){return{message:t,markSeenAt:r}}),n_=o(function(t,r,e,n,o){return{mailboxName:t,state:r,bodyMode:e,searchInput:n,now:o}}),o_={ctor:"SafeHtmlBody"},c_={ctor:"TextBody"},u_=r(function(t,r){return{ctor:"ShowingList",_0:t,_1:r}}),i_=r(function(t,r){var e=v.cmp(Wt(r),1)>0?Ct(r):"",n=t.state;return"LoadingList"===n.ctor?{ctor:"_Tuple3",_0:t,_1:le,_2:bi}:{ctor:"_Tuple3",_0:v.update(t,{searchInput:r,state:_(u_,v.update(n._0,{searchFilter:e}),n._1)}),_1:le,_2:bi}}),a_=function(t){return{ctor:"LoadingList",_0:t}},__=function(t){return{ctor:"Transitioning",_0:t}},s_=function(t){return{ctor:"ShowingMessage",_0:t}},l_={ctor:"LoadingMessage"},f_=r(function(t,r){var e=t.state;if("LoadingList"===e.ctor)return t;var n=v.update(e._0,{selected:A(r)}),o=e._1;switch(o.ctor){case"NoMessage":case"LoadingMessage":return v.update(t,{state:_(u_,n,l_)});case"ShowingMessage":default:return v.update(t,{state:_(u_,n,__(o._0))})}}),d_={ctor:"NoMessage"},p_=function(t){return{ctor:"ViewMessage",_0:t}},h_=function(t){return{ctor:"Tick",_0:t}},v_=function(t){return{ctor:"SeenTick",_0:t}},m_=function(t){var r=function(){var r=t.state;return"ShowingList"===r.ctor&&"ShowingMessage"===r._1.ctor?r._1._0.message.seen?he:_(An,250,v_):he}();return pe({ctor:"::",_0:_(An,3e4,h_),_1:{ctor:"::",_0:r,_1:{ctor:"[]"}}})},g_=function(t){return{ctor:"SearchInput",_0:t}},b_=function(t){return{ctor:"PurgeResult",_0:t}},y_=function(t){var r=_(Ic,b_,Ti(_(b["++"],"/api/v1/mailbox/",t.mailboxName)));return"ShowingList"===t.state.ctor?{ctor:"_Tuple3",_0:v.update(t,{state:_(u_,s(r_,{ctor:"[]"},C,""),d_)}),_1:r,_2:bi}:{ctor:"_Tuple3",_0:t,_1:r,_2:bi}},k_={ctor:"Purge"},T_=function(t){return{ctor:"OpenedTime",_0:t}},w_=r(function(t,r){var e=v.eq(r.html,"")?c_:t.bodyMode,n=t.state;return"LoadingList"===n.ctor?{ctor:"_Tuple3",_0:t,_1:le,_2:bi}:{ctor:"_Tuple3",_0:v.update(t,{state:_(u_,v.update(n._0,{selected:A(r.id)}),s_(_(e_,r,C))),bodyMode:e}),_1:_(hn,T_,Mn),_2:bi}}),x_=function(t){return{ctor:"MessageBody",_0:t}},M_=r(function(t,e){var n=r(function(t,r){return _(Go,{ctor:"::",_0:vc({ctor:"::",_0:{ctor:"_Tuple2",_0:"active",_1:v.eq(e,t)},_1:{ctor:"[]"}}),_1:{ctor:"::",_0:xc(x_(t)),_1:{ctor:"::",_0:dc("javacript:void(0)"),_1:{ctor:"[]"}}}},{ctor:"::",_0:Eo(r),_1:{ctor:"[]"}})}),o=_(n,o_,"Safe HTML"),c=_(n,c_,"Plain Text"),u=v.eq(t.html,"")?{ctor:"::",_0:c,_1:{ctor:"[]"}}:{ctor:"::",_0:o,_1:{ctor:"::",_0:c,_1:{ctor:"[]"}}};return _(Vo,{ctor:"::",_0:ac("tab-panel"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Ao,{ctor:"::",_0:ac("tab-bar"),_1:{ctor:"[]"}},u),_1:{ctor:"::",_0:_(Oo,{ctor:"::",_0:ac("message-body"),_1:{ctor:"[]"}},{ctor:"::",_0:function(){return"SafeHtmlBody"===e.ctor?_(Vo,{ctor:"::",_0:_(uc,"innerHTML",Hr(t.html)),_1:{ctor:"[]"}},{ctor:"[]"}):_(Vo,{ctor:"::",_0:_(uc,"innerHTML",Hr(t.text)),_1:{ctor:"[]"}},{ctor:"[]"})}(),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}})}),S_=function(t){return{ctor:"MessageResult",_0:t}},N_=r(function(t,r){var e=_(b["++"],"/serve/m/",_(b["++"],t,_(b["++"],"/",r)));return _(Ic,S_,_(Pc,e,ri))}),B_=function(t){return{ctor:"MarkSeenResult",_0:t}},R_=r(function(t,e){var n=t.state;if("ShowingList"===n.ctor&&"ShowingMessage"===n._1.ctor){var o=r(function(t,r){return v.update(r,{headers:_(V,t,r.headers)})}),c=_(b["++"],"/api/v1/mailbox/",_(b["++"],e.mailbox,_(b["++"],"/",e.id))),u=_(Ic,B_,_(ki,c,Oc(Fr({ctor:"::",_0:{ctor:"_Tuple2",_0:"seen",_1:Ir(!0)},_1:{ctor:"[]"}})))),i=function(t){return v.eq(t.id,e.id)?v.update(t,{seen:!0}):t};return{ctor:"_Tuple3",_0:v.update(t,{state:_(u_,_(o,i,n._0),s_(v.update(n._1._0,{message:v.update(e,{seen:!0}),markSeenAt:C})))}),_1:u,_2:gi}}return{ctor:"_Tuple3",_0:t,_1:le,_2:bi}}),E_=function(t){return{ctor:"ListResult",_0:t}},C_=function(t){var r=_(b["++"],"/api/v1/mailbox/",t);return _(Ic,E_,_(Pc,r,te(ni)))},A_=function(t){return se({ctor:"::",_0:Ni(_(b["++"],t," - Inbucket")),_1:{ctor:"::",_0:_(hn,h_,Mn),_1:{ctor:"::",_0:C_(t),_1:{ctor:"[]"}}}})},O_=r(function(t,r){return{ctor:"_Tuple2",_0:f(n_,t,a_(r),o_,"",Un(0)),_1:A_(t)}}),L_=function(t){return{ctor:"DeleteMessageResult",_0:t}},D_=r(function(t,e){var n=r(function(t,r){return v.update(r,{headers:_(G,t,r.headers)})}),o=_(b["++"],"/api/v1/mailbox/",_(b["++"],e.mailbox,_(b["++"],"/",e.id))),c=_(Ic,L_,Ti(o)),u=t.state;return"ShowingList"===u.ctor?{ctor:"_Tuple3",_0:v.update(t,{state:_(u_,_(n,function(t){return!v.eq(t.id,e.id)},u._0),d_)}),_1:c,_2:bi}:{ctor:"_Tuple3",_0:t,_1:c,_2:bi}}),P_=e(function(t,r,e){t:for(;;){var n=r;switch(n.ctor){case"ClickMessage":var o=n._0;return{ctor:"_Tuple3",_0:_(f_,e,o),_1:se({ctor:"::",_0:ja(_(qa,e.mailboxName,o)),_1:{ctor:"::",_0:_(N_,e.mailboxName,o),_1:{ctor:"[]"}}}),_2:hi};case"ViewMessage":var c=n._0;return{ctor:"_Tuple3",_0:_(f_,e,c),_1:_(N_,e.mailboxName,c),_2:di(e.mailboxName)};case"DeleteMessage":return _(D_,e,n._0);case"DeleteMessageResult":return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:e,_1:le,_2:bi}:{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))};case"ListResult":if("Ok"===n._0.ctor){var u=e.state;if("LoadingList"===u.ctor){var i=v.update(e,{state:_(u_,s(r_,n._0._0,C,""),d_)}),a=u._0;if("Just"===a.ctor){var l=t,f=p_(a._0),d=i;t=l,r=f,e=d;continue t}return{ctor:"_Tuple3",_0:i,_1:le,_2:di(e.mailboxName)}}return{ctor:"_Tuple3",_0:e,_1:le,_2:bi}}return{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))};case"MarkSeenResult":return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:e,_1:le,_2:bi}:{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))};case"MessageResult":return"Ok"===n._0.ctor?_(w_,e,n._0._0):{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))};case"MessageBody":return{ctor:"_Tuple3",_0:v.update(e,{bodyMode:n._0}),_1:le,_2:bi};case"SearchInput":return _(i_,e,n._0);case"OpenedTime":var p=e.state;if("ShowingList"===p.ctor&&"ShowingMessage"===p._1.ctor){var h=p._1._0;return h.message.seen?{ctor:"_Tuple3",_0:e,_1:le,_2:bi}:{ctor:"_Tuple3",_0:v.update(e,{state:_(u_,p._0,s_(v.update(h,{markSeenAt:A(n._0+1500)})))}),_1:le,_2:bi}}return{ctor:"_Tuple3",_0:e,_1:le,_2:bi};case"Purge":return y_(e);case"PurgeResult":return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:e,_1:le,_2:bi}:{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))};case"SeenTick":var m=e.state;if("ShowingList"===m.ctor&&"ShowingMessage"===m._1.ctor){var g=m._1._0.markSeenAt;return"Just"===g.ctor&&v.cmp(n._0,g._0)>-1?_(R_,e,m._1._0.message):{ctor:"_Tuple3",_0:e,_1:le,_2:bi}}return{ctor:"_Tuple3",_0:e,_1:le,_2:bi};default:return{ctor:"_Tuple3",_0:v.update(e,{now:Un(n._0)}),_1:le,_2:bi}}}}),F_=function(t){return{ctor:"DeleteMessage",_0:t}},I_=r(function(t,r){return _(Vo,{ctor:"[]"},{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("button-bar"),_1:{ctor:"[]"}},{ctor:"::",_0:_(oc,{ctor:"::",_0:ac("danger"),_1:{ctor:"::",_0:xc(F_(t)),_1:{ctor:"[]"}}},{ctor:"::",_0:Eo("Delete"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Go,{ctor:"::",_0:dc(function(t){return _(b["++"],"/serve/m/",_(b["++"],t.mailbox,_(b["++"],"/",_(b["++"],t.id,"/source"))))}(t)),_1:{ctor:"::",_0:pc("_blank"),_1:{ctor:"[]"}}},{ctor:"::",_0:_(oc,{ctor:"[]"},{ctor:"::",_0:Eo("Source"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_(Wo,{ctor:"::",_0:_c("message-header"),_1:{ctor:"[]"}},{ctor:"::",_0:_(qo,{ctor:"[]"},{ctor:"::",_0:Eo("From:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Jo,{ctor:"[]"},{ctor:"::",_0:Eo(t.from),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(qo,{ctor:"[]"},{ctor:"::",_0:Eo("To:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Jo,{ctor:"[]"},_(V,Eo,t.to)),_1:{ctor:"::",_0:_(qo,{ctor:"[]"},{ctor:"::",_0:Eo("Date:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Jo,{ctor:"[]"},{ctor:"::",_0:Ka(t.date),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(qo,{ctor:"[]"},{ctor:"::",_0:Eo("Subject:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Jo,{ctor:"[]"},{ctor:"::",_0:Eo(t.subject),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}}}}}}),_1:{ctor:"::",_0:_(M_,t,r),_1:{ctor:"::",_0:t_(t),_1:{ctor:"[]"}}}}})}),H_=function(t){return{ctor:"ClickMessage",_0:t}},z_=e(function(t,r,e){return _(Vo,{ctor:"::",_0:vc({ctor:"::",_0:{ctor:"_Tuple2",_0:"message-list-entry",_1:!0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:"selected",_1:v.eq(r,A(e.id))},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:"unseen",_1:!e.seen},_1:{ctor:"[]"}}}}),_1:{ctor:"::",_0:xc(H_(e.id)),_1:{ctor:"[]"}}},{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("subject"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(e.subject),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("from"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(e.from),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("date"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Xa,t,e.date),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}})}),j_=r(function(t,r){return _(Lo,{ctor:"::",_0:_c("message-list"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Vo,{ctor:"[]"},{ctor:"::",_0:_(nc,{ctor:"::",_0:sc("search"),_1:{ctor:"::",_0:fc("search"),_1:{ctor:"::",_0:wc(g_),_1:{ctor:"::",_0:lc(r.searchInput),_1:{ctor:"[]"}}}}},{ctor:"[]"}),_1:{ctor:"::",_0:_(oc,{ctor:"::",_0:xc(k_),_1:{ctor:"[]"}},{ctor:"::",_0:Eo("Purge"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:function(){var t=r.state;if("LoadingList"===t.ctor)return _(Vo,{ctor:"[]"},{ctor:"[]"});var e=t._0;return _(Vo,{ctor:"[]"},_(V,_(z_,r,e.selected),$($a(e))))}(),_1:{ctor:"[]"}}})}),U_=r(function(t,r){return _(Vo,{ctor:"::",_0:_c("page"),_1:{ctor:"::",_0:ac("mailbox"),_1:{ctor:"[]"}}},{ctor:"::",_0:_(j_,t,r),_1:{ctor:"::",_0:_(Ho,{ctor:"::",_0:_c("message"),_1:{ctor:"[]"}},{ctor:"::",_0:function(){var t=r.state;t:do{if("ShowingList"!==t.ctor)break t;switch(t._1.ctor){case"NoMessage":return Eo(_(b["++"],"Select a message on the left,"," or enter a different username into the box on upper right."));case"ShowingMessage":case"Transitioning":return _(I_,t._1._0.message,r.bodyMode);default:break t}}while(!1);return Eo("")}(),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}})}),W_=function(t){return Eo(_(ta,{ctor:"::",_0:ha,_1:{ctor:"::",_0:ea("-"),_1:{ctor:"::",_0:ya,_1:{ctor:"::",_0:ea(" "),_1:{ctor:"::",_0:aa,_1:{ctor:"::",_0:ea(":"),_1:{ctor:"::",_0:ua,_1:{ctor:"::",_0:ea(" "),_1:{ctor:"::",_0:sa,_1:{ctor:"[]"}}}}}}}}}},t))},q_=e(function(t,r,e){var n=r;if("MonitorResult"===n.ctor)return"Ok"===n._0.ctor?"Connected"===n._0._0.ctor?{ctor:"_Tuple3",_0:v.update(e,{connected:n._0._0._0}),_1:le,_2:bi}:{ctor:"_Tuple3",_0:v.update(e,{messages:{ctor:"::",_0:n._0._0._0,_1:e.messages}}),_1:le,_2:bi}:{ctor:"_Tuple3",_0:e,_1:le,_2:mi(n._0._0)};var o=n._0;return{ctor:"_Tuple3",_0:e,_1:ja(_(qa,o.mailbox,o.id)),_2:bi}}),J_=r(function(t,r){return{connected:t,messages:r}}),V_={ctor:"_Tuple2",_0:_(J_,!1,{ctor:"[]"}),_1:se({ctor:"::",_0:Ni("Inbucket Monitor"),_1:{ctor:"::",_0:wi(!0),_1:{ctor:"[]"}}})},G_=function(t){return{ctor:"OpenMessage",_0:t}},Y_=function(t){return _(Zo,{ctor:"::",_0:xc(G_(t)),_1:{ctor:"[]"}},{ctor:"::",_0:_(tc,{ctor:"[]"},{ctor:"::",_0:W_(t.date),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(tc,{ctor:"::",_0:ac("desktop"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(t.from),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(tc,{ctor:"[]"},{ctor:"::",_0:Eo(t.mailbox),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(tc,{ctor:"[]"},{ctor:"::",_0:Eo(t.subject),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}})},Q_=r(function(t,r){return _(Vo,{ctor:"::",_0:_c("page"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Do,{ctor:"[]"},{ctor:"::",_0:Eo("Monitor"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(zo,{ctor:"[]"},{ctor:"::",_0:Eo("Messages will be listed here shortly after delivery. "),_1:{ctor:"::",_0:_(Yo,{ctor:"[]"},{ctor:"::",_0:Eo(r.connected?"Connected.":"Disconnected!"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_($o,{ctor:"::",_0:_c("monitor"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Xo,{ctor:"[]"},{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:Eo("Date"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(rc,{ctor:"::",_0:ac("desktop"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo("From"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:Eo("Mailbox"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:Eo("Subject"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}}),_1:{ctor:"::",_0:_(Ko,{ctor:"[]"},_(V,Y_,r.messages)),_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})}),$_=function(t){return{ctor:"MonitorResult",_0:t}},K_=function(t){return{ctor:"Message",_0:t}},X_=function(t){return{ctor:"Connected",_0:t}},Z_=function(t){var r=xi(Vr($r({ctor:"::",_0:_(Qr,K_,ni),_1:{ctor:"::",_0:_(Qr,X_,ee),_1:{ctor:"[]"}}})));return _(ve,$_,r)},ts=ts||{};ts["*="]=r(function(t,r){return t(_(zt," ",_(V,y,r)))});var ts=ts||{};ts[":="]=r(function(t,r){return t(y(r))});var rs=r(function(t,r){var e=t;return _(V,function(t){var r=t;return{ctor:"_Tuple2",_0:e._0(r._0),_1:e._1(r._1)}},r)}),es=function(t){return!0===T(t)?0:t},ns=r(function(t,r){var e=t,n=r,o=n._1._1,c=n._0._0;return{ctor:"_Tuple2",_0:function(t){return es((t-c)*(e._0/(n._1._0-c)))},_1:function(t){return es((o-t)*(e._1/(o-n._0._1)))}}}),os=function(t){var r=t,e=r._1._1,n=r._0._1,o=r._1._0,c=r._0._0;return v.eq(n,e)?{ctor:"_Tuple2",_0:{ctor:"_Tuple2",_0:c,_1:_(S,0,n)},_1:{ctor:"_Tuple2",_0:o,_1:e}}:{ctor:"_Tuple2",_0:{ctor:"_Tuple2",_0:c,_1:n},_1:{ctor:"_Tuple2",_0:o,_1:e}}},cs=function(t){var e=_(Z,function(t){return t},t),n=_(E,{ctor:"_Tuple2",_0:0,_1:0},q(e));return os(s(I,r(function(t,r){var e=t,n=e._1,o=e._0,c=r;return{ctor:"_Tuple2",_0:{ctor:"_Tuple2",_0:_(S,c._0._0,o),_1:_(S,c._0._1,n)},_1:{ctor:"_Tuple2",_0:_(M,c._1._0,o),_1:_(M,c._1._1,n)}}}),{ctor:"_Tuple2",_0:n,_1:n},e))},us=r(function(t,r){var e=t,n=v.eq(r,"")?"M":"L";return _(b["++"],r,_(b["++"],n,_(b["++"],y(e._0),_(b["++"]," ",y(e._1)))))}),is=r(function(t,r){return s(I,us,"",_(rs,t,r))}),as=o(function(t,r,e,n,o){var c=ft(t);return _(Z,function(t){var r=t,n=_(_t,r._0,c);return"Nothing"===n.ctor?{ctor:"[]"}:{ctor:"::",_0:_(Tu,_(b["++"],{ctor:"::",_0:_(ts[":="],Nu,r._1._0),_1:{ctor:"::",_0:_(ts[":="],Su,r._1._1),_1:{ctor:"[]"}}},_(b["++"],e,n._0._1)),{ctor:"::",_0:pu(n._0._2),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}},st(ft(_(rs,o,r))))}),_s=o(function(t,r,e,n,o){var c=n,u=c._0._0,i=o,a=i._1;return _(V,function(r){var n=r,o=n._1,s=n._0,l=v.cmp(o,0)<0?{ctor:"_Tuple2",_0:a(o)-(a(o)-a(0)),_1:a(o)-a(0)}:{ctor:"_Tuple2",_0:a(o),_1:a(0)-a(o)},f=l._0,d=l._1,p=t*((s-u)/(c._1._0-u));return _(ku,_(b["++"],{ctor:"::",_0:_(ts[":="],Nu,i._0(s)-p),_1:{ctor:"::",_0:_(ts[":="],Su,f),_1:{ctor:"::",_0:_(ts[":="],Bu,t),_1:{ctor:"::",_0:_(ts[":="],Au,d),_1:{ctor:"[]"}}}}},e),{ctor:"[]"})},r)}),ss=n(function(t,r,e,n){return _(V,function(t){var e=t;return _(bu,_(b["++"],{ctor:"::",_0:_(ts[":="],Du,e._0),_1:{ctor:"::",_0:_(ts[":="],Lu,e._1),_1:{ctor:"::",_0:_(ts[":="],Cu,2),_1:{ctor:"[]"}}}},r),{ctor:"[]"})},_(rs,n,t))}),ls=n(function(t,r,e,n){return{ctor:"::",_0:_(yu,_(b["++"],{ctor:"::",_0:Mu("none"),_1:{ctor:"::",_0:wu("#000"),_1:{ctor:"::",_0:_(ts[":="],xu,1),_1:{ctor:"::",_0:Ou(_(is,n,t)),_1:{ctor:"[]"}}}}},r),{ctor:"[]"}),_1:{ctor:"[]"}}}),fs=n(function(t,r,e,n){var o=e,c=o._0._0,u=o._0._1,i=o._1._0,a=(o._1._1,{ctor:"_Tuple2",_0:c,_1:u}),s={ctor:"_Tuple2",_0:i,_1:u},f=_(b["++"],{ctor:"::",_0:a,_1:{ctor:"[]"}},_(b["++"],t,{ctor:"::",_0:s,_1:{ctor:"[]"}}));return l(ls,f,r,e,n)}),ds=n(function(t,r,e,n){return{ctor:"[]"}}),ps=n(function(t,r,e,n){var o=e,c=o._0._0,u=(o._0._1,o._1._0);o._1._1;return l(ls,{ctor:"::",_0:{ctor:"_Tuple2",_0:c,_1:0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:u,_1:0},_1:{ctor:"[]"}}},r,e,n)}),hs=r(function(t,r){var e=t,n=e._0,o=e._3,c=e._2,u=e._1;return _(mu,{ctor:"::",_0:_(ts[":="],Bu,n+2*c),_1:{ctor:"::",_0:_(ts[":="],Au,u+2*o),_1:{ctor:"::",_0:_(ts["*="],Ru,{ctor:"::",_0:0,_1:{ctor:"::",_0:0,_1:{ctor:"::",_0:n+2*c,_1:{ctor:"::",_0:u+2*o,_1:{ctor:"[]"}}}}}),_1:{ctor:"[]"}}}},{ctor:"::",_0:_(gu,{ctor:"::",_0:Eu(_(b["++"],"translate",y({ctor:"_Tuple2",_0:c,_1:o}))),_1:{ctor:"[]"}},r),_1:{ctor:"[]"}})}),vs=function(t){var r=t;switch(r.ctor){case"Bar":return{ctor:"_Tuple4",_0:_s(r._0),_1:r._1,_2:{ctor:"[]"},_3:!1};case"Dot":return{ctor:"_Tuple4",_0:ss,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Line":return{ctor:"_Tuple4",_0:ls,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Area":return{ctor:"_Tuple4",_0:fs,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Domain":return{ctor:"_Tuple4",_0:ds,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Label":var e=r._0,n=_(V,function(t){return t._0},e);return{ctor:"_Tuple4",_0:as(e),_1:n,_2:{ctor:"[]"},_3:!1};case"ZeroLine":return{ctor:"_Tuple4",_0:ps,_1:{ctor:"[]"},_2:{ctor:"[]"},_3:!1};case"Independent":var o=vs(r._0),c=o._0,u=o._1;return{ctor:"_Tuple4",_0:c,_1:u,_2:o._2,_3:!0};default:var i=vs(r._1),c=i._0,u=i._1,a=i._3;return{ctor:"_Tuple4",_0:c,_1:u,_2:r._0,_3:a}}},ms=r(function(t,r){var e=_(V,vs,r),n=cs(_(Z,function(t){return{ctor:"::",_0:t._1,_1:{ctor:"[]"}}},_(G,function(t){var r=t;return!v.eq(r._3,!0)},e))),o=_(ns,t,n);return _(hs,t,_(Z,function(r){var e=r,c=e._1,u=v.eq(e._3,!0)?{ctor:"_Tuple2",_0:cs({ctor:"::",_0:c,_1:{ctor:"[]"}}),_1:_(ns,t,cs({ctor:"::",_0:c,_1:{ctor:"[]"}}))}:{ctor:"_Tuple2",_0:n,_1:o},i=u._0,a=u._1;return l(e._0,c,e._2,i,a)},e))}),gs=r(function(t,r){return{ctor:"Style",_0:t,_1:r}}),bs={ctor:"ZeroLine"},ys=function(t){return{ctor:"Domain",_0:t}},ks=function(t){return{ctor:"Area",_0:t}},Ts=r(function(t,r){return{ctor:"Bar",_0:t,_1:r}}),ws=function(t){var r=function(t){return v.cmp(Wt(t),3)<1?t:_(b["++"],r(s(It,0,-3,t)),_(b["++"],",",_(Pt,3,t)))};return r(y(t))},xs=function(t){var r=60-z(t);return v.cmp(r,0)>0?_(b["++"],_(ct,r,0),t):t},Ms=function(t){var e=_(E,{ctor:"[]"},W(t));return s(P,r(function(t,r){return t-r}),e,t)},Ss=r(function(t,r){return _(Vo,{ctor:"::",_0:ac("metric-panel"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Po,{ctor:"[]"},{ctor:"::",_0:Eo(t),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("metrics"),_1:{ctor:"[]"}},r),_1:{ctor:"[]"}}})}),Ns=gs({ctor:"::",_0:wu("rgba(0,0,0,0.2)"),_1:{ctor:"::",_0:xu("1.0"),_1:{ctor:"[]"}}}),Bs=gs({ctor:"::",_0:Mu("rgba(50,200,50,0.7)"),_1:{ctor:"[]"}}),Rs=gs({ctor:"::",_0:Mu("rgba(50,100,255,0.3)"),_1:{ctor:"::",_0:wu("rgba(50,100,255,1.0)"),_1:{ctor:"::",_0:xu("1.0"),_1:{ctor:"[]"}}}}),Es={ctor:"_Tuple4",_0:180,_1:16,_2:0,_3:0},Cs=function(t){var r=function(){var r=q(t);return"Nothing"===r.ctor?0:ie(r._0)}();return _(ms,Es,{ctor:"::",_0:Bs(_(Ts,2.5,t)),_1:{ctor:"::",_0:Ns(bs),_1:{ctor:"::",_0:ys({ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:1},_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})},As=function(t){var r=function(){var r=q(t);return"Nothing"===r.ctor?0:ie(r._0)}();return _(ms,Es,{ctor:"::",_0:Rs(ks(t)),_1:{ctor:"::",_0:Ns(bs),_1:{ctor:"::",_0:ys({ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:1},_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})},Os=(_(Vo,{ctor:"[]"},{ctor:"[]"}),n(function(t,r,e,n){return _(Vo,{ctor:"::",_0:ac("metric"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("label"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(t),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("value"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(r(e)),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("graph"),_1:{ctor:"[]"}},{ctor:"::",_0:n,_1:{ctor:"::",_0:Eo("(10min)"),_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})}),function(t){return _(Vo,{ctor:"::",_0:ac("metric"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("label"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(t.label),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("value"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(t.formatter(t.value)),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("graph"),_1:{ctor:"[]"}},{ctor:"::",_0:t.graph(t.history),_1:{ctor:"::",_0:Eo(_(b["++"],"(",_(b["++"],y(t.minutes),"min)"))),_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})}),Ls=r(function(t,r){return _(Vo,{ctor:"::",_0:_c("page"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Do,{ctor:"[]"},{ctor:"::",_0:Eo("Status"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:function(){return"Nothing"===r.metrics.ctor?_(Vo,{ctor:"[]"},{ctor:"::",_0:Eo("Loading metrics..."),_1:{ctor:"[]"}}):_(Vo,{ctor:"[]"},{ctor:"::",_0:_(Ss,"General Metrics",{ctor:"::",_0:Os(r.sysMem),_1:{ctor:"::",_0:Os(r.heapSize),_1:{ctor:"::",_0:Os(r.heapUsed),_1:{ctor:"::",_0:Os(r.heapObjects),_1:{ctor:"::",_0:Os(r.goRoutines),_1:{ctor:"::",_0:Os(r.webSockets),_1:{ctor:"[]"}}}}}}}),_1:{ctor:"::",_0:_(Ss,"SMTP Metrics",{ctor:"::",_0:Os(r.smtpConnOpen),_1:{ctor:"::",_0:Os(r.smtpConnTotal),_1:{ctor:"::",_0:Os(r.smtpReceivedTotal),_1:{ctor:"::",_0:Os(r.smtpErrorsTotal),_1:{ctor:"::",_0:Os(r.smtpWarnsTotal),_1:{ctor:"[]"}}}}}}),_1:{ctor:"::",_0:_(Ss,"Storage Metrics",{ctor:"::",_0:Os(r.retentionDeletesTotal),_1:{ctor:"::",_0:Os(r.retainedCount),_1:{ctor:"::",_0:Os(r.retainedSize),_1:{ctor:"[]"}}}}),_1:{ctor:"[]"}}}})}(),_1:{ctor:"[]"}}})}),Ds=e(function(t,e,n){return v.update(t,{value:e,history:_(at,r(function(t,r){return{ctor:"_Tuple2",_0:w(t),_1:w(r)}}),Ms(xs(n)))})}),Ps=e(function(t,e,n){return v.update(t,{value:e,history:_(at,r(function(t,r){return{ctor:"_Tuple2",_0:w(t),_1:w(r)}}),xs(n))})}),Fs=e(function(t,r,e){return v.update(t,{value:e,history:_(b["++"],_(E,{ctor:"[]"},W(t.history)),{ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:w(e)},_1:{ctor:"[]"}})})}),Is=r(function(t,r){var e=r.xCounter;return v.update(r,{metrics:A(t),xCounter:e+1,sysMem:s(Fs,r.sysMem,e,t.sysMem),heapSize:s(Fs,r.heapSize,e,t.heapSize),heapUsed:s(Fs,r.heapUsed,e,t.heapUsed),heapObjects:s(Fs,r.heapObjects,e,t.heapObjects),goRoutines:s(Fs,r.goRoutines,e,t.goRoutines),webSockets:s(Fs,r.webSockets,e,t.webSockets),smtpConnOpen:s(Fs,r.smtpConnOpen,e,t.smtpConnOpen),smtpConnTotal:s(Ds,r.smtpConnTotal,t.smtpConnTotal,t.smtpConnHist),smtpReceivedTotal:s(Ds,r.smtpReceivedTotal,t.smtpReceivedTotal,t.smtpReceivedHist),smtpErrorsTotal:s(Ds,r.smtpErrorsTotal,t.smtpErrorsTotal,t.smtpErrorsHist),smtpWarnsTotal:s(Ds,r.smtpWarnsTotal,t.smtpWarnsTotal,t.smtpWarnsHist),retentionDeletesTotal:s(Ds,r.retentionDeletesTotal,t.retentionDeletesTotal,t.retentionDeletesHist),retainedCount:s(Ps,r.retainedCount,t.retainedCount,t.retainedCountHist),retainedSize:s(Ps,r.retainedSize,t.retainedSize,t.retainedSizeHist)})}),Hs=_(V,function(t){return{ctor:"_Tuple2",_0:w(t),_1:0}},_(it,0,59)),zs=c(function(t,r,e,n,o,c){return{label:t,value:r,formatter:e,graph:n,history:o,minutes:c}}),js={metrics:C,xCounter:60,sysMem:d(zs,"System Memory",0,Ze,As,Hs,10),heapSize:d(zs,"Heap Size",0,Ze,As,Hs,10),heapUsed:d(zs,"Heap Used",0,Ze,As,Hs,10),heapObjects:d(zs,"Heap # Objects",0,ws,As,Hs,10),goRoutines:d(zs,"Goroutines",0,ws,As,Hs,10),webSockets:d(zs,"Open WebSockets",0,ws,As,Hs,10),smtpConnOpen:d(zs,"Open Connections",0,ws,As,Hs,10),smtpConnTotal:d(zs,"Total Connections",0,ws,Cs,Hs,60),smtpReceivedTotal:d(zs,"Messages Received",0,ws,Cs,Hs,60),smtpErrorsTotal:d(zs,"Messages Errors",0,ws,Cs,Hs,60),smtpWarnsTotal:d(zs,"Messages Warns",0,ws,Cs,Hs,60),retentionDeletesTotal:d(zs,"Retention Deletes",0,ws,Cs,Hs,60),retainedCount:d(zs,"Stored Messages",0,ws,As,Hs,60),retainedSize:d(zs,"Store Size",0,Ze,As,Hs,60)},Us=function(t){return{ctor:"Tick",_0:t}},Ws=function(t){return _(An,1e4,Us)},qs=function(t){return{ctor:"NewMetrics",_0:t}},Js=_(Ic,qs,_(Pc,"/debug/vars",ui)),Vs=Js,Gs=e(function(t,r,e){var n=r;return"NewMetrics"===n.ctor?"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:_(Is,n._0._0,e),_1:le,_2:bi}:{ctor:"_Tuple3",_0:e,_1:le,_2:mi(yi(n._0._0))}:{ctor:"_Tuple3",_0:e,_1:Js,_2:vi}}),Ys=r(function(t,r){var e={ctor:"_Tuple2",_0:t,_1:r};t:do{if("_Tuple2"!==e.ctor)break t;switch(e._0.ctor){case"Monitor":if("Monitor"===e._1.ctor)return!0;break t;case"Status":if("Status"===e._1.ctor)return!0;break t;default:break t}}while(!1);return!1}),Qs=e(function(t,r,e){return _(Uo,{ctor:"::",_0:vc({ctor:"::",_0:{ctor:"_Tuple2",_0:"navbar-active",_1:_(Ys,t,r)},_1:{ctor:"[]"}}),_1:{ctor:"[]"}},{ctor:"::",_0:_(Go,{ctor:"::",_0:za(r),_1:{ctor:"[]"}},e),_1:{ctor:"[]"}})}),$s=(o(function(t,r,e,n,o){return{viewMailbox:t,mailboxOnInput:r,mailboxValue:e,recentOptions:n,recentActive:o}}),{ctor:"Status"}),Ks={ctor:"Monitor"},Xs={ctor:"Mailbox"},Zs=r(function(t,r){var e=v.eq(t,Xs),n=e?r.recentActive:"Recent Mailboxes",o=e?_(E,{ctor:"[]"},W(r.recentOptions)):r.recentOptions,c=function(t){return _(Go,{ctor:"::",_0:za(Ja(t)),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(t),_1:{ctor:"[]"}})};return _(Uo,{ctor:"::",_0:_c("navbar-recent"),_1:{ctor:"::",_0:vc({ctor:"::",_0:{ctor:"_Tuple2",_0:"navbar-dropdown",_1:!0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:"navbar-active",_1:e},_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}},{ctor:"::",_0:_(Qo,{ctor:"[]"},{ctor:"::",_0:Eo(n),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:ac("navbar-dropdown-content"),_1:{ctor:"[]"}},_(V,c,o)),_1:{ctor:"[]"}}})}),tl=n(function(t,r,e,n){return _(Vo,{ctor:"::",_0:_c("app"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Fo,{ctor:"[]"},{ctor:"::",_0:_(jo,{ctor:"::",_0:ac("navbar"),_1:{ctor:"::",_0:_(cc,"role","navigation"),_1:{ctor:"[]"}}},{ctor:"::",_0:_(Uo,{ctor:"::",_0:_c("navbar-brand"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Go,{ctor:"::",_0:za(Va),_1:{ctor:"[]"}},{ctor:"::",_0:Eo("@ inbucket"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:s(Qs,e,Wa,{ctor:"::",_0:Eo("Monitor"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:s(Qs,e,Ua,{ctor:"::",_0:Eo("Status"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Zs,e,t),_1:{ctor:"::",_0:_(Uo,{ctor:"::",_0:_c("navbar-mailbox"),_1:{ctor:"[]"}},{ctor:"::",_0:_(ec,{ctor:"::",_0:Tc(t.viewMailbox(t.mailboxValue)),_1:{ctor:"[]"}},{ctor:"::",_0:_(nc,{ctor:"::",_0:sc("text"),_1:{ctor:"::",_0:fc("mailbox"),_1:{ctor:"::",_0:lc(t.mailboxValue),_1:{ctor:"::",_0:wc(t.mailboxOnInput),_1:{ctor:"[]"}}}}},{ctor:"[]"}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}}}),_1:{ctor:"::",_0:_(Vo,{ctor:"[]"},{ctor:"::",_0:Eo(_(b["++"],"Status: ",r.flash)),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_(Vo,{ctor:"::",_0:_c("navbg"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo(""),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:n,_1:{ctor:"::",_0:_(Io,{ctor:"[]"},{ctor:"::",_0:_(Vo,{ctor:"::",_0:_c("footer"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Go,{ctor:"::",_0:dc("https://www.inbucket.org"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo("Inbucket"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Eo(" is an open source projected hosted at "),_1:{ctor:"::",_0:_(Go,{ctor:"::",_0:dc("https://github.com/jhillyerd/inbucket"),_1:{ctor:"[]"}},{ctor:"::",_0:Eo("GitHub"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Eo("."),_1:{ctor:"[]"}}}}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}})}),rl={ctor:"Other"},el=function(t){var r=t,e=r._0,n=r._1,o=_(ii,r._2,e.session),c=v.update(e,{session:o});return v.eq(o.persistent,e.session.persistent)?{ctor:"_Tuple2",_0:c,_1:n}:{ctor:"_Tuple2",_0:c,_1:se({ctor:"::",_0:n,_1:{ctor:"::",_0:Si(o.persistent),_1:{ctor:"[]"}}})}},nl=Mi(Vr(li)),ol=(e(function(t,r,e){return{page:t,session:r,mailboxName:e}}),function(t){return{ctor:"Status",_0:t}}),cl=function(t){return{ctor:"Monitor",_0:t}},ul=function(t){return{ctor:"Mailbox",_0:t}},il=function(t){return{ctor:"Home",_0:t}},al=function(t){return{ctor:"StatusMsg",_0:t}},_l=function(t){return{ctor:"MonitorMsg",_0:t}},sl=function(t){return{ctor:"MailboxMsg",_0:t}},ll=function(t){var r=t;switch(r.ctor){case"Mailbox":return _(ve,sl,m_(r._0));case"Monitor":return _(ve,_l,Z_(r._0));case"Status":return _(ve,al,Ws(r._0));default:return he}},fl=function(t){return{ctor:"HomeMsg",_0:t}},dl=r(function(t,r){var e=o(function(t,e,n,o,c){var u=s(n,r.session,o,c),i=u._0,a=u._1,l=u._2;return{ctor:"_Tuple3",_0:v.update(r,{page:t(i)}),_1:_(de,e,a),_2:l}}),n={ctor:"_Tuple2",_0:t,_1:r.page};t:do{switch(n._1.ctor){case"Home":if("HomeMsg"===n._0.ctor)return f(e,il,fl,Ei,n._0._0,n._1._0);break t;case"Mailbox":if("MailboxMsg"===n._0.ctor)return f(e,ul,sl,P_,n._0._0,n._1._0);break t;case"Monitor":if("MonitorMsg"===n._0.ctor)return f(e,cl,_l,q_,n._0._0,n._1._0);break t;default:if("StatusMsg"===n._0.ctor)return f(e,ol,al,Gs,n._0._0,n._1._0);break t}}while(!1);return{ctor:"_Tuple3",_0:r,_1:le,_2:bi}}),pl=r(function(t,r){var e=function(){var e=t;switch(e.ctor){case"Unknown":return{ctor:"_Tuple3",_0:r,_1:le,_2:mi(_(b["++"],"Unknown route requested: ",e._0))};case"Home":var n=Oi,o=n._0,c=n._1;return{ctor:"_Tuple3",_0:v.update(r,{page:il(o)}),_1:_(de,fl,c),_2:bi};case"Mailbox":var u=_(O_,e._0,C),o=u._0,c=u._1;return{ctor:"_Tuple3",_0:v.update(r,{page:ul(o)}),_1:_(de,sl,c),_2:bi};case"Message":var i=_(O_,e._0,A(e._1)),o=i._0,c=i._1;return{ctor:"_Tuple3",_0:v.update(r,{page:ul(o)}),_1:_(de,sl,c),_2:bi};case"Monitor":var a=V_,o=a._0,c=a._1;return{ctor:"_Tuple3",_0:v.update(r,{page:cl(o)}),_1:_(de,_l,c),_2:bi};default:return{ctor:"_Tuple3",_0:v.update(r,{page:ol(js)}),_1:se({ctor:"::",_0:Ni("Inbucket Status"),_1:{ctor:"::",_0:_(de,al,Vs),_1:{ctor:"[]"}}}),_2:bi}}}(),n=e._0,o=e._1,c=e._2;return"Monitor"===r.page.ctor?{ctor:"_Tuple3",_0:n,_1:se({ctor:"::",_0:wi(!1),_1:{ctor:"::",_0:o,_1:{ctor:"[]"}}}),_2:c}:{ctor:"_Tuple3",_0:n,_1:o,_2:c}}),hl=r(function(t,r){var e=Qa(r),n=Oi,o=n._0,c=_(_i,r,fi(t)),u={page:il(o),session:c,mailboxName:""};return el(_(pl,e,u))}),vl=r(function(t,r){return el(function(){var e=t;switch(e.ctor){case"SetRoute":return{ctor:"_Tuple3",_0:r,_1:ja(e._0),_2:bi};case"NewRoute":return r.session.routing?_(pl,e._0,r):{ctor:"_Tuple3",_0:r,_1:le,_2:pi};case"UpdateSession":if("Ok"===e._0.ctor){var n=r.session;return{ctor:"_Tuple3",_0:v.update(r,{session:v.update(n,{persistent:e._0._0})}),_1:le,_2:bi}}_(oe,"Error decoding session",e._0._0);return{ctor:"_Tuple3",_0:r,_1:le,_2:bi};case"MailboxNameInput":return{ctor:"_Tuple3",_0:v.update(r,{mailboxName:e._0}),_1:le,_2:bi};case"ViewMailbox":return{ctor:"_Tuple3",_0:v.update(r,{mailboxName:""}),_1:ja(Ja(e._0)),_2:bi};default:return _(dl,t,r)}}())}),ml=function(t){return{ctor:"ViewMailbox",_0:t}},gl=function(t){return{ctor:"MailboxNameInput",_0:t}},bl=function(t){var r=function(){var r=t.page;return"Mailbox"===r.ctor?r._0.mailboxName:""}(),e={viewMailbox:ml,mailboxOnInput:gl,mailboxValue:t.mailboxName,recentOptions:t.session.persistent.recentMailboxes,recentActive:r},n=_(tl,e,t.session),o=t.page;switch(o.ctor){case"Home":return _(n,rl,_(Ro,fl,_(Bi,t.session,o._0)));case"Mailbox":return _(n,Xs,_(Ro,sl,_(U_,t.session,o._0)));case"Monitor":return _(n,Ks,_(Ro,_l,_(Q_,t.session,o._0)));default:return _(n,$s,_(Ro,al,_(Ls,t.session,o._0)))}},yl=function(t){return{ctor:"UpdateSession",_0:t}},kl=function(t){return pe({ctor:"::",_0:ll(t.page),_1:{ctor:"::",_0:_(ve,yl,nl),_1:{ctor:"[]"}}})},Tl=function(t){return{ctor:"NewRoute",_0:t}},wl=_(au,function(t){return Tl(Qa(t))},{init:hl,view:bl,update:vl,subscriptions:kl})(Ur),xl={};if(xl.Main=xl.Main||{},void 0!==wl&&wl(xl.Main,"Main",void 0),"function"==typeof define&&define.amd)return void define([],function(){return xl});if("object"==typeof t)return void(t.exports=xl);var Ml=this.Elm;if(void 0===Ml)return void(this.Elm=xl);for(var Sl in xl){if(Sl in Ml)throw new Error("There are two Elm modules called `"+Sl+"` on this page! Rename one of them.");Ml[Sl]=xl[Sl]}}).call(this)},function(t,r,e){"use strict";function n(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",function(){var t="/service-worker.js";u?c(t):o(t)})}}function o(t){navigator.serviceWorker.register(t).then(function(t){t.onupdatefound=function(){var r=t.installing;r.onstatechange=function(){"installed"===r.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(function(t){console.error("Error during service worker registration:",t)})}function c(t){fetch(t).then(function(r){404===r.status||-1===r.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(function(t){t.unregister().then(function(){window.location.reload()})}):o(t)}).catch(function(){console.log("No internet connection found. App is running in offline mode.")})}r.a=n;var u=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))},function(t,r,e){"use strict";function n(t){var r=("https:"===window.location.protocol?"wss://":"ws://")+window.location.host+"/api/v1/monitor/messages",e=null;t.ports.monitorCommand.subscribe(function(n){null!=e&&(e.down(),e=null),n&&(e=o(r,t.ports.monitorMessage),e.up())})}function o(t,r){var e=null;return{up:function(){e=new WebSocket(t),e.addEventListener("open",function(t){r.send(!0)}),e.addEventListener("close",function(t){r.send(!1)}),e.addEventListener("message",function(t){var e=JSON.parse(t.data);r.send(e)})},down:function(){e.close()}}}r.a=n}]); \ No newline at end of file diff --git a/ui/build/static/js/main.d6280c5d.js b/ui/build/static/js/main.d6280c5d.js deleted file mode 100644 index 868a8a1..0000000 --- a/ui/build/static/js/main.d6280c5d.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var e={};r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="/",r(r.s=0)}([function(t,r,e){t.exports=e(1)},function(t,r,e){"use strict";function n(){var t=localStorage.session;try{if(t)return JSON.parse(t)}catch(t){console.error(t)}return null}Object.defineProperty(r,"__esModule",{value:!0});var o=e(2),c=(e.n(o),e(3)),u=(e.n(c),e(4)),i=c.Main.embed(document.getElementById("root"),n());i.ports.storeSession.subscribe(function(t){localStorage.session=JSON.stringify(t)}),i.ports.windowTitle.subscribe(function(t){document.title=t}),window.addEventListener("storage",function(t){t.storageArea===localStorage&&"session"===t.key&&i.ports.onSessionChange.send(n())},!1),Object(u.a)()},function(t,r){},function(t,r){(function(){"use strict";function r(t){function r(r){return function(e){return t(r,e)}}return r.arity=2,r.func=t,r}function e(t){function r(r){return function(e){return function(n){return t(r,e,n)}}}return r.arity=3,r.func=t,r}function n(t){function r(r){return function(e){return function(n){return function(o){return t(r,e,n,o)}}}}return r.arity=4,r.func=t,r}function o(t){function r(r){return function(e){return function(n){return function(o){return function(c){return t(r,e,n,o,c)}}}}}return r.arity=5,r.func=t,r}function c(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return t(r,e,n,o,c,u)}}}}}}return r.arity=6,r.func=t,r}function u(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return t(r,e,n,o,c,u,i)}}}}}}}return r.arity=7,r.func=t,r}function i(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return t(r,e,n,o,c,u,i,a)}}}}}}}}return r.arity=8,r.func=t,r}function a(t){function r(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return t(r,e,n,o,c,u,i,a,_)}}}}}}}}}return r.arity=9,r.func=t,r}function _(t,r,e){return 2===t.arity?t.func(r,e):t(r)(e)}function s(t,r,e,n){return 3===t.arity?t.func(r,e,n):t(r)(e)(n)}function f(t,r,e,n,o){return 4===t.arity?t.func(r,e,n,o):t(r)(e)(n)(o)}function l(t,r,e,n,o,c){return 5===t.arity?t.func(r,e,n,o,c):t(r)(e)(n)(o)(c)}function d(t,r,e,n,o,c,u){return 6===t.arity?t.func(r,e,n,o,c,u):t(r)(e)(n)(o)(c)(u)}var p=function(){function t(t,r){if(t<0||t>=F(r))throw new Error("Index "+t+" is out of range. Check the length of your array first or use getMaybe or getWithDefault.");return n(t,r)}function n(t,r){for(var e=r.height;e>0;e--){for(var n=t>>5*e;r.lengths[n]<=t;)n++;n>0&&(t-=r.lengths[n-1]),r=r.table[n]}return r.table[t]}function o(t,r,e){return t<0||F(e)<=t?e:c(t,r,e)}function c(t,r,e){if(e=P(e),0===e.height)e.table[t]=r;else{var n=I(t,e);n>0&&(t-=e.lengths[n-1]),e.table[n]=c(t,r,e.table[n])}return e}function u(t,r){return t<=0?Y:i(r,Math.floor(Math.log(t)/Math.log(G)),0,t)}function i(t,r,e,n){if(0===r){for(var o=new Array((n-e)%(G+1)),c=0;c0?a[c-1]:0);return{ctor:"_Array",height:r,table:o,lengths:a}}function a(t){if("[]"===t.ctor)return Y;for(var r=new Array(G),e=[],n=0;"[]"!==t.ctor;)if(r[n]=t._0,t=t._1,++n===G){var o={ctor:"_Array",height:0,table:r};s(o,e),r=new Array(G),n=0}if(n>0){var o={ctor:"_Array",height:0,table:r.splice(0,n)};s(o,e)}for(var c=0;c0&&s(e[c],e);var u=e[e.length-1];return u.height>0&&1===u.table.length?u.table[0]:u}function s(t,r){var e=t.height;if(r.length===e){var n={ctor:"_Array",height:e+1,table:[],lengths:[]};r.push(n)}r[e].table.push(t);var o=F(t);r[e].lengths.length>0&&(o+=r[e].lengths[r[e].lengths.length-1]),r[e].lengths.push(o),r[e].table.length===G&&(s(r[e],r),r[e]={ctor:"_Array",height:e+1,table:[],lengths:[]})}function f(t,r){var e=l(t,r);return null!==e?e:W(r,H(t,r.height))}function l(t,r){if(0===r.height){if(r.table.length=0;e--)t=0===r.height?D.Cons(r.table[e],t):p(t,r.table[e]);return t}function h(t,r){var e={ctor:"_Array",height:r.height,table:new Array(r.table.length)};r.height>0&&(e.lengths=r.lengths);for(var n=0;n0&&(n.lengths=r.lengths);for(var o=0;o0?r.lengths[n-1]:0),r.table[n]);if(0===n)return o;var e={ctor:"_Array",height:r.height,table:r.table.slice(0,n),lengths:r.lengths.slice(0,n)};return o.table.length>0&&(e.table[n]=o,e.lengths[n]=F(o)+(n>0?e.lengths[n-1]:0)),e}function w(t,r){if(0===t)return r;if(0===r.height){var e={ctor:"_Array",height:0};return e.table=r.table.slice(t,r.table.length+1),e}var n=I(t,r),o=w(t-(n>0?r.lengths[n-1]:0),r.table[n]);if(n===r.table.length-1)return o;var e={ctor:"_Array",height:r.height,table:r.table.slice(n,r.table.length+1),lengths:new Array(r.table.length-n)};e.table[0]=o;for(var c=0,u=0;u0){for(var n=F(e[0]),o=0;o0){var c=N(t,r);c>V&&(e=O(e[0],e[1],c))}return W(e[0],e[1])}function x(t,r){if(0===t.height&&0===r.height)return[t,r];if(1!==t.height||1!==r.height)if(t.height===r.height){t=P(t),r=P(r);var e=x(A(t),L(r));S(t,e[1]),M(r,e[0])}else if(t.height>r.height){t=P(t);var e=x(A(t),r);S(t,e[0]),r=z(e[1],e[1].height+1)}else{r=P(r);var e=x(t,L(r)),n=0===e[0].table.length?0:1,o=0===n?1:0;M(r,e[n]),t=z(e[o],e[o].height+1)}if(0===t.table.length||0===r.table.length)return[t,r];var c=N(t,r);return c<=V?[t,r]:O(t,r,c)}function S(t,r){var e=t.table.length-1;t.table[e]=r,t.lengths[e]=F(r),t.lengths[e]+=e>0?t.lengths[e-1]:0}function M(t,r){if(r.table.length>0){t.table[0]=r,t.lengths[0]=F(r);for(var e=F(t.table[0]),n=1;n0&&(e.lengths=new Array(r)),e}function O(t,r,e){for(var n=C(t.height,Math.min(G,t.table.length+r.table.length-e)),o=C(t.height,n.table.length-(t.table.length+r.table.length-e)),c=0;B(t.table,r.table,c).table.length%G==0;)R(n.table,o.table,c,B(t.table,r.table,c)),R(n.lengths,o.lengths,c,B(t.lengths,r.lengths,c)),c++;for(var u=c,i=new C(t.height-1,0),a=0;c-u-(i.table.length>0?1:0)0)for(var f=i.lengths.length,l=f;l0?i.lengths[l-1]:0;a+=s,_.table.length<=s&&(c++,a=0),i.table.length===G&&(E(n,o,u,i),i=C(t.height-1,0),u++)}for(i.table.length>0&&(E(n,o,u,i),u++);c0&&(r.lengths=t.lengths.slice()),r}function F(t){return 0===t.height?t.table.length:t.lengths[t.lengths.length-1]}function I(t,r){for(var e=t>>5*r.height;r.lengths[e]<=t;)e++;return e}function H(t,r){return 0===r?{ctor:"_Array",height:0,table:[t]}:{ctor:"_Array",height:r,table:[H(t,r-1)],lengths:[1]}}function z(t,r){return r===t.height?t:{ctor:"_Array",height:r,table:[z(t,r-1)],lengths:[F(t)]}}function W(t,r){return{ctor:"_Array",height:t.height+1,table:[t,r],lengths:[F(t),F(t)+F(r)]}}function q(t){var r=new Array(F(t));return U(r,0,t),r}function U(t,r,e){for(var n=0;n0?u[i-1]:0);return{ctor:"_Array",height:r,table:c,lengths:u}}var G=32,V=2,Y={ctor:"_Array",height:0,table:[]};return{empty:Y,fromList:a,toList:d,initialize:r(u),append:r(T),push:r(f),slice:e(y),get:r(t),set:e(o),map:r(h),indexedMap:r(v),foldl:e(m),foldr:e(b),length:F,toJSArray:q,fromJSArray:j}}(),h=function(){function t(t,r){return t/r|0}function n(t,r){return t%r}function o(t,r){if(0===r)throw new Error("Cannot perform mod 0. Division by zero error.");var e=t%r,n=0===t?0:r>0?t>=0?e:e+r:-o(-t,-r);return n===r?0:n}function c(t,r){return Math.log(r)/Math.log(t)}function u(t){return-t}function i(t){return t<0?-t:t}function a(t,r){return v.cmp(t,r)<0?t:r}function _(t,r){return v.cmp(t,r)>0?t:r}function s(t,r,e){return v.cmp(e,t)<0?t:v.cmp(e,r)>0?r:e}function f(t,r){return{ctor:k[v.cmp(t,r)+1]}}function l(t,r){return t!==r}function d(t){return!t}function p(t){return t===1/0||t===-1/0}function h(t){return 0|t}function g(t){return t*Math.PI/180}function m(t){return 2*Math.PI*t}function b(t){var r=t._0,e=t._1;return v.Tuple2(r*Math.cos(e),r*Math.sin(e))}function y(t){var r=t._0,e=t._1;return v.Tuple2(Math.sqrt(r*r+e*e),Math.atan2(e,r))}var k=["LT","EQ","GT"];return{div:r(t),rem:r(n),mod:r(o),pi:Math.PI,e:Math.E,cos:Math.cos,sin:Math.sin,tan:Math.tan,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:r(Math.atan2),degrees:g,turns:m,fromPolar:b,toPolar:y,sqrt:Math.sqrt,logBase:r(c),negate:u,abs:i,min:r(a),max:r(_),clamp:e(s),compare:r(f),xor:r(l),not:d,truncate:h,ceiling:Math.ceil,floor:Math.floor,round:Math.round,toFloat:function(t){return t},isNaN:isNaN,isInfinite:p}}(),v=function(){function t(t,r){for(var n,o=[],c=e(t,r,0,o);c&&(n=o.pop());)c=e(n.x,n.y,0,o);return c}function e(t,r,n,o){if(n>100)return o.push({x:t,y:r}),!0;if(t===r)return!0;if("object"!=typeof t){if("function"==typeof t)throw new Error('Trying to use `(==)` on functions. There is no way to know if functions are "the same" in the Elm sense. Read more about this at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#== which describes why it is this way and what the better version will look like.');return!1}if(null===t||null===r)return!1;if(t instanceof Date)return t.getTime()===r.getTime();if(!("ctor"in t)){for(var c in t)if(!e(t[c],r[c],n+1,o))return!1;return!0}if("RBNode_elm_builtin"!==t.ctor&&"RBEmpty_elm_builtin"!==t.ctor||(t=$t(t),r=$t(r)),"Set_elm_builtin"===t.ctor&&(t=_elm_lang$core$Set$toList(t),r=_elm_lang$core$Set$toList(r)),"::"===t.ctor){for(var u=t,i=r;"::"===u.ctor&&"::"===i.ctor;){if(!e(u._0,i._0,n+1,o))return!1;u=u._1,i=i._1}return u.ctor===i.ctor}if("_Array"===t.ctor){var a=p.toJSArray(t),_=p.toJSArray(r);if(a.length!==_.length)return!1;for(var s=0;s=1){if((c=n(t._0,r._0))!==g)return c;if(u>=2){if((c=n(t._1,r._1))!==g)return c;if(u>=3){if((c=n(t._2,r._2))!==g)return c;if(u>=4){if((c=n(t._3,r._3))!==g)return c;if(u>=5){if((c=n(t._4,r._4))!==g)return c;if(u>=6){if((c=n(t._5,r._5))!==g)return c;if(u>=7)throw new Error("Comparison error: cannot compare tuples with more than 6 elements.")}}}}}}return g}throw new Error("Comparison error: comparison is only defined on ints, floats, times, chars, strings, lists of comparable values, and tuples of comparable values.")}function o(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}function c(t){return new String(t)}function u(t){return y++}function i(t,r){var e={};for(var n in t)e[n]=t[n];for(var n in r)e[n]=r[n];return e}function a(t,r){return{ctor:"::",_0:t,_1:r}}function _(t,r){if("string"==typeof t)return t+r;if("[]"===t.ctor)return r;var e=a(t._0,k),n=e;for(t=t._1;"[]"!==t.ctor;)n._1=a(t._0,k),t=t._1,n=n._1;return n._1=r,e}function s(t,r){return function(e){throw new Error("Ran into a `Debug.crash` in module `"+t+"` "+l(r)+"\nThe message provided by the code author is:\n\n "+e)}}function f(t,r,e){return function(n){throw new Error("Ran into a `Debug.crash` in module `"+t+"`\n\nThis was caused by the `case` expression "+l(r)+".\nOne of the branches ended with a crash and the following value got through:\n\n "+d(e)+"\n\nThe message provided by the code author is:\n\n "+n)}}function l(t){return t.start.line==t.end.line?"on line "+t.start.line:"between lines "+t.start.line+" and "+t.end.line}function d(t){var r=typeof t;if("function"===r)return"";if("boolean"===r)return t?"True":"False";if("number"===r)return t+"";if(t instanceof String)return"'"+h(t,!0)+"'";if("string"===r)return'"'+h(t,!1)+'"';if(null===t)return"null";if("object"===r&&"ctor"in t){var e=t.ctor.substring(0,5);if("_Tupl"===e){var n=[];for(var o in t)"ctor"!==o&&n.push(d(t[o]));return"("+n.join(",")+")"}if("_Task"===e)return"";if("_Array"===t.ctor){return"Array.fromList "+d(ft(t))}if(""===t.ctor)return"";if("_Process"===t.ctor)return"";if("::"===t.ctor){var n="["+d(t._0);for(t=t._1;"::"===t.ctor;)n+=","+d(t._0),t=t._1;return n+"]"}if("[]"===t.ctor)return"[]";if("Set_elm_builtin"===t.ctor)return"Set.fromList "+d(_elm_lang$core$Set$toList(t));if("RBNode_elm_builtin"===t.ctor||"RBEmpty_elm_builtin"===t.ctor)return"Dict.fromList "+d($t(t));var n="";for(var c in t)if("ctor"!==c){var u=d(t[c]),i=u[0],a="{"===i||"("===i||"<"===i||'"'===i||u.indexOf(" ")<0;n+=" "+(a?u:"("+u+")")}return t.ctor+n}if("object"===r){if(t instanceof Date)return"<"+t.toString()+">";if(t.elm_web_socket)return"";var n=[];for(var o in t)n.push(o+" = "+d(t[o]));return 0===n.length?"{}":"{ "+n.join(", ")+" }"}return""}function h(t,r){var e=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return r?e.replace(/\'/g,"\\'"):e.replace(/\"/g,'\\"')}var v=-1,g=0,m=1,b={ctor:"_Tuple0"},y=0,k={ctor:"[]"};return{eq:t,cmp:n,Tuple0:b,Tuple2:o,chr:c,update:i,guid:u,append:r(_),crash:s,crashCase:f,toString:d}}(),g=(r(function(t,r){var e=r;return _(t,e._0,e._1)}),e(function(t,r,e){return t({ctor:"_Tuple2",_0:r,_1:e})}),e(function(t,r,e){return _(t,e,r)}),r(function(t,r){return t})),m=function(t){return t},b=b||{};b["<|"]=r(function(t,r){return t(r)});var b=b||{};b["|>"]=r(function(t,r){return r(t)});var b=b||{};b[">>"]=e(function(t,r,e){return r(t(e))});var b=b||{};b["<<"]=e(function(t,r,e){return t(r(e))});var b=b||{};b["++"]=v.append;var y=v.toString,k=h.isInfinite,w=h.isNaN,T=h.toFloat,x=(h.ceiling,h.floor),b=(h.truncate,h.round,h.not,h.xor,b||{});b["||"]=h.or;var b=b||{};b["&&"]=h.and;var S=h.max,M=h.min,N=h.compare,b=b||{};b[">="]=h.ge;var b=b||{};b["<="]=h.le;var b=b||{};b[">"]=h.gt;var b=b||{};b["<"]=h.lt;var b=b||{};b["/="]=h.neq;var b=b||{};b["=="]=h.eq;var B=(h.e,h.pi,h.clamp,h.logBase,h.abs),R=h.negate,b=(h.sqrt,h.atan2,h.atan,h.asin,h.acos,h.tan,h.sin,h.cos,b||{});b["^"]=h.exp;var b=b||{};b["%"]=h.mod;var b=(h.rem,b||{});b["//"]=h.div;var b=b||{};b["/"]=h.floatDiv;var b=b||{};b["*"]=h.mul;var b=b||{};b["-"]=h.sub;var b=b||{};b["+"]=h.add;var E=(h.toPolar,h.fromPolar,h.turns,h.degrees,r(function(t,r){var e=r;return"Just"===e.ctor?e._0:t})),C={ctor:"Nothing"},O=(r(function(t,r){var e=r;return"Just"===e.ctor?t(e._0):C}),function(t){return{ctor:"Just",_0:t}}),A=r(function(t,r){var e=r;return"Just"===e.ctor?O(t(e._0)):C}),L=e(function(t,r,e){var n={ctor:"_Tuple2",_0:r,_1:e};return"_Tuple2"===n.ctor&&"Just"===n._0.ctor&&"Just"===n._1.ctor?O(_(t,n._0._0,n._1._0)):C}),D=(n(function(t,r,e,n){var o={ctor:"_Tuple3",_0:r,_1:e,_2:n};return"_Tuple3"===o.ctor&&"Just"===o._0.ctor&&"Just"===o._1.ctor&&"Just"===o._2.ctor?O(s(t,o._0._0,o._1._0,o._2._0)):C}),o(function(t,r,e,n,o){var c={ctor:"_Tuple4",_0:r,_1:e,_2:n,_3:o};return"_Tuple4"===c.ctor&&"Just"===c._0.ctor&&"Just"===c._1.ctor&&"Just"===c._2.ctor&&"Just"===c._3.ctor?O(f(t,c._0._0,c._1._0,c._2._0,c._3._0)):C}),c(function(t,r,e,n,o,c){var u={ctor:"_Tuple5",_0:r,_1:e,_2:n,_3:o,_4:c};return"_Tuple5"===u.ctor&&"Just"===u._0.ctor&&"Just"===u._1.ctor&&"Just"===u._2.ctor&&"Just"===u._3.ctor&&"Just"===u._4.ctor?O(l(t,u._0._0,u._1._0,u._2._0,u._3._0,u._4._0)):C}),function(){function t(t,r){return{ctor:"::",_0:t,_1:r}}function u(r){for(var e=y,n=r.length;n--;)e=t(r[n],e);return e}function i(t){for(var r=[];"[]"!==t.ctor;)r.push(t._0),t=t._1;return r}function a(t,r,e){for(var n=i(e),o=r,c=n.length;c--;)o=_(t,n[c],o);return o}function d(t,r,e){for(var n=[];"[]"!==r.ctor&&"[]"!==e.ctor;)n.push(_(t,r._0,e._0)),r=r._1,e=e._1;return u(n)}function p(t,r,e,n){for(var o=[];"[]"!==r.ctor&&"[]"!==e.ctor&&"[]"!==n.ctor;)o.push(s(t,r._0,e._0,n._0)),r=r._1,e=e._1,n=n._1;return u(o)}function h(t,r,e,n,o){for(var c=[];"[]"!==r.ctor&&"[]"!==e.ctor&&"[]"!==n.ctor&&"[]"!==o.ctor;)c.push(f(t,r._0,e._0,n._0,o._0)),r=r._1,e=e._1,n=n._1,o=o._1;return u(c)}function g(t,r,e,n,o,c){for(var i=[];"[]"!==r.ctor&&"[]"!==e.ctor&&"[]"!==n.ctor&&"[]"!==o.ctor&&"[]"!==c.ctor;)i.push(l(t,r._0,e._0,n._0,o._0,c._0)),r=r._1,e=e._1,n=n._1,o=o._1,c=c._1;return u(i)}function m(t,r){return u(i(r).sort(function(r,e){return v.cmp(t(r),t(e))}))}function b(t,r){return u(i(r).sort(function(r,e){var n=t(r)(e).ctor;return"EQ"===n?0:"LT"===n?-1:1}))}var y={ctor:"[]"};return{Nil:y,Cons:t,cons:r(t),toArray:i,fromArray:u,foldr:e(a),map2:e(d),map3:n(p),map4:o(h),map5:c(g),sortBy:r(m),sortWith:r(b)}}()),P=(D.sortWith,D.sortBy,r(function(t,r){for(;;){if(v.cmp(t,0)<1)return r;var e=r;if("[]"===e.ctor)return r;var n=t-1,o=e._1;t=n,r=o}}),D.map5,D.map4,D.map3,D.map2),F=r(function(t,r){for(;;){var e=r;if("[]"===e.ctor)return!1;if(t(e._0))return!0;var n=t,o=e._1;t=n,r=o}}),I=(r(function(t,r){return!_(F,function(r){return!t(r)},r)}),D.foldr),H=e(function(t,r,e){for(;;){var n=e;if("[]"===n.ctor)return r;var o=t,c=_(t,n._0,r),u=n._1;t=o,r=c,e=u}}),z=function(t){return s(H,r(function(t,r){return r+1}),0,t)},W=function(t){return s(H,r(function(t,r){return t+r}),0,t)},q=(r(function(t,r){return _(F,function(r){return v.eq(r,t)},r)}),function(t){return"[]"===t.ctor}),U=function(t){var r=t;return"::"===r.ctor?O(r._1):C},j=function(t){var r=t;return"::"===r.ctor?O(r._0):C},J=J||{};J["::"]=D.cons;var G=r(function(t,e){return s(I,r(function(r,e){return{ctor:"::",_0:t(r),_1:e}}),{ctor:"[]"},e)}),V=r(function(t,e){var n=r(function(r,e){return t(r)?{ctor:"::",_0:r,_1:e}:e});return s(I,n,{ctor:"[]"},e)}),Y=e(function(t,r,e){var n=t(r);return"Just"===n.ctor?{ctor:"::",_0:n._0,_1:e}:e}),Q=r(function(t,r){return s(I,Y(t),{ctor:"[]"},r)}),$=function(t){return s(H,r(function(t,r){return{ctor:"::",_0:t,_1:r}}),{ctor:"[]"},t)},K=(e(function(t,e,n){var o=r(function(r,e){var n=e;return"::"===n.ctor?{ctor:"::",_0:_(t,r,n._0),_1:e}:{ctor:"[]"}});return $(s(H,o,{ctor:"::",_0:e,_1:{ctor:"[]"}},n))}),r(function(t,e){return"[]"===e.ctor?t:s(I,r(function(t,r){return{ctor:"::",_0:t,_1:r}}),e,t)})),X=function(t){return s(I,K,{ctor:"[]"},t)},Z=r(function(t,r){return X(_(G,t,r))}),tt=(r(function(t,e){var n=r(function(r,e){var n=e,o=n._0,c=n._1;return t(r)?{ctor:"_Tuple2",_0:{ctor:"::",_0:r,_1:o},_1:c}:{ctor:"_Tuple2",_0:o,_1:{ctor:"::",_0:r,_1:c}}});return s(I,n,{ctor:"_Tuple2",_0:{ctor:"[]"},_1:{ctor:"[]"}},e)}),r(function(t,e){var n=e;if("[]"===n.ctor)return{ctor:"[]"};var o=r(function(r,e){return{ctor:"::",_0:t,_1:{ctor:"::",_0:r,_1:e}}}),c=s(I,o,{ctor:"[]"},n._1);return{ctor:"::",_0:n._0,_1:c}}),e(function(t,r,e){for(;;){if(v.cmp(t,0)<1)return e;var n=r;if("[]"===n.ctor)return e;var o=t-1,c=n._1,u={ctor:"::",_0:n._0,_1:e};t=o,r=c,e=u}})),rt=r(function(t,r){return $(s(tt,t,r,{ctor:"[]"}))}),et=e(function(t,r,e){if(v.cmp(r,0)<1)return{ctor:"[]"};var n={ctor:"_Tuple2",_0:r,_1:e};t:do{r:do{if("_Tuple2"!==n.ctor)break t;if("[]"===n._1.ctor)return e;if("::"!==n._1._1.ctor){if(1===n._0)break r;break t}switch(n._0){case 1:break r;case 2:return{ctor:"::",_0:n._1._0,_1:{ctor:"::",_0:n._1._1._0,_1:{ctor:"[]"}}};case 3:if("::"===n._1._1._1.ctor)return{ctor:"::",_0:n._1._0,_1:{ctor:"::",_0:n._1._1._0,_1:{ctor:"::",_0:n._1._1._1._0,_1:{ctor:"[]"}}}};break t;default:if("::"===n._1._1._1.ctor&&"::"===n._1._1._1._1.ctor){var o=n._1._1._1._0,c=n._1._1._0,u=n._1._0,i=n._1._1._1._1._0,a=n._1._1._1._1._1;return v.cmp(t,1e3)>0?{ctor:"::",_0:u,_1:{ctor:"::",_0:c,_1:{ctor:"::",_0:o,_1:{ctor:"::",_0:i,_1:_(rt,r-4,a)}}}}:{ctor:"::",_0:u,_1:{ctor:"::",_0:c,_1:{ctor:"::",_0:o,_1:{ctor:"::",_0:i,_1:s(et,t+1,r-4,a)}}}}}break t}}while(!1);return{ctor:"::",_0:n._1._0,_1:{ctor:"[]"}}}while(!1);return e}),nt=r(function(t,r){return s(et,0,t,r)}),ot=e(function(t,r,e){for(;;){if(v.cmp(r,0)<1)return t;var n={ctor:"::",_0:e,_1:t},o=r-1,c=e;t=n,r=o,e=c}}),ct=r(function(t,r){return s(ot,{ctor:"[]"},t,r)}),ut=e(function(t,r,e){for(;;){if(!(v.cmp(t,r)<1))return e;var n=t,o=r-1,c={ctor:"::",_0:r,_1:e};t=n,r=o,e=c}}),it=r(function(t,r){return s(ut,t,r,{ctor:"[]"})}),at=r(function(t,r){return s(P,t,_(it,0,z(r)-1),r)}),_t=(p.append,p.length,p.slice,p.set,r(function(t,r){return v.cmp(0,t)<1&&v.cmp(t,p.length(r))<0?O(_(p.get,t,r)):C})),st=(p.push,p.empty,r(function(t,e){var n=r(function(r,e){return t(r)?_(p.push,r,e):e});return s(p.foldl,n,p.empty,e)}),p.foldr,p.foldl,p.indexedMap,p.map,function(t){return s(P,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),_(it,0,p.length(t)-1),p.toList(t))}),ft=p.toList,lt=p.fromList,dt=p.initialize,pt=(r(function(t,r){return _(dt,t,g(r))}),function(){function t(t,r){var e=t+": "+v.toString(r),n=n||{};return n.stdout?n.stdout.write(e):console.log(e),r}function e(t){throw new Error(t)}return{crash:e,log:r(t)}}()),ht=function(){function t(t){return 0===t.length}function n(t,r){return t+r}function o(t){var r=t[0];return r?O(v.Tuple2(v.chr(r),t.slice(1))):C}function c(t,r){return t+r}function u(t){return D.toArray(t).join("")}function i(t){return t.length}function a(t,r){for(var e=r.split(""),n=e.length;n--;)e[n]=t(v.chr(e[n]));return e.join("")}function s(t,r){return r.split("").map(v.chr).filter(t).join("")}function f(t){return t.split("").reverse().join("")}function l(t,r,e){for(var n=e.length,o=0;o0;)1&t&&(e+=r),t>>=1,r+=r;return e}function m(t,r,e){return e.slice(t,r)}function b(t,r){return t<1?"":r.slice(0,t)}function y(t,r){return t<1?"":r.slice(-t)}function k(t,r){return t<1?r:r.slice(t)}function w(t,r){return t<1?r:r.slice(0,-t)}function T(t,r,e){var n=(t-e.length)/2;return g(Math.ceil(n),r)+e+g(0|n,r)}function x(t,r,e){return e+g(t-e.length,r)}function S(t,r,e){return g(t-e.length,r)+e}function M(t){return t.trim()}function N(t){return t.replace(/^\s+/,"")}function B(t){return t.replace(/\s+$/,"")}function R(t){return D.fromArray(t.trim().split(/\s+/g))}function E(t){return D.fromArray(t.split(/\r\n|\r|\n/g))}function A(t){return t.toUpperCase()}function L(t){return t.toLowerCase()}function P(t,r){for(var e=r.length;e--;)if(t(v.chr(r[e])))return!0;return!1}function F(t,r){for(var e=r.length;e--;)if(!t(v.chr(r[e])))return!1;return!0}function I(t,r){return r.indexOf(t)>-1}function H(t,r){return 0===r.indexOf(t)}function z(t,r){return r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length}function W(t,r){var e=t.length;if(e<1)return D.Nil;for(var n=0,o=[];(n=r.indexOf(t,n))>-1;)o.push(n),n+=e;return D.fromArray(o)}function q(t){var r=t.length;if(0===r)return U(t);var e=t[0];if("0"===e&&"x"===t[1]){for(var n=2;n"9"||e<"0"&&"-"!==e&&"+"!==e)return U(t);for(var n=1;n-1&&v.cmp(n,mt(r))<1})),yt=(_(bt,v.chr("A"),v.chr("Z")),_(bt,v.chr("a"),v.chr("z")),_(bt,v.chr("0"),v.chr("9")),_(bt,v.chr("0"),v.chr("7")),function(t){var r=t;return"Ok"===r.ctor?O(r._0):C}),kt=r(function(t,r){var e=r;return"Ok"===e.ctor?e._0:t}),wt=function(t){return{ctor:"Err",_0:t}},Tt=(r(function(t,r){var e=r;return"Ok"===e.ctor?t(e._0):wt(e._0)}),function(t){return{ctor:"Ok",_0:t}}),xt=r(function(t,r){var e=r;return"Ok"===e.ctor?Tt(t(e._0)):wt(e._0)}),St=(e(function(t,r,e){var n={ctor:"_Tuple2",_0:r,_1:e};return"Ok"===n._0.ctor?"Ok"===n._1.ctor?Tt(_(t,n._0._0,n._1._0)):wt(n._1._0):wt(n._0._0)}),n(function(t,r,e,n){var o={ctor:"_Tuple3",_0:r,_1:e,_2:n};return"Ok"===o._0.ctor?"Ok"===o._1.ctor?"Ok"===o._2.ctor?Tt(s(t,o._0._0,o._1._0,o._2._0)):wt(o._2._0):wt(o._1._0):wt(o._0._0)}),o(function(t,r,e,n,o){var c={ctor:"_Tuple4",_0:r,_1:e,_2:n,_3:o};return"Ok"===c._0.ctor?"Ok"===c._1.ctor?"Ok"===c._2.ctor?"Ok"===c._3.ctor?Tt(f(t,c._0._0,c._1._0,c._2._0,c._3._0)):wt(c._3._0):wt(c._2._0):wt(c._1._0):wt(c._0._0)}),c(function(t,r,e,n,o,c){var u={ctor:"_Tuple5",_0:r,_1:e,_2:n,_3:o,_4:c};return"Ok"===u._0.ctor?"Ok"===u._1.ctor?"Ok"===u._2.ctor?"Ok"===u._3.ctor?"Ok"===u._4.ctor?Tt(l(t,u._0._0,u._1._0,u._2._0,u._3._0,u._4._0)):wt(u._4._0):wt(u._3._0):wt(u._2._0):wt(u._1._0):wt(u._0._0)}),r(function(t,r){var e=r;return"Ok"===e.ctor?Tt(e._0):wt(t(e._0))}),r(function(t,r){var e=r;return"Just"===e.ctor?Tt(e._0):wt(t)}),ht.fromList,ht.toList),Mt=ht.toFloat,Nt=ht.toInt,Bt=(ht.indexes,ht.indexes,ht.endsWith),Rt=ht.startsWith,Et=ht.contains,Ct=(ht.all,ht.any,ht.toLower),Ot=ht.toUpper,At=(ht.lines,ht.words,ht.trimRight,ht.trimLeft,ht.trim,ht.padRight),Lt=(ht.padLeft,ht.pad,ht.dropRight),Dt=ht.dropLeft,Pt=ht.right,Ft=ht.left,It=ht.slice,Ht=ht.repeat,zt=ht.join,Wt=ht.split,qt=(ht.foldr,ht.foldl,ht.reverse),Ut=(ht.filter,ht.map,ht.length),jt=ht.concat,Jt=(ht.append,ht.uncons),Gt=ht.cons,Vt=function(t){return _(Gt,t,"")},Yt=ht.isEmpty,Qt=e(function(t,r,e){for(;;){var n=e;if("RBEmpty_elm_builtin"===n.ctor)return r;var o=t,c=s(t,n._1,n._2,s(Qt,t,r,n._4)),u=n._3;t=o,r=c,e=u}}),$t=function(t){return s(Qt,e(function(t,r,e){return{ctor:"::",_0:{ctor:"_Tuple2",_0:t,_1:r},_1:e}}),{ctor:"[]"},t)},Kt=e(function(t,r,e){for(;;){var n=e;if("RBEmpty_elm_builtin"===n.ctor)return r;var o=t,c=s(t,n._1,n._2,s(Kt,t,r,n._3)),u=n._4;t=o,r=c,e=u}}),Xt=c(function(t,n,o,c,u,i){var a=e(function(r,e,c){for(;;){var u=c,i=u._1,a=u._0,_=a;if("[]"===_.ctor)return{ctor:"_Tuple2",_0:a,_1:s(o,r,e,i)};var l=_._1,d=_._0._1,p=_._0._0;if(!(v.cmp(p,r)<0))return v.cmp(p,r)>0?{ctor:"_Tuple2",_0:a,_1:s(o,r,e,i)}:{ctor:"_Tuple2",_0:l,_1:f(n,p,d,e,i)};var h=r,g=e,m={ctor:"_Tuple2",_0:l,_1:s(t,p,d,i)};r=h,e=g,c=m}}),_=s(Kt,a,{ctor:"_Tuple2",_0:$t(c),_1:i},u),l=_._0,d=_._1;return s(H,r(function(r,e){var n=r;return s(t,n._0,n._1,e)}),d,l)}),Zt=n(function(t,r,e,n){return pt.crash(jt({ctor:"::",_0:"Internal red-black tree invariant violated, expected ",_1:{ctor:"::",_0:t,_1:{ctor:"::",_0:" and got ",_1:{ctor:"::",_0:y(r),_1:{ctor:"::",_0:"/",_1:{ctor:"::",_0:e,_1:{ctor:"::",_0:"/",_1:{ctor:"::",_0:n,_1:{ctor:"::",_0:"\nPlease report this bug to ",_1:{ctor:"[]"}}}}}}}}}}))}),tr=function(t){var r=t;t:do{if("RBNode_elm_builtin"===r.ctor){if("BBlack"===r._0.ctor)return!0;break t}if("LBBlack"===r._0.ctor)return!0;break t}while(!1);return!1},rr=r(function(t,r){for(;;){var e=r;if("RBEmpty_elm_builtin"===e.ctor)return t;var n=_(rr,t+1,e._4),o=e._3;t=n,r=o}}),er=r(function(t,r){t:for(;;){var e=r;if("RBEmpty_elm_builtin"===e.ctor)return C;var n=_(N,t,e._1);switch(n.ctor){case"LT":var o=t,c=e._3;t=o,r=c;continue t;case"EQ":return O(e._2);default:var u=t,i=e._4;t=u,r=i;continue t}}}),nr=r(function(t,r){return"Just"===_(er,t,r).ctor}),or=e(function(t,r,e){for(;;){var n=e;if("RBEmpty_elm_builtin"===n.ctor)return{ctor:"_Tuple2",_0:t,_1:r};var o=n._1,c=n._2,u=n._4;t=o,r=c,e=u}}),cr={ctor:"NBlack"},ur={ctor:"BBlack"},ir={ctor:"Black"},ar=function(t){var r=t;if("RBNode_elm_builtin"===r.ctor){var e=r._0;return v.eq(e,ir)||v.eq(e,ur)}return!0},_r={ctor:"Red"},sr=function(t){switch(t.ctor){case"Black":return ur;case"Red":return ir;case"NBlack":return _r;default:return pt.crash("Can't make a double black node more black!")}},fr=function(t){switch(t.ctor){case"BBlack":return ir;case"Black":return _r;case"Red":return cr;default:return pt.crash("Can't make a negative black node less black!")}},lr={ctor:"LBBlack"},dr={ctor:"LBlack"},pr=function(t){return{ctor:"RBEmpty_elm_builtin",_0:t}},hr=pr(dr),vr=o(function(t,r,e,n,o){return{ctor:"RBNode_elm_builtin",_0:t,_1:r,_2:e,_3:n,_4:o}}),gr=function(t){var r=t;return"RBNode_elm_builtin"===r.ctor&&"Red"===r._0.ctor?l(vr,ir,r._1,r._2,r._3,r._4):t},mr=function(t){var r=t;return"RBNode_elm_builtin"===r.ctor?l(vr,fr(r._0),r._1,r._2,r._3,r._4):pr(dr)},br=function(t){return function(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return function(s){return l(vr,fr(t),n,o,l(vr,ir,r,e,i,a),l(vr,ir,c,u,_,s))}}}}}}}}}}},yr=function(t){var r=t;return"RBEmpty_elm_builtin"===r.ctor?pr(dr):l(vr,ir,r._1,r._2,r._3,r._4)},kr=function(t){var r=t;return"RBEmpty_elm_builtin"===r.ctor?pt.crash("can't make a Leaf red"):l(vr,_r,r._1,r._2,r._3,r._4)},wr=function(t){var r=t;t:do{r:do{e:do{n:do{o:do{c:do{u:do{if("RBNode_elm_builtin"!==r.ctor)break t;if("RBNode_elm_builtin"===r._3.ctor)if("RBNode_elm_builtin"===r._4.ctor)switch(r._3._0.ctor){case"Red":switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;break t;case"NBlack":if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;break t;default:if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;break t}case"NBlack":switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t;case"NBlack":if("BBlack"===r._0.ctor){if("RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;if("RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t}break t;default:if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t}default:switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;break t;case"NBlack":if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;break t;default:break t}}else switch(r._3._0.ctor){case"Red":if("RBNode_elm_builtin"===r._3._3.ctor&&"Red"===r._3._3._0.ctor)break u;if("RBNode_elm_builtin"===r._3._4.ctor&&"Red"===r._3._4._0.ctor)break c;break t;case"NBlack":if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._3._3.ctor&&"Black"===r._3._3._0.ctor&&"RBNode_elm_builtin"===r._3._4.ctor&&"Black"===r._3._4._0.ctor)break r;break t;default:break t}else{if("RBNode_elm_builtin"!==r._4.ctor)break t;switch(r._4._0.ctor){case"Red":if("RBNode_elm_builtin"===r._4._3.ctor&&"Red"===r._4._3._0.ctor)break o;if("RBNode_elm_builtin"===r._4._4.ctor&&"Red"===r._4._4._0.ctor)break n;break t;case"NBlack":if("BBlack"===r._0.ctor&&"RBNode_elm_builtin"===r._4._3.ctor&&"Black"===r._4._3._0.ctor&&"RBNode_elm_builtin"===r._4._4.ctor&&"Black"===r._4._4._0.ctor)break e;break t;default:break t}}}while(!1);return br(r._0)(r._3._3._1)(r._3._3._2)(r._3._1)(r._3._2)(r._1)(r._2)(r._3._3._3)(r._3._3._4)(r._3._4)(r._4)}while(!1);return br(r._0)(r._3._1)(r._3._2)(r._3._4._1)(r._3._4._2)(r._1)(r._2)(r._3._3)(r._3._4._3)(r._3._4._4)(r._4)}while(!1);return br(r._0)(r._1)(r._2)(r._4._3._1)(r._4._3._2)(r._4._1)(r._4._2)(r._3)(r._4._3._3)(r._4._3._4)(r._4._4)}while(!1);return br(r._0)(r._1)(r._2)(r._4._1)(r._4._2)(r._4._4._1)(r._4._4._2)(r._3)(r._4._3)(r._4._4._3)(r._4._4._4)}while(!1);return l(vr,ir,r._4._3._1,r._4._3._2,l(vr,ir,r._1,r._2,r._3,r._4._3._3),l(Tr,ir,r._4._1,r._4._2,r._4._3._4,kr(r._4._4)))}while(!1);return l(vr,ir,r._3._4._1,r._3._4._2,l(Tr,ir,r._3._1,r._3._2,kr(r._3._3),r._3._4._3),l(vr,ir,r._1,r._2,r._3._4._4,r._4))}while(!1);return t},Tr=o(function(t,r,e,n,o){var c=l(vr,t,r,e,n,o);return ar(c)?wr(c):c}),xr=o(function(t,r,e,n,o){return tr(n)||tr(o)?l(Tr,sr(t),r,e,mr(n),mr(o)):l(vr,t,r,e,n,o)}),Sr=o(function(t,r,e,n,o){var c=o;return"RBEmpty_elm_builtin"===c.ctor?s(Mr,t,n,o):l(xr,t,r,e,n,l(Sr,c._0,c._1,c._2,c._3,c._4))}),Mr=e(function(t,r,e){var n={ctor:"_Tuple2",_0:r,_1:e};if("RBEmpty_elm_builtin"!==n._0.ctor){if("RBEmpty_elm_builtin"===n._1.ctor){var o=n._1._0,c=n._0._0,u={ctor:"_Tuple3",_0:t,_1:c,_2:o};return"_Tuple3"===u.ctor&&"Black"===u._0.ctor&&"Red"===u._1.ctor&&"LBlack"===u._2.ctor?l(vr,ir,n._0._1,n._0._2,n._0._3,n._0._4):f(Zt,"Black/Red/LBlack",t,y(c),y(o))}var i=n._0._2,a=n._0._4,_=n._0._1,d=l(Sr,n._0._0,_,i,n._0._3,a),p=s(or,_,i,a),h=p._0,v=p._1;return l(xr,t,h,v,d,e)}if("RBEmpty_elm_builtin"!==n._1.ctor){var g=n._1._0,m=n._0._0,b={ctor:"_Tuple3",_0:t,_1:m,_2:g};return"_Tuple3"===b.ctor&&"Black"===b._0.ctor&&"LBlack"===b._1.ctor&&"Red"===b._2.ctor?l(vr,ir,n._1._1,n._1._2,n._1._3,n._1._4):f(Zt,"Black/LBlack/Red",t,y(m),y(g))}switch(t.ctor){case"Red":return pr(dr);case"Black":return pr(lr);default:return pt.crash("cannot have bblack or nblack nodes at this point")}}),Nr=r(function(t,r){var e=r;if("RBEmpty_elm_builtin"===e.ctor)return pr(dr);var n=e._1;return l(vr,e._0,n,_(t,n,e._2),_(Nr,t,e._3),_(Nr,t,e._4))}),Br={ctor:"Same"},Rr={ctor:"Remove"},Er={ctor:"Insert"},Cr=e(function(t,r,e){var n=function(e){var o=e;if("RBEmpty_elm_builtin"===o.ctor){var c=r(C);return"Nothing"===c.ctor?{ctor:"_Tuple2",_0:Br,_1:hr}:{ctor:"_Tuple2",_0:Er,_1:l(vr,_r,t,c._0,hr,hr)}}var u=o._2,i=o._4,a=o._3,f=o._1,d=o._0;switch(_(N,t,f).ctor){case"EQ":var p=r(O(u));return"Nothing"===p.ctor?{ctor:"_Tuple2",_0:Rr,_1:s(Mr,d,a,i)}:{ctor:"_Tuple2",_0:Br,_1:l(vr,d,f,p._0,a,i)};case"LT":var h=n(a),v=h._0,g=h._1;switch(v.ctor){case"Same":return{ctor:"_Tuple2",_0:Br,_1:l(vr,d,f,u,g,i)};case"Insert":return{ctor:"_Tuple2",_0:Er,_1:l(Tr,d,f,u,g,i)};default:return{ctor:"_Tuple2",_0:Rr,_1:l(xr,d,f,u,g,i)}}default:var m=n(i),v=m._0,b=m._1;switch(v.ctor){case"Same":return{ctor:"_Tuple2",_0:Br,_1:l(vr,d,f,u,a,b)};case"Insert":return{ctor:"_Tuple2",_0:Er,_1:l(Tr,d,f,u,a,b)};default:return{ctor:"_Tuple2",_0:Rr,_1:l(xr,d,f,u,a,b)}}}},o=n(e),c=o._0,u=o._1;switch(c.ctor){case"Same":return u;case"Insert":return gr(u);default:return yr(u)}}),Or=e(function(t,r,e){return s(Cr,t,g(O(r)),e)}),Ar=(r(function(t,r){return s(Or,t,r,hr)}),r(function(t,r){return s(Kt,Or,r,t)})),Lr=r(function(t,r){var n=e(function(r,e,n){return _(t,r,e)?s(Or,r,e,n):n});return s(Kt,n,hr,r)}),Dr=(r(function(t,e){return _(Lr,r(function(t,r){return _(nr,t,e)}),t)}),r(function(t,r){var n=e(function(r,e,n){var o=n,c=o._1,u=o._0;return _(t,r,e)?{ctor:"_Tuple2",_0:s(Or,r,e,u),_1:c}:{ctor:"_Tuple2",_0:u,_1:s(Or,r,e,c)}});return s(Kt,n,{ctor:"_Tuple2",_0:hr,_1:hr},r)}),function(t){return s(H,r(function(t,r){var e=t;return s(Or,e._0,e._1,r)}),hr,t)}),Pr=r(function(t,r){return s(Cr,t,g(C),r)}),Fr=(r(function(t,r){return s(Kt,e(function(t,r,e){return _(Pr,t,e)}),t,r)}),function(){function t(t){return{ctor:"",tag:"succeed",msg:t}}function _(t){return{ctor:"",tag:"fail",msg:t}}function s(t){return{ctor:"",tag:t}}function f(t,r){return{ctor:"",tag:t,decoder:r}}function l(t){return{ctor:"",tag:"null",value:t}}function d(t,r){return{ctor:"",tag:"field",field:t,decoder:r}}function h(t,r){return{ctor:"",tag:"index",index:t,decoder:r}}function g(t){return{ctor:"",tag:"key-value",decoder:t}}function m(t,r){return{ctor:"",tag:"map-many",func:t,decoders:r}}function b(t,r){return{ctor:"",tag:"andThen",decoder:r,callback:t}}function y(t){return{ctor:"",tag:"oneOf",decoders:t}}function k(t,r){return m(t,[r])}function w(t,r,e){return m(t,[r,e])}function T(t,r,e,n){return m(t,[r,e,n])}function x(t,r,e,n,o){return m(t,[r,e,n,o])}function S(t,r,e,n,o,c){return m(t,[r,e,n,o,c])}function M(t,r,e,n,o,c,u){return m(t,[r,e,n,o,c,u])}function N(t,r,e,n,o,c,u,i){return m(t,[r,e,n,o,c,u,i])}function B(t,r,e,n,o,c,u,i,a){return m(t,[r,e,n,o,c,u,i,a])}function R(t){return{tag:"ok",value:t}}function E(t,r){return{tag:"primitive",type:t,value:r}}function A(t,r){return{tag:"index",index:t,rest:r}}function L(t,r){return{tag:"field",field:t,rest:r}}function A(t,r){return{tag:"index",index:t,rest:r}}function P(t){return{tag:"oneOf",problems:t}}function F(t){return{tag:"fail",msg:t}}function I(t){for(var r="_";t;)switch(t.tag){case"primitive":return"Expecting "+t.type+("_"===r?"":" at "+r)+" but instead got: "+H(t.value);case"index":r+="["+t.index+"]",t=t.rest;break;case"field":r+="."+t.field,t=t.rest;break;case"oneOf":for(var e=t.problems,n=0;n=r.length)return E("a longer array. Need index "+a+" but there are only "+r.length+" entries",r);var o=q(t.decoder,r[a]);return"ok"===o.tag?o:A(a,o);case"key-value":if("object"!=typeof r||null===r||r instanceof Array)return E("an object",r);var _=D.Nil;for(var s in r){var o=q(t.decoder,r[s]);if("ok"!==o.tag)return L(s,o);var f=v.Tuple2(s,o.value);_=D.Cons(f,_)}return R(_);case"map-many":for(var l=t.func,d=t.decoders,n=0;n=0&&c.splice(r,1)}var c=[],u=B[t].converter,i=se.succeed(null);return B[t].init=i,B[t].onEffects=e(r),{subscribe:n,unsubscribe:o}}function M(t,r){return T(t),B[t]={tag:"sub",subMap:E,converter:r,isForeign:!0},h(t)}function N(t,r){function n(t,r,e){for(var n=o(t,r,e),c=0;c0;){var f=n[_];s[--_]=void 0===f?C:O(f)}o.push({match:n[0],submatches:D.fromArray(s),index:n.index,number:c}),a=r.lastIndex}return r.lastIndex=i,D.fromArray(o)}function a(t,r,e,n){function o(r){if(c++>=t)return r;for(var n=arguments.length-3,o=new Array(n);n>0;){var u=arguments[n];o[--n]=void 0===u?C:O(u)}return e({match:r,submatches:D.fromArray(o),index:arguments[arguments.length-2],number:c})}t="All"===t.ctor?1/0:t._0;var c=0;return n.replace(r,o)}function _(t,r,e){if((t="All"===t.ctor?1/0:t._0)===1/0)return D.fromArray(e.split(r));for(var n,o=e,c=[],u=r.lastIndex,i=r.lastIndex;t--&&(n=r.exec(o));)c.push(o.slice(u,n.index)),u=r.lastIndex;return c.push(o.slice(u)),r.lastIndex=i,D.fromArray(c)}return{regex:c,caseInsensitive:o,escape:t,contains:r(u),find:e(i),replace:n(a),split:e(_)}}(),Ne=(Me.split,Me.replace),Be=(Me.find,Me.contains,Me.caseInsensitive,Me.regex),Re=Me.escape,Ee=(n(function(t,r,e,n){return{match:t,submatches:r,index:e,number:n}}),function(t){return{ctor:"AtMost",_0:t}}),Ce=e(function(t,r,e){return _(E,NaN,yt(Mt(_(t,r,e))))}),Oe=function(t){var r=t,e=r._1,n=r._0;if(v.eq(n,v.chr("9"))){var o=Jt(e);return"Nothing"===o.ctor?"01":_(Gt,v.chr("0"),Oe(o._0))}var c=mt(n);return v.cmp(c,48)>-1&&v.cmp(c,57)<0?_(Gt,gt(c+1),e):"0"},Ae=r(function(t,r){var e=_(F,function(t){return!v.eq(t,v.chr("0"))&&!v.eq(t,v.chr("."))},St(r));return _(b["++"],t&&e?"-":"",r)}),Le=function(t){var r=_(Wt,".",t);return"::"===r.ctor?"::"===r._1.ctor?{ctor:"_Tuple2",_0:r._0,_1:r._1._0}:{ctor:"_Tuple2",_0:r._0,_1:"0"}:{ctor:"_Tuple2",_0:"0",_1:"0"}},De=function(t){var r=_(Wt,"e",y(B(t)));if("::"===r.ctor){if("::"===r._1.ctor){var e=r._1._0,n=Le(r._0),o=n._0,c=n._1,u=_(b["++"],o,c),i=_(E,0,yt(Nt(_(Rt,"+",e)?_(Dt,1,e):e))),a=v.cmp(i,0)<0?_(E,"0",_(A,function(t){var r=t;return _(b["++"],r._0,_(b["++"],".",r._1))},_(A,ue(Vt),Jt(_(b["++"],_(Ht,B(i),"0"),u))))):s(At,i+1,v.chr("0"),u);return _(b["++"],v.cmp(t,0)<0?"-":"",a)}return _(b["++"],v.cmp(t,0)<0?"-":"",r._0)}return""},Pe=e(function(t,e,n){if(k(n)||w(n))return y(n);var o=v.cmp(n,0)<0,c=Le(De(B(n))),u=c._0,i=c._1,a=Ut(u)+e,f=_(S,1,a),l=_(b["++"],_(Ht,R(a)+1,"0"),s(At,a,v.chr("0"),_(b["++"],u,i))),d=Ut(l),p=_(t,o,s(It,f,d,l)),h=s(It,0,f,l),g=p?qt(_(E,"1",_(A,Oe,Jt(qt(h))))):h,m=Ut(g),T=v.eq(g,"0")?g:v.cmp(e,0)<1?_(r(function(t,r){return _(b["++"],t,r)}),g,_(Ht,B(e),"0")):v.cmp(e,Ut(i))<0?_(b["++"],s(It,0,m-e,g),_(b["++"],".",s(It,m-e,m,g))):_(r(function(t,r){return _(b["++"],t,r)}),_(b["++"],u,"."),s(At,e,v.chr("0"),i));return _(Ae,o,T)}),Fe=Pe(r(function(t,r){var e=Jt(r);return"Nothing"!==e.ctor&&("5"===e._0._0.valueOf()?""!==e._0._1||!t:function(r){return v.cmp(r,53)>0&&t||v.cmp(r,53)>-1&&!t}(mt(e._0._0)))})),Ie=(Ce(Fe),Pe(r(function(t,e){var n=Jt(e);return"Nothing"!==n.ctor&&("_Tuple2"===n._0.ctor&&"0"===n._0._0.valueOf()?_(r(function(t,r){return t&&r}),!t,_(F,r(function(t,r){return!v.eq(t,r)})(v.chr("0")),St(n._0._1))):!t)}))),He=(Ce(Ie),Pe(r(function(t,e){var n=Jt(e);return"Nothing"!==n.ctor&&("_Tuple2"===n._0.ctor&&"0"===n._0._0.valueOf()?_(r(function(t,r){return t&&r}),t,_(F,r(function(t,r){return!v.eq(t,r)})(v.chr("0")),St(n._0._1))):t)}))),ze=r(function(t,r){return v.cmp(r,0)<0?_(Ie,t,r):_(He,t,r)}),We=(Ce(ze),r(function(t,r){return v.cmp(r,0)<0?_(He,t,r):_(Ie,t,r)})),qe=(Ce(We),Ce(He),Pe(r(function(t,e){return _(r(function(t,r){return v.cmp(t,r)<1}),53,mt(_(E,v.chr("0"),_(A,ae,Jt(e)))))}))),Ue=(Ce(qe),Be("^(\\d+\\.[^0]*)(0+)$")),je=Be(Re(".")),Je=r(function(t,r){var e=_(He,t.decimalPlaces,r),n=f(Ne,Ee(1),Ue,function(t){var r=t;return _(zt,"",_(G,E(""),_(nt,1,r.submatches)))},e),o=_(Bt,".",n)?_(Lt,1,n):n;return v.eq(t.decimalSeparator,".")?o:f(Ne,Ee(1),je,function(r){return t.decimalSeparator},o)}),Ge={minimumSize:1,abbreviation:"?"},Ve={ctor:"::",_0:{minimumSize:1,abbreviation:"B"},_1:{ctor:"::",_0:{minimumSize:1024,abbreviation:"KiB"},_1:{ctor:"::",_0:{minimumSize:1048576,abbreviation:"MiB"},_1:{ctor:"::",_0:{minimumSize:1073741824,abbreviation:"GiB"},_1:{ctor:"::",_0:{minimumSize:1099511627776,abbreviation:"TiB"},_1:{ctor:"::",_0:{minimumSize:0x4000000000000,abbreviation:"PiB"},_1:{ctor:"[]"}}}}}}},Ye={ctor:"::",_0:{minimumSize:1,abbreviation:"B"},_1:{ctor:"::",_0:{minimumSize:1e3,abbreviation:"kB"},_1:{ctor:"::",_0:{minimumSize:1e6,abbreviation:"MB"},_1:{ctor:"::",_0:{minimumSize:1e9,abbreviation:"GB"},_1:{ctor:"::",_0:{minimumSize:1e12,abbreviation:"TB"},_1:{ctor:"::",_0:{minimumSize:1e15,abbreviation:"PB"},_1:{ctor:"::",_0:{minimumSize:1e18,abbreviation:"EB"},_1:{ctor:"[]"}}}}}}}},Qe=function(t){return"Base10"===t.ctor?Ye:Ve},$e=r(function(t,r){if(v.eq(r,0))return"0 B";var e=Qe(t.units),n=v.cmp(r,0)<0?{ctor:"_Tuple2",_0:R(r),_1:"-"}:{ctor:"_Tuple2",_0:r,_1:""},o=n._0,c=n._1,u=_(E,Ge,j($(_(V,function(t){return v.cmp(o,t.minimumSize)>-1},e)))),i=_(Je,t,T(o)/T(u.minimumSize));return _(b["++"],c,_(b["++"],i,_(b["++"]," ",u.abbreviation)))}),Ke=(e(function(t,r,e){return{units:t,decimalPlaces:r,decimalSeparator:e}}),r(function(t,r){return{minimumSize:t,abbreviation:r}}),{ctor:"Base2"}),Xe={ctor:"Base10"},Ze={units:Xe,decimalPlaces:2,decimalSeparator:"."},tn=$e(Ze),rn=($e(v.update(Ze,{units:Ke})),function(){function t(t){var r=new Date(t);return isNaN(r.getTime())?wt("Unable to parse '"+t+"' as a date. Dates must be in the ISO 8601 format."):Tt(r)}var r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return{fromString:t,year:function(t){return t.getFullYear()},month:function(t){return{ctor:e[t.getMonth()]}},day:function(t){return t.getDate()},hour:function(t){return t.getHours()},minute:function(t){return t.getMinutes()},second:function(t){return t.getSeconds()},millisecond:function(t){return t.getMilliseconds()},toTime:function(t){return t.getTime()},fromTime:function(t){return new Date(t)},dayOfWeek:function(t){return{ctor:r[t.getDay()]}}}}()),en=se.onError,nn=se.andThen,on=r(function(t,r){var e=r;return se.spawn(_(nn,be(t),e._0))}),cn=se.fail,un=(r(function(t,r){return _(en,function(r){return cn(t(r))},r)}),se.succeed),an=r(function(t,r){return _(nn,function(r){return un(t(r))},r)}),_n=e(function(t,r,e){return _(nn,function(r){return _(nn,function(e){return un(_(t,r,e))},e)},r)}),sn=(n(function(t,r,e,n){return _(nn,function(r){return _(nn,function(e){return _(nn,function(n){return un(s(t,r,e,n))},n)},e)},r)}),o(function(t,r,e,n,o){return _(nn,function(r){return _(nn,function(e){return _(nn,function(n){return _(nn,function(o){return un(f(t,r,e,n,o))},o)},n)},e)},r)}),c(function(t,r,e,n,o,c){return _(nn,function(r){return _(nn,function(e){return _(nn,function(n){return _(nn,function(o){return _(nn,function(c){return un(l(t,r,e,n,o,c))},c)},o)},n)},e)},r)}),function(t){var e=t;return"[]"===e.ctor?un({ctor:"[]"}):s(_n,r(function(t,r){return{ctor:"::",_0:t,_1:r}}),e._0,sn(e._1))}),fn=e(function(t,r,e){return _(an,function(t){return{ctor:"_Tuple0"}},sn(_(G,on(t),r)))}),ln=un({ctor:"_Tuple0"}),dn=e(function(t,r,e){return un({ctor:"_Tuple0"})}),pn=_e.leaf("Task"),hn=function(t){return{ctor:"Perform",_0:t}},vn=r(function(t,r){return pn(hn(_(an,t,r)))}),gn=r(function(t,r){return pn(hn(_(en,function(r){return un(t(wt(r)))},_(nn,function(r){return un(t(Tt(r)))},r))))}),mn=r(function(t,r){return hn(_(an,t,r._0))});_e.effectManagers.Task={pkg:"elm-lang/core",init:ln,onEffects:fn,onSelfMsg:dn,tag:"cmd",cmdMap:mn};var bn=function(){function t(t,r){return se.nativeBinding(function(e){var n=setInterval(function(){se.rawSpawn(r)},t);return function(){clearInterval(n)}})}return{now:se.nativeBinding(function(t){t(se.succeed(Date.now()))}),setInterval_:r(t)}}(),yn=bn.setInterval_,kn=e(function(t,r,e){var n=r;if("[]"===n.ctor)return un(e);var o=n._0,c=function(r){return s(kn,t,n._1,s(Or,o,r,e))},u=se.spawn(_(yn,o,_(me,t,o)));return _(nn,c,u)}),wn=r(function(t,r){var e=t,n=e._1,o=e._0,c=_(er,o,r);return"Nothing"===c.ctor?s(Or,o,{ctor:"::",_0:n,_1:{ctor:"[]"}},r):s(Or,o,{ctor:"::",_0:n,_1:c._0},r)}),Tn=function(t){return t/36e5},xn=function(t){return t/6e4},Sn=function(t){return t/1e3},Mn=bn.now,Nn=e(function(t,r,e){var n=_(er,r,e.taggers);if("Nothing"===n.ctor)return un(e);var o=function(r){return sn(_(G,function(e){return _(be,t,e(r))},n._0))};return _(nn,function(t){return un(e)},_(nn,o,Mn))}),Bn=_e.leaf("Time"),Rn=r(function(t,r){return{taggers:t,processes:r}}),En=un(_(Rn,hr,hr)),Cn=e(function(t,r,o){var c=o,u=e(function(t,r,e){var n=e;return{ctor:"_Tuple3",_0:n._0,_1:n._1,_2:_(nn,function(t){return n._2},se.kill(r))}}),i=n(function(t,r,e,n){var o=n;return{ctor:"_Tuple3",_0:o._0,_1:s(Or,t,e,o._1),_2:o._2}}),a=e(function(t,r,e){var n=e;return{ctor:"_Tuple3",_0:{ctor:"::",_0:t,_1:n._0},_1:n._1,_2:n._2}}),f=s(H,wn,hr,r),l=d(Xt,a,i,u,f,c.processes,{ctor:"_Tuple3",_0:{ctor:"[]"},_1:hr,_2:un({ctor:"_Tuple0"})}),p=l._0,h=l._1,v=l._2;return _(nn,function(t){return un(_(Rn,f,t))},_(nn,function(r){return s(kn,t,p,h)},v))}),On=r(function(t,r){return{ctor:"Every",_0:t,_1:r}}),An=r(function(t,r){return Bn(_(On,t,r))}),Ln=r(function(t,r){var e=r;return _(On,e._0,function(r){return t(e._1(r))})});_e.effectManagers.Time={pkg:"elm-lang/core",init:En,onEffects:Cn,onSelfMsg:Nn,tag:"sub",subMap:Ln};var Dn,Pn=(rn.millisecond,rn.second),Fn=rn.minute,In=rn.hour,Hn=rn.dayOfWeek,zn=rn.day,Wn=rn.month,qn=rn.year,Un=rn.fromTime,jn=rn.toTime,Jn=rn.fromString,Gn=(_(an,Un,Mn),{ctor:"Sun"}),Vn={ctor:"Sat"},Yn={ctor:"Fri"},Qn={ctor:"Thu"},$n={ctor:"Wed"},Kn={ctor:"Tue"},Xn={ctor:"Mon"},Zn={ctor:"Dec"},to={ctor:"Nov"},ro={ctor:"Oct"},eo={ctor:"Sep"},no={ctor:"Aug"},oo={ctor:"Jul"},co={ctor:"Jun"},uo={ctor:"May"},io={ctor:"Apr"},ao={ctor:"Mar"},_o={ctor:"Feb"},so={ctor:"Jan"},fo=se.kill,lo=se.sleep,po=se.spawn,ho=function(){function t(t){return function(r,e,n){return se.nativeBinding(function(o){function c(t){var r=_(Vr,e,t);"Ok"===r.ctor&&se.rawSpawn(n(r._0))}return t.addEventListener(r,c),function(){t.removeEventListener(r,c)}})}}function n(t,r){return se.nativeBinding(function(e){b(function(){var n=document.getElementById(t);if(null===n)return void e(se.fail({ctor:"NotFound",_0:t}));e(se.succeed(r(n)))})})}function o(t){return n(t,function(t){return t.focus(),v.Tuple0})}function c(t){return n(t,function(t){return t.blur(),v.Tuple0})}function u(t){return n(t,function(t){return t.scrollTop})}function i(t,r){return n(t,function(t){return t.scrollTop=r,v.Tuple0})}function a(t){return n(t,function(t){return t.scrollTop=t.scrollHeight,v.Tuple0})}function s(t){return n(t,function(t){return t.scrollLeft})}function f(t,r){return n(t,function(t){return t.scrollLeft=r,v.Tuple0})}function l(t){return n(t,function(t){return t.scrollLeft=t.scrollWidth,v.Tuple0})}function d(t,r){return n(r,function(r){switch(t.ctor){case"Content":return r.scrollWidth;case"VisibleContent":return r.clientWidth;case"VisibleContentWithBorders":return r.offsetWidth;case"VisibleContentWithBordersAndMargins":var e=r.getBoundingClientRect();return e.right-e.left}})}function p(t,r){return n(r,function(r){switch(t.ctor){case"Content":return r.scrollHeight;case"VisibleContent":return r.clientHeight;case"VisibleContentWithBorders":return r.offsetHeight;case"VisibleContentWithBordersAndMargins":var e=r.getBoundingClientRect();return e.bottom-e.top}})}var h={addEventListener:function(){},removeEventListener:function(){}},g=t("undefined"!=typeof document?document:h),m=t("undefined"!=typeof window?window:h),b="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:function(t){t()};return{onDocument:e(g),onWindow:e(m),focus:o,blur:c,getScrollTop:u,setScrollTop:r(i),getScrollLeft:s,setScrollLeft:r(f),toBottom:a,toRight:l,height:r(p),width:r(d)}}(),vo=ho.onWindow,go=(ho.onDocument,function(){function t(t){return{type:"text",text:t}}function o(t){return r(function(r,e){return c(t,r,e)})}function c(t,r,e){for(var n=h(r),o=n.namespace,c=n.facts,u=[],i=0;"[]"!==e.ctor;){var a=e._0;i+=a.descendantsCount||0,u.push(a),e=e._1}return i+=u.length,{type:"node",tag:t,facts:c,children:u,namespace:o,descendantsCount:i}}function u(t,r,e){for(var n=h(r),o=n.namespace,c=n.facts,u=[],i=0;"[]"!==e.ctor;){var a=e._0;i+=a._1.descendantsCount||0,u.push(a),e=e._1}return i+=u.length,{type:"keyed-node",tag:t,facts:c,children:u,namespace:o,descendantsCount:i}}function i(t,r,e){return{type:"custom",facts:h(t).facts,model:r,impl:e}}function a(t,r){return{type:"tagger",tagger:t,node:r,descendantsCount:1+(r.descendantsCount||0)}}function f(t,r,e){return{type:"thunk",func:t,args:r,thunk:e,node:void 0}}function l(t,r){return f(t,[r],function(){return t(r)})}function d(t,r,e){return f(t,[r,e],function(){return _(t,r,e)})}function p(t,r,e,n){return f(t,[r,e,n],function(){return s(t,r,e,n)})}function h(t){for(var r,e={};"[]"!==t.ctor;){var n=t._0,o=n.key;if(o===dt||o===pt||o===lt){var c=e[o]||{};c[n.realKey]=n.value,e[o]=c}else if(o===ft){for(var u=e[o]||{},i=n.value;"[]"!==i.ctor;){var a=i._0;u[a._0]=a._1,i=i._1}e[o]=u}else if("namespace"===o)r=n.value;else if("className"===o){var _=e[o];e[o]=void 0===_?n.value:_+" "+n.value}else e[o]=n.value;t=t._1}return{facts:e,namespace:r}}function g(t){return{key:ft,value:t}}function m(t,r){return{key:t,value:r}}function b(t,r){return{key:dt,realKey:t,value:r}}function y(t,r,e){return{key:pt,realKey:r,value:{value:e,namespace:t}}}function k(t,r,e){return{key:lt,realKey:t,value:{options:r,decoder:e}}}function w(t,r){return(t.options===r.options||t.options.stopPropagation===r.options.stopPropagation&&t.options.preventDefault===r.options.preventDefault)&&Fr.equality(t.decoder,r.decoder)}function T(t,r){return r.key!==lt?r:k(r.realKey,r.value.options,_($r,t,r.value.decoder))}function x(t,r){switch(t.type){case"thunk":return t.node||(t.node=t.thunk()),x(t.node,r);case"tagger":for(var e=t.node,n=t.tagger;"tagger"===e.type;)"object"!=typeof n?n=[n,e.tagger]:n.push(e.tagger),e=e.node;var o={tagger:n,parent:r},c=x(e,o);return c.elm_event_node_ref=o,c;case"text":return ht.createTextNode(t.text);case"node":var c=t.namespace?ht.createElementNS(t.namespace,t.tag):ht.createElement(t.tag);S(c,r,t.facts);for(var u=t.children,i=0;i0&&e.push(O("p-thunk",n,s)));case"tagger":for(var f=t.tagger,l=r.tagger,d=!1,p=t.node;"tagger"===p.type;)d=!0,"object"!=typeof f?f=[f,p.tagger]:f.push(p.tagger),p=p.node;for(var h=r.node;"tagger"===h.type;)d=!0,"object"!=typeof l?l=[l,h.tagger]:l.push(h.tagger),h=h.node;return d&&f.length!==l.length?void e.push(O("p-redraw",n,r)):((d?L(f,l):f===l)||e.push(O("p-tagger",n,l)),void A(p,h,e,n+1));case"text":if(t.text!==r.text)return void e.push(O("p-text",n,r.text));return;case"node":if(t.tag!==r.tag||t.namespace!==r.namespace)return void e.push(O("p-redraw",n,r));var v=D(t.facts,r.facts);return void 0!==v&&e.push(O("p-facts",n,v)),void P(t,r,e,n);case"keyed-node":if(t.tag!==r.tag||t.namespace!==r.namespace)return void e.push(O("p-redraw",n,r));var v=D(t.facts,r.facts);return void 0!==v&&e.push(O("p-facts",n,v)),void F(t,r,e,n);case"custom":if(t.impl!==r.impl)return void e.push(O("p-redraw",n,r));var v=D(t.facts,r.facts);void 0!==v&&e.push(O("p-facts",n,v));var g=r.impl.diff(t,r);if(g)return void e.push(O("p-custom",n,g));return}}}function L(t,r){for(var e=0;ei?e.push(O("p-remove-last",n,u-i)):u0||u.length>0||void 0!==E)&&e.push(O("p-reorder",n,{patches:o,inserts:u,endInserts:E}))}function I(t,r,e,n,o,c){var u=t[e];if(void 0===u)return u={tag:"insert",vnode:n,index:o,data:void 0},c.push({index:o,entry:u}),void(t[e]=u);if("remove"===u.tag){c.push({index:o,entry:u}),u.tag="move";var i=[];return A(u.vnode,n,i,u.index),u.index=o,void(u.data.data={patches:i,entry:u})}I(t,r,e+vt,n,o,c)}function H(t,r,e,n,o){var c=t[e];if(void 0===c){var u=O("p-remove",o,void 0);return r.push(u),void(t[e]={tag:"remove",vnode:n,index:o,data:u})}if("insert"===c.tag){c.tag="move";var i=[];A(n,c.vnode,i,o);var u=O("p-remove",o,{patches:i,entry:c});return void r.push(u)}H(t,r,e+vt,n,o)}function z(t,r,e,n){W(t,r,e,0,0,r.descendantsCount,n)}function W(t,r,e,n,o,c,u){for(var i=e[n],a=i.index;a===o;){var _=i.type;if("p-thunk"===_)z(t,r.node,i.data,u);else if("p-reorder"===_){i.domNode=t,i.eventNode=u;var s=i.data.patches;s.length>0&&W(t,r,s,0,o,c,u)}else if("p-remove"===_){i.domNode=t,i.eventNode=u;var f=i.data;if(void 0!==f){f.entry.data=t;var s=f.patches;s.length>0&&W(t,r,s,0,o,c,u)}}else i.domNode=t,i.eventNode=u;if(n++,!(i=e[n])||(a=i.index)>c)return n}switch(r.type){case"tagger":for(var l=r.node;"tagger"===l.type;)l=l.node;return W(t,l,e,n,o+1,c,t.elm_event_node_ref);case"node":for(var d=r.children,p=t.childNodes,h=0;hc))return n;o=g}return n;case"keyed-node":for(var d=r.children,p=t.childNodes,h=0;hc))return n;o=g}return n;case"text":case"thunk":throw new Error("should never traverse `text` or `thunk` nodes like this")}}function q(t,r,e,n){return 0===e.length?t:(z(t,r,e,n),U(t,e))}function U(t,r){for(var e=0;e"),new Error(t)}function Z(t,r,e,n){r.embed=function(r,e){for(;r.lastChild;)r.removeChild(r.lastChild);return _e.initialize(n(t.init,e,r),t.update,t.subscriptions,tt(r,t.view))},r.fullscreen=function(r){return _e.initialize(n(t.init,r,document.body),t.update,t.subscriptions,tt(document.body,t.view))}}function tt(t,r){return function(e,n){var o={tagger:e,parent:void 0},c=r(n),u=x(c,o);return t.appendChild(u),rt(u,r,c,o)}}function rt(t,r,e,n){function o(){switch(u){case"NO_REQUEST":throw new Error("Unexpected draw callback.\nPlease report this to .");case"PENDING_REQUEST":bt(o),u="EXTRA_REQUEST";var e=r(c),a=C(i,e);return t=q(t,i,a,n),void(i=e);case"EXTRA_REQUEST":return void(u="NO_REQUEST")}}var c,u="NO_REQUEST",i=e;return function(t){"NO_REQUEST"===u&&bt(o),u="PENDING_REQUEST",c=t}}function et(t,r,e,n){r.fullscreen=function(r){var o={doc:void 0};return _e.initialize(n(t.init,r,document.body),t.update(nt(o)),t.subscriptions,ot(e,document.body,o,t.view,t.viewIn,t.viewOut))},r.embed=function(r,o){var c={doc:void 0};return _e.initialize(n(t.init,o,r),t.update(nt(c)),t.subscriptions,ot(e,r,c,t.view,t.viewIn,t.viewOut))}}function nt(t){return se.nativeBinding(function(r){var e=t.doc;if(e){var n=e.getElementsByClassName("debugger-sidebar-messages")[0];n&&(n.scrollTop=n.scrollHeight)}r(se.succeed(v.Tuple0))})}function ot(t,r,e,n,o,c){return function(u,i){var a={tagger:u,parent:void 0},_={tagger:u,parent:void 0},s=n(i),f=x(s,a);r.appendChild(f);var l=rt(f,n,s,a),d=o(i)._1,p=x(d,_);r.appendChild(p);var h=it(a,p,o),v=rt(p,h,d,_),g=ct(i,c,_,r,t,e);return function(t){l(t),v(t),g(t)}}}function ct(t,r,e,n,o,c){var u,i;return function(t){if(t.isDebuggerOpen){if(!c.doc)return u=r(t),void(i=ut(o,c,u,e));ht=c.doc;var n=r(t),a=C(u,n);i=q(i,u,a,e),u=n,ht=document}}}function ut(t,r,e,n){function o(){r.doc=void 0,i.close()}var c=screen.width-900,u=screen.height-360,i=window.open("","","width=900,height=360,left="+c+",top="+u);ht=i.document,r.doc=ht,ht.title="Debugger - "+t,ht.body.style.margin="0",ht.body.style.padding="0";var a=x(e,n);return ht.body.appendChild(a),ht.addEventListener("keydown",function(t){t.metaKey&&82===t.which&&window.location.reload(),38===t.which&&(n.tagger({ctor:"Up"}),t.preventDefault()),40===t.which&&(n.tagger({ctor:"Down"}),t.preventDefault())}),window.addEventListener("unload",o),i.addEventListener("unload",function(){r.doc=void 0,window.removeEventListener("unload",o),n.tagger({ctor:"Close"})}),ht=document,a}function it(t,r,e){var n,o=st(r),c="Normal",u=t.tagger,i=function(){};return function(r){var a=e(r),_=a._0.ctor;return t.tagger="Normal"===_?u:i,c!==_&&(at("removeEventListener",o,c),at("addEventListener",o,_),"Normal"===c&&(n=document.body.style.overflow,document.body.style.overflow="hidden"),"Normal"===_&&(document.body.style.overflow=n),c=_),a._1}}function at(t,r,e){switch(e){case"Normal":return;case"Pause":return _t(t,r,yt);case"Message":return _t(t,r,kt)}}function _t(t,r,e){for(var n=0;n0){var u=o.substring(0,c),i=o.substring(c+2);r=s(Cr,u,function(t){return O("Just"===t.ctor?i+", "+t._0:i)},r)}}return r}function l(t){return{responseType:"text",responseToResult:t}}function d(t,r){return{responseType:r.responseType,responseToResult:function(e){var n=r.responseToResult(e);return _(xt,t,n)}}}function p(t){for(var r=new FormData;"[]"!==t.ctor;){var e=t._0;r.append(e._0,e._1),t=t._1}return{ctor:"FormDataBody",_0:r}}return{toTask:r(n),expectStringResponse:l,mapExpect:r(d),multipart:p,encodeUri:t,decodeUri:e}}()),Nc=(r(function(t,r){return v.update(r,{expect:_(Mc.mapExpect,t,r.expect)})}),u(function(t,r,e,n,o,c,u){return{method:t,headers:r,url:e,body:n,expect:o,timeout:c,withCredentials:u}}),function(t){return{ctor:"Request",_0:t}}),Bc=r(function(t,r){return{ctor:"StringBody",_0:t,_1:r}}),Rc={ctor:"EmptyBody"},Ec=(r(function(t,r){return{ctor:"Header",_0:t,_1:r}}),Mc.decodeUri),Cc=(Mc.encodeUri,Mc.expectStringResponse),Oc=function(t){return Cc(function(r){return _(Yr,t,r.body)})},Ac=Cc(function(t){return Tt(t.body)}),Lc=(Mc.multipart,function(t){return _(Bc,"application/json",_(Wr,0,t))}),Dc=Rc,Pc=Nc,Fc=(e(function(t,r,e){return Pc({method:"POST",headers:{ctor:"[]"},url:t,body:r,expect:Oc(e),timeout:C,withCredentials:!1})}),r(function(t,r){return Pc({method:"GET",headers:{ctor:"[]"},url:t,body:Dc,expect:Oc(r),timeout:C,withCredentials:!1})})),Ic=function(t){var r=t;return _(Mc.toTask,r._0,C)},Hc=r(function(t,r){return _(gn,t,Ic(r))}),zc=(n(function(t,r,e,n){return{url:t,status:r,headers:e,body:n}}),r(function(t,r){return{ctor:"BadPayload",_0:t,_1:r}}),r(function(t,r){return{ctor:"StringPart",_0:t,_1:r}}),function(){function t(t){return se.nativeBinding(function(r){0!==t&&history.go(t),r(se.succeed(v.Tuple0))})}function r(t){return se.nativeBinding(function(r){history.pushState({},"",t),r(se.succeed(c()))})}function e(t){return se.nativeBinding(function(r){history.replaceState({},"",t),r(se.succeed(c()))})}function n(t){return se.nativeBinding(function(r){document.location.reload(t),r(se.succeed(v.Tuple0))})}function o(t){return se.nativeBinding(function(r){try{window.location=t}catch(t){document.location.reload(!1)}r(se.succeed(v.Tuple0))})}function c(){var t=document.location;return{href:t.href,host:t.host,hostname:t.hostname,protocol:t.protocol,origin:t.origin,port_:t.port,pathname:t.pathname,search:t.search,hash:t.hash,username:t.username,password:t.password}}function u(){return-1!==window.navigator.userAgent.indexOf("Trident")}return{go:t,setLocation:o,reloadPage:n,pushState:r,replaceState:e,getLocation:c,isInternetExplorer11:u}}()),Wc=zc.replaceState,qc=zc.pushState,Uc=zc.go,jc=zc.reloadPage,Jc=zc.setLocation,Gc=Gc||{};Gc["&>"]=r(function(t,r){return _(nn,function(t){return r},t)});var Vc=e(function(t,r,e){var n=function(r){return _(be,t,r._0(e))};return _(Gc["&>"],sn(_(G,n,r)),un({ctor:"_Tuple0"}))}),Yc=e(function(t,r,e){var n=e;switch(n.ctor){case"Jump":return Uc(n._0);case"New":return _(nn,_(Vc,t,r),qc(n._0));case"Modify":return _(nn,_(Vc,t,r),Wc(n._0));case"Visit":return Jc(n._0);default:return jc(n._0)}}),Qc=function(t){var r=t;return"Normal"===r.ctor?fo(r._0):_(Gc["&>"],fo(r._0),fo(r._1))},$c=e(function(t,r,e){return _(Gc["&>"],s(Vc,t,e.subs,r),un(e))}),Kc=_e.leaf("Navigation"),Xc=_e.leaf("Navigation"),Zc=r(function(t,r){return{subs:t,popWatcher:r}}),tu=un(_(Zc,{ctor:"[]"},C)),ru=function(t){return{ctor:"Reload",_0:t}},eu=(Xc(ru(!1)),Xc(ru(!0)),function(t){return{ctor:"Visit",_0:t}}),nu=function(t){return{ctor:"Modify",_0:t}},ou=function(t){return{ctor:"New",_0:t}},cu=function(t){return Xc(ou(t))},uu=function(t){return{ctor:"Jump",_0:t}},iu=r(function(t,r){var e=r;switch(e.ctor){case"Jump":return uu(e._0);case"New":return ou(e._0);case"Modify":return nu(e._0);case"Visit":return eu(e._0);default:return ru(e._0)}}),au=function(t){return{ctor:"Monitor",_0:t}},_u=(r(function(t,r){var e=r.init(zc.getLocation({ctor:"_Tuple0"})),n=function(e){return he({ctor:"::",_0:Kc(au(t)),_1:{ctor:"::",_0:r.subscriptions(e),_1:{ctor:"[]"}}})};return Eo({init:e,view:r.view,update:r.update,subscriptions:n})}),r(function(t,r){var e=function(t){return _(r.init,t,zc.getLocation({ctor:"_Tuple0"}))},n=function(e){return he({ctor:"::",_0:Kc(au(t)),_1:{ctor:"::",_0:r.subscriptions(e),_1:{ctor:"[]"}}})};return Ro({init:e,view:r.view,update:r.update,subscriptions:n})})),su=r(function(t,r){var e=r;return au(function(r){return t(e._0(r))})}),fu=r(function(t,r){return{ctor:"InternetExplorer",_0:t,_1:r}}),lu=function(t){return{ctor:"Normal",_0:t}},du=function(t){var r=function(r){return _(me,t,zc.getLocation({ctor:"_Tuple0"}))};return zc.isInternetExplorer11({ctor:"_Tuple0"})?s(_n,fu,po(s(vo,"popstate",Ur,r)),po(s(vo,"hashchange",Ur,r))):_(an,lu,po(s(vo,"popstate",Ur,r)))},pu=n(function(t,r,e,n){var o=n,c=o.popWatcher,u=function(){var r={ctor:"_Tuple2",_0:e,_1:c};t:do{if("[]"===r._0.ctor){if("Just"===r._1.ctor)return _(Gc["&>"],Qc(r._1._0),un(_(Zc,e,C)));break t}if("Nothing"===r._1.ctor)return _(an,function(t){return _(Zc,e,O(t))},du(t));break t}while(!1);return un(_(Zc,e,c))}();return _(Gc["&>"],sn(_(G,_(Yc,t,e),r)),u)});_e.effectManagers.Navigation={pkg:"elm-lang/navigation",init:tu,onEffects:pu,onSelfMsg:$c,tag:"fx",cmdMap:iu,subMap:su};var hu=No,vu=_(So,"namespace",zr("http://www.w3.org/2000/svg")),gu=e(function(t,r,e){return s(Bo,t,{ctor:"::",_0:vu,_1:r},e)}),mu=gu("svg"),bu=(gu("foreignObject"),gu("animate"),gu("animateColor"),gu("animateMotion"),gu("animateTransform"),gu("mpath"),gu("set"),gu("a"),gu("defs"),gu("g")),yu=(gu("marker"),gu("mask"),gu("pattern"),gu("switch"),gu("symbol"),gu("desc"),gu("metadata"),gu("title"),gu("feBlend"),gu("feColorMatrix"),gu("feComponentTransfer"),gu("feComposite"),gu("feConvolveMatrix"),gu("feDiffuseLighting"),gu("feDisplacementMap"),gu("feFlood"),gu("feFuncA"),gu("feFuncB"),gu("feFuncG"),gu("feFuncR"),gu("feGaussianBlur"),gu("feImage"),gu("feMerge"),gu("feMergeNode"),gu("feMorphology"),gu("feOffset"),gu("feSpecularLighting"),gu("feTile"),gu("feTurbulence"),gu("font"),gu("linearGradient"),gu("radialGradient"),gu("stop"),gu("circle")),ku=(gu("ellipse"),gu("image"),gu("line"),gu("path")),wu=(gu("polygon"),gu("polyline"),gu("rect")),Tu=(gu("use"),gu("feDistantLight"),gu("fePointLight"),gu("feSpotLight"),gu("altGlyph"),gu("altGlyphDef"),gu("altGlyphItem"),gu("glyph"),gu("glyphRef"),gu("textPath"),gu("text")),xu=(gu("tref"),gu("tspan"),gu("clipPath"),gu("colorProfile"),gu("cursor"),gu("filter"),gu("script"),gu("style"),gu("view"),xo("writing-mode"),xo("word-spacing"),xo("visibility"),xo("unicode-bidi"),xo("text-rendering"),xo("text-decoration"),xo("text-anchor"),xo("stroke")),Su=xo("stroke-width"),Mu=(xo("stroke-opacity"),xo("stroke-miterlimit"),xo("stroke-linejoin"),xo("stroke-linecap"),xo("stroke-dashoffset"),xo("stroke-dasharray"),xo("stop-opacity"),xo("stop-color"),xo("shape-rendering"),xo("pointer-events"),xo("overflow"),xo("opacity"),xo("mask"),xo("marker-start"),xo("marker-mid"),xo("marker-end"),xo("lighting-color"),xo("letter-spacing"),xo("kerning"),xo("image-rendering"),xo("glyph-orientation-vertical"),xo("glyph-orientation-horizontal"),xo("font-weight"),xo("font-variant"),xo("font-style"),xo("font-stretch"),xo("font-size"),xo("font-size-adjust"),xo("font-family"),xo("flood-opacity"),xo("flood-color"),xo("filter"),xo("fill")),Nu=(xo("fill-rule"),xo("fill-opacity"),xo("enable-background"),xo("dominant-baseline"),xo("display"),xo("direction"),xo("cursor"),xo("color"),xo("color-rendering"),xo("color-profile"),xo("color-interpolation"),xo("color-interpolation-filters"),xo("clip"),xo("clip-rule"),xo("clip-path"),xo("baseline-shift"),xo("alignment-baseline"),xo("zoomAndPan"),xo("z"),xo("yChannelSelector"),xo("y2"),xo("y1"),xo("y")),Bu=(_(To,"http://www.w3.org/XML/1998/namespace","xml:space"),_(To,"http://www.w3.org/XML/1998/namespace","xml:lang"),_(To,"http://www.w3.org/XML/1998/namespace","xml:base"),_(To,"http://www.w3.org/1999/xlink","xlink:type"),_(To,"http://www.w3.org/1999/xlink","xlink:title"),_(To,"http://www.w3.org/1999/xlink","xlink:show"),_(To,"http://www.w3.org/1999/xlink","xlink:role"),_(To,"http://www.w3.org/1999/xlink","xlink:href"),_(To,"http://www.w3.org/1999/xlink","xlink:arcrole"),_(To,"http://www.w3.org/1999/xlink","xlink:actuate"),xo("xChannelSelector"),xo("x2"),xo("x1"),xo("x-height"),xo("x")),Ru=(xo("widths"),xo("width")),Eu=(xo("viewTarget"),xo("viewBox")),Cu=(xo("vert-origin-y"),xo("vert-origin-x"),xo("vert-adv-y"),xo("version"),xo("values"),xo("v-mathematical"),xo("v-ideographic"),xo("v-hanging"),xo("v-alphabetic"),xo("units-per-em"),xo("unicode-range"),xo("unicode"),xo("underline-thickness"),xo("underline-position"),xo("u2"),xo("u1"),xo("type"),xo("transform")),Ou=(xo("to"),xo("title"),xo("textLength"),xo("targetY"),xo("targetX"),xo("target"),xo("tableValues"),xo("systemLanguage"),xo("surfaceScale"),xo("style"),xo("string"),xo("strikethrough-thickness"),xo("strikethrough-position"),xo("stitchTiles"),xo("stemv"),xo("stemh"),xo("stdDeviation"),xo("startOffset"),xo("spreadMethod"),xo("speed"),xo("specularExponent"),xo("specularConstant"),xo("spacing"),xo("slope"),xo("seed"),xo("scale"),xo("ry"),xo("rx"),xo("rotate"),xo("result"),xo("restart"),xo("requiredFeatures"),xo("requiredExtensions"),xo("repeatDur"),xo("repeatCount"),xo("rendering-intent"),xo("refY"),xo("refX"),xo("radius"),xo("r")),Au=(xo("primitiveUnits"),xo("preserveAspectRatio"),xo("preserveAlpha"),xo("pointsAtZ"),xo("pointsAtY"),xo("pointsAtX"),xo("points"),xo("point-order"),xo("patternUnits"),xo("patternTransform"),xo("patternContentUnits"),xo("pathLength"),xo("path"),xo("panose-1"),xo("overline-thickness"),xo("overline-position"),xo("origin"),xo("orientation"),xo("orient"),xo("order"),xo("operator"),xo("offset"),xo("numOctaves"),xo("name"),xo("mode"),xo("min"),xo("method"),xo("media"),xo("max"),xo("mathematical"),xo("maskUnits"),xo("maskContentUnits"),xo("markerWidth"),xo("markerUnits"),xo("markerHeight"),xo("local"),xo("limitingConeAngle"),xo("lengthAdjust"),xo("lang"),xo("keyTimes"),xo("keySplines"),xo("keyPoints"),xo("kernelUnitLength"),xo("kernelMatrix"),xo("k4"),xo("k3"),xo("k2"),xo("k1"),xo("k"),xo("intercept"),xo("in2"),xo("in"),xo("ideographic"),xo("id"),xo("horiz-origin-y"),xo("horiz-origin-x"),xo("horiz-adv-x"),xo("height")),Lu=(xo("hanging"),xo("gradientUnits"),xo("gradientTransform"),xo("glyphRef"),xo("glyph-name"),xo("g2"),xo("g1"),xo("fy"),xo("fx"),xo("from"),xo("format"),xo("filterUnits"),xo("filterRes"),xo("externalResourcesRequired"),xo("exponent"),xo("end"),xo("elevation"),xo("edgeMode"),xo("dy"),xo("dx"),xo("dur"),xo("divisor"),xo("diffuseConstant"),xo("descent"),xo("decelerate"),xo("d")),Du=xo("cy"),Pu=xo("cx"),Fu=(xo("contentStyleType"),xo("contentScriptType"),xo("clipPathUnits"),xo("class"),xo("cap-height"),xo("calcMode"),xo("by"),xo("bias"),xo("begin"),xo("bbox"),xo("baseProfile"),xo("baseFrequency"),xo("azimuth"),xo("autoReverse"),xo("attributeType"),xo("attributeName"),xo("ascent"),xo("arabic-form"),xo("amplitude"),xo("allowReorder"),xo("alphabetic"),xo("additive"),xo("accumulate"),xo("accelerate"),xo("accent-height"),function(){function t(t,r){return se.nativeBinding(function(e){try{var n=new WebSocket(t);n.elm_web_socket=!0}catch(t){return e(se.fail({ctor:"SecurityError"===t.name?"BadSecurity":"BadArgs",_0:t.message}))}return n.addEventListener("open",function(t){e(se.succeed(n))}),n.addEventListener("message",function(t){se.rawSpawn(_(r.onMessage,n,t.data))}),n.addEventListener("close",function(t){se.rawSpawn(r.onClose({code:t.code,reason:t.reason,wasClean:t.wasClean}))}),function(){n&&n.close&&n.close()}})}function n(t,r){return se.nativeBinding(function(e){var n=t.readyState===WebSocket.OPEN?C:O({ctor:"NotOpen"});try{t.send(r)}catch(t){n=O({ctor:"BadString"})}e(se.succeed(n))})}function o(t,r,e){return se.nativeBinding(function(n){try{e.close(t,r)}catch(t){return n(se.fail(O({ctor:"SyntaxError"===t.name?"BadReason":"BadCode"})))}n(se.succeed(C))})}function c(t){return se.nativeBinding(function(r){r(se.succeed(t.bufferedAmount))})}return{open:r(t),send:r(n),close:e(o),bytesQueued:c}}()),Iu=(Fu.bytesQueued,Fu.send),Hu=Fu.close,zu=function(t){return _(an,g({ctor:"_Tuple0"}),s(Hu,1e3,"",t))},Wu=Fu.open,qu=(r(function(t,r){return{onMessage:t,onClose:r}}),function(t){var r=t;return"Opening"===r.ctor?fo(r._1):zu(r._0)}),Uu=function(t){return v.cmp(t,1)<0?un({ctor:"_Tuple0"}):lo(T(10*Math.pow(2,t)))},ju=r(function(t,r){return v.update(r,{queues:_(Pr,t,r.queues)})}),Ju=e(function(t,r,e){return v.update(e,{sockets:s(Or,t,r,e.sockets)})}),Gu=r(function(t,r){var e=r;return O("Nothing"===e.ctor?{ctor:"::",_0:t,_1:{ctor:"[]"}}:{ctor:"::",_0:t,_1:e._0})}),Vu=r(function(t,r){for(;;){var e=t;if("[]"===e.ctor)return r;if("Listen"!==e._0.ctor){var n=e._1,o=s(Cr,e._0._0,function(t){return O(_(E,{ctor:"[]"},t))},r);t=n,r=o}else{var c=e._1,u=s(Cr,e._0._0,Gu(e._0._1),r);t=c,r=u}}}),Yu=Yu||{};Yu["&>"]=r(function(t,r){return _(nn,function(t){return r},t)});var Qu=e(function(t,r,e){for(;;){var n=t;if("[]"===n.ctor)return un(e);var o=n._1,c=n._0._0,u=n._0._1,i=_(er,c,r);if("Just"===i.ctor&&"Connected"===i._0.ctor)return _(Yu["&>"],_(Iu,i._0._0,u),s(Qu,o,r,e));var a=o,f=r,l=s(Cr,c,Gu(u),e);t=a,r=f,e=l}}),$u=_e.leaf("WebSocket"),Ku=_e.leaf("WebSocket"),Xu=e(function(t,r,e){return{sockets:t,queues:r,subs:e}}),Zu=un(s(Xu,hr,hr,hr)),ti=r(function(t,r){return{ctor:"Send",_0:t,_1:r}}),ri=(r(function(t,r){return Ku(_(ti,t,r))}),r(function(t,r){var e=r;return _(ti,e._0,e._1)})),ei=function(t){return{ctor:"KeepAlive",_0:t}},ni=r(function(t,r){return{ctor:"Listen",_0:t,_1:r}}),oi=r(function(t,r){return $u(_(ni,t,r))}),ci=r(function(t,r){var e=r;return"Listen"===e.ctor?_(ni,e._0,function(r){return t(e._1(r))}):ei(e._0)}),ui=function(t){return{ctor:"Connected",_0:t}},ii=r(function(t,r){return{ctor:"Opening",_0:t,_1:r}}),ai=function(t){return{ctor:"BadOpen",_0:t}},_i=r(function(t,r){return{ctor:"GoodOpen",_0:t,_1:r}}),si=function(t){return{ctor:"Die",_0:t}},fi=r(function(t,r){return{ctor:"Receive",_0:t,_1:r}}),li=r(function(t,e){return _(Wu,t,{onMessage:r(function(r,n){return _(me,e,_(fi,t,n))}),onClose:function(r){return _(me,e,si(t))}})}),di=e(function(t,r,e){var n=function(r){return _(me,t,ai(e))},o=function(r){return _(me,t,_(_i,e,r))},c=_(en,n,_(nn,o,_(li,e,t)));return po(_(Yu["&>"],Uu(r),c))}),pi=n(function(t,o,c,u){var i=_(Vu,c,hr),a=function(o){var c=e(function(t,r,e){return _(Yu["&>"],qu(r),e)}),a=n(function(t,r,e,n){return _(an,_(Or,t,e),n)}),f=e(function(r,e,n){return _(nn,function(e){return _(nn,function(t){return un(s(Or,r,_(ii,0,t),e))},s(di,t,0,r))},n)}),l=_(Ar,o,_(Nr,r(function(t,r){return{ctor:"[]"}}),i)),p=d(Xt,f,a,c,l,u.sockets,un(hr));return _(nn,function(t){return un(s(Xu,t,o,i))},p)},f=s(Qu,o,u.sockets,u.queues);return _(nn,a,f)}),hi=e(function(t,e,n){var o=e;switch(o.ctor){case"Receive":var c=_(G,function(r){return _(be,t,r(o._1))},_(E,{ctor:"[]"},_(er,o._0,n.subs)));return _(Yu["&>"],sn(c),un(n));case"Die":var u=o._0;return"Nothing"===_(er,u,n.sockets).ctor?un(n):_(nn,function(t){return un(s(Ju,u,_(ii,0,t),n))},s(di,t,0,u));case"GoodOpen":var i=o._1,a=o._0,f=_(er,a,n.queues);return"Nothing"===f.ctor?un(s(Ju,a,ui(i),n)):s(H,r(function(t,r){return _(Yu["&>"],_(Iu,i,t),r)}),un(_(ju,a,s(Ju,a,ui(i),n))),f._0);default:var l=o._0,d=_(er,l,n.sockets);if("Nothing"===d.ctor)return un(n);if("Opening"===d._0.ctor){var p=d._0._0;return _(nn,function(t){return un(s(Ju,l,_(ii,p+1,t),n))},s(di,t,p+1,l))}return un(n)}});_e.effectManagers.WebSocket={pkg:"elm-lang/websocket",init:Zu,onEffects:pi,onSelfMsg:hi,tag:"fx",cmdMap:ri,subMap:ci};var vi=function(t){var e=_(Wt,"=",t);return"::"===e.ctor&&"::"===e._1.ctor&&"[]"===e._1._1.ctor?s(L,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),Ec(e._0),Ec(e._1._0)):C},gi=function(t){return Dr(_(Q,vi,_(Wt,"&",_(Dt,1,t))))},mi=function(t){var r=_(Wt,"/",t);return"::"===r.ctor&&""===r._0?r._1:r},bi=function(t){for(;;){var r=t;if("[]"===r.ctor)return C;var e=r._0,n=e.unvisited;if("[]"===n.ctor)return O(e.value);if(""===n._0&&"[]"===n._1.ctor)return O(e.value);t=r._1}},yi=e(function(t,r,e){return bi(t._0({visited:{ctor:"[]"},unvisited:mi(r),params:e,value:m}))}),ki=r(function(t,r){return s(yi,t,_(Dt,1,r.hash),gi(r.search))}),wi=(r(function(t,r){return s(yi,t,r.pathname,gi(r.search))}),r(function(t,r){var e=r;return{visited:e.visited,unvisited:e.unvisited,params:e.params,value:t(e.value)}})),Ti=n(function(t,r,e,n){return{visited:t,unvisited:r,params:e,value:n}}),xi=function(t){return{ctor:"Parser",_0:t}},Si=function(t){return xi(function(r){var e=r,n=e.unvisited;if("[]"===n.ctor)return{ctor:"[]"};var o=n._0;return v.eq(o,t)?{ctor:"::",_0:f(Ti,{ctor:"::",_0:o,_1:e.visited},n._1,e.params,e.value),_1:{ctor:"[]"}}:{ctor:"[]"}})},Mi=r(function(t,r){return xi(function(t){var e=t,n=e.unvisited;if("[]"===n.ctor)return{ctor:"[]"};var o=n._0,c=r(o);return"Ok"===c.ctor?{ctor:"::",_0:f(Ti,{ctor:"::",_0:o,_1:e.visited},n._1,e.params,e.value(c._0)),_1:{ctor:"[]"}}:{ctor:"[]"}})}),Ni=_(Mi,"STRING",Tt),Bi=(_(Mi,"NUMBER",Nt),Bi||{});Bi[""]=r(function(t,r){var e=t,n=r;return xi(function(t){return _(Z,n._0,e._0(t))})});var Ri=r(function(t,r){var e=r;return xi(function(r){var n=r;return _(G,wi(n.value),e._0({visited:n.visited,unvisited:n.unvisited,params:n.params,value:t}))})}),Bi=(xi(function(t){return{ctor:"::",_0:t,_1:{ctor:"[]"}}}),Bi||{});Bi[""]=r(function(t,r){var e=t,n=r;return xi(function(t){return _(Z,n._0,e._0(t))})});var Ei=function(t){return{ctor:"QueryParser",_0:t}},Ci=(r(function(t,r){return Ei(function(e){var n=e,o=n.params;return{ctor:"::",_0:f(Ti,n.visited,n.unvisited,o,n.value(r(_(er,t,o)))),_1:{ctor:"[]"}}})}),function(){return _(jr,function(t){var r=Jn(t);return"Ok"===r.ctor?Gr(r._0):Jr(r._0)},oe)}()),Oi=function(t){return function(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return function(s){return{mailbox:t,id:r,from:e,to:n,subject:o,date:c,size:u,seen:i,text:a,html:_,attachments:s}}}}}}}}}}}},Ai=e(function(t,r,e){return{id:t,fileName:r,contentType:e}}),Li=s(Se,"content-type",oe,s(Se,"filename",oe,s(Se,"id",oe,ye(Ai)))),Di=s(Se,"attachments",re(Li),s(Se,"html",oe,s(Se,"text",oe,s(Se,"seen",ne,s(Se,"size",ee,s(Se,"date",Ci,f(Te,"subject",oe,"",s(Se,"to",re(oe),f(Te,"from",oe,"",s(Se,"id",oe,s(Se,"mailbox",oe,ye(Oi)))))))))))),Pi=i(function(t,r,e,n,o,c,u,i){return{mailbox:t,id:r,from:e,to:n,subject:o,date:c,size:u,seen:i}}),Fi=s(Se,"seen",ne,s(Se,"size",ee,s(Se,"date",Ci,f(Te,"subject",oe,"",s(Se,"to",re(oe),f(Te,"from",oe,"",s(Se,"id",oe,s(Se,"mailbox",oe,ye(Pi))))))))),Ii=_($r,function(t){return _(G,function(t){return _(kt,0,Nt(t))},_(Wt,",",t))},oe),Hi=function(t){return function(r){return function(e){return function(n){return function(o){return function(c){return function(u){return function(i){return function(a){return function(_){return function(s){return function(f){return function(l){return function(d){return function(p){return function(h){return function(v){return function(g){return function(m){return function(b){return function(y){return{sysMem:t,heapSize:r,heapUsed:e,heapObjects:n,goRoutines:o,webSockets:c,smtpConnOpen:u,smtpConnTotal:i,smtpConnHist:a,smtpReceivedTotal:_,smtpReceivedHist:s,smtpErrorsTotal:f,smtpErrorsHist:l,smtpWarnsTotal:d,smtpWarnsHist:p,retentionDeletesTotal:h,retentionDeletesHist:v,retainedCount:g,retainedCountHist:m,retainedSize:b,retainedSizeHist:y}}}}}}}}}}}}}}}}}}}}}},zi=s(xe,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"SizeHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"RetainedSize",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"RetainedHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"RetainedCurrent",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"DeletesHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"retention",_1:{ctor:"::",_0:"DeletesTotal",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"WarnsHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"WarnsTotal",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ErrorsHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ErrorsTotal",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ReceivedHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ReceivedTotal",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ConnectsHist",_1:{ctor:"[]"}}},Ii,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ConnectsTotal",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"smtp",_1:{ctor:"::",_0:"ConnectsCurrent",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"http",_1:{ctor:"::",_0:"WebSocketConnectsCurrent",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"goroutines",_1:{ctor:"[]"}},ee,s(xe,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"HeapObjects",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"HeapAlloc",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"HeapSys",_1:{ctor:"[]"}}},ee,s(xe,{ctor:"::",_0:"memstats",_1:{ctor:"::",_0:"Sys",_1:{ctor:"[]"}}},ee,ye(Hi)))))))))))))))))))))),Wi=r(function(t,e){var n=t;switch(n.ctor){case"None":return e;case"SetFlash":return v.update(e,{flash:n._0});case"ClearFlash":return v.update(e,{flash:""});case"DisableRouting":return v.update(e,{routing:!1});case"EnableRouting":return v.update(e,{routing:!0});default:var o=n._0;if(v.eq(j(e.persistent.recentMailboxes),O(o)))return e;var c=e.persistent,u=_(r(function(t,r){return{ctor:"::",_0:t,_1:r}}),o,_(nt,7,_(V,r(function(t,r){return!v.eq(t,r)})(o),e.persistent.recentMailboxes)));return v.update(e,{persistent:v.update(c,{recentMailboxes:u})})}}),qi=n(function(t,r,e,n){return{host:t,flash:r,routing:e,persistent:n}}),Ui=r(function(t,r){return f(qi,t.host,"",!0,r)}),ji=function(t){return{recentMailboxes:t}},Ji=f(Te,"recentMailboxes",re(oe),{ctor:"[]"},ye(ji)),Gi=function(t){return _(kt,{recentMailboxes:{ctor:"[]"}},_(Vr,Ji,t))},Vi=function(t){return{ctor:"AddRecent",_0:t}},Yi={ctor:"EnableRouting"},Qi={ctor:"DisableRouting"},$i={ctor:"ClearFlash"},Ki=function(t){return{ctor:"SetFlash",_0:t}},Xi={ctor:"None"},Zi=Xi,ta=function(t){var r=t;switch(r.ctor){case"BadUrl":return _(b["++"],"Bad URL: ",r._0);case"Timeout":return"HTTP timeout";case"NetworkError":return"HTTP Network error";case"BadStatus":return _(b["++"],"Bad HTTP status: ",y(r._0.status.code));default:return _(b["++"],"Bad HTTP payload: ",_(b["++"],r._0,_(b["++"]," (",_(b["++"],y(r._1.status.code),")"))))}},ra=r(function(t,r){return Pc({method:"PATCH",headers:{ctor:"[]"},url:t,body:r,expect:Cc(function(t){return Tt({ctor:"_Tuple0"})}),timeout:C,withCredentials:!1})}),ea=function(t){return Pc({method:"DELETE",headers:{ctor:"[]"},url:t,body:Dc,expect:Cc(function(t){return Tt({ctor:"_Tuple0"})}),timeout:C,withCredentials:!1})},na=_e.incomingPort("onSessionChange",Ur),oa=_e.outgoingPort("storeSession",function(t){return{recentMailboxes:D.toArray(t.recentMailboxes).map(function(t){return t})}}),ca=_e.outgoingPort("windowTitle",function(t){return t}),ua=r(function(t,r){return _(Yo,{ctor:"::",_0:sc("page"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("greeting"),_1:{ctor:"::",_0:_(ic,"innerHTML",zr(r.greeting)),_1:{ctor:"[]"}}},{ctor:"[]"}),_1:{ctor:"[]"}})}),ia=function(t){return{greeting:t}},aa=e(function(t,r,e){var n=r;return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:ia(n._0._0),_1:le,_2:Zi}:{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))}}),_a=function(t){return{ctor:"GreetingResult",_0:t}},sa=_(Hc,_a,function(t){return Pc({method:"GET",headers:{ctor:"[]"},url:t,body:Dc,expect:Ac,timeout:C,withCredentials:!1})}("/serve/greeting")),fa={ctor:"_Tuple2",_0:ia(""),_1:fe({ctor:"::",_0:ca("Inbucket"),_1:{ctor:"::",_0:sa,_1:{ctor:"[]"}}})},la=function(t){var r=function(){switch(t){case 11:case 12:case 13:return"th";default:switch(_(b["%"],t,10)){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}}();return _(b["++"],y(t),r)},da=r(function(t,r){var e=y(r),n=t-Ut(e),o=_(zt,"",_(G,function(t){return"0"},_(it,1,n)));return _(b["++"],o,e)}),pa=function(t){return v.eq(t,0)?12:v.cmp(t,12)<1?t:t-12},ha=function(t){return v.cmp(In(t),11)>0?"pm":"am"},va=function(t){return y(qn(t))},ga=function(t){var r=Jn(_(b["++"],y(qn(t)),"-01-01T00:00:00.000Z"));return"Ok"===r.ctor?r._0:t},ma=function(t){switch(Hn(t).ctor){case"Mon":return"Monday";case"Tue":return"Tuesday";case"Wed":return"Wednesday";case"Thu":return"Thursday";case"Fri":return"Friday";case"Sat":return"Saturday";default:return"Sunday"}},ba=zn,ya=function(t){return!!v.eq(_(b["%"],t,4),0)&&(!v.eq(_(b["%"],t,100),0)||!!v.eq(_(b["%"],t,400),0))},ka=r(function(t,r){switch(r.ctor){case"Jan":return 31;case"Feb":return ya(t)?29:28;case"Mar":return 31;case"Apr":return 30;case"May":return 31;case"Jun":return 30;case"Jul":case"Aug":return 31;case"Sep":return 30;case"Oct":return 31;case"Nov":return 30;default:return 31}}),wa=function(t){switch(Wn(t).ctor){case"Jan":return"January";case"Feb":return"February";case"Mar":return"March";case"Apr":return"April";case"May":return"May";case"Jun":return"June";case"Jul":return"July";case"Aug":return"August";case"Sep":return"September";case"Oct":return"October";case"Nov":return"November";default:return"December"}},Ta={ctor:"::",_0:Gn,_1:{ctor:"::",_0:Xn,_1:{ctor:"::",_0:Kn,_1:{ctor:"::",_0:$n,_1:{ctor:"::",_0:Qn,_1:{ctor:"::",_0:Yn,_1:{ctor:"::",_0:Vn,_1:{ctor:"[]"}}}}}}}},xa=function(t){return function(t){return t._0}(_(E,{ctor:"_Tuple2",_0:0,_1:Gn},j(_(V,function(r){var e=r;return v.eq(e._1,Hn(t))},_(at,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),Ta)))))},Sa={ctor:"::",_0:so,_1:{ctor:"::",_0:_o,_1:{ctor:"::",_0:ao,_1:{ctor:"::",_0:io,_1:{ctor:"::",_0:uo,_1:{ctor:"::",_0:co,_1:{ctor:"::",_0:oo,_1:{ctor:"::",_0:no,_1:{ctor:"::",_0:eo,_1:{ctor:"::",_0:ro,_1:{ctor:"::",_0:to,_1:{ctor:"::",_0:Zn,_1:{ctor:"[]"}}}}}}}}}}}}},Ma=function(t){return _(E,{ctor:"_Tuple2",_0:0,_1:so},j(_(V,function(r){var e=r;return v.eq(e._1,Wn(t))},_(at,r(function(t,r){return{ctor:"_Tuple2",_0:t,_1:r}}),Sa))))},Na=function(t){return _(r(function(t,r){return t+r}),1,function(t){return t._0}(Ma(t)))},Ba=function(t){return Na(t)/4|0},Ra=function(t){var r=_(nt,Na(t)-1,Sa);return W(_(G,ka(qn(t)),r))+ba(t)},Ea=function(t){var r=ga(t),e=xa(r);return 1+((Ra(t)+e)/7|0)},Ca=r(function(t,e){var n=e;switch(n.ctor){case"MonthNumber":return y(Na(t));case"MonthSuffix":return la(Na(t));case"MonthFixed":return _(da,2,Na(t));case"MonthNameFirst":return _(Ft,n._0,wa(t));case"MonthNameFull":return wa(t);case"QuarterNumber":return y(_(r(function(t,r){return t+r}),1,Ba(t)));case"QuarterSuffix":return la(_(r(function(t,r){return t+r}),1,Ba(t)));case"DayOfMonthNumber":return y(ba(t));case"DayOfMonthSuffix":return la(ba(t));case"DayOfMonthFixed":return _(da,2,ba(t));case"DayOfYearNumber":return y(Ra(t));case"DayOfYearSuffix":return la(Ra(t));case"DayOfYearFixed":return _(da,3,Ra(t));case"DayOfWeekNumber":return y(xa(t));case"DayOfWeekSuffix":return la(xa(t));case"DayOfWeekNameFirst":return _(Ft,n._0,ma(t));case"DayOfWeekNameFull":return ma(t);case"WeekOfYearNumber":return y(Ea(t));case"WeekOfYearSuffix":return la(Ea(t));case"WeekOfYearFixed":return _(da,2,Ea(t));case"YearNumberLastTwo":return _(Pt,2,va(t));case"YearNumber":return va(t);case"AmPmUppercase":return Ot(ha(t));case"AmPmLowercase":return Ct(ha(t));case"HourMilitaryNumber":return y(In(t));case"HourMilitaryFixed":return _(da,2,In(t));case"HourNumber":return y(pa(In(t)));case"HourFixed":return _(da,2,pa(In(t)));case"HourMilitaryFromOneNumber":return y(_(r(function(t,r){return t+r}),1,In(t)));case"HourMilitaryFromOneFixed":return _(da,2,_(r(function(t,r){return t+r}),1,In(t)));case"MinuteNumber":return y(Fn(t));case"MinuteFixed":return _(da,2,Fn(t));case"SecondNumber":return y(Pn(t));case"SecondFixed":return _(da,2,Pn(t));default:return n._0}}),Oa=r(function(t,r){return _(zt,"",_(G,Ca(r),t))}),Aa=(e(function(t,r,e){return{month:t,day:r,year:e}}),function(t){return{ctor:"Text",_0:t}}),La=Aa,Da={ctor:"SecondFixed"},Pa=Da,Fa={ctor:"MinuteFixed"},Ia=Fa,Ha={ctor:"HourNumber"},za=Ha,Wa={ctor:"AmPmUppercase"},qa=Wa,Ua={ctor:"YearNumber"},ja=Ua,Ja=function(t){return{ctor:"DayOfWeekNameFirst",_0:t}},Ga=(Ja(2),Ja(3),{ctor:"DayOfMonthFixed"}),Va=Ga,Ya={ctor:"DayOfMonthSuffix"},Qa=Ya,$a={ctor:"MonthNameFull"},Ka=$a,Xa=function(t){return{ctor:"MonthNameFirst",_0:t}}(3),Za=function(t){return v.cmp(t,2)<0?"in a year":_(b["++"],"in ",_(b["++"],y(t)," years"))},t_=function(t){return v.cmp(t,2)<0?"in a month":_(b["++"],"in ",_(b["++"],y(t)," months"))},r_=function(t){return v.cmp(t,2)<0?"tomorrow":_(b["++"],"in ",_(b["++"],y(t)," days"))},e_=function(t){return v.cmp(t,2)<0?"in an hour":_(b["++"],"in ",_(b["++"],y(t)," hours"))},n_=function(t){return v.cmp(t,2)<0?"in a minute":_(b["++"],"in ",_(b["++"],y(t)," minutes"))},o_=function(t){return v.cmp(t,30)<0?"in a few seconds":_(b["++"],"in ",_(b["++"],y(t)," seconds"))},c_=function(t){return v.cmp(t,2)<0?"last year":_(b["++"],y(t)," years ago")},u_=function(t){return v.cmp(t,2)<0?"last month":_(b["++"],y(t)," months ago")},i_=function(t){return v.cmp(t,2)<0?"yesterday":_(b["++"],y(t)," days ago")},a_=function(t){return v.cmp(t,2)<0?"an hour ago":_(b["++"],y(t)," hours ago")},__=function(t){return v.cmp(t,2)<0?"a minute ago":_(b["++"],y(t)," minutes ago")},s_=function(t){return v.cmp(t,30)<0?"just now":_(b["++"],y(t)," seconds ago")},f_=r(function(t,r){return v.cmp(xn(t),1)<0?r.seconds(x(Sn(t))):v.cmp(Tn(t),1)<0?r.minutes(x(xn(t))):v.cmp(Tn(t),24)<0?r.hours(x(Tn(t)/1)):v.cmp(Tn(t),720)<0?r.days(x(Tn(t)/24)):v.cmp(Tn(t),8760)<0?r.months(x(Tn(t)/24/12)):r.years(x(Tn(t)/24/365))}),l_=function(t){return Sn(jn(t))},d_={someSecondsAgo:s_,someMinutesAgo:__,someHoursAgo:a_,someDaysAgo:i_,someMonthsAgo:u_,someYearsAgo:c_,inSomeSeconds:o_,inSomeMinutes:n_,inSomeHours:e_,inSomeDays:r_,inSomeMonths:t_,inSomeYears:Za},p_=c(function(t,r,e,n,o,c){return{seconds:t,minutes:r,hours:e,days:n,months:o,years:c}}),h_=e(function(t,r,e){var n=l_(e)-l_(r),o=1e3*B(n);return _(f_,o,v.cmp(n,0)<0?d(p_,t.someSecondsAgo,t.someMinutesAgo,t.someHoursAgo,t.someDaysAgo,t.someMonthsAgo,t.someYearsAgo):d(p_,t.inSomeSeconds,t.inSomeMinutes,t.inSomeHours,t.inSomeDays,t.inSomeMonths,t.inSomeYears))}),v_=h_(d_),g_=function(t){var r=function(){var r=t;switch(r.ctor){case"Unknown":case"Home":return{ctor:"[]"};case"Mailbox":return{ctor:"::",_0:"m",_1:{ctor:"::",_0:r._0,_1:{ctor:"[]"}}};case"Message":return{ctor:"::",_0:"m",_1:{ctor:"::",_0:r._0,_1:{ctor:"::",_0:r._1,_1:{ctor:"[]"}}}};case"Monitor":return{ctor:"::",_0:"monitor",_1:{ctor:"[]"}};default:return{ctor:"::",_0:"status",_1:{ctor:"[]"}}}}();return _(b["++"],"/#/",_(zt,"/",r))},m_=function(t){return pc(g_(t))},b_=function(t){return cu(g_(t))},y_={ctor:"Status"},k_={ctor:"Monitor"},w_=r(function(t,r){return{ctor:"Message",_0:t,_1:r}}),T_=function(t){return{ctor:"Mailbox",_0:t}},x_={ctor:"Home"},S_=function(t){return xi(function(r){return _(Z,function(t){return t._0(r)},t)})}({ctor:"::",_0:_(Ri,x_,Si("")),_1:{ctor:"::",_0:_(Ri,w_,_(Bi[""],Si("m"),_(Bi[""],Ni,Ni))),_1:{ctor:"::",_0:_(Ri,T_,_(Bi[""],Si("m"),Ni)),_1:{ctor:"::",_0:_(Ri,k_,Si("monitor")),_1:{ctor:"::",_0:_(Ri,y_,Si("status")),_1:{ctor:"[]"}}}}}}),M_=function(t){return{ctor:"Unknown",_0:t}},N_=function(t){if(Yt(t.hash))return x_;var r=_(ki,S_,t);return"Nothing"===r.ctor?M_(t.hash):r._0},B_=function(t){return v.eq(t.searchFilter,"")?t.headers:_(V,function(r){return _(Et,t.searchFilter,Ct(r.subject))||_(Et,t.searchFilter,Ct(r.from))},t.headers)},R_=function(t){return Oo(_(Oa,{ctor:"::",_0:Ka,_1:{ctor:"::",_0:La(" "),_1:{ctor:"::",_0:Qa,_1:{ctor:"::",_0:La(", "),_1:{ctor:"::",_0:ja,_1:{ctor:"::",_0:La(" "),_1:{ctor:"::",_0:za,_1:{ctor:"::",_0:La(":"),_1:{ctor:"::",_0:Ia,_1:{ctor:"::",_0:La(":"),_1:{ctor:"::",_0:Pa,_1:{ctor:"::",_0:La(" "),_1:{ctor:"::",_0:qa,_1:{ctor:"[]"}}}}}}}}}}}}}},t))},E_=r(function(t,r){return Oo(_(v_,t.now,r))}),C_=r(function(t,r){var e=_(b["++"],t,_(b["++"],r.id,_(b["++"],"/",r.fileName)));return _(tc,{ctor:"[]"},{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:_(Qo,{ctor:"::",_0:pc(e),_1:{ctor:"::",_0:hc("_blank"),_1:{ctor:"[]"}}},{ctor:"::",_0:Oo(r.fileName),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Oo(_(b["++"]," (",_(b["++"],r.contentType,") "))),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:_(Qo,{ctor:"::",_0:pc(e),_1:{ctor:"::",_0:vc(r.fileName),_1:{ctor:"::",_0:_c("button"),_1:{ctor:"[]"}}}},{ctor:"::",_0:Oo("Download"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}})}),O_=function(t){var r=_(b["++"],"/serve/m/attach/",_(b["++"],t.mailbox,_(b["++"],"/",_(b["++"],t.id,"/"))));return q(t.attachments)?_(Yo,{ctor:"[]"},{ctor:"[]"}):_(Ko,{ctor:"::",_0:_c("attachments well"),_1:{ctor:"[]"}},_(G,C_(r),t.attachments))},A_=e(function(t,r,e){return{headers:t,selected:r,searchFilter:e}}),L_=r(function(t,r){return{message:t,markSeenAt:r}}),D_=o(function(t,r,e,n,o){return{mailboxName:t,state:r,bodyMode:e,searchInput:n,now:o}}),P_={ctor:"SafeHtmlBody"},F_={ctor:"TextBody"},I_=r(function(t,r){return{ctor:"ShowingList",_0:t,_1:r}}),H_=r(function(t,r){var e=v.cmp(Ut(r),1)>0?Ct(r):"",n=t.state;return"LoadingList"===n.ctor?{ctor:"_Tuple3",_0:t,_1:le,_2:Zi}:{ctor:"_Tuple3",_0:v.update(t,{searchInput:r,state:_(I_,v.update(n._0,{searchFilter:e}),n._1)}),_1:le,_2:Zi}}),z_=function(t){return{ctor:"LoadingList",_0:t}},W_=function(t){return{ctor:"Transitioning",_0:t}},q_=function(t){return{ctor:"ShowingMessage",_0:t}},U_={ctor:"LoadingMessage"},j_=r(function(t,r){var e=t.state;if("LoadingList"===e.ctor)return t;var n=v.update(e._0,{selected:O(r)}),o=e._1;switch(o.ctor){case"NoMessage":case"LoadingMessage":return v.update(t,{state:_(I_,n,U_)});case"ShowingMessage":default:return v.update(t,{state:_(I_,n,W_(o._0))})}}),J_={ctor:"NoMessage"},G_=function(t){return{ctor:"ViewMessage",_0:t}},V_=function(t){return{ctor:"Tick",_0:t}},Y_=function(t){return{ctor:"SeenTick",_0:t}},Q_=function(t){var r=function(){var r=t.state;return"ShowingList"===r.ctor&&"ShowingMessage"===r._1.ctor?r._1._0.message.seen?ve:_(An,250,Y_):ve}();return he({ctor:"::",_0:_(An,3e4,V_),_1:{ctor:"::",_0:r,_1:{ctor:"[]"}}})},$_=function(t){return{ctor:"SearchInput",_0:t}},K_=function(t){return{ctor:"PurgeResult",_0:t}},X_=function(t){var r=_(Hc,K_,ea(_(b["++"],"/api/v1/mailbox/",t.mailboxName)));return"ShowingList"===t.state.ctor?{ctor:"_Tuple3",_0:v.update(t,{state:_(I_,s(A_,{ctor:"[]"},C,""),J_)}),_1:r,_2:Zi}:{ctor:"_Tuple3",_0:t,_1:r,_2:Zi}},Z_={ctor:"Purge"},ts=function(t){return{ctor:"OpenedTime",_0:t}},rs=r(function(t,r){var e=v.eq(r.html,"")?F_:t.bodyMode,n=t.state;return"LoadingList"===n.ctor?{ctor:"_Tuple3",_0:t,_1:le,_2:Zi}:{ctor:"_Tuple3",_0:v.update(t,{state:_(I_,v.update(n._0,{selected:O(r.id)}),q_(_(L_,r,C))),bodyMode:e}),_1:_(vn,ts,Mn),_2:Zi}}),es=function(t){return{ctor:"MessageBody",_0:t}},ns=r(function(t,e){var n=r(function(t,r){return _(Qo,{ctor:"::",_0:gc({ctor:"::",_0:{ctor:"_Tuple2",_0:"active",_1:v.eq(e,t)},_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Sc(es(t)),_1:{ctor:"::",_0:pc("javacript:void(0)"),_1:{ctor:"[]"}}}},{ctor:"::",_0:Oo(r),_1:{ctor:"[]"}})}),o=_(n,P_,"Safe HTML"),c=_(n,F_,"Plain Text"),u=v.eq(t.html,"")?{ctor:"::",_0:c,_1:{ctor:"[]"}}:{ctor:"::",_0:o,_1:{ctor:"::",_0:c,_1:{ctor:"[]"}}};return _(Yo,{ctor:"::",_0:_c("tab-panel"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Lo,{ctor:"::",_0:_c("tab-bar"),_1:{ctor:"[]"}},u),_1:{ctor:"::",_0:_(Do,{ctor:"::",_0:_c("message-body"),_1:{ctor:"[]"}},{ctor:"::",_0:function(){return"SafeHtmlBody"===e.ctor?_(Yo,{ctor:"::",_0:_(ic,"innerHTML",zr(t.html)),_1:{ctor:"[]"}},{ctor:"[]"}):_(Yo,{ctor:"::",_0:_(ic,"innerHTML",zr(t.text)),_1:{ctor:"[]"}},{ctor:"[]"})}(),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}})}),os=function(t){return{ctor:"MessageResult",_0:t}},cs=r(function(t,r){var e=_(b["++"],"/serve/m/",_(b["++"],t,_(b["++"],"/",r)));return _(Hc,os,_(Fc,e,Di))}),us=function(t){return{ctor:"MarkSeenResult",_0:t}},is=r(function(t,e){var n=t.state;if("ShowingList"===n.ctor&&"ShowingMessage"===n._1.ctor){var o=r(function(t,r){return v.update(r,{headers:_(G,t,r.headers)})}),c=_(b["++"],"/api/v1/mailbox/",_(b["++"],e.mailbox,_(b["++"],"/",e.id))),u=_(Hc,us,_(ra,c,Lc(Ir({ctor:"::",_0:{ctor:"_Tuple2",_0:"seen",_1:Hr(!0)},_1:{ctor:"[]"}})))),i=function(t){return v.eq(t.id,e.id)?v.update(t,{seen:!0}):t};return{ctor:"_Tuple3",_0:v.update(t,{state:_(I_,_(o,i,n._0),q_(v.update(n._1._0,{message:v.update(e,{seen:!0}),markSeenAt:C})))}),_1:u,_2:Xi}}return{ctor:"_Tuple3",_0:t,_1:le,_2:Zi}}),as=function(t){return{ctor:"ListResult",_0:t}},_s=function(t){var r=_(b["++"],"/api/v1/mailbox/",t);return _(Hc,as,_(Fc,r,re(Fi)))},ss=function(t){return fe({ctor:"::",_0:ca(_(b["++"],t," - Inbucket")),_1:{ctor:"::",_0:_(vn,V_,Mn),_1:{ctor:"::",_0:_s(t),_1:{ctor:"[]"}}}})},fs=r(function(t,r){return{ctor:"_Tuple2",_0:l(D_,t,z_(r),P_,"",Un(0)),_1:ss(t)}}),ls=function(t){return{ctor:"DeleteMessageResult",_0:t}},ds=r(function(t,e){var n=r(function(t,r){return v.update(r,{headers:_(V,t,r.headers)})}),o=_(b["++"],"/api/v1/mailbox/",_(b["++"],e.mailbox,_(b["++"],"/",e.id))),c=_(Hc,ls,ea(o)),u=t.state;return"ShowingList"===u.ctor?{ctor:"_Tuple3",_0:v.update(t,{state:_(I_,_(n,function(t){return!v.eq(t.id,e.id)},u._0),J_)}),_1:c,_2:Zi}:{ctor:"_Tuple3",_0:t,_1:c,_2:Zi}}),ps=e(function(t,r,e){t:for(;;){var n=r;switch(n.ctor){case"ClickMessage":var o=n._0;return{ctor:"_Tuple3",_0:_(j_,e,o),_1:fe({ctor:"::",_0:b_(_(w_,e.mailboxName,o)),_1:{ctor:"::",_0:_(cs,e.mailboxName,o),_1:{ctor:"[]"}}}),_2:Qi};case"ViewMessage":var c=n._0;return{ctor:"_Tuple3",_0:_(j_,e,c),_1:_(cs,e.mailboxName,c),_2:Vi(e.mailboxName)};case"DeleteMessage":return _(ds,e,n._0);case"DeleteMessageResult":return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:e,_1:le,_2:Zi}:{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))};case"ListResult":if("Ok"===n._0.ctor){var u=e.state;if("LoadingList"===u.ctor){var i=v.update(e,{state:_(I_,s(A_,n._0._0,C,""),J_)}),a=u._0;if("Just"===a.ctor){var f=t,l=G_(a._0),d=i;t=f,r=l,e=d;continue t}return{ctor:"_Tuple3",_0:i,_1:le,_2:Vi(e.mailboxName)}}return{ctor:"_Tuple3",_0:e,_1:le,_2:Zi}}return{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))};case"MarkSeenResult":return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:e,_1:le,_2:Zi}:{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))};case"MessageResult":return"Ok"===n._0.ctor?_(rs,e,n._0._0):{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))};case"MessageBody":return{ctor:"_Tuple3",_0:v.update(e,{bodyMode:n._0}),_1:le,_2:Zi};case"SearchInput":return _(H_,e,n._0);case"OpenedTime":var p=e.state;if("ShowingList"===p.ctor&&"ShowingMessage"===p._1.ctor){var h=p._1._0;return h.message.seen?{ctor:"_Tuple3",_0:e,_1:le,_2:Zi}:{ctor:"_Tuple3",_0:v.update(e,{state:_(I_,p._0,q_(v.update(h,{markSeenAt:O(n._0+1500)})))}),_1:le,_2:Zi}}return{ctor:"_Tuple3",_0:e,_1:le,_2:Zi};case"Purge":return X_(e);case"PurgeResult":return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:e,_1:le,_2:Zi}:{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))};case"SeenTick":var g=e.state;if("ShowingList"===g.ctor&&"ShowingMessage"===g._1.ctor){var m=g._1._0.markSeenAt;return"Just"===m.ctor&&v.cmp(n._0,m._0)>-1?_(is,e,g._1._0.message):{ctor:"_Tuple3",_0:e,_1:le,_2:Zi}}return{ctor:"_Tuple3",_0:e,_1:le,_2:Zi};default:return{ctor:"_Tuple3",_0:v.update(e,{now:Un(n._0)}),_1:le,_2:Zi}}}}),hs=function(t){return{ctor:"DeleteMessage",_0:t}},vs=r(function(t,r){return _(Yo,{ctor:"[]"},{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("button-bar"),_1:{ctor:"[]"}},{ctor:"::",_0:_(cc,{ctor:"::",_0:_c("danger"),_1:{ctor:"::",_0:Sc(hs(t)),_1:{ctor:"[]"}}},{ctor:"::",_0:Oo("Delete"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Qo,{ctor:"::",_0:pc(function(t){return _(b["++"],"/serve/m/",_(b["++"],t.mailbox,_(b["++"],"/",_(b["++"],t.id,"/source"))))}(t)),_1:{ctor:"::",_0:hc("_blank"),_1:{ctor:"[]"}}},{ctor:"::",_0:_(cc,{ctor:"[]"},{ctor:"::",_0:Oo("Source"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_(Jo,{ctor:"::",_0:sc("message-header"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Go,{ctor:"[]"},{ctor:"::",_0:Oo("From:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"[]"},{ctor:"::",_0:Oo(t.from),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Go,{ctor:"[]"},{ctor:"::",_0:Oo("To:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"[]"},_(G,Oo,t.to)),_1:{ctor:"::",_0:_(Go,{ctor:"[]"},{ctor:"::",_0:Oo("Date:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"[]"},{ctor:"::",_0:R_(t.date),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Go,{ctor:"[]"},{ctor:"::",_0:Oo("Subject:"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Vo,{ctor:"[]"},{ctor:"::",_0:Oo(t.subject),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}}}}}}),_1:{ctor:"::",_0:_(ns,t,r),_1:{ctor:"::",_0:O_(t),_1:{ctor:"[]"}}}}})}),gs=function(t){return{ctor:"ClickMessage",_0:t}},ms=e(function(t,r,e){return _(Yo,{ctor:"::",_0:gc({ctor:"::",_0:{ctor:"_Tuple2",_0:"message-list-entry",_1:!0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:"selected",_1:v.eq(r,O(e.id))},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:"unseen",_1:!e.seen},_1:{ctor:"[]"}}}}),_1:{ctor:"::",_0:Sc(gs(e.id)),_1:{ctor:"[]"}}},{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("subject"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(e.subject),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("from"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(e.from),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("date"),_1:{ctor:"[]"}},{ctor:"::",_0:_(E_,t,e.date),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}})}),bs=r(function(t,r){return _(Po,{ctor:"::",_0:sc("message-list"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Yo,{ctor:"[]"},{ctor:"::",_0:_(oc,{ctor:"::",_0:fc("search"),_1:{ctor:"::",_0:dc("search"),_1:{ctor:"::",_0:xc($_),_1:{ctor:"::",_0:lc(r.searchInput),_1:{ctor:"[]"}}}}},{ctor:"[]"}),_1:{ctor:"::",_0:_(cc,{ctor:"::",_0:Sc(Z_),_1:{ctor:"[]"}},{ctor:"::",_0:Oo("Purge"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:function(){var t=r.state;if("LoadingList"===t.ctor)return _(Yo,{ctor:"[]"},{ctor:"[]"});var e=t._0;return _(Yo,{ctor:"[]"},_(G,_(ms,r,e.selected),$(B_(e))))}(),_1:{ctor:"[]"}}})}),ys=r(function(t,r){return _(Yo,{ctor:"::",_0:sc("page"),_1:{ctor:"::",_0:_c("mailbox"),_1:{ctor:"[]"}}},{ctor:"::",_0:_(bs,t,r),_1:{ctor:"::",_0:_(Wo,{ctor:"::",_0:sc("message"),_1:{ctor:"[]"}},{ctor:"::",_0:function(){var t=r.state;t:do{if("ShowingList"!==t.ctor)break t;switch(t._1.ctor){case"NoMessage":return Oo(_(b["++"],"Select a message on the left,"," or enter a different username into the box on upper right."));case"ShowingMessage":case"Transitioning":return _(vs,t._1._0.message,r.bodyMode);default:break t}}while(!1);return Oo("")}(),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}})}),ks=function(t){return Oo(_(Oa,{ctor:"::",_0:Va,_1:{ctor:"::",_0:La("-"),_1:{ctor:"::",_0:Xa,_1:{ctor:"::",_0:La(" "),_1:{ctor:"::",_0:za,_1:{ctor:"::",_0:La(":"),_1:{ctor:"::",_0:Ia,_1:{ctor:"::",_0:La(" "),_1:{ctor:"::",_0:qa,_1:{ctor:"[]"}}}}}}}}}},t))},ws=e(function(t,r,e){var n=r;if("NewMessage"===n.ctor)return"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:v.update(e,{messages:{ctor:"::",_0:n._0._0,_1:e.messages}}),_1:le,_2:Zi}:{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(n._0._0)};var o=n._0;return{ctor:"_Tuple3",_0:e,_1:b_(_(w_,o.mailbox,o.id)),_2:Zi}}),Ts=function(t){return{wsUrl:_(b["++"],"ws://",_(b["++"],t,"/api/v1/monitor/messages")),messages:{ctor:"[]"}}},xs=(r(function(t,r){return{wsUrl:t,messages:r}}),function(t){return{ctor:"OpenMessage",_0:t}}),Ss=function(t){return _(tc,{ctor:"::",_0:Sc(xs(t)),_1:{ctor:"[]"}},{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:ks(t.date),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(rc,{ctor:"::",_0:_c("desktop"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(t.from),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:Oo(t.mailbox),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(rc,{ctor:"[]"},{ctor:"::",_0:Oo(t.subject),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}})},Ms=r(function(t,r){return _(Yo,{ctor:"::",_0:sc("page"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Fo,{ctor:"[]"},{ctor:"::",_0:Oo("Monitor"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(qo,{ctor:"[]"},{ctor:"::",_0:Oo("Messages will be listed here shortly after delivery."),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Ko,{ctor:"::",_0:sc("monitor"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Zo,{ctor:"[]"},{ctor:"::",_0:_(ec,{ctor:"[]"},{ctor:"::",_0:Oo("Date"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(ec,{ctor:"::",_0:_c("desktop"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo("From"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(ec,{ctor:"[]"},{ctor:"::",_0:Oo("Mailbox"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(ec,{ctor:"[]"},{ctor:"::",_0:Oo("Subject"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}}),_1:{ctor:"::",_0:_(Xo,{ctor:"[]"},_(G,Ss,r.messages)),_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})}),Ns=function(t){return{ctor:"NewMessage",_0:t}},Bs=function(t){return _(oi,t.wsUrl,function(t){return Ns(_(Yr,Fi,t))})},Rs=Rs||{};Rs["*="]=r(function(t,r){return t(_(zt," ",_(G,y,r)))});var Rs=Rs||{};Rs[":="]=r(function(t,r){return t(y(r))});var Es=r(function(t,r){var e=t;return _(G,function(t){var r=t;return{ctor:"_Tuple2",_0:e._0(r._0),_1:e._1(r._1)}},r)}),Cs=function(t){return!0===w(t)?0:t},Os=r(function(t,r){var e=t,n=r,o=n._1._1,c=n._0._0;return{ctor:"_Tuple2",_0:function(t){return Cs((t-c)*(e._0/(n._1._0-c)))},_1:function(t){return Cs((o-t)*(e._1/(o-n._0._1)))}}}),As=function(t){var r=t,e=r._1._1,n=r._0._1,o=r._1._0,c=r._0._0;return v.eq(n,e)?{ctor:"_Tuple2",_0:{ctor:"_Tuple2",_0:c,_1:_(M,0,n)},_1:{ctor:"_Tuple2",_0:o,_1:e}}:{ctor:"_Tuple2",_0:{ctor:"_Tuple2",_0:c,_1:n},_1:{ctor:"_Tuple2",_0:o,_1:e}}},Ls=function(t){var e=_(Z,function(t){return t},t),n=_(E,{ctor:"_Tuple2",_0:0,_1:0},j(e));return As(s(I,r(function(t,r){var e=t,n=e._1,o=e._0,c=r;return{ctor:"_Tuple2",_0:{ctor:"_Tuple2",_0:_(M,c._0._0,o),_1:_(M,c._0._1,n)},_1:{ctor:"_Tuple2",_0:_(S,c._1._0,o),_1:_(S,c._1._1,n)}}}),{ctor:"_Tuple2",_0:n,_1:n},e))},Ds=r(function(t,r){var e=t,n=v.eq(r,"")?"M":"L";return _(b["++"],r,_(b["++"],n,_(b["++"],y(e._0),_(b["++"]," ",y(e._1)))))}),Ps=r(function(t,r){return s(I,Ds,"",_(Es,t,r))}),Fs=o(function(t,r,e,n,o){var c=lt(t);return _(Z,function(t){var r=t,n=_(_t,r._0,c);return"Nothing"===n.ctor?{ctor:"[]"}:{ctor:"::",_0:_(Tu,_(b["++"],{ctor:"::",_0:_(Rs[":="],Bu,r._1._0),_1:{ctor:"::",_0:_(Rs[":="],Nu,r._1._1),_1:{ctor:"[]"}}},_(b["++"],e,n._0._1)),{ctor:"::",_0:hu(n._0._2),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}},st(lt(_(Es,o,r))))}),Is=o(function(t,r,e,n,o){var c=n,u=c._0._0,i=o,a=i._1;return _(G,function(r){var n=r,o=n._1,s=n._0,f=v.cmp(o,0)<0?{ctor:"_Tuple2",_0:a(o)-(a(o)-a(0)),_1:a(o)-a(0)}:{ctor:"_Tuple2",_0:a(o),_1:a(0)-a(o)},l=f._0,d=f._1,p=t*((s-u)/(c._1._0-u));return _(wu,_(b["++"],{ctor:"::",_0:_(Rs[":="],Bu,i._0(s)-p),_1:{ctor:"::",_0:_(Rs[":="],Nu,l),_1:{ctor:"::",_0:_(Rs[":="],Ru,t),_1:{ctor:"::",_0:_(Rs[":="],Au,d),_1:{ctor:"[]"}}}}},e),{ctor:"[]"})},r)}),Hs=n(function(t,r,e,n){return _(G,function(t){var e=t;return _(yu,_(b["++"],{ctor:"::",_0:_(Rs[":="],Pu,e._0),_1:{ctor:"::",_0:_(Rs[":="],Du,e._1),_1:{ctor:"::",_0:_(Rs[":="],Ou,2),_1:{ctor:"[]"}}}},r),{ctor:"[]"})},_(Es,n,t))}),zs=n(function(t,r,e,n){return{ctor:"::",_0:_(ku,_(b["++"],{ctor:"::",_0:Mu("none"),_1:{ctor:"::",_0:xu("#000"),_1:{ctor:"::",_0:_(Rs[":="],Su,1),_1:{ctor:"::",_0:Lu(_(Ps,n,t)),_1:{ctor:"[]"}}}}},r),{ctor:"[]"}),_1:{ctor:"[]"}}}),Ws=n(function(t,r,e,n){var o=e,c=o._0._0,u=o._0._1,i=o._1._0,a=(o._1._1,{ctor:"_Tuple2",_0:c,_1:u}),s={ctor:"_Tuple2",_0:i,_1:u},l=_(b["++"],{ctor:"::",_0:a,_1:{ctor:"[]"}},_(b["++"],t,{ctor:"::",_0:s,_1:{ctor:"[]"}}));return f(zs,l,r,e,n)}),qs=n(function(t,r,e,n){return{ctor:"[]"}}),Us=n(function(t,r,e,n){var o=e,c=o._0._0,u=(o._0._1,o._1._0);o._1._1;return f(zs,{ctor:"::",_0:{ctor:"_Tuple2",_0:c,_1:0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:u,_1:0},_1:{ctor:"[]"}}},r,e,n)}),js=r(function(t,r){var e=t,n=e._0,o=e._3,c=e._2,u=e._1;return _(mu,{ctor:"::",_0:_(Rs[":="],Ru,n+2*c),_1:{ctor:"::",_0:_(Rs[":="],Au,u+2*o),_1:{ctor:"::",_0:_(Rs["*="],Eu,{ctor:"::",_0:0,_1:{ctor:"::",_0:0,_1:{ctor:"::",_0:n+2*c,_1:{ctor:"::",_0:u+2*o,_1:{ctor:"[]"}}}}}),_1:{ctor:"[]"}}}},{ctor:"::",_0:_(bu,{ctor:"::",_0:Cu(_(b["++"],"translate",y({ctor:"_Tuple2",_0:c,_1:o}))),_1:{ctor:"[]"}},r),_1:{ctor:"[]"}})}),Js=function(t){var r=t;switch(r.ctor){case"Bar":return{ctor:"_Tuple4",_0:Is(r._0),_1:r._1,_2:{ctor:"[]"},_3:!1};case"Dot":return{ctor:"_Tuple4",_0:Hs,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Line":return{ctor:"_Tuple4",_0:zs,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Area":return{ctor:"_Tuple4",_0:Ws,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Domain":return{ctor:"_Tuple4",_0:qs,_1:r._0,_2:{ctor:"[]"},_3:!1};case"Label":var e=r._0,n=_(G,function(t){return t._0},e);return{ctor:"_Tuple4",_0:Fs(e),_1:n,_2:{ctor:"[]"},_3:!1};case"ZeroLine":return{ctor:"_Tuple4",_0:Us,_1:{ctor:"[]"},_2:{ctor:"[]"},_3:!1};case"Independent":var o=Js(r._0),c=o._0,u=o._1;return{ctor:"_Tuple4",_0:c,_1:u,_2:o._2,_3:!0};default:var i=Js(r._1),c=i._0,u=i._1,a=i._3;return{ctor:"_Tuple4",_0:c,_1:u,_2:r._0,_3:a}}},Gs=r(function(t,r){var e=_(G,Js,r),n=Ls(_(Z,function(t){return{ctor:"::",_0:t._1,_1:{ctor:"[]"}}},_(V,function(t){var r=t;return!v.eq(r._3,!0)},e))),o=_(Os,t,n);return _(js,t,_(Z,function(r){var e=r,c=e._1,u=v.eq(e._3,!0)?{ctor:"_Tuple2",_0:Ls({ctor:"::",_0:c,_1:{ctor:"[]"}}),_1:_(Os,t,Ls({ctor:"::",_0:c,_1:{ctor:"[]"}}))}:{ctor:"_Tuple2",_0:n,_1:o},i=u._0,a=u._1;return f(e._0,c,e._2,i,a)},e))}),Vs=r(function(t,r){return{ctor:"Style",_0:t,_1:r}}),Ys={ctor:"ZeroLine"},Qs=function(t){return{ctor:"Domain",_0:t}},$s=function(t){return{ctor:"Area",_0:t}},Ks=r(function(t,r){return{ctor:"Bar",_0:t,_1:r}}),Xs=function(t){var r=function(t){return v.cmp(Ut(t),3)<1?t:_(b["++"],r(s(It,0,-3,t)),_(b["++"],",",_(Pt,3,t)))};return r(y(t))},Zs=function(t){var r=60-z(t);return v.cmp(r,0)>0?_(b["++"],_(ct,r,0),t):t},tf=function(t){var e=_(E,{ctor:"[]"},U(t));return s(P,r(function(t,r){return t-r}),e,t)},rf=r(function(t,r){return _(Yo,{ctor:"::",_0:_c("metric-panel"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Io,{ctor:"[]"},{ctor:"::",_0:Oo(t),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("metrics"),_1:{ctor:"[]"}},r),_1:{ctor:"[]"}}})}),ef=Vs({ctor:"::",_0:xu("rgba(0,0,0,0.2)"),_1:{ctor:"::",_0:Su("1.0"),_1:{ctor:"[]"}}}),nf=Vs({ctor:"::",_0:Mu("rgba(50,200,50,0.7)"),_1:{ctor:"[]"}}),of=Vs({ctor:"::",_0:Mu("rgba(50,100,255,0.3)"),_1:{ctor:"::",_0:xu("rgba(50,100,255,1.0)"),_1:{ctor:"::",_0:Su("1.0"),_1:{ctor:"[]"}}}}),cf={ctor:"_Tuple4",_0:180,_1:16,_2:0,_3:0},uf=function(t){var r=function(){var r=j(t);return"Nothing"===r.ctor?0:ae(r._0)}();return _(Gs,cf,{ctor:"::",_0:nf(_(Ks,2.5,t)),_1:{ctor:"::",_0:ef(Ys),_1:{ctor:"::",_0:Qs({ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:1},_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})},af=function(t){var r=function(){var r=j(t);return"Nothing"===r.ctor?0:ae(r._0)}();return _(Gs,cf,{ctor:"::",_0:of($s(t)),_1:{ctor:"::",_0:ef(Ys),_1:{ctor:"::",_0:Qs({ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:1},_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})},_f=(_(Yo,{ctor:"[]"},{ctor:"[]"}),n(function(t,r,e,n){return _(Yo,{ctor:"::",_0:_c("metric"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("label"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(t),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("value"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(r(e)),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("graph"),_1:{ctor:"[]"}},{ctor:"::",_0:n,_1:{ctor:"::",_0:Oo("(10min)"),_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})}),function(t){return _(Yo,{ctor:"::",_0:_c("metric"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("label"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(t.label),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("value"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(t.formatter(t.value)),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("graph"),_1:{ctor:"[]"}},{ctor:"::",_0:t.graph(t.history),_1:{ctor:"::",_0:Oo(_(b["++"],"(",_(b["++"],y(t.minutes),"min)"))),_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}}})}),sf=r(function(t,r){return _(Yo,{ctor:"::",_0:sc("page"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Fo,{ctor:"[]"},{ctor:"::",_0:Oo("Status"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:function(){return"Nothing"===r.metrics.ctor?_(Yo,{ctor:"[]"},{ctor:"::",_0:Oo("Loading metrics..."),_1:{ctor:"[]"}}):_(Yo,{ctor:"[]"},{ctor:"::",_0:_(rf,"General Metrics",{ctor:"::",_0:_f(r.sysMem),_1:{ctor:"::",_0:_f(r.heapSize),_1:{ctor:"::",_0:_f(r.heapUsed),_1:{ctor:"::",_0:_f(r.heapObjects),_1:{ctor:"::",_0:_f(r.goRoutines),_1:{ctor:"::",_0:_f(r.webSockets),_1:{ctor:"[]"}}}}}}}),_1:{ctor:"::",_0:_(rf,"SMTP Metrics",{ctor:"::",_0:_f(r.smtpConnOpen),_1:{ctor:"::",_0:_f(r.smtpConnTotal),_1:{ctor:"::",_0:_f(r.smtpReceivedTotal),_1:{ctor:"::",_0:_f(r.smtpErrorsTotal),_1:{ctor:"::",_0:_f(r.smtpWarnsTotal),_1:{ctor:"[]"}}}}}}),_1:{ctor:"::",_0:_(rf,"Storage Metrics",{ctor:"::",_0:_f(r.retentionDeletesTotal),_1:{ctor:"::",_0:_f(r.retainedCount),_1:{ctor:"::",_0:_f(r.retainedSize),_1:{ctor:"[]"}}}}),_1:{ctor:"[]"}}}})}(),_1:{ctor:"[]"}}})}),ff=e(function(t,e,n){return v.update(t,{value:e,history:_(at,r(function(t,r){return{ctor:"_Tuple2",_0:T(t),_1:T(r)}}),tf(Zs(n)))})}),lf=e(function(t,e,n){return v.update(t,{value:e,history:_(at,r(function(t,r){return{ctor:"_Tuple2",_0:T(t),_1:T(r)}}),Zs(n))})}),df=e(function(t,r,e){return v.update(t,{value:e,history:_(b["++"],_(E,{ctor:"[]"},U(t.history)),{ctor:"::",_0:{ctor:"_Tuple2",_0:r,_1:T(e)},_1:{ctor:"[]"}})})}),pf=r(function(t,r){var e=r.xCounter;return v.update(r,{metrics:O(t),xCounter:e+1,sysMem:s(df,r.sysMem,e,t.sysMem),heapSize:s(df,r.heapSize,e,t.heapSize),heapUsed:s(df,r.heapUsed,e,t.heapUsed),heapObjects:s(df,r.heapObjects,e,t.heapObjects),goRoutines:s(df,r.goRoutines,e,t.goRoutines),webSockets:s(df,r.webSockets,e,t.webSockets),smtpConnOpen:s(df,r.smtpConnOpen,e,t.smtpConnOpen),smtpConnTotal:s(ff,r.smtpConnTotal,t.smtpConnTotal,t.smtpConnHist),smtpReceivedTotal:s(ff,r.smtpReceivedTotal,t.smtpReceivedTotal,t.smtpReceivedHist),smtpErrorsTotal:s(ff,r.smtpErrorsTotal,t.smtpErrorsTotal,t.smtpErrorsHist),smtpWarnsTotal:s(ff,r.smtpWarnsTotal,t.smtpWarnsTotal,t.smtpWarnsHist),retentionDeletesTotal:s(ff,r.retentionDeletesTotal,t.retentionDeletesTotal,t.retentionDeletesHist),retainedCount:s(lf,r.retainedCount,t.retainedCount,t.retainedCountHist),retainedSize:s(lf,r.retainedSize,t.retainedSize,t.retainedSizeHist)})}),hf=_(G,function(t){return{ctor:"_Tuple2",_0:T(t),_1:0}},_(it,0,59)),vf=c(function(t,r,e,n,o,c){return{label:t,value:r,formatter:e,graph:n,history:o,minutes:c}}),gf={metrics:C,xCounter:60,sysMem:d(vf,"System Memory",0,tn,af,hf,10),heapSize:d(vf,"Heap Size",0,tn,af,hf,10),heapUsed:d(vf,"Heap Used",0,tn,af,hf,10),heapObjects:d(vf,"Heap # Objects",0,Xs,af,hf,10),goRoutines:d(vf,"Goroutines",0,Xs,af,hf,10),webSockets:d(vf,"Open WebSockets",0,Xs,af,hf,10),smtpConnOpen:d(vf,"Open Connections",0,Xs,af,hf,10),smtpConnTotal:d(vf,"Total Connections",0,Xs,uf,hf,60),smtpReceivedTotal:d(vf,"Messages Received",0,Xs,uf,hf,60),smtpErrorsTotal:d(vf,"Messages Errors",0,Xs,uf,hf,60),smtpWarnsTotal:d(vf,"Messages Warns",0,Xs,uf,hf,60),retentionDeletesTotal:d(vf,"Retention Deletes",0,Xs,uf,hf,60),retainedCount:d(vf,"Stored Messages",0,Xs,af,hf,60),retainedSize:d(vf,"Store Size",0,tn,af,hf,60)},mf=function(t){return{ctor:"Tick",_0:t}},bf=function(t){return _(An,1e4,mf)},yf=function(t){return{ctor:"NewMetrics",_0:t}},kf=_(Hc,yf,_(Fc,"/debug/vars",zi)),wf=kf,Tf=e(function(t,r,e){var n=r;return"NewMetrics"===n.ctor?"Ok"===n._0.ctor?{ctor:"_Tuple3",_0:_(pf,n._0._0,e),_1:le,_2:Zi}:{ctor:"_Tuple3",_0:e,_1:le,_2:Ki(ta(n._0._0))}:{ctor:"_Tuple3",_0:e,_1:kf,_2:$i}}),xf=r(function(t,r){var e={ctor:"_Tuple2",_0:t,_1:r};t:do{if("_Tuple2"!==e.ctor)break t;switch(e._0.ctor){case"Monitor":if("Monitor"===e._1.ctor)return!0;break t;case"Status":if("Status"===e._1.ctor)return!0;break t;default:break t}}while(!1);return!1}),Sf=e(function(t,r,e){return _(jo,{ctor:"::",_0:gc({ctor:"::",_0:{ctor:"_Tuple2",_0:"navbar-active",_1:_(xf,t,r)},_1:{ctor:"[]"}}),_1:{ctor:"[]"}},{ctor:"::",_0:_(Qo,{ctor:"::",_0:m_(r),_1:{ctor:"[]"}},e),_1:{ctor:"[]"}})}),Mf=(o(function(t,r,e,n,o){return{viewMailbox:t,mailboxOnInput:r,mailboxValue:e,recentOptions:n,recentActive:o}}),{ctor:"Status"}),Nf={ctor:"Monitor"},Bf={ctor:"Mailbox"},Rf=r(function(t,r){var e=v.eq(t,Bf),n=e?r.recentActive:"Recent Mailboxes",o=e?_(E,{ctor:"[]"},U(r.recentOptions)):r.recentOptions,c=function(t){return _(Qo,{ctor:"::",_0:m_(T_(t)),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(t),_1:{ctor:"[]"}})};return _(jo,{ctor:"::",_0:sc("navbar-recent"),_1:{ctor:"::",_0:gc({ctor:"::",_0:{ctor:"_Tuple2",_0:"navbar-dropdown",_1:!0},_1:{ctor:"::",_0:{ctor:"_Tuple2",_0:"navbar-active",_1:e},_1:{ctor:"[]"}}}),_1:{ctor:"[]"}}},{ctor:"::",_0:_($o,{ctor:"[]"},{ctor:"::",_0:Oo(n),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:_c("navbar-dropdown-content"),_1:{ctor:"[]"}},_(G,c,o)),_1:{ctor:"[]"}}})}),Ef=n(function(t,r,e,n){return _(Yo,{ctor:"::",_0:sc("app"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Ho,{ctor:"[]"},{ctor:"::",_0:_(Uo,{ctor:"::",_0:_c("navbar"),_1:{ctor:"::",_0:_(uc,"role","navigation"),_1:{ctor:"[]"}}},{ctor:"::",_0:_(jo,{ctor:"::",_0:sc("navbar-brand"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Qo,{ctor:"::",_0:m_(x_),_1:{ctor:"[]"}},{ctor:"::",_0:Oo("@ inbucket"),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:s(Sf,e,k_,{ctor:"::",_0:Oo("Monitor"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:s(Sf,e,y_,{ctor:"::",_0:Oo("Status"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:_(Rf,e,t),_1:{ctor:"::",_0:_(jo,{ctor:"::",_0:sc("navbar-mailbox"),_1:{ctor:"[]"}},{ctor:"::",_0:_(nc,{ctor:"::",_0:Tc(t.viewMailbox(t.mailboxValue)),_1:{ctor:"[]"}},{ctor:"::",_0:_(oc,{ctor:"::",_0:fc("text"),_1:{ctor:"::",_0:dc("mailbox"),_1:{ctor:"::",_0:lc(t.mailboxValue),_1:{ctor:"::",_0:xc(t.mailboxOnInput),_1:{ctor:"[]"}}}}},{ctor:"[]"}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}}}),_1:{ctor:"::",_0:_(Yo,{ctor:"[]"},{ctor:"::",_0:Oo(_(b["++"],"Status: ",r.flash)),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}),_1:{ctor:"::",_0:_(Yo,{ctor:"::",_0:sc("navbg"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo(""),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:n,_1:{ctor:"::",_0:_(zo,{ctor:"[]"},{ctor:"::",_0:_(Yo,{ctor:"::",_0:sc("footer"),_1:{ctor:"[]"}},{ctor:"::",_0:_(Qo,{ctor:"::",_0:pc("https://www.inbucket.org"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo("Inbucket"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Oo(" is an open source projected hosted at "),_1:{ctor:"::",_0:_(Qo,{ctor:"::",_0:pc("https://github.com/jhillyerd/inbucket"),_1:{ctor:"[]"}},{ctor:"::",_0:Oo("GitHub"),_1:{ctor:"[]"}}),_1:{ctor:"::",_0:Oo("."),_1:{ctor:"[]"}}}}}),_1:{ctor:"[]"}}),_1:{ctor:"[]"}}}}})}),Cf={ctor:"Other"},Of=function(t){var r=t,e=r._0,n=r._1,o=_(Wi,r._2,e.session),c=v.update(e,{session:o});return v.eq(o.persistent,e.session.persistent)?{ctor:"_Tuple2",_0:c,_1:n}:{ctor:"_Tuple2",_0:c,_1:fe({ctor:"::",_0:n,_1:{ctor:"::",_0:oa(o.persistent),_1:{ctor:"[]"}}})}},Af=na(Vr(Ji)),Lf=(e(function(t,r,e){return{page:t,session:r,mailboxName:e}}),function(t){return{ctor:"Status",_0:t}}),Df=function(t){return{ctor:"Monitor",_0:t}},Pf=function(t){return{ctor:"Mailbox",_0:t}},Ff=function(t){return{ctor:"Home",_0:t}},If=function(t){return{ctor:"StatusMsg",_0:t}},Hf=function(t){return{ctor:"MonitorMsg",_0:t}},zf=function(t){return{ctor:"MailboxMsg",_0:t}},Wf=function(t){var r=t;switch(r.ctor){case"Mailbox":return _(ge,zf,Q_(r._0));case"Monitor":return _(ge,Hf,Bs(r._0));case"Status":return _(ge,If,bf(r._0));default:return ve}},qf=function(t){return{ctor:"HomeMsg",_0:t}},Uf=r(function(t,r){var e=o(function(t,e,n,o,c){var u=s(n,r.session,o,c),i=u._0,a=u._1,f=u._2;return{ctor:"_Tuple3",_0:v.update(r,{page:t(i)}),_1:_(pe,e,a),_2:f}}),n={ctor:"_Tuple2",_0:t,_1:r.page};t:do{switch(n._1.ctor){case"Home":if("HomeMsg"===n._0.ctor)return l(e,Ff,qf,aa,n._0._0,n._1._0);break t;case"Mailbox":if("MailboxMsg"===n._0.ctor)return l(e,Pf,zf,ps,n._0._0,n._1._0);break t;case"Monitor":if("MonitorMsg"===n._0.ctor)return l(e,Df,Hf,ws,n._0._0,n._1._0);break t;default:if("StatusMsg"===n._0.ctor)return l(e,Lf,If,Tf,n._0._0,n._1._0);break t}}while(!1);return{ctor:"_Tuple3",_0:r,_1:le,_2:Zi}}),jf=r(function(t,r){var e=t;switch(e.ctor){case"Unknown":return{ctor:"_Tuple3",_0:r,_1:le,_2:Ki(_(b["++"],"Unknown route requested: ",e._0))};case"Home":var n=fa,o=n._0,c=n._1;return{ctor:"_Tuple3",_0:v.update(r,{page:Ff(o)}),_1:_(pe,qf,c),_2:Zi};case"Mailbox":var u=_(fs,e._0,C),o=u._0,c=u._1;return{ctor:"_Tuple3",_0:v.update(r,{page:Pf(o)}),_1:_(pe,zf,c),_2:Zi};case"Message":var i=_(fs,e._0,O(e._1)),o=i._0,c=i._1;return{ctor:"_Tuple3",_0:v.update(r,{page:Pf(o)}),_1:_(pe,zf,c),_2:Zi};case"Monitor":return{ctor:"_Tuple3",_0:v.update(r,{page:Df(Ts(r.session.host))}),_1:ca("Inbucket Monitor"),_2:Zi};default:return{ctor:"_Tuple3",_0:v.update(r,{page:Lf(gf)}),_1:fe({ctor:"::",_0:ca("Inbucket Status"),_1:{ctor:"::",_0:_(pe,If,wf),_1:{ctor:"[]"}}}),_2:Zi}}}),Jf=r(function(t,r){var e=N_(r),n=fa,o=n._0,c=_(Ui,r,Gi(t)),u={page:Ff(o),session:c,mailboxName:""};return Of(_(jf,e,u))}),Gf=r(function(t,r){return Of(function(){var e=t;switch(e.ctor){case"SetRoute":return{ctor:"_Tuple3",_0:r,_1:b_(e._0),_2:Zi};case"NewRoute":return r.session.routing?_(jf,e._0,r):{ctor:"_Tuple3",_0:r,_1:le,_2:Yi};case"UpdateSession":if("Ok"===e._0.ctor){var n=r.session;return{ctor:"_Tuple3",_0:v.update(r,{session:v.update(n,{persistent:e._0._0})}),_1:le,_2:Zi}}_(ce,"Error decoding session",e._0._0);return{ctor:"_Tuple3",_0:r,_1:le,_2:Zi};case"MailboxNameInput":return{ctor:"_Tuple3",_0:v.update(r,{mailboxName:e._0}),_1:le,_2:Zi};case"ViewMailbox":return{ctor:"_Tuple3",_0:v.update(r,{mailboxName:""}),_1:b_(T_(e._0)),_2:Zi};default:return _(Uf,t,r)}}())}),Vf=function(t){return{ctor:"ViewMailbox",_0:t}},Yf=function(t){return{ctor:"MailboxNameInput",_0:t}},Qf=function(t){var r=function(){var r=t.page;return"Mailbox"===r.ctor?r._0.mailboxName:""}(),e={viewMailbox:Vf,mailboxOnInput:Yf,mailboxValue:t.mailboxName,recentOptions:t.session.persistent.recentMailboxes,recentActive:r},n=_(Ef,e,t.session),o=t.page;switch(o.ctor){case"Home":return _(n,Cf,_(Co,qf,_(ua,t.session,o._0)));case"Mailbox":return _(n,Bf,_(Co,zf,_(ys,t.session,o._0)));case"Monitor":return _(n,Nf,_(Co,Hf,_(Ms,t.session,o._0)));default:return _(n,Mf,_(Co,If,_(sf,t.session,o._0)))}},$f=function(t){return{ctor:"UpdateSession",_0:t}},Kf=function(t){return he({ctor:"::",_0:Wf(t.page),_1:{ctor:"::",_0:_(ge,$f,Af),_1:{ctor:"[]"}}})},Xf=function(t){return{ctor:"NewRoute",_0:t}},Zf=_(_u,function(t){return Xf(N_(t))},{init:Jf,view:Qf,update:Gf,subscriptions:Kf})(Ur),tl={};if(tl.Main=tl.Main||{},void 0!==Zf&&Zf(tl.Main,"Main",void 0),"function"==typeof define&&define.amd)return void define([],function(){return tl});if("object"==typeof t)return void(t.exports=tl);var rl=this.Elm;if(void 0===rl)return void(this.Elm=tl);for(var el in tl){if(el in rl)throw new Error("There are two Elm modules called `"+el+"` on this page! Rename one of them.");rl[el]=tl[el]}}).call(this)},function(t,r,e){"use strict";function n(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",function(){var t="/service-worker.js";u?c(t):o(t)})}}function o(t){navigator.serviceWorker.register(t).then(function(t){t.onupdatefound=function(){var r=t.installing;r.onstatechange=function(){"installed"===r.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(function(t){console.error("Error during service worker registration:",t)})}function c(t){fetch(t).then(function(r){404===r.status||-1===r.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(function(t){t.unregister().then(function(){window.location.reload()})}):o(t)}).catch(function(){console.log("No internet connection found. App is running in offline mode.")})}r.a=n;var u=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))}]); \ No newline at end of file diff --git a/ui/build/webpack-assets.json b/ui/build/webpack-assets.json index f0e864e..9555fd0 100644 --- a/ui/build/webpack-assets.json +++ b/ui/build/webpack-assets.json @@ -1 +1 @@ -{"main":{"js":"/static/js/main.d6280c5d.js","css":"/static/css/main.8d438738.css"},"":{"html":"/index.html"}} \ No newline at end of file +{"main":{"js":"/static/js/main.04b41a91.js","css":"/static/css/main.8d438738.css"},"":{"html":"/index.html"}} \ No newline at end of file diff --git a/ui/elm-package.json b/ui/elm-package.json index 0ce064d..b150533 100644 --- a/ui/elm-package.json +++ b/ui/elm-package.json @@ -27,7 +27,6 @@ "elm-lang/http": "1.0.0 <= v < 2.0.0", "elm-lang/navigation": "2.1.0 <= v < 3.0.0", "elm-lang/svg": "2.0.0 <= v < 3.0.0", - "elm-lang/websocket": "1.0.2 <= v < 2.0.0", "evancz/url-parser": "2.0.1 <= v < 3.0.0", "jweir/sparkline": "3.0.0 <= v < 4.0.0", "ryannhg/elm-date-format": "2.1.2 <= v < 3.0.0" diff --git a/ui/src/Main.elm b/ui/src/Main.elm index 882d303..5aa24fd 100644 --- a/ui/src/Main.elm +++ b/ui/src/Main.elm @@ -180,54 +180,68 @@ updatePage msg model = setRoute : Route -> Model -> ( Model, Cmd Msg, Session.Msg ) setRoute route model = - case route of - Route.Unknown hash -> - ( model, Cmd.none, Session.SetFlash ("Unknown route requested: " ++ hash) ) + let + ( newModel, newCmd, newSession ) = + case route of + Route.Unknown hash -> + ( model, Cmd.none, Session.SetFlash ("Unknown route requested: " ++ hash) ) - Route.Home -> - let - ( subModel, subCmd ) = - Home.init - in - ( { model | page = Home subModel } - , Cmd.map HomeMsg subCmd - , Session.none - ) + Route.Home -> + let + ( subModel, subCmd ) = + Home.init + in + ( { model | page = Home subModel } + , Cmd.map HomeMsg subCmd + , Session.none + ) - Route.Mailbox name -> - let - ( subModel, subCmd ) = - Mailbox.init name Nothing - in - ( { model | page = Mailbox subModel } - , Cmd.map MailboxMsg subCmd - , Session.none - ) + Route.Mailbox name -> + let + ( subModel, subCmd ) = + Mailbox.init name Nothing + in + ( { model | page = Mailbox subModel } + , Cmd.map MailboxMsg subCmd + , Session.none + ) - Route.Message mailbox id -> - let - ( subModel, subCmd ) = - Mailbox.init mailbox (Just id) - in - ( { model | page = Mailbox subModel } - , Cmd.map MailboxMsg subCmd - , Session.none - ) + Route.Message mailbox id -> + let + ( subModel, subCmd ) = + Mailbox.init mailbox (Just id) + in + ( { model | page = Mailbox subModel } + , Cmd.map MailboxMsg subCmd + , Session.none + ) - Route.Monitor -> - ( { model | page = Monitor (Monitor.init model.session.host) } - , Ports.windowTitle "Inbucket Monitor" - , Session.none - ) + Route.Monitor -> + let + ( subModel, subCmd ) = + Monitor.init + in + ( { model | page = Monitor subModel } + , Cmd.map MonitorMsg subCmd + , Session.none + ) - Route.Status -> - ( { model | page = Status Status.init } - , Cmd.batch - [ Ports.windowTitle "Inbucket Status" - , Cmd.map StatusMsg Status.load - ] - , Session.none - ) + Route.Status -> + ( { model | page = Status Status.init } + , Cmd.batch + [ Ports.windowTitle "Inbucket Status" + , Cmd.map StatusMsg Status.load + ] + , Session.none + ) + in + case model.page of + Monitor _ -> + -- Leaving Monitor page, shut down the web socket. + ( newModel, Cmd.batch [ Ports.monitorCommand False, newCmd ], newSession ) + + _ -> + ( newModel, newCmd, newSession ) applySession : ( Model, Cmd Msg, Session.Msg ) -> ( Model, Cmd Msg ) diff --git a/ui/src/Page/Monitor.elm b/ui/src/Page/Monitor.elm index 15c4457..8cc5a56 100644 --- a/ui/src/Page/Monitor.elm +++ b/ui/src/Page/Monitor.elm @@ -15,25 +15,28 @@ import DateFormat import Html exposing (..) import Html.Attributes exposing (..) import Html.Events as Events -import Json.Decode exposing (decodeString) +import Json.Decode as D +import Ports import Route -import WebSocket -- MODEL type alias Model = - { wsUrl : String + { connected : Bool , messages : List MessageHeader } -init : String -> Model -init host = - { wsUrl = "ws://" ++ host ++ "/api/v1/monitor/messages" - , messages = [] - } +init : ( Model, Cmd Msg ) +init = + ( Model False [] + , Cmd.batch + [ Ports.windowTitle "Inbucket Monitor" + , Ports.monitorCommand True + ] + ) @@ -42,7 +45,16 @@ init host = subscriptions : Model -> Sub Msg subscriptions model = - WebSocket.listen model.wsUrl (decodeString MessageHeader.decoder >> NewMessage) + let + monitorMessage = + D.oneOf + [ D.map Message MessageHeader.decoder + , D.map Connected D.bool + ] + |> D.decodeValue + |> Ports.monitorMessage + in + Sub.map MonitorResult monitorMessage @@ -50,17 +62,25 @@ subscriptions model = type Msg - = NewMessage (Result String MessageHeader) + = MonitorResult (Result String MonitorMessage) | OpenMessage MessageHeader +type MonitorMessage + = Connected Bool + | Message MessageHeader + + update : Session -> Msg -> Model -> ( Model, Cmd Msg, Session.Msg ) update session msg model = case msg of - NewMessage (Ok msg) -> + MonitorResult (Ok (Connected status)) -> + ( { model | connected = status }, Cmd.none, Session.none ) + + MonitorResult (Ok (Message msg)) -> ( { model | messages = msg :: model.messages }, Cmd.none, Session.none ) - NewMessage (Err err) -> + MonitorResult (Err err) -> ( model, Cmd.none, Session.SetFlash err ) OpenMessage msg -> @@ -78,7 +98,17 @@ view : Session -> Model -> Html Msg view session model = div [ id "page" ] [ h1 [] [ text "Monitor" ] - , p [] [ text "Messages will be listed here shortly after delivery." ] + , p [] + [ text "Messages will be listed here shortly after delivery. " + , em [] + [ text + (if model.connected then + "Connected." + else + "Disconnected!" + ) + ] + ] , table [ id "monitor" ] [ thead [] [ th [] [ text "Date" ] diff --git a/ui/src/Ports.elm b/ui/src/Ports.elm index db5afa6..73f273b 100644 --- a/ui/src/Ports.elm +++ b/ui/src/Ports.elm @@ -1,9 +1,22 @@ -port module Ports exposing (onSessionChange, storeSession, windowTitle) +port module Ports + exposing + ( monitorCommand + , monitorMessage + , onSessionChange + , storeSession + , windowTitle + ) import Data.Session exposing (Persistent) import Json.Encode exposing (Value) +port monitorCommand : Bool -> Cmd msg + + +port monitorMessage : (Value -> msg) -> Sub msg + + port onSessionChange : (Value -> msg) -> Sub msg diff --git a/ui/src/index.js b/ui/src/index.js index 38cef34..6b1f476 100644 --- a/ui/src/index.js +++ b/ui/src/index.js @@ -1,33 +1,40 @@ -import './main.css'; -import { Main } from './Main.elm'; -import registerServiceWorker from './registerServiceWorker'; +import './main.css' +import { Main } from './Main.elm' +import registerServiceWorker from './registerServiceWorker' +import registerMonitorPorts from './registerMonitor' -var app = Main.embed(document.getElementById('root'), sessionObject()); +// App startup. +var app = Main.embed(document.getElementById('root'), sessionObject()) +// Message monitor. +registerMonitorPorts(app) + +// Session storage. app.ports.storeSession.subscribe(function (session) { - localStorage.session = JSON.stringify(session); -}); - -app.ports.windowTitle.subscribe(function (title) { - document.title = title; -}); + localStorage.session = JSON.stringify(session) +}) window.addEventListener("storage", function (event) { if (event.storageArea === localStorage && event.key === "session") { - app.ports.onSessionChange.send(sessionObject()); + app.ports.onSessionChange.send(sessionObject()) } -}, false); +}, false) function sessionObject() { - var s = localStorage.session; + var s = localStorage.session try { if (s) { - return JSON.parse(s); + return JSON.parse(s) } } catch (error) { - console.error(error); + console.error(error) } - return null; + return null } -registerServiceWorker(); +// Window title. +app.ports.windowTitle.subscribe(function (title) { + document.title = title +}) + +registerServiceWorker() diff --git a/ui/src/registerMonitor.js b/ui/src/registerMonitor.js new file mode 100644 index 0000000..5bf1a50 --- /dev/null +++ b/ui/src/registerMonitor.js @@ -0,0 +1,46 @@ +// Register the websocket listeners for the monitor API. +export default function registerMonitorPorts(app) { + var uri = '/api/v1/monitor/messages' + var url = ((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + uri + + // Current handler. + var handler = null + + app.ports.monitorCommand.subscribe(function (cmd) { + if (handler != null) { + handler.down() + handler = null + } + if (cmd) { + // Command is up. + handler = websocketHandler(url, app.ports.monitorMessage) + handler.up() + } + }) +} + +// Creates a handler responsible for connecting, disconnecting from web socket. +function websocketHandler(url, port) { + var ws = null + + return { + up: () => { + ws = new WebSocket(url) + + ws.addEventListener('open', function (e) { + port.send(true) + }) + ws.addEventListener('close', function (e) { + port.send(false) + }) + ws.addEventListener('message', function (e) { + var msg = JSON.parse(e.data) + port.send(msg) + }) + }, + + down: () => { + ws.close() + } + } +}