From c9f3fb805eb1c4f2bf820d30a2419f577530966a Mon Sep 17 00:00:00 2001 From: Dave Rapin Date: Wed, 11 Oct 2023 11:27:55 -0400 Subject: [PATCH] Allow for assignment of team is no team is assigned even if the game has started. --- dev.js | 4 ++-- prod.js | 47 +++++++++++++++++++++--------------------- prod.min.js | 2 +- src/BracketBuilder.elm | 6 +++--- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/dev.js b/dev.js index a728665..346bb78 100644 --- a/dev.js +++ b/dev.js @@ -13384,7 +13384,7 @@ var $author$project$BracketBuilder$viewSide = F7( } }(); var dropTarget = function () { - if (_Utils_eq(onGame.state, $author$project$BracketBuilder$GamePending)) { + if (_Utils_eq(onGame.state, $author$project$BracketBuilder$GamePending) || _Utils_eq(side.assignment, $elm$core$Maybe$Nothing)) { var _v0 = _Utils_Tuple2(dragId, dropId); if ((((_v0.a.$ === 'Just') && (_v0.a.a.$ === 'DraggableResult')) && (_v0.b.$ === 'Just')) && (_v0.b.a.$ === 'DroppableSide')) { var gameIdAndPosition = _v0.b.a.a; @@ -14279,7 +14279,7 @@ var $author$project$BracketBuilder$viewEditGame = F3( $elm$html$Html$Events$onInput( $author$project$BracketBuilder$UpdateSide(index)), $elm$html$Html$Attributes$disabled( - !_Utils_eq(game.state, $author$project$BracketBuilder$GamePending)) + (!_Utils_eq(game.state, $author$project$BracketBuilder$GamePending)) && (!_Utils_eq(side.assignment, $elm$core$Maybe$Nothing))) ]), A2(assignmentOptions, index, side)) ])); diff --git a/prod.js b/prod.js index b75cc11..6ae2a19 100644 --- a/prod.js +++ b/prod.js @@ -5019,7 +5019,7 @@ var $elm$core$Array$treeFromBuilder = F2( }); var $elm$core$Array$builderToArray = F2( function (reverseNodeList, builder) { - if (!builder.g) { + if (!builder.h) { return A4( $elm$core$Array$Array_elm_builtin, $elm$core$Elm$JsArray$length(builder.j), @@ -5027,11 +5027,11 @@ var $elm$core$Array$builderToArray = F2( $elm$core$Elm$JsArray$empty, builder.j); } else { - var treeLen = builder.g * $elm$core$Array$branchFactor; + var treeLen = builder.h * $elm$core$Array$branchFactor; var depth = $elm$core$Basics$floor( A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.k) : builder.k; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.g); + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.h); return A4( $elm$core$Array$Array_elm_builtin, $elm$core$Elm$JsArray$length(builder.j) + treeLen, @@ -5050,7 +5050,7 @@ var $elm$core$Array$initializeHelp = F5( return A2( $elm$core$Array$builderToArray, false, - {k: nodeList, g: (len / $elm$core$Array$branchFactor) | 0, j: tail}); + {k: nodeList, h: (len / $elm$core$Array$branchFactor) | 0, j: tail}); } else { var leaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); @@ -5620,7 +5620,7 @@ var $author$project$BracketBuilder$LoserAssignment = function (a) { }; var $author$project$BracketBuilder$Side = F5( function (position, firstHammer, assignment, teamId, result) { - return {h: assignment, aF: firstHammer, aa: position, ax: result, B: teamId}; + return {g: assignment, aF: firstHammer, aa: position, ax: result, B: teamId}; }); var $author$project$BracketBuilder$SideResultLost = 1; var $author$project$BracketBuilder$SideResultWon = 0; @@ -6749,7 +6749,7 @@ var $author$project$BracketBuilder$assignTeamsForCompletedGames = function (game }, games))); }; - var _v0 = side.h; + var _v0 = side.g; if (_v0.$ === 1) { return $elm$core$Maybe$Nothing; } else { @@ -6811,10 +6811,10 @@ var $author$project$BracketBuilder$clearAssignmentFromAllGames = F2( function (games, assignment) { var unassignedSide = function (side) { return _Utils_eq( - side.h, + side.g, $elm$core$Maybe$Just(assignment)) ? _Utils_update( side, - {h: $elm$core$Maybe$Nothing}) : side; + {g: $elm$core$Maybe$Nothing}) : side; }; var unassignedGame = function (game) { return _Utils_update( @@ -7005,7 +7005,7 @@ var $author$project$BracketBuilder$gamesEncoder = function (games) { _Utils_Tuple2( 'winner_id', function () { - var _v2 = side.h; + var _v2 = side.g; if ((!_v2.$) && (_v2.a.$ === 1)) { var id = _v2.a.a; return $elm$json$Json$Encode$string(id); @@ -7016,7 +7016,7 @@ var $author$project$BracketBuilder$gamesEncoder = function (games) { _Utils_Tuple2( 'loser_id', function () { - var _v3 = side.h; + var _v3 = side.g; if ((!_v3.$) && (_v3.a.$ === 2)) { var id = _v3.a.a; return $elm$json$Json$Encode$string(id); @@ -7491,7 +7491,7 @@ var $author$project$BracketBuilder$update = F2( return _Utils_eq(side.aa, toPosition) ? _Utils_update( side, { - h: $elm$core$Maybe$Just(from) + g: $elm$core$Maybe$Just(from) }) : side; }; return _Utils_update( @@ -7758,7 +7758,7 @@ var $author$project$BracketBuilder$update = F2( {am: true, f: _List_Nil}); } else { var updatedSide = function (side) { - var _v8 = side.h; + var _v8 = side.g; _v8$2: while (true) { if (!_v8.$) { @@ -7767,12 +7767,12 @@ var $author$project$BracketBuilder$update = F2( var id = _v8.a.a; return _Utils_eq(id, game_.a) ? _Utils_update( side, - {h: $elm$core$Maybe$Nothing}) : side; + {g: $elm$core$Maybe$Nothing}) : side; case 2: var id = _v8.a.a; return _Utils_eq(id, game_.a) ? _Utils_update( side, - {h: $elm$core$Maybe$Nothing}) : side; + {g: $elm$core$Maybe$Nothing}) : side; default: break _v8$2; } @@ -7964,7 +7964,7 @@ var $author$project$BracketBuilder$update = F2( return _Utils_eq(side.aa, position) ? _Utils_update( side, { - h: typedAssignment, + g: typedAssignment, B: function () { if ((!typedAssignment.$) && (!typedAssignment.a.$)) { var id = typedAssignment.a.a; @@ -8569,7 +8569,7 @@ var $author$project$BracketBuilder$viewSide = F7( function (dragId, dropId, teams, games, onGame, position, side) { var positionClass = (!position) ? _Utils_Tuple2('game-top', true) : _Utils_Tuple2('game-bottom', true); var label = function () { - var _v1 = side.h; + var _v1 = side.g; if (!_v1.$) { switch (_v1.a.$) { case 0: @@ -8658,7 +8658,7 @@ var $author$project$BracketBuilder$viewSide = F7( } }(); var dropTarget = function () { - if (!onGame.S) { + if ((!onGame.S) || _Utils_eq(side.g, $elm$core$Maybe$Nothing)) { var _v0 = _Utils_Tuple2(dragId, dropId); if ((((!_v0.a.$) && (_v0.a.a.$ === 1)) && (!_v0.b.$)) && (_v0.b.a.$ === 1)) { var gameIdAndPosition = _v0.b.a.a; @@ -8995,7 +8995,7 @@ var $author$project$BracketBuilder$viewSvgLines = F2( return $elm$core$Maybe$Nothing; } }); - var _v0 = side.h; + var _v0 = side.g; _v0$2: while (true) { if (!_v0.$) { @@ -9382,7 +9382,7 @@ var $author$project$BracketBuilder$viewEditGame = F3( var teamOption = F3( function (index, selectedSide, team) { var isSelected = function () { - var _v6 = selectedSide.h; + var _v6 = selectedSide.g; if ((!_v6.$) && (!_v6.a.$)) { var id = _v6.a.a; return _Utils_eq(id, team.a); @@ -9416,7 +9416,7 @@ var $author$project$BracketBuilder$viewEditGame = F3( }; var notAlreadyAssigned = function (assignment) { var assignedToSide = function (side) { - return _Utils_eq(assignment, side.h); + return _Utils_eq(assignment, side.g); }; var assignedToGame = function (g) { return _Utils_eq(g.a, game.a) ? false : (!$elm$core$List$isEmpty( @@ -9468,7 +9468,7 @@ var $author$project$BracketBuilder$viewEditGame = F3( var assignedTo = F2( function (team, g) { var assignedToPosition = function (p) { - var _v4 = p.h; + var _v4 = p.g; if ((!_v4.$) && (!_v4.a.$)) { var id = _v4.a.a; return _Utils_eq(id, team.a); @@ -9535,7 +9535,7 @@ var $author$project$BracketBuilder$viewEditGame = F3( } }(); var isSelected = _Utils_eq( - selectedSide.h, + selectedSide.g, $elm$core$Maybe$Just(assignment)); var _v1 = _Utils_Tuple2(optionId, optionLabel); if ((!_v1.a.$) && (!_v1.b.$)) { @@ -9601,7 +9601,8 @@ var $author$project$BracketBuilder$viewEditGame = F3( $elm$html$Html$Attributes$id('editing-game'), $elm$html$Html$Events$onInput( $author$project$BracketBuilder$UpdateSide(index)), - $elm$html$Html$Attributes$disabled(!(!game.S)) + $elm$html$Html$Attributes$disabled( + (!(!game.S)) && (!_Utils_eq(side.g, $elm$core$Maybe$Nothing))) ]), A2(assignmentOptions, index, side)) ])); diff --git a/prod.min.js b/prod.min.js index 5f02b69..40e5ce2 100644 --- a/prod.min.js +++ b/prod.min.js @@ -1 +1 @@ -!function(o){"use strict";function H(n,r,t){return t.a=n,t.f=r,t}function h(t){return H(2,t,function(r){return function(n){return t(r,n)}})}function g(e){return H(3,e,function(t){return function(r){return function(n){return e(t,r,n)}}})}function n(u){return H(4,u,function(e){return function(t){return function(r){return function(n){return u(e,t,r,n)}}}})}function r(a){return H(5,a,function(u){return function(e){return function(t){return function(r){return function(n){return a(u,e,t,r,n)}}}}})}function i(o){return H(6,o,function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return o(a,u,e,t,r,n)}}}}}})}function c(i){return H(7,i,function(o){return function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return i(o,a,u,e,t,r,n)}}}}}}})}function q(c){return H(8,c,function(i){return function(o){return function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return c(i,o,a,u,e,t,r,n)}}}}}}}})}function P(f){return H(9,f,function(c){return function(i){return function(o){return function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return f(c,i,o,a,u,e,t,r,n)}}}}}}}}})}function m(n,r,t){return 2===n.a?n.f(r,t):n(r)(t)}function p(n,r,t,e){return 3===n.a?n.f(r,t,e):n(r)(t)(e)}function l(n,r,t,e,u){return 4===n.a?n.f(r,t,e,u):n(r)(t)(e)(u)}function w(n,r,t,e,u,a){return 5===n.a?n.f(r,t,e,u,a):n(r)(t)(e)(u)(a)}function F(n,r,t,e,u,a,o){return 6===n.a?n.f(r,t,e,u,a,o):n(r)(t)(e)(u)(a)(o)}function G(n,r,t,e,u,a,o,i){return 7===n.a?n.f(r,t,e,u,a,o,i):n(r)(t)(e)(u)(a)(o)(i)}var I=g(function(n,r,t){for(var e=Array(n),u=0;u"),r});function Q(n){throw Error("https://github.com/elm/core/blob/1.0.0/hints/"+n+".md")}function y(n,r){for(var t,e=[],u=X(n,r,0,e);u&&(t=e.pop());u=X(t.a,t.b,0,e));return u}function X(n,r,t,e){if(n===r)return!0;if("object"!=typeof n||null===n||null===r)return"function"==typeof n&&Q(5),!1;if(100a||a>56319?(e[u]=n(r[u]),u++):(e[u]=n(r[u]+r[u+1]),u+=2)}return e.join("")}),h(function(n,r){for(var t=[],e=r.length,u=0;uo)return u}var d=t.$;if(4===d){for(var l=t.k;4===l.$;)l=l.k;return n(r,l,e,u,a+1,o,r.elm_event_node_ref)}var v=t.e;var $=r.childNodes;for(var h=0;ho))return u;a=m}return u}(n,r,t,0,0,r.b,e)}function Tr(n,r,t,e){return 0===t.length?n:(Br(n,r,t,e),Lr(n,t))}function Lr(n,r){for(var t=0;t>n});Mr=h(function(n,r){return r>>>n});h(function(t,e){return{$:2,b:function(n){var r=setInterval(function(){qn(e)},t);return function(){clearInterval(r)}},c:null}});var Hr=g(function(e,u,a){return{$:2,b:function(r){function t(n){r(u(a.at.a(n)))}var n=new XMLHttpRequest;n.addEventListener("error",function(){t($u)}),n.addEventListener("timeout",function(){t(mu)}),n.addEventListener("load",function(){t(function(n,r){return m(200<=r.status&&r.status<300?vu:du,function(n){return{aB:n.responseURL,bI:n.status,bJ:n.statusText,aJ:function(n){if(!n)return wu;for(var r=wu,t=n.split("\r\n"),e=t.length;e--;){var u,a,o=t[e],i=o.indexOf(": ");0>>0,r)}var _=function(n){return{$:0,a:n}},N={$:1},v=K,Kr=z,Zr=(g(function(t,n,r){var e=r.c,r=r.d,u=h(function(n,r){return p(Kr,n.$?t:u,r,n.a)});return p(Kr,u,p(Kr,t,n,r),e)}),g(function(n,r,t){for(;;){if(-2===t.$)return r;var e=t.d,u=n,a=p(n,t.b,t.c,p(Zr,n,r,t.e));n=u,r=a,t=e}})),nt=function(n){return p(Zr,g(function(n,r,t){return m(v,{a:n,b:r},t)}),x,n)},rt=1,tt=2,et=0,$=function(n){return{$:1,a:n}},ut=h(function(n,r){return{$:3,a:n,b:r}}),at=h(function(n,r){return{$:0,a:n,b:r}}),ot=h(function(n,r){return{$:1,a:n,b:r}}),it=function(n){return{$:0,a:n}},ct=function(n){return{$:2,a:n}},ft=sn,bt=Sn,C=function(n){return n+""},st=h(function(n,r){return m(fn,n,Z(r))}),dt=h(function(n,r){return j(m(cn,n,r))}),lt=g(function(n,r,t){for(;;){if(!t.b)return r;var e=t.b,u=n,a=m(n,t.a,r);n=u,r=a,t=e}}),vt=nn,$t=g(function(n,r,t){for(;;){if(b(n,r)>=1)return t;var e=n,u=r-1,a=m(v,r,t);n=e,r=u,t=a}}),ht=h(function(n,r){return p($t,n,r,x)}),gt=h(function(n,r){return p(vt,n,m(ht,0,Ir(r)-1),r)}),mt=function(n){var r=n.charCodeAt(0);return r<55296||56319>>4+(n>>>28)))>>>22^n)>>>0}function pe(n){return{$:21,a:n}}function we(n){return{$:2,a:n}}function ye(n){return{$:0,a:n}}function ke(n){return{$:1,a:n}}function Ae(n){return cu(j([m(a,_,n),e(N)]))}function xe(n){var r,t,e,u,a,o,i,c;return-1===n.$&&-1===n.d.$&&-1===n.e.$?-1!==n.e.d.$||n.e.d.a?(e=(c=n.e).b,u=c.c,a=c.d,c=c.e,w(E,1,n.b,n.c,w(E,0,(r=n.d).b,r.c,r.d,r.e),w(E,0,e,u,a,c))):(e=(t=n.e).b,u=t.c,o=(a=t.d).d,i=a.e,c=t.e,w(E,0,a.b,a.c,w(E,1,n.b,n.c,w(E,0,(r=n.d).b,r.c,r.d,r.e),o),w(E,1,e,u,i,c))):n}function je(n){var r,t,e,u,a,o,i,c,f;return-1===n.$&&-1===n.d.$&&-1===n.e.$?-1!==n.d.d.$||n.d.d.a?(o=(f=n.e).b,i=f.c,c=f.d,f=f.e,w(E,1,r=n.b,t=n.c,w(E,0,(u=n.d).b,u.c,u.d,u=u.e),w(E,0,o,i,c,f))):(r=n.b,t=n.c,u=(e=n.d).e,o=(a=n.e).b,i=a.c,c=a.d,f=a.e,w(E,0,e.b,e.c,w(E,1,(a=e.d).b,a.c,a.d,a.e),w(E,1,r,t,u,w(E,0,o,i,c,f)))):n}function _e(n){var r,t,e,u,a,o;return-1===n.$&&-1===n.d.$?(r=n.a,t=n.b,e=n.c,o=(u=n.d).d,a=n.e,1===u.a?-1!==o.$||o.a?-1===(o=xe(n)).$?(n=o.e,w(ju,o.a,o.b,o.c,_e(o.d),n)):pu:w(E,r,t,e,_e(u),a):w(E,r,t,e,_e(u),a)):pu}function Ne(n){return{$:4,a:n}}function Ce(n){return 1===n.$?{$:2,a:n.a}:{$:3,a:n.a}}function Be(n){return Uu(Fu({bf:!1,bh:n.bh,at:n.at,aJ:n.aJ,bx:n.bx,bM:n.bM,a8:n.a8,aB:n.aB}))}function Te(n){return Uu(Fu({bf:!0,bh:n.bh,at:n.at,aJ:n.aJ,bx:n.bx,bM:n.bM,a8:n.a8,aB:n.aB}))}function Le(n){return n.P?Te:Be}function Ee(n){var r=n.M,r=(n=n.a).$?r+"brackets/new":r+("brackets/"+C(n.a));return p(Zu,r,pe,su)}function Oe(e){return m(T,function(n){return k(n,{f:m(T,function(t){var n=function(){function n(r){return m(J,x,m(ia,function(n){return n.f},m(S,function(n){return y(n.a,r)&&2===n.S},e)))}var r=t.h;if(1===r.$)return N;switch(r.a.$){case 1:return m(J,N,m(ia,function(n){return n.B},m(S,function(n){return y(n.ax,_(0))},n(r.a.a))));case 2:return m(J,N,m(ia,function(n){return n.B},m(S,function(n){return y(n.ax,_(1))},n(r.a.a))));default:return t.B}}();return k(t,{B:n})},n.f)})},e)}function Se(n){return n.b?_(n.a):N}function Je(n){return m(pa,function(n){var r;return ya(j([{a:"id",b:ka(n.a)},{a:"name",b:(r=n.c).$?wa:ka(r.a)},{a:"_delete",b:ga(n.am)},{a:"game_positions",b:m(pa,function(n){return ya(j([{a:"position",b:ma(n.aa)},{a:"first_hammer",b:ga(n.aF)},{a:"team_id",b:(r=n.B).$?wa:ma(r.a)},{a:"winner_id",b:(r=n.h).$||1!==r.a.$?wa:ka(r.a.a)},{a:"loser_id",b:(r=n.h).$||2!==r.a.$?wa:ka(r.a.a)}]));var r},n.f)},{a:"coords",b:ya(j([{a:"group_id",b:ma((r=n.m).X)},{a:"col",b:ma(r.N)},{a:"row",b:ma(r.Q)}]))}]))},n)}function Me(n){return ya(j([{a:"id",b:(r=n.a).$?wa:ma(r.a)},{a:"name_en",b:ka(n.c)},{a:"groups",b:m(pa,function(n){return ya(j([{a:"id",b:ma(n.a)},{a:"name",b:ka(n.c)}]))},n.n)},{a:"games",b:Je(n.d)}]));var r}function Re(n){switch(n.$){case 0:return n.a;case 1:return"Server is taking too long to respond. Please try again later.";case 2:return"Unable to reach server.";case 3:return"Request failed with status code: "+C(n.a);default:return n.a}}function De(n){return n.b}function He(n){return M(m(st," ",m(T,Xr,m(Wa,De,n))))}function L(n){return m(Xa,"click",e(n))}function qe(n){return n.b?_(p(lt,Ot,n.a,n.b)):N}function Pe(n){return{$:1,a:n}}function Fe(n){return m(Xa,"dblclick",e(n))}function Ge(n){return m(J,10,qe(m(T,function(n){return n.m.N+5},n)))}function Ie(n){return m(Wa,function(n){return!n.am},n)}function We(n){return{$:3,a:n}}function ze(n){return{a:n,b:!0}}function Qe(n){return m(Po,"input",m(a,ze,m(a,n,Fo)))}function Xe(n){return{$:14,a:n}}var Ve,I=m(oe,function(n){return ee(function(n){var r=Ur(m(ge,0,1013904223));return Ur(m(ge,r.a+n>>>0,r.b))}(n))},{$:2,b:function(n){n({$:0,a:Ve(Date.now())})},c:null}),Ye=h(function(n,r){return n(r)}),Ue=g(function(r,n,t){var e,u;return n.b?(e=n.b,n=m(Ye,n.a,t),u=n.b,m(oe,function(n){return p(Ue,r,e,u)},m(fe,r,n.a))):ee(t)}),en=g(function(n,r,t){return ee(t)}),Ke=h(function(t,n){var e=n;return function(n){var n=e(n),r=n.b;return{a:t(n.a),b:r}}}),W=h(function(n,r){return m(Ke,n,r)}),Ze=(d.Random={b:I,c:Ue,d:en,e:W,f:void 0},Yn("Random")),pn=h(function(n,r){return Ze(m(Ke,n,r))}),nu=h(function(c,f){return function(n){var r=b(c,f)<0?{a:c,b:f}:{a:f,b:c},t=r.a,e=r.b-t+1;if(!(e-1&e))return{a:((e-1&me(n))>>>0)+t,b:Ur(n)};for(var u=(-e>>>0)%e>>>0,a=n;;){var o=me(a),i=Ur(a);if(b(o,u)>=0)return{a:o%e+t,b:i};a=i}}}),ru=n(function(u,n,r,t){var a=n,o=r,i=t;return function(n){var n=a(n),r=n.a,n=o(n.b),t=n.a,n=i(n.b),e=n.b;return{a:p(u,r,t,n.a),b:e}}}),tu=m(pn,function(n){return{$:0,a:n}},function(n){var r=g(function(n,r,t){return Ur(m(ge,n,(1|r^t)>>>0))}),t=m(nu,0,4294967295);return m(Ye,l(ru,r,t,t,t),n)}),eu={$:0},uu=eu,wn=n(function(n,r,t,e){return{d:e,n:t,a:n,c:r}}),au=g(function(n,r,t){return{N:r,X:n,Q:t}}),ou=c(function(n,r,t,e,u,a,o){return{m:u,al:n,a:r,am:e,c:t,f:o,S:a}}),iu=r(function(n,r,t,e,u){return{h:t,aF:r,aa:n,ax:u,B:e}}),yn=vn,t=ln,bn=function(n){return{$:3,b:n}},dn=kn,Xn=xn,K=jn,cu=function(n){return{$:11,g:n}},fu=gn,bu=function(n){return n.toLowerCase()},Or=(z=m(Pt,function(n){return e("won"===n?0:1)},fu),sn=cu(j([m(a,ke,m(u,"winner_id",fu)),m(a,we,m(u,"loser_id",fu)),m(a,ye,m(u,"team_id",t))])),sn=F(Xn,iu,m(u,"position",t),m(u,"first_hammer",yn),Ae(sn),Ae(m(u,"team_id",t)),Ae(m(u,"result",z))),z=m(Pt,function(n){switch(bu(n)){case"active":return e(1);case"complete":return e(2);default:return e(0)}},fu),Sn=l(dn,au,m(u,"group_id",t),m(u,"col",t),m(u,"row",t)),G(K,ou(N),m(u,"id",fu),Ae(m(u,"name",fu)),e(!1),m(u,"coords",Sn),m(u,"state",z),m(u,"game_positions",bn(sn)))),mn=l(dn,$e,m(u,"id",t),m(u,"name",fu),e(!0)),Mr=An,su=w(Mr,wn,Ae(m(u,"id",t)),m(u,"name",fu),m(u,"groups",bn(mn)),m(u,"games",bn(Or))),du=h(function(n,r){return{$:3,a:n,b:r}}),lu=function(n){return{$:0,a:n}},vu=h(function(n,r){return{$:4,a:n,b:r}}),$u={$:2},hu=function(n){return{$:1,a:n}},gu=function(n){return{$:0,a:n}},mu={$:1},pu={$:-2},wu=pu,yu=function(n){return!n.$},ku=Vn,Au=V,xu=h(function(n,r){for(;;){if(-2===r.$)return N;var t=r.c,e=r.d,u=r.e;switch(m(Au,n,r.b)){case 0:n=n,r=e;continue;case 1:return _(t);default:n=n,r=u;continue}}}),E=r(function(n,r,t,e,u){return{$:-1,a:n,b:r,c:t,d:e,e:u}}),ju=r(function(n,r,t,e,u){var a,o,i,c;return-1!==u.$||u.a?-1!==e.$||e.a||-1!==e.d.$||e.d.a?w(E,n,r,t,e,u):(a=e.d,c=e.e,w(E,0,e.b,e.c,w(E,1,a.b,a.c,a.d,a.e),w(E,1,r,t,c,u))):(a=u.b,o=u.c,i=u.d,u=u.e,-1!==e.$||e.a?w(E,n,a,o,w(E,0,r,t,e,i),u):w(E,0,r,t,w(E,1,e.b,e.c,e.d,c=e.e),w(E,1,a,o,i,u)))}),_u=g(function(n,r,t){if(-2===t.$)return w(E,0,n,r,pu,pu);var e=t.a,u=t.b,a=t.c,o=t.d,i=t.e;switch(m(Au,n,u)){case 0:return w(ju,e,u,a,p(_u,n,r,o),i);case 1:return w(E,e,u,r,o,i);default:return w(ju,e,u,a,o,p(_u,n,r,i))}}),Nu=g(function(n,r,t){n=p(_u,n,r,t);return-1!==n.$||n.a?n:w(E,1,n.b,n.c,n.d,n.e)}),Cu=c(function(n,r,t,e,u,a,o){if(-1!==a.$||a.a){for(;;){if(-1!==o.$||1!==o.a)break;if(-1!==o.d.$)return je(r);if(1===o.d.a)return je(r);break}return r}return w(E,t,a.b,a.c,a.d,w(E,0,e,u,a.e,o))}),Bu=h(function(n,r){var t,e,u,a,o,i,c;return-2===r.$?pu:(t=r.a,u=r.c,a=r.d,o=r.e,b(n,e=r.b)<0?-1===a.$&&1===a.a?-1!==(i=a.d).$||i.a?-1===(i=xe(r)).$?(c=i.e,w(ju,i.a,i.b,i.c,m(Bu,n,i.d),c)):pu:w(E,t,e,u,m(Bu,n,a),o):w(E,t,e,u,m(Bu,n,a),o):m(Tu,n,G(Cu,n,r,t,e,u,a,o)))}),Tu=h(function(n,r){var t,e,u,a,o;return-1===r.$?(t=r.a,e=r.c,u=r.d,a=r.e,y(n,r=r.b)?-1===(o=function(n){for(;;){if(-1!==n.$||-1!==n.d.$)return n;n=n.d}}(a)).$?w(ju,t,o.b,o.c,u,_e(a)):pu:w(ju,t,r,e,u,m(Bu,n,a))):pu}),Lu=h(function(n,r){n=m(Bu,n,r);return-1!==n.$||n.a?n:w(E,1,n.b,n.c,n.d,n.e)}),Eu=g(function(n,r,t){r=r(m(xu,n,t));return r.$?m(Lu,n,t):p(Nu,n,r.a,t)}),Ou={$:0},Su=g(function(n,r,t){return r(n(t))}),Ju=_n,Mu=h(function(n,r){return p(qr,"",Vr,m(Su,r,n))}),Ru=h(function(n,r){return r.$?$(n(r.a)):it(r.a)}),Du={$:2},Hu={$:1},qu=h(function(n,r){switch(r.$){case 0:return $({$:0,a:r.a});case 1:return $(Hu);case 2:return $(Du);case 3:return $({$:3,a:r.a.bI});default:return m(Ru,Ne,n(r.b))}}),Pu=h(function(n,r){return m(Mu,n,qu(function(n){return m(Ru,kt,m(Ju,r,n))}))}),Fu=function(n){return{$:1,a:n}},Gu=h(function(n,r){return{aY:n,a6:r}}),I=ee(m(Gu,wu,x)),Iu=function(t){return{$:2,b:function(n){var r=t.f;2===r.$&&r.c&&r.c(),t.f=null,n({$:0,a:Y})},c:null}},Wu=Pn,zu=g(function(t,n,e){for(;;){if(!n.b)return ee(e);var u,r=n.a,a=n.b;if(r.$)return u=r.a,m(oe,function(n){var r=u.a8;return p(zu,t,a,1===r.$?e:p(Nu,r.a,n,e))},Wu(p(Hr,t,fe(t),u)));var o=r.a,r=m(xu,o,e);if(1!==r.$)return m(oe,function(n){return p(zu,t,a,m(Lu,o,e))},Iu(r.a));t=t,n=a,e=e}}),en=n(function(n,r,t,e){return m(oe,function(n){return ee(m(Gu,n,t))},p(zu,n,r,e.aY))}),Qu=g(function(n,r,t){n=n(r);return n.$?t:m(v,n.a,t)}),Xu=h(function(n,r){return p(ae,Qu(n),x,r)}),Vu=n(function(n,r,t,e){var u=e.b;return y(r,e.a)?_(m(fe,n,u(t))):N}),W=g(function(n,r,t){return m(oe,function(n){return ee(t)},Yr(m(Xu,p(Vu,n,r.a,r.b),t.a6)))}),pn=h(function(n,r){var t;return r.$?Fu({bf:(t=r.a).bf,bh:t.bh,at:m(Pr,n,t.at),aJ:t.aJ,bx:t.bx,bM:t.bM,a8:t.a8,aB:t.aB}):{$:0,a:r.a}}),Yu=h(function(n,r){return{$:0,a:n,b:r}}),vn=h(function(n,r){return m(Yu,r.a,m(Su,r.b,n))}),Uu=(d.Http={b:I,c:en,d:W,e:pn,f:vn},Yn("Http")),Ku=(Yn("Http"),i(function(n,r,t,e,u,a){return m(Le,r,{bh:a,at:m(Pu,m(Su,Ce,e),u),aJ:r.aJ,bx:n,bM:r.bM,a8:r.a8,aB:t})})),ln=n(function(n,r,t,e){return F(Ku,"GET",n,r,t,e,Ou)}),kn=h(function(n,r){return{$:0,a:n,b:r}}),xn={aJ:j([m(kn,"Accept","application/json")]),P:!1,bM:N,a8:N},jn=m(kn,"Cache-Control","no-store, must-revalidate, no-cache, max-age=0"),Zu=ln(k(xn,{aJ:m(v,jn,xn.aJ)})),na=function(n){return{$:20,a:n}},gn=h(function(n,r){return{a:n,c:r}}),Xn=p(Ft,gn,m(u,"id",t),m(u,"short_name",fu)),ra=bn(Xn),O=ve(x),yn=function(n){return{$:5,c:n}},ta=Un(x),ea={$:4},ua={$:0},aa={$:3},oa=h(function(n,r){for(;;){if(!r.b)return!1;var t=r.b;if(n(r.a))return!0;n=n,r=t}}),S=h(function(n,r){for(;;){if(!r.b)return N;var t=r.a,e=r.b;if(n(t))return _(t);n=n,r=e}}),ia=h(function(n,r){return r.$?N:_(n(r.a))}),J=h(function(n,r){return r.$?n:r.a}),ca=h(function(n,r){function t(n){return y(n.h,_(r))?k(n,{h:N}):n}return m(T,function(n){return k(n,{f:m(T,t,n.f)})},n)}),fa=(K=Vr,tr(Sn="dragstart"),d[Sn]={e:er,u:K,a:ur},Yn(Sn)),ba=h(function(r,n){return m(S,function(n){return y(n.m,r)},n)}),sa=n(function(n,r,t,e){return{$:0,a:n,b:r,c:t,d:e}}),z=r(function(a,n,r,t,e){var o=n,i=r,c=t,f=e;return function(n){var n=o(n),r=n.a,n=i(n.b),t=n.a,n=c(n.b),e=n.a,n=f(n.b),u=n.b;return{a:l(a,r,t,e,n.a),b:u}}}),da=tn(0),sn=m(Ke,da,m(nu,-2147483648,2147483647)),dn=h(function(n,r){var t=r.c,e=r.d;return l(sa,r.a,da(n<<12|4294905855&r.b),t,e)}),la=m(Ke,m(Su,dn(4),function(n){var r=n.d;return l(sa,n.a,n.b,da(2147483648|1073741823&n.c),r)}),w(z,sa,sn,sn,sn,sn)),va={$:0},$a=h(function(n,r){switch(r.$){case 3:return{$:3,a:n(r.a)};case 1:return le;case 0:return va;default:return{$:2,a:r.a}}}),ha=h(function(n,r){var t;return r.b?(t=r.b,y(n,r=r.a)?t:m(v,r,m(ha,n,t))):x}),ga=Jn,ma=Jn,pa=h(function(n,r){return p(lt,function(t){return h(function(n,r){return r.push(t(n)),r})}(n),[],r)}),wa=null,ya=function(n){return p(lt,h(function(n,r){return p(Mn,n.a,n.b,r)}),{},n)},ka=Jn,An=i(function(n,r,t,e,u,a){return F(Ku,n,r,t,e,u,m(Fr,"application/json",m(bt,0,a)))}),Aa=An("PATCH")(xn),xa=An("POST")(xn),ja=h(function(n,r){var t,n=n.M,e=g(function(n,r,t){return l(n,r,pe,su,Me(t))});return 3===r.$?(t=(r=r.a).a).$?p(e,xa,n+"brackets",r):p(e,Aa,n+("brackets/"+C(t.a)),r):O}),_a=rn,Na=on,Ca=g(function(n,r,t){return 0>1,A(r,r),1&n?A(t,r):t):t}),Ba=h(function(n,r){return p(Ca,n,r,"")}),Ta=g(function(n,r,t){return A(m(Ba,n-Qt(t),function(n){return m(Na,n,"")}(r)),t)}),La=function(n){return Z(n).join("")},Ea=h(function(n,r){for(;;){if(!r)return La(n);var t=function(){switch(15&r){case 0:return"0";case 1:return"1";case 2:return"2";case 3:return"3";case 4:return"4";case 5:return"5";case 6:return"6";case 7:return"7";case 8:return"8";case 9:return"9";case 10:return"a";case 11:return"b";case 12:return"c";case 13:return"d";case 14:return"e";default:return"f"}}();n=m(v,t,n),r=r>>>4}}),Oa=h(function(n,r){var t=r.b,e=r.c,u=r.d;return A(p(Ta,8,"0",m(Ea,x,r.a)),A(n,A(p(Ta,4,"0",m(Ea,x,t>>>16)),A(n,A(p(Ta,4,"0",m(Ea,x,65535&t)),A(n,A(p(Ta,4,"0",m(Ea,x,e>>>16)),A(n,A(p(Ta,4,"0",m(Ea,x,65535&e)),p(Ta,8,"0",m(Ea,x,u)))))))))))})("-"),Sa=function(n){return n.toUpperCase()},Ja=n(function(n,r,t,e){return{$:2,a:n,b:r,c:t,d:e}}),Ma=g(function(n,r,t){var e,u={a:r,b:t,c:n};n:for(;;)switch(u.a.$){case 0:return{a:{$:1,a:s=u.a.a},b:N};case 1:return{a:eu,b:N};case 2:switch(u.b.$){case 1:var a=u.a.a;return{a:l(Ja,s=u.b.a,a,0,N),b:N};case 2:var a=u.a.a,o=u.b;return{a:l(Ja,s=o.a,a,0,f=o.d),b:N};default:break n}case 3:if(2!==u.b.$||u.c)break n;return s=(e=u.b).a,y(u.a.a,a=e.b)?{a:{$:1,a:s},b:N}:{a:t,b:N};case 4:switch(u.b.$){case 1:var i=u.a,a=i.a,c=i.b,f=i.c;return{a:l(Ja,s=u.b.a,a,c,_(f)),b:N};case 2:var i=u.a,a=i.a,c=i.b,f=i.c,b=u.b,s=b.a;return y(c,b.c)?{a:t,b:N}:{a:l(Ja,s,a,c,_(f)),b:N};default:break n}default:switch(u.b.$){case 1:var d=u.a,a=d.a,f=d.b;return{a:eu,b:_({a:s=u.b.a,b:a,c:f})};case 2:d=u.a,a=d.a,f=d.b;return{a:eu,b:_({a:s=u.b.a,b:a,c:f})};default:break n}}return{a:t,b:N}})(!1),Ra=g(function(r,t,n){return m(T,function(n){return r(n)?t(n):n},n)}),wn=h(function(n,i){switch(n.$){case 0:var r=Oa(m(Ye,la,n.a).a);return{a:k(i,{an:_(r)}),b:O};case 1:var r=n.a,t=m(Ma,r,i.H),c=t.a,f=t.b;return{a:function(){for(;;){if(f.$)break;if(f.a.a.$){var r,t,e,u;if(1===f.a.b.$)return r=(n=f.a).a.a,t=(n=n.b.a).a,e=n.b,u=function(n){return y(n.a,t)?k(n,{f:m(T,function(n){return y(n.aa,e)?k(n,{h:_(r)}):n},n.f)}):n},k(i,{b:m($a,function(n){return k(n,{d:Oe(m(T,u,m(ca,n.d,r)))})},i.b),i:!0,H:c});break}var n,a,o;if(f.a.b.$)break;return a=(n=f.a).a.a,o=n.b.a,k(i,{b:m($a,function(n){return k(n,{d:p(Ra,function(n){return y(n.a,a)},function(n){return k(n,{m:o})},n.d)})},i.b),i:!0,H:c})}return k(i,{H:c})}(),b:m(J,O,m(ia,m(Su,function(n){return n.bn},fa),function(n){return n.$?N:_({bl:n.a,bn:n.b})}(r)))};case 2:return{a:k(i,{e:_(ua)}),b:O};case 3:var e=n.a;return{a:k(i,{b:m($a,l=function(n){return k(n,{c:e})},i.b),i:!0}),b:O};case 4:return{a:k(i,{i:!0,e:N}),b:O};case 5:return{a:k(i,{b:m($a,l=function(n){var r=Ir(n.n)+1,r=p($e,r,"Group "+C(r),!0);return k(n,{n:A(n.n,j([r]))})},i.b),i:!0}),b:O};case 6:return{a:k(i,{e:_({$:1,a:o=n.a})}),b:O};case 7:var u=k(o=n.a,{as:!o.as}),a=function(n){return p(Ra,function(n){return y(n.a,u.a)},function(n){return u},n)};return{a:k(i,{b:m($a,l=function(n){return k(n,{n:a(n.n)})},i.b),i:!0}),b:O};case 8:u=k(o=n.a,{c:e=n.b});return{a:k(i,{e:_({$:1,a:u})}),b:O};case 9:var o=n.a,a=function(n){return p(Ra,function(n){return y(n.a,o.a)},function(n){return o},n)};return{a:k(i,{b:m($a,l=function(n){return k(n,{n:a(n.n)})},i.b),i:!0,e:N}),b:O};case 10:o=n.a;return{a:k(i,{b:m($a,l=function(n){return k(n,{n:m(ha,o,n.n)})},i.b),i:!0,e:N}),b:O};case 11:var b=n.a;return{a:k(i,{b:m($a,l=function(n){return k(n,{d:1!==m(ba,b,n=n.d).$||(r=i.an).$?n:A(n,j([G(ou,N,r.a,N,!1,b,0,j([w(iu,0,!1,N,N,N),w(iu,1,!0,N,N,N)]))]))});var r},i.b),i:!0}),b:tu};case 12:var s=n.a,d=function(t){return y(t.a,s.a)?k(t,{am:!0,f:x}):k(t,{f:m(T,function(n){var r=n.h;n:for(;;){if(r.$)break;switch(r.a.$){case 1:case 2:return y(r.a.a,t.a)?k(n,{h:N}):n;default:break n}}return n},t.f)})};return{a:k(i,{b:m($a,l=function(n){return k(n,{d:m(T,d,n.d)})},i.b),i:!0,e:N}),b:O};case 13:return{a:k(i,{e:_({$:2,a:s=n.a})}),b:O};case 14:var e=n.a,d=h(function(n,r){var t=""===e?N:_(e);return k(r,{al:m(oa,function(n){var r,n={a:n.c,b:t};return!n.a.$&&!n.b.$&&(r=n.b.a,y(Sa(n.a.a),Sa(r)))},n)?_("Name is already being used."):N,c:t})}),l=h(function(r,t){return k(t,{d:p(Ra,function(n){return y(n.a,r.a)},function(n){return m(d,t.d,r)},t.d)})});return{a:(t=i.e).$||2!==t.a.$?i:(t=t.a.a,3===(r=i.b).$?k(i,{b:{$:3,a:m(l,t,r=r.a)},i:!0,e:_({$:2,a:m(d,r.d,t)})}):i),b:O};case 15:var v=n.a,$=n.b,d=g(function(o,i,n){var r=function(){var n=m(dt,"_",$);if(!n.b)return N;var r,t=n.a,e=n.b,u=(n=Se(e)).$||(n=Kt(n.a)).$?N:(r=n.a,(n=m(S,function(n){return y(n.a,r)},o)).$?N:_(n.a.a)),a=function(){var r,n=Se(e);return n.$?N:(r=n.a,(n=m(S,function(n){return y(n.a,r)},i)).$?N:_(n.a.a))}();switch(t){case"team":return m(ia,ye,u);case"winner":return m(ia,ke,a);case"loser":return m(ia,we,a);default:return N}}();return k(n,{f:m(T,function(n){return y(n.aa,v)?k(n,{h:r,B:r.$||r.a.$?N:_(r.a.a)}):n},n.f)})}),l=g(function(r,t,e){return k(e,{d:Oe(m(T,function(n){return y(n.a,r.a)?p(d,t,e.d,r):n},e.d))})});return{a:function(){var n,r,t={a:i.e,b:i.ac,c:i.b};return t.a.$||2!==t.a.a.$||3!==t.b.$||3!==t.c.$?i:k(i,{b:{$:3,a:p(l,n=t.a.a.a,r=t.b.a,t=t.c.a)},i:!0,e:_({$:2,a:p(d,r,t.d,n)})})}(),b:O};case 16:return{a:k(i,{e:N}),b:O};case 17:return{a:k(i,{i:!1}),b:m(ja,i.V,i.b)};case 18:return{a:k(i,{e:_(aa)}),b:O};case 19:return{a:k(i,{b:le,i:!1,e:N}),b:Ee(i.V)};case 20:return{a:k(i,{ac:f=n.a}),b:O};case 21:return{a:k(i,{b:m($a,l=function(n){return k(n,{n:m(_a,function(n){return n.a},n.n)})},f=n.a)}),b:O};case 22:return{a:k(i,{e:_(ea)}),b:O};case 23:return{a:k(i,{b:m($a,function(n){return m(he,n.a,n.c)},i.b),i:!0,e:N}),b:O};default:return{a:k(i,{e:N}),b:O}}}),Da=h(function(n,r){return m(sr,n,ka(r))}),M=Da("className"),Ha=f("h3"),qa=f("p"),R=ir,Pa={$:5},Fa={$:17},Ga=f("a"),Ia=f("button"),Wa=h(function(t,n){return p(ae,h(function(n,r){return t(n)?m(v,n,r):r}),x,n)}),mn=h(function(n,r){return m(sr,n,ga(r))}),za=mn("disabled"),D=f("div"),Qa=fr,Xa=h(function(n,r){return m(Qa,n,{$:0,a:r})}),Va={$:2},Ya=f("h2"),Ua=h(function(r,n){return m(J,4,qe(m(T,function(n){return n.m.Q+3},m(Wa,function(n){return y(n.m.X,r.a)},n))))}),Ka=f("table"),Za={$:1},no=h(function(n,r){return{$:0,a:n,b:r}}),ro=h(function(n,r){return m(dr,function(n){return/^(on|formAction$)/i.test(n)?"data-"+n:n}(n),function(n){return/^\s*(javascript:|data:text\/html)/i.test(n)?"":n}(r))}),to=g(function(n,r,t){return n(r(t))}),eo=h(function(n,r){return m(Qa,n,{$:3,a:r})}),uo=g(function(n,r,t){var e=r.aA,u=r.aw;return m(eo,n,m(a,function(n){return{E:n,aw:u,aA:e}},t))}),ao=hn,oo=h(function(n,r){return j([m(ro,"draggable","true"),p(uo,"dragstart",{aw:!1,aA:!0},m(a,m(to,n,no(r)),ao)),p(uo,"dragend",{aw:!1,aA:!0},e(n(Za)))])}),io=br,co=h(function(r,n){function t(n){return!r.$&&1===r.a.$&&y(n,r.a.a)}return j([m(D,A(j([He(j([{a:"game-result-connector",b:!0},{a:"dragging-connector",b:t({$:1,a:n})}]))]),m(oo,Pe,{$:1,a:{$:1,a:n}})),j([m(D,j([M("game-result-connector-icon game-result-connector-winner")]),j([R("W")]))])),m(D,A(j([He(j([{a:"game-result-connector",b:!0},{a:"dragging-connector",b:t({$:2,a:n})}]))]),m(oo,Pe,{$:1,a:{$:2,a:n}})),j([m(D,j([M("game-result-connector-icon game-result-connector-loser")]),j([R("L")]))]))])}),fo=g(function(n,r,t){return{$:4,a:n,b:r,c:t}}),bo=h(function(n,r){return{$:5,a:n,b:r}}),Or=n(function(n,r,t,e){return{aK:r,ba:n,bb:t,bc:e}}),Vn=h(function(n,r){return p(ae,u,r,n)}),V=$n,_n=un,so=w(Mr,Or,m(Vn,j(["currentTarget","clientWidth"]),t),m(Vn,j(["currentTarget","clientHeight"]),t),m(a,_n,m(Vn,j(["offsetX"]),V)),m(a,_n,m(Vn,j(["offsetY"]),V))),lo=m(a,_n,m(Vn,j(["timeStamp"]),V)),vo=h(function(n,r){return j([p(uo,"dragenter",{aw:!0,aA:!0},e(n({$:2,a:r}))),p(uo,"dragleave",{aw:!0,aA:!0},e(n({$:3,a:r}))),p(uo,"dragover",{aw:!0,aA:!1},m(a,n,p(Ft,fo(r),lo,so))),p(uo,"drop",{aw:!0,aA:!0},m(a,m(to,n,bo(r)),so))])}),$o=c(function(n,r,a,o,t,e,i){var u=e?{a:"game-bottom",b:!0}:{a:"game-top",b:!0},c=function(){var n=i.h;if(n.$)return"TBD";switch(n.a.$){case 0:var r=n.a.a,t=m(S,function(n){return y(n.a,r)},a);return t.$?"TBD":t.a.c;case 1:var r=n.a.a,t=m(S,function(n){return y(n.a,r)},o);return t.$?"TBD":(e=t.a,(t=i.B).$?"W: "+m(J,"TDB",e.c):(u=t.a,m(J,m(J,"",e.c),m(ia,function(n){return n.c},m(S,function(n){return y(n.a,u)},a)))));default:var e,u,r=n.a.a,t=m(S,function(n){return y(n.a,r)},o);return t.$?"TBD":(e=t.a,(t=i.B).$?"L: "+m(J,"TDB",e.c):(u=t.a,m(J,m(J,"",e.c),m(ia,function(n){return n.c},m(S,function(n){return y(n.a,u)},a)))))}}(),r=!t.S&&(!(n={a:n,b:r}).a.$&&1===n.a.a.$&&!n.b.$&&1===n.b.a.$&&!!y(n.b.a.a,{a:t.a,b:e}));return m(D,A(j([He(j([u,{a:"drop-target",b:r}]))]),m(vo,Pe,{$:1,a:{a:t.a,b:e}})),j([R(c)]))}),ho=r(function(t,e,u,a,o){var n=!t.$&&!t.a.$&&y(t.a.a,o.a);return m(D,A(j([He(j([{a:"game",b:!0},{a:"dragging-game",b:n}])),m(io,"left",C(50*o.m.N)+"px"),m(io,"top",C(50*o.m.Q)+"px"),Fe({$:13,a:o})]),m(oo,Pe,{$:0,a:o.a})),j([m(D,j([M("d-flex game-header")]),j([m(D,j([M("game-name flex-fill")]),j([R(m(J,"TDB",o.c))])),2===o.S?R(""):m(D,j([M("game-delete align-self-end"),L({$:12,a:o})]),j([R("✘")]))])),m(D,j([M("game-body d-flex")]),j([m(D,j([M("game-positions flex-fill")]),m(gt,h(function(n,r){return G($o,t,e,u,a,o,n,r)}),o.f)),m(D,j([M("align-self-end ml-1")]),m(co,t,o.a))]))]))}),go=r(function(n,r,t,e,u){return m(D,j([M("games")]),m(T,l(ho,n,r,t,e),u))}),mo=f("tr"),po=f("td"),wo=i(function(n,r,t,e,u,a){e=p(au,e.a,a,u),u=!((a={a:r,b:t}).a.$||a.a.a.$||a.b.$||a.b.a.$)&&!!y(a.b.a.a,e),r=Ie(n.d);m(ba,e,r);return m(po,A(j([m(io,"width",C(50)+"px"),m(io,"height",C(50)+"px"),He(j([{a:"drop-target",b:u}]))]),A(m(vo,Pe,{$:0,a:e}),j([Fe({$:11,a:e})]))),j([R("")]))}),yo=r(function(n,r,t,e,u){var a=Ie(n.d);return m(mo,x,m(T,w(wo,n,r,t,e,u),m(ht,0,Ge(a)-1)))}),ko=g(function(n,r,t){return{W:r,aH:n,ae:t}}),Ao=h(function(n,r){return r.b?p(ae,v,r,n):n}),xo=dr("fill"),jo=dr("height"),_o=dr("points"),I=cr("http://www.w3.org/2000/svg"),No=I("polyline"),Co=dr("stroke"),Bo=dr("stroke-dasharray"),To=dr("stroke-opacity"),Lo=I("svg"),Eo=dr("width"),Oo=h(function(n,i){function r(n){return C(n.a)+(","+C(n.b))+" "}var t=m(Xu,Vr,(t=m(T,function(o){var n=h(function(n,r){var t=_({a:50*o.m.N+1,b:50*o.m.Q+(n?57:32)}),e=h(function(r,n){var t=m(S,function(n){return y(n.a,r)},i);return t.$?N:_({a:50*(t=t.a).m.N+175,b:50*t.m.Q+(n?57:32)})}),u=r.h;n:for(;;){if(u.$)break;switch(u.a.$){case 1:var a={a:m(e,u.a.a,0),b:t};return a.a.$||a.b.$?N:_(p(ko,0,a.a.a,a.b.a));case 2:a={a:m(e,u.a.a,1),b:t};return a.a.$||a.b.$?N:_(p(ko,1,a.a.a,a.b.a));default:break n}}return N});return m(gt,n,o.f)},i),p(ae,Ao,x,t)));return m(D,j([M("group-lines")]),j([m(Lo,j([Eo(C(50*(Ge(i)+1))),jo(C(50*(m(Ua,n,i)-1)))]),m(T,function(n){return m(No,j([xo("none"),To("0.5"),Bo("3"),Co(n.aH?"red":"green"),_o(A(r({a:n.W.a+6,b:n.W.b}),A(r({a:n.W.a+11,b:n.W.b}),A(r({a:n.ae.a-8,b:n.ae.b}),r({a:n.ae.a-3,b:n.ae.b})))))]),x)},t))]))}),So=r(function(n,r,t,e,u){var a=Ie(r.d),o=m(Wa,function(n){return y(n.m.X,u.a)},a);return m(D,j([M("group-container")]),j([m(D,j([M("d-flex")]),j([m(D,j([M("group-name btn btn-default"),L({$:7,a:u})]),j([R("☷ "+u.c)])),m(D,j([M("btn btn-default px-0"),L({$:6,a:u})]),j([R("✎")]))])),m(D,j([M("group")]),j(u.as?[m(Oo,u,o),m(Ka,x,m(T,l(yo,r,t,e,u),m(ht,0,m(Ua,u,a)-1))),w(go,t,e,n,a,o)]:[m(D,j([M("text-muted group-hide")]),j([R("...")]))]))]))}),Jo=n(function(n,r,t,e){return m(D,x,m(T,l(So,n,r,t,e),r.n))}),en={$:24},Mo=f("h5"),Ro=m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Confirm Clear")]))])),m(D,j([M("modal-body")]),j([m(qa,x,j([R("DANGER: This will empty out the bracket so you can start over. Nothing will be saved until you click the Save button, but you will lose any changes made since the last save. Are you sure you want to continue?")]))])),m(D,j([M("modal-footer")]),j([m(Ia,j([L({$:23}),M("btn btn-danger mr-2")]),j([R("Continue")])),m(Ia,j([L(en),M("btn btn-secondary mr-2")]),j([R("Cancel")]))]))])),Do={$:4},Ho=Da("id"),qo=f("input"),Po=h(function(n,r){return m(Qa,n,{$:1,a:r})}),Fo=m(Vn,j(["target","value"]),fu),Go=Da("title"),Io=function(n){return n.trim()},Wo=Da("value"),zo={$:16},Qo=h(function(n,r){return{$:15,a:n,b:r}}),Xo=Da("htmlFor"),Vo=f("i"),Yo=f("label"),Uo=f("option"),Ko=f("select"),Zo=mn("selected"),ni=g(function(n,r,e){var t,u,a=g(function(n,r,t){r=!(r=r.h).$&&!r.a.$&&y(r.a.a,t.a);return m(Uo,j([Wo("team_"+C(t.a)),Zo(r)]),j([R(t.c)]))}),o=Ie(r.d),i=(r=A(m(T,function(n){return _({$:1,a:n.a})},o),m(T,function(n){return _({$:2,a:n.a})},o)),m(Xu,Vr,m(Wa,function(r){function t(n){return y(r,n.h)}return 1===r.$||(!r.a.$||!m(Wa,function(n){return!y(n.a,e.a)&&!!m(Wa,t,n.f).b},o).b)},m(Wa,function(n){return!(y(n,_({$:1,a:e.a}))||y(n,_({$:2,a:e.a})))},r)))),c=(t=m(Wa,function(n){return!y(n.a,e.a)},o),u=h(function(r,n){return m(oa,function(n){n=n.h;return!n.$&&!n.a.$&&y(n.a.a,r.a)},n.f)}),m(Wa,function(n){return!m(Wa,u(n),t).b},n)),f=g(function(n,r,t){var e=function(){function n(r){return m(ia,function(n){return m(J,"TBD",n.c)},m(S,function(n){return y(n.a,r)},o))}switch(t.$){case 1:return _("Winner of "+m(J,"TBD",n(t.a)));case 2:return _("Loser of "+m(J,"TBD",n(t.a)));default:return N}}(),u=function(){switch(t.$){case 1:return _("winner_"+t.a);case 2:return _("loser_"+t.a);default:return N}}(),r=y(r.h,_(t)),u={a:u,b:e};return u.a.$||u.b.$?R(""):(e=u.b.a,m(Uo,j([Wo(u.a.a),Zo(r)]),j([R(e)])))}),b=h(function(n,r){return A(j([m(Uo,x,x)]),A(m(T,m(a,n,r),c),m(T,m(f,n,r),i)))}),r=h(function(n,r){return m(D,j([M("form-group")]),j([m(Yo,j([Xo("editing-game")]),j([R("Team")])),m(Ko,j([M("form-control"),Ho("editing-game"),Qe(Qo(n)),za(!!e.S)]),m(b,n,r))]))});return m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Edit Game")]))])),m(D,j([M("modal-body")]),A(j([(n=e.al).$?R(""):(n=n.a,m(D,j([M("alert alert-danger")]),j([R(n)]))),m(D,j([M("form-group")]),j([m(Yo,j([Xo("editing-game-name")]),j([R("Game Name")])),m(qo,j([M("form-control"),Ho("editing-game-name"),Wo(m(J,"",e.c)),Qe(Xe)]),x)]))]),m(gt,r,e.f))),m(D,j([M("modal-footer d-flex justify-content-between")]),j([m(D,j([M("text-left")]),j([e.S?m(Vo,j([M("text-danger")]),j([R("Teams cannot be assigned after game starts.")])):R("")])),m(Ia,j([L(zo),M("btn btn-primary mr-2"),za(!y(e.al,N))]),j([R("Close")]))]))]))}),ri=h(function(n,r){return{$:8,a:n,b:r}}),ti=h(function(n,r){var t=""===Io(r.c),n=Ie(n.d),n=!!m(Wa,function(n){return y(n.m.X,r.a)},n).b;return m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Group Name")]))])),m(D,j([M("modal-body")]),j([m(D,j([M("form-group")]),j([m(qo,j([M("form-control"),Ho("editing-group-name"),Wo(r.c),Qe(ri(r))]),x)]))])),m(D,j([M("modal-footer d-flex justify-content-between")]),j([m(Ia,j([L({$:10,a:r}),M("btn btn-danger mr-2"),za(n),Go(n?"Remove games from this group first":"")]),j([R("Remove")])),m(Ia,j([L({$:9,a:r}),M("btn btn-primary"),za(t),Go(t?"Name is required":"")]),j([R("Close")]))]))]))}),ei=m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Confirm Revert")]))])),m(D,j([M("modal-body")]),j([m(qa,x,j([R("DANGER: This will revert all of your changes since the last save. Are you sure you want to continue?")]))])),m(D,j([M("modal-footer")]),j([m(Ia,j([L({$:19}),M("btn btn-danger mr-2")]),j([R("Continue")])),m(Ia,j([L(en),M("btn btn-secondary mr-2")]),j([R("Cancel")]))]))])),ui=g(function(t,e,u){return m(D,j([M("modal"),m(io,"display","block")]),j([m(D,j([M("modal-dialog")]),j([function(){if(t.$)return R("");switch(t.a.$){case 0:return r=""===Io(n=u.c),m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Bracket Name")]))])),m(D,j([M("modal-body")]),j([m(D,j([M("form-group")]),j([m(qo,j([M("form-control"),Ho("editing-bracket-name"),Wo(n),Qe(We)]),x)]))])),m(D,j([M("modal-footer d-flex justify-content-between")]),j([m(Ia,j([L(Do),M("btn btn-primary"),za(r),Go(r?"Name is required":"")]),j([R("Close")]))]))]));case 1:return m(ti,u,t.a.a);case 2:return p(ni,e,u,t.a.a);case 3:return ei;default:return Ro}var n,r}()]))]))}),ai=g(function(n,r,t){var e,u=n.V,a=n.e,o=n.H,n=n.i,i=!y(a,N),c=function(n){switch(n.$){case 0:return N;case 1:return N;default:return _(n.b)}}(o),o=function(n){switch(n.$){case 0:return N;case 1:return _(r=n.a);default:var r=n.a;return _(r)}}(o);return m(D,j([He(j([{a:"modal-open",b:i}]))]),j([m(D,j([M("py-3")]),j([(e=t.c,m(D,j([M("d-flex bracket-name")]),j([m(Ya,j([L(Va)]),j([R(e)])),m(Ya,j([M("ml-2"),L(Va)]),j([R("✎")]))]))),l(Jo,r,t,o,c),m(Ia,j([M("btn btn-primary"),L(Pa)]),j([R("Add Group")])),i?p(ui,a,r,t):m(D,j([M("save-buttons")]),j([m(Ia,j([M("btn btn-primary mr-1"),za(!n),L(Fa)]),j([R("Save")])),m(Ga,j([M("btn btn-secondary"),(e=u.M+"stages",m(Da,"href",/^javascript:/i.test((e=e).replace(/\s/g,""))?"":e))]),j([R("Exit")]))]))])),m(D,j([He(j([{a:"modal-backdrop",b:i},{a:"show",b:i}]))]),x)]))}),W=nn({bv:function(n){return{a:{b:n.a.$?{$:3,a:m(he,N,"Playoffs")}:le,i:!1,H:uu,V:n,an:N,e:N,ac:le},b:ve(j([function(n){return p(Zu,n.M+"teams",na,ra)}(n),n.a.$?O:Ee(n),tu]))}},bL:function(n){return ta},bO:wn,bP:function(n){var r={a:n.ac,b:n.b};n:for(;;){r:for(;;){t:for(;;){e:for(;;)switch(r.a.$){case 3:switch(r.b.$){case 3:return p(ai,n,r.a.a,r.b.a);case 0:break n;case 1:break t;default:var t=r.b.a;return m(qa,j([M("mt-5 text-center text-danger")]),j([R(Re(t))]))}case 0:return m(Ha,j([M("mt-5 text-center")]),j([R("Initializing...")]));case 1:if(0!==r.b.$)break r;break n;default:switch(r.b.$){case 0:break n;case 1:break t;default:break e}}t=r.a.a;return m(qa,j([M("mt-5 text-center text-danger")]),j([R(Re(t))]))}return m(Ha,j([M("mt-5 text-center")]),j([R("Loading...")]))}return m(Ha,j([M("mt-5 text-center")]),j([R("Loading...")]))}return m(Ha,j([M("mt-5 text-center")]),j([R("Initializing...")]))}});pn={BracketBuilder:{init:W(m(Pt,function(r){return m(Pt,function(n){return e({M:n,a:r})},m(u,"baseUrl",fu))},m(u,"id",cu(j([yn(N),m(a,_,t)])))))(0)}},o.Elm?function n(r,t){for(var e in t)e in r?"init"==e?Q(6):n(r[e],t[e]):r[e]=t[e]}(o.Elm,pn):o.Elm=pn}(this); \ No newline at end of file +!function(o){"use strict";function H(n,r,t){return t.a=n,t.f=r,t}function h(t){return H(2,t,function(r){return function(n){return t(r,n)}})}function g(e){return H(3,e,function(t){return function(r){return function(n){return e(t,r,n)}}})}function n(u){return H(4,u,function(e){return function(t){return function(r){return function(n){return u(e,t,r,n)}}}})}function r(a){return H(5,a,function(u){return function(e){return function(t){return function(r){return function(n){return a(u,e,t,r,n)}}}}})}function i(o){return H(6,o,function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return o(a,u,e,t,r,n)}}}}}})}function c(i){return H(7,i,function(o){return function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return i(o,a,u,e,t,r,n)}}}}}}})}function q(c){return H(8,c,function(i){return function(o){return function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return c(i,o,a,u,e,t,r,n)}}}}}}}})}function P(f){return H(9,f,function(c){return function(i){return function(o){return function(a){return function(u){return function(e){return function(t){return function(r){return function(n){return f(c,i,o,a,u,e,t,r,n)}}}}}}}}})}function m(n,r,t){return 2===n.a?n.f(r,t):n(r)(t)}function p(n,r,t,e){return 3===n.a?n.f(r,t,e):n(r)(t)(e)}function l(n,r,t,e,u){return 4===n.a?n.f(r,t,e,u):n(r)(t)(e)(u)}function w(n,r,t,e,u,a){return 5===n.a?n.f(r,t,e,u,a):n(r)(t)(e)(u)(a)}function F(n,r,t,e,u,a,o){return 6===n.a?n.f(r,t,e,u,a,o):n(r)(t)(e)(u)(a)(o)}function G(n,r,t,e,u,a,o,i){return 7===n.a?n.f(r,t,e,u,a,o,i):n(r)(t)(e)(u)(a)(o)(i)}var I=g(function(n,r,t){for(var e=Array(n),u=0;u"),r});function Q(n){throw Error("https://github.com/elm/core/blob/1.0.0/hints/"+n+".md")}function y(n,r){for(var t,e=[],u=X(n,r,0,e);u&&(t=e.pop());u=X(t.a,t.b,0,e));return u}function X(n,r,t,e){if(n!==r){if("object"!=typeof n||null===n||null===r)return"function"==typeof n&&Q(5),!1;if(100a||a>56319?(e[u]=n(r[u]),u++):(e[u]=n(r[u]+r[u+1]),u+=2)}return e.join("")}),h(function(n,r){for(var t=[],e=r.length,u=0;uo)return u}var d=t.$;if(4===d){for(var l=t.k;4===l.$;)l=l.k;return n(r,l,e,u,a+1,o,r.elm_event_node_ref)}var v=t.e;var $=r.childNodes;for(var h=0;ho))return u;a=m}return u}(n,r,t,0,0,r.b,e)}function Tr(n,r,t,e){return 0===t.length?n:(Br(n,r,t,e),Lr(n,t))}function Lr(n,r){for(var t=0;t>n});Mr=h(function(n,r){return r>>>n});h(function(t,e){return{$:2,b:function(n){var r=setInterval(function(){qn(e)},t);return function(){clearInterval(r)}},c:null}});var Hr=g(function(e,u,a){return{$:2,b:function(r){function t(n){r(u(a.at.a(n)))}var n=new XMLHttpRequest;n.addEventListener("error",function(){t($u)}),n.addEventListener("timeout",function(){t(mu)}),n.addEventListener("load",function(){t(function(n,r){return m(200<=r.status&&r.status<300?vu:du,function(n){return{aB:n.responseURL,bI:n.status,bJ:n.statusText,aJ:function(n){if(!n)return wu;for(var r=wu,t=n.split("\r\n"),e=t.length;e--;){var u,a,o=t[e],i=o.indexOf(": ");0>>0,r)}var _=function(n){return{$:0,a:n}},N={$:1},v=K,Kr=z,Zr=(g(function(t,n,r){var e=r.c,r=r.d,u=h(function(n,r){return p(Kr,n.$?t:u,r,n.a)});return p(Kr,u,p(Kr,t,n,r),e)}),g(function(n,r,t){for(;;){if(-2===t.$)return r;var e=t.d,u=n,a=p(n,t.b,t.c,p(Zr,n,r,t.e));n=u,r=a,t=e}})),nt=function(n){return p(Zr,g(function(n,r,t){return m(v,{a:n,b:r},t)}),x,n)},rt=1,tt=2,et=0,$=function(n){return{$:1,a:n}},ut=h(function(n,r){return{$:3,a:n,b:r}}),at=h(function(n,r){return{$:0,a:n,b:r}}),ot=h(function(n,r){return{$:1,a:n,b:r}}),it=function(n){return{$:0,a:n}},ct=function(n){return{$:2,a:n}},ft=sn,bt=Sn,C=function(n){return n+""},st=h(function(n,r){return m(fn,n,Z(r))}),dt=h(function(n,r){return j(m(cn,n,r))}),lt=g(function(n,r,t){for(;;){if(!t.b)return r;var e=t.b,u=n,a=m(n,t.a,r);n=u,r=a,t=e}}),vt=nn,$t=g(function(n,r,t){for(;;){if(1<=b(n,r))return t;var e=n,u=r-1,a=m(v,r,t);n=e,r=u,t=a}}),ht=h(function(n,r){return p($t,n,r,x)}),gt=h(function(n,r){return p(vt,n,m(ht,0,Ir(r)-1),r)}),mt=function(n){var r=n.charCodeAt(0);return r<55296||56319>>4+(n>>>28)))>>>22^n)>>>0}function pe(n){return{$:21,a:n}}function we(n){return{$:2,a:n}}function ye(n){return{$:0,a:n}}function ke(n){return{$:1,a:n}}function Ae(n){return cu(j([m(a,_,n),e(N)]))}function xe(n){var r,t,e,u,a,o,i,c;return-1===n.$&&-1===n.d.$&&-1===n.e.$?-1!==n.e.d.$||n.e.d.a?(e=(c=n.e).b,u=c.c,a=c.d,c=c.e,w(E,1,n.b,n.c,w(E,0,(r=n.d).b,r.c,r.d,r.e),w(E,0,e,u,a,c))):(e=(t=n.e).b,u=t.c,o=(a=t.d).d,i=a.e,c=t.e,w(E,0,a.b,a.c,w(E,1,n.b,n.c,w(E,0,(r=n.d).b,r.c,r.d,r.e),o),w(E,1,e,u,i,c))):n}function je(n){var r,t,e,u,a,o,i,c,f;return-1===n.$&&-1===n.d.$&&-1===n.e.$?-1!==n.d.d.$||n.d.d.a?(o=(f=n.e).b,i=f.c,c=f.d,f=f.e,w(E,1,r=n.b,t=n.c,w(E,0,(u=n.d).b,u.c,u.d,u=u.e),w(E,0,o,i,c,f))):(r=n.b,t=n.c,u=(e=n.d).e,o=(a=n.e).b,i=a.c,c=a.d,f=a.e,w(E,0,e.b,e.c,w(E,1,(a=e.d).b,a.c,a.d,a.e),w(E,1,r,t,u,w(E,0,o,i,c,f)))):n}function _e(n){var r,t,e,u,a,o;return-1===n.$&&-1===n.d.$?(r=n.a,t=n.b,e=n.c,o=(u=n.d).d,a=n.e,1===u.a?-1!==o.$||o.a?-1===(o=xe(n)).$?(n=o.e,w(ju,o.a,o.b,o.c,_e(o.d),n)):pu:w(E,r,t,e,_e(u),a):w(E,r,t,e,_e(u),a)):pu}function Ne(n){return{$:4,a:n}}function Ce(n){return 1===n.$?{$:2,a:n.a}:{$:3,a:n.a}}function Be(n){return Uu(Fu({bf:!1,bh:n.bh,at:n.at,aJ:n.aJ,bx:n.bx,bM:n.bM,a8:n.a8,aB:n.aB}))}function Te(n){return Uu(Fu({bf:!0,bh:n.bh,at:n.at,aJ:n.aJ,bx:n.bx,bM:n.bM,a8:n.a8,aB:n.aB}))}function Le(n){return n.P?Te:Be}function Ee(n){var r=n.M,r=(n=n.a).$?r+"brackets/new":r+("brackets/"+C(n.a));return p(Zu,r,pe,su)}function Oe(e){return m(T,function(n){return k(n,{f:m(T,function(t){var n=function(){function n(r){return m(J,x,m(ia,function(n){return n.f},m(S,function(n){return y(n.a,r)&&2===n.S},e)))}var r=t.g;if(1===r.$)return N;switch(r.a.$){case 1:return m(J,N,m(ia,function(n){return n.B},m(S,function(n){return y(n.ax,_(0))},n(r.a.a))));case 2:return m(J,N,m(ia,function(n){return n.B},m(S,function(n){return y(n.ax,_(1))},n(r.a.a))));default:return t.B}}();return k(t,{B:n})},n.f)})},e)}function Se(n){return n.b?_(n.a):N}function Je(n){return m(pa,function(n){var r;return ya(j([{a:"id",b:ka(n.a)},{a:"name",b:(r=n.c).$?wa:ka(r.a)},{a:"_delete",b:ga(n.am)},{a:"game_positions",b:m(pa,function(n){return ya(j([{a:"position",b:ma(n.aa)},{a:"first_hammer",b:ga(n.aF)},{a:"team_id",b:(r=n.B).$?wa:ma(r.a)},{a:"winner_id",b:(r=n.g).$||1!==r.a.$?wa:ka(r.a.a)},{a:"loser_id",b:(r=n.g).$||2!==r.a.$?wa:ka(r.a.a)}]));var r},n.f)},{a:"coords",b:ya(j([{a:"group_id",b:ma((r=n.m).X)},{a:"col",b:ma(r.N)},{a:"row",b:ma(r.Q)}]))}]))},n)}function Me(n){return ya(j([{a:"id",b:(r=n.a).$?wa:ma(r.a)},{a:"name_en",b:ka(n.c)},{a:"groups",b:m(pa,function(n){return ya(j([{a:"id",b:ma(n.a)},{a:"name",b:ka(n.c)}]))},n.n)},{a:"games",b:Je(n.d)}]));var r}function Re(n){switch(n.$){case 0:return n.a;case 1:return"Server is taking too long to respond. Please try again later.";case 2:return"Unable to reach server.";case 3:return"Request failed with status code: "+C(n.a);default:return n.a}}function De(n){return n.b}function He(n){return M(m(st," ",m(T,Xr,m(Wa,De,n))))}function L(n){return m(Xa,"click",e(n))}function qe(n){return n.b?_(p(lt,Ot,n.a,n.b)):N}function Pe(n){return{$:1,a:n}}function Fe(n){return m(Xa,"dblclick",e(n))}function Ge(n){return m(J,10,qe(m(T,function(n){return n.m.N+5},n)))}function Ie(n){return m(Wa,function(n){return!n.am},n)}function We(n){return{$:3,a:n}}function ze(n){return{a:n,b:!0}}function Qe(n){return m(Po,"input",m(a,ze,m(a,n,Fo)))}function Xe(n){return{$:14,a:n}}var Ve,I=m(oe,function(n){return ee(function(n){var r=Ur(m(ge,0,1013904223));return Ur(m(ge,r.a+n>>>0,r.b))}(n))},{$:2,b:function(n){n({$:0,a:Ve(Date.now())})},c:null}),Ye=h(function(n,r){return n(r)}),Ue=g(function(r,n,t){var e,u;return n.b?(e=n.b,n=m(Ye,n.a,t),u=n.b,m(oe,function(n){return p(Ue,r,e,u)},m(fe,r,n.a))):ee(t)}),en=g(function(n,r,t){return ee(t)}),Ke=h(function(t,n){var e=n;return function(n){var n=e(n),r=n.b;return{a:t(n.a),b:r}}}),W=h(function(n,r){return m(Ke,n,r)}),Ze=(d.Random={b:I,c:Ue,d:en,e:W,f:void 0},Yn("Random")),pn=h(function(n,r){return Ze(m(Ke,n,r))}),nu=h(function(c,f){return function(n){var r=b(c,f)<0?{a:c,b:f}:{a:f,b:c},t=r.a,e=r.b-t+1;if(!(e-1&e))return{a:((e-1&me(n))>>>0)+t,b:Ur(n)};for(var u=(-e>>>0)%e>>>0,a=n;;){var o=me(a),i=Ur(a);if(0<=b(o,u))return{a:o%e+t,b:i};a=i}}}),ru=n(function(u,n,r,t){var a=n,o=r,i=t;return function(n){var n=a(n),r=n.a,n=o(n.b),t=n.a,n=i(n.b),e=n.b;return{a:p(u,r,t,n.a),b:e}}}),tu=m(pn,function(n){return{$:0,a:n}},function(n){var r=g(function(n,r,t){return Ur(m(ge,n,(1|r^t)>>>0))}),t=m(nu,0,4294967295);return m(Ye,l(ru,r,t,t,t),n)}),eu={$:0},uu=eu,wn=n(function(n,r,t,e){return{d:e,n:t,a:n,c:r}}),au=g(function(n,r,t){return{N:r,X:n,Q:t}}),ou=c(function(n,r,t,e,u,a,o){return{m:u,al:n,a:r,am:e,c:t,f:o,S:a}}),iu=r(function(n,r,t,e,u){return{g:t,aF:r,aa:n,ax:u,B:e}}),yn=vn,t=ln,bn=function(n){return{$:3,b:n}},dn=kn,Xn=xn,K=jn,cu=function(n){return{$:11,g:n}},fu=gn,bu=function(n){return n.toLowerCase()},Or=(z=m(Pt,function(n){return e("won"===n?0:1)},fu),sn=cu(j([m(a,ke,m(u,"winner_id",fu)),m(a,we,m(u,"loser_id",fu)),m(a,ye,m(u,"team_id",t))])),sn=F(Xn,iu,m(u,"position",t),m(u,"first_hammer",yn),Ae(sn),Ae(m(u,"team_id",t)),Ae(m(u,"result",z))),z=m(Pt,function(n){switch(bu(n)){case"active":return e(1);case"complete":return e(2);default:return e(0)}},fu),Sn=l(dn,au,m(u,"group_id",t),m(u,"col",t),m(u,"row",t)),G(K,ou(N),m(u,"id",fu),Ae(m(u,"name",fu)),e(!1),m(u,"coords",Sn),m(u,"state",z),m(u,"game_positions",bn(sn)))),mn=l(dn,$e,m(u,"id",t),m(u,"name",fu),e(!0)),Mr=An,su=w(Mr,wn,Ae(m(u,"id",t)),m(u,"name",fu),m(u,"groups",bn(mn)),m(u,"games",bn(Or))),du=h(function(n,r){return{$:3,a:n,b:r}}),lu=function(n){return{$:0,a:n}},vu=h(function(n,r){return{$:4,a:n,b:r}}),$u={$:2},hu=function(n){return{$:1,a:n}},gu=function(n){return{$:0,a:n}},mu={$:1},pu={$:-2},wu=pu,yu=function(n){return!n.$},ku=Vn,Au=V,xu=h(function(n,r){for(;;){if(-2===r.$)return N;var t=r.c,e=r.d,u=r.e;switch(m(Au,n,r.b)){case 0:n=n,r=e;continue;case 1:return _(t);default:n=n,r=u;continue}}}),E=r(function(n,r,t,e,u){return{$:-1,a:n,b:r,c:t,d:e,e:u}}),ju=r(function(n,r,t,e,u){var a,o,i,c;return-1!==u.$||u.a?-1!==e.$||e.a||-1!==e.d.$||e.d.a?w(E,n,r,t,e,u):(a=e.d,c=e.e,w(E,0,e.b,e.c,w(E,1,a.b,a.c,a.d,a.e),w(E,1,r,t,c,u))):(a=u.b,o=u.c,i=u.d,u=u.e,-1!==e.$||e.a?w(E,n,a,o,w(E,0,r,t,e,i),u):w(E,0,r,t,w(E,1,e.b,e.c,e.d,c=e.e),w(E,1,a,o,i,u)))}),_u=g(function(n,r,t){if(-2===t.$)return w(E,0,n,r,pu,pu);var e=t.a,u=t.b,a=t.c,o=t.d,i=t.e;switch(m(Au,n,u)){case 0:return w(ju,e,u,a,p(_u,n,r,o),i);case 1:return w(E,e,u,r,o,i);default:return w(ju,e,u,a,o,p(_u,n,r,i))}}),Nu=g(function(n,r,t){n=p(_u,n,r,t);return-1!==n.$||n.a?n:w(E,1,n.b,n.c,n.d,n.e)}),Cu=c(function(n,r,t,e,u,a,o){if(-1!==a.$||a.a){for(;;){if(-1!==o.$||1!==o.a)break;if(-1!==o.d.$)return je(r);if(1===o.d.a)return je(r);break}return r}return w(E,t,a.b,a.c,a.d,w(E,0,e,u,a.e,o))}),Bu=h(function(n,r){var t,e,u,a,o,i,c;return-2===r.$?pu:(t=r.a,u=r.c,a=r.d,o=r.e,b(n,e=r.b)<0?-1===a.$&&1===a.a?-1!==(i=a.d).$||i.a?-1===(i=xe(r)).$?(c=i.e,w(ju,i.a,i.b,i.c,m(Bu,n,i.d),c)):pu:w(E,t,e,u,m(Bu,n,a),o):w(E,t,e,u,m(Bu,n,a),o):m(Tu,n,G(Cu,n,r,t,e,u,a,o)))}),Tu=h(function(n,r){var t,e,u,a,o;return-1===r.$?(t=r.a,e=r.c,u=r.d,a=r.e,y(n,r=r.b)?-1===(o=function(n){for(;;){if(-1!==n.$||-1!==n.d.$)return n;n=n.d}}(a)).$?w(ju,t,o.b,o.c,u,_e(a)):pu:w(ju,t,r,e,u,m(Bu,n,a))):pu}),Lu=h(function(n,r){n=m(Bu,n,r);return-1!==n.$||n.a?n:w(E,1,n.b,n.c,n.d,n.e)}),Eu=g(function(n,r,t){r=r(m(xu,n,t));return r.$?m(Lu,n,t):p(Nu,n,r.a,t)}),Ou={$:0},Su=g(function(n,r,t){return r(n(t))}),Ju=_n,Mu=h(function(n,r){return p(qr,"",Vr,m(Su,r,n))}),Ru=h(function(n,r){return r.$?$(n(r.a)):it(r.a)}),Du={$:2},Hu={$:1},qu=h(function(n,r){switch(r.$){case 0:return $({$:0,a:r.a});case 1:return $(Hu);case 2:return $(Du);case 3:return $({$:3,a:r.a.bI});default:return m(Ru,Ne,n(r.b))}}),Pu=h(function(n,r){return m(Mu,n,qu(function(n){return m(Ru,kt,m(Ju,r,n))}))}),Fu=function(n){return{$:1,a:n}},Gu=h(function(n,r){return{aY:n,a6:r}}),I=ee(m(Gu,wu,x)),Iu=function(t){return{$:2,b:function(n){var r=t.f;2===r.$&&r.c&&r.c(),t.f=null,n({$:0,a:Y})},c:null}},Wu=Pn,zu=g(function(t,n,e){for(;;){if(!n.b)return ee(e);var u,r=n.a,a=n.b;if(r.$)return u=r.a,m(oe,function(n){var r=u.a8;return p(zu,t,a,1===r.$?e:p(Nu,r.a,n,e))},Wu(p(Hr,t,fe(t),u)));var o=r.a,r=m(xu,o,e);if(1!==r.$)return m(oe,function(n){return p(zu,t,a,m(Lu,o,e))},Iu(r.a));t=t,n=a,e=e}}),en=n(function(n,r,t,e){return m(oe,function(n){return ee(m(Gu,n,t))},p(zu,n,r,e.aY))}),Qu=g(function(n,r,t){n=n(r);return n.$?t:m(v,n.a,t)}),Xu=h(function(n,r){return p(ae,Qu(n),x,r)}),Vu=n(function(n,r,t,e){var u=e.b;return y(r,e.a)?_(m(fe,n,u(t))):N}),W=g(function(n,r,t){return m(oe,function(n){return ee(t)},Yr(m(Xu,p(Vu,n,r.a,r.b),t.a6)))}),pn=h(function(n,r){var t;return r.$?Fu({bf:(t=r.a).bf,bh:t.bh,at:m(Pr,n,t.at),aJ:t.aJ,bx:t.bx,bM:t.bM,a8:t.a8,aB:t.aB}):{$:0,a:r.a}}),Yu=h(function(n,r){return{$:0,a:n,b:r}}),vn=h(function(n,r){return m(Yu,r.a,m(Su,r.b,n))}),Uu=(d.Http={b:I,c:en,d:W,e:pn,f:vn},Yn("Http")),Ku=(Yn("Http"),i(function(n,r,t,e,u,a){return m(Le,r,{bh:a,at:m(Pu,m(Su,Ce,e),u),aJ:r.aJ,bx:n,bM:r.bM,a8:r.a8,aB:t})})),ln=n(function(n,r,t,e){return F(Ku,"GET",n,r,t,e,Ou)}),kn=h(function(n,r){return{$:0,a:n,b:r}}),xn={aJ:j([m(kn,"Accept","application/json")]),P:!1,bM:N,a8:N},jn=m(kn,"Cache-Control","no-store, must-revalidate, no-cache, max-age=0"),Zu=ln(k(xn,{aJ:m(v,jn,xn.aJ)})),na=function(n){return{$:20,a:n}},gn=h(function(n,r){return{a:n,c:r}}),Xn=p(Ft,gn,m(u,"id",t),m(u,"short_name",fu)),ra=bn(Xn),O=ve(x),yn=function(n){return{$:5,c:n}},ta=Un(x),ea={$:4},ua={$:0},aa={$:3},oa=h(function(n,r){for(;;){if(!r.b)return!1;var t=r.b;if(n(r.a))return!0;n=n,r=t}}),S=h(function(n,r){for(;;){if(!r.b)return N;var t=r.a,e=r.b;if(n(t))return _(t);n=n,r=e}}),ia=h(function(n,r){return r.$?N:_(n(r.a))}),J=h(function(n,r){return r.$?n:r.a}),ca=h(function(n,r){function t(n){return y(n.g,_(r))?k(n,{g:N}):n}return m(T,function(n){return k(n,{f:m(T,t,n.f)})},n)}),fa=(K=Vr,tr(Sn="dragstart"),d[Sn]={e:er,u:K,a:ur},Yn(Sn)),ba=h(function(r,n){return m(S,function(n){return y(n.m,r)},n)}),sa=n(function(n,r,t,e){return{$:0,a:n,b:r,c:t,d:e}}),z=r(function(a,n,r,t,e){var o=n,i=r,c=t,f=e;return function(n){var n=o(n),r=n.a,n=i(n.b),t=n.a,n=c(n.b),e=n.a,n=f(n.b),u=n.b;return{a:l(a,r,t,e,n.a),b:u}}}),da=tn(0),sn=m(Ke,da,m(nu,-2147483648,2147483647)),dn=h(function(n,r){var t=r.c,e=r.d;return l(sa,r.a,da(n<<12|4294905855&r.b),t,e)}),la=m(Ke,m(Su,dn(4),function(n){var r=n.d;return l(sa,n.a,n.b,da(2147483648|1073741823&n.c),r)}),w(z,sa,sn,sn,sn,sn)),va={$:0},$a=h(function(n,r){switch(r.$){case 3:return{$:3,a:n(r.a)};case 1:return le;case 0:return va;default:return{$:2,a:r.a}}}),ha=h(function(n,r){var t;return r.b?(t=r.b,y(n,r=r.a)?t:m(v,r,m(ha,n,t))):x}),ga=Jn,ma=Jn,pa=h(function(n,r){return p(lt,function(t){return h(function(n,r){return r.push(t(n)),r})}(n),[],r)}),wa=null,ya=function(n){return p(lt,h(function(n,r){return p(Mn,n.a,n.b,r)}),{},n)},ka=Jn,An=i(function(n,r,t,e,u,a){return F(Ku,n,r,t,e,u,m(Fr,"application/json",m(bt,0,a)))}),Aa=An("PATCH")(xn),xa=An("POST")(xn),ja=h(function(n,r){var t,n=n.M,e=g(function(n,r,t){return l(n,r,pe,su,Me(t))});return 3===r.$?(t=(r=r.a).a).$?p(e,xa,n+"brackets",r):p(e,Aa,n+("brackets/"+C(t.a)),r):O}),_a=rn,Na=on,Ca=g(function(n,r,t){return 0>1,A(r,r),1&n?A(t,r):t):t}),Ba=h(function(n,r){return p(Ca,n,r,"")}),Ta=g(function(n,r,t){return A(m(Ba,n-Qt(t),function(n){return m(Na,n,"")}(r)),t)}),La=function(n){return Z(n).join("")},Ea=h(function(n,r){for(;;){if(!r)return La(n);var t=function(){switch(15&r){case 0:return"0";case 1:return"1";case 2:return"2";case 3:return"3";case 4:return"4";case 5:return"5";case 6:return"6";case 7:return"7";case 8:return"8";case 9:return"9";case 10:return"a";case 11:return"b";case 12:return"c";case 13:return"d";case 14:return"e";default:return"f"}}();n=m(v,t,n),r=r>>>4}}),Oa=h(function(n,r){var t=r.b,e=r.c,u=r.d;return A(p(Ta,8,"0",m(Ea,x,r.a)),A(n,A(p(Ta,4,"0",m(Ea,x,t>>>16)),A(n,A(p(Ta,4,"0",m(Ea,x,65535&t)),A(n,A(p(Ta,4,"0",m(Ea,x,e>>>16)),A(n,A(p(Ta,4,"0",m(Ea,x,65535&e)),p(Ta,8,"0",m(Ea,x,u)))))))))))})("-"),Sa=function(n){return n.toUpperCase()},Ja=n(function(n,r,t,e){return{$:2,a:n,b:r,c:t,d:e}}),Ma=g(function(n,r,t){var e,u={a:r,b:t,c:n};n:for(;;)switch(u.a.$){case 0:return{a:{$:1,a:s=u.a.a},b:N};case 1:return{a:eu,b:N};case 2:switch(u.b.$){case 1:var a=u.a.a;return{a:l(Ja,s=u.b.a,a,0,N),b:N};case 2:var a=u.a.a,o=u.b;return{a:l(Ja,s=o.a,a,0,f=o.d),b:N};default:break n}case 3:if(2!==u.b.$||u.c)break n;return s=(e=u.b).a,y(u.a.a,a=e.b)?{a:{$:1,a:s},b:N}:{a:t,b:N};case 4:switch(u.b.$){case 1:var i=u.a,a=i.a,c=i.b,f=i.c;return{a:l(Ja,s=u.b.a,a,c,_(f)),b:N};case 2:var i=u.a,a=i.a,c=i.b,f=i.c,b=u.b,s=b.a;return y(c,b.c)?{a:t,b:N}:{a:l(Ja,s,a,c,_(f)),b:N};default:break n}default:switch(u.b.$){case 1:var d=u.a,a=d.a,f=d.b;return{a:eu,b:_({a:s=u.b.a,b:a,c:f})};case 2:d=u.a,a=d.a,f=d.b;return{a:eu,b:_({a:s=u.b.a,b:a,c:f})};default:break n}}return{a:t,b:N}})(!1),Ra=g(function(r,t,n){return m(T,function(n){return r(n)?t(n):n},n)}),wn=h(function(n,i){switch(n.$){case 0:var r=Oa(m(Ye,la,n.a).a);return{a:k(i,{an:_(r)}),b:O};case 1:var r=n.a,t=m(Ma,r,i.H),c=t.a,f=t.b;return{a:function(){for(;;){if(f.$)break;if(f.a.a.$){var r,t,e,u;if(1===f.a.b.$)return r=(n=f.a).a.a,t=(n=n.b.a).a,e=n.b,u=function(n){return y(n.a,t)?k(n,{f:m(T,function(n){return y(n.aa,e)?k(n,{g:_(r)}):n},n.f)}):n},k(i,{b:m($a,function(n){return k(n,{d:Oe(m(T,u,m(ca,n.d,r)))})},i.b),i:!0,H:c});break}var n,a,o;if(f.a.b.$)break;return a=(n=f.a).a.a,o=n.b.a,k(i,{b:m($a,function(n){return k(n,{d:p(Ra,function(n){return y(n.a,a)},function(n){return k(n,{m:o})},n.d)})},i.b),i:!0,H:c})}return k(i,{H:c})}(),b:m(J,O,m(ia,m(Su,function(n){return n.bn},fa),function(n){return n.$?N:_({bl:n.a,bn:n.b})}(r)))};case 2:return{a:k(i,{e:_(ua)}),b:O};case 3:var e=n.a;return{a:k(i,{b:m($a,l=function(n){return k(n,{c:e})},i.b),i:!0}),b:O};case 4:return{a:k(i,{i:!0,e:N}),b:O};case 5:return{a:k(i,{b:m($a,l=function(n){var r=Ir(n.n)+1,r=p($e,r,"Group "+C(r),!0);return k(n,{n:A(n.n,j([r]))})},i.b),i:!0}),b:O};case 6:return{a:k(i,{e:_({$:1,a:o=n.a})}),b:O};case 7:var u=k(o=n.a,{as:!o.as}),a=function(n){return p(Ra,function(n){return y(n.a,u.a)},function(n){return u},n)};return{a:k(i,{b:m($a,l=function(n){return k(n,{n:a(n.n)})},i.b),i:!0}),b:O};case 8:u=k(o=n.a,{c:e=n.b});return{a:k(i,{e:_({$:1,a:u})}),b:O};case 9:var o=n.a,a=function(n){return p(Ra,function(n){return y(n.a,o.a)},function(n){return o},n)};return{a:k(i,{b:m($a,l=function(n){return k(n,{n:a(n.n)})},i.b),i:!0,e:N}),b:O};case 10:o=n.a;return{a:k(i,{b:m($a,l=function(n){return k(n,{n:m(ha,o,n.n)})},i.b),i:!0,e:N}),b:O};case 11:var b=n.a;return{a:k(i,{b:m($a,l=function(n){return k(n,{d:1!==m(ba,b,n=n.d).$||(r=i.an).$?n:A(n,j([G(ou,N,r.a,N,!1,b,0,j([w(iu,0,!1,N,N,N),w(iu,1,!0,N,N,N)]))]))});var r},i.b),i:!0}),b:tu};case 12:var s=n.a,d=function(t){return y(t.a,s.a)?k(t,{am:!0,f:x}):k(t,{f:m(T,function(n){var r=n.g;n:for(;;){if(r.$)break;switch(r.a.$){case 1:case 2:return y(r.a.a,t.a)?k(n,{g:N}):n;default:break n}}return n},t.f)})};return{a:k(i,{b:m($a,l=function(n){return k(n,{d:m(T,d,n.d)})},i.b),i:!0,e:N}),b:O};case 13:return{a:k(i,{e:_({$:2,a:s=n.a})}),b:O};case 14:var e=n.a,d=h(function(n,r){var t=""===e?N:_(e);return k(r,{al:m(oa,function(n){var r,n={a:n.c,b:t};return!n.a.$&&!n.b.$&&(r=n.b.a,y(Sa(n.a.a),Sa(r)))},n)?_("Name is already being used."):N,c:t})}),l=h(function(r,t){return k(t,{d:p(Ra,function(n){return y(n.a,r.a)},function(n){return m(d,t.d,r)},t.d)})});return{a:!(t=i.e).$&&2===t.a.$&&(t=t.a.a,3===(r=i.b).$)?k(i,{b:{$:3,a:m(l,t,r=r.a)},i:!0,e:_({$:2,a:m(d,r.d,t)})}):i,b:O};case 15:var v=n.a,$=n.b,d=g(function(o,i,n){var r=function(){var n=m(dt,"_",$);if(!n.b)return N;var r,t=n.a,e=n.b,u=(n=Se(e)).$||(n=Kt(n.a)).$||(r=n.a,(n=m(S,function(n){return y(n.a,r)},o)).$)?N:_(n.a.a),a=function(){var r,n=Se(e);return n.$||(r=n.a,(n=m(S,function(n){return y(n.a,r)},i)).$)?N:_(n.a.a)}();switch(t){case"team":return m(ia,ye,u);case"winner":return m(ia,ke,a);case"loser":return m(ia,we,a);default:return N}}();return k(n,{f:m(T,function(n){return y(n.aa,v)?k(n,{g:r,B:r.$||r.a.$?N:_(r.a.a)}):n},n.f)})}),l=g(function(r,t,e){return k(e,{d:Oe(m(T,function(n){return y(n.a,r.a)?p(d,t,e.d,r):n},e.d))})});return{a:function(){var n,r,t={a:i.e,b:i.ac,c:i.b};return t.a.$||2!==t.a.a.$||3!==t.b.$||3!==t.c.$?i:k(i,{b:{$:3,a:p(l,n=t.a.a.a,r=t.b.a,t=t.c.a)},i:!0,e:_({$:2,a:p(d,r,t.d,n)})})}(),b:O};case 16:return{a:k(i,{e:N}),b:O};case 17:return{a:k(i,{i:!1}),b:m(ja,i.V,i.b)};case 18:return{a:k(i,{e:_(aa)}),b:O};case 19:return{a:k(i,{b:le,i:!1,e:N}),b:Ee(i.V)};case 20:return{a:k(i,{ac:f=n.a}),b:O};case 21:return{a:k(i,{b:m($a,l=function(n){return k(n,{n:m(_a,function(n){return n.a},n.n)})},f=n.a)}),b:O};case 22:return{a:k(i,{e:_(ea)}),b:O};case 23:return{a:k(i,{b:m($a,function(n){return m(he,n.a,n.c)},i.b),i:!0,e:N}),b:O};default:return{a:k(i,{e:N}),b:O}}}),Da=h(function(n,r){return m(sr,n,ka(r))}),M=Da("className"),Ha=f("h3"),qa=f("p"),R=ir,Pa={$:5},Fa={$:17},Ga=f("a"),Ia=f("button"),Wa=h(function(t,n){return p(ae,h(function(n,r){return t(n)?m(v,n,r):r}),x,n)}),mn=h(function(n,r){return m(sr,n,ga(r))}),za=mn("disabled"),D=f("div"),Qa=fr,Xa=h(function(n,r){return m(Qa,n,{$:0,a:r})}),Va={$:2},Ya=f("h2"),Ua=h(function(r,n){return m(J,4,qe(m(T,function(n){return n.m.Q+3},m(Wa,function(n){return y(n.m.X,r.a)},n))))}),Ka=f("table"),Za={$:1},no=h(function(n,r){return{$:0,a:n,b:r}}),ro=h(function(n,r){return m(dr,function(n){return/^(on|formAction$)/i.test(n)?"data-"+n:n}(n),function(n){return/^\s*(javascript:|data:text\/html)/i.test(n)?"":n}(r))}),to=g(function(n,r,t){return n(r(t))}),eo=h(function(n,r){return m(Qa,n,{$:3,a:r})}),uo=g(function(n,r,t){var e=r.aA,u=r.aw;return m(eo,n,m(a,function(n){return{E:n,aw:u,aA:e}},t))}),ao=hn,oo=h(function(n,r){return j([m(ro,"draggable","true"),p(uo,"dragstart",{aw:!1,aA:!0},m(a,m(to,n,no(r)),ao)),p(uo,"dragend",{aw:!1,aA:!0},e(n(Za)))])}),io=br,co=h(function(r,n){function t(n){return!r.$&&1===r.a.$&&y(n,r.a.a)}return j([m(D,A(j([He(j([{a:"game-result-connector",b:!0},{a:"dragging-connector",b:t({$:1,a:n})}]))]),m(oo,Pe,{$:1,a:{$:1,a:n}})),j([m(D,j([M("game-result-connector-icon game-result-connector-winner")]),j([R("W")]))])),m(D,A(j([He(j([{a:"game-result-connector",b:!0},{a:"dragging-connector",b:t({$:2,a:n})}]))]),m(oo,Pe,{$:1,a:{$:2,a:n}})),j([m(D,j([M("game-result-connector-icon game-result-connector-loser")]),j([R("L")]))]))])}),fo=g(function(n,r,t){return{$:4,a:n,b:r,c:t}}),bo=h(function(n,r){return{$:5,a:n,b:r}}),Or=n(function(n,r,t,e){return{aK:r,ba:n,bb:t,bc:e}}),Vn=h(function(n,r){return p(ae,u,r,n)}),V=$n,_n=un,so=w(Mr,Or,m(Vn,j(["currentTarget","clientWidth"]),t),m(Vn,j(["currentTarget","clientHeight"]),t),m(a,_n,m(Vn,j(["offsetX"]),V)),m(a,_n,m(Vn,j(["offsetY"]),V))),lo=m(a,_n,m(Vn,j(["timeStamp"]),V)),vo=h(function(n,r){return j([p(uo,"dragenter",{aw:!0,aA:!0},e(n({$:2,a:r}))),p(uo,"dragleave",{aw:!0,aA:!0},e(n({$:3,a:r}))),p(uo,"dragover",{aw:!0,aA:!1},m(a,n,p(Ft,fo(r),lo,so))),p(uo,"drop",{aw:!0,aA:!0},m(a,m(to,n,bo(r)),so))])}),$o=c(function(n,r,a,o,t,e,i){var u=e?{a:"game-bottom",b:!0}:{a:"game-top",b:!0},c=function(){var n=i.g;if(n.$)return"TBD";switch(n.a.$){case 0:var r=n.a.a,t=m(S,function(n){return y(n.a,r)},a);return t.$?"TBD":t.a.c;case 1:var r=n.a.a,t=m(S,function(n){return y(n.a,r)},o);return t.$?"TBD":(e=t.a,(t=i.B).$?"W: "+m(J,"TDB",e.c):(u=t.a,m(J,m(J,"",e.c),m(ia,function(n){return n.c},m(S,function(n){return y(n.a,u)},a)))));default:var e,u,r=n.a.a,t=m(S,function(n){return y(n.a,r)},o);return t.$?"TBD":(e=t.a,(t=i.B).$?"L: "+m(J,"TDB",e.c):(u=t.a,m(J,m(J,"",e.c),m(ia,function(n){return n.c},m(S,function(n){return y(n.a,u)},a)))))}}(),r=!(t.S&&!y(i.g,N)||(n={a:n,b:r}).a.$||1!==n.a.a.$||n.b.$||1!==n.b.a.$||!y(n.b.a.a,{a:t.a,b:e}));return m(D,A(j([He(j([u,{a:"drop-target",b:r}]))]),m(vo,Pe,{$:1,a:{a:t.a,b:e}})),j([R(c)]))}),ho=r(function(t,e,u,a,o){var n=!t.$&&!t.a.$&&y(t.a.a,o.a);return m(D,A(j([He(j([{a:"game",b:!0},{a:"dragging-game",b:n}])),m(io,"left",C(50*o.m.N)+"px"),m(io,"top",C(50*o.m.Q)+"px"),Fe({$:13,a:o})]),m(oo,Pe,{$:0,a:o.a})),j([m(D,j([M("d-flex game-header")]),j([m(D,j([M("game-name flex-fill")]),j([R(m(J,"TDB",o.c))])),2===o.S?R(""):m(D,j([M("game-delete align-self-end"),L({$:12,a:o})]),j([R("✘")]))])),m(D,j([M("game-body d-flex")]),j([m(D,j([M("game-positions flex-fill")]),m(gt,h(function(n,r){return G($o,t,e,u,a,o,n,r)}),o.f)),m(D,j([M("align-self-end ml-1")]),m(co,t,o.a))]))]))}),go=r(function(n,r,t,e,u){return m(D,j([M("games")]),m(T,l(ho,n,r,t,e),u))}),mo=f("tr"),po=f("td"),wo=i(function(n,r,t,e,u,a){e=p(au,e.a,a,u),u=!((a={a:r,b:t}).a.$||a.a.a.$||a.b.$||a.b.a.$||!y(a.b.a.a,e)),r=Ie(n.d);m(ba,e,r);return m(po,A(j([m(io,"width",C(50)+"px"),m(io,"height",C(50)+"px"),He(j([{a:"drop-target",b:u}]))]),A(m(vo,Pe,{$:0,a:e}),j([Fe({$:11,a:e})]))),j([R("")]))}),yo=r(function(n,r,t,e,u){var a=Ie(n.d);return m(mo,x,m(T,w(wo,n,r,t,e,u),m(ht,0,Ge(a)-1)))}),ko=g(function(n,r,t){return{W:r,aH:n,ae:t}}),Ao=h(function(n,r){return r.b?p(ae,v,r,n):n}),xo=dr("fill"),jo=dr("height"),_o=dr("points"),I=cr("http://www.w3.org/2000/svg"),No=I("polyline"),Co=dr("stroke"),Bo=dr("stroke-dasharray"),To=dr("stroke-opacity"),Lo=I("svg"),Eo=dr("width"),Oo=h(function(n,i){function r(n){return C(n.a)+(","+C(n.b))+" "}var t=m(Xu,Vr,(t=m(T,function(o){var n=h(function(n,r){var t=_({a:50*o.m.N+1,b:50*o.m.Q+(n?57:32)}),e=h(function(r,n){var t=m(S,function(n){return y(n.a,r)},i);return t.$?N:_({a:50*(t=t.a).m.N+175,b:50*t.m.Q+(n?57:32)})}),u=r.g;n:for(;;){if(u.$)break;switch(u.a.$){case 1:var a={a:m(e,u.a.a,0),b:t};return a.a.$||a.b.$?N:_(p(ko,0,a.a.a,a.b.a));case 2:a={a:m(e,u.a.a,1),b:t};return a.a.$||a.b.$?N:_(p(ko,1,a.a.a,a.b.a));default:break n}}return N});return m(gt,n,o.f)},i),p(ae,Ao,x,t)));return m(D,j([M("group-lines")]),j([m(Lo,j([Eo(C(50*(Ge(i)+1))),jo(C(50*(m(Ua,n,i)-1)))]),m(T,function(n){return m(No,j([xo("none"),To("0.5"),Bo("3"),Co(n.aH?"red":"green"),_o(A(r({a:n.W.a+6,b:n.W.b}),A(r({a:n.W.a+11,b:n.W.b}),A(r({a:n.ae.a-8,b:n.ae.b}),r({a:n.ae.a-3,b:n.ae.b})))))]),x)},t))]))}),So=r(function(n,r,t,e,u){var a=Ie(r.d),o=m(Wa,function(n){return y(n.m.X,u.a)},a);return m(D,j([M("group-container")]),j([m(D,j([M("d-flex")]),j([m(D,j([M("group-name btn btn-default"),L({$:7,a:u})]),j([R("☷ "+u.c)])),m(D,j([M("btn btn-default px-0"),L({$:6,a:u})]),j([R("✎")]))])),m(D,j([M("group")]),j(u.as?[m(Oo,u,o),m(Ka,x,m(T,l(yo,r,t,e,u),m(ht,0,m(Ua,u,a)-1))),w(go,t,e,n,a,o)]:[m(D,j([M("text-muted group-hide")]),j([R("...")]))]))]))}),Jo=n(function(n,r,t,e){return m(D,x,m(T,l(So,n,r,t,e),r.n))}),en={$:24},Mo=f("h5"),Ro=m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Confirm Clear")]))])),m(D,j([M("modal-body")]),j([m(qa,x,j([R("DANGER: This will empty out the bracket so you can start over. Nothing will be saved until you click the Save button, but you will lose any changes made since the last save. Are you sure you want to continue?")]))])),m(D,j([M("modal-footer")]),j([m(Ia,j([L({$:23}),M("btn btn-danger mr-2")]),j([R("Continue")])),m(Ia,j([L(en),M("btn btn-secondary mr-2")]),j([R("Cancel")]))]))])),Do={$:4},Ho=Da("id"),qo=f("input"),Po=h(function(n,r){return m(Qa,n,{$:1,a:r})}),Fo=m(Vn,j(["target","value"]),fu),Go=Da("title"),Io=function(n){return n.trim()},Wo=Da("value"),zo={$:16},Qo=h(function(n,r){return{$:15,a:n,b:r}}),Xo=Da("htmlFor"),Vo=f("i"),Yo=f("label"),Uo=f("option"),Ko=f("select"),Zo=mn("selected"),ni=g(function(n,r,e){var t,u,a=g(function(n,r,t){r=!(r=r.g).$&&!r.a.$&&y(r.a.a,t.a);return m(Uo,j([Wo("team_"+C(t.a)),Zo(r)]),j([R(t.c)]))}),o=Ie(r.d),i=(r=A(m(T,function(n){return _({$:1,a:n.a})},o),m(T,function(n){return _({$:2,a:n.a})},o)),m(Xu,Vr,m(Wa,function(r){function t(n){return y(r,n.g)}return 1===r.$||!r.a.$||!m(Wa,function(n){return!y(n.a,e.a)&&!!m(Wa,t,n.f).b},o).b},m(Wa,function(n){return!(y(n,_({$:1,a:e.a}))||y(n,_({$:2,a:e.a})))},r)))),c=(t=m(Wa,function(n){return!y(n.a,e.a)},o),u=h(function(r,n){return m(oa,function(n){n=n.g;return!n.$&&!n.a.$&&y(n.a.a,r.a)},n.f)}),m(Wa,function(n){return!m(Wa,u(n),t).b},n)),f=g(function(n,r,t){var e=function(){function n(r){return m(ia,function(n){return m(J,"TBD",n.c)},m(S,function(n){return y(n.a,r)},o))}switch(t.$){case 1:return _("Winner of "+m(J,"TBD",n(t.a)));case 2:return _("Loser of "+m(J,"TBD",n(t.a)));default:return N}}(),u=function(){switch(t.$){case 1:return _("winner_"+t.a);case 2:return _("loser_"+t.a);default:return N}}(),r=y(r.g,_(t)),u={a:u,b:e};return u.a.$||u.b.$?R(""):(e=u.b.a,m(Uo,j([Wo(u.a.a),Zo(r)]),j([R(e)])))}),b=h(function(n,r){return A(j([m(Uo,x,x)]),A(m(T,m(a,n,r),c),m(T,m(f,n,r),i)))}),r=h(function(n,r){return m(D,j([M("form-group")]),j([m(Yo,j([Xo("editing-game")]),j([R("Team")])),m(Ko,j([M("form-control"),Ho("editing-game"),Qe(Qo(n)),za(!!e.S&&!y(r.g,N))]),m(b,n,r))]))});return m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Edit Game")]))])),m(D,j([M("modal-body")]),A(j([(n=e.al).$?R(""):(n=n.a,m(D,j([M("alert alert-danger")]),j([R(n)]))),m(D,j([M("form-group")]),j([m(Yo,j([Xo("editing-game-name")]),j([R("Game Name")])),m(qo,j([M("form-control"),Ho("editing-game-name"),Wo(m(J,"",e.c)),Qe(Xe)]),x)]))]),m(gt,r,e.f))),m(D,j([M("modal-footer d-flex justify-content-between")]),j([m(D,j([M("text-left")]),j([e.S?m(Vo,j([M("text-danger")]),j([R("Teams cannot be assigned after game starts.")])):R("")])),m(Ia,j([L(zo),M("btn btn-primary mr-2"),za(!y(e.al,N))]),j([R("Close")]))]))]))}),ri=h(function(n,r){return{$:8,a:n,b:r}}),ti=h(function(n,r){var t=""===Io(r.c),n=Ie(n.d),n=!!m(Wa,function(n){return y(n.m.X,r.a)},n).b;return m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Group Name")]))])),m(D,j([M("modal-body")]),j([m(D,j([M("form-group")]),j([m(qo,j([M("form-control"),Ho("editing-group-name"),Wo(r.c),Qe(ri(r))]),x)]))])),m(D,j([M("modal-footer d-flex justify-content-between")]),j([m(Ia,j([L({$:10,a:r}),M("btn btn-danger mr-2"),za(n),Go(n?"Remove games from this group first":"")]),j([R("Remove")])),m(Ia,j([L({$:9,a:r}),M("btn btn-primary"),za(t),Go(t?"Name is required":"")]),j([R("Close")]))]))]))}),ei=m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Confirm Revert")]))])),m(D,j([M("modal-body")]),j([m(qa,x,j([R("DANGER: This will revert all of your changes since the last save. Are you sure you want to continue?")]))])),m(D,j([M("modal-footer")]),j([m(Ia,j([L({$:19}),M("btn btn-danger mr-2")]),j([R("Continue")])),m(Ia,j([L(en),M("btn btn-secondary mr-2")]),j([R("Cancel")]))]))])),ui=g(function(t,e,u){return m(D,j([M("modal"),m(io,"display","block")]),j([m(D,j([M("modal-dialog")]),j([function(){if(t.$)return R("");switch(t.a.$){case 0:return r=""===Io(n=u.c),m(D,j([M("modal-content")]),j([m(D,j([M("modal-header")]),j([m(Mo,j([M("modal-title")]),j([R("Bracket Name")]))])),m(D,j([M("modal-body")]),j([m(D,j([M("form-group")]),j([m(qo,j([M("form-control"),Ho("editing-bracket-name"),Wo(n),Qe(We)]),x)]))])),m(D,j([M("modal-footer d-flex justify-content-between")]),j([m(Ia,j([L(Do),M("btn btn-primary"),za(r),Go(r?"Name is required":"")]),j([R("Close")]))]))]));case 1:return m(ti,u,t.a.a);case 2:return p(ni,e,u,t.a.a);case 3:return ei;default:return Ro}var n,r}()]))]))}),ai=g(function(n,r,t){var e,u=n.V,a=n.e,o=n.H,n=n.i,i=!y(a,N),c=function(n){switch(n.$){case 0:return N;case 1:return N;default:return _(n.b)}}(o),o=function(n){switch(n.$){case 0:return N;case 1:return _(r=n.a);default:var r=n.a;return _(r)}}(o);return m(D,j([He(j([{a:"modal-open",b:i}]))]),j([m(D,j([M("py-3")]),j([(e=t.c,m(D,j([M("d-flex bracket-name")]),j([m(Ya,j([L(Va)]),j([R(e)])),m(Ya,j([M("ml-2"),L(Va)]),j([R("✎")]))]))),l(Jo,r,t,o,c),m(Ia,j([M("btn btn-primary"),L(Pa)]),j([R("Add Group")])),i?p(ui,a,r,t):m(D,j([M("save-buttons")]),j([m(Ia,j([M("btn btn-primary mr-1"),za(!n),L(Fa)]),j([R("Save")])),m(Ga,j([M("btn btn-secondary"),(e=u.M+"stages",m(Da,"href",/^javascript:/i.test((e=e).replace(/\s/g,""))?"":e))]),j([R("Exit")]))]))])),m(D,j([He(j([{a:"modal-backdrop",b:i},{a:"show",b:i}]))]),x)]))}),W=nn({bv:function(n){return{a:{b:n.a.$?{$:3,a:m(he,N,"Playoffs")}:le,i:!1,H:uu,V:n,an:N,e:N,ac:le},b:ve(j([function(n){return p(Zu,n.M+"teams",na,ra)}(n),n.a.$?O:Ee(n),tu]))}},bL:function(n){return ta},bO:wn,bP:function(n){var r={a:n.ac,b:n.b};n:for(;;){r:for(;;){t:for(;;){e:for(;;)switch(r.a.$){case 3:switch(r.b.$){case 3:return p(ai,n,r.a.a,r.b.a);case 0:break n;case 1:break t;default:var t=r.b.a;return m(qa,j([M("mt-5 text-center text-danger")]),j([R(Re(t))]))}case 0:return m(Ha,j([M("mt-5 text-center")]),j([R("Initializing...")]));case 1:if(0!==r.b.$)break r;break n;default:switch(r.b.$){case 0:break n;case 1:break t;default:break e}}t=r.a.a;return m(qa,j([M("mt-5 text-center text-danger")]),j([R(Re(t))]))}return m(Ha,j([M("mt-5 text-center")]),j([R("Loading...")]))}return m(Ha,j([M("mt-5 text-center")]),j([R("Loading...")]))}return m(Ha,j([M("mt-5 text-center")]),j([R("Initializing...")]))}});pn={BracketBuilder:{init:W(m(Pt,function(r){return m(Pt,function(n){return e({M:n,a:r})},m(u,"baseUrl",fu))},m(u,"id",cu(j([yn(N),m(a,_,t)])))))(0)}},o.Elm?function n(r,t){for(var e in t)e in r?"init"==e?Q(6):n(r[e],t[e]):r[e]=t[e]}(o.Elm,pn):o.Elm=pn}(this); \ No newline at end of file diff --git a/src/BracketBuilder.elm b/src/BracketBuilder.elm index b988cb3..93c28be 100644 --- a/src/BracketBuilder.elm +++ b/src/BracketBuilder.elm @@ -1496,7 +1496,7 @@ viewEditGame teams bracket game = [ class "form-control" , id "editing-game" , onInput (UpdateSide index) - , disabled (game.state /= GamePending) + , disabled (game.state /= GamePending && side.assignment /= Nothing) ] (assignmentOptions index side) ] @@ -1736,8 +1736,8 @@ viewSide dragId dropId teams games onGame position side = ( "game-bottom", True ) dropTarget = - if onGame.state == GamePending then - -- Only allow assignments for games that haven't started. + if onGame.state == GamePending || side.assignment == Nothing then + -- Only allow assignments for games that haven't started or is missing a team. case ( dragId, dropId ) of ( Just (DraggableResult _), Just (DroppableSide gameIdAndPosition) ) -> if gameIdAndPosition == ( onGame.id, position ) then