@@ -0,0 +1,5214 @@
5+<meta name="viewport" content="width=device-width, initial-scale=1">
6+<title>LynxJS-Elm</title>
8+*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
9+body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
15+// LynxJS PAPI-to-DOM polyfill for browser preview
21+ 'scroll-view': 'div',
23+ 'textarea': 'textarea',
29+ 'longpress': 'contextmenu',
30+ 'touchstart': 'touchstart',
31+ 'touchmove': 'touchmove',
32+ 'touchend': 'touchend',
33+ 'touchcancel': 'touchcancel',
37+ var g = typeof globalThis !== 'undefined' ? globalThis : window;
39+ g.__CreatePage = function() {
40+ var page = document.createElement('div');
41+ page.id = 'lynx-page';
42+ document.body.appendChild(page);
46+ g.__createElement = function(tag) {
47+ var domTag = tagMap[tag] || 'div';
48+ var el = document.createElement(domTag);
49+ if (tag === 'scroll-view') { el.style.overflow = 'auto'; }
50+ el.setAttribute('data-lynx-tag', tag);
54+ g.__AppendElement = function(parent, child) {
55+ parent.appendChild(child);
58+ g.__RemoveElement = function(parent, child) {
59+ parent.removeChild(child);
62+ g.__ReplaceElement = function(parent, newEl, oldEl) {
63+ parent.replaceChild(newEl, oldEl);
66+ g.__InsertElementBefore = function(parent, child, ref) {
67+ parent.insertBefore(child, ref);
70+ g.__SetAttribute = function(el, key, value) {
71+ if (key === 'content' && el.getAttribute('data-lynx-tag') === 'text') {
72+ el.textContent = value;
73+ } else if (key === 'src' && el.tagName === 'IMG') {
76+ el.setAttribute(key, value);
80+ g.__AddEvent = function(el, bindingName, eventName, callback) {
81+ var domEvent = eventMap[eventName] || eventName;
82+ el.addEventListener(domEvent, function(e) {
87+ g.__SetInlineStyles = function(el, styles) {
88+ Object.assign(el.style, styles);
91+ g.__AddInlineStyle = function(el, key, value) {
92+ el.style[key] = value;
95+ g.__GetChildren = function(el) {
96+ return Array.from(el.children);
99+ g.__GetParent = function(el) {
100+ return el.parentNode;
109+function F(arity, fun, wrapper) {
116+ return F(2, fun, function(a) { return function(b) { return fun(a,b); }; })
119+ return F(3, fun, function(a) {
120+ return function(b) { return function(c) { return fun(a, b, c); }; };
124+ return F(4, fun, function(a) { return function(b) { return function(c) {
125+ return function(d) { return fun(a, b, c, d); }; }; };
129+ return F(5, fun, function(a) { return function(b) { return function(c) {
130+ return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };
134+ return F(6, fun, function(a) { return function(b) { return function(c) {
135+ return function(d) { return function(e) { return function(f) {
136+ return fun(a, b, c, d, e, f); }; }; }; }; };
140+ return F(7, fun, function(a) { return function(b) { return function(c) {
141+ return function(d) { return function(e) { return function(f) {
142+ return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; };
146+ return F(8, fun, function(a) { return function(b) { return function(c) {
147+ return function(d) { return function(e) { return function(f) {
148+ return function(g) { return function(h) {
149+ return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; };
153+ return F(9, fun, function(a) { return function(b) { return function(c) {
154+ return function(d) { return function(e) { return function(f) {
155+ return function(g) { return function(h) { return function(i) {
156+ return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; };
160+function A2(fun, a, b) {
161+ return fun.a === 2 ? fun.f(a, b) : fun(a)(b);
163+function A3(fun, a, b, c) {
164+ return fun.a === 3 ? fun.f(a, b, c) : fun(a)(b)(c);
166+function A4(fun, a, b, c, d) {
167+ return fun.a === 4 ? fun.f(a, b, c, d) : fun(a)(b)(c)(d);
169+function A5(fun, a, b, c, d, e) {
170+ return fun.a === 5 ? fun.f(a, b, c, d, e) : fun(a)(b)(c)(d)(e);
172+function A6(fun, a, b, c, d, e, f) {
173+ return fun.a === 6 ? fun.f(a, b, c, d, e, f) : fun(a)(b)(c)(d)(e)(f);
175+function A7(fun, a, b, c, d, e, f, g) {
176+ return fun.a === 7 ? fun.f(a, b, c, d, e, f, g) : fun(a)(b)(c)(d)(e)(f)(g);
178+function A8(fun, a, b, c, d, e, f, g, h) {
179+ return fun.a === 8 ? fun.f(a, b, c, d, e, f, g, h) : fun(a)(b)(c)(d)(e)(f)(g)(h);
181+function A9(fun, a, b, c, d, e, f, g, h, i) {
182+ return fun.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i);
185+console.warn('Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.');
188+var _JsArray_empty = [];
190+function _JsArray_singleton(value)
195+function _JsArray_length(array)
197+ return array.length;
200+var _JsArray_initialize = F3(function(size, offset, func)
202+ var result = new Array(size);
204+ for (var i = 0; i < size; i++)
206+ result[i] = func(offset + i);
212+var _JsArray_initializeFromList = F2(function (max, ls)
214+ var result = new Array(max);
216+ for (var i = 0; i < max && ls.b; i++)
223+ return _Utils_Tuple2(result, ls);
226+var _JsArray_unsafeGet = F2(function(index, array)
228+ return array[index];
231+var _JsArray_unsafeSet = F3(function(index, value, array)
233+ var length = array.length;
234+ var result = new Array(length);
236+ for (var i = 0; i < length; i++)
238+ result[i] = array[i];
241+ result[index] = value;
245+var _JsArray_push = F2(function(value, array)
247+ var length = array.length;
248+ var result = new Array(length + 1);
250+ for (var i = 0; i < length; i++)
252+ result[i] = array[i];
255+ result[length] = value;
259+var _JsArray_foldl = F3(function(func, acc, array)
261+ var length = array.length;
263+ for (var i = 0; i < length; i++)
265+ acc = A2(func, array[i], acc);
271+var _JsArray_foldr = F3(function(func, acc, array)
273+ for (var i = array.length - 1; i >= 0; i--)
275+ acc = A2(func, array[i], acc);
281+var _JsArray_map = F2(function(func, array)
283+ var length = array.length;
284+ var result = new Array(length);
286+ for (var i = 0; i < length; i++)
288+ result[i] = func(array[i]);
294+var _JsArray_indexedMap = F3(function(func, offset, array)
296+ var length = array.length;
297+ var result = new Array(length);
299+ for (var i = 0; i < length; i++)
301+ result[i] = A2(func, offset + i, array[i]);
307+var _JsArray_slice = F3(function(from, to, array)
309+ return array.slice(from, to);
312+var _JsArray_appendN = F3(function(n, dest, source)
314+ var destLen = dest.length;
315+ var itemsToCopy = n - destLen;
317+ if (itemsToCopy > source.length)
319+ itemsToCopy = source.length;
322+ var size = destLen + itemsToCopy;
323+ var result = new Array(size);
325+ for (var i = 0; i < destLen; i++)
327+ result[i] = dest[i];
330+ for (var i = 0; i < itemsToCopy; i++)
332+ result[i + destLen] = source[i];
342+var _Debug_log_UNUSED = F2(function(tag, value)
347+var _Debug_log = F2(function(tag, value)
349+ console.log(tag + ': ' + _Debug_toString(value));
356+function _Debug_todo(moduleName, region)
358+ return function(message) {
359+ _Debug_crash(8, moduleName, region, message);
363+function _Debug_todoCase(moduleName, region, value)
365+ return function(message) {
366+ _Debug_crash(9, moduleName, region, value, message);
373+function _Debug_toString_UNUSED(value)
375+ return '<internals>';
378+function _Debug_toString(value)
380+ return _Debug_toAnsiString(false, value);
383+function _Debug_toAnsiString(ansi, value)
385+ if (typeof value === 'function')
387+ return _Debug_internalColor(ansi, '<function>');
390+ if (typeof value === 'boolean')
392+ return _Debug_ctorColor(ansi, value ? 'True' : 'False');
395+ if (typeof value === 'number')
397+ return _Debug_numberColor(ansi, value + '');
400+ if (value instanceof String)
402+ return _Debug_charColor(ansi, "'" + _Debug_addSlashes(value, true) + "'");
405+ if (typeof value === 'string')
407+ return _Debug_stringColor(ansi, '"' + _Debug_addSlashes(value, false) + '"');
410+ if (typeof value === 'object' && '$' in value)
414+ if (typeof tag === 'number')
416+ return _Debug_internalColor(ansi, '<internals>');
422+ for (var k in value)
424+ if (k === '$') continue;
425+ output.push(_Debug_toAnsiString(ansi, value[k]));
427+ return '(' + output.join(',') + ')';
430+ if (tag === 'Set_elm_builtin')
432+ return _Debug_ctorColor(ansi, 'Set')
433+ + _Debug_fadeColor(ansi, '.fromList') + ' '
434+ + _Debug_toAnsiString(ansi, $elm$core$Set$toList(value));
437+ if (tag === 'RBNode_elm_builtin' || tag === 'RBEmpty_elm_builtin')
439+ return _Debug_ctorColor(ansi, 'Dict')
440+ + _Debug_fadeColor(ansi, '.fromList') + ' '
441+ + _Debug_toAnsiString(ansi, $elm$core$Dict$toList(value));
444+ if (tag === 'Array_elm_builtin')
446+ return _Debug_ctorColor(ansi, 'Array')
447+ + _Debug_fadeColor(ansi, '.fromList') + ' '
448+ + _Debug_toAnsiString(ansi, $elm$core$Array$toList(value));
451+ if (tag === '::' || tag === '[]')
455+ value.b && (output += _Debug_toAnsiString(ansi, value.a), value = value.b)
457+ for (; value.b; value = value.b) // WHILE_CONS
459+ output += ',' + _Debug_toAnsiString(ansi, value.a);
461+ return output + ']';
465+ for (var i in value)
467+ if (i === '$') continue;
468+ var str = _Debug_toAnsiString(ansi, value[i]);
470+ var parenless = c0 === '{' || c0 === '(' || c0 === '[' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0;
471+ output += ' ' + (parenless ? str : '(' + str + ')');
473+ return _Debug_ctorColor(ansi, tag) + output;
476+ if (typeof DataView === 'function' && value instanceof DataView)
478+ return _Debug_stringColor(ansi, '<' + value.byteLength + ' bytes>');
481+ if (typeof File !== 'undefined' && value instanceof File)
483+ return _Debug_internalColor(ansi, '<' + value.name + '>');
486+ if (typeof value === 'object')
489+ for (var key in value)
491+ var field = key[0] === '_' ? key.slice(1) : key;
492+ output.push(_Debug_fadeColor(ansi, field) + ' = ' + _Debug_toAnsiString(ansi, value[key]));
494+ if (output.length === 0)
498+ return '{ ' + output.join(', ') + ' }';
501+ return _Debug_internalColor(ansi, '<internals>');
504+function _Debug_addSlashes(str, isChar)
507+ .replace(/\\/g, '\\\\')
508+ .replace(/\n/g, '\\n')
509+ .replace(/\t/g, '\\t')
510+ .replace(/\r/g, '\\r')
511+ .replace(/\v/g, '\\v')
512+ .replace(/\0/g, '\\0');
516+ return s.replace(/\'/g, '\\\'');
520+ return s.replace(/\"/g, '\\"');
524+function _Debug_ctorColor(ansi, string)
526+ return ansi ? '\x1b[96m' + string + '\x1b[0m' : string;
529+function _Debug_numberColor(ansi, string)
531+ return ansi ? '\x1b[95m' + string + '\x1b[0m' : string;
534+function _Debug_stringColor(ansi, string)
536+ return ansi ? '\x1b[93m' + string + '\x1b[0m' : string;
539+function _Debug_charColor(ansi, string)
541+ return ansi ? '\x1b[92m' + string + '\x1b[0m' : string;
544+function _Debug_fadeColor(ansi, string)
546+ return ansi ? '\x1b[37m' + string + '\x1b[0m' : string;
549+function _Debug_internalColor(ansi, string)
551+ return ansi ? '\x1b[36m' + string + '\x1b[0m' : string;
554+function _Debug_toHexDigit(n)
556+ return String.fromCharCode(n < 10 ? 48 + n : 55 + n);
563+function _Debug_crash_UNUSED(identifier)
565+ throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md');
569+function _Debug_crash(identifier, fact1, fact2, fact3, fact4)
574+ throw new Error('What node should I take over? In JavaScript I need something like:\n\n Elm.Main.init({\n node: document.getElementById("elm-node")\n })\n\nYou need to do this with any Browser.sandbox or Browser.element program.');
577+ throw new Error('Browser.application programs cannot handle URLs like this:\n\n ' + document.location.href + '\n\nWhat is the root? The root of your file system? Try looking at this program with `elm reactor` or some other server.');
580+ var jsonErrorString = fact1;
581+ throw new Error('Problem with the flags given to your Elm program on initialization.\n\n' + jsonErrorString);
584+ var portName = fact1;
585+ throw new Error('There can only be one port named `' + portName + '`, but your program has multiple.');
588+ var portName = fact1;
589+ var problem = fact2;
590+ throw new Error('Trying to send an unexpected type of value through port `' + portName + '`:\n' + problem);
593+ throw new Error('Trying to use `(==)` on functions.\nThere is no way to know if functions are "the same" in the Elm sense.\nRead more about this at https://package.elm-lang.org/packages/elm/core/latest/Basics#== which describes why it is this way and what the better version will look like.');
596+ var moduleName = fact1;
597+ throw new Error('Your page is loading multiple Elm scripts with a module named ' + moduleName + '. Maybe a duplicate script is getting loaded accidentally? If not, rename one of them so I know which is which!');
600+ var moduleName = fact1;
602+ var message = fact3;
603+ throw new Error('TODO in module `' + moduleName + '` ' + _Debug_regionToString(region) + '\n\n' + message);
606+ var moduleName = fact1;
609+ var message = fact4;
611+ 'TODO in module `' + moduleName + '` from the `case` expression '
612+ + _Debug_regionToString(region) + '\n\nIt received the following value:\n\n '
613+ + _Debug_toString(value).replace('\n', '\n ')
614+ + '\n\nBut the branch that handles it says:\n\n ' + message.replace('\n', '\n ')
618+ throw new Error('Bug in https://github.com/elm/virtual-dom/issues');
621+ throw new Error('Cannot perform mod 0. Division by zero error.');
625+function _Debug_regionToString(region)
627+ if (region.start.line === region.end.line)
629+ return 'on line ' + region.start.line;
631+ return 'on lines ' + region.start.line + ' through ' + region.end.line;
638+function _Utils_eq(x, y)
641+ var pair, stack = [], isEqual = _Utils_eqHelp(x, y, 0, stack);
642+ isEqual && (pair = stack.pop());
643+ isEqual = _Utils_eqHelp(pair.a, pair.b, 0, stack)
650+function _Utils_eqHelp(x, y, depth, stack)
657+ if (typeof x !== 'object' || x === null || y === null)
659+ typeof x === 'function' && _Debug_crash(5);
665+ stack.push(_Utils_Tuple2(x,y));
670+ if (x.$ === 'Set_elm_builtin')
672+ x = $elm$core$Set$toList(x);
673+ y = $elm$core$Set$toList(y);
675+ if (x.$ === 'RBNode_elm_builtin' || x.$ === 'RBEmpty_elm_builtin')
677+ x = $elm$core$Dict$toList(x);
678+ y = $elm$core$Dict$toList(y);
685+ x = $elm$core$Dict$toList(x);
686+ y = $elm$core$Dict$toList(y);
692+ if (!_Utils_eqHelp(x[key], y[key], depth + 1, stack))
700+var _Utils_equal = F2(_Utils_eq);
701+var _Utils_notEqual = F2(function(a, b) { return !_Utils_eq(a,b); });
707+// Code in Generate/JavaScript.hs, Basics.js, and List.js depends on
708+// the particular integer values assigned to LT, EQ, and GT.
710+function _Utils_cmp(x, y, ord)
712+ if (typeof x !== 'object')
714+ return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1;
718+ if (x instanceof String)
720+ var a = x.valueOf();
721+ var b = y.valueOf();
722+ return a === b ? 0 : a < b ? -1 : 1;
727+ if (typeof x.$ === 'undefined')
733+ return (ord = _Utils_cmp(x.a, y.a))
735+ : (ord = _Utils_cmp(x.b, y.b))
737+ : _Utils_cmp(x.c, y.c);
740+ // traverse conses until end of a list or a mismatch
741+ for (; x.b && y.b && !(ord = _Utils_cmp(x.a, y.a)); x = x.b, y = y.b) {} // WHILE_CONSES
742+ return ord || (x.b ? /*GT*/ 1 : y.b ? /*LT*/ -1 : /*EQ*/ 0);
745+var _Utils_lt = F2(function(a, b) { return _Utils_cmp(a, b) < 0; });
746+var _Utils_le = F2(function(a, b) { return _Utils_cmp(a, b) < 1; });
747+var _Utils_gt = F2(function(a, b) { return _Utils_cmp(a, b) > 0; });
748+var _Utils_ge = F2(function(a, b) { return _Utils_cmp(a, b) >= 0; });
750+var _Utils_compare = F2(function(x, y)
752+ var n = _Utils_cmp(x, y);
753+ return n < 0 ? $elm$core$Basics$LT : n ? $elm$core$Basics$GT : $elm$core$Basics$EQ;
759+var _Utils_Tuple0_UNUSED = 0;
760+var _Utils_Tuple0 = { $: '#0' };
762+function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; }
763+function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; }
765+function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; }
766+function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; }
768+function _Utils_chr_UNUSED(c) { return c; }
769+function _Utils_chr(c) { return new String(c); }
774+function _Utils_update(oldRecord, updatedFields)
778+ for (var key in oldRecord)
780+ newRecord[key] = oldRecord[key];
783+ for (var key in updatedFields)
785+ newRecord[key] = updatedFields[key];
794+var _Utils_append = F2(_Utils_ap);
796+function _Utils_ap(xs, ys)
799+ if (typeof xs === 'string')
809+ var root = _List_Cons(xs.a, ys);
811+ for (var curr = root; xs.b; xs = xs.b) // WHILE_CONS
813+ curr = curr.b = _List_Cons(xs.a, ys);
820+var _List_Nil_UNUSED = { $: 0 };
821+var _List_Nil = { $: '[]' };
823+function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; }
824+function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; }
827+var _List_cons = F2(_List_Cons);
829+function _List_fromArray(arr)
831+ var out = _List_Nil;
832+ for (var i = arr.length; i--; )
834+ out = _List_Cons(arr[i], out);
839+function _List_toArray(xs)
841+ for (var out = []; xs.b; xs = xs.b) // WHILE_CONS
848+var _List_map2 = F3(function(f, xs, ys)
850+ for (var arr = []; xs.b && ys.b; xs = xs.b, ys = ys.b) // WHILE_CONSES
852+ arr.push(A2(f, xs.a, ys.a));
854+ return _List_fromArray(arr);
857+var _List_map3 = F4(function(f, xs, ys, zs)
859+ for (var arr = []; xs.b && ys.b && zs.b; xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
861+ arr.push(A3(f, xs.a, ys.a, zs.a));
863+ return _List_fromArray(arr);
866+var _List_map4 = F5(function(f, ws, xs, ys, zs)
868+ for (var arr = []; ws.b && xs.b && ys.b && zs.b; ws = ws.b, xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
870+ arr.push(A4(f, ws.a, xs.a, ys.a, zs.a));
872+ return _List_fromArray(arr);
875+var _List_map5 = F6(function(f, vs, ws, xs, ys, zs)
877+ for (var arr = []; vs.b && ws.b && xs.b && ys.b && zs.b; vs = vs.b, ws = ws.b, xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
879+ arr.push(A5(f, vs.a, ws.a, xs.a, ys.a, zs.a));
881+ return _List_fromArray(arr);
884+var _List_sortBy = F2(function(f, xs)
886+ return _List_fromArray(_List_toArray(xs).sort(function(a, b) {
887+ return _Utils_cmp(f(a), f(b));
891+var _List_sortWith = F2(function(f, xs)
893+ return _List_fromArray(_List_toArray(xs).sort(function(a, b) {
894+ var ord = A2(f, a, b);
895+ return ord === $elm$core$Basics$EQ ? 0 : ord === $elm$core$Basics$LT ? -1 : 1;
903+var _Basics_add = F2(function(a, b) { return a + b; });
904+var _Basics_sub = F2(function(a, b) { return a - b; });
905+var _Basics_mul = F2(function(a, b) { return a * b; });
906+var _Basics_fdiv = F2(function(a, b) { return a / b; });
907+var _Basics_idiv = F2(function(a, b) { return (a / b) | 0; });
908+var _Basics_pow = F2(Math.pow);
910+var _Basics_remainderBy = F2(function(b, a) { return a % b; });
912+// https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf
913+var _Basics_modBy = F2(function(modulus, x)
915+ var answer = x % modulus;
916+ return modulus === 0
919+ ((answer > 0 && modulus < 0) || (answer < 0 && modulus > 0))
927+var _Basics_pi = Math.PI;
928+var _Basics_e = Math.E;
929+var _Basics_cos = Math.cos;
930+var _Basics_sin = Math.sin;
931+var _Basics_tan = Math.tan;
932+var _Basics_acos = Math.acos;
933+var _Basics_asin = Math.asin;
934+var _Basics_atan = Math.atan;
935+var _Basics_atan2 = F2(Math.atan2);
940+function _Basics_toFloat(x) { return x; }
941+function _Basics_truncate(n) { return n | 0; }
942+function _Basics_isInfinite(n) { return n === Infinity || n === -Infinity; }
944+var _Basics_ceiling = Math.ceil;
945+var _Basics_floor = Math.floor;
946+var _Basics_round = Math.round;
947+var _Basics_sqrt = Math.sqrt;
948+var _Basics_log = Math.log;
949+var _Basics_isNaN = isNaN;
954+function _Basics_not(bool) { return !bool; }
955+var _Basics_and = F2(function(a, b) { return a && b; });
956+var _Basics_or = F2(function(a, b) { return a || b; });
957+var _Basics_xor = F2(function(a, b) { return a !== b; });
961+var _String_cons = F2(function(chr, str)
966+function _String_uncons(string)
968+ var word = string.charCodeAt(0);
970+ ? $elm$core$Maybe$Just(
971+ 0xD800 <= word && word <= 0xDBFF
972+ ? _Utils_Tuple2(_Utils_chr(string[0] + string[1]), string.slice(2))
973+ : _Utils_Tuple2(_Utils_chr(string[0]), string.slice(1))
975+ : $elm$core$Maybe$Nothing;
978+var _String_append = F2(function(a, b)
983+function _String_length(str)
988+var _String_map = F2(function(func, string)
990+ var len = string.length;
991+ var array = new Array(len);
995+ var word = string.charCodeAt(i);
996+ if (0xD800 <= word && word <= 0xDBFF)
998+ array[i] = func(_Utils_chr(string[i] + string[i+1]));
1002+ array[i] = func(_Utils_chr(string[i]));
1005+ return array.join('');
1008+var _String_filter = F2(function(isGood, str)
1011+ var len = str.length;
1016+ var word = str.charCodeAt(i);
1018+ if (0xD800 <= word && word <= 0xDBFF)
1024+ if (isGood(_Utils_chr(char)))
1029+ return arr.join('');
1032+function _String_reverse(str)
1034+ var len = str.length;
1035+ var arr = new Array(len);
1039+ var word = str.charCodeAt(i);
1040+ if (0xD800 <= word && word <= 0xDBFF)
1042+ arr[len - i] = str[i + 1];
1044+ arr[len - i] = str[i - 1];
1049+ arr[len - i] = str[i];
1053+ return arr.join('');
1056+var _String_foldl = F3(function(func, state, string)
1058+ var len = string.length;
1062+ var char = string[i];
1063+ var word = string.charCodeAt(i);
1065+ if (0xD800 <= word && word <= 0xDBFF)
1070+ state = A2(func, _Utils_chr(char), state);
1075+var _String_foldr = F3(function(func, state, string)
1077+ var i = string.length;
1080+ var char = string[i];
1081+ var word = string.charCodeAt(i);
1082+ if (0xDC00 <= word && word <= 0xDFFF)
1085+ char = string[i] + char;
1087+ state = A2(func, _Utils_chr(char), state);
1092+var _String_split = F2(function(sep, str)
1094+ return str.split(sep);
1097+var _String_join = F2(function(sep, strs)
1099+ return strs.join(sep);
1102+var _String_slice = F3(function(start, end, str) {
1103+ return str.slice(start, end);
1106+function _String_trim(str)
1111+function _String_trimLeft(str)
1113+ return str.replace(/^\s+/, '');
1116+function _String_trimRight(str)
1118+ return str.replace(/\s+$/, '');
1121+function _String_words(str)
1123+ return _List_fromArray(str.trim().split(/\s+/g));
1126+function _String_lines(str)
1128+ return _List_fromArray(str.split(/\r\n|\r|\n/g));
1131+function _String_toUpper(str)
1133+ return str.toUpperCase();
1136+function _String_toLower(str)
1138+ return str.toLowerCase();
1141+var _String_any = F2(function(isGood, string)
1143+ var i = string.length;
1146+ var char = string[i];
1147+ var word = string.charCodeAt(i);
1148+ if (0xDC00 <= word && word <= 0xDFFF)
1151+ char = string[i] + char;
1153+ if (isGood(_Utils_chr(char)))
1161+var _String_all = F2(function(isGood, string)
1163+ var i = string.length;
1166+ var char = string[i];
1167+ var word = string.charCodeAt(i);
1168+ if (0xDC00 <= word && word <= 0xDFFF)
1171+ char = string[i] + char;
1173+ if (!isGood(_Utils_chr(char)))
1181+var _String_contains = F2(function(sub, str)
1183+ return str.indexOf(sub) > -1;
1186+var _String_startsWith = F2(function(sub, str)
1188+ return str.indexOf(sub) === 0;
1191+var _String_endsWith = F2(function(sub, str)
1193+ return str.length >= sub.length &&
1194+ str.lastIndexOf(sub) === str.length - sub.length;
1197+var _String_indexes = F2(function(sub, str)
1199+ var subLen = sub.length;
1209+ while ((i = str.indexOf(sub, i)) > -1)
1215+ return _List_fromArray(is);
1221+function _String_fromNumber(number)
1223+ return number + '';
1229+function _String_toInt(str)
1232+ var code0 = str.charCodeAt(0);
1233+ var start = code0 == 0x2B /* + */ || code0 == 0x2D /* - */ ? 1 : 0;
1235+ for (var i = start; i < str.length; ++i)
1237+ var code = str.charCodeAt(i);
1238+ if (code < 0x30 || 0x39 < code)
1240+ return $elm$core$Maybe$Nothing;
1242+ total = 10 * total + code - 0x30;
1246+ ? $elm$core$Maybe$Nothing
1247+ : $elm$core$Maybe$Just(code0 == 0x2D ? -total : total);
1251+// FLOAT CONVERSIONS
1253+function _String_toFloat(s)
1255+ // check if it is a hex, octal, or binary number
1256+ if (s.length === 0 || /[\sxbo]/.test(s))
1258+ return $elm$core$Maybe$Nothing;
1261+ // faster isNaN check
1262+ return n === n ? $elm$core$Maybe$Just(n) : $elm$core$Maybe$Nothing;
1265+function _String_fromList(chars)
1267+ return _List_toArray(chars).join('');
1273+function _Char_toCode(char)
1275+ var code = char.charCodeAt(0);
1276+ if (0xD800 <= code && code <= 0xDBFF)
1278+ return (code - 0xD800) * 0x400 + char.charCodeAt(1) - 0xDC00 + 0x10000
1283+function _Char_fromCode(code)
1286+ (code < 0 || 0x10FFFF < code)
1290+ ? String.fromCharCode(code)
1293+ String.fromCharCode(Math.floor(code / 0x400) + 0xD800, code % 0x400 + 0xDC00)
1298+function _Char_toUpper(char)
1300+ return _Utils_chr(char.toUpperCase());
1303+function _Char_toLower(char)
1305+ return _Utils_chr(char.toLowerCase());
1308+function _Char_toLocaleUpper(char)
1310+ return _Utils_chr(char.toLocaleUpperCase());
1313+function _Char_toLocaleLower(char)
1315+ return _Utils_chr(char.toLocaleLowerCase());
1321+function _Json_errorToString(error)
1323+ return $elm$json$Json$Decode$errorToString(error);
1330+function _Json_succeed(msg)
1338+function _Json_fail(msg)
1346+function _Json_decodePrim(decoder)
1348+ return { $: 2, b: decoder };
1351+var _Json_decodeInt = _Json_decodePrim(function(value) {
1352+ return (typeof value !== 'number')
1353+ ? _Json_expecting('an INT', value)
1355+ (-2147483647 < value && value < 2147483647 && (value | 0) === value)
1356+ ? $elm$core$Result$Ok(value)
1358+ (isFinite(value) && !(value % 1))
1359+ ? $elm$core$Result$Ok(value)
1360+ : _Json_expecting('an INT', value);
1363+var _Json_decodeBool = _Json_decodePrim(function(value) {
1364+ return (typeof value === 'boolean')
1365+ ? $elm$core$Result$Ok(value)
1366+ : _Json_expecting('a BOOL', value);
1369+var _Json_decodeFloat = _Json_decodePrim(function(value) {
1370+ return (typeof value === 'number')
1371+ ? $elm$core$Result$Ok(value)
1372+ : _Json_expecting('a FLOAT', value);
1375+var _Json_decodeValue = _Json_decodePrim(function(value) {
1376+ return $elm$core$Result$Ok(_Json_wrap(value));
1379+var _Json_decodeString = _Json_decodePrim(function(value) {
1380+ return (typeof value === 'string')
1381+ ? $elm$core$Result$Ok(value)
1382+ : (value instanceof String)
1383+ ? $elm$core$Result$Ok(value + '')
1384+ : _Json_expecting('a STRING', value);
1387+function _Json_decodeList(decoder) { return { $: 3, b: decoder }; }
1388+function _Json_decodeArray(decoder) { return { $: 4, b: decoder }; }
1390+function _Json_decodeNull(value) { return { $: 5, c: value }; }
1392+var _Json_decodeField = F2(function(field, decoder)
1401+var _Json_decodeIndex = F2(function(index, decoder)
1410+function _Json_decodeKeyValuePairs(decoder)
1418+function _Json_mapMany(f, decoders)
1427+var _Json_andThen = F2(function(callback, decoder)
1436+function _Json_oneOf(decoders)
1447+var _Json_map1 = F2(function(f, d1)
1449+ return _Json_mapMany(f, [d1]);
1452+var _Json_map2 = F3(function(f, d1, d2)
1454+ return _Json_mapMany(f, [d1, d2]);
1457+var _Json_map3 = F4(function(f, d1, d2, d3)
1459+ return _Json_mapMany(f, [d1, d2, d3]);
1462+var _Json_map4 = F5(function(f, d1, d2, d3, d4)
1464+ return _Json_mapMany(f, [d1, d2, d3, d4]);
1467+var _Json_map5 = F6(function(f, d1, d2, d3, d4, d5)
1469+ return _Json_mapMany(f, [d1, d2, d3, d4, d5]);
1472+var _Json_map6 = F7(function(f, d1, d2, d3, d4, d5, d6)
1474+ return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6]);
1477+var _Json_map7 = F8(function(f, d1, d2, d3, d4, d5, d6, d7)
1479+ return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7]);
1482+var _Json_map8 = F9(function(f, d1, d2, d3, d4, d5, d6, d7, d8)
1484+ return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]);
1490+var _Json_runOnString = F2(function(decoder, string)
1494+ var value = JSON.parse(string);
1495+ return _Json_runHelp(decoder, value);
1499+ return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, 'This is not valid JSON! ' + e.message, _Json_wrap(string)));
1503+var _Json_run = F2(function(decoder, value)
1505+ return _Json_runHelp(decoder, _Json_unwrap(value));
1508+function _Json_runHelp(decoder, value)
1513+ return decoder.b(value);
1516+ return (value === null)
1517+ ? $elm$core$Result$Ok(decoder.c)
1518+ : _Json_expecting('null', value);
1521+ if (!_Json_isArray(value))
1523+ return _Json_expecting('a LIST', value);
1525+ return _Json_runArrayDecoder(decoder.b, value, _List_fromArray);
1528+ if (!_Json_isArray(value))
1530+ return _Json_expecting('an ARRAY', value);
1532+ return _Json_runArrayDecoder(decoder.b, value, _Json_toElmArray);
1535+ var field = decoder.d;
1536+ if (typeof value !== 'object' || value === null || !(field in value))
1538+ return _Json_expecting('an OBJECT with a field named `' + field + '`', value);
1540+ var result = _Json_runHelp(decoder.b, value[field]);
1541+ return ($elm$core$Result$isOk(result)) ? result : $elm$core$Result$Err(A2($elm$json$Json$Decode$Field, field, result.a));
1544+ var index = decoder.e;
1545+ if (!_Json_isArray(value))
1547+ return _Json_expecting('an ARRAY', value);
1549+ if (index >= value.length)
1551+ return _Json_expecting('a LONGER array. Need index ' + index + ' but only see ' + value.length + ' entries', value);
1553+ var result = _Json_runHelp(decoder.b, value[index]);
1554+ return ($elm$core$Result$isOk(result)) ? result : $elm$core$Result$Err(A2($elm$json$Json$Decode$Index, index, result.a));
1557+ if (typeof value !== 'object' || value === null || _Json_isArray(value))
1559+ return _Json_expecting('an OBJECT', value);
1562+ var keyValuePairs = _List_Nil;
1563+ // TODO test perf of Object.keys and switch when support is good enough
1564+ for (var key in value)
1566+ if (value.hasOwnProperty(key))
1568+ var result = _Json_runHelp(decoder.b, value[key]);
1569+ if (!$elm$core$Result$isOk(result))
1571+ return $elm$core$Result$Err(A2($elm$json$Json$Decode$Field, key, result.a));
1573+ keyValuePairs = _List_Cons(_Utils_Tuple2(key, result.a), keyValuePairs);
1576+ return $elm$core$Result$Ok($elm$core$List$reverse(keyValuePairs));
1579+ var answer = decoder.f;
1580+ var decoders = decoder.g;
1581+ for (var i = 0; i < decoders.length; i++)
1583+ var result = _Json_runHelp(decoders[i], value);
1584+ if (!$elm$core$Result$isOk(result))
1588+ answer = answer(result.a);
1590+ return $elm$core$Result$Ok(answer);
1593+ var result = _Json_runHelp(decoder.b, value);
1594+ return (!$elm$core$Result$isOk(result))
1596+ : _Json_runHelp(decoder.h(result.a), value);
1599+ var errors = _List_Nil;
1600+ for (var temp = decoder.g; temp.b; temp = temp.b) // WHILE_CONS
1602+ var result = _Json_runHelp(temp.a, value);
1603+ if ($elm$core$Result$isOk(result))
1607+ errors = _List_Cons(result.a, errors);
1609+ return $elm$core$Result$Err($elm$json$Json$Decode$OneOf($elm$core$List$reverse(errors)));
1612+ return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, decoder.a, _Json_wrap(value)));
1615+ return $elm$core$Result$Ok(decoder.a);
1619+function _Json_runArrayDecoder(decoder, value, toElmValue)
1621+ var len = value.length;
1622+ var array = new Array(len);
1623+ for (var i = 0; i < len; i++)
1625+ var result = _Json_runHelp(decoder, value[i]);
1626+ if (!$elm$core$Result$isOk(result))
1628+ return $elm$core$Result$Err(A2($elm$json$Json$Decode$Index, i, result.a));
1630+ array[i] = result.a;
1632+ return $elm$core$Result$Ok(toElmValue(array));
1635+function _Json_isArray(value)
1637+ return Array.isArray(value) || (typeof FileList !== 'undefined' && value instanceof FileList);
1640+function _Json_toElmArray(array)
1642+ return A2($elm$core$Array$initialize, array.length, function(i) { return array[i]; });
1645+function _Json_expecting(type, value)
1647+ return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, 'Expecting ' + type, _Json_wrap(value)));
1653+function _Json_equality(x, y)
1669+ return x.a === y.a;
1672+ return x.b === y.b;
1675+ return x.c === y.c;
1680+ return _Json_equality(x.b, y.b);
1683+ return x.d === y.d && _Json_equality(x.b, y.b);
1686+ return x.e === y.e && _Json_equality(x.b, y.b);
1689+ return x.f === y.f && _Json_listEquality(x.g, y.g);
1692+ return x.h === y.h && _Json_equality(x.b, y.b);
1695+ return _Json_listEquality(x.g, y.g);
1699+function _Json_listEquality(aDecoders, bDecoders)
1701+ var len = aDecoders.length;
1702+ if (len !== bDecoders.length)
1706+ for (var i = 0; i < len; i++)
1708+ if (!_Json_equality(aDecoders[i], bDecoders[i]))
1719+var _Json_encode = F2(function(indentLevel, value)
1721+ return JSON.stringify(_Json_unwrap(value), null, indentLevel) + '';
1724+function _Json_wrap(value) { return { $: 0, a: value }; }
1725+function _Json_unwrap(value) { return value.a; }
1727+function _Json_wrap_UNUSED(value) { return value; }
1728+function _Json_unwrap_UNUSED(value) { return value; }
1730+function _Json_emptyArray() { return []; }
1731+function _Json_emptyObject() { return {}; }
1733+var _Json_addField = F3(function(key, value, object)
1735+ object[key] = _Json_unwrap(value);
1739+function _Json_addEntry(func)
1741+ return F2(function(entry, array)
1743+ array.push(_Json_unwrap(func(entry)));
1748+var _Json_encodeNull = _Json_wrap(null);
1754+function _Scheduler_succeed(value)
1762+function _Scheduler_fail(error)
1770+function _Scheduler_binding(callback)
1779+var _Scheduler_andThen = F2(function(callback, task)
1788+var _Scheduler_onError = F2(function(callback, task)
1797+function _Scheduler_receive(callback)
1808+var _Scheduler_guid = 0;
1810+function _Scheduler_rawSpawn(task)
1814+ e: _Scheduler_guid++,
1820+ _Scheduler_enqueue(proc);
1825+function _Scheduler_spawn(task)
1827+ return _Scheduler_binding(function(callback) {
1828+ callback(_Scheduler_succeed(_Scheduler_rawSpawn(task)));
1832+function _Scheduler_rawSend(proc, msg)
1835+ _Scheduler_enqueue(proc);
1838+var _Scheduler_send = F2(function(proc, msg)
1840+ return _Scheduler_binding(function(callback) {
1841+ _Scheduler_rawSend(proc, msg);
1842+ callback(_Scheduler_succeed(_Utils_Tuple0));
1846+function _Scheduler_kill(proc)
1848+ return _Scheduler_binding(function(callback) {
1850+ if (task.$ === 2 && task.c)
1857+ callback(_Scheduler_succeed(_Utils_Tuple0));
1864+type alias Process =
1868+ , stack : null | { $: SUCCEED | FAIL, a: callback, b: stack }
1875+var _Scheduler_working = false;
1876+var _Scheduler_queue = [];
1879+function _Scheduler_enqueue(proc)
1881+ _Scheduler_queue.push(proc);
1882+ if (_Scheduler_working)
1886+ _Scheduler_working = true;
1887+ while (proc = _Scheduler_queue.shift())
1889+ _Scheduler_step(proc);
1891+ _Scheduler_working = false;
1895+function _Scheduler_step(proc)
1899+ var rootTag = proc.f.$;
1900+ if (rootTag === 0 || rootTag === 1)
1902+ while (proc.g && proc.g.$ !== rootTag)
1910+ proc.f = proc.g.b(proc.f.a);
1913+ else if (rootTag === 2)
1915+ proc.f.c = proc.f.b(function(newRoot) {
1917+ _Scheduler_enqueue(proc);
1921+ else if (rootTag === 5)
1923+ if (proc.h.length === 0)
1927+ proc.f = proc.f.b(proc.h.shift());
1929+ else // if (rootTag === 3 || rootTag === 4)
1932+ $: rootTag === 3 ? 0 : 1,
1943+function _Process_sleep(time)
1945+ return _Scheduler_binding(function(callback) {
1946+ var id = setTimeout(function() {
1947+ callback(_Scheduler_succeed(_Utils_Tuple0));
1950+ return function() { clearTimeout(id); };
1960+var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args)
1962+ return _Platform_initialize(
1967+ impl.subscriptions,
1968+ function() { return function() {} }
1974+// INITIALIZE A PROGRAM
1977+function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder)
1979+ var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined));
1980+ $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/);
1982+ var initPair = init(result.a);
1983+ var model = initPair.a;
1984+ var stepper = stepperBuilder(sendToApp, model);
1985+ var ports = _Platform_setupEffects(managers, sendToApp);
1987+ function sendToApp(msg, viewMetadata)
1989+ var pair = A2(update, msg, model);
1990+ stepper(model = pair.a, viewMetadata);
1991+ _Platform_enqueueEffects(managers, pair.b, subscriptions(model));
1994+ _Platform_enqueueEffects(managers, initPair.b, subscriptions(model));
1996+ return ports ? { ports: ports } : {};
2003+// This is used by code in elm/browser and elm/http
2004+// to register any HTTP requests that are triggered by init.
2008+var _Platform_preload;
2011+function _Platform_registerPreload(url)
2013+ _Platform_preload.add(url);
2021+var _Platform_effectManagers = {};
2024+function _Platform_setupEffects(managers, sendToApp)
2028+ // setup all necessary effect managers
2029+ for (var key in _Platform_effectManagers)
2031+ var manager = _Platform_effectManagers[key];
2035+ ports = ports || {};
2036+ ports[key] = manager.a(key, sendToApp);
2039+ managers[key] = _Platform_instantiateManager(manager, sendToApp);
2046+function _Platform_createManager(init, onEffects, onSelfMsg, cmdMap, subMap)
2058+function _Platform_instantiateManager(info, sendToApp)
2065+ var onEffects = info.c;
2066+ var onSelfMsg = info.d;
2067+ var cmdMap = info.e;
2068+ var subMap = info.f;
2070+ function loop(state)
2072+ return A2(_Scheduler_andThen, loop, _Scheduler_receive(function(msg)
2078+ return A3(onSelfMsg, router, value, state);
2081+ return cmdMap && subMap
2082+ ? A4(onEffects, router, value.i, value.j, state)
2083+ : A3(onEffects, router, cmdMap ? value.i : value.j, state);
2087+ return router.h = _Scheduler_rawSpawn(A2(_Scheduler_andThen, loop, info.b));
2095+var _Platform_sendToApp = F2(function(router, msg)
2097+ return _Scheduler_binding(function(callback)
2100+ callback(_Scheduler_succeed(_Utils_Tuple0));
2105+var _Platform_sendToSelf = F2(function(router, msg)
2107+ return A2(_Scheduler_send, router.h, {
2118+function _Platform_leaf(home)
2120+ return function(value)
2131+function _Platform_batch(list)
2140+var _Platform_map = F2(function(tagger, bag)
2151+// PIPE BAGS INTO EFFECT MANAGERS
2153+// Effects must be queued!
2155+// Say your init contains a synchronous command, like Time.now or Time.here
2157+// - This will produce a batch of effects (FX_1)
2158+// - The synchronous task triggers the subsequent `update` call
2159+// - This will produce a batch of effects (FX_2)
2161+// If we just start dispatching FX_2, subscriptions from FX_2 can be processed
2162+// before subscriptions from FX_1. No good! Earlier versions of this code had
2163+// this problem, leading to these reports:
2165+// https://github.com/elm/core/issues/980
2166+// https://github.com/elm/core/pull/981
2167+// https://github.com/elm/compiler/issues/1776
2169+// The queue is necessary to avoid ordering issues for synchronous commands.
2172+// Why use true/false here? Why not just check the length of the queue?
2173+// The goal is to detect "are we currently dispatching effects?" If we
2174+// are, we need to bail and let the ongoing while loop handle things.
2176+// Now say the queue has 1 element. When we dequeue the final element,
2177+// the queue will be empty, but we are still actively dispatching effects.
2178+// So you could get queue jumping in a really tricky category of cases.
2180+var _Platform_effectsQueue = [];
2181+var _Platform_effectsActive = false;
2184+function _Platform_enqueueEffects(managers, cmdBag, subBag)
2186+ _Platform_effectsQueue.push({ p: managers, q: cmdBag, r: subBag });
2188+ if (_Platform_effectsActive) return;
2190+ _Platform_effectsActive = true;
2191+ for (var fx; fx = _Platform_effectsQueue.shift(); )
2193+ _Platform_dispatchEffects(fx.p, fx.q, fx.r);
2195+ _Platform_effectsActive = false;
2199+function _Platform_dispatchEffects(managers, cmdBag, subBag)
2201+ var effectsDict = {};
2202+ _Platform_gatherEffects(true, cmdBag, effectsDict, null);
2203+ _Platform_gatherEffects(false, subBag, effectsDict, null);
2205+ for (var home in managers)
2207+ _Scheduler_rawSend(managers[home], {
2209+ a: effectsDict[home] || { i: _List_Nil, j: _List_Nil }
2215+function _Platform_gatherEffects(isCmd, bag, effectsDict, taggers)
2221+ var effect = _Platform_toEffect(isCmd, home, taggers, bag.l);
2222+ effectsDict[home] = _Platform_insert(isCmd, effect, effectsDict[home]);
2226+ for (var list = bag.m; list.b; list = list.b) // WHILE_CONS
2228+ _Platform_gatherEffects(isCmd, list.a, effectsDict, taggers);
2233+ _Platform_gatherEffects(isCmd, bag.o, effectsDict, {
2242+function _Platform_toEffect(isCmd, home, taggers, value)
2244+ function applyTaggers(x)
2246+ for (var temp = taggers; temp; temp = temp.t)
2254+ ? _Platform_effectManagers[home].e
2255+ : _Platform_effectManagers[home].f;
2257+ return A2(map, applyTaggers, value)
2261+function _Platform_insert(isCmd, newEffect, effects)
2263+ effects = effects || { i: _List_Nil, j: _List_Nil };
2266+ ? (effects.i = _List_Cons(newEffect, effects.i))
2267+ : (effects.j = _List_Cons(newEffect, effects.j));
2277+function _Platform_checkPortName(name)
2279+ if (_Platform_effectManagers[name])
2281+ _Debug_crash(3, name)
2290+function _Platform_outgoingPort(name, converter)
2292+ _Platform_checkPortName(name);
2293+ _Platform_effectManagers[name] = {
2294+ e: _Platform_outgoingPortMap,
2296+ a: _Platform_setupOutgoingPort
2298+ return _Platform_leaf(name);
2302+var _Platform_outgoingPortMap = F2(function(tagger, value) { return value; });
2305+function _Platform_setupOutgoingPort(name)
2308+ var converter = _Platform_effectManagers[name].u;
2312+ var init = _Process_sleep(0);
2314+ _Platform_effectManagers[name].b = init;
2315+ _Platform_effectManagers[name].c = F3(function(router, cmdList, state)
2317+ for ( ; cmdList.b; cmdList = cmdList.b) // WHILE_CONS
2319+ // grab a separate reference to subs in case unsubscribe is called
2320+ var currentSubs = subs;
2321+ var value = _Json_unwrap(converter(cmdList.a));
2322+ for (var i = 0; i < currentSubs.length; i++)
2324+ currentSubs[i](value);
2332+ function subscribe(callback)
2334+ subs.push(callback);
2337+ function unsubscribe(callback)
2339+ // copy subs into a new array in case unsubscribe is called within a
2340+ // subscribed callback
2341+ subs = subs.slice();
2342+ var index = subs.indexOf(callback);
2345+ subs.splice(index, 1);
2350+ subscribe: subscribe,
2351+ unsubscribe: unsubscribe
2360+function _Platform_incomingPort(name, converter)
2362+ _Platform_checkPortName(name);
2363+ _Platform_effectManagers[name] = {
2364+ f: _Platform_incomingPortMap,
2366+ a: _Platform_setupIncomingPort
2368+ return _Platform_leaf(name);
2372+var _Platform_incomingPortMap = F2(function(tagger, finalTagger)
2374+ return function(value)
2376+ return tagger(finalTagger(value));
2381+function _Platform_setupIncomingPort(name, sendToApp)
2383+ var subs = _List_Nil;
2384+ var converter = _Platform_effectManagers[name].u;
2388+ var init = _Scheduler_succeed(null);
2390+ _Platform_effectManagers[name].b = init;
2391+ _Platform_effectManagers[name].c = F3(function(router, subList, state)
2399+ function send(incomingValue)
2401+ var result = A2(_Json_run, converter, _Json_wrap(incomingValue));
2403+ $elm$core$Result$isOk(result) || _Debug_crash(4, name, result.a);
2405+ var value = result.a;
2406+ for (var temp = subs; temp.b; temp = temp.b) // WHILE_CONS
2408+ sendToApp(temp.a(value));
2412+ return { send: send };
2417+// EXPORT ELM MODULES
2419+// Have DEBUG and PROD versions so that we can (1) give nicer errors in
2420+// debug mode and (2) not pay for the bits needed for that in prod mode.
2424+function _Platform_export_UNUSED(exports)
2427+ ? _Platform_mergeExportsProd(scope['Elm'], exports)
2428+ : scope['Elm'] = exports;
2432+function _Platform_mergeExportsProd(obj, exports)
2434+ for (var name in exports)
2439+ : _Platform_mergeExportsProd(obj[name], exports[name])
2440+ : (obj[name] = exports[name]);
2445+function _Platform_export(exports)
2448+ ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports)
2449+ : scope['Elm'] = exports;
2453+function _Platform_mergeExportsDebug(moduleName, obj, exports)
2455+ for (var name in exports)
2459+ ? _Debug_crash(6, moduleName)
2460+ : _Platform_mergeExportsDebug(moduleName + '.' + name, obj[name], exports[name])
2461+ : (obj[name] = exports[name]);
2467+var _Lynx_g = (typeof globalThis !== 'undefined' ? globalThis : scope);
2468+function _Lynx_papi(name) { return _Lynx_g['_' + '_' + name] || function() {}; }
2469+var _Lynx_createElement = _Lynx_papi('createElement');
2470+var _Lynx_createPage = _Lynx_papi('CreatePage');
2471+var _Lynx_appendChild = _Lynx_papi('AppendElement');
2472+var _Lynx_removeElement = _Lynx_papi('RemoveElement');
2473+var _Lynx_replaceElement = _Lynx_papi('ReplaceElement');
2474+var _Lynx_insertBefore = _Lynx_papi('InsertElementBefore');
2475+var _Lynx_setAttribute = _Lynx_papi('SetAttribute');
2476+var _Lynx_getChildren = _Lynx_g['_' + '_GetChildren'] || function() { return []; };
2477+var _Lynx_getParent = _Lynx_g['_' + '_GetParent'] || function() { return null; };
2478+var _Lynx_addEvent = _Lynx_papi('AddEvent');
2479+var _Lynx_setInlineStyles = _Lynx_g['_' + '_SetInlineStyles'];
2480+var _Lynx_addInlineStyle = _Lynx_papi('AddInlineStyle');
2482+var _VirtualDom_elementMeta = new Map();
2483+function _VirtualDom_getMeta(el) {
2484+ var meta = _VirtualDom_elementMeta.get(el);
2485+ if (!meta) { meta = {}; _VirtualDom_elementMeta.set(el, meta); }
2496+function _VirtualDom_appendChild(parent, child)
2498+ _Lynx_appendChild(parent, child);
2501+var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args)
2503+ // NOTE: this function needs _Platform_export available to work
2504+ var rootPage = args['node'] || _Lynx_createPage();
2505+ var tree = _VirtualDom_render(virtualNode, function() {});
2506+ _Lynx_appendChild(rootPage, tree);
2515+function _VirtualDom_text(string)
2528+var _VirtualDom_nodeNS = F2(function(namespace, tag)
2530+ return F2(function(factList, kidList)
2532+ for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS
2534+ var kid = kidList.a;
2535+ descendantsCount += (kid.b || 0);
2538+ descendantsCount += kids.length;
2543+ d: _VirtualDom_organizeFacts(factList),
2546+ b: descendantsCount
2552+var _VirtualDom_node = _VirtualDom_nodeNS(undefined);
2559+var _VirtualDom_keyedNodeNS = F2(function(namespace, tag)
2561+ return F2(function(factList, kidList)
2563+ for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS
2565+ var kid = kidList.a;
2566+ descendantsCount += (kid.b.b || 0);
2569+ descendantsCount += kids.length;
2574+ d: _VirtualDom_organizeFacts(factList),
2577+ b: descendantsCount
2583+var _VirtualDom_keyedNode = _VirtualDom_keyedNodeNS(undefined);
2590+function _VirtualDom_custom(factList, model, render, diff)
2594+ d: _VirtualDom_organizeFacts(factList),
2606+var _VirtualDom_map = F2(function(tagger, node)
2612+ b: 1 + (node.b || 0)
2621+function _VirtualDom_thunk(refs, thunk)
2631+var _VirtualDom_lazy = F2(function(func, a)
2633+ return _VirtualDom_thunk([func, a], function() {
2638+var _VirtualDom_lazy2 = F3(function(func, a, b)
2640+ return _VirtualDom_thunk([func, a, b], function() {
2641+ return A2(func, a, b);
2645+var _VirtualDom_lazy3 = F4(function(func, a, b, c)
2647+ return _VirtualDom_thunk([func, a, b, c], function() {
2648+ return A3(func, a, b, c);
2652+var _VirtualDom_lazy4 = F5(function(func, a, b, c, d)
2654+ return _VirtualDom_thunk([func, a, b, c, d], function() {
2655+ return A4(func, a, b, c, d);
2659+var _VirtualDom_lazy5 = F6(function(func, a, b, c, d, e)
2661+ return _VirtualDom_thunk([func, a, b, c, d, e], function() {
2662+ return A5(func, a, b, c, d, e);
2666+var _VirtualDom_lazy6 = F7(function(func, a, b, c, d, e, f)
2668+ return _VirtualDom_thunk([func, a, b, c, d, e, f], function() {
2669+ return A6(func, a, b, c, d, e, f);
2673+var _VirtualDom_lazy7 = F8(function(func, a, b, c, d, e, f, g)
2675+ return _VirtualDom_thunk([func, a, b, c, d, e, f, g], function() {
2676+ return A7(func, a, b, c, d, e, f, g);
2680+var _VirtualDom_lazy8 = F9(function(func, a, b, c, d, e, f, g, h)
2682+ return _VirtualDom_thunk([func, a, b, c, d, e, f, g, h], function() {
2683+ return A8(func, a, b, c, d, e, f, g, h);
2692+var _VirtualDom_on = F2(function(key, handler)
2700+var _VirtualDom_style = F2(function(key, value)
2708+var _VirtualDom_property = F2(function(key, value)
2716+var _VirtualDom_attribute = F2(function(key, value)
2724+var _VirtualDom_attributeNS = F3(function(namespace, key, value)
2729+ o: { f: namespace, o: value }
2735+// XSS ATTACK VECTOR CHECKS
2737+// For some reason, tabs can appear in href protocols and it still works.
2738+// So '\tjava\tSCRIPT:alert("!!!")' and 'javascript:alert("!!!")' are the same
2739+// in practice. That is why _VirtualDom_RE_js and _VirtualDom_RE_js_html look
2742+// Pulling the regular expressions out to the top level gives a slight speed
2743+// boost in small benchmarks (4-10%) but hoisting values to reduce allocation
2744+// can be unpredictable in large programs where JIT may have a harder time with
2745+// functions are not fully self-contained. The benefit is more that the js and
2746+// js_html ones are so weird that I prefer to see them near each other.
2752+function _VirtualDom_noScript(tag)
2757+function _VirtualDom_noOnOrFormAction(key)
2762+function _VirtualDom_noInnerHtmlOrFormAction(key)
2767+function _VirtualDom_noJavaScriptUri(value)
2772+function _VirtualDom_noJavaScriptOrHtmlUri(value)
2777+function _VirtualDom_noJavaScriptOrHtmlJson(value)
2787+var _VirtualDom_mapAttribute = F2(function(func, attr)
2789+ return (attr.$ === 'a0')
2790+ ? A2(_VirtualDom_on, attr.n, _VirtualDom_mapHandler(func, attr.o))
2794+function _VirtualDom_mapHandler(func, handler)
2796+ var tag = $elm$virtual_dom$VirtualDom$toHandlerInt(handler);
2799+ // 1 = MayStopPropagation
2800+ // 2 = MayPreventDefault
2807+ ? A2($elm$json$Json$Decode$map, func, handler.a)
2809+ A3($elm$json$Json$Decode$map2,
2811+ ? _VirtualDom_mapEventTuple
2812+ : _VirtualDom_mapEventRecord,
2813+ $elm$json$Json$Decode$succeed(func),
2819+var _VirtualDom_mapEventTuple = F2(function(func, tuple)
2821+ return _Utils_Tuple2(func(tuple.a), tuple.b);
2824+var _VirtualDom_mapEventRecord = F2(function(func, record)
2827+ message: func(record.message),
2828+ stopPropagation: record.stopPropagation,
2829+ preventDefault: record.preventDefault
2838+function _VirtualDom_organizeFacts(factList)
2840+ for (var facts = {}; factList.b; factList = factList.b) // WHILE_CONS
2842+ var entry = factList.a;
2846+ var value = entry.o;
2850+ (key === 'className')
2851+ ? _VirtualDom_addClass(facts, key, _Json_unwrap(value))
2852+ : facts[key] = _Json_unwrap(value);
2857+ var subFacts = facts[tag] || (facts[tag] = {});
2858+ (tag === 'a3' && key === 'class')
2859+ ? _VirtualDom_addClass(subFacts, key, value)
2860+ : subFacts[key] = value;
2866+function _VirtualDom_addClass(object, key, newClass)
2868+ var classes = object[key];
2869+ object[key] = classes ? classes + ' ' + newClass : newClass;
2877+function _VirtualDom_render(vNode, eventNode)
2883+ return _VirtualDom_render(vNode.k || (vNode.k = vNode.m()), eventNode);
2888+ var textEl = _Lynx_createElement('text', 0, {});
2889+ _Lynx_setAttribute(textEl, 'content', vNode.a);
2895+ var subNode = vNode.k;
2896+ var tagger = vNode.j;
2898+ while (subNode.$ === 4)
2900+ typeof tagger !== 'object'
2901+ ? tagger = [tagger, subNode.j]
2902+ : tagger.push(subNode.j);
2904+ subNode = subNode.k;
2907+ var subEventRoot = { j: tagger, p: eventNode };
2908+ var domNode = _VirtualDom_render(subNode, subEventRoot);
2909+ _VirtualDom_getMeta(domNode).elm_event_node_ref = subEventRoot;
2915+ var domNode = vNode.h(vNode.g);
2916+ _VirtualDom_applyFacts(domNode, eventNode, vNode.d);
2920+ // at this point `tag` must be 1 or 2
2922+ var domNode = _Lynx_createElement(vNode.c, 0, {});
2924+ _VirtualDom_applyFacts(domNode, eventNode, vNode.d);
2926+ for (var kids = vNode.e, i = 0; i < kids.length; i++)
2928+ _VirtualDom_appendChild(domNode, _VirtualDom_render(tag === 1 ? kids[i] : kids[i].b, eventNode));
2939+function _VirtualDom_applyFacts(domNode, eventNode, facts)
2941+ for (var key in facts)
2943+ var value = facts[key];
2946+ ? _VirtualDom_applyStyles(domNode, value)
2949+ ? _VirtualDom_applyEvents(domNode, eventNode, value)
2952+ ? _VirtualDom_applyAttrs(domNode, value)
2955+ ? _VirtualDom_applyAttrsNS(domNode, value)
2957+ (key !== 'value' && key !== 'checked' || domNode[key] !== value) && _Lynx_setAttribute(domNode, key === 'className' ? 'class' : key, String(value));
2966+function _VirtualDom_applyStyles(domNode, styles)
2968+ if (_Lynx_setInlineStyles)
2970+ _Lynx_setInlineStyles(domNode, styles);
2974+ for (var key in styles)
2976+ _Lynx_addInlineStyle(domNode, key, styles[key]);
2986+function _VirtualDom_applyAttrs(domNode, attrs)
2988+ for (var key in attrs)
2990+ var value = attrs[key];
2991+ if (typeof value !== 'undefined')
2993+ _Lynx_setAttribute(domNode, key, value);
3000+// APPLY NAMESPACED ATTRS
3003+function _VirtualDom_applyAttrsNS(domNode, nsAttrs)
3005+ for (var key in nsAttrs)
3007+ var pair = nsAttrs[key];
3008+ var value = pair.o;
3010+ if (typeof value !== 'undefined')
3012+ _Lynx_setAttribute(domNode, key, value);
3022+function _VirtualDom_applyEvents(domNode, eventNode, events)
3024+ var meta = _VirtualDom_getMeta(domNode);
3025+ var allCallbacks = meta.elmFs || (meta.elmFs = {});
3027+ for (var key in events)
3029+ var newHandler = events[key];
3030+ var oldCallback = allCallbacks[key];
3034+ allCallbacks[key] = undefined;
3040+ var oldHandler = oldCallback.q;
3041+ if (oldHandler.$ === newHandler.$)
3043+ oldCallback.q = newHandler;
3048+ oldCallback = _VirtualDom_makeCallback(eventNode, newHandler);
3049+ allCallbacks[key] = oldCallback;
3051+ var lynxEventName = _VirtualDom_mapEventName(key);
3052+ var handlerType = $elm$virtual_dom$VirtualDom$toHandlerInt(newHandler);
3053+ var prefix = (handlerType === 1) ? 'catch' : 'bind';
3054+ _Lynx_addEvent(domNode, prefix + lynxEventName, lynxEventName, oldCallback);
3058+function _VirtualDom_mapEventName(name)
3062+ case 'click': return 'tap';
3063+ case 'dblclick': return 'tap';
3064+ case 'mousedown': return 'touchstart';
3065+ case 'mousemove': return 'touchmove';
3066+ case 'mouseup': return 'touchend';
3067+ default: return name;
3080+function _VirtualDom_makeCallback(eventNode, initialHandler)
3082+ function callback(event)
3084+ var handler = callback.q;
3085+ var result = _Json_runHelp(handler.a, event);
3087+ if (!$elm$core$Result$isOk(result))
3092+ var tag = $elm$virtual_dom$VirtualDom$toHandlerInt(handler);
3095+ // 1 = MayStopPropagation
3096+ // 2 = MayPreventDefault
3099+ var value = result.a;
3100+ var message = !tag ? value : tag < 3 ? value.a : value.message;
3101+ var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation;
3102+ var currentEventNode = eventNode;
3105+ while (tagger = currentEventNode.j)
3107+ if (typeof tagger == 'function')
3109+ message = tagger(message);
3113+ for (var i = tagger.length; i--; )
3115+ message = tagger[i](message);
3118+ currentEventNode = currentEventNode.p;
3120+ currentEventNode(message, stopPropagation); // stopPropagation implies isSync
3123+ callback.q = initialHandler;
3128+function _VirtualDom_equalEvents(x, y)
3130+ return x.$ == y.$ && _Json_equality(x.a, y.a);
3138+// TODO: Should we do patches like in iOS?
3142+// | Batch (List Patch)
3145+// How could it not be better?
3147+function _VirtualDom_diff(x, y)
3150+ _VirtualDom_diffHelp(x, y, patches, 0);
3155+function _VirtualDom_pushPatch(patches, type, index, data)
3164+ patches.push(patch);
3169+function _VirtualDom_diffHelp(x, y, patches, index)
3179+ // Bail if you run into different types of nodes. Implies that the
3180+ // structure has changed significantly and it's not worth a diff.
3181+ if (xType !== yType)
3183+ if (xType === 1 && yType === 2)
3185+ y = _VirtualDom_dekey(y);
3190+ _VirtualDom_pushPatch(patches, 0, index, y);
3195+ // Now we know that both nodes are the same $.
3201+ var i = xRefs.length;
3202+ var same = i === yRefs.length;
3203+ while (same && i--)
3205+ same = xRefs[i] === yRefs[i];
3213+ var subPatches = [];
3214+ _VirtualDom_diffHelp(x.k, y.k, subPatches, 0);
3215+ subPatches.length > 0 && _VirtualDom_pushPatch(patches, 1, index, subPatches);
3219+ // gather nested taggers
3220+ var xTaggers = x.j;
3221+ var yTaggers = y.j;
3222+ var nesting = false;
3224+ var xSubNode = x.k;
3225+ while (xSubNode.$ === 4)
3229+ typeof xTaggers !== 'object'
3230+ ? xTaggers = [xTaggers, xSubNode.j]
3231+ : xTaggers.push(xSubNode.j);
3233+ xSubNode = xSubNode.k;
3236+ var ySubNode = y.k;
3237+ while (ySubNode.$ === 4)
3241+ typeof yTaggers !== 'object'
3242+ ? yTaggers = [yTaggers, ySubNode.j]
3243+ : yTaggers.push(ySubNode.j);
3245+ ySubNode = ySubNode.k;
3248+ // Just bail if different numbers of taggers. This implies the
3249+ // structure of the virtual DOM has changed.
3250+ if (nesting && xTaggers.length !== yTaggers.length)
3252+ _VirtualDom_pushPatch(patches, 0, index, y);
3256+ // check if taggers are "the same"
3257+ if (nesting ? !_VirtualDom_pairwiseRefEqual(xTaggers, yTaggers) : xTaggers !== yTaggers)
3259+ _VirtualDom_pushPatch(patches, 2, index, yTaggers);
3262+ // diff everything below the taggers
3263+ _VirtualDom_diffHelp(xSubNode, ySubNode, patches, index + 1);
3269+ _VirtualDom_pushPatch(patches, 3, index, y.a);
3274+ _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKids);
3278+ _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKeyedKids);
3284+ _VirtualDom_pushPatch(patches, 0, index, y);
3288+ var factsDiff = _VirtualDom_diffFacts(x.d, y.d);
3289+ factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff);
3291+ var patch = y.i(x.g, y.g);
3292+ patch && _VirtualDom_pushPatch(patches, 5, index, patch);
3298+// assumes the incoming arrays are the same length
3299+function _VirtualDom_pairwiseRefEqual(as, bs)
3301+ for (var i = 0; i < as.length; i++)
3303+ if (as[i] !== bs[i])
3312+function _VirtualDom_diffNodes(x, y, patches, index, diffKids)
3314+ // Bail if obvious indicators have changed. Implies more serious
3315+ // structural changes such that it's not worth it to diff.
3316+ if (x.c !== y.c || x.f !== y.f)
3318+ _VirtualDom_pushPatch(patches, 0, index, y);
3322+ var factsDiff = _VirtualDom_diffFacts(x.d, y.d);
3323+ factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff);
3325+ diffKids(x, y, patches, index);
3333+// TODO Instead of creating a new diff object, it's possible to just test if
3334+// there *is* a diff. During the actual patch, do the diff again and make the
3335+// modifications directly. This way, there's no new allocations. Worth it?
3336+function _VirtualDom_diffFacts(x, y, category)
3340+ // look for changes and removals
3341+ for (var xKey in x)
3343+ if (xKey === 'a1' || xKey === 'a0' || xKey === 'a3' || xKey === 'a4')
3345+ var subDiff = _VirtualDom_diffFacts(x[xKey], y[xKey] || {}, xKey);
3349+ diff[xKey] = subDiff;
3354+ // remove if not in the new facts
3360+ ? (typeof x[xKey] === 'string' ? '' : null)
3362+ (category === 'a1')
3365+ (category === 'a0' || category === 'a3')
3368+ { f: x[xKey].f, o: undefined };
3373+ var xValue = x[xKey];
3374+ var yValue = y[xKey];
3376+ // reference equal, so don't worry about it
3377+ if (xValue === yValue && xKey !== 'value' && xKey !== 'checked'
3378+ || category === 'a0' && _VirtualDom_equalEvents(xValue, yValue))
3384+ diff[xKey] = yValue;
3388+ for (var yKey in y)
3393+ diff[yKey] = y[yKey];
3405+function _VirtualDom_diffKids(xParent, yParent, patches, index)
3407+ var xKids = xParent.e;
3408+ var yKids = yParent.e;
3410+ var xLen = xKids.length;
3411+ var yLen = yKids.length;
3413+ // FIGURE OUT IF THERE ARE INSERTS OR REMOVALS
3417+ _VirtualDom_pushPatch(patches, 6, index, {
3422+ else if (xLen < yLen)
3424+ _VirtualDom_pushPatch(patches, 7, index, {
3430+ // PAIRWISE DIFF EVERYTHING ELSE
3432+ for (var minLen = xLen < yLen ? xLen : yLen, i = 0; i < minLen; i++)
3434+ var xKid = xKids[i];
3435+ _VirtualDom_diffHelp(xKid, yKids[i], patches, ++index);
3436+ index += xKid.b || 0;
3445+function _VirtualDom_diffKeyedKids(xParent, yParent, patches, rootIndex)
3447+ var localPatches = [];
3449+ var changes = {}; // Dict String Entry
3450+ var inserts = []; // Array { index : Int, entry : Entry }
3451+ // type Entry = { tag : String, vnode : VNode, index : Int, data : _ }
3453+ var xKids = xParent.e;
3454+ var yKids = yParent.e;
3455+ var xLen = xKids.length;
3456+ var yLen = yKids.length;
3460+ var index = rootIndex;
3462+ while (xIndex < xLen && yIndex < yLen)
3464+ var x = xKids[xIndex];
3465+ var y = yKids[yIndex];
3472+ var newMatch = undefined;
3473+ var oldMatch = undefined;
3475+ // check if keys match
3480+ _VirtualDom_diffHelp(xNode, yNode, localPatches, index);
3481+ index += xNode.b || 0;
3488+ // look ahead 1 to detect insertions and removals.
3490+ var xNext = xKids[xIndex + 1];
3491+ var yNext = yKids[yIndex + 1];
3495+ var xNextKey = xNext.a;
3496+ var xNextNode = xNext.b;
3497+ oldMatch = yKey === xNextKey;
3502+ var yNextKey = yNext.a;
3503+ var yNextNode = yNext.b;
3504+ newMatch = xKey === yNextKey;
3509+ if (newMatch && oldMatch)
3512+ _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index);
3513+ _VirtualDom_insertNode(changes, localPatches, xKey, yNode, yIndex, inserts);
3514+ index += xNode.b || 0;
3517+ _VirtualDom_removeNode(changes, localPatches, xKey, xNextNode, index);
3518+ index += xNextNode.b || 0;
3529+ _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts);
3530+ _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index);
3531+ index += xNode.b || 0;
3542+ _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index);
3543+ index += xNode.b || 0;
3546+ _VirtualDom_diffHelp(xNextNode, yNode, localPatches, index);
3547+ index += xNextNode.b || 0;
3554+ // remove x, insert y
3555+ if (xNext && xNextKey === yNextKey)
3558+ _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index);
3559+ _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts);
3560+ index += xNode.b || 0;
3563+ _VirtualDom_diffHelp(xNextNode, yNextNode, localPatches, index);
3564+ index += xNextNode.b || 0;
3574+ // eat up any remaining nodes with removeNode and insertNode
3576+ while (xIndex < xLen)
3579+ var x = xKids[xIndex];
3581+ _VirtualDom_removeNode(changes, localPatches, x.a, xNode, index);
3582+ index += xNode.b || 0;
3586+ while (yIndex < yLen)
3588+ var endInserts = endInserts || [];
3589+ var y = yKids[yIndex];
3590+ _VirtualDom_insertNode(changes, localPatches, y.a, y.b, undefined, endInserts);
3594+ if (localPatches.length > 0 || inserts.length > 0 || endInserts)
3596+ _VirtualDom_pushPatch(patches, 8, rootIndex, {
3606+// CHANGES FROM KEYED DIFF
3609+var _VirtualDom_POSTFIX = '_elmW6BL';
3612+function _VirtualDom_insertNode(changes, localPatches, key, vnode, yIndex, inserts)
3614+ var entry = changes[key];
3616+ // never seen this key before
3626+ inserts.push({ r: yIndex, A: entry });
3627+ changes[key] = entry;
3632+ // this key was removed earlier, a match!
3635+ inserts.push({ r: yIndex, A: entry });
3638+ var subPatches = [];
3639+ _VirtualDom_diffHelp(entry.z, vnode, subPatches, entry.r);
3649+ // this key has already been inserted or moved, a duplicate!
3650+ _VirtualDom_insertNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, yIndex, inserts);
3654+function _VirtualDom_removeNode(changes, localPatches, key, vnode, index)
3656+ var entry = changes[key];
3658+ // never seen this key before
3661+ var patch = _VirtualDom_pushPatch(localPatches, 9, index, undefined);
3673+ // this key was inserted earlier, a match!
3677+ var subPatches = [];
3678+ _VirtualDom_diffHelp(vnode, entry.z, subPatches, index);
3680+ _VirtualDom_pushPatch(localPatches, 9, index, {
3688+ // this key has already been removed or moved, a duplicate!
3689+ _VirtualDom_removeNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, index);
3696+// Each DOM node has an "index" assigned in order of traversal. It is important
3697+// to minimize our crawl over the actual DOM, so these indexes (along with the
3698+// descendantsCount of virtual nodes) let us skip touching entire subtrees of
3699+// the DOM if we know there are no patches there.
3702+function _VirtualDom_addDomNodes(domNode, vNode, patches, eventNode)
3704+ _VirtualDom_addDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.b, eventNode);
3708+// assumes `patches` is non-empty and indexes increase monotonically.
3709+function _VirtualDom_addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode)
3711+ var patch = patches[i];
3712+ var index = patch.r;
3714+ while (index === low)
3716+ var patchType = patch.$;
3718+ if (patchType === 1)
3720+ _VirtualDom_addDomNodes(domNode, vNode.k, patch.s, eventNode);
3722+ else if (patchType === 8)
3725+ patch.u = eventNode;
3727+ var subPatches = patch.s.w;
3728+ if (subPatches.length > 0)
3730+ _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);
3733+ else if (patchType === 9)
3736+ patch.u = eventNode;
3738+ var data = patch.s;
3741+ data.A.s = domNode;
3742+ var subPatches = data.w;
3743+ if (subPatches.length > 0)
3745+ _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);
3752+ patch.u = eventNode;
3757+ if (!(patch = patches[i]) || (index = patch.r) > high)
3767+ var subNode = vNode.k;
3769+ while (subNode.$ === 4)
3771+ subNode = subNode.k;
3774+ return _VirtualDom_addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, _VirtualDom_getMeta(domNode).elm_event_node_ref);
3777+ // tag must be 1 or 2 at this point
3779+ var vKids = vNode.e;
3780+ var childNodes = _Lynx_getChildren(domNode);
3781+ for (var j = 0; j < vKids.length; j++)
3784+ var vKid = tag === 1 ? vKids[j] : vKids[j].b;
3785+ var nextLow = low + (vKid.b || 0);
3786+ if (low <= index && index <= nextLow)
3788+ i = _VirtualDom_addDomNodesHelp(childNodes[j], vKid, patches, i, low, nextLow, eventNode);
3789+ if (!(patch = patches[i]) || (index = patch.r) > high)
3804+function _VirtualDom_applyPatches(rootDomNode, oldVirtualNode, patches, eventNode)
3806+ if (patches.length === 0)
3808+ return rootDomNode;
3811+ _VirtualDom_addDomNodes(rootDomNode, oldVirtualNode, patches, eventNode);
3812+ return _VirtualDom_applyPatchesHelp(rootDomNode, patches);
3815+function _VirtualDom_applyPatchesHelp(rootDomNode, patches)
3817+ for (var i = 0; i < patches.length; i++)
3819+ var patch = patches[i];
3820+ var localDomNode = patch.t
3821+ var newNode = _VirtualDom_applyPatch(localDomNode, patch);
3822+ if (localDomNode === rootDomNode)
3824+ rootDomNode = newNode;
3827+ return rootDomNode;
3830+function _VirtualDom_applyPatch(domNode, patch)
3835+ return _VirtualDom_applyPatchRedraw(domNode, patch.s, patch.u);
3838+ _VirtualDom_applyFacts(domNode, patch.u, patch.s);
3842+ _Lynx_setAttribute(domNode, 'content', patch.s);
3846+ return _VirtualDom_applyPatchesHelp(domNode, patch.s);
3849+ if (_VirtualDom_getMeta(domNode).elm_event_node_ref)
3851+ _VirtualDom_getMeta(domNode).elm_event_node_ref.j = patch.s;
3855+ _VirtualDom_getMeta(domNode).elm_event_node_ref = { j: patch.s, p: patch.u };
3860+ var data = patch.s;
3861+ for (var i = 0; i < data.i; i++)
3863+ var children = _Lynx_getChildren(domNode);
3864+ _Lynx_removeElement(domNode, children[data.v]);
3869+ var data = patch.s;
3871+ for (var i = data.v; i < kids.length; i++)
3873+ _Lynx_appendChild(domNode, _VirtualDom_render(kids[i], patch.u));
3878+ var data = patch.s;
3881+ _Lynx_removeElement(_Lynx_getParent(domNode), domNode);
3884+ var entry = data.A;
3885+ if (typeof entry.r !== 'undefined')
3887+ _Lynx_removeElement(_Lynx_getParent(domNode), domNode);
3889+ entry.s = _VirtualDom_applyPatchesHelp(domNode, data.w);
3893+ return _VirtualDom_applyPatchReorder(domNode, patch);
3896+ return patch.s(domNode);
3899+ _Debug_crash(10); // 'Ran into an unknown patch!'
3904+function _VirtualDom_applyPatchRedraw(domNode, vNode, eventNode)
3906+ var parentNode = _Lynx_getParent(domNode);
3907+ var newNode = _VirtualDom_render(vNode, eventNode);
3909+ if (!_VirtualDom_getMeta(newNode).elm_event_node_ref)
3911+ _VirtualDom_getMeta(newNode).elm_event_node_ref = _VirtualDom_getMeta(domNode).elm_event_node_ref;
3914+ if (parentNode && newNode !== domNode)
3916+ _Lynx_replaceElement(parentNode, newNode, domNode);
3922+function _VirtualDom_applyPatchReorder(domNode, patch)
3924+ var data = patch.s;
3926+ // remove end inserts
3927+ var endInsertNodes = _VirtualDom_applyPatchReorderEndInsertsHelp(data.y, patch);
3930+ domNode = _VirtualDom_applyPatchesHelp(domNode, data.w);
3933+ var inserts = data.x;
3934+ for (var i = 0; i < inserts.length; i++)
3936+ var insert = inserts[i];
3937+ var entry = insert.A;
3938+ var node = entry.c === 2
3940+ : _VirtualDom_render(entry.z, patch.u);
3941+ var children = _Lynx_getChildren(domNode);
3942+ _Lynx_insertBefore(domNode, node, children[insert.r]);
3946+ if (endInsertNodes)
3948+ for (var i = 0; i < endInsertNodes.length; i++)
3950+ _Lynx_appendChild(domNode, endInsertNodes[i]);
3958+function _VirtualDom_applyPatchReorderEndInsertsHelp(endInserts, patch)
3966+ for (var i = 0; i < endInserts.length; i++)
3968+ var insert = endInserts[i];
3969+ var entry = insert.A;
3970+ nodes.push(entry.c === 2
3972+ : _VirtualDom_render(entry.z, patch.u)
3979+function _VirtualDom_dekey(keyedNode)
3981+ var keyedKids = keyedNode.e;
3982+ var len = keyedKids.length;
3983+ var kids = new Array(len);
3984+ for (var i = 0; i < len; i++)
3986+ kids[i] = keyedKids[i].b;
4001+// LYNXJS PAPI WRAPPERS
4002+var _Browser_lynx = (typeof globalThis !== 'undefined' ? globalThis : scope);
4003+var _Browser_createPage = _Browser_lynx['_' + '_CreatePage'] || function() { return {}; };
4010+var _Debugger_element;
4012+var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args)
4014+ return _Platform_initialize(
4019+ impl.subscriptions,
4020+ function(sendToApp, initialModel) {
4021+ var view = impl.view;
4022+ var domNode = args['node'] || _Browser_createPage();
4023+ var currNode = view(initialModel);
4024+ var currDomNode = _VirtualDom_render(currNode, sendToApp);
4025+ _VirtualDom_appendChild(domNode, currDomNode);
4027+ return _Browser_makeAnimator(initialModel, function(model)
4029+ var nextNode = view(model);
4030+ var patches = _VirtualDom_diff(currNode, nextNode);
4031+ currDomNode = _VirtualDom_applyPatches(currDomNode, currNode, patches, sendToApp);
4032+ currNode = nextNode;
4043+var _Debugger_document;
4045+var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args)
4047+ return _Platform_initialize(
4052+ impl.subscriptions,
4053+ function(sendToApp, initialModel) {
4054+ var view = impl.view;
4055+ var rootNode = args['node'] || _Browser_createPage();
4056+ var doc = view(initialModel);
4057+ var currNode = _VirtualDom_node('view')(_List_Nil)(doc.body);
4058+ var currDomNode = _VirtualDom_render(currNode, sendToApp);
4059+ _VirtualDom_appendChild(rootNode, currDomNode);
4061+ return _Browser_makeAnimator(initialModel, function(model)
4063+ var doc = view(model);
4064+ var nextNode = _VirtualDom_node('view')(_List_Nil)(doc.body);
4065+ var patches = _VirtualDom_diff(currNode, nextNode);
4066+ currDomNode = _VirtualDom_applyPatches(currDomNode, currNode, patches, sendToApp);
4067+ currNode = nextNode;
4078+var _Browser_cancelAnimationFrame =
4079+ function(id) { clearTimeout(id); };
4081+var _Browser_requestAnimationFrame =
4082+ function(callback) { return setTimeout(callback, 1000 / 60); };
4085+function _Browser_makeAnimator(model, draw)
4091+ function updateIfNeeded()
4093+ state = state === 1
4095+ : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 );
4098+ return function(nextModel, isSync)
4104+ state === 2 && (state = 1)
4106+ : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded),
4117+function _Browser_application(impl)
4119+ return _Browser_document({
4120+ init: function(flags)
4122+ return A3(impl.init, flags, _Browser_fakeUrl(), {});
4125+ update: impl.update,
4126+ subscriptions: impl.subscriptions
4130+function _Browser_fakeUrl()
4133+ protocol: { $: 0 },
4144+var _Browser_go = F2(function(key, n)
4146+ return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() {
4152+var _Browser_pushUrl = F2(function(key, url)
4154+ return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() {
4160+var _Browser_replaceUrl = F2(function(key, url)
4162+ return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() {
4173+var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} };
4174+var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode;
4175+var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode;
4177+var _Browser_on = F3(function(node, eventName, sendToSelf)
4179+ return _Scheduler_spawn(_Scheduler_binding(function(callback)
4181+ return function() {};
4185+var _Browser_decodeEvent = F2(function(decoder, event)
4187+ var result = _Json_runHelp(decoder, event);
4188+ return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing;
4196+function _Browser_visibilityInfo()
4198+ return (typeof _VirtualDom_doc.hidden !== 'undefined')
4199+ ? { hidden: 'hidden', change: 'visibilitychange' }
4201+ (typeof _VirtualDom_doc.mozHidden !== 'undefined')
4202+ ? { hidden: 'mozHidden', change: 'mozvisibilitychange' }
4204+ (typeof _VirtualDom_doc.msHidden !== 'undefined')
4205+ ? { hidden: 'msHidden', change: 'msvisibilitychange' }
4207+ (typeof _VirtualDom_doc.webkitHidden !== 'undefined')
4208+ ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' }
4209+ : { hidden: 'hidden', change: 'visibilitychange' };
4217+function _Browser_rAF()
4219+ return _Scheduler_binding(function(callback)
4221+ var id = _Browser_requestAnimationFrame(function() {
4222+ callback(_Scheduler_succeed(Date.now()));
4225+ return function() {
4226+ _Browser_cancelAnimationFrame(id);
4232+function _Browser_now()
4234+ return _Scheduler_binding(function(callback)
4236+ callback(_Scheduler_succeed(Date.now()));
4245+function _Browser_withNode(id, doStuff)
4247+ return _Scheduler_binding(function(callback)
4249+ callback(_Scheduler_fail($elm$browser$Browser$Dom$NotFound(id)));
4254+function _Browser_withWindow(doStuff)
4256+ return _Scheduler_binding(function(callback)
4258+ _Browser_requestAnimationFrame(function() {
4259+ callback(_Scheduler_succeed(doStuff()));
4268+var _Browser_call = F2(function(functionName, id)
4270+ return _Browser_withNode(id, function(node) {
4271+ node[functionName]();
4272+ return _Utils_Tuple0;
4281+function _Browser_getViewport()
4284+ scene: _Browser_getScene(),
4286+ x: _Browser_window.pageXOffset,
4287+ y: _Browser_window.pageYOffset,
4288+ width: _Browser_doc.documentElement.clientWidth,
4289+ height: _Browser_doc.documentElement.clientHeight
4294+function _Browser_getScene()
4296+ var body = _Browser_doc.body;
4297+ var elem = _Browser_doc.documentElement;
4299+ width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth),
4300+ height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight)
4304+var _Browser_setViewport = F2(function(x, y)
4306+ return _Browser_withWindow(function()
4308+ _Browser_window.scroll(x, y);
4309+ return _Utils_Tuple0;
4318+function _Browser_getViewportOf(id)
4320+ return _Browser_withNode(id, function(node)
4324+ width: node.scrollWidth,
4325+ height: node.scrollHeight
4328+ x: node.scrollLeft,
4330+ width: node.clientWidth,
4331+ height: node.clientHeight
4338+var _Browser_setViewportOf = F3(function(id, x, y)
4340+ return _Browser_withNode(id, function(node)
4342+ node.scrollLeft = x;
4343+ node.scrollTop = y;
4344+ return _Utils_Tuple0;
4353+function _Browser_getElement(id)
4355+ return _Browser_withNode(id, function(node)
4357+ var rect = node.getBoundingClientRect();
4358+ var x = _Browser_window.pageXOffset;
4359+ var y = _Browser_window.pageYOffset;
4361+ scene: _Browser_getScene(),
4365+ width: _Browser_doc.documentElement.clientWidth,
4366+ height: _Browser_doc.documentElement.clientHeight
4372+ height: rect.height
4383+function _Browser_reload(skipCache)
4385+ return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback)
4391+function _Browser_load(url)
4393+ return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback)
4401+ // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here.
4402+ // Other browsers reload the page, so let's be consistent about that.
4407+var $author$project$Main$init = {count: 0};
4408+var $elm$core$List$cons = _List_cons;
4409+var $elm$core$Elm$JsArray$foldr = _JsArray_foldr;
4410+var $elm$core$Array$foldr = F3(
4411+ function (func, baseCase, _v0) {
4415+ function (node, acc) {
4416+ if (node.$ === 'SubTree') {
4417+ var subTree = node.a;
4418+ return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree);
4420+ var values = node.a;
4421+ return A3($elm$core$Elm$JsArray$foldr, func, acc, values);
4425+ $elm$core$Elm$JsArray$foldr,
4427+ A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail),
4430+var $elm$core$Array$toList = function (array) {
4431+ return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array);
4433+var $elm$core$Dict$foldr = F3(
4434+ function (func, acc, t) {
4437+ if (t.$ === 'RBEmpty_elm_builtin') {
4444+ var $temp$func = func,
4449+ A3($elm$core$Dict$foldr, func, acc, right)),
4458+var $elm$core$Dict$toList = function (dict) {
4460+ $elm$core$Dict$foldr,
4462+ function (key, value, list) {
4464+ $elm$core$List$cons,
4465+ _Utils_Tuple2(key, value),
4471+var $elm$core$Dict$keys = function (dict) {
4473+ $elm$core$Dict$foldr,
4475+ function (key, value, keyList) {
4476+ return A2($elm$core$List$cons, key, keyList);
4481+var $elm$core$Set$toList = function (_v0) {
4483+ return $elm$core$Dict$keys(dict);
4485+var $elm$core$Basics$EQ = {$: 'EQ'};
4486+var $elm$core$Basics$GT = {$: 'GT'};
4487+var $elm$core$Basics$LT = {$: 'LT'};
4488+var $elm$core$Result$Err = function (a) {
4489+ return {$: 'Err', a: a};
4491+var $elm$json$Json$Decode$Failure = F2(
4493+ return {$: 'Failure', a: a, b: b};
4495+var $elm$json$Json$Decode$Field = F2(
4497+ return {$: 'Field', a: a, b: b};
4499+var $elm$json$Json$Decode$Index = F2(
4501+ return {$: 'Index', a: a, b: b};
4503+var $elm$core$Result$Ok = function (a) {
4504+ return {$: 'Ok', a: a};
4506+var $elm$json$Json$Decode$OneOf = function (a) {
4507+ return {$: 'OneOf', a: a};
4509+var $elm$core$Basics$False = {$: 'False'};
4510+var $elm$core$Basics$add = _Basics_add;
4511+var $elm$core$Maybe$Just = function (a) {
4512+ return {$: 'Just', a: a};
4514+var $elm$core$Maybe$Nothing = {$: 'Nothing'};
4515+var $elm$core$String$all = _String_all;
4516+var $elm$core$Basics$and = _Basics_and;
4517+var $elm$core$Basics$append = _Utils_append;
4518+var $elm$json$Json$Encode$encode = _Json_encode;
4519+var $elm$core$String$fromInt = _String_fromNumber;
4520+var $elm$core$String$join = F2(
4521+ function (sep, chunks) {
4525+ _List_toArray(chunks));
4527+var $elm$core$String$split = F2(
4528+ function (sep, string) {
4529+ return _List_fromArray(
4530+ A2(_String_split, sep, string));
4532+var $elm$json$Json$Decode$indent = function (str) {
4534+ $elm$core$String$join,
4536+ A2($elm$core$String$split, '\n', str));
4538+var $elm$core$List$foldl = F3(
4539+ function (func, acc, list) {
4547+ var $temp$func = func,
4548+ $temp$acc = A2(func, x, acc),
4557+var $elm$core$List$length = function (xs) {
4559+ $elm$core$List$foldl,
4561+ function (_v0, i) {
4567+var $elm$core$List$map2 = _List_map2;
4568+var $elm$core$Basics$le = _Utils_le;
4569+var $elm$core$Basics$sub = _Basics_sub;
4570+var $elm$core$List$rangeHelp = F3(
4571+ function (lo, hi, list) {
4574+ if (_Utils_cmp(lo, hi) < 1) {
4577+ $temp$list = A2($elm$core$List$cons, hi, list);
4581+ continue rangeHelp;
4587+var $elm$core$List$range = F2(
4588+ function (lo, hi) {
4589+ return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil);
4591+var $elm$core$List$indexedMap = F2(
4594+ $elm$core$List$map2,
4597+ $elm$core$List$range,
4599+ $elm$core$List$length(xs) - 1),
4602+var $elm$core$Char$toCode = _Char_toCode;
4603+var $elm$core$Char$isLower = function (_char) {
4604+ var code = $elm$core$Char$toCode(_char);
4605+ return (97 <= code) && (code <= 122);
4607+var $elm$core$Char$isUpper = function (_char) {
4608+ var code = $elm$core$Char$toCode(_char);
4609+ return (code <= 90) && (65 <= code);
4611+var $elm$core$Basics$or = _Basics_or;
4612+var $elm$core$Char$isAlpha = function (_char) {
4613+ return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char);
4615+var $elm$core$Char$isDigit = function (_char) {
4616+ var code = $elm$core$Char$toCode(_char);
4617+ return (code <= 57) && (48 <= code);
4619+var $elm$core$Char$isAlphaNum = function (_char) {
4620+ return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char));
4622+var $elm$core$List$reverse = function (list) {
4623+ return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list);
4625+var $elm$core$String$uncons = _String_uncons;
4626+var $elm$json$Json$Decode$errorOneOf = F2(
4627+ function (i, error) {
4628+ return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent(
4629+ $elm$json$Json$Decode$errorToString(error))));
4631+var $elm$json$Json$Decode$errorToString = function (error) {
4632+ return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil);
4634+var $elm$json$Json$Decode$errorToStringHelp = F2(
4635+ function (error, context) {
4642+ var isSimple = function () {
4643+ var _v1 = $elm$core$String$uncons(f);
4644+ if (_v1.$ === 'Nothing') {
4650+ return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest);
4653+ var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']'));
4654+ var $temp$error = err,
4655+ $temp$context = A2($elm$core$List$cons, fieldName, context);
4656+ error = $temp$error;
4657+ context = $temp$context;
4658+ continue errorToStringHelp;
4662+ var indexName = '[' + ($elm$core$String$fromInt(i) + ']');
4663+ var $temp$error = err,
4664+ $temp$context = A2($elm$core$List$cons, indexName, context);
4665+ error = $temp$error;
4666+ context = $temp$context;
4667+ continue errorToStringHelp;
4669+ var errors = error.a;
4671+ return 'Ran into a Json.Decode.oneOf with no possibilities' + function () {
4675+ return ' at json' + A2(
4676+ $elm$core$String$join,
4678+ $elm$core$List$reverse(context));
4683+ var err = errors.a;
4684+ var $temp$error = err,
4685+ $temp$context = context;
4686+ error = $temp$error;
4687+ context = $temp$context;
4688+ continue errorToStringHelp;
4690+ var starter = function () {
4692+ return 'Json.Decode.oneOf';
4694+ return 'The Json.Decode.oneOf at json' + A2(
4695+ $elm$core$String$join,
4697+ $elm$core$List$reverse(context));
4700+ var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt(
4701+ $elm$core$List$length(errors)) + ' ways:'));
4703+ $elm$core$String$join,
4706+ $elm$core$List$cons,
4708+ A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors)));
4713+ var json = error.b;
4714+ var introduction = function () {
4716+ return 'Problem with the given value:\n\n';
4718+ return 'Problem with the value at json' + (A2(
4719+ $elm$core$String$join,
4721+ $elm$core$List$reverse(context)) + ':\n\n ');
4724+ return introduction + ($elm$json$Json$Decode$indent(
4725+ A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg));
4729+var $elm$core$Array$branchFactor = 32;
4730+var $elm$core$Array$Array_elm_builtin = F4(
4731+ function (a, b, c, d) {
4732+ return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d};
4734+var $elm$core$Elm$JsArray$empty = _JsArray_empty;
4735+var $elm$core$Basics$ceiling = _Basics_ceiling;
4736+var $elm$core$Basics$fdiv = _Basics_fdiv;
4737+var $elm$core$Basics$logBase = F2(
4738+ function (base, number) {
4739+ return _Basics_log(number) / _Basics_log(base);
4741+var $elm$core$Basics$toFloat = _Basics_toFloat;
4742+var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling(
4743+ A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor));
4744+var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty);
4745+var $elm$core$Elm$JsArray$initialize = _JsArray_initialize;
4746+var $elm$core$Array$Leaf = function (a) {
4747+ return {$: 'Leaf', a: a};
4749+var $elm$core$Basics$apL = F2(
4753+var $elm$core$Basics$apR = F2(
4757+var $elm$core$Basics$eq = _Utils_equal;
4758+var $elm$core$Basics$floor = _Basics_floor;
4759+var $elm$core$Elm$JsArray$length = _JsArray_length;
4760+var $elm$core$Basics$gt = _Utils_gt;
4761+var $elm$core$Basics$max = F2(
4763+ return (_Utils_cmp(x, y) > 0) ? x : y;
4765+var $elm$core$Basics$mul = _Basics_mul;
4766+var $elm$core$Array$SubTree = function (a) {
4767+ return {$: 'SubTree', a: a};
4769+var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList;
4770+var $elm$core$Array$compressNodes = F2(
4771+ function (nodes, acc) {
4774+ var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes);
4776+ var remainingNodes = _v0.b;
4778+ $elm$core$List$cons,
4779+ $elm$core$Array$SubTree(node),
4781+ if (!remainingNodes.b) {
4782+ return $elm$core$List$reverse(newAcc);
4784+ var $temp$nodes = remainingNodes,
4785+ $temp$acc = newAcc;
4786+ nodes = $temp$nodes;
4788+ continue compressNodes;
4792+var $elm$core$Tuple$first = function (_v0) {
4796+var $elm$core$Array$treeFromBuilder = F2(
4797+ function (nodeList, nodeListSize) {
4800+ var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor);
4801+ if (newNodeSize === 1) {
4802+ return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a;
4804+ var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil),
4805+ $temp$nodeListSize = newNodeSize;
4806+ nodeList = $temp$nodeList;
4807+ nodeListSize = $temp$nodeListSize;
4808+ continue treeFromBuilder;
4812+var $elm$core$Array$builderToArray = F2(
4813+ function (reverseNodeList, builder) {
4814+ if (!builder.nodeListSize) {
4816+ $elm$core$Array$Array_elm_builtin,
4817+ $elm$core$Elm$JsArray$length(builder.tail),
4818+ $elm$core$Array$shiftStep,
4819+ $elm$core$Elm$JsArray$empty,
4822+ var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor;
4823+ var depth = $elm$core$Basics$floor(
4824+ A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1));
4825+ var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList;
4826+ var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize);
4828+ $elm$core$Array$Array_elm_builtin,
4829+ $elm$core$Elm$JsArray$length(builder.tail) + treeLen,
4830+ A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep),
4835+var $elm$core$Basics$idiv = _Basics_idiv;
4836+var $elm$core$Basics$lt = _Utils_lt;
4837+var $elm$core$Array$initializeHelp = F5(
4838+ function (fn, fromIndex, len, nodeList, tail) {
4841+ if (fromIndex < 0) {
4843+ $elm$core$Array$builderToArray,
4845+ {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail});
4847+ var leaf = $elm$core$Array$Leaf(
4848+ A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn));
4850+ $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor,
4852+ $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList),
4855+ fromIndex = $temp$fromIndex;
4857+ nodeList = $temp$nodeList;
4859+ continue initializeHelp;
4863+var $elm$core$Basics$remainderBy = _Basics_remainderBy;
4864+var $elm$core$Array$initialize = F2(
4865+ function (len, fn) {
4867+ return $elm$core$Array$empty;
4869+ var tailLen = len % $elm$core$Array$branchFactor;
4870+ var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn);
4871+ var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor;
4872+ return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail);
4875+var $elm$core$Basics$True = {$: 'True'};
4876+var $elm$core$Result$isOk = function (result) {
4877+ if (result.$ === 'Ok') {
4883+var $elm$json$Json$Decode$map = _Json_map1;
4884+var $elm$json$Json$Decode$map2 = _Json_map2;
4885+var $elm$json$Json$Decode$succeed = _Json_succeed;
4886+var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) {
4887+ switch (handler.$) {
4890+ case 'MayStopPropagation':
4892+ case 'MayPreventDefault':
4898+var $elm$core$Basics$identity = function (x) {
4901+var $elm$browser$Browser$Dom$NotFound = function (a) {
4902+ return {$: 'NotFound', a: a};
4904+var $elm$core$Basics$never = function (_v0) {
4908+ var $temp$_v0 = nvr;
4913+var $elm$core$Task$Perform = function (a) {
4914+ return {$: 'Perform', a: a};
4916+var $elm$core$Task$succeed = _Scheduler_succeed;
4917+var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0);
4918+var $elm$core$List$foldrHelper = F4(
4919+ function (fn, acc, ctr, ls) {
4926+ return A2(fn, a, acc);
4949+ var res = (ctr > 500) ? A3(
4950+ $elm$core$List$foldl,
4953+ $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4);
4969+var $elm$core$List$foldr = F3(
4970+ function (fn, acc, ls) {
4971+ return A4($elm$core$List$foldrHelper, fn, acc, 0, ls);
4973+var $elm$core$List$map = F2(
4976+ $elm$core$List$foldr,
4978+ function (x, acc) {
4980+ $elm$core$List$cons,
4987+var $elm$core$Task$andThen = _Scheduler_andThen;
4988+var $elm$core$Task$map = F2(
4989+ function (func, taskA) {
4991+ $elm$core$Task$andThen,
4993+ return $elm$core$Task$succeed(
4998+var $elm$core$Task$map2 = F3(
4999+ function (func, taskA, taskB) {
5001+ $elm$core$Task$andThen,
5004+ $elm$core$Task$andThen,
5006+ return $elm$core$Task$succeed(
5013+var $elm$core$Task$sequence = function (tasks) {
5015+ $elm$core$List$foldr,
5016+ $elm$core$Task$map2($elm$core$List$cons),
5017+ $elm$core$Task$succeed(_List_Nil),
5020+var $elm$core$Platform$sendToApp = _Platform_sendToApp;
5021+var $elm$core$Task$spawnCmd = F2(
5022+ function (router, _v0) {
5024+ return _Scheduler_spawn(
5026+ $elm$core$Task$andThen,
5027+ $elm$core$Platform$sendToApp(router),
5030+var $elm$core$Task$onEffects = F3(
5031+ function (router, commands, state) {
5033+ $elm$core$Task$map,
5035+ return _Utils_Tuple0;
5037+ $elm$core$Task$sequence(
5039+ $elm$core$List$map,
5040+ $elm$core$Task$spawnCmd(router),
5043+var $elm$core$Task$onSelfMsg = F3(
5044+ function (_v0, _v1, _v2) {
5045+ return $elm$core$Task$succeed(_Utils_Tuple0);
5047+var $elm$core$Task$cmdMap = F2(
5048+ function (tagger, _v0) {
5050+ return $elm$core$Task$Perform(
5051+ A2($elm$core$Task$map, tagger, task));
5053+_Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap);
5054+var $elm$core$Task$command = _Platform_leaf('Task');
5055+var $elm$core$Task$perform = F2(
5056+ function (toMessage, task) {
5057+ return $elm$core$Task$command(
5058+ $elm$core$Task$Perform(
5059+ A2($elm$core$Task$map, toMessage, task)));
5061+var $elm$core$Platform$Cmd$batch = _Platform_batch;
5062+var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil);
5063+var $elm$core$Platform$Sub$batch = _Platform_batch;
5064+var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil);
5065+var $elm$browser$Browser$sandbox = function (impl) {
5066+ return _Browser_element(
5068+ init: function (_v0) {
5069+ return _Utils_Tuple2(impl.init, $elm$core$Platform$Cmd$none);
5071+ subscriptions: function (_v1) {
5072+ return $elm$core$Platform$Sub$none;
5075+ function (msg, model) {
5076+ return _Utils_Tuple2(
5077+ A2(impl.update, msg, model),
5078+ $elm$core$Platform$Cmd$none);
5083+var $author$project$Main$update = F2(
5084+ function (msg, model) {
5085+ if (msg.$ === 'Increment') {
5086+ return _Utils_update(
5088+ {count: model.count + 1});
5090+ return _Utils_update(
5092+ {count: model.count - 1});
5095+var $author$project$Main$Decrement = {$: 'Decrement'};
5096+var $author$project$Main$Increment = {$: 'Increment'};
5097+var $elm$virtual_dom$VirtualDom$style = _VirtualDom_style;
5098+var $author$project$Lynx$Attributes$style = $elm$virtual_dom$VirtualDom$style;
5099+var $author$project$Lynx$Attributes$alignItems = $author$project$Lynx$Attributes$style('alignItems');
5100+var $author$project$Lynx$Attributes$backgroundColor = $author$project$Lynx$Attributes$style('backgroundColor');
5101+var $author$project$Lynx$Attributes$intStyle = F2(
5102+ function (key, val) {
5104+ $elm$virtual_dom$VirtualDom$style,
5106+ $elm$core$String$fromInt(val));
5108+var $author$project$Lynx$Attributes$borderRadius = $author$project$Lynx$Attributes$intStyle('borderRadius');
5109+var $author$project$Lynx$Attributes$color = $author$project$Lynx$Attributes$style('color');
5110+var $author$project$Lynx$Attributes$fontSize = $author$project$Lynx$Attributes$intStyle('fontSize');
5111+var $elm$virtual_dom$VirtualDom$Normal = function (a) {
5112+ return {$: 'Normal', a: a};
5114+var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on;
5115+var $author$project$Lynx$Events$onTap = function (msg) {
5117+ $elm$virtual_dom$VirtualDom$on,
5119+ $elm$virtual_dom$VirtualDom$Normal(
5120+ $elm$json$Json$Decode$succeed(msg)));
5122+var $author$project$Lynx$Attributes$paddingBottom = $author$project$Lynx$Attributes$intStyle('paddingBottom');
5123+var $author$project$Lynx$Attributes$paddingLeft = $author$project$Lynx$Attributes$intStyle('paddingLeft');
5124+var $author$project$Lynx$Attributes$paddingRight = $author$project$Lynx$Attributes$intStyle('paddingRight');
5125+var $author$project$Lynx$Attributes$paddingTop = $author$project$Lynx$Attributes$intStyle('paddingTop');
5126+var $elm$virtual_dom$VirtualDom$node = function (tag) {
5127+ return _VirtualDom_node(
5128+ _VirtualDom_noScript(tag));
5130+var $author$project$Lynx$text = $elm$virtual_dom$VirtualDom$node('text');
5131+var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text;
5132+var $author$project$Lynx$textContent = $elm$virtual_dom$VirtualDom$text;
5133+var $author$project$Lynx$view = $elm$virtual_dom$VirtualDom$node('view');
5134+var $author$project$Main$button = F2(
5135+ function (msg, label) {
5137+ $author$project$Lynx$view,
5140+ $author$project$Lynx$Events$onTap(msg),
5141+ $author$project$Lynx$Attributes$backgroundColor('#4a90d9'),
5142+ $author$project$Lynx$Attributes$borderRadius(8),
5143+ $author$project$Lynx$Attributes$paddingTop(12),
5144+ $author$project$Lynx$Attributes$paddingBottom(12),
5145+ $author$project$Lynx$Attributes$paddingLeft(24),
5146+ $author$project$Lynx$Attributes$paddingRight(24)
5151+ $author$project$Lynx$text,
5154+ $author$project$Lynx$Attributes$color('#ffffff'),
5155+ $author$project$Lynx$Attributes$fontSize(24)
5159+ $author$project$Lynx$textContent(label)
5163+var $author$project$Lynx$Attributes$flex = $author$project$Lynx$Attributes$intStyle('flex');
5164+var $author$project$Lynx$Attributes$flexDirection = $author$project$Lynx$Attributes$style('flexDirection');
5165+var $author$project$Lynx$Attributes$justifyContent = $author$project$Lynx$Attributes$style('justifyContent');
5166+var $author$project$Lynx$Attributes$marginLeft = $author$project$Lynx$Attributes$intStyle('marginLeft');
5167+var $author$project$Lynx$Attributes$marginRight = $author$project$Lynx$Attributes$intStyle('marginRight');
5168+var $author$project$Main$view = function (model) {
5170+ $author$project$Lynx$view,
5173+ $author$project$Lynx$Attributes$flexDirection('column'),
5174+ $author$project$Lynx$Attributes$alignItems('center'),
5175+ $author$project$Lynx$Attributes$justifyContent('center'),
5176+ $author$project$Lynx$Attributes$flex(1)
5181+ $author$project$Lynx$view,
5184+ $author$project$Lynx$Attributes$flexDirection('row'),
5185+ $author$project$Lynx$Attributes$alignItems('center')
5189+ A2($author$project$Main$button, $author$project$Main$Decrement, '-'),
5191+ $author$project$Lynx$text,
5194+ $author$project$Lynx$Attributes$fontSize(32),
5195+ $author$project$Lynx$Attributes$marginLeft(20),
5196+ $author$project$Lynx$Attributes$marginRight(20)
5200+ $author$project$Lynx$textContent(
5201+ $elm$core$String$fromInt(model.count))
5203+ A2($author$project$Main$button, $author$project$Main$Increment, '+')
5207+var $author$project$Main$main = $elm$browser$Browser$sandbox(
5208+ {init: $author$project$Main$init, update: $author$project$Main$update, view: $author$project$Main$view});
5209+_Platform_export({'Main':{'init':$author$project$Main$main(
5210+ $elm$json$Json$Decode$succeed(_Utils_Tuple0))(0)}});}(this));
5211+var app = Elm.Main.init({});